RaspberrPi project source code
guowenxue
18 hours ago 9e2630a8f3887df3d8f11ee6a27d0d34b331ef28
project/lightd/config.h
@@ -13,6 +13,7 @@
#ifndef  __CONF_H_
#define  __CONF_H_
#include <stddef.h>
#include "gpio.h"
enum
@@ -73,6 +74,10 @@
    mqtt_ctx_t      mqtt;
} iotd_ctx_t;
/* get iotd_ctx address by mqtt_ctx address */
#define container_of(ptr, type, member) ((type *)((char *)(ptr) - offsetof(type, member)))
#define to_iotd(ctx)   container_of(ctx, iotd_ctx_t, mqtt);
extern int parser_conf(const char *conf_file, iotd_ctx_t *ctx, int debug);
#endif   /* ----- #ifndef _CONF_H_  ----- */