Commit Graph

54 Commits

Author SHA1 Message Date
Johan Dahlin
64ee6cb5b0 [gtypelib.ch] Rename to gitypelib.ch
Rename gtypelib.h -> gitypelib-internal.h and rename
gtypelib.c to gitypelib.c
2010-05-31 17:47:50 -03:00
Johan Dahlin
7e2e379388 [girepository] Use g_slice
Use g_slice to allocate instead of g_new(x, 1); It uses a memory
pool internally and should be faster, especially for GBaseInfo/GRealInfo,
structs which are tiny.
2010-05-20 11:41:44 -03:00
Johan Dahlin
51118b3338 [girepository] Document most of the structs 2010-05-18 18:11:58 -03:00
Johan Dahlin
9f4cadec60 [girepository] Update gtk-doc syntax
Update the gtk-doc syntax to remove a couple of warnings
2010-05-18 18:11:57 -03:00
Johan Dahlin
6b0463dd16 [girepository] Remove trailing whitespace 2010-03-24 15:02:05 -03:00
Javier Jardón
e568b5f9fd Substitute deprecated Glib symbol: g_mapped_file_free
glib-compat.h file created to use g_mapped_file_unref only if
glib >= 2.22 is available

https://bugzilla.gnome.org/show_bug.cgi?id=603727
2009-12-15 11:06:50 -02:00
Colin Walters
1735ebde9a [typelib] Clean up dlopen handling
It's was busted that g_typelib_new_* does the dlopen() since that caused
g-ir-compiler to load the modules even though it wasn't going to do
anything with them.

Instead, change things so that g_module_symbol does the dlopen on-demand.
Remove the extra dlopen(NULL) inside girepository.c, we had another
already in gtypelib.c.

Thanks to Owen Taylor for suggesting this approach.
2009-08-19 11:05:08 -04:00
Mark Lee
378350f3a9 Bug 584423 – Add short/ushort support
Add type tags for short and ushort, plus all of the requisite code needed
to utilize them in libgirepository.
Add support in the scanner's AST files.
Add test functions to the everything library and the expected gir file.

gtypelib.c constant validation fixed by Colin Walters <walters@verbum.org>
2009-06-22 14:01:56 -04:00
Colin Walters
2898d23962 Bug 564016 - Include c:prefix in typelib, use it to optimize find_by_gtype
Parse the c:prefix from the .gir, include it in the header.  Armed with this
information, we can now optimize lookups of GTypes because we
have the requirement that GTypes must start with the c:prefix.  We do
fall back though if a lookup fails.
2009-03-17 16:29:08 -04:00
Robert Carr
cd46d2fa0b Fix build 2009-02-12 09:51:16 -05:00
Johan Dahlin
fe8c6d34c4 Add gtk-doc support 2009-02-12 01:32:25 -02:00
Johan Dahlin
9bf5ee61a4 Bug 567813 – Everything should be versioned
2009-01-15  Johan Dahlin  <jdahlin@async.com.br>

        Bug 567813 – Everything should be versioned

        * gir/Makefile.am:
        * girepository/Makefile.am:
        * girepository/girepository.c (init_globals):
        * girepository/girparser.c (locate_gir):
        * giscanner/dumper.py:
        * giscanner/transformer.py:
        * gobject-introspection-1.0.pc.in:
        * tests/everything/Makefile.am:
        * tests/invoke/Makefile.am:
        * tests/offsets/Makefile.am:
        * tests/repository/Makefile.am:
        * tests/scanner/Makefile.am:
        * tools/Makefile.am:


svn path=/trunk/; revision=1046
2009-01-15 22:31:07 +00:00
Colin Walters
3fff99dfcc Bug 562914: Order GI_TYPELIB_PATH before anything else
We want the environment variable to override so that people can
easily write scripts that run their programs uninstalled.

svn path=/trunk/; revision=1024
2009-01-12 21:42:58 +00:00
Colin Walters
2971e35fe6 Bug 567212: Exit after dumping
The intended use of g_irepository_get_option_group is that your
application more transparently supports --introspection-dump; we
should exit so that your app doesn't continue trying to launch.

svn path=/trunk/; revision=1023
2009-01-12 21:31:45 +00:00
Johan Bilien
bb9820839a Bug 563998 – Cache the GIBaseInfo for GTypes
2008-12-10  Johan Bilien  <jobi@via.ecp.fr>

	Bug 563998 – Cache the GIBaseInfo for GTypes

	* girepository/girepository.c (g_irepository_find_by_gtype):
	add a cache of GType -> GIBaseInfo.


