Use Gnulib's alloc functions throughout the source.

This commit is contained in:
Steven Schubiger 2008-04-19 01:21:24 +02:00
parent b06220f359
commit 76780021d8
33 changed files with 92 additions and 0 deletions

View File

@ -28,6 +28,8 @@ Corresponding Source for a non-source form of such a combination
shall include the source code for the parts of OpenSSL used as well
as that of the covered work. */
#define USE_GNULIB_ALLOC
#include "wget.h"
#include <stdio.h>

View File

@ -28,6 +28,8 @@ Corresponding Source for a non-source form of such a combination
shall include the source code for the parts of OpenSSL used as well
as that of the covered work. */
#define USE_GNULIB_ALLOC
#include "wget.h"
#include <stdio.h>

View File

@ -28,6 +28,8 @@ Corresponding Source for a non-source form of such a combination
shall include the source code for the parts of OpenSSL used as well
as that of the covered work. */
#define USE_GNULIB_ALLOC
#include "wget.h"
#include <stdio.h>

View File

@ -43,6 +43,8 @@ as that of the covered work. */
sites that do send Set-Cookie2 also emit Set-Cookie for
compatibility. */
#define USE_GNULIB_ALLOC
#include "wget.h"
#include <stdio.h>

View File

@ -28,6 +28,8 @@ Corresponding Source for a non-source form of such a combination
shall include the source code for the parts of OpenSSL used as well
as that of the covered work. */
#define USE_GNULIB_ALLOC
#include "wget.h"
#include <assert.h>

View File

@ -28,6 +28,8 @@ Corresponding Source for a non-source form of such a combination
shall include the source code for the parts of OpenSSL used as well
as that of the covered work. */
#define USE_GNULIB_ALLOC
#include "wget.h"
#include <stdio.h>

View File

@ -28,6 +28,8 @@ Corresponding Source for a non-source form of such a combination
shall include the source code for the parts of OpenSSL used as well
as that of the covered work. */
#define USE_GNULIB_ALLOC
#include "wget.h"
#include <stdio.h>

View File

@ -28,6 +28,8 @@ Corresponding Source for a non-source form of such a combination
shall include the source code for the parts of OpenSSL used as well
as that of the covered work. */
#define USE_GNULIB_ALLOC
#include "wget.h"
#include <stdio.h>

View File

@ -28,6 +28,8 @@ Corresponding Source for a non-source form of such a combination
shall include the source code for the parts of OpenSSL used as well
as that of the covered work. */
#define USE_GNULIB_ALLOC
#include "wget.h"
#include "gen-md5.h"

View File

@ -27,6 +27,8 @@ Corresponding Source for a non-source form of such a combination
shall include the source code for the parts of OpenSSL used as well
as that of the covered work. */
#define USE_GNULIB_ALLOC
#include "wget.h"
#include <assert.h>

View File

@ -31,6 +31,8 @@ as that of the covered work. */
/* With -DSTANDALONE, this file can be compiled outside Wget source
tree. To test, also use -DTEST. */
#define USE_GNULIB_ALLOC
#ifndef STANDALONE
# include "wget.h"
#endif

View File

@ -28,6 +28,8 @@ Corresponding Source for a non-source form of such a combination
shall include the source code for the parts of OpenSSL used as well
as that of the covered work. */
#define USE_GNULIB_ALLOC
#include "wget.h"
#include <stdio.h>

View File

@ -89,6 +89,8 @@ as that of the covered work. */
/* To test as standalone, compile with `-DSTANDALONE -I.'. You'll
still need Wget headers to compile. */
#define USE_GNULIB_ALLOC
#include "wget.h"
#ifdef STANDALONE
@ -100,6 +102,7 @@ as that of the covered work. */
#include <string.h>
#include <assert.h>
#include "utils.h"
#include "html-parse.h"
#ifdef STANDALONE

View File

@ -28,6 +28,8 @@ Corresponding Source for a non-source form of such a combination
shall include the source code for the parts of OpenSSL used as well
as that of the covered work. */
#define USE_GNULIB_ALLOC
#include "wget.h"
#include <stdio.h>

View File

@ -28,6 +28,8 @@ Corresponding Source for a non-source form of such a combination
shall include the source code for the parts of OpenSSL used as well
as that of the covered work. */
#define USE_GNULIB_ALLOC
#include "wget.h"
/* NTLM details:

View File

@ -28,6 +28,8 @@ Corresponding Source for a non-source form of such a combination
shall include the source code for the parts of OpenSSL used as well
as that of the covered work. */
#define USE_GNULIB_ALLOC
#include "wget.h"
#include <stdio.h>

View File

@ -28,6 +28,8 @@ Corresponding Source for a non-source form of such a combination
shall include the source code for the parts of OpenSSL used as well
as that of the covered work. */
#define USE_GNULIB_ALLOC
#include "wget.h"
#include <stdio.h>

View File

@ -28,6 +28,8 @@ Corresponding Source for a non-source form of such a combination
shall include the source code for the parts of OpenSSL used as well
as that of the covered work. */
#define USE_GNULIB_ALLOC
#include "wget.h"
#include <stdio.h>

