14#define META_FILE_NAME "LcSettingC_tcl.c"
18#define OT_CLASS NS(LcSettingC)
19#define OT_CLASS_NAME "LcSettingC"
21#define OBJECT2CFS(O) MkAssertCastM(LcSettingC,(Tcl_ObjectGetMetadata(O, &MK(AtomMeta))))
51#define OT_SETUP_hdl_static_constr_pre
52#define OT_SETUP_hdl_static_constr \
53 OT_SETUP_hdl_static_constr_pre; \
56#define OT_SETUP_hdl_static \
57 int __skip=Tcl_ObjectContextSkippedArgs(objCtx); \
59 __attribute__((unused)) OT_SELF_T selfO = Tcl_ObjectContextObject(objCtx); \
60 __attribute__((unused)) MK_TYP hdl = LcSettingC##_TT;
62#define OT_SETUP_hdl SetupHdlFromMetaData_2(CFS,LC_CFS);
63#define OT_SETUP_hdl__null_allow SetupHdlFromMetaData__null_allow_2(CFS,LC_CFS);
64#define OT_SETUP_hdl_destr SetupHdlFromMetaData__null_allow_2(CFS,LC_CFS);
66#define OT_SETUP_hdl_constr_pre
67#define OT_SETUP_hdl_constr \
68 OT_SETUP_hdl_constr_pre; \
69 int __skip=Tcl_ObjectContextSkippedArgs(objCtx); \
71 MK_RT_UNUSED OT_SELF_T selfO = Tcl_ObjectContextObject(objCtx); \
72 LC_CFS hdl = (LC_CFS) &MkERROR;
74#if !defined(SetupRtFromHdl_XN)
75 #define SetupRtFromHdl_XN(hdl) AllRtSetup_XN(hdl)
76 #define SetupRtFromHdl_X(hdl) AllRtSetup_X(hdl)
82 if (LcSettingCTT == NULL) LcSettingCTT = LcSettingSTT; \
85 if (LcSettingCTT->selfCreate == NS(LcSettingC_selfCreate)) return MK_OK; \
88 LcSettingCTT->selfCreate = NS(LcSettingC_selfCreate); \
89 LcSettingCTT->selfDelete = NS(LcSettingC_selfDelete); \
90 LcSettingCTT->selfUnlink = NS(LcSettingC_selfUnlink); \
93 OT_SELF_T classO = MK(ClassDef)(interp,ns,LcSettingCTT); \
94 check_NULL(classO) goto error; \
95 OT_CLASS = Tcl_GetObjectAsClass(classO); \
98 static MkThreadLocal OtUnknownS NS(sClassUnknown) = {OT_UNKNOWN_CLASS}; \
99 check_LNG(MK(UnknownSetup) (interp,classO,NS(sOtClassDef),&NS(sClassUnknown))) goto error; \
102 static MkThreadLocal OtUnknownS NS(sInstanceUnknown) = {OT_UNKNOWN_INSTANCE}; \
103 check_LNG(MK(UnknownSetup) (interp,classO,NS(sInstanceDef),&NS(sInstanceUnknown))) goto error; \
106 LC(LcSettingC_MK_NULL) = Tcl_GetObjectName(interp, \
107 MK(AtomCreate) (MK_RT_CALL interp, NULL , OT_CLASS, "MK_NULL" , "::tcllcconfig::LcSettingC" ) \
109 Tcl_IncrRefCount(LC(LcSettingC_MK_NULL));
111#define VER TCL_OO_METHOD_VERSION_CURRENT
118#define GetNull_doc "LcSettingC [LcSettingC GetNull]"
119#define HandleResolve_doc "LcSettingC [LcSettingC HandleResolve netHdl:MK_HDL]"
120#define Instances_doc "LcSettingC [LcSettingC Instances]"
123#define Add_doc "LcSettingC [$parent Add name:string __type:LcConfigTypeE]"
126#define AddIfNotExists_doc "LcSettingC [$setting AddIfNotExists name:string cfgtype:LcConfigTypeE]"
127#define GetConfig_doc "LcConfigC [$setting GetConfig] (const)"
128#define GetElem_doc "LcSettingC [$setting GetElem idx:int32] (const)"
129#define GetMember_doc "LcSettingC [$setting GetMember name:string] (const)"
130#define Lookup_doc "LcSettingC [$setting Lookup path:string]"
131#define LookupAll_doc "MkBufferListC [$setting LookupAll] (const)"
132#define Next_doc "LcSettingC [$cfs Next]"
133#define Parent_doc "LcSettingC [$setting Parent] (const)"
134#define Prev_doc "LcSettingC [$cfs Prev]"
135#define SetBoolElem_doc "LcSettingC [$setting SetBoolElem idx:int32 value:int32]"
136#define SetFloatElem_doc "LcSettingC [$setting SetFloatElem idx:int32 value:double]"
137#define SetInt64Elem_doc "LcSettingC [$setting SetInt64Elem idx:int32 value:int64]"
138#define SetIntElem_doc "LcSettingC [$setting SetIntElem idx:int32 value:int32]"
139#define SetStringElem_doc "LcSettingC [$setting SetStringElem idx:int32 value:string]"
142#define Exists_doc "bool [$setting Exists name:string]"
143#define GetBool_doc "bool [$setting GetBool] (const)"
144#define GetBoolElem_doc "bool [$setting GetBoolElem idx:int32] (const)"
145#define GetFloat_doc "double [$setting GetFloat] (const)"
146#define GetFloatElem_doc "double [$setting GetFloatElem idx:int32] (const)"
147#define GetFormat_doc "LcConfigFormatE [$setting GetFormat] (const)"
148#define GetInt_doc "int32 [$setting GetInt] (const)"
149#define GetInt64_doc "int64 [$setting GetInt64] (const)"
150#define GetInt64Elem_doc "int64 [$setting GetInt64Elem idx:int32] (const)"
151#define GetIntElem_doc "int32 [$setting GetIntElem idx:int32] (const)"
152#define GetString_doc "string [$setting GetString] (const)"
153#define GetStringElem_doc "string [$setting GetStringElem idx:int32] (const)"
155#define Index_doc "int32 [$setting Index] (const)"
156#define IsAggregate_doc "bool [$setting IsAggregate] (const)"
157#define IsArray_doc "bool [$setting IsArray] (const)"
158#define IsGroup_doc "bool [$setting IsGroup] (const)"
159#define IsList_doc "bool [$setting IsList] (const)"
160#define IsNumber_doc "bool [$setting IsNumber] (const)"
161#define IsRoot_doc "bool [$setting IsRoot] (const)"
162#define IsScalar_doc "bool [$setting IsScalar] (const)"
163#define Length_doc "int32 [$setting Length] (const)"
165#define Name_doc "string [$setting Name] (const)"
166#define Remove_doc "$parent Remove name:string"
167#define RemoveElem_doc "$parent RemoveElem idx:int32"
168#define SetBool_doc "$setting SetBool value:bool"
169#define SetFloat_doc "$setting SetFloat value:double"
170#define SetFormat_doc "$setting SetFormat format:LcConfigFormatE"
171#define SetInt_doc "$setting SetInt value:int32"
172#define SetInt64_doc "$setting SetInt64 value:int64"
173#define SetString_doc "$setting SetString value:string"
174#define SourceFile_doc "string [$setting SourceFile] (const)"
175#define SourceLine_doc "int32 [$setting SourceLine] (const)"
176#define Type_doc "LcConfigTypeE [$setting Type] (const)"
179#define LookupBool_doc "bool [$setting LookupBool name:string] (const)"
180#define LookupFloat_doc "double [$setting LookupFloat name:string] (const)"
181#define LookupInt_doc "int32 [$setting LookupInt name:string] (const)"
182#define LookupInt64_doc "int64 [$setting LookupInt64 name:string] (const)"
183#define LookupString_doc "string [$setting LookupString name:string] (const)"
322 if (retVal == NULL) {
342 if (retVal == NULL) {
626 if (retVal == NULL) {
772 if (retVal == NULL) {
934 if (retVal == NULL) {
956 if (retVal == NULL) {
978 if (retVal == NULL) {
1000 if (retVal == NULL) {
1022 if (retVal == NULL) {
1151 if (retVal == NULL) {
1186static Tcl_MethodType
NS(sOtClassDef)[] = {
1190 {
VER,
"GetNull" ,
NS(LcSettingC_GetNull) , NULL, NULL},
1191 {
VER,
"HandleResolve" ,
NS(LcSettingC_HandleResolve) , NULL, NULL},
1192 {
VER,
"Instances" ,
NS(LcSettingC_Instances) , NULL, NULL},
1195 {0, NULL, NULL, NULL}
1200static Tcl_MethodType
NS(sInstanceDef)[] = {
1204 {
VER,
"Add" ,
NS(LcSettingC_Add) , NULL, NULL},
1207 {
VER,
"AddIfNotExists" ,
NS(LcSettingC_AddIfNotExists) , NULL, NULL},
1208 {
VER,
"GetConfig" ,
NS(LcSettingC_GetConfig) , NULL, NULL},
1209 {
VER,
"GetElem" ,
NS(LcSettingC_GetElem) , NULL, NULL},
1210 {
VER,
"GetMember" ,
NS(LcSettingC_GetMember) , NULL, NULL},
1211 {
VER,
"Lookup" ,
NS(LcSettingC_Lookup) , NULL, NULL},
1212 {
VER,
"LookupAll" ,
NS(LcSettingC_LookupAll) , NULL, NULL},
1213 {
VER,
"Next" ,
NS(LcSettingC_Next) , NULL, NULL},
1214 {
VER,
"Parent" ,
NS(LcSettingC_Parent) , NULL, NULL},
1215 {
VER,
"Prev" ,
NS(LcSettingC_Prev) , NULL, NULL},
1216 {
VER,
"SetBoolElem" ,
NS(LcSettingC_SetBoolElem) , NULL, NULL},
1217 {
VER,
"SetFloatElem" ,
NS(LcSettingC_SetFloatElem) , NULL, NULL},
1218 {
VER,
"SetInt64Elem" ,
NS(LcSettingC_SetInt64Elem) , NULL, NULL},
1219 {
VER,
"SetIntElem" ,
NS(LcSettingC_SetIntElem) , NULL, NULL},
1220 {
VER,
"SetStringElem" ,
NS(LcSettingC_SetStringElem) , NULL, NULL},
1223 {
VER,
"Exists" ,
NS(LcSettingC_Exists) , NULL, NULL},
1224 {
VER,
"GetBool" ,
NS(LcSettingC_GetBool) , NULL, NULL},
1225 {
VER,
"GetBoolElem" ,
NS(LcSettingC_GetBoolElem) , NULL, NULL},
1226 {
VER,
"GetFloat" ,
NS(LcSettingC_GetFloat) , NULL, NULL},
1227 {
VER,
"GetFloatElem" ,
NS(LcSettingC_GetFloatElem) , NULL, NULL},
1228 {
VER,
"GetFormat" ,
NS(LcSettingC_GetFormat) , NULL, NULL},
1229 {
VER,
"GetInt" ,
NS(LcSettingC_GetInt) , NULL, NULL},
1230 {
VER,
"GetInt64" ,
NS(LcSettingC_GetInt64) , NULL, NULL},
1231 {
VER,
"GetInt64Elem" ,
NS(LcSettingC_GetInt64Elem) , NULL, NULL},
1232 {
VER,
"GetIntElem" ,
NS(LcSettingC_GetIntElem) , NULL, NULL},
1233 {
VER,
"GetString" ,
NS(LcSettingC_GetString) , NULL, NULL},
1234 {
VER,
"GetStringElem" ,
NS(LcSettingC_GetStringElem) , NULL, NULL},
1236 {
VER,
"Index" ,
NS(LcSettingC_Index) , NULL, NULL},
1237 {
VER,
"IsAggregate" ,
NS(LcSettingC_IsAggregate) , NULL, NULL},
1238 {
VER,
"IsArray" ,
NS(LcSettingC_IsArray) , NULL, NULL},
1239 {
VER,
"IsGroup" ,
NS(LcSettingC_IsGroup) , NULL, NULL},
1240 {
VER,
"IsList" ,
NS(LcSettingC_IsList) , NULL, NULL},
1241 {
VER,
"IsNumber" ,
NS(LcSettingC_IsNumber) , NULL, NULL},
1242 {
VER,
"IsRoot" ,
NS(LcSettingC_IsRoot) , NULL, NULL},
1243 {
VER,
"IsScalar" ,
NS(LcSettingC_IsScalar) , NULL, NULL},
1244 {
VER,
"Length" ,
NS(LcSettingC_Length) , NULL, NULL},
1246 {
VER,
"Name" ,
NS(LcSettingC_Name) , NULL, NULL},
1247 {
VER,
"Remove" ,
NS(LcSettingC_Remove) , NULL, NULL},
1248 {
VER,
"RemoveElem" ,
NS(LcSettingC_RemoveElem) , NULL, NULL},
1249 {
VER,
"SetBool" ,
NS(LcSettingC_SetBool) , NULL, NULL},
1250 {
VER,
"SetFloat" ,
NS(LcSettingC_SetFloat) , NULL, NULL},
1251 {
VER,
"SetFormat" ,
NS(LcSettingC_SetFormat) , NULL, NULL},
1252 {
VER,
"SetInt" ,
NS(LcSettingC_SetInt) , NULL, NULL},
1253 {
VER,
"SetInt64" ,
NS(LcSettingC_SetInt64) , NULL, NULL},
1254 {
VER,
"SetString" ,
NS(LcSettingC_SetString) , NULL, NULL},
1255 {
VER,
"SourceFile" ,
NS(LcSettingC_SourceFile) , NULL, NULL},
1256 {
VER,
"SourceLine" ,
NS(LcSettingC_SourceLine) , NULL, NULL},
1257 {
VER,
"Type" ,
NS(LcSettingC_Type) , NULL, NULL},
1260 {
VER,
"LookupBool" ,
NS(LcSettingC_LookupBool) , NULL, NULL},
1261 {
VER,
"LookupFloat" ,
NS(LcSettingC_LookupFloat) , NULL, NULL},
1262 {
VER,
"LookupInt" ,
NS(LcSettingC_LookupInt) , NULL, NULL},
1263 {
VER,
"LookupInt64" ,
NS(LcSettingC_LookupInt64) , NULL, NULL},
1264 {
VER,
"LookupString" ,
NS(LcSettingC_LookupString) , NULL, NULL},
1267 {0, NULL, NULL, NULL, NULL}
1276int NS(pLcSettingC_Init) (
MK_RT_ARGS Tcl_Interp *interp, Tcl_Namespace *ns)
#define GetStringElem_doc
static __thread MK_TYP LcSettingCTT
#define SetStringElem_doc
#define HandleResolve_doc
#define OT_SETUP_hdl_static
#define AddIfNotExists_doc
LibLcConfig_private_tcl.h - 11 Apr 2025 - aotto1968.
#define OT_retObj_SET_CFG(nat)
#define OT_retObj_SET_CFS(nat)
#define OT_NEW_Lc_enum_OBJ(typ, val)
#define OT_CHECK_bool(val)
#define OT_SETUP_VARARGS(min, max, d)
#define OT_CHECK_NIH(val)
#define OT_retObj_SET_BOL(nat)
#define OT_SETUP_NOARG(d)
#define OT_SETUP_ONEARG(d)
#define OT_ERROR_LNG_RETURN
#define OT_CHECK_NI4(val)
#define OT_CHECK_NI8(val)
#define OT_retObj_SET_Error
#define OT_CHECK_NF8(val)
#define OT_ERROR_CONSTRUCTOR(class)
#define OT_retObj_SET_DBL(nat)
#define OT_retObj_SET_I64(nat)
#define OT_CHECK_REQUIRED(val)
#define OT_retObj_SET_None
#define OT_retObj_SET_I32(nat)
#define OT_retObj_SET_BFL(nat)
#define OT_CHECK_ENUM(ename, val)
#define OT_retObj_SET_STR(nat)
#define OT_retObj_SET(val)
#define MkErrorC_Check(mng, PROC)
#define OT_ERROR_SOFT_CONSTRUCTOR(class)
#define OT_CHECK_STRN(val)
LcConfigFormatE
set the format of a LcSettingC …
LcConfigTypeE
define the data-type of a LcSettingC …
#define LcSettingHandleResolve(...)
static LC_CFS LcSettingPrev(LC_CFS const cfs)
get previous instance from linked-list of LcSettingS type
static LC_CFS LcSettingNext(LC_CFS const cfs)
get next instance from linked-list of LcSettingS type
#define LcSettingInstances()
static LC_CFS LcSettingGetNull(void)
Null-Slot - return a LcSettingC typed NULL instance …
static MK_STRN LcSettingGetString(LC_CFSN setting)
These functions return the value of the given setting …
static LC_CFG LcSettingGetConfig(LC_CFSN setting)
addon - return the LcConfigC from the LcSettingC …
static LC_CFS LcSettingGetElem(LC_CFSN setting, MK_I32 idx)
This function fetches the element at the given index index in the setting setting,...
static MK_BOOL LcSettingGetBool(LC_CFSN setting)
These functions return the value of the given setting …
static MK_DBL LcSettingGetFloat(LC_CFSN setting)
These functions return the value of the given setting …
static MK_BOOL LcSettingGetBoolElem(LC_CFSN setting, MK_I32 idx)
These functions return the value at the specified index index in the setting setting …
static MK_I64 LcSettingGetInt64Elem(LC_CFSN setting, MK_I32 idx)
These functions return the value at the specified index index in the setting setting …
static LC_CFS LcSettingGetMember(LC_CFSN setting, MK_STRN name)
This function fetches the child setting named name from the group setting …
static enum LcConfigFormatE LcSettingGetFormat(LC_CFSN setting)
These functions get and set the external format for the setting setting …
static MK_I32 LcSettingGetInt(LC_CFSN setting)
These functions return the value of the given setting …
static MK_I32 LcSettingGetIntElem(LC_CFSN setting, MK_I32 idx)
These functions return the value at the specified index index in the setting setting …
static MK_I64 LcSettingGetInt64(LC_CFSN setting)
These functions return the value of the given setting …
static MK_STRN LcSettingGetStringElem(LC_CFSN setting, MK_I32 idx)
These functions return the value at the specified index index in the setting setting …
static MK_DBL LcSettingGetFloatElem(LC_CFSN setting, MK_I32 idx)
These functions return the value at the specified index index in the setting setting …
static MK_BOOL LcSettingIsArray(LC_CFSN setting)
These convenience functions, which are implemented as macros, test if the setting setting is of a giv...
static MK_BOOL LcSettingIsNumber(LC_CFSN setting)
These convenience functions, some of which are implemented as macros, test if the setting setting is ...
static MK_BOOL LcSettingIsRoot(LC_CFSN setting)
This function returns CONFIG_TRUE if the given setting is the root setting, and CONFIG_FALSE otherwis...
static MK_BOOL LcSettingIsList(LC_CFSN setting)
These convenience functions, which are implemented as macros, test if the setting setting is of a giv...
static MK_BOOL LcSettingIsAggregate(LC_CFSN setting)
These convenience functions, some of which are implemented as macros, test if the setting setting is ...
static MK_BOOL LcSettingIsGroup(LC_CFSN setting)
These convenience functions, which are implemented as macros, test if the setting setting is of a giv...
static MK_BOOL LcSettingIsScalar(LC_CFSN setting)
These convenience functions, some of which are implemented as macros, test if the setting setting is ...
static enum MkErrorE LcSettingLookupString(LC_CFSN setting, MK_STRN name, MK_STRN *value_out)
These functions look up the value of the child setting named name of the setting setting …
static LC_CFS LcSettingLookup(LC_CFS setting, MK_STRN path)
This function locates a setting by a path path relative to the setting setting …
static enum MkErrorE LcSettingLookupBool(LC_CFSN setting, MK_STRN name, MK_BOOL *value_out)
These functions look up the value of the child setting named name of the setting setting …
static enum MkErrorE LcSettingLookupInt(LC_CFSN setting, MK_STRN name, MK_I32 *value_out)
These functions look up the value of the child setting named name of the setting setting …
static enum MkErrorE LcSettingLookupInt64(LC_CFSN setting, MK_STRN name, MK_I64 *value_out)
These functions look up the value of the child setting named name of the setting setting …
static enum MkErrorE LcSettingLookupFloat(LC_CFSN setting, MK_STRN name, MK_DBL *value_out)
These functions look up the value of the child setting named name of the setting setting …
MK_BFL LcSettingLookupAll(LC_CFSN setting)
addon - read an entire configuration below setting into MkBufferListC …
static LC_CFS LcSettingParent(LC_CFSN setting)
This function returns the parent setting of the given setting, or NULL if setting is the root setting...
static MK_I32 LcSettingIndex(LC_CFSN setting)
This function returns the index of the given setting within its parent setting …
static enum MkErrorE LcSettingRemoveElem(LC_CFS parent, MK_I32 idx)
This function removes the child setting at the given index index from the setting parent,...
static MK_STRN LcSettingName(LC_CFSN setting)
This function returns the name of the given setting, or NULL if the setting has no name …
static bool LcSettingExists(const LC_CFS setting, MK_STRN name)
addon - return true if name exists in the setting otherwise false …
static MK_I32 LcSettingSourceLine(LC_CFSN setting)
This function returns the line number of the configuration file or stream at which the setting settin...
static MK_STRN LcSettingSourceFile(LC_CFSN setting)
This function returns the name of the file from which the setting setting was read,...
static enum MkErrorE LcSettingRemove(LC_CFS parent, MK_STRN name)
This function removes and destroys the setting named name from the parent setting parent,...
static enum LcConfigTypeE LcSettingType(LC_CFSN setting)
This function returns the type of the given setting …
static MK_I32 LcSettingLength(LC_CFSN setting)
This function returns the number of settings in a group, or the number of elements in a list or array...
static LC_CFS LcSettingAddIfNotExists(LC_CFS setting, MK_STRN name, enum LcConfigTypeE cfgtype)
addon - add name with type only if not exists in the setting …
static LC_CFS LcSettingSetFloatElem(LC_CFS setting, MK_I32 idx, MK_DBL value)
These functions set the value at the specified index index in the setting setting to value …
static enum MkErrorE LcSettingSetInt64(LC_CFS setting, MK_I64 value)
These functions set the value of the given setting to value …
static enum MkErrorE LcSettingSetBool(LC_CFS setting, MK_BOOL value)
These functions set the value of the given setting to value …
static LC_CFS LcSettingSetIntElem(LC_CFS setting, MK_I32 idx, MK_I32 value)
These functions set the value at the specified index index in the setting setting to value …
static enum MkErrorE LcSettingSetString(LC_CFS setting, MK_STRN value)
These functions set the value of the given setting to value …
static enum MkErrorE LcSettingSetFormat(LC_CFS setting, enum LcConfigFormatE format)
These functions get and set the external format for the setting setting …
static LC_CFS LcSettingSetBoolElem(LC_CFS setting, MK_I32 idx, MK_I32 value)
These functions set the value at the specified index index in the setting setting to value …
static enum MkErrorE LcSettingSetFloat(LC_CFS setting, MK_DBL value)
These functions set the value of the given setting to value …
static LC_CFS LcSettingSetStringElem(LC_CFS setting, MK_I32 idx, MK_STRN value)
These functions set the value at the specified index index in the setting setting to value …
static LC_CFS LcSettingSetInt64Elem(LC_CFS setting, MK_I32 idx, MK_I64 value)
These functions set the value at the specified index index in the setting setting to value …
static enum MkErrorE LcSettingSetInt(LC_CFS setting, MK_I32 value)
These functions set the value of the given setting to value …
static LC_CFS LcSettingAdd(LC_CFS parent, MK_STRN name, enum LcConfigTypeE __type)
This function adds a new child setting or element to the setting parent, which must be a group,...
Struct to represent the data from the LcConfigC …
Struct to represent the data from the LcSettingC …