theSq3Lite 10.0
Loading...
Searching...
No Matches
Sq3ValueC_tcl.c
Go to the documentation of this file.
1
9/* LABEL-START */
10
11#define META_FILE_NAME "Sq3ValueC_tcl.c"
12
14
15#define OT_CLASS NS(Sq3ValueC)
16#define OT_CLASS_NAME "Sq3ValueC"
17
18#define OBJECT2VAL(O) MkAssertCastM(Sq3ValueC,(Tcl_ObjectGetMetadata(O, &MK(AtomMeta))))
19
20// TCL class
22
23// META class
25MkThreadLocal OT_OBJ_T SQ3(Sq3ValueC_MK_NULL) = NULL;
26
27// META: ObjNew feature: selfCreate will be called from "ObjNew->MkSelfNew" if MkObj need a SELF pointer
28static MK_PTR NS(Sq3ValueC_selfCreate) (MK_RT_ARGS MK_OBJ const obj, MK_PTR const env) {
29 OT_ENV_T interp = env;
30 return MK(AtomCreate) (MK_RT_CALL interp,obj,OT_CLASS,NULL,NULL);
31}
32// META: is called when the META object is destroyed and SELF does NOT belongs to the META.
33static void NS(Sq3ValueC_selfDelete) (MK_RT_ARGS MK_PTR selfP, MK_PTR const env) {
34 OT_SELF_T selfO = selfP;
35 OT_ENV_T interp = env;
36 MK(AtomDeleteHard) (MK_RT_CALL interp, selfO);
37}
38// META: is called when the META object is destroyed and SELF does NOT belong to the META.
39static void NS(Sq3ValueC_selfUnlink) (MK_RT_ARGS MK_PTR selfP, MK_PTR const env) {
40 OT_SELF_T selfO = selfP;
41 OT_ENV_T interp = env;
42 MK(AtomUnlink) (MK_RT_CALL interp, selfO);
43}
44
45// ATTENTION: TCL has no "Unlink" because the "Tcl_ObjectSetMetadata(selfO,&MK(AtomMeta),NULL);" call
46// also the destructor
47
48#define OT_SETUP_hdl_static_constr_pre
49#define OT_SETUP_hdl_static_constr \
50 OT_SETUP_hdl_static_constr_pre; \
51 OT_SETUP_hdl_static
52
53#define OT_SETUP_hdl_static \
54 int __skip=Tcl_ObjectContextSkippedArgs(objCtx); \
55 AllRtSetup_NULL; \
56 __attribute__((unused)) OT_SELF_T selfO = Tcl_ObjectContextObject(objCtx); \
57 __attribute__((unused)) MK_TYP hdl = Sq3ValueC##_TT;
58
59#define OT_SETUP_hdl SetupHdlFromMetaData_2(VAL,SQ3_VAL);
60#define OT_SETUP_hdl__null_allow SetupHdlFromMetaData__null_allow_2(VAL,SQ3_VAL);
61#define OT_SETUP_hdl_destr SetupHdlFromMetaData__null_allow_2(VAL,SQ3_VAL);
62
63#define OT_SETUP_hdl_constr_pre
64#define OT_SETUP_hdl_constr \
65 OT_SETUP_hdl_constr_pre; \
66 int __skip=Tcl_ObjectContextSkippedArgs(objCtx); \
67 AllRtSetup_NULL; \
68 MK_RT_UNUSED OT_SELF_T selfO = Tcl_ObjectContextObject(objCtx); \
69 SQ3_VAL hdl = (SQ3_VAL) &MkERROR;
70
71#if !defined(SetupRtFromHdl_XN)
72 #define SetupRtFromHdl_XN(hdl) AllRtSetup_XN(hdl)
73 #define SetupRtFromHdl_X(hdl) AllRtSetup_X(hdl)
74#endif
75
76// initialize the TCL and MO class specific object
77#define ClassInit \
78 /* if not already done, initialize NEW MQ type */ \
79 if (Sq3ValueCTT == NULL) Sq3ValueCTT = Sq3ValueSTT; \
80 \
81 /* protect against double call */ \
82 if (Sq3ValueCTT->selfCreate == NS(Sq3ValueC_selfCreate)) return MK_OK; \
83 \
84 /* add "selfCreate" and "selfDelete" feature to the MQ-Class */ \
85 Sq3ValueCTT->selfCreate = NS(Sq3ValueC_selfCreate); \
86 Sq3ValueCTT->selfDelete = NS(Sq3ValueC_selfDelete); \
87 Sq3ValueCTT->selfUnlink = NS(Sq3ValueC_selfUnlink); \
88 \
89 /* create the TCL-class */ \
90 OT_SELF_T classO = MK(ClassDef)(interp,ns,Sq3ValueCTT); \
91 check_NULL(classO) goto error; \
92 OT_CLASS = Tcl_GetObjectAsClass(classO); \
93 \
94 /* create the TCL static Methods */ \
95 static MkThreadLocal OtUnknownS NS(sClassUnknown) = {OT_UNKNOWN_CLASS}; \
96 check_LNG(MK(UnknownSetup) (interp,classO,NS(sOtClassDef),&NS(sClassUnknown))) goto error; \
97 \
98 /* create the TCL instance Methods */ \
99 static MkThreadLocal OtUnknownS NS(sInstanceUnknown) = {OT_UNKNOWN_INSTANCE}; \
100 check_LNG(MK(UnknownSetup) (interp,classO,NS(sInstanceDef),&NS(sInstanceUnknown))) goto error; \
101 \
102 /* define the "NULL" object */ \
103 SQ3(Sq3ValueC_MK_NULL) = Tcl_GetObjectName(interp, \
104 MK(AtomCreate) (MK_RT_CALL interp, NULL /*obj*/, OT_CLASS, "MK_NULL" /*name*/, "::tclsq3lite::Sq3ValueC" /*ns*/) \
105 ); \
106 Tcl_IncrRefCount(SQ3(Sq3ValueC_MK_NULL));
107
108#define VER TCL_OO_METHOD_VERSION_CURRENT
109
110/* LABEL-END */
111
112// BEGIN-DOC - created by 'tcl_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
113
114// doc-key: Sq3ValueC,Sq3Value,sc_,func
115#define GetNull_doc "Sq3ValueC [Sq3ValueC GetNull]"
116#define HandleResolve_doc "Sq3ValueC [Sq3ValueC HandleResolve netHdl:MK_HDL]"
117#define Instances_doc "Sq3ValueC [Sq3ValueC Instances]"
118
119// doc-key: Sq3ValueC,Sq3Value,oCx,func
120#define Dup_doc "Sq3ValueC [$sq3val Dup] (const)"
121
122// doc-key: Sq3ValueC,Sq3Value,oc_,func
123#define BUF_doc "MkBufferC [$val BUF] (const)"
124#define Blob_doc "MkBufferC [$sq3val Blob] (const)"
125#define Next_doc "Sq3ValueC [$val Next]"
126#define Prev_doc "Sq3ValueC [$val Prev]"
127
128// doc-key: Sq3ValueC,Sq3Value,oco,func
129#define VtabInFirst_doc "Sq3ValueC [$pVal VtabInFirst]"
130#define VtabInNext_doc "Sq3ValueC [$pVal VtabInNext]"
131
132// doc-key: Sq3ValueC,Sq3Value,om_,func
133#define BinaryR_doc "binary [$sq3val BinaryR] (const)"
134#define Bytes_doc "Sq3TextE [$sq3val Bytes] (const)"
135#define Double_doc "double [$sq3val Double] (const)"
136#define Encoding_doc "Sq3TextE [$sq3val Encoding] (const)"
137#define FromBind_doc "bool [$sq3val FromBind] (const)"
138// skip class-overload: HandleGet → MkObjectHandleGet
139#define Int_doc "int32 [$sq3val Int] (const)"
140#define Int64_doc "int64 [$sq3val Int64] (const)"
141// skip class-overload: Log → MkObjectLog
142#define NoChange_doc "bool [$sq3val NoChange] (const)"
143#define NumericType_doc "Sq3TypeE [$sq3val NumericType] (const)"
144#define StringR_doc "string [$sq3val StringR] (const)"
145#define SubType_doc "int32 [$sq3val SubType] (const)"
146#define Text_doc "string [$sq3val Text] (const)"
147#define Type_doc "Sq3TypeE [$sq3val Type] (const)"
148
149// END-DOC - created by 'tcl_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
150
151/*****************************************************************************/
152/* */
153/* O B J E C T */
154/* */
155/*****************************************************************************/
156
157// BEGIN-Sq3ValueC - created by 'tcl_MqC.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
158
162
163// doc-key: Sq3ValueC,Sq3ValueC-Class-Export,sc_
164
166static OT_ProcRet NS(Sq3ValueC_HandleResolve) (OtClass_ARGS) {
169 MK_HDL netHdl = 0;
172 SQ3_VAL retVal = Sq3ValueHandleResolve (netHdl);
173 OT_retObj_SET_VAL(retVal);
174 goto end;
175 error:
177 end:
179}
180
181// doc-key: Sq3ValueC,Sq3ValueC-Class-Export,om_
182
183// skip on class-overload: Sq3ValueHandleGet → MkObjectHandleGet
185static OT_ProcRet NS(Sq3ValueC_HandleGet) (Sq3ValueC_ARGS) {OT_ERROR_LNG_RETURN;}
186
188// Sq3ValueC_Class_TCL_API
189
193
194// doc-key: Sq3ValueC,Sq3ValueC-Class-Introspection,oc_
195
197static OT_ProcRet NS(Sq3ValueC_Next) (Sq3ValueC_ARGS) {
201 SQ3_VAL retVal = Sq3ValueNext (hdl);
202 OT_retObj_SET_VAL(retVal);
203 goto end;
204 error:
206 end:
208}
209
211static OT_ProcRet NS(Sq3ValueC_Prev) (Sq3ValueC_ARGS) {
215 SQ3_VAL retVal = Sq3ValuePrev (hdl);
216 OT_retObj_SET_VAL(retVal);
217 goto end;
218 error:
220 end:
222}
223
224// doc-key: Sq3ValueC,Sq3ValueC-Class-Introspection,sc_
225
227static OT_ProcRet NS(Sq3ValueC_Instances) (OtClass_ARGS) {
231 SQ3_VAL retVal = Sq3ValueInstances ();
232 OT_retObj_SET_VAL(retVal);
233 goto end;
234 error:
236 end:
238}
239
241// Sq3ValueC_Class_TCL_API
242
246
247// doc-key: Sq3ValueC,Sq3ValueC-Class-Misc,sc_
248
250static OT_ProcRet NS(Sq3ValueC_GetNull) (OtClass_ARGS) {
254 SQ3_VAL retVal = Sq3ValueGetNull ();
255 OT_retObj_SET_VAL(retVal);
256 goto end;
257 error:
259 end:
261}
262
264// Sq3ValueC_Class_TCL_API
265
269
270// doc-key: Sq3ValueC,Sq3ValueC-Info,om_
271
273static OT_ProcRet NS(Sq3ValueC_Bytes) (Sq3ValueC_ARGS) {
278 goto end;
279 error:
281 end:
283}
284
286static OT_ProcRet NS(Sq3ValueC_Encoding) (Sq3ValueC_ARGS) {
291 goto end;
292 error:
294 end:
296}
297
299static OT_ProcRet NS(Sq3ValueC_FromBind) (Sq3ValueC_ARGS) {
304 goto end;
305 error:
307 end:
309}
310
311// skip on class-overload: Sq3ValueLog → MkObjectLog
314
316static OT_ProcRet NS(Sq3ValueC_NoChange) (Sq3ValueC_ARGS) {
321 goto end;
322 error:
324 end:
326}
327
329static OT_ProcRet NS(Sq3ValueC_NumericType) (Sq3ValueC_ARGS) {
334 goto end;
335 error:
337 end:
339}
340
342static OT_ProcRet NS(Sq3ValueC_SubType) (Sq3ValueC_ARGS) {
347 goto end;
348 error:
350 end:
352}
353
355static OT_ProcRet NS(Sq3ValueC_Type) (Sq3ValueC_ARGS) {
360 goto end;
361 error:
363 end:
365}
366
368// Sq3ValueC_Info_TCL_API
369
373
374// doc-key: Sq3ValueC,Sq3ValueC-TOR,oCx
375
377static OT_ProcRet NS(Sq3ValueC_Dup) (Sq3ValueC_ARGS) {
381 SQ3_VAL retVal = Sq3ValueDup (hdl);
382 if (retVal == NULL) {
383 OT_ERROR_CONSTRUCTOR(Sq3ValueC);
384 goto error;
385 }
386 OT_retObj_SET_VAL(retVal);
387 goto end;
388 error:
390 end:
392}
393
395// Sq3ValueC_TOR_TCL_API
396
400
401// doc-key: Sq3ValueC,Sq3ValueC-Types,oc_
402
404static OT_ProcRet NS(Sq3ValueC_BUF) (Sq3ValueC_ARGS) {
408 MK_BUF retVal = Sq3ValueBUF (hdl);
409 OT_retObj_SET_BUF(retVal);
410 goto end;
411 error:
413 end:
415}
416
418static OT_ProcRet NS(Sq3ValueC_Blob) (Sq3ValueC_ARGS) {
422 MK_BUF retVal = Sq3ValueBlob (hdl);
423 OT_retObj_SET_BUF(retVal);
424 goto end;
425 error:
427 end:
429}
430
431// doc-key: Sq3ValueC,Sq3ValueC-Types,om_
432
434static OT_ProcRet NS(Sq3ValueC_BinaryR) (Sq3ValueC_ARGS) {
438 MkBinaryR retVal = Sq3ValueBinaryR (hdl);
440 goto end;
441 error:
443 end:
445}
446
448static OT_ProcRet NS(Sq3ValueC_Double) (Sq3ValueC_ARGS) {
453 goto end;
454 error:
456 end:
458}
459
461static OT_ProcRet NS(Sq3ValueC_Int) (Sq3ValueC_ARGS) {
466 goto end;
467 error:
469 end:
471}
472
474static OT_ProcRet NS(Sq3ValueC_Int64) (Sq3ValueC_ARGS) {
479 goto end;
480 error:
482 end:
484}
485
487static OT_ProcRet NS(Sq3ValueC_StringR) (Sq3ValueC_ARGS) {
491 MkStringR retVal = Sq3ValueStringR (hdl);
493 goto end;
494 error:
496 end:
498}
499
501static OT_ProcRet NS(Sq3ValueC_Text) (Sq3ValueC_ARGS) {
506 goto end;
507 error:
509 end:
511}
512
514// Sq3ValueC_Types_TCL_API
515
519
520// doc-key: Sq3ValueC,Sq3ValueC-Vtab,oco
521
523static OT_ProcRet NS(Sq3ValueC_VtabInFirst) (Sq3ValueC_ARGS) {
527 SQ3_VAL ppOut;
528 MkErrorC_Check(hdl,Sq3ValueVtabInFirst (hdl, &ppOut));
529 OT_retObj_SET_VAL(ppOut);
530 goto end;
531 error:
533 end:
535}
536
538static OT_ProcRet NS(Sq3ValueC_VtabInNext) (Sq3ValueC_ARGS) {
542 SQ3_VAL ppOut;
543 MkErrorC_Check(hdl,Sq3ValueVtabInNext (hdl, &ppOut));
544 OT_retObj_SET_VAL(ppOut);
545 goto end;
546 error:
548 end:
550}
551
553// Sq3ValueC_Vtab_TCL_API
554
555// END-Sq3ValueC - created by 'tcl_MqC.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
556
557// ---------------------------------------------------------------------------------------
558
559static Tcl_MethodType NS(sOtClassDef)[] = {
560// BEGIN-CLASS - created by 'tcl_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
561
562// doc-key: Sq3ValueC,Sq3Value,sc_
563 {VER, "GetNull" , NS(Sq3ValueC_GetNull) , NULL, NULL},
564 {VER, "HandleResolve" , NS(Sq3ValueC_HandleResolve) , NULL, NULL},
565 {VER, "Instances" , NS(Sq3ValueC_Instances) , NULL, NULL},
566
567// END-CLASS - created by 'tcl_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
568 {0, NULL, NULL, NULL}
569};
570
571// ---------------------------------------------------------------------------------------
572
573static Tcl_MethodType NS(sInstanceDef)[] = {
574// BEGIN-OBJ - created by 'tcl_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
575
576// doc-key: Sq3ValueC,Sq3Value,oCx
577 {VER, "Dup" , NS(Sq3ValueC_Dup) , NULL, NULL},
578
579// doc-key: Sq3ValueC,Sq3Value,oc_
580 {VER, "BUF" , NS(Sq3ValueC_BUF) , NULL, NULL},
581 {VER, "Blob" , NS(Sq3ValueC_Blob) , NULL, NULL},
582 {VER, "Next" , NS(Sq3ValueC_Next) , NULL, NULL},
583 {VER, "Prev" , NS(Sq3ValueC_Prev) , NULL, NULL},
584
585// doc-key: Sq3ValueC,Sq3Value,oco
586 {VER, "VtabInFirst" , NS(Sq3ValueC_VtabInFirst) , NULL, NULL},
587 {VER, "VtabInNext" , NS(Sq3ValueC_VtabInNext) , NULL, NULL},
588
589// doc-key: Sq3ValueC,Sq3Value,om_
590 {VER, "BinaryR" , NS(Sq3ValueC_BinaryR) , NULL, NULL},
591 {VER, "Bytes" , NS(Sq3ValueC_Bytes) , NULL, NULL},
592 {VER, "Double" , NS(Sq3ValueC_Double) , NULL, NULL},
593 {VER, "Encoding" , NS(Sq3ValueC_Encoding) , NULL, NULL},
594 {VER, "FromBind" , NS(Sq3ValueC_FromBind) , NULL, NULL},
595 // skip class-overload: Sq3ValueHandleGet → HandleGet, NS(Sq3ValueC_HandleGet)
596 {VER, "Int" , NS(Sq3ValueC_Int) , NULL, NULL},
597 {VER, "Int64" , NS(Sq3ValueC_Int64) , NULL, NULL},
598 // skip class-overload: Sq3ValueLog → Log, NS(Sq3ValueC_Log)
599 {VER, "NoChange" , NS(Sq3ValueC_NoChange) , NULL, NULL},
600 {VER, "NumericType" , NS(Sq3ValueC_NumericType) , NULL, NULL},
601 {VER, "StringR" , NS(Sq3ValueC_StringR) , NULL, NULL},
602 {VER, "SubType" , NS(Sq3ValueC_SubType) , NULL, NULL},
603 {VER, "Text" , NS(Sq3ValueC_Text) , NULL, NULL},
604 {VER, "Type" , NS(Sq3ValueC_Type) , NULL, NULL},
605
606// END-OBJ - created by 'tcl_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
607 {0, NULL, NULL, NULL, NULL}
608};
609
615
616int NS(pSq3ValueC_Init) ( MK_RT_ARGS Tcl_Interp *interp, Tcl_Namespace *ns)
617{
619
620 return TCL_OK;
621error:
622 return TCL_ERROR;
623}
#define MK(n)
#define OT_CHECK_NIH(val)
#define OT_retObj_SET_BOL(nat)
#define OT_SETUP_NOARG(d)
#define OT_SETUP_ONEARG(d)
Tcl_Class OT_CLS_T
#define OT_ERROR_LNG_RETURN
#define OT_retObj_SET_Error
#define OT_retObj_SET_BUF(nat)
#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_I32(nat)
#define OT_GET__ME_REF_MkStringR(s)
#define OT_GET__ME_REF_MkBinaryR(b)
#define OT_retObj_RETURN
#define OT_retObj_SET_STR(nat)
Tcl_Object OT_SELF_T
#define OT_retObj_SET(val)
#define OT_CHECK_NOARGS
#define MkErrorC_Check(mng, PROC)
#define OT_ProcRet
Tcl_Interp * OT_ENV_T
Tcl_Obj * OT_OBJ_T
tag: nhi1-release-250425
#define OtClass_ARGS
#define SQ3(n)
#define OT_NEW_Sq3_enum_OBJ(typ, val)
#define NS(n)
#define OT_retObj_SET_VAL(nat)
#define Sq3ValueC_ARGS
#define Instances_doc
#define Int64_doc
#define BinaryR_doc
#define Blob_doc
#define OT_SETUP_hdl
#define Int_doc
static __thread MK_TYP Sq3ValueCTT
#define Text_doc
#define Dup_doc
#define NumericType_doc
#define GetNull_doc
#define Next_doc
#define HandleResolve_doc
#define VtabInFirst_doc
#define Prev_doc
#define VER
#define OT_CLASS
#define OT_SETUP_hdl_static
#define Type_doc
#define BUF_doc
#define StringR_doc
#define SubType_doc
#define FromBind_doc
#define VtabInNext_doc
#define Double_doc
#define ClassInit
#define NoChange_doc
#define Bytes_doc
#define Encoding_doc
#define MK_UNUSED
#define MK_DEPRECATED
MK_PTRB * MK_PTR
int32_t MK_HDL
#define MkThreadLocal
#define MK_RT_CALL
#define MK_RT_ARGS
static SQ3_VAL Sq3ValueGetNull(void)
Null-Slot - return a Sq3ValueC typed NULL instance …
#define Sq3ValueInstances()
#define Sq3ValueHandleResolve(...)
static SQ3_VAL Sq3ValueNext(SQ3_VAL const val)
get next instance from linked-list of Sq3ValueS type
static SQ3_VAL Sq3ValuePrev(SQ3_VAL const val)
get previous instance from linked-list of Sq3ValueS type
static enum Sq3TextE Sq3ValueEncoding(SQ3_VALN sq3val)
Report the internal text encoding state of an sqlite3_value object …
static enum Sq3TypeE Sq3ValueType(SQ3_VALN sq3val)
Obtaining SQL Values …
static enum Sq3TextE Sq3ValueBytes(SQ3_VALN sq3val)
Obtaining SQL Values …
static MK_I32 Sq3ValueSubType(SQ3_VALN sq3val)
Finding The Subtype Of SQL Values …
static MK_BOOL Sq3ValueFromBind(SQ3_VALN sq3val)
Obtaining SQL Values …
static MK_BOOL Sq3ValueNoChange(SQ3_VALN sq3val)
Obtaining SQL Values …
static enum Sq3TypeE Sq3ValueNumericType(SQ3_VALN sq3val)
Obtaining SQL Values …
static SQ3_VAL Sq3ValueDup(SQ3_VALN sq3val)
Copy And Free SQL Values …
static MkStringR Sq3ValueStringR(SQ3_VALN sq3val)
Obtaining SQL Values …
#define Sq3ValueBUF(...)
static MkBinaryR Sq3ValueBinaryR(SQ3_VALN sq3val)
Obtaining SQL Values …
#define Sq3ValueBlob(...)
static MK_I64 Sq3ValueInt64(SQ3_VALN sq3val)
Obtaining SQL Values …
static MK_STRN Sq3ValueText(SQ3_VALN sq3val)
Obtaining SQL Values …
static MK_DBL Sq3ValueDouble(SQ3_VALN sq3val)
Obtaining SQL Values …
static MK_I32 Sq3ValueInt(SQ3_VALN sq3val)
Obtaining SQL Values …
static enum MkErrorE Sq3ValueVtabInNext(SQ3_VAL pVal, SQ3_VAL *ppOut)
Find all elements on the right-hand side of an IN constraint …
static enum MkErrorE Sq3ValueVtabInFirst(SQ3_VAL pVal, SQ3_VAL *ppOut)
Find all elements on the right-hand side of an IN constraint …
Struct to represent the data of the Sq3ValueC …