svn path=/trunk/; revision=991
2008-12-10 17:53:09 +00:00
Colin Walters
e8718f0250 Remove debug print
svn path=/trunk/; revision=971
2008-11-25 21:48:38 +00:00
Colin Walters
a573a1c741 Bug 561137 - support multiple repositories
This change makes us stop calling g_irepository_get_default inside ginfo.c,
which won't work for non-default repositories.

Change GIBaseInfo to not only keep track of its source repository,
we hold a reference.  This makes memmgt much clearer.

svn path=/trunk/; revision=970
2008-11-25 21:48:34 +00:00
Colin Walters
e6cf04484d Ensure we always call init_globals
svn path=/trunk/; revision=938
2008-11-17 00:49:58 +00:00
Colin Walters
b87284dac2 g_irepository_get_default is (transfer none)
svn path=/trunk/; revision=937
2008-11-17 00:39:46 +00:00
Colin Walters
1ffeeab3d4 g_irepository_dump implementation
svn path=/trunk/; revision=911
2008-11-13 19:57:09 +00:00
Tommi Komulainen
092901f3ab Fix minor memory leak.
2008-11-12  Tommi Komulainen  <tommi.komulainen@iki.fi>

	* girepository/girepository.c (find_namespace_latest): Fix
	minor memory leak.

svn path=/trunk/; revision=899
2008-11-12 14:42:13 +00:00
Johan Dahlin
afe696cafd Change the element type from utf8 to filename Special case filename
2008-11-12  Johan Dahlin  <jdahlin@async.com.br>

        * girepository/girepository.c:
        Change the element type from utf8 to filename
        * girepository/girnode.c (g_ir_node_build_typelib):
        Special case filename equally to utf8 here.


svn path=/trunk/; revision=895
2008-11-12 12:59:01 +00:00
Johan Dahlin
bc1f9c5bbb Add a g_irepository_get_search_path, so we can access the search paths
2008-11-12  Johan Dahlin  <jdahlin@async.com.br>

        * girepository/girepository.c (g_irepository_get_search_path):
        * girepository/girepository.h:
        Add a g_irepository_get_search_path, so we can access the search
        paths from runtime.


svn path=/trunk/; revision=893
2008-11-12 12:40:34 +00:00
Colin Walters
310f119141 Bug 557791 – g_irepository_require() could return a GTypelib *
svn path=/trunk/; revision=816
2008-10-25 15:48:50 +00:00
Colin Walters
3944a895ce Bug 557076 - move typelibs to $libdir
svn path=/trunk/; revision=813
2008-10-25 14:59:25 +00:00
Johan Bilien
bb2b5e1ee3 Bug 557468 – Support for GI_TYPELIB_PATH
2008-10-23  Johan Bilien  <jobi@via.ecp.fr>

	Bug 557468 – Support for GI_TYPELIB_PATH

	* girepository/girepository.c: if the GI_TYPELIB_PATH is set, add the
	provided paths to the global search path.


svn path=/trunk/; revision=786
2008-10-23 09:10:04 +00:00
Colin Walters
adc6a3e2ef Respect path ordering for unversioned requires
svn path=/trunk/; revision=778
2008-10-21 18:41:36 +00:00
Tommi Komulainen
4fb5b001bb Bug 556543 – reduce compiler warnings
2008-10-16  Tommi Komulainen  <tommi.komulainen@iki.fi>

	Bug 556543 – reduce compiler warnings

	* girepository/ginfo.c:
	* girepository/girepository.c (register_internal,
	count_interfaces, find_interface, find_namespace_version,
	parse_version, g_irepository_require):
	* girepository/girmodule.c (g_ir_module_build_typelib):
	* girepository/girnode.c (init_stats, dump_stats,
	_g_irnode_init_stats, _g_irnode_dump_stats,
	g_ir_node_can_have_member):
	* girepository/girparser.c (firstpass_end_element_handler,
	locate_gir, parse_basic, parse_type_internal, resolve_aliases,
	start_alias, start_type, end_type_top, parse_include, cleanup,
	post_filter):
	* girepository/gtypelib.c (validate_function_blob, validate_enum_blob):
	* giscanner/giscannermodule.c (directive_get_options,
	type_get_child_list):
	* giscanner/scannerlexer.l (parse_gtkdoc):
	* giscanner/scannerparser.y (ctype_free):
	* giscanner/sourcescanner.c:
	* giscanner/sourcescanner.h (gi_source_scanner_parse_macros):
	* tests/types/gitesttypes.c:
	* tools/compiler.c (main):
	* tools/generate.c (write_repository): Remove unused variables
	and code, add missing includes, declarations and case
	statements.

