2010-03-26 01:20:59 +02:00
|
|
|
/* upslog.h - table of functions for handling various logging functions */
|
|
|
|
|
2022-07-10 10:23:45 +03:00
|
|
|
#ifndef NUT_UPSLOG_H_SEEN
|
|
|
|
#define NUT_UPSLOG_H_SEEN 1
|
|
|
|
|
2013-11-24 17:00:12 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
/* *INDENT-OFF* */
|
|
|
|
extern "C" {
|
|
|
|
/* *INDENT-ON* */
|
|
|
|
#endif
|
|
|
|
|
2010-03-26 01:20:59 +02:00
|
|
|
/* function list */
|
2011-01-26 11:35:08 +02:00
|
|
|
typedef struct flist_s {
|
2010-03-26 01:20:59 +02:00
|
|
|
void (*fptr)(const char *arg);
|
|
|
|
const char *arg;
|
2011-01-26 11:35:08 +02:00
|
|
|
struct flist_s *next;
|
|
|
|
} flist_t;
|
2010-03-26 01:20:59 +02:00
|
|
|
|
|
|
|
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);
|
|
|
|
|
2022-07-10 10:23:45 +03:00
|
|
|
/* This is only used in upslog.c, but refers to routines declared here...
|
|
|
|
* To move or not to move?..
|
|
|
|
*/
|
|
|
|
static struct {
|
2010-03-26 01:20:59 +02:00
|
|
|
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 },
|
2022-07-10 10:23:45 +03:00
|
|
|
{ NULL, (void(*)(const char*))(NULL) }
|
2010-03-26 01:20:59 +02:00
|
|
|
};
|
2013-11-24 17:00:12 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
/* *INDENT-OFF* */
|
|
|
|
}
|
|
|
|
/* *INDENT-ON* */
|
|
|
|
#endif
|
|
|
|
|
2022-07-10 10:23:45 +03:00
|
|
|
#endif /* NUT_UPSLOG_H_SEEN */
|