Add ISC_R_NORESOURCES, and redo where and how the last entry is set

This commit is contained in:
Michael Graff
1998-11-03 00:53:42 +00:00
parent 7b5e3afd21
commit 35921f41cf
2 changed files with 6 additions and 4 deletions

View File

@@ -17,6 +17,9 @@ typedef unsigned int isc_result_t;
#define ISC_R_NETDOWN 10
#define ISC_R_HOSTDOWN 11
#define ISC_R_CONNREFUSED 12
#define ISC_R_NORESOURCES 13 /* not enough resources */
#define ISC_R_LAST_ENTRY 13 /* last entry in the file */
#define ISC_R_UNEXPECTED 0xFFFFFFFFL
#define isc_result_totext __isc_result_totext

View File

@@ -1,9 +1,7 @@
#include <isc/result.h>
#define LAST_ENTRY ISC_R_CONNREFUSED
static char *text_table[LAST_ENTRY+1] = {
static char *text_table[ISC_R_LAST_ENTRY + 1] = {
"success",
"out of memory",
"timed out",
@@ -17,13 +15,14 @@ static char *text_table[LAST_ENTRY+1] = {
"network down",
"host down",
"connection refused",
"not enough free resources",
};
char *
isc_result_totext(isc_result_t result) {
if (result == ISC_R_UNEXPECTED)
return ("unexpected error");
if (result > LAST_ENTRY)
if (result > ISC_R_LAST_ENTRY)
return ("unknown result code");
return (text_table[result]);
}