]> granicus.if.org Git - curl/commitdiff
curl tool: reviewed code moved to tool_*.[ch] files
authorYang Tse <yangsita@gmail.com>
Tue, 20 Sep 2011 13:58:35 +0000 (15:58 +0200)
committerYang Tse <yangsita@gmail.com>
Tue, 20 Sep 2011 13:59:19 +0000 (15:59 +0200)
Overhauled FindWin32CACert()

12 files changed:
packages/Symbian/group/curl.mmp
src/Makefile.inc
src/Makefile.vc6
src/main.c
src/tool_cfgable.h
src/tool_doswin.c
src/tool_doswin.h
src/tool_msgs.c [new file with mode: 0644]
src/tool_msgs.h [new file with mode: 0644]
src/tool_sdecls.h [new file with mode: 0644]
src/vc6curlsrc.dsp
src/version.h

index 5294f6f62f1d9402b8479c0c59d6b7ece8db375f..5adbe8df0b70051be9a8d8bb48a35ee1581ab2f4 100644 (file)
@@ -11,7 +11,8 @@ SOURCE \
     main.c hugehelp.c urlglob.c writeout.c writeenv.c \
     getpass.c homedir.c curlutil.c xattr.c \
     tool_bname.c tool_cfgable.c tool_convert.c tool_dirhie.c \
-    tool_doswin.c tool_mfiles.c tool_myfunc.c tool_vms.c
+    tool_doswin.c tool_mfiles.c tool_msgs.c tool_myfunc.c \
+    tool_vms.c
 
 SOURCEPATH  ../../../lib
 SOURCE \
index 38036260b51eceb9444848a1c33b0e9ea4eb4e5e..9893fd34c1cd2d4c4e0a544ff0b2d384a11ca24c 100644 (file)
@@ -17,13 +17,15 @@ CURLX_ONES = $(top_srcdir)/lib/strtoofft.c \
 CURL_CFILES = main.c hugehelp.c urlglob.c writeout.c writeenv.c \
        getpass.c homedir.c curlutil.c xattr.c \
        tool_bname.c tool_cfgable.c tool_convert.c tool_dirhie.c \
-       tool_doswin.c tool_mfiles.c tool_myfunc.c tool_vms.c
+       tool_doswin.c tool_mfiles.c tool_msgs.c tool_myfunc.c \
+       tool_vms.c
 
 CURL_HFILES = hugehelp.h setup.h config-win32.h config-mac.h \
        config-riscos.h urlglob.h version.h xattr.h \
        writeout.h writeenv.h getpass.h homedir.h curlutil.h \
        tool_bname.h tool_cfgable.h tool_convert.h tool_dirhie.h \
-       tool_doswin.h tool_mfiles.h tool_myfunc.h tool_vms.h
+       tool_doswin.h tool_mfiles.h tool_msgs.h tool_myfunc.h \
+       tool_sdecls.h tool_vms.h
 
 curl_SOURCES = $(CURL_CFILES) $(CURLX_ONES) $(CURL_HFILES)
 
index e1f75120f6939c58d51612661daadb2cc7a6d7a3..035b7cceb783f9a24f4f095d240c84c3c9f23969 100644 (file)
@@ -121,7 +121,7 @@ RCD   = rc.exe /dDEBUGBUILD=1
 \r
 CFLAGS   = /I../lib /I../include /nologo /W3 /GX /DWIN32 /YX /FD /c /D_BIND_TO_CURRENT_VCLIBS_VERSION=1\r
 LFLAGS   = /nologo /out:$(PROGRAM_NAME) /subsystem:console /machine:$(MACHINE)\r
-RESFLAGS = /i../lib /i../include\r
+RESFLAGS = /i../include\r
 \r
 # This manifest thing is for VC8, enabled by the maketgz script that\r
 # builds the VC8 version of this makefile. Left commented out in the VC6\r
@@ -147,6 +147,7 @@ RELEASE_OBJS= \
        tool_dirhier.obj \\r
        tool_doswinr.obj \\r
        tool_mfilesr.obj \\r
+       tool_msgsr.obj \\r
        tool_myfuncr.obj \\r
        tool_vmsr.obj \\r
        urlglobr.obj \\r
@@ -169,6 +170,7 @@ DEBUG_OBJS= \
        tool_dirhied.obj \\r
        tool_doswind.obj \\r
        tool_mfilesd.obj \\r
