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-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-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
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-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-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-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
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
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
* 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
* 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-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-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 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 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-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-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 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-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-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