Hardware Design: SIE
Sign in or create your account | Project List | Help
Hardware Design: SIE Git Source Tree
Root/
| 1 | #include "lua.h" |
| 2 | #include "lualib.h" |
| 3 | #include "lauxlib.h" |
| 4 | #include <stdio.h> |
| 5 | |
| 6 | |
| 7 | static int myCfunc ( lua_State *L) { |
| 8 | printf ("lua SIE's test\n"); |
| 9 | double trouble = lua_tonumber(L, 1); |
| 10 | lua_pushnumber(L, 16.0 - trouble); |
| 11 | return 1; } |
| 12 | |
| 13 | |
| 14 | int luaopen_luapassing ( lua_State *L) { |
| 15 | static const luaL_reg Map [] = { |
| 16 | {"dothis", myCfunc}, |
| 17 | {NULL,NULL} } ; |
| 18 | luaL_register(L, "cstuff", Map); |
| 19 | return 1; } |
| 20 |
Branches:
master
