From 08655d8d5d0ea980227096366c231693198e61d6 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 21 Aug 2001 13:18:07 +0000 Subject: Georg Huettenegger's patch curl-7.8.1-pre5-patch-20010819 --- include/curl/curl.h | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/curl/curl.h b/include/curl/curl.h index 2f64a79df..0c92d7395 100644 --- a/include/curl/curl.h +++ b/include/curl/curl.h @@ -59,12 +59,15 @@ struct HttpPost { struct HttpPost *next; /* next entry in the list */ char *name; /* pointer to allocated name */ char *contents; /* pointer to allocated data contents */ + long contentslength; /* length of contents field */ char *contenttype; /* Content-Type */ struct HttpPost *more; /* if one field name has more than one file, this link should link to following files */ long flags; /* as defined below */ #define HTTPPOST_FILENAME (1<<0) /* specified content is a file name */ #define HTTPPOST_READFILE (1<<1) /* specified content is a file name */ +#define HTTPPOST_PTRCONTENTS (1<<2) /* contents is only stored pointer + do not free in formfree */ }; typedef int (*curl_progress_callback)(void *clientp, @@ -483,6 +486,32 @@ int curl_formparse(char *string, struct HttpPost **httppost, struct HttpPost **last_post); +/* name is uppercase CURLFORM_ */ +#ifdef CFINIT +#undef CFINIT +#endif +#define CFINIT(name) CURLFORM_ ## name + +typedef enum { + CFINIT(NOTHING), /********* the first one is unused ************/ + + /* */ + CFINIT(COPYNAME), + CFINIT(COPYCONTENTS), + CFINIT(PTRCONTENTS), + CFINIT(CONTENTSLENGTH), + CFINIT(FILE), + CFINIT(CONTENTTYPE), + CFINIT(END), + + CURLFORM_LASTENTRY /* the last unusued */ +} CURLformoption; + +/* new external form function */ +int curl_formadd(struct HttpPost **httppost, + struct HttpPost **last_post, + ...); + /* cleanup a form: */ void curl_formfree(struct HttpPost *form); @@ -495,8 +524,8 @@ char *curl_version(void); /* Escape and unescape URL encoding in strings. The functions return a new * allocated string or NULL if an error occurred. */ -char *curl_escape(char *string, int length); -char *curl_unescape(char *string, int length); +char *curl_escape(const char *string, int length); +char *curl_unescape(const char *string, int length); /* curl_global_init() should be invoked exactly once for each application that uses libcurl */ @@ -507,8 +536,8 @@ CURLcode curl_global_init(long flags); void curl_global_cleanup(void); /* This is the version number */ -#define LIBCURL_VERSION "7.8.1" -#define LIBCURL_VERSION_NUM 0x070801 +#define LIBCURL_VERSION "7.8.2-pre1" +#define LIBCURL_VERSION_NUM 0x070802 /* linked-list structure for the CURLOPT_QUOTE option (and other) */ struct curl_slist { -- cgit v1.2.3