diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/tpax/tpax_specs.h | 66 |
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 |