From b2524868317ca0ba8521b766fbc3ab672f9ad2da Mon Sep 17 00:00:00 2001 From: Joshua Vega Date: Sun, 18 Jan 2026 12:01:47 -0500 Subject: [PATCH] [config]: flesh out config system --- config.c | 22 ++++++++++++++++++++++ config.h | 24 ++++++++++++++++++++++++ main.c | 8 ++++++++ 3 files changed, 54 insertions(+) create mode 100644 config.c create mode 100644 config.h diff --git a/config.c b/config.c new file mode 100644 index 0000000..0576d58 --- /dev/null +++ b/config.c @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2026 Joshua Vega + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ +#include "config.h" + +int getConfig(int argc, char** argv, Config* config) +{ + /* TODO */ + return 0; +} diff --git a/config.h b/config.h new file mode 100644 index 0000000..e3d54b6 --- /dev/null +++ b/config.h @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2026 Joshua Vega + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ +#ifndef CONFIG_H +#define CONFIG_H + +typedef struct { +} Config; + +int getConfig(const int, char**, Config*); + +#endif /* CONFIG_H */ diff --git a/main.c b/main.c index 2b19ec3..27f1cdd 100644 --- a/main.c +++ b/main.c @@ -13,10 +13,18 @@ * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ +#include "config.h" #include +Config globalConfig; + int main(int argc, char** argv) { + int result = getConfig(argc, argv, &globalConfig); + if (result != 0) { + return -1; + } + printf("Hello world!\n"); return 0; }