diff options
author | Daniel Stenberg <daniel@haxx.se> | 2002-05-21 07:44:27 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2002-05-21 07:44:27 +0000 |
commit | 5d2944c21185200ebc1ba194fd8214557bb62e66 (patch) | |
tree | e9f1e3613312ea188ba97a7278588e3f7227c6b6 /include | |
parent | fe3ba1dd115c2cea2ec20a91f044cd5a59e483b1 (diff) |
curl_formadd() now returns 'CURLFORMcode' instead of int, to better enable
checking for particular errors. curl/curl.h defines the errros
Diffstat (limited to 'include')
-rw-r--r-- | include/curl/curl.h | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/include/curl/curl.h b/include/curl/curl.h index 237b24b24..8833ad7e8 100644 --- a/include/curl/curl.h +++ b/include/curl/curl.h @@ -656,7 +656,35 @@ struct curl_forms { }; /* use this for multipart formpost building */ -int curl_formadd(struct curl_httppost **httppost, +/* Returns code for curl_formadd() + * + * Returns: + * CURL_FORMADD_OK on success + * CURL_FORMADD_MEMORY if the FormInfo allocation fails + * CURL_FORMADD_OPTION_TWICE if one option is given twice for one Form + * CURL_FORMADD_NULL if a null pointer was given for a char + * CURL_FORMADD_MEMORY if the allocation of a FormInfo struct failed + * CURL_FORMADD_UNKNOWN_OPTION if an unknown option was used + * CURL_FORMADD_INCOMPLETE if the some FormInfo is not complete (or error) + * CURL_FORMADD_MEMORY if a HttpPost struct cannot be allocated + * CURL_FORMADD_MEMORY if some allocation for string copying failed. + * CURL_FORMADD_ILLEGAL_ARRAY if an illegal option is used in an array + * + ***************************************************************************/ +typedef enum { + CURL_FORMADD_OK, /* first, no error */ + + CURL_FORMADD_MEMORY, + CURL_FORMADD_OPTION_TWICE, + CURL_FORMADD_NULL, + CURL_FORMADD_UNKNOWN_OPTION, + CURL_FORMADD_INCOMPLETE, + CURL_FORMADD_ILLEGAL_ARRAY, + + CURL_FORMADD_LAST /* last */ +} CURLFORMcode; + +CURLFORMcode curl_formadd(struct curl_httppost **httppost, struct curl_httppost **last_post, ...); |