~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): Michael Vogt
  • Date: 2008-06-18 15:21:57 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20080618152157-qq94aiequcq35w6b
Tags: 7.18.2-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Drop the stunnel build dependency.
  - Drop the build-dependency on libdb4.5-dev
  - Add build-dependency on openssh-server
  - Drop libssh2-1-dev from libcurl4-openssl-dev's Depends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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.341 2008-01-10 10:30:20 bagder Exp $
 
23
 * $Id: curl.h,v 1.352 2008-06-03 18:00:48 danf Exp $
24
24
 ***************************************************************************/
25
25
 
26
26
/* If you have problems, all libcurl docs and details are found here:
33
33
 * Define WIN32 when build target is Win32 API
34
34
 */
35
35
 
36
 
#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
 
36
#if (defined(_WIN32) || defined(__WIN32__)) && \
 
37
     !defined(WIN32) && !defined(__SYMBIAN32__)
37
38
#define WIN32
38
39
#endif
39
40
 
62
63
/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish
63
64
   libc5-based Linux systems. Only include it on system that are known to
64
65
   require it! */
65
 
#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || defined(__minix)
 
66
#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \
 
67
    defined(__minix) || defined(__SYMBIAN32__)
66
68
#include <sys/select.h>
67
69
#endif
68
70
 
86
88
typedef void CURL;
87
89
 
88
90
/*
89
 
 * Decorate exportable functions for Win32 DLL linking.
 
91
 * Decorate exportable functions for Win32 and Symbian OS DLL linking.
90
92
 * This avoids using a .def file for building libcurl.dll.
91
93
 */
92
 
#if (defined(WIN32) || defined(_WIN32)) && !defined(CURL_STATICLIB)
 
94
#if (defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__)) && \
 
95
     !defined(CURL_STATICLIB)
93
96
#if defined(BUILDING_LIBCURL)
94
97
#define CURL_EXTERN  __declspec(dllexport)
95
98
#else
99
102
 
100
103
#ifdef CURL_HIDDEN_SYMBOLS
101
104
/*
102
 
 * This definition is used to make external definitions visibile in the
 
105
 * This definition is used to make external definitions visible in the
103
106
 * shared library when symbols are hidden by default.  It makes no
104
107
 * difference when compiling applications whether this is set or not,
105
108
 * only when compiling the library.
115
118
 * platforms. We also provide a CURL_FORMAT_OFF_T define to use in *printf
116
119
 * format strings when outputting a variable of type curl_off_t.
117
120
 *
118
 
 * Note: "pocc -Ze" is MSVC compatibily mode and this sets _MSC_VER!
 
121
 * Note: "pocc -Ze" is MSVC compatibility mode and this sets _MSC_VER!
119
122
 */
120
123
 
121
 
#if (defined(_MSC_VER) && !defined(__POCC__)) || (defined(__LCC__) && defined(WIN32))
 
124
#if (defined(_MSC_VER) && !defined(__POCC__)) || (defined(__LCC__) && \
 
125
     defined(WIN32))
122
126
/* MSVC */
123
127
#ifdef _WIN32_WCE
124
128
  typedef long curl_off_t;
211
215
                                       do not free in formfree */
212
216
#define HTTPPOST_BUFFER (1<<4)      /* upload file from buffer */
213
217
#define HTTPPOST_PTRBUFFER (1<<5)   /* upload file from pointer contents */
 
218
#define HTTPPOST_CALLBACK (1<<6)    /* upload file contents by using the
 
219
                                       regular read callback to get the data
 
220
                                       and pass the given pointer as custom
 
221
                                       pointer */
214
222
 
215
223
  char *showfilename;               /* The file name to show. If not set, the
216
224
                                       actual file name will be used (if this
217
225
                                       is a file part) */
 
226
  void *userp;                      /* custom pointer used for
 
227
                                       HTTPPOST_CALLBACK posts */
218
228
};
219
229
 
