Initial revision
[platform/upstream/curl.git] / lib / formdata.h
1 #ifndef __FORMDATA_H
2 #define __FORMDATA_H
3
4 /*****************************************************************************
5  *                                  _   _ ____  _     
6  *  Project                     ___| | | |  _ \| |    
7  *                             / __| | | | |_) | |    
8  *                            | (__| |_| |  _ <| |___ 
9  *                             \___|\___/|_| \_\_____|
10  *
11  *  The contents of this file are subject to the Mozilla Public License
12  *  Version 1.0 (the "License"); you may not use this file except in
13  *  compliance with the License. You may obtain a copy of the License at
14  *  http://www.mozilla.org/MPL/
15  *
16  *  Software distributed under the License is distributed on an "AS IS"
17  *  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
18  *  License for the specific language governing rights and limitations
19  *  under the License.
20  *
21  *  The Original Code is Curl.
22  *
23  *  The Initial Developer of the Original Code is Daniel Stenberg.
24  *
25  *  Portions created by the Initial Developer are Copyright (C) 1998.
26  *  All Rights Reserved.
27  *
28  *  Contributor(s):
29  *   Rafael Sagula <sagula@inf.ufrgs.br>
30  *   Sampo Kellomaki <sampo@iki.fi>
31  *   Linas Vepstas <linas@linas.org>
32  *   Bjorn Reese <breese@imada.ou.dk>
33  *   Johan Anderson <johan@homemail.com>
34  *   Kjell Ericson <Kjell.Ericson@haxx.nu>
35  *   Troy Engel <tengel@palladium.net>
36  *   Ryan Nelson <ryan@inch.com>
37  *   Bjorn Stenberg <Bjorn.Stenberg@haxx.nu>
38  *   Angus Mackay <amackay@gus.ml.org>
39  *
40  * ------------------------------------------------------------
41  * Main author:
42  * - Daniel Stenberg <Daniel.Stenberg@haxx.nu>
43  *
44  *      http://curl.haxx.nu
45  *
46  * $Source$
47  * $Revision$
48  * $Date$
49  * $Author$
50  * $State$
51  * $Locker$
52  *
53  * ------------------------------------------------------------
54  * $Log$
55  * Revision 1.1  1999-12-29 14:21:22  bagder
56  * Initial revision
57  *
58  * Revision 1.4  1999/09/06 06:59:40  dast
59  * Changed email info
60  *
61  * Revision 1.3  1999/08/13 07:34:47  dast
62  * Changed the URL in the header
63  *
64  * Revision 1.2  1999/07/30 12:59:47  dast
65  * FormFree() was added to properly cleanup after a form was posted.
66  *
67  * Revision 1.1.1.1  1999/03/11 22:23:34  dast
68  * Imported sources
69  *
70  ****************************************************************************/
71 /* plain and simple linked list with lines to send */
72 struct FormData {
73   struct FormData *next;
74   char *line;
75   long length;
76 };
77
78 struct Form {
79   struct FormData *data; /* current form line to send */
80   int sent; /* number of bytes of the current line that has already
81                been sent in a previous invoke */
82 };
83
84 int FormParse(char *string,
85               struct HttpPost **httppost,
86               struct HttpPost **last_post);
87
88 int FormInit(struct Form *form, struct FormData *formdata );
89
90 struct FormData *getFormData(struct HttpPost *post,
91                              int *size);
92
93 /* fread() emulation */
94 int FormReader(char *buffer,
95                size_t size,
96                size_t nitems,
97                FILE *mydata);
98
99 char *MakeFormBoundary(void);
100
101 void FormFree(struct FormData *);
102
103 #endif