|
#include <stdio.h>
|
|
#include <lua.h>
|
|
#include <lauxlib.h>
|
|
|
|
static int hello(lua_State* L) {
|
|
puts("Hello World!");
|
|
return 0;
|
|
}
|
|
|
|
static const struct luaL_Reg lib[] = {
|
|
{"hello", hello},
|
|
{NULL, NULL}
|
|
};
|
|
|
|
int luaopen_lib (lua_State *L) {
|
|
luaL_openlib(L, "lunaclib", lib, 0);
|
|
return 1;
|
|
}
|
|
|