Commit Graph

36 Commits

Author SHA1 Message Date
Colin Walters
74e22b307c Bug 559705 – Missing association between static methods and classes
2008-11-25  Colin Walters  <walters@verbum.org>

        Bug 559705 – Missing association between static methods and classes

        * docs/typelib-format.txt:
        * girepository/ginfo.c (g_function_info_get_flags):
        * girepository/girmodule.c (g_ir_module_build_typelib):
        * girepository/girnode.c (g_ir_node_get_size),
        (g_ir_node_build_typelib):
        * girepository/girparser.c (start_function):
        * girepository/gtypelib.c (g_typelib_check_sanity),
        (validate_header), (validate_function_blob):
        * girepository/gtypelib.h:
        * giscanner/ast.py:
        * giscanner/girwriter.py:
        * giscanner/glibtransformer.py:
        * tests/scanner/foo-1.0-expected.gir:
        * tests/scanner/foo-1.0-expected.tgir:
        * tests/scanner/foo.h:


svn path=/trunk/; revision=972
2008-11-25 22:29:20 +00:00
Colin Walters
d4d832bf9a Add a comment about keeping hardcoded numbers in g_typelib_check_sanity
svn path=/trunk/; revision=945
2008-11-18 18:42:32 +00:00
Owen Taylor
6cb96533b9 Bug 560825 – Add size and alignment to typelib
Include the size and alignment of structures and unions in the typelib,
and add getter methods to retrieve them from GIStructInfo/GIUnionInfo.

* docs/typelib-format.txt girepository/gtypelib.h girepository/girnode.c
girepository/girmodule.c girepository/gtypelib.c: Add size and alignment
to StructBlob and UnionBlob.

* girepository/ginfo.c girepository/girepository.h:
Add g_[struct|union]_get[size|alignment]().

* test/offsets/gen-gitestoffsets: Test overall structure size and alignment.

svn path=/trunk/; revision=930
2008-11-16 21:15:54 +00:00
Tommi Komulainen
65b8727e57 Bug 557898 – Fails to build on OSX 10.4
2008-11-01  Tommi Komulainen  <tommi.komulainen@iki.fi>

	* configure.ac: Check for $shrext_cmds that should be implicitly
	available if you're using libtool >= 2.0. If undefined, call
	libtool --config explicitly to get its value.
	* girepository/gtypelib.c: Remove special case for (non-)Darwin
	systems as unneeded.

svn path=/trunk/; revision=859
2008-11-01 18:21:55 +00:00
Johan Dahlin
8d06e5c8e7 Only use SHLIB_SUFFIX on darwin, otherwise use G_MODULE_SUFFIX, we cannot
2008-10-24  Johan Dahlin  <johan@gnome.org>

        * girepository/gtypelib.c:
        Only use SHLIB_SUFFIX on darwin, otherwise use
        G_MODULE_SUFFIX, we cannot get shext_cmds from libtool 2.2.


svn path=/trunk/; revision=806
2008-10-24 11:19:49 +00:00
Lucas Rocha
9a32d9b093 fix some build warnings.
2008-10-22  Lucas Rocha  <lucasr@gnome.org>

	* girepository/girmodule.c, girepository/gtypelib.c,
	girepository/girparser.[ch]: fix some build warnings.

svn path=/trunk/; revision=783
2008-10-22 14:31:58 +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
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
Johan Bilien
1b2aa59534 ignore non-UTF-8 string constants
2008-10-11  Johan Bilien  <jobi@litl.com>

	* giscanner/scannerparser.y: ignore non-UTF-8 string constants

2008-10-11  Johan Bilien  <jobi@litl.com>

	Bug 552347: Parse #defines constants

	* girepository/gtypelib.c: update the list of value_size
	with recently defined type tags
	* giscanner/scannerparser.y: brought back parsing of #defined, as
	present in older version
	* giscanner/giscannermodule.c: bind gi_source_scanner_append_filename
	* giscanner/girwriter.py: write out constant tags in the gir
	* giscanner/sourcescanner.py: add accessor for const_string
	* giscanner/transformer.py, giscanner/glibtransformer.py: handle
	constant

