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