Commit Graph

562 Commits

Author SHA1 Message Date
Colin Walters
4779b03a21 girepository: Use g_atomic for refcounting
They could be freed in separate threads (e.g. language binding GC
thread).  But no particular reason to change other than noticing it
during code inspection for a different bug.

https://bugzilla.gnome.org/show_bug.cgi?id=688694
2013-04-02 12:10:33 -04:00
Giovanni Campagna
50638cf403 GIRepository: add API for extending library paths
Previously we would require applications that shipped with private
typelibs to add the private path to LD_LIBRARY_PATH, or to have a
launcher binary with the right RPATH.
Now they can just call GIRepository.prepend_library_path() before
they access the module.

https://bugzilla.gnome.org/show_bug.cgi?id=694485
2013-02-24 23:09:36 +01:00
Torsten Schönfeld
a7a47f4375 girepository: Document g_enum_info_get_error_domain
https://bugzilla.gnome.org/show_bug.cgi?id=693838
2013-02-15 14:34:32 +01:00
Jasper St. Pierre
ee4ee72ac3 girparser: Serialize and read back the instance_parameter
g-ir-doc-tool wants to use the instance parameter to read docs
and the parameter name, so it needs to be shuttled through the
GIR.

https://bugzilla.gnome.org/show_bug.cgi?id=693040
2013-02-01 19:37:21 -05:00
Jasper St. Pierre
06dfbc7dcb girparser: Clean up passthrough handling
Instead of remembering to have to set unknown_depth, smarten up
state_switch to do it for us.

https://bugzilla.gnome.org/show_bug.cgi?id=693040
2013-02-01 19:36:38 -05:00
Jasper St. Pierre
37791c8267 girparser: Move <doc> handling to passthrough
https://bugzilla.gnome.org/show_bug.cgi?id=693040
2013-02-01 19:20:35 -05:00
Martin Pitt
259c10f787 girepository: gchar is a signed type
gchar is signed, not unsigned. Add "guchar" alias as unsigned for completeness
(but usually it appears as guint8).

https://bugzilla.gnome.org/show_bug.cgi?id=691524
2013-01-11 10:09:25 +01:00
Torsten Schönfeld
f57dc1a133 build: Properly export g_interface_info_find_signal
It was missing from girepository.symbols.
2013-01-07 17:35:47 +01:00
Colin Walters
35091ec7df repo: Drop deprecated GStaticMutex usage
In favor of GOnce, since we just want initialize-once semantics.
2012-12-17 09:57:24 -05:00
Dieter Verfaillie
430826e825 docs: don't mark non GTK-Doc as being a GTK-Doc comment block
This patch silences another gtkdoc-mkdb warning.

https://bugzilla.gnome.org/show_bug.cgi?id=688418
2012-11-15 23:49:43 +01:00
Colin Walters
f4e33baf3b cmph: Remove leftover statement-without-effect
Compiler warning introduced from MSVC patches.
2012-10-30 18:23:09 -04:00
Colin Walters
b7555303b3 girepository: Use girepository.symbols for Unix builds too
Rather than having a regex for both builds, but *also* use a symbol
file for the MSVC build which would bitrot quickly, force us to update
the .symbols file by using it for Unix too.

Add some missing symbols.
2012-10-27 12:24:12 -04:00
Chun-wei Fan
671d1494f1 Add girepository.symbols
This is the listing of symbols to export from the main libgirepository
.dll/.so.  This is used for example to generate the .lib file from the
Windows DLL.

https://bugzilla.gnome.org/show_bug.cgi?id=681820
2012-10-27 12:06:10 -04:00
Chun-wei Fan
08da5d65ee girepository: Remove C99ism and other updates
-Make code using libgirepository_internals relocatable on Windows,
 like what is done in the GTK+ stack, and the girepository DLL.
-Remove C99isms
-"interface" is a reserved keyword on certain compilers, so change that to
 "giinterface"

https://bugzilla.gnome.org/show_bug.cgi?id=681820
2012-10-27 12:06:09 -04:00
Chun-wei Fan
c449db7704 girffi.c: Don't include unistd.h unconditionally
It does not exist on all platforms

https://bugzilla.gnome.org/show_bug.cgi?id=681820
2012-10-27 12:06:09 -04:00
Chun-wei Fan
86b7d7cc99 cmph: Remove C99ism and other fixes
...So that it will compile on non-C99 compilers.  The changes are mainly
moving the variable declarations to the start of the resecptive blocks.

Also, replace the use of buflen in chd.c as it might not be defined for all
platforms, instead using packed_cr_size as it seems to represent the value
that is to be printed/displayed by the debugging output.

https://bugzilla.gnome.org/show_bug.cgi?id=681820
2012-10-27 12:06:09 -04:00
Colin Walters
5428e934b2 Drop calls to g_type_init()
And bump our GLib requirement.
2012-10-16 10:58:08 -04:00
Mark Nauwelaerts
1eb27e4bf8 ginvoke: support conversion of fundamental type GParamSpec values
https://bugzilla.gnome.org/show_bug.cgi?id=683265
2012-09-03 16:00:07 +02:00
Jasper St. Pierre
56048fc81c girepository: Fix leak in g_vfunc_info_get_address
We need to fix the struct info here.

https://bugzilla.gnome.org/show_bug.cgi?id=682647
2012-08-25 14:10:06 -03:00
Torsten Schönfeld
27f11b2e51 girepository: Add g_interface_info_find_signal
Add the convenience method g_interface_info_find_signal, mirroring
g_object_info_find_signal.

https://bugzilla.gnome.org/show_bug.cgi?id=682672
2012-08-25 19:06:58 +02:00
Jasper St. Pierre
3bcc0e43c6 girffi: Fix g_callable_info_prepare_closure for certain callables
Namely, those that are methods and those that throw GErrors.
We have very similar code in two places that calculate arg lengths and
argument types to stick into libffi. Merge, clean up, and correct both.

https://bugzilla.gnome.org/show_bug.cgi?id=673805
2012-08-20 15:01:59 -04:00
Jasper St. Pierre
d65cec7f15 gicallableinfo: Add two new convenience methods: is_method and can_throw_gerror
https://bugzilla.gnome.org/show_bug.cgi?id=673805
2012-08-20 15:01:59 -04:00
Jasper St. Pierre
d936489647 Fix build 2012-06-29 10:05:50 -04:00
Alan Knowles
849c7c2f66 fix GIArgument being exported as _Argument in .gir
https://bugzilla.gnome.org/show_bug.cgi?id=635128
2012-06-28 12:07:35 -04:00
Jasper St. Pierre
df10915ba5 givfuncinfo: Fix memory leak
The field info wasn't being freed after it was used
2012-05-25 16:36:46 -04:00
Pavel Holejsovsky
8af8aaa4a8 girepository: avoid crash when querying nonexistent info
It appears that cmph library can return (n+1) when querying item not
present in its original n-item-sized set.  Adjust code so that it
detects this condition and do not chase stray pointers resulting from
this bogus(?) hash result.

https://bugzilla.gnome.org/show_bug.cgi?id=675939
2012-05-12 20:48:55 +02:00
Johan Dahlin
0a96da9284 Make introspection compile with -Wall -Werror
Address all gcc warnings, -Werror is not enabled yet but at least
-Wall -Werror passes on my machine.
2012-04-09 14:19:23 -03:00
Pavel Holejsovsky
d0b8813d14 Avoid _get_func() consuming reference from input info
Fix of leak in 4c9424e18d71237f438a99bc5f2d45ae7de60b78 was a bit
overaggressive, stealing also one reference from input 'info'
argument.

Also fixes another bug in that commit - local 'func' shadowing the
return value, causing that function always returned NULL even when
some result was actually found.

https://bugzilla.gnome.org/show_bug.cgi?id=673282
2012-04-07 18:13:23 +02:00
Dieter Verfaillie
5374f24d38 Fix malformed GTK-Doc comment blocks:
- add missing colons
- invalid annotations
- invalid parameters and tags
- correct parameter name
- preserve description indentation
- no description parts
- comment end marker
- invalid empty lines
- line numbers

AnnotationParser now emits warnings which are considered as
errors by "make check" so fix those warnings...

https://bugzilla.gnome.org/show_bug.cgi?id=672254
2012-04-05 10:23:03 -03:00
Tomeu Vizoso
320fd24734 Make g_callable_info_invoke public
So it can be used for invoking callbacks

https://bugzilla.gnome.org/show_bug.cgi?id=663052

Signed-off-by: Martin Pitt <martinpitt@gnome.org>
2012-03-27 17:42:30 +02:00
Michel Dänzer
b2eef541e9 repository: Remove extraneous leftover assignment to rvalue.
Signed-off-by: Michel Dänzer <michel@daenzer.net>

https://bugzilla.gnome.org/show_bug.cgi?id=668902
2012-03-08 09:32:34 -05:00
Colin Walters
4b71be0ef0 repository: Add new public gi_type_info_extract_ffi_return_value() API
Dealing with FFI and return values is very tricky; this API allows
sharing the bits to do it between gobject-introspection and gjs (and
potentially other FFI binding consumers).

**NOTE** I swapped the order of the arguments, under the premise that
out arguments should generally be last.

https://bugzilla.gnome.org/show_bug.cgi?id=668902
2012-03-05 09:56:56 -05:00
Michel Dänzer
0d58e2e924 repository: Fix conversion of FFI values on big-endian architectures
Adapted from the fixes for (see bug 665152). It makes sure values are
properly converted between glib and FFI, which is critical for big
endian architectures.

Patch adjusted to use GIArgument instead of custom union types
by Colin Walters <walters@verbum.org>

