gsoc-2013 - lua plugins
- From: "victortozo gmail com" <victortozo gmail com>
- To: grilo-list gnome org
- Subject: gsoc-2013 - lua plugins
- Date: Sun, 14 Apr 2013 23:51:10 -0300
Juan,
I've been looking into libquvi project in order to understand how they integrate their lua scripts with c code.
It works really nice[0] (lua 5.1) we just need to be careful with stack control...
ps: I'm calling as 'lua-factory' the glue code between grilo and lua plugins.
Calling a c function from lua also works fine[1].
We can create a 'module' in c to give lua some help functions and also a way to alert the lua-factory that an async call has finished.
If I understand right, the lua plugins would take care of search/browse/query procedures with lua code; the lua-factory (c code) would translate the return from lua into GrlMedia / GrlSource besides dealing with calls and async responses from lua code.
There are some core understandings that I'm still looking into but any thoughts would be very appreciated.
Best regards,
[0] e.g - running lua script to convert html entities
1-) line 45: "l_load_util_script" loads a lua function from lua script ("convert_entities" and "convert_entities.lua")
2-) line 51: passing a parameter to lua function
3-) line 57: calling the lua function with the text to convert; It waits 1 arg in return;
[1] e.g - running c hash functions
line 83-86: register c functions defined in (3th param) quvi_*_reg_meth in lua quvi.* module (2nd param)
line 38 & 44: calling c function to md5/sha1 hash
getting lua parameters and doing the c code..
--------------------
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]