Changes in uspace/lib/posix/include/posix/string.h [32b3a12:12b29f3] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/include/posix/string.h
r32b3a12 r12b29f3 37 37 #define POSIX_STRING_H_ 38 38 39 #ifndef __POSIX_DEF__ 40 #define __POSIX_DEF__(x) x 41 #endif 42 39 43 #include "sys/types.h" 40 44 … … 60 64 * forward declarations ought to be enough. 61 65 */ 62 /* From str.h. */63 extern char * strtok_r(char *, const char *, char **);64 extern char * strtok(char *, const char *);65 66 66 67 /* From mem.h */ 67 #define bzero(ptr, len) memset((ptr), 0, (len))68 // #define bzero(ptr, len) memset((ptr), 0, (len)) 68 69 extern void *memset(void *, int, size_t); 69 70 extern void *memcpy(void *, const void *, size_t); … … 72 73 73 74 /* Copying and Concatenation */ 74 extern char * posix_strcpy(char *restrict dest, const char *restrict src);75 extern char * posix_strncpy(char *restrict dest, const char *restrict src, size_t n);76 extern char * posix_stpcpy(char *restrict dest, const char *restrict src);77 extern char * posix_stpncpy(char *restrict dest, const char *restrict src, size_t n);78 extern char * posix_strcat(char *restrict dest, const char *restrict src);79 extern char * posix_strncat(char *restrict dest, const char *restrict src, size_t n);80 extern void * posix_memccpy(void *restrict dest, const void *restrict src, int c, size_t n);81 extern char * posix_strdup(const char *s);82 extern char * posix_strndup(const char *s, size_t n);75 extern char *__POSIX_DEF__(strcpy)(char *restrict dest, const char *restrict src); 76 extern char *__POSIX_DEF__(strncpy)(char *restrict dest, const char *restrict src, size_t n); 77 extern char *__POSIX_DEF__(stpcpy)(char *restrict dest, const char *restrict src); 78 extern char *__POSIX_DEF__(stpncpy)(char *restrict dest, const char *restrict src, size_t n); 79 extern char *__POSIX_DEF__(strcat)(char *restrict dest, const char *restrict src); 80 extern char *__POSIX_DEF__(strncat)(char *restrict dest, const char *restrict src, size_t n); 81 extern void *__POSIX_DEF__(memccpy)(void *restrict dest, const void *restrict src, int c, size_t n); 82 extern char *__POSIX_DEF__(strdup)(const char *s); 83 extern char *__POSIX_DEF__(strndup)(const char *s, size_t n); 83 84 84 85 /* String/Array Comparison */ 85 extern int posix_memcmp(const void *mem1, const void *mem2, size_t n);86 extern int posix_strcmp(const char *s1, const char *s2);87 extern int posix_strncmp(const char *s1, const char *s2, size_t n);86 extern int __POSIX_DEF__(memcmp)(const void *mem1, const void *mem2, size_t n); 87 extern int __POSIX_DEF__(strcmp)(const char *s1, const char *s2); 88 extern int __POSIX_DEF__(strncmp)(const char *s1, const char *s2, size_t n); 88 89 89 90 /* Search Functions */ 90 extern void * posix_memchr(const void *mem, int c, size_t n);91 extern char * posix_strchr(const char *s, int c);92 extern char * posix_strrchr(const char *s, int c);91 extern void *__POSIX_DEF__(memchr)(const void *mem, int c, size_t n); 92 extern char *__POSIX_DEF__(strchr)(const char *s, int c); 93 extern char *__POSIX_DEF__(strrchr)(const char *s, int c); 93 94 extern char *gnu_strchrnul(const char *s, int c); 94 extern char *posix_strpbrk(const char *s1, const char *s2); 95 extern size_t posix_strcspn(const char *s1, const char *s2); 96 extern size_t posix_strspn(const char *s1, const char *s2); 97 extern char *posix_strstr(const char *haystack, const char *needle); 95 extern char *__POSIX_DEF__(strpbrk)(const char *s1, const char *s2); 96 extern size_t __POSIX_DEF__(strcspn)(const char *s1, const char *s2); 97 extern size_t __POSIX_DEF__(strspn)(const char *s1, const char *s2); 98 extern char *__POSIX_DEF__(strstr)(const char *haystack, const char *needle); 99 100 /* Tokenization functions. */ 101 extern char *__POSIX_DEF__(strtok_r)(char *, const char *, char **); 102 extern char *__POSIX_DEF__(strtok)(char *, const char *); 103 98 104 99 105 /* Collation Functions */ 100 extern int posix_strcoll(const char *s1, const char *s2);101 extern size_t posix_strxfrm(char *restrict s1, const char *restrict s2, size_t n);106 extern int __POSIX_DEF__(strcoll)(const char *s1, const char *s2); 107 extern size_t __POSIX_DEF__(strxfrm)(char *restrict s1, const char *restrict s2, size_t n); 102 108 103 109 /* Error Messages */ 104 extern char * posix_strerror(int errnum);105 extern int posix_strerror_r(int errnum, char *buf, size_t bufsz);110 extern char *__POSIX_DEF__(strerror)(int errnum); 111 extern int __POSIX_DEF__(strerror_r)(int errnum, char *buf, size_t bufsz); 106 112 107 113 /* String Length */ 108 extern size_t posix_strlen(const char *s);109 extern size_t posix_strnlen(const char *s, size_t n);114 extern size_t __POSIX_DEF__(strlen)(const char *s); 115 extern size_t __POSIX_DEF__(strnlen)(const char *s, size_t n); 110 116 111 117 /* Signal Messages */ 112 extern char * posix_strsignal(int signum);118 extern char *__POSIX_DEF__(strsignal)(int signum); 113 119 114 120 /* Legacy Declarations */ 115 121 #ifndef POSIX_STRINGS_H_ 116 extern int posix_ffs(int i);117 extern int posix_strcasecmp(const char *s1, const char *s2);118 extern int posix_strncasecmp(const char *s1, const char *s2, size_t n);122 extern int __POSIX_DEF__(ffs)(int i); 123 extern int __POSIX_DEF__(strcasecmp)(const char *s1, const char *s2); 124 extern int __POSIX_DEF__(strncasecmp)(const char *s1, const char *s2, size_t n); 119 125 #endif 120 126 121 #ifndef LIBPOSIX_INTERNAL122 #define strcpy posix_strcpy123 #define strncpy posix_strncpy124 #define stpcpy posix_stpcpy125 #define stpncpy posix_stpncpy126 #define strcat posix_strcat127 #define strncat posix_strncat128 #define memccpy posix_memccpy129 #define strdup posix_strdup130 #define strndup posix_strndup131 132 #define memcmp posix_memcmp133 #define strcmp posix_strcmp134 #define strncmp posix_strncmp135 136 #define memchr posix_memchr137 #define strchr posix_strchr138 #define strrchr posix_strrchr139 #define strchrnul gnu_strchrnul140 #define strpbrk posix_strpbrk141 #define strcspn posix_strcspn142 #define strspn posix_strspn143 #define strstr posix_strstr144 145 #define strcoll posix_strcoll146 #define strxfrm posix_strxfrm147 148 #define strerror posix_strerror149 #define strerror_r posix_strerror_r150 151 #define strlen posix_strlen152 #define strnlen posix_strnlen153 154 #define strsignal posix_strsignal155 156 #define ffs posix_ffs157 #define strcasecmp posix_strcasecmp158 #define strncasecmp posix_strncasecmp159 #endif160 127 161 128 #endif // POSIX_STRING_H_
Note:
See TracChangeset
for help on using the changeset viewer.