From: Daniel Stenberg Date: Mon, 17 Feb 2025 09:23:09 +0000 (+0100) Subject: STRPARSE.md: sync with recent changes X-Git-Tag: curl-8_13_0~441 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bd15d8beb3b08bcd7fca56b9948b8dcb6003325f;p=thirdparty%2Fcurl.git STRPARSE.md: sync with recent changes New functions and Curl_str_number() changed number return type. Closes #16365 --- diff --git a/docs/internals/STRPARSE.md b/docs/internals/STRPARSE.md index a50448cdff..0784bb9345 100644 --- a/docs/internals/STRPARSE.md +++ b/docs/internals/STRPARSE.md @@ -94,11 +94,32 @@ Advance over a single ASCII space. Return non-zero on error. ## `Curl_str_number` ~~~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 -non-zero on error. +Get an unsigned decimal 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_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` @@ -107,3 +128,21 @@ int Curl_str_newline(char **linep); ~~~ 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.