1 2 // automatically generated by m4 from headers in proto subdir 3 4 5 #ifndef __STRING_H__ 6 #define __STRING_H__ 7 8 #include <stddef.h> 9 10 #ifndef _SIZE_T_DEFINED 11 #define _SIZE_T_DEFINED 12 typedef unsigned int size_t; 13 #endif 14 15 #ifndef NULL 16 #define NULL ((void*)(0)) 17 #endif 18 19 extern int bcmp(const void *b1,const void *b2,size_t len); 20 extern int bcmp_callee(const void *b1,const void *b2,size_t len) __z88dk_callee; 21 #define bcmp(a,b,c) bcmp_callee(a,b,c) 22 23 24 extern void bcopy(const void *src,void *dst,size_t len); 25 extern void bcopy_callee(const void *src,void *dst,size_t len) __z88dk_callee; 26 #define bcopy(a,b,c) bcopy_callee(a,b,c) 27 28 29 extern void bzero(void *mem,size_t n); 30 extern void bzero_callee(void *mem,size_t n) __z88dk_callee; 31 #define bzero(a,b) bzero_callee(a,b) 32 33 34 extern char *index(const char *s,int c) __preserves_regs(d,e); 35 extern char *index_callee(const char *s,int c) __preserves_regs(d,e) __z88dk_callee; 36 #define index(a,b) index_callee(a,b) 37 38 39 extern char *rindex(const char *s,int c) __preserves_regs(d); 40 extern char *rindex_callee(const char *s,int c) __preserves_regs(d) __z88dk_callee; 41 #define rindex(a,b) rindex_callee(a,b) 42 43 44 extern char *strset(char *s,int c) __preserves_regs(b,c); 45 extern char *strset_callee(char *s,int c) __preserves_regs(b,c) __z88dk_callee; 46 #define strset(a,b) strset_callee(a,b) 47 48 49 extern char *strnset(char *s,int c,size_t n); 50 extern char *strnset_callee(char *s,int c,size_t n) __z88dk_callee; 51 #define strnset(a,b,c) strnset_callee(a,b,c) 52 53 54 extern void *rawmemchr(const void *mem,int c) __preserves_regs(d,e); 55 extern void *rawmemchr_callee(const void *mem,int c) __preserves_regs(d,e) __z88dk_callee; 56 #define rawmemchr(a,b) rawmemchr_callee(a,b) 57 58 59 60 extern char *_memlwr_(void *p,size_t n) __preserves_regs(d,e); 61 extern char *_memlwr__callee(void *p,size_t n) __preserves_regs(d,e) __z88dk_callee; 62 #define _memlwr_(a,b) _memlwr__callee(a,b) 63 64 65 extern char *_memstrcpy_(void *p,const char *s,size_t n); 66 extern char *_memstrcpy__callee(void *p,const char *s,size_t n) __z88dk_callee; 67 #define _memstrcpy_(a,b,c) _memstrcpy__callee(a,b,c) 68 69 70 extern char *_memupr_(void *p,size_t n) __preserves_regs(d,e); 71 extern char *_memupr__callee(void *p,size_t n) __preserves_regs(d,e) __z88dk_callee; 72 #define _memupr_(a,b) _memupr__callee(a,b) 73 74 75 extern char *_strrstrip_(char *s); 76 extern char *_strrstrip__fastcall(char *s) __z88dk_fastcall; 77 #define _strrstrip_(a) _strrstrip__fastcall(a) 78 79 80 extern int ffs(int i) __preserves_regs(b,c,d,e); 81 extern int ffs_fastcall(int i) __preserves_regs(b,c,d,e) __z88dk_fastcall; 82 #define ffs(a) ffs_fastcall(a) 83 84 85 extern int ffsl(long i) __preserves_regs(b,c); 86 extern int ffsl_fastcall(long i) __preserves_regs(b,c,d,e) __z88dk_fastcall; 87 #define ffsl(a) ffsl_fastcall(a) 88 89 90 extern void *memccpy(void *dst,const void *src,int c,size_t n); 91 extern void *memccpy_callee(void *dst,const void *src,int c,size_t n) __z88dk_callee; 92 #define memccpy(a,b,c,d) memccpy_callee(a,b,c,d) 93 94 95 extern void *memchr(const void *s,int c,size_t n); 96 extern void *memchr_callee(const void *s,int c,size_t n) __z88dk_callee; 97 #define memchr(a,b,c) memchr_callee(a,b,c) 98 99 100 extern int memcmp(const void *s1,const void *s2,size_t n); 101 extern int memcmp_callee(const void *s1,const void *s2,size_t n) __z88dk_callee; 102 #define memcmp(a,b,c) memcmp_callee(a,b,c) 103 104 105 extern void *memcpy(void *dst,const void *src,size_t n); 106 extern void *memcpy_callee(void *dst,const void *src,size_t n) __z88dk_callee; 107 #define memcpy(a,b,c) memcpy_callee(a,b,c) 108 109 110 extern void *memmem(const void *haystack,size_t haystack_len,const void *needle,size_t needle_len); 111 extern void *memmem_callee(const void *haystack,size_t haystack_len,const void *needle,size_t needle_len) __z88dk_callee; 112 #define memmem(a,b,c,d) memmem_callee(a,b,c,d) 113 114 115 extern void *memmove(void *dst,const void *src,size_t n); 116 extern void *memmove_callee(void *dst,const void *src,size_t n) __z88dk_callee; 117 #define memmove(a,b,c) memmove_callee(a,b,c) 118 119 120 extern void *memrchr(const void *s,int c,size_t n); 121 extern void *memrchr_callee(const void *s,int c,size_t n) __z88dk_callee; 122 #define memrchr(a,b,c) memrchr_callee(a,b,c) 123 124 125 extern void *memset(void *s,int c,size_t n); 126 extern void *memset_callee(void *s,int c,size_t n) __z88dk_callee; 127 #define memset(a,b,c) memset_callee(a,b,c) 128 129 130 extern void *memswap(void *s1,void *s2,size_t n); 131 extern void *memswap_callee(void *s1,void *s2,size_t n) __z88dk_callee; 132 #define memswap(a,b,c) memswap_callee(a,b,c) 133 134 135 extern char *stpcpy(char *dst,const char *src); 136 extern char *stpcpy_callee(char *dst,const char *src) __z88dk_callee; 137 #define stpcpy(a,b) stpcpy_callee(a,b) 138 139 140 extern char *stpncpy(char *dst,const char *src,size_t n); 141 extern char *stpncpy_callee(char *dst,const char *src,size_t n) __z88dk_callee; 142 #define stpncpy(a,b,c) stpncpy_callee(a,b,c) 143 144 145 extern int strcasecmp(const char *s1,const char *s2) __preserves_regs(b); 146 extern int strcasecmp_callee(const char *s1,const char *s2) __preserves_regs(b) __z88dk_callee; 147 #define strcasecmp(a,b) strcasecmp_callee(a,b) 148 149 150 extern char *strcat(char *dst,const char *src); 151 extern char *strcat_callee(char *dst,const char *src) __z88dk_callee; 152 #define strcat(a,b) strcat_callee(a,b) 153 154 155 extern char *strchr(const char *s,int c) __preserves_regs(d,e); 156 extern char *strchr_callee(const char *s,int c) __preserves_regs(d,e) __z88dk_callee; 157 #define strchr(a,b) strchr_callee(a,b) 158 159 160 extern char *strchrnul(const char *s,int c) __preserves_regs(d,e); 161 extern char *strchrnul_callee(const char *s,int c) __preserves_regs(d,e) __z88dk_callee; 162 #define strchrnul(a,b) strchrnul_callee(a,b) 163 164 165 extern int strcmp(const char *s1,const char *s2); 166 extern int strcmp_callee(const char *s1,const char *s2) __z88dk_callee; 167 #define strcmp(a,b) strcmp_callee(a,b) 168 169 170 extern int strcoll(const char *s1,const char *s2); 171 extern int strcoll_callee(const char *s1,const char *s2) __z88dk_callee; 172 #define strcoll(a,b) strcoll_callee(a,b) 173 174 175 extern char *strcpy(char *dst,const char *src); 176 extern char *strcpy_callee(char *dst,const char *src) __z88dk_callee; 177 #define strcpy(a,b) strcpy_callee(a,b) 178 179 180 extern size_t strcspn(const char *s,const char *nspn); 181 extern size_t strcspn_callee(const char *s,const char *nspn) __z88dk_callee; 182 #define strcspn(a,b) strcspn_callee(a,b) 183 184 185 extern char *strdup(const char *s); 186 extern char *strdup_fastcall(const char *s) __z88dk_fastcall; 187 #define strdup(a) strdup_fastcall(a) 188 189 190 extern char *strerror(int errnum) __preserves_regs(d); 191 extern char *strerror_fastcall(int errnum) __preserves_regs(d) __z88dk_fastcall; 192 #define strerror(a) strerror_fastcall(a) 193 194 195 extern int stricmp(const char *s1,const char *s2) __preserves_regs(b); 196 extern int stricmp_callee(const char *s1,const char *s2) __preserves_regs(b) __z88dk_callee; 197 #define stricmp(a,b) stricmp_callee(a,b) 198 199 200 extern size_t strlcat(char *dst,const char *src,size_t n); 201 extern size_t strlcat_callee(char *dst,const char *src,size_t n) __z88dk_callee; 202 #define strlcat(a,b,c) strlcat_callee(a,b,c) 203 204 205 extern size_t strlcpy(char *dst,const char *src,size_t n); 206 extern size_t strlcpy_callee(char *dst,const char *src,size_t n) __z88dk_callee; 207 #define strlcpy(a,b,c) strlcpy_callee(a,b,c) 208 209 210 extern size_t strlen(const char *s) __preserves_regs(d,e); 211 extern size_t strlen_fastcall(const char *s) __preserves_regs(d,e) __z88dk_fastcall; 212 #define strlen(a) strlen_fastcall(a) 213 214 215 extern char *strlwr(char *s) __preserves_regs(b,c,d,e); 216 extern char *strlwr_fastcall(char *s) __preserves_regs(b,c,d,e,h,l) __z88dk_fastcall; 217 #define strlwr(a) strlwr_fastcall(a) 218 219 220 extern int strncasecmp(const char *s1,const char *s2,size_t n); 221 extern int strncasecmp_callee(const char *s1,const char *s2,size_t n) __z88dk_callee; 222 #define strncasecmp(a,b,c) strncasecmp_callee(a,b,c) 223 224 225 extern char *strncat(char *dst,const char *src,size_t n); 226 extern char *strncat_callee(char *dst,const char *src,size_t n) __z88dk_callee; 227 #define strncat(a,b,c) strncat_callee(a,b,c) 228 229 230 extern char *strnchr(const char *s,size_t n,int c); 231 extern char *strnchr_callee(const char *s,size_t n,int c) __z88dk_callee; 232 #define strnchr(a,b,c) strnchr_callee(a,b,c) 233 234 235 extern int strncmp(const char *s1,const char *s2,size_t n); 236 extern int strncmp_callee(const char *s1,const char *s2,size_t n) __z88dk_callee; 237 #define strncmp(a,b,c) strncmp_callee(a,b,c) 238 239 240 extern char *strncpy(char *dst,const char *src,size_t n); 241 extern char *strncpy_callee(char *dst,const char *src,size_t n) __z88dk_callee; 242 #define strncpy(a,b,c) strncpy_callee(a,b,c) 243 244 245 extern char *strndup(const char *s,size_t n); 246 extern char *strndup_callee(const char *s,size_t n) __z88dk_callee; 247 #define strndup(a,b) strndup_callee(a,b) 248 249 250 extern int strnicmp(const char *s1,const char *s2,size_t n); 251 extern int strnicmp_callee(const char *s1,const char *s2,size_t n) __z88dk_callee; 252 #define strnicmp(a,b,c) strnicmp_callee(a,b,c) 253 254 255 extern size_t strnlen(const char *s,size_t max_len); 256 extern size_t strnlen_callee(const char *s,size_t max_len) __z88dk_callee; 257 #define strnlen(a,b) strnlen_callee(a,b) 258 259 260 extern char *strpbrk(const char *s,const char *set) __preserves_regs(b); 261 extern char *strpbrk_callee(const char *s,const char *set) __preserves_regs(b) __z88dk_callee; 262 #define strpbrk(a,b) strpbrk_callee(a,b) 263 264 265 extern char *strrchr(const char *s,int c) __preserves_regs(d); 266 extern char *strrchr_callee(const char *s,int c) __preserves_regs(d) __z88dk_callee; 267 #define strrchr(a,b) strrchr_callee(a,b) 268 269 270 extern size_t strrcspn(const char *s,const char *set); 271 extern size_t strrcspn_callee(const char *s,const char *set) __z88dk_callee; 272 #define strrcspn(a,b) strrcspn_callee(a,b) 273 274 275 extern char *strrev(char *s); 276 extern char *strrev_fastcall(char *s) __preserves_regs(h,l) __z88dk_fastcall; 277 #define strrev(a) strrev_fastcall(a) 278 279 280 extern size_t strrspn(const char *s,const char *set); 281 extern size_t strrspn_callee(const char *s,const char *set) __z88dk_callee; 282 #define strrspn(a,b) strrspn_callee(a,b) 283 284 285 extern char *strrstr(const char *s,const char *subs); 286 extern char *strrstr_callee(const char *s,const char *subs) __z88dk_callee; 287 #define strrstr(a,b) strrstr_callee(a,b) 288 289 290 extern char *strrstrip(char *s); 291 extern char *strrstrip_fastcall(char *s) __preserves_regs(h,l) __z88dk_fastcall; 292 #define strrstrip(a) strrstrip_fastcall(a) 293 294 295 extern char *strsep(char **s,const char *delim); 296 extern char *strsep_callee(char **s,const char *delim) __z88dk_callee; 297 #define strsep(a,b) strsep_callee(a,b) 298 299 300 extern size_t strspn(const char *s,const char *pfx); 301 extern size_t strspn_callee(const char *s,const char *pfx) __z88dk_callee; 302 #define strspn(a,b) strspn_callee(a,b) 303 304 305 extern char *strstr(const char *s,const char *subs) __preserves_regs(b,c); 306 extern char *strstr_callee(const char *s,const char *subs) __preserves_regs(b,c) __z88dk_callee; 307 #define strstr(a,b) strstr_callee(a,b) 308 309 310 extern char *strstrip(char *s) __preserves_regs(b,c,d,e); 311 extern char *strstrip_fastcall(char *s) __preserves_regs(b,c,d,e) __z88dk_fastcall; 312 #define strstrip(a) strstrip_fastcall(a) 313 314 315 extern char *strtok(char *s,const char *delim); 316 extern char *strtok_callee(char *s,const char *delim) __z88dk_callee; 317 #define strtok(a,b) strtok_callee(a,b) 318 319 320 extern char *strtok_r(char *s,const char *delim,char **last_s); 321 extern char *strtok_r_callee(char *s,const char *delim,char **last_s) __z88dk_callee; 322 #define strtok_r(a,b,c) strtok_r_callee(a,b,c) 323 324 325 extern char *strupr(char *s) __preserves_regs(b,c,d,e); 326 extern char *strupr_fastcall(char *s) __preserves_regs(b,c,d,e,h,l) __z88dk_fastcall; 327 #define strupr(a) strupr_fastcall(a) 328 329 330 extern size_t strxfrm(char *dst,const char *src,size_t n); 331 extern size_t strxfrm_callee(char *dst,const char *src,size_t n) __z88dk_callee; 332 #define strxfrm(a,b,c) strxfrm_callee(a,b,c) 333 334 335 336 #ifdef __CLANG 337 338 extern int ffsll(long long i); 339 340 #endif 341 342 #ifdef __SCCZ80 343 344 #ifndef __DISABLE_BUILTIN 345 346 #ifndef __DISABLE_BUILTIN_MEMSET 347 #undef memset 348 #define memset(a,b,c) __builtin_memset(a,b,c) 349 extern void __LIB__ *__builtin_memset(void *dst, int c, size_t n) __smallc; 350 #endif 351 352 #ifndef __DISABLE_BUILTIN_MEMCPY 353 #undef memcpy 354 #define memcpy(a,b,c) __builtin_memcpy(a,b,c) 355 extern void __LIB__ *__builtin_memcpy(void *dst, void *src,size_t n) __smallc; 356 #endif 357 358 #ifndef __DISABLE_BUILTIN_STRCPY 359 #undef strcpy 360 #define strcpy(a,b) __builtin_strcpy(a,b) 361 extern char __LIB__ *__builtin_strcpy(char *dst, const char *src) __smallc; 362 #endif 363 364 #ifndef __DISABLE_BUILTIN_STRCHR 365 #undef strchr 366 #define strchr(a,b) __builtin_strchr(a,b) 367 extern char __LIB__ *__builtin_strchr(const char *haystack, int needle) __smallc; 368 #endif 369 370 #endif 371 372 #endif 373 374 #ifdef __SDCC 375 376 extern int ffsll(long long i) __preserves_regs(b,c); 377 extern int ffsll_callee(long long i) __preserves_regs(b,c) __z88dk_callee; 378 #define ffsll(a) ffsll_callee(a) 379 380 #ifndef __DISABLE_BUILTIN 381 382 #ifndef __DISABLE_BUILTIN_MEMCPY 383 #undef memcpy 384 #define memcpy(dst, src, n) __builtin_memcpy(dst, src, n) 385 #endif 386 387 #ifndef __DISABLE_BUILTIN_STRCPY 388 #undef strcpy 389 #define strcpy(dst, src) __builtin_strcpy(dst, src) 390 #endif 391 392 #ifndef __DISABLE_BUILTIN_STRNCPY 393 #undef strncpy 394 #define strncpy(dst, src, n) __builtin_strncpy(dst, src, n) 395 #endif 396 397 #ifndef __DISABLE_BUILTIN_STRCHR 398 #undef strchr 399 #define strchr(s, c) __builtin_strchr(s, c) 400 #endif 401 402 #ifndef __DISABLE_BUILTIN_MEMSET 403 #undef memset 404 #define memset(dst, c, n) __builtin_memset(dst, c, n) 405 #endif 406 407 #endif 408 409 #endif 410 411 #endif 412