
  Format of embedded typeinfo streams
=======================================

Typeinfo streams contain interfaces and types definition identical to the
content of IDL file it was generated from, but in form that is much easier
to parse by libpff.

Typeinfo stream contains arbitrary number of chunks. Each chunk is preceded by 
uint32_t value containing length of the following chunk. The stream is ended by
chunk length value of zero (no chucks follow).

All values are in network byte order (big-endian, i.e. non-Intel).

 Data types
============

uint8_t, uint16_t, uint32_t have their usual meaning. Additional types
are defined as follows:

"str" exands to:
---
uint16_t     lng         length of the string with
"lng" bytes  id          string data (*not* null-terminated!)
---

"IID" expands to:
---
uint32_t     iid_1       1st part of interface's IID
uint32_t     iid_2       2nd
uint32_t     iid_3       3rd
uint32_t     iid_4       4th
uint16_t     major       major version number
uint16_t     minor       minor version number
---

"bool" is same as uint8_t, but values may only be "0" or "1".


 Chunk layout
==============

Every chunk begins with this header:

uint8_t      type        chunk type. Possible values are:
                             ENTITY_INTERFACE   = 0
                             ENTITY_TYPEDEF     = 1
                             ENTITY_NATIVE_TYPE = 2
                             ENTITY_STRUCT      = 3
                             ENTITY_CONST       = 4
                             ENTITY_UNION       = 5
                             ENTITY_ENUM        = 6
str          id          string identifier of the type

The rest of chunk is type-specific


 ENTITY_INTERFACE
------------------
IID          iid         interface's IID
uint16_t     superCnt    number of super-interfaces from that this iface
                         inherits
superCnt*str supers[]    superCnt iface names of super-interfaces
uint16_t     methodCnt   number of methods
<methodCnt times following block:>
  string     name        method name
  string     retval      type of return value
  uint16_t   paramCnt    number of parameters the method takes
  <paramCnt times following block:>
    string   type        parameter type
    string   name        parameter name
    bool     in          is it input parameter?
    bool     out         is it output parameter?
bool         singleImpl  1 if this iface has #pragma single_impl, 0 otherwise


 ENTITY_NATIVE_TYPE
--------------------
(nothing more)


 ENTITY_CONST
--------------
string       type        constant's type
string       value       constant's value


 ENTITY_TYPEDEF
----------------
uint8_t      kind        1 = sequence typedef
                         2 = simple typedef
string       type        typedefed type. if kind==1, then the real type
                         will be sequence<type>


 ENTITY_STRUCT
---------------
uint16_t     cnt         number of variables in the struct
<cnt times following block:>
  string     type        variable type
  string     name        variable name


 ENTITY_UNION
--------------
string       switchType  type used for union's switch statement
uint16_t     caseCnt     number of 'case X:' statements in the union
<caseCnt times following block:>
  string     case        switch case value (is legal switchType value)
  string     type        type of variable used in this case
  string     name        name of variable used in this case


 ENTITY_ENUM
-------------
uint16_t     cnt
<cnt times following block:>
  string     value       enum item value
