Changeset 2b3dd78 in mainline for uspace/lib/posix/src/strings.c
- Timestamp:
- 2018-01-31T12:02:00Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5595841
- Parents:
- a0a9cc2 (diff), 14d789c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/src/strings.c
ra0a9cc2 r2b3dd78 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" … … 44 41 45 42 #include "libc/mem.h" 43 #include "libc/str.h" 46 44 47 45 /** … … 51 49 * @return Index of first set bit. Bits are numbered starting at one. 52 50 */ 53 int posix_ffs(int i)51 int ffs(int i) 54 52 { 55 53 if (i == 0) { … … 91 89 * or 0 if strings have the same content. 92 90 */ 93 int posix_strcasecmp(const char *s1, const char *s2)91 int strcasecmp(const char *s1, const char *s2) 94 92 { 95 return posix_strncasecmp(s1, s2, STR_NO_LIMIT);93 return strncasecmp(s1, s2, STR_NO_LIMIT); 96 94 } 97 95 … … 105 103 * or 0 if strings have the same content. 106 104 */ 107 int posix_strncasecmp(const char *s1, const char *s2, size_t n)105 int strncasecmp(const char *s1, const char *s2, size_t n) 108 106 { 109 107 for (size_t i = 0; i < n; ++i) { … … 130 128 * zero. Otherwise return non-zero. 131 129 */ 132 int posix_bcmp(const void *mem1, const void *mem2, size_t n)130 int bcmp(const void *mem1, const void *mem2, size_t n) 133 131 { 134 132 return memcmp(mem1, mem2, n); … … 142 140 * @param n Number of bytes to copy. 143 141 */ 144 void posix_bcopy(const void *src, void *dest, size_t n)142 void bcopy(const void *src, void *dest, size_t n) 145 143 { 146 144 /* Note that memmove has different order of arguments. */ … … 154 152 * @param n Number of bytes to reset. 155 153 */ 156 void posix_bzero(void *mem, size_t n)154 void bzero(void *mem, size_t n) 157 155 { 158 156 memset(mem, 0, n); … … 167 165 * NULL pointer otherwise. 168 166 */ 169 char * posix_index(const char *s, int c)167 char *index(const char *s, int c) 170 168 { 171 return posix_strchr(s, c);169 return strchr(s, c); 172 170 } 173 171 … … 180 178 * NULL pointer otherwise. 181 179 */ 182 char * posix_rindex(const char *s, int c)180 char *rindex(const char *s, int c) 183 181 { 184 return posix_strrchr(s, c);182 return strrchr(s, c); 185 183 } 186 184
Note:
See TracChangeset
for help on using the changeset viewer.