# cstruct sample
# usage:
#     :cstruct <cstruct_name>
#     :cstruct <path_to_cstruct_file> <cstruct_name>
#     :cstruct <cstruct_name1> <cstruct_name2> ... <cstruct_nameN>

struct uuid {
	u32 time_low;
	u16 time_mid;
	u16 time_hi_and_version;
	u8 clock_seq_hi_and_reserved;
	u8 clock_seq_low;
	u8 node[6];
};

struct hammer_blockmap {
	x64le phys_offset_;
	x64le first_offset;
	x64le next_offset_;
	x64le alloc_offset;
	u32 reserved01;
	x32le entry_crc;
};

struct hammer_volume_ondisk {
	x64le vol_signature;

	x64le vol_bot_beg;
	x64le vol_mem_beg;
	x64le vol_buf_beg;
	x64le vol_buf_end;
	s64 vol_reserved01;

	struct uuid vol_fsid;
	struct uuid vol_fstype;
	string vol_name[64];

	s32le vol_no;
	s32le vol_count;

	u32le vol_version;
	x32le vol_crc;
	x32le vol_flags;
	u32le vol_rootvol;

	u32 vol_reserved[8];

	s64le vol0_stat_bigblocks;
	s64le vol0_stat_freebigblocks;
	s64 vol0_reserved01;
	s64le vol0_stat_inodes;
	s64 vol0_reserved02;
	x64le vol0_btree_root;
	u64le vol0_next_tid;
	u64 vol0_reserved03;

	struct hammer_blockmap vol0_blockmap[16];
	x64le vol0_undo_array[128];
};
