1 /* Copyright (c) 2007 Ralf Corsepius <ralf.corsepius@rtems.org> */ 2 /* 3 * tar.h 4 */ 5 6 #ifndef _TAR_H 7 #define _TAR_H 8 9 #include <sys/features.h> 10 11 /* General definitions */ 12 #define TMAGIC "ustar" /* ustar plus null byte. */ 13 #define TMAGLEN 6 /* Length of the above. */ 14 #define TVERSION "00" /* 00 without a null byte. */ 15 #define TVERSLEN 2 /* Length of the above. */ 16 17 /* Typeflag field definitions */ 18 #define REGTYPE '0' /* Regular file. */ 19 #define AREGTYPE '\0' /* Regular file. */ 20 #define LNKTYPE '1' /* Link. */ 21 #define SYMTYPE '2' /* Symbolic link. */ 22 #define CHRTYPE '3' /* Character special. */ 23 #define BLKTYPE '4' /* Block special. */ 24 #define DIRTYPE '5' /* Directory. */ 25 #define FIFOTYPE '6' /* FIFO special. */ 26 #define CONTTYPE '7' /* Reserved. */ 27 28 /* Mode field bit definitions (octal) */ 29 #define TSUID 04000 /* Set UID on execution. */ 30 #define TSGID 02000 /* Set GID on execution. */ 31 #if __XSI_VISIBLE || __POSIX_VISIBLE < 200112 32 #define TSVTX 01000 /* On directories, restricted deletion flag. */ 33 #endif 34 #define TUREAD 00400 /* Read by owner. */ 35 #define TUWRITE 00200 /* Write by owner. */ 36 #define TUEXEC 00100 /* Execute/search by owner. */ 37 #define TGREAD 00040 /* Read by group. */ 38 #define TGWRITE 00020 /* Write by group. */ 39 #define TGEXEC 00010 /* Execute/search by group. */ 40 #define TOREAD 00004 /* Read by other. */ 41 #define TOWRITE 00002 /* Write by other. */ 42 #define TOEXEC 00001 /* Execute/search by other. */ 43 44 #endif 45