~ubuntu-branches/ubuntu/warty/curl/warty-security

« back to all changes in this revision

Viewing changes to lib/formdata.h

  • Committer: Bazaar Package Importer
  • Author(s): Domenico Andreoli
  • Date: 2004-06-04 19:09:25 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040604190925-wy048bp31320r2z6
Tags: 7.12.0.is.7.11.2-1
* Reverted to version 7.11.2 (closes: #252348).
* Disabled support for libidn (closes: #252367). This is to leave
  curl in unstable as much similar as possible to the one in testing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#ifndef __FORMDATA_H
2
2
#define __FORMDATA_H
3
3
 
4
 
/*****************************************************************************
 
4
/***************************************************************************
5
5
 *                                  _   _ ____  _     
6
6
 *  Project                     ___| | | |  _ \| |    
7
7
 *                             / __| | | | |_) | |    
8
8
 *                            | (__| |_| |  _ <| |___ 
9
9
 *                             \___|\___/|_| \_\_____|
10
10
 *
11
 
 * Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
12
 
 *
13
 
 * In order to be useful for every potential user, curl and libcurl are
14
 
 * dual-licensed under the MPL and the MIT/X-derivate licenses.
15
 
 *
 
11
 * Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
 
12
 *
 
13
 * This software is licensed as described in the file COPYING, which
 
14
 * you should have received as part of this distribution. The terms
 
15
 * are also available at http://curl.haxx.se/docs/copyright.html.
 
16
 * 
16
17
 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17
18
 * copies of the Software, and permit persons to whom the Software is
18
 
 * furnished to do so, under the terms of the MPL or the MIT/X-derivate
19
 
 * licenses. You may pick one of these licenses.
 
19
 * furnished to do so, under the terms of the COPYING file.
20
20
 *
21
21
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
22
22
 * KIND, either express or implied.
23
23
 *
24
 
 * $Id: formdata.h,v 1.9 2001/12/14 12:59:16 bagder Exp $
25
 
 *****************************************************************************/
 
24
 * $Id: formdata.h,v 1.20 2004/04/23 10:37:52 bagder Exp $
 
25
 ***************************************************************************/
26
26
/* plain and simple linked list with lines to send */
27
27
struct FormData {
28
28
  struct FormData *next;
29
29
  char *line;
30
 
  long length;
 
30
  size_t length;
31
31
};
32
32
 
33
33
struct Form {
34
34
  struct FormData *data; /* current form line to send */
35
 
  int sent; /* number of bytes of the current line that has already
36
 
               been sent in a previous invoke */
 
35
  unsigned int sent; /* number of bytes of the current line that has already
 
36
                        been sent in a previous invoke */
37
37
};
38
38
 
39
39
/* used by FormAdd for temporary storage */
40
40
typedef struct FormInfo {
41
41
  char *name;
42
 
  long namelength;
 
42
  size_t namelength;
43
43
  char *value;
44
 
  long contentslength;
 
44
  size_t contentslength;
45
45
  char *contenttype;
46
46
  long flags;
 
47
  char *buffer;      /* pointer to existing buffer used for file upload */
 
48
  size_t bufferlength;
 
49
  char *showfilename; /* The file name to show. If not set, the actual
 
50
                         file name will be used */
47
51
  struct curl_slist* contentheader;
48
52
  struct FormInfo *more;
49
53
} FormInfo;
50
54
 
51
55
int Curl_FormInit(struct Form *form, struct FormData *formdata );
52
56
 
53
 
struct FormData *Curl_getFormData(struct HttpPost *post,
54
 
                                  int *size);
 
57
CURLcode
 
58
Curl_getFormData(struct FormData **,
 
59
                 struct curl_httppost *post,
 
60
                 curl_off_t *size);
55
61
 
56
62
/* fread() emulation */
57
 
int Curl_FormReader(char *buffer,
58
 
                    size_t size,
59
 
                    size_t nitems,
60
 
                    FILE *mydata);
 
63
size_t Curl_FormReader(char *buffer,
 
64
                       size_t size,
 
65
                       size_t nitems,
 
66
                       FILE *mydata);
61
67
 
62
 
/* possible (old) fread() emulation that copies at most one line */
63
 
int Curl_FormReadOneLine(char *buffer,
64
 
                         size_t size,
65
 
                         size_t nitems,
66
 
                         FILE *mydata);
 
68
/*
 
69
 * Curl_formpostheader() returns the first line of the formpost, the
 
70
 * request-header part (which is not part of the request-body like the rest of
 
71
 * the post).
 
72
 */
 
73
char *Curl_formpostheader(void *formp, size_t *len);
67
74
 
68
75
char *Curl_FormBoundary(void);
69
76