svn path=/trunk/; revision=730
2008-10-16 17:07:05 +00:00
Colin Walters
7db23628b0 Merge branch 'bug556331-includecleanup'
svn path=/trunk/; revision=724
2008-10-16 01:40:29 +00:00
Colin Walters
5069680682 Document g_irepository_get_dependencies
svn path=/trunk/; revision=701
2008-10-13 16:59:09 +00:00
Colin Walters
0103bf1fe3 Don't cast DirEntry to Blob, actually look it up by offset
svn path=/trunk/; revision=696
2008-10-12 21:22:44 +00:00
Colin Walters
1ff932e7a1 Fix inverted test for success in version parsing.
svn path=/trunk/; revision=687
2008-10-12 21:03:41 +00:00
Tommi Komulainen
6a82099f9b Bug 556048 – Crash in g_irepository_find_by_gtype
* girepository/gtypelib.h (BLOB_IS_REGISTERED_TYPE): added
	* girepository/girepository.c (find_interface): Fix
	find_by_gtype case to get the type name from right offset

svn path=/trunk/; revision=686
2008-10-12 20:53:26 +00:00
Colin Walters
5cfc7580a3 Add tests/repository which has some repository regression tests
svn path=/trunk/; revision=683
2008-10-12 16:36:29 +00:00
Colin Walters
3be641f836 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
2008-10-12 04:51:48 +00:00
Lucas Rocha
a0d5227db5 fix regression on invoke test case by making sure we load the global
2008-10-09  Lucas Rocha  <lucasr@gnome.org>

	* girepository/girepository.c (register_internal): fix regression on
	invoke test case by making sure we load the global module in the
	typelib when dealing with inline typelibs.
	* girepository/gtypelib.c: a couple of coding style fixes.

svn path=/trunk/; revision=661
2008-10-09 16:44:11 +00:00
Lucas Rocha
728beb0424 Bug 555294: Add support for multiple shared libraries per typelib.
2008-10-06  Lucas Rocha  <lucasr@gnome.org>

	Bug 555294: Add support for multiple shared libraries per typelib.

	* girepository/ginvoke.c (g_function_info_invoke),
	girepository/ginfo.c(g_registered_type_info_get_g_type): use
	g_typelib_symbol instead of g_module_symbol.
	* girepository/girepository.h: remove g_typelib_set_module and add
	g_typelib_symbol.
	* girepository/gtypelib.[ch] (find_some_symbol, _g_typelib_init,
	g_typelib_new_from_memory, g_typelib_new_from_const_memory,
	g_typelib_free, g_typelib_symbol): chnage GTypeLib to hold a list of
	modules instead of just one. The symbol lookup is now abstracted
	behind g_typelib_symbol which tries to find the passed symbol name in
	one of its modules.
	* giscanner/girwriter.py, tools/g-ir-scanner: change scanner to read
	and write shared_library attribute as a comma-separated list of libs.

svn path=/trunk/; revision=660
2008-10-07 21:25:01 +00:00
Colin Walters
b26d8d2dce Bug 554632: Create type tag for GType
svn path=/trunk/; revision=641
2008-10-02 13:25:46 +00:00
Colin Walters
8fc943f941 Merge branch 'bug552566-timet/wip'
svn path=/trunk/; revision=624
2008-09-23 18:20:25 +00:00
Colin Walters
74651b01bd Remove g_irepository_unregister, add GIRepositoryLoadFlags
svn path=/trunk/; revision=543
2008-08-30 20:31:12 +00:00
Colin Walters
6e656b4498 Put dependencies in typelibs, resolve them when loading
* gir/Makefile.am: Dep on Makefile
	* girepository/ginfo.c: Print out a nicer error
	message if we failed to load something.
	* girepository/girepository.c: Clean up
	default typelib handling; remove global
	default_typelib variable.  Ensure we handle
	NULL repository in more places.
	Support dependency resolution.
	* tests/Makefile.am: Kill off gobject.gir,
	it conflicts with the real one.
	* tests/Object.gir: Depend on GObject.
	* tools/generate.c: Take --includedir
	argument to say which directories to search
	for typelibs.  Print out dependencies.

