summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/mar/mar.h
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2000-11-09 23:09:17 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2000-11-09 23:09:17 +0000
commitb695b4bd2408c4ad06a1dcdd95b2a95a3bf63fa5 (patch)
tree7f890201f7b16e38103141b0f47a47a30fe8d403 /mdk-stage1/mar/mar.h
parent9166c569774a7580df1b39ccebc8cc5abd46b1d9 (diff)
downloaddrakx-backup-do-not-use-b695b4bd2408c4ad06a1dcdd95b2a95a3bf63fa5.tar
drakx-backup-do-not-use-b695b4bd2408c4ad06a1dcdd95b2a95a3bf63fa5.tar.gz
drakx-backup-do-not-use-b695b4bd2408c4ad06a1dcdd95b2a95a3bf63fa5.tar.bz2
drakx-backup-do-not-use-b695b4bd2408c4ad06a1dcdd95b2a95a3bf63fa5.tar.xz
drakx-backup-do-not-use-b695b4bd2408c4ad06a1dcdd95b2a95a3bf63fa5.zip
add `mar' archiving program
Diffstat (limited to 'mdk-stage1/mar/mar.h')
-rw-r--r--mdk-stage1/mar/mar.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/mdk-stage1/mar/mar.h b/mdk-stage1/mar/mar.h
new file mode 100644
index 000000000..5d8d98f61
--- /dev/null
+++ b/mdk-stage1/mar/mar.h
@@ -0,0 +1,71 @@
+/*
+ * Guillaume Cottenceau (gc@mandrakesoft.com)
+ *
+ * Copyright 2000 MandrakeSoft
+ *
+ * This software may be freely redistributed under the terms of the GNU
+ * public license.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+/*
+ * mar - The Mandrake Archiver
+ *
+ * An archiver that supports compression (through zlib).
+ *
+ * Designed to be small so these bad designs are inside:
+ * . archive and compression are mixed together
+ * . create the mar file in-memory
+ * . does not free memory
+ *
+ */
+
+#ifndef MAR_H
+#define MAR_H
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <unistd.h>
+#include <zlib.h>
+
+/*
+ * Format of a mar file:
+ *
+ * int crc32 \
+ * ASCIIZ filename \ |
+ * int file_length | repeated | gzipped
+ * int pointer_in_archive / |
+ * char 0 |
+ * raw_files_data /
+ *
+ */
+
+typedef struct mar_element_s
+{
+ char * filename; /* filename (ASCIIZ) of the element */
+ int file_length; /* length (in bytes) of the raw data of the element */
+ int data_offset; /* seek start of the raw data in the underlying mar stream */
+ struct mar_element_s * next_element; /* pointer to the next element in the mar stream; NULL if last */
+} mar_element;
+
+typedef struct mar_stream_s
+{
+ int crc32; /* crc32 of the mar stream; it is the addition of all the 8-bit char's from the stream */
+ mar_element * first_element; /* pointer to the first element inside the mar stream */
+ gzFile mar_gzfile; /* associated gzFile (opened) */
+} mar_stream;
+
+int gz_errnum;
+
+#define DEBUG_MAR(x)
+
+#endif