forked from networkupstools/nut
-
Notifications
You must be signed in to change notification settings - Fork 0
/
upslog.h
49 lines (42 loc) · 1.02 KB
/
upslog.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/* upslog.h - table of functions for handling various logging functions */
#ifndef NUT_UPSLOG_H_SEEN
#define NUT_UPSLOG_H_SEEN 1
#ifdef __cplusplus
/* *INDENT-OFF* */
extern "C" {
/* *INDENT-ON* */
#endif
/* function list */
typedef struct flist_s {
void (*fptr)(const char *arg);
const char *arg;
struct flist_s *next;
} flist_t;
static void do_host(const char *arg);
static void do_upshost(const char *arg);
static void do_pid(const char *arg);
static void do_time(const char *arg);
static void do_var(const char *arg);
static void do_etime(const char *arg);
/* This is only used in upslog.c, but refers to routines declared here...
* To move or not to move?..
*/
static struct {
const char *name;
void (*func)(const char *arg);
} logcmds[] =
{
{ "HOST", do_host },
{ "UPSHOST", do_upshost },
{ "PID", do_pid },
{ "TIME", do_time },
{ "VAR", do_var },
{ "ETIME", do_etime },
{ NULL, (void(*)(const char*))(NULL) }
};
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#endif /* NUT_UPSLOG_H_SEEN */