summaryrefslogtreecommitdiff
path: root/shopify.c
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2022-09-14 20:29:03 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2022-09-14 20:29:03 +0800
commit200909484e3ccb263f18a166c2c6c1de113a6a3b (patch)
tree04c10f22f5c73f3819e49f7385ceff83ba0fdf6a /shopify.c
parent306cf74eb0101a12b51549866a4d60296618ee0b (diff)
Reorder functions
Diffstat (limited to 'shopify.c')
-rw-r--r--shopify.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/shopify.c b/shopify.c
index fd1c396..6fb4037 100644
--- a/shopify.c
+++ b/shopify.c
@@ -53,6 +53,14 @@ extern inline void request_token(const char *, const char *, const char *,
extern inline void request_cleanup();
extern inline void token_parse(char *, struct session *);
+void shopify_init()
+{
+ crypt_init();
+ request_init();
+ sessions = malloc(sizeof(struct session));
+ sessions[0].shop = NULL;
+}
+
static enum MHD_Result getparam(void *cls, enum MHD_ValueKind kind,
const char *key, const char *val)
{
@@ -72,12 +80,13 @@ static enum MHD_Result getparam(void *cls, enum MHD_ValueKind kind,
return MHD_YES;
}
-void shopify_init()
+static inline void clear(struct shopify_param params[])
{
- crypt_init();
- request_init();
- sessions = malloc(sizeof(struct session));
- sessions[0].shop = NULL;
+ int i = 0;
+ while (params[i].key) {
+ free(params[i].val);
+ free(params[i++].key);
+ }
}
static int paramcmp(const void *param1, const void *param2)
@@ -92,15 +101,6 @@ static int sessioncmp(const void *session1, const void *session2)
((struct session *)session2)->shop);
}
-static inline void clear(struct shopify_param params[])
-{
- int i = 0;
- while (params[i].key) {
- free(params[i].val);
- free(params[i++].key);
- }
-}
-
bool shopify_valid(struct MHD_Connection *conn, const char *url,
const char *redir_url, const char *secret_key,
struct shopify_param *params[])