+       tool_msgsd.obj \\r
        tool_myfuncd.obj \\r
        tool_vmsd.obj \\r
        urlglobd.obj \\r
@@ -326,6 +328,8 @@ tool_doswinr.obj: tool_doswin.c
        $(CCR) $(CFLAGS) /Fo"$@" tool_doswin.c\r
 tool_mfilesr.obj: tool_mfiles.c\r
        $(CCR) $(CFLAGS) /Fo"$@" tool_mfiles.c\r
+tool_msgsr.obj: tool_msgs.c\r
+       $(CCR) $(CFLAGS) /Fo"$@" tool_msgs.c\r
 tool_myfuncr.obj: tool_myfunc.c\r
        $(CCR) $(CFLAGS) /Fo"$@" tool_myfunc.c\r
 tool_vmsr.obj: tool_vms.c\r
@@ -368,6 +372,8 @@ tool_doswind.obj: tool_doswin.c
        $(CCD) $(CFLAGS) /Fo"$@" tool_doswin.c\r
 tool_mfilesd.obj: tool_mfiles.c\r
        $(CCD) $(CFLAGS) /Fo"$@" tool_mfiles.c\r
+tool_msgsd.obj: tool_msgs.c\r
+       $(CCD) $(CFLAGS) /Fo"$@" tool_msgs.c\r
 tool_myfuncd.obj: tool_myfunc.c\r
        $(CCD) $(CFLAGS) /Fo"$@" tool_myfunc.c\r
 tool_vmsd.obj: tool_vms.c\r
index a5163a65f019ee411ce656561cd8664a4ea764a4..1f48fd604e6e115ba69dd65753f684a58103bb70 100644 (file)
@@ -98,6 +98,7 @@
 #include "tool_dirhie.h"
 #include "tool_doswin.h"
 #include "tool_mfiles.h"
+#include "tool_msgs.h"
 #include "tool_myfunc.h"
 #include "tool_vms.h"
 #ifdef USE_MANUAL
@@ -266,49 +267,6 @@ static int ftruncate64(int fd, curl_off_t where)
 
 #endif /* WIN32 */
 
-#define WARN_PREFIX "Warning: "
-#define WARN_TEXTWIDTH (79 - (int)strlen(WARN_PREFIX))
-/* produce this text message to the user unless mute was selected */
-static void warnf(struct Configurable *config, const char *fmt, ...)
-{
-  if(!config->mute) {
-    va_list ap;
-    int len;
-    char *ptr;
-    char print_buffer[256];
-
-    va_start(ap, fmt);
-    len = vsnprintf(print_buffer, sizeof(print_buffer), fmt, ap);
-    va_end(ap);
-
-    ptr = print_buffer;
-    while(len > 0) {
-      fputs(WARN_PREFIX, config->errors);
-
-      if(len > (int)WARN_TEXTWIDTH) {
-        int cut = WARN_TEXTWIDTH-1;
-
-        while(!ISSPACE(ptr[cut]) && cut) {
-          cut--;
-        }
-        if(0 == cut)
-          /* not a single cutting position was found, just cut it at the
-             max text width then! */
-          cut = WARN_TEXTWIDTH-1;
-
-        (void)fwrite(ptr, cut + 1, 1, config->errors);
-        fputs("\n", config->errors);
-        ptr += cut+1; /* skip the space too */
-        len -= cut;
-      }
-      else {
-        fputs(ptr, config->errors);
-        len = 0;
-      }
-    }
-  }
-}
-
 /*
  * This is the main global constructor for the app. Call this before
  * _any_ libcurl usage. If this fails, *NO* libcurl functions may be
@@ -346,22 +304,6 @@ static int SetHTTPrequest(struct Configurable *config,
   return 1;
 }
 
-static void helpf(FILE *errors, const char *fmt, ...)
-{
-  va_list ap;
-  if(fmt) {
-    va_start(ap, fmt);
-    fputs("curl: ", errors); /* prefix it */
-    vfprintf(errors, fmt, ap);
-    va_end(ap);
-  }
-  fprintf(errors, "curl: try 'curl --help' "
-#ifdef USE_MANUAL
-          "or 'curl --manual' "
-#endif
-          "for more information\n");
-}
-
 static void help(void)
 {
   int i;
@@ -3169,11 +3111,6 @@ static size_t my_fwrite(void *buffer, size_t sz, size_t nmemb, void *stream)
   return rc;
 }
 