220
230
typedef int (*curl_progress_callback)(void *clientp,
231
241
#define CURL_MAX_WRITE_SIZE 16384
232
242
#endif
233
243
/* This is a magic return code for the write callback that, when returned,
234
 
   will signal libcurl to pause receving on the current transfer. */
 
244
   will signal libcurl to pause receiving on the current transfer. */
235
245
#define CURL_WRITEFUNC_PAUSE 0x10000001
236
246
typedef size_t (*curl_write_callback)(char *buffer,
237
247
                                      size_t size,
246
256
#define CURL_READFUNC_PAUSE 0x10000001
247
257
typedef int (*curl_seek_callback)(void *instream,
248
258
                                  curl_off_t offset,
249
 
                                  int origin); /* 'whence' */
 
259
                                  int origin); /* 'whence' */
250
260
 
251
261
typedef size_t (*curl_read_callback)(char *buffer,
252
262
                                      size_t size,
369
379
  CURLE_WRITE_ERROR,             /* 23 */
370
380
  CURLE_OBSOLETE24,              /* 24 - NOT USED */
371
381
  CURLE_UPLOAD_FAILED,           /* 25 - failed upload "command" */
372
 
  CURLE_READ_ERROR,              /* 26 - could open/read from file */
 
382
  CURLE_READ_ERROR,              /* 26 - couldn't open/read from file */
373
383
  CURLE_OUT_OF_MEMORY,           /* 27 */
374
384
  /* Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error
375
385
           instead of a memory allocation error if CURL_DOES_CONVERSIONS
441
451
 
442
452
  CURLE_SSL_SHUTDOWN_FAILED,     /* 80 - Failed to shut down the SSL
443
453
                                    connection */
 
454
  CURLE_AGAIN,                   /* 81 - socket is not ready for send/recv,
 
455
                                    wait till it's ready and try again */
444
456
  CURL_LAST /* never use! */
445
457
} CURLcode;
446
458
 
672
684
 
673
685
  /* If the CURLOPT_INFILE is used, this can be used to inform libcurl about
674
686
   * how large the file being sent really is. That allows better error
675
 
   * checking and better verifies that the upload was succcessful. -1 means
 
687
   * checking and better verifies that the upload was successful. -1 means
676
688
   * unknown size.
677
689
   *
678
690
   * For large file support, there is also a _LARGE version of the key
684
696
  /* POST static input fields. */
685
697
  CINIT(POSTFIELDS, OBJECTPOINT, 15),
686
698
 
687
 
  /* Set the referer page (needed by some CGIs) */
 
699
  /* Set the referrer page (needed by some CGIs) */
688
700
  CINIT(REFERER, OBJECTPOINT, 16),
689
701
 
690
702
  /* Set the FTP PORT string (interface name, named or numerical IP address)
743
755
     "cookie awareness" */
744
756
  CINIT(COOKIEFILE, OBJECTPOINT, 31),
745
757
 
746
 
  /* What version to specifly try to use.
 
758
  /* What version to specifically try to use.
747
759
     See CURL_SSLVERSION defines below. */
748
760
  CINIT(SSLVERSION, LONG, 32),
749
761
 
804
816
  /* Data passed to the progress callback */
805
817
  CINIT(PROGRESSDATA, OBJECTPOINT, 57),
806
818
 
807
 
  /* We want the referer field set automatically when following locations */
 
819
  /* We want the referrer field set automatically when following locations */
808
820
  CINIT(AUTOREFERER, LONG, 58),
809
821
 
810
822
  /* Port of the proxy, can be set in the proxy string as well with:
901
913
     CURL_HTTP_VERSION* enums set below. */
902
914
  CINIT(HTTP_VERSION, LONG, 84),
903
915
 
904
 
  /* Specificly switch on or off the FTP engine's use of the EPSV command. By
 
916
  /* Specifically switch on or off the FTP engine's use of the EPSV command. By
905
917
     default, that one will always be attempted before the more traditional
906
918
     PASV command. */
907
919
  CINIT(FTP_USE_EPSV, LONG, 85),
971
983
  CINIT(HTTP200ALIASES, OBJECTPOINT, 104),
972
984
 
973
985
  /* Continue to send authentication (user+password) when following locations,
974
 
     even when hostname changed. This can potentionally send off the name
 
986
     even when hostname changed. This can potentially send off the name
975
987
     and password to whatever host the server decides. */
976
988
  CINIT(UNRESTRICTED_AUTH, LONG, 105),
977
989
 
978
 
  /* Specificly switch on or off the FTP engine's use of the EPRT command ( it
 
990
  /* Specifically switch on or off the FTP engine's use of the EPRT command ( it
979
991
     also disables the LPRT attempt). By default, those ones will always be
980
992
     attempted before the good old traditional PORT command. */
981
993
  CINIT(FTP_USE_EPRT, LONG, 106),
1156
1168
  CINIT(CONNECTTIMEOUT_MS, LONG, 156),
1157
1169
 
1158
1170
  /* set to zero to disable the libcurl's decoding and thus pass the raw body
1159
 
     data to the appliction even when it is encoded/compressed */
 
1171
     data to the application even when it is encoded/compressed */
1160
1172
  CINIT(HTTP_TRANSFER_DECODING, LONG, 157),
1161
1173
  CINIT(HTTP_CONTENT_DECODING, LONG, 158),
1162
1174
 
1313
1325
  CFINIT(END),
1314
1326
  CFINIT(OBSOLETE2),
1315
1327
 
1316
 
  CURLFORM_LASTENTRY /* the last unusued */
 
1328
  CFINIT(STREAM),
 
1329
 
 
1330
  CURLFORM_LASTENTRY /* the last unused */
1317
1331
} CURLformoption;
1318
1332
 
