| 1 | /* strings.h: The ABC representation of non-standard C library.
|
|---|
| 2 | * strings.h is useful but non-standard strings header file.
|
|---|
| 3 | * Based on C11 Standard.
|
|---|
| 4 | */
|
|---|
| 5 | #ifndef _STRINGS_
|
|---|
| 6 | #define _STRINGS_
|
|---|
| 7 |
|
|---|
| 8 | #include <stddef.h>
|
|---|
| 9 |
|
|---|
| 10 | /* Functions */
|
|---|
| 11 |
|
|---|
| 12 | /* Compare bytes in memory. The bcmp() function compares the
|
|---|
| 13 | * first n bytes of the area pointed to by s1 (first parameter)
|
|---|
| 14 | * with the area pointed to by s2(the second parameter).
|
|---|
| 15 | */
|
|---|
| 16 | int bcmp(const void *, const void *, size_t);
|
|---|
| 17 |
|
|---|
| 18 | /* Copy bytes in memory. The bcopy() function copies n bytes from
|
|---|
| 19 | * the area pointed to by s1 to the area pointed to by s2
|
|---|
| 20 | * using the memcpy() function.
|
|---|
| 21 | */
|
|---|
| 22 | void bcopy(const void *, void *, size_t);
|
|---|
| 23 |
|
|---|
| 24 | /* Zero bytes in memory. The bzero() function places n zero-valued
|
|---|
| 25 | * bytes in the area pointed to by s(first parameter)
|
|---|
| 26 | */
|
|---|
| 27 | void bzero(void *, size_t);
|
|---|
| 28 |
|
|---|
| 29 | /* Find first set bit. The ffs() function shall find the first bit
|
|---|
| 30 | * set (beginning with the least significant bit) in i, and return
|
|---|
| 31 | * the index of that bit. Bits are numbered starting at
|
|---|
| 32 | * one (the least significant bit).
|
|---|
| 33 | */
|
|---|
| 34 | int ffs(int);
|
|---|
| 35 |
|
|---|
| 36 | /* index, rindex - locate character in string.
|
|---|
| 37 | * The index() function returns a pointer to the
|
|---|
| 38 | * first occurrence of the character c in the string s.
|
|---|
| 39 | * The rindex() function returns a pointer to the last
|
|---|
| 40 | * occurrence of the character c in the string s.
|
|---|
| 41 | */
|
|---|
| 42 | char *index(const char *, int);
|
|---|
| 43 | char *rindex(const char *, int);
|
|---|
| 44 |
|
|---|
| 45 | /* strcasecmp, strncasecmp -- case-insensitive string comparisons.
|
|---|
| 46 | * The strcasecmp() function shall compare, while ignoring differences
|
|---|
| 47 | * in case, the string pointed to by s1 to the string pointed to by s2.
|
|---|
| 48 | * The strncasecmp() function shall compare, while ignoring differences in case,
|
|---|
| 49 | * not more than n bytes from the string pointed to by s1 to the string
|
|---|
| 50 | * pointed to by s2.
|
|---|
| 51 | */
|
|---|
| 52 | int strcasecmp(const char *, const char *);
|
|---|
| 53 | int strncasecmp(const char *, const char *, size_t);
|
|---|
| 54 |
|
|---|
| 55 | #endif
|
|---|