*/
int main(int argc, char *argv[])
{
- int res;
+ CURLcode result = CURLE_OK;
struct Configurable *config;
main_checkfds();
/* Initialize the curl library - do not call any libcurl functions before
this point */
- res = main_init(config);
- if(!res) {
+ result = main_init(config);
+ if(!result) {
/* Start our curl operation */
- res = operate(config, argc, argv);
+ result = operate(config, argc, argv);
/* Perform the main cleanup */
main_free();
}
else {
helpf(stderr, "error initializing curl\n");
- res = CURLE_FAILED_INIT;
+ result = CURLE_FAILED_INIT;
}
#ifdef __NOVELL_LIBC__
#ifdef __VMS
vms_special_exit(res, vms_show);
#else
- return res;
+ return (int)result;
#endif
}
"If you'd like to turn off curl's verification of the certificate, use\n" \
" the -k (or --insecure) option.\n"
-static int is_fatal_error(int code)
+static bool is_fatal_error(CURLcode code)
{
switch(code) {
/* TODO: Should CURLE_SSL_CACERT be included as critical error ? */
case CURLE_FUNCTION_NOT_FOUND:
case CURLE_BAD_FUNCTION_ARGUMENT:
/* critical error */
- return 1;
+ return TRUE;
default:
break;
}
+
/* no error or not critical */
- return 0;
+ return FALSE;
}
#ifdef __VMS
return CURLE_OK;
}
-static int operate_do(struct Configurable *config)
+static CURLcode operate_do(struct Configurable *config)
{
char errorbuffer[CURL_ERROR_SIZE];
struct ProgressData progressbar;
dumpeasysrc(config);
#endif
- return res;
+ return (CURLcode)res;
}
static void operate_free(struct Configurable *config)
clean_metalink(config);
}
-int operate(struct Configurable *config, int argc, argv_item_t argv[])
+CURLcode operate(struct Configurable *config, int argc, argv_item_t argv[])
{
- int result = 0;
+ CURLcode result = CURLE_OK;
/* Initialize the easy interface */
result = operate_init(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
***************************************************************************/
#include "tool_setup.h"
-int operate(struct Configurable *config, int argc, argv_item_t argv[]);
+CURLcode operate(struct Configurable *config, int argc, argv_item_t argv[]);
#endif /* HEADER_CURL_TOOL_OPERATE_H */