1319
1333
#undef CFINIT /* done */
1359
1373
 *
1360
1374
 * DESCRIPTION
1361
1375
 *
1362
 
 * Pretty advanved function for building multi-part formposts. Each invoke
 
1376
 * Pretty advanced function for building multi-part formposts. Each invoke
1363
1377
 * adds one part that together construct a full post. Then use
1364
1378
 * CURLOPT_HTTPPOST to send it off to libcurl.
1365
1379
 */
1369
1383
 
1370
1384
/*
1371
1385
 * callback function for curl_formget()
1372
 
 * The void *arg pointer will be the one passed as second argument to curl_formget().
 
1386
 * The void *arg pointer will be the one passed as second argument to
 
1387
 *   curl_formget().
1373
1388
 * The character buffer passed to it must not be freed.
1374
 
 * Should return the buffer length passed to it as the argument "len" on success.
 
1389
 * Should return the buffer length passed to it as the argument "len" on
 
1390
 *   success.
1375
1391
 */
1376
1392
typedef size_t (*curl_formget_callback)(void *arg, const char *buf, size_t len);
1377
1393
 
1579
1595
  CURLINFO_COOKIELIST       = CURLINFO_SLIST  + 28,
1580
1596
  CURLINFO_LASTSOCKET       = CURLINFO_LONG   + 29,
1581
1597
  CURLINFO_FTP_ENTRY_PATH   = CURLINFO_STRING + 30,
 
1598
  CURLINFO_REDIRECT_URL     = CURLINFO_STRING + 31,
1582
1599
  /* Fill in new entries below here! */
1583
1600
 
1584
 
  CURLINFO_LASTONE          = 30
 
1601
  CURLINFO_LASTONE          = 31
1585
1602
} CURLINFO;
1586
1603
 
1587
1604
/* CURLINFO_RESPONSE_CODE is the new name for the option previously known as
1614
1631
/* Different data locks for a single share */
1615
1632
typedef enum {
1616
1633
  CURL_LOCK_DATA_NONE = 0,
1617
 
  /*  CURL_LOCK_DATA_SHARE is used internaly to say that
 
1634
  /*  CURL_LOCK_DATA_SHARE is used internally to say that
1618
1635
   *  the locking is just made to change the internal state of the share
1619
1636
   *  itself.
1620
1637
   */
1656
1673
typedef enum {
1657
1674
  CURLSHOPT_NONE,  /* don't use */
1658
1675
  CURLSHOPT_SHARE,   /* specify a data type to share */
1659
 
  CURLSHOPT_UNSHARE, /* specify shich data type to stop sharing */
 
1676
  CURLSHOPT_UNSHARE, /* specify which data type to stop sharing */
1660
1677
  CURLSHOPT_LOCKFUNC,   /* pass in a 'curl_lock_function' pointer */
1661
1678
  CURLSHOPT_UNLOCKFUNC, /* pass in a 'curl_unlock_function' pointer */
1662
1679
  CURLSHOPT_USERDATA,   /* pass in a user data pointer used in the lock/unlock
1681
1698
} CURLversion;
1682
1699
 
1683
1700
/* The 'CURLVERSION_NOW' is the symbolic name meant to be used by
1684
 
   basicly all programs ever, that want to get version information. It is
 
1701
   basically all programs ever that want to get version information. It is
1685
1702
   meant to be a built-in version number for what kind of struct the caller
1686
1703
   expects. If the struct ever changes, we redefine the NOW to another enum
1687
1704
   from above. */
1791
1808
#include "easy.h" /* nothing in curl is fun without the easy stuff */
1792
1809
#include "multi.h"
1793
1810
 
 
1811
/* the typechecker doesn't work in C++ (yet) */
 
1812
#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && \
 
1813
    !defined(__cplusplus) && !defined(CURL_DISABLE_TYPECHECK)
 
1814
#include "typecheck-gcc.h"
 
1815
#else
 
1816
#if defined(__STDC__) && (__STDC__ >= 1)
 
1817
/* This preprocessor magic that replaces a call with the exact same call is
 
1818
   only done to make sure application authors pass exactly three arguments
 
1819
   to these functions. */
 
1820
#define curl_easy_setopt(handle,opt,param) curl_easy_setopt(handle,opt,param)
 
1821
#define curl_easy_getinfo(handle,info,arg) curl_easy_getinfo(handle,info,arg)
 
1822
#define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param)
 
1823
#define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param)
 
1824
#endif /* __STDC__ >= 1 */
 
1825
#endif /* gcc >= 4.3 && !__cplusplus */
 
1826
 
1794
1827
#endif /* __CURL_CURL_H */