diff options
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | admin.c | 6 | ||||
-rw-r--r-- | icclient/admin.h | 5 | ||||
-rw-r--r-- | icclient/member.h | 10 | ||||
-rw-r--r-- | login.c | 3 | ||||
-rw-r--r-- | login.h | 7 | ||||
-rw-r--r-- | main.c | 2 | ||||
-rw-r--r-- | member.c | 12 |
8 files changed, 17 insertions, 30 deletions
diff --git a/Makefile.am b/Makefile.am index bb373d6..451b72d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -26,6 +26,6 @@ pkginclude_HEADERS = \ icclient/member.h \ icclient/admin.h #bin_PROGRAMS = icclient -#icclient_SOURCES = main.c client.c request.c handler.c login.c member.c +#icclient_SOURCES = main.c client.c request.c handler.c login.c member.c admin.c #icclient_CPPFLAGS = $(TIDY_CFLAGS) #icclient_LDFLAGS = -lcurl $(TIDY_LIBS) @@ -5,15 +5,13 @@ typedef struct icclient_admin icclient_admin; -icclient_admin *icclient_admin_login(const char *username, const char *password, - const char *successpage, const char *nextpage, const char *failpage, - void (*handler)(icclient_fetch_t *)) +icclient_admin *icclient_admin_login(const char *username, const char *password, void (*handler)(icclient_fetch_t *)) { icclient_admin *admin = malloc(sizeof(icclient_admin)); admin->name = NULL; admin->username = NULL; admin->super = false; - login(username, password, NULL, "MMLogin", successpage, nextpage, failpage, handler, admin); + login(username, password, NULL, "MMLogin", handler, admin); return admin; } diff --git a/icclient/admin.h b/icclient/admin.h index b7089a9..9756f40 100644 --- a/icclient/admin.h +++ b/icclient/admin.h @@ -19,10 +19,7 @@ struct icclient_admin { extern "C" { #endif - struct icclient_admin *icclient_admin_login(const char *username, - const char *password, const char *successpage, - const char *nextpage, const char *failpage, - void (*handler)(icclient_fetch_t *)); + struct icclient_admin *icclient_admin_login(const char *username, const char *password, void (*handler)(icclient_fetch_t *)); void icclient_admin_new_admin(const char *username, const char *password, const char *name, bool super, enum icclient_admin_group group, void (*handler)(icclient_fetch_t *)); void icclient_admin_new_item(const char *description, const char *comment, const char *price, const char *image_path, diff --git a/icclient/member.h b/icclient/member.h index feee6c3..3c6a41d 100644 --- a/icclient/member.h +++ b/icclient/member.h @@ -60,12 +60,10 @@ struct icclient_member { extern "C" { #endif - struct icclient_member *icclient_member_newaccount(const char *username, - const char *password, const char *verify, const char *successpage, - const char *nextpage, const char *failpage, void (*handler)(icclient_fetch_t *)); - struct icclient_member *icclient_member_login(const char *username, - const char *password, const char *successpage, - const char *nextpage, const char *failpage, void (*handler)(icclient_fetch_t *)); + struct icclient_member *icclient_member_newaccount(const char *username, const char *password, const char *verify, + void (*handler)(icclient_fetch_t *)); + struct icclient_member *icclient_member_login(const char *username, const char *password, + void (*handler)(icclient_fetch_t *)); void icclient_member_account(const char *fname, const char *lname, const char *address1, const char *address2, const char *city, const char *state, const char *zip, const char *email, @@ -1,4 +1,3 @@ #include "login.h" -extern inline void login(const char *, const char *, const char *, const char *, - const char *, const char *, const char *, void (*)(icclient_fetch_t *), void *); +extern inline void login(const char *, const char *, const char *, const char *, void (*)(icclient_fetch_t *), void *); @@ -4,16 +4,13 @@ #include "request.h" static inline void login(const char *username, const char *password, const char *verify, const char *click, - const char *successpage, const char *nextpage, const char *failpage, void (*handler)(icclient_fetch_t *), void *user) + void (*handler)(icclient_fetch_t *), void *user) { - request(handler, user, &(struct body){ 7, { + request(handler, user, &(struct body){ 4, { { "mv_username", username }, { "mv_password", password }, { "mv_verify", verify }, { "mv_click", click }, - { "mv_successpage", successpage }, - { "mv_nextpage", nextpage }, - { "mv_failpage", failpage } }}, "%s", "process"); } @@ -38,7 +38,7 @@ int main(int argc, char *argv[]) struct icclient_member *member = icclient_member_login("kirk@icdevgroup.net", "kirk", NULL, NULL, NULL, print); icclient_member_logout(member); */ - struct icclient_admin *admin = icclient_admin_login("interch", "pass", NULL, NULL, NULL, NULL); + struct icclient_admin *admin = icclient_admin_login("interch", "pass", NULL); icclient_admin_new_admin("Hardware", "pass", "Hardware stuff", 0, ICCLIENT_ADMIN_GROUP_MERCH, NULL); icclient_admin_logout(admin, NULL); icclient_cleanup(); @@ -58,20 +58,18 @@ icclient_member *initialise(const char *username, const char *password) return member; } -icclient_member *icclient_member_newaccount(const char *username, const char *password, - const char *verify, const char *successpage, const char *nextpage, - const char *failpage, void (*handler)(icclient_fetch_t *)) +icclient_member *icclient_member_newaccount(const char *username, const char *password, const char *verify, + void (*handler)(icclient_fetch_t *)) { icclient_member *member = initialise(username, password); - login(username, password, verify, "NewAccount", successpage, nextpage, failpage, handler, member); + login(username, password, verify, "NewAccount", handler, member); return member; } -icclient_member *icclient_member_login(const char *username, const char *password, - const char *successpage, const char *nextpage, const char *failpage, void (*handler)(icclient_fetch_t *)) +icclient_member *icclient_member_login(const char *username, const char *password, void (*handler)(icclient_fetch_t *)) { icclient_member *member = initialise(username, password); - login(username, password, NULL, "Login", successpage, nextpage, failpage, handler, member); + login(username, password, NULL, "Login", handler, member); return member; } |