aboutsummaryrefslogtreecommitdiff
path: root/include
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
parentfcfb6ac21651e286092bcc92309e89c8fa2e87fd (diff)
ezntek: checkpoint!
Diffstat (limited to 'include')
-rw-r--r--include/files.h1
-rw-r--r--include/globs.h63
-rw-r--r--include/lua_vars.h4
-rw-r--r--include/pkg_create.h2
4 files changed, 32 insertions, 38 deletions
diff --git a/include/files.h b/include/files.h
index 9fd1a71..24712e9 100644
--- a/include/files.h
+++ b/include/files.h
@@ -21,7 +21,6 @@
#ifndef PKGIT_FILES_H
#define PKGIT_FILES_H
-#include <sys/stat.h>
#include <stdbool.h>
bool file_exists(const char *path);
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);
diff --git a/include/lua_vars.h b/include/lua_vars.h
index dfc62d0..439a335 100644
--- a/include/lua_vars.h
+++ b/include/lua_vars.h
@@ -20,8 +20,10 @@
#ifndef PKGIT_LUA_VARS_H
#define PKGIT_LUA_VARS_H
-#include <lua.h>
+
#include <lauxlib.h>
+#include <lua.h>
#include <lualib.h>
+
void init_install_directories(void);
#endif
diff --git a/include/pkg_create.h b/include/pkg_create.h
index 908b6fd..95e12c6 100644
--- a/include/pkg_create.h
+++ b/include/pkg_create.h
@@ -21,5 +21,5 @@
#ifndef PKGIT_PKG_CREATE_H
#define PKGIT_PKG_CREATE_H
#include "globs.h"
-package pkg_create(str_slc *arg);
+package_t pkg_create(str_slc arg);
#endif