Bug 552858: versioning

This is a big patch.  You should probably remove your installation
	tree to be cleaner.

	* docs/typelib-format.txt: Add nsversion entry which holds
	version of namespace.
	* girepository/girepository.h: Add 'version' parameter to
	g_irepository_require.  This may be NULL.  Normally
	bindings should pass an explicit version though.
	* girepository/girepository.c: Lots of infrastructure to
	support versioning.  Add some more documentation.  Disallow
	some usage of NULL namespaces.
	* girepository/girmodule.c: Add version parameter.
	* girepository/gtypelib.c: Update header size.
	* giscanner/ast.py: Add version to Namespace.
	* giscanner/girparser.py: Parse version attribute from
	XML, pass to Namespace.
	* giscanner/girwriter.py: Write out version parameter.
	* giscanner/transformer.py: Clean up include registration.
	* tests/*: Add version attribute.
	* tests/invoke/invoke.c: Don't try looking up test before
	it's loaded in repository.
	* tools/generate.c: Output version parameter.
	* gir/Makefile.am: Add 2.0 version to .gir files.

svn path=/trunk/; revision=677
This commit is contained in:
Colin Walters
2008-10-12 04:51:48 +00:00
parent 1b2aa59534
commit 3be641f836
7 changed files with 542 additions and 134 deletions

View File

@@ -82,17 +82,19 @@ const char * g_irepository_load_typelib (GIRepository *repository,
GIRepositoryLoadFlags flags,
GError **error);
gboolean g_irepository_is_registered (GIRepository *repository,
const gchar *namespace);
const gchar *namespace,
const gchar *version);
GIBaseInfo * g_irepository_find_by_name (GIRepository *repository,
const gchar *namespace,
const gchar *name);
gboolean g_irepository_require (GIRepository *repository,
const char *namespace,
const gchar *namespace,
const gchar *version,
GIRepositoryLoadFlags flags,
GError **error);
gchar ** g_irepository_get_dependencies (GIRepository *repository,
const char *namespace);
gchar ** g_irepository_get_namespaces (GIRepository *repository);
const gchar *namespace);
gchar ** g_irepository_get_loaded_namespaces (GIRepository *repository);
GIBaseInfo * g_irepository_find_by_gtype (GIRepository *repository,
GType gtype);
gint g_irepository_get_n_infos (GIRepository *repository,
@@ -104,6 +106,9 @@ const gchar * g_irepository_get_typelib_path (GIRepository *repository,
const gchar *namespace);
const gchar * g_irepository_get_shared_library (GIRepository *repository,
const gchar *namespace);
const gchar * g_irepository_get_version (GIRepository *repository,
const gchar *namespace);
/* Typelib */
GTypelib * g_typelib_new_from_memory (guchar *memory,
@@ -112,6 +117,7 @@ GTypelib * g_typelib_new_from_const_memory (const guchar *memory,
gsize len);
GTypelib * g_typelib_new_from_mapped_file (GMappedFile *mfile);
void g_typelib_free (GTypelib *typelib);
gboolean g_typelib_symbol (GTypelib *typelib,
const gchar *symbol_name,
gpointer *symbol);
@@ -121,6 +127,7 @@ typedef enum
{
G_IREPOSITORY_ERROR_TYPELIB_NOT_FOUND,
G_IREPOSITORY_ERROR_NAMESPACE_MISMATCH,
G_IREPOSITORY_ERROR_NAMESPACE_VERSION_CONFLICT,
G_IREPOSITORY_ERROR_LIBRARY_NOT_FOUND
} GIRepositoryError;