aboutsummaryrefslogtreecommitdiff
path: root/lib/lua/src/ltable.h
blob: f5b9d5ead0f4a44fba1f800f5c4d604beabdbe73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
** $Id: ltable.h,v 2.10.1.1 2007/12/27 13:02:25 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.nk)
#define gval(n)		(&(n)->i_val)
#define gnext(n)	((n)->i_key.nk.next)

#define key2tval(n)	(&(n)->i_key.tvk)


LUAI_FUNC const TValue *luaH_getnum (Table *t, int key);
LUAI_FUNC TValue *luaH_setnum (lua_State *L, Table *t, int key);
LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key);
LUAI_FUNC TValue *luaH_setstr (lua_State *L, Table *t, TString *key);
LUAI_FUNC const TValue *luaH_get (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, int narray, int lnhash);
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
/span> utility.cpp servermain.cpp test.cpp SERVER_SOURCES = $(addprefix src/, $(SERVER_SOURCE_FILES)) SERVER_BUILD_DIR = serverbuild SERVER_OBJECTS = $(addprefix $(SERVER_BUILD_DIR)/, $(SERVER_SOURCE_FILES:.cpp=.o)) IRRLICHTPATH = ../irrlicht/irrlicht-1.7.1 JTHREADPATH = ../jthread/jthread-1.2.1 all: fast ifeq ($(HOSTTYPE), x86_64) LIBSELECT=64 endif debug: CXXFLAGS = -Wall -g -O1 debug: CPPFLAGS = -I$(IRRLICHTPATH)/include -I/usr/X11R6/include -I$(JTHREADPATH)/src -DDEBUG -DRUN_IN_PLACE debug: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L$(IRRLICHTPATH)/lib/Linux -L$(JTHREADPATH)/src/.libs -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -ljthread -lz fast: CXXFLAGS = -O3 -ffast-math -Wall -fomit-frame-pointer -pipe -funroll-loops -mtune=i686 fast: CPPFLAGS = -I$(IRRLICHTPATH)/include -I/usr/X11R6/include -I$(JTHREADPATH)/src -DUNITTEST_DISABLE -DRUN_IN_PLACE fast: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L$(IRRLICHTPATH)/lib/Linux -L$(JTHREADPATH)/src/.libs -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -ljthread -lz server: CXXFLAGS = -O3 -ffast-math -Wall -fomit-frame-pointer -pipe -funroll-loops -mtune=i686 server: CPPFLAGS = -I$(IRRLICHTPATH)/include -I/usr/X11R6/include -I$(JTHREADPATH)/src -DSERVER -DUNITTEST_DISABLE -DRUN_IN_PLACE server: LDFLAGS = -L$(JTHREADPATH)/src/.libs -ljthread -lz -lpthread DEBUG_DESTPATH = bin/$(DEBUG_TARGET) FAST_DESTPATH = bin/$(FAST_TARGET) SERVER_DESTPATH = bin/$(SERVER_TARGET) # Build commands debug: $(DEBUG_BUILD_DIR) $(DEBUG_DESTPATH) fast: $(FAST_BUILD_DIR) $(FAST_DESTPATH) server: $(SERVER_BUILD_DIR) $(SERVER_DESTPATH) $(DEBUG_BUILD_DIR): mkdir -p $(DEBUG_BUILD_DIR) $(FAST_BUILD_DIR): mkdir -p $(FAST_BUILD_DIR) $(SERVER_BUILD_DIR): mkdir -p $(SERVER_BUILD_DIR) $(DEBUG_DESTPATH): $(DEBUG_OBJECTS) $(CXX) -o $@ $(DEBUG_OBJECTS) $(LDFLAGS) $(FAST_DESTPATH): $(FAST_OBJECTS) $(CXX) -o $@ $(FAST_OBJECTS) $(LDFLAGS) $(SERVER_DESTPATH): $(SERVER_OBJECTS) $(CXX) -o $@ $(SERVER_OBJECTS) $(LDFLAGS) $(DEBUG_BUILD_DIR)/%.o: src/%.cpp $(CXX) -c -o $@ $< $(CPPFLAGS) $(CXXFLAGS) $(FAST_BUILD_DIR)/%.o: src/%.cpp $(CXX) -c -o $@ $< $(CPPFLAGS) $(CXXFLAGS) $(SERVER_BUILD_DIR)/%.o: src/%.cpp $(CXX) -c -o $@ $< $(CPPFLAGS) $(CXXFLAGS) clean: clean_debug clean_fast clean_server clean_debug: @$(RM) $(DEBUG_OBJECTS) $(DEBUG_DESTPATH) clean_fast: @$(RM) $(FAST_OBJECTS) $(FAST_DESTPATH) clean_server: @$(RM) $(SERVER_OBJECTS) $(SERVER_DESTPATH) .PHONY: all all_win32 clean clean_debug clean_win32 clean_fast clean_server