Wed, 23 Apr 2014 14:25:09 +0200
Added library
7 | 1 | #ifndef _MBSELIB_H |
2 | #define _MBSELIB_H | |
3 | ||
4 | #include "../config.h" | |
5 | ||
6 | #include <stdlib.h> | |
7 | #include <stdio.h> | |
8 | #include <string.h> | |
9 | #include <ctype.h> | |
10 | #include <sys/types.h> | |
11 | ||
12 | #define TRUE 1 | |
13 | #define FALSE 0 | |
14 | ||
15 | /* rdconfig.c */ | |
16 | #define S(x) (x)?(x):"(null)" | |
17 | ||
18 | typedef struct _key_list { | |
19 | char *key; | |
20 | int (*prc)(char **); | |
21 | char **dest; | |
22 | } key_list; | |
23 | ||
24 | ||
25 | typedef struct _sys_config { | |
26 | char *name; /* Configuration name */ | |
27 | char *mosq_server; /* mosquitto server hostname */ | |
28 | int mosq_port; /* mosquitto server port */ | |
29 | } sys_config; | |
30 | ||
31 | ||
32 | void killconfig(void); | |
33 | int rdconfig(char *); | |
34 | int wrconfig(char *); | |
35 | ||
36 | ||
37 | /* xutil.c */ | |
38 | char *xmalloc(size_t); | |
39 | char *xstrcpy(char *); | |
40 | char *xstrcat(char *, char *); | |
41 | ||
42 | #endif | |
43 |