theConfig 10.0
Loading...
Searching...
No Matches
LibLcConfig_tcl.h File Reference

tag: nhi1-release-250425 More...

+ Include dependency graph for LibLcConfig_tcl.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define LC_DOC   __doc
 
#define HEADER
 
#define LC_TCL_EXTERN
 static library
 
#define LC_TCL_EXTERN_DATA   extern
 
#define LC(n)
 
#define NS(n)
 
#define LcConfigC_ARGS   OBJECT_ARGS
 
#define LcConfigC_ARGS_CALL   OBJECT_ARGS_CALL
 
#define LcSettingC_ARGS   OBJECT_ARGS
 
#define LcSettingC_ARGS_CALL   OBJECT_ARGS_CALL
 
#define LcConfigC_lngO   LC(LcConfigC)
 
#define OT_retObj_SET_CFG(nat)
 
#define OT_TMP_CFG_OBJ(val)
 
#define LcSettingC_lngO   LC(LcSettingC)
 
#define OT_retObj_SET_CFS(nat)
 
#define OT_TMP_CFS_OBJ(val)
 
#define OT_get_CFS_from_NAT(_nat)
 
#define OT_get_CFG_from_NAT(_nat)
 
#define Get_LcConfigFormatE_FromObj_path   LC(Get_LcConfigFormatE_FromObj)
 
#define Get_LcConfigOptionsEF_FromObj_path   LC(Get_LcConfigOptionsEF_FromObj)
 
#define Get_LcConfigTypeE_FromObj_path   LC(Get_LcConfigTypeE_FromObj)
 
#define Get_LcErrorE_FromObj_path   LC(Get_LcErrorE_FromObj)
 
#define Get_LcErrorTypeE_FromObj_path   LC(Get_LcErrorTypeE_FromObj)
 
#define OT_NEW_Lc_enum_OBJ(typ, val)
 

Functions

int tcllcconfig_pLcConfigC_Init (MK_RT mkrt, OT_ENV_T, OT_NS_T)
 
static MK_ARTIFICIAL OT_OBJ_T tcllcconfig_LcConfigC_ObjNew (MK_RT mkrt, OT_ENV_T interp, LcConfigC_type hdl)
 
int tcllcconfig_pLcSettingC_Init (MK_RT mkrt, OT_ENV_T, OT_NS_T)
 
static MK_ARTIFICIAL OT_OBJ_T tcllcconfig_LcSettingC_ObjNew (MK_RT mkrt, OT_ENV_T interp, LcSettingC_type hdl)
 
enum MkErrorE tcllcconfig_ConfigIncludeCall (LcConfigIncludeCallF_ARGS)
 
void tcllcconfig_ConfigIncludeFree (LcConfigIncludeFreeF_ARGS)
 
enum MkErrorE tcllcconfig_SettingDeleteCall (LcSettingDeleteCallF_ARGS)
 
void tcllcconfig_SettingDeleteFree (LcSettingDeleteFreeF_ARGS)
 
LC_TCL_EXTERN int tcllcconfig_Get_LcConfigFormatE_FromObj (MK_RT mkrt, OT_ENV_T interp, OT_OBJ_T enumE, enum LcConfigFormatE *ret)
 
LC_TCL_EXTERN int tcllcconfig_Get_LcConfigOptionsEF_FromObj (MK_RT mkrt, OT_ENV_T interp, OT_OBJ_T enumE, enum LcConfigOptionsEF *ret)
 
LC_TCL_EXTERN int tcllcconfig_Get_LcConfigTypeE_FromObj (MK_RT mkrt, OT_ENV_T interp, OT_OBJ_T enumE, enum LcConfigTypeE *ret)
 
LC_TCL_EXTERN int tcllcconfig_Get_LcErrorE_FromObj (MK_RT mkrt, OT_ENV_T interp, OT_OBJ_T enumE, enum LcErrorE *ret)
 
LC_TCL_EXTERN int tcllcconfig_Get_LcErrorTypeE_FromObj (MK_RT mkrt, OT_ENV_T interp, OT_OBJ_T enumE, enum LcErrorTypeE *ret)
 
