Entry Data Encoding
Integer Encoding
Fields shown in light green contain either one byte with value less than 0xFF, or sequence of 0xFF and 4 bytes of value, like here:
Immediate
Immediate is either one or 5 bytes, encoded as xlong. Remember, that stored values are NewtonScript immediates, i.e. integer is shifted two bits left.
Character
C is character code.
Unicode Character
C is 16 bits of character code.
Binary
Length is xlong encoded size of binary object. Class is encoded symbol showing binary class. Object data is placed right after this.
Array
Slots contain xlong encoded number of items in array. Class is encoded symbol for object class. Item data is placed after array header.
Plain Array
Slots contain number of items in array. Item data is placed after array header. This array class is 'Array.
Frame
B contains index to framemap object link in root entry. Offset is offset from beginning of framemaps entry to this frame's framemap. Item data is placed after frame header. Number of them is derived from framemap.
Algorithm for generating framemap hashes is like:
def idxForFramemap(framemap)
hash = 0
for i = 0..framemap.size do
hash = hash ^ framemap[i].hash
hash >>= i
end
return hash&0x3F
end
This function would give "base" slot for a hashmap, id>>6 would give sequential number of framemap in framemaps object.
Symbol
B contains index to symbol list object link in root entry. Offset contains offset from symbols object to beginning of symbol.
String
Length is xlong encoded, and contains "unicode" length of string, Class is encoded symbol to strings class.
Precedent
Precedent links to previously used array, frame, symbol or binary object. In xlong encoded Number precedent number is stored.
Nil
This encodes nil value.
Small Rectangle
This encodes frame like this::
{ top: T, left: L, bottom: B, right: R }
Frame class is 'RECT, and each value must be smaller than 0xFF.
Large Binary
ObjectID stores object id of VBO's root object. After object id, symbol for VBO's class is referenced. B is symbol table number, and Offset is offset to symbol in table (just like for symbols).
Entry Alias
Entry aliases are stored as arrays of class 'alias, containing::
[ nil, StoreSignature, UniqueIDofDestinationEntry, SoupName]

