Commit 9cd6d409 authored by David Lawrence's avatar David Lawrence

first pass at using isc_msgcat_get for message strings in libisc

parent 5f515f43
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: assertions.c,v 1.12 2000/08/01 01:29:13 tale Exp $ */
/* $Id: assertions.c,v 1.13 2000/12/06 00:29:55 tale Exp $ */
#include <config.h>
......@@ -23,6 +23,7 @@
#include <stdlib.h>
#include <isc/assertions.h>
#include <isc/msgs.h>
/*
* Forward.
......@@ -49,6 +50,11 @@ const char *
isc_assertion_typetotext(isc_assertiontype_t type) {
const char *result;
/*
* These strings have purposefully not been internationalized
* because they are considered to essentially be keywords of
* the ISC development environment.
*/
switch (type) {
case isc_assertiontype_require:
result = "REQUIRE";
......@@ -76,8 +82,10 @@ static void
default_callback(const char *file, int line, isc_assertiontype_t type,
const char *cond)
{
fprintf(stderr, "%s:%d: %s(%s) failed.\n",
file, line, isc_assertion_typetotext(type), cond);
fprintf(stderr, "%s:%d: %s(%s) %s.\n",
file, line, isc_assertion_typetotext(type), cond,
isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
ISC_MSG_FAILED, "failed"));
fflush(stderr);
abort();
/* NOTREACHED */
......
......@@ -48,7 +48,7 @@
* SUCH DAMAGE.
*/
/* $Id: commandline.c,v 1.10 2000/08/01 01:29:19 tale Exp $ */
/* $Id: commandline.c,v 1.11 2000/12/06 00:29:56 tale Exp $ */
/*
* This file was adapted from the NetBSD project's source tree, RCS ID:
......@@ -68,6 +68,7 @@
#include <stdio.h>
#include <isc/commandline.h>
#include <isc/msgs.h>
#include <isc/string.h>
#include <isc/util.h>
......@@ -140,8 +141,12 @@ isc_commandline_parse(int argc, char * const *argv, const char *options) {
isc_commandline_index++;
if (isc_commandline_errprint && *options != ':')
fprintf(stderr, "%s: illegal option -- %c\n",
fprintf(stderr, "%s: %s -- %c\n",
isc_commandline_progname,
isc_msgcat_get(isc_msgcat,
ISC_MSGSET_COMMANDLINE,
ISC_MSG_ILLEGALOPT,
"illegal option"),
isc_commandline_option);
return (BADOPT);
......@@ -189,10 +194,14 @@ isc_commandline_parse(int argc, char * const *argv, const char *options) {
return (BADARG);
if (isc_commandline_errprint)
fprintf(stderr,
"%s: option requires an argument -- %c\n",
isc_commandline_progname,
isc_commandline_option);
fprintf(stderr, "%s: %s -- %c\n",
isc_commandline_progname,
isc_msgcat_get(isc_msgcat,
ISC_MSGSET_COMMANDLINE,
ISC_MSG_OPTNEEDARG,
"option requires"
"an argument"),
isc_commandline_option);
return (BADOPT);
}
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: error.c,v 1.13 2000/08/01 01:29:20 tale Exp $ */
/* $Id: error.c,v 1.14 2000/12/06 00:29:57 tale Exp $ */
#include <config.h>
......@@ -23,6 +23,7 @@
#include <stdlib.h>
#include <isc/error.h>
#include <isc/msgs.h>
static void
default_unexpected_callback(const char *, int, const char *, va_list);
......@@ -70,7 +71,9 @@ 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) failed", expression);
isc_error_fatal(file, line, "RUNTIME_CHECK(%s) %s", expression,
isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
ISC_MSG_FAILED, "failed"));
}
static void
......@@ -87,7 +90,9 @@ static void
default_fatal_callback(const char *file, int line, const char *format,
va_list args)
{
fprintf(stderr, "%s:%d: fatal error: ", file, line);
fprintf(stderr, "%s:%d: %s: ", file, line,
isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
ISC_MSG_FATALERROR, "fatal error"));
vfprintf(stderr, format, args);
fprintf(stderr, "\n");
fflush(stderr);
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: util.h,v 1.19 2000/08/28 19:49:38 bwelling Exp $ */
/* $Id: util.h,v 1.20 2000/12/06 00:30:15 tale Exp $ */
#ifndef ISC_UTIL_H
#define ISC_UTIL_H 1
......@@ -75,6 +75,7 @@
#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
......@@ -82,15 +83,21 @@
#include <isc/result.h> /* Contractual promise. */
#define LOCK(lp) do { \
ISC_UTIL_TRACE(fprintf(stderr, "LOCKING %p %s %d\n", \
ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %d\n", \
isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
ISC_MSG_LOCKING, "LOCKING"), \
(lp), __FILE__, __LINE__)); \
RUNTIME_CHECK(isc_mutex_lock((lp)) == ISC_R_SUCCESS); \
ISC_UTIL_TRACE(fprintf(stderr, "LOCKED %p %s %d\n", (lp), \
__FILE__, __LINE__)); \
ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %d\n", \
isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
ISC_MSG_LOCKED, "LOCKED"), \
(lp), __FILE__, __LINE__)); \
} while (0)
#define UNLOCK(lp) do { \
RUNTIME_CHECK(isc_mutex_unlock((lp)) == ISC_R_SUCCESS); \
ISC_UTIL_TRACE(fprintf(stderr, "UNLOCKED %p %s %d\n", \
ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %d\n", \
isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
ISC_MSG_UNLOCKED, "UNLOCKED"), \
(lp), __FILE__, __LINE__)); \
} while (0)
#define ISLOCKED(lp) (1)
......@@ -99,21 +106,35 @@
#define BROADCAST(cvp) do { \
ISC_UTIL_TRACE(fprintf(stderr, "BROADCAST %p %s %d\n", \
ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %d\n", \
isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
ISC_MSG_BROADCAST, "BROADCAST"),\
(cvp), __FILE__, __LINE__)); \
RUNTIME_CHECK(isc_condition_broadcast((cvp)) == ISC_R_SUCCESS); \
} while (0)
#define SIGNAL(cvp) do { \
ISC_UTIL_TRACE(fprintf(stderr, "SIGNAL %p %s %d\n", \
ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %d\n", \
isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
ISC_MSG_SIGNAL, "SIGNAL"), \
(cvp), __FILE__, __LINE__)); \
RUNTIME_CHECK(isc_condition_signal((cvp)) == ISC_R_SUCCESS); \
} while (0)
#define WAIT(cvp, lp) do { \
ISC_UTIL_TRACE(fprintf(stderr, "WAIT %p LOCK %p %s %d\n", \
(cvp), (lp), __FILE__, __LINE__)); \
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__)); \
RUNTIME_CHECK(isc_condition_wait((cvp), (lp)) == ISC_R_SUCCESS); \
ISC_UTIL_TRACE(fprintf(stderr, "WAITED %p LOCKED %p %s %d\n", \
(cvp), (lp), __FILE__, __LINE__)); \
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__)); \
} while (0)
/*
......@@ -127,14 +148,20 @@
isc_condition_waituntil((cvp), (lp), (tp))
#define RWLOCK(lp, t) do { \
ISC_UTIL_TRACE(fprintf(stderr, "RWLOCK %p, %d %s %d\n", \
ISC_UTIL_TRACE(fprintf(stderr, "%s %p, %d %s %d\n", \
isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
ISC_MSG_RWLOCK, "RWLOCK"), \
(lp), (t), __FILE__, __LINE__)); \
RUNTIME_CHECK(isc_rwlock_lock((lp), (t)) == ISC_R_SUCCESS); \
ISC_UTIL_TRACE(fprintf(stderr, "RWLOCKED %p, %d %s %d\n", \
ISC_UTIL_TRACE(fprintf(stderr, "%s %p, %d %s %d\n", \
isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
ISC_MSG_RWLOCKED, "RWLOCKED"), \
(lp), (t), __FILE__, __LINE__)); \
} while (0)
#define RWUNLOCK(lp, t) do { \
ISC_UTIL_TRACE(fprintf(stderr, "RWUNLOCK %p, %d %s %d\n", \
ISC_UTIL_TRACE(fprintf(stderr, "%s %p, %d %s %d\n", \
isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
ISC_MSG_RWUNLOCK, "RWUNLOCK"), \
(lp), (t), __FILE__, __LINE__)); \
RUNTIME_CHECK(isc_rwlock_unlock((lp), (t)) == ISC_R_SUCCESS); \
} while (0)
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: lex.c,v 1.52 2000/11/20 00:41:50 bwelling Exp $ */
/* $Id: lex.c,v 1.53 2000/12/06 00:29:58 tale Exp $ */
#include <config.h>
......@@ -27,6 +27,7 @@
#include <isc/file.h>
#include <isc/lex.h>
#include <isc/mem.h>
#include <isc/msgs.h>
#include <isc/stdio.h>
#include <isc/string.h>
#include <isc/util.h>
......@@ -724,7 +725,10 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) {
break;
default:
FATAL_ERROR(__FILE__, __LINE__,
"Unexpected state %d", state);
isc_msgcat_get(isc_msgcat, ISC_MSGSET_LEX,
ISC_MSG_UNEXPECTEDSTATE,
"Unexpected state %d"),
state);
/* Does not return. */
}
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: lib.c,v 1.6 2000/08/01 01:29:31 tale Exp $ */
/* $Id: lib.c,v 1.7 2000/12/06 00:29:59 tale Exp $ */
#include <config.h>
......@@ -23,7 +23,7 @@
#include <stdlib.h>
#include <isc/once.h>
#include <isc/msgcat.h>
#include <isc/msgs.h>
#include <isc/lib.h>
/***
......@@ -63,9 +63,15 @@ isc_lib_initmsgcat(void) {
/*
* 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: fatal error: isc_once_do() failed.\n",
__FILE__, __LINE__);
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();
}
}
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: log.c,v 1.49 2000/11/24 01:37:24 marka Exp $ */
/* $Id: log.c,v 1.50 2000/12/06 00:30:01 tale Exp $ */
/* Principal Authors: DCL */
......@@ -32,6 +32,7 @@
#include <isc/log.h>
#include <isc/magic.h>
#include <isc/mem.h>
#include <isc/msgs.h>
#include <isc/print.h>
#include <isc/string.h>
#include <isc/time.h>
......@@ -1364,14 +1365,22 @@ isc_log_doit(isc_log_t *lctx, isc_logcategory_t *category,
* "Should never happen."
*/
snprintf(time_string, sizeof(time_string),
"Bad 00 99:99:99.999 ");
isc_msgcat_get(isc_msgcat,
ISC_MSGSET_LOG,
ISC_MSG_BADTIME,
"Bad 00 99:99:99.999 "));
}
if ((channel->flags & ISC_LOG_PRINTLEVEL) != 0 &&
level_string[0] == '\0') {
if (level < ISC_LOG_CRITICAL)
sprintf(level_string, "level %d: ", level);
sprintf(level_string,
isc_msgcat_get(isc_msgcat,
ISC_MSGSET_LOG,
ISC_MSG_LEVEL,
"level %d: "),
level);
else if (level > ISC_LOG_DYNAMIC)
sprintf(level_string, "%s %d: ",
log_level_strings[0], level);
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: mem.c,v 1.68 2000/12/01 00:52:38 gson Exp $ */
/* $Id: mem.c,v 1.69 2000/12/06 00:30:02 tale Exp $ */
#include <config.h>
......@@ -26,6 +26,7 @@
#include <limits.h>
#include <isc/mem.h>
#include <isc/msgs.h>
#include <isc/ondestroy.h>
#include <isc/string.h>
......@@ -175,7 +176,10 @@ add_trace_entry(isc_mem_t *mctx, const void *ptr, unsigned int size
unsigned int i;
if (MEM_TRACE)
fprintf(stderr, "add %p size %u file %s line %u mctx %p\n",
fprintf(stderr, isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM,
ISC_MSG_ADDTRACE,
"add %p size %u "
"file %s line %u mctx %p\n"),
ptr, size, file, line, mctx);
if (!MEM_RECORD)
......@@ -224,7 +228,10 @@ delete_trace_entry(isc_mem_t *mctx, const void *ptr, unsigned int size,
unsigned int i;
if (MEM_TRACE)
fprintf(stderr, "del %p size %u file %s line %u mctx %p\n",
fprintf(stderr, isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM,
ISC_MSG_DELTRACE,
"del %p size %u "
"file %s line %u mctx %p\n"),
ptr, size, file, line, mctx);
if (!MEM_RECORD)
......@@ -664,7 +671,9 @@ isc_mem_createx(size_t init_max_size, size_t target_size,
(memfree)(arg, ctx->freelists);
(memfree)(arg, ctx);
UNEXPECTED_ERROR(__FILE__, __LINE__,
"isc_mutex_init() failed");
"isc_mutex_init() %s",
isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
ISC_MSG_FAILED, "failed"));
return (ISC_R_UNEXPECTED);
}
ctx->references = 1;
......@@ -907,8 +916,10 @@ isc__mem_get(isc_mem_t *ctx, size_t size FLARG) {
if (call_water) {
/* XXX remove */
fprintf(stderr, "calling water(%p,ISC_MEM_HIWATER)\n",
ctx->water_arg);
fprintf(stderr, "%s water(%p, ISC_MEM_HIWATER)\n",
isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
ISC_MSG_CALLING, "calling"),
ctx->water_arg);
(ctx->water)(ctx->water_arg, ISC_MEM_HIWATER);
}
......@@ -938,8 +949,10 @@ isc__mem_put(isc_mem_t *ctx, void *ptr, size_t size FLARG)
if (call_water) {
/* XXX remove */
fprintf(stderr, "calling water(%p,ISC_MEM_LOWATER)\n",
ctx->water_arg);
fprintf(stderr, "%s water(%p,ISC_MEM_LOWATER)\n",
isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
ISC_MSG_CALLING, "calling"),
ctx->water_arg);
(ctx->water)(ctx->water_arg, ISC_MEM_LOWATER);
}
}
......@@ -1005,10 +1018,27 @@ isc_mem_stats(isc_mem_t *ctx, FILE *out) {
*/
pool = ISC_LIST_HEAD(ctx->pools);
if (pool != NULL) {
fprintf(out, "[Pool statistics]\n");
fprintf(out, isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM,
ISC_MSG_POOLSTATS,
"[Pool statistics]\n"));
fprintf(out, "%15s %10s %10s %10s %10s %10s %10s %10s %1s\n",
"name", "size", "maxalloc", "allocated", "freecount",
"freemax", "fillcount", "gets", "L");
isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM,
ISC_MSG_POOLNAME, "name"),
isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM,
ISC_MSG_POOLSIZE, "size"),
isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM,
ISC_MSG_POOLMAXALLOC, "maxalloc"),
isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM,
ISC_MSG_POOLALLOCATED, "allocated"),
isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM,
ISC_MSG_POOLFREECOUNT, "freecount"),
isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM,
ISC_MSG_POOLFREEMAX, "freemax"),
isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM,
ISC_MSG_POOLFILLCOUNT, "fillcount"),
isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM,
ISC_MSG_POOLGETS, "gets"),
"L");
}
while (pool != NULL) {
fprintf(out, "%15s %10lu %10u %10u %10u %10u %10u %10u %s\n",
......@@ -1024,15 +1054,25 @@ isc_mem_stats(isc_mem_t *ctx, FILE *out) {
debuglink_t *dl;
unsigned int i;
fprintf(out, "DUMP OF ALL OUTSTANDING MEMORY ALLOCATIONS\n");
fprintf(out, isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM,
ISC_MSG_DUMPALLOC,
"DUMP OF ALL OUTSTANDING "
"MEMORY ALLOCATIONS\n");
dl = ISC_LIST_HEAD(ctx->debuglist);
if (dl == NULL)
fprintf(out, "\tNone.\n");
fprintf(out, isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM,
ISC_MSG_NONE,
"\tNone.\n"));
while (dl != NULL) {
for (i = 0 ; i < DEBUGLIST_COUNT ; i++)
if (dl->ptr[i] != NULL)
fprintf(out,
"\tptr %p file %s line %u\n",
isc_msgcat_get(isc_msgcat,
ISC_MSGSET_MEM,
ISC_MSG_PTRFILELINE,
"\tptr %p "
"file %s "
"line %u\n"),
dl->ptr[i], dl->file[i],
dl->line[i]);
dl = ISC_LIST_NEXT(dl, link);
......
......@@ -15,13 +15,14 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: netaddr.c,v 1.12 2000/08/01 01:29:37 tale Exp $ */
/* $Id: netaddr.c,v 1.13 2000/12/06 00:30:05 tale Exp $ */
#include <config.h>
#include <stdio.h>
#include <isc/buffer.h>
#include <isc/msgs.h>
#include <isc/netaddr.h>
#include <isc/print.h>
#include <isc/sockaddr.h>
......@@ -151,7 +152,9 @@ isc_netaddr_format(isc_netaddr_t *na, char *array, unsigned int size) {
if (result != ISC_R_SUCCESS) {
snprintf(array, size,
"<unknown address, family %u>",
isc_msgcat_get(isc_msgcat, ISC_MSGSET_NETADDR,
ISC_MSG_UNKNOWNADDR,
"<unknown address, family %u>"),
na->family);
array[size - 1] = '\0';
}
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: print.c,v 1.14 2000/11/14 23:42:29 tale Exp $ */
/* $Id: print.c,v 1.15 2000/12/06 00:30:06 tale Exp $ */
#include <config.h>
......@@ -24,6 +24,7 @@
#include <stdlib.h>
#include <isc/assertions.h>
#include <isc/msgs.h>
#include <isc/print.h>
#include <isc/platform.h>
#include <isc/util.h>
......@@ -456,17 +457,29 @@ isc_print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
}
break;
case 'D': /*deprecated*/
INSIST("use %ld instead of %D" == NULL);
INSIST(isc_msgcat_get(isc_msgcat, ISC_MSGSET_PRINT,
ISC_MSG_USELD,
"use %ld instead of %D")
== NULL);
case 'O': /*deprecated*/
INSIST("use %lo instead of %O" == NULL);
INSIST(isc_msgcat_get(isc_msgcat, ISC_MSGSET_PRINT,
ISC_MSG_USELO,
"use %lo instead of %O")
== NULL);
case 'U': /*deprecated*/
INSIST("use %lu instead of %U" == NULL);
INSIST(isc_msgcat_get(isc_msgcat, ISC_MSGSET_PRINT,
ISC_MSG_USELU,
"use %lu instead of %U")
== NULL);
case 'L':
#ifdef HAVE_LONG_DOUBLE
l = 1;
#else
INSIST("long doubles are not supported" == NULL);
INSIST(isc_msgcat_get(isc_msgcat, ISC_MSGSET_PRINT,
ISC_MSG_NOLONGDBL,
"long doubles are not supported")
== NULL);
#endif
/*FALLTHROUGH*/
case 'e':
......
......@@ -15,13 +15,14 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: condition.c,v 1.24 2000/08/01 01:31:00 tale Exp $ */
/* $Id: condition.c,v 1.25 2000/12/06 00:30:17 tale Exp $ */
#include <config.h>
#include <errno.h>
#include <isc/condition.h>
#include <isc/msgs.h>
#include <isc/string.h>
#include <isc/time.h>
#include <isc/util.h>
......@@ -56,7 +57,9 @@ isc_condition_waituntil(isc_condition_t *c, isc_mutex_t *m, isc_time_t *t) {
} while (presult == EINTR);
UNEXPECTED_ERROR(__FILE__, __LINE__,
"pthread_cond_timedwait() returned %s",
"pthread_cond_timedwait() %s %s",
isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
ISC_MSG_RETURNED, "returned %s"),
strerror(presult));
return (ISC_R_UNEXPECTED);
}
......@@ -15,14 +15,14 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: result.c,v 1.50 2000/11/18 02:56:45 gson Exp $ */
/* $Id: result.c,v 1.51 2000/12/06 00:30:07 tale Exp $ */
#include <config.h>
#include <stdlib.h>
#include <isc/lib.h>
#include <isc/msgcat.h>
#include <isc/msgs.h>
#include <isc/mutex.h>
#include <isc/once.h>
#include <isc/resultclass.h>
......@@ -142,7 +142,10 @@ initialize_action(void) {
isc_msgcat, ISC_RESULT_RESULTSET);
if (result != ISC_R_SUCCESS)
UNEXPECTED_ERROR(__FILE__, __LINE__,
"register_table() failed: %u", result);
"register_table() %s: %u",
isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
ISC_MSG_FAILED, "failed"),
result);
}
static void
......
......@@ -15,13 +15,14 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rwlock.c,v 1.25 2000/08/29 00:33:35 bwelling Exp $ */
/* $Id: rwlock.c,v 1.26 2000/12/06 00:30:09 tale Exp $ */
#include <config.h>
#include <stddef.h>
#include <isc/magic.h>
#include <isc/msgs.h>
#include <isc/platform.h>
#include <isc/rwlock.h>
#include <isc/util.h>
......@@ -46,10 +47,21 @@
static void
print_lock(const char *operation, isc_rwlock_t *rwl, isc_rwlocktype_t type) {
fprintf(stderr,
"rwlock %p thread %lu %s(%s): %s, %u active, %u granted, "
"%u rwaiting, %u wwaiting\n", rwl, isc_thread_self(),
operation, (type == isc_rwlocktype_read ? "read" : "write"),
(rwl->type == isc_rwlocktype_read ? "reading" : "writing"),
isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK,
ISC_MSG_PRINTLOCK,
"rwlock %p thread %lu %s(%s): %s, %u active, "
"%u granted, %u rwaiting, %u wwaiting\n"),
rwl, isc_thread_self(), operation,
(type == isc_rwlocktype_read ?
isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK,
ISC_MSG_READ, "read") :