Annotation of mqtt/src/mqtt.c, revision 1.1.1.1.2.7

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.7! misho      29:        if (mqttMkDir(&cfg)) {
        !            30:                printf("Error:: in statedir #%d - %s\n", errno, strerror(errno));
        !            31:                goto end;
        !            32:        }
        !            33: 
1.1.1.1.2.6  misho      34:        printf("success!\n");
1.1.1.1.2.5  misho      35: 
                     36: end:
1.1.1.1.2.6  misho      37:        mqttCloseDB(pub);
                     38:        mqttCloseDB(acc);
1.1.1.1.2.5  misho      39:        mqttUnloadRTLM(0);
                     40:        UnloadConfig(&cfg);
1.1       misho      41:        return 0;
                     42: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>