initial check-in, version 0.5.0
This commit is contained in:
commit
0b44a0315b
1021 changed files with 45711 additions and 0 deletions
16
src/network/hstrerror.c
Normal file
16
src/network/hstrerror.c
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#define _GNU_SOURCE
|
||||
#include <netdb.h>
|
||||
|
||||
static const char msgs[] =
|
||||
"Host not found\0"
|
||||
"Try again\0"
|
||||
"Non-recoverable error\0"
|
||||
"Address not available\0"
|
||||
"\0Unknown error";
|
||||
|
||||
const char *hstrerror(int ecode)
|
||||
{
|
||||
const char *s;
|
||||
for (s=msgs, ecode--; ecode && *s; ecode--, s++) for (; *s; s++);
|
||||
return *s ? s : s+1;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue