aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/add_repo.h26
-rw-r--r--include/banned.h47
-rw-r--r--include/build.h28
-rw-r--r--include/cla_parse.h26
-rw-r--r--include/cmd_out.h26
-rw-r--r--include/copy_install.h26
-rw-r--r--include/create_pkg.h28
-rw-r--r--include/declare.h24
-rw-r--r--include/fetch_git.h28
-rw-r--r--include/fetch_pwd.h28
-rw-r--r--include/fetch_src.h28
-rw-r--r--include/files.h25
-rw-r--r--include/help.h26
-rw-r--r--include/install_pkg.h28
-rw-r--r--include/is_updated.h27
-rw-r--r--include/link_install.h26
-rw-r--r--include/list_pkgs.h26
-rw-r--r--include/lua_build.h26
-rw-r--r--include/lua_state.h60
-rw-r--r--include/name_from_url.h26
-rw-r--r--include/pkgit_string.h27
-rw-r--r--include/remove_pkg.h28
-rw-r--r--include/resolve_deps.h24
-rw-r--r--include/search.h24
-rw-r--r--include/set_install_directories.h26
-rw-r--r--include/setup_dirs.h26
-rw-r--r--include/setup_pkgit.h26
-rw-r--r--include/update_all.h26
-rw-r--r--include/update_pkg.h28
-rw-r--r--include/vars.h146
30 files changed, 27 insertions, 939 deletions
diff --git a/include/add_repo.h b/include/add_repo.h
deleted file mode 100644
index 5b32bd7..0000000
--- a/include/add_repo.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
-
- pkgit - package it!
-
- Copyright (C) 2026 dacctal
- 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 2 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 <https://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef ADD_REPO_H
-#define ADD_REPO_H
-
-void add_repo(const char *repo, const char *repo_name);
-
-#endif \ No newline at end of file
diff --git a/include/banned.h b/include/banned.h
deleted file mode 100644
index 2b934c8..0000000
--- a/include/banned.h
+++ /dev/null
@@ -1,47 +0,0 @@
-#ifndef BANNED_H
-#define BANNED_H
-
-/*
- * This header lists functions that have been banned from our code base,
- * because they're too easy to misuse (and even if used correctly,
- * complicate audits). Including this header turns them into compile-time
- * errors.
- */
-
-#define BANNED(func) sorry_##func##_is_a_banned_function
-
-#undef strcpy
-#define strcpy(x,y) BANNED(strcpy)
-#undef strcat
-#define strcat(x,y) BANNED(strcat)
-#undef strncpy
-#define strncpy(x,y,n) BANNED(strncpy)
-#undef strncat
-#define strncat(x,y,n) BANNED(strncat)
-#undef strtok
-#define strtok(x,y) BANNED(strtok)
-#undef strtok_r
-#define strtok_r(x,y,z) BANNED(strtok_r)
-
-#undef sprintf
-#undef vsprintf
-#define sprintf(...) BANNED(sprintf)
-#define vsprintf(...) BANNED(vsprintf)
-
-#undef gmtime
-#define gmtime(t) BANNED(gmtime)
-#undef localtime
-#define localtime(t) BANNED(localtime)
-#undef ctime
-#define ctime(t) BANNED(ctime)
-#undef ctime_r
-#define ctime_r(t, buf) BANNED(ctime_r)
-#undef asctime
-#define asctime(t) BANNED(asctime)
-#undef asctime_r
-#define asctime_r(t, buf) BANNED(asctime_r)
-
-#undef mktemp
-#define mktemp(x) BANNED(mktemp)
-
-#endif /* BANNED_H */
diff --git a/include/build.h b/include/build.h
deleted file mode 100644
index 18c08fd..0000000
--- a/include/build.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-
- pkgit - package it!
-
- Copyright (C) 2026 dacctal
- 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 2 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 <https://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef BUILD_H
-#define BUILD_H
-
-#include "vars.h"
-
-void build(Pkg pkg);
-
-#endif \ No newline at end of file
diff --git a/include/cla_parse.h b/include/cla_parse.h
deleted file mode 100644
index 19ae172..0000000
--- a/include/cla_parse.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
-
- pkgit - package it!
-
- Copyright (C) 2026 dacctal
- 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 2 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 <https://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef CLA_PARSE_H
-#define CLA_PARSE_H
-
-void cla_parse(int argc, char **argv);
-
-#endif \ No newline at end of file
diff --git a/include/cmd_out.h b/include/cmd_out.h
deleted file mode 100644
index 1b5a35a..0000000
--- a/include/cmd_out.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
-
- pkgit - package it!
-
- Copyright (C) 2026 dacctal
- 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 2 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 <https://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef CMD_OUT_H
-#define CMD_OUT_H
-
-char* cmd_out(const char *cmd);
-
-#endif \ No newline at end of file
diff --git a/include/copy_install.h b/include/copy_install.h
deleted file mode 100644
index 18ff679..0000000
--- a/include/copy_install.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
-
- pkgit - package it!
-
- Copyright (C) 2026 dacctal
- 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 2 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 <https://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef COPY_INSTALL_H
-#define COPY_INSTALL_H
-
-void copy_install(const char *build_dir);
-
-#endif \ No newline at end of file
diff --git a/include/create_pkg.h b/include/create_pkg.h
deleted file mode 100644
index 0bad45d..0000000
--- a/include/create_pkg.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-
- pkgit - package it!
-
- Copyright (C) 2026 dacctal
- 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 2 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 <https://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef CREATE_PKG_H
-#define CREATE_PKG_H
-
-#include "vars.h"
-
-Pkg create_pkg(const char *arg);
-
-#endif \ No newline at end of file
diff --git a/include/declare.h b/include/declare.h
deleted file mode 100644
index 7a3fd41..0000000
--- a/include/declare.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
-
- pkgit - package it!
-
- Copyright (C) 2026 dacctal
- 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 2 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 <https://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef DECLARE
-#define DECLARE
-void declare(void);
-#endif
diff --git a/include/fetch_git.h b/include/fetch_git.h
deleted file mode 100644
index b27661e..0000000
--- a/include/fetch_git.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-
- pkgit - package it!
-
- Copyright (C) 2026 dacctal
- 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 2 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 <https://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef FETCH_GIT_H
-#define FETCH_GIT_H
-
-#include "vars.h"
-
-int fetch_git(Pkg pkg);
-
-#endif \ No newline at end of file
diff --git a/include/fetch_pwd.h b/include/fetch_pwd.h
deleted file mode 100644
index e64689b..0000000
--- a/include/fetch_pwd.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-
- pkgit - package it!
-
- Copyright (C) 2026 dacctal
- 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 2 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 <https://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef FETCH_PWD_H
-#define FETCH_PWD_H
-
-#include "vars.h"
-
-void fetch_pwd(Pkg pkg);
-
-#endif \ No newline at end of file
diff --git a/include/fetch_src.h b/include/fetch_src.h
deleted file mode 100644
index fd647d5..0000000
--- a/include/fetch_src.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-
- pkgit - package it!
-
- Copyright (C) 2026 dacctal
- 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 2 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 <https://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef FETCH_SRC_H
-#define FETCH_SRC_H
-
-#include "vars.h"
-
-void fetch_src(Pkg pkg);
-
-#endif \ No newline at end of file
diff --git a/include/files.h b/include/files.h
deleted file mode 100644
index cc72ace..0000000
--- a/include/files.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
-
- pkgit - package it!
-
- Copyright (C) 2026 dacctal
- 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 2 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 <https://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef FILES
-#define FILES
-const char *get_filename_ext(const char *filename);
-void cpdir(const char *path, const char *dest);
-#endif
diff --git a/include/help.h b/include/help.h
deleted file mode 100644
index c194be4..0000000
--- a/include/help.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
-
- pkgit - package it!
-
- Copyright (C) 2026 dacctal
- 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 2 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 <https://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef HELP_H
-#define HELP_H
-
-void help(void);
-
-#endif \ No newline at end of file
diff --git a/include/install_pkg.h b/include/install_pkg.h
deleted file mode 100644
index c35d8e3..0000000
--- a/include/install_pkg.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-
- pkgit - package it!
-
- Copyright (C) 2026 dacctal
- 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 2 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 <https://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef INSTALL_PKG_H
-#define INSTALL_PKG_H
-
-#include "vars.h"
-
-void install_pkg(Pkg pkg);
-
-#endif \ No newline at end of file
diff --git a/include/is_updated.h b/include/is_updated.h
deleted file mode 100644
index 769cc61..0000000
--- a/include/is_updated.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-
- pkgit - package it!
-
- Copyright (C) 2026 dacctal
- 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 2 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 <https://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef IS_UPDATED_H
-#define IS_UPDATED_H
-
-bool is_updated(const char *src);
-bool is_bldit_usable(void);
-
-#endif \ No newline at end of file
diff --git a/include/link_install.h b/include/link_install.h
deleted file mode 100644
index 084559b..0000000
--- a/include/link_install.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
-
- pkgit - package it!
-
- Copyright (C) 2026 dacctal
- 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 2 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 <https://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef LINK_INSTALL_H
-#define LINK_INSTALL_H
-
-void link_install(const char *build_dir);
-
-#endif \ No newline at end of file
diff --git a/include/list_pkgs.h b/include/list_pkgs.h
deleted file mode 100644
index 3ae6900..0000000
--- a/include/list_pkgs.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
-
- pkgit - package it!
-
- Copyright (C) 2026 dacctal
- 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 2 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 <https://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef LIST_PKGS_H
-#define LIST_PKGS_H
-
-void list_pkgs(void);
-
-#endif \ No newline at end of file
diff --git a/include/lua_build.h b/include/lua_build.h
deleted file mode 100644
index 70c2e8b..0000000
--- a/include/lua_build.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
-
- pkgit - package it!
-
- Copyright (C) 2026 dacctal
- 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 2 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 <https://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef LUA_BUILD_H
-#define LUA_BUILD_H
-
-bool lua_build(const char *repository, const char *target, const char *path);
-
-#endif \ No newline at end of file
diff --git a/include/lua_state.h b/include/lua_state.h
deleted file mode 100644
index d8457ad..0000000
--- a/include/lua_state.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
-
- pkgit - package it!
-
- Copyright (C) 2026 dacctal
- 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 2 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 <https://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef LUA_STATE_H
-#define LUA_STATE_H
-
-#include <lua.h>
-#include <lauxlib.h>
-#include <lualib.h>
-
-#include "vars.h"
-
-extern Map cached_install_directories;
-extern Repo cached_repos[MAX_REPOS];
-extern size_t cached_repos_count;
-extern Map cached_build_systems;
-
-void push_lua_path(lua_State *L, const char *new_path);
-void init_lua_state(void);
-void free_lua_state(void);
-lua_State* get_lua_state(void);
-const char* get_privilege_escalator(void);
-
-void cache_repos(void);
-void cache_build_systems(void);
-void cache_install_directories(void);
-void cache_prefix_directory(void);
-bool on_update(lua_State *L);
-bool target_loop_on_update(lua_State *L, const char* lua_file, const char *target);
-bool repo_build(const char *repository, const char *target);
-bool repo_install(const char *repository, const char *target);
-bool repo_uninstall(const char *repository, const char *target);
-bool bldit(const char *target);
-bool bldit_install(const char *target);
-bool bldit_uninstall(const char *target);
-bool config_build(const char *path, const char *target);
-bool config_install(const char *path, const char *target);
-bool config_uninstall(const char *path, const char *target);
-
-char* bldit_getver(void);
-char* bldit_pkg_getver(void);
-
-#endif \ No newline at end of file
diff --git a/include/name_from_url.h b/include/name_from_url.h
deleted file mode 100644
index ab2761b..0000000
--- a/include/name_from_url.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
-
- pkgit - package it!
-
- Copyright (C) 2026 dacctal
- 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 2 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 <https://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef NAME_FROM_URL_H
-#define NAME_FROM_URL_H
-
-char* name_from_url(const char *url);
-
-#endif \ No newline at end of file
diff --git a/include/pkgit_string.h b/include/pkgit_string.h
new file mode 100644
index 0000000..ae6098c
--- /dev/null
+++ b/include/pkgit_string.h
@@ -0,0 +1,27 @@
+#ifndef PKGIT_STRING_H
+#define PKGIT_STRING_H
+#include <stddef.h>
+
+typedef struct {
+ char* data;
+ size_t len;
+} str_s;
+
+typedef struct {
+ char* data;
+ size_t cap;
+ size_t len;
+} str;
+
+#define format_string(s) (int)((s).len), (s).data
+// Usage: printf("%.*s", format_string(ss));
+
+void print_slice(str_s s);
+str_s slice_from_cstr(char* cstr);
+int slice_eq(str_s a, str_s b);
+int slice_starts_with(str_s slice, str_s prefix);
+str_s slice_take(str_s slice, size_t n);
+str_s slice_drop(str_s slice, size_t n);
+str_s slice_trim(str_s slice);
+
+#endif
diff --git a/include/remove_pkg.h b/include/remove_pkg.h
deleted file mode 100644
index 4ac5ca0..0000000
--- a/include/remove_pkg.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-
- pkgit - package it!
-
- Copyright (C) 2026 dacctal
- 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 2 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 <https://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef REMOVE_PKG_H
-#define REMOVE_PKG_H
-
-#include "vars.h"
-
-void remove_pkg(Pkg pkg);
-
-#endif \ No newline at end of file
diff --git a/include/resolve_deps.h b/include/resolve_deps.h
deleted file mode 100644
index 1e0b8ee..0000000
--- a/include/resolve_deps.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
-
- pkgit - package it!
-
- Copyright (C) 2026 dacctal
- 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 2 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 <https://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef RESOLVE_DEPS_H
-#define RESOLVE_DEPS_H
-void resolve_deps(void);
-#endif
diff --git a/include/search.h b/include/search.h
deleted file mode 100644
index a316a71..0000000
--- a/include/search.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
-
- pkgit - package it!
-
- Copyright (C) 2026 dacctal
- 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 2 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 <https://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef FIND
-#define FIND
-void search(const char* arg);
-#endif
diff --git a/include/set_install_directories.h b/include/set_install_directories.h
deleted file mode 100644
index 22886e1..0000000
--- a/include/set_install_directories.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
-
- pkgit - package it!
-
- Copyright (C) 2026 dacctal
- 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 2 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 <https://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef SET_INSTALL_DIRECTORIES_H
-#define SET_INSTALL_DIRECTORIES_H
-
-void set_install_directories(void);
-
-#endif \ No newline at end of file
diff --git a/include/setup_dirs.h b/include/setup_dirs.h
deleted file mode 100644
index 4490948..0000000
--- a/include/setup_dirs.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
-
- pkgit - package it!
-
- Copyright (C) 2026 dacctal
- 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 2 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 <https://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef SETUP_DIRS_H
-#define SETUP_DIRS_H
-
-void setup_dirs(void);
-
-#endif \ No newline at end of file
diff --git a/include/setup_pkgit.h b/include/setup_pkgit.h
deleted file mode 100644
index 9554969..0000000
--- a/include/setup_pkgit.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
-
- pkgit - package it!
-
- Copyright (C) 2026 dacctal
- 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 2 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 <https://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef SETUP_PKGIT_H
-#define SETUP_PKGIT_H
-
-void setup_pkgit(void);
-
-#endif \ No newline at end of file
diff --git a/include/update_all.h b/include/update_all.h
deleted file mode 100644
index 022c92b..0000000
--- a/include/update_all.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
-
- pkgit - package it!
-
- Copyright (C) 2026 dacctal
- 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 2 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 <https://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef UPDATE_ALL_H
-#define UPDATE_ALL_H
-
-void update_all(void);
-
-#endif \ No newline at end of file
diff --git a/include/update_pkg.h b/include/update_pkg.h
deleted file mode 100644
index 8d3a993..0000000
--- a/include/update_pkg.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-
- pkgit - package it!
-
- Copyright (C) 2026 dacctal
- 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 2 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 <https://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef UPDATE_PKG_H
-#define UPDATE_PKG_H
-
-#include "vars.h"
-
-void update_pkg(Pkg pkg);
-
-#endif \ No newline at end of file
diff --git a/include/vars.h b/include/vars.h
deleted file mode 100644
index c76b742..0000000
--- a/include/vars.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
-
- pkgit - package it!
-
- Copyright (C) 2026 dacctal
- 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 2 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 <https://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef VARS_H
-#define VARS_H
-
-#include <stdbool.h>
-#include <stddef.h>
-#include "banned.h"
-
-#define MAX_REPOS 1000
-#define MAX_DIRS 100
-#define MAX_PATH_LEN 1024
-
-typedef struct {
- char *key;
- char *value;
-} KeyValue;
-
-typedef struct {
- char *key;
- char *value;
-} MapItem;
-
-typedef struct {
- MapItem *items;
- size_t size;
- size_t capacity;
-} Map;
-
-typedef struct {
- char *url;
- char *version;
-} Dependency;
-
-typedef struct {
- char *source_key;
- char *source_value;
- char *version;
- Dependency *dependencies;
- size_t dep_count;
- int build_ref;
- int pre_install_ref;
- int install_ref;
- int post_install_ref;
-} Repo;
-
-typedef struct {
- char *url;
- char *name;
- const char *target;
- char *ver;
- char src[MAX_PATH_LEN];
- bool is_local;
-} Pkg;
-
-extern bool is_symlink_install;
-extern bool is_verbose;
-extern bool is_auto_installed;
-extern bool is_forced;
-extern bool config_exists;
-
-extern char home_dir[MAX_PATH_LEN];
-extern char prefix_dir[MAX_PATH_LEN];
-
-extern char root_config[MAX_PATH_LEN];
-extern bool is_root_config;
-extern char config_dir[MAX_PATH_LEN];
-extern char config_file[MAX_PATH_LEN];
-extern char repo_file[MAX_PATH_LEN];
-
-extern char bin[MAX_PATH_LEN];
-extern char lib[MAX_PATH_LEN];
-extern char inc[MAX_PATH_LEN];
-extern char src[MAX_PATH_LEN];
-
-extern char *install_directories[5];
-
-extern const char *version;
-
-extern const char *red;
-extern const char *green;
-extern const char *yellow;
-extern const char *blue;
-extern const char *magenta;
-extern const char *cyan;
-extern const char *gray;
-extern const char *bright_red;
-extern const char *bright_green;
-extern const char *bright_yellow;
-extern const char *bright_blue;
-extern const char *bright_magenta;
-extern const char *bright_cyan;
-extern const char *bright_gray;
-extern const char *bold_red;
-extern const char *bold_green;
-extern const char *bold_yellow;
-extern const char *bold_blue;
-extern const char *bold_magenta;
-extern const char *bold_cyan;
-extern const char *bold_gray;
-extern const char *bold_white;
-extern const char *bold_bright_red;
-extern const char *bold_bright_green;
-extern const char *bold_bright_yellow;
-extern const char *bold_bright_blue;
-extern const char *bold_bright_magenta;
-extern const char *bold_bright_cyan;
-extern const char *bold_bright_gray;
-extern const char *italic;
-extern const char *color_reset;
-
-extern const char *print_pkgit;
-extern const char *print_success;
-extern const char *print_skipped;
-extern const char *print_warning;
-extern const char *print_error;
-
-void init_vars(void);
-const char* get_install_dir(const char *key);
-bool file_exists(const char *path);
-bool is_directory(const char *path);
-int mkdir_p(const char *path);
-
-void map_init(Map *map);
-void map_put(Map *map, char *key, char *value);
-char* map_get(Map *map, const char *key);
-
-#endif