rpm
4.5
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
lib
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
22
enum
cpioErrorReturns
{
23
CPIOERR_BAD_MAGIC
= (2 ),
24
CPIOERR_BAD_HEADER
= (3 ),
25
CPIOERR_OPEN_FAILED
= (4 |
CPIOERR_CHECK_ERRNO
),
26
CPIOERR_CHMOD_FAILED
= (5 |
CPIOERR_CHECK_ERRNO
),
27
CPIOERR_CHOWN_FAILED
= (6 |
CPIOERR_CHECK_ERRNO
),
28
CPIOERR_WRITE_FAILED
= (7 |
CPIOERR_CHECK_ERRNO
),
29
CPIOERR_UTIME_FAILED
= (8 |
CPIOERR_CHECK_ERRNO
),
30
CPIOERR_UNLINK_FAILED
= (9 |
CPIOERR_CHECK_ERRNO
),
31
32
CPIOERR_RENAME_FAILED
= (10 |
CPIOERR_CHECK_ERRNO
),
33
CPIOERR_SYMLINK_FAILED
= (11 |
CPIOERR_CHECK_ERRNO
),
34
CPIOERR_STAT_FAILED
= (12 |
CPIOERR_CHECK_ERRNO
),
35
CPIOERR_LSTAT_FAILED
= (13 |
CPIOERR_CHECK_ERRNO
),
36
CPIOERR_MKDIR_FAILED
= (14 |
CPIOERR_CHECK_ERRNO
),
37
CPIOERR_RMDIR_FAILED
= (15 |
CPIOERR_CHECK_ERRNO
),
38
CPIOERR_MKNOD_FAILED
= (16 |
CPIOERR_CHECK_ERRNO
),
39
CPIOERR_MKFIFO_FAILED
= (17 |
CPIOERR_CHECK_ERRNO
),
40
CPIOERR_LINK_FAILED
= (18 |
CPIOERR_CHECK_ERRNO
),
41
CPIOERR_READLINK_FAILED
= (19 |
CPIOERR_CHECK_ERRNO
),
42
CPIOERR_READ_FAILED
= (20 |
CPIOERR_CHECK_ERRNO
),
43
CPIOERR_COPY_FAILED
= (21 |
CPIOERR_CHECK_ERRNO
),
44
CPIOERR_LSETFCON_FAILED
= (22 |
CPIOERR_CHECK_ERRNO
),
45
CPIOERR_HDR_SIZE
= (23 ),
46
CPIOERR_HDR_TRAILER
= (24 ),
47
CPIOERR_UNKNOWN_FILETYPE
= (25 ),
48
CPIOERR_MISSING_HARDLINK
= (26 ),
49
CPIOERR_DIGEST_MISMATCH
= (27 ),
50
CPIOERR_INTERNAL
= (28 ),
51
CPIOERR_UNMAPPED_FILE
= (29 ),
52
CPIOERR_ENOENT
= (30 ),
53
CPIOERR_ENOTEMPTY
= (31 )
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),
63
CPIO_FOLLOW_SYMLINKS
= (1 << 4),
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),
70
CPIO_PAYLOAD_EXTRACT
= (1 << 11),
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
81
struct
cpioCrcPhysicalHeader
{
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 */
Generated on Mon Oct 27 2014 16:03:31 for rpm by
1.8.3.1