dpkg 1.22.7-3-g89f48
Loading...
Searching...
No Matches
fsys.h
Go to the documentation of this file.
1/*
2 * libdpkg - Debian packaging suite library routines
3 * fsys.h - filesystem nodes hash table
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_FSYS_H
23#define LIBDPKG_FSYS_H
24
25#include <stdio.h>
26
27#include <dpkg/file.h>
28
30
31/*
32 * Data structure here is as follows:
33 *
34 * For each package we have a ‘struct fsys_namenode_list *’, the head of a list of
35 * files in that package. They are in ‘forwards’ order. Each entry has a
36 * pointer to the ‘struct fsys_namenode’.
37 *
38 * The struct fsys_namenodes are in a hash table, indexed by name.
39 * (This hash table is not visible to callers.)
40 *
41 * Each fsys_namenode has a (possibly empty) list of ‘struct filepackage’,
42 * giving a list of the packages listing that filename.
43 *
44 * When we read files contained info about a particular package we set the
45 * ‘files’ member of the clientdata struct to the appropriate thing. When
46 * not yet set the files pointer is made to point to ‘fileslist_uninited’
47 * (this is available only internally, within filesdb.c - the published
48 * interface is ensure_*_available).
49 */
50
51struct pkginfo;
52
64
89
94 dev_t id_dev;
95 ino_t id_ino;
96};
97
100 const char *name;
103
110
112
113 /*
114 * Fields from here on are used by archives.c &c, and cleared by
115 * fsys_hash_init().
116 */
117
120
122 const char *oldhash;
123
125 const char *newhash;
126
128};
129
134
141
167
169struct fsys_node_pkgs_iter *
171struct pkginfo *
173void
175
176void
177fsys_hash_init(void);
178void
179fsys_hash_reset(void);
180void
182int
184
185struct fsys_hash_iter;
186struct fsys_hash_iter *
188struct fsys_namenode *
190void
192
193struct fsys_namenode *
194fsys_hash_find_node(const char *filename, enum fsys_hash_find_flags flags);
195
199
200void
202 struct fsys_namenode_list *files);
203struct fsys_namenode *
205void
207
208const char *dpkg_fsys_set_dir(const char *dir);
209const char *dpkg_fsys_get_dir(void);
210char *dpkg_fsys_get_path(const char *pathpart);
211
213
214#endif /* LIBDPKG_FSYS_H */
FNNF_NO_ATOMIC_OVERWRITE
>= 1 instance is a dir, cannot rename over.
Definition fsys.h:79
struct fsys_namenode * fsys_hash_rev_iter_next(struct fsys_hash_rev_iter *iter)
Definition fsys-iter.c:61
struct fsys_namenode * fsys_hash_iter_next(struct fsys_hash_iter *iter)
Definition fsys-hash.c:177
struct pkginfo * fsys_node_pkgs_iter_next(struct fsys_node_pkgs_iter *iter)
Definition fsys-iter.c:109
const char * dpkg_fsys_get_dir(void)
Get current on-disk filesystem root directory.
Definition fsys-dir.c:95
FNNF_NEW_INARCHIVE
In the new filesystem archive.
Definition fsys.h:71
void fsys_hash_init(void)
Definition fsys-hash.c:44
void fsys_node_pkgs_iter_free(struct fsys_node_pkgs_iter *iter)
Definition fsys-iter.c:123
FNNF_DEFERRED_RENAME
Definition fsys.h:83
FNNF_FILTERED
Path being filtered.
Definition fsys.h:85
void fsys_hash_rev_iter_init(struct fsys_hash_rev_iter *iter, struct fsys_namenode_list *files)
Definition fsys-iter.c:45
char * dpkg_fsys_get_path(const char *pathpart)
Get a pathname to the current on-disk filesystem root directory.
Definition fsys-dir.c:114
FNNF_NEW_CONFF
In the newconffiles list.
Definition fsys.h:69
void fsys_hash_report(FILE *file)
Definition fsys-hash.c:117
struct fsys_node_pkgs_iter * fsys_node_pkgs_iter_new(struct fsys_namenode *fnn)
Definition fsys-iter.c:98
void fsys_hash_reset(void)
Definition fsys-hash.c:60
void fsys_hash_iter_free(struct fsys_hash_iter *iter)
Definition fsys-hash.c:193
enum DPKG_ATTR_ENUM_FLAGS fsys_namenode_flags
Definition fsys.h:65
const char * dpkg_fsys_set_dir(const char *dir)
Set current on-disk filesystem root directory.
Definition fsys-dir.c:69
void fsys_hash_rev_iter_abort(struct fsys_hash_rev_iter *iter)
Definition fsys-iter.c:83
int fsys_hash_entries(void)
Definition fsys-hash.c:67
FNNF_OLD_CONFF
In the old package's conffiles list.
Definition fsys.h:73
FNNF_PLACED_ON_DISK
New file has been placed on the disk.
Definition fsys.h:81
FNNF_NONE
No flags.
Definition fsys.h:67
FHFF_NO_COPY
Do not need to copy filename.
Definition fsys.h:60
FNNF_OBS_CONFF
Obsolete conffile.
Definition fsys.h:75
FNNF_ELIDE_OTHER_LISTS
Must remove from other packages' lists.
Definition fsys.h:77
struct fsys_hash_iter * fsys_hash_iter_new(void)
Definition fsys-hash.c:165
FHFF_NO_NEW
Do not insert the item if it is not found, and return NULL.
Definition fsys.h:62
FNNF_RM_CONFF_ON_UPGRADE
Conffile removal requested by upgrade.
Definition fsys.h:87
FNNF_DEFERRED_FSYNC
Definition fsys.h:82
FHFF_NONE
No flags.
Definition fsys.h:58
struct fsys_namenode * fsys_hash_find_node(const char *filename, enum fsys_hash_find_flags flags)
Definition fsys-hash.c:73
enum DPKG_ATTR_ENUM_FLAGS fsys_hash_find_flags
Flags to fsys_hash_find_node().
Definition fsys.h:56
#define DPKG_ATTR_ENUM_FLAGS
Definition macros.h:149
#define DPKG_BEGIN_DECLS
Definition macros.h:164
#define DPKG_END_DECLS
Definition macros.h:165
#define DPKG_BIT(n)
Return the integer value of bit n.
Definition macros.h:203
Stores information to uniquely identify an on-disk file.
Definition fsys.h:93
ino_t id_ino
Definition fsys.h:95
dev_t id_dev
Definition fsys.h:94
Definition file.h:40
Definition main.c:133
When we deal with an ‘overridden’ file, every package except the overriding one is considered to cont...
Definition fsys.h:159
struct pkgset * pkgset
Definition fsys.h:162
struct fsys_namenode * camefrom
Definition fsys.h:161
struct fsys_namenode * useinstead
Definition fsys.h:160
struct fsys_diversion * next
The ‘contested’ halves are in this list for easy cleanup.
Definition fsys.h:165
Definition fsys-hash.c:159
Definition fsys.h:196
struct fsys_namenode_list * todo
Definition fsys.h:197
Definition fsys.h:130
struct fsys_namenode * namenode
Definition fsys.h:132
struct fsys_namenode_list * next
Definition fsys.h:131
Queue of fsys_namenode entries.
Definition fsys.h:138
struct fsys_namenode_list ** tail
Definition fsys.h:139
struct fsys_namenode_list * head
Definition fsys.h:139
Definition fsys.h:98
struct fsys_diversion * divert
Definition fsys.h:102
struct file_ondisk_id * file_ondisk_id
Definition fsys.h:127
const char * name
Definition fsys.h:100
struct pkg_list * packages
Definition fsys.h:101
struct file_stat * statoverride
We allow the administrator to override the owner, group and mode of a file.
Definition fsys.h:109
struct trigfileint * trig_interested
Definition fsys.h:111
const char * newhash
Valid iff the file was unpacked and hashed on this run.
Definition fsys.h:125
enum fsys_namenode_flags flags
Set to zero when a new node is created.
Definition fsys.h:119
struct fsys_namenode * next
Definition fsys.h:99
const char * oldhash
Valid iff this namenode is in the newconffiles list.
Definition fsys.h:122
Definition fsys-iter.c:93
Definition pkg-list.h:34
Node describing an architecture package instance.
Definition dpkg-db.h:206
Node describing a package set sharing the same package name.
Definition dpkg-db.h:253
Definition triglib.h:56