aboutsummaryrefslogtreecommitdiff
path: root/lib/formdata.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2001-01-05 10:11:41 +0000
committerDaniel Stenberg <daniel@haxx.se>2001-01-05 10:11:41 +0000
commit4031104404c6ceed5e57134125dcdb6cac51c564 (patch)
tree18bd035e58e42180cf416d0d94d4726cd44d9d7f /lib/formdata.c
parent9f9cac7402f9f134be6f6d5b7fb830e9946a83d8 (diff)
Internal symbols that aren't static are now prefixed with 'Curl_'
Diffstat (limited to 'lib/formdata.c')
-rw-r--r--lib/formdata.c52
1 files changed, 20 insertions, 32 deletions
diff --git a/lib/formdata.c b/lib/formdata.c
index 8f86b980c..14d911d35 100644
--- a/lib/formdata.c
+++ b/lib/formdata.c
@@ -91,16 +91,10 @@ static void GetStr(char **string,
*
***************************************************************************/
-int curl_formparse(char *input,
- struct HttpPost **httppost,
- struct HttpPost **last_post)
-{
- return FormParse(input, httppost, last_post);
-}
-
#define FORM_FILE_SEPARATOR ','
#define FORM_TYPE_SEPARATOR ';'
+static
int FormParse(char *input,
struct HttpPost **httppost,
struct HttpPost **last_post)
@@ -298,6 +292,13 @@ int FormParse(char *input,
return 0;
}
+int curl_formparse(char *input,
+ struct HttpPost **httppost,
+ struct HttpPost **last_post)
+{
+ return FormParse(input, httppost, last_post);
+}
+
static int AddFormData(struct FormData **formp,
void *line,
long length)
@@ -339,7 +340,7 @@ static int AddFormDataf(struct FormData **formp,
}
-char *MakeFormBoundary(void)
+char *Curl_FormBoundary(void)
{
char *retstring;
static int randomizer=0; /* this is just so that two boundaries within
@@ -367,7 +368,7 @@ char *MakeFormBoundary(void)
}
/* Used from http.c */
-void FormFree(struct FormData *form)
+void Curl_FormFree(struct FormData *form)
{
struct FormData *next;
do {
@@ -400,8 +401,8 @@ void curl_formfree(struct HttpPost *form)
} while((form=next)); /* continue */
}
-struct FormData *getFormData(struct HttpPost *post,
- int *sizep)
+struct FormData *Curl_getFormData(struct HttpPost *post,
+ int *sizep)
{
struct FormData *form = NULL;
struct FormData *firstform;
@@ -415,7 +416,7 @@ struct FormData *getFormData(struct HttpPost *post,
if(!post)
return NULL; /* no input => no output! */
- boundary = MakeFormBoundary();
+ boundary = Curl_FormBoundary();
/* Make the first line of the output */
AddFormDataf(&form,
@@ -439,7 +440,7 @@ struct FormData *getFormData(struct HttpPost *post,
/* If used, this is a link to more file names, we must then do
the magic to include several files with the same field name */
- fileboundary = MakeFormBoundary();
+ fileboundary = Curl_FormBoundary();
size += AddFormDataf(&form,
"\r\nContent-Type: multipart/mixed,"
@@ -535,24 +536,11 @@ struct FormData *getFormData(struct HttpPost *post,
return firstform;
}
-int FormInit(struct Form *form, struct FormData *formdata )
+int Curl_FormInit(struct Form *form, struct FormData *formdata )
{
if(!formdata)
return 1; /* error */
-#if 0
- struct FormData *lastnode=formdata;
-
- /* find the last node in the list */
- while(lastnode->next) {
- lastnode = lastnode->next;
- }
-
- /* Now, make sure that we'll send a nice terminating sequence at the end
- * of the post. We *DONT* add this string to the size of the data since this
- * is actually AFTER the data. */
- AddFormDataf(&lastnode, "\r\n\r\n");
-#endif
form->data = formdata;
form->sent = 0;
@@ -560,10 +548,10 @@ int FormInit(struct Form *form, struct FormData *formdata )
}
/* fread() emulation */
-int FormReader(char *buffer,
- size_t size,
- size_t nitems,
- FILE *mydata)
+int Curl_FormReader(char *buffer,
+ size_t size,
+ size_t nitems,
+ FILE *mydata)
{
struct Form *form;
int wantedsize;
@@ -638,7 +626,7 @@ int main(int argc, char **argv)
}
}
- form=getFormData(httppost, &size);
+ form=Curl_getFormData(httppost, &size);
FormInit(&formread, form);