mongoose/examples/lua_dll.c

18 lines
321 B
C
Raw Normal View History

2013-07-30 21:49:52 +08:00
#include <stdio.h>
2013-11-22 16:45:04 +08:00
#include "lua_5.2.1.h"
2013-07-30 21:49:52 +08:00
static int smile(lua_State *L) {
(void) L; // Unused
printf("%s\n", ":-)");
return 0;
}
int LUA_API luaopen_lua_dll(lua_State *L) {
static const struct luaL_Reg api[] = {
{"smile", smile},
{NULL, NULL},
};
luaL_openlib(L, "lua_dll", api, 0);
return 1;
}