OpenOfficeBinary specification of the type representation in the UNO typelibrary


Overview

The typelibrary consists of complete typedecriptions for each existing IDL type. This typedescriptions are organized in a hierarchical form which represents the IDL module structure including a node for the type itself. Each type node has a binary type blob which contains the complete type information.
The main aim of the sepcification is to keep the format simple and extendable for further extensions (e.g support of CORBA IDL)

Structure

The structure of the type blob depends on the kind of the type. The first part is relevant for each type and the other parts depend on the type. For example, a structure has only an additional field section because it isn't possible to specify methods for structures.


Header section

  • magic, type: sal_uInt32
    a reserved field for internal use.
  • size, type: sal_uInt32
    represents the size of the blob in bytes.
  • minor,major version, type: sal_uInt16
    two fields to specify a version number for the binary format.
  • nHeaderFields, type: sal_uInt16
    specifies the number of fields in the header section. This number is used for calculating the offset of the next section.
  • typeSource, type: sal_uInt16
    specifies in which language the type was defined, e.g. UNO IDL, CORBA IDL or Java.
  • typeClass, type: sal_uInt16
    specify the typeclass of the described type, e.g. interface or enum.
  • name, type: sal_uInt16
    represents an index for a string item in the constant item pool which specifies the full qualified name of the type.
  • Uik, type: sal_uInt16
    represents an index for a Uik item in the constant item pool which contains the Uik information for an interface.
    This field is 0 if the type isn't an interface.
  • docu, type: sal_uInt16
    represents an index for a string item in the constant item pool which contains the documentation of this type.
  • filename, type sal_uInt16
    represents an index for a string item in the constant item pool which specifies the name of the source file where the type is defined.
  • nSuperTypes, type: sal_uInt16
    specifies the count of supertypes. This field is only relevant for structs, exceptions, services and interfaces. If nSuperTypes > 0 than the next section is an area with size nSuperTypes * sal_uInt16, which represents indices for string items in the constant pool.

Constant pool section

The constant pool section consists of nConstantPoolCount entries of variable length and type. Each entry constists of three fields:

  • size, type: sal_uInt32
    specifies the size of the entry in bytes
  • type tag, type: sal_uInt16
    specifies the type of the data field.
  • data, type: sal_uInt8
    specifies the raw data of the entry with (size - sizeof(sal_uInt32) - sizeof(sal_uInt16)) bytes.

Field section

The field section represents type information for struct or exception members, const types, enums, service members and attributes of interfaces. This section only exists if the field nFieldCount is > 0.

  • nFieldCount, type: sal_uIn16
    specifies the number of fields in the field section.
  • nFieldEntries, type: sal_uInt16
    specifies the number of fields for each entry in the field section. This number is used for calculating the offsets in the field section.
  • access, type: sal_uInt16
    specifies the access of the field, e.g. readonly.
  • name, type: sal_uInt16
    represents an index for a string item in the constant item pool which specifies the name of the field.
  • typename, type: sal_uInt16
    represents an index for a string item in the constant item pool which specifies the full qualified typename of the field.
  • value, type: sal_uInt16
    represents an index for an item in the constant item pool with the same type specified by typename which represents the value of the field, e.g. the initial enum value or the value of a constant. This field could be 0.
  • docu, type: sal_uInt16
    represents an index for a string item in the constant item pool which contains the documentation of this field.
  • filename, type: sal_uInt16
    represents an index for a string item in the constant item pool which specifies the name of the source file where the field is defined. This could be differ from the filename in the header section, because constants could be defned in different source files.

Method section

The method section represents type information for interface methods. This section only exists if the field nMethodCount is > 0.

  • nMethodCount, type: sal_uIn16
    specifies the number of methods in the method section.
  • nMethodEntries, type: sal_uInt16
    specifies the number of fields for each entry in the method section. This number is used for calculating the offsets in the method section.
  • nParameterEntries, type: sal_uInt16
    specifies the number of fields for each entry in a parameter section. This number is used for calculating the offsets in the parameter section.
  • size, type: sal_uInt16
    specifies the size of the current method entry in bytes.
  • mode, type: sal_uInt16
    specifies the mode of the method, e.g oneway.
  • name, type: sal_uInt16
    represents an index for a string item in the constant item pool which specifies the name of the method.
  • returntype, type: sal_uInt16
    represents an index for a string item in the constant item pool which specifies the full qualified typename of the returntype of the method.
  • docu, type: sal_uInt16
    represents an index for a string item in the constant item pool which contains the documentation of this method.
  • nParamCount, type: sal_uInt16
    specifies the number of parameters for this method. If parameters exists the parameter section follows this field.
  • type, type: sal_uInt16
    represents an index for a string item in the constant item pool which specifies the full qualified typename of the parameter.
  • mode, type: sal_uInt16
    specifies the mode of the method, e.g in, out or inout.
  • name, type: sal_uInt16
    represents an index for a string item in the constant item pool which specifies the name of the parameter.
  • nExceptionCount, type: sal_uInt16
    specifies the number of exceptions for this method. If exceptions exists the exception section follows this field.
  • excpName 1 .. n, type: sal_uInt16
    represent indices for string items in the constant item pool which specifies the full qualified name of exceptions.

Reference section

The reference section represents type information for references in services. This section only exists if the field nReferenceCount is > 0.

  • nReferenceCount, type: sal_uInt16
    specifies the number of references for this type.
  • nReferenceEntries, type: sal_uInt16
    specifies the number of fields for each entry in the reference section. This number is used for calculating the offsets in the reference section.
  • typename, type: sal_uInt16
    represents an index for a string item in the constant item pool which specifies the full qualified typename of the reference.
  • name, type: sal_uInt16
    represents an index for a string item in the constant item pool which specifies the name of the reference.
  • docu, type: sal_uInt16
    represents an index for a string item in the constant item pool which contains the documentation of this reference.
  • access, type: sal_uInt16
    specifies the access of the reference, e.g. needs, observes or interface.


Auhor: Juergen Schmidt ($Date: 2001/08/09 13:27:05 $)
Copyright 2001 Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, CA 94303 USA.