STRPARSE.md: sync with recent changes

New functions and Curl_str_number() changed number return type.

Closes #16365
This commit is contained in:
Daniel Stenberg 2025-02-17 10:23:09 +01:00
parent bc6a404061
commit bd15d8beb3
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -94,11 +94,32 @@ Advance over a single ASCII space. Return non-zero on error.
## `Curl_str_number` ## `Curl_str_number`
~~~c ~~~c
int Curl_str_number(char **linep, size_t *nump, size_t max); int Curl_str_number(char **linep, curl_size_t *nump, size_t max);
~~~ ~~~
Get an unsigned decimal number. Leading zeroes are just swallowed. Return Get an unsigned decimal number not larger than `max`. Leading zeroes are just
non-zero on error. swallowed. Return non-zero on error. Returns error if there was not a single
digit.
## `Curl_str_hex`
~~~c
int Curl_str_hex(char **linep, curl_size_t *nump, size_t max);
~~~
Get an unsigned hexadecimal number not larger than `max`. Leading zeroes are
just swallowed. Return non-zero on error. Returns error if there was not a
single digit. Does *not* handled `0x` prefix.
## `Curl_str_octal`
~~~c
int Curl_str_octal(char **linep, curl_size_t *nump, size_t max);
~~~
Get an unsigned octal number not larger than `max`. Leading zeroes are just
swallowed. Return non-zero on error. Returns error if there was not a single
digit.
## `Curl_str_newline` ## `Curl_str_newline`
@ -107,3 +128,21 @@ int Curl_str_newline(char **linep);
~~~ ~~~
Check for a single CR or LF. Return non-zero on error */ Check for a single CR or LF. Return non-zero on error */
## `Curl_str_casecompare`
~~~c
int Curl_str_casecompare(struct Curl_str *str, const char *check);
~~~
Returns true if the provided string in the `str` argument matches the `check`
string case insensitively.
## `Curl_str_nudge`
~~~c
int Curl_str_nudge(struct Curl_str *str, size_t num);
~~~
Removes `num` bytes from the beginning (left) of the string kept in `str`. If
`num` is larger than the string, it instead returns an error.