Daniel Stenberg | 7da93d5 | 2002-06-15 15:49:32 +0000 | [diff] [blame] | 1 | /* |
| 2 | * string.h |
| 3 | * |
| 4 | * Definitions for memory and string functions. |
| 5 | */ |
| 6 | |
| 7 | #ifndef _STRING_H_ |
Andree Buschmann | 0b7dcd6 | 2010-02-22 21:24:09 +0000 | [diff] [blame] | 8 | #define _STRING_H_ |
Daniel Stenberg | 7da93d5 | 2002-06-15 15:49:32 +0000 | [diff] [blame] | 9 | |
| 10 | #ifdef __cplusplus |
| 11 | extern "C" { |
| 12 | #endif |
| 13 | |
| 14 | #include "_ansi.h" |
Daniel Stenberg | 7da93d5 | 2002-06-15 15:49:32 +0000 | [diff] [blame] | 15 | |
Thomas Martitz | 50a6ca3 | 2010-05-06 21:04:40 +0000 | [diff] [blame] | 16 | #if !defined(__size_t_defined)&& !defined(_SIZE_T_) && !defined(size_t) && !defined(_SIZE_T_DECLARED) |
| 17 | #define __size_t_defined |
| 18 | #define _SIZE_T |
| 19 | #define _SIZE_T_ |
| 20 | #define _SIZE_T_DECLARED |
| 21 | #define size_t size_t |
| 22 | typedef unsigned long size_t; |
| 23 | #endif |
| 24 | |
Daniel Stenberg | 7da93d5 | 2002-06-15 15:49:32 +0000 | [diff] [blame] | 25 | #ifndef NULL |
Michael Sevakis | 0b0c23f | 2007-10-15 07:59:13 +0000 | [diff] [blame] | 26 | #define NULL ((void*)0) |
Daniel Stenberg | 7da93d5 | 2002-06-15 15:49:32 +0000 | [diff] [blame] | 27 | #endif |
| 28 | |
Andree Buschmann | 0b7dcd6 | 2010-02-22 21:24:09 +0000 | [diff] [blame] | 29 | _PTR _EXFUN(memchr,(const _PTR, int, size_t)); |
| 30 | int _EXFUN(memcmp,(const _PTR, const _PTR, size_t)); |
| 31 | _PTR _EXFUN(memcpy,(_PTR, const _PTR, size_t)); |
| 32 | _PTR _EXFUN(memmove,(_PTR, const _PTR, size_t)); |
| 33 | _PTR _EXFUN(memset,(_PTR, int, size_t)); |
| 34 | char *_EXFUN(strcat,(char *, const char *)); |
| 35 | char *_EXFUN(strchr,(const char *, int)); |
| 36 | int _EXFUN(strcmp,(const char *, const char *)); |
| 37 | int _EXFUN(strcoll,(const char *, const char *)); |
| 38 | char *_EXFUN(strcpy,(char *, const char *)); |
| 39 | size_t _EXFUN(strcspn,(const char *, const char *)); |
| 40 | char *_EXFUN(strerror,(int)); |
| 41 | size_t _EXFUN(strlen,(const char *)); |
| 42 | char *_EXFUN(strncat,(char *, const char *, size_t)); |
| 43 | int _EXFUN(strncmp,(const char *, const char *, size_t)); |
| 44 | char *_EXFUN(strpbrk,(const char *, const char *)); |
| 45 | char *_EXFUN(strrchr,(const char *, int)); |
| 46 | size_t _EXFUN(strspn,(const char *, const char *)); |
| 47 | char *_EXFUN(strstr,(const char *, const char *)); |
| 48 | char *_EXFUN(strcasestr,(const char *, const char *)); |
Daniel Stenberg | 7da93d5 | 2002-06-15 15:49:32 +0000 | [diff] [blame] | 49 | |
Nils Wallménius | 3d4701a | 2009-07-14 13:57:45 +0000 | [diff] [blame] | 50 | size_t strlcpy(char *dst, const char *src, size_t siz); |
Torne Wuff | 6e9af8b | 2010-01-02 13:31:46 +0000 | [diff] [blame] | 51 | size_t strlcat(char *dst, const char *src, size_t siz); |
Nils Wallménius | 3d4701a | 2009-07-14 13:57:45 +0000 | [diff] [blame] | 52 | |
Daniel Stenberg | 7da93d5 | 2002-06-15 15:49:32 +0000 | [diff] [blame] | 53 | #ifndef _REENT_ONLY |
Andree Buschmann | 0b7dcd6 | 2010-02-22 21:24:09 +0000 | [diff] [blame] | 54 | char *_EXFUN(strtok,(char *, const char *)); |
Daniel Stenberg | 7da93d5 | 2002-06-15 15:49:32 +0000 | [diff] [blame] | 55 | #endif |
| 56 | |
Andree Buschmann | 0b7dcd6 | 2010-02-22 21:24:09 +0000 | [diff] [blame] | 57 | size_t _EXFUN(strxfrm,(char *, const char *, size_t)); |
Daniel Stenberg | 7da93d5 | 2002-06-15 15:49:32 +0000 | [diff] [blame] | 58 | |
| 59 | #ifndef __STRICT_ANSI__ |
Andree Buschmann | 0b7dcd6 | 2010-02-22 21:24:09 +0000 | [diff] [blame] | 60 | char *_EXFUN(strtok_r,(char *, const char *, char **)); |
Daniel Stenberg | 7da93d5 | 2002-06-15 15:49:32 +0000 | [diff] [blame] | 61 | |
Andree Buschmann | 0b7dcd6 | 2010-02-22 21:24:09 +0000 | [diff] [blame] | 62 | _PTR _EXFUN(memccpy,(_PTR, const _PTR, int, size_t)); |
| 63 | int _EXFUN(strcasecmp,(const char *, const char *)); |
| 64 | int _EXFUN(strncasecmp,(const char *, const char *, size_t)); |
Daniel Stenberg | a898728 | 2002-06-17 13:34:04 +0000 | [diff] [blame] | 65 | |
Daniel Stenberg | 7da93d5 | 2002-06-15 15:49:32 +0000 | [diff] [blame] | 66 | #ifdef __CYGWIN__ |
Andree Buschmann | 0b7dcd6 | 2010-02-22 21:24:09 +0000 | [diff] [blame] | 67 | #ifndef DEFS_H /* Kludge to work around problem compiling in gdb */ |
Daniel Stenberg | 7da93d5 | 2002-06-15 15:49:32 +0000 | [diff] [blame] | 68 | const char *_EXFUN(strsignal, (int __signo)); |
| 69 | #endif |
| 70 | int _EXFUN(strtosigno, (const char *__name)); |
| 71 | #endif |
| 72 | |
| 73 | /* These function names are used on Windows and perhaps other systems. */ |
| 74 | #ifndef strcmpi |
| 75 | #define strcmpi strcasecmp |
| 76 | #endif |
| 77 | #ifndef stricmp |
| 78 | #define stricmp strcasecmp |
| 79 | #endif |
| 80 | #ifndef strncmpi |
| 81 | #define strncmpi strncasecmp |
| 82 | #endif |
| 83 | #ifndef strnicmp |
| 84 | #define strnicmp strncasecmp |
| 85 | #endif |
| 86 | |
| 87 | #endif /* ! __STRICT_ANSI__ */ |
| 88 | |
| 89 | #ifdef __cplusplus |
| 90 | } |
| 91 | #endif |
| 92 | #endif /* _STRING_H_ */ |