The Battle for Wesnoth  1.15.1+dev
Classes | Macros | Functions | Variables
application_lua_kernel.cpp File Reference

Provides a Lua interpreter, to drive the game_controller. More...

#include "scripting/application_lua_kernel.hpp"
#include "config.hpp"
#include "game_errors.hpp"
#include "log.hpp"
#include "scripting/lua_common.hpp"
#include "scripting/lua_cpp_function.hpp"
#include "scripting/lua_fileops.hpp"
#include "scripting/lua_kernel_base.hpp"
#include "scripting/lua_preferences.hpp"
#include "scripting/plugins/context.hpp"
#include "scripting/plugins/manager.hpp"
#include <map>
#include <sstream>
#include <string>
#include <utility>
#include "utils/functional.hpp"
#include <boost/range/adaptors.hpp>
#include <SDL2/SDL.h>
#include "lua/lauxlib.h"
#include "lua/lua.h"
#include "lua/luaconf.h"
Include dependency graph for application_lua_kernel.cpp:

Go to the source code of this file.

Classes

struct  lua_context_backend
 

Macros

#define DBG_LUA   LOG_STREAM(debug, log_scripting_lua)
 
#define LOG_LUA   LOG_STREAM(info, log_scripting_lua)
 
#define WRN_LUA   LOG_STREAM(warn, log_scripting_lua)
 
#define ERR_LUA   LOG_STREAM(err, log_scripting_lua)
 

Functions

static int intf_describe_plugins (lua_State *L)
 
static int intf_delay (lua_State *L)
 
static lua_Stateget_new_thread (lua_State *L)
 
static int impl_context_backend (lua_State *L, std::shared_ptr< lua_context_backend > backend, std::string req_name)
 
static int impl_context_accessor (lua_State *L, std::shared_ptr< lua_context_backend > backend, plugins_context::accessor_function func)
 

Variables

static lg::log_domain log_scripting_lua ("scripting/lua")
 
static char * v_threadtableKey = 0
 
static void *const threadtableKey = static_cast<void *> (& v_threadtableKey)
 

Detailed Description

Provides a Lua interpreter, to drive the game_controller.

Note
Naming conventions:
  • intf_ functions are exported in the wesnoth domain,
  • impl_ functions are hidden inside metatables,
  • cfun_ functions are closures,
  • luaW_ functions are helpers in Lua style.

Definition in file application_lua_kernel.cpp.

Macro Definition Documentation

◆ DBG_LUA

#define DBG_LUA   LOG_STREAM(debug, log_scripting_lua)

◆ ERR_LUA

#define ERR_LUA   LOG_STREAM(err, log_scripting_lua)

◆ LOG_LUA

#define LOG_LUA   LOG_STREAM(info, log_scripting_lua)

◆ WRN_LUA

#define WRN_LUA   LOG_STREAM(warn, log_scripting_lua)

Definition at line 61 of file application_lua_kernel.cpp.

Function Documentation

◆ get_new_thread()

static lua_State* get_new_thread ( lua_State L)
static

◆ impl_context_accessor()

static int impl_context_accessor ( lua_State L,
std::shared_ptr< lua_context_backend backend,
plugins_context::accessor_function  func 
)
static

◆ impl_context_backend()

static int impl_context_backend ( lua_State L,
std::shared_ptr< lua_context_backend backend,
std::string  req_name 
)
static

◆ intf_delay()

static int intf_delay ( lua_State L)
static

◆ intf_describe_plugins()

static int intf_describe_plugins ( lua_State L)
static

Variable Documentation

◆ log_scripting_lua

lg::log_domain log_scripting_lua("scripting/lua")
static

◆ threadtableKey

void* const threadtableKey = static_cast<void *> (& v_threadtableKey)
static

Definition at line 141 of file application_lua_kernel.cpp.

Referenced by get_new_thread().

◆ v_threadtableKey

char* v_threadtableKey = 0
static

Definition at line 140 of file application_lua_kernel.cpp.