svn path=/trunk/; revision=541
2008-08-30 20:31:07 +00:00
Colin Walters
c9951bd099 Search $DATADIR/girepository instead of $DATADIR/gitypelibs; this naming
2008-08-26  Colin Walters  <walters@verbum.org>

	* girepository/girepository.c: Search
	$DATADIR/girepository instead of
	$DATADIR/gitypelibs; this naming makes
	it clearer that e.g. jgir can install
	.jars there.
	* gir/Makefile.am: Install there.

svn path=/trunk/; revision=502
2008-08-26 21:55:42 +00:00
Colin Walters
92b476b8c1 Don't open shared library here; we already do it in gtypelib.c.
2008-08-24  Colin Walters  <walters@verbum.org>

	* girepository/girepository.c (g_irepository_require):
	Don't open shared library here; we already do it
	in gtypelib.c.

svn path=/trunk/; revision=483
2008-08-24 16:55:07 +00:00
Johan Dahlin
bfb52af903 Plug memory leak and avoid using freed memory. Resolve the whole module
2008-08-21  Johan Dahlin  <johan@gnome.org>

    * girepository/girepository.c (g_irepository_require):
    Plug memory leak and avoid using freed memory.
    Resolve the whole module path, here as well.


svn path=/trunk/; revision=441
2008-08-21 16:38:03 +00:00
Colin Walters
3011ce4539 Fix one small leak in error case.
2008-08-21  Colin Walters  <walters@verbum.org>

	* girepository/girparser.c (g_irepository_require):
	Fix one small leak in error case.

svn path=/trunk/; revision=434
2008-08-21 13:26:53 +00:00
Johan Dahlin
790ba0d7b0 Rewrap and fix double free bug by leaking a bit.
2008-08-21  Johan Dahlin  <johan@gnome.org>

    * girepository/girepository.c (g_irepository_require):
    Rewrap and fix double free bug by leaking a bit.


svn path=/trunk/; revision=430
2008-08-21 06:47:49 +00:00
Colin Walters
c09cf789a0 Add new function g_irepository_get_typelib_path which tells us from where
2008-08-20  Colin Walters  <walters@verbum.org>

	* girepository/girepository.c: Add new function
	g_irepository_get_typelib_path which tells
	us from where we loaded a namespace.

svn path=/trunk/; revision=429
2008-08-21 03:06:13 +00:00
Colin Walters
61ae81c9c8 Remove g_irepository_register_file in favor of g_irepository_require.
2008-08-20  Colin Walters  <walters@verbum.org>

	* girepository/girepository.c: Remove
	g_irepository_register_file in favor of
	g_irepository_require.  There are two
	possible deployment scenarios for typelibs:
	First, separate in $DATADIR/gitypelibs/.  Second,
	they may be embedded in shlibs.  However since
	the first is now the normal case, the API is
	optimized around it.

	Refactor internals to look up typelibs for
	namespaces just-in-time, but we expect
	consumers to call g_irepository_require.

	Also, add some docs.  No one has died from that
	before.
	* gir/Makefile.am: Need --library for glib.
	* giscanner/girwriter.py: Write out shared-library.
	* tools/g-ir-writer: Take the first --library
	argument as the target of shared-library.  In
	the future we should make this nicer with pkg-config
	probably.

svn path=/trunk/; revision=426
2008-08-20 23:56:40 +00:00
Colin Walters
89e881b47b Rename .gir files using GI namespace. Use XDG_DATA_DIRS for looking up
2008-08-20  Colin Walters  <walters@verbum.org>

	* gir/Makefile.am: Rename .gir files using GI namespace.
	* girepository/girepository.c: Use XDG_DATA_DIRS for
	looking up typelibs.  Also typelibs are now suffixed
	with .typelib.
	* tests/invoke/Makefile.am: Only use metadata.
	* girepository/Makefile.am: Remove unnecessary include.
	* tests/scanner/Makefile.am: Update using GI namespaces
	for scanner includes.

svn path=/trunk/; revision=422
2008-08-20 19:17:14 +00:00
Johan Dahlin
b3312fb83f Make enum serializing functions public. Clean up some whitespace.
2008-08-18  Johan Dahlin  <johan@gnome.org>

    * girepository/girepository.c (g_type_tag_to_string):
    * girepository/girepository.h:
    * girepository/girnode.c (g_ir_node_get_full_size_internal),
    (find_entry_node):
    * girepository/girnode.h:
    Make enum serializing functions public. Clean up some whitespace.


svn path=/trunk/; revision=394
2008-08-18 08:52:47 +00:00