~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): Domenico Andreoli
  • Date: 2009-11-05 10:11:57 UTC
  • mto: (3.3.3 squeeze)
  • mto: This revision was merged to the branch mainline in revision 41.
  • Revision ID: james.westby@ubuntu.com-20091105101157-bj4sosg9l00k9c08
Tags: upstream-7.19.7
ImportĀ upstreamĀ versionĀ 7.19.7

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.383 2009-04-28 11:19:10 bagder Exp $
 
23
 * $Id: curl.h,v 1.396 2009-10-16 13:30:31 yangtse Exp $
24
24
 ***************************************************************************/
25
25
 
26
26
/*
31
31
 *   http://cool.haxx.se/mailman/listinfo/curl-library/
32
32
 */
33
33
 
 
34
/*
 
35
 * Leading 'curl' path on the 'curlbuild.h' include statement is
 
36
 * required to properly allow building outside of the source tree,
 
37
 * due to the fact that in this case 'curlbuild.h' is generated in
 
38
 * a subdirectory of the build tree while 'curl.h actually remains
 
39
 * in a subdirectory of the source tree.
 
40
 */
 
41
 
34
42
#include "curlver.h"         /* libcurl version defines   */
35
43
#include "curl/curlbuild.h"  /* libcurl build definitions */
36
44
#include "curlrules.h"       /* libcurl rules enforcement */
48
56
#include <limits.h>
49
57
 
50
58
/* The include stuff here below is mainly for time_t! */
51
 
#ifdef vms
52
 
# include <types.h>
53
 
# include <time.h>
54
 
#else
55
 
# include <sys/types.h>
56
 
# include <time.h>
57
 
#endif /* defined (vms) */
 
59
#include <sys/types.h>
 
60
#include <time.h>
58
61
 
59
62
#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__GNUC__) && \
60
63
  !defined(__CYGWIN__) || defined(__MINGW32__)
70
73
   libc5-based Linux systems. Only include it on system that are known to
71
74
   require it! */
72
75
#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \
73
 
    defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY)
 
76
    defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \
 
77
    defined(ANDROID)
74
78
#include <sys/select.h>
75
79
#endif
76
80
 
77
81
#ifndef _WIN32_WCE
78
82
#include <sys/socket.h>
79
83
#endif
80
 
#if !defined(WIN32) && !defined(__WATCOMC__)
 
84
#if !defined(WIN32) && !defined(__WATCOMC__) && !defined(__VXWORKS__)
81
85
#include <sys/time.h>
82
86
#endif
83
87
#include <sys/types.h>
178
182
     time for those who feel adventurous. */
179
183
#define CURL_MAX_WRITE_SIZE 16384
180
184
#endif
 
185
 
 
186
#ifndef CURL_MAX_HTTP_HEADER
 
187
/* The only reason to have a max limit for this is to avoid the risk of a bad
 
188
   server feeding libcurl with a never-ending header that will cause reallocs
 
189
   infinitely */
 
190
#define CURL_MAX_HTTP_HEADER (100*1024)
 
191
#endif
 
192
 
 
193
 
181
194
/* This is a magic return code for the write callback that, when returned,
182
195
   will signal libcurl to pause receiving on the current transfer. */
183
196
#define CURL_WRITEFUNC_PAUSE 0x10000001
186
199
                                      size_t nitems,
187
200
                                      void *outstream);
188
201
 
189
 
/* this is the return codes for the seek callbacks */
 
202
/* These are the return codes for the seek callbacks */
190
203
#define CURL_SEEKFUNC_OK       0
191
204
#define CURL_SEEKFUNC_FAIL     1 /* fail the entire transfer */
192
205
#define CURL_SEEKFUNC_CANTSEEK 2 /* tell libcurl seeking can't be done, so
497
510
 
498
511
#define CURL_ERROR_SIZE 256
499
512
 
 
513
struct curl_khkey {
 
514
  const char *key; /* points to a zero-terminated string encoded with base64
 
515
                      if len is zero, otherwise to the "raw" data */
 
516
  size_t len;
 
517
  enum type {
 
518
    CURLKHTYPE_UNKNOWN,
 
519
    CURLKHTYPE_RSA1,
 
520
    CURLKHTYPE_RSA,
 
521
    CURLKHTYPE_DSS
 
522
  } keytype;
 
523
};
 
