chiark / gitweb /
lib/dpkg/tarfn.c: Kludge `tar_header_decode' to handle spurious `errno'.
[dpkg] / src / infodb.h
1 /*
2  * dpkg - main program for package management
3  * infodb.h - package control information database
4  *
5  * Copyright © 2011-2014 Guillem Jover <guillem@debian.org>
6  *
7  * This is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
19  */
20
21 #ifndef DPKG_INFODB_H
22 #define DPKG_INFODB_H
23
24 #include <stdbool.h>
25
26 #include <dpkg/dpkg-db.h>
27
28 enum pkg_infodb_format {
29         PKG_INFODB_FORMAT_UNKNOWN = -1,
30         PKG_INFODB_FORMAT_LEGACY = 0,
31         PKG_INFODB_FORMAT_MULTIARCH = 1,
32         PKG_INFODB_FORMAT_LAST,
33 };
34
35 enum pkg_infodb_format pkg_infodb_get_format(void);
36 void pkg_infodb_set_format(enum pkg_infodb_format format);
37 bool pkg_infodb_is_upgrading(void);
38 void pkg_infodb_upgrade(void);
39
40 const char *pkg_infodb_get_dir(void);
41 const char *pkg_infodb_get_file(struct pkginfo *pkg, struct pkgbin *pkgbin,
42                                 const char *filetype);
43 bool pkg_infodb_has_file(struct pkginfo *pkg, struct pkgbin *pkgbin,
44                          const char *name);
45
46 typedef void pkg_infodb_file_func(const char *filename, const char *filetype);
47
48 void pkg_infodb_foreach(struct pkginfo *pkg, struct pkgbin *pkgbin,
49                         pkg_infodb_file_func *func);
50
51 #endif /* DPKG_INFODB_H */