tool_cfgable: Added GlobalConfig pointer to OperationConfig
authorSteve Holme <steve_holme@hotmail.com>
Wed, 26 Feb 2014 21:02:53 +0000 (21:02 +0000)
committerSteve Holme <steve_holme@hotmail.com>
Thu, 27 Feb 2014 20:20:17 +0000 (20:20 +0000)
In order to ease the moving of global options such as the error stream,
updated the OperationConfig structure to point to the GlobalConfig.

src/tool_cfgable.h
src/tool_getparam.c
src/tool_parsecfg.c

index e88b978..77c6037 100644 (file)
@@ -27,6 +27,8 @@
 
 #include "tool_metalink.h"
 
+struct GlobalConfig;
+
 struct OperationConfig {
   CURL *easy;               /* A copy of the handle from GlobalConfig */
   bool remote_time;
@@ -213,6 +215,7 @@ struct OperationConfig {
   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 */
 };
index e4cc69d..b9c5eb7 100644 (file)
@@ -1838,6 +1838,9 @@ ParameterError parse_args(struct GlobalConfig *config, int argc,
               /* Copy the easy handle */
               operation->next->easy = config->easy;
 
+              /* Set the global config pointer */
+              operation->next->global = config;
+
               /* Update the last operation pointer */
               config->last = operation->next;
 
index 9adbe82..53e2660 100644 (file)
@@ -236,6 +236,9 @@ int parseconfig(const char *filename, struct GlobalConfig *global)
             /* Copy the easy handle */
             operation->next->easy = global->easy;
 
+            /* Set the global config pointer */
+            operation->next->global = global;
+
             /* Update the last operation pointer */
             global->last = operation->next;