]>
git.ipfire.org Git - people/ms/pakfire.git/blob - src/libpakfire/include/pakfire/db.h
1 /*#############################################################################
3 # Pakfire - The IPFire package management system #
4 # Copyright (C) 2021 Pakfire development team #
6 # This program is free software: you can redistribute it and/or modify #
7 # it under the terms of the GNU General Public License as published by #
8 # the Free Software Foundation, either version 3 of the License, or #
9 # (at your option) any later version. #
11 # This program is distributed in the hope that it will be useful, #
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 # GNU General Public License for more details. #
16 # You should have received a copy of the GNU General Public License #
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
19 #############################################################################*/
24 #ifdef PAKFIRE_PRIVATE
26 #include <sys/types.h>
28 #include <pakfire/archive.h>
29 #include <pakfire/package.h>
30 #include <pakfire/repo.h>
31 #include <pakfire/scriptlet.h>
32 #include <pakfire/types.h>
37 PAKFIRE_DB_READONLY
= 0,
38 PAKFIRE_DB_READWRITE
= (1 << 0),
41 int pakfire_db_open(struct pakfire_db
** db
, Pakfire pakfire
, int flags
);
43 struct pakfire_db
* pakfire_db_ref(struct pakfire_db
* db
);
44 struct pakfire_db
* pakfire_db_unref(struct pakfire_db
* db
);
46 int pakfire_db_check(struct pakfire_db
* db
);
48 ssize_t
pakfire_db_packages(struct pakfire_db
* db
);
50 int pakfire_db_add_package(struct pakfire_db
* db
, struct pakfire_package
* pkg
,
51 struct pakfire_archive
* archive
, int userinstalled
);
52 int pakfire_db_remove_package(struct pakfire_db
* db
, struct pakfire_package
* pkg
);
54 int pakfire_db_load(struct pakfire_db
* db
, struct pakfire_repo
* repo
);
56 struct pakfire_scriptlet
* pakfire_db_get_scriptlet(
57 struct pakfire_db
* db
, struct pakfire_package
* pkg
, const char* type
);
59 int pakfire_db_package_filelist(struct pakfire_db
* db
, struct pakfire_filelist
** filelist
,
60 struct pakfire_package
* pkg
);
64 #endif /* PAKFIRE_DB_H */