Revert "[GIPARSER] - tidy up of var args."
[gnome.gobject-introspection] / docs / global-module-registry.txt
1 Problem statement
2 =================
3 On-disk registry for mapping namespace to typelib. 
4 Conceptually similar to mono /etc/mono/config.
5
6 It should be possible in a dynamic language such as python to just do:
7
8 >>> import PythonIntrospectionBindings
9 >>> import Gtk
10
11
12 Gtk should be a special namespace provided by the package containing the
13 Gtk namespace
14
15 Layout of the on disk tool
16 ==========================
17
18 Location to should be /var/lib/glib/introspection-registry.xml
19 Should be read completely. Not expected to be larger than one page on most
20 systems.
21
22 Layout in XML:
23
24 <root>
25   <registry-path location="/usr/lib/typelibs/1.0/">
26   <registry-path location="$HOME/.typelibs/">
27   <entry namespace="Gtk" 
28          library-location="libgtk-x11-2.0.so.0"
29          typelib-location="gtk.typelib"/>
30 </root>
31
32 FIXME: version?
33 FIXME: pkg-config name?
34
35 The overhead should be reduced to a minimum, both runtime and memory footprint.
36 Thus a binary format that is mmap(2):able is ideal:
37
38 gir-registry-tool
39 ================
40 Is a command line utility, probably written in C which should be used
41 to update/modify the registry.
42
43 Example use cases, installing a new typelib
44
45 gir-registry-tool --install Gtk /usr/lib/glib/introspection/gtk.typelib 2.12.0
46 gir-registry-tool --uninstall Gtk /usr/lib/glib/introspection/gtk.typelib 2.12.0
47
48 It's the registry tools responsibility to sort the disk format.
49
50 API
51 ===
52
53 libgirepository should provide an api:
54
55 gi_locale_typelib (const gchar *name, const gchar * version);
56
57 version should NULL, if so it should pick the first one in the on-disk registry.
58
59 libgirepository should mmap the registry and read it when that API is called
60 the first time.