lunajit/lunaclib/lunaclib.c

20 lines
307 B
C

#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;
}