Revert "Update to 7.40.1"
[platform/upstream/curl.git] / src / tool_cfgable.h
index 63e9f04..4ef2690 100644 (file)
@@ -7,7 +7,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution. The terms
  * KIND, either express or implied.
  *
  ***************************************************************************/
-#include "setup.h"
-
-typedef enum {
-  HTTPREQ_UNSPEC,
-  HTTPREQ_GET,
-  HTTPREQ_HEAD,
-  HTTPREQ_POST,
-  HTTPREQ_SIMPLEPOST,
-  HTTPREQ_CUSTOM,
-  HTTPREQ_LAST
-} HttpReq;
-
-typedef enum {
-  TRACE_NONE,  /* no trace/verbose output at all */
-  TRACE_BIN,   /* tcpdump inspired look */
-  TRACE_ASCII, /* like *BIN but without the hex output */
-  TRACE_PLAIN  /* -v/--verbose type */
-} trace;
-
-struct OutStruct {
-  char *filename;
-  bool alloc_filename;
-  FILE *stream;
-  struct Configurable *config;
-  curl_off_t bytes; /* amount written so far */
-  curl_off_t init;  /* original size (non-zero when appending) */
-};
+#include "tool_setup.h"
 
-/*
- * A chain of these 'getout' nodes contain URL's to fetch and where to
- * place URL's contents.
- */
-
-struct getout {
-  struct getout *next;      /* next one */
-  char          *url;       /* the URL we deal with */
-  char          *outfile;   /* where to store the output */
-  char          *infile;    /* file to upload, if GETOUT_UPLOAD is set */
-  int            flags;     /* options - composed of GETOUT_* bits */
-};
+#include "tool_sdecls.h"
 
-#define GETOUT_OUTFILE    (1<<0)  /* set when outfile is deemed done */
-#define GETOUT_URL        (1<<1)  /* set when URL is deemed done */
-#define GETOUT_USEREMOTE  (1<<2)  /* use remote file name locally */
-#define GETOUT_UPLOAD     (1<<3)  /* if set, -T has been used */
-#define GETOUT_NOUPLOAD   (1<<4)  /* if set, -T "" has been used */
+#include "tool_metalink.h"
 
