aboutsummaryrefslogtreecommitdiff
path: root/include/pkg.h
diff options
context:
space:
mode:
authordacctal <donotcontactmevia@email.invalid>2026-07-21 21:32:27 +0000
committerdacctal <donotcontactmevia@email.invalid>2026-07-21 21:32:27 +0000
commit184bd50e2ea12b4bf40f4ae1b0d685f0bfa1c995 (patch)
treebfe4f0a8fb39def302bdc807308c30b60dd18a92 /include/pkg.h
parentc251d37c98efba534766e914f7392cc7a0470351 (diff)
started 2.0 refactor. Co-authored-by: ezntek <eason@ezntek.com>
Diffstat (limited to 'include/pkg.h')
-rw-r--r--include/pkg.h37
1 files changed, 14 insertions, 23 deletions
diff --git a/include/pkg.h b/include/pkg.h
index 5ad88b2..47d1918 100644
--- a/include/pkg.h
+++ b/include/pkg.h
@@ -1,33 +1,24 @@
-/*
- 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 PKGIT_PKG_H
#define PKGIT_PKG_H
#include "str.h"
-typedef struct {
- str name, url, version, target, src;
+struct package_t;
+typedef bool (*package_hook_cb_t)(struct package_t *self);
+typedef str (*package_version_cb_t)(struct package_t *self);
+
+typedef struct package_t {
+ str name, version, url, src;
+ unsigned int dep_count;
bool is_local;
+ package_hook_cb_t setup, build, install, rem, on_update, fetch_sources;
+ package_version_cb_t fetch_latest_version;
} package_t;
-package_t pkg_create(str *arg);
-void pkg_free(package_t *pkg);
+bool setup(package_t *self), build(package_t *self),
+ install(package_t *self), rem(package_t *self),
+ on_update(package_t *self),
+ fetch_sources(package_t *self);
+str fetch_latest_version(package_t *self);
#endif