6 #include <stdlib.h> |
6 #include <stdlib.h> |
7 #include <stdio.h> |
7 #include <stdio.h> |
8 #include <string.h> |
8 #include <string.h> |
9 #include <ctype.h> |
9 #include <ctype.h> |
10 #include <sys/types.h> |
10 #include <sys/types.h> |
|
11 #include <syslog.h> |
|
12 #include <unistd.h> |
|
13 #include <errno.h> |
|
14 #include <signal.h> |
|
15 #include <getopt.h> |
|
16 |
|
17 #include <mosquitto.h> |
|
18 |
11 |
19 |
12 #define TRUE 1 |
20 #define TRUE 1 |
13 #define FALSE 0 |
21 #define FALSE 0 |
14 |
22 |
|
23 #define MBSE_SS(x) (x)?(x):"(null)" |
|
24 |
15 /* rdconfig.c */ |
25 /* rdconfig.c */ |
16 #define S(x) (x)?(x):"(null)" |
|
17 |
|
18 typedef struct _key_list { |
26 typedef struct _key_list { |
19 char *key; |
27 char *key; |
20 int (*prc)(char **); |
28 int (*prc)(char **); |
21 char **dest; |
29 char **dest; |
22 } key_list; |
30 } key_list; |
23 |
31 |
24 |
32 |
25 typedef struct _sys_config { |
33 typedef struct _sys_config { |
26 char *name; /* Configuration name */ |
34 char *name; /* Configuration name */ |
27 char *mosq_server; /* mosquitto server hostname */ |
35 char *mosq_host; /* mosquitto server hostname */ |
28 int mosq_port; /* mosquitto server port */ |
36 int mosq_port; /* mosquitto server port */ |
29 } sys_config; |
37 } sys_config; |
30 |
38 |
31 |
39 |
32 void killconfig(void); |
40 void killconfig(void); |
33 int rdconfig(char *); |
41 int rdconfig(void); |
34 int wrconfig(char *); |
|
35 |
42 |
36 |
43 |
37 /* xutil.c */ |
44 /* xutil.c */ |
38 char *xmalloc(size_t); |
45 char *xmalloc(size_t); |
39 char *xstrcpy(char *); |
46 char *xstrcpy(char *); |