mirror of
https://github.com/curl/curl.git
synced 2026-07-24 19:17:20 +03:00
urlapi: add curl_url_strerror()
Add curl_url_strerror() to convert CURLUcode into readable string and facilitate easier troubleshooting in programs using URL API. Extend CURLUcode with CURLU_LAST for iteration in unit tests. Update man pages with a mention of new function. Update example code and tests with new functionality where it fits. Closes #7605
This commit is contained in:
parent
f0b8d1c5f6
commit
3363eeb262
25 changed files with 233 additions and 72 deletions
|
|
@ -47,7 +47,8 @@ typedef enum {
|
|||
CURLUE_NO_HOST, /* 14 */
|
||||
CURLUE_NO_PORT, /* 15 */
|
||||
CURLUE_NO_QUERY, /* 16 */
|
||||
CURLUE_NO_FRAGMENT /* 17 */
|
||||
CURLUE_NO_FRAGMENT, /* 17 */
|
||||
CURLUE_LAST
|
||||
} CURLUcode;
|
||||
|
||||
typedef enum {
|
||||
|
|
@ -118,6 +119,12 @@ CURL_EXTERN CURLUcode curl_url_get(CURLU *handle, CURLUPart what,
|
|||
CURL_EXTERN CURLUcode curl_url_set(CURLU *handle, CURLUPart what,
|
||||
const char *part, unsigned int flags);
|
||||
|
||||
/*
|
||||
* curl_url_strerror() turns a CURLUcode value into the equivalent human
|
||||
* readable error string. This is useful for printing meaningful error
|
||||
* messages.
|
||||
*/
|
||||
CURL_EXTERN const char *curl_url_strerror(CURLUcode);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end of extern "C" */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue