Wed, 23 Apr 2014 17:19:00 +0200
Server communication seems ok, can handle server shutdowns too.
#ifndef _MBSELIB_H #define _MBSELIB_H #include "../config.h" #include <stdlib.h> #include <stdio.h> #include <string.h> #include <ctype.h> #include <sys/types.h> #include <syslog.h> #include <unistd.h> #include <errno.h> #include <signal.h> #include <getopt.h> #include <mosquitto.h> #define TRUE 1 #define FALSE 0 #define MBSE_SS(x) (x)?(x):"(null)" /* rdconfig.c */ typedef struct _key_list { char *key; int (*prc)(char **); char **dest; } key_list; typedef struct _sys_config { char *name; /* Configuration name */ char *mosq_host; /* mosquitto server hostname */ int mosq_port; /* mosquitto server port */ } sys_config; void killconfig(void); int rdconfig(void); /* xutil.c */ char *xmalloc(size_t); char *xstrcpy(char *); char *xstrcat(char *, char *); #endif