-struct InStruct {
-  int fd;
-  struct Configurable *config;
-};
-
 #define MAX_SEEK 2147483647
 
 /*
@@ -3588,39 +3525,6 @@ int my_trace(CURL *handle, curl_infotype type,
   return 0;
 }
 
-#ifdef WIN32
-
-/* Function to find CACert bundle on a Win32 platform using SearchPath.
- * (SearchPath is already declared via inclusions done in setup header file)
- * (Use the ASCII version instead of the unicode one!)
- * The order of the directories it searches is:
- *  1. application's directory
- *  2. current working directory
- *  3. Windows System directory (e.g. C:\windows\system32)
- *  4. Windows Directory (e.g. C:\windows)
- *  5. all directories along %PATH%
- */
-static void FindWin32CACert(struct Configurable *config,
-                            const char *bundle_file)
-{
-  /* only check for cert file if "we" support SSL */
-  if(curlinfo->features & CURL_VERSION_SSL) {
-    DWORD buflen;
-    char *ptr = NULL;
-    char *retval = malloc(sizeof (TCHAR) * (MAX_PATH + 1));
-    if(!retval)
-      return;
-    retval[0] = '\0';
-    buflen = SearchPathA(NULL, bundle_file, NULL, MAX_PATH+2, retval, &ptr);
-    if(buflen > 0) {
-      GetStr(&config->cacert, retval);
-    }
-    Curl_safefree(retval);
-  }
-}
-
-#endif
-
 #define RETRY_SLEEP_DEFAULT 1000  /* ms */
 #define RETRY_SLEEP_MAX     600000 /* ms == 10 minutes */
 
@@ -4238,8 +4142,13 @@ operate(struct Configurable *config, int argc, argv_item_t argv[])
     if(env)
       curl_free(env);
 #ifdef WIN32
-    else
-      FindWin32CACert(config, "curl-ca-bundle.crt");
+    else {
+      res = FindWin32CACert(config, "curl-ca-bundle.crt");
+      if(res) {
+        clean_getout(config);
+        goto quit_curl;
+      }
+    }
 #endif
   }
 
index ef3169583c6cd90c2adc64006c08b4c7be0b9141..f99910a1a1876dcafa5c403c7e42f08d3e60582d 100644 (file)
  ***************************************************************************/
 #include "setup.h"
 
