]> sjero.net Git - wget/blobdiff - src/wget.h
[svn] Remove the OPTIONS_DEFINED_HERE kludge.
[wget] / src / wget.h
index 3837d9b42cbb6f33dd4d75a046a2f279622e4af6..58ca27342855baff6ac159a9e0e17956ce891893 100644 (file)
@@ -28,6 +28,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 # define NDEBUG /* To kill off assertions */
 #endif /* not DEBUG */
 
+/* Define this if you want primitive but extensive malloc debugging.
+   It will make Wget extremely slow, so only do it in development
+   builds.  */
+#undef DEBUG_MALLOC
+
 #ifndef PARAMS
 # if PROTOTYPES
 #  define PARAMS(args) args
@@ -60,7 +65,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
    3) Finally, the debug messages are meant to be a clue for me to
    debug problems with Wget.  If I get them in a language I don't
-   understand, debugging will become a new challenge of its own!  :-) */
+   understand, debugging will become a new challenge of its own!  */
 
 
 /* Include these, so random files need not include them.  */
@@ -98,6 +103,9 @@ void logprintf ();
 void debug_logprintf ();
 #endif /* not HAVE_STDARG_H */
 void logputs PARAMS ((enum log_options, const char *));
+void logflush PARAMS ((void));
+void log_set_flush PARAMS ((int));
+int log_set_save_context PARAMS ((int));
 
 /* Defined in `utils.c', but used literally everywhere.  */
 #ifndef DEBUG_MALLOC
@@ -243,8 +251,9 @@ char *xstrdup_debug PARAMS ((const char *, const char *, int));
        XREALLOC_ARRAY (basevar, type, do_realloc_newsize);                     \
       else                                                                     \
        {                                                                       \
-         void *drfa_new_basevar = xmalloc (do_realloc_newsize);                \
-         memcpy (drfa_new_basevar, basevar, (sizevar));                        \
+         void *drfa_new_basevar =                                              \
+               xmalloc (do_realloc_newsize * sizeof (type));                   \
+         memcpy (drfa_new_basevar, basevar, (sizevar) * sizeof (type));        \
          (basevar) = drfa_new_basevar;                                         \
          allocap = 0;                                                          \
        }                                                                       \
@@ -255,15 +264,7 @@ char *xstrdup_debug PARAMS ((const char *, const char *, int));
 /* Free FOO if it is non-NULL.  */
 #define FREE_MAYBE(foo) do { if (foo) xfree (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 <wget@harkless.org>] */
-#ifndef OPTIONS_DEFINED_HERE
 extern const char *exec_name;
-#endif
-
 \f
 /* Document type ("dt") flags */
 enum
@@ -285,9 +286,8 @@ typedef enum
   BINDERR, BINDOK, LISTENERR, ACCEPTERR, ACCEPTOK,
   CONCLOSED, FTPOK, FTPLOGINC, FTPLOGREFUSED, FTPPORTERR,
   FTPNSFOD, FTPRETROK, FTPUNKNOWNTYPE, FTPRERR,
-  FTPREXC, FTPSRVERR, FTPRETRINT, FTPRESTFAIL, URLHTTPS,
-  URLOK, URLHTTP, URLFTP, URLFILE, URLUNKNOWN, URLBADPORT,
-  URLBADHOST, FOPENERR, FWRITEERR, HOK, HLEXC, HEOF,
+  FTPREXC, FTPSRVERR, FTPRETRINT, FTPRESTFAIL, URLERROR,
+  FOPENERR, FWRITEERR, HOK, HLEXC, HEOF,
   HERR, RETROK, RECLEVELEXC, FTPACCDENIED, WRONGCODE,
   FTPINVPASV, FTPNOPASV,
   CONTNOTSUPPORTED, RETRUNNEEDED, RETRFINISHED, READERR, TRYLIMEXC,