Changes in uspace/lib/posix/strings.c [8ecef91:fc3680e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/strings.c
r8ecef91 rfc3680e 31 31 * @{ 32 32 */ 33 /** @file 33 /** @file Additional string manipulation. 34 34 */ 35 35 … … 45 45 46 46 /** 47 * Find first set bit (beginning with the least significant bit). 47 48 * 48 * @param i 49 * @return 49 * @param i Integer in which to look for the first set bit. 50 * @return Index of first set bit. Bits are numbered starting at one. 50 51 */ 51 52 int posix_ffs(int i) … … 82 83 83 84 /** 85 * Compare two strings (case-insensitive). 84 86 * 85 * @param s1 86 * @param s2 87 * @return 87 * @param s1 First string to be compared. 88 * @param s2 Second string to be compared. 89 * @return Difference of the first pair of inequal characters, 90 * or 0 if strings have the same content. 88 91 */ 89 92 int posix_strcasecmp(const char *s1, const char *s2) … … 93 96 94 97 /** 98 * Compare part of two strings (case-insensitive). 95 99 * 96 * @param s1 97 * @param s2 98 * @param n 99 * @return 100 * @param s1 First string to be compared. 101 * @param s2 Second string to be compared. 102 * @param n Maximum number of characters to be compared. 103 * @return Difference of the first pair of inequal characters, 104 * or 0 if strings have the same content. 100 105 */ 101 106 int posix_strncasecmp(const char *s1, const char *s2, size_t n) … … 116 121 117 122 /** 123 * Compare two memory areas. 118 124 * 119 * @param mem1 120 * @param mem2 121 * @param n 122 * @return 125 * @param mem1 Pointer to the first area to compare. 126 * @param mem2 Pointer to the second area to compare. 127 * @param n Common size of both areas. 128 * @return If n is 0, return zero. If the areas match, return 129 * zero. Otherwise return non-zero. 123 130 */ 124 131 int posix_bcmp(const void *mem1, const void *mem2, size_t n) … … 128 135 129 136 /** 137 * Copy bytes in memory with overlapping areas. 130 138 * 131 * @param dest132 * @param src133 * @param n 139 * @param src Source area. 140 * @param dest Destination area. 141 * @param n Number of bytes to copy. 134 142 */ 135 void posix_bcopy(const void * dest, void *src, size_t n)143 void posix_bcopy(const void *src, void *dest, size_t n) 136 144 { 137 145 /* Note that memmove has different order of arguments. */ 138 memmove( src, dest, n);146 memmove(dest, src, n); 139 147 } 140 148 141 149 /** 150 * Reset bytes in memory area to zero. 142 151 * 143 * @param mem 144 * @param n 152 * @param mem Memory area to be zeroed. 153 * @param n Number of bytes to reset. 145 154 */ 146 155 void posix_bzero(void *mem, size_t n) … … 150 159 151 160 /** 161 * Scan string for a first occurence of a character. 152 162 * 153 * @param s 154 * @param c 155 * @return 163 * @param s String in which to look for the character. 164 * @param c Character to look for. 165 * @return Pointer to the specified character on success, 166 * NULL pointer otherwise. 156 167 */ 157 168 char *posix_index(const char *s, int c) … … 161 172 162 173 /** 163 * 164 * @param s 165 * @param c 166 * @return 174 * Scan string for a last occurence of a character. 175 * 176 * @param s String in which to look for the character. 177 * @param c Character to look for. 178 * @return Pointer to the specified character on success, 179 * NULL pointer otherwise. 167 180 */ 168 181 char *posix_rindex(const char *s, int c)
Note:
See TracChangeset
for help on using the changeset viewer.