524
 
 
525
/* this is the set of return values expected from the curl_sshkeycallback
 
526
   callback */
 
527
enum curl_khstat {
 
528
  CURLKHSTAT_FINE_ADD_TO_FILE,
 
529
  CURLKHSTAT_FINE,
 
530
  CURLKHSTAT_REJECT, /* reject the connection, return an error */
 
531
  CURLKHSTAT_DEFER,  /* do not accept it, but we can't answer right now so
 
532
                        this causes a CURLE_DEFER error but otherwise the
 
533
                        connection will be left intact etc */
 
534
  CURLKHSTAT_LAST    /* not for use, only a marker for last-in-list */
 
535
};
 
536
 
 
537
/* this is the set of status codes pass in to the callback */
 
538
enum curl_khmatch {
 
539
  CURLKHMATCH_OK,       /* match */
 
540
  CURLKHMATCH_MISMATCH, /* host found, key mismatch! */
 
541
  CURLKHMATCH_MISSING,  /* no matching host/key found */
 
542
  CURLKHMATCH_LAST      /* not for use, only a marker for last-in-list */
 
543
};
 
544
 
 
545
typedef int
 
546
  (*curl_sshkeycallback) (CURL *easy,     /* easy handle */
 
547
                          const struct curl_khkey *knownkey, /* known */
 
548
                          const struct curl_khkey *foundkey, /* found */
 
549
                          enum curl_khmatch, /* libcurl's view on the keys */
 
550
                          void *clientp); /* custom pointer passed from app */
 
551
 
500
552
/* parameter for the CURLOPT_USE_SSL option */
501
553
typedef enum {
502
554
  CURLUSESSL_NONE,    /* do not attempt to use SSL */
1201
1253
  CINIT(TFTP_BLKSIZE, LONG, 178),
1202
1254
 
1203
1255
  /* Socks Service */
1204
 
  CINIT(SOCKS5_GSSAPI_SERVICE, LONG, 179),
 
1256
  CINIT(SOCKS5_GSSAPI_SERVICE, OBJECTPOINT, 179),
1205
1257
 
1206
1258
  /* Socks Service */
1207
1259
  CINIT(SOCKS5_GSSAPI_NEC, LONG, 180),
1218
1270
     to all protocols except FILE and SCP. */
1219
1271
  CINIT(REDIR_PROTOCOLS, LONG, 182),
1220
1272
 
 
1273
  /* set the SSH knownhost file name to use */
 
1274
  CINIT(SSH_KNOWNHOSTS, OBJECTPOINT, 183),
 
1275
 
 
1276
  /* set the SSH host key callback, must point to a curl_sshkeycallback
 
1277
     function */
 
1278
  CINIT(SSH_KEYFUNCTION, FUNCTIONPOINT, 184),
 
1279
 
 
1280
  /* set the SSH host key callback custom pointer */
 
1281
  CINIT(SSH_KEYDATA, OBJECTPOINT, 185),
 
1282
 
1221
1283
  CURLOPT_LASTENTRY /* the last unused */
1222
1284
} CURLoption;
1223
1285
 
1516
1578
 * DESCRIPTION
1517
1579
 *
1518
1580
 * curl_global_init() should be invoked exactly once for each application that
1519
 
 * uses libcurl and before any call of other libcurl function.
 
1581
 * uses libcurl and before any call of other libcurl functions.
1520
1582
 *
1521
1583
 * This function is not thread-safe!
1522
1584
 */
1790
1852
#define CURL_VERSION_LARGEFILE (1<<9)  /* supports files bigger than 2GB */
1791
1853
#define CURL_VERSION_IDN       (1<<10) /* International Domain Names support */
1792
1854
#define CURL_VERSION_SSPI      (1<<11) /* SSPI is supported */
1793
 
#define CURL_VERSION_CONV      (1<<12) /* character conversions are
1794
 
                                          supported */
 
1855
#define CURL_VERSION_CONV      (1<<12) /* character conversions supported */
 
1856
#define CURL_VERSION_CURLDEBUG (1<<13) /* debug memory tracking supported */
1795
1857
 
1796
1858
/*
1797
1859
 * NAME curl_version_info()