rpm  4.5
cpio.h
Go to the documentation of this file.
1 #ifndef H_CPIO
2 #define H_CPIO
3 
18 #define CPIOERR_CHECK_ERRNO 0x00008000
19 
31 
52  CPIOERR_ENOENT = (30 ),
54 };
55 
58 typedef enum cpioMapFlags_e {
59  CPIO_MAP_PATH = (1 << 0),
60  CPIO_MAP_MODE = (1 << 1),
61  CPIO_MAP_UID = (1 << 2),
62  CPIO_MAP_GID = (1 << 3),
64  CPIO_MAP_ABSOLUTE = (1 << 5),
65  CPIO_MAP_ADDDOT = (1 << 6),
66  CPIO_ALL_HARDLINKS = (1 << 7),
67  CPIO_MAP_TYPE = (1 << 8),
68  CPIO_SBIT_CHECK = (1 << 9),
69  CPIO_PAYLOAD_LIST = (1 << 10),
71  CPIO_PAYLOAD_CREATE = (1 << 12)
72 } cpioMapFlags;
73 
74 #define CPIO_NEWC_MAGIC "070701"
75 #define CPIO_CRC_MAGIC "070702"
76 #define CPIO_TRAILER "TRAILER!!!"
77 
82  char magic[6];
83  char inode[8];
84  char mode[8];
85  char uid[8];
86  char gid[8];
87  char nlink[8];
88  char mtime[8];
89  char filesize[8];
90  char devMajor[8];
91  char devMinor[8];
92  char rdevMajor[8];
93  char rdevMinor[8];
94  char namesize[8];
95  char checksum[8]; /* ignored !! */
96 };
97 
98 #define PHYS_HDR_SIZE 110 /* Don't depend on sizeof(struct) */
99 
100 /*@unchecked@*/
101 extern int _cpio_debug;
102 
103 #ifdef __cplusplus
104 extern "C" {
105 #endif
106 
112 int cpioTrailerWrite(FSM_t fsm)
113  /*@globals h_errno, fileSystem, internalState @*/
114  /*@modifies fsm, fileSystem, internalState @*/;
115 
122 int cpioHeaderWrite(FSM_t fsm, struct stat * st)
123  /*@globals h_errno, fileSystem, internalState @*/
124  /*@modifies fsm, fileSystem, internalState @*/;
125 
132 int cpioHeaderRead(FSM_t fsm, struct stat * st)
133  /*@globals h_errno, fileSystem, internalState @*/
134  /*@modifies fsm, *st, fileSystem, internalState @*/;
135 
141 /*@observer@*/ const char * cpioStrerror(int rc)
142  /*@*/;
143 
144 #ifdef __cplusplus
145 }
146 #endif
147 
148 #endif /* H_CPIO */