]> sjero.net Git - wget/commitdiff
[svn] Remove headers.c and headers.h.
authorhniksic <devnull@localhost>
Fri, 21 Nov 2003 08:48:45 +0000 (00:48 -0800)
committerhniksic <devnull@localhost>
Fri, 21 Nov 2003 08:48:45 +0000 (00:48 -0800)
src/ChangeLog
src/Makefile.in
src/headers.c [deleted file]
src/headers.h [deleted file]
src/http.c
windows/Makefile.src
windows/Makefile.src.bor
windows/Makefile.src.mingw
windows/Makefile.watcom
windows/wget.dep

index f27a486f9d5b7924481ce126b49a889c98ef04a9..6a5a99121744b84f978a5a0ab920c16b9ac0c9bf 100644 (file)
@@ -1,3 +1,9 @@
+2003-11-21  Hrvoje Niksic  <hniksic@xemacs.org>
+
+       * headers.c: Removed.  The file is no longer relevant, now that no
+       special handling of headers is done by the rbuf code.  Moved
+       portions to http.c.
+
 2003-11-21  Hrvoje Niksic  <hniksic@xemacs.org>
 
        * rbuf.c: Removed.
index 789f3477795f5e221f3e3366e3184cce8edaa7f1..185b14bef001f6f33138799cce9321dcd0e802e6 100644 (file)
@@ -74,7 +74,7 @@ GETOPT_OBJ = @GETOPT_OBJ@
 
 OBJ = $(ALLOCA) cmpt$o connect$o convert$o cookies$o              \
       ftp$o ftp-basic$o ftp-ls$o $(OPIE_OBJ) $(GETOPT_OBJ) hash$o \
-      headers$o host$o html-parse$o html-url$o http$o init$o      \
+      host$o html-parse$o html-url$o http$o init$o      \
       log$o main$o $(MD5_OBJ) netrc$o progress$o recur$o   \
       res$o retr$o safe-ctype$o snprintf$o $(SSL_OBJ) url$o       \
       utils$o version$o xmalloc$o
@@ -170,13 +170,11 @@ gen_sslfunc$o: wget.h sysdep.h options.h safe-ctype.h utils.h connect.h host.h \
 getopt$o: wget.h sysdep.h options.h safe-ctype.h getopt.h
 gnu-md5$o: wget.h sysdep.h options.h safe-ctype.h gnu-md5.h
 hash$o: wget.h sysdep.h options.h safe-ctype.h utils.h hash.h
-headers$o: wget.h sysdep.h options.h safe-ctype.h connect.h host.h \
-       headers.h
 host$o: wget.h sysdep.h options.h safe-ctype.h utils.h host.h url.h hash.h
 html-parse$o: wget.h sysdep.h options.h safe-ctype.h html-parse.h
 html-url$o: wget.h sysdep.h options.h safe-ctype.h html-parse.h url.h utils.h
 http$o: wget.h sysdep.h options.h safe-ctype.h utils.h url.h host.h \
-       retr.h headers.h connect.h host.h netrc.h gen_sslfunc.h \
+       retr.h connect.h host.h netrc.h gen_sslfunc.h 
        cookies.h gen-md5.h
 init$o: wget.h sysdep.h options.h safe-ctype.h utils.h init.h host.h recur.h \
        netrc.h cookies.h progress.h
