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.v52.bindstatic;
8 
9 
10 version(BindBC_Static) version = BindLua_Static;
11 version(BindLua_Static) {
12     version(LUA_52) version = LUA_52_STATIC;
13 }
14 
15 version(LUA_52_STATIC):
16 
17 import core.stdc.stdarg : va_list;
18 import bindbc.lua.v52.types;
19 
20 extern(C) @nogc nothrow:
21     // lauxlib.h
22     void luaL_checkversion_(lua_State* L, lua_Number ver);
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 numarg, const(char)* extramsg);
27     const(char)* luaL_checklstring(lua_State* L, int numArg, size_t* l);
28     const(char)* luaL_optlstring(lua_State* L, int numArg, const(char)* def, size_t* l);
29     lua_Number luaL_checknumber(lua_State* L, int numArg);
30     lua_Number luaL_optnumber(lua_State* L, int nArg, lua_Number def);
31     lua_Integer luaL_checkinteger(lua_State* L, int numArg);
32     lua_Integer luaL_optinteger(lua_State* L, int nArg, lua_Integer def);
33     lua_Unsigned luaL_checkunsigned(lua_State* L, int numArg);
34     lua_Unsigned luaL_optunsigned(lua_State* L, int numArg, lua_Unsigned def);
35     void luaL_checkstack(lua_State* L, int sz, const(char)* msg);
36     void luaL_checktype(lua_State* L, int narg, int t);
37     void luaL_checkany(lua_State* L, int narg);
38     int luaL_newmetatable(lua_State* L, const(char)* tname);
39     void luaL_setmetatable(lua_State* L, const(char)* tname);
40     void* luaL_testudata(lua_State* L, int ud, const(char)* tname);
41     void* luaL_checkudata(lua_State* L, int ud, const(char)* tname);
42     void luaL_where(lua_State* L, int lvl);
43     int luaL_error(lua_State* L, const(char)* fmt, ...);
44     int luaL_checkoption(lua_State* L, int narg, const(char)* def, const(char)** lst);
45     int luaL_fileresult(lua_State* L, int stat, const(char)* fname);
46     int luaL_execresult(lua_State* L, int stat);
47     int luaL_ref(lua_State* L, int t);
48     void luaL_unref(lua_State* L, int t, int ref_);
49     int luaL_loadfilex(lua_State* L, const(char)* filename, const(char)* mode);
50     int luaL_loadbufferx(lua_State* L, const(char)* buff, size_t sz, const(char)* name, const(char)* mode);
51     int luaL_loadstring(lua_State* L, const(char)* s);
52     lua_State* luaL_newstate();
53     int luaL_len(lua_State* L, int idx);
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*, 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     const(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_remove(lua_State* L, int idx);
79     void lua_insert(lua_State* L, int idx);
80     void lua_replace(lua_State* L, int idx);
81     void lua_copy(lua_State* L, int fromidx, int toidx);
82     int lua_checkstack(lua_State* L, int sz);
83     void lua_xmove(lua_State* from, lua_State* to, int n);
84     int lua_isnumber(lua_State* L, int idx);
85     int lua_isstring(lua_State* L, int idx);
86     int lua_iscfunction(lua_State* L, int idx);
87     int lua_isuserdata(lua_State* L, int idx);
88     int lua_type(lua_State* L, int idx);
89     const(char)* lua_typename(lua_State* L, int tp);
90     lua_Number lua_tonumberx(lua_State* L, int idx, int* isnum);
91     lua_Integer lua_tointegerx(lua_State* L, int idx, int* isnum);
92     lua_Unsigned lua_tounsignedx(lua_State* L, int idx, int* isnum);
93     int lua_toboolean(lua_State* L, int idx);
94     const(char)* lua_tolstring(lua_State* L, int idx, size_t* len);
95     size_t lua_rawlen(lua_State* L, int idx);
96     lua_CFunction lua_tocfunction(lua_State* L, int idx);
97     void* lua_touserdata(lua_State* L, int idx);
98     lua_State* lua_tothread(lua_State* L, int idx);
99     const(void)* lua_topointer(lua_State* L, int idx);
100     void lua_arith(lua_State* L, int op);
101     int lua_rawequal(lua_State* L, int idx1, int idx2);
102     int lua_compare(lua_State* L, int idx1, int idx2, int op);
103     void lua_pushnil(lua_State* L);
104     void lua_pushnumber(lua_State* L, lua_Number n);
105     void lua_pushinteger(lua_State* L, lua_Integer n);
106     void lua_pushunsigned(lua_State* L, lua_Unsigned n);
107     void lua_pushlstring(lua_State* L, const(char)* s, size_t l);
108     void lua_pushstring(lua_State* L, const(char)* s);
109     const(char)* lua_pushvfstring(lua_State* L, const(char)* fmt, va_list argp);
110     const(char)* lua_pushfstring(lua_State* L, const(char)* fmt, ...);
111     void lua_pushcclosure(lua_State* L, lua_CFunction fn, int n);
112     void lua_pushboolean(lua_State* L, int b);
113     void lua_pushlightuserdata(lua_State* L, void* p);
114     int lua_pushthread(lua_State* L);
115     void lua_getglobal(lua_State* L, const(char)* var);
116     void lua_gettable(lua_State* L, int idx);
117     void lua_getfield(lua_State* L, int idx, const(char)* k);
118     void lua_rawget(lua_State* L, int idx);
119     void lua_rawgeti(lua_State* L, int idx, int n);
120     void lua_rawgetp(lua_State* L, int idx, const(void)* p);
121     void lua_createtable(lua_State* L, int narr, int nrec);
122     void* lua_newuserdata(lua_State* L, size_t sz);
123     int lua_getmetatable(lua_State* L, int objindex);
124     void lua_getuservalue(lua_State* L, int idx);
125     void lua_setglobal(lua_State* L, const(char)* var);
126     void lua_settable(lua_State* L, int idx);
127     void lua_setfield(lua_State* L, int idx, const(char)* k);
128     void lua_rawset(lua_State* L, int idx);
129     void lua_rawseti(lua_State* L, int idx, int n);
130     void lua_rawsetp(lua_State* L, int idx, const(void)* p);
131     int lua_setmetatable(lua_State* L, int objindex);
132     int lua_setuservalue(lua_State* L, int idx);
133     void lua_callk(lua_State* L, int nargs, int nresults, int ctx, lua_CFunction k);
134     int lua_getctx(lua_State* L, int* ctx);
135     int lua_pcallk(lua_State* L, int nargs, int nresults, int errfunc, int ctx, lua_CFunction k);
136     int lua_load(lua_State* L, lua_Reader reader, void* dt, const(char)* chunkname, const(char)* mode);
137     int lua_dump(lua_State* L, lua_Writer writer, void* data);
138     int lua_yieldk(lua_State* L, int nresults, int ctx, lua_CFunction k);
139     int lua_resume(lua_State* L, lua_State* from, int narg);
140     int lua_status(lua_State* L);
141     int lua_gc(lua_State* L, int what, int data);
142     int lua_error(lua_State* L);
143     int lua_next(lua_State* L, int idx);
144     void lua_concat(lua_State* L, int n);
145     void lua_len(lua_State* L, int idx);
146     lua_Alloc lua_getallocf(lua_State* L, void** ud);
147     void lua_setallocf(lua_State* L, lua_Alloc f, void* ud);
148     int lua_getstack(lua_State* L, int level, lua_Debug* ar);
149     int lua_getinfo(lua_State* L, const(char)* what, lua_Debug* ar);
150     const(char)* lua_getlocal(lua_State* L, const(lua_Debug)* ar, int n);
151     const(char)* lua_setlocal(lua_State* L, const(lua_Debug)* ar, int n);
152     const(char)* lua_getupvalue(lua_State* L, int funcindex, int n);
153     const(char)* lua_setupvalue(lua_State* L, int funcindex, int n);
154     void* lua_upvalueid(lua_State* L, int fidx, int n);
155     void lua_upvaluejoin(lua_State* L, int fidx1, int n1, int fidx2, int n2);
156     int lua_sethook(lua_State* L, lua_Hook func, int mask, int count);
157     lua_Hook lua_gethook(lua_State* L);
158     int lua_gethookmask(lua_State* L);
159     int lua_gethookcount(lua_State* L);
160 
161     // lualib.h
162     int luaopen_base(lua_State* L);
163     int luaopen_coroutine(lua_State* L);
164     int luaopen_table(lua_State* L);
165     int luaopen_io(lua_State* L);
166     int luaopen_os(lua_State* L);
167     int luaopen_string(lua_State* L);
168     int luaopen_bit32(lua_State* L);
169     int luaopen_math(lua_State* L);
170     int luaopen_debug(lua_State* L);
171     int luaopen_package(lua_State* L);
172     void luaL_openlibs(lua_State* L);