It is now possible to construct callable based both on baseinfo or table definition with target address from Lua side.
When GLib.SourceFuncs are used for creating GLib.Source, the source takes ownership of sourcefuncs so that marshalling guards are kept alive as long as the source itself is alive. #111
It is now possible to assign Lua functions to fields of structs of ponter-to-function type. There is a gotcha - these fields are valid only as long as lgi-wrapper for the structure exists, then they go to limbo and will crash when callbacks are invoked.
When cross compiling, the build system is different from the host system, so directly using `uname` is not an option. Use the helper variable HOST_OS so it can be overriden when calling make and leave the current command (uname -s) as its default value. Better would be to use a full system triplet and rely on config.guess (like autoconf does) but this would significantly increase the complexity of the build system.
Defined a PKG_CONFIG makefile variable and using it instead of the hardcoded "pkg-config" value. This allows the use of a custom pkg-config, e.g. "make PKG_CONFIG=i686-w64-mingw32-pkg-config", a quite common convention adopted during cross compilation.
There are two problems: (a) entries of GPtrArray are not taken as pointers, (b) their size is not computed correctly (zero is returned). Examples: http://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/examples/lua/lgi/get-ips.lua or #!/usr/bin/env lua local lgi = require 'lgi' local NM = lgi.NM client = NM.Client.new() device = client:get_device_by_iface("em1") ip4_cfg = device:get_ip4_config() print("IPv4 addresses:") for _, nm_address in ipairs(ip4_cfg:get_addresses()) do addr = nm_address:get_address() prefix = nm_address:get_prefix() print(string.format("%s/%d", addr, prefix)) end print("IPv4 routes:") for _, nm_route in ipairs(ip4_cfg:get_routes()) do dest = nm_route:get_dest() prefix = nm_route:get_prefix() next_hop = nm_route:get_next_hop() metric = nm_route:get_metric() print(string.format("%s/%d %s %d", dest, prefix, next_hop, metric)) end Signed-off-by: Jiří Klimeš <email@example.com>
Lua 5.3 and 5.1 have problems finishing the run of the test probably because of insane GC settings inside the test. #103
Lua implements those using NLS-sensitive way, which breaks things in our intended usage. So implement our own core.downcase() and core.upcase() which works simple ASCII-only operation and replace all usages with these new methods. This is actually better fix for #97
Revert "Workaround hacks for running lgi in turkish locale" This reverts commit f89027c.
Without that lgi crashed e.g for GPtrArray* return values. See this example: http://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/examples/lua/lgi/list-connections.lua NetworkManager libnm API: https://developer.gnome.org/libnm/1.0/NMClient.html#nm-client-get-connections https://wiki.gnome.org/Projects/NetworkManager/libnm Signed-off-by: Jiří Klimeš <firstname.lastname@example.org>
Use luaL_checkinteger instead of luaL_checkint -> based on the patch by David Favro. Disabled ctor_gc test, which seems to stress Lua GC in a way that test proceeds very slowly (would probably take years to complete). GTK testsuite and many samples still fail with 'C stack overflow'
Don't attempt to direclty access globals that might not exist, instead use rawget(). Strict Mode: http://metalua.luaforge.net/src/lib/strict.lua.html
Also document overriding of properties.