X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=lib%2Fperl%2FBlerg-Database%2FDatabase.xs;h=a3f87a52d6580cc270ad87ebdd6467e52044f938;hb=4a1ef10deb4ba66c2008a21865b9ed07a7e88def;hp=69d2442aa8f0896dc34b77273015bb2f374d7849;hpb=0633c5ed9ca5302ba9ff0eb9050bc23f1173e38a;p=blerg.git diff --git a/lib/perl/Blerg-Database/Database.xs b/lib/perl/Blerg-Database/Database.xs index 69d2442..a3f87a5 100644 --- a/lib/perl/Blerg-Database/Database.xs +++ b/lib/perl/Blerg-Database/Database.xs @@ -10,6 +10,7 @@ #include "database/tags.h" #include "database/subscription.h" #include "database/util.h" +#include "common/auth.h" #include "const-c.inc" @@ -144,16 +145,8 @@ void tag_list(const char *tag, const char *str_offset, int direction) free(list); int subscription_add(const char *from, const char *to) - CODE: - RETVAL = subscription_add(from, to); - OUTPUT: - RETVAL int subscription_remove(const char *from, const char *to) - CODE: - RETVAL = subscription_remove(from, to); - OUTPUT: - RETVAL void _subscription_list(const char *author, const char *str_offset, int direction) INIT: @@ -179,3 +172,23 @@ void _subscription_list(const char *author, const char *str_offset, int directio int valid_tag_name(const char *name) int valid_name(const char *name) + +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)