1 (* This is an example program using an imported C structure.
3 * The C structure is imported from <linux/ext3_fs.h> via "ext3.c"
4 * by the bitstring-import-c program, and saved as "ext3.bmpp".
6 * Then we can load "ext3.bmpp" here.
11 open bitmatch "ext3.bmpp"
14 (* Load a real ext3 superblock from the examples directory. *)
15 let bits = Bitstring.bitstring_of_file "examples/ext3_sb" in
18 | { :ext2_super_block } ->
19 printf "ext3 superblock:\n";
20 printf " s_inodes_count = %ld\n" s_inodes_count;
21 printf " s_blocks_count = %ld\n" s_blocks_count;
22 printf " s_free_inodes_count = %ld\n" s_free_inodes_count;
23 printf " s_free_blocks_count = %ld\n" s_free_blocks_count;
24 printf " s_uuid = %S\n" s_uuid;
25 printf " s_volume_name = %S\n" s_volume_name;
26 printf " s_last_mounted = %S\n" s_last_mounted
29 failwith "input is not an ext2/3 superblock"