]> sjero.net Git - wget/blobdiff - src/wget.h
[svn] Rewrite parsing and handling of URLs.
[wget] / src / wget.h
index 0fa9765f59d15968f2755182b8533bb6b8f44924..f5eff47e4f46e2d37e0db28c68902fb7d24851c6 100644 (file)
@@ -1,20 +1,20 @@
 /* Miscellaneous declarations.
    Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
 
-This file is part of Wget.
+This file is part of GNU Wget.
 
-This program is free software; you can redistribute it and/or modify
+GNU Wget is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
+GNU Wget is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
+along with Wget; if not, write to the Free Software
 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 /* This file contains some declarations that don't fit anywhere else.
@@ -231,24 +231,24 @@ char *xstrdup_debug PARAMS ((const char *, const char *, int));
 {                                                                              \
   /* Avoid side-effectualness.  */                                             \
   long do_realloc_needed_size = (needed_size);                                 \
-  long do_realloc_newsize = 0;                                                 \
-  while ((sizevar) < (do_realloc_needed_size)) {                               \
-    do_realloc_newsize = 2*(sizevar);                                          \
+  long do_realloc_newsize = (sizevar);                                         \
+  while (do_realloc_newsize < do_realloc_needed_size) {                                \
+    do_realloc_newsize <<= 1;                                                  \
     if (do_realloc_newsize < 16)                                               \
       do_realloc_newsize = 16;                                                 \
-    (sizevar) = do_realloc_newsize;                                            \
   }                                                                            \
-  if (do_realloc_newsize)                                                      \
+  if (do_realloc_newsize != (sizevar))                                         \
     {                                                                          \
       if (!allocap)                                                            \
        XREALLOC_ARRAY (basevar, type, do_realloc_newsize);                     \
       else                                                                     \
        {                                                                       \
          void *drfa_new_basevar = xmalloc (do_realloc_newsize);                \
-         memcpy (drfa_new_basevar, basevar, sizevar);                          \
+         memcpy (drfa_new_basevar, basevar, (sizevar));                        \
          (basevar) = drfa_new_basevar;                                         \
          allocap = 0;                                                          \
        }                                                                       \
+      (sizevar) = do_realloc_newsize;                                          \
     }                                                                          \
 } while (0)
 
@@ -285,12 +285,11 @@ 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, RETRFINISHED, READERR, TRYLIMEXC,
+  CONTNOTSUPPORTED, RETRUNNEEDED, RETRFINISHED, READERR, TRYLIMEXC,
   URLBADPATTERN, FILEBADFILE, RANGEERR, RETRBADPATTERN,
   RETNOTSUP, ROBOTSOK, NOROBOTS, PROXERR, AUTHFAILED,
   QUOTEXC, WRITEFAILED,