aboutsummaryrefslogtreecommitdiff
path: root/include/globs.h
diff options
context:
space:
mode:
authordacctal <donotcontactmevia@email.invalid>2026-07-01 07:50:01 +0000
committerdacctal <donotcontactmevia@email.invalid>2026-07-01 07:50:01 +0000
commit166b788d61a443a1576f8b56abdf06fea5a2178e (patch)
treee6f4760d01f83d0865fecdd097fca51e521a1376 /include/globs.h
parentfcfb6ac21651e286092bcc92309e89c8fa2e87fd (diff)
ezntek: checkpoint!
Diffstat (limited to 'include/globs.h')
-rw-r--r--include/globs.h63
1 files changed, 28 insertions, 35 deletions
diff --git a/include/globs.h b/include/globs.h
index f44ab85..4611216 100644
--- a/include/globs.h
+++ b/include/globs.h
@@ -21,6 +21,9 @@
#ifndef PKGIT_GLOBALS_H
#define PKGIT_GLOBALS_H
+#include "str.h"
+#include <stdint.h>
+
#define VERSION "1.4.0_INDEV"
#define RED "\x1b[0;31m"
#define GREEN "\x1b[0;32m"
@@ -90,48 +93,38 @@
#endif
#define unreachable panic("reached unreachable code")
-#define PRINT_PKGIT \
- BOLD_YELLOW "[" BOLD_MAGENTA "pkgit" BOLD_YELLOW "]" COLOR_RESET
-#define PRINT_SUCCESS PRINT_PKGIT GREEN " [SUCCESS]" COLOR_RESET
-#define PRINT_SKIPPED PRINT_PKGIT BLUE " [SKIPPED]" COLOR_RESET
-#define PRINT_WARNING PRINT_PKGIT YELLOW " [WARNING]" COLOR_RESET
-#define PRINT_ERROR PRINT_PKGIT RED " [ERROR]" COLOR_RESET
+#define PKGIT_PREFIX \
+ BOLD_YELLOW "[" BOLD_MAGENTA "pkgit" BOLD_YELLOW "] " COLOR_RESET
+#define PKGIT_PREFIX_SUCCESS PKGIT_PREFIX GREEN "[SUCCESS] " COLOR_RESET
+#define PKGIT_PREFIX_INFO PKGIT_PREFIX BLUE "[INFO] " COLOR_RESET
+#define PKGIT_PREFIX_WARNING PKGIT_PREFIX YELLOW "[WARNING] " COLOR_RESET
+#define PKGIT_PREFIX_ERROR PKGIT_PREFIX RED "[ERROR] " COLOR_RESET
#define MAX_REPOS 1000
#define MAX_DIRS 100
#define MAX_PATH_LEN 1024
-#include "str.h"
+typedef struct {
+ str name, url, version, target, src;
+ bool is_local;
+} package_t;
typedef struct {
- str name;
- str url;
- str version;
- str target;
- str src;
- int is_local;
-} package;
-
-extern int is_verbose;
-extern int is_forced;
-extern int config_exists;
-
-extern str home_config_dir;
-extern str home_config_file;
-extern str home_repos_file;
-extern str root_config_dir;
-extern str root_config_file;
-extern str root_repos_file;
-extern int is_root_config;
-
-extern str config_dir;
-extern str config_file;
-extern str repos_file;
-
-extern str bin;
-extern str lib;
-extern str include;
-extern str src;
+ bool verbose, force;
+} cli_flags_t;
+
+typedef struct {
+ str dir, name, content, repos;
+ bool is_root_config;
+} config_t;
+
+typedef struct {
+ str prefix, bin, lib, include, src;
+} install_dirs_t;
+
+extern cli_flags_t flags;
+extern config_t cfg;
+extern install_dirs_t inst_dirs;
void init_vars(void);
void free_vars(void);