diff --git a/lib/isc/assertions.c b/lib/isc/assertions.c index 63a2a5ce79..08dd5f3d51 100644 --- a/lib/isc/assertions.c +++ b/lib/isc/assertions.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: assertions.c,v 1.15 2001/07/12 05:58:17 mayer Exp $ */ +/* $Id: assertions.c,v 1.16 2001/07/16 03:52:05 mayer Exp $ */ #include @@ -36,7 +36,8 @@ default_callback(const char *, int, isc_assertiontype_t, const char *); * Public. */ -LIBISC_EXTERNAL_DATA isc_assertioncallback_t isc_assertion_failed = default_callback; +LIBISC_EXTERNAL_DATA isc_assertioncallback_t isc_assertion_failed = + default_callback; void isc_assertion_setcallback(isc_assertioncallback_t cb) { diff --git a/lib/isc/commandline.c b/lib/isc/commandline.c index 5120140663..dedaf341cd 100644 --- a/lib/isc/commandline.c +++ b/lib/isc/commandline.c @@ -48,7 +48,7 @@ * SUCH DAMAGE. */ -/* $Id: commandline.c,v 1.14 2001/07/12 05:58:18 mayer Exp $ */ +/* $Id: commandline.c,v 1.15 2001/07/16 03:52:06 mayer Exp $ */ /* * This file was adapted from the NetBSD project's source tree, RCS ID: @@ -72,14 +72,18 @@ #include #include -LIBISC_EXTERNAL_DATA int isc_commandline_index = 1; /* Index into parent argv vector. */ -LIBISC_EXTERNAL_DATA int isc_commandline_option; /* Character checked for validity. */ - -LIBISC_EXTERNAL_DATA char *isc_commandline_argument; /* Argument associated with option. */ -LIBISC_EXTERNAL_DATA char *isc_commandline_progname; /* For printing error messages. */ - -LIBISC_EXTERNAL_DATA isc_boolean_t isc_commandline_errprint = ISC_TRUE; /* Print error messages. */ -LIBISC_EXTERNAL_DATA isc_boolean_t isc_commandline_reset = ISC_TRUE; /* Reset processing. */ +/* Index into parent argv vector. */ +LIBISC_EXTERNAL_DATA int isc_commandline_index = 1; +/* Character checked for validity. */ +LIBISC_EXTERNAL_DATA int isc_commandline_option; +/* Argument associated with option. */ +LIBISC_EXTERNAL_DATA char *isc_commandline_argument; +/* For printing error messages. */ +LIBISC_EXTERNAL_DATA char *isc_commandline_progname; +/* Print error messages. */ +LIBISC_EXTERNAL_DATA isc_boolean_t isc_commandline_errprint = ISC_TRUE; +/* Reset processing. */ +LIBISC_EXTERNAL_DATA isc_boolean_t isc_commandline_reset = ISC_TRUE; static char endopt = '\0'; diff --git a/lib/isc/include/isc/commandline.h b/lib/isc/include/isc/commandline.h index 563063b227..1d6304162d 100644 --- a/lib/isc/include/isc/commandline.h +++ b/lib/isc/include/isc/commandline.h @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: commandline.h,v 1.8 2001/07/12 05:58:22 mayer Exp $ */ +/* $Id: commandline.h,v 1.9 2001/07/16 03:52:07 mayer Exp $ */ #ifndef ISC_COMMANDLINE_H #define ISC_COMMANDLINE_H 1 @@ -24,15 +24,18 @@ #include #include - -LIBISC_EXTERNAL_DATA extern int isc_commandline_index; /* Index into parent argv vector. */ -LIBISC_EXTERNAL_DATA extern int isc_commandline_option; /* Character checked for validity. */ - -LIBISC_EXTERNAL_DATA extern char *isc_commandline_argument; /* Argument associated with option. */ -LIBISC_EXTERNAL_DATA extern char *isc_commandline_progname; /* For printing error messages. */ - -LIBISC_EXTERNAL_DATA extern isc_boolean_t isc_commandline_errprint; /* Print error message. */ -LIBISC_EXTERNAL_DATA extern isc_boolean_t isc_commandline_reset; /* Reset getopt. */ +/* Index into parent argv vector. */ +LIBISC_EXTERNAL_DATA extern int isc_commandline_index; +/* Character checked for validity. */ +LIBISC_EXTERNAL_DATA extern int isc_commandline_option; +/* Argument associated with option. */ +LIBISC_EXTERNAL_DATA extern char *isc_commandline_argument; +/* For printing error messages. */ +LIBISC_EXTERNAL_DATA extern char *isc_commandline_progname; +/* Print error message. */ +LIBISC_EXTERNAL_DATA extern isc_boolean_t isc_commandline_errprint; +/* Reset getopt. */ +LIBISC_EXTERNAL_DATA extern isc_boolean_t isc_commandline_reset; ISC_LANG_BEGINDECLS diff --git a/lib/isc/include/isc/file.h b/lib/isc/include/isc/file.h index 5b89efce75..a63de215e3 100644 --- a/lib/isc/include/isc/file.h +++ b/lib/isc/include/isc/file.h @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: file.h,v 1.20 2001/06/08 21:53:48 tale Exp $ */ +/* $Id: file.h,v 1.21 2001/07/16 03:52:08 mayer Exp $ */ #ifndef ISC_FILE_H #define ISC_FILE_H 1 @@ -216,11 +216,17 @@ isc_file_template(const char *path, const char *templet, char *buf, * such that path can be renamed to buf atomically. */ -isc_result_t -isc_file_renameunique(const char *file, char *templet); /* * Rename 'file' using 'templet' as a template for the new file name. */ +isc_result_t +isc_file_renameunique(const char *file, char *templet); +/* + * Given a file name, return the fully qualified path to the file + * + */ +isc_result_t +isc_file_getabsolutepath(const char *filename, char *path, size_t pathlen); /* * XXX We should also have a isc_file_writeeopen() function diff --git a/lib/isc/win32/file.c b/lib/isc/win32/file.c index 36a13899e9..7eab9a43fa 100644 --- a/lib/isc/win32/file.c +++ b/lib/isc/win32/file.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: file.c,v 1.15 2001/07/12 05:58:26 mayer Exp $ */ +/* $Id: file.c,v 1.16 2001/07/16 03:52:09 mayer Exp $ */ #include @@ -454,3 +454,22 @@ isc_file_progname(const char *filename, char *progname, size_t namelen) { progname[len] = '\0'; return (ISC_R_SUCCESS); } + +isc_result_t +isc_file_getabsolutepath(const char *filename, char *path, size_t pathlen) { + char *ptrname; + DWORD retval; + + REQUIRE(filename != NULL); + REQUIRE(path != NULL); + + retval = GetFullPathName(filename, pathlen, path, &ptrname); + + /* Something went wrong in getting the path */ + if (retval == 0) + return (ISC_R_NOTFOUND); + /* Caller needs to provide a larger buffer to contain the string */ + if (retval >= pathlen) + return (ISC_R_NOSPACE); + return(ISC_R_SUCCESS); +} diff --git a/lib/isc/win32/include/isc/net.h b/lib/isc/win32/include/isc/net.h index 3731b38c44..9c960973b7 100644 --- a/lib/isc/win32/include/isc/net.h +++ b/lib/isc/win32/include/isc/net.h @@ -15,11 +15,19 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: net.h,v 1.14 2001/07/08 05:09:29 mayer Exp $ */ +/* $Id: net.h,v 1.15 2001/07/16 03:52:13 mayer Exp $ */ #ifndef ISC_NET_H #define ISC_NET_H 1 +/* + * Also define LWRES_IPV6_H to keep it from being included if liblwres is + * being used, or redefinition errors will occur. + */ +#define LWRES_IPV6_H 1 + + + /***** ***** Module Info *****/ diff --git a/lib/isc/win32/include/isc/ntfile.h b/lib/isc/win32/include/isc/ntfile.h index fd0955d29e..9fe77bc191 100644 --- a/lib/isc/win32/include/isc/ntfile.h +++ b/lib/isc/win32/include/isc/ntfile.h @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: ntfile.h,v 1.4 2001/07/09 21:34:43 gson Exp $ */ +/* $Id: ntfile.h,v 1.5 2001/07/16 03:52:14 mayer Exp $ */ #ifndef ISC_NTFILE_H #define ISC_NTFILE_H 1 @@ -29,6 +29,50 @@ * be just the one iov to deal with. */ +/* + * Outside of lib isc we need to redefine these functions + * This is due to the way _iob is set up. + * liblwres should not use this. + */ + +#if !defined(LIBISC_EXPORTS) && !defined(LIBLWRES_EXPORTS) + +#undef fdopen +#undef getc + +#define fopen isc_ntfile_fopen +#define fclose isc_ntfile_fclose +#define fwrite isc_ntfile_fwrite +#define fread isc_ntfile_fread +#define fseek isc_ntfile_fseek +#define fflush isc_ntfile_flush +#define fsync isc_ntfile_sync +#define printf isc_ntfile_printf +#define fprintf isc_ntfile_fprintf +#define vfprintf isc_ntfile_vfprintf +#define getc isc_ntfile_getc +#define fgetc isc_ntfile_fgetc +#define fgets isc_ntfile_fgets +#define fputc isc_ntfile_fputc +#define fputs isc_ntfile_fputs +#define fgetpos isc_ntfile_fgetpos +#define freopen isc_ntfile_freopen +#define fdopen isc_ntfile_fdopen +#define open isc_ntfile_open +#define close isc_ntfile_close +#define read isc_ntfile_read +#define write isc_ntfile_write + +#undef stdin +#undef stdout +#undef stderr + +#define stdin isc_ntfile_getaddress(0) +#define stdout isc_ntfile_getaddress(1) +#define stderr isc_ntfile_getaddress(2) + +#endif + FILE* isc_ntfile_fopen(const char *filename, const char *mode); diff --git a/lib/isc/win32/libisc.def b/lib/isc/win32/libisc.def index cb16b7d58a..363b477997 100644 --- a/lib/isc/win32/libisc.def +++ b/lib/isc/win32/libisc.def @@ -78,6 +78,7 @@ isc_file_renameunique isc_file_basename isc_file_progname isc_file_safemovefile +isc_file_getabsolutepath isc_fsaccess_add isc_fsaccess_remove isc_fsaccess_set diff --git a/lib/isc/win32/ntfile.c b/lib/isc/win32/ntfile.c index e99d0fb35d..965a516092 100644 --- a/lib/isc/win32/ntfile.c +++ b/lib/isc/win32/ntfile.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: ntfile.c,v 1.3 2001/07/09 21:06:14 gson Exp $ */ +/* $Id: ntfile.c,v 1.4 2001/07/16 03:52:12 mayer Exp $ */ /* * This file has been necessitated by the fact that the iov array is local @@ -29,6 +29,7 @@ #include #include +#include FILE * isc_ntfile_fopen(const char *filename, const char *mode) {