00001 #ifndef CLASSLIB_TAR_CONSTANTS_H
00002 # define CLASSLIB_TAR_CONSTANTS_H
00003
00004
00005
00006 # include "classlib/zip/ZipUtils.h"
00007
00008 namespace lat {
00009
00010
00011
00012
00013
00014
00015
00017 struct TarConstants : ZipUtils
00018 {
00019
00020 enum Mode {
00021 SUID = 04000,
00022 SGID = 02000,
00023 SVTX = 01000,
00024 UREAD = 00400,
00025 UWRITE = 00200,
00026 UEXEC = 00100,
00027 GREAD = 00040,
00028 GWRITE = 00020,
00029 GEXEC = 00010,
00030 OREAD = 00004,
00031 OWRITE = 00002,
00032 OEXEC = 00001
00033 };
00034
00035
00036 enum Type {
00037 REGULAR = '0',
00038 HARD_LINK = '1',
00039 SYM_LINK = '2',
00040 CHAR_DEVICE = '3',
00041 BLOCK_DEVICE = '4',
00042 DIRECTORY = '5',
00043 FIFO = '6',
00044 CONTIGUOUS = '7'
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 };
00056
00057
00058 static const char *MAGIC;
00059 static const char *VERSION;
00060
00061
00062 enum {
00063 NAME_OFFSET = 0, NAME_LENGTH = 100,
00064 MODE_OFFSET = 100, MODE_LENGTH = 8,
00065 UID_OFFSET = 108, UID_LENGTH = 8,
00066 GID_OFFSET = 116, GID_LENGTH = 8,
00067 SIZE_OFFSET = 124, SIZE_LENGTH = 12,
00068 MTIME_OFFSET = 136, MTIME_LENGTH = 12,
00069 CHKSUM_OFFSET = 148, CHKSUM_LENGTH = 8,
00070 TYPE_OFFSET = 156, TYPE_LENGTH = 1,
00071 LINK_OFFSET = 157, LINK_LENGTH = 100,
00072 MAGIC_OFFSET = 257, MAGIC_LENGTH = 6,
00073 VERSION_OFFSET = 263, VERSION_LENGTH = 2,
00074 UNAME_OFFSET = 265, UNAME_LENGTH = 32,
00075 GNAME_OFFSET = 297, GNAME_LENGTH = 32,
00076 DEVMAJOR_OFFSET = 329, DEVMAJOR_LENGTH = 8,
00077 DEVMINOR_OFFSET = 329, DEVMINOR_LENGTH = 8,
00078 PREFIX_OFFSET = 345, PREFIX_LENGTH = 155,
00079
00080 HEADER_SIZE = 512,
00081
00082
00083 SMALL_MAX = 0777777,
00084 LARGE_MAX = 07777777777
00085 };
00086 };
00087
00088
00089
00090
00091 }
00092 #endif // CLASSLIB_TAR_CONSTANTS_H