diff options
author | Colin Walters <walters@verbum.org> | 2010-10-25 13:33:01 -0400 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2010-12-02 12:49:47 -0500 |
commit | 9821bdbbd304612ddcf9164cd7b655341701874f (patch) | |
tree | 3838abbc20c481c8ef57a6b76bf42b8dfa08609c /girepository/gitypelib-internal.h | |
parent | fa383ec4fe3724193b1f551e3915e9620d6b4f20 (diff) | |
download | gobject-introspection-9821bdbbd304612ddcf9164cd7b655341701874f.tar.gz |
Add directory index sectionwip/cmph-rebase3
Use the internal perfect hashing API to add an index to the directory.
To support this, add the notion of additional "sections" to the
typelib. A section index is inserted between the header and the
directory.
https://bugzilla.gnome.org/show_bug.cgi?id=554943
Diffstat (limited to 'girepository/gitypelib-internal.h')
-rw-r--r-- | girepository/gitypelib-internal.h | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/girepository/gitypelib-internal.h b/girepository/gitypelib-internal.h index 227d6da2..e8f5c025 100644 --- a/girepository/gitypelib-internal.h +++ b/girepository/gitypelib-internal.h @@ -52,7 +52,7 @@ G_BEGIN_DECLS * * The typelib has the following general format. * - * typelib ::= header, directory, blobs, attributes, attributedata + * typelib ::= header, section-index, directory, blobs, attributes, attributedata * * directory ::= list of entries * @@ -233,6 +233,7 @@ typedef enum { * write parser which continue to work if the format is extended by * adding new fields before the first flexible array member in * variable-size blobs. + * @sections: Offset of section blob array * * The header structure appears exactly once at the beginning of a typelib. It is a * collection of meta-information, such as the number of entries and dependencies. @@ -278,10 +279,34 @@ typedef struct { guint16 interface_blob_size; guint16 union_blob_size; + guint32 sections; + /* <private> */ - guint16 padding[7]; + guint16 padding[5]; } Header; +typedef enum { + GI_SECTION_END = 0, + GI_SECTION_DIRECTORY_INDEX = 1 +} SectionType; + +/** + * Section: + * @id: A #SectionType + * @offset: Integer offset for this section + * + * A section is a blob of data that's (at least theoretically) optional, + * and may or may not be present in the typelib. Presently, just used + * for the directory index. This allows a form of dynamic extensibility + * with different tradeoffs from the format minor version. + * + */ +typedef struct { + guint32 id; + guint32 offset; +} Section; + + /** * DirEntry: * @blob_type: A #GTypelibBlobType |