2011-10-04 18:03:20 -04:00
|
|
|
#ifndef HEADER_CURL_TOOL_GETPARAM_H
|
|
|
|
#define HEADER_CURL_TOOL_GETPARAM_H
|
2011-09-17 19:58:18 -04:00
|
|
|
/***************************************************************************
|
|
|
|
* _ _ ____ _
|
|
|
|
* Project ___| | | | _ \| |
|
|
|
|
* / __| | | | |_) | |
|
|
|
|
* | (__| |_| | _ <| |___
|
|
|
|
* \___|\___/|_| \_\_____|
|
|
|
|
*
|
2014-02-02 09:58:25 -05:00
|
|
|
* Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
|
2011-09-17 19:58:18 -04:00
|
|
|
*
|
|
|
|
* This software is licensed as described in the file COPYING, which
|
|
|
|
* you should have received as part of this distribution. The terms
|
2016-02-02 18:19:02 -05:00
|
|
|
* are also available at https://curl.haxx.se/docs/copyright.html.
|
2011-09-17 19:58:18 -04:00
|
|
|
*
|
|
|
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
|
|
|
* copies of the Software, and permit persons to whom the Software is
|
|
|
|
* furnished to do so, under the terms of the COPYING file.
|
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
***************************************************************************/
|
2012-04-06 17:35:15 -04:00
|
|
|
#include "tool_setup.h"
|
2011-09-17 19:58:18 -04:00
|
|
|
|
2011-10-04 18:03:20 -04:00
|
|
|
typedef enum {
|
2012-11-26 10:23:02 -05:00
|
|
|
PARAM_OK = 0,
|
2011-10-04 18:03:20 -04:00
|
|
|
PARAM_OPTION_AMBIGUOUS,
|
|
|
|
PARAM_OPTION_UNKNOWN,
|
|
|
|
PARAM_REQUIRES_PARAMETER,
|
|
|
|
PARAM_BAD_USE,
|
|
|
|
PARAM_HELP_REQUESTED,
|
2014-02-23 05:37:44 -05:00
|
|
|
PARAM_MANUAL_REQUESTED,
|
2014-02-23 05:16:36 -05:00
|
|
|
PARAM_VERSION_INFO_REQUESTED,
|
2014-02-22 15:58:43 -05:00
|
|
|
PARAM_ENGINES_REQUESTED,
|
2011-10-04 18:03:20 -04:00
|
|
|
PARAM_GOT_EXTRA_PARAMETER,
|
|
|
|
PARAM_BAD_NUMERIC,
|
2012-07-10 17:11:30 -04:00
|
|
|
PARAM_NEGATIVE_NUMERIC,
|
2011-10-04 18:03:20 -04:00
|
|
|
PARAM_LIBCURL_DOESNT_SUPPORT,
|
2015-08-22 21:49:26 -04:00
|
|
|
PARAM_LIBCURL_UNSUPPORTED_PROTOCOL,
|
2011-10-04 18:03:20 -04:00
|
|
|
PARAM_NO_MEM,
|
2014-02-23 12:19:45 -05:00
|
|
|
PARAM_NEXT_OPERATION,
|
2011-10-04 18:03:20 -04:00
|
|
|
PARAM_LAST
|
|
|
|
} ParameterError;
|
|
|
|
|
2014-02-25 02:16:51 -05:00
|
|
|
struct GlobalConfig;
|
2014-02-23 07:59:59 -05:00
|
|
|
struct OperationConfig;
|
2012-06-08 17:14:30 -04:00
|
|
|
|
2014-02-23 11:04:39 -05:00
|
|
|
ParameterError getparameter(char *flag, char *nextarg, bool *usedarg,
|
|
|
|
struct GlobalConfig *global,
|
|
|
|
struct OperationConfig *operation);
|
2011-10-04 18:03:20 -04:00
|
|
|
|
2013-05-03 07:26:25 -04:00
|
|
|
#ifdef UNITTESTS
|
|
|
|
void parse_cert_parameter(const char *cert_parameter,
|
|
|
|
char **certname,
|
|
|
|
char **passphrase);
|
|
|
|
#endif
|
|
|
|
|
2014-02-23 09:32:22 -05:00
|
|
|
ParameterError parse_args(struct GlobalConfig *config, int argc,
|
2014-02-02 09:58:25 -05:00
|
|
|
argv_item_t argv[]);
|
|
|
|
|
2011-10-04 18:03:20 -04:00
|
|
|
#endif /* HEADER_CURL_TOOL_GETPARAM_H */
|
2011-09-17 19:58:18 -04:00
|
|
|
|