From 946085efa5b9b949664ab94fcda302914936a1c5 Mon Sep 17 00:00:00 2001 From: Clint Adams Date: Tue, 19 Sep 2000 15:54:30 +0000 Subject: 12846: moved simple string manipulation functions to string.c --- Src/utils.c | 80 ------------------------------------------------------------- 1 file changed, 80 deletions(-) (limited to 'Src/utils.c') diff --git a/Src/utils.c b/Src/utils.c index 3ffb4388a..4ec73d7be 100644 --- a/Src/utils.c +++ b/Src/utils.c @@ -3437,86 +3437,6 @@ strsfx(char *s, char *t) return 0; } -/**/ -mod_export char * -dupstrpfx(const char *s, int len) -{ - char *r = zhalloc(len + 1); - - memcpy(r, s, len); - r[len] = '\0'; - return r; -} - -/**/ -mod_export char * -ztrduppfx(const char *s, int len) -{ - char *r = zalloc(len + 1); - - memcpy(r, s, len); - r[len] = '\0'; - return r; -} - -/* Append a string to an allocated string, reallocating to make room. */ - -/**/ -mod_export char * -appstr(char *base, char const *append) -{ - return strcat(realloc(base, strlen(base) + strlen(append) + 1), append); -} - -/* concatenate s1, s2, and s3 in dynamically allocated buffer */ - -/**/ -mod_export char * -tricat(char const *s1, char const *s2, char const *s3) -{ - /* This version always uses permanently-allocated space. */ - char *ptr; - size_t l1 = strlen(s1); - size_t l2 = strlen(s2); - - ptr = (char *)zalloc(l1 + l2 + strlen(s3) + 1); - strcpy(ptr, s1); - strcpy(ptr + l1, s2); - strcpy(ptr + l1 + l2, s3); - return ptr; -} - -/**/ -mod_export char * -zhtricat(char const *s1, char const *s2, char const *s3) -{ - char *ptr; - size_t l1 = strlen(s1); - size_t l2 = strlen(s2); - - ptr = (char *)zhalloc(l1 + l2 + strlen(s3) + 1); - strcpy(ptr, s1); - strcpy(ptr + l1, s2); - strcpy(ptr + l1 + l2, s3); - return ptr; -} - -/* concatenate s1 and s2 in dynamically allocated buffer */ - -/**/ -mod_export char * -dyncat(char *s1, char *s2) -{ - /* This version always uses space from the current heap. */ - char *ptr; - size_t l1 = strlen(s1); - - ptr = (char *)zhalloc(l1 + strlen(s2) + 1); - strcpy(ptr, s1); - strcpy(ptr + l1, s2); - return ptr; -} - /**/ static int upchdir(int n) -- cgit v1.2.3