Skip to content

Instantly share code, notes, and snippets.

@lighth7015
Created January 15, 2020 21:27
Show Gist options
  • Save lighth7015/9bb557b7d968e36a94363f7120bac0cf to your computer and use it in GitHub Desktop.
Save lighth7015/9bb557b7d968e36a94363f7120bac0cf to your computer and use it in GitHub Desktop.
IDB file format
Magic number: "IDB" \r \n NULL
Version: 0x01
Flags: is_big_endian
Length of Schemas
Target AS String /* used to identify which program this is for, so */
/* the host program can provide implicit schemas. */
OPTIONAL Schemas OF {
Schema_size AS UInt8
Schema_type AS UInt8
Schema_name AS String
Record_types OF {
Value_type
IF Value_type = Record THEN Record_type
}
}
Value_type /* only really makes sense for this to be a compound type */
Value AS Value_type
-------------------------------------------------------------------------------
Types:
Int8, Int16, Int32, Int64: 0x02-0x05
UInt8, UInt16, UInt32, Uint64: 0x06-0x09
Single, Double: 0x0A, 0x0B
String AS { Length as UInt32, Chars as UInt8 }: 0x01
/* string does not need to be null-terminated */
Record AS {
Size
Element_count
Elements of {
Value_type
Key AS String
Value AS Value_type
}
}: 0x0C
List AS {
Size
Element_count
Elements of {
Value_type
Value AS Value_type
}
}: 0x0D
Sequence AS {
Size
Element_count
Value_type
Values AS Value_type
}: 0x0E
Boolean: 0x0F
Nil: 0x00
Schema types start at 0x10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment