diff options
author | darylm503 <darylm503@Edk2> | 2014-11-07 20:18:01 +0000 |
---|---|---|
committer | darylm503 <darylm503@Edk2> | 2014-11-07 20:18:01 +0000 |
commit | 16a5fed65808adf648004b34f98718301d718fa2 (patch) | |
tree | 1fd24a832f20c1ce4e1e52e0020513d0d1ef5ae8 /AppPkg/Applications/Lua/src/ltable.h | |
parent | c058d59f40b4a95c218cd171ff976bee1ff487e2 (diff) | |
download | edk2-16a5fed65808adf648004b34f98718301d718fa2.tar.gz edk2-16a5fed65808adf648004b34f98718301d718fa2.tar.bz2 edk2-16a5fed65808adf648004b34f98718301d718fa2.zip |
AppPkg: Add the Lua interpreter and library.
StdLib: Add support and include files for Lua.
The sources for the Lua standalone interpreter, as well as its library, have been added to AppPkg/Applications/Lua. The Lua library, LuaLib, can be used to embed Lua into new applications.
The Lua header files, needed for both building and embedding, are located in StdLib/Include/Lua. The original versions of these header files, in the source directory, have been converted into stubs that reference the include files in StdLib. This allows us to keep the Lua sources as close to the distributed version as possible.
Documentation is contained in the Lua/doc directory. Further information is available at www.lua.org.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed Off by: Bruce Maynard <Bruce.Maynard@Emulex.Com>
Reviewed by: Daryl McDaniel <daryl.mcdaniel@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16313 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'AppPkg/Applications/Lua/src/ltable.h')
-rw-r--r-- | AppPkg/Applications/Lua/src/ltable.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/AppPkg/Applications/Lua/src/ltable.h b/AppPkg/Applications/Lua/src/ltable.h new file mode 100644 index 0000000000..d69449b2b8 --- /dev/null +++ b/AppPkg/Applications/Lua/src/ltable.h @@ -0,0 +1,45 @@ +/* +** $Id: ltable.h,v 2.16.1.2 2013/08/30 15:49:41 roberto Exp $ +** Lua tables (hash) +** See Copyright Notice in lua.h +*/ + +#ifndef ltable_h +#define ltable_h + +#include "lobject.h" + + +#define gnode(t,i) (&(t)->node[i]) +#define gkey(n) (&(n)->i_key.tvk) +#define gval(n) (&(n)->i_val) +#define gnext(n) ((n)->i_key.nk.next) + +#define invalidateTMcache(t) ((t)->flags = 0) + +/* returns the key, given the value of a table entry */ +#define keyfromval(v) \ + (gkey(cast(Node *, cast(char *, (v)) - offsetof(Node, i_val)))) + + +LUAI_FUNC const TValue *luaH_getint (Table *t, int key); +LUAI_FUNC void luaH_setint (lua_State *L, Table *t, int key, TValue *value); +LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key); +LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key); +LUAI_FUNC TValue *luaH_newkey (lua_State *L, Table *t, const TValue *key); +LUAI_FUNC TValue *luaH_set (lua_State *L, Table *t, const TValue *key); +LUAI_FUNC Table *luaH_new (lua_State *L); +LUAI_FUNC void luaH_resize (lua_State *L, Table *t, int nasize, int nhsize); +LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, int nasize); +LUAI_FUNC void luaH_free (lua_State *L, Table *t); +LUAI_FUNC int luaH_next (lua_State *L, Table *t, StkId key); +LUAI_FUNC int luaH_getn (Table *t); + + +#if defined(LUA_DEBUG) +LUAI_FUNC Node *luaH_mainposition (const Table *t, const TValue *key); +LUAI_FUNC int luaH_isdummy (Node *n); +#endif + + +#endif |