View File

@ -28,6 +28,8 @@ Corresponding Source for a non-source form of such a combination
shall include the source code for the parts of OpenSSL used as well
as that of the covered work. */
#define USE_GNULIB_ALLOC
#include "wget.h"
#include <stdio.h>

View File

@ -28,6 +28,8 @@ Corresponding Source for a non-source form of such a combination
shall include the source code for the parts of OpenSSL used as well
as that of the covered work. */
#define USE_GNULIB_ALLOC
#define INHIBIT_WRAP /* avoid wrapping of socket, bind, ... */
#include "wget.h"

View File

@ -30,6 +30,8 @@ as that of the covered work. */
/* This file used to be kept in synch with the code in Fetchmail, but
the latter has diverged since. */
#define USE_GNULIB_ALLOC
#include "wget.h"
#include <stdio.h>

View File

@ -29,6 +29,8 @@ Corresponding Source for a non-source form of such a combination
shall include the source code for the parts of OpenSSL used as well
as that of the covered work. */
#define USE_GNULIB_ALLOC
#include "wget.h"
#include <assert.h>

View File

@ -28,6 +28,8 @@ Corresponding Source for a non-source form of such a combination
shall include the source code for the parts of OpenSSL used as well
as that of the covered work. */
#define USE_GNULIB_ALLOC
#include "wget.h"
#include <stdio.h>

View File

@ -50,6 +50,8 @@ as that of the covered work. */
double secs = ptimer_measure ();
printf ("The loop took %.2fs\n", secs); */
#define USE_GNULIB_ALLOC
#include "wget.h"
#include <stdio.h>
@ -71,6 +73,7 @@ as that of the covered work. */
# include <windows.h>
#endif
#include "utils.h"
#include "ptimer.h"
/* Depending on the OS, one and only one of PTIMER_POSIX,

View File

@ -28,6 +28,8 @@ Corresponding Source for a non-source form of such a combination
shall include the source code for the parts of OpenSSL used as well
as that of the covered work. */
#define USE_GNULIB_ALLOC
#include "wget.h"
#include <stdio.h>

View File

@ -67,6 +67,8 @@ as that of the covered work. */
res_match_path, res_register_specs, res_get_specs, and
res_retrieve_file. */
#define USE_GNULIB_ALLOC
#include "wget.h"
#include <stdio.h>

View File

@ -28,6 +28,8 @@ Corresponding Source for a non-source form of such a combination
shall include the source code for the parts of OpenSSL used as well
as that of the covered work. */
#define USE_GNULIB_ALLOC
#include "wget.h"
#include <stdio.h>

View File

@ -87,6 +87,8 @@
*
**************************************************************/
#define USE_GNULIB_ALLOC
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

View File

@ -27,6 +27,8 @@ Corresponding Source for a non-source form of such a combination
shall include the source code for the parts of OpenSSL used as well
as that of the covered work. */
#define USE_GNULIB_ALLOC
#include "wget.h"
#include <stdio.h>

View File

@ -27,6 +27,8 @@ Corresponding Source for a non-source form of such a combination
shall include the source code for the parts of OpenSSL used as well
as that of the covered work. */
#define USE_GNULIB_ALLOC
#include <stdio.h>
#include "test.h"

View File

@ -28,6 +28,8 @@ Corresponding Source for a non-source form of such a combination
shall include the source code for the parts of OpenSSL used as well
as that of the covered work. */
#define USE_GNULIB_ALLOC
#include "wget.h"
#include <stdio.h>

View File

@ -28,6 +28,8 @@ Corresponding Source for a non-source form of such a combination
shall include the source code for the parts of OpenSSL used as well
as that of the covered work. */
#define USE_GNULIB_ALLOC
#include "wget.h"
#include <stdio.h>

View File

@ -31,6 +31,32 @@ as that of the covered work. */
#ifndef UTILS_H
#define UTILS_H
#ifdef USE_GNULIB_ALLOC
/* Constant is using when we don`t know attempted size exactly */
#define UNKNOWN_ATTEMPTED_SIZE -3
/* Macros that interface to malloc, but know about type sizes, and
cast the result to the appropriate type. The casts are not
necessary in standard C, but Wget performs them anyway for the sake
of pre-standard environments and possibly C++. */
#define xnew(type) (xmalloc (sizeof (type)))
#define xnew0(type) (xcalloc (1, sizeof (type)))
#define xnew_array(type, len) (xmalloc ((len) * sizeof (type)))
#define xnew0_array(type, len) (xcalloc ((len), sizeof (type)))
#define alloca_array(type, size) ((type *) alloca ((size) * sizeof (type)))
#define xfree free
/* Free P if it is non-NULL. C requires free() to behaves this way by
default, but Wget's code is historically careful not to pass NULL
to free. This allows us to assert p!=NULL in xfree to check
additional errors. (But we currently don't do that!) */
#define xfree_null(p) if (!(p)) ; else xfree (p)
#endif /* USE_GNULIB_ALLOC */
struct hash_table;
struct file_memory {