1 2 // Copyright 2019 - 2021 Michael D. Parker 3 // Distributed under the Boost Software License, Version 1.0. 4 // (See accompanying file LICENSE_1_0.txt or copy at 5 // http://www.boost.org/LICENSE_1_0.txt) 6 7 module bindbc.lua.v54.bindstatic; 8 9 10 version(BindBC_Static) version = BindLua_Static; 11 version(BindLua_Static) { 12 version(LUA_54) version = LUA_54_STATIC; 13 } 14 15 version(LUA_54_STATIC): 16 17 import core.stdc.stdarg : va_list; 18 import bindbc.lua.v54.types; 19 20 extern(C) @nogc nothrow: 21 // lauxlib.h 22 void luaL_checkversion_(lua_State* L, lua_Number ver, size_t sz); 23 int luaL_getmetafield(lua_State* L, int obj, const(char)* e); 24 int luaL_callmeta(lua_State* L, int obj, const(char)* e); 25 const(char)* luaL_tolstring(lua_State* L, int idx, size_t* len); 26 int luaL_argerror(lua_State* L, int arg, const(char)* extramsg); 27 int luaL_typeerror(lua_State *L, int arg, const(char)* tname); 28 const(char)* luaL_checklstring(lua_State* L, int arg, size_t* l); 29 const(char)* luaL_optlstring(lua_State* L, int arg, const(char)* def, size_t* l); 30 lua_Number luaL_checknumber(lua_State* L, int arg); 31 lua_Number luaL_optnumber(lua_State* L, int arg, lua_Number def); 32 lua_Integer luaL_checkinteger(lua_State* L, int arg); 33 lua_Integer luaL_optinteger(lua_State* L, int arg, lua_Integer def); 34 void luaL_checkstack(lua_State* L, int sz, const(char)* msg); 35 void luaL_checktype(lua_State* L, int arg, int t); 36 void luaL_checkany(lua_State* L, int arg); 37 int luaL_newmetatable(lua_State* L, const(char)* tname); 38 void luaL_setmetatable(lua_State* L, const(char)* tname); 39 void* luaL_testudata(lua_State* L, int ud, const(char)* tname); 40 void* luaL_checkudata(lua_State* L, int ud, const(char)* tname); 41 void luaL_where(lua_State* L, int lvl); 42 int luaL_error(lua_State* L, const(char)* fmt, ...); 43 int luaL_checkoption(lua_State* L, int arg, const(char)* def, const(char)** lst); 44 int luaL_fileresult(lua_State* L, int stat, const(char)* fname); 45 int luaL_execresult(lua_State* L, int stat); 46 int luaL_ref(lua_State* L, int t); 47 void luaL_unref(lua_State* L, int t, int ref_); 48 int luaL_loadfilex(lua_State* L, const(char)* filename, const(char)* mode); 49 int luaL_loadbufferx(lua_State* L, const(char)* buff, size_t sz, const(char)* name, const(char)* mode); 50 int luaL_loadstring(lua_State* L, const(char)* s); 51 lua_State* luaL_newstate(); 52 int luaL_len(lua_State* L, int idx); 53 void luaL_addgsub(luaL_Buffer *b, const(char)* s, const(char)* p, const(char)* r); 54 const(char)* luaL_gsub(lua_State* L, const(char)* s, const(char)* p, const(char)* r); 55 void luaL_setfuncs(lua_State* L, const(luaL_Reg)* l, int nup); 56 int luaL_getsubtable(lua_State* L, int idx, const(char)* fname); 57 void luaL_traceback(lua_State* L, lua_State* L1, const(char)* msg, int level); 58 void luaL_requiref(lua_State* L, const(char)* modname, lua_CFunction openf, int glb); 59 void luaL_buffinit(lua_State* L, luaL_Buffer* B); 60 char* luaL_prepbuffsize(luaL_Buffer* B, size_t sz); 61 void luaL_addlstring(luaL_Buffer* B, const(char)* s, size_t l); 62 void luaL_addstring(luaL_Buffer* B, const(char)* s); 63 void luaL_addvalue(luaL_Buffer* B); 64 void luaL_pushresult(luaL_Buffer* B); 65 void luaL_pushresultsize(luaL_Buffer* B, size_t sz); 66 char* luaL_buffinitsize(lua_State* L, luaL_Buffer* B, size_t sz); 67 68 // lua.h 69 lua_State* lua_newstate(lua_Alloc f, void* ud); 70 lua_State* lua_close(lua_State* L); 71 lua_State* lua_newthread(lua_State* L); 72 lua_CFunction lua_atpanic(lua_State* L, lua_CFunction panicf); 73 lua_Number lua_version(lua_State* L); 74 int lua_absindex(lua_State* L, int idx); 75 int lua_gettop(lua_State* L); 76 void lua_settop(lua_State* L, int idx); 77 void lua_pushvalue(lua_State* L, int idx); 78 void lua_rotate(lua_State* L, int idx, int n); 79 void lua_copy(lua_State* L, int fromidx, int toidx); 80 int lua_checkstack(lua_State* L, int n); 81 void lua_xmove(lua_State* from, lua_State* to, int n); 82 int lua_isnumber(lua_State* L, int idx); 83 int lua_isstring(lua_State* L, int idx); 84 int lua_iscfunction(lua_State* L, int idx); 85 int lua_isinteger(lua_State* L, int idx); 86 int lua_isuserdata(lua_State* L, int idx); 87 int lua_type(lua_State* L, int idx); 88 const(char)* lua_typename(lua_State* L, int tp); 89 lua_Number lua_tonumberx(lua_State* L, int idx, int* isnum); 90 lua_Integer lua_tointegerx(lua_State* L, int idx, int* isnum); 91 int lua_toboolean(lua_State* L, int idx); 92 const(char)* lua_tolstring(lua_State* L, int idx, size_t* len); 93 lua_Unsigned lua_rawlen(lua_State* L, int idx); 94 lua_CFunction lua_tocfunction(lua_State* L, int idx); 95 void* lua_touserdata(lua_State* L, int idx); 96 lua_State* lua_tothread(lua_State* L, int idx); 97 const(void)* lua_topointer(lua_State* L, int idx); 98 void lua_arith(lua_State* L, int op); 99 int lua_rawequal(lua_State* L, int idx1, int idx2); 100 int lua_compare(lua_State* L, int idx1, int idx2, int op); 101 void lua_pushnil(lua_State* L); 102 void lua_pushnumber(lua_State* L, lua_Number n); 103 void lua_pushinteger(lua_State* L, lua_Integer n); 104 void lua_pushlstring(lua_State* L, const(char)* s, size_t len); 105 void lua_pushstring(lua_State* L, const(char)* s); 106 const(char)* lua_pushvfstring(lua_State* L, const(char)* fmt, va_list argp); 107 const(char)* lua_pushfstring(lua_State* L, const(char)* fmt, ...); 108 void lua_pushcclosure(lua_State* L, lua_CFunction fn, int n); 109 void lua_pushboolean(lua_State* L, int b); 110 void lua_pushlightuserdata(lua_State* L, void* p); 111 int lua_pushthread(lua_State* L); 112 void lua_getglobal(lua_State* L, const(char)* name); 113 void lua_gettable(lua_State* L, int idx); 114 void lua_getfield(lua_State* L, int idx, const(char)* k); 115 int lua_geti(lua_State* L, int idx, lua_Integer n); 116 void lua_rawget(lua_State* L, int idx); 117 void lua_rawgeti(lua_State* L, int idx, int b); 118 void lua_rawgetp(lua_State* L, int idx, const(void)* p); 119 void lua_createtable(lua_State* L, int narr, int nrec); 120 void* lua_newuserdatauv(lua_State* L, size_t sz, int nuvalue); 121 int lua_getmetatable(lua_State* L, int objindex); 122 int lua_getiuservalue(lua_State* L, int idx, int n); 123 void lua_setglobal(lua_State* L, const(char)* name); 124 void lua_settable(lua_State* L, int idx); 125 void lua_setfield(lua_State* L, int idx, const(char)* k); 126 void lua_seti(lua_State* L, int idx, lua_Integer n); 127 void lua_rawset(lua_State* L, int idx); 128 void lua_rawseti(lua_State* L, int idx, lua_Integer n); 129 void lua_rawsetp(lua_State* L, int idx, const(void)* p); 130 int lua_setmetatable(lua_State* L, int objindex); 131 int lua_setiuservalue(lua_State* L, int idx, int n); 132 void lua_callk(lua_State* L, int nargs, int nresults, lua_KContext ctx, lua_KFunction k); 133 int lua_pcallk(lua_State* L, int nargs, int nresults, int errfunc, lua_KContext ctx, lua_KFunction k); 134 int lua_load(lua_State* L, lua_Reader reader, void* dt, const(char)* chunkname, const(char)* mode); 135 int lua_dump(lua_State* L, lua_Writer writer, void* data, int strip); 136 int lua_yieldk(lua_State* L, int nresults, lua_KContext ctx, lua_KFunction k); 137 int lua_resume(lua_State* L, lua_State* from, int narg, int* nres); 138 int lua_status(lua_State* L); 139 int lua_isyieldable(lua_State* L); 140 void lua_setwarnf(lua_State *L, lua_WarnFunction f, void *ud); 141 void lua_warning(lua_State *L, const char *msg, int tocont); 142 int lua_gc(lua_State* L, int what, ...); 143 int lua_error(lua_State* L); 144 int lua_next(lua_State* L, int idx); 145 void lua_concat(lua_State* L, int n); 146 void lua_len(lua_State* L, int idx); 147 size_t plua_stringtonumber(lua_State* L, const(char)* s); 148 lua_Alloc lua_getallocf(lua_State* L, void** ud); 149 void lua_setallocf(lua_State* L, lua_Alloc f, void* ud); 150 void lua_toclose(lua_State *L, int idx); 151 int lua_getstack(lua_State* L, int level, lua_Debug* ar); 152 int lua_getinfo(lua_State* L, const(char)* what, lua_Debug* ar); 153 const(char)* lua_getlocal(lua_State* L, const(lua_Debug)* ar, int n); 154 const(char)* lua_setlocal(lua_State* L, const(lua_Debug)* ar, int n); 155 const(char)* lua_getupvalue(lua_State* L, int funcindex, int n); 156 const(char)* lua_setupvalue(lua_State* L, int funcindex, int n); 157 void* lua_upvalueid(lua_State* L, int fidx, int n); 158 void lua_upvaluejoin(lua_State* L, int fidx1, int n1, int fidx2, int n2); 159 int lua_sethook(lua_State* L, lua_Hook func, int mask, int count); 160 lua_Hook lua_gethook(lua_State* L); 161 int lua_gethookmask(lua_State* L); 162 int lua_gethookcount(lua_State* L); 163 164 // lualib.h 165 int luaopen_base(lua_State* L); 166 int luaopen_coroutine(lua_State* L); 167 int luaopen_table(lua_State* L); 168 int luaopen_io(lua_State* L); 169 int luaopen_os(lua_State* L); 170 int luaopen_string(lua_State* L); 171 int luaopen_utf8(lua_State* L); 172 int luaopen_math(lua_State* L); 173 int luaopen_debug(lua_State* L); 174 int luaopen_package(lua_State* L); 175 void luaL_openlibs(lua_State* L);