The Battle for Wesnoth  1.15.0+dev
Macros | Functions | Variables
lcorolib.cpp File Reference
#include "lprefix.h"
#include <stdlib.h>
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
Include dependency graph for lcorolib.cpp:

Go to the source code of this file.


#define lcorolib_c
#define LUA_LIB


static lua_Stategetco (lua_State *L)
static int auxresume (lua_State *L, lua_State *co, int narg)
static int luaB_coresume (lua_State *L)
static int luaB_auxwrap (lua_State *L)
static int luaB_cocreate (lua_State *L)
static int luaB_cowrap (lua_State *L)
static int luaB_yield (lua_State *L)
static int luaB_costatus (lua_State *L)
static int luaB_yieldable (lua_State *L)
static int luaB_corunning (lua_State *L)
LUAMOD_API int luaopen_coroutine (lua_State *L)


static const luaL_Reg co_funcs []

Macro Definition Documentation

◆ lcorolib_c

#define lcorolib_c

Definition at line 7 of file lcorolib.cpp.


#define LUA_LIB

Definition at line 8 of file lcorolib.cpp.

Function Documentation

◆ auxresume()

static int auxresume ( lua_State L,
lua_State co,
int  narg 

◆ getco()

static lua_State* getco ( lua_State L)

Definition at line 21 of file lcorolib.cpp.

References lua_tothread(), and luaL_argcheck.

Referenced by luaB_coresume(), and luaB_costatus().

◆ luaB_auxwrap()

static int luaB_auxwrap ( lua_State L)

◆ luaB_cocreate()

static int luaB_cocreate ( lua_State L)

Definition at line 89 of file lcorolib.cpp.

References lua_newthread(), lua_pushvalue(), LUA_TFUNCTION, lua_xmove(), and luaL_checktype().

Referenced by luaB_cowrap().

◆ luaB_coresume()

static int luaB_coresume ( lua_State L)

Definition at line 57 of file lcorolib.cpp.

References auxresume(), getco(), lua_gettop(), lua_insert, and lua_pushboolean().

◆ luaB_corunning()

static int luaB_corunning ( lua_State L)

Definition at line 144 of file lcorolib.cpp.

References lua_pushboolean(), and lua_pushthread().

◆ luaB_costatus()

static int luaB_costatus ( lua_State L)

Definition at line 111 of file lcorolib.cpp.

References getco(), lua_getstack(), lua_gettop(), LUA_OK, lua_pushliteral, lua_status(), and LUA_YIELD.

◆ luaB_cowrap()

static int luaB_cowrap ( lua_State L)

Definition at line 99 of file lcorolib.cpp.

References lua_pushcclosure(), luaB_auxwrap(), and luaB_cocreate().

◆ luaB_yield()

static int luaB_yield ( lua_State L)

Definition at line 106 of file lcorolib.cpp.

References lua_gettop(), and lua_yield.

◆ luaB_yieldable()

static int luaB_yieldable ( lua_State L)

Definition at line 138 of file lcorolib.cpp.

References lua_isyieldable(), and lua_pushboolean().

◆ luaopen_coroutine()

LUAMOD_API int luaopen_coroutine ( lua_State L)

Definition at line 164 of file lcorolib.cpp.

References luaL_newlib.

Referenced by lua_kernel_base::lua_kernel_base().

Variable Documentation

◆ co_funcs

const luaL_Reg co_funcs[]
Initial value:
= {
{"create", luaB_cocreate},
{"resume", luaB_coresume},
{"running", luaB_corunning},
{"status", luaB_costatus},
{"wrap", luaB_cowrap},
{"yield", luaB_yield},
{"isyieldable", luaB_yieldable},
static int luaB_cocreate(lua_State *L)
Definition: lcorolib.cpp:89
static int luaB_yield(lua_State *L)
Definition: lcorolib.cpp:106
static int luaB_cowrap(lua_State *L)
Definition: lcorolib.cpp:99
static int luaB_costatus(lua_State *L)
Definition: lcorolib.cpp:111
static int luaB_coresume(lua_State *L)
Definition: lcorolib.cpp:57
static int luaB_corunning(lua_State *L)
Definition: lcorolib.cpp:144
static int luaB_yieldable(lua_State *L)
Definition: lcorolib.cpp:138

Definition at line 151 of file lcorolib.cpp.