Add auth counter to perl library
[blerg.git] / lib / perl / Blerg-Database / Database.xs
index e3614db..536bbe1 100644 (file)
@@ -200,3 +200,13 @@ char * auth_login(const char *username, const char *password)
 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;
+        }