summaryrefslogtreecommitdiffstats
path: root/Source/CTest/Curl/formdata.h
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2004-10-05 13:34:20 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2004-10-05 13:34:20 (GMT)
commit609801fe67c95f9959468df8316a8f4a26943842 (patch)
treebe2cf804edae61b76806c95bf0965985e4f45aed /Source/CTest/Curl/formdata.h
parent50da0328472ad0f318f64a20876c474ad968fef3 (diff)
downloadCMake-609801fe67c95f9959468df8316a8f4a26943842.zip
CMake-609801fe67c95f9959468df8316a8f4a26943842.tar.gz
CMake-609801fe67c95f9959468df8316a8f4a26943842.tar.bz2
ENH: Update Curl to 7.12.1
Diffstat (limited to 'Source/CTest/Curl/formdata.h')
-rw-r--r--Source/CTest/Curl/formdata.h62
1 files changed, 36 insertions, 26 deletions
diff --git a/Source/CTest/Curl/formdata.h b/Source/CTest/Curl/formdata.h
index d1cc674..c6a78cd 100644
--- a/Source/CTest/Curl/formdata.h
+++ b/Source/CTest/Curl/formdata.h
@@ -2,18 +2,18 @@
#define __FORMDATA_H
/***************************************************************************
- * _ _ ____ _
- * Project ___| | | | _ \| |
- * / __| | | | |_) | |
- * | (__| |_| | _ <| |___
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2002, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2004, 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
* are also available at http://curl.haxx.se/docs/copyright.html.
- *
+ *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file.
@@ -23,34 +23,43 @@
*
* $Id$
***************************************************************************/
+
+enum formtype {
+ FORM_DATA, /* regular data */
+ FORM_FILE /* 'line' points to a file name we should read from */
+};
+
/* plain and simple linked list with lines to send */
struct FormData {
struct FormData *next;
+ enum formtype type;
char *line;
- long length;
+ size_t length;
};
struct Form {
struct FormData *data; /* current form line to send */
- int sent; /* number of bytes of the current line that has already
- been sent in a previous invoke */
+ 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 */
};
/* used by FormAdd for temporary storage */
typedef struct FormInfo {
char *name;
- long namelength;
+ bool name_alloc;
+ size_t namelength;
char *value;
- long contentslength;
+ bool value_alloc;
+ size_t contentslength;
char *contenttype;
+ bool contenttype_alloc;
long flags;
-
- /* CMC: Added support for buffer uploads */
char *buffer; /* pointer to existing buffer used for file upload */
- long bufferlength;
-
+ size_t bufferlength;
char *showfilename; /* The file name to show. If not set, the actual
file name will be used */
+ bool showfilename_alloc;
struct curl_slist* contentheader;
struct FormInfo *more;
} FormInfo;
@@ -59,20 +68,21 @@ int Curl_FormInit(struct Form *form, struct FormData *formdata );
CURLcode
Curl_getFormData(struct FormData **,
- struct HttpPost *post,
- int *size);
+ struct curl_httppost *post,
+ curl_off_t *size);
/* fread() emulation */
-int Curl_FormReader(char *buffer,
- size_t size,
- size_t nitems,
- FILE *mydata);
+size_t Curl_FormReader(char *buffer,
+ size_t size,
+ size_t nitems,
+ FILE *mydata);
-/* possible (old) fread() emulation that copies at most one line */
-int Curl_FormReadOneLine(char *buffer,
- size_t size,
- size_t nitems,
- FILE *mydata);
+/*
+ * Curl_formpostheader() returns the first line of the formpost, the
+ * request-header part (which is not part of the request-body like the rest of
+ * the post).
+ */
+char *Curl_formpostheader(void *formp, size_t *len);
char *Curl_FormBoundary(void);