#include "database/tags.h"
#include "database/subscription.h"
#include "database/util.h"
+#include "database/configuration.h"
#include "common/auth.h"
#include "const-c.inc"
INCLUDE: const-xs.inc
PROTOTYPES: ENABLE
+int init()
+ CODE:
+ RETVAL = blerg_init();
+ OUTPUT:
+ RETVAL
+
int exists(const char *name)
CODE:
RETVAL = blerg_exists(name);
n = snprintf(buf, 21, "%llu", mark);
XPUSHs(sv_2mortal(newSVpv(buf, n)));
-int _set_mute(struct blerg *ptr, int v)
+int _set_status(struct blerg *ptr, int status, int v)
CODE:
- RETVAL = blerg_set_mute(ptr, v);
+ RETVAL = blerg_set_status(ptr, status, v);
OUTPUT:
RETVAL
-int _get_mute(struct blerg *ptr)
+int _get_status(struct blerg *ptr, int status)
CODE:
- RETVAL = blerg_get_mute(ptr);
+ RETVAL = blerg_get_status(ptr, status);
OUTPUT:
RETVAL
int count, i;
PPCODE:
offset = strtoull(str_offset, NULL, 0);
+ count = 50;
list = tag_list(tag, offset, &count, direction);
if (list == NULL) {
XSRETURN_EMPTY;
int count, i;
PPCODE:
offset = strtoull(str_offset, NULL, 0);
+ count = 50;
list = subscription_list(author, offset, &count, direction);
if (list == NULL) {
XSRETURN_EMPTY;
int auth_logout(const char *username, const char *token)
int auth_check_token(const char *username, const char *given_token)
+
+void auth_get_counter(const char *username)
+ INIT:
+ uint32_t counter = 0;
+ PPCODE:
+ if (auth_get_counter(username, &counter)) {
+ XPUSHs(sv_2mortal(newSVuv(counter)));
+ } else {
+ XSRETURN_UNDEF;
+ }
+
+void configuration()
+ INIT:
+ HV *confhash;
+ PPCODE:
+ confhash = newHV();
+ hv_store(confhash, "base_path", 9, newSVpv(blergconf.base_path, 0), 0);
+ hv_store(confhash, "data_path", 9, newSVpv(blergconf.data_path, 0), 0);
+ hv_store(confhash, "hash_tags_path", 14, newSVpv(blergconf.hash_tags_path, 0), 0);
+ hv_store(confhash, "ref_tags_path", 13, newSVpv(blergconf.ref_tags_path, 0), 0);
+
+ XPUSHs(sv_2mortal(newRV_noinc((SV*)confhash)));