Annotation of mqtt/src/mqtt.c, revision 1.1.1.1.2.6
1.1 misho 1: #include "global.h"
1.1.1.1.2.5 misho 2: #include "rtlm.h"
3:
4:
5: sl_config cfg;
1.1 misho 6:
7:
8: int
9: main(int argc, char **argv)
10: {
1.1.1.1.2.6! misho 11: sqlite3 *acc = NULL, *pub = NULL;
1.1.1.1.2.5 misho 12:
13: if (LoadConfig("/etc/mqtt.conf", &cfg)) {
14: printf("Error:: Load config #%d - %s\n", cfg_GetErrno(), cfg_GetError());
15: return 1;
16: }
17: if (!mqttLoadRTLM(&cfg, 0)) {
18: printf("Error:: Can't load RTL module\n");
19: return 2;
20: }
21:
22: acc = mqttOpenDB(&cfg, 0);
23: if (!acc)
24: goto end;
1.1.1.1.2.6! misho 25: pub = mqttOpenDB(&cfg, 1);
! 26: if (!pub)
! 27: goto end;
1.1.1.1.2.5 misho 28:
1.1.1.1.2.6! misho 29: printf("success!\n");
1.1.1.1.2.5 misho 30:
31: end:
1.1.1.1.2.6! misho 32: mqttCloseDB(pub);
! 33: mqttCloseDB(acc);
1.1.1.1.2.5 misho 34: mqttUnloadRTLM(0);
35: UnloadConfig(&cfg);
1.1 misho 36: return 0;
37: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>