aboutsummaryrefslogtreecommitdiffstats
path: root/include/api.h
diff options
context:
space:
mode:
authorturret <turret@duck.com>2024-03-30 16:04:45 -0500
committerturret <turret@duck.com>2024-03-30 16:04:45 -0500
commit80a67b7d20393a29aa5d2cb92197f3381be7fd96 (patch)
treef0c313da5ef509e79e5067972edd91976513ce0e /include/api.h
parentf01745a2ee84f11b8cc54e37c5f7f596184ab785 (diff)
downloaddiscord-bot-skeleton-80a67b7d20393a29aa5d2cb92197f3381be7fd96.tar.gz
discord-bot-skeleton-80a67b7d20393a29aa5d2cb92197f3381be7fd96.tar.bz2
discord-bot-skeleton-80a67b7d20393a29aa5d2cb92197f3381be7fd96.zip
*: directory changes
since this project is a skeleton and not meant to clutter up the code that will actually consume the bot, i've opted to consolidate the majority of files under a single directory and minimise extra files *: move code to util/ *: move include files to include/dbs/ net: consolidate net functions into single file config: remove config
Diffstat (limited to 'include/api.h')
-rw-r--r--include/api.h35
1 files changed, 0 insertions, 35 deletions
diff --git a/include/api.h b/include/api.h
deleted file mode 100644
index a70d447..0000000
--- a/include/api.h
+++ /dev/null
@@ -1,35 +0,0 @@
-#ifndef __API_H
-#define __API_H
-#define _Nullable
-
-typedef enum {
- HTTP_GET,
- HTTP_POST,
- HTTP_PUT,
- HTTP_DELETE,
- HTTP_PATCH
-} HTTPMethod;
-
-#ifndef __API_INTERNAL
-
-int http_request(HTTPMethod method, char *url,
- struct curl_slist *_Nullable headers, char *writebuf, size_t bufsiz);
-
-int api_request(HTTPMethod method, char * url,
- struct curl_slist *_Nullable headers, char *writebuf, size_t bufsiz);
-
-#endif
-
-#define http_get(...) http_request(HTTP_GET, __VA_ARGS__)
-#define http_post(...) http_request(HTTP_POST, __VA_ARGS__)
-#define http_put(...) http_request(HTTP_PUT, __VA_ARGS__)
-#define http_delete(...) http_request(HTTP_DELETE, __VA_ARGS__)
-#define http_patch(...) http_request(HTTP_PATCH, __VA_ARGS__)
-
-#define api_get(...) api_request(HTTP_GET, __VA_ARGS__)
-#define api_post(...) api_request(HTTP_POST, __VA_ARGS__)
-#define api_put(...) api_request(HTTP_PUT, __VA_ARGS__)
-#define api_delete(...) api_request(HTTP_DELETE, __VA_ARGS__)
-#define api_patch(...) api_request(HTTP_PATCH, __VA_ARGS__)
-
-#endif