Skip to content.
Sections
Personal tools
You are here: Home » Frame Store » Entries » Entry Data Encoding

Entry Data Encoding

Document Actions
Everything contained in entries is encoded in format resembling Newton Streamed Object Format.

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:

XLong

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.

Immediate

Character

C is character code.

Char

Unicode Character

C is 16 bits of character code.

Unichar

Binary

Length is xlong encoded size of binary object. Class is encoded symbol showing binary class. Object data is placed right after this.

Binary

Array

Slots contain xlong encoded number of items in array. Class is encoded symbol for object class. Item data is placed after array header.

Array

Plain Array

Slots contain number of items in array. Item data is placed after array header. This array class is 'Array.

PlainArray

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.

Frame

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.

Symbol

String

Length is xlong encoded, and contains "unicode" length of string, Class is encoded symbol to strings class.

String

Precedent

Precedent links to previously used array, frame, symbol or binary object. In xlong encoded Number precedent number is stored.

Precedent

Nil

This encodes nil value.

Nil

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.

SmallRect

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).

VBO

Entry Alias

Entry aliases are stored as arrays of class 'alias, containing::

[ nil, StoreSignature, UniqueIDofDestinationEntry, SoupName]

Created by philz
Last modified 2003-07-28 04:16 PM
 

Powered by Plone