LC_TCL_EXTERN OT_OBJ_T tcllcconfig_LcConfigFormatE_ToString (const enum LcConfigFormatE)
 
LC_TCL_EXTERN OT_OBJ_T tcllcconfig_LcConfigOptionsEF_ToString (const enum LcConfigOptionsEF)
 
LC_TCL_EXTERN OT_OBJ_T tcllcconfig_LcConfigTypeE_ToString (const enum LcConfigTypeE)
 
LC_TCL_EXTERN OT_OBJ_T tcllcconfig_LcErrorE_ToString (const enum LcErrorE)
 
LC_TCL_EXTERN OT_OBJ_T tcllcconfig_LcErrorTypeE_ToString (const enum LcErrorTypeE)
 

Variables

LC_TCL_EXTERN_DATA __thread OT_CLS_T tcllcconfig_LcConfigC
 
LC_TCL_EXTERN_DATA __thread OT_OBJ_T tcllcconfig_LcConfigC_MK_NULL
 
LC_TCL_EXTERN_DATA __thread OT_CLS_T tcllcconfig_LcSettingC
 
LC_TCL_EXTERN_DATA __thread OT_OBJ_T tcllcconfig_LcSettingC_MK_NULL
 

Detailed Description

tag: nhi1-release-250425

Definition in file LibLcConfig_tcl.h.

Macro Definition Documentation

◆ Get_LcConfigFormatE_FromObj_path

#define Get_LcConfigFormatE_FromObj_path   LC(Get_LcConfigFormatE_FromObj)

Definition at line 170 of file LibLcConfig_tcl.h.

◆ Get_LcConfigOptionsEF_FromObj_path

#define Get_LcConfigOptionsEF_FromObj_path   LC(Get_LcConfigOptionsEF_FromObj)

Definition at line 173 of file LibLcConfig_tcl.h.

◆ Get_LcConfigTypeE_FromObj_path

#define Get_LcConfigTypeE_FromObj_path   LC(Get_LcConfigTypeE_FromObj)

Definition at line 176 of file LibLcConfig_tcl.h.

◆ Get_LcErrorE_FromObj_path

#define Get_LcErrorE_FromObj_path   LC(Get_LcErrorE_FromObj)

Definition at line 179 of file LibLcConfig_tcl.h.

◆ Get_LcErrorTypeE_FromObj_path

#define Get_LcErrorTypeE_FromObj_path   LC(Get_LcErrorTypeE_FromObj)

Definition at line 182 of file LibLcConfig_tcl.h.

◆ HEADER

#define HEADER

Definition at line 26 of file LibLcConfig_tcl.h.

◆ LC

#define LC ( n)
Value:
tcllcconfig_ ## n

Definition at line 77 of file LibLcConfig_tcl.h.

◆ LC_DOC

#define LC_DOC   __doc

Definition at line 15 of file LibLcConfig_tcl.h.

◆ LC_TCL_EXTERN

#define LC_TCL_EXTERN

static library

Definition at line 50 of file LibLcConfig_tcl.h.

◆ LC_TCL_EXTERN_DATA

#define LC_TCL_EXTERN_DATA   extern

Definition at line 73 of file LibLcConfig_tcl.h.

◆ LcConfigC_ARGS

#define LcConfigC_ARGS   OBJECT_ARGS

Definition at line 85 of file LibLcConfig_tcl.h.

◆ LcConfigC_ARGS_CALL

#define LcConfigC_ARGS_CALL   OBJECT_ARGS_CALL

Definition at line 86 of file LibLcConfig_tcl.h.

◆ LcConfigC_lngO

#define LcConfigC_lngO   LC(LcConfigC)

Definition at line 111 of file LibLcConfig_tcl.h.

◆ LcSettingC_ARGS

#define LcSettingC_ARGS   OBJECT_ARGS

Definition at line 87 of file LibLcConfig_tcl.h.

◆ LcSettingC_ARGS_CALL

#define LcSettingC_ARGS_CALL   OBJECT_ARGS_CALL

Definition at line 88 of file LibLcConfig_tcl.h.

◆ LcSettingC_lngO

#define LcSettingC_lngO   LC(LcSettingC)

