Update doc

This commit is contained in:
Patrick Pelissier committed 2019-03-12 21:43:18 +01:00
1 parent 2835d53ef1
commit 4d3a82583d
1 file changed
+36 -38
+36 -38
View File
@@ -4188,19 +4188,15 @@ Append the string with the character 'c'
##### void string\_cat\_str(string\_t v, const char str[]) ##### void string\_cat\_str(string\_t v, const char str[])
Append the string with the array of char 'str'. Append the string 'v' with the array of char 'str'.
The array of char shall be terminated with 0. The array of char shall be terminated with 0.
##### void string\_cat(string\_t v, const string\_t v2) ##### void string\_cat(string\_t v, const string\_t v2)
Append the string with the string 'v2'. Append the string 'v' with the string 'v2'.
##### int string\_cmp\_str(const string\_t v1, const char str[]) ##### int string\_cmp\_str(const string\_t v1, const char str[])
##### int string\_cmp(const string\_t v1, const string\_t str)
Perform a byte comparison of the string and the array of char
by using the strcmp function and return the result of this comparison.
##### int string\_cmp(const string\_t v1, const string\_t v2)
Perform a byte comparison of both string Perform a byte comparison of both string
by using the strcmp function and return the result of this comparison. by using the strcmp function and return the result of this comparison.
@@ -4213,16 +4209,8 @@ Return true if the string is equal to the array of char, false otherwise.
Return true if both strings are equal, false otherwise. Return true if both strings are equal, false otherwise.
##### int string\_cmpi\_str(const string\_t v1, const char p2[]) ##### int string\_cmpi\_str(const string\_t v, const char str[])
##### int string\_cmpi(const string\_t v, const string\_t str)
This function compares the string and the array of char
by ignoring the difference due to the case.
This function doesn't work with UTF-8 strings.
It returns a negative integer if the string is before the array,
0 if there are equal,
a positive integer if the string is after the array.
##### int string\_cmpi(const string\_t v1, const string\_t v2)
This function compares both strings by ignoring the difference due to the casse. This function compares both strings by ignoring the difference due to the casse.
This function doesn't work with UTF-8 strings. This function doesn't work with UTF-8 strings.
@@ -4251,15 +4239,6 @@ Return the offset of the string where the character is last found,
or STRING_FAILURE otherwise. or STRING_FAILURE otherwise.
##### size\_t string\_search\_str (const string\_t v, char str[] [, size\_t start]) ##### size\_t string\_search\_str (const string\_t v, char str[] [, size\_t start])
Search for the array of char 'str' in the string from the offset 'start'.
'start' shall be within the valid ranges of offset of the string.
'start' is an optional argument. If it is not present, the default
value 0 is used instead.
This doesn't work if the function is used as function pointer.
Return the offset of the string where the array of char is first found,
or STRING_FAILURE otherwise.
##### size\_t string\_search (const string\_t v, string\_t str [, size\_t start]) ##### size\_t string\_search (const string\_t v, string\_t str [, size\_t start])
Search for the string 'str' in the string from the offset 'start'. Search for the string 'str' in the string from the offset 'start'.
@@ -4285,7 +4264,7 @@ or STRING_FAILURE otherwise.
##### int string\_strcoll(const string\_t str1, const string\_t str2[]) ##### int string\_strcoll(const string\_t str1, const string\_t str2[])
Compare the two strings str1 and str2. Compare the two strings str1 and str2.
It returns an integer less than, equal to, or greater than zero if s1 is found, It returns an 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. The respectively, to be less than, to match, or be greater than s2. The
comparison is based on strings interpreted as appropriate for the program's comparison is based on strings interpreted as appropriate for the program's
current locale. current locale.
@@ -4317,8 +4296,8 @@ Extract the medium string from offset 'index' and up to 'size' bytes.
##### size\_t string\_replace\_str (string\_t v, const char str1[], const char str2[] [, size_t start]) ##### size\_t string\_replace\_str (string\_t v, const char str1[], const char str2[] [, size_t start])
##### size\_t string\_replace (string\_t v, const string\_t str1, const string\_t str2 [ , size_t start]) ##### size\_t string\_replace (string\_t v, const string\_t str1, const string\_t str2 [ , size_t start])
Replace in the string 'v' from the offset start Replace in the string 'v' from the offset 'start'
the string str1 by the string str2 once. the string 'str1' by the string 'str2' once.
Returns the offset of the replacement or STRING_FAILURE if no replacement Returns the offset of the replacement or STRING_FAILURE if no replacement
was performed. was performed.
@@ -4326,17 +4305,17 @@ was performed.
Replace in the string 'v' the sub-string defined as starting from 'pos' and Replace in the string 'v' the sub-string defined as starting from 'pos' and
of size 'len' by the string str2. of size 'len' by the string str2.
It assumes that pos+len is within the range. It assumes that pos+len is before the end of the string of 'v'.
##### int string\_printf (string\_t v, const char format[], ...) ##### int string\_printf (string\_t v, const char format[], ...)
Set the string 'v' to the formatted string format. Set the string 'v' to the formatted string 'format'.
'format' follows the printf function family. 'format' is like the printf function family.
##### int string\_cat\_tprintf (string\_t v, const char format[], ...) ##### int string\_cat\_printf (string\_t v, const char format[], ...)
Appends to the string 'v' the formatted string format. Appends to the string 'v' the formatted string 'format'.
'format' follows the printf function family. 'format' is like the printf function family.
##### bool string\_fgets(string\_t v, FILE \*f, string\_fgets\_t arg) ##### bool string\_fgets(string\_t v, FILE \*f, string\_fgets\_t arg)
@@ -4374,9 +4353,17 @@ Return a hash of the string.
Remove from the string any leading or trailing space-like characters Remove from the string any leading or trailing space-like characters
(space or tabulation or end of line). (space or tabulation or end of line).
If charTab is given, it get the list of characters to remove from If 'charTab' is given, it get the list of characters to remove from
this argument. this argument.
##### bool string\_oor\_equal\_p(const string\_t v, unsigned char n)
Provide the OOR_EQUAL_P operator of a string.
##### void string\_oor\_set(string\_t v, unsigned char n)
Provide the OOR_SET operator of a string.
##### void string\_get\_str(string\_t v, const string\_t v2, bool append) ##### void string\_get\_str(string\_t v, const string\_t v2, bool append)
Convert a string into a string usable for I/O: Convert a string into a string usable for I/O:
@@ -4396,7 +4383,7 @@ decoded by the function.
##### void string\_out\_str(FILE *f, const string\_t v) ##### void string\_out\_str(FILE *f, const string\_t v)
Write a string into a FILE: Write a string into a FILE:
Outputs the input string with quote around, Outputs the input string while quoting around,
replacing any \" by \\\" within the string. replacing any \" by \\\" within the string.
##### bool string\_in\_str(string\_t v, FILE *f) ##### bool string\_in\_str(string\_t v, FILE *f)
@@ -4413,7 +4400,7 @@ Define a type suitable to store a unicode character.
##### string\_it\_t ##### string\_it\_t
Define an iterator over the string, allowing to Define an iterator over the string, enabling to
iterate the string over UTF8 encoded character. iterate the string over UTF8 encoded character.
##### void string\_it(string\_it\_t it, const string\_t str) ##### void string\_it(string\_it\_t it, const string\_t str)
@@ -5642,6 +5629,17 @@ Assuming both containers are reverse sorted, perform an intersection
of the containers in 'c'. of the containers in 'c'.
This method is available if the IT\_REMOVE operator is defined. This method is available if the IT\_REMOVE operator is defined.
##### void name\_split(container\_t c, const string\_t str, const char sp)
Split the string 'str' around the character separator 'c'
into a set of string in the container 'c'.
This method is defined if the base type of the container is a string\_t type,
##### void name\_join(string\_t dst, container\_t c, const string\_t str)
Join the string 'str' and all the strings of the container 'c' into 'dst'.
This method is defined if the base type of the container is a string\_t type,
#### ALGO\_FOR\_EACH(container, oplist, func[, arguments..]) #### ALGO\_FOR\_EACH(container, oplist, func[, arguments..])
Apply the function 'func' to each element of the container 'container' of oplist 'oplist' : Apply the function 'func' to each element of the container 'container' of oplist 'oplist' :