Commit 3cddfdd2 authored by Bob Halley's avatar Bob Halley
Browse files

add new results

parent ab774d16
......@@ -2,19 +2,25 @@
#ifndef ISC_RESULT_H
#define ISC_RESULT_H 1
/* XXX HACK XXX */
#define isc_result isc_result_t
typedef unsigned int isc_result_t;
#define ISC_R_SUCCESS 0
#define ISC_R_NOMEMORY 1
#define ISC_R_TIMEDOUT 2
#define ISC_R_NOTHREADS 3
#define ISC_R_ADDRNOTAVAIL 4
#define ISC_R_ADDRINUSE 5
#define ISC_R_NOPERM 6
#define ISC_R_NOCONN 7
#define ISC_R_NETUNREACH 8
#define ISC_R_HOSTUNREACH 9
#define ISC_R_NETDOWN 10
#define ISC_R_HOSTDOWN 11
#define ISC_R_CONNREFUSED 12
#define ISC_R_UNEXPECTED 0xFFFFFFFFL
#define isc_result_totext __isc_result_totext
char * isc_result_totext(isc_result);
char * isc_result_totext(isc_result_t);
#endif /* ISC_RESULT_H */
#include <isc/result.h>
#define LAST_ENTRY ISC_R_NOMEMORY
#define LAST_ENTRY ISC_R_CONNREFUSED
static char *text_table[LAST_ENTRY+1] = {
"success",
"out of memory"
"out of memory",
"timed out",
"no available threads",
"address not available",
"address in use",
"permission denied",
"no pending connections",
"network unreachable",
"host unreachable",
"network down",
"host down",
"connection refused",
};
char *
isc_result_totext(isc_result result) {
isc_result_totext(isc_result_t result) {
if (result == ISC_R_UNEXPECTED)
return ("unexpected error");
if (result > LAST_ENTRY)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment