theSq3Lite 10.0 NHI1 - theKernel - theLink - theConfig - theSq3Lite - theCompiler - theBrain - theGuard - theLib - theATL
c - tcl - atl - cs - py - rb - jv - cc
Loading...
Searching...
No Matches
Sq3StmtC_tcl.c
Go to the documentation of this file.
1
12/* LABEL-START */
13
14#define META_FILE_NAME "Sq3StmtC_tcl.c"
15
17
18#define OT_CLASS NS(Sq3StmtC)
19#define OT_CLASS_NAME "Sq3StmtC"
20
21#define OBJECT2STMT(O) MkAssertCastM(Sq3StmtC,(Tcl_ObjectGetMetadata(O, &MK(AtomMeta))))
22
23// TCL class
25
26// META class
28MkThreadLocal OT_OBJ_T SQ3(Sq3StmtC_MK_NULL) = NULL;
29
30// META: ObjNew feature: selfCreate will be called from "ObjNew->MkSelfNew" if MkObj need a SELF pointer
31static MK_PTR NS(Sq3StmtC_selfCreate) (MK_RT_ARGS MK_OBJ const obj, MK_PTR const env) {
32 OT_ENV_T interp = env;
33 return MK(AtomCreate) (MK_RT_CALL interp,obj,OT_CLASS,NULL,NULL);
34}
35// META: is called when the META object is destroyed and SELF does NOT belongs to the META.
36static void NS(Sq3StmtC_selfDelete) (MK_RT_ARGS MK_PTR selfP, MK_PTR const env) {
37 OT_SELF_T selfO = selfP;
38 OT_ENV_T interp = env;
39 MK(AtomDeleteHard) (MK_RT_CALL interp, selfO);
40}
41// META: is called when the META object is destroyed and SELF does NOT belong to the META.
42static void NS(Sq3StmtC_selfUnlink) (MK_RT_ARGS MK_PTR selfP, MK_PTR const env) {
43 OT_SELF_T selfO = selfP;
44 OT_ENV_T interp = env;
45 MK(AtomUnlink) (MK_RT_CALL interp, selfO);
46}
47
48// ATTENTION: TCL has no "Unlink" because the "Tcl_ObjectSetMetadata(selfO,&MK(AtomMeta),NULL);" call
49// also the destructor
50
51#define OT_SETUP_hdl_static_constr_pre
52#define OT_SETUP_hdl_static_constr \
53 OT_SETUP_hdl_static_constr_pre; \
54 OT_SETUP_hdl_static
55
56#define OT_SETUP_hdl_static \
57 int __skip=Tcl_ObjectContextSkippedArgs(objCtx); \
58 AllRtSetup_NULL; \
59 __attribute__((unused)) OT_SELF_T selfO = Tcl_ObjectContextObject(objCtx); \
60 __attribute__((unused)) MK_TYP hdl = Sq3StmtC##_TT;
61
62#define OT_SETUP_hdl SetupHdlFromMetaData_2(STMT,SQ3_STMT);
63#define OT_SETUP_hdl__null_allow SetupHdlFromMetaData__null_allow_2(STMT,SQ3_STMT);
64#define OT_SETUP_hdl_destr SetupHdlFromMetaData__null_allow_2(STMT,SQ3_STMT);
65
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); \
70 AllRtSetup_NULL; \
71 MK_RT_UNUSED OT_SELF_T selfO = Tcl_ObjectContextObject(objCtx); \
72 SQ3_STMT hdl = (SQ3_STMT) &MkERROR;
73
74#if !defined(SetupRtFromHdl_XN)
75 #define SetupRtFromHdl_XN(hdl) AllRtSetup_XN(hdl)
76 #define SetupRtFromHdl_X(hdl) AllRtSetup_X(hdl)
77#endif
78
79// initialize the TCL and MO class specific object
80#define ClassInit \
81 /* if not already done, initialize NEW MQ type */ \
82 if (Sq3StmtCTT == NULL) Sq3StmtCTT = Sq3StmtSTT; \
83 \
84 /* protect against double call */ \
85 if (Sq3StmtCTT->selfCreate == NS(Sq3StmtC_selfCreate)) return MK_OK; \
86 \
87 /* add "selfCreate" and "selfDelete" feature to the MQ-Class */ \
88 Sq3StmtCTT->selfCreate = NS(Sq3StmtC_selfCreate); \
89 Sq3StmtCTT->selfDelete = NS(Sq3StmtC_selfDelete); \
90 Sq3StmtCTT->selfUnlink = NS(Sq3StmtC_selfUnlink); \
91 \
92 /* create the TCL-class */ \
93 OT_SELF_T classO = MK(ClassDef)(interp,ns,Sq3StmtCTT); \
94 check_NULL(classO) goto error; \
95 OT_CLASS = Tcl_GetObjectAsClass(classO); \
96 \
97 /* create the TCL static Methods */ \
98 static MkThreadLocal OtUnknownS NS(sClassUnknown) = {OT_UNKNOWN_CLASS}; \
99 check_LNG(MK(UnknownSetup) (interp,classO,NS(sOtClassDef),&NS(sClassUnknown))) goto error; \
100 \
101 /* create the TCL instance Methods */ \
102 static MkThreadLocal OtUnknownS NS(sInstanceUnknown) = {OT_UNKNOWN_INSTANCE}; \
103 check_LNG(MK(UnknownSetup) (interp,classO,NS(sInstanceDef),&NS(sInstanceUnknown))) goto error; \
104 \
105 /* define the "NULL" object */ \
106 SQ3(Sq3StmtC_MK_NULL) = Tcl_GetObjectName(interp, \
107 MK(AtomCreate) (MK_RT_CALL interp, NULL /*obj*/, OT_CLASS, "MK_NULL" /*name*/, "::tclsq3lite::Sq3StmtC" /*ns*/) \
108 ); \
109 Tcl_IncrRefCount(SQ3(Sq3StmtC_MK_NULL));
110
111#define VER TCL_OO_METHOD_VERSION_CURRENT
112
113/* LABEL-END */
114
115// BEGIN-DOC - created by 'tcl_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
116
117// doc-key: Sq3StmtC,Sq3Stmt,sCo,func
118#define CTOR_doc "Sq3StmtC [Sq3StmtC CTOR db:Sq3LiteC zSql:string]"
119#define PrepareV2_doc "Sq3StmtC [Sq3StmtC PrepareV2 db:Sq3LiteC zSql:string]"
120#define PrepareV3_doc "Sq3StmtC [Sq3StmtC PrepareV3 db:Sq3LiteC zSql:string ?prepFlags:Sq3PrepareEF=SQ3_PREPARE_NO?]"
121
122// doc-key: Sq3StmtC,Sq3Stmt,sc_,func
123#define GetNull_doc "Sq3StmtC [Sq3StmtC GetNull]"
124#define HandleResolve_doc "Sq3StmtC [Sq3StmtC HandleResolve netHdl:MK_HDL]"
125#define Instances_doc "Sq3StmtC [Sq3StmtC Instances]"
126#define NextStmt_doc "Sq3StmtC [Sq3StmtC NextStmt pDb:Sq3LiteC ?pStmt:Sq3StmtC=\"MK_NULL\"?]"
127
128// doc-key: Sq3StmtC,Sq3Stmt,oc_,func
129#define ColumnValue_doc "Sq3ValueC [$sq3stmt ColumnValue iCol:int32]"
130#define DbHandle_doc "Sq3LiteC [$sq3stmt DbHandle]"
131#define Next_doc "Sq3StmtC [$stmt Next]"
132#define Prev_doc "Sq3StmtC [$stmt Prev]"
133
134// doc-key: Sq3StmtC,Sq3Stmt,om_,func
135#define BindBlob_doc "$sq3stmt BindBlob pos:int32 blob:binary"
136#define BindDouble_doc "$sq3stmt BindDouble arg1:int32 arg2:double"
137#define BindInt_doc "$sq3stmt BindInt arg1:int32 arg2:int32"
138#define BindInt64_doc "$sq3stmt BindInt64 arg1:int32 arg2:int64"
139#define BindNull_doc "$sq3stmt BindNull arg1:int32"
140#define BindParameterCount_doc "$sq3stmt BindParameterCount"
141#define BindParameterIndex_doc "$sq3stmt BindParameterIndex zName:string"
142#define BindParameterName_doc "string [$sq3stmt BindParameterName arg1:int32]"
143#define BindText_doc "$sq3stmt BindText pos:int32 text:string"
144#define BindValue_doc "$sq3stmt BindValue arg1:int32 arg2:Sq3ValueC"
145#define BindZeroblob_doc "$sq3stmt BindZeroblob arg1:int32 n:int32"
146#define BindZeroblob64_doc "$sq3stmt BindZeroblob64 arg1:int32 arg2:int64"
147#define Busy_doc "$sq3stmt Busy"
148#define ClearBindings_doc "$sq3stmt ClearBindings"
149#define ColumnBlob_doc "binary [$sq3stmt ColumnBlob iCol:int32]"
150#define ColumnBytes_doc "int32 [$sq3stmt ColumnBytes iCol:int32]"
151#define ColumnCount_doc "int32 [$pStmt ColumnCount]"
152#define ColumnDouble_doc "double [$sq3stmt ColumnDouble iCol:int32]"
153#define ColumnInt_doc "int32 [$sq3stmt ColumnInt iCol:int32]"
154#define ColumnInt64_doc "int64 [$sq3stmt ColumnInt64 iCol:int32]"
155#define ColumnName_doc "string [$sq3stmt ColumnName N:int32]"
156#define ColumnText_doc "string [$sq3stmt ColumnText iCol:int32]"
157#define ColumnType_doc "Sq3TypeE [$sq3stmt ColumnType iCol:int32]"
158#define DataCount_doc "$pStmt DataCount"
159#define ExpandedSql_doc "string [$pStmt ExpandedSql]"
160#define Explain_doc "$pStmt Explain eMode:int32"
161#define Finalize_doc "$pStmt Finalize"
162#define GetPzTail_doc "string [$sq3stmt GetPzTail]"
163// skip class-overload: HandleGet → MkObjectHandleGet
164#define IsExplain_doc "$pStmt IsExplain"
165// skip class-overload: Log → MkObjectLog
166#define Readonly_doc "$pStmt Readonly"
167#define Reset_doc "$pStmt Reset"
168#define Sql_doc "string [$pStmt Sql]"
169#define Status_doc "$sq3stmt Status op:Sq3StmtStatusE resetFlg:bool"
170
171// doc-key: Sq3StmtC,Sq3Stmt,omo,func
172#define Step_doc "Sq3ErrorE [$sq3stmt Step]"
173
174// END-DOC - created by 'tcl_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
175
176/*****************************************************************************/
177/* */
178/* O B J E C T */
179/* */
180/*****************************************************************************/
181
182// BEGIN-Sq3StmtC - created by 'tcl_MqC.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
183
187
188// doc-key: Sq3StmtC,Sq3StmtC-Bind,om_
189
191static OT_ProcRet NS(Sq3StmtC_BindBlob) (Sq3StmtC_ARGS) {
194 MK_I32 pos = 0;
196 MkBinaryR blob = {0};
199 MkErrorC_Check(hdl,Sq3StmtBindBlob (hdl, pos, blob));
201 goto end;
202 error:
204 end:
206}
207
209static OT_ProcRet NS(Sq3StmtC_BindDouble) (Sq3StmtC_ARGS) {
212 MK_I32 arg1 = 0;
214 MK_DBL arg2 = 0;
217 MkErrorC_Check(hdl,Sq3StmtBindDouble (hdl, arg1, arg2));
219 goto end;
220 error:
222 end:
224}
225
227static OT_ProcRet NS(Sq3StmtC_BindInt) (Sq3StmtC_ARGS) {
230 MK_I32 arg1 = 0;
232 MK_I32 arg2 = 0;
235 MkErrorC_Check(hdl,Sq3StmtBindInt (hdl, arg1, arg2));
237 goto end;
238 error:
240 end:
242}
243
245static OT_ProcRet NS(Sq3StmtC_BindInt64) (Sq3StmtC_ARGS) {
248 MK_I32 arg1 = 0;
250 MK_I64 arg2 = 0;
253 MkErrorC_Check(hdl,Sq3StmtBindInt64 (hdl, arg1, arg2));
255 goto end;
256 error:
258 end:
260}
261
263static OT_ProcRet NS(Sq3StmtC_BindNull) (Sq3StmtC_ARGS) {
266 MK_I32 arg1 = 0;
269 MkErrorC_Check(hdl,Sq3StmtBindNull (hdl, arg1));
271 goto end;
272 error:
274 end:
276}
277
279static OT_ProcRet NS(Sq3StmtC_BindParameterCount) (Sq3StmtC_ARGS) {
285 goto end;
286 error:
288 end:
290}
291
293static OT_ProcRet NS(Sq3StmtC_BindParameterIndex) (Sq3StmtC_ARGS) {
296 MK_STRN zName = 0;
301 goto end;
302 error:
304 end:
306}
307
309static OT_ProcRet NS(Sq3StmtC_BindParameterName) (Sq3StmtC_ARGS) {
312 MK_I32 arg1 = 0;
316 goto end;
317 error:
319 end:
321}
322
324static OT_ProcRet NS(Sq3StmtC_BindText) (Sq3StmtC_ARGS) {
327 MK_I32 pos = 0;
329 MkStringR text = {0};
332 MkErrorC_Check(hdl,Sq3StmtBindText (hdl, pos, text));
334 goto end;
335 error:
337 end:
339}
340
342static OT_ProcRet NS(Sq3StmtC_BindValue) (Sq3StmtC_ARGS) {
345 MK_I32 arg1 = 0;
347 SQ3_VALN arg2 = 0;
350 MkErrorC_Check(hdl,Sq3StmtBindValue (hdl, arg1, arg2));
352 goto end;
353 error:
355 end:
357}
358
360static OT_ProcRet NS(Sq3StmtC_BindZeroblob) (Sq3StmtC_ARGS) {
363 MK_I32 arg1 = 0;
365 MK_I32 n = 0;
368 MkErrorC_Check(hdl,Sq3StmtBindZeroblob (hdl, arg1, n));
370 goto end;
371 error:
373 end:
375}
376
378static OT_ProcRet NS(Sq3StmtC_BindZeroblob64) (Sq3StmtC_ARGS) {
381 MK_I32 arg1 = 0;
383 MK_I64 arg2 = 0;
386 MkErrorC_Check(hdl,Sq3StmtBindZeroblob64 (hdl, arg1, arg2));
388 goto end;
389 error:
391 end:
393}
394
396// Sq3StmtC_Bind_TCL_API
397
401
402// doc-key: Sq3StmtC,Sq3StmtC-Class-Export,sc_
403
405static OT_ProcRet NS(Sq3StmtC_HandleResolve) (OtClass_ARGS) {
408 MK_HDL netHdl = 0;
411 SQ3_STMT retVal = Sq3StmtHandleResolve (netHdl);
412 OT_retObj_SET_STMT(retVal);
413 goto end;
414 error:
416 end:
418}
419
420// doc-key: Sq3StmtC,Sq3StmtC-Class-Export,om_
421
422// skip on class-overload: Sq3StmtHandleGet → MkObjectHandleGet
424static OT_ProcRet NS(Sq3StmtC_HandleGet) (Sq3StmtC_ARGS) {OT_ERROR_LNG_RETURN;}
425
427// Sq3StmtC_Class_TCL_API
428
432
433// doc-key: Sq3StmtC,Sq3StmtC-Class-Introspection,oc_
434
436static OT_ProcRet NS(Sq3StmtC_Next) (Sq3StmtC_ARGS) {
440 SQ3_STMT retVal = Sq3StmtNext (hdl);
441 OT_retObj_SET_STMT(retVal);
442 goto end;
443 error:
445 end:
447}
448
450static OT_ProcRet NS(Sq3StmtC_Prev) (Sq3StmtC_ARGS) {
454 SQ3_STMT retVal = Sq3StmtPrev (hdl);
455 OT_retObj_SET_STMT(retVal);
456 goto end;
457 error:
459 end:
461}
462
463// doc-key: Sq3StmtC,Sq3StmtC-Class-Introspection,sc_
464
466static OT_ProcRet NS(Sq3StmtC_Instances) (OtClass_ARGS) {
470 SQ3_STMT retVal = Sq3StmtInstances ();
471 OT_retObj_SET_STMT(retVal);
472 goto end;
473 error:
475 end:
477}
478
480// Sq3StmtC_Class_TCL_API
481
485
486// doc-key: Sq3StmtC,Sq3StmtC-Class-Misc,sc_
487
489static OT_ProcRet NS(Sq3StmtC_GetNull) (OtClass_ARGS) {
493 SQ3_STMT retVal = Sq3StmtGetNull ();
494 OT_retObj_SET_STMT(retVal);
495 goto end;
496 error:
498 end:
500}
501
503// Sq3StmtC_Class_TCL_API
504
508
509// doc-key: Sq3StmtC,Sq3StmtC-Column,oc_
510
512static OT_ProcRet NS(Sq3StmtC_ColumnValue) (Sq3StmtC_ARGS) {
515 MK_I32 iCol = 0;
518 SQ3_VAL retVal = Sq3StmtColumnValue (hdl, iCol);
519 OT_retObj_SET_VAL(retVal);
520 goto end;
521 error:
523 end:
525}
526
527// doc-key: Sq3StmtC,Sq3StmtC-Column,om_
528
530static OT_ProcRet NS(Sq3StmtC_ColumnBlob) (Sq3StmtC_ARGS) {
533 MK_I32 iCol = 0;
536 MkBinaryR retVal = Sq3StmtColumnBlob (hdl, iCol);
538 goto end;
539 error:
541 end:
543}
544
546static OT_ProcRet NS(Sq3StmtC_ColumnBytes) (Sq3StmtC_ARGS) {
549 MK_I32 iCol = 0;
553 goto end;
554 error:
556 end:
558}
559
561static OT_ProcRet NS(Sq3StmtC_ColumnCount) (Sq3StmtC_ARGS) {
566 goto end;
567 error:
569 end:
571}
572
574static OT_ProcRet NS(Sq3StmtC_ColumnDouble) (Sq3StmtC_ARGS) {
577 MK_I32 iCol = 0;
581 goto end;
582 error:
584 end:
586}
587
589static OT_ProcRet NS(Sq3StmtC_ColumnInt) (Sq3StmtC_ARGS) {
592 MK_I32 iCol = 0;
596 goto end;
597 error:
599 end:
601}
602
604static OT_ProcRet NS(Sq3StmtC_ColumnInt64) (Sq3StmtC_ARGS) {
607 MK_I32 iCol = 0;
611 goto end;
612 error:
614 end:
616}
617
619static OT_ProcRet NS(Sq3StmtC_ColumnName) (Sq3StmtC_ARGS) {
622 MK_I32 N = 0;
626 goto end;
627 error:
629 end:
631}
632
634static OT_ProcRet NS(Sq3StmtC_ColumnText) (Sq3StmtC_ARGS) {
637 MK_I32 iCol = 0;
640 MkStringR retVal = Sq3StmtColumnText (hdl, iCol);
642 goto end;
643 error:
645 end:
647}
648
650static OT_ProcRet NS(Sq3StmtC_ColumnType) (Sq3StmtC_ARGS) {
653 MK_I32 iCol = 0;
657 goto end;
658 error:
660 end:
662}
663
665// Sq3StmtC_Column_TCL_API
666
670
671// doc-key: Sq3StmtC,Sq3StmtC-Info,oc_
672
674static OT_ProcRet NS(Sq3StmtC_DbHandle) (Sq3StmtC_ARGS) {
678 SQ3_LITE retVal = Sq3StmtDbHandle (hdl);
679 OT_retObj_SET_LITE(retVal);
680 goto end;
681 error:
683 end:
685}
686
687// doc-key: Sq3StmtC,Sq3StmtC-Info,om_
688
690static OT_ProcRet NS(Sq3StmtC_Busy) (Sq3StmtC_ARGS) {
694 MkErrorC_Check(hdl,Sq3StmtBusy (hdl));
696 goto end;
697 error:
699 end:
701}
702
704static OT_ProcRet NS(Sq3StmtC_DataCount) (Sq3StmtC_ARGS) {
710 goto end;
711 error:
713 end:
715}
716
718static OT_ProcRet NS(Sq3StmtC_IsExplain) (Sq3StmtC_ARGS) {
724 goto end;
725 error:
727 end:
729}
730
731// skip on class-overload: Sq3StmtLog → MkObjectLog
734
736static OT_ProcRet NS(Sq3StmtC_Readonly) (Sq3StmtC_ARGS) {
742 goto end;
743 error:
745 end:
747}
748
750static OT_ProcRet NS(Sq3StmtC_Status) (Sq3StmtC_ARGS) {
753 enum Sq3StmtStatusE op = 0;
755 MK_BOOL resetFlg = 0;
758 MkErrorC_Check(hdl,Sq3StmtStatus (hdl, op, resetFlg));
760 goto end;
761 error:
763 end:
765}
766
768// Sq3StmtC_Info_TCL_API
769
773
774// doc-key: Sq3StmtC,Sq3StmtC-Misc,sc_
775
777static OT_ProcRet NS(Sq3StmtC_NextStmt) (OtClass_ARGS) {
780 SQ3_LITE pDb = 0;
782 SQ3_STMT pStmt = NULL;
785 SQ3_STMT retVal = Sq3StmtNextStmt (pDb, pStmt);
786 OT_retObj_SET_STMT(retVal);
787 goto end;
788 error:
790 end:
792}
793
794// doc-key: Sq3StmtC,Sq3StmtC-Misc,om_
795
797static OT_ProcRet NS(Sq3StmtC_ClearBindings) (Sq3StmtC_ARGS) {
803 goto end;
804 error:
806 end:
808}
809
811static OT_ProcRet NS(Sq3StmtC_Explain) (Sq3StmtC_ARGS) {
814 MK_I32 eMode = 0;
817 MkErrorC_Check(hdl,Sq3StmtExplain (hdl, eMode));
819 goto end;
820 error:
822 end:
824}
825
827static OT_ProcRet NS(Sq3StmtC_Reset) (Sq3StmtC_ARGS) {
831 MkErrorC_Check(hdl,Sq3StmtReset (hdl));
833 goto end;
834 error:
836 end:
838}
839
840// doc-key: Sq3StmtC,Sq3StmtC-Misc,omo
841
843static OT_ProcRet NS(Sq3StmtC_Step) (Sq3StmtC_ARGS) {
847 enum Sq3ErrorE retCode;
848 MkErrorC_Check(hdl,Sq3StmtStep (hdl, &retCode));
849 OT_retObj_SET(OT_NEW_Sq3_enum_OBJ(ErrorE,retCode));
850 goto end;
851 error:
853 end:
855}
856
858// Sq3StmtC_Misc_TCL_API
859
863
864// doc-key: Sq3StmtC,Sq3StmtC-Sql,om_
865
867static OT_ProcRet NS(Sq3StmtC_ExpandedSql) (Sq3StmtC_ARGS) {
872 goto end;
873 error:
875 end:
877}
878
880static OT_ProcRet NS(Sq3StmtC_GetPzTail) (Sq3StmtC_ARGS) {
885 goto end;
886 error:
888 end:
890}
891
893static OT_ProcRet NS(Sq3StmtC_Sql) (Sq3StmtC_ARGS) {
898 goto end;
899 error:
901 end:
903}
904
906// Sq3StmtC_Sql_TCL_API
907
911
912// doc-key: Sq3StmtC,Sq3StmtC-TOR,sCo
913
915static OT_ProcRet NS(Sq3StmtC_CTOR) (CONSTR_ARGS) {
918 SQ3_LITE db = 0;
920 MkStringR zSql = {0};
922 SQ3_STMT ppStmt;
923 MkErrorC_Check(db,Sq3StmtPrepareV2 (db, zSql, &ppStmt));
924 OT_CONSTRUCTOR_POST(ppStmt)
925 OT_retObj_CONSTR(ppStmt);
926 goto end;
927 error:
929 end:
931}
932
934static OT_ProcRet NS(Sq3StmtC_PrepareV2) (OtClass_ARGS) {
937 SQ3_LITE db = 0;
939 MkStringR zSql = {0};
942 SQ3_STMT ppStmt;
943 MkErrorC_Check(db,Sq3StmtPrepareV2 (db, zSql, &ppStmt));
944 OT_CONSTRUCTOR_POST(ppStmt)
945 OT_retObj_SET_STMT(ppStmt);
946 goto end;
947 error:
949 end:
951}
952
954static OT_ProcRet NS(Sq3StmtC_PrepareV3) (OtClass_ARGS) {
957 SQ3_LITE db = 0;
959 MkStringR zSql = {0};
961 enum Sq3PrepareEF prepFlags = SQ3_PREPARE_NO;
964 SQ3_STMT ppStmt;
965 MkErrorC_Check(db,Sq3StmtPrepareV3 (db, zSql, prepFlags, &ppStmt));
966 OT_retObj_SET_STMT(ppStmt);
967 goto end;
968 error:
970 end:
972}
973
974// doc-key: Sq3StmtC,Sq3StmtC-TOR,om_
975
977static OT_ProcRet NS(Sq3StmtC_Finalize) (Sq3StmtC_ARGS) {
983 goto end;
984 error:
986 end:
988}
989
991// Sq3StmtC_TOR_TCL_API
992
993// END-Sq3StmtC - created by 'tcl_MqC.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
994
995// ---------------------------------------------------------------------------------------
996
997static Tcl_MethodType NS(sOtClassDef)[] = {
998// BEGIN-CLASS - created by 'tcl_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
999
1000// doc-key: Sq3StmtC,Sq3Stmt,sCo
1001 {VER, "PrepareV2" , NS(Sq3StmtC_PrepareV2) , NULL, NULL},
1002 {VER, "PrepareV3" , NS(Sq3StmtC_PrepareV3) , NULL, NULL},
1003
1004// doc-key: Sq3StmtC,Sq3Stmt,sc_
1005 {VER, "GetNull" , NS(Sq3StmtC_GetNull) , NULL, NULL},
1006 {VER, "HandleResolve" , NS(Sq3StmtC_HandleResolve) , NULL, NULL},
1007 {VER, "Instances" , NS(Sq3StmtC_Instances) , NULL, NULL},
1008 {VER, "NextStmt" , NS(Sq3StmtC_NextStmt) , NULL, NULL},
1009
1010// END-CLASS - created by 'tcl_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
1011 {0, NULL, NULL, NULL}
1012};
1013
1014// ---------------------------------------------------------------------------------------
1015
1016static Tcl_MethodType NS(sInstanceDef)[] = {
1017// BEGIN-OBJ - created by 'tcl_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
1018
1019// doc-key: Sq3StmtC,Sq3Stmt,oC_
1020 {VER, "<constructor>" , NS(Sq3StmtC_CTOR) , NULL, NULL},
1021
1022// doc-key: Sq3StmtC,Sq3Stmt,oc_
1023 {VER, "ColumnValue" , NS(Sq3StmtC_ColumnValue) , NULL, NULL},
1024 {VER, "DbHandle" , NS(Sq3StmtC_DbHandle) , NULL, NULL},
1025 {VER, "Next" , NS(Sq3StmtC_Next) , NULL, NULL},
1026 {VER, "Prev" , NS(Sq3StmtC_Prev) , NULL, NULL},
1027
1028// doc-key: Sq3StmtC,Sq3Stmt,om_
1029 {VER, "BindBlob" , NS(Sq3StmtC_BindBlob) , NULL, NULL},
1030 {VER, "BindDouble" , NS(Sq3StmtC_BindDouble) , NULL, NULL},
1031 {VER, "BindInt" , NS(Sq3StmtC_BindInt) , NULL, NULL},
1032 {VER, "BindInt64" , NS(Sq3StmtC_BindInt64) , NULL, NULL},
1033 {VER, "BindNull" , NS(Sq3StmtC_BindNull) , NULL, NULL},
1034 {VER, "BindParameterCount" , NS(Sq3StmtC_BindParameterCount) , NULL, NULL},
1035 {VER, "BindParameterIndex" , NS(Sq3StmtC_BindParameterIndex) , NULL, NULL},
1036 {VER, "BindParameterName" , NS(Sq3StmtC_BindParameterName) , NULL, NULL},
1037 {VER, "BindText" , NS(Sq3StmtC_BindText) , NULL, NULL},
1038 {VER, "BindValue" , NS(Sq3StmtC_BindValue) , NULL, NULL},
1039 {VER, "BindZeroblob" , NS(Sq3StmtC_BindZeroblob) , NULL, NULL},
1040 {VER, "BindZeroblob64" , NS(Sq3StmtC_BindZeroblob64) , NULL, NULL},
1041 {VER, "Busy" , NS(Sq3StmtC_Busy) , NULL, NULL},
1042 {VER, "ClearBindings" , NS(Sq3StmtC_ClearBindings) , NULL, NULL},
1043 {VER, "ColumnBlob" , NS(Sq3StmtC_ColumnBlob) , NULL, NULL},
1044 {VER, "ColumnBytes" , NS(Sq3StmtC_ColumnBytes) , NULL, NULL},
1045 {VER, "ColumnCount" , NS(Sq3StmtC_ColumnCount) , NULL, NULL},
1046 {VER, "ColumnDouble" , NS(Sq3StmtC_ColumnDouble) , NULL, NULL},
1047 {VER, "ColumnInt" , NS(Sq3StmtC_ColumnInt) , NULL, NULL},
1048 {VER, "ColumnInt64" , NS(Sq3StmtC_ColumnInt64) , NULL, NULL},
1049 {VER, "ColumnName" , NS(Sq3StmtC_ColumnName) , NULL, NULL},
1050 {VER, "ColumnText" , NS(Sq3StmtC_ColumnText) , NULL, NULL},
1051 {VER, "ColumnType" , NS(Sq3StmtC_ColumnType) , NULL, NULL},
1052 {VER, "DataCount" , NS(Sq3StmtC_DataCount) , NULL, NULL},
1053 {VER, "ExpandedSql" , NS(Sq3StmtC_ExpandedSql) , NULL, NULL},
1054 {VER, "Explain" , NS(Sq3StmtC_Explain) , NULL, NULL},
1055 {VER, "Finalize" , NS(Sq3StmtC_Finalize) , NULL, NULL},
1056 {VER, "GetPzTail" , NS(Sq3StmtC_GetPzTail) , NULL, NULL},
1057 // skip class-overload: Sq3StmtHandleGet → HandleGet, NS(Sq3StmtC_HandleGet)
1058 {VER, "IsExplain" , NS(Sq3StmtC_IsExplain) , NULL, NULL},
1059 // skip class-overload: Sq3StmtLog → Log, NS(Sq3StmtC_Log)
1060 {VER, "Readonly" , NS(Sq3StmtC_Readonly) , NULL, NULL},
1061 {VER, "Reset" , NS(Sq3StmtC_Reset) , NULL, NULL},
1062 {VER, "Sql" , NS(Sq3StmtC_Sql) , NULL, NULL},
1063 {VER, "Status" , NS(Sq3StmtC_Status) , NULL, NULL},
1064
1065// doc-key: Sq3StmtC,Sq3Stmt,omo
1066 {VER, "Step" , NS(Sq3StmtC_Step) , NULL, NULL},
1067
1068// END-OBJ - created by 'tcl_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
1069 {0, NULL, NULL, NULL, NULL}
1070};
1071
1077
1078int NS(pSq3StmtC_Init) ( MK_RT_ARGS Tcl_Interp *interp, Tcl_Namespace *ns)
1079{
1080 ClassInit
1081
1082 return TCL_OK;
1083error:
1084 return TCL_ERROR;
1085}
#define OT_CHECK_bool(val)
#define MK(n)
#define OT_SETUP_VARARGS(min, max, d)
#define OT_CHECK_NIH(val)
#define OT_SETUP_NOARG(d)
#define OT_SETUP_ONEARG(d)
Tcl_Class OT_CLS_T
#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_CONSTRUCTOR_POST(x)
#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_GET__ME_REF_MkStringR(s)
#define OT_GET__ME_REF_MkBinaryR(b)
#define OT_SETUP_CONSTRUCTOR_ARGS(...)
#define OT_CHECK_ENUM(ename, val)
#define OT_retObj_RETURN
#define OT_CHECK__ME_REF_MkStringR(val)
#define OT_CHECK__ME_REF_MkBinaryR(val)
#define OT_retObj_SET_STR(nat)
Tcl_Object OT_SELF_T
#define OT_CHECK_OPTIONAL(val)
#define OT_retObj_SET(val)
#define OT_retObj_CONSTR(x)
#define OT_CHECK_NOARGS
#define MkErrorC_Check(mng, PROC)
#define OT_ProcRet
Tcl_Interp * OT_ENV_T
#define CONSTR_ARGS
Tcl_Obj * OT_OBJ_T
#define OT_CHECK_STRN(val)
LibSq3Lite_private_tcl.h - 17 Apr 2025 - aotto1968.
#define OtClass_ARGS
#define SQ3(n)
#define Sq3StmtC_ARGS
#define OT_NEW_Sq3_enum_OBJ(typ, val)
#define OT_retObj_SET_LITE(nat)
#define NS(n)
#define OT_retObj_SET_VAL(nat)
#define OT_retObj_SET_STMT(nat)
#define Instances_doc
#define DataCount_doc
#define ColumnType_doc
#define OT_SETUP_hdl_static_constr
#define DbHandle_doc
#define BindValue_doc
#define Reset_doc
#define Finalize_doc
#define ColumnDouble_doc
#define OT_SETUP_hdl
#define IsExplain_doc
#define ClearBindings_doc
#define ColumnName_doc
#define Step_doc
#define ColumnText_doc
#define BindParameterCount_doc
#define ColumnBytes_doc
#define GetPzTail_doc
#define OT_SETUP_hdl_destr
#define BindInt_doc
#define GetNull_doc
#define ColumnInt_doc
#define Next_doc
#define ColumnCount_doc
#define BindZeroblob64_doc
static __thread MK_TYP Sq3StmtCTT
#define HandleResolve_doc
#define Prev_doc
#define VER
#define BindParameterName_doc
#define OT_CLASS
#define BindNull_doc
#define OT_SETUP_hdl_static
#define OT_SETUP_hdl_constr
#define PrepareV2_doc
#define Status_doc
#define ColumnValue_doc
#define BindParameterIndex_doc
#define Explain_doc
#define NextStmt_doc
#define PrepareV3_doc
#define Sql_doc
#define BindZeroblob_doc
#define BindInt64_doc
#define BindText_doc
#define CTOR_doc
#define ColumnInt64_doc
#define ExpandedSql_doc
#define ClassInit
#define Readonly_doc
#define Busy_doc
#define ColumnBlob_doc
#define BindDouble_doc
#define BindBlob_doc
#define MK_NULL_NO
#define MK_NULL_YES
#define MK_UNUSED
#define MK_DEPRECATED
MK_PTRB * MK_PTR
const MK_STRB * MK_STRN
signed long long MK_I64
bool MK_BOOL
double MK_DBL
int32_t MK_HDL
signed int MK_I32
#define MkThreadLocal
#define MK_RT_CALL
#define MK_RT_ARGS
Sq3StmtStatusE
Status Parameters for prepared statements.
Sq3PrepareEF
Prepare Flags.
Sq3ErrorE
Result Codes.
@ SQ3_PREPARE_NO
static enum MkErrorE Sq3StmtBindDouble(SQ3_STMT sq3stmt, MK_I32 arg1, MK_DBL arg2)
Binding Values To Prepared Statements …
static enum MkErrorE Sq3StmtBindNull(SQ3_STMT sq3stmt, MK_I32 arg1)
Binding Values To Prepared Statements …
static MK_STRN Sq3StmtBindParameterName(SQ3_STMT sq3stmt, MK_I32 arg1)
Name Of A Host Parameter …
#define Sq3StmtBindText(...)
static enum MkErrorE Sq3StmtBindZeroblob64(SQ3_STMT sq3stmt, MK_I32 arg1, MK_I64 arg2)
Binding Values To Prepared Statements …
#define Sq3StmtBindBlob(...)
static enum MkErrorE Sq3StmtBindParameterCount(SQ3_STMT sq3stmt)
Number Of SQL Parameters …
static enum MkErrorE Sq3StmtBindInt64(SQ3_STMT sq3stmt, MK_I32 arg1, MK_I64 arg2)
Binding Values To Prepared Statements …
static enum MkErrorE Sq3StmtBindValue(SQ3_STMT sq3stmt, MK_I32 arg1, SQ3_VALN arg2)
Binding Values To Prepared Statements …
static enum MkErrorE Sq3StmtBindZeroblob(SQ3_STMT sq3stmt, MK_I32 arg1, MK_I32 n)
Binding Values To Prepared Statements …
static enum MkErrorE Sq3StmtBindParameterIndex(SQ3_STMT sq3stmt, MK_STRN zName)
Index Of A Parameter With A Given Name …
static enum MkErrorE Sq3StmtBindInt(SQ3_STMT sq3stmt, MK_I32 arg1, MK_I32 arg2)
Binding Values To Prepared Statements …
#define Sq3StmtHandleResolve(...)
static SQ3_STMT Sq3StmtPrev(SQ3_STMT const stmt)
get previous instance from linked-list of Sq3StmtS type
static SQ3_STMT Sq3StmtNext(SQ3_STMT const stmt)
get next instance from linked-list of Sq3StmtS type
#define Sq3StmtInstances()
static SQ3_STMT Sq3StmtGetNull(void)
Null-Slot - return a Sq3StmtC typed NULL instance …
static enum Sq3TypeE Sq3StmtColumnType(SQ3_STMT sq3stmt, MK_I32 iCol)
Result Values From A Query …
static MkBinaryR Sq3StmtColumnBlob(SQ3_STMT sq3stmt, MK_I32 iCol)
Result a MkBinaryR Value From A Query.
static MK_DBL Sq3StmtColumnDouble(SQ3_STMT sq3stmt, MK_I32 iCol)
Result Values From A Query …
static MK_I64 Sq3StmtColumnInt64(SQ3_STMT sq3stmt, MK_I32 iCol)
Result Values From A Query …
static MkStringR Sq3StmtColumnText(SQ3_STMT sq3stmt, MK_I32 iCol)
Result a MkStringR Value From A Query.
static MK_I32 Sq3StmtColumnCount(SQ3_STMT pStmt)
Number Of Columns In A Result Set …
static MK_STRN Sq3StmtColumnName(SQ3_STMT sq3stmt, MK_I32 N)
Column Names In A Result Set …
static SQ3_VAL Sq3StmtColumnValue(SQ3_STMT sq3stmt, MK_I32 iCol)
Result Values From A Query …
static MK_I32 Sq3StmtColumnInt(SQ3_STMT sq3stmt, MK_I32 iCol)
Result Values From A Query …
static MK_I32 Sq3StmtColumnBytes(SQ3_STMT sq3stmt, MK_I32 iCol)
Result Values From A Query …
static enum MkErrorE Sq3StmtStatus(SQ3_STMT sq3stmt, enum Sq3StmtStatusE op, MK_BOOL resetFlg)
Prepared Statement Status …
static SQ3_LITE Sq3StmtDbHandle(SQ3_STMT sq3stmt)
Find The Database Handle Of A Prepared Statement …
static enum MkErrorE Sq3StmtDataCount(SQ3_STMT pStmt)
Number of columns in a result set …
static enum MkErrorE Sq3StmtIsExplain(SQ3_STMT pStmt)
Query The EXPLAIN Setting For A Prepared Statement …
static enum MkErrorE Sq3StmtReadonly(SQ3_STMT pStmt)
Determine If An SQL Statement Writes The Database …
static enum MkErrorE Sq3StmtBusy(SQ3_STMT sq3stmt)
Determine If A Prepared Statement Has Been Reset …
static enum MkErrorE Sq3StmtExplain(SQ3_STMT pStmt, MK_I32 eMode)
Change The EXPLAIN Setting For A Prepared Statement …
static enum MkErrorE Sq3StmtClearBindings(SQ3_STMT sq3stmt)
Reset All Bindings On A Prepared Statement …
static SQ3_STMT Sq3StmtNextStmt(SQ3_LITE pDb, SQ3_STMT pStmt)
Find the next prepared statement …
static enum MkErrorE Sq3StmtStep(SQ3_STMT sq3stmt, enum Sq3ErrorE *retCode)
Evaluate An SQL Statement …
static enum MkErrorE Sq3StmtReset(SQ3_STMT pStmt)
Reset A Prepared Statement Object …
static MK_STR Sq3StmtExpandedSql(SQ3_STMT pStmt)
Retrieving Statement SQL …
static MK_STRN Sq3StmtGetPzTail(SQ3_STMT sq3stmt)
return the non compiled sql-statement from Sq3StmtPrepareV2 and Sq3StmtPrepareV3 …
static MK_STRN Sq3StmtSql(SQ3_STMT pStmt)
Retrieving Statement SQL …
static enum MkErrorE Sq3StmtPrepareV2(SQ3_LITE db, MkStringR zSql, SQ3_STMT *ppStmt)
Compiling An SQL Statement …
static enum MkErrorE Sq3StmtFinalize(SQ3_STMT pStmt)
Destroy A Prepared Statement Object …
static enum MkErrorE Sq3StmtPrepareV3(SQ3_LITE db, MkStringR zSql, Sq3PrepareEF prepFlags, SQ3_STMT *ppStmt)
Compiling An SQL Statement …
#define OT_CHECK_VALN(val, nullB)
#define OT_CHECK_LITE(val, nullB)
#define OT_CHECK_STMT(val, nullB)
Struct to represent the data of the Sq3LiteC …
Struct to represent the data of the Sq3StmtC …
Struct to represent the data of the Sq3ValueC …