rpm  5.4.15
tar.h
Go to the documentation of this file.
1 #ifndef H_TAR
2 #define H_TAR
3 
11 typedef struct tarHeader_s * tarHeader;
12 
13 /* Tar file constants */
14 # define TAR_MAGIC "ustar" /* ustar and a null */
15 # define TAR_VERSION " " /* Be compatible with GNU tar format */
16 
17 #define TAR_BLOCK_SIZE 512
18 #define TAR_MAGIC_LEN 6
19 #define TAR_VERSION_LEN 2
20 
21 /* POSIX tar Header Block, from POSIX 1003.1-1990 */
22 #define TAR_NAME_SIZE 100
23 
27 struct tarHeader_s { /* byte offset */
28  char name[TAR_NAME_SIZE]; /* 0-99 */
29  char mode[8]; /* 100-107 */ /* mode */
30  char uid[8]; /* 108-115 */ /* uid */
31  char gid[8]; /* 116-123 */ /* gid */
32  char filesize[12]; /* 124-135 */ /* ilesize */
33  char mtime[12]; /* 136-147 */ /* mtime */
34  char checksum[8]; /* 148-155 */ /* checksum */
35  char typeflag; /* 156-156 */
36  char linkname[TAR_NAME_SIZE]; /* 157-256 */
37  char magic[6]; /* 257-262 */ /* magic */
38  char version[2]; /* 263-264 */
39  char uname[32]; /* 265-296 */
40  char gname[32]; /* 297-328 */
41  char devMajor[8]; /* 329-336 */ /* devMajor */
42  char devMinor[8]; /* 337-344 */ /* devMinor */
43  char prefix[155]; /* 345-499 */
44  char padding[12]; /* 500-512 (pad to exactly TAR_BLOCK_SIZE) */
45 };
46 
47 /*@unchecked@*/
48 extern int _tar_debug;
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
60 int tarHeaderRead(void * _iosm, struct stat * st)
61  /*@globals fileSystem, internalState @*/
62  /*@modifies _iosm, *st, fileSystem, internalState @*/;
63 
70 int tarHeaderWrite(void * _iosm, struct stat * st)
71  /*@globals fileSystem, internalState @*/
72  /*@modifies _iosm, fileSystem, internalState @*/;
73 
79 int tarTrailerWrite(void * _iosm)
80  /*@globals fileSystem, internalState @*/
81  /*@modifies _iosm, fileSystem, internalState @*/;
82 
83 #ifdef __cplusplus
84 }
85 #endif
86 
87 #endif /* H_TAR */
char padding[12]
Definition: tar.h:44
char devMajor[8]
Definition: tar.h:41
char uid[8]
Definition: tar.h:30
char mode[8]
Definition: tar.h:29
char filesize[12]
Definition: tar.h:32
Tar archive header information.
Definition: tar.h:27
char version[2]
Definition: tar.h:38
char gid[8]
Definition: tar.h:31
char mtime[12]
Definition: tar.h:33
char devMinor[8]
Definition: tar.h:42
int _tar_debug
Definition: tar.c:21
struct tarHeader_s * tarHeader
Definition: tar.h:11
char magic[6]
Definition: tar.h:37
char gname[32]
Definition: tar.h:40
char checksum[8]
Definition: tar.h:34
#define TAR_NAME_SIZE
Definition: tar.h:22
char linkname[100]
Definition: tar.h:36
int tarHeaderRead(void *_iosm, struct stat *st)
Read tar header from payload.
Definition: tar.c:122
int tarHeaderWrite(void *_iosm, struct stat *st)
Write tar header to payload.
Definition: tar.c:387
char typeflag
Definition: tar.h:35
char uname[32]
Definition: tar.h:39
char prefix[155]
Definition: tar.h:43
char name[100]
Definition: tar.h:28
int tarTrailerWrite(void *_iosm)
Write cpio trailer to payload.
Definition: tar.c:499