| 1 | /* string.h (emx+gcc) */ | 
|---|
| 2 |  | 
|---|
| 3 | #ifndef _EMXSTRING_H | 
|---|
| 4 | #define _EMXSTRING_H | 
|---|
| 5 |  | 
|---|
| 6 | #ifndef CRTWRAP | 
|---|
| 7 | #define CRTWRAP(a)   emx_##a | 
|---|
| 8 | #endif | 
|---|
| 9 |  | 
|---|
| 10 | #if defined (__cplusplus) | 
|---|
| 11 | extern "C" { | 
|---|
| 12 | #endif | 
|---|
| 13 |  | 
|---|
| 14 | #if !defined (_SIZE_T) | 
|---|
| 15 | #define _SIZE_T | 
|---|
| 16 | typedef unsigned long size_t; | 
|---|
| 17 | #endif | 
|---|
| 18 |  | 
|---|
| 19 | #if !defined (NULL) | 
|---|
| 20 | #if defined (__cplusplus) | 
|---|
| 21 | #define NULL 0 | 
|---|
| 22 | #else | 
|---|
| 23 | #define NULL ((void *)0) | 
|---|
| 24 | #endif | 
|---|
| 25 | #endif | 
|---|
| 26 |  | 
|---|
| 27 | #define memchr CRTWRAP(memchr) | 
|---|
| 28 | #define memcmp CRTWRAP(memcmp) | 
|---|
| 29 | #define memcpy CRTWRAP(memcpy) | 
|---|
| 30 | #define memmove CRTWRAP(memmove) | 
|---|
| 31 | #define memset CRTWRAP(memset) | 
|---|
| 32 |  | 
|---|
| 33 | void *memchr (__const__ void *, int, size_t); | 
|---|
| 34 | int  memcmp (__const__ void *, __const__ void *, size_t); | 
|---|
| 35 | void *memcpy (void *, __const__ void *, size_t); | 
|---|
| 36 | void *memmove (void *, __const__ void *, size_t); | 
|---|
| 37 | void *memset (void *, int, size_t); | 
|---|
| 38 |  | 
|---|
| 39 | #define strcat CRTWRAP(strcat) | 
|---|
| 40 | #define strchr CRTWRAP(strchr) | 
|---|
| 41 | #define strcmp CRTWRAP(strcmp) | 
|---|
| 42 | #define strcoll CRTWRAP(strcoll) | 
|---|
| 43 | #define strcpy CRTWRAP(strcpy) | 
|---|
| 44 | #define strcspn CRTWRAP(strcspn) | 
|---|
| 45 | #define strerror CRTWRAP(strerror) | 
|---|
| 46 | #define strlen CRTWRAP(strlen) | 
|---|
| 47 | #define strncat CRTWRAP(strncat) | 
|---|
| 48 | #define strncmp CRTWRAP(strncmp) | 
|---|
| 49 | #define strncpy CRTWRAP(strncpy) | 
|---|
| 50 | #define strpbrk CRTWRAP(strpbrk) | 
|---|
| 51 | #define strrchr CRTWRAP(strrchr) | 
|---|
| 52 | #define strspn CRTWRAP(strspn) | 
|---|
| 53 | #define strstr CRTWRAP(strstr) | 
|---|
| 54 | #define strtok CRTWRAP(strtok) | 
|---|
| 55 | #define strxfrm CRTWRAP(strxfrm) | 
|---|
| 56 |  | 
|---|
| 57 | char *strcat (char *, __const__ char *); | 
|---|
| 58 | char *strchr (__const__ char *, int); | 
|---|
| 59 | int strcmp (__const__ char *, __const__ char *); | 
|---|
| 60 | int strcoll (__const__ char *, __const__ char *); | 
|---|
| 61 | char *strcpy (char *, __const__ char *); | 
|---|
| 62 | size_t strcspn (__const__ char *, __const__ char *); | 
|---|
| 63 | char *strerror (int); | 
|---|
| 64 | size_t strlen (__const__ char *); | 
|---|
| 65 | char *strncat (char *, __const__ char *, size_t); | 
|---|
| 66 | int strncmp (__const__ char *, __const__ char *, size_t); | 
|---|
| 67 | char *strncpy (char *, __const__ char *, size_t); | 
|---|
| 68 | char *strpbrk (__const__ char *, __const__ char *); | 
|---|
| 69 | char *strrchr (__const__ char *, int); | 
|---|
| 70 | size_t strspn (__const__ char *, __const__ char *); | 
|---|
| 71 | char *strstr (__const__ char *, __const__ char *); | 
|---|
| 72 | char *strtok (char *, __const__ char *); | 
|---|
| 73 | size_t strxfrm (char *, __const__ char *, size_t); | 
|---|
| 74 |  | 
|---|
| 75 |  | 
|---|
| 76 | #if !defined (__STRICT_ANSI__) && !defined (_POSIX_SOURCE) | 
|---|
| 77 |  | 
|---|
| 78 | #if !defined (_MEMDIF_EQ) | 
|---|
| 79 | #define _MEMDIF_EQ 0xffffffff | 
|---|
| 80 | #endif | 
|---|
| 81 |  | 
|---|
| 82 |  | 
|---|
| 83 | #define memccpy CRTWRAP(memccpy) | 
|---|
| 84 | #define memicmp CRTWRAP(memicmp) | 
|---|
| 85 |  | 
|---|
| 86 | void *memccpy (void *, __const__ void *, int, size_t); | 
|---|
| 87 | int memicmp (__const__ void *, __const__ void *, size_t); | 
|---|
| 88 |  | 
|---|
| 89 | #define strdup CRTWRAP(strdup) | 
|---|
| 90 | #define stricmp CRTWRAP(stricmp) | 
|---|
| 91 | #define strlwr CRTWRAP(strlwr) | 
|---|
| 92 | #define strnicmp CRTWRAP(strnicmp) | 
|---|
| 93 | #define strnset CRTWRAP(strnset) | 
|---|
| 94 | #define strrev CRTWRAP(strrev) | 
|---|
| 95 | #define strset CRTWRAP(strset) | 
|---|
| 96 | #define strupr CRTWRAP(strupr) | 
|---|
| 97 |  | 
|---|
| 98 | #define strsep CRTWRAP(strsep) | 
|---|
| 99 |  | 
|---|
| 100 | char *strdup (__const__ char *); | 
|---|
| 101 | int stricmp (__const__ char *, __const__ char *); | 
|---|
| 102 | char *strlwr (char *); | 
|---|
| 103 | int strnicmp (__const__ char *, __const__ char *, size_t); | 
|---|
| 104 | char *strnset (char *, int, size_t); | 
|---|
| 105 | char *strrev (char *); | 
|---|
| 106 | char *strset (char *, int); | 
|---|
| 107 | char *strupr (char *); | 
|---|
| 108 |  | 
|---|
| 109 | char *strsep (char **, __const__ char *); /* BSD */ | 
|---|
| 110 |  | 
|---|
| 111 | #endif | 
|---|
| 112 |  | 
|---|
| 113 | #define _memcount CRTWRAP(_memcount) | 
|---|
| 114 | #define _memdif CRTWRAP(_memdif) | 
|---|
| 115 | #define _memrchr CRTWRAP(_memrchr) | 
|---|
| 116 | #define _memswap CRTWRAP(_memswap) | 
|---|
| 117 | #define _strncpy CRTWRAP(_strncpy) | 
|---|
| 118 | #define _memccpy CRTWRAP(_memccpy) | 
|---|
| 119 | #define _memicmp CRTWRAP(_memicmp) | 
|---|
| 120 | #define _strdup CRTWRAP(_strdup) | 
|---|
| 121 | #define _stricmp CRTWRAP(_stricmp) | 
|---|
| 122 | #define _strlwr CRTWRAP(_strlwr) | 
|---|
| 123 | #define _strnicmp CRTWRAP(_strnicmp) | 
|---|
| 124 | #define _strnset CRTWRAP(_strnset) | 
|---|
| 125 | #define _strrev CRTWRAP(_strrev) | 
|---|
| 126 | #define _strset CRTWRAP(_strset) | 
|---|
| 127 | #define _strupr CRTWRAP(_strupr) | 
|---|
| 128 | #define _strsep CRTWRAP(_strsep) | 
|---|
| 129 |  | 
|---|
| 130 | #if (!defined (__STRICT_ANSI__) && !defined (_POSIX_SOURCE)) \ | 
|---|
| 131 | || defined (_WITH_UNDERSCORE) | 
|---|
| 132 |  | 
|---|
| 133 | size_t _memcount (__const__ void *, int, size_t); | 
|---|
| 134 | size_t _memdif (__const__ void *, __const__ void *, size_t); | 
|---|
| 135 | void *_memrchr (__const__ void *, int, size_t); | 
|---|
| 136 | void _memswap (void *, void *, size_t); | 
|---|
| 137 | char *_strncpy (char *, __const__ char *, size_t); | 
|---|
| 138 |  | 
|---|
| 139 | void *_memccpy (void *, __const__ void *, int, size_t); | 
|---|
| 140 | int _memicmp (__const__ void *, __const__ void *, size_t); | 
|---|
| 141 | char *_strdup (__const__ char *); | 
|---|
| 142 | int _stricmp (__const__ char *, __const__ char *); | 
|---|
| 143 | char *_strlwr (char *); | 
|---|
| 144 | int _strnicmp (__const__ char *, __const__ char *, size_t); | 
|---|
| 145 | char *_strnset (char *, int, size_t); | 
|---|
| 146 | char *_strrev (char *); | 
|---|
| 147 | char *_strset (char *, int); | 
|---|
| 148 | char *_strupr (char *); | 
|---|
| 149 | char *_strsep (char **, __const__ char *); | 
|---|
| 150 |  | 
|---|
| 151 | #endif | 
|---|
| 152 |  | 
|---|
| 153 |  | 
|---|
| 154 | #if defined (__cplusplus) | 
|---|
| 155 | } | 
|---|
| 156 | #endif | 
|---|
| 157 |  | 
|---|
| 158 | #endif /* not _STRING_H */ | 
|---|