From 184bd50e2ea12b4bf40f4ae1b0d685f0bfa1c995 Mon Sep 17 00:00:00 2001 From: dacctal Date: Tue, 21 Jul 2026 21:32:27 +0000 Subject: started 2.0 refactor. Co-authored-by: ezntek --- include/pkg.h | 37 ++++++++++++++----------------------- 1 file changed, 14 insertions(+), 23 deletions(-) (limited to 'include/pkg.h') 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 . -*/ - #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 -- cgit v1.2.3