~ubuntu-branches/ubuntu/lucid/curl/lucid-201101212007

« back to all changes in this revision

Viewing changes to include/curl/curl.h

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2008-02-08 11:20:41 UTC
  • mto: (3.1.1 lenny) (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 26.
  • Revision ID: james.westby@ubuntu.com-20080208112041-hed7sb5r6ghmjf8v
Tags: upstream-7.18.0
ImportĀ upstreamĀ versionĀ 7.18.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 *                            | (__| |_| |  _ <| |___
8
8
 *                             \___|\___/|_| \_\_____|
9
9
 *
10
 
 * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
 
10
 * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
11
11
 *
12
12
 * This software is licensed as described in the file COPYING, which
13
13
 * you should have received as part of this distribution. The terms
20
20
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21
21
 * KIND, either express or implied.
22
22
 *
23
 
 * $Id: curl.h,v 1.331 2007-10-15 18:32:01 patrickm Exp $
 
23
 * $Id: curl.h,v 1.341 2008-01-10 10:30:20 bagder Exp $
24
24
 ***************************************************************************/
25
25
 
26
26
/* If you have problems, all libcurl docs and details are found here:
29
29
 
30
30
#include "curlver.h" /* the libcurl version defines */
31
31
 
 
32
/*
 
33
 * Define WIN32 when build target is Win32 API
 
34
 */
 
35
 
 
36
#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
 
37
#define WIN32
 
38
#endif
 
39
 
32
40
#include <stdio.h>
33
41
#include <limits.h>
34
42
 
41
49
# include <time.h>
42
50
#endif /* defined (vms) */
43
51
 
 
52
#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__GNUC__) && \
 
53
  !defined(__CYGWIN__) || defined(__MINGW32__)
 
54
#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H))
 
55
/* The check above prevents the winsock2 inclusion if winsock.h already was
 
56
   included, since they can't co-exist without problems */
 
57
#include <winsock2.h>
 
58
#include <ws2tcpip.h>
 
59
#endif
 
60
#else
 
61
 
 
62
/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish
 
63
   libc5-based Linux systems. Only include it on system that are known to
 
64
   require it! */
 
65
#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || defined(__minix)
 
66
#include <sys/select.h>
 
67
#endif
 
68
 
 
69
#ifndef _WIN32_WCE
 
70
#include <sys/socket.h>
 
71
#endif
 
72
#ifndef __WATCOMC__
 
73
#include <sys/time.h>
 
74
#endif
 
75
#include <sys/types.h>
 
76
#endif
 
77
 
 
78
#ifdef __BEOS__
 
79
#include <support/SupportDefs.h>
 
80
#endif
 
81
 
 
82
#ifdef  __cplusplus
 
83
extern "C" {
 
84
#endif
 
85
 
44
86
typedef void CURL;
45
87
 
46
 
#ifdef  __cplusplus
47
 
extern "C" {
48
 
#endif
49
 
 
50
88
/*
51
89
 * Decorate exportable functions for Win32 DLL linking.
52
90
 * This avoids using a .def file for building libcurl.dll.
139
177
#undef FILESIZEBITS
140
178
#endif
141
179
 
142
 
#if defined(_WIN32) && !defined(WIN32)
143
 
/* Chris Lewis mentioned that he doesn't get WIN32 defined, only _WIN32 so we
144
 
   make this adjustment to catch this. */
145
 
#define WIN32 1
146
 
#endif
147
 
 
148
 
#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__GNUC__) && \
149
 
  !defined(__CYGWIN__) || defined(__MINGW32__)
150
 
#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H))
151
 
/* The check above prevents the winsock2 inclusion if winsock.h already was
152
 
   included, since they can't co-exist without problems */
153
 
#include <winsock2.h>
154
 
#include <ws2tcpip.h>
155
 
#endif
156
 
#else
157
 
 
158
 
/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish
159
 
   libc5-based Linux systems. Only include it on system that are known to
160
 
   require it! */
161
 
#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || defined(__minix)
162
 
#include <sys/select.h>
163
 
#endif
164
 
 
165
 
#ifndef _WIN32_WCE
166
 
#include <sys/socket.h>
167
 
#endif
168
 
#ifndef __WATCOMC__
169
 
#include <sys/time.h>
170
 
#endif
171
 
#include <sys/types.h>
172
 
#endif
173
 
 
174
180
#ifndef curl_socket_typedef
175
181
/* socket typedef */
176
182
#ifdef WIN32
224
230
     time for those who feel adventurous. */
225
231
#define CURL_MAX_WRITE_SIZE 16384
226
232
#endif
227
 
 
 
233
/* This is a magic return code for the write callback that, when returned,
 
234
   will signal libcurl to pause receving on the current transfer. */
 
235
#define CURL_WRITEFUNC_PAUSE 0x10000001
228
236
typedef size_t (*curl_write_callback)(char *buffer,
229
237
                                      size_t size,
230
238
                                      size_t nitems,
233
241
/* This is a return code for the read callback that, when returned, will
234
242
   signal libcurl to immediately abort the current transfer. */
235
243
#define CURL_READFUNC_ABORT 0x10000000
 
244
/* This is a return code for the read callback that, when returned, will
 
245
   signal libcurl to pause sending data on the current transfer. */
 
246
#define CURL_READFUNC_PAUSE 0x10000001
 
247
typedef int (*curl_seek_callback)(void *instream,
 
248
                                  curl_off_t offset,
 
249
                                  int origin); /* 'whence' */
 
250
 
236
251
typedef size_t (*curl_read_callback)(char *buffer,
237
252
                                      size_t size,
238
253
                                      size_t nitems,
251
266
  int family;
252
267
  int socktype;
253
268
  int protocol;
254
 
  socklen_t addrlen;
 
269
  unsigned int addrlen; /* addrlen was a socklen_t type before 7.18.0 but it
 
270
                           turned really ugly and painful on the systems that
 
271
                           lack this type */
255
272
  struct sockaddr addr;
256
273
};
257
274
 
487
504
                                          void *userptr);
488
505
 
489
506
typedef enum {
490
 
  CURLPROXY_HTTP = 0,
491
 
  CURLPROXY_SOCKS4 = 4,
492
 
  CURLPROXY_SOCKS5 = 5
493
 
} curl_proxytype;
 
507
  CURLPROXY_HTTP = 0,   /* added in 7.10 */
 
508
  CURLPROXY_SOCKS4 = 4, /* support added in 7.15.2, enum existed already
 
509
                           in 7.10 */
 
510
  CURLPROXY_SOCKS5 = 5, /* added in 7.10 */
 
511
  CURLPROXY_SOCKS4A = 6, /* added in 7.18.0 */
 
512
  CURLPROXY_SOCKS5_HOSTNAME = 7 /* Use the SOCKS5 protocol but pass along the
 
513
                                   host name rather than the IP address. added
 
514
                                   in 7.18.0 */
 
515
} curl_proxytype;  /* this enum was added in 7.10 */
494
516
 
495
517
#define CURLAUTH_NONE         0       /* nothing */
496
518
#define CURLAUTH_BASIC        (1<<0)  /* Basic (default) */
935
957
  CINIT(SHARE, OBJECTPOINT, 100),
936
958
 
937
959
  /* indicates type of proxy. accepted values are CURLPROXY_HTTP (default),
938
 
     CURLPROXY_SOCKS4 and CURLPROXY_SOCKS5. */
 
960
     CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and CURLPROXY_SOCKS5. */
939
961
  CINIT(PROXYTYPE, LONG, 101),
940
962
 
941
963
  /* Set the Accept-Encoding string. Use this to tell a server you would like
1159
1181
  /* POST volatile input fields. */
1160
1182
  CINIT(COPYPOSTFIELDS, OBJECTPOINT, 165),
1161
1183
 
 
1184
  /* set transfer mode (;type=<a|i>) when doing FTP via an HTTP proxy */
 
1185
  CINIT(PROXY_TRANSFER_MODE, LONG, 166),
 
1186
 
 
1187
  /* Callback function for seeking in the input stream */
 
1188
  CINIT(SEEKFUNCTION, FUNCTIONPOINT, 167),
 
1189
  CINIT(SEEKDATA, OBJECTPOINT, 168),
 
1190
 
1162
1191
  CURLOPT_LASTENTRY /* the last unused */
1163
1192
} CURLoption;
1164
1193
 
1241
1270
  CURL_TIMECOND_LAST
1242
1271
} curl_TimeCond;
1243
1272
 
1244
 
#ifdef __BEOS__
1245
 
#include <support/SupportDefs.h>
1246
 
#endif
1247
 
 
1248
1273
 
1249
1274
/* curl_strequal() and curl_strnequal() are subject for removal in a future
1250
1275
   libcurl, see lib/README.curlx for details */
1737
1762
 */
1738
1763
CURL_EXTERN const char *curl_share_strerror(CURLSHcode);
1739
1764
 
 
1765
/*
 
1766
 * NAME curl_easy_pause()
 
1767
 *
 
1768
 * DESCRIPTION
 
1769
 *
 
1770
 * The curl_easy_pause function pauses or unpauses transfers. Select the new
 
1771
 * state by setting the bitmask, use the convenience defines below.
 
1772
 *
 
1773
 */
 
1774
CURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask);
 
1775
 
 
1776
#define CURLPAUSE_RECV      (1<<0)
 
1777
#define CURLPAUSE_RECV_CONT (0)
 
1778
 
 
1779
#define CURLPAUSE_SEND      (1<<2)
 
1780
#define CURLPAUSE_SEND_CONT (0)
 
1781
 
 
1782
#define CURLPAUSE_ALL       (CURLPAUSE_RECV|CURLPAUSE_SEND)
 
1783
#define CURLPAUSE_CONT      (CURLPAUSE_RECV_CONT|CURLPAUSE_SEND_CONT)
 
1784
 
1740
1785
#ifdef  __cplusplus
1741
1786
}
1742
1787
#endif