dpkg (1.18.25) stretch; urgency=medium
[dpkg] / dpkg-split / dpkg-split.h
CommitLineData
1479465f
GJ
1/*
2 * dpkg-split - splitting and joining of multipart *.deb archives
3 * dpkg-split.h - external definitions for this program
4 *
5 * Copyright © 1995 Ian Jackson <ijackson@chiark.greenend.org.uk>
6 * Copyright © 2008-2012 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 DPKG_SPLIT_H
23#define DPKG_SPLIT_H
24
25#include <dpkg/ar.h>
26#include <dpkg/deb-version.h>
27
28action_func do_split;
29action_func do_join;
30action_func do_info;
31action_func do_auto;
32action_func do_queue;
33action_func do_discard;
34
35struct partinfo {
36 struct deb_version fmtversion;
37 const char *filename;
38 const char *package;
39 const char *version;
40 const char *arch;
41 const char *md5sum;
42 off_t orglength;
43 unsigned int thispartn, maxpartn;
44 off_t maxpartlen;
45 off_t thispartoffset;
46 off_t thispartlen;
47 /** Size of header in part file. */
48 off_t headerlen;
49 off_t filesize;
50};
51
52struct partqueue {
53 struct partqueue *nextinqueue;
54
55 /** Only fields filename, md5sum, maxpartlen, thispartn, maxpartn
56 * are valid; the rest are NULL. If the file is not named correctly
57 * to be a part file md5sum is NULL too and the numbers are zero. */
58 struct partinfo info;
59};
60
61extern off_t opt_maxpartsize;
62extern const char *opt_depotdir;
63extern const char *opt_outputfile;
64extern int opt_npquiet;
65extern int opt_msdos;
66
67void read_fail(int rc, const char *filename, const char *what) DPKG_ATTR_NORET;
68void print_info(const struct partinfo *pi);
69struct partinfo *read_info(struct dpkg_ar *ar, struct partinfo *ir);
70
71void reassemble(struct partinfo **partlist, const char *outputfile);
72void mustgetpartinfo(const char *filename, struct partinfo *ri);
73void addtopartlist(struct partinfo**, struct partinfo*, struct partinfo *refi);
74
75#define SPLITVERSION "2.1"
76
77#define PARTSDIR "parts"
78
79#define PARTMAGIC "debian-split"
80#define HEADERALLOWANCE 1024
81
82#define SPLITPARTDEFMAX (450 * 1024)
83
84#endif /* DPKG_SPLIT_H */