summaryrefslogtreecommitdiff
path: root/dpkg-deb/dpkg-deb.h
blob: a5e8d39ce314b07af2fe732ca5bfa2f32c6a716c (plain)
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
/*
 * dpkg-deb - construction and deconstruction of *.deb archives
 * dpkg-deb.h - external definitions for this program
 *
 * Copyright © 1994,1995 Ian Jackson <ijackson@chiark.greenend.org.uk>
 * Copyright © 2006-2012 Guillem Jover <guillem@debian.org>
 *
 * 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 <https://www.gnu.org/licenses/>.
 */

#ifndef DPKG_DEB_H
#define DPKG_DEB_H

#include <dpkg/deb-version.h>

action_func do_build;
action_func do_contents;
action_func do_control;
action_func do_showinfo;
action_func do_info;
action_func do_field;
action_func do_extract;
action_func do_vextract;
action_func do_raw_extract;
action_func do_ctrltarfile;
action_func do_fsystarfile;

extern int opt_verbose;
extern int opt_root_owner_group;
extern int opt_uniform_compression;
extern int debugflag, nocheckflag;

extern struct deb_version deb_format;

enum dpkg_tar_options {
	/** Output the tar file directly, without any processing. */
	DPKG_TAR_PASSTHROUGH = 0,
	/** List tar files. */
	DPKG_TAR_LIST = DPKG_BIT(0),
	/** Extract tar files. */
	DPKG_TAR_EXTRACT = DPKG_BIT(1),
	/** Preserve tar permissions on extract. */
	DPKG_TAR_PERMS = DPKG_BIT(2),
	/** Do not set tar mtime on extract. */
	DPKG_TAR_NOMTIME = DPKG_BIT(3),
	/** Guarantee extraction into a new directory, abort if it exists. */
	DPKG_TAR_CREATE_DIR = DPKG_BIT(4),
};

void extracthalf(const char *debar, const char *dir,
                 enum dpkg_tar_options taroption, int admininfo);

extern const char *showformat;
extern struct compress_params compress_params;

#define ARCHIVEVERSION		"2.0"

#define BUILDCONTROLDIR		"DEBIAN"
#define EXTRACTCONTROLDIR	BUILDCONTROLDIR

#define OLDARCHIVEVERSION	"0.939000"

#define OLDDEBDIR		"DEBIAN"
#define OLDOLDDEBDIR		".DEBIAN"

#define DEBMAGIC		"debian-binary"
#define ADMINMEMBER		"control.tar"
#define DATAMEMBER		"data.tar"

#ifdef PATH_MAX
# define INTERPRETER_MAX PATH_MAX
#else
# define INTERPRETER_MAX 1024
#endif

#endif /* DPKG_DEB_H */