UTF-8 aware string utilities and functions.
s_strsize | Return the size of the given UTF-8 string in bytes, excluding the trailing zero. |
s_strnsize | Return the size of n characters of the given UTF-8 string in bytes. |
s_strzsize | Return the size of the given UTF-8 string in bytes, including the trailing zero. |
s_strlen | Return the length (number of characters) of the given UTF-8 string. |
s_strdup | Return a newly allocated copy of the given UTF-8 string. |
s_strzcpy | Copy the given UTF-8 string src to dest, size specified. |
s_strcpy | Copy the given UTF-8 string src to dest. |
s_strncpy | Copy n characters of the given UTF-8 string src to dest. |
s_strzncpy | Copy n characters of the given UTF-8 string src to dest, size specified. |
s_strzcat | Concatenate two UTF-8 strings, size specified. |
s_strcat | Concatenate two UTF-8 strings. |
s_strncat | Concatenate n characters of the given UTF-8 string src to dest. |
s_strzncat | Concatenate n characters of the given UTF-8 string src to dest, size specified. |
s_strcmp | Compare two UTF-8 strings. |
s_strncmp | Compare n characters of two UTF-8 strings. |
s_stricmp | Compare two UTF-8 strings (case insensitive). |
s_strnicmp | Compare n characters of two UTF-8 strings (case insensitive). |
s_strlwr | Replace all upper case characters in the given UTF-8 string with lower case characters. |
s_strupr | Replace all lower case characters in the given UTF-8 string with upper case characters. |
s_strchr | Locate a character in the given UTF-8 string. |
s_strrchr | Reverse locate a character in the given UTF-8 string. |
s_strstr | Locate a sub-string in the given UTF-8 string. |
s_strpbrk | Search the given UTF-8 string for any of a set of characters. |
s_strtok | Extract tokens from the given UTF-8 string. |
s_strtok_r | Re-entrant version s_strtok. |
s_atof | Convert the given UTF-8 string to a double. |
s_strtol | Return long int value of the given UTF-8 string. |
s_strtod | Convert the given UTF-8 string to a double, first valid character address. |
s_strerror | Convert the given error number to a UTF-8 string. |
s_isvalid | Validate the given UTF-8 string. |
s_smatches | Test to see if the given UTF-8 string matches the given regular expression. |
s_safter | Return the UTF-8 string that is after the first occurrence of the given character in the given UTF-8 string. |
s_sbefore | Return the UTF-8 string that is before the first occurrence of the given character in the given UTF-8 string. |
s_sappend | Append two UTF-8 strings. |
Return the size of the given UTF-8 string in bytes, excluding the trailing zero.
Parameters: |
|
---|---|
Return: | Size in bytes, excluding the trailing zero. |
Return the size of n characters of the given UTF-8 string in bytes.
Parameters: |
|
---|---|
Return: | Size of n characters of s in bytes. |
Return the size of the given UTF-8 string in bytes, including the trailing zero.
Parameters: |
|
---|---|
Return: | Size in bytes, including the trailing zero. |
Return the length (number of characters) of the given UTF-8 string.
Parameters: |
|
---|---|
Return: | The character length of the string. |
Return a newly allocated copy of the given UTF-8 string.
Parameters: |
|
---|---|
Return: | A copy of src. |
Note: | Caller is responsible for the memory of the returned string. |
Copy the given UTF-8 string src to dest, size specified.
The size of dest is specified by size.
Parameters: |
|
---|---|
Return: | The destination string dest. |
Note: | The trailing zero is copied. |
Copy the given UTF-8 string src to dest.
The size of dest is ignored (should be set correctly by caller).
Parameters: |
|
---|---|
Return: | Pointer to the destination string dest. |
Note: | The trailing zero is copied. |
See also: |
Copy n characters of the given UTF-8 string src to dest.
The size of dest is ignored (should be set correctly by caller).
Parameters: |
|
---|---|
Return: | The destination string dest. |
See also: |
Copy n characters of the given UTF-8 string src to dest, size specified.
The size of dest is specified by size.
Parameters: |
|
---|---|
Return: | The destination string dest. |
Concatenate two UTF-8 strings, size specified.
The size of dest is specified by size.
Parameters: |
|
---|---|
Return: | The concatenation of dest and src or NULL if size <= 0 or src or dest is NULL. |
Note: | The dest string will be zero terminated. |
Concatenate two UTF-8 strings.
The size of dest is ignored (should be set correctly by caller).
Parameters: |
|
---|---|
Return: | The concatenation of dest and src. |
See also: | |
Note: | The dest string will be zero terminated. |
Concatenate n characters of the given UTF-8 string src to dest.
The size of dest is ignored (should be set correctly by caller).
Parameters: |
|
---|---|
Return: | The concatenation of dest and n characters of src. |
See also: | |
Note: | The dest string will be zero terminated. |
Concatenate n characters of the given UTF-8 string src to dest, size specified.
The size of dest is specified by size.
Parameters: |
|
---|---|
Return: | The concatenation of dest and n characters of src or NULL if src or dest is NULL or n or size is 0. |
Note: | The dest string will be zero terminated. |
Compare two UTF-8 strings.
Parameters: |
|
---|---|
Return: | Integer less than, equal to, or greater than zero if s1 is found, respectively, to be less than, to match, or be greater than s2. |
Compare n characters of two UTF-8 strings.
Parameters: |
|
---|---|
Return: | Integer less than, equal to, or greater than zero if s1 is found, respectively, to be less than, to match, or be greater than s2. |
Compare two UTF-8 strings (case insensitive).
Parameters: |
|
---|---|
Return: | Integer less than, equal to, or greater than zero if s1 is found, respectively, to be less than, to match, or be greater than s2. |
See also: |
Compare n characters of two UTF-8 strings (case insensitive).
Parameters: |
|
---|---|
Return: | Integer less than, equal to, or greater than zero if s1 is found, respectively, to be less than, to match, or be greater than s2. |
See also: |
Replace all upper case characters in the given UTF-8 string with lower case characters.
Parameters: |
|
---|---|
Return: | Modified string. |
Note: | The string s is modified in place. |
Replace all lower case characters in the given UTF-8 string with upper case characters.
Parameters: |
|
---|---|
Return: | Modified string. |
Note: | The string s is modified in place. |
Locate a sub-string in the given UTF-8 string.
Parameters: |
|
---|---|
Return: | Pointer to first occurance of needle in haystack. |
Search the given UTF-8 string for any of a set of characters.
Parameters: |
|
---|---|
Return: | Pointer to first occurance of any characters in set in string s. |
Extract tokens from the given UTF-8 string.
UTF-8 aware replacement for standard c library function strtok().
Parameters: |
|
---|---|
Return: | Pointer to next token in s. |
Note: | Not thread-safe. |
Re-entrant version s_strtok.
The last argument is a pointer to a char* variable that is used internally in order to maintain context between successive calls that parse the same string.
Parameters: |
|
---|---|
Return: | Pointer to next token in s. |
Note: | Thread-safe. |
Convert the given UTF-8 string to a double.
Parameters: |
|
---|---|
Return: | Double point value of s. |
Note: | This is merely a wrapper to the standard ISO C atof() function. |
Return long int value of the given UTF-8 string.
Converts the initial part of the string in s to a long integer value according to the given base, which must be between 2 and 36 inclusive, or be the special value 0. Also see the standard ISO C strtol() function.
Parameters: |
|
---|---|
Return: | Long value of string s. |
Convert the given UTF-8 string to a double, first valid character address.
UTF-8 ware version of the standard ISO C strtod() function.
Parameters: |
|
---|---|
Return: | Double value of string s. |
Convert the given error number to a UTF-8 string.
Parameters: |
|
---|---|
Return: | UTF-8 string of error value. |
Note: | Not thread safe. |
Validate the given UTF-8 string.
Parameters: |
|
---|---|
Return: |
Test to see if the given UTF-8 string matches the given regular expression.
Parameters: |
|
---|---|
Return: |
Return the UTF-8 string that is after the first occurrence of the given character in the given UTF-8 string.
Parameters: |
|
---|---|
Return: | A new reference to the string after the character. |
Note: | Caller is responsible for memory of returned string. |
Return the UTF-8 string that is before the first occurrence of the given character in the given UTF-8 string.
Parameters: |
|
---|---|
Return: | A new reference to the string before the character. |
Note: | Caller is responsible for memory of returned string. |