-typedef enum {
-  HTTPREQ_UNSPEC,
-  HTTPREQ_GET,
-  HTTPREQ_HEAD,
-  HTTPREQ_POST,
-  HTTPREQ_SIMPLEPOST,
-  HTTPREQ_CUSTOM,
-  HTTPREQ_LAST
-} HttpReq;
-
-typedef enum {
-  TRACE_NONE,  /* no trace/verbose output at all */
-  TRACE_BIN,   /* tcpdump inspired look */
-  TRACE_ASCII, /* like *BIN but without the hex output */
-  TRACE_PLAIN  /* -v/--verbose type */
-} trace;
-
-struct OutStruct {
-  char *filename;
-  bool alloc_filename;
-  FILE *stream;
-  struct Configurable *config;
-  curl_off_t bytes; /* amount written so far */
-  curl_off_t init;  /* original size (non-zero when appending) */
-};
-
-/*
- * A chain of these 'getout' nodes contain URL's to fetch and where to
- * place URL's contents.
- */
-
-struct getout {
-  struct getout *next;      /* next one */
-  char          *url;       /* the URL we deal with */
-  char          *outfile;   /* where to store the output */
-  char          *infile;    /* file to upload, if GETOUT_UPLOAD is set */
-  int            flags;     /* options - composed of GETOUT_* bits */
-};
-
-#define GETOUT_OUTFILE    (1<<0)  /* set when outfile is deemed done */
-#define GETOUT_URL        (1<<1)  /* set when URL is deemed done */
-#define GETOUT_USEREMOTE  (1<<2)  /* use remote file name locally */
-#define GETOUT_UPLOAD     (1<<3)  /* if set, -T has been used */
-#define GETOUT_NOUPLOAD   (1<<4)  /* if set, -T "" has been used */
+#include "tool_sdecls.h"
 
 struct Configurable {
   CURL *easy;               /* once we have one, we keep it here */
@@ -120,7 +77,7 @@ struct Configurable {
   struct curl_slist *mail_rcpt;
   bool proxytunnel;
   bool ftp_append;          /* APPE on ftp */
-  bool mute;                /* shutup */
+  bool mute;                /* don't show messages, --silent given */
   bool use_ascii;           /* select ascii or text transfer */
   bool autoreferer;         /* automatically set referer */
   bool failonerror;         /* fail on (HTTP) errors */
@@ -178,8 +135,8 @@ struct Configurable {
   bool proxyanyauth;
   char *writeout;           /* %-styled format string to output */
   bool writeenv;            /* write results to environment, if available */
-  FILE *errors;             /* if stderr redirect is requested */
-  bool errors_fopened;
+  FILE *errors;             /* errors stream, defaults to stderr */
+  bool errors_fopened;      /* whether errors stream isn't stderr */
   struct curl_slist *quote;
   struct curl_slist *postquote;
   struct curl_slist *prequote;
index dc9062798267561e18db5d672a3e7e4d3c0be71e..7fab33b800c06193185dc2ea6f7704e197ae6ba3 100644 (file)
 #  include <libgen.h>
 #endif
 
+#ifdef WIN32
+#  include <curl/curl.h>
+#  include "tool_cfgable.h"
+#endif
+
 #include "tool_bname.h"
 #include "tool_doswin.h"
 
@@ -225,5 +230,59 @@ static char *rename_if_dos_device_name (char *file_name)
   return file_name;
 }
 
+#ifdef WIN32
+
+/*
+ * Function to find CACert bundle on a Win32 platform using SearchPath.
+ * (SearchPath is already declared via inclusions done in setup header file)
+ * (Use the ASCII version instead of the unicode one!)
+ * The order of the directories it searches is:
+ *  1. application's directory
+ *  2. current working directory
+ *  3. Windows System directory (e.g. C:\windows\system32)
+ *  4. Windows Directory (e.g. C:\windows)
+ *  5. all directories along %PATH%
+ *
+ * For WinXP and later search order actually depends on registry value:
+ * HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\SafeProcessSearchMode
+ */
+
+CURLcode FindWin32CACert(struct Configurable *config, const char *bundle_file)
+{
+  CURLcode result = CURLE_OK;
+
+  curl_version_info_data *info = curl_version_info(CURLVERSION_NOW);
+
+  /* search and set cert file only if "we" support SSL */
+  if(info->features & CURL_VERSION_SSL) {
+
+    DWORD res_len;
+    DWORD buf_tchar_size = PATH_MAX + 1;
+    DWORD buf_bytes_size = sizeof(TCHAR) * buf_tchar_size;
+    char *ptr = NULL;
+
+    char *buf = malloc(buf_bytes_size);
+    if(!buf)
+      return CURLE_OUT_OF_MEMORY;
+    buf[0] = '\0';
+
+    res_len = SearchPathA(NULL, bundle_file, NULL, buf_tchar_size, buf, &ptr);
+    if(res_len > 0) {
+      Curl_safefree(config->cacert);
+      config->cacert = strdup(buf);
+      if(!config->cacert)
+        result = CURLE_OUT_OF_MEMORY;
+    }
+    else
+      result = CURLE_SSL_CACERT;
+
+    free(buf);
+  }
+
+  return result;
+}
+
+#endif /* WIN32 */
+
 #endif /* MSDOS || WIN32 */
 
index 218a5a3f10025f129e61f9b18df931f20d1081e8..658660f9853887de29489c6954f7010625dd3a52 100644 (file)
 
 char *sanitize_dos_name(char *file_name);
 
+#ifdef WIN32
+
+CURLcode FindWin32CACert(struct Configurable *config, const char *bundle_file);
+
+#endif /* WIN32 */
+
 #endif /* MSDOS || WIN32 */
 
 #endif /* HEADER_CURL_TOOL_DOSWIN_H */
diff --git a/src/tool_msgs.c b/src/tool_msgs.c
new file mode 100644 (file)
index 0000000..b6a80a2
--- /dev/null
@@ -0,0 +1,100 @@
+/***************************************************************************
+ *                                  _   _ ____  _
+ *  Project                     ___| | | |  _ \| |
+ *                             / __| | | | |_) | |
+ *                            | (__| |_| |  _ <| |___
+ *                             \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2011, 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
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * 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.
+ *
+ ***************************************************************************/
+#include "setup.h"
+
+#define ENABLE_CURLX_PRINTF
+/* use our own printf() functions */
+#include "curlx.h"
+
+#include "tool_cfgable.h"
+#include "tool_msgs.h"
+
+#include "memdebug.h" /* keep this as LAST include */
+
+#define WARN_PREFIX "Warning: "
+#define WARN_TEXTWIDTH (79 - (int)strlen(WARN_PREFIX))
+
+/*
+ * Emit warning formatted message on configured 'errors' stream unless
+ * mute (--silent) was selected.
+ */
+
+void warnf(struct Configurable *config, const char *fmt, ...)
+{
+  if(!config->mute) {
+    va_list ap;
+    int len;
+    char *ptr;
+    char print_buffer[256];
+
+    va_start(ap, fmt);
+    len = vsnprintf(print_buffer, sizeof(print_buffer), fmt, ap);
+    va_end(ap);
+
+    ptr = print_buffer;
+    while(len > 0) {
+      fputs(WARN_PREFIX, config->errors);
+
+      if(len > (int)WARN_TEXTWIDTH) {
+        int cut = WARN_TEXTWIDTH-1;
+
+        while(!ISSPACE(ptr[cut]) && cut) {
+          cut--;
+        }
+        if(0 == cut)
+          /* not a single cutting position was found, just cut it at the
+             max text width then! */
+          cut = WARN_TEXTWIDTH-1;
+
+        (void)fwrite(ptr, cut + 1, 1, config->errors);
+        fputs("\n", config->errors);
+        ptr += cut+1; /* skip the space too */
+        len -= cut;
+      }
+      else {
+        fputs(ptr, config->errors);
+        len = 0;
+      }
+    }
+  }
+}
+
+/*
+ * Emit help formatted message on given stream.
+ */
+
+void helpf(FILE *errors, const char *fmt, ...)
+{
+  va_list ap;
+  if(fmt) {
+    va_start(ap, fmt);
+    fputs("curl: ", errors); /* prefix it */
+    vfprintf(errors, fmt, ap);
+    va_end(ap);
+  }
+  fprintf(errors, "curl: try 'curl --help' "
+#ifdef USE_MANUAL
+          "or 'curl --manual' "
+#endif
+          "for more information\n");
+}
+
diff --git a/src/tool_msgs.h b/src/tool_msgs.h
new file mode 100644 (file)
index 0000000..9102139
--- /dev/null
@@ -0,0 +1,31 @@
+#ifndef HEADER_CURL_TOOL_MSGS_H
+#define HEADER_CURL_TOOL_MSGS_H
+/***************************************************************************
+ *                                  _   _ ____  _
+ *  Project                     ___| | | |  _ \| |
+ *                             / __| | | | |_) | |
+ *                            | (__| |_| |  _ <| |___
+ *                             \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2011, 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
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * 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.
+ *
+ ***************************************************************************/
+#include "setup.h"
+
+void warnf(struct Configurable *config, const char *fmt, ...);
+
+void helpf(FILE *errors, const char *fmt, ...);
+
+#endif /* HEADER_CURL_TOOL_MSGS_H */
+
diff --git a/src/tool_sdecls.h b/src/tool_sdecls.h
new file mode 100644 (file)
index 0000000..cf4f3a1
--- /dev/null
@@ -0,0 +1,128 @@
+#ifndef HEADER_CURL_TOOL_SDECLS_H
+#define HEADER_CURL_TOOL_SDECLS_H
+/***************************************************************************
+ *                                  _   _ ____  _
+ *  Project                     ___| | | |  _ \| |
+ *                             / __| | | | |_) | |
+ *                            | (__| |_| |  _ <| |___
+ *                             \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2011, 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
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * 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.
+ *
+ ***************************************************************************/
+#include "setup.h"
+
+
+/*
+ * OutStruct variables keep track of information relative to curl's
+ * output writing, which may take place to stdout or to some file.
+ *
+ * 'filename' member is a pointer to either a file name string or to
+ * string "-" to indicate that output is written to stdout.
+ *
+ * 'alloc_filename' member is TRUE when string pointed by 'filename' has been
+ * dynamically allocated and 'belongs' to this OutStruct, otherwise FALSE.
+ *
+ * 'stream' member is a pointer to a stream controlling object as returned
+ * from a 'fopen' call or stdout. When 'stdout' this shall not be closed.
+ *
+ * 'bytes' member represents amount written, and 'init' initial file size.
+ */
+
+struct OutStruct {
+  char *filename;               /* pointer to file name or "-" string */
+  bool alloc_filename;          /* allocated filename belongs to this */
+  FILE *stream;                 /* stdout or stream controlling object */
+  struct Configurable *config;  /* pointer back to Configurable struct */
+  curl_off_t bytes;             /* amount written so far */
+  curl_off_t init;              /* original size (non-zero when appending) */
+};
+
+
+/*
+ * InStruct variables keep track of information relative to curl's
+ * input reading, which may take place from stdin or from some file.
+ *
+ * '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.
+ *
+ * TODO: evaluate if an additional struct member should be added to
+ * allow easier handling of 'stdin' vs other 'file' descriptors.
+ */
+
+struct InStruct {
+  int fd;
+  struct Configurable *config;
+};
+
+
+/*
+ * A linked list of these 'getout' nodes contain URL's to fetch,
+ * as well as information relative to where URL contents should
+ * be stored or which file should be uploaded.
+ */
+
+struct getout {
+  struct getout *next;      /* next one */
+  char          *url;       /* the URL we deal with */
+  char          *outfile;   /* where to store the output */
+  char          *infile;    /* file to upload, if GETOUT_UPLOAD is set */
+  int            flags;     /* options - composed of GETOUT_* bits */
+};
+
+#define GETOUT_OUTFILE    (1<<0)  /* set when outfile is deemed done */
+#define GETOUT_URL        (1<<1)  /* set when URL is deemed done */
+#define GETOUT_USEREMOTE  (1<<2)  /* use remote file name locally */
+#define GETOUT_UPLOAD     (1<<3)  /* if set, -T has been used */
+#define GETOUT_NOUPLOAD   (1<<4)  /* if set, -T "" has been used */
+
+
+/*
+ * 'trace' enumeration represents curl's output look'n feel possibilities.
+ */
+
+typedef enum {
+  TRACE_NONE,  /* no trace/verbose output at all */
+  TRACE_BIN,   /* tcpdump inspired look */
+  TRACE_ASCII, /* like *BIN but without the hex output */
+  TRACE_PLAIN  /* -v/--verbose type */
+} trace;
+
+
+/*
+ * 'HttpReq' enumeration represents HTTP request types.
+ */
+
+typedef enum {
+  HTTPREQ_UNSPEC,  /* first in list */
+  HTTPREQ_GET,
+  HTTPREQ_HEAD,
+  HTTPREQ_POST,
+  HTTPREQ_SIMPLEPOST,
+  HTTPREQ_CUSTOM,
+  HTTPREQ_LAST     /* last in list */
+} HttpReq;
+
+
+/*
+ * Complete struct declarations which have Configurable struct members,
+ * just in case this header is directly included in some source file.
+ */
+
+#include "tool_cfgable.h"
+
+#endif /* HEADER_CURL_TOOL_SDECLS_H */
+
index 603b4bfdbc795c1e21467c59e1647b0290a3d7e1..6ef1cdab18238d8ce9e01fec44f4a5b07eb2720d 100644 (file)
@@ -45,8 +45,8 @@ RSC=rc.exe
 # PROP Target_Dir ""\r
 # ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\lib" /I "..\include" /I "." /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_CONSOLE" /FD /GZ /c\r
 # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\lib" /I "..\include" /I "." /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_CONSOLE" /FD /GZ /c\r
-# ADD BASE RSC /l 0x409 /i "..\lib" /i "..\include" /d "_DEBUG"\r
-# ADD RSC /l 0x409 /i "..\lib" /i "..\include" /d "_DEBUG"\r
+# ADD BASE RSC /l 0x409 /i "..\include" /d "_DEBUG"\r
+# ADD RSC /l 0x409 /i "..\include" /d "_DEBUG"\r
 BSC32=bscmake.exe\r
 # ADD BASE BSC32 /nologo\r
 # ADD BSC32 /nologo\r
@@ -69,8 +69,8 @@ LINK32=link.exe
 # PROP Target_Dir ""\r
 # ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\lib" /I "..\include" /I "." /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_CONSOLE" /FD /c\r
 # ADD CPP /nologo /MD /W3 /GX /O2 /I "..\lib" /I "..\include" /I "." /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_CONSOLE" /FD /c\r
-# ADD BASE RSC /l 0x409 /i "..\lib" /i "..\include" /d "NDEBUG"\r
-# ADD RSC /l 0x409 /i "..\lib" /i "..\include" /d "NDEBUG"\r
+# ADD BASE RSC /l 0x409 /i "..\include" /d "NDEBUG"\r
+# ADD RSC /l 0x409 /i "..\include" /d "NDEBUG"\r
 BSC32=bscmake.exe\r
 # ADD BASE BSC32 /nologo\r
 # ADD BSC32 /nologo\r
@@ -93,8 +93,8 @@ LINK32=link.exe
 # PROP Target_Dir ""\r
 # ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\lib" /I "..\include" /I "." /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_CONSOLE" /D "CURL_STATICLIB" /FD /GZ /c\r
 # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\lib" /I "..\include" /I "." /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_CONSOLE" /D "CURL_STATICLIB" /FD /GZ /c\r
-# ADD BASE RSC /l 0x409 /i "..\lib" /i "..\include" /d "_DEBUG"\r
-# ADD RSC /l 0x409 /i "..\lib" /i "..\include" /d "_DEBUG"\r
+# ADD BASE RSC /l 0x409 /i "..\include" /d "_DEBUG"\r
+# ADD RSC /l 0x409 /i "..\include" /d "_DEBUG"\r
 BSC32=bscmake.exe\r
 # ADD BASE BSC32 /nologo\r
 # ADD BSC32 /nologo\r
@@ -117,8 +117,8 @@ LINK32=link.exe
 # PROP Target_Dir ""\r
 # ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\lib" /I "..\include" /I "." /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_CONSOLE" /D "CURL_STATICLIB" /FD /c\r
 # ADD CPP /nologo /MD /W3 /GX /O2 /I "..\lib" /I "..\include" /I "." /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_CONSOLE" /D "CURL_STATICLIB" /FD /c\r
-# ADD BASE RSC /l 0x409 /i "..\lib" /i "..\include" /d "NDEBUG"\r
-# ADD RSC /l 0x409 /i "..\lib" /i "..\include" /d "NDEBUG"\r
+# ADD BASE RSC /l 0x409 /i "..\include" /d "NDEBUG"\r
+# ADD RSC /l 0x409 /i "..\include" /d "NDEBUG"\r
 BSC32=bscmake.exe\r
 # ADD BASE BSC32 /nologo\r
 # ADD BSC32 /nologo\r
@@ -195,6 +195,10 @@ SOURCE=.\tool_mfiles.c
 # End Source File\r
 # Begin Source File\r
 \r
+SOURCE=.\tool_msgs.c\r
+# End Source File\r
+# Begin Source File\r
+\r
 SOURCE=.\tool_myfunc.c\r
 # End Source File\r
 # Begin Source File\r
@@ -283,10 +287,18 @@ SOURCE=.\tool_mfiles.h
 # End Source File\r
 # Begin Source File\r
 \r
+SOURCE=.\tool_msgs.h\r
+# End Source File\r
+# Begin Source File\r
+\r
 SOURCE=.\tool_myfunc.h\r
 # End Source File\r
 # Begin Source File\r
 \r
+SOURCE=.\tool_sdecls.h\r
+# End Source File\r
+# Begin Source File\r
+\r
 SOURCE=.\tool_vms.h\r
 # End Source File\r
 # Begin Source File\r
index a4116b77debbc418698771459e34faf9db3262df..569526bfeaaa391e98566a6eb25c51774e4d3fe2 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef HEADER_CURL_VERSION_H
-#define HEADER_CURL_VERSION_H
+#ifndef HEADER_CURL_TOOL_VERSION_H
+#define HEADER_CURL_TOOL_VERSION_H
 /***************************************************************************
  *                                  _   _ ____  _
  *  Project                     ___| | | |  _ \| |
@@ -21,8 +21,6 @@
  * KIND, either express or implied.
  *
  ***************************************************************************/
-#include "setup.h"
-
 #include <curl/curlver.h>
 
 #define CURL_NAME "curl"
@@ -33,4 +31,4 @@
 #define CURL_VERSION_PATCH LIBCURL_VERSION_PATCH
 #define CURL_ID CURL_NAME " " CURL_VERSION " (" OS ") "
 
-#endif /* HEADER_CURL_VERSION_H */
+#endif /* HEADER_CURL_TOOL_VERSION_H */