diff options
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | admin.c | 14 | ||||
-rw-r--r-- | icclient/admin.h | 17 | ||||
-rw-r--r-- | main.c | 5 |
4 files changed, 36 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am index 54d9c15..e603edd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,9 +2,11 @@ noinst_LIBRARIES = libicclient.a libicclient_a_SOURCES = \ icclient/request.h \ icclient/login.h \ + icclient/admin.h \ icclient/client.h \ request.c \ login.c \ + admin.c \ client.c bin_PROGRAMS = icclienttest @@ -0,0 +1,14 @@ +#include "login.h" +#include "icclient/admin.h" + +void icclient_admin_login(const char *username, const char *password + , const char *successpage, const char *nextpage + , const char *failpage) +{ + login(username, password, NULL, "MMLogin", successpage, nextpage, failpage); +} + +void icclient_admin_logout() +{ + request(NULL, NULL, NULL, "%s", "admin/login"); +} diff --git a/icclient/admin.h b/icclient/admin.h new file mode 100644 index 0000000..e01fdc9 --- /dev/null +++ b/icclient/admin.h @@ -0,0 +1,17 @@ +#ifndef ICCLIENT_ADMIN_H +#define ICCLIENT_ADMIN_H + +#ifdef __cplusplus +extern "C" { +#endif + + void icclient_admin_login(const char *username, const char *password + , const char *successpage, const char *nextpage + , const char *failpage); + void icclient_admin_logout(); + +#ifdef __cplusplus +} +#endif + +#endif // ICCLIENT_ADMIN_H @@ -2,6 +2,7 @@ #include <stdlib.h> #include <string.h> #include <stdbool.h> +#include <icclient/admin.h> #include <icclient/client.h> int main(void) @@ -26,10 +27,10 @@ int main(void) icclient_init(url); free(url); - icclient_login(name, pass, NULL, NULL, NULL); + icclient_admin_login(name, pass, NULL, NULL, NULL); free(name); free(pass); - icclient_logout(); + icclient_admin_logout(); icclient_cleanup(); } |