1 /***************************************************************************
3 * Project ___| | | | _ \| |
5 * | (__| |_| | _ <| |___
6 * \___|\___/|_| \_\_____|
8 * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
10 * This software is licensed as described in the file COPYING, which
11 * you should have received as part of this distribution. The terms
12 * are also available at http://curl.haxx.se/docs/copyright.html.
14 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 * copies of the Software, and permit persons to whom the Software is
16 * furnished to do so, under the terms of the COPYING file.
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
21 ***************************************************************************/
22 #include "tool_setup.h"
26 #define ENABLE_CURLX_PRINTF
27 /* use our own printf() functions */
30 #include "tool_cfgable.h"
31 #include "tool_msgs.h"
32 #include "tool_getparam.h"
33 #include "tool_helpers.h"
35 #include "memdebug.h" /* keep this as LAST include */
38 ** Helper functions that are used from more tha one source file.
41 const char *param2text(int res)
43 ParameterError error = (ParameterError)res;
45 case PARAM_GOT_EXTRA_PARAMETER:
46 return "had unsupported trailing garbage";
47 case PARAM_OPTION_UNKNOWN:
49 case PARAM_OPTION_AMBIGUOUS:
50 return "is ambiguous";
51 case PARAM_REQUIRES_PARAMETER:
52 return "requires parameter";
54 return "is badly used here";
55 case PARAM_BAD_NUMERIC:
56 return "expected a proper numerical parameter";
57 case PARAM_NEGATIVE_NUMERIC:
58 return "expected a positive numerical parameter";
59 case PARAM_LIBCURL_DOESNT_SUPPORT:
60 return "the installed libcurl version doesn't support this";
62 return "out of memory";
64 return "unknown error";
68 int SetHTTPrequest(struct OperationConfig *config, HttpReq req, HttpReq *store)
70 if((*store == HTTPREQ_UNSPEC) ||
76 warnf(config->global, "You can only select one HTTP request!\n");