Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import
- lua
- proc get_hello(state: PState): cint {.cdecl.} =
- state.pushstring("Hello!")
- return 1
- const
- test = [
- Treg(name: "get_hello", `func`: get_hello),
- Treg(name: "", `func`: nil)
- ]
- proc luaopen_test(state: PState): cint =
- state.openlib(cstring"test", unsafeAddr(test[0]), cint(test.len-1))
- return 1
Add Comment
Please, Sign In to add comment