Return the status of token removal in auth_logout
[blerg.git] / tools / blergtool.c
index 35af915..c689d2f 100644 (file)
@@ -3,7 +3,9 @@
  */
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include "database.h"
+#include "subscription.h"
 #include "tags.h"
 
 void help() {
@@ -27,6 +29,10 @@ int main(int argc, char *argv[]) {
                exit(1);
        }
 
+       if (!blerg_init()) {
+               exit(2);
+       }
+
        if (strncmp(argv[1], "store", 5) == 0) {
                char *store = argv[2];
                struct blerg *f = blerg_open(store);
@@ -75,7 +81,7 @@ int main(int argc, char *argv[]) {
                } else {
                        int i;
                        for (i = 0; i < count; i++) {
-                               printf("%s %d\n", list[i].author, list[i].record);
+                               printf("%s %llu\n", list[i].author, list[i].record);
                        }
                        free(list);
                }
@@ -87,7 +93,7 @@ int main(int argc, char *argv[]) {
                        exit(1);
                }
 
-               blerg_set_mute(f, 1);
+               blerg_set_status(f, BLERGSTATUS_MUTED, 1);
                blerg_close(f);
        } else if (strncmp(argv[1], "unmute", 6) == 0) {
                char *store = argv[2];
@@ -97,7 +103,7 @@ int main(int argc, char *argv[]) {
                        exit(1);
                }
 
-               blerg_set_mute(f, 0);
+               blerg_set_status(f, BLERGSTATUS_MUTED, 0);
                blerg_close(f);
        } else if (strncmp(argv[1], "subscribe", 9) == 0) {
                if (argc < 4) {