diff --git a/src/headers.c b/src/headers.c
deleted file mode 100644 (file)
index c942ca3..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-/* Generic support for headers.
-   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
-
-This file is part of GNU Wget.
-
-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.
-
-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 Wget; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-In addition, as a special exception, the Free Software Foundation
-gives permission to link the code of its release of Wget with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.  */
-
-#include <config.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#ifdef HAVE_STRING_H
-# include <string.h>
-#else
-# include <strings.h>
-#endif
-
-#include "wget.h"
-#include "connect.h"
-#include "headers.h"
-
-/* This file contains the generic routines for work with headers.
-   Currently they are used only by HTTP in http.c, but they can be
-   used by anything that cares about RFC822-style headers.
-
-   Header is defined in RFC2068, as quoted below.  Note that this
-   definition is not HTTP-specific -- it is virtually
-   indistinguishable from the one given in RFC822 or RFC1036.
-
-       message-header = field-name ":" [ field-value ] CRLF
-
-       field-name     = token
-       field-value    = *( field-content | LWS )
-
-       field-content  = <the OCTETs making up the field-value
-                        and consisting of either *TEXT or combinations
-                        of token, tspecials, and quoted-string>
-
-   The public functions are header_get() and header_process(), which
-   see.  */
-
-
-/* Check whether HEADER begins with NAME and, if yes, skip the `:' and
-   the whitespace, and call PROCFUN with the arguments of HEADER's
-   contents (after the `:' and space) and ARG.  Otherwise, return 0.  */
-int
-header_process (const char *header, const char *name,
-               int (*procfun) (const char *, void *),
-               void *arg)
-{
-  /* Check whether HEADER matches NAME.  */
-  while (*name && (TOLOWER (*name) == TOLOWER (*header)))
-    ++name, ++header;
-  if (*name || *header++ != ':')
-    return 0;
-
-  header += skip_lws (header);
-
-  return ((*procfun) (header, arg));
-}
-\f
-/* Helper functions for use with header_process().  */
-
-/* Extract a long integer from HEADER and store it to CLOSURE.  If an
-   error is encountered, return 0, else 1.  */
-int
-header_extract_number (const char *header, void *closure)
-{
-  const char *p = header;
-  long result;
-
-  for (result = 0; ISDIGIT (*p); p++)
-    result = 10 * result + (*p - '0');
-
-  /* Failure if no number present. */
-  if (p == header)
-    return 0;
-
-  /* Skip trailing whitespace. */
-  p += skip_lws (p);
-
-  /* Indicate failure if trailing garbage is present. */
-  if (*p)
-    return 0;
-
-  *(long *)closure = result;
-  return 1;
-}
-
-/* Strdup HEADER, and place the pointer to CLOSURE.  */
-int
-header_strdup (const char *header, void *closure)
-{
-  *(char **)closure = xstrdup (header);
-  return 1;
-}
-
-/* Write the value 1 into the integer pointed to by CLOSURE.  */
-int
-header_exists (const char *header, void *closure)
-{
-  *(int *)closure = 1;
-  return 1;
-}
-
-/* Skip LWS (linear white space), if present.  Returns number of
-   characters to skip.  */
-int
-skip_lws (const char *string)
-{
-  const char *p = string;
-
-  while (*p == ' ' || *p == '\t' || *p == '\r' || *p == '\n')
-    ++p;
-  return p - string;
-}
diff --git a/src/headers.h b/src/headers.h
deleted file mode 100644 (file)
index 782ad35..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Declarations for `headers.c'.
-   Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
-
-This file is part of GNU Wget.
-
-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.
-
-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 Wget; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-In addition, as a special exception, the Free Software Foundation
-gives permission to link the code of its release of Wget with the
-OpenSSL project's "OpenSSL" library (or with modified versions of it
-that use the same license as the "OpenSSL" library), and distribute
-the linked executables.  You must obey the GNU General Public License
-in all respects for all of the code used other than "OpenSSL".  If you
-modify this file, you may extend this exception to your version of the
-file, but you are not obligated to do so.  If you do not wish to do
-so, delete this exception statement from your version.  */
-
-#ifndef HEADERS_H
-#define HEADERS_H
-
-enum {
-  HG_OK, HG_ERROR, HG_EOF
-};
-
-enum header_get_flags { HG_NONE = 0,
-                       HG_NO_CONTINUATIONS = 0x2 };
-
-int header_process PARAMS ((const char *, const char *,
-                           int (*) (const char *, void *),
-                           void *));
-
-int header_extract_number PARAMS ((const char *, void *));
-int header_strdup PARAMS ((const char *, void *));
-int header_exists PARAMS ((const char *, void *));
-
-int skip_lws PARAMS ((const char *));
-
-#endif /* HEADERS_H */
index de1cb084dbb1d15baabb8266332d5558d54c06cc..09383af27c2cfeb45a4f1fbb29be1ab1597f051f 100644 (file)
@@ -62,7 +62,6 @@ extern int errno;
 #include "url.h"
 #include "host.h"
 #include "retr.h"
-#include "headers.h"
 #include "connect.h"
 #include "netrc.h"
 #ifdef HAVE_SSL
@@ -250,6 +249,80 @@ next_header (const char *h)
   return end;
 }
 
+/* Skip LWS (linear white space), if present.  Returns number of
+   characters to skip.  */
+static int
+skip_lws (const char *string)
+{
+  const char *p = string;
+
+  while (*p == ' ' || *p == '\t' || *p == '\r' || *p == '\n')
+    ++p;
+  return p - string;
+}
+
+/* Check whether HEADER begins with NAME and, if yes, skip the `:' and
+   the whitespace, and call PROCFUN with the arguments of HEADER's
+   contents (after the `:' and space) and ARG.  Otherwise, return 0.  */
+int
+header_process (const char *header, const char *name,
+               int (*procfun) (const char *, void *),
+               void *arg)
+{
+  /* Check whether HEADER matches NAME.  */
+  while (*name && (TOLOWER (*name) == TOLOWER (*header)))
+    ++name, ++header;
+  if (*name || *header++ != ':')
+    return 0;
+
+  header += skip_lws (header);
+
+  return ((*procfun) (header, arg));
+}
+\f
+/* Helper functions for use with header_process().  */
+
+/* Extract a long integer from HEADER and store it to CLOSURE.  If an
+   error is encountered, return 0, else 1.  */
+int
+header_extract_number (const char *header, void *closure)
+{
+  const char *p = header;
+  long result;
+
+  for (result = 0; ISDIGIT (*p); p++)
+    result = 10 * result + (*p - '0');
+
+  /* Failure if no number present. */
+  if (p == header)
+    return 0;
+
+  /* Skip trailing whitespace. */
+  p += skip_lws (p);
+
+  /* Indicate failure if trailing garbage is present. */
+  if (*p)
+    return 0;
+
+  *(long *)closure = result;
+  return 1;
+}
+
+/* Strdup HEADER, and place the pointer to CLOSURE.  */
+int
+header_strdup (const char *header, void *closure)
+{
+  *(char **)closure = xstrdup (header);
+  return 1;
+}
+
+/* Write the value 1 into the integer pointed to by CLOSURE.  */
+int
+header_exists (const char *header, void *closure)
+{
+  *(int *)closure = 1;
+  return 1;
+}
 \f
 /* Functions to be used as arguments to header_process(): */
 
index 617a8181b068990a832306e702016ad8376c025c..a665f25b0456abba91c064aa20683d76e049c177 100644 (file)
@@ -64,13 +64,13 @@ LINK    = $(LD) $(LDFLAGS) $(DEBUGLF) /out:$@
 RM      = del
 
 SRC = cmpt.c safe-ctype.c convert.c connect.c host.c http.c netrc.c \
-      ftp-basic.c ftp.c ftp-ls.c ftp-opie.c getopt.c hash.c headers.c \
+      ftp-basic.c ftp.c ftp-ls.c ftp-opie.c getopt.c hash.c \
       html-parse.c html-url.c progress.c retr.c recur.c res.c url.c cookies.c \
       init.c utils.c main.c version.c xmalloc.c mswindows.c \
       gen-md5.c gnu-md5.c log.c $(SSLSRC)
 
 OBJ = cmpt$o safe-ctype$o convert$o connect$o host$o http$o netrc$o \
-      ftp-basic$o ftp$o ftp-ls$o ftp-opie$o getopt$o hash$o headers$o \
+      ftp-basic$o ftp$o ftp-ls$o ftp-opie$o getopt$o hash$o \
       html-parse$o html-url$o progress$o retr$o recur$o res$o url$o cookies$o \
       init$o utils$o main$o version$o xmalloc$o mswindows$o \
       gen-md5$o gnu-md5$o log$o $(SSLOBJ)
index 91f982df49fad0c4eab5af8b5a253acebe4621c2..3457a10cfe08e3487f4f06850716de20f8db7010 100644 (file)
@@ -9,7 +9,7 @@ CFLAGS=-DWINDOWS -DHAVE_CONFIG_H -I. -w- -O2
 
 ## variables
 OBJS=cmpt.obj connect.obj convert.obj ftp.obj ftp-basic.obj  \
-      ftp-ls.obj ftp-opie.obj getopt.obj headers.obj host.obj html-parse.obj html-url.obj \
+      ftp-ls.obj ftp-opie.obj getopt.obj host.obj html-parse.obj html-url.obj \
       http.obj init.obj log.obj main.obj gnu-md5.obj netrc.obj  \
       safe-ctype.obj hash.obj progress.obj gen-md5.obj cookies.obj \
       recur.obj res.obj retr.obj url.obj utils.obj version.obj xmalloc.obj \
@@ -33,7 +33,6 @@ gen-md5.obj+
 getopt.obj+
 gnu-md5.obj+
 hash.obj+
-headers.obj+
 host.obj+
 html-parse.obj+
 html-url.obj+
index 0fddcf3ad5604939f3efb5040a03c489809bc2e1..9d349db3df19466f4ac9fb501aa7902f1f3ebc25 100644 (file)
@@ -22,7 +22,7 @@ CFLAGS= -DWINDOWS -DHAVE_CONFIG_H -O3 -Wall -I.
 LIBS= -lwsock32
 OBJ_EXT=.o
 OBJS=cmpt${OBJ_EXT} convert${OBJ_EXT} connect${OBJ_EXT} ftp${OBJ_EXT} ftp-basic${OBJ_EXT}  \
-      ftp-ls${OBJ_EXT} ftp-opie${OBJ_EXT} getopt${OBJ_EXT} headers${OBJ_EXT} host${OBJ_EXT} html-parse${OBJ_EXT} html-url${OBJ_EXT} \
+      ftp-ls${OBJ_EXT} ftp-opie${OBJ_EXT} getopt${OBJ_EXT} host${OBJ_EXT} html-parse${OBJ_EXT} html-url${OBJ_EXT} \
       http${OBJ_EXT} init${OBJ_EXT} log${OBJ_EXT} main${OBJ_EXT} gnu-md5${OBJ_EXT} netrc${OBJ_EXT} \
       safe-ctype${OBJ_EXT} hash${OBJ_EXT} progress${OBJ_EXT} gen-md5${OBJ_EXT} cookies${OBJ_EXT} \
       recur${OBJ_EXT} res${OBJ_EXT} retr${OBJ_EXT} url${OBJ_EXT} utils${OBJ_EXT} \
index 75077d01305969e4b297ab99042993b41e9fb05e..f235c647049217258d2f2a1d13a6e9554df3c9d1 100644 (file)
@@ -52,7 +52,7 @@ CFLAGS+= /os /d2
 #       ^^-- mind the gap !!
 
 OBJS = cmpt.obj convert.obj connect.obj cookies.obj ftp.obj ftp-basic.obj  &
-      ftp-ls.obj ftp-opie.obj getopt.obj hash.obj headers.obj host.obj html-parse.obj html-url.obj  &
+      ftp-ls.obj ftp-opie.obj getopt.obj hash.obj host.obj html-parse.obj html-url.obj  &
       http.obj init.obj log.obj main.obj gen-md5.obj gnu-md5.obj netrc.obj progress.obj  &
       recur.obj res.obj retr.obj safe-ctype.obj url.obj utils.obj version.obj mswindows.obj
 
index e2c2851a710549ac37bc71a72078e6ea4c261dff..bac6130b8e2a9c9d2b6b5af66d84c5c47f1ae66a 100644 (file)
@@ -13,11 +13,10 @@ gen_sslfunc$o: gen_sslfunc.c config.h wget.h sysdep.h mswindows.h options.h safe
 getopt$o: getopt.c config.h wget.h sysdep.h mswindows.h options.h safe-ctype.h getopt.h
 gnu-md5$o: gnu-md5.c config.h wget.h sysdep.h mswindows.h options.h safe-ctype.h gnu-md5.h
 hash$o: hash.c config.h wget.h sysdep.h mswindows.h options.h safe-ctype.h utils.h hash.h
-headers$o: headers.c config.h wget.h sysdep.h mswindows.h options.h safe-ctype.h connect.h host.h headers.h
 host$o: host.c config.h wget.h sysdep.h mswindows.h options.h safe-ctype.h utils.h host.h url.h hash.h
 html-parse$o: html-parse.c config.h wget.h sysdep.h mswindows.h options.h safe-ctype.h html-parse.h
 html-url$o: html-url.c config.h wget.h sysdep.h mswindows.h options.h safe-ctype.h html-parse.h url.h utils.h
-http$o: http.c config.h wget.h sysdep.h mswindows.h options.h safe-ctype.h utils.h url.h host.h retr.h headers.h connect.h netrc.h gen-md5.h
+http$o: http.c config.h wget.h sysdep.h mswindows.h options.h safe-ctype.h utils.h url.h host.h retr.h connect.h netrc.h gen-md5.h
 init$o: init.c config.h wget.h sysdep.h mswindows.h options.h safe-ctype.h utils.h init.h host.h recur.h netrc.h cookies.h progress.h
 log$o: log.c config.h wget.h sysdep.h mswindows.h options.h safe-ctype.h utils.h
 main$o: main.c config.h wget.h sysdep.h mswindows.h options.h safe-ctype.h utils.h getopt.h init.h retr.h recur.h host.h gen_sslfunc.h getopt.h