summaryrefslogtreecommitdiffstats
path: root/Utilities/cmcurl/lib/formdata.h
diff options
context:
space:
mode:
Diffstat (limited to 'Utilities/cmcurl/lib/formdata.h')
-rw-r--r--Utilities/cmcurl/lib/formdata.h29
1 files changed, 15 insertions, 14 deletions
diff --git a/Utilities/cmcurl/lib/formdata.h b/Utilities/cmcurl/lib/formdata.h
index 4ca0f3c..22f504b 100644
--- a/Utilities/cmcurl/lib/formdata.h
+++ b/Utilities/cmcurl/lib/formdata.h
@@ -1,6 +1,5 @@
-#ifndef __FORMDATA_H
-#define __FORMDATA_H
-
+#ifndef HEADER_CURL_FORMDATA_H
+#define HEADER_CURL_FORMDATA_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
@@ -8,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -21,14 +20,15 @@
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
- * $Id$
***************************************************************************/
enum formtype {
FORM_DATA, /* form metadata (convert to network encoding if necessary) */
FORM_CONTENT, /* form content (never convert) */
- FORM_FILE /* 'line' points to a file name we should read from
- to create the form data (never convert) */
+ FORM_CALLBACK, /* 'line' points to the custom pointer we pass to the callback
+ */
+ FORM_FILE /* 'line' points to a file name we should read from
+ to create the form data (never convert) */
};
/* plain and simple linked list with lines to send */
@@ -44,6 +44,7 @@ struct Form {
size_t sent; /* number of bytes of the current line that has
already been sent in a previous invoke */
FILE *fp; /* file to read from */
+ curl_read_callback fread_func; /* fread callback pointer */
};
/* used by FormAdd for temporary storage */
@@ -62,17 +63,18 @@ typedef struct FormInfo {
char *showfilename; /* The file name to show. If not set, the actual
file name will be used */
bool showfilename_alloc;
+ char *userp; /* pointer for the read callback */
struct curl_slist* contentheader;
struct FormInfo *more;
} FormInfo;
int Curl_FormInit(struct Form *form, struct FormData *formdata );
-CURLcode
-Curl_getFormData(struct FormData **,
- struct curl_httppost *post,
- const char *custom_contenttype,
- curl_off_t *size);
+CURLcode Curl_getformdata(struct SessionHandle *data,
+ struct FormData **,
+ struct curl_httppost *post,
+ const char *custom_contenttype,
+ curl_off_t *size);
/* fread() emulation */
size_t Curl_FormReader(char *buffer,
@@ -93,5 +95,4 @@ void Curl_formclean(struct FormData **);
CURLcode Curl_formconvert(struct SessionHandle *, struct FormData *);
-#endif
-
+#endif /* HEADER_CURL_FORMDATA_H */