/usr/include/dpkg/parsedump.h is in libdpkg-dev 1.16.1.2ubuntu7.7.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | /*
* libdpkg - Debian packaging suite library routines
* parsedump.h - declarations for in-core database reading/writing
*
* Copyright © 1995 Ian Jackson <ian@chiark.greenend.org.uk>
* Copyright © 2001 Wichert Akkerman
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBDPKG_PARSEDUMP_H
#define LIBDPKG_PARSEDUMP_H
struct fieldinfo;
struct parsedb_state {
enum parsedbflags flags;
struct pkginfo *pkg;
struct pkgbin *pkgbin;
char *data;
char *dataptr;
char *endptr;
const char *filename;
int lno;
};
#define parse_EOF(ps) ((ps)->dataptr >= (ps)->endptr)
#define parse_getc(ps) *(ps)->dataptr++
#define parse_ungetc(c, ps) (ps)->dataptr--
struct field_state {
const char *fieldstart;
const char *valuestart;
struct varbuf value;
int fieldlen;
int valuelen;
int *fieldencountered;
};
void parse_open(struct parsedb_state *ps, const char *filename,
enum parsedbflags flags);
void parse_close(struct parsedb_state *ps);
typedef void parse_field_func(struct parsedb_state *ps, struct field_state *fs,
void *parse_obj);
bool parse_stanza(struct parsedb_state *ps, struct field_state *fs,
parse_field_func *parse_field, void *parse_obj);
#define PKGIFPOFF(f) (offsetof(struct pkgbin, f))
#define PKGPFIELD(pifp,of,type) (*(type*)((char*)(pifp)+(of)))
#define FILEFOFF(f) (offsetof(struct filedetails, f))
#define FILEFFIELD(filedetail,of,type) (*(type*)((char*)(filedetail)+(of)))
typedef void freadfunction(struct pkginfo *pigp, struct pkgbin *pifp,
struct parsedb_state *ps,
const char *value, const struct fieldinfo *fip);
freadfunction f_name, f_charfield, f_priority, f_section, f_status, f_filecharf;
freadfunction f_boolean, f_dependency, f_conffiles, f_version, f_revision;
freadfunction f_configversion;
freadfunction f_multiarch;
freadfunction f_architecture;
freadfunction f_trigpend, f_trigaw;
freadfunction f_forbidden;
enum fwriteflags {
/* Print field header and trailing newline. */
fw_printheader = 001,
};
typedef void fwritefunction(struct varbuf*,
const struct pkginfo *, const struct pkgbin *,
enum fwriteflags flags, const struct fieldinfo*);
fwritefunction w_name, w_charfield, w_priority, w_section, w_status, w_configversion;
fwritefunction w_version, w_null, w_booleandefno, w_dependency, w_conffiles;
fwritefunction w_multiarch;
fwritefunction w_architecture;
fwritefunction w_filecharf;
fwritefunction w_trigpend, w_trigaw;
fwritefunction w_packagespec;
struct fieldinfo {
const char *name;
freadfunction *rcall;
fwritefunction *wcall;
size_t integer;
};
void parse_db_version(struct parsedb_state *ps,
struct versionrevision *version, const char *value,
const char *fmt, ...) DPKG_ATTR_PRINTF(4);
void parse_error(struct parsedb_state *ps, const char *fmt, ...)
DPKG_ATTR_NORET DPKG_ATTR_PRINTF(2);
void parse_warn(struct parsedb_state *ps, const char *fmt, ...)
DPKG_ATTR_PRINTF(2);
void parse_must_have_field(struct parsedb_state *ps,
const char *value, const char *what);
void parse_ensure_have_field(struct parsedb_state *ps,
const char **value, const char *what);
#define MSDOS_EOF_CHAR '\032' /* ^Z */
struct nickname {
const char *nick;
const char *canon;
};
extern const struct fieldinfo fieldinfos[];
#endif /* LIBDPKG_PARSEDUMP_H */
|