summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am2
-rw-r--r--admin.c6
-rw-r--r--icclient/admin.h5
-rw-r--r--icclient/member.h10
-rw-r--r--login.c3
-rw-r--r--login.h7
-rw-r--r--main.c2
-rw-r--r--member.c12
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)
diff --git a/admin.c b/admin.c
index a334f3b..b06a751 100644
--- a/admin.c
+++ b/admin.c
@@ -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,
diff --git a/login.c b/login.c
index 5e97f4f..de81b02 100644
--- a/login.c
+++ b/login.c
@@ -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 *);
diff --git a/login.h b/login.h
index e49643d..2ea4e17 100644
--- a/login.h
+++ b/login.h
@@ -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");
}
diff --git a/main.c b/main.c
index 3fef9ea..ef16563 100644
--- a/main.c
+++ b/main.c
@@ -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();
diff --git a/member.c b/member.c
index c5b5e42..66ceb22 100644
--- a/member.c
+++ b/member.c
@@ -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;
}