Definition at line 129 of file LibLcConfig_tcl.h.

◆ NS

#define NS ( n)
Value:
tcllcconfig_ ## n

Definition at line 79 of file LibLcConfig_tcl.h.

◆ OT_get_CFG_from_NAT

#define OT_get_CFG_from_NAT ( _nat)
Value:
#define LcGetCfgFromNat(_nat)
helper for LcConfigC_ObjNew …

Definition at line 153 of file LibLcConfig_tcl.h.

◆ OT_get_CFS_from_NAT

#define OT_get_CFS_from_NAT ( _nat)
Value:
#define LcGetCfsFromNat(_nat)
helper for LcSettingC_ObjNew …

Definition at line 152 of file LibLcConfig_tcl.h.

◆ OT_NEW_Lc_enum_OBJ

#define OT_NEW_Lc_enum_OBJ ( typ,
val )
Value:
LC(Lc ## typ ## _ToString(val))
#define LC(n)

Definition at line 188 of file LibLcConfig_tcl.h.

◆ OT_retObj_SET_CFG

#define OT_retObj_SET_CFG ( nat)
Value:
retObj = LC(LcConfigC_ObjNew) (MK_RT_CALL interp,nat)
static MK_ARTIFICIAL LC_CFG LcConfigC_ObjNew(config_t *hdl)
return Programming-Language-Micro-Kernel (PLMK) instance from native hdl …
#define MK_RT_CALL

Definition at line 117 of file LibLcConfig_tcl.h.

◆ OT_retObj_SET_CFS

#define OT_retObj_SET_CFS ( nat)
Value:
retObj = LC(LcSettingC_ObjNew) (MK_RT_CALL interp,nat)
static MK_ARTIFICIAL LC_CFS LcSettingC_ObjNew(config_setting_t *hdl)
return Programming-Language-Micro-Kernel (PLMK) instance from native hdl …

Definition at line 135 of file LibLcConfig_tcl.h.

◆ OT_TMP_CFG_OBJ

#define OT_TMP_CFG_OBJ ( val)
Value:

Definition at line 119 of file LibLcConfig_tcl.h.

◆ OT_TMP_CFS_OBJ

#define OT_TMP_CFS_OBJ ( val)
Value:

Definition at line 137 of file LibLcConfig_tcl.h.

Function Documentation

◆ tcllcconfig_ConfigIncludeCall()

enum MkErrorE tcllcconfig_ConfigIncludeCall ( LcConfigIncludeCallF_ARGS )

Definition at line 38 of file LcCall_tcl.c.

39{
41
42 // 1. setup environment
44 if (interp==NULL || Tcl_InterpDeleted(interp)) return MK_OK;
45
46 // 2. setup arguments
47 struct MkCallS *call = cfg->fConfigIncludeData ;
48 Tcl_Obj *objv[6+MkProcResolve_maxArgsLen] = {0};
49 int objc = 0;
50
51 // 3. setup my
52rescan:
53 switch (call->type) {
54 case MkCallS_own_method: {
55 // this is a instance->method
56 objv[objc++] = OT_SELF_NAME_O(MkOBJ(cfg));
57 break;
58 }
60 case MkCallS_static:
61 objv[objc++] = call->my;
62 break;
63 case MkCallS_proc:
64 break;
65 case MkCallS_init: {
66 check_META(MK(ProcResolve)(MK_RT_CALL interp, MkOBJ(cfg), call)) goto error_mq;
67 goto rescan;
68 }
69 case MkCallS_error:
70 goto error;
71 case MkCallS_null:
72 return MK_OK;
73 }
74
75 // 4. setup methode
76 if (call->mth) objv[objc++] = call->mth;
77
78 // 5. setup CTX arg
79 switch (call->type) {
81 break;
83 case MkCallS_static:
84 case MkCallS_proc:
85 objv[objc++] = META2VAL_X(cfg);
86 break;
87 case MkCallS_init:
88 break;
89 case MkCallS_error:
90 goto error;
91 case MkCallS_null:
92 return MK_OK;
93 }
94 objv[objc++] = Tcl_NewStringObj(incDir,-1);
95 objv[objc++] = Tcl_NewStringObj(path,-1);
96 objv[objc++] = OT_TMP_BFL_OBJ(ret_inout);
97
98 if (call->args) MK(ProcResolveAppendArgs)(call,&objc,objv);
99
100 // 3. call the callback
101 int tclret = MK(EvalObjv) (interp, objc, objv, TCL_EVAL_GLOBAL);
102
103 if (tclret == TCL_OK) {
104 Tcl_ResetResult(interp);
105 return MkErrorGetCode_0E();
106 }
107error:
109error_mq:
110 return MkErrorStack_0E();
111}
#define MK(n)
#define check_META(code)
#define META2VAL_X(x)
#define OT_ERROR_LNG_2_META(m)
#define OT_TMP_BFL_OBJ(val)
#define OT_SELF_NAME_O(o)
#define MkProcResolve_maxArgsLen
#define SETUP_interp
#define LcConfigIncludeCallF_CHECK
#define MkErrorGetCode_0E()
#define MkErrorStack_0E()
MK_OK
#define MkOBJ(x)
OT_OBJ_T mth
OT_ENV_T interp
OT_OBJ_T args
enum MkCallS::@2 type
OT_OBJ_T my

◆ tcllcconfig_ConfigIncludeFree()

void tcllcconfig_ConfigIncludeFree ( LcConfigIncludeFreeF_ARGS )

Definition at line 113 of file LcCall_tcl.c.

114{
116 if ( interp == NULL || Tcl_InterpDeleted(interp)) return;
117
118 MkCallFree(cfg->fConfigIncludeData);
119
120 //OT_REF_DECR_AND_NULL(cfg->fConfigIncludeHook);
121
122 cfg->fConfigIncludeCall = NULL;
123 cfg->fConfigIncludeFree = NULL;
124}
#define MkCallFree(cb)

◆ tcllcconfig_LcConfigC_ObjNew()

static MK_ARTIFICIAL OT_OBJ_T tcllcconfig_LcConfigC_ObjNew ( MK_RT mkrt,
OT_ENV_T interp,
LcConfigC_type hdl )
inlinestatic

Definition at line 122 of file LibLcConfig_tcl.h.

122 {
123 return ( hdl ? MK(AtomObjNew) (MK_RT_CALL interp, LcConfigC_X2obj(hdl)) : LC(LcConfigC_MK_NULL) );
124 }
#define LcConfigC_X2obj(x)

◆ tcllcconfig_LcSettingC_ObjNew()

static MK_ARTIFICIAL OT_OBJ_T tcllcconfig_LcSettingC_ObjNew ( MK_RT mkrt,
OT_ENV_T interp,
LcSettingC_type hdl )
inlinestatic

Definition at line 140 of file LibLcConfig_tcl.h.

140 {
141 return ( hdl ? MK(AtomObjNew) (MK_RT_CALL interp, LcSettingC_X2obj(hdl)) : LC(LcSettingC_MK_NULL) );
142 }
#define LcSettingC_X2obj(x)

◆ tcllcconfig_pLcConfigC_Init()

int tcllcconfig_pLcConfigC_Init ( MK_RT mkrt,
Tcl_Interp * interp,
Tcl_Namespace * ns )

Public API

Definition at line 985 of file LcConfigC_tcl.c.

986{
988
989 return TCL_OK;
990error:
991 return TCL_ERROR;
992}
#define ClassInit

◆ tcllcconfig_pLcSettingC_Init()

int tcllcconfig_pLcSettingC_Init ( MK_RT mkrt,
Tcl_Interp * interp,
Tcl_Namespace * ns )

Public API

Definition at line 1273 of file LcSettingC_tcl.c.

1274{
1275 ClassInit
1276
1277 return TCL_OK;
1278error:
1279 return TCL_ERROR;
1280}
#define ClassInit

◆ tcllcconfig_SettingDeleteCall()

enum MkErrorE tcllcconfig_SettingDeleteCall ( LcSettingDeleteCallF_ARGS )

Definition at line 144 of file LcCall_tcl.c.

145{
147
148 // 1. setup environment
150 if (interp==NULL || Tcl_InterpDeleted(interp)) return MK_OK;
151
152 static MkThreadLocal bool onCall = false;
153 if (onCall) {
154printSTACK_1(cfg)
155 return MkErrorSetC_2M(cfg,"REKURSIVE call on LcSettingC -> delete handler");
156 }
157 onCall=true;
158
159 // 2. setup arguments
160 struct MkCallS *call = cfg->fSettingDeleteData;
161 Tcl_Obj *objv[5+MkProcResolve_maxArgsLen] = {0};
162 int objc = 0;
163
164 if (call->nsPtr == NULL) {
165 call->nsPtr = Tcl_FindNamespace(interp,VAL2STR(call->nsO),NULL,TCL_GLOBAL_ONLY);
166 if (call->nsPtr == NULL) return MK_OK ; // instance namespace already deleted
167 }
168
169 // 3. setup my
170rescan:
171 switch (call->type) {
172 case MkCallS_own_method: {
173 // this is a instance->method
174 objv[objc++] = OT_SELF_NAME_O(MkOBJ(cfg));
175 break;
176 }
178 case MkCallS_static:
179 objv[objc++] = call->my;
180 break;
181 case MkCallS_proc:
182 break;
183 case MkCallS_init: {
184 check_META(MK(ProcResolve)(MK_RT_CALL interp, MkOBJ(cfg), call)) goto error;
185 goto rescan;
186 }
187 case MkCallS_error:
188 goto error;
189 case MkCallS_null:
190 return MK_OK;
191 }
192
193 // 4. setup methode
194 if (call->mth) objv[objc++] = call->mth;
195
196 objv[objc++] = LONG2VAL(MkObjectHandleGet_1X(cfs));
197
198 if (call->args) MK(ProcResolveAppendArgs)(call,&objc,objv);
199
200 // 3. call the callback
201 int tclret = MK(EvalObjv) (interp, objc, objv, TCL_EVAL_GLOBAL);
202
203//printV("tclret=%i, code=%s\n", tclret, MkLogErrorE(MkErrorGetCode_0E()))
204
205 if (tclret != TCL_OK) goto error;
206
207 Tcl_ResetResult(interp);
208 onCall = false;
209 return MkErrorGetCode_0E();
210
211error:
213 onCall = false;
214 return MkErrorStack_0E();
215}
#define VAL2STR(obj)
#define LONG2VAL(nat)
#define LcSettingDeleteCallF_CHECK
#define MkErrorSetC_2M(err, message)
#define MkObjectHandleGet_1X(x)
#define MkThreadLocal
OT_NS_T nsPtr
OT_OBJ_T nsO

◆ tcllcconfig_SettingDeleteFree()

void tcllcconfig_SettingDeleteFree ( LcSettingDeleteFreeF_ARGS )

Definition at line 217 of file LcCall_tcl.c.

218{
220 if ( interp == NULL || Tcl_InterpDeleted(interp) ) return;
221
222 MK(CallFree) (&cfg->fSettingDeleteData);
223
224 //OT_REF_DECR_AND_NULL(cfg->fSettingDeleteHook);
225
226 cfg->fSettingDeleteData = NULL;
227 cfg->fSettingDeleteCall = NULL;
228 cfg->fSettingDeleteFree = NULL;
229}

Variable Documentation

◆ tcllcconfig_LcConfigC

LC_TCL_EXTERN_DATA __thread OT_CLS_T tcllcconfig_LcConfigC

Definition at line 112 of file LibLcConfig_tcl.h.

◆ tcllcconfig_LcConfigC_MK_NULL

LC_TCL_EXTERN_DATA __thread OT_OBJ_T tcllcconfig_LcConfigC_MK_NULL

Definition at line 113 of file LibLcConfig_tcl.h.

◆ tcllcconfig_LcSettingC

LC_TCL_EXTERN_DATA __thread OT_CLS_T tcllcconfig_LcSettingC

Definition at line 130 of file LibLcConfig_tcl.h.

◆ tcllcconfig_LcSettingC_MK_NULL

LC_TCL_EXTERN_DATA __thread OT_OBJ_T tcllcconfig_LcSettingC_MK_NULL

Definition at line 131 of file LibLcConfig_tcl.h.