* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2012, 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
unsigned char *data, size_t size,
void *userdata)
{
- struct Configurable *config = userdata;
+ struct OperationConfig *config = userdata;
FILE *output = config->errors;
const char *text;
struct timeval tv;
}
void progressbarinit(struct ProgressData *bar,
- struct Configurable *config)
+ struct OperationConfig *config)
{
#ifdef __EMX__
/* 20000318 mgs */
bar->out = config->errors;
}
-
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2013, 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
};
void progressbarinit(struct ProgressData *bar,
- struct Configurable *config);
+ struct OperationConfig *config);
/*
** callback for CURLOPT_PROGRESSFUNCTION
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2012, 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
{
size_t rc;
struct OutStruct *outs = userdata;
- struct Configurable *config = outs->config;
+ struct OperationConfig *config = outs->config;
/*
* Once that libcurl has called back tool_write_cb() the returned value
#include "memdebug.h" /* keep this as LAST include */
-void config_init(struct Configurable* config)
+void config_init(struct OperationConfig* config)
{
- memset(config, 0, sizeof(struct Configurable));
+ memset(config, 0, sizeof(struct OperationConfig));
config->errors = stderr; /* default errors to stderr */
config->postfieldsize = -1;
config->proto_redir_present = FALSE;
}
-static void free_config_fields(struct Configurable *config)
+static void free_config_fields(struct OperationConfig *config)
{
struct getout *urlnode;
Curl_safefree(config->libcurl);
}
-void config_free(struct Configurable *config)
+void config_free(struct OperationConfig *config)
{
- struct Configurable *last = config;
+ struct OperationConfig *last = config;
/* Find the last config structure */
while(last->next)
/* Free each of the structures in reverse order */
do {
- struct Configurable *prev = last->prev;
+ struct OperationConfig *prev = last->prev;
if(prev)
last->easy = NULL;
#include "tool_metalink.h"
-struct Configurable {
+struct OperationConfig {
CURL *easy; /* once we have one, we keep it here */
bool remote_time;
char *random_file;
bool nonpn; /* enable/disable TLS NPN extension */
bool noalpn; /* enable/disable TLS ALPN extension */
- struct Configurable* prev;
- struct Configurable* next; /* Always last in the struct */
+ struct OperationConfig* prev;
+ struct OperationConfig* next; /* Always last in the struct */
};
-void config_init(struct Configurable* config);
-void config_free(struct Configurable* config);
+void config_init(struct OperationConfig* config);
+void config_free(struct OperationConfig* config);
#endif /* HEADER_CURL_TOOL_CFGABLE_H */
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2012, 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
* HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\SafeProcessSearchMode
*/
-CURLcode FindWin32CACert(struct Configurable *config, const char *bundle_file)
+CURLcode FindWin32CACert(struct OperationConfig *config,
+ const char *bundle_file)
{
CURLcode result = CURLE_OK;
#endif /* WIN32 */
#endif /* MSDOS || WIN32 */
-
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2012, 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
#ifdef WIN32
-CURLcode FindWin32CACert(struct Configurable *config, const char *bundle_file);
+CURLcode FindWin32CACert(struct OperationConfig *config, const char *bundle_file);
#endif /* WIN32 */
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2012, 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
return CURLE_OK;
}
-void dumpeasysrc(struct Configurable *config)
+void dumpeasysrc(struct OperationConfig *config)
{
struct curl_slist *ptr;
char *o = config->libcurl;
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2012, 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
extern CURLcode easysrc_addf(struct curl_slist **plist, const char *fmt, ...);
extern CURLcode easysrc_perform(void);
extern CURLcode easysrc_cleanup(void);
-void dumpeasysrc(struct Configurable *config);
+void dumpeasysrc(struct OperationConfig *config);
#endif /* CURL_DISABLE_LIBCURL_OPTION */
*
***************************************************************************/
-int formparse(struct Configurable *config,
+int formparse(struct OperationConfig *config,
const char *input,
struct curl_httppost **httppost,
struct curl_httppost **last_post,
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2012, 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
***************************************************************************/
#include "tool_setup.h"
-int formparse(struct Configurable *config,
+int formparse(struct OperationConfig *config,
const char *input,
struct curl_httppost **httppost,
struct curl_httppost **last_post,
char *nextarg, /* NULL if unset */
bool *usedarg, /* set to TRUE if the arg
has been used */
- struct Configurable *config)
+ struct OperationConfig *config)
{
char letter;
char subletter = '\0'; /* subletters can only occur on long options */
return PARAM_OK;
}
-ParameterError parse_args(struct Configurable *config, int argc,
+ParameterError parse_args(struct OperationConfig *config, int argc,
argv_item_t argv[])
{
int i;
(config->url_list && config->url_list->url)) {
/* Allocate the next config */
- config->next = malloc(sizeof(struct Configurable));
+ config->next = malloc(sizeof(struct OperationConfig));
if(config->next) {
/* Initialise the newly created config */
config_init(config->next);
PARAM_LAST
} ParameterError;
-struct Configurable;
+struct OperationConfig;
ParameterError getparameter(char *flag,
char *nextarg,
bool *usedarg,
- struct Configurable *config);
+ struct OperationConfig *config);
#ifdef UNITTESTS
void parse_cert_parameter(const char *cert_parameter,
char **passphrase);
#endif
-ParameterError parse_args(struct Configurable *config, int argc,
+ParameterError parse_args(struct OperationConfig *config, int argc,
argv_item_t argv[]);
#endif /* HEADER_CURL_TOOL_GETPARAM_H */
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2012, 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
}
}
-int SetHTTPrequest(struct Configurable *config, HttpReq req, HttpReq *store)
+int SetHTTPrequest(struct OperationConfig *config, HttpReq req, HttpReq *store)
{
if((*store == HTTPREQ_UNSPEC) ||
(*store == req)) {
warnf(config, "You can only select one HTTP request!\n");
return 1;
}
-
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2012, 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
const char *param2text(int res);
-int SetHTTPrequest(struct Configurable *config, HttpReq req, HttpReq *store);
+int SetHTTPrequest(struct OperationConfig *config, HttpReq req, HttpReq *store);
#endif /* HEADER_CURL_TOOL_HELPERS_H */
* _any_ libcurl usage. If this fails, *NO* libcurl functions may be
* used, or havoc may be the result.
*/
-static CURLcode main_init(struct Configurable *config)
+static CURLcode main_init(struct OperationConfig *config)
{
CURLcode result = CURLE_OK;
int main(int argc, char *argv[])
{
CURLcode result = CURLE_OK;
- struct Configurable *config;
+ struct OperationConfig *config;
main_checkfds();
memory_tracking_init();
/* Allocate the initial config */
- config = malloc(sizeof(struct Configurable));
+ config = malloc(sizeof(struct OperationConfig));
if(config) {
/* Initialise the config */
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2012, 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
return check_ok;
}
-int metalink_check_hash(struct Configurable *config,
+int metalink_check_hash(struct OperationConfig *config,
metalinkfile *mlfile,
const char *filename)
{
return f;
}
-int parse_metalink(struct Configurable *config, struct OutStruct *outs,
+int parse_metalink(struct OperationConfig *config, struct OutStruct *outs,
const char *metalink_url)
{
metalink_error_t r;
void *userdata)
{
struct OutStruct *outs = userdata;
- struct Configurable *config = outs->config;
+ struct OperationConfig *config = outs->config;
int rv;
/*
Curl_safefree(mlfile);
}
-void clean_metalink(struct Configurable *config)
+void clean_metalink(struct OperationConfig *config)
{
while(config->metalinkfile_list) {
metalinkfile *mlfile = config->metalinkfile_list;
* Counts the resource in the metalinkfile.
*/
int count_next_metalink_resource(metalinkfile *mlfile);
-void clean_metalink(struct Configurable *config);
+void clean_metalink(struct OperationConfig *config);
/*
* Performs final parse operation and extracts information from
* -1: Parsing failed; or no file is found
* -2: Parsing succeeded with some warnings.
*/
-int parse_metalink(struct Configurable *config, struct OutStruct *outs,
+int parse_metalink(struct OperationConfig *config, struct OutStruct *outs,
const char *metalink_url);
/*
* No checksum in Metalink supported, hash algorithm not available, or
* Metalink does not contain checksum.
*/
-int metalink_check_hash(struct Configurable *config,
+int metalink_check_hash(struct OperationConfig *config,
metalinkfile *mlfile,
const char *filename);
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2012, 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
* mute (--silent) was selected.
*/
-void warnf(struct Configurable *config, const char *fmt, ...)
+void warnf(struct OperationConfig *config, const char *fmt, ...)
{
if(!config->mute) {
va_list ap;
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2012, 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
***************************************************************************/
#include "tool_setup.h"
-void warnf(struct Configurable *config, const char *fmt, ...);
+void warnf(struct OperationConfig *config, const char *fmt, ...);
void helpf(FILE *errors, const char *fmt, ...);
}
#endif /* __VMS */
-static CURLcode operate_init(struct Configurable *config)
+static CURLcode operate_init(struct OperationConfig *config)
{
/* Get a curl handle to use for all forthcoming curl transfers */
config->easy = curl_easy_init();
return CURLE_OK;
}
-static CURLcode operate_do(struct Configurable *config)
+static CURLcode operate_do(struct OperationConfig *config)
{
char errorbuffer[CURL_ERROR_SIZE];
struct ProgressData progressbar;
return (CURLcode)res;
}
-static void operate_free(struct Configurable *config)
+static void operate_free(struct OperationConfig *config)
{
if(config->easy) {
curl_easy_cleanup(config->easy);
clean_metalink(config);
}
-CURLcode operate(struct Configurable *config, int argc, argv_item_t argv[])
+CURLcode operate(struct OperationConfig *config, int argc, argv_item_t argv[])
{
CURLcode result = CURLE_OK;
/* Perform the main operations */
else {
size_t count = 0;
- struct Configurable *operation = config;
+ struct OperationConfig *operation = config;
/* Get the required aguments for each operation */
while(!result && operation) {
***************************************************************************/
#include "tool_setup.h"
-CURLcode operate(struct Configurable *config, int argc, argv_item_t argv[]);
+CURLcode operate(struct OperationConfig *config, int argc, argv_item_t argv[]);
#endif /* HEADER_CURL_TOOL_OPERATE_H */
#include "memdebug.h" /* keep this as LAST include */
-void clean_getout(struct Configurable *config)
+void clean_getout(struct OperationConfig *config)
{
struct getout *next;
struct getout *node = config->url_list;
***************************************************************************/
#include "tool_setup.h"
-struct Configurable;
+struct OperationConfig;
-void clean_getout(struct Configurable *config);
+void clean_getout(struct OperationConfig *config);
bool output_expected(const char *url, const char *uploadfile);
#include "memdebug.h" /* keep this as LAST include */
-struct getout *new_getout(struct Configurable *config)
+struct getout *new_getout(struct OperationConfig *config)
{
struct getout *node = calloc(1, sizeof(struct getout));
struct getout *last = config->url_last;
* data.
*/
-long proto2num(struct Configurable *config, long *val, const char *str)
+long proto2num(struct OperationConfig *config, long *val, const char *str)
{
char *buffer;
const char *sep = ",";
return PARAM_OK;
}
-int ftpfilemethod(struct Configurable *config, const char *str)
+int ftpfilemethod(struct OperationConfig *config, const char *str)
{
if(curlx_raw_equal("singlecwd", str))
return CURLFTPMETHOD_SINGLECWD;
return CURLFTPMETHOD_MULTICWD;
}
-int ftpcccmethod(struct Configurable *config, const char *str)
+int ftpcccmethod(struct OperationConfig *config, const char *str)
{
if(curlx_raw_equal("passive", str))
return CURLFTPSSL_CCC_PASSIVE;
return CURLFTPSSL_CCC_PASSIVE;
}
-long delegation(struct Configurable *config, char *str)
+long delegation(struct OperationConfig *config, char *str)
{
if(curlx_raw_equal("none", str))
return CURLGSSAPI_DELEGATION_NONE;
return strdup(CURL_NAME "/" CURL_VERSION);
}
-CURLcode get_args(struct Configurable *config, const size_t i)
+CURLcode get_args(struct OperationConfig *config, const size_t i)
{
CURLcode result = CURLE_OK;
bool last = (config->next ? FALSE : TRUE);
***************************************************************************/
#include "tool_setup.h"
-struct getout *new_getout(struct Configurable *config);
+struct getout *new_getout(struct OperationConfig *config);
ParameterError file2string(char **bufp, FILE *file);
ParameterError str2double(double *val, const char *str);
ParameterError str2udouble(double *val, const char *str);
-long proto2num(struct Configurable *config, long *val, const char *str);
+long proto2num(struct OperationConfig *config, long *val, const char *str);
ParameterError str2offset(curl_off_t *val, const char *str);
-CURLcode get_args(struct Configurable *config, const size_t index);
+CURLcode get_args(struct OperationConfig *config, const size_t i);
ParameterError add2list(struct curl_slist **list, const char *ptr);
-int ftpfilemethod(struct Configurable *config, const char *str);
+int ftpfilemethod(struct OperationConfig *config, const char *str);
-int ftpcccmethod(struct Configurable *config, const char *str);
+int ftpcccmethod(struct OperationConfig *config, const char *str);
-long delegation(struct Configurable *config, char *str);
+long delegation(struct OperationConfig *config, char *str);
#endif /* HEADER_CURL_TOOL_PARAMHLP_H */
static char *my_get_line(FILE *fp);
/* return 0 on everything-is-fine, and non-zero otherwise */
-int parseconfig(const char *filename,
- struct Configurable *config)
+int parseconfig(const char *filename, struct OperationConfig *config)
{
int res;
FILE *file;
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2012, 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
***************************************************************************/
#include "tool_setup.h"
-int parseconfig(const char *filename,
- struct Configurable *config);
+int parseconfig(const char *filename, struct OperationConfig *config);
#endif /* HEADER_CURL_TOOL_PARSECFG_H */
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2012, 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
* 'stream' member is a pointer to a stream controlling object as returned
* from a 'fopen' call or a standard stream.
*
- * 'config' member is a pointer to associated 'Configurable' struct.
+ * 'config' member is a pointer to associated 'OperationConfig' struct.
*
* 'bytes' member represents amount written so far.
*
bool s_isreg;
bool fopened;
FILE *stream;
- struct Configurable *config;
+ struct OperationConfig *config;
curl_off_t bytes;
curl_off_t init;
#ifdef USE_METALINK
* 'fd' member is either 'stdin' file descriptor number STDIN_FILENO
* or a file descriptor as returned from an 'open' call for some file.
*
- * 'config' member is a pointer to associated 'Configurable' struct.
+ * 'config' member is a pointer to associated 'OperationConfig' struct.
*/
struct InStruct {
int fd;
- struct Configurable *config;
+ struct OperationConfig *config;
};
/*
- * Complete struct declarations which have Configurable struct members,
+ * Complete struct declarations which have OperationConfig struct members,
* just in case this header is directly included in some source file.
*/
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2013, 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
}
/* setopt wrapper for enum types */
-CURLcode tool_setopt_enum(CURL *curl, struct Configurable *config,
+CURLcode tool_setopt_enum(CURL *curl, struct OperationConfig *config,
const char *name, CURLoption tag,
const NameValue *nvlist, long lval)
{
}
/* setopt wrapper for flags */
-CURLcode tool_setopt_flags(CURL *curl, struct Configurable *config,
+CURLcode tool_setopt_flags(CURL *curl, struct OperationConfig *config,
const char *name, CURLoption tag,
const NameValue *nvlist, long lval)
{
}
/* setopt wrapper for bitmasks */
-CURLcode tool_setopt_bitmask(CURL *curl, struct Configurable *config,
+CURLcode tool_setopt_bitmask(CURL *curl, struct OperationConfig *config,
const char *name, CURLoption tag,
const NameValueUnsigned *nvlist,
long lval)
}
/* setopt wrapper for CURLOPT_HTTPPOST */
-CURLcode tool_setopt_httppost(CURL *curl, struct Configurable *config,
+CURLcode tool_setopt_httppost(CURL *curl, struct OperationConfig *config,
const char *name, CURLoption tag,
struct curl_httppost *post)
{
}
/* setopt wrapper for curl_slist options */
-CURLcode tool_setopt_slist(CURL *curl, struct Configurable *config,
+CURLcode tool_setopt_slist(CURL *curl, struct OperationConfig *config,
const char *name, CURLoption tag,
struct curl_slist *list)
{
/* generic setopt wrapper for all other options.
* Some type information is encoded in the tag value. */
-CURLcode tool_setopt(CURL *curl, bool str, struct Configurable *config,
+CURLcode tool_setopt(CURL *curl, bool str, struct OperationConfig *config,
const char *name, CURLoption tag, ...)
{
va_list arg;
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2013, 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
/* Intercept setopt calls for --libcurl */
-CURLcode tool_setopt_enum(CURL *curl, struct Configurable *config,
+CURLcode tool_setopt_enum(CURL *curl, struct OperationConfig *config,
const char *name, CURLoption tag,
const NameValue *nv, long lval);
-CURLcode tool_setopt_flags(CURL *curl, struct Configurable *config,
+CURLcode tool_setopt_flags(CURL *curl, struct OperationConfig *config,
const char *name, CURLoption tag,
const NameValue *nv, long lval);
-CURLcode tool_setopt_bitmask(CURL *curl, struct Configurable *config,
+CURLcode tool_setopt_bitmask(CURL *curl, struct OperationConfig *config,
const char *name, CURLoption tag,
const NameValueUnsigned *nv, long lval);
-CURLcode tool_setopt_httppost(CURL *curl, struct Configurable *config,
+CURLcode tool_setopt_httppost(CURL *curl, struct OperationConfig *config,
const char *name, CURLoption tag,
struct curl_httppost *httppost);
-CURLcode tool_setopt_slist(CURL *curl, struct Configurable *config,
+CURLcode tool_setopt_slist(CURL *curl, struct OperationConfig *config,
const char *name, CURLoption tag,
struct curl_slist *list);
-CURLcode tool_setopt(CURL *curl, bool str, struct Configurable *config,
+CURLcode tool_setopt(CURL *curl, bool str, struct OperationConfig *config,
const char *name, CURLoption tag, ...);
#define my_setopt(x,y,z) \