11#define META_FILE_NAME "MkExceptionC_tcl.c"
14#include "mk_check_tcl.h"
28void MK(MkExceptionC_Raise) (
40 Tcl_SetResult(interp,
"WARNING: detect recursion on 'MkExceptionC_Raise'", TCL_VOLATILE);
48 while (
MK(Get_Call_Stack)(
MK_RT_CALL interp, err, lvl)) lvl--;
59 if (tclErrObj == NULL) {
60 Tcl_SetResult(interp,
"WARNING: failed to create an error-object", TCL_STATIC);
68 check_LNG(Tcl_ListObjAppendElement(interp,lst,
RG(MkExceptionC)))
goto error;
69 check_LNG(Tcl_ListObjAppendElement(interp,lst,tclErrObj))
goto error;
70 Tcl_SetObjErrorCode(interp,lst);
71 Tcl_SetVar2Ex(interp,
"errorCode",NULL,lst,TCL_GLOBAL_ONLY);
91 if (errorCode == NULL) {
92 errorCode = Tcl_GetVar2Ex (interp,
"errorCode", NULL, TCL_GLOBAL_ONLY);
100 Tcl_ListObjIndex (NULL, errorCode, 0, &item) == TCL_ERROR ||
101 strcmp (Tcl_GetString (item),
"MkExceptionC") != 0
104 MK_STRN errorInfo = Tcl_GetVar (interp,
"errorInfo", TCL_GLOBAL_ONLY);
105 if (errorInfo == NULL) errorInfo =
"unspecified error...";
109 if (Tcl_ListObjIndex (NULL, errorCode, 1, &item) == TCL_ERROR) {
110 MkErrorSetV(err, callfunc, -1,
"internal error: 'errorCode' return: %s", Tcl_GetStringResult(interp));
121 MkErrorSetV (err, callfunc, -1,
"internal error: '%s' has no 'MkObjectC' type",
VAL2STR(item));
125 MkErrorSetC (err,
"internal error: 'MkTestObject' return WRONG num", callfunc, -1);
130 MkErrorSetV (err, callfunc, -1,
"internal error: '%s' has no 'Object' type",
VAL2STR(item));
135 if (newerr == NULL) {
136 MkErrorSetC (err,
"internal error: 'errorCode' has no 'MkExceptionC' type", callfunc, -1);
152 Tcl_ResetResult(interp);
struct MkErrorS * MK_ERR
class-shortcut for struct MkErrorS *, all shortcut using the XX_YYY syntax (only for public API) …
static bool MkErrCheck(MK_MNGN mng)
check MkErrorS -> MkObjectS::signature …
static MK_ERR MkErr(MK_MNG mng)
cast a unknown-object into an MkErrorS pointer or NULL if not possible
#define MkErrorGetText_0E()
#define MkErrorReset_1(err)
#define MkErrorStackFormat(...)
#define MkErrorFORMAT_1M(m)
const MK_PTRB * MK_MNGN
const - a managed object pointer, datatype will be checked at runtime
const MK_STRB * MK_STRN
constant string pointer data-type
MK_PTRB * MK_MNG
managed object pointer, datatype will be checked at runtime
MK_PTRB const * MK_EXP
exception object pointer
MK_STRB * MK_STR
string pointer data-type with UTF8 ecoding (string)
signed int MK_I32
4 byte integer data-type
#define MkLogV_2(fmtobj, printfmt,...)
#define OT_LNG_OBJECT_IS_3(objV, obj, flag)
@ MkTestClassE_INVALID_SIGNATURE
The data-type to store and handle the error-condition …