svn path=/trunk/; revision=673
2008-10-11 23:19:59 +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
ea99326529 Merge branch 'bug551744-boxed-ctors'
svn path=/trunk/; revision=654
2008-10-03 19:30:12 +00:00
Colin Walters
ec679636ef Merge branch 'bug552961-methods/wip'
svn path=/trunk/; revision=647
2008-10-02 21:24:20 +00:00
Colin Walters
bfb6271201 Strengthen check for interface vs basic types
Previously we were just checking "reserved", but to be more correct
we should check whether reserved2 is zero as well because it is
possible for offsets to have reserved = 0 but reserved2 != 0.

svn path=/trunk/; revision=620
2008-09-19 23:43:38 +00:00
Colin Walters
c760a31723 Validate the "this" argument for methods
svn path=/trunk/; revision=615
2008-09-19 14:55:20 +00:00
Colin Walters
4e4c8c137d Bug 522384: Use SHLIB_SUFFIX intead of G_MODULE_SUFFIX for Darwin
On Darwin, the suffix for installed shared libraries (.dylib) is
different from loadable modules (.so).  We use a bit of magic shell
script from Behdad Esfahbod to figure out the right suffix.

svn path=/trunk/; revision=612
2008-09-19 02:24:05 +00:00
Colin Walters
8f09203dda Allow both union and struct to be boxed or not
* girepository/girnode.c: Allow gtype_name
	and gtype_init in struct and union.
	* girepository/girparser.c: Parse glib:
	boxed bits for both structure and union.
	* girepository/gtypelib.c: Don't barf
	if structure is boxed.
	* giscanner/girparser.py: Parse new XML
	format.
	* giscanner/girwriter.py: Write out new
	XML format.
	* giscanner/glibast.py: Define new classes
	which are both Boxed and Struct/Union, as
	well as an "Other" for everything else.
	* giscanner/glibtransformer.py: Handle
	boxed types specially; we try to merge
	them with a struct/union if one exists,
	otherwise fall back to generic boxed.
	* tests/*: Update.
	* tools/generate.c: Write out new format.

svn path=/trunk/; revision=575
2008-09-06 20:33:51 +00:00
Colin Walters
5a14ec555c Fix conflict
svn path=/trunk/; revision=544
2008-08-30 20:31:14 +00:00
Colin Walters
e6a68106a2 Don't lose on NULL shlib
svn path=/trunk/; revision=542
2008-08-30 20:31:10 +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
ce86b80390 Don't crash if no shlib is embedded
* girepository/gtypelib.c: Don't crash if no
	shlib is embedded

svn path=/trunk/; revision=533
2008-08-29 20:42:51 +00:00
Colin Walters
295fc99a40 More context information in validate
* girepository/gtypelib.c: Add more context
	during validate.

svn path=/trunk/; revision=525
2008-08-29 18:49:22 +00:00
Tor Lillqvist
2bb80a1209 Make g-ir-scanner work on Windows. Still problems with the typelib code.
2008-08-27  Tor Lillqvist  <tml@novell.com>

	Make g-ir-scanner work on Windows. Still problems with the typelib
	code. Changes okayed by jdahlin.

	* configure.ac: Check for Windows, set Automake conditional
	OS_WIN32. Change backslashes to forward slashes in pyexecdir to
	avoid shell quoting issues
	
	* girepository/Makefile.am: Use -no-undefined so that libtool
	agrees to build a shared library on Windows.

	* girepository/girparser.c (backtrace_stderr): No backtrace() on
	Windows. Empty implementation on Windows so far.

	* girepository/gtypelib.c (g_typelib_check_sanity): Give more
	informative error message for the assertion failures. Tell also
	what the expected size of the struct is. Check all sizes first and
	fail afterwards if at least one size was different from expected.

	* tools/Makefile.am: Reorder libraries into proper logical
	dependency order.

	* tools/generate.c: Don't include <dlfcn.h>, not used.

	* giscanner/Makefile.am: On Windows, link with the Python library,
	and install the module DLL as _giscanner.pyd. Remove the
	unnecessary import library and libtool library that libtool has
	installed.

	* giscanner/scannerlexer.l: Recognize the gcc __attribute__ syntax
	and just skip it. Recognize also two "l" suffixes for long long
	constants. Recognize also __inline__.

	* giscanner/grealpath.h (g_realpath): Implement on Windows, using
	GetFullPathName(). As such, GetFullPathName() does more than the
	UNIX realpath(). It also changes relative paths into absolute
	paths. But for our purposes that shouldn't matter.

	* giscanner/giscannermodule.c (pygi_source_scanner_parse_file): On
	Windows the file descriptor passed to us is from Python. Python
	Python2.5 uses the msvcr71.dll C library, while mingw-built code
	uses msvcrt.dll. On Windows, file descriptors are specific to
	which C library is used. So we must find out what underlying OS
	handle corresponds to the file descriptor Python passes us, and
	then make that into a file descriptor valid for the C library this
	code uses.

	* giscanner/sourcescanner.py (_parse): Don't need to bypass
	__attribute__ as the lexer now handles it. The definition as empty
	was ineffective for mingw anyway, as mingw's _mingw.h undefines
	__attribute__. Close the temp file before unlinking it.

	* giscanner/cgobject.py: Use correct library name for the gobject
	DLL on Windows.

	* gir/Makefile.am: Must pass the full basename of the DLLs on
	Windows to g-ir-scanner. It's a bit ugly that we have to "know"
	that the names of the GLib DLLs are like libglib-2.0-0.dll, but in
	reality they won't change, until there is a GLib 3, and then also
	the Unix code here needs changing.

	Must pass CPPFLAGS to g-ir-scanner when building GLib.gir so that
	libintl.h is found.


svn path=/trunk/; revision=503
2008-08-27 13:33:21 +00:00
Colin Walters
7805ca101f Also use G_MODULE_SUFFIX instead of hardcoding .so.
2008-08-26  Colin Walters  <walters@verbum.org>

	* girepository/gtypelib.c (_g_typelib_init): Also
	use G_MODULE_SUFFIX instead of hardcoding .so.

svn path=/trunk/; revision=501
2008-08-26 21:05:32 +00:00
Colin Walters
d6139fcb45 Free string in the right place.
2008-08-26  Colin Walters  <walters@verbum.org>

	* girepository/gtypelib.c (_g_typelib_init): Free
	string in the right place.

svn path=/trunk/; revision=500
2008-08-26 21:01:36 +00:00
Colin Walters
7f30a2502c Fix small memory leak
svn path=/trunk/; revision=499
2008-08-26 20:06:42 +00:00
Colin Walters
00fb846ad8 Handle both .la and .so names; this works better in the uninstalled
2008-08-26  Colin Walters  <walters@verbum.org>

	* girepository/gtypelib.c (_g_typelib_init): Handle
	both .la and .so names; this works better in the
	uninstalled library case.

svn path=/trunk/; revision=498
2008-08-26 20:04:38 +00:00
Colin Walters
1ebc6cfb7a Add context stack so when we get an error we can print out nicely where it
2008-08-24  Colin Walters  <walters@verbum.org>

	* girepository/gtypelib.c: Add context stack so
	when we get an error we can print out nicely
	where it is.

svn path=/trunk/; revision=482
2008-08-24 16:51:43 +00:00
Colin Walters
88f221c38e Check constructor returns
svn path=/trunk/; revision=477
2008-08-23 21:30:09 +00:00
Colin Walters
60adefcef2 Tweak to use UINT instead of INT. Not likely to matter. Add to
2008-08-21  Colin Walters  <walters@verbum.org>

	* girepository/girnode.c (write_string): Tweak to
	use UINT instead of INT.  Not likely to matter.
	* girepository/girmodule.c (g_ir_module_build_typelib):
	Add to header_offset as well for header strings
	to match what write_string does.
	* girepository/gtypelib.c: Replace is_name with
	validate_name, which more strongly validates and
	handles errors in a better way.  Update all callers.
	* giscanner/glibtransformer.py: Handle constructors
	better.

svn path=/trunk/; revision=439
2008-08-21 16:15:55 +00:00
Johan Dahlin
a47d659cd1 Use g_module_build_path to resolve the shlib name
2008-08-21  Johan Dahlin  <johan@gnome.org>

    * girepository/gtypelib.c (_g_typelib_init):
    Use g_module_build_path to resolve the shlib name


svn path=/trunk/; revision=437
2008-08-21 14:21:00 +00:00
Johan Dahlin
fc01170517 Remove resolve_possible_typedefs, it was unused. Allow multiple enum
2008-08-17  Johan Dahlin  <johan@gnome.org>

    * girepository/gtypelib.c (validate_enum_blob):
    * giscanner/glibtransformer.py:
    * giscanner/transformer.py:
    Remove resolve_possible_typedefs, it was unused.
    Allow multiple enum values of the sample value in an enum,
    since it's actually pretty common.
    Register enums so they can be resolved too.


svn path=/trunk/; revision=389
2008-08-16 22:26:55 +00:00
Colin Walters
0ed07b5934 Remove usage of (GAPI-oriented) TypeTag in favor of GITypeTag from
2008-08-12  Colin Walters  <walters@verbum.org>

	* girepository/girparser.c, girepository/gtypelib.c,
	girepository/gtypelib.h, girepository/girnode.c:
	Remove usage of (GAPI-oriented) TypeTag in favor of
	GITypeTag from girepository.h.



svn path=/trunk/; revision=347
2008-08-12 15:34:27 +00:00
Johan Dahlin
33455bc3ef Rename metadata to typelib in variable names, comments and apis.
2008-08-09  Johan Dahlin  <johan@gnome.org>

    * *.[ch]:
    Rename metadata to typelib in variable names,
    comments and apis.


svn path=/trunk/; revision=339
2008-08-09 12:55:32 +00:00
Johan Dahlin
e1c3498df8 Merge in the gir-compiler branch. Thanks to Philip and Colin for their
2008-08-08  Johan Dahlin  <johan@gnome.org>

    * girepository/gtypelib.c (validate_header):
    * girepository/gtypelib.h:
    * giscanner/ast.py:
    * giscanner/girwriter.py:
    * giscanner/sourcescanner.c (gi_source_symbol_ref),
    (gi_source_symbol_unref):
    * tests/array.test:
    * tests/boxed.test:
    * tests/constant.test:
    * tests/enum.test:
    * tests/errors.test:
    * tests/function.test:
    * tests/gobject.test:
    * tests/interface.test:
    * tests/invoke/Makefile.am:
    * tests/invoke/testfns.xml:
    * tests/object.test:
    * tests/parser/Makefile.am:
    * tests/roundtrips.sh:
    * tests/struct.test:
    * tests/types.test:
    * tests/union.test:
    * tests/xref1.test:
    * tests/xref2.test:
    * tools/Makefile.am:
    * tools/compiler.c (main):
    * tools/generate.c (write_callable_info), (write_function_info),
    (write_repository):
    * tools/gidlmodule.c:
    * tools/gidlmodule.h:
    * tools/gidlnode.c:
    * tools/gidlnode.h:
    * tools/gidlparser.c:
    * tools/gidlparser.h:
    * tools/gidlwriter.c:
    * tools/gidlwriter.h:
    * tools/scanner.c (create_node_from_gtype),
    (create_node_from_ctype), (g_igenerator_process_properties),
    (g_igenerator_process_signals), (g_igenerator_create_object),
    (g_igenerator_create_interface), (g_igenerator_create_boxed),
    (g_igenerator_create_enum), (g_igenerator_create_flags),
    (g_igenerator_process_function_symbol),
    (g_igenerator_process_unregistered_struct_typedef),
    (g_igenerator_process_struct_typedef),
    (g_igenerator_process_union_typedef),
    (g_igenerator_process_enum_typedef),
    (g_igenerator_process_function_typedef),
    (g_igenerator_process_constant), (g_igenerator_process_symbols),
    (g_igenerator_add_module), (g_igenerator_add_include_idl):
    Merge in the gir-compiler branch.
    Thanks to Philip and Colin for their help.


svn path=/trunk/; revision=325
2008-08-08 19:09:17 +00:00
Philip Van Hoof
776ee5f79e tools/gidlnode.c
2008-06-08  Philip Van Hoof  <pvanhoof@gnome.org>

        * girepository/girepository.c:
        * girepository/gtypelib.c:
        * girepository/ginfo.c:
        * girepository/ginvoke.c:
        * girepository/girepository.h:
        * girepository/gtypelib.h:
        * girepository/gmetadata.c:
        * girepository/Makefile.am:
        * girepository/gmetadata.h:
        * tools/compiler.c:
        * tools/gidlmodule.c:
        * tools/gidlnode.c
        * tools/generate.c:
        * tools/gidlmodule.h:
        * tools/gidlparser.c:

        Renamed GMetadata to GTypelib


svn path=/trunk/; revision=288
2008-06-08 14:37:30 +00:00