summaryrefslogtreecommitdiffstats
path: root/dpkg-split/dpkg-split.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 00:45:20 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 00:45:20 +0000
commit9a08cbfcc1ef900a04580f35afe2a4592d7d6030 (patch)
tree004cc7027bca2f2c0bcb5806527c8e0c48df2d6e /dpkg-split/dpkg-split.h
parentInitial commit. (diff)
downloaddpkg-upstream/1.19.8.tar.xz
dpkg-upstream/1.19.8.zip
Adding upstream version 1.19.8.upstream/1.19.8upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dpkg-split/dpkg-split.h')
-rw-r--r--dpkg-split/dpkg-split.h84
1 files changed, 84 insertions, 0 deletions
diff --git a/dpkg-split/dpkg-split.h b/dpkg-split/dpkg-split.h
new file mode 100644
index 0000000..3064d4d
--- /dev/null
+++ b/dpkg-split/dpkg-split.h
@@ -0,0 +1,84 @@
+/*
+ * dpkg-split - splitting and joining of multipart *.deb archives
+ * dpkg-split.h - external definitions for this program
+ *
+ * Copyright © 1995 Ian Jackson <ijackson@chiark.greenend.org.uk>
+ * Copyright © 2008-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_SPLIT_H
+#define DPKG_SPLIT_H
+
+#include <dpkg/ar.h>
+#include <dpkg/deb-version.h>
+
+action_func do_split;
+action_func do_join;
+action_func do_info;
+action_func do_auto;
+action_func do_queue;
+action_func do_discard;
+
+struct partinfo {
+ struct deb_version fmtversion;
+ const char *filename;
+ const char *package;
+ const char *version;
+ const char *arch;
+ const char *md5sum;
+ off_t orglength;
+ unsigned int thispartn, maxpartn;
+ off_t maxpartlen;
+ off_t thispartoffset;
+ off_t thispartlen;
+ /** Size of header in part file. */
+ off_t headerlen;
+ off_t filesize;
+};
+
+struct partqueue {
+ struct partqueue *nextinqueue;
+
+ /** Only fields filename, md5sum, maxpartlen, thispartn, maxpartn
+ * are valid; the rest are NULL. If the file is not named correctly
+ * to be a part file md5sum is NULL too and the numbers are zero. */
+ struct partinfo info;
+};
+
+extern off_t opt_maxpartsize;
+extern const char *opt_depotdir;
+extern const char *opt_outputfile;
+extern int opt_npquiet;
+extern int opt_msdos;
+
+void read_fail(int rc, const char *filename, const char *what) DPKG_ATTR_NORET;
+void print_info(const struct partinfo *pi);
+struct partinfo *read_info(struct dpkg_ar *ar, struct partinfo *ir);
+
+void reassemble(struct partinfo **partlist, const char *outputfile);
+void mustgetpartinfo(const char *filename, struct partinfo *ri);
+void addtopartlist(struct partinfo**, struct partinfo*, struct partinfo *refi);
+
+#define SPLITVERSION "2.1"
+
+#define PARTSDIR "parts"
+
+#define PARTMAGIC "debian-split"
+#define HEADERALLOWANCE 1024
+
+#define SPLITPARTDEFMAX (450 * 1024)
+
+#endif /* DPKG_SPLIT_H */