diff options
author | Andy Belle-Isle <drumsetmonkey@gmail.com> | 2019-08-28 00:57:57 -0400 |
---|---|---|
committer | Andy Belle-Isle <drumsetmonkey@gmail.com> | 2019-08-28 00:57:57 -0400 |
commit | 85fb2bff38b2ef6cb17e86c5f602ee09a365b117 (patch) | |
tree | a8066d33233ec9b6a2b9bb281a1de040ab96be7b /lib/LuaBridge/Tests/Lua/Lua.5.2.0/src/lstring.h | |
parent | 787393dd86d6c37b5680847dd4eef14406a86687 (diff) |
Added LuaBridge support
Diffstat (limited to 'lib/LuaBridge/Tests/Lua/Lua.5.2.0/src/lstring.h')
-rw-r--r-- | lib/LuaBridge/Tests/Lua/Lua.5.2.0/src/lstring.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/lib/LuaBridge/Tests/Lua/Lua.5.2.0/src/lstring.h b/lib/LuaBridge/Tests/Lua/Lua.5.2.0/src/lstring.h new file mode 100644 index 0000000..d708a1b --- /dev/null +++ b/lib/LuaBridge/Tests/Lua/Lua.5.2.0/src/lstring.h @@ -0,0 +1,37 @@ +/* +** $Id: lstring.h,v 1.46 2010/04/05 16:26:37 roberto Exp $ +** String table (keep all strings handled by Lua) +** See Copyright Notice in lua.h +*/ + +#ifndef lstring_h +#define lstring_h + +#include "lgc.h" +#include "lobject.h" +#include "lstate.h" + + +#define sizestring(s) (sizeof(union TString)+((s)->len+1)*sizeof(char)) + +#define sizeudata(u) (sizeof(union Udata)+(u)->len) + +#define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \ + (sizeof(s)/sizeof(char))-1)) + +#define luaS_fix(s) l_setbit((s)->tsv.marked, FIXEDBIT) + + +/* +** as all string are internalized, string equality becomes +** pointer equality +*/ +#define eqstr(a,b) ((a) == (b)) + +LUAI_FUNC void luaS_resize (lua_State *L, int newsize); +LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e); +LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l); +LUAI_FUNC TString *luaS_new (lua_State *L, const char *str); + + +#endif |