]>
Commit | Line | Data |
---|---|---|
1b1e52a4 WB |
1 | use pxar::format::hash_filename; |
2 | ||
3 | const CONSTANTS: &[(&str, &str, &str)] = &[ | |
57bee6f8 WB |
4 | ( |
5 | "Beginning of an entry (current version).", | |
6 | "PXAR_ENTRY", | |
7 | "__PROXMOX_FORMAT_ENTRY_V2__", | |
8 | ), | |
9 | ( | |
10 | "Previous version of the entry struct", | |
11 | "PXAR_ENTRY_V1", | |
12 | "__PROXMOX_FORMAT_ENTRY__", | |
13 | ), | |
1b1e52a4 WB |
14 | ("", "PXAR_FILENAME", "__PROXMOX_FORMAT_FILENAME__"), |
15 | ("", "PXAR_SYMLINK", "__PROXMOX_FORMAT_SYMLINK__"), | |
16 | ("", "PXAR_DEVICE", "__PROXMOX_FORMAT_DEVICE__"), | |
17 | ("", "PXAR_XATTR", "__PROXMOX_FORMAT_XATTR__"), | |
18 | ("", "PXAR_ACL_USER", "__PROXMOX_FORMAT_ACL_USER__"), | |
19 | ("", "PXAR_ACL_GROUP", "__PROXMOX_FORMAT_ACL_GROUP__"), | |
20 | ("", "PXAR_ACL_GROUP_OBJ", "__PROXMOX_FORMAT_ACL_GROUP_OBJ__"), | |
21 | ("", "PXAR_ACL_DEFAULT", "__PROXMOX_FORMAT_ACL_DEFAULT__"), | |
37774a67 WB |
22 | ( |
23 | "", | |
24 | "PXAR_ACL_DEFAULT_USER", | |
25 | "__PROXMOX_FORMAT_ACL_DEFAULT_USER__", | |
26 | ), | |
27 | ( | |
28 | "", | |
29 | "PXAR_ACL_DEFAULT_GROUP", | |
30 | "__PROXMOX_FORMAT_ACL_DEFAULT_GROUP__", | |
31 | ), | |
1b1e52a4 WB |
32 | ("", "PXAR_FCAPS", "__PROXMOX_FORMAT_FCAPS__"), |
33 | ("", "PXAR_QUOTA_PROJID", "__PROXMOX_FORMAT_QUOTA_PROJID__"), | |
37774a67 WB |
34 | ( |
35 | "Marks item as hardlink", | |
36 | "PXAR_HARDLINK", | |
37 | "__PROXMOX_FORMAT_HARDLINK__", | |
38 | ), | |
1b1e52a4 WB |
39 | ( |
40 | "Marks the beginnig of the payload (actual content) of regular files", | |
41 | "PXAR_PAYLOAD", | |
42 | "__PROXMOX_FORMAT_PXAR_PAYLOAD__", | |
43 | ), | |
37774a67 WB |
44 | ( |
45 | "Marks item as entry of goodbye table", | |
46 | "PXAR_GOODBYE", | |
47 | "__PROXMOX_FORMAT_GOODBYE__", | |
48 | ), | |
1b1e52a4 WB |
49 | ( |
50 | "The end marker used in the GOODBYE object", | |
51 | "PXAR_GOODBYE_TAIL_MARKER", | |
52 | "__PROXMOX_FORMAT_PXAR_GOODBYE_TAIL_MARKER__", | |
53 | ), | |
54 | ]; | |
55 | ||
56 | fn main() { | |
00d36bf9 | 57 | println!("// Generated by `cargo run --example mk-format-hashes`"); |
1b1e52a4 WB |
58 | for constant in CONSTANTS { |
59 | if !constant.0.is_empty() { | |
60 | println!("/// {}", constant.0); | |
61 | } | |
62 | println!( | |
63 | "pub const {}: u64 = 0x{:016x};", | |
64 | constant.1, | |
65 | hash_filename(constant.2.as_bytes()), | |
66 | ) | |
67 | } | |
68 | } |