diff options
author | turret <turret@duck.com> | 2024-03-30 16:04:45 -0500 |
---|---|---|
committer | turret <turret@duck.com> | 2024-03-30 16:04:45 -0500 |
commit | 80a67b7d20393a29aa5d2cb92197f3381be7fd96 (patch) | |
tree | f0c313da5ef509e79e5067972edd91976513ce0e /include | |
parent | f01745a2ee84f11b8cc54e37c5f7f596184ab785 (diff) | |
download | discord-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')
-rw-r--r-- | include/config.h | 4 | ||||
-rw-r--r-- | include/dbs/api.h (renamed from include/api.h) | 9 | ||||
-rw-r--r-- | include/dbs/init.h (renamed from include/init.h) | 0 | ||||
-rw-r--r-- | include/dbs/log.h (renamed from include/log.h) | 0 | ||||
-rw-r--r-- | include/dbs/subsys.h (renamed from include/subsys.h) | 5 | ||||
-rw-r--r-- | include/dbs/util.h (renamed from include/util.h) | 0 |
6 files changed, 7 insertions, 11 deletions
diff --git a/include/config.h b/include/config.h deleted file mode 100644 index 4254edc..0000000 --- a/include/config.h +++ /dev/null @@ -1,4 +0,0 @@ -#define VERSION "0.0.1" -#define NAME_SHORTHAND "TCDBF" -#define NAME "turret.'s C Discord Bot Framework" - diff --git a/include/api.h b/include/dbs/api.h index a70d447..d421f08 100644 --- a/include/api.h +++ b/include/dbs/api.h @@ -1,6 +1,5 @@ #ifndef __API_H #define __API_H -#define _Nullable typedef enum { HTTP_GET, @@ -10,15 +9,11 @@ typedef enum { HTTP_PATCH } HTTPMethod; -#ifndef __API_INTERNAL - int http_request(HTTPMethod method, char *url, - struct curl_slist *_Nullable headers, char *writebuf, size_t bufsiz); + struct curl_slist *headers, char *writebuf, size_t bufsiz); int api_request(HTTPMethod method, char * url, - struct curl_slist *_Nullable headers, char *writebuf, size_t bufsiz); - -#endif + struct curl_slist *headers, char *writebuf, size_t bufsiz); #define http_get(...) http_request(HTTP_GET, __VA_ARGS__) #define http_post(...) http_request(HTTP_POST, __VA_ARGS__) diff --git a/include/init.h b/include/dbs/init.h index 79e60f1..79e60f1 100644 --- a/include/init.h +++ b/include/dbs/init.h diff --git a/include/log.h b/include/dbs/log.h index 30fec81..30fec81 100644 --- a/include/log.h +++ b/include/dbs/log.h diff --git a/include/subsys.h b/include/dbs/subsys.h index 1515293..1885a80 100644 --- a/include/subsys.h +++ b/include/dbs/subsys.h @@ -3,5 +3,10 @@ int __impl_start_subsystem(char *name, int (*fn)(void)); #define start_subsystem(fn) __impl_start_subsystem(#fn, fn) +#define declare_subsystem(fn) \ + void subsys_start_##fn(void) { \ + start_subsystem(fn); \ + } \ + l5_initcall(subsys_start_##fn) #endif diff --git a/include/util.h b/include/dbs/util.h index bad4a33..bad4a33 100644 --- a/include/util.h +++ b/include/dbs/util.h |