Rev 1693 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1693 | Rev 3065 | ||
---|---|---|---|
Line 7... | Line 7... | ||
7 | #ifndef _STRING_H_ |
7 | #ifndef _STRING_H_ |
8 | #define _STRING_H_ |
8 | #define _STRING_H_ |
Line 9... | Line 9... | ||
9 | 9 | ||
10 | #include "_ansi.h" |
10 | #include "_ansi.h" |
- | 11 | #include |
|
Line 11... | Line 12... | ||
11 | #include |
12 | #include |
12 | 13 | ||
Line 13... | Line 14... | ||
13 | #define __need_size_t |
14 | #define __need_size_t |
Line 60... | Line 61... | ||
60 | char *_EXFUN(rindex,(const char *, int)); |
61 | char *_EXFUN(rindex,(const char *, int)); |
61 | char *_EXFUN(stpcpy,(char *, const char *)); |
62 | char *_EXFUN(stpcpy,(char *, const char *)); |
62 | char *_EXFUN(stpncpy,(char *, const char *, size_t)); |
63 | char *_EXFUN(stpncpy,(char *, const char *, size_t)); |
63 | int _EXFUN(strcasecmp,(const char *, const char *)); |
64 | int _EXFUN(strcasecmp,(const char *, const char *)); |
64 | char *_EXFUN(strcasestr,(const char *, const char *)); |
65 | char *_EXFUN(strcasestr,(const char *, const char *)); |
- | 66 | char *_EXFUN(strchrnul,(const char *, int)); |
|
65 | char *_EXFUN(strdup,(const char *)); |
67 | char *_EXFUN(strdup,(const char *)); |
66 | char *_EXFUN(_strdup_r,(struct _reent *, const char *)); |
68 | char *_EXFUN(_strdup_r,(struct _reent *, const char *)); |
67 | char *_EXFUN(strndup,(const char *, size_t)); |
69 | char *_EXFUN(strndup,(const char *, size_t)); |
68 | char *_EXFUN(_strndup_r,(struct _reent *, const char *, size_t)); |
70 | char *_EXFUN(_strndup_r,(struct _reent *, const char *, size_t)); |
- | 71 | /* There are two common strerror_r variants. If you request |
|
- | 72 | _GNU_SOURCE, you get the GNU version; otherwise you get the POSIX |
|
- | 73 | version. POSIX requires that #undef strerror_r will still let you |
|
- | 74 | invoke the underlying function, but that requires gcc support. */ |
|
- | 75 | #ifdef _GNU_SOURCE |
|
69 | char *_EXFUN(strerror_r,(int, char *, size_t)); |
76 | char *_EXFUN(strerror_r,(int, char *, size_t)); |
- | 77 | #else |
|
- | 78 | # ifdef __GNUC__ |
|
- | 79 | int _EXFUN(strerror_r,(int, char *, size_t)) __asm__ (__ASMNAME ("__xpg_strerror_r")); |
|
- | 80 | # else |
|
- | 81 | int _EXFUN(__xpg_strerror_r,(int, char *, size_t)); |
|
- | 82 | # define strerror_r __xpg_strerror_r |
|
- | 83 | # endif |
|
- | 84 | #endif |
|
70 | size_t _EXFUN(strlcat,(char *, const char *, size_t)); |
85 | size_t _EXFUN(strlcat,(char *, const char *, size_t)); |
71 | size_t _EXFUN(strlcpy,(char *, const char *, size_t)); |
86 | size_t _EXFUN(strlcpy,(char *, const char *, size_t)); |
72 | int _EXFUN(strncasecmp,(const char *, const char *, size_t)); |
87 | int _EXFUN(strncasecmp,(const char *, const char *, size_t)); |
73 | size_t _EXFUN(strnlen,(const char *, size_t)); |
88 | size_t _EXFUN(strnlen,(const char *, size_t)); |
74 | char *_EXFUN(strsep,(char **, const char *)); |
89 | char *_EXFUN(strsep,(char **, const char *)); |
75 | char *_EXFUN(strlwr,(char *)); |
90 | char *_EXFUN(strlwr,(char *)); |
76 | char *_EXFUN(strupr,(char *)); |
91 | char *_EXFUN(strupr,(char *)); |
77 | #ifdef __CYGWIN__ |
- | |
78 | #ifndef DEFS_H /* Kludge to work around problem compiling in gdb */ |
92 | #ifndef DEFS_H /* Kludge to work around problem compiling in gdb */ |
79 | char *_EXFUN(strsignal, (int __signo)); |
93 | char *_EXFUN(strsignal, (int __signo)); |
80 | #endif |
94 | #endif |
- | 95 | #ifdef __CYGWIN__ |
|
81 | int _EXFUN(strtosigno, (const char *__name)); |
96 | int _EXFUN(strtosigno, (const char *__name)); |
82 | #endif |
97 | #endif |
Line -... | Line 98... | ||
- | 98 | ||
- | 99 | /* Recursive version of strerror. */ |
|
- | 100 | char * _EXFUN(_strerror_r, (struct _reent *, int, int, int *)); |
|
- | 101 | ||
- | 102 | #if defined _GNU_SOURCE && defined __GNUC__ |
|
- | 103 | #define strdupa(__s) \ |
|
- | 104 | (__extension__ ({const char *__in = (__s); \ |
|
- | 105 | size_t __len = strlen (__in) + 1; \ |
|
- | 106 | char * __out = (char *) __builtin_alloca (__len); \ |
|
- | 107 | (char *) memcpy (__out, __in, __len);})) |
|
- | 108 | #define strndupa(__s, __n) \ |
|
- | 109 | (__extension__ ({const char *__in = (__s); \ |
|
- | 110 | size_t __len = strnlen (__in, (__n)) + 1; \ |
|
- | 111 | char *__out = (char *) __builtin_alloca (__len); \ |
|
- | 112 | __out[__len-1] = '\0'; \ |
|
- | 113 | (char *) memcpy (__out, __in, __len-1);})) |
|
- | 114 | #endif /* _GNU_SOURCE && __GNUC__ */ |
|
83 | 115 | ||
84 | /* These function names are used on Windows and perhaps other systems. */ |
116 | /* These function names are used on Windows and perhaps other systems. */ |
85 | #ifndef strcmpi |
117 | #ifndef strcmpi |
86 | #define strcmpi strcasecmp |
118 | #define strcmpi strcasecmp |
87 | #endif |
119 | #endif |