2418
|
1 |
/*
|
|
2 |
|
|
3 |
module: errlib.h
|
|
4 |
|
|
5 |
purpose: definitions of function sin errlib.c
|
|
6 |
|
|
7 |
reference: Stevens, Unix network programming (2ed), p.922
|
|
8 |
|
|
9 |
*/
|
|
10 |
|
|
11 |
#ifndef _ERRLIB_H
|
|
12 |
#define _ERRLIB_H
|
|
13 |
|
2529
|
14 |
#include "globals.h"
|
|
15 |
|
|
16 |
#ifdef __CPLUSPLUS
|
|
17 |
extern "C" {
|
|
18 |
#endif
|
2418
|
19 |
|
2529
|
20 |
extern int daemon_proc;
|
2418
|
21 |
|
2529
|
22 |
void err_msg (const char *fmt, ...);
|
|
23 |
void err_quit (const char *fmt, ...);
|
|
24 |
void err_ret (const char *fmt, ...);
|
|
25 |
void err_sys (const char *fmt, ...);
|
|
26 |
void err_dump (const char *fmt, ...);
|
|
27 |
|
|
28 |
#ifdef __CPLUSPLUS
|
|
29 |
}
|
|
30 |
#endif
|
2418
|
31 |
|
|
32 |
#endif /*_ERRLIB_H*/
|
|
33 |
|
|
34 |
/*
|
|
35 |
suggested error string ( PROG ) LEVEL - TEXT : ERRNO
|
|
36 |
|
|
37 |
errno? closeprog? log level
|
|
38 |
err_msg no no LOG_INFO
|
|
39 |
err_quit no exit(1) LOG_ERR
|
|
40 |
err_ret si no LOG_INFO
|
|
41 |
err_sys si exit(1) LOG_ERR
|
|
42 |
err_dump si abort( ) LOG_ERR
|
|
43 |
*/ |