Files
Bubberstation/code/__HELPERS/_auxtools_api.dm
SkyratBot 9927170b49 [MIRROR] Auxtools is now a config opt-in [MDB IGNORE] (#20361)
* Auxtools is now a config opt-in (#74501)

See https://github.com/tgstation/tgstation/pull/74497

Causes auxtools to not be a default part of the server environment and
requires server operators to manually enable it.

---------

Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com>

* Auxtools is now a config opt-in

---------

Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com>
2023-04-06 02:08:19 +01:00

44 lines
1.1 KiB
Plaintext

#define AUXTOOLS_FULL_INIT 2
#define AUXTOOLS_PARTIAL_INIT 1
GLOBAL_LIST_EMPTY(auxtools_initialized)
GLOBAL_PROTECT(auxtools_initialized)
#define AUXTOOLS_CHECK(LIB)\
if (!CONFIG_GET(flag/auxtools_enabled)) {\
CRASH("Auxtools is not enabled in config!");\
}\
if (GLOB.auxtools_initialized[LIB] != AUXTOOLS_FULL_INIT) {\
if (fexists(LIB)) {\
var/string = LIBCALL(LIB,"auxtools_init")();\
if(findtext(string, "SUCCESS")) {\
GLOB.auxtools_initialized[LIB] = AUXTOOLS_FULL_INIT;\
} else {\
CRASH(string);\
}\
} else {\
CRASH("No file named [LIB] found!")\
}\
}\
#define AUXTOOLS_SHUTDOWN(LIB)\
if (GLOB.auxtools_initialized[LIB] == AUXTOOLS_FULL_INIT && fexists(LIB)){\
LIBCALL(LIB,"auxtools_shutdown")();\
GLOB.auxtools_initialized[LIB] = AUXTOOLS_PARTIAL_INIT;\
}\
#define AUXTOOLS_FULL_SHUTDOWN(LIB)\
if (GLOB.auxtools_initialized[LIB] && fexists(LIB)){\
LIBCALL(LIB,"auxtools_full_shutdown")();\
GLOB.auxtools_initialized[LIB] = FALSE;\
}
/proc/auxtools_stack_trace(msg)
CRASH(msg)
/proc/auxtools_expr_stub()
CRASH("auxtools not loaded")
/proc/enable_debugging(mode, port)
CRASH("auxtools not loaded")