Turnstone Operating System
|
main string operations interface More...
Macros | |
#define | ___STRINGS_H 0 |
#define | strcontains(str, pattern) |
checks str contains pattern | |
#define | strcat(s1, s2) |
#define | atoi(number) |
#define | atou(number) |
#define | atoh(number) |
#define | itoa(number) |
#define | itoh(number) |
#define | utoa(number) |
#define | utoh(number) |
#define | strdup_at_heap(heap, src) |
#define | strdup(src) |
#define | strndup(src, n) |
Functions | |
size_t | strlen (const char_t *string) |
calculates null ended string's length | |
int8_t | strcmp (const char_t *string1, const char_t *string2) |
compares two string | |
int8_t | strncmp (const char_t *string1, const char_t *string2, size_t n) |
compares two string with first n bytes | |
int8_t | strstarts (const char_t *str, const char_t *prefix) |
checks str starts with prefix | |
int8_t | strends (const char_t *str, const char_t *suffix) |
checks str ends with suffix | |
char_t * | strchr (const char_t *s, int32_t c) |
finds first occurance of char in string | |
char_t * | strrchr (const char_t *s, int32_t c) |
finds first occurance of char in string | |
char_t * | strstr (const char_t *haystack, const char_t *needle) |
finds first occurance of char in string | |
char_t * | strcat_at_heap (memory_heap_t *heap, const char_t *string1, const char_t *string2) |
concanates two string and returns new one | |
int8_t | strcopy (const char_t *source, char_t *destination) |
copies source string to destination string | |
char * | strrev (const char_t *source) |
reverse a string | |
number_t | ato_base (const char_t *source, number_t base) |
converts string into number | |
unumber_t | atou_base (const char_t *source, number_t base) |
converts string into number | |
char_t * | ito_base (number_t number, number_t base) |
convers number to its string representation | |
char_t * | uto_base (unumber_t number, number_t base) |
convers unsigned number to its string representation | |
char_t * | strndup_at_heap (memory_heap_t *heap, const char_t *src, size_t n) |
duplicate string at heap | |
char_t ** | strsplit (const char_t *str, const char_t token, int64_t **lengths, int64_t *count) |
splits string into array | |
char_t * | strupper (char_t *str) |
converts string to upper case | |
char_t * | struppercopy (const char_t *str) |
duplicates string and converts it to upper case | |
char_t * | strlower (char_t *str) |
converts string to lower case | |
char_t * | strlowercopy (const char_t *str) |
duplicates string and converts it to lower case | |
char_t * | strtrim_right (char_t *str) |
int8_t | str_is_upper (char_t *str) |
int64_t | wchar_size (const char16_t *str) |
char_t * | char16_to_char (char16_t *src) |
char16_t * | char_to_wchar (const char_t *str) |
int64_t | lchar_size (const char32_t *str) |
char_t * | char32_to_char (char32_t *src) |
char32_t * | char_to_lchar (char_t *str) |
uint64_t | strhash (const char_t *input) |
char_t * | strprintf (const char_t *format,...) |
char_t * | vstrprintf (const char_t *format, va_list args) |
main string operations interface
>
This work is licensed under TURNSTONE OS Public License. Please read and understand latest version of Licence.
#define ___STRINGS_H 0 |
prevent duplicate header error macro
#define atoh | ( | number | ) |
#define atoi | ( | number | ) |
#define atou | ( | number | ) |
atou_base macro for base 10
#define itoa | ( | number | ) |
#define itoh | ( | number | ) |
ito_base macro for base 16
#define strcat | ( | s1, | |
s2 ) |
strcat at default heap
#define strcontains | ( | str, | |
pattern ) |
checks str contains pattern
str | string for look |
pattern | to check |
#define strdup | ( | src | ) |
string duplicate at default heap
#define strdup_at_heap | ( | heap, | |
src ) |
string duplicate at heap
#define strndup | ( | src, | |
n ) |
string duplicate with length at default heap
#define utoa | ( | number | ) |
#define utoh | ( | number | ) |
converts string into number
[in] | source | string represents number in base |
[in] | base | base of number inside string |
converts string into number
[in] | source | string represents number in base |
[in] | base | base of number inside string |
convers number to its string representation
[in] | number | number to be converted string |
[in] | base | base value of conversion |
return value should be freed or memory leak will be happened
char_t * strcat_at_heap | ( | memory_heap_t * | heap, |
const char_t * | string1, | ||
const char_t * | string2 ) |
concanates two string and returns new one
string1 | first string |
string2 | second string |
finds first occurance of char in string
s | string for look |
c | char to find |
compares two string
string1 | first string |
string2 | second string |
copies source string to destination string
source | source string |
destination | destination string |
NULL will not be copied. destination should be equal or greater then source. destination should have space for NULL.
checks str ends with suffix
str | string for look |
suffix | to compare |
calculates null ended string's length
[in] | string | string to calculate length |
converts string to lower case
[in] | str | string to lower case |
duplicates string and converts it to lower case
[in] | str | string to lower case |
compares two string with first n bytes
string1 | first string |
string2 | second string |
n | first n bytes |
char_t * strndup_at_heap | ( | memory_heap_t * | heap, |
const char_t * | src, | ||
size_t | n ) |
duplicate string at heap
[in] | heap | destination heap |
[in] | src | source string |
[in] | length | of destination string |
finds first occurance of char in string
s | string for look |
c | char to find |
char * strrev | ( | const char_t * | source | ) |
reverse a string
[in] | source | string to be reversed |
allocates new space, hence return value needs be freed, else leak will be happened
splits string into array
[in] | str | string to tokinize |
[in] | token | split char |
[out] | lengths | array of each splitted part's length |
[out] | count | splitted array length |
checks str starts with prefix
str | string for look |
prefix | to compare |
finds first occurance of char in string
s | string for look |
c | char to find |
converts string to upper case
[in] | str | string to upper case |
duplicates string and converts it to upper case
[in] | str | string to upper case |