[ntpsec commit] Remove the ISC message catalog layer.
Eric S. Raymond
esr at ntpsec.org
Tue Sep 29 10:59:32 UTC 2015
Module: ntpsec
Branch: master
Commit: 2dded300eba5701618194e0ac3f136d5fb1bb0c5
Changeset: http://git.ntpsec.org/ntpsec/commit/?id=2dded300eba5701618194e0ac3f136d5fb1bb0c5
Author: Eric S. Raymond <esr at thyrsus.com>
Date: Tue Sep 29 06:56:49 2015 -0400
Remove the ISC message catalog layer.
It might make sense for a user-facing application, but all it was being
used for was to internationalize text in error messages. There are
no catalogs for this becauae there don't need to be.
---
lib/isc/assertions.c | 7 +-
lib/isc/error.c | 9 +-
lib/isc/include/isc/lib.h | 9 --
lib/isc/include/isc/log.h | 21 ++---
lib/isc/include/isc/msgcat.h | 129 --------------------------
lib/isc/include/isc/msgs.h | 193 ---------------------------------------
lib/isc/include/isc/result.h | 2 +-
lib/isc/include/isc/util.h | 51 +++--------
lib/isc/lib.c | 80 ----------------
lib/isc/log.c | 43 ++++-----
lib/isc/netaddr.c | 1 -
lib/isc/nls/msgcat.c | 131 --------------------------
lib/isc/result.c | 31 ++-----
lib/isc/sockaddr.c | 23 +----
lib/isc/unix/ifiter_getifaddrs.c | 6 +-
lib/isc/unix/ifiter_ioctl.c | 87 ++++--------------
lib/isc/unix/ifiter_sysctl.c | 18 +---
lib/isc/unix/interfaceiter.c | 1 -
lib/isc/unix/net.c | 29 +-----
lib/isc/win32/libisc.def | 1 -
lib/isc/win32/net.c | 28 +-----
lib/isc/wscript | 2 -
22 files changed, 85 insertions(+), 817 deletions(-)
diff --git a/lib/isc/assertions.c b/lib/isc/assertions.c
index 31c4fe7..fc320c8 100644
--- a/lib/isc/assertions.c
+++ b/lib/isc/assertions.c
@@ -26,7 +26,6 @@
#include <isc/assertions.h>
#include <isc/backtrace.h>
-#include <isc/msgs.h>
#include <isc/result.h>
/*
@@ -115,10 +114,8 @@ default_callback(const char *file, int line, isc_assertiontype_t type,
if (result == ISC_R_SUCCESS && nframes > 0)
logsuffix = ", back trace";
- fprintf(stderr, "%s:%d: %s(%s) %s%s\n",
- file, line, isc_assertion_typetotext(type), cond,
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
- ISC_MSG_FAILED, "failed"), logsuffix);
+ fprintf(stderr, "%s:%d: %s(%s) failed%s\n",
+ file, line, isc_assertion_typetotext(type), cond, logsuffix);
if (result == ISC_R_SUCCESS) {
for (i = 0; i < nframes; i++) {
unsigned long offset;
diff --git a/lib/isc/error.c b/lib/isc/error.c
index 095100a..58a5782 100644
--- a/lib/isc/error.c
+++ b/lib/isc/error.c
@@ -25,7 +25,6 @@
#include <stdlib.h>
#include <isc/error.h>
-#include <isc/msgs.h>
/*% Default unexpected callback. */
static void
@@ -78,9 +77,7 @@ isc_error_fatal(const char *file, int line, const char *format, ...) {
void
isc_error_runtimecheck(const char *file, int line, const char *expression) {
- isc_error_fatal(file, line, "RUNTIME_CHECK(%s) %s", expression,
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
- ISC_MSG_FAILED, "failed"));
+ isc_error_fatal(file, line, "RUNTIME_CHECK(%s) failed", expression);
}
static void
@@ -97,9 +94,7 @@ static void
default_fatal_callback(const char *file, int line, const char *format,
va_list args)
{
- fprintf(stderr, "%s:%d: %s: ", file, line,
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
- ISC_MSG_FATALERROR, "fatal error"));
+ fprintf(stderr, "%s:%d: fatal error: ", file, line);
vfprintf(stderr, format, args);
fprintf(stderr, "\n");
fflush(stderr);
diff --git a/lib/isc/include/isc/lib.h b/lib/isc/include/isc/lib.h
index 131e7fb..0b9ae32 100644
--- a/lib/isc/include/isc/lib.h
+++ b/lib/isc/include/isc/lib.h
@@ -25,15 +25,6 @@
ISC_LANG_BEGINDECLS
-LIBISC_EXTERNAL_DATA extern isc_msgcat_t *isc_msgcat;
-
-void
-isc_lib_initmsgcat(void);
-/*!<
- * \brief Initialize the ISC library's message catalog, isc_msgcat, if it
- * has not already been initialized.
- */
-
void
isc_lib_register(void);
/*!<
diff --git a/lib/isc/include/isc/log.h b/lib/isc/include/isc/log.h
index 11fcd96..1b8027c 100644
--- a/lib/isc/include/isc/log.h
+++ b/lib/isc/include/isc/log.h
@@ -638,10 +638,7 @@ ISC_FORMAT_PRINTF(5, 0);
*
* The only difference is that they take arguments for a message
* catalog, message set, and message number, all immediately preceding the
- * format argument. The format argument becomes the default text, a la
- * isc_msgcat_get. If the message catalog is NULL, no lookup is attempted
- * for a message -- which makes the message set and message number irrelevant,
- * and the non-internationalized call should have probably been used instead.
+ * format argument. The format argument becomes the default text.
*
* Yes, that means there are now *eight* interfaces to logging a message.
* Sheesh. Make the madness stop!
@@ -650,30 +647,30 @@ ISC_FORMAT_PRINTF(5, 0);
void
isc_log_iwrite(isc_log_t *lctx, isc_logcategory_t *category,
isc_logmodule_t *module, int level,
- isc_msgcat_t *msgcat, int msgset, int message,
+ int msgset, int message,
const char *format, ...)
-ISC_FORMAT_PRINTF(8, 9);
+ISC_FORMAT_PRINTF(7, 8);
void
isc_log_ivwrite(isc_log_t *lctx, isc_logcategory_t *category,
isc_logmodule_t *module, int level,
- isc_msgcat_t *msgcat, int msgset, int message,
+ int msgset, int message,
const char *format, va_list args)
-ISC_FORMAT_PRINTF(8, 0);
+ISC_FORMAT_PRINTF(7, 0);
void
isc_log_iwrite1(isc_log_t *lctx, isc_logcategory_t *category,
isc_logmodule_t *module, int level,
- isc_msgcat_t *msgcat, int msgset, int message,
+ int msgset, int message,
const char *format, ...)
-ISC_FORMAT_PRINTF(8, 9);
+ISC_FORMAT_PRINTF(7, 8);
void
isc_log_ivwrite1(isc_log_t *lctx, isc_logcategory_t *category,
isc_logmodule_t *module, int level,
- isc_msgcat_t *msgcat, int msgset, int message,
+ int msgset, int message,
const char *format, va_list args)
-ISC_FORMAT_PRINTF(8, 0);
+ISC_FORMAT_PRINTF(7, 0);
/*@}*/
void
diff --git a/lib/isc/include/isc/msgcat.h b/lib/isc/include/isc/msgcat.h
deleted file mode 100644
index 34c214d..0000000
--- a/lib/isc/include/isc/msgcat.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#ifndef GUARD_ISC_MSGCAT_H
-#define GUARD_ISC_MSGCAT_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file isc/msgcat.h
- * \brief The ISC Message Catalog
- * aids internationalization of applications by allowing
- * messages to be retrieved from locale-specific files instead of
- * hardwiring them into the application. This allows translations of
- * messages appropriate to the locale to be supplied without recompiling
- * the application.
- *
- * Notes:
- *\li It's very important that message catalogs work, even if only the
- * default_text can be used.
- *
- * MP:
- *\li The caller must ensure appropriate synchronization of
- * isc_msgcat_open() and isc_msgcat_close(). isc_msgcat_get()
- * ensures appropriate synchronization.
- *
- * Reliability:
- *\li No anticipated impact.
- *
- * Resources:
- *\li TBS
- *
- * \li Security:
- * No anticipated impact.
- *
- * \li Standards:
- * None.
- */
-
-/*****
- ***** Imports
- *****/
-
-#include <isc/lang.h>
-#include <isc/types.h>
-
-ISC_LANG_BEGINDECLS
-
-/*****
- ***** Methods
- *****/
-
-void
-isc_msgcat_open(const char *name, isc_msgcat_t **msgcatp);
-/*%<
- * Open a message catalog.
- *
- * Notes:
- *
- *\li If memory cannot be allocated or other failures occur, *msgcatp
- * will be set to NULL. If a NULL msgcat is given to isc_msgcat_get(),
- * the default_text will be returned, ensuring that some message text
- * will be available, no matter what's going wrong.
- *
- * Requires:
- *
- *\li 'name' is a valid string.
- *
- *\li msgcatp != NULL && *msgcatp == NULL
- */
-
-void
-isc_msgcat_close(isc_msgcat_t **msgcatp);
-/*%<
- * Close a message catalog.
- *
- * Notes:
- *
- *\li Any string pointers returned by prior calls to isc_msgcat_get() are
- * invalid after isc_msgcat_close() has been called and must not be
- * used.
- *
- * Requires:
- *
- *\li *msgcatp is a valid message catalog or is NULL.
- *
- * Ensures:
- *
- *\li All resources associated with the message catalog are released.
- *
- *\li *msgcatp == NULL
- */
-
-const char *
-isc_msgcat_get(isc_msgcat_t *msgcat, int set, int message,
- const char *default_text);
-/*%<
- * Get message 'message' from message set 'set' in 'msgcat'. If it
- * is not available, use 'default_text'.
- *
- * Requires:
- *
- *\li 'msgcat' is a valid message catalog or is NULL.
- *
- *\li set > 0
- *
- *\li message > 0
- *
- *\li 'default_text' is a valid string.
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* GUARD_ISC_MSGCAT_H */
diff --git a/lib/isc/include/isc/msgs.h b/lib/isc/include/isc/msgs.h
deleted file mode 100644
index 3410556..0000000
--- a/lib/isc/include/isc/msgs.h
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 2000-2003 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#ifndef GUARD_ISC_MSGS_H
-#define GUARD_ISC_MSGS_H 1
-
-/*! \file isc/msgs.h */
-
-#include <isc/lib.h> /* Provide isc_msgcat global variable. */
-#include <isc/msgcat.h> /* Provide isc_msgcat_*() functions. */
-
-/*@{*/
-/*!
- * \brief Message sets, named per source file, excepting "GENERAL".
- *
- * IMPORTANT: The original list is alphabetical, but any new sets must
- * be added to the end.
- */
-#define ISC_MSGSET_GENERAL 1
-/* ISC_RESULT_RESULTSET 2 */ /* XXX */
-/* ISC_RESULT_UNAVAILABLESET 3 */ /* XXX */
-#define ISC_MSGSET_APP 4
-#define ISC_MSGSET_COMMANDLINE 5
-#define ISC_MSGSET_ENTROPY 6
-#define ISC_MSGSET_IFITERIOCTL 7
-#define ISC_MSGSET_IFITERSYSCTL 8
-#define ISC_MSGSET_LEX 9
-#define ISC_MSGSET_LOG 10
-#define ISC_MSGSET_MEM 11
-#define ISC_MSGSET_NETADDR 12
-#define ISC_MSGSET_PRINT 13
-#define ISC_MSGSET_RESULT 14
-#define ISC_MSGSET_RWLOCK 15
-#define ISC_MSGSET_SOCKADDR 16
-#define ISC_MSGSET_SOCKET 17
-#define ISC_MSGSET_TASK 18
-#define ISC_MSGSET_TIMER 19
-#define ISC_MSGSET_UTIL 20
-#define ISC_MSGSET_IFITERGETIFADDRS 21
-/*@}*/
-
-/*@{*/
-/*!
- * Message numbers
- * are only required to be unique per message set,
- * but are unique throughout the entire catalog to not be as confusing when
- * debugging.
- *
- * The initial numbering was done by multiply by 100 the set number the
- * message appears in then adding the incremental message number.
- */
-#define ISC_MSG_FAILED 101 /*%< "failed" */
-#define ISC_MSG_SUCCEEDED 102 /*%< Compatible with "failed" */
-#define ISC_MSG_SUCCESS 103 /*%< More usual way to say "success" */
-#define ISC_MSG_STARTING 104 /*%< As in "daemon: starting" */
-#define ISC_MSG_STOPING 105 /*%< As in "daemon: stopping" */
-#define ISC_MSG_ENTERING 106 /*%< As in "some_subr: entering" */
-#define ISC_MSG_EXITING 107 /*%< As in "some_subr: exiting" */
-#define ISC_MSG_CALLING 108 /*%< As in "calling some_subr()" */
-#define ISC_MSG_RETURNED 109 /*%< As in "some_subr: returned <foo>" */
-#define ISC_MSG_FATALERROR 110 /*%< "fatal error" */
-#define ISC_MSG_SHUTTINGDOWN 111 /*%< "shutting down" */
-#define ISC_MSG_RUNNING 112 /*%< "running" */
-#define ISC_MSG_WAIT 113 /*%< "wait" */
-#define ISC_MSG_WAITUNTIL 114 /*%< "waituntil" */
-
-#define ISC_MSG_SIGNALSETUP 201 /*%< "handle_signal() %d setup: %s" */
-
-#define ISC_MSG_ILLEGALOPT 301 /*%< "illegal option" */
-#define ISC_MSG_OPTNEEDARG 302 /*%< "option requires an argument" */
-
-#define ISC_MSG_ENTROPYSTATS 401 /*%< "Entropy pool %p: refcnt %u ..." */
-
-#define ISC_MSG_MAKESCANSOCKET 501 /*%< "making interface scan socket: %s" */
-#define ISC_MSG_GETIFCONFIG 502 /*%< "get interface configuration: %s" */
-#define ISC_MSG_BUFFERMAX 503 /*%< "... maximum buffer size exceeded" */
-#define ISC_MSG_GETDESTADDR 504 /*%< "%s: getting destination address: %s" */
-#define ISC_MSG_GETNETMASK 505 /*%< "%s: getting netmask: %s" */
-#define ISC_MSG_GETBCSTADDR 506 /*%< "%s: getting broadcast address: %s" */
-
-#define ISC_MSG_GETIFLISTSIZE 601 /*%< "getting interface list size: ..." */
-#define ISC_MSG_GETIFLIST 602 /*%< "getting interface list: ..." */
-#define ISC_MSG_UNEXPECTEDTYPE 603 /*%< "... unexpected ... message type" */
-
-#define ISC_MSG_UNEXPECTEDSTATE 701 /*%< "Unexpected state %d" */
-
-#define ISC_MSG_BADTIME 801 /*%< "Bad 00 99:99:99.999 " */
-#define ISC_MSG_LEVEL 802 /*%< "level %d: " */
-
-#define ISC_MSG_ADDTRACE 901 /*%< "add %p size %u " */
-#define ISC_MSG_DELTRACE 902 /*%< "del %p size %u " */
-#define ISC_MSG_POOLSTATS 903 /*%< "[Pool statistics]\n" */
-#define ISC_MSG_POOLNAME 904 /*%< "name" */
-#define ISC_MSG_POOLSIZE 905 /*%< "size" */
-#define ISC_MSG_POOLMAXALLOC 906 /*%< "maxalloc" */
-#define ISC_MSG_POOLALLOCATED 907 /*%< "allocated" */
-#define ISC_MSG_POOLFREECOUNT 908 /*%< "freecount" */
-#define ISC_MSG_POOLFREEMAX 909 /*%< "freemax" */
-#define ISC_MSG_POOLFILLCOUNT 910 /*%< "fillcount" */
-#define ISC_MSG_POOLGETS 911 /*%< "gets" */
-#define ISC_MSG_DUMPALLOC 912 /*%< "DUMP OF ALL OUTSTANDING MEMORY ..." */
-#define ISC_MSG_NONE 913 /*%< "\tNone.\n" */
-#define ISC_MSG_PTRFILELINE 914 /*%< "\tptr %p file %s line %u\n" */
-
-#define ISC_MSG_UNKNOWNADDR 1001 /*%< "<unknown address, family %u>" */
-
-#define ISC_MSG_NOLONGDBL 1104 /*%< "long doubles are not supported" */
-
-#define ISC_MSG_PRINTLOCK 1201 /*%< "rwlock %p thread %lu ..." */
-#define ISC_MSG_READ 1202 /*%< "read" */
-#define ISC_MSG_WRITE 1203 /*%< "write" */
-#define ISC_MSG_READING 1204 /*%< "reading" */
-#define ISC_MSG_WRITING 1205 /*%< "writing" */
-#define ISC_MSG_PRELOCK 1206 /*%< "prelock" */
-#define ISC_MSG_POSTLOCK 1207 /*%< "postlock" */
-#define ISC_MSG_PREUNLOCK 1208 /*%< "preunlock" */
-#define ISC_MSG_POSTUNLOCK 1209 /*%< "postunlock" */
-
-#define ISC_MSG_UNKNOWNFAMILY 1301 /*%< "unknown address family: %d" */
-
-#define ISC_MSG_WRITEFAILED 1401 /*%< "write() failed during watcher ..." */
-#define ISC_MSG_READFAILED 1402 /*%< "read() failed during watcher ... " */
-#define ISC_MSG_PROCESSCMSG 1403 /*%< "processing cmsg %p" */
-#define ISC_MSG_IFRECEIVED 1404 /*%< "interface received on ifindex %u" */
-#define ISC_MSG_SENDTODATA 1405 /*%< "sendto pktinfo data, ifindex %u" */
-#define ISC_MSG_DOIORECV 1406 /*%< "doio_recv: recvmsg(%d) %d bytes ..." */
-#define ISC_MSG_PKTRECV 1407 /*%< "packet received correctly" */
-#define ISC_MSG_DESTROYING 1408 /*%< "destroying" */
-#define ISC_MSG_CREATED 1409 /*%< "created" */
-#define ISC_MSG_ACCEPTLOCK 1410 /*%< "internal_accept called, locked ..." */
-#define ISC_MSG_ACCEPTEDCXN 1411 /*%< "accepted connection, new socket %p" */
-#define ISC_MSG_INTERNALRECV 1412 /*%< "internal_recv: task %p got event %p" */
-#define ISC_MSG_INTERNALSEND 1413 /*%< "internal_send: task %p got event %p" */
-#define ISC_MSG_WATCHERMSG 1414 /*%< "watcher got message %d" */
-#define ISC_MSG_SOCKETSREMAIN 1415 /*%< "sockets exist" */
-#define ISC_MSG_PKTINFOPROVIDED 1416 /*%< "pktinfo structure provided, ..." */
-#define ISC_MSG_BOUND 1417 /*%< "bound" */
-#define ISC_MSG_ACCEPTRETURNED 1418 /*%< accept() returned %d/%s */
-#define ISC_MSG_TOOMANYFDS 1419 /*%< %s: too many open file descriptors */
-#define ISC_MSG_ZEROPORT 1420 /*%< dropping source port zero packet */
-#define ISC_MSG_FILTER 1421 /*%< setsockopt(SO_ACCEPTFILTER): %s */
-
-#define ISC_MSG_TOOMANYHANDLES 1422 /*%< %s: too many open WSA event handles: %s */
-#define ISC_MSG_POKED 1423 /*%< "poked flags: %d" */
-
-#define ISC_MSG_AWAKE 1502 /*%< "awake" */
-#define ISC_MSG_WORKING 1503 /*%< "working" */
-#define ISC_MSG_EXECUTE 1504 /*%< "execute action" */
-#define ISC_MSG_EMPTY 1505 /*%< "empty" */
-#define ISC_MSG_DONE 1506 /*%< "done" */
-#define ISC_MSG_QUANTUM 1507 /*%< "quantum" */
-
-#define ISC_MSG_SCHEDULE 1601 /*%< "schedule" */
-#define ISC_MSG_SIGNALSCHED 1602 /*%< "signal (schedule)" */
-#define ISC_MSG_SIGNALDESCHED 1603 /*%< "signal (deschedule)" */
-#define ISC_MSG_SIGNALDESTROY 1604 /*%< "signal (destroy)" */
-#define ISC_MSG_IDLERESCHED 1605 /*%< "idle reschedule" */
-#define ISC_MSG_EVENTNOTALLOC 1606 /*%< "couldn't allocate event" */
-#define ISC_MSG_SCHEDFAIL 1607 /*%< "couldn't schedule timer: %u" */
-#define ISC_MSG_POSTING 1608 /*%< "posting" */
-#define ISC_MSG_WAKEUP 1609 /*%< "wakeup" */
-
-#define ISC_MSG_LOCK 1701 /*%< "LOCK" */
-#define ISC_MSG_LOCKING 1702 /*%< "LOCKING" */
-#define ISC_MSG_LOCKED 1703 /*%< "LOCKED" */
-#define ISC_MSG_UNLOCKED 1704 /*%< "UNLOCKED" */
-#define ISC_MSG_RWLOCK 1705 /*%< "RWLOCK" */
-#define ISC_MSG_RWLOCKED 1706 /*%< "RWLOCKED" */
-#define ISC_MSG_RWUNLOCK 1707 /*%< "RWUNLOCK" */
-#define ISC_MSG_BROADCAST 1708 /*%< "BROADCAST" */
-#define ISC_MSG_SIGNAL 1709 /*%< "SIGNAL" */
-#define ISC_MSG_UTILWAIT 1710 /*%< "WAIT" */
-#define ISC_MSG_WAITED 1711 /*%< "WAITED" */
-
-#define ISC_MSG_GETIFADDRS 1801 /*%< "getting interface addresses: ..." */
-
-/*@}*/
-
-#endif /* GUARD_ISC_MSGS_H */
diff --git a/lib/isc/include/isc/result.h b/lib/isc/include/isc/result.h
index f2d70f1..34a1bb0 100644
--- a/lib/isc/include/isc/result.h
+++ b/lib/isc/include/isc/result.h
@@ -100,7 +100,7 @@ isc_result_totext(isc_result_t);
isc_result_t
isc_result_register(unsigned int base, unsigned int nresults,
- const char **text, isc_msgcat_t *msgcat, int set);
+ const char **text, int set);
ISC_LANG_ENDDECLS
diff --git a/lib/isc/include/isc/util.h b/lib/isc/include/isc/util.h
index 1db2712..5db90e2 100644
--- a/lib/isc/include/isc/util.h
+++ b/lib/isc/include/isc/util.h
@@ -85,7 +85,6 @@
#ifdef ISC_UTIL_TRACEON
#define ISC_UTIL_TRACE(a) a
#include <stdio.h> /* Required for fprintf/stderr when tracing. */
-#include <isc/msgs.h> /* Required for isc_msgcat when tracing. */
#else
#define ISC_UTIL_TRACE(a)
#endif
@@ -93,21 +92,15 @@
#include <isc/result.h> /* Contractual promise. */
#define LOCK(lp) do { \
- ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %d\n", \
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
- ISC_MSG_LOCKING, "LOCKING"), \
+ ISC_UTIL_TRACE(fprintf(stderr, "LOCKING %p %s %d\n", \
(lp), __FILE__, __LINE__)); \
RUNTIME_CHECK(pthread_mutex_lock((lp)) == 0); \
- ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %d\n", \
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
- ISC_MSG_LOCKED, "LOCKED"), \
+ ISC_UTIL_TRACE(fprintf(stderr, "LOCKED %p %s %d\n", \
(lp), __FILE__, __LINE__)); \
} while (0)
#define UNLOCK(lp) do { \
RUNTIME_CHECK(pthread_mutex_unlock((lp)) == 0); \
- ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %d\n", \
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
- ISC_MSG_UNLOCKED, "UNLOCKED"), \
+ ISC_UTIL_TRACE(fprintf(stderr, "UNLOCKED %p %s %d\n", \
(lp), __FILE__, __LINE__)); \
} while (0)
#define ISLOCKED(lp) (1)
@@ -116,35 +109,21 @@
#define BROADCAST(cvp) do { \
- ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %d\n", \
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
- ISC_MSG_BROADCAST, "BROADCAST"),\
+ ISC_UTIL_TRACE(fprintf(stderr, "BOADCAST %p %s %d\n", \
(cvp), __FILE__, __LINE__)); \
RUNTIME_CHECK(isc_condition_broadcast((cvp)) == ISC_R_SUCCESS); \
} while (0)
#define SIGNAL(cvp) do { \
- ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %d\n", \
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
- ISC_MSG_SIGNAL, "SIGNAL"), \
+ ISC_UTIL_TRACE(fprintf(stderr, "SIGNAL %p %s %d\n", \
(cvp), __FILE__, __LINE__)); \
RUNTIME_CHECK(isc_condition_signal((cvp)) == ISC_R_SUCCESS); \
} while (0)
#define WAIT(cvp, lp) do { \
- ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %p %s %d\n", \
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
- ISC_MSG_UTILWAIT, "WAIT"), \
- (cvp), \
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
- ISC_MSG_LOCK, "LOCK"), \
- (lp), __FILE__, __LINE__)); \
+ ISC_UTIL_TRACE(fprintf(stderr, "WAIT %p LOCK %p %s %d\n", \
+ (cvp), (lp), __FILE__, __LINE__)); \
RUNTIME_CHECK(isc_condition_wait((cvp), (lp)) == ISC_R_SUCCESS); \
- ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %p %s %d\n", \
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
- ISC_MSG_WAITED, "WAITED"), \
- (cvp), \
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
- ISC_MSG_LOCKED, "LOCKED"), \
- (lp), __FILE__, __LINE__)); \
+ ISC_UTIL_TRACE(fprintf(stderr, "WAITED %p LOCKED %p %s %d\n", \
+ (cvp), (lp), __FILE__, __LINE__)); \
} while (0)
/*
@@ -158,20 +137,14 @@
isc_condition_waituntil((cvp), (lp), (tp))
#define RWLOCK(lp, t) do { \
- ISC_UTIL_TRACE(fprintf(stderr, "%s %p, %d %s %d\n", \
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
- ISC_MSG_RWLOCK, "RWLOCK"), \
+ ISC_UTIL_TRACE(fprintf(stderr, "RWLOCK %p, %d %s %d\n", \
(lp), (t), __FILE__, __LINE__)); \
RUNTIME_CHECK(isc_rwlock_lock((lp), (t)) == ISC_R_SUCCESS); \
- ISC_UTIL_TRACE(fprintf(stderr, "%s %p, %d %s %d\n", \
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
- ISC_MSG_RWLOCKED, "RWLOCKED"), \
+ ISC_UTIL_TRACE(fprintf(stderr, "RWLOCKED %p, %d %s %d\n", \
(lp), (t), __FILE__, __LINE__)); \
} while (0)
#define RWUNLOCK(lp, t) do { \
- ISC_UTIL_TRACE(fprintf(stderr, "%s %p, %d %s %d\n", \
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
- ISC_MSG_RWUNLOCK, "RWUNLOCK"), \
+ ISC_UTIL_TRACE(fprintf(stderr, "RWUNLOCK %p, %d %s %d\n", \
(lp), (t), __FILE__, __LINE__)); \
RUNTIME_CHECK(isc_rwlock_unlock((lp), (t)) == ISC_R_SUCCESS); \
} while (0)
diff --git a/lib/isc/lib.c b/lib/isc/lib.c
deleted file mode 100644
index b9e2805..0000000
--- a/lib/isc/lib.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: lib.c,v 1.16 2009/09/02 23:48:02 tbox Exp $ */
-
-/*! \file */
-
-#include <config.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <isc/lib.h>
-#include <isc/mem.h>
-#include <isc/msgs.h>
-#include <isc/once.h>
-#include <isc/util.h>
-
-/***
- *** Globals
- ***/
-
-LIBISC_EXTERNAL_DATA isc_msgcat_t * isc_msgcat = NULL;
-
-
-/***
- *** Private
- ***/
-
-static isc_once_t msgcat_once = ISC_ONCE_INIT;
-
-/***
- *** Functions
- ***/
-
-static void
-open_msgcat(void) {
- isc_msgcat_open("libisc.cat", &isc_msgcat);
-}
-
-void
-isc_lib_initmsgcat(void) {
- isc_result_t result;
-
- /*!
- * Initialize the ISC library's message catalog, isc_msgcat, if it
- * has not already been initialized.
- */
-
- result = isc_once_do(&msgcat_once, open_msgcat);
- if (result != ISC_R_SUCCESS) {
- /*
- * Normally we'd use RUNTIME_CHECK() or FATAL_ERROR(), but
- * we can't do that here, since they might call us!
- * (Note that the catalog might be open anyway, so we might
- * as well try to provide an internationalized message.)
- */
- fprintf(stderr, "%s:%d: %s: isc_once_do() %s.\n",
- __FILE__, __LINE__,
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
- ISC_MSG_FATALERROR, "fatal error"),
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
- ISC_MSG_FAILED, "failed"));
- abort();
- }
-}
diff --git a/lib/isc/log.c b/lib/isc/log.c
index 8162f9f..e1bf93c 100644
--- a/lib/isc/log.c
+++ b/lib/isc/log.c
@@ -36,7 +36,6 @@
#include <isc/log.h>
#include <isc/magic.h>
#include <isc/mem.h>
-#include <isc/msgs.h>
#include <isc/time.h>
#include <isc/util.h>
@@ -243,9 +242,9 @@ roll_log(isc_logchannel_t *channel);
static void
isc_log_doit(isc_log_t *lctx, isc_logcategory_t *category,
isc_logmodule_t *module, int level, bool write_once,
- isc_msgcat_t *msgcat, int msgset, int msg,
+ int msgset, int msg,
const char *format, va_list args)
- ISC_FORMAT_PRINTF(9, 0);
+ ISC_FORMAT_PRINTF(8, 0);
/*@{*/
/*!
@@ -842,7 +841,7 @@ isc_log_write(isc_log_t *lctx, isc_logcategory_t *category,
va_start(args, format);
isc_log_doit(lctx, category, module, level, false,
- NULL, 0, 0, format, args);
+ 0, 0, format, args);
va_end(args);
}
@@ -855,7 +854,7 @@ isc_log_vwrite(isc_log_t *lctx, isc_logcategory_t *category,
* Contract checking is done in isc_log_doit().
*/
isc_log_doit(lctx, category, module, level, false,
- NULL, 0, 0, format, args);
+ 0, 0, format, args);
}
void
@@ -870,7 +869,7 @@ isc_log_write1(isc_log_t *lctx, isc_logcategory_t *category,
va_start(args, format);
isc_log_doit(lctx, category, module, level, true,
- NULL, 0, 0, format, args);
+ 0, 0, format, args);
va_end(args);
}
@@ -883,13 +882,13 @@ isc_log_vwrite1(isc_log_t *lctx, isc_logcategory_t *category,
* Contract checking is done in isc_log_doit().
*/
isc_log_doit(lctx, category, module, level, true,
- NULL, 0, 0, format, args);
+ 0, 0, format, args);
}
void
isc_log_iwrite(isc_log_t *lctx, isc_logcategory_t *category,
isc_logmodule_t *module, int level,
- isc_msgcat_t *msgcat, int msgset, int msg,
+ int msgset, int msg,
const char *format, ...)
{
va_list args;
@@ -900,27 +899,27 @@ isc_log_iwrite(isc_log_t *lctx, isc_logcategory_t *category,
va_start(args, format);
isc_log_doit(lctx, category, module, level, false,
- msgcat, msgset, msg, format, args);
+ msgset, msg, format, args);
va_end(args);
}
void
isc_log_ivwrite(isc_log_t *lctx, isc_logcategory_t *category,
isc_logmodule_t *module, int level,
- isc_msgcat_t *msgcat, int msgset, int msg,
+ int msgset, int msg,
const char *format, va_list args)
{
/*
* Contract checking is done in isc_log_doit().
*/
isc_log_doit(lctx, category, module, level, false,
- msgcat, msgset, msg, format, args);
+ msgset, msg, format, args);
}
void
isc_log_iwrite1(isc_log_t *lctx, isc_logcategory_t *category,
isc_logmodule_t *module, int level,
- isc_msgcat_t *msgcat, int msgset, int msg,
+ int msgset, int msg,
const char *format, ...)
{
va_list args;
@@ -931,21 +930,21 @@ isc_log_iwrite1(isc_log_t *lctx, isc_logcategory_t *category,
va_start(args, format);
isc_log_doit(lctx, category, module, level, true,
- msgcat, msgset, msg, format, args);
+ msgset, msg, format, args);
va_end(args);
}
void
isc_log_ivwrite1(isc_log_t *lctx, isc_logcategory_t *category,
isc_logmodule_t *module, int level,
- isc_msgcat_t *msgcat, int msgset, int msg,
+ int msgset, int msg,
const char *format, va_list args)
{
/*
* Contract checking is done in isc_log_doit().
*/
isc_log_doit(lctx, category, module, level, true,
- msgcat, msgset, msg, format, args);
+ msgset, msg, format, args);
}
void
@@ -1409,7 +1408,7 @@ isc_log_wouldlog(isc_log_t *lctx, int level) {
static void
isc_log_doit(isc_log_t *lctx, isc_logcategory_t *category,
isc_logmodule_t *module, int level, bool write_once,
- isc_msgcat_t *msgcat, int msgset, int msg,
+ int msgset, int msg,
const char *format, va_list args)
{
int syslog_level;
@@ -1446,10 +1445,7 @@ isc_log_doit(isc_log_t *lctx, isc_logcategory_t *category,
if (! isc_log_wouldlog(lctx, level))
return;
- if (msgcat != NULL)
- iformat = isc_msgcat_get(msgcat, msgset, msg, format);
- else
- iformat = format;
+ iformat = format;
time_string[0] = '\0';
level_string[0] = '\0';
@@ -1526,12 +1522,7 @@ isc_log_doit(isc_log_t *lctx, isc_logcategory_t *category,
level_string[0] == '\0') {
if (level < ISC_LOG_CRITICAL)
snprintf(level_string, sizeof(level_string),
- "%s %d: ",
- isc_msgcat_get(isc_msgcat,
- ISC_MSGSET_LOG,
- ISC_MSG_LEVEL,
- "level"),
- level);
+ "level %d: ", level);
else if (level > ISC_LOG_DYNAMIC)
snprintf(level_string, sizeof(level_string),
"%s %d: ", log_level_strings[0],
diff --git a/lib/isc/netaddr.c b/lib/isc/netaddr.c
index d491e75..e37684d 100644
--- a/lib/isc/netaddr.c
+++ b/lib/isc/netaddr.c
@@ -21,7 +21,6 @@
#include <stdio.h>
-#include <isc/msgs.h>
#include <isc/net.h>
#include <isc/netaddr.h>
#include <isc/sockaddr.h>
diff --git a/lib/isc/nls/msgcat.c b/lib/isc/nls/msgcat.c
deleted file mode 100644
index 3d6b676..0000000
--- a/lib/isc/nls/msgcat.c
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: msgcat.c,v 1.18 2007/06/19 23:47:18 tbox Exp $ */
-
-/*! \file msgcat.c
- *
- * \author Principal Author: Bob Halley
- */
-
-#include <config.h>
-
-#include <stddef.h>
-#include <stdlib.h>
-
-#include <isc/magic.h>
-#include <isc/msgcat.h>
-#include <isc/util.h>
-
-#ifdef HAVE_CATGETS
-#include <nl_types.h> /* Required for nl_catd. */
-#endif
-
-/*
- * Implementation Notes:
- *
- * We use malloc() and free() instead of isc_mem_get() and isc_mem_put()
- * because we don't want to require a memory context to be specified
- * in order to use a message catalog.
- */
-
-struct isc_msgcat {
- unsigned int magic;
-#ifdef HAVE_CATGETS
- nl_catd catalog;
-#endif
-};
-
-#define MSGCAT_MAGIC ISC_MAGIC('M', 'C', 'a', 't')
-#define VALID_MSGCAT(m) ISC_MAGIC_VALID(m, MSGCAT_MAGIC)
-
-void
-isc_msgcat_open(const char *name, isc_msgcat_t **msgcatp) {
- isc_msgcat_t *msgcat;
-
- /*
- * Open a message catalog.
- */
-
- REQUIRE(name != NULL);
- REQUIRE(msgcatp != NULL && *msgcatp == NULL);
-
- msgcat = malloc(sizeof(*msgcat));
- if (msgcat == NULL) {
- *msgcatp = NULL;
- return;
- }
-
-#ifdef HAVE_CATGETS
- /*
- * We don't check if catopen() fails because we don't care.
- * If it does fail, then when we call catgets(), it will use
- * the default string.
- */
- msgcat->catalog = catopen(name, 0);
-#endif
- msgcat->magic = MSGCAT_MAGIC;
-
- *msgcatp = msgcat;
-}
-
-void
-isc_msgcat_close(isc_msgcat_t **msgcatp) {
- isc_msgcat_t *msgcat;
-
- /*
- * Close a message catalog.
- */
-
- REQUIRE(msgcatp != NULL);
- msgcat = *msgcatp;
- REQUIRE(VALID_MSGCAT(msgcat) || msgcat == NULL);
-
- if (msgcat != NULL) {
-#ifdef HAVE_CATGETS
- if (msgcat->catalog != (nl_catd)(-1))
- (void)catclose(msgcat->catalog);
-#endif
- msgcat->magic = 0;
- free(msgcat);
- }
-
- *msgcatp = NULL;
-}
-
-const char *
-isc_msgcat_get(isc_msgcat_t *msgcat, int set, int message,
- const char *default_text)
-{
- /*
- * Get message 'message' from message set 'set' in 'msgcat'. If it
- * is not available, use 'default'.
- */
-
- REQUIRE(VALID_MSGCAT(msgcat) || msgcat == NULL);
- REQUIRE(set > 0);
- REQUIRE(message > 0);
- REQUIRE(default_text != NULL);
-
-#ifdef HAVE_CATGETS
- if (msgcat == NULL)
- return (default_text);
- return (catgets(msgcat->catalog, set, message, default_text));
-#else
- return (default_text);
-#endif
-}
diff --git a/lib/isc/result.c b/lib/isc/result.c
index e936f9b..8ca18f9 100644
--- a/lib/isc/result.c
+++ b/lib/isc/result.c
@@ -23,7 +23,6 @@
#include <stdlib.h>
#include <isc/lib.h>
-#include <isc/msgs.h>
#include <isc/once.h>
#include <isc/resultclass.h>
#include <isc/util.h>
@@ -32,7 +31,6 @@ typedef struct resulttable {
unsigned int base;
unsigned int last;
const char ** text;
- isc_msgcat_t * msgcat;
int set;
ISC_LINK(struct resulttable) link;
} resulttable;
@@ -111,7 +109,7 @@ static pthread_mutex_t lock;
static isc_result_t
register_table(unsigned int base, unsigned int nresults, const char **txt,
- isc_msgcat_t *msgcat, int set)
+ int set)
{
resulttable *table;
@@ -129,7 +127,6 @@ register_table(unsigned int base, unsigned int nresults, const char **txt,
table->base = base;
table->last = base + nresults - 1;
table->text = txt;
- table->msgcat = msgcat;
table->set = set;
ISC_LINK_INIT(table, link);
@@ -150,25 +147,21 @@ initialize_action(void) {
ISC_LIST_INIT(tables);
result = register_table(ISC_RESULTCLASS_ISC, ISC_R_NRESULTS, text,
- isc_msgcat, ISC_RESULT_RESULTSET);
+ ISC_RESULT_RESULTSET);
if (result != ISC_R_SUCCESS)
UNEXPECTED_ERROR(__FILE__, __LINE__,
- "register_table() %s: %u",
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
- ISC_MSG_FAILED, "failed"),
- result);
+ "register_table() failed: %u", result);
}
static void
initialize(void) {
- isc_lib_initmsgcat();
RUNTIME_CHECK(isc_once_do(&once, initialize_action) == ISC_R_SUCCESS);
}
const char *
isc_result_totext(isc_result_t result) {
resulttable *table;
- const char *txt, *default_text;
+ const char *txt;
int idx;
initialize();
@@ -181,20 +174,12 @@ isc_result_totext(isc_result_t result) {
table = ISC_LIST_NEXT(table, link)) {
if (result >= table->base && result <= table->last) {
idx = (int)(result - table->base);
- default_text = table->text[idx];
- /*
- * Note: we use 'idx + 1' as the message number
- * instead of idx because isc_msgcat_get() requires
- * the message number to be > 0.
- */
- txt = isc_msgcat_get(table->msgcat, table->set,
- idx + 1, default_text);
+ txt = table->text[idx];
break;
}
}
if (txt == NULL)
- txt = isc_msgcat_get(isc_msgcat, ISC_RESULT_UNAVAILABLESET,
- 1, "(result code text not available)");
+ txt = "(result code text not available)";
UNLOCK(&lock);
@@ -203,9 +188,9 @@ isc_result_totext(isc_result_t result) {
isc_result_t
isc_result_register(unsigned int base, unsigned int nresults,
- const char **txt, isc_msgcat_t *msgcat, int set)
+ const char **txt, int set)
{
initialize();
- return (register_table(base, nresults, txt, msgcat, set));
+ return (register_table(base, nresults, txt, set));
}
diff --git a/lib/isc/sockaddr.c b/lib/isc/sockaddr.c
index d80f801..f8a76ab 100644
--- a/lib/isc/sockaddr.c
+++ b/lib/isc/sockaddr.c
@@ -25,7 +25,6 @@
#include <string.h>
#include <isc/hash.h>
-#include <isc/msgs.h>
#include <isc/netaddr.h>
#include <isc/sockaddr.h>
#include <isc/util.h>
@@ -127,12 +126,8 @@ isc_sockaddr_hash(const isc_sockaddr_t *sockaddr, bool address_only) {
break;
default:
UNEXPECTED_ERROR(__FILE__, __LINE__,
- "%s: %d",
- isc_msgcat_get(isc_msgcat,
- ISC_MSGSET_SOCKADDR,
- ISC_MSG_UNKNOWNFAMILY,
- "unknown address family"),
- (int)sockaddr->type.sa.sa_family);
+ "unknown address family: %d",
+ (int)sockaddr->type.sa.sa_family);
s = (const unsigned char *)&sockaddr->type;
length = sockaddr->length;
p = 0;
@@ -257,9 +252,7 @@ isc_sockaddr_pf(const isc_sockaddr_t *sockaddr) {
return (PF_INET6);
default:
FATAL_ERROR(__FILE__, __LINE__,
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKADDR,
- ISC_MSG_UNKNOWNFAMILY,
- "unknown address family: %d"),
+ "unknown address family: %d",
(int)sockaddr->type.sa.sa_family);
}
#endif
@@ -308,10 +301,7 @@ isc_sockaddr_setport(isc_sockaddr_t *sockaddr, in_port_t port) {
break;
default:
FATAL_ERROR(__FILE__, __LINE__,
- "%s: %d",
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKADDR,
- ISC_MSG_UNKNOWNFAMILY,
- "unknown address family"),
+ "unknown address family: %d",
(int)sockaddr->type.sa.sa_family);
}
}
@@ -329,10 +319,7 @@ isc_sockaddr_getport(const isc_sockaddr_t *sockaddr) {
break;
default:
FATAL_ERROR(__FILE__, __LINE__,
- "%s: %d",
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKADDR,
- ISC_MSG_UNKNOWNFAMILY,
- "unknown address family"),
+ "unknown address family: %d",
(int)sockaddr->type.sa.sa_family);
}
diff --git a/lib/isc/unix/ifiter_getifaddrs.c b/lib/isc/unix/ifiter_getifaddrs.c
index 5e93a3b..3548db5 100644
--- a/lib/isc/unix/ifiter_getifaddrs.c
+++ b/lib/isc/unix/ifiter_getifaddrs.c
@@ -99,11 +99,7 @@ isc_interfaceiter_create(isc_mem_t *mctx, isc_interfaceiter_t **iterp) {
if (ret < 0) {
ISC_IGNORE(strerror_r(errno, strbuf, sizeof(strbuf)));
UNEXPECTED_ERROR(__FILE__, __LINE__,
- "getting interface addresses: %s: %s",
- isc_msgcat_get(isc_msgcat,
- ISC_MSGSET_IFITERGETIFADDRS,
- ISC_MSG_GETIFADDRS,
- "getifaddrs"),
+ "getting interface addresses: getifaddrs: %s",
strbuf);
result = ISC_R_UNEXPECTED;
goto failure;
diff --git a/lib/isc/unix/ifiter_ioctl.c b/lib/isc/unix/ifiter_ioctl.c
index abfb2e8..83b0f65 100644
--- a/lib/isc/unix/ifiter_ioctl.c
+++ b/lib/isc/unix/ifiter_ioctl.c
@@ -139,11 +139,8 @@ getbuf4(isc_interfaceiter_t *iter) {
if (errno != EINVAL) {
strerror_r(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
- isc_msgcat_get(isc_msgcat,
- ISC_MSGSET_IFITERIOCTL,
- ISC_MSG_GETIFCONFIG,
"get interface "
- "configuration: %s"),
+ "configuration: %s",
strbuf);
goto unexpected;
}
@@ -166,13 +163,8 @@ getbuf4(isc_interfaceiter_t *iter) {
}
if (iter->bufsize >= IFCONF_BUFSIZE_MAX) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
- isc_msgcat_get(isc_msgcat,
- ISC_MSGSET_IFITERIOCTL,
- ISC_MSG_BUFFERMAX,
- "get interface "
- "configuration: "
- "maximum buffer "
- "size exceeded"));
+ "get interface configuration: "
+ "maximum buffer size exceeded");
goto unexpected;
}
isc_mem_put(iter->mctx, iter->buf, iter->bufsize);
@@ -226,11 +218,8 @@ getbuf6(isc_interfaceiter_t *iter) {
isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
ISC_LOGMODULE_INTERFACE,
ISC_LOG_DEBUG(1),
- isc_msgcat_get(isc_msgcat,
- ISC_MSGSET_IFITERIOCTL,
- ISC_MSG_GETIFCONFIG,
"get interface "
- "configuration: %s"),
+ "configuration: %s",
strbuf);
result = ISC_R_FAILURE;
goto cleanup;
@@ -239,11 +228,8 @@ getbuf6(isc_interfaceiter_t *iter) {
if (errno != EINVAL) {
strerror_r(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
- isc_msgcat_get(isc_msgcat,
- ISC_MSGSET_IFITERIOCTL,
- ISC_MSG_GETIFCONFIG,
"get interface "
- "configuration: %s"),
+ "configuration: %s",
strbuf);
result = ISC_R_UNEXPECTED;
goto cleanup;
@@ -267,13 +253,8 @@ getbuf6(isc_interfaceiter_t *iter) {
}
if (iter->bufsize6 >= IFCONF_BUFSIZE_MAX) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
- isc_msgcat_get(isc_msgcat,
- ISC_MSGSET_IFITERIOCTL,
- ISC_MSG_BUFFERMAX,
- "get interface "
- "configuration: "
- "maximum buffer "
- "size exceeded"));
+ "get interface configuration: "
+ "maximum buffer size exceeded");
result = ISC_R_UNEXPECTED;
goto cleanup;
}
@@ -335,11 +316,7 @@ isc_interfaceiter_create(isc_mem_t *mctx, isc_interfaceiter_t **iterp) {
if ((iter->socket6 = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) {
strerror_r(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
- isc_msgcat_get(isc_msgcat,
- ISC_MSGSET_IFITERIOCTL,
- ISC_MSG_MAKESCANSOCKET,
- "making interface "
- "scan socket: %s"),
+ "making interface scan socket: %s",
strbuf);
result = ISC_R_UNEXPECTED;
goto socket6_failure;
@@ -352,11 +329,7 @@ isc_interfaceiter_create(isc_mem_t *mctx, isc_interfaceiter_t **iterp) {
if ((iter->socket = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
strerror_r(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
- isc_msgcat_get(isc_msgcat,
- ISC_MSGSET_IFITERIOCTL,
- ISC_MSG_MAKESCANSOCKET,
- "making interface "
- "scan socket: %s"),
+ "making interface scan socket: %s",
strbuf);
result = ISC_R_UNEXPECTED;
goto socket_failure;
@@ -530,11 +503,7 @@ internal_current4(isc_interfaceiter_t *iter) {
isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
ISC_LOGMODULE_INTERFACE,
ISC_LOG_INFO,
- isc_msgcat_get(isc_msgcat,
- ISC_MSGSET_IFITERIOCTL,
- ISC_MSG_GETIFCONFIG,
- "prefix length for %s is unknown "
- "(assume 128)"), sabuf);
+ "prefix length for %s is unknown (assume 128)", sabuf);
prefixlen = 128;
#endif
@@ -574,11 +543,7 @@ internal_current4(isc_interfaceiter_t *iter) {
< 0) {
strerror_r(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
- isc_msgcat_get(isc_msgcat,
- ISC_MSGSET_IFITERIOCTL,
- ISC_MSG_GETDESTADDR,
- "%s: getting "
- "destination address: %s"),
+ "%s: getting destination address: %s",
ifreq.ifr_name, strbuf);
return (ISC_R_IGNORE);
}
@@ -597,11 +562,7 @@ internal_current4(isc_interfaceiter_t *iter) {
< 0) {
strerror_r(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
- isc_msgcat_get(isc_msgcat,
- ISC_MSGSET_IFITERIOCTL,
- ISC_MSG_GETBCSTADDR,
- "%s: getting "
- "broadcast address: %s"),
+ "%s: getting broadcast address: %s",
ifreq.ifr_name, strbuf);
return (ISC_R_IGNORE);
}
@@ -622,11 +583,8 @@ internal_current4(isc_interfaceiter_t *iter) {
if (isc_ioctl(iter->socket, SIOCGIFNETMASK, (char *)&ifreq) < 0) {
strerror_r(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
- isc_msgcat_get(isc_msgcat,
- ISC_MSGSET_IFITERIOCTL,
- ISC_MSG_GETNETMASK,
- "%s: getting netmask: %s"),
- ifreq.ifr_name, strbuf);
+ "%s: getting netmask: %s",
+ ifreq.ifr_name, strbuf);
return (ISC_R_IGNORE);
}
get_addr(family, &iter->current.netmask,
@@ -752,11 +710,7 @@ internal_current6(isc_interfaceiter_t *iter) {
< 0) {
strerror_r(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
- isc_msgcat_get(isc_msgcat,
- ISC_MSGSET_IFITERIOCTL,
- ISC_MSG_GETDESTADDR,
- "%s: getting "
- "destination address: %s"),
+ "%s: getting destination address: %s",
lifreq.lifr_name, strbuf);
return (ISC_R_IGNORE);
}
@@ -777,11 +731,7 @@ internal_current6(isc_interfaceiter_t *iter) {
< 0) {
strerror_r(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
- isc_msgcat_get(isc_msgcat,
- ISC_MSGSET_IFITERIOCTL,
- ISC_MSG_GETBCSTADDR,
- "%s: getting "
- "broadcast address: %s"),
+ "%s: getting broadcast address: %s",
lifreq.lifr_name, strbuf);
return (ISC_R_IGNORE);
}
@@ -828,10 +778,7 @@ internal_current6(isc_interfaceiter_t *iter) {
if (isc_ioctl(fd, SIOCGLIFNETMASK, (char *)&lifreq) < 0) {
strerror_r(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
- isc_msgcat_get(isc_msgcat,
- ISC_MSGSET_IFITERIOCTL,
- ISC_MSG_GETNETMASK,
- "%s: getting netmask: %s"),
+ "%s: getting netmask: %s",
lifreq.lifr_name, strbuf);
return (ISC_R_IGNORE);
}
diff --git a/lib/isc/unix/ifiter_sysctl.c b/lib/isc/unix/ifiter_sysctl.c
index 3a2b55a..7a7db55 100644
--- a/lib/isc/unix/ifiter_sysctl.c
+++ b/lib/isc/unix/ifiter_sysctl.c
@@ -90,11 +90,7 @@ isc_interfaceiter_create(isc_mem_t *mctx, isc_interfaceiter_t **iterp) {
if (sysctl(mib, 6, NULL, &bufsize, NULL, (size_t) 0) < 0) {
strerror_r(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
- isc_msgcat_get(isc_msgcat,
- ISC_MSGSET_IFITERSYSCTL,
- ISC_MSG_GETIFLISTSIZE,
- "getting interface "
- "list size: sysctl: %s"),
+ "getting interface list size: sysctl: %s",
strbuf);
result = ISC_R_UNEXPECTED;
goto failure;
@@ -111,11 +107,7 @@ isc_interfaceiter_create(isc_mem_t *mctx, isc_interfaceiter_t **iterp) {
if (sysctl(mib, 6, iter->buf, &bufused, NULL, (size_t) 0) < 0) {
strerror_r(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
- isc_msgcat_get(isc_msgcat,
- ISC_MSGSET_IFITERSYSCTL,
- ISC_MSG_GETIFLIST,
- "getting interface list: "
- "sysctl: %s"),
+ "getting interface list: sysctl: %s",
strbuf);
result = ISC_R_UNEXPECTED;
goto failure;
@@ -276,11 +268,7 @@ internal_current(isc_interfaceiter_t *iter) {
return (ISC_R_SUCCESS);
} else {
- printf("%s", isc_msgcat_get(isc_msgcat,
- ISC_MSGSET_IFITERSYSCTL,
- ISC_MSG_UNEXPECTEDTYPE,
- "warning: unexpected interface "
- "list message type\n"));
+ printf("warning: unexpected interface list message type\n"));
return (ISC_R_IGNORE);
}
}
diff --git a/lib/isc/unix/interfaceiter.c b/lib/isc/unix/interfaceiter.c
index 584003d..6e9c45b 100644
--- a/lib/isc/unix/interfaceiter.c
+++ b/lib/isc/unix/interfaceiter.c
@@ -36,7 +36,6 @@
#include <isc/log.h>
#include <isc/magic.h>
#include <isc/mem.h>
-#include <isc/msgs.h>
#include <isc/net.h>
#include <isc/result.h>
#include <isc/types.h>
diff --git a/lib/isc/unix/net.c b/lib/isc/unix/net.c
index 6799940..a4401ad 100644
--- a/lib/isc/unix/net.c
+++ b/lib/isc/unix/net.c
@@ -33,7 +33,6 @@
#include <string.h>
#include <isc/log.h>
-#include <isc/msgs.h>
#include <isc/net.h>
#include <isc/once.h>
#include <isc/util.h>
@@ -141,12 +140,7 @@ try_proto(int domain) {
default:
ISC_IGNORE(strerror_r(errno, strbuf, sizeof(strbuf)));
UNEXPECTED_ERROR(__FILE__, __LINE__,
- "socket() %s: %s",
- isc_msgcat_get(isc_msgcat,
- ISC_MSGSET_GENERAL,
- ISC_MSG_FAILED,
- "failed"),
- strbuf);
+ "socket() failed: %s", strbuf);
return (ISC_R_UNEXPECTED);
}
}
@@ -263,12 +257,7 @@ try_ipv6only(void) {
if (s == -1) {
ISC_IGNORE(strerror_r(errno, strbuf, sizeof(strbuf)));
UNEXPECTED_ERROR(__FILE__, __LINE__,
- "socket() %s: %s",
- isc_msgcat_get(isc_msgcat,
- ISC_MSGSET_GENERAL,
- ISC_MSG_FAILED,
- "failed"),
- strbuf);
+ "socket() failed: %s", strbuf);
ipv6only_result = ISC_R_UNEXPECTED;
return;
}
@@ -286,12 +275,7 @@ try_ipv6only(void) {
if (s == -1) {
ISC_IGNORE(strerror_r(errno, strbuf, sizeof(strbuf)));
UNEXPECTED_ERROR(__FILE__, __LINE__,
- "socket() %s: %s",
- isc_msgcat_get(isc_msgcat,
- ISC_MSGSET_GENERAL,
- ISC_MSG_FAILED,
- "failed"),
- strbuf);
+ "socket() failed: %s", strbuf);
ipv6only_result = ISC_R_UNEXPECTED;
return;
}
@@ -335,12 +319,7 @@ try_ipv6pktinfo(void) {
if (s == -1) {
ISC_IGNORE(strerror_r(errno, strbuf, sizeof(strbuf)));
UNEXPECTED_ERROR(__FILE__, __LINE__,
- "socket() %s: %s",
- isc_msgcat_get(isc_msgcat,
- ISC_MSGSET_GENERAL,
- ISC_MSG_FAILED,
- "failed"),
- strbuf);
+ "socket() failed: %s", strbuf);
ipv6pktinfo_result = ISC_R_UNEXPECTED;
return;
}
diff --git a/lib/isc/win32/libisc.def b/lib/isc/win32/libisc.def
index 5d8a7ed..ad3d85b 100644
--- a/lib/isc/win32/libisc.def
+++ b/lib/isc/win32/libisc.def
@@ -344,7 +344,6 @@ isc_md5_invalidate
isc_md5_update
isc_mem_renderxml
isc_msgcat_close
-isc_msgcat_get
isc_msgcat_open
isc_net_aton
isc_net_disableipv4
diff --git a/lib/isc/win32/net.c b/lib/isc/win32/net.c
index c680edf..7586671 100644
--- a/lib/isc/win32/net.c
+++ b/lib/isc/win32/net.c
@@ -82,12 +82,7 @@ try_proto(int domain) {
default:
strerror_r(errval, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
- "socket() %s: %s",
- isc_msgcat_get(isc_msgcat,
- ISC_MSGSET_GENERAL,
- ISC_MSG_FAILED,
- "failed"),
- strbuf);
+ "socket() failed: %s", strbuf);
return (ISC_R_UNEXPECTED);
}
}
@@ -158,12 +153,7 @@ try_ipv6only(void) {
if (s == INVALID_SOCKET) {
strerror_r(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
- "socket() %s: %s",
- isc_msgcat_get(isc_msgcat,
- ISC_MSGSET_GENERAL,
- ISC_MSG_FAILED,
- "failed"),
- strbuf);
+ "socket() failed: %s", strbuf);
ipv6only_result = ISC_R_UNEXPECTED;
return;
}
@@ -182,12 +172,7 @@ try_ipv6only(void) {
if (s == INVALID_SOCKET) {
strerror_r(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
- "socket() %s: %s",
- isc_msgcat_get(isc_msgcat,
- ISC_MSGSET_GENERAL,
- ISC_MSG_FAILED,
- "failed"),
- strbuf);
+ "socket() failed: %s", strbuf);
ipv6only_result = ISC_R_UNEXPECTED;
return;
}
@@ -231,12 +216,7 @@ try_ipv6pktinfo(void) {
if (s == INVALID_SOCKET) {
strerror_r(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
- "socket() %s: %s",
- isc_msgcat_get(isc_msgcat,
- ISC_MSGSET_GENERAL,
- ISC_MSG_FAILED,
- "failed"),
- strbuf);
+ "socket() failed: %s", strbuf);
ipv6pktinfo_result = ISC_R_UNEXPECTED;
return;
}
diff --git a/lib/isc/wscript b/lib/isc/wscript
index 00b0362..689665c 100644
--- a/lib/isc/wscript
+++ b/lib/isc/wscript
@@ -33,11 +33,9 @@ def build(ctx):
"backtrace-emptytbl.c",
"backtrace.c",
"error.c",
- "lib.c",
"log.c",
"md5.c",
"netaddr.c",
- "nls/msgcat.c",
"random.c",
"result.c",
"sha1.c",
More information about the vc
mailing list