aboutsummaryrefslogtreecommitdiff
path: root/src/lua/api.h
blob: 7b5e7428812aeb84bad48ff4be271965ed4e0bf1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifndef COMET_LUA_API_H
#define COMET_LUA_API_H

#include <lauxlib.h>
#include <lua.h>
#include <lualib.h>
#include <stdbool.h>

typedef struct {
    lua_State *state;
} lua_api_t;

typedef int (*lua_library_t)(lua_State *state);

bool lua_api_init(lua_api_t *lua);

void lua_api_require(lua_api_t *lua, const char *name, lua_library_t lib_fn);

void lua_api_close(lua_api_t *lua);

#endif