mirror of
https://github.com/curl/curl.git
synced 2026-08-26 05:03:33 +03:00
curl: unify pointer names to global config
Use 'config' for pointing to a OperationConfig Use 'global' for pointing to GlobalConfig Bonus: add config_alloc(), an easier way to allocate + init a new OperationConfig struct. Closes #17888
This commit is contained in:
parent
695eee432f
commit
d516628d14
20 changed files with 110 additions and 123 deletions
|
|
@ -29,10 +29,14 @@
|
|||
#include "tool_main.h"
|
||||
#include "memdebug.h" /* keep this as LAST include */
|
||||
|
||||
void config_init(struct OperationConfig *config)
|
||||
struct OperationConfig *config_alloc(struct GlobalConfig *global)
|
||||
{
|
||||
memset(config, 0, sizeof(struct OperationConfig));
|
||||
struct OperationConfig *config =
|
||||
calloc(1, sizeof(struct OperationConfig));
|
||||
if(!config)
|
||||
return NULL;
|
||||
|
||||
config->global = global;
|
||||
config->use_httpget = FALSE;
|
||||
config->create_dirs = FALSE;
|
||||
config->maxredirs = DEFAULT_MAXREDIRS;
|
||||
|
|
@ -46,6 +50,7 @@ void config_init(struct OperationConfig *config)
|
|||
config->file_clobber_mode = CLOBBER_DEFAULT;
|
||||
config->upload_flags = CURLULFLAG_SEEN;
|
||||
curlx_dyn_init(&config->postdata, MAX_FILE2MEMORY);
|
||||
return config;
|
||||
}
|
||||
|
||||
static void free_config_fields(struct OperationConfig *config)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue