summaryrefslogtreecommitdiff
path: root/login.h
diff options
context:
space:
mode:
authorꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2020-07-11 10:29:39 +0800
committerꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2020-07-11 10:29:39 +0800
commit1a1f3c047d36dd59958d3dba6e4fa690d2178fec (patch)
treeac1081e0805baa55bf7895046f963f9508c0c3e9 /login.h
parent6ff383c3d12dc215123fb975b453ca74b1bef162 (diff)
Move newaccount, login, logout to member namespace
Diffstat (limited to 'login.h')
-rw-r--r--login.h60
1 files changed, 30 insertions, 30 deletions
diff --git a/login.h b/login.h
index 83bc162..e8ce170 100644
--- a/login.h
+++ b/login.h
@@ -1,48 +1,48 @@
#ifndef ICCLIENT_LOGIN_H
#define ICCLIENT_LOGIN_H
-#include <stdbool.h>
-#include "icclient/member.h"
#include "request.h"
+struct icclient_member;
+
inline void login(size_t (*handler)(void *, size_t, size_t, void *),
struct icclient_member *member, const char *username, const char *password,
const char *verify, const char *click, const char *successpage,
const char *nextpage, const char *failpage)
{
struct curl_httppost *post, *last = NULL;
- curl_formadd(&post, &last
- , CURLFORM_COPYNAME, "mv_username"
- , CURLFORM_PTRCONTENTS, username
- , CURLFORM_END);
- curl_formadd(&post, &last
- , CURLFORM_COPYNAME, "mv_password"
- , CURLFORM_PTRCONTENTS, password
- , CURLFORM_END);
+ curl_formadd(&post, &last,
+ CURLFORM_COPYNAME, "mv_username",
+ CURLFORM_PTRCONTENTS, username,
+ CURLFORM_END);
+ curl_formadd(&post, &last,
+ CURLFORM_COPYNAME, "mv_password",
+ CURLFORM_PTRCONTENTS, password,
+ CURLFORM_END);
if (verify)
- curl_formadd(&post, &last
- , CURLFORM_COPYNAME, "mv_verify"
- , CURLFORM_PTRCONTENTS, verify
- , CURLFORM_END);
- curl_formadd(&post, &last
- , CURLFORM_COPYNAME, "mv_click"
- , CURLFORM_PTRCONTENTS, click
- , CURLFORM_END);
+ curl_formadd(&post, &last,
+ CURLFORM_COPYNAME, "mv_verify",
+ CURLFORM_PTRCONTENTS, verify,
+ CURLFORM_END);
+ curl_formadd(&post, &last,
+ CURLFORM_COPYNAME, "mv_click",
+ CURLFORM_PTRCONTENTS, click,
+ CURLFORM_END);
if (successpage)
- curl_formadd(&post, &last
- , CURLFORM_COPYNAME, "mv_successpage"
- , CURLFORM_PTRCONTENTS, successpage
- , CURLFORM_END);
+ curl_formadd(&post, &last,
+ CURLFORM_COPYNAME, "mv_successpage",
+ CURLFORM_PTRCONTENTS, successpage,
+ CURLFORM_END);
if (nextpage)
- curl_formadd(&post, &last
- , CURLFORM_COPYNAME, "mv_nextpage"
- , CURLFORM_PTRCONTENTS, nextpage
- , CURLFORM_END);
+ curl_formadd(&post, &last,
+ CURLFORM_COPYNAME, "mv_nextpage",
+ CURLFORM_PTRCONTENTS, nextpage,
+ CURLFORM_END);
if (failpage)
- curl_formadd(&post, &last
- , CURLFORM_COPYNAME, "mv_failpage"
- , CURLFORM_PTRCONTENTS, failpage
- , CURLFORM_END);
+ curl_formadd(&post, &last,
+ CURLFORM_COPYNAME, "mv_failpage",
+ CURLFORM_PTRCONTENTS, failpage,
+ CURLFORM_END);
last = NULL;
request(handler, member, post, "%s", "process");
curl_formfree(post);