Minetest  5.4.0
c_internal.cpp File Reference
#include "common/c_internal.h"
#include "debug.h"
#include "log.h"
#include "porting.h"
#include "settings.h"
+ Include dependency graph for c_internal.cpp:

Functions

std::string script_get_backtrace (lua_State *L)
 
int script_exception_wrapper (lua_State *L, lua_CFunction f)
 
void script_error (lua_State *L, int pcall_result, const char *mod, const char *fxn)
 
void script_run_callbacks_f (lua_State *L, int nargs, RunCallbacksMode mode, const char *fxn)
 
static void script_log (lua_State *L, const std::string &message, std::ostream &log_to, bool do_error, int stack_depth)
 
DeprecatedHandlingMode get_deprecated_handling_mode ()
 Reads deprecated_lua_api_handling in settings, returns cached value. More...
 
void log_deprecated (lua_State *L, const std::string &message, int stack_depth)
 Handles a deprecation warning based on user settings. More...
 

Function Documentation

◆ get_deprecated_handling_mode()

DeprecatedHandlingMode get_deprecated_handling_mode ( )

Reads deprecated_lua_api_handling in settings, returns cached value.

Returns
DeprecatedHandlingMode

References Error, g_settings, Settings::get(), Ignore, and Log.

Referenced by ModApiBase::l_deprecated_function(), and log_deprecated().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ log_deprecated()

void log_deprecated ( lua_State *  L,
const std::string &  message,
int  stack_depth = 1 
)

Handles a deprecation warning based on user settings.

Parameters
LLua State
messageThe deprecation method
stack_depthHow far on the stack to the first user function (ie: not builtin or core)

References Error, get_deprecated_handling_mode(), Ignore, script_log(), and warningstream.

Referenced by ModApiParticles::l_add_particle(), ModApiParticles::l_add_particlespawner(), ObjectRef::l_get_attribute(), ModApiEnvMod::l_get_connected_players(), ObjectRef::l_get_entity_name(), ObjectRef::l_get_look_pitch(), ObjectRef::l_get_look_yaw(), ModApiMapgen::l_get_mapgen_params(), ModApiUtil::l_log(), ModApiMapgen::l_register_ore(), ObjectRef::l_set_attribute(), ObjectRef::l_set_look_pitch(), ObjectRef::l_set_look_yaw(), ModApiMapgen::l_set_mapgen_params(), ObjectRef::l_set_physics_override(), ObjectRef::l_set_sky(), and read_hud_element().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ script_error()

void script_error ( lua_State *  L,
int  pcall_result,
const char *  mod,
const char *  fxn 
)

References itos(), and porting::mt_snprintf().

Referenced by ModApiBase::l_deprecated_function(), script_log(), script_run_callbacks_f(), and ScriptApiBase::scriptError().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ script_exception_wrapper()

int script_exception_wrapper ( lua_State *  L,
lua_CFunction  f 
)

Referenced by ScriptApiBase::ScriptApiBase().

+ Here is the caller graph for this function:

◆ script_get_backtrace()

std::string script_get_backtrace ( lua_State *  L)

◆ script_log()

static void script_log ( lua_State *  L,
const std::string &  message,
std::ostream &  log_to,
bool  do_error,
int  stack_depth 
)
static

References FATAL_ERROR_IF, infostream, script_error(), and script_get_backtrace().

Referenced by log_deprecated().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ script_run_callbacks_f()

void script_run_callbacks_f ( lua_State *  L,
int  nargs,
RunCallbacksMode  mode,
const char *  fxn 
)

References FATAL_ERROR_IF, PUSH_ERROR_HANDLER, and script_error().

+ Here is the call graph for this function: