This header provides functions ported from Unix in string.h. More...
Functions | |
| int | ffs (int i) |
| Return the position of the first (least significant) bit set in a word. | |
| char * | strrstr (const char *str, const char *substr) |
| Get the last substring occurence. | |
| char * | strcasestr (const char *haystack, const char *needle) |
| Locatea substring into a string, ignoring case. | |
Detailed Description
This header provides functions ported from Unix in string.h.
Function Documentation
| int ffs | ( | int | i | ) |
Return the position of the first (least significant) bit set in a word.
- Parameters
-
i Word to take the first bit.
- Returns
- The position of the first bit set, or 0 if no bits are set.
This function returns the position of the first (least significant) bit set in i. The least significant bit is position 1 and the most significant position e.g. 32 or 64. The function returns 0 if no bits are set in i, or the position of the first bit set otherwise.
Conformity: BSD
Supported OS: Windows XP, Windows CE (not cegcc).
| char* strrstr | ( | const char * | str, |
| const char * | substr | ||
| ) |
Get the last substring occurence.
- Parameters
-
str The string to search from. substr The substring to search.
- Returns
- The last occurrence of the substring if found,
NULLotherwise.
This function retrieves the last occurrence of substring in the string str. If str or substr are NULL, of if substr is not found in str, NULL is returned.
Conformity: Non applicable.
Supported OS: Windows XP, Windows CE.
| char* strcasestr | ( | const char * | haystack, |
| const char * | needle | ||
| ) |
Locatea substring into a string, ignoring case.
- Parameters
-
haystack The string to search in. needle The substring to find.
- Returns
This function locates the string needle into the string haystack, ignoring the case of the characters. It returns apointer to the beginning of the substring, or NULL if the substring is not found. If haystack or needle are NULL, this function returns NULL.
Conformity: Non applicable.
Supported OS: Windows XP, Windows CE
