The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Macros | Functions
lstring.cpp File Reference
#include <string.h>
#include "lua.h"
#include "lmem.h"
#include "lobject.h"
#include "lstate.h"
#include "lstring.h"
Include dependency graph for lstring.cpp:

Go to the source code of this file.

Macros

#define lstring_c
 
#define LUA_CORE
 
#define LUAI_HASHLIMIT   5
 

Functions

int luaS_eqlngstr (TString *a, TString *b)
 
int luaS_eqstr (TString *a, TString *b)
 
unsigned int luaS_hash (const char *str, size_t l, unsigned int seed)
 
void luaS_resize (lua_State *L, int newsize)
 
static TStringcreatestrobj (lua_State *L, const char *str, size_t l, int tag, unsigned int h, GCObject **list)
 
static TStringnewshrstr (lua_State *L, const char *str, size_t l, unsigned int h)
 
static TStringinternshrstr (lua_State *L, const char *str, size_t l)
 
TStringluaS_newlstr (lua_State *L, const char *str, size_t l)
 
TStringluaS_new (lua_State *L, const char *str)
 
UdataluaS_newudata (lua_State *L, size_t s, Table *e)
 

Macro Definition Documentation

#define lstring_c

Definition at line 9 of file lstring.cpp.

#define LUA_CORE

Definition at line 10 of file lstring.cpp.

#define LUAI_HASHLIMIT   5

Definition at line 25 of file lstring.cpp.

Referenced by luaS_hash().

Function Documentation

static TString* createstrobj ( lua_State L,
const char *  str,
size_t  l,
int  tag,
unsigned int  h,
GCObject **  list 
)
static

Definition at line 97 of file lstring.cpp.

References TString::extra, h, TString::hash, TString::len, luaC_newobj(), GCObject::ts, and TString::tsv.

Referenced by luaS_newlstr(), and newshrstr().

static TString* internshrstr ( lua_State L,
const char *  str,
size_t  l 
)
static
int luaS_eqlngstr ( TString a,
TString b 
)

Definition at line 32 of file lstring.cpp.

References getstr, TString::len, lua_assert, LUA_TLNGSTR, and TString::tsv.

Referenced by luaS_eqstr(), and luaV_equalobj_().

int luaS_eqstr ( TString a,
TString b 
)
unsigned int luaS_hash ( const char *  str,
size_t  l,
unsigned int  seed 
)

Definition at line 50 of file lstring.cpp.

References cast, cast_byte, h, and LUAI_HASHLIMIT.

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

TString* luaS_new ( lua_State L,
const char *  str 
)
TString* luaS_newlstr ( lua_State L,
const char *  str,
size_t  l 
)
Udata* luaS_newudata ( lua_State L,
size_t  s,
Table e 
)
void luaS_resize ( lua_State L,
int  newsize 
)
static TString* newshrstr ( lua_State L,
const char *  str,
size_t  l,
unsigned int  h 
)
static