From 61e9c1cdbe29683bb2db388e4fc6a6fd59315cef Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Fri, 28 Apr 2000 00:36:56 +0000 Subject: [PATCH] 116. [func] Added for isc_offset_t --- CHANGES | 3 +++ lib/dns/journal.c | 10 +--------- lib/isc/include/isc/log.h | 7 ++----- lib/isc/include/isc/types.h | 15 ++++++++++++++- lib/isc/unix/include/isc/offset.h | 31 +++++++++++++++++++++++++++++++ util/copyrights | 1 + 6 files changed, 52 insertions(+), 15 deletions(-) create mode 100644 lib/isc/unix/include/isc/offset.h diff --git a/CHANGES b/CHANGES index f267507379..a472fdebda 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ + 116. [func] Added for isc_offset_t (aka off_t + on Unix systems). + 115. [port] Shut up the -Wmissing-declarations warning about 's __sputaux on BSD/OS pre-4.1. diff --git a/lib/dns/journal.c b/lib/dns/journal.c index dd5f034190..e2ae0bfc1a 100644 --- a/lib/dns/journal.c +++ b/lib/dns/journal.c @@ -24,8 +24,6 @@ #include #include -#include - #include #include #include @@ -830,19 +828,13 @@ typedef enum { JOURNAL_STATE_TRANSACTION } journal_state_t; -/* - * XXXRTH We use 'off_t' in the following structure. If we continue to - * use stdio instead of creating an ISC file module, we'll convert - * 'off_t' to 'long'. - */ - struct dns_journal { unsigned int magic; /* JOUR */ isc_mem_t *mctx; /* Memory context */ journal_state_t state; const char *filename; /* Journal file name */ FILE * fp; /* File handle */ - off_t offset; /* Current file offset */ + isc_offset_t offset; /* Current file offset */ journal_header_t header; /* In-core journal header */ journal_pos_t *index; /* In-core journal index */ diff --git a/lib/isc/include/isc/log.h b/lib/isc/include/isc/log.h index 3df80c7448..bd33fa0510 100644 --- a/lib/isc/include/isc/log.h +++ b/lib/isc/include/isc/log.h @@ -15,13 +15,11 @@ * SOFTWARE. */ -/* $Id: log.h,v 1.17 2000/04/27 23:44:44 tale Exp $ */ +/* $Id: log.h,v 1.18 2000/04/28 00:36:55 tale Exp $ */ #ifndef ISC_LOG_H #define ISC_LOG_H 1 -#include /* XXXDCL NT; need for off_t on some systems */ - #include #include #include /* XXXDCL NT */ @@ -108,8 +106,7 @@ typedef struct isc_logfile { * anyone would want). st_size returned by fstat should be typedef'd * to a size large enough for the largest possible file on a system. */ - /* XXXDCL NT */ - off_t maximum_size; + isc_offset_t maximum_size; } isc_logfile_t; /* diff --git a/lib/isc/include/isc/types.h b/lib/isc/include/isc/types.h index c5432f7ea6..990cd3b2b7 100644 --- a/lib/isc/include/isc/types.h +++ b/lib/isc/include/isc/types.h @@ -18,8 +18,21 @@ #ifndef ISC_TYPES_H #define ISC_TYPES_H 1 +/* + * OS-specific types, from the OS-specific include directories. + */ #include +#include + +/* + * XXXDCL should isc_boolean_t be moved here, requiring an explicit include + * of when ISC_TRUE/ISC_FALSE/ISC_TF() are desired? + */ #include +/* + * XXXDCL This is just for ISC_LIST and ISC_LINK, but gets all of the other + * list macros too. + */ #include /*** @@ -30,7 +43,7 @@ typedef struct isc_bitstring isc_bitstring_t; typedef struct isc_buffer isc_buffer_t; typedef ISC_LIST(isc_buffer_t) isc_bufferlist_t; typedef struct isc_event isc_event_t; -typedef ISC_LIST(struct isc_event) isc_eventlist_t; +typedef ISC_LIST(isc_event_t) isc_eventlist_t; typedef unsigned int isc_eventtype_t; typedef struct isc_interface isc_interface_t; typedef struct isc_interfaceiter isc_interfaceiter_t; diff --git a/lib/isc/unix/include/isc/offset.h b/lib/isc/unix/include/isc/offset.h new file mode 100644 index 0000000000..bd16665548 --- /dev/null +++ b/lib/isc/unix/include/isc/offset.h @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2000 Internet Software Consortium. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS + * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE + * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + */ + +/* $Id: offset.h,v 1.1 2000/04/28 00:36:56 tale Exp $ */ + +#ifndef ISC_OFFSET_T +#define ISC_OFFSET_T 1 + +/* + * File offsets are operating-system dependent. + */ + +#include + +typedef isc_offset_t off_t; + +#endif /* ISC_OFFSET_T */ diff --git a/util/copyrights b/util/copyrights index c8a816608c..03be47ce3b 100644 --- a/util/copyrights +++ b/util/copyrights @@ -711,6 +711,7 @@ ./lib/isc/unix/include/isc/ipv6.h C 1999,2000 ./lib/isc/unix/include/isc/net.h C 1999,2000 ./lib/isc/unix/include/isc/netdb.h C 1999,2000 +./lib/isc/unix/include/isc/offset.h C 2000 ./lib/isc/unix/include/isc/stdtime.h C 1999,2000 ./lib/isc/unix/include/isc/time.h C 1998,1999,2000 ./lib/isc/unix/interfaceiter.c C 1999,2000