Commit graph

12 commits

Author SHA1 Message Date
Luka Perkov
4e82a1fabb lua: allow methods with no arguments
In C it is possible to have methods without arguments (UBUS_METHOD_NOARG).
Enable support for the same calls in Lua too.

This commit also fixes segfault which can be caused by passing non-table type
where table is expected. The lua_gettablelen() function is called after we have
made sure we are dealing with a table in the first place.

Signed-off-by: Luka Perkov <luka@openwrt.org>
2014-01-28 22:20:30 +00:00
Luka Perkov
b356773921 lua: fix whitespaces and typo
Signed-off-by: Luka Perkov <luka@openwrt.org>
2014-01-28 22:20:26 +00:00
John Crispin
8ea9667036 add Lua bindings for ubus events
It mostly mimick the style of the existing code.

With it and the ubox Lua bindings, you can now send ubus events
through Lua or listen for events (you can register for multiple events
at the same time).

Signed-off-by: Jeff Remy <jeff.remy@gmail.com>
2013-11-07 16:23:30 +01:00
Jo-Philipp Wich
bf566871bd lua: pass u64 blob type as double to Lua 2013-01-13 20:37:19 +01:00
Jo-Philipp Wich
77eefb3bdd lua: remove a superfluous lua_pop() when checking table style 2012-10-17 15:32:26 +02:00
Jo-Philipp Wich
9c0b821573 lua: fix ubus_lua_format_blob_is_array() to not leave garbage on the stack 2012-10-16 19:37:31 +03:00
John Crispin
0f793d3a45 lua: propagate incoming message to method callback inside the lua context
Signed-off-by: John Crispin <blogic@openwrt.org>
2012-09-29 01:41:09 +02:00
Felix Fietkau
c382792d98 lua: add support for registering methods
Signed-off-by: John Crispin <blogic@openwrt.org>
2012-09-27 14:00:49 +02:00
Felix Fietkau
0371c8f5fd lua: add uloop support 2012-09-27 13:59:47 +02:00
John Crispin
115b7a8c73 lua: allow building the lua binding with vanilla lua
Signed-off-by: John Crispin <blogic@openwrt.org>
2012-09-27 13:49:45 +02:00
Felix Fietkau
960c342b4a lua: add a prototype for luaopen_ubus so that -Wmissing-declarations can be enabled 2012-05-29 00:41:27 +02:00
Jo-Philipp Wich
25b9b4b827 implement Lua binding 2012-05-05 22:37:46 +02:00