diff --git a/config.h.win32 b/config.h.win32 index 962ffe2be8..301d2871f4 100644 --- a/config.h.win32 +++ b/config.h.win32 @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: config.h.win32,v 1.21 2009/07/17 23:47:40 tbox Exp $ */ +/* $Id: config.h.win32,v 1.22 2009/09/02 23:43:54 each Exp $ */ /* * win32 configuration file @@ -51,7 +51,10 @@ /* * Windows NT and 2K only */ +#ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0400 +#endif + /* Define if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -239,3 +242,9 @@ typedef long off_t; * Define if libxml2 is present */ #define HAVE_LIBXML2 1 + +/* + * Define when building BIND9. When building exportable versions + * of libisc, libdns, etc, this must be removed. + */ +#define BIND9 1 diff --git a/lib/dns/rdata/generic/hip_55.c b/lib/dns/rdata/generic/hip_55.c index c5e0687ee2..101066209f 100644 --- a/lib/dns/rdata/generic/hip_55.c +++ b/lib/dns/rdata/generic/hip_55.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: hip_55.c,v 1.3 2009/02/26 11:18:56 tbox Exp $ */ +/* $Id: hip_55.c,v 1.4 2009/09/02 23:43:54 each Exp $ */ /* reviewed: TBC */ @@ -215,7 +215,7 @@ fromwire_hip(ARGS_FROMWIRE) { if (key_len == 0) RETERR(DNS_R_FORMERR); isc_region_consume(®ion, 2); - if (region.length < hit_len + key_len) + if (region.length < (unsigned) (hit_len + key_len)) RETERR(DNS_R_FORMERR); RETERR(mem_tobuffer(target, rr.base, 4 + hit_len + key_len)); diff --git a/lib/isc/include/isc/mem.h b/lib/isc/include/isc/mem.h index 28edcb67a3..ef6e3c89c9 100644 --- a/lib/isc/include/isc/mem.h +++ b/lib/isc/include/isc/mem.h @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: mem.h,v 1.83 2009/09/01 23:47:44 tbox Exp $ */ +/* $Id: mem.h,v 1.84 2009/09/02 23:43:54 each Exp $ */ #ifndef ISC_MEM_H #define ISC_MEM_H 1 @@ -152,11 +152,11 @@ LIBISC_EXTERNAL_DATA extern unsigned int isc_mem_debugging; #endif -#define isc_mem_get(c, s) isc__mem_get((c), (s) _ISC_MEM_FILELINE) -#define isc_mem_allocate(c, s) isc__mem_allocate((c), (s) _ISC_MEM_FILELINE) -#define isc_mem_reallocate(c, p, s) isc__mem_reallocate((c), (p), (s) _ISC_MEM_FILELINE) -#define isc_mem_strdup(c, p) isc__mem_strdup((c), (p) _ISC_MEM_FILELINE) -#define isc_mempool_get(c) isc__mempool_get((c) _ISC_MEM_FILELINE) +#define isc_mem_get(c, s) isc___mem_get((c), (s) _ISC_MEM_FILELINE) +#define isc_mem_allocate(c, s) isc___mem_allocate((c), (s) _ISC_MEM_FILELINE) +#define isc_mem_reallocate(c, p, s) isc___mem_reallocate((c), (p), (s) _ISC_MEM_FILELINE) +#define isc_mem_strdup(c, p) isc___mem_strdup((c), (p) _ISC_MEM_FILELINE) +#define isc_mempool_get(c) isc___mempool_get((c) _ISC_MEM_FILELINE) /*% * isc_mem_putanddetach() is a convenience function for use where you @@ -197,6 +197,8 @@ typedef struct isc_memmethods { void (*memputanddetach)(isc_mem_t **mctxp, void *ptr, size_t size _ISC_MEM_FLARG); void *(*memallocate)(isc_mem_t *mctx, size_t size _ISC_MEM_FLARG); + void *(*memreallocate)(isc_mem_t *mctx, void *ptr, + size_t size _ISC_MEM_FLARG); char *(*memstrdup)(isc_mem_t *mctx, const char *s _ISC_MEM_FLARG); void (*memfree)(isc_mem_t *mctx, void *ptr _ISC_MEM_FLARG); void (*setdestroycheck)(isc_mem_t *mctx, isc_boolean_t flag); @@ -256,29 +258,29 @@ struct isc_mempool { #if ISC_MEM_DEBUG #define isc_mem_put(c, p, s) \ do { \ - isc__mem_put((c), (p), (s) _ISC_MEM_FILELINE); \ + isc___mem_put((c), (p), (s) _ISC_MEM_FILELINE); \ (p) = NULL; \ } while (0) #define isc_mem_putanddetach(c, p, s) \ do { \ - isc__mem_putanddetach((c), (p), (s) _ISC_MEM_FILELINE); \ + isc___mem_putanddetach((c), (p), (s) _ISC_MEM_FILELINE); \ (p) = NULL; \ } while (0) #define isc_mem_free(c, p) \ do { \ - isc__mem_free((c), (p) _ISC_MEM_FILELINE); \ + isc___mem_free((c), (p) _ISC_MEM_FILELINE); \ (p) = NULL; \ } while (0) #define isc_mempool_put(c, p) \ do { \ - isc__mempool_put((c), (p) _ISC_MEM_FILELINE); \ + isc___mempool_put((c), (p) _ISC_MEM_FILELINE); \ (p) = NULL; \ } while (0) #else -#define isc_mem_put(c, p, s) isc__mem_put((c), (p), (s) _ISC_MEM_FILELINE) +#define isc_mem_put(c, p, s) isc___mem_put((c), (p), (s) _ISC_MEM_FILELINE) #define isc_mem_putanddetach(c, p, s) \ - isc__mem_putanddetach((c), (p), (s) _ISC_MEM_FILELINE) -#define isc_mem_free(c, p) isc__mem_free((c), (p) _ISC_MEM_FILELINE) + isc___mem_putanddetach((c), (p), (s) _ISC_MEM_FILELINE) +#define isc_mem_free(c, p) isc___mem_free((c), (p) _ISC_MEM_FILELINE) #define isc_mempool_put(c, p) isc__mempool_put((c), (p) _ISC_MEM_FILELINE) #endif @@ -671,23 +673,23 @@ isc_mempool_setfillcount(isc_mempool_t *mpctx, unsigned int limit); * Pseudo-private functions for use via macros. Do not call directly. */ void * -isc__mem_get(isc_mem_t *, size_t _ISC_MEM_FLARG); +isc___mem_get(isc_mem_t *, size_t _ISC_MEM_FLARG); void -isc__mem_putanddetach(isc_mem_t **, void *, size_t _ISC_MEM_FLARG); +isc___mem_putanddetach(isc_mem_t **, void *, size_t _ISC_MEM_FLARG); void -isc__mem_put(isc_mem_t *, void *, size_t _ISC_MEM_FLARG); +isc___mem_put(isc_mem_t *, void *, size_t _ISC_MEM_FLARG); void * -isc__mem_allocate(isc_mem_t *, size_t _ISC_MEM_FLARG); +isc___mem_allocate(isc_mem_t *, size_t _ISC_MEM_FLARG); void * -isc__mem_reallocate(isc_mem_t *, void *, size_t _ISC_MEM_FLARG); +isc___mem_reallocate(isc_mem_t *, void *, size_t _ISC_MEM_FLARG); void -isc__mem_free(isc_mem_t *, void * _ISC_MEM_FLARG); +isc___mem_free(isc_mem_t *, void * _ISC_MEM_FLARG); char * -isc__mem_strdup(isc_mem_t *, const char *_ISC_MEM_FLARG); +isc___mem_strdup(isc_mem_t *, const char *_ISC_MEM_FLARG); void * -isc__mempool_get(isc_mempool_t * _ISC_MEM_FLARG); +isc___mempool_get(isc_mempool_t * _ISC_MEM_FLARG); void -isc__mempool_put(isc_mempool_t *, void * _ISC_MEM_FLARG); +isc___mempool_put(isc_mempool_t *, void * _ISC_MEM_FLARG); #ifdef USE_MEMIMPREGISTER diff --git a/lib/isc/include/isc/namespace.h b/lib/isc/include/isc/namespace.h index 9cc8d60a84..24fdcecc89 100644 --- a/lib/isc/include/isc/namespace.h +++ b/lib/isc/include/isc/namespace.h @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: namespace.h,v 1.2 2009/09/01 00:22:28 jinmei Exp $ */ +/* $Id: namespace.h,v 1.3 2009/09/02 23:43:54 each Exp $ */ #ifndef ISCAPI_NAMESPACE_H #define ISCAPI_NAMESPACE_H 1 @@ -59,6 +59,7 @@ #define isc__mem_allocate isc___mem_allocate #define isc__mem_free isc___mem_free #define isc__mem_strdup isc___mem_strdup +#define isc__mem_reallocate isc___mem_reallocate #define isc_mem_references isc__mem_references #define isc_mem_setdestroycheck isc__mem_setdestroycheck #define isc_mem_setquota isc__mem_setquota diff --git a/lib/isc/include/isc/socket.h b/lib/isc/include/isc/socket.h index 11ee408935..376dcc09ad 100644 --- a/lib/isc/include/isc/socket.h +++ b/lib/isc/include/isc/socket.h @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: socket.h,v 1.92 2009/09/02 18:32:25 each Exp $ */ +/* $Id: socket.h,v 1.93 2009/09/02 23:43:54 each Exp $ */ #ifndef ISC_SOCKET_H #define ISC_SOCKET_H 1 @@ -1068,7 +1068,7 @@ void *isc_socket_gettag(isc_socket_t *socket); */ void -isc_socketmgr_setreserved(isc_socketmgr_t *mgr, isc_uint32_t); +isc__socketmgr_setreserved(isc_socketmgr_t *mgr, isc_uint32_t); /*%< * Temporary. For use by named only. */ diff --git a/lib/isc/mem.c b/lib/isc/mem.c index 934694f618..ef6ece0c29 100644 --- a/lib/isc/mem.c +++ b/lib/isc/mem.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: mem.c,v 1.152 2009/09/02 04:25:19 jinmei Exp $ */ +/* $Id: mem.c,v 1.153 2009/09/02 23:43:54 each Exp $ */ /*! \file */ @@ -255,6 +255,8 @@ ISC_MEMFUNC_SCOPE void isc__mem_stats(isc_mem_t *ctx, FILE *out); ISC_MEMFUNC_SCOPE void * isc___mem_allocate(isc_mem_t *ctx, size_t size FLARG); +ISC_MEMFUNC_SCOPE void * +isc___mem_reallocate(isc_mem_t *ctx, void *ptr, size_t size FLARG); ISC_MEMFUNC_SCOPE void isc___mem_free(isc_mem_t *ctx, void *ptr FLARG); ISC_MEMFUNC_SCOPE char * @@ -336,6 +338,7 @@ static struct isc__memmethods { isc___mem_put, isc___mem_putanddetach, isc___mem_allocate, + isc___mem_reallocate, isc___mem_strdup, isc___mem_free, isc__mem_setdestroycheck, @@ -1545,8 +1548,9 @@ isc___mem_allocate(isc_mem_t *ctx0, size_t size FLARG) { return (si); } -void * -isc__mem_reallocate(isc_mem_t *ctx, void *ptr, size_t size FLARG) { +ISC_MEMFUNC_SCOPE void * +isc___mem_reallocate(isc_mem_t *ctx0, void *ptr, size_t size FLARG) { + isc__mem_t *ctx = (isc__mem_t *)ctx0; void *new_ptr = NULL; size_t oldsize, copysize; @@ -1564,17 +1568,17 @@ isc__mem_reallocate(isc_mem_t *ctx, void *ptr, size_t size FLARG) { * NULL if allocation fails or doesn't happen. */ if (size > 0U) { - new_ptr = isc__mem_allocate(ctx, size FLARG_PASS); + new_ptr = isc__mem_allocate(ctx0, size FLARG_PASS); if (new_ptr != NULL && ptr != NULL) { oldsize = (((size_info *)ptr)[-1]).u.size; INSIST(oldsize >= ALIGNMENT_SIZE); oldsize -= ALIGNMENT_SIZE; copysize = oldsize > size ? size : oldsize; memcpy(new_ptr, ptr, copysize); - isc__mem_free(ctx, ptr FLARG_PASS); + isc__mem_free(ctx0, ptr FLARG_PASS); } } else if (ptr != NULL) - isc__mem_free(ctx, ptr FLARG_PASS); + isc__mem_free(ctx0, ptr FLARG_PASS); return (new_ptr); } diff --git a/lib/isc/mem_api.c b/lib/isc/mem_api.c index e50c56b843..a6f2c3aa35 100644 --- a/lib/isc/mem_api.c +++ b/lib/isc/mem_api.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: mem_api.c,v 1.3 2009/09/01 03:43:27 jinmei Exp $ */ +/* $Id: mem_api.c,v 1.4 2009/09/02 23:43:54 each Exp $ */ #include @@ -148,6 +148,13 @@ isc__mem_allocate(isc_mem_t *mctx, size_t size FLARG) { return (mctx->methods->memallocate(mctx, size FLARG_PASS)); } +void * +isc__mem_reallocate(isc_mem_t *mctx, void *ptr, size_t size FLARG) { + REQUIRE(ISCAPI_MCTX_VALID(mctx)); + + return (mctx->methods->memreallocate(mctx, ptr, size FLARG_PASS)); +} + char * isc__mem_strdup(isc_mem_t *mctx, const char *s FLARG) { REQUIRE(ISCAPI_MCTX_VALID(mctx)); diff --git a/lib/isc/win32/libisc.def b/lib/isc/win32/libisc.def index cffe791c84..1773472802 100644 --- a/lib/isc/win32/libisc.def +++ b/lib/isc/win32/libisc.def @@ -51,6 +51,7 @@ isc__app_unblock isc_assertion_setcallback isc_assertion_typetotext isc_backtrace_getsymbol +isc_backtrace_getsymbolfromindex isc_backtrace_gettrace isc_base32_decoderegion isc_base32_decodestring @@ -128,6 +129,7 @@ isc_file_renameunique isc_file_safecreate isc_file_safemovefile isc_file_settime +isc_file_splitpath isc_file_template isc_file_truncate isc_fsaccess_add diff --git a/lib/isccfg/parser.c b/lib/isccfg/parser.c index 1314e7a5de..e76a53df8a 100644 --- a/lib/isccfg/parser.c +++ b/lib/isccfg/parser.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: parser.c,v 1.131 2009/06/11 23:47:55 tbox Exp $ */ +/* $Id: parser.c,v 1.132 2009/09/02 23:43:54 each Exp $ */ /*! \file */ @@ -29,12 +29,12 @@ #include #include #include +#include #include #include #include -#include -#include #include +#include #include #include