aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/libraries
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-05-05 17:35:13 +1000
committerDavid Walter Seikel2014-05-05 17:35:13 +1000
commit58e26c8dbcfa60a9a1550f026b5cf7059d29fdd7 (patch)
tree5d5bda5ed38d2db37609cc7e436e63fbb8ae2f90 /src/libraries
parentNo more ourGlobals in GuiLua. (diff)
downloadSledjHamr-58e26c8dbcfa60a9a1550f026b5cf7059d29fdd7.zip
SledjHamr-58e26c8dbcfa60a9a1550f026b5cf7059d29fdd7.tar.gz
SledjHamr-58e26c8dbcfa60a9a1550f026b5cf7059d29fdd7.tar.bz2
SledjHamr-58e26c8dbcfa60a9a1550f026b5cf7059d29fdd7.tar.xz
Support light user data in the Lua argument support functions.
Diffstat (limited to 'src/libraries')
-rw-r--r--src/libraries/Runnr.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/libraries/Runnr.c b/src/libraries/Runnr.c
index a24e7f5..f316755 100644
--- a/src/libraries/Runnr.c
+++ b/src/libraries/Runnr.c
@@ -45,6 +45,7 @@ void dumpStack(lua_State *L, int i)
45// str $ 45// str $
46// bool ! 46// bool !
47// C func & 47// C func &
48// lightuserdata *
48// table.field @ Expects an integer and a string. 49// table.field @ Expects an integer and a string.
49// nil ~ 50// nil ~
50// table {} Starts and stops filling up a new table. 51// table {} Starts and stops filling up a new table.
@@ -53,7 +54,6 @@ void dumpStack(lua_State *L, int i)
53// FIXME: Still to do, if we ever use them - 54// FIXME: Still to do, if we ever use them -
54// stack = Get a value from the stack, expects a stack index. 55// stack = Get a value from the stack, expects a stack index.
55// userdata + 56// userdata +
56// lightuserdata *
57// thread ^ 57// thread ^
58 58
59static char *_push_name(lua_State *L, char *q, int *idx) // Stack usage [-0, +1, e or m] 59static char *_push_name(lua_State *L, char *q, int *idx) // Stack usage [-0, +1, e or m]
@@ -167,6 +167,17 @@ int pull_lua(lua_State *L, int i, char *params, ...) // Stack usage -
167 } 167 }
168 break; 168 break;
169 } 169 }
170 case '*':
171 {
172 if (table) q = _push_name(L, q, &i); // Stack usage [-0, +1, e]
173 if (lua_islightuserdata(L, j)) // Stack usage [-0, +0, -]
174 {
175 void **v = va_arg(vl, void **);
176 *v = lua_touserdata(L, j); // Stack usage [-0, +0, -]
177 n++;
178 }
179 break;
180 }
170 default: 181 default:
171 { 182 {
172 get = EINA_FALSE; 183 get = EINA_FALSE;
@@ -257,6 +268,12 @@ int push_lua(lua_State *L, char *params, ...) // Stack usage [-0, +n, em]
257 lua_getfield(L, tabl, field); // Stack usage [-0, +1, e] 268 lua_getfield(L, tabl, field); // Stack usage [-0, +1, e]
258 break; 269 break;
259 } 270 }
271 case '*':
272 {
273 if (table) q = _push_name(L, q, &i); // Stack usage [-0, +1, m]
274 lua_pushlightuserdata(L, va_arg(vl, void *)); // Stack usage [-0, +1, m]
275 break;
276 }
260 case '&': 277 case '&':
261 { 278 {
262 if (table) q = _push_name(L, q, &i); // Stack usage [-0, +1, m] 279 if (table) q = _push_name(L, q, &i); // Stack usage [-0, +1, m]