From 37f4877e569cdd0d1afa6bb0d7cd3a463ee75ac9 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 24 Jun 2006 21:46:41 +0000 Subject: Michael Wallner added curl_formget(), which allows an application to extract (serialise) a previously built formpost (as with curl_formadd()). --- include/curl/curl.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'include') diff --git a/include/curl/curl.h b/include/curl/curl.h index 79e71ca0a..1a118a36c 100644 --- a/include/curl/curl.h +++ b/include/curl/curl.h @@ -1158,6 +1158,26 @@ CURL_EXTERN CURLFORMcode curl_formadd(struct curl_httppost **httppost, struct curl_httppost **last_post, ...); +/* + * callback function for curl_formget() + * The void *arg pointer will be the one passed as second argument to curl_formget(). + * The character buffer passed to it must not be freed. + * Should return the buffer length passed to it as the argument "len" on success. + */ +typedef size_t (*curl_formget_callback)(void *arg, const char *buf, size_t len); + +/* + * NAME curl_formget() + * + * DESCRIPTION + * + * Serialize a curl_httppost struct built with curl_formadd(). + * Accepts a void pointer as second argument which will be passed to + * the curl_formget_callback function. + * Returns 0 on success. + */ +CURL_EXTERN int curl_formget(struct curl_httppost *form, void *arg, + curl_formget_callback append); /* * NAME curl_formfree() * -- cgit v1.2.3