Changeset 7f9df7b9 in mainline for uspace/lib/posix/src/strings.c
- Timestamp:
- 2018-01-22T22:42:57Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7a08c70
- Parents:
- e0f47f5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/src/strings.c
re0f47f5 r7f9df7b9 34 34 */ 35 35 36 #define LIBPOSIX_INTERNAL37 #define __POSIX_DEF__(x) posix_##x38 39 36 #include "internal/common.h" 40 37 #include "posix/strings.h" … … 52 49 * @return Index of first set bit. Bits are numbered starting at one. 53 50 */ 54 int posix_ffs(int i)51 int ffs(int i) 55 52 { 56 53 if (i == 0) { … … 92 89 * or 0 if strings have the same content. 93 90 */ 94 int posix_strcasecmp(const char *s1, const char *s2)91 int strcasecmp(const char *s1, const char *s2) 95 92 { 96 return posix_strncasecmp(s1, s2, STR_NO_LIMIT);93 return strncasecmp(s1, s2, STR_NO_LIMIT); 97 94 } 98 95 … … 106 103 * or 0 if strings have the same content. 107 104 */ 108 int posix_strncasecmp(const char *s1, const char *s2, size_t n)105 int strncasecmp(const char *s1, const char *s2, size_t n) 109 106 { 110 107 for (size_t i = 0; i < n; ++i) { … … 131 128 * zero. Otherwise return non-zero. 132 129 */ 133 int posix_bcmp(const void *mem1, const void *mem2, size_t n)130 int bcmp(const void *mem1, const void *mem2, size_t n) 134 131 { 135 132 return memcmp(mem1, mem2, n); … … 143 140 * @param n Number of bytes to copy. 144 141 */ 145 void posix_bcopy(const void *src, void *dest, size_t n)142 void bcopy(const void *src, void *dest, size_t n) 146 143 { 147 144 /* Note that memmove has different order of arguments. */ … … 155 152 * @param n Number of bytes to reset. 156 153 */ 157 void posix_bzero(void *mem, size_t n)154 void bzero(void *mem, size_t n) 158 155 { 159 156 memset(mem, 0, n); … … 168 165 * NULL pointer otherwise. 169 166 */ 170 char * posix_index(const char *s, int c)167 char *index(const char *s, int c) 171 168 { 172 return posix_strchr(s, c);169 return strchr(s, c); 173 170 } 174 171 … … 181 178 * NULL pointer otherwise. 182 179 */ 183 char * posix_rindex(const char *s, int c)180 char *rindex(const char *s, int c) 184 181 { 185 return posix_strrchr(s, c);182 return strrchr(s, c); 186 183 } 187 184
Note:
See TracChangeset
for help on using the changeset viewer.