tar.h
Go to the documentation of this file.
#ifndef H_TAR
#define H_TAR
typedef struct tarHeader_s * tarHeader;
/* Tar file constants */
# define TAR_MAGIC "ustar" /* ustar and a null */
# define TAR_VERSION " " /* Be compatable with GNU tar format */
#define TAR_BLOCK_SIZE 512
#define TAR_MAGIC_LEN 6
#define TAR_VERSION_LEN 2
/* POSIX tar Header Block, from POSIX 1003.1-1990 */
#define TAR_NAME_SIZE 100
struct tarHeader_s { /* byte offset */
char name[TAR_NAME_SIZE]; /* 0-99 */
char mode[8]; /* 100-107 */ /* mode */
char uid[8]; /* 108-115 */ /* uid */
char gid[8]; /* 116-123 */ /* gid */
char filesize[12]; /* 124-135 */ /* ilesize */
char mtime[12]; /* 136-147 */ /* mtime */
char checksum[8]; /* 148-155 */ /* checksum */
char typeflag; /* 156-156 */
char linkname[TAR_NAME_SIZE]; /* 157-256 */
char magic[6]; /* 257-262 */ /* magic */
char version[2]; /* 263-264 */
char uname[32]; /* 265-296 */
char gname[32]; /* 297-328 */
char devMajor[8]; /* 329-336 */ /* devMajor */
char devMinor[8]; /* 337-344 */ /* devMinor */
char prefix[155]; /* 345-499 */
char padding[12]; /* 500-512 (pad to exactly TAR_BLOCK_SIZE) */
};
/*@unchecked@*/
extern int _tar_debug;
#ifdef __cplusplus
extern "C" {
#endif
int tarHeaderRead(void * _iosm, struct stat * st)
/*@globals fileSystem, internalState @*/
/*@modifies _iosm, *st, fileSystem, internalState @*/;
int tarHeaderWrite(void * _iosm, struct stat * st)
/*@globals fileSystem, internalState @*/
/*@modifies _iosm, fileSystem, internalState @*/;
int tarTrailerWrite(void * _iosm)
/*@globals fileSystem, internalState @*/
/*@modifies _iosm, fileSystem, internalState @*/;
#ifdef __cplusplus
}
#endif
#endif /* H_TAR */