#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include “lua.h”
#include “lualib.h”
#include “lauxlib.h”
int luaopen_mylib(lua_State *L);
static int l_sin (lua_State *L)
{
double d=luaL_checknumber(L, 1);
lua_pushnumber(L, sin(d));
//printf(“ok now is luahook!\n”);
return 1;
}
static const luaL_Reg mylib[]=
{
,
{NULL, NULL}
};
int luaopen_mylib(lua_State *L)
{
luaI_openlib(L, “mylib”, mylib, 0);
return 1;
}