https://bugzilla.gnome.org/show_bug.cgi?id=668902
2012-03-05 09:56:55 -05:00
Jean Bréfort
4359a037db repository: Ensure error is set if we're parsing a malformed file
https://bugzilla.gnome.org/show_bug.cgi?id=661951
2012-02-17 11:48:35 -05:00
Jasper St. Pierre
a714bef965 girffi: Virtual functions are methods 2012-02-10 10:19:17 -05:00
Thorsten Glaser
87857869e9 typelib: Fix invalid alignment assumptions
The current source has invalid assumptions about structure alignment
that break on platforms like m68k where 32-bit integers are aligned to
16-bit only. Fix this by introducing explicit structure padding for
32-bit quantities following odd numbers of 16-bit quantities and
structure trail padding, to make the binary representation generated
by the compiler match the text of the specification exactly.

https://bugzilla.gnome.org/show_bug.cgi?id=661839
2012-02-08 09:07:13 -05:00
Jesse van den Kieboom
c2d79efd53 Plug memory leak in lazy typelibs hash table
https://bugzilla.gnome.org/show_bug.cgi?id=669317
2012-02-05 15:45:09 +01:00
Jasper St. Pierre
04cf2f480d girffi: Fix g_function_info_new_for_address to respect G_VFUNC_THROWS 2012-02-03 13:48:39 -05:00
Colin Walters
e865dcb7b4 Add Emacs mode lines to C sources 2012-02-03 13:42:56 -05:00
Colin Walters
b9d0981460 girepository: Add GI_VFUNC_THROWS
Virtual functions can definitely throw an error.  Right now the
scanner omits the GError parameter for them and adds throws="1", but
g-ir-compiler ignores this.

https://bugzilla.gnome.org/show_bug.cgi?id=669332
2012-02-03 13:20:57 -05:00
Jasper St. Pierre
3aaf08b49d giobjectinfo: Add g_object_info_find_vfunc_using_interfaces
As an analogue to g_object_info_find_method_using_interfaces, add a
new API so that we can find a vfunc using the same strategy.
2012-02-03 11:52:33 -05:00
Jasper St. Pierre
a0d19ca066 girffi: Add new g_function_invoker_new_for_address
This is a new method designed to make a GIFunctionInvoker for
any GICallableInfo*, for bindings to use.
2012-02-03 11:52:33 -05:00
Jasper St. Pierre
3e1486f924 girffi: Fix compiler warnings 2012-01-06 15:00:46 -05:00
Jasper St. Pierre
c18e0be549 repository: Squash memory leak in _get_func and fix up style 2012-01-06 15:00:39 -05:00
Ray Strode
c99df8f34c ffi: Treat enums as 32 bit signed values to fix PPC64
To call a function dynamically using ffi, the caller
first has to tell ffi the size of all the input arguments
of the function. On little endian architectures (like x86_64)
specifying a size that's too large will happen to work because
of how the bits are laid out in memory.  On big endian architectures,
however, specifying the wrong size can lead to reading the wrong
bits.

The function g_type_info_get_ffi_type maps input giargument types to
specific sizes. It was assuming enums were word (pointer) sized; in
fact they can be in theory any size (1,2,4,8 bytes), but in practice
in introspection (via GIArgument) as well as GValue we're limited to 4
byte enums.

This commit fixes PPC64 (big endian, 64 bit).

Signed-off-by: Colin Walters <walters@verbum.org>

https://bugzilla.gnome.org/show_bug.cgi?id=665150
2011-12-21 15:55:18 -05:00
Jasper St. Pierre
cfcbd719ea gitypelib: Fix compiler warnings
These variables are unused.

https://bugzilla.gnome.org/show_bug.cgi?id=665249
2011-12-01 10:55:19 -05:00
Jasper St. Pierre
fd0625aa6e gibaseinfo: Fix compiler warnings
g_slice_free complains when you pass it a pointer of a different type
than it was expecting, like it should.

https://bugzilla.gnome.org/show_bug.cgi?id=665249
2011-12-01 10:55:19 -05:00
Sjoerd Simons
acd55584c2 Use the correct size when freeing unused info
A GIBaseInfo struct can underneath either be GIRealInfo *or*
GIUnresolvedInfo if the type is GI_INFO_TYPE_UNRESOLVED. So when we
eventually free the structures slice use the correct struct type
otherwise things get unhappy.
2011-10-20 10:24:33 +02:00
Alberto Ruiz
c87a386cd1 parser: prevents a segfault when _g_ir_parser_parse_string returns NULL error was not set.
Noticed the segmentation fault while using Vala to generate a .gir, a bug has
been filed tomake sure Vala doesn't export gir symbols outside of a namespace
(see https://bugzilla.gnome.org/show_bug.cgi?id=661952)

https://bugzilla.gnome.org/show_bug.cgi?id=661951
2011-10-18 16:59:34 +01:00
Jasper St. Pierre
b75e788785 giconstantinfo: Add API to fix memory leak
https://bugzilla.gnome.org/show_bug.cgi?id=654069
2011-10-05 16:46:33 -04:00