result.c revision 15a44745412679c30a6d022733925af70a38b715
/*
* Copyright (C) 1998-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: result.c,v 1.45 2000/07/27 09:51:09 tale Exp $ */
#include <config.h>
#include <stdlib.h>
#include <isc/resultclass.h>
typedef struct resulttable {
unsigned int base;
unsigned int last;
const char ** text;
int set;
} resulttable;
static const char *text[ISC_R_NRESULTS] = {
"success", /* 0 */
"out of memory", /* 1 */
"timed out", /* 2 */
"no available threads", /* 3 */
"address not available", /* 4 */
"address in use", /* 5 */
"permission denied", /* 6 */
"no pending connections", /* 7 */
"network unreachable", /* 8 */
"host unreachable", /* 9 */
"network down", /* 10 */
"host down", /* 11 */
"connection refused", /* 12 */
"not enough free resources", /* 13 */
"end of file", /* 14 */
"socket already bound", /* 15 */
"reload", /* 16 */
"lock busy", /* 17 */
"already exists", /* 18 */
"ran out of space", /* 19 */
"operation canceled", /* 20 */
"socket is not bound", /* 21 */
"shutting down", /* 22 */
"not found", /* 23 */
"unexpected end of input", /* 24 */
"failure", /* 25 */
"I/O error", /* 26 */
"not implemented", /* 27 */
"unbalanced parentheses", /* 28 */
"no more", /* 29 */
"invalid file", /* 30 */
"bad base64 encoding", /* 31 */
"unexpected token", /* 32 */
"quota reached", /* 33 */
"unexpected error", /* 34 */
"already running", /* 35 */
"ignore", /* 36 */
"address mask not contiguous", /* 37 */
"file not found", /* 38 */
"file already exists", /* 39 */
"socket is not connected", /* 40 */
"out of range", /* 41 */
"out of entropy", /* 42 */
"invalid use of multicast address", /* 43 */
"not a file", /* 44 */
"not a directory", /* 45 */
"queue is full" /* 46 */
};
#define ISC_RESULT_RESULTSET 2
#define ISC_RESULT_UNAVAILABLESET 3
static isc_mutex_t lock;
static isc_result_t
{
/*
* We use malloc() here because we we want to be able to use
* isc_result_totext() even if there is no memory context.
*/
return (ISC_R_NOMEMORY);
return (ISC_R_SUCCESS);
}
static void
initialize_action(void) {
if (result != ISC_R_SUCCESS)
"register_table() failed: %u", result);
}
static void
initialize(void) {
}
const char *
const char *text, *default_text;
int index;
initialize();
/*
* Note: we use 'index + 1' as the message number
* instead of index because isc_msgcat_get() requires
* the message number to be > 0.
*/
break;
}
}
1, "(result code text not available)");
return (text);
}
{
initialize();
}