The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Macros | Typedefs | Functions
lstate.cpp File Reference
#include <stddef.h>
#include <string.h>
#include "lua.h"
#include "lapi.h"
#include "ldebug.h"
#include "ldo.h"
#include "lfunc.h"
#include "lgc.h"
#include "llex.h"
#include "lmem.h"
#include "lstate.h"
#include "lstring.h"
#include "ltable.h"
#include "ltm.h"
#include <time.h>
Include dependency graph for lstate.cpp:

Go to the source code of this file.

Classes

struct  LX
 
struct  LG
 

Macros

#define lstate_c
 
#define LUA_CORE
 
#define LUAI_GCPAUSE   200 /* 200% */
 
#define LUAI_GCMAJOR   200 /* 200% */
 
#define LUAI_GCMUL   200 /* GC runs 'twice the speed' of memory allocation */
 
#define MEMERRMSG   "not enough memory"
 
#define luai_makeseed()   cast(unsigned int, time(NULL))
 
#define fromstate(L)   (cast(LX *, cast(lu_byte *, (L)) - offsetof(LX, l)))
 
#define addbuff(b, p, e)
 

Typedefs

typedef struct LX LX
 
typedef struct LG LG
 

Functions

static unsigned int makeseed (lua_State *L)
 
void luaE_setdebt (global_State *g, l_mem debt)
 
CallInfoluaE_extendCI (lua_State *L)
 
void luaE_freeCI (lua_State *L)
 
static void stack_init (lua_State *L1, lua_State *L)
 
static void freestack (lua_State *L)
 
static void init_registry (lua_State *L, global_State *g)
 
static void f_luaopen (lua_State *L, void *ud)
 
static void preinit_state (lua_State *L, global_State *g)
 
static void close_state (lua_State *L)
 
LUA_API lua_Statelua_newthread (lua_State *L)
 
void luaE_freethread (lua_State *L, lua_State *L1)
 
LUA_API lua_Statelua_newstate (lua_Alloc f, void *ud)
 
LUA_API void lua_close (lua_State *L)
 

Macro Definition Documentation

#define addbuff (   b,
  p,
  e 
)
Value:
{ size_t t = cast(size_t, e); \
memcpy(buff + p, &t, sizeof(t)); p += sizeof(t); }
#define cast(t, exp)
Definition: llimits.h:92
GLdouble GLdouble t
Definition: glew.h:1366
GLfloat GLfloat p
Definition: glew.h:12766
#define e

Definition at line 84 of file lstate.cpp.

Referenced by makeseed().

#define fromstate (   L)    (cast(LX *, cast(lu_byte *, (L)) - offsetof(LX, l)))

Definition at line 76 of file lstate.cpp.

Referenced by close_state(), and luaE_freethread().

#define lstate_c

Definition at line 10 of file lstate.cpp.

#define LUA_CORE

Definition at line 11 of file lstate.cpp.

#define LUAI_GCMAJOR   200 /* 200% */

Definition at line 33 of file lstate.cpp.

Referenced by lua_newstate().

#define LUAI_GCMUL   200 /* GC runs 'twice the speed' of memory allocation */

Definition at line 37 of file lstate.cpp.

Referenced by lua_newstate().

#define LUAI_GCPAUSE   200 /* 200% */

Definition at line 29 of file lstate.cpp.

Referenced by lua_newstate().

#define luai_makeseed ( )    cast(unsigned int, time(NULL))

Definition at line 50 of file lstate.cpp.

Referenced by makeseed().

#define MEMERRMSG   "not enough memory"

Definition at line 41 of file lstate.cpp.

Referenced by f_luaopen().

Typedef Documentation

typedef struct LG LG
typedef struct LX LX

Function Documentation

static void close_state ( lua_State L)
static
static void f_luaopen ( lua_State L,
void ud 
)
static
static void freestack ( lua_State L)
static
static void init_registry ( lua_State L,
global_State g 
)
static
LUA_API void lua_close ( lua_State L)

Definition at line 316 of file lstate.cpp.

References close_state(), G, and lua_lock.

Referenced by main(), os_exit(), and lua_kernel_base::~lua_kernel_base().

LUA_API lua_State* lua_newstate ( lua_Alloc  f,
void ud 
)
LUA_API lua_State* lua_newthread ( lua_State L)
CallInfo* luaE_extendCI ( lua_State L)

Definition at line 111 of file lstate.cpp.

References lua_State::ci, lua_assert, luaM_new, CallInfo::next, and CallInfo::previous.

void luaE_freeCI ( lua_State L)

Definition at line 121 of file lstate.cpp.

References lua_State::ci, luaM_free, next, and CallInfo::next.

Referenced by freestack(), and sweepthread().

void luaE_freethread ( lua_State L,
lua_State L1 
)
void luaE_setdebt ( global_State g,
l_mem  debt 
)

Definition at line 105 of file lstate.cpp.

References global_State::GCdebt, and global_State::totalbytes.

Referenced by incstep(), lua_gc(), luaC_step(), and setpause().

static unsigned int makeseed ( lua_State L)
static

Definition at line 88 of file lstate.cpp.

References addbuff, lua_assert, lua_newstate(), luai_makeseed, luaO_nilobject, and luaS_hash().

Referenced by lua_newstate().

static void preinit_state ( lua_State L,
global_State g 
)
static
static void stack_init ( lua_State L1,
lua_State L 
)
static