If the argument of a function is char* then the function will always expect a 0-terminated string, otherwise
the behaviour of the function is undefined.
Non-0 then the string is freed. If free_cstring is 0 then the string
is returned
Returns
The pointer to the string if free_cstring is 0. NULL otherwise
SString Funktion
Description
Description: When you set free_cstring to 0 when you use ss_string_free() you get the pointer to the C-String. This C-String must be freed with ss_string_gc_free()
str
The pointer to the C-String to be freed
SString Funktion
Description
Enables the usage of the simple garbage collector. This function should be called before any other ss_string functions
SS_NULL if string or insert are NULL SS_NOMEM if there is no memory available (memory cannot be allocated) SS_EINVAL if string or insert are invalid ss_string-Objects
Replace functions
SString Function
Description
Replaces the first occurrence of a substring given by its pattern with another substring
The substitute substring length. Note that ss_string_replace_c_string_l() does not check whether repl_len is the right length.
Returns
1 on success, 0 on failure, -1 when pattern is not found in string
Error model
SS_NULL if string or pattern or replace are NULL SS_NOMEM if there is no memory available (memory cannot be allocated) SS_EINVAL if string or pattern or replace are invalid ss_string-Objects
SString Function
Description
Replaces the last occurrence of a substring given by its pattern with another substring
The substitute substring length. Note that ss_string_rreplace_c_string_l() does not check whether repl_len is the right length.
Returns
1 on success, 0 on failure, -1 when pattern is not found in string
Error model
SS_NULL if string or pattern or replace are NULL SS_NOMEM if there is no memory available (memory cannot be allocated) SS_EINVAL if string or pattern or replace are invalid ss_string-Objects
Deletes the leading characters of a string that are equal. ss_string_ltrim() deletes all leading characters from left to right. ss_string_rltrim() deletes all leading characters from right to left. ss_string_trim() deletes all leading characters at the beginning and at the end of the string