]> git.ipfire.org Git - people/ms/pakfire.git/blob - src/libpakfire/include/pakfire/db.h
filelist: Change type from PakfireFilelist to struct pakfire_filelist
[people/ms/pakfire.git] / src / libpakfire / include / pakfire / db.h
1 /*#############################################################################
2 # #
3 # Pakfire - The IPFire package management system #
4 # Copyright (C) 2021 Pakfire development team #
5 # #
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. #
10 # #
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. #
15 # #
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/>. #
18 # #
19 #############################################################################*/
20
21 #ifndef PAKFIRE_DB_H
22 #define PAKFIRE_DB_H
23
24 #ifdef PAKFIRE_PRIVATE
25
26 #include <sys/types.h>
27
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>
33
34 struct pakfire_db;
35
36 enum {
37 PAKFIRE_DB_READONLY = 0,
38 PAKFIRE_DB_READWRITE = (1 << 0),
39 };
40
41 int pakfire_db_open(struct pakfire_db** db, Pakfire pakfire, int flags);
42
43 struct pakfire_db* pakfire_db_ref(struct pakfire_db* db);
44 struct pakfire_db* pakfire_db_unref(struct pakfire_db* db);
45
46 int pakfire_db_check(struct pakfire_db* db);
47
48 ssize_t pakfire_db_packages(struct pakfire_db* db);
49
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);
53
54 int pakfire_db_load(struct pakfire_db* db, struct pakfire_repo* repo);
55
56 struct pakfire_scriptlet* pakfire_db_get_scriptlet(
57 struct pakfire_db* db, struct pakfire_package* pkg, const char* type);
58
59 int pakfire_db_package_filelist(struct pakfire_db* db, struct pakfire_filelist** filelist,
60 struct pakfire_package* pkg);
61
62 #endif
63
64 #endif /* PAKFIRE_DB_H */