]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | #include <stdio.h> |
2 | ||
3 | #include "lua.h" | |
4 | #include "lauxlib.h" | |
5 | ||
6 | static int smile(lua_State *L) | |
7 | { | |
8 | (void) L; // Unused | |
9 | printf("%s\n", ":-)"); | |
10 | return 0; | |
11 | } | |
12 | ||
13 | int LUA_API luaopen_lua_dll(lua_State *L) | |
14 | { | |
15 | static const struct luaL_Reg api[] = { | |
16 | {"smile", smile}, | |
17 | {NULL, NULL}, | |
18 | }; | |
19 | luaL_openlib(L, "lua_dll", api, 0); | |
20 | return 1; | |
21 | } |