aboutsummaryrefslogtreecommitdiff
path: root/src/sysbin/lx/lxlib.h
blob: dd31ffb4f3a83f8a8297f06e1c5033d5bdbc3c8a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
** Lua eXtended libraries
*/
#pragma once

#include <lua/lua.h>


// Helper for libraries
bool lx_checkboolean(lua_State *L, int arg);
void* lx_checklightudata(lua_State *L, int arg);
void setintfield (lua_State *L, const char *key, int value);
void setstrfield (lua_State *L, const char *key, const char* value);

int getintfield(lua_State *L, int arg, const char *key);


#define LX_SYSLIBNAME "lx.sys"
LUAMOD_API int (lx_open_sys) (lua_State *L);

#define LX_IOCTLLIBNAME "lx.ioctl"
LUAMOD_API int (lx_open_ioctl) (lua_State *L);

#define LX_MSGLIBNAME "lx.msg"
LUAMOD_API int (luaopen_cmsgpack) (lua_State *L);
#define lx_open_msg luaopen_cmsgpack

#define LX_DRAWLIBNAME "lx.draw"
LUAMOD_API int (lx_open_draw) (lua_State *L);

#define LX_KBDLIBNAME "lx.kbd"
LUAMOD_API int (lx_open_kbd) (lua_State *L);

/* open all previous libraries */
LUALIB_API void (lx_openlibs) (lua_State *L);