2008-10-11 07:35:26 -07:00
|
|
|
#ifndef __EVIL_STRING_H__
|
|
|
|
#define __EVIL_STRING_H__
|
|
|
|
|
|
|
|
|
2009-10-14 11:48:13 -07:00
|
|
|
/**
|
|
|
|
* @file evil_string.h
|
|
|
|
* @brief The file that provides functions ported from Unix in string.h.
|
|
|
|
* @defgroup Evil_String_Group String.h functions.
|
2012-12-18 10:38:35 -08:00
|
|
|
* @ingroup Evil
|
2009-10-14 11:48:13 -07:00
|
|
|
*
|
|
|
|
* This header provides functions ported from Unix in string.h.
|
|
|
|
*
|
2020-04-29 08:32:41 -07:00
|
|
|
* @{
|
2009-10-14 11:48:13 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2008-10-19 12:06:19 -07:00
|
|
|
/*
|
2019-05-03 05:09:07 -07:00
|
|
|
* string related functions
|
2008-10-19 12:06:19 -07:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2012-04-20 00:51:58 -07:00
|
|
|
/**
|
2014-07-13 01:59:40 -07:00
|
|
|
* @brief Locate a substring into a string, ignoring case.
|
2012-04-20 00:51:58 -07:00
|
|
|
*
|
|
|
|
* @param haystack The string to search in.
|
|
|
|
* @param needle The substring to find.
|
|
|
|
* @return
|
|
|
|
*
|
|
|
|
* This function locates the string @p needle into the string @p 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 @p haystack or @p needle are @c NULL, this function returns @c NULL.
|
|
|
|
*
|
|
|
|
* Conformity: Non applicable.
|
|
|
|
*
|
2014-07-13 01:59:40 -07:00
|
|
|
* Supported OS: Windows XP.
|
2012-04-20 00:51:58 -07:00
|
|
|
*/
|
|
|
|
EAPI char *strcasestr(const char *haystack, const char *needle);
|
|
|
|
|
2009-10-14 11:48:13 -07:00
|
|
|
/**
|
2013-06-24 20:26:20 -07:00
|
|
|
* @brief Implements the strsep function which is used to separate strings.
|
|
|
|
*
|
|
|
|
* @param stringp The pointer to the string to search in.
|
|
|
|
* @param delim The delimiter that contains characters used to find the next token.
|
|
|
|
* @return a pointer to the next token or NULL;
|
|
|
|
*
|
|
|
|
* The strsep() function locates, in the string referenced by *stringp, the
|
|
|
|
* first occurrence of any character in the string delim (or the terminating
|
|
|
|
* `\0' character) and replaces it with a `\0'. The location of the next
|
|
|
|
* character after the delimiter character (or NULL, if the end of the
|
|
|
|
* string was reached) is stored in *stringp. The original value of
|
|
|
|
* stringp is returned.
|
|
|
|
*
|
|
|
|
* An ``empty'' field (i.e., a character in the string delim occurs as the
|
|
|
|
* first character of *stringp) can be detected by comparing the location
|
|
|
|
* referenced by the returned pointer to `\0'.
|
2009-10-14 11:48:13 -07:00
|
|
|
|
2013-06-24 20:26:20 -07:00
|
|
|
* If *stringp is initially NULL, strsep() returns NULL.
|
|
|
|
*
|
|
|
|
* This function is from LibGW32C.
|
|
|
|
* @since 1.8
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
EAPI char *strsep(char **stringp, const char *delim);
|
2009-10-14 11:48:13 -07:00
|
|
|
|
2020-04-29 08:32:41 -07:00
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
2008-10-11 07:35:26 -07:00
|
|
|
#endif /* __EVIL_STRING_H__ */
|