The Battle for Wesnoth  1.15.1+dev
Macros | Functions
lstring.h File Reference
#include "lgc.h"
#include "lobject.h"
#include "lstate.h"
Include dependency graph for lstring.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define sizelstring(l)   (sizeof(union UTString) + ((l) + 1) * sizeof(char))
 
#define sizeludata(l)   (sizeof(union UUdata) + (l))
 
#define sizeudata(u)   sizeludata((u)->len)
 
#define luaS_newliteral(L, s)
 
#define isreserved(s)   ((s)->tt == LUA_TSHRSTR && (s)->extra > 0)
 
#define eqshrstr(a, b)   check_exp((a)->tt == LUA_TSHRSTR, (a) == (b))
 

Functions

LUAI_FUNC unsigned int luaS_hash (const char *str, size_t l, unsigned int seed)
 
LUAI_FUNC unsigned int luaS_hashlongstr (TString *ts)
 
LUAI_FUNC int luaS_eqlngstr (TString *a, TString *b)
 
LUAI_FUNC void luaS_resize (lua_State *L, int newsize)
 
LUAI_FUNC void luaS_clearcache (global_State *g)
 
LUAI_FUNC void luaS_init (lua_State *L)
 
LUAI_FUNC void luaS_remove (lua_State *L, TString *ts)
 
LUAI_FUNC UdataluaS_newudata (lua_State *L, size_t s)
 
LUAI_FUNC TStringluaS_newlstr (lua_State *L, const char *str, size_t l)
 
LUAI_FUNC TStringluaS_new (lua_State *L, const char *str)
 
LUAI_FUNC TStringluaS_createlngstrobj (lua_State *L, size_t l)
 

Macro Definition Documentation

◆ eqshrstr

#define eqshrstr (   a,
  b 
)    check_exp((a)->tt == LUA_TSHRSTR, (a) == (b))

Definition at line 33 of file lstring.h.

Referenced by luaH_getshortstr(), and luaV_equalobj().

◆ isreserved

#define isreserved (   s)    ((s)->tt == LUA_TSHRSTR && (s)->extra > 0)

Definition at line 27 of file lstring.h.

Referenced by llex(), and undefgoto().

◆ luaS_newliteral

#define luaS_newliteral (   L,
  s 
)
Value:
(luaS_newlstr(L, "" s, \
(sizeof(s)/sizeof(char))-1))
LUAI_FUNC TString * luaS_newlstr(lua_State *L, const char *str, size_t l)
Definition: lstring.cpp:199
static map_location::DIRECTION s

Definition at line 20 of file lstring.h.

Referenced by luaS_init(), luaX_init(), luaX_setinput(), and seterrorobj().

◆ sizelstring

#define sizelstring (   l)    (sizeof(union UTString) + ((l) + 1) * sizeof(char))

Definition at line 15 of file lstring.h.

Referenced by createstrobj(), freeobj(), and reallymarkobject().

◆ sizeludata

#define sizeludata (   l)    (sizeof(union UUdata) + (l))

Definition at line 17 of file lstring.h.

Referenced by luaS_newudata().

◆ sizeudata

#define sizeudata (   u)    sizeludata((u)->len)

Definition at line 18 of file lstring.h.

Referenced by freeobj(), and reallymarkobject().

Function Documentation

◆ luaS_clearcache()

LUAI_FUNC void luaS_clearcache ( global_State g)

Definition at line 103 of file lstring.cpp.

References i, iswhite, global_State::memerrmsg, global_State::strcache, STRCACHE_M, and STRCACHE_N.

Referenced by atomic().

◆ luaS_createlngstrobj()

LUAI_FUNC TString* luaS_createlngstrobj ( lua_State L,
size_t  l 
)

Definition at line 147 of file lstring.cpp.

References createstrobj(), G, TString::lnglen, LUA_TLNGSTR, and TString::u.

Referenced by LoadString(), luaS_newlstr(), and luaV_concat().

◆ luaS_eqlngstr()

LUAI_FUNC int luaS_eqlngstr ( TString a,
TString b 
)

Definition at line 40 of file lstring.cpp.

References getstr, TString::lnglen, lua_assert, LUA_TLNGSTR, and TString::u.

Referenced by luaV_equalobj().

◆ luaS_hash()

LUAI_FUNC unsigned int luaS_hash ( const char *  str,
size_t  l,
unsigned int  seed 
)

Definition at line 49 of file lstring.cpp.

References cast, cast_byte, h, and LUAI_HASHLIMIT.

Referenced by internshrstr(), luaS_hashlongstr(), and makeseed().

◆ luaS_hashlongstr()

LUAI_FUNC unsigned int luaS_hashlongstr ( TString ts)

Definition at line 58 of file lstring.cpp.

References TString::extra, getstr, TString::hash, TString::lnglen, lua_assert, LUA_TLNGSTR, luaS_hash(), and TString::u.

Referenced by mainposition().

◆ luaS_init()

LUAI_FUNC void luaS_init ( lua_State L)

◆ luaS_new()

LUAI_FUNC TString* luaS_new ( lua_State L,
const char *  str 
)

◆ luaS_newlstr()

LUAI_FUNC TString* luaS_newlstr ( lua_State L,
const char *  str,
size_t  l 
)

◆ luaS_newudata()

LUAI_FUNC Udata* luaS_newudata ( lua_State L,
size_t  s 
)

◆ luaS_remove()

LUAI_FUNC void luaS_remove ( lua_State L,
TString ts 
)

Definition at line 154 of file lstring.cpp.

References G, stringtable::hash, TString::hash, TString::hnext, lmod, stringtable::nuse, p, stringtable::size, and TString::u.

Referenced by freeobj().

◆ luaS_resize()

LUAI_FUNC void luaS_resize ( lua_State L,
int  newsize 
)