annotate lib/lua/lua-5.2.2/lstring.h @ 2287:4e3236a4ea63

GenerateItemsInChest cleaned up a bit, unified the two switches
author Grumpy7
date Sat, 15 Mar 2014 23:42:51 +0100
parents 41cc4dd3c122
children
rev   line source
1866
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
1 /*
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
2 ** $Id: lstring.h,v 1.49 2012/02/01 21:57:15 roberto Exp $
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
3 ** String table (keep all strings handled by Lua)
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
4 ** See Copyright Notice in lua.h
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
5 */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
6
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
7 #ifndef lstring_h
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
8 #define lstring_h
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
9
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
10 #include "lgc.h"
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
11 #include "lobject.h"
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
12 #include "lstate.h"
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
13
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
14
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
15 #define sizestring(s) (sizeof(union TString)+((s)->len+1)*sizeof(char))
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
16
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
17 #define sizeudata(u) (sizeof(union Udata)+(u)->len)
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
18
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
19 #define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
20 (sizeof(s)/sizeof(char))-1))
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
21
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
22 #define luaS_fix(s) l_setbit((s)->tsv.marked, FIXEDBIT)
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
23
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
24
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
25 /*
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
26 ** test whether a string is a reserved word
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
27 */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
28 #define isreserved(s) ((s)->tsv.tt == LUA_TSHRSTR && (s)->tsv.extra > 0)
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
29
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
30
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
31 /*
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
32 ** equality for short strings, which are always internalized
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
33 */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
34 #define eqshrstr(a,b) check_exp((a)->tsv.tt == LUA_TSHRSTR, (a) == (b))
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
35
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
36
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
37 LUAI_FUNC unsigned int luaS_hash (const char *str, size_t l, unsigned int seed);
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
38 LUAI_FUNC int luaS_eqlngstr (TString *a, TString *b);
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
39 LUAI_FUNC int luaS_eqstr (TString *a, TString *b);
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
40 LUAI_FUNC void luaS_resize (lua_State *L, int newsize);
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
41 LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e);
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
42 LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
43 LUAI_FUNC TString *luaS_new (lua_State *L, const char *str);
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
44
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
45
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
46 #endif