diff options
Diffstat (limited to 'backends/PalmOS/Src/missing/ext_string.c')
-rw-r--r-- | backends/PalmOS/Src/missing/ext_string.c | 82 |
1 files changed, 3 insertions, 79 deletions
diff --git a/backends/PalmOS/Src/missing/ext_string.c b/backends/PalmOS/Src/missing/ext_string.c index a02c360ceb..319017f790 100644 --- a/backends/PalmOS/Src/missing/ext_string.c +++ b/backends/PalmOS/Src/missing/ext_string.c @@ -24,6 +24,7 @@ #include <string.h> +#ifdef PALMOS_68K void *memchr(const void *s, int c, UInt32 n) { UInt32 chr; for(chr = 0; chr < n;chr++,((UInt8 *)s)++) @@ -33,84 +34,6 @@ void *memchr(const void *s, int c, UInt32 n) { return NULL; } -UInt32 strspn(const char *s1, const char *s2) { - UInt32 chr = 0; - - while ( chr < strlen(s1) && - strchr(s2, s1[chr]) ) - chr++; - - return chr; -} - -static Char *StrTokNext = NULL; - -Char *strtok(Char *str, const Char *sep) { - Char *position = NULL, - *found, - *end; - - UInt16 loop = 0, - chars= StrLen(sep); - - str = (str)?(str):(StrTokNext); - StrTokNext = NULL; - - if (!str) - return NULL; - - end = str+StrLen(str); - - while (loop<chars) - { - found = StrChr(str,sep[loop]); - loop++; - - if (found == str) - { - str++; - loop = 0; - } - else if (position == NULL || position > found) - position = found; - } - - if (position == NULL) - if (str==end) - return NULL; - else - return str; - - position[0] = 0; - StrTokNext = position+1; - - return str; -} - -Char *strpbrk(const Char *s1, const Char *s2) { - Char *found; - UInt32 n; - - for (n=0; n <= StrLen(s2); n++) { - found = StrChr(s1, s2[n]); - if (found) - return found; - } - - return NULL; -} - -Char *strrchr(const Char *s, int c) { - UInt32 chr; - UInt32 n = StrLen(s); - - for(chr = n; chr >= 0; chr--) - if ( *((UInt8 *)s+chr) == c) - return (Char *)(s+chr); - - return NULL; -} - Char *strdup(const Char *s1) { Char* buf = (Char *)MemPtrNew(StrLen(s1)+1); @@ -118,4 +41,5 @@ Char *strdup(const Char *s1) { StrCopy(buf, s1); return buf; -}
\ No newline at end of file +} +#endif |