#include <clua.h>
Public Member Functions | |
CLua (bool managed=true) | |
~CLua () | |
lua_State * | state () |
operator lua_State * () | |
void | save (writer &outf) |
void | gc () |
void | setglobal (const char *name) |
void | getglobal (const char *name) |
std::string | setuniqregistry () |
void | setregistry (const char *name) |
void | getregistry (const char *name) |
int | loadbuffer (const char *buf, size_t size, const char *context) |
int | loadstring (const char *str, const char *context) |
int | execstring (const char *str, const char *context="init.txt", int nresults=0) |
int | execfile (const char *filename, bool trusted=false, bool die_on_fail=false, bool force=false) |
void | pushglobal (const std::string &name) |
maybe_bool | callmbooleanfn (const char *fn, const char *params,...) |
bool | callbooleanfn (bool defval, const char *fn, const char *params,...) |
bool | callfn (const char *fn, int nargs, int nret=1) |
bool | callfn (const char *fn, const char *params,...) |
void | fnreturns (const char *params,...) |
bool | runhook (const char *hook, const char *params,...) |
void | add_shutdown_listener (lua_shutdown_listener *) |
void | remove_shutdown_listener (lua_shutdown_listener *) |
void | print_stack () |
Static Public Member Functions | |
static CLua & | get_vm (lua_State *) |
static int | file_write (lua_State *ls) |
static int | loadfile (lua_State *ls, const char *file, bool trusted=false, bool die_on_fail=false) |
static bool | is_path_safe (std::string file, bool trusted=false) |
static bool | is_managed_vm (lua_State *ls) |
Public Attributes | |
std::string | error |
bool | managed_vm |
bool | shutting_down |
int | throttle_unit_lines |
int | throttle_sleep_ms |
int | throttle_sleep_start |
int | throttle_sleep_end |
int | n_throttle_sleeps |
int | mixed_call_depth |
int | lua_call_depth |
int | max_mixed_call_depth |
int | max_lua_call_depth |
long | memory_used |
Static Public Attributes | |
static const int | MAX_THROTTLE_SLEEPS = 100 |
Friends | |
class | lua_call_throttle |
Classes | |
struct | CLuaSave |
CLua::CLua | ( | bool | managed = true |
) |
CLua::~CLua | ( | ) |
CLua & CLua::get_vm | ( | lua_State * | ls | ) | [static] |
lua_State * CLua::state | ( | ) |
CLua::operator lua_State * | ( | ) | [inline] |
void CLua::save | ( | writer & | outf | ) |
void CLua::gc | ( | ) |
void CLua::setglobal | ( | const char * | name | ) |
void CLua::getglobal | ( | const char * | name | ) |
std::string CLua::setuniqregistry | ( | ) |
void CLua::setregistry | ( | const char * | name | ) |
void CLua::getregistry | ( | const char * | name | ) |
int CLua::loadbuffer | ( | const char * | buf, | |
size_t | size, | |||
const char * | context | |||
) |
int CLua::loadstring | ( | const char * | str, | |
const char * | context | |||
) |
int CLua::execstring | ( | const char * | str, | |
const char * | context = "init.txt" , |
|||
int | nresults = 0 | |||
) |
int CLua::execfile | ( | const char * | filename, | |
bool | trusted = false , |
|||
bool | die_on_fail = false , |
|||
bool | force = false | |||
) |
void CLua::pushglobal | ( | const std::string & | name | ) |
maybe_bool CLua::callmbooleanfn | ( | const char * | fn, | |
const char * | params, | |||
... | ||||
) |
bool CLua::callbooleanfn | ( | bool | defval, | |
const char * | fn, | |||
const char * | params, | |||
... | ||||
) |
bool CLua::callfn | ( | const char * | fn, | |
int | nargs, | |||
int | nret = 1 | |||
) |
bool CLua::callfn | ( | const char * | fn, | |
const char * | params, | |||
... | ||||
) |
void CLua::fnreturns | ( | const char * | params, | |
... | ||||
) |
bool CLua::runhook | ( | const char * | hook, | |
const char * | params, | |||
... | ||||
) |
void CLua::add_shutdown_listener | ( | lua_shutdown_listener * | listener | ) |
void CLua::remove_shutdown_listener | ( | lua_shutdown_listener * | listener | ) |
int CLua::file_write | ( | lua_State * | ls | ) | [static] |
int CLua::loadfile | ( | lua_State * | ls, | |
const char * | file, | |||
bool | trusted = false , |
|||
bool | die_on_fail = false | |||
) | [static] |
bool CLua::is_path_safe | ( | std::string | file, | |
bool | trusted = false | |||
) | [static] |
bool CLua::is_managed_vm | ( | lua_State * | ls | ) | [static] |
void CLua::print_stack | ( | ) |
friend class lua_call_throttle [friend] |
bool CLua::managed_vm |
bool CLua::shutting_down |
long CLua::memory_used |
const int CLua::MAX_THROTTLE_SLEEPS = 100 [static] |