Skip to content

Instantly share code, notes, and snippets.

@nektro
Last active August 23, 2025 02:53
Show Gist options
  • Select an option

  • Save nektro/d371537cf3208d535c63508638e5d4a6 to your computer and use it in GitHub Desktop.

Select an option

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(u3) {
none,
gzip,
zstd,
_,
},
is_executable: bool,
name_length: u11,
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment