+
+int auth_set_password(const char *username, const char *password)
+
+int auth_check_password(const char *username, const char *password)
+
+char * auth_login(const char *username, const char *password)
+ INIT:
+ char *token;
+ PPCODE:
+ token = auth_login(username, password);
+ if (token != NULL) {
+ XPUSHs(sv_2mortal(newSVpv(token, TOKEN_SIZE * 2)));
+ } else {
+ XSRETURN_UNDEF;
+ }
+ free(token);
+
+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)));