home *** CD-ROM | disk | FTP | other *** search
- /*
- * string.h -- ANSI
- *
- * Functions, types, and macros for manipulating strings and
- * arbitrary areas of memory.
- *
- * Copyright (c) 1990, MetaWare Incorporated
- */
-
- #ifndef _STRING_H
- #define _STRING_H
-
- #ifndef _SIZE_T_DEFINED
- #define _SIZE_T_DEFINED
- typedef unsigned int size_t;
- #endif
- #define _MAXSTRING (sizeof(int) == 2 ? 65535 : 4294967295)
- #ifndef NULL
- #define NULL ((void *)0)
- #endif
-
- extern void *memchr(const void *__s, int __c, size_t __n);
-
- #undef memcmp
- extern int memcmp(const void *__s1, const void *__s2, size_t __n);
- #ifdef __HIGHC__
- #define memcmp(s1, s2, n) (_compare(s1, s2, n))
- #endif
-
- extern void *memcpy(void *__s1, const void *__s2, size_t __n);
- extern void *memmove(void *__s1, const void *__s2, size_t __n);
- extern void *memset(void *__s, int __c, size_t __n);
-
- #ifdef __HIGHC__
- extern void * memccpy(void *, void *, int, unsigned int);
- extern int memicmp(void *, void *, unsigned int);
- extern void movedata(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int);
- #endif
-
- #undef strcat
- extern char *strcat(char *__s1, const char *__s2);
- #if 0
- /* USE THIS MACRO FOR SPEED
- * only if you don't mind multiple evaluation of the arguments.
- */
- #define strcat(s1, s2) \
- (_move(s2, ((char *)s1)+_find_char(s1, _MAXSTRING, 0), _find_char(s2,_MAXSTRING,0)+1), s1)
- #endif
-
- extern char *strchr(const char *__s, int __c);
-
- #undef strcmp
- extern int strcmp(const char *__s1, const char *__s2);
- #define strcmp(s1, s2) (strncmp(s1,s2,_MAXSTRING))
- #ifdef __HIGHC__
- extern int strcmpi(const char *s1, const char *s2);
- extern int stricmp(const char *s1, const char *s2);
- extern char *strdup(const char *s1);
- extern char *strlwr(char *s1);
- extern char *strupr(char *s1);
- #endif
-
- #undef strcpy
- extern char *strcpy(char *__s1, const char *__s2);
- #if 0
- /* USE THIS MACRO FOR SPEED
- * only if you don't mind multiple evaluation of the arguments.
- */
- #define strcpy(s1, s2) (_move(s2, s1, _find_char(s2, _MAXSTRING, 0)+1), s1)
- #endif
-
- extern size_t strcspn(const char *__s1, const char *__s2);
-
- extern size_t strlen(const char *__s);
-
- extern char *strncat(char *__s1, const char *__s2, size_t __n);
-
- extern int strncmp(const char *__s1, const char *__s2, size_t __n);
-
- #ifdef __HIGHC__
- extern int strnicmp(const char *__s1, const char *__s2, size_t __n);
- #endif
-
- extern char *strncpy(char *__s1, const char *__s2, size_t __n);
-
- #ifdef __HIGHC__
- extern char *strnset(char *__s, int __character, size_t __kount);
- #endif
-
- extern char *strpbrk(const char *__s1, const char *__s2);
-
- extern char *strrchr(const char *__s, int __c);
-
- #ifdef __HIGHC__
- extern char *strrev(char *__s);
-
- extern char *strset(char *__s, int __c);
- #endif
-
- extern size_t strspn(const char *__s1, const char *__s2);
-
- extern char * strstr(const char *__s1, const char *__s2);
-
- extern char *strtok(char *__s1, const char *__s2);
-
- #undef _rmemcpy
- extern void *_rmemcpy(void *__dest, const void *__source, size_t __n);
- #ifdef __HIGHC__
- #define _rmemcpy(dest, source, size) (_move_right(source, dest, size), dest)
- #endif
-
- #undef _rstrcpy
- extern char *_rstrcpy(char *__dest, const char *__source);
- #ifdef __HIGHC__
- #define _rstrcpy(dest, source) \
- (_move_right(source, dest, _find_char(source, _MAXSTRING, 0)+1), dest)
- #endif
-
- extern char *_rstrncpy(char *__dest, const char *__source, size_t __n);
-
- extern char *_strcats(size_t __n, char *__s1, char *__s2, ...);
- extern char *_strncat(char *__s1, const char *__s2, size_t __n);
-
- extern char * _strerror(char *);
- extern char * strerror(int __errnum);
- extern size_t strxfrm(char *__s1, const char *__s2, size_t __n);
- extern int strcoll(const char *__s1, const char *__s2);
-
- extern void * _memccpy(void *, void *, int, unsigned int);
- extern int _memicmp(void *, void *, unsigned int);
- extern void _movedata(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int);
- extern int _strcmpi(const char *s1, const char *s2);
- extern int _stricmp(const char *s1, const char *s2);
- extern char *_strdup(const char *s1);
- extern char *_strlwr(char *s1);
- extern char *_strupr(char *s1);
- extern int _strnicmp(const char *__s1, const char *__s2, size_t __n);
- extern char *_strnset(char *__s, int __character, size_t __kount);
- extern char *_strrev(char *__s);
- extern char *_strset(char *__s, int __c);
-
- extern int _compare(void *, void *, unsigned int); /* 15-Jul-92 (MJM) */
- #endif /* _STRING_H */
-