]>
git.proxmox.com Git - rustc.git/blob - vendor/object/src/archive.rs
1 //! Archive definitions.
3 //! These definitions are independent of read/write support, although we do implement
4 //! some traits useful for those.
8 /// File identification bytes stored at the beginning of the file.
9 pub const MAGIC
: [u8; 8] = *b
"!<arch>\n";
11 /// File identification bytes at the beginning of AIX big archive.
12 pub const AIX_BIG_MAGIC
: [u8; 8] = *b
"<bigaf>\n";
14 /// File identification bytes stored at the beginning of a thin archive.
16 /// A thin archive only contains a symbol table and file names.
17 pub const THIN_MAGIC
: [u8; 8] = *b
"!<thin>\n";
19 /// The terminator for each archive member header.
20 pub const TERMINATOR
: [u8; 2] = *b
"`\n";
22 /// The header at the start of an archive member.
23 #[derive(Debug, Clone, Copy)]
28 /// File modification timestamp in decimal.
30 /// User ID in decimal.
32 /// Group ID in decimal.
34 /// File mode in octal.
36 /// File size in decimal.
38 /// Must be equal to `TERMINATOR`.
39 pub terminator
: [u8; 2],
42 /// The header at the start of an AIX big archive member, without name.
43 #[derive(Debug, Clone, Copy)]
45 pub struct AixHeader
{
46 /// File member size in decimal.
48 /// Next member offset in decimal.
50 /// Previous member offset in decimal.
52 /// File member date in decimal.
54 /// File member user id in decimal.
56 /// File member group id in decimal.
58 /// File member mode in octal.
60 /// File member name length in decimal.
64 /// The AIX big archive's fixed length header at file beginning.
65 #[derive(Debug, Clone, Copy)]
67 pub struct AixFileHeader
{
68 /// Archive magic string.
70 /// Offset of member table.
72 /// Offset of global symbol table.
74 /// Offset of global symbol table for 64-bit objects.
75 pub gst64off
: [u8; 20],
76 /// Offset of first member.
77 pub fstmoff
: [u8; 20],
78 /// Offset of last member.
79 pub lstmoff
: [u8; 20],
80 /// Offset of first member on free list.
81 pub freeoff
: [u8; 20],
84 /// Offset of a member in an AIX big archive.
86 /// This is used in the member index.
87 #[derive(Debug, Clone, Copy)]
89 pub struct AixMemberOffset(pub [u8; 20]);
91 unsafe_impl_pod
!(Header
, AixHeader
, AixFileHeader
, AixMemberOffset
,);