-struct Configurable {
-  CURL *easy;               /* once we have one, we keep it here */
+struct GlobalConfig;
+
+struct OperationConfig {
+  CURL *easy;               /* A copy of the handle from GlobalConfig */
   bool remote_time;
   char *random_file;
   char *egd_file;
@@ -80,7 +41,7 @@ struct Configurable {
   bool cookiesession;       /* new session? */
   bool encoding;            /* Accept-Encoding please */
   bool tr_encoding;         /* Transfer-Encoding please */
-  long authtype;            /* auth bitmask */
+  unsigned long authtype;   /* auth bitmask */
   bool use_resume;
   bool resume_from_current;
   bool disable_epsv;
@@ -94,8 +55,8 @@ struct Configurable {
   char *postfields;
   curl_off_t postfieldsize;
   char *referer;
-  long timeout;
-  long connecttimeout;
+  double timeout;
+  double connecttimeout;
   long maxredirs;
   curl_off_t max_filesize;
   char *headerfile;
@@ -107,8 +68,12 @@ struct Configurable {
   char *range;
   long low_speed_limit;
   long low_speed_time;
-  bool showerror;
+  char *dns_servers;   /* dot notation: 1.1.1.1;2.2.2.2 */
+  char *dns_interface; /* interface name */
+  char *dns_ipv4_addr; /* dot notation */
+  char *dns_ipv6_addr; /* dot notation */
   char *userpwd;
+  char *login_options;
   char *tls_username;
   char *tls_password;
   char *tls_authtype;
@@ -118,9 +83,10 @@ struct Configurable {
   char *noproxy;
   char *mail_from;
   struct curl_slist *mail_rcpt;
+  char *mail_auth;
+  bool sasl_ir;             /* Enable/disable SASL initial response */
   bool proxytunnel;
   bool ftp_append;          /* APPE on ftp */
-  bool mute;                /* shutup */
   bool use_ascii;           /* select ascii or text transfer */
   bool autoreferer;         /* automatically set referer */
   bool failonerror;         /* fail on (HTTP) errors */
@@ -134,8 +100,6 @@ struct Configurable {
   bool netrc_opt;
   bool netrc;
   char *netrc_file;
-  bool noprogress;
-  bool isatty;              /* updated internally only if output is a tty */
   struct getout *url_list;  /* point to the first node */
   struct getout *url_last;  /* point to the last/current node */
   struct getout *url_get;   /* point to the node to fill in URL */
@@ -152,17 +116,10 @@ struct Configurable {
   char *pubkey;
   char *hostpubmd5;
   char *engine;
-  bool list_engines;
   bool crlf;
   char *customrequest;
   char *krblevel;
-  char *trace_dump;         /* file to dump the network trace to, or NULL */
-  FILE *trace_stream;
-  bool trace_fopened;
-  trace tracetype;
-  bool tracetime;           /* include timestamp? */
   long httpversion;
-  int progressmode;
   bool nobuffer;
   bool readbusy;            /* set when reading input returns EAGAIN */
   bool globoff;
@@ -178,8 +135,6 @@ struct Configurable {
   bool proxyanyauth;
   char *writeout;           /* %-styled format string to output */
   bool writeenv;            /* write results to environment, if available */
-  FILE *errors;             /* if stderr redirect is requested */
-  bool errors_fopened;
   struct curl_slist *quote;
   struct curl_slist *postquote;
   struct curl_slist *prequote;
@@ -188,6 +143,7 @@ struct Configurable {
   curl_TimeCond timecond;
   time_t condtime;
   struct curl_slist *headers;
+  struct curl_slist *proxyheaders;
   struct curl_httppost *httppost;
   struct curl_httppost *last_post;
   struct curl_slist *telnet_options;
@@ -223,22 +179,60 @@ struct Configurable {
   bool ignorecl;            /* --ignore-content-length */
   bool disable_sessionid;
 
-  char *libcurl;            /* output libcurl code to this file name */
   bool raw;
   bool post301;
   bool post302;
+  bool post303;
   bool nokeepalive;         /* for keepalive needs */
   long alivetime;
   bool content_disposition; /* use Content-disposition filename */
 
   int default_node_flags;   /* default flags to search for each 'node', which
                                is basically each given URL to transfer */
-  struct OutStruct *outs;
+
   bool xattr;               /* store metadata in extended attributes */
   long gssapi_delegation;
+  bool ssl_allow_beast;     /* allow this SSL vulnerability */
+
+  bool use_metalink;        /* process given URLs as metalink XML file */
+  metalinkfile *metalinkfile_list; /* point to the first node */
+  metalinkfile *metalinkfile_last; /* point to the last/current node */
+#ifdef CURLDEBUG
+  bool test_event_based;
+#endif
+  char *xoauth2_bearer;       /* XOAUTH2 bearer token */
+  bool nonpn;                 /* enable/disable TLS NPN extension */
+  bool noalpn;                /* enable/disable TLS ALPN extension */
+
+  struct GlobalConfig *global;
+  struct OperationConfig *prev;
+  struct OperationConfig *next; /* Always last in the struct */
+};
+
+struct GlobalConfig {
+  CURL *easy;                     /* Once we have one, we keep it here */
+  int showerror;                  /* -1 == unset, default => show errors
+                                      0 => -s is used to NOT show errors
+                                      1 => -S has been used to show errors */
+  bool mute;                      /* don't show messages, --silent given */
+  bool noprogress;                /* don't show progress bar --silent given */
+  bool isatty;                    /* Updated internally if output is a tty */
+  FILE *errors;                   /* Error stream, defaults to stderr */
+  bool errors_fopened;            /* Whether error stream isn't stderr */
+  char *trace_dump;               /* file to dump the network trace to */
+  FILE *trace_stream;
+  bool trace_fopened;
+  trace tracetype;
+  bool tracetime;                 /* include timestamp? */
+  int progressmode;               /* CURL_PROGRESS_BAR / CURL_PROGRESS_STATS */
+  char *libcurl;                  /* Output libcurl code to this file name */
 
-}; /* struct Configurable */
+  struct OperationConfig *first;
+  struct OperationConfig *current;
+  struct OperationConfig *last;   /* Always last in the struct */
+};
 
-void free_config_fields(struct Configurable *config);
+void config_init(struct OperationConfig *config);
+void config_free(struct OperationConfig *config);
 
 #endif /* HEADER_CURL_TOOL_CFGABLE_H */