]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
STRPARSE.md: sync with recent changes
authorDaniel Stenberg <daniel@haxx.se>
Mon, 17 Feb 2025 09:23:09 +0000 (10:23 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 17 Feb 2025 13:40:52 +0000 (14:40 +0100)
New functions and Curl_str_number() changed number return type.

Closes #16365

docs/internals/STRPARSE.md

index a50448cdff94cccf0356523cff259fe5d413debb..0784bb9345407b2123c07430ebb58e686fed60a2 100644 (file)
@@ -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.