split merge test into two tests
[dpkg/seanius.git] / dpkg-split / dpkg-split.h
bloba29a8232909ea7a1c49332493d5717f4c888cf7b
1 /*
2 * dpkg-split - splitting and joining of multipart *.deb archives
3 * dpkg-split.h - external definitions for this program
5 * Copyright © 1995 Ian Jackson <ian@chiark.greenend.org.uk>
7 * This is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #ifndef DPKG_SPLIT_H
22 #define DPKG_SPLIT_H
24 typedef void dofunction(const char *const *argv);
25 dofunction do_split DPKG_ATTR_NORET;
26 dofunction do_join, do_info, do_auto, do_queue, do_discard;
28 struct partinfo {
29 const char *filename;
30 const char *fmtversion;
31 const char *package;
32 const char *version;
33 const char *md5sum;
34 unsigned long orglength;
35 unsigned int thispartn, maxpartn;
36 unsigned long maxpartlen;
37 unsigned long thispartoffset;
38 size_t thispartlen;
39 size_t headerlen; /* size of header in part file */
40 off_t filesize;
43 struct partqueue {
44 struct partqueue *nextinqueue;
45 struct partinfo info;
46 /* only fields filename, md5sum, maxpartlen, thispartn, maxpartn
47 * are valid; the rest are null. If the file is not named correctly
48 * to be a part file md5sum is null too and the numbers are zero.
52 extern dofunction *action;
53 extern const struct cmdinfo *cipaction;
54 extern long maxpartsize;
55 extern const char *depotdir, *outputfile;
56 extern struct partqueue *queue;
57 extern int npquiet, msdos;
59 void rerr(const char *fn) DPKG_ATTR_NORET;
60 void rerreof(FILE *f, const char *fn) DPKG_ATTR_NORET;
61 void print_info(const struct partinfo *pi);
62 struct partinfo *read_info(FILE *partfile, const char *fn, struct partinfo *ir);
64 void scandepot(void);
65 void reassemble(struct partinfo **partlist, const char *outputfile);
66 void mustgetpartinfo(const char *filename, struct partinfo *ri);
67 void addtopartlist(struct partinfo**, struct partinfo*, struct partinfo *refi);
69 #define SPLITVERSION "2.1"
71 #define PARTSDIR "parts/"
73 #define PARTMAGIC "!<arch>\ndebian-split "
74 #define HEADERALLOWANCE 1024
76 #define SPLITPARTDEFMAX (450 * 1024)
78 #endif /* DPKG_SPLIT_H */