From 662c70b5b1e5c04385e7f61be82d01fdbcf13b9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Thu, 22 Sep 2022 14:15:37 +0800 Subject: Merge accesstoken.h --- accesstoken.h | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 accesstoken.h (limited to 'accesstoken.h') diff --git a/accesstoken.h b/accesstoken.h deleted file mode 100644 index 31d0d29..0000000 --- a/accesstoken.h +++ /dev/null @@ -1,27 +0,0 @@ -#include - -static inline void accesstoken_parse(const char *tok, - struct shopify_session *session) -{ - json_tokener *tokener = json_tokener_new(); - json_object *obj = json_tokener_parse_ex(tokener, tok, strlen(tok)); - struct json_object_iterator iter = json_object_iter_begin(obj); - struct json_object_iterator iter_end = json_object_iter_end(obj); - while (!json_object_iter_equal(&iter, &iter_end)) { - if (!strcmp(json_object_iter_peek_name(&iter), - "access_token")) { - const char *val = json_object_get_string( - json_object_iter_peek_value(&iter)); - session->access_token = malloc(strlen(val) + 1); - strcpy(session->access_token, val); - } else if (!strcmp(json_object_iter_peek_name(&iter), - "scope")) { - const char *val = json_object_get_string( - json_object_iter_peek_value(&iter)); - session->scopes = malloc(strlen(val) + 1); - strcpy(session->scopes, val); - } - json_object_iter_next(&iter); - } - json_tokener_free(tokener); -} -- cgit v1.2.3