aboutsummaryrefslogtreecommitdiff
path: root/src/lua/api.c
blob: 3f68b1ee58fed45ef51c34c146c18f0abb612cb9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "api.h"

int lua_log_library(lua_State *state);

bool lua_api_init(lua_api_t *lua)
{
    lua->state = luaL_newstate();
    luaL_openlibs(lua->state);
    luaL_requiref(lua->state, "log", lua_log_library, 1);
    lua_pop(lua->state, 1);
    return true;
}

void lua_api_close(lua_api_t *lua)
{
    lua_close(lua->state);
}