--- mqtt/src/dl.c 2012/02/01 15:44:40 1.2.2.2 +++ mqtt/src/dl.c 2012/05/08 14:27:46 1.2.2.6 @@ -25,11 +25,11 @@ mqttLog(const char *fmt, ...) } void * -mqttLoadRTLM(sl_config *cfg, int modtype) +mqttLoadRTLM(cfg_root_t *cfg, int modtype) { const char *str, *attr; void *rtlm = NULL; - void *(*mqttOpenRTLM)(sl_config *); + void *(*mqttOpenRTLM)(cfg_root_t *); void (*mqttCloseRTLM)(void *); if (!cfg) @@ -47,13 +47,13 @@ mqttLoadRTLM(sl_config *cfg, int modtype) break; } - str = (const char*) CFG(cfg_GetAttribute(cfg, CFG("mqttd"), CFG(attr))); + str = cfg_getAttribute(cfg, "mqttd", attr); if (!str) { mqttLog("Error:: RTL module not found\n"); return NULL; } - rtlm = dlopen(str, RTLD_LAZY); + rtlm = dlopen(str, RTLD_NOW); if (!rtlm) { mqttLog("Error:: RTL module %s not found %s\n", str, dlerror()); return NULL; @@ -61,13 +61,13 @@ mqttLoadRTLM(sl_config *cfg, int modtype) mqttOpenRTLM = dlsym(rtlm, "mqtt_rtlm_open"); if (!mqttOpenRTLM) { - mqttLog("Error:: Can't found mqtt_db_open call\n"); + mqttLog("Error:: Can't found mqtt_rtlm_open call\n"); dlclose(rtlm); return NULL; } mqttCloseRTLM = dlsym(rtlm, "mqtt_rtlm_close"); if (!mqttCloseRTLM) { - mqttLog("Error:: Can't found mqtt_db_close call\n"); + mqttLog("Error:: Can't found mqtt_rtlm_close call\n"); dlclose(rtlm); return NULL; } @@ -94,6 +94,7 @@ mqttLoadRTLM(sl_config *cfg, int modtype) call.WritePUB_topic = dlsym(rtlm, "mqtt_rtlm_write_topic"); call.ReadPUB_topic = dlsym(rtlm, "mqtt_rtlm_read_topic"); call.DeletePUB_topic = dlsym(rtlm, "mqtt_rtlm_delete_topic"); + call.WipePUB_topic = dlsym(rtlm, "mqtt_rtlm_wipe_topic"); call.WritePUB_subscribe = dlsym(rtlm, "mqtt_rtlm_write_subscribe"); call.ReadPUB_subscribe = dlsym(rtlm, "mqtt_rtlm_read_subscribe"); call.DeletePUB_subscribe = dlsym(rtlm, "mqtt_rtlm_delete_subscribe"); @@ -139,14 +140,14 @@ mqttUnloadRTLM(int modtype) } inline int -mqttMkDir(sl_config *cfg) +mqttMkDir(cfg_root_t *cfg) { const char *str; if (!cfg) return -1; - str = (const char*) cfg_GetAttribute(cfg, CFG("mqttd"), CFG("statedir")); + str = (const char*) cfg_getAttribute(cfg, "mqttd", "statedir"); if (!str) return -1;