lib/mbselib.h

Wed, 23 Apr 2014 14:25:09 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Wed, 23 Apr 2014 14:25:09 +0200
changeset 7
d74b26b2f217
child 8
e584bc0177df
permissions
-rw-r--r--

Added library

#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>

#define TRUE 1
#define FALSE 0

/* rdconfig.c */
#define S(x) (x)?(x):"(null)"

typedef struct _key_list {
    char	*key;
    int		(*prc)(char **);
    char	**dest;
} key_list;


typedef struct _sys_config {
    char	*name;			/* Configuration name		*/
    char	*mosq_server;		/* mosquitto server hostname	*/
    int		mosq_port;		/* mosquitto server port	*/
} sys_config;


void killconfig(void);
int  rdconfig(char *);
int  wrconfig(char *);


/* xutil.c */
char *xmalloc(size_t);
char *xstrcpy(char *);
char *xstrcat(char *, char *);

#endif

mercurial