Skip to content

Instantly share code, notes, and snippets.

@nektro
Last active April 22, 2024 00:56
Show Gist options
  • Save nektro/d371537cf3208d535c63508638e5d4a6 to your computer and use it in GitHub Desktop.
Save nektro/d371537cf3208d535c63508638e5d4a6 to your computer and use it in GitHub Desktop.
const Archive = struct {
magic: [4]u8 = [_]u8{ 'q', 'o', 'z', 1 },
files_count: u32,
files: [*]File,
};
const File = struct {
flags: Flags,
data_length: u64,
data_length_uncompressed: u64,
mtime: u64,
ctime: u64,
name_bytes: [*]u8,
data_bytes: [*]u8,
};
const Flags = packed struct(u16) {
kind: enum(u1) { file, symlink },
compression: enum(u4) {
none,
gzip,
zstd,
_,
},
is_executable: bool,
name_length: u10,
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment