dpkg 1.21.11
db-fsys.h
Go to the documentation of this file.
1/*
2 * libdpkg - Debian packaging suite library routines
3 * db-fsys.h - management of database of files installed on system
4 *
5 * Copyright © 1995 Ian Jackson <ijackson@chiark.greenend.org.uk>
6 * Copyright © 2008-2014 Guillem Jover <guillem@debian.org>
7 *
8 * This is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 */
21
22#ifndef LIBDPKG_DB_FSYS_H
23#define LIBDPKG_DB_FSYS_H
24
25#include <dpkg/file.h>
26#include <dpkg/fsys.h>
27
29
30/*
31 * Data structure here is as follows:
32 *
33 * For each package we have a ‘struct fsys_namenode_list *’, the head of a list of
34 * files in that package. They are in ‘forwards’ order. Each entry has a
35 * pointer to the ‘struct fsys_namenode’.
36 *
37 * The struct fsys_namenodes are in a hash table, indexed by name.
38 * (This hash table is not visible to callers.)
39 *
40 * Each fsys_namenode has a (possibly empty) list of ‘struct filepackage’,
41 * giving a list of the packages listing that filename.
42 *
43 * When we read files contained info about a particular package we set the
44 * ‘files’ member of the clientdata struct to the appropriate thing. When
45 * not yet set the files pointer is made to point to ‘fileslist_uninited’
46 * (this is available only internally, within filesdb.c - the published
47 * interface is ensure_*_available).
48 */
49
50struct pkginfo;
51
52void ensure_diversions(void);
53
57};
58
59uid_t statdb_parse_uid(const char *str);
60gid_t statdb_parse_gid(const char *str);
61mode_t statdb_parse_mode(const char *str);
63
64#define LISTFILE "list"
65#define HASHFILE "md5sums"
66
71void parse_filehash(struct pkginfo *pkg, struct pkgbin *pkgbin);
72void write_filelist_except(struct pkginfo *pkg, struct pkgbin *pkgbin,
73 struct fsys_namenode_list *list, enum fsys_namenode_flags mask);
74void write_filehash_except(struct pkginfo *pkg, struct pkgbin *pkgbin,
75 struct fsys_namenode_list *list, enum fsys_namenode_flags mask);
76
78
79#endif /* LIBDPKG_DB_FSYS_H */
void write_filelist_except(struct pkginfo *pkg, struct pkgbin *pkgbin, struct fsys_namenode_list *list, enum fsys_namenode_flags mask)
Definition: db-fsys-files.c:300
void ensure_statoverrides(enum statdb_parse_flags flags)
Definition: db-fsys-override.c:112
void ensure_packagefiles_available(struct pkginfo *pkg)
Load the list of files in this package into memory, or update the list if it is there but stale.
Definition: db-fsys-files.c:78
void note_must_reread_files_inpackage(struct pkginfo *pkg)
Definition: db-fsys-files.c:60
statdb_parse_flags
Definition: db-fsys.h:54
@ STATDB_PARSE_NORMAL
Definition: db-fsys.h:55
@ STATDB_PARSE_LAX
Definition: db-fsys.h:56
void ensure_allinstfiles_available(void)
Definition: db-fsys-files.c:250
void ensure_diversions(void)
Definition: db-fsys-divert.c:46
void ensure_allinstfiles_available_quiet(void)
Definition: db-fsys-files.c:290
void write_filehash_except(struct pkginfo *pkg, struct pkgbin *pkgbin, struct fsys_namenode_list *list, enum fsys_namenode_flags mask)
Definition: db-fsys-digest.c:46
uid_t statdb_parse_uid(const char *str)
Definition: db-fsys-override.c:47
gid_t statdb_parse_gid(const char *str)
Definition: db-fsys-override.c:73
mode_t statdb_parse_mode(const char *str)
Definition: db-fsys-override.c:99
void parse_filehash(struct pkginfo *pkg, struct pkgbin *pkgbin)
Definition: db-fsys-digest.c:134
fsys_namenode_flags
Definition: fsys.h:63
#define DPKG_BEGIN_DECLS
Definition: macros.h:86
#define DPKG_END_DECLS
Definition: macros.h:87
Definition: fsys.h:126
Node describing a binary package file.
Definition: dpkg-db.h:108
Node describing an architecture package instance.
Definition: dpkg-db.h:198