seqlua
diff seqlua_c_example.c @ 23:29792283522f
Removed iterator(...) function; ipairs doesn't accept iterator triplets anymore
| author | jbe |
|---|---|
| date | Thu Aug 21 20:01:52 2014 +0200 (2014-08-21) |
| parents | 144f0bddee2b |
| children | 44880bcfc323 |
line diff
1.1 --- a/seqlua_c_example.c Thu Aug 21 13:04:45 2014 +0200 1.2 +++ b/seqlua_c_example.c Thu Aug 21 20:01:52 2014 +0200 1.3 @@ -14,23 +14,8 @@ 1.4 return 0; 1.5 } 1.6 1.7 -static int seqlua_c_example_printthree(lua_State *L) { 1.8 - int i; 1.9 - seqlua_iterclosure(L, 1); 1.10 - for (i=0; i<3; i++) { 1.11 - lua_pushvalue(L, 1); 1.12 - lua_call(L, 0, 1); 1.13 - fputs(luaL_tolstring(L, -1, NULL), stdout); 1.14 - lua_pop(L, 1); // pop value that luaL_tolstring pushed onto stack 1.15 - fputs("\n", stdout); 1.16 - } 1.17 - return 0; 1.18 -} 1.19 - 1.20 int luaopen_seqlua_c_example(lua_State *L) { 1.21 lua_pushcfunction(L, seqlua_c_example_printcsv); 1.22 lua_setglobal(L, "printcsv"); 1.23 - lua_pushcfunction(L, seqlua_c_example_printthree); 1.24 - lua_setglobal(L, "printthree"); 1.25 return 0; 1.26 }