summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2020-01-28 19:43:01 -0500
committermidipix <writeonce@midipix.org>2020-05-23 05:59:01 +0000
commita9490ccb9fdf7ef146a7886526f1b1cf6bf2c714 (patch)
treef0aa434a382f03ba731a6cd24d7ca97a768210ae /include
parent88751e9e5ee3726b8a6987aeaae04e956c2234f5 (diff)
downloadtpax-a9490ccb9fdf7ef146a7886526f1b1cf6bf2c714.tar.bz2
tpax-a9490ccb9fdf7ef146a7886526f1b1cf6bf2c714.tar.xz
abi/api: added tpax_specs.h, definitions for struct tpax_{ustar|cpio}_header.
Diffstat (limited to 'include')
-rw-r--r--include/tpax/tpax_specs.h66
1 files changed, 66 insertions, 0 deletions
diff --git a/include/tpax/tpax_specs.h b/include/tpax/tpax_specs.h
new file mode 100644
index 0000000..d0ac5a4
--- /dev/null
+++ b/include/tpax/tpax_specs.h
@@ -0,0 +1,66 @@
+#ifndef TPAX_SPECS_H
+#define TPAX_SPECS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define TPAX_USTAR_MAGIC {'u','s','t','a','r',0}
+#define TPAX_USTAR_VERSION {'0','0'}
+
+#define TPAX_USTAR_TYPEFLAG_AREGFILE '\0'
+#define TPAX_USTAR_TYPEFLAG_REGFILE '0'
+#define TPAX_USTAR_TYPEFLAG_HARDLINK '1'
+#define TPAX_USTAR_TYPEFLAG_SYMLINK '2'
+#define TPAX_USTAR_TYPEFLAG_CHARDEV '3'
+#define TPAX_USTAR_TYPEFLAG_BLKDEV '4'
+#define TPAX_USTAR_TYPEFLAG_DIRFILE '5'
+#define TPAX_USTAR_TYPEFLAG_FIFODEV '6'
+#define TPAX_USTAR_TYPEFLAG_CONTAINER '7'
+
+#define TPAX_USTAR_MODE_MASK \
+ ( S_ISUID | S_ISGID \
+ | S_IRUSR | S_IWUSR | S_IXUSR \
+ | S_IRGRP | S_IWGRP | S_IXGRP \
+ | S_IROTH | S_IWOTH | S_IXOTH )
+
+struct tpax_ustar_header {
+ char u_name [100];
+ char u_mode [8];
+ char u_uid [8];
+ char u_gid [8];
+ char u_size [12];
+ char u_mtime [12];
+ char u_chksum [8];
+ char u_typeflag [1];
+ char u_linkname [100];
+ char u_magic [6];
+ char u_version [2];
+ char u_uname [32];
+ char u_gname [32];
+ char u_devmajor [8];
+ char u_devminor [8];
+ char u_prefix [155];
+ char u_pad [12];
+};
+
+struct tpax_cpio_header {
+ char c_magic [6];
+ char c_dev [6];
+ char c_ino [6];
+ char c_mode [6];
+ char c_uid [6];
+ char c_gid [6];
+ char c_nlink [6];
+ char c_rdev [6];
+ char c_mtime [11];
+ char c_namesize [6];
+ char c_filesize [11];
+ char c_namedata [];
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif