]> sjero.net Git - wget/blobdiff - src/wget.h
[svn] snprintf.c addition.
[wget] / src / wget.h
index 1a1fdb4589f220abaf5a9b5ef4391170a0b29ea3..fd97f097948e7da1025387dc4f747b84d29d0d5f 100644 (file)
@@ -87,9 +87,14 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
    them here.  */
 enum log_options { LOG_VERBOSE, LOG_NOTQUIET, LOG_NONVERBOSE, LOG_ALWAYS };
 
+#ifdef HAVE_STDARG_H
 void logprintf PARAMS ((enum log_options, const char *, ...))
      GCC_FORMAT_ATTR (2, 3);
 void debug_logprintf PARAMS ((const char *, ...)) GCC_FORMAT_ATTR (1, 2);
+#else  /* not HAVE_STDARG_H */
+void logprintf ();
+void debug_logprintf ();
+#endif /* not HAVE_STDARG_H */
 void logputs PARAMS ((enum log_options, const char *));
 
 /* Defined in `utils.c', but used literally everywhere.  */
@@ -113,7 +118,7 @@ char *xstrdup PARAMS ((const char *));
 
 /* ASCII char -> HEX digit */
 #define ASC2HEXD(x) (((x) >= '0' && (x) <= '9') ?               \
-                    ((x) - '0') : (toupper(x) - 'A' + 10))
+                    ((x) - '0') : (TOUPPER(x) - 'A' + 10))
 
 /* HEX digit -> ASCII char */
 #define HEXD2ASC(x) (((x) < 10) ? ((x) + '0') : ((x) - 10 + 'A'))
@@ -193,19 +198,24 @@ char *xstrdup PARAMS ((const char *));
 #define FREE_MAYBE(foo) do { if (foo) free (foo); } while (0)
 
 /* #### Hack: OPTIONS_DEFINED_HERE is defined in main.c.  */
+/* [Is this weird hack really necessary on any compilers?  No ANSI C compiler
+    should complain about "extern const char *exec_name;" followed by
+    "const char *exec_name;".  Are we doing this for K&R compilers, or...??
+    -- Dan Harkless <dan-wget@dilvish.speed.net>] */
 #ifndef OPTIONS_DEFINED_HERE
 extern const char *exec_name;
 #endif
 
 \f
-/* Document-type flags */
+/* Document type ("dt") flags */
 enum
 {
-  TEXTHTML      = 0x0001,      /* document is of type text/html */
-  RETROKF       = 0x0002,      /* retrieval was OK */
-  HEAD_ONLY     = 0x0004,      /* only send the HEAD request */
-  SEND_NOCACHE  = 0x0008,      /* send Pragma: no-cache directive */
-  ACCEPTRANGES  = 0x0010       /* Accept-ranges header was found */
+  TEXTHTML             = 0x0001,       /* document is of type text/html */
+  RETROKF              = 0x0002,       /* retrieval was OK */
+  HEAD_ONLY            = 0x0004,       /* only send the HEAD request */
+  SEND_NOCACHE         = 0x0008,       /* send Pragma: no-cache directive */
+  ACCEPTRANGES         = 0x0010,       /* Accept-ranges header was found */
+  ADDED_HTML_EXTENSION = 0x0020         /* added ".html" extension due to -E */
 };
 
 /* Universal error type -- used almost everywhere.
@@ -239,4 +249,11 @@ typedef unsigned char  boolean;
    the really awful !strcmp(a, b). */
 #define EQ 0
 
+/* For most options, 0 means no limits, but with -p in the picture, that causes
+   a problem on the maximum recursion depth variable.  To retain backwards
+   compatibility we allow users to consider "0" to be synonymous with "inf" for
+   -l, but internally infinite recursion is specified by -1 and 0 means to only
+   retrieve the requisites of a single document. */
+#define INFINITE_RECURSION -1
+
 #endif /* WGET_H */