summaryrefslogtreecommitdiff
path: root/girepository/girffi.c
Commit message (Collapse)AuthorAgeFilesLines
* build: enable -Wswitch-defaultChristoph Reiter2018-07-291-0/+2
| | | | | | | In case the surrounding code handles missing cases break, otherwise add a g_assert_not_reached(). The generated parser code triggers this as well, so disable it there only.
* docs: fix up reference docs a bitDieter Verfaillie2013-10-101-8/+23
| | | | | | | | | | | | | - require GTK-Doc 1.19 - remove sgml mode - automatically generate gi.types (needs GTK-Doc 1.19) - fix https://bugzilla.gnome.org/show_bug.cgi?id=700025 [WIP] - rearange sections a bit [WIP] - add gi-building, gi-programming sections [WIP] - mark missing docs with TODO, which is only marginaly better than nothing but at least can be grepped :) https://bugzilla.gnome.org/show_bug.cgi?id=571648
* girffi.c: Don't include unistd.h unconditionallyChun-wei Fan2012-10-271-0/+2
| | | | | | It does not exist on all platforms https://bugzilla.gnome.org/show_bug.cgi?id=681820
* girffi: Fix g_callable_info_prepare_closure for certain callablesJasper St. Pierre2012-08-201-71/+44
| | | | | | | | 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
* gicallableinfo: Add two new convenience methods: is_method and can_throw_gerrorJasper St. Pierre2012-08-201-27/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=673805
* girffi: Virtual functions are methodsJasper St. Pierre2012-02-101-1/+1
|
* girffi: Fix g_function_info_new_for_address to respect G_VFUNC_THROWSJasper St. Pierre2012-02-031-1/+8
|
* Add Emacs mode lines to C sourcesColin Walters2012-02-031-1/+2
|
* girffi: Add new g_function_invoker_new_for_addressJasper St. Pierre2012-02-031-14/+65
| | | | | This is a new method designed to make a GIFunctionInvoker for any GICallableInfo*, for bindings to use.
* girffi: Fix compiler warningsJasper St. Pierre2012-01-061-12/+9
|
* ffi: Treat enums as 32 bit signed values to fix PPC64Ray Strode2011-12-211-12/+48
| | | | | | | | | | | | | | | | | | | | | | 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
* girffi: Remove unnecessary sys/mman.h includeColin Walters2011-09-031-2/+2
| | | | While we're here move config.h to the top for consistency.
* Free allocated ffi_types in g_callable_info_free_closure()Giovanni Campagna2011-06-201-0/+1
| | | | | | | g_callable_info_prepare_closure() allocates memory for the argument types in the ffi_cif, so we need to free it. https://bugzilla.gnome.org/show_bug.cgi?id=652954
* Account for arg direction in g_callable_info_get_ffi_arg_typesJonathan Matthew2011-02-091-1/+12
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=641647
* Add support for gunichar in typelibColin Walters2010-11-121-0/+1
| | | | | | | Some API such as gtk_text_iter_get_char returns an individual "gunichar"; we should support this. https://bugzilla.gnome.org/show_bug.cgi?id=633197
* Export gi_type_tag_get_ffi_typeColin Walters2010-11-091-3/+10
| | | | | | This is needed by the offsets code, and is generally useful. We need to export it for a future patch which won't export symbols with a leading _.
* Don't include machine-dependent integral types in the typelibColin Walters2010-07-091-29/+0
| | | | | | | | | | | | | | | | | | | | Previously we had both e.g. GI_TYPE_TAG_LONG and GI_TYPE_TAG_INT64, but in fact the typelib is already machine-specific, so it makes sense to just encode this as a fixed type. The .gir remains abstract. We also remove size_t from the typelib; one would never want to treat it differently than an integer. time_t is removed as well; while bindings like gjs had special handling to turn it into e.g. a JS Date object, I don't think we should encourage people to use these POSIX types in their API. Use GTimeVal or the like instead. Because the typelib is now really machine-specific, we need to remove the -expected.tgirs from git. (We could potentially add a check which wasn't just a literal diff later) https://bugzilla.gnome.org/show_bug.cgi?id=623774
* [girepository] Kill girffi-private.hJohan Dahlin2010-06-061-4/+4
|
* [girepository] Document most of the structsJohan Dahlin2010-05-181-0/+2
|
* Correctly use ffi_closure_alloc(), fixing mmap permissions errorOwen W. Taylor2010-04-081-22/+22
| | | | | | | | | | | | | | | | | | | | | | | This restores the reverted-commit ed8634d: Author: Dan Winship <danw@gnome.org> Date: Mon Apr 5 14:05:52 2010 -0400 g_callable_info_prepare_closure: handle mmap permissions error When SELinux or similar is active, a process may not be able to mmap() a segment that is both writable and executable, which would causing g_callable_info_prepare_closure() to fail. Libffi has a workaround for this problem though (it maps the same non-anonymous region twice, once writable and once executable, and returns two separate pointers to it), so use that. But with an added fix, when using ffi_closure_alloc(), we need to use ffi_prep_closure_loc() so we can pass in the executable address of the trampoline separately from the writable address, rather than the deprecated ffi_prep_closure(). https://bugzilla.gnome.org/show_bug.cgi?id=615105
* Revert "g_callable_info_prepare_closure: handle mmap permissions error"Colin Walters2010-04-071-22/+22
| | | | | | | This reverts commit ed8634ddf73a56cb1935fd87254b3c6c04352893. This commit caused crashes in gjs/gnome-shell, which we're still trying to track down. See: http://bugzilla.gnome.org/615078
* g_callable_info_prepare_closure: handle mmap permissions errorDan Winship2010-04-061-22/+22
| | | | | | | | | | | When SELinux or similar is active, a process may not be able to mmap() a segment that is both writable and executable, which would causing g_callable_info_prepare_closure() to fail. Libffi has a workaround for this problem though (it maps the same non-anonymous region twice, once writable and once executable, and returns two separate pointers to it), so use that. https://bugzilla.gnome.org/show_bug.cgi?id=614903
* [girepository] Remove trailing whitespaceJohan Dahlin2010-03-241-13/+13
|
* The private header should be included in girffi.cJohan Dahlin2009-12-311-0/+1
| | | | Not in the public girffi.h.
* [girffi] Clean up API, add g_function_info_prep_invokerColin Walters2009-12-161-127/+135
| | | | | | | | | | | | | | Rather than having bindings use g_function_info_invoke, which is basically a toy/demo API, export a convenience utility function which takes the introspection information and sets up things we need to pass to libffi. Then invocation can be done directly to libffi by a binding. As part of this work, remove some (unused by gjs) public functions from the girffi API, and instead export a function to map to libffi which can work semi-correctly. https://bugzilla.gnome.org/show_bug.cgi?id=604074
* Revert "GI_TYPE_TAG_VOID != ffi_type_void"Johan Dahlin2009-12-151-1/+2
| | | | This reverts commit 28cccba737ec2214da66b0d74059278162cf5fd0.
* Remove some unportable integral type size assumptionsIain Nicol2009-12-021-4/+12
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=602762
* Fix build on OpenBSDJasper Lievisse Adriaanse2009-12-021-1/+4
| | | | | | | | Due to a missing header, gobject-introspection fails to compile on OpenBSD. And only due to headers-including-headers practice this doesn't blow up on many other platforms. https://bugzilla.gnome.org/show_bug.cgi?id=596226
* GI_TYPE_TAG_VOID != ffi_type_voidMaxim Ermilov2009-12-021-2/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=603157
* Plug a leak in g_callable_info_get_ffi_return_typeMaxim Ermilov2009-12-021-0/+3
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=603526
* Add g_ir_ffi_convert_argumentsTomeu Vizoso2009-11-121-0/+112
|
* Bug 584423 – Add short/ushort supportMark Lee2009-06-221-0/+4
| | | | | | | | | 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>
* Add gtk-doc supportJohan Dahlin2009-02-121-1/+1
|
* Add utility functions for invocing closures given a GICallableInfo usingJohan Dahlin2009-02-051-0/+139
| | | | | | | | | | | | | | | 2009-02-04 Johan Dahlin <jdahlin@async.com.br> * girepository/Makefile.am: * girepository/girffi.c (g_callable_info_get_ffi_arg_types), (g_callable_info_get_ffi_return_type), (g_callable_info_prepare_closure), (g_callable_info_free_closure): * girepository/girffi.h: Add utility functions for invocing closures given a GICallableInfo using libffi. svn path=/trunk/; revision=1084
* girepository/girffi.c: Fix "Unexpected time for time_t" message.Owen Taylor2008-11-131-1/+1
| | | | svn path=/trunk/; revision=919
* Split g_ir_ffi_get_ffi_type() out from ginvoke.cOwen Taylor2008-11-111-0/+100
Extract a function to convert GITypeTag to ffi_type from the internals of ginvoke.c. This will be useful in figure out structure alignment. Also fix handling of gsize and time_t to be portable. (Add a check to configure.ac to figure out the width of time_t.) svn path=/trunk/; revision=873