theSq3Lite 10.0
Loading...
Searching...
No Matches
Sq3StmtC_tcl.c
Go to the documentation of this file.
1
9/* LABEL-START */
10
11#define META_FILE_NAME "Sq3StmtC_tcl.c"
12
14
15#define OT_CLASS NS(Sq3StmtC)
16#define OT_CLASS_NAME "Sq3StmtC"
17
18#define OBJECT2STMT(O) MkAssertCastM(Sq3StmtC,(Tcl_ObjectGetMetadata(O, &MK(AtomMeta))))
19
20// TCL class
22
23// META class
25MkThreadLocal OT_OBJ_T SQ3(Sq3StmtC_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(Sq3StmtC_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(Sq3StmtC_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(Sq3StmtC_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 = Sq3StmtC##_TT;
58
59#define OT_SETUP_hdl SetupHdlFromMetaData_2(STMT,SQ3_STMT);
60#define OT_SETUP_hdl__null_allow SetupHdlFromMetaData__null_allow_2(STMT,SQ3_STMT);
61#define OT_SETUP_hdl_destr SetupHdlFromMetaData__null_allow_2(STMT,SQ3_STMT);
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_STMT hdl = (SQ3_STMT) &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 (Sq3StmtCTT == NULL) Sq3StmtCTT = Sq3StmtSTT; \
80 \
81 /* protect against double call */ \
82 if (Sq3StmtCTT->selfCreate == NS(Sq3StmtC_selfCreate)) return MK_OK; \
83 \
84 /* add "selfCreate" and "selfDelete" feature to the MQ-Class */ \
85 Sq3StmtCTT->selfCreate = NS(Sq3StmtC_selfCreate); \
86 Sq3StmtCTT->selfDelete = NS(Sq3StmtC_selfDelete); \
87 Sq3StmtCTT->selfUnlink = NS(Sq3StmtC_selfUnlink); \
88 \
89 /* create the TCL-class */ \
90 OT_SELF_T classO = MK(ClassDef)(interp,ns,Sq3StmtCTT); \
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(Sq3StmtC_MK_NULL) = Tcl_GetObjectName(interp, \
104 MK(AtomCreate) (MK_RT_CALL interp, NULL /*obj*/, OT_CLASS, "MK_NULL" /*name*/, "::tclsq3lite::Sq3StmtC" /*ns*/) \
105 ); \
106 Tcl_IncrRefCount(SQ3(Sq3StmtC_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: Sq3StmtC,Sq3Stmt,sCo,func
115#define CTOR_doc "Sq3StmtC [Sq3StmtC CTOR db:Sq3LiteC zSql:string]"
116#define PrepareV2_doc "Sq3StmtC [Sq3StmtC PrepareV2 db:Sq3LiteC zSql:string]"
117#define PrepareV3_doc "Sq3StmtC [Sq3StmtC PrepareV3 db:Sq3LiteC zSql:string ?prepFlags:Sq3PrepareEF=SQ3_PREPARE_NO?]"
118
119// doc-key: Sq3StmtC,Sq3Stmt,sc_,func
120#define GetNull_doc "Sq3StmtC [Sq3StmtC GetNull]"
121#define HandleResolve_doc "Sq3StmtC [Sq3StmtC HandleResolve netHdl:MK_HDL]"
122#define Instances_doc "Sq3StmtC [Sq3StmtC Instances]"
123#define NextStmt_doc "Sq3StmtC [Sq3StmtC NextStmt pDb:Sq3LiteC ?pStmt:Sq3StmtC=\"MK_NULL\"?]"
124
125// doc-key: Sq3StmtC,Sq3Stmt,oc_,func
126#define ColumnValue_doc "Sq3ValueC [$sq3stmt ColumnValue iCol:int32]"
127#define DbHandle_doc "Sq3LiteC [$sq3stmt DbHandle]"
128#define Next_doc "Sq3StmtC [$stmt Next]"
129#define Prev_doc "Sq3StmtC [$stmt Prev]"
130
131// doc-key: Sq3StmtC,Sq3Stmt,om_,func
132#define BindBlob_doc "$sq3stmt BindBlob pos:int32 blob:binary"
133#define BindDouble_doc "$sq3stmt BindDouble arg1:int32 arg2:double"
134#define BindInt_doc "$sq3stmt BindInt arg1:int32 arg2:int32"
135#define BindInt64_doc "$sq3stmt BindInt64 arg1:int32 arg2:int64"
136#define BindNull_doc "$sq3stmt BindNull arg1:int32"
137#define BindParameterCount_doc "$sq3stmt BindParameterCount"
138#define BindParameterIndex_doc "$sq3stmt BindParameterIndex zName:string"
139#define BindParameterName_doc "string [$sq3stmt BindParameterName arg1:int32]"
140#define BindText_doc "$sq3stmt BindText pos:int32 text:string"
141#define BindValue_doc "$sq3stmt BindValue arg1:int32 arg2:Sq3ValueC"
142#define BindZeroblob_doc "$sq3stmt BindZeroblob arg1:int32 n:int32"
143#define BindZeroblob64_doc "$sq3stmt BindZeroblob64 arg1:int32 arg2:int64"
144#define Busy_doc "$sq3stmt Busy"
145#define ClearBindings_doc "$sq3stmt ClearBindings"
146#define ColumnBlob_doc "binary [$sq3stmt ColumnBlob iCol:int32]"
147#define ColumnBytes_doc "int32 [$sq3stmt ColumnBytes iCol:int32]"
148#define ColumnCount_doc "int32 [$pStmt ColumnCount]"
149#define ColumnDouble_doc "double [$sq3stmt ColumnDouble iCol:int32]"
150#define ColumnInt_doc "int32 [$sq3stmt ColumnInt iCol:int32]"
151#define ColumnInt64_doc "int64 [$sq3stmt ColumnInt64 iCol:int32]"
152#define ColumnName_doc "string [$sq3stmt ColumnName N:int32]"
153#define ColumnText_doc "string [$sq3stmt ColumnText iCol:int32]"
154#define ColumnType_doc "Sq3TypeE [$sq3stmt ColumnType iCol:int32]"
155#define DataCount_doc "$pStmt DataCount"
156#define ExpandedSql_doc "string [$pStmt ExpandedSql]"
157#define Explain_doc "$pStmt Explain eMode:int32"
158#define Finalize_doc "$pStmt Finalize"
159#define GetPzTail_doc "string [$sq3stmt GetPzTail]"
160// skip class-overload: HandleGet → MkObjectHandleGet
161#define IsExplain_doc "$pStmt IsExplain"
162// skip class-overload: Log → MkObjectLog
163#define Readonly_doc "$pStmt Readonly"
164#define Reset_doc "$pStmt Reset"
165#define Sql_doc "string [$pStmt Sql]"
166#define Status_doc "$sq3stmt Status op:Sq3StmtStatusE resetFlg:bool"
167
168// doc-key: Sq3StmtC,Sq3Stmt,omo,func
169#define Step_doc "Sq3ErrorE [$sq3stmt Step]"
170
171// END-DOC - created by 'tcl_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
172
173/*****************************************************************************/
174/* */
175/* O B J E C T */
176/* */
177/*****************************************************************************/
178
179// BEGIN-Sq3StmtC - created by 'tcl_MqC.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
180
184
185// doc-key: Sq3StmtC,Sq3StmtC-Bind,om_
186
188static OT_ProcRet NS(Sq3StmtC_BindBlob) (Sq3StmtC_ARGS) {
191 MK_I32 pos = 0;
193 MkBinaryR blob = {0};
196 MkErrorC_Check(hdl,Sq3StmtBindBlob (hdl, pos, blob));
198 goto end;
199 error:
201 end:
203}
204
206static OT_ProcRet NS(Sq3StmtC_BindDouble) (Sq3StmtC_ARGS) {
209 MK_I32 arg1 = 0;
211 MK_DBL arg2 = 0;
214 MkErrorC_Check(hdl,Sq3StmtBindDouble (hdl, arg1, arg2));
216 goto end;
217 error:
219 end:
221}
222
224static OT_ProcRet NS(Sq3StmtC_BindInt) (Sq3StmtC_ARGS) {
227 MK_I32 arg1 = 0;
229 MK_I32 arg2 = 0;
232 MkErrorC_Check(hdl,Sq3StmtBindInt (hdl, arg1, arg2));
234 goto end;
235 error:
237 end:
239}
240
242static OT_ProcRet NS(Sq3StmtC_BindInt64) (Sq3StmtC_ARGS) {
245 MK_I32 arg1 = 0;
247 MK_I64 arg2 = 0;
250 MkErrorC_Check(hdl,Sq3StmtBindInt64 (hdl, arg1, arg2));
252 goto end;
253 error:
255 end:
257}
258
260static OT_ProcRet NS(Sq3StmtC_BindNull) (Sq3StmtC_ARGS) {
263 MK_I32 arg1 = 0;
266 MkErrorC_Check(hdl,Sq3StmtBindNull (hdl, arg1));
268 goto end;
269 error:
271 end:
273}
274
276static OT_ProcRet NS(Sq3StmtC_BindParameterCount) (Sq3StmtC_ARGS) {
282 goto end;
283 error:
285 end:
287}
288
290static OT_ProcRet NS(Sq3StmtC_BindParameterIndex) (Sq3StmtC_ARGS) {
293 MK_STRN zName = 0;
298 goto end;
299 error:
301 end:
303}
304
306static OT_ProcRet NS(Sq3StmtC_BindParameterName) (Sq3StmtC_ARGS) {
309 MK_I32 arg1 = 0;
313 goto end;
314 error:
316 end:
318}
319
321static OT_ProcRet NS(Sq3StmtC_BindText) (Sq3StmtC_ARGS) {
324 MK_I32 pos = 0;
326 MkStringR text = {0};
329 MkErrorC_Check(hdl,Sq3StmtBindText (hdl, pos, text));
331 goto end;
332 error:
334 end:
336}
337
339static OT_ProcRet NS(Sq3StmtC_BindValue) (Sq3StmtC_ARGS) {
342 MK_I32 arg1 = 0;
344 SQ3_VALN arg2 = 0;
347 MkErrorC_Check(hdl,Sq3StmtBindValue (hdl, arg1, arg2));
349 goto end;
350 error:
352 end:
354}
355
357static OT_ProcRet NS(Sq3StmtC_BindZeroblob) (Sq3StmtC_ARGS) {
360 MK_I32 arg1 = 0;
362 MK_I32 n = 0;
365 MkErrorC_Check(hdl,Sq3StmtBindZeroblob (hdl, arg1, n));
367 goto end;
368 error:
370 end:
372}
373
375static OT_ProcRet NS(Sq3StmtC_BindZeroblob64) (Sq3StmtC_ARGS) {
378 MK_I32 arg1 = 0;
380 MK_I64 arg2 = 0;
383 MkErrorC_Check(hdl,Sq3StmtBindZeroblob64 (hdl, arg1, arg2));
385 goto end;
386 error:
388 end:
390}
391
393// Sq3StmtC_Bind_TCL_API
394
398
399// doc-key: Sq3StmtC,Sq3StmtC-Class-Export,sc_
400
402static OT_ProcRet NS(Sq3StmtC_HandleResolve) (OtClass_ARGS) {
405 MK_HDL netHdl = 0;
408 SQ3_STMT retVal = Sq3StmtHandleResolve (netHdl);
409 OT_retObj_SET_STMT(retVal);
410 goto end;
411 error:
413 end:
415}
416
417// doc-key: Sq3StmtC,Sq3StmtC-Class-Export,om_
418
419// skip on class-overload: Sq3StmtHandleGet → MkObjectHandleGet
421static OT_ProcRet NS(Sq3StmtC_HandleGet) (Sq3StmtC_ARGS) {OT_ERROR_LNG_RETURN;}
422
424// Sq3StmtC_Class_TCL_API
425
429
430// doc-key: Sq3StmtC,Sq3StmtC-Class-Introspection,oc_
431
433static OT_ProcRet NS(Sq3StmtC_Next) (Sq3StmtC_ARGS) {
437 SQ3_STMT retVal = Sq3StmtNext (hdl);
438 OT_retObj_SET_STMT(retVal);
439 goto end;
440 error:
442 end:
444}
445
447static OT_ProcRet NS(Sq3StmtC_Prev) (Sq3StmtC_ARGS) {
451 SQ3_STMT retVal = Sq3StmtPrev (hdl);
452 OT_retObj_SET_STMT(retVal);
453 goto end;
454 error:
456 end:
458}
459
460// doc-key: Sq3StmtC,Sq3StmtC-Class-Introspection,sc_
461
463static OT_ProcRet NS(Sq3StmtC_Instances) (OtClass_ARGS) {
467 SQ3_STMT retVal = Sq3StmtInstances ();
468 OT_retObj_SET_STMT(retVal);
469 goto end;
470 error:
472 end:
474}
475
477// Sq3StmtC_Class_TCL_API
478
482
483// doc-key: Sq3StmtC,Sq3StmtC-Class-Misc,sc_
484
486static OT_ProcRet NS(Sq3StmtC_GetNull) (OtClass_ARGS) {
490 SQ3_STMT retVal = Sq3StmtGetNull ();
491 OT_retObj_SET_STMT(retVal);
492 goto end;
493 error:
495 end:
497}
498
500// Sq3StmtC_Class_TCL_API
501
505
506// doc-key: Sq3StmtC,Sq3StmtC-Column,oc_
507
509static OT_ProcRet NS(Sq3StmtC_ColumnValue) (Sq3StmtC_ARGS) {
512 MK_I32 iCol = 0;
515 SQ3_VAL retVal = Sq3StmtColumnValue (hdl, iCol);
516 OT_retObj_SET_VAL(retVal);
517 goto end;
518 error:
520 end:
522}
523
524// doc-key: Sq3StmtC,Sq3StmtC-Column,om_
525
527static OT_ProcRet NS(Sq3StmtC_ColumnBlob) (Sq3StmtC_ARGS) {
530 MK_I32 iCol = 0;
533 MkBinaryR retVal = Sq3StmtColumnBlob (hdl, iCol);
535 goto end;
536 error:
538 end:
540}
541
543static OT_ProcRet NS(Sq3StmtC_ColumnBytes) (Sq3StmtC_ARGS) {
546 MK_I32 iCol = 0;
550 goto end;
551 error:
553 end:
555}
556
558static OT_ProcRet NS(Sq3StmtC_ColumnCount) (Sq3StmtC_ARGS) {
563 goto end;
564 error:
566 end:
568}
569
571static OT_ProcRet NS(Sq3StmtC_ColumnDouble) (Sq3StmtC_ARGS) {
574 MK_I32 iCol = 0;
578 goto end;
579 error:
581 end:
583}
584
586static OT_ProcRet NS(Sq3StmtC_ColumnInt) (Sq3StmtC_ARGS) {
589 MK_I32 iCol = 0;
593 goto end;
594 error:
596 end:
598}
599
601static OT_ProcRet NS(Sq3StmtC_ColumnInt64) (Sq3StmtC_ARGS) {
604 MK_I32 iCol = 0;
608 goto end;
609 error:
611 end:
613}
614
616static OT_ProcRet NS(Sq3StmtC_ColumnName) (Sq3StmtC_ARGS) {
619 MK_I32 N = 0;
623 goto end;
624 error:
626 end:
628}
629
631static OT_ProcRet NS(Sq3StmtC_ColumnText) (Sq3StmtC_ARGS) {
634 MK_I32 iCol = 0;
637 MkStringR retVal = Sq3StmtColumnText (hdl, iCol);
639 goto end;
640 error:
642 end:
644}
645
647static OT_ProcRet NS(Sq3StmtC_ColumnType) (Sq3StmtC_ARGS) {
650 MK_I32 iCol = 0;
654 goto end;
655 error:
657 end:
659}
660
662// Sq3StmtC_Column_TCL_API
663
667
668// doc-key: Sq3StmtC,Sq3StmtC-Info,oc_
669
671static OT_ProcRet NS(Sq3StmtC_DbHandle) (Sq3StmtC_ARGS) {
675 SQ3_LITE retVal = Sq3StmtDbHandle (hdl);
676 OT_retObj_SET_LITE(retVal);
677 goto end;
678 error:
680 end:
682}
683
684// doc-key: Sq3StmtC,Sq3StmtC-Info,om_
685
687static OT_ProcRet NS(Sq3StmtC_Busy) (Sq3StmtC_ARGS) {
691 MkErrorC_Check(hdl,Sq3StmtBusy (hdl));
693 goto end;
694 error:
696 end:
698}
699
701static OT_ProcRet NS(Sq3StmtC_DataCount) (Sq3StmtC_ARGS) {
707 goto end;
708 error:
710 end:
712}
713
715static OT_ProcRet NS(Sq3StmtC_IsExplain) (Sq3StmtC_ARGS) {
721 goto end;
722 error:
724 end:
726}
727
728// skip on class-overload: Sq3StmtLog → MkObjectLog
731
733static OT_ProcRet NS(Sq3StmtC_Readonly) (Sq3StmtC_ARGS) {
739 goto end;
740 error:
742 end:
744}
745
747static OT_ProcRet NS(Sq3StmtC_Status) (Sq3StmtC_ARGS) {
750 enum Sq3StmtStatusE op = 0;
752 MK_BOOL resetFlg = 0;
755 MkErrorC_Check(hdl,Sq3StmtStatus (hdl, op, resetFlg));
757 goto end;
758 error:
760 end:
762}
763
765// Sq3StmtC_Info_TCL_API
766
770
771// doc-key: Sq3StmtC,Sq3StmtC-Misc,sc_
772
774static OT_ProcRet NS(Sq3StmtC_NextStmt) (OtClass_ARGS) {
777 SQ3_LITE pDb = 0;
779 SQ3_STMT pStmt = NULL;
782 SQ3_STMT retVal = Sq3StmtNextStmt (pDb, pStmt);
783 OT_retObj_SET_STMT(retVal);
784 goto end;
785 error:
787 end:
789}
790
791// doc-key: Sq3StmtC,Sq3StmtC-Misc,om_
792
794static OT_ProcRet NS(Sq3StmtC_ClearBindings) (Sq3StmtC_ARGS) {
800 goto end;
801 error:
803 end:
805}
806
808static OT_ProcRet NS(Sq3StmtC_Explain) (Sq3StmtC_ARGS) {
811 MK_I32 eMode = 0;
814 MkErrorC_Check(hdl,Sq3StmtExplain (hdl, eMode));
816 goto end;
817 error:
819 end:
821}
822
824static OT_ProcRet NS(Sq3StmtC_Reset) (Sq3StmtC_ARGS) {
828 MkErrorC_Check(hdl,Sq3StmtReset (hdl));
830 goto end;
831 error:
833 end:
835}
836
837// doc-key: Sq3StmtC,Sq3StmtC-Misc,omo
838
840static OT_ProcRet NS(Sq3StmtC_Step) (Sq3StmtC_ARGS) {
844 enum Sq3ErrorE retCode;
845 MkErrorC_Check(hdl,Sq3StmtStep (hdl, &retCode));
846 OT_retObj_SET(OT_NEW_Sq3_enum_OBJ(ErrorE,retCode));
847 goto end;
848 error:
850 end:
852}
853
855// Sq3StmtC_Misc_TCL_API
856
860
861// doc-key: Sq3StmtC,Sq3StmtC-Sql,om_
862
864static OT_ProcRet NS(Sq3StmtC_ExpandedSql) (Sq3StmtC_ARGS) {
869 goto end;
870 error:
872 end:
874}
875
877static OT_ProcRet NS(Sq3StmtC_GetPzTail) (Sq3StmtC_ARGS) {
882 goto end;
883 error:
885 end:
887}
888
890static OT_ProcRet NS(Sq3StmtC_Sql) (Sq3StmtC_ARGS) {
895 goto end;
896 error:
898 end:
900}
901
903// Sq3StmtC_Sql_TCL_API
904
908
909// doc-key: Sq3StmtC,Sq3StmtC-TOR,sCo
910
912static OT_ProcRet NS(Sq3StmtC_CTOR) (CONSTR_ARGS) {
915 SQ3_LITE db = 0;
917 MkStringR zSql = {0};
919 SQ3_STMT ppStmt;
920 MkErrorC_Check(db,Sq3StmtPrepareV2 (db, zSql, &ppStmt));
921 OT_CONSTRUCTOR_POST(ppStmt)
922 OT_retObj_CONSTR(ppStmt);
923 goto end;
924 error:
926 end:
928}
929
931static OT_ProcRet NS(Sq3StmtC_PrepareV2) (OtClass_ARGS) {
934 SQ3_LITE db = 0;
936 MkStringR zSql = {0};
939 SQ3_STMT ppStmt;
940 MkErrorC_Check(db,Sq3StmtPrepareV2 (db, zSql, &ppStmt));
941 OT_CONSTRUCTOR_POST(ppStmt)
942 OT_retObj_SET_STMT(ppStmt);
943 goto end;
944 error:
946 end:
948}
949
951static OT_ProcRet NS(Sq3StmtC_PrepareV3) (OtClass_ARGS) {
954 SQ3_LITE db = 0;
956 MkStringR zSql = {0};
958 enum Sq3PrepareEF prepFlags = SQ3_PREPARE_NO;
961 SQ3_STMT ppStmt;
962 MkErrorC_Check(db,Sq3StmtPrepareV3 (db, zSql, prepFlags, &ppStmt));
963 OT_retObj_SET_STMT(ppStmt);
964 goto end;
965 error:
967 end:
969}
970
971// doc-key: Sq3StmtC,Sq3StmtC-TOR,om_
972
974static OT_ProcRet NS(Sq3StmtC_Finalize) (Sq3StmtC_ARGS) {
980 goto end;
981 error:
983 end:
985}
986
988// Sq3StmtC_TOR_TCL_API
989
990// END-Sq3StmtC - created by 'tcl_MqC.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
991
992// ---------------------------------------------------------------------------------------
993
994static Tcl_MethodType NS(sOtClassDef)[] = {
995// BEGIN-CLASS - created by 'tcl_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
996
997// doc-key: Sq3StmtC,Sq3Stmt,sCo
998 {VER, "PrepareV2" , NS(Sq3StmtC_PrepareV2) , NULL, NULL},
999 {VER, "PrepareV3" , NS(Sq3StmtC_PrepareV3) , NULL, NULL},
1000
1001// doc-key: Sq3StmtC,Sq3Stmt,sc_
1002 {VER, "GetNull" , NS(Sq3StmtC_GetNull) , NULL, NULL},
1003 {VER, "HandleResolve" , NS(Sq3StmtC_HandleResolve) , NULL, NULL},
1004 {VER, "Instances" , NS(Sq3StmtC_Instances) , NULL, NULL},
1005 {VER, "NextStmt" , NS(Sq3StmtC_NextStmt) , NULL, NULL},
1006
1007// END-CLASS - created by 'tcl_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
1008 {0, NULL, NULL, NULL}
1009};
1010
1011// ---------------------------------------------------------------------------------------
1012
1013static Tcl_MethodType NS(sInstanceDef)[] = {
1014// BEGIN-OBJ - created by 'tcl_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
1015
1016// doc-key: Sq3StmtC,Sq3Stmt,oC_
1017 {VER, "<constructor>" , NS(Sq3StmtC_CTOR) , NULL, NULL},
1018
1019// doc-key: Sq3StmtC,Sq3Stmt,oc_
1020 {VER, "ColumnValue" , NS(Sq3StmtC_ColumnValue) , NULL, NULL},
1021 {VER, "DbHandle" , NS(Sq3StmtC_DbHandle) , NULL, NULL},
1022 {VER, "Next" , NS(Sq3StmtC_Next) , NULL, NULL},
1023 {VER, "Prev" , NS(Sq3StmtC_Prev) , NULL, NULL},
1024
1025// doc-key: Sq3StmtC,Sq3Stmt,om_
1026 {VER, "BindBlob" , NS(Sq3StmtC_BindBlob) , NULL, NULL},
1027 {VER, "BindDouble" , NS(Sq3StmtC_BindDouble) , NULL, NULL},
1028 {VER, "BindInt" , NS(Sq3StmtC_BindInt) , NULL, NULL},
1029 {VER, "BindInt64" , NS(Sq3StmtC_BindInt64) , NULL, NULL},
1030 {VER, "BindNull" , NS(Sq3StmtC_BindNull) , NULL, NULL},
1031 {VER, "BindParameterCount" , NS(Sq3StmtC_BindParameterCount) , NULL, NULL},
1032 {VER, "BindParameterIndex" , NS(Sq3StmtC_BindParameterIndex) , NULL, NULL},
1033 {VER, "BindParameterName" , NS(Sq3StmtC_BindParameterName) , NULL, NULL},
1034 {VER, "BindText" , NS(Sq3StmtC_BindText) , NULL, NULL},
1035 {VER, "BindValue" , NS(Sq3StmtC_BindValue) , NULL, NULL},
1036 {VER, "BindZeroblob" , NS(Sq3StmtC_BindZeroblob) , NULL, NULL},
1037 {VER, "BindZeroblob64" , NS(Sq3StmtC_BindZeroblob64) , NULL, NULL},
1038 {VER, "Busy" , NS(Sq3StmtC_Busy) , NULL, NULL},
1039 {VER, "ClearBindings" , NS(Sq3StmtC_ClearBindings) , NULL, NULL},
1040 {VER, "ColumnBlob" , NS(Sq3StmtC_ColumnBlob) , NULL, NULL},
1041 {VER, "ColumnBytes" , NS(Sq3StmtC_ColumnBytes) , NULL, NULL},
1042 {VER, "ColumnCount" , NS(Sq3StmtC_ColumnCount) , NULL, NULL},
1043 {VER, "ColumnDouble" , NS(Sq3StmtC_ColumnDouble) , NULL, NULL},
1044 {VER, "ColumnInt" , NS(Sq3StmtC_ColumnInt) , NULL, NULL},
1045 {VER, "ColumnInt64" , NS(Sq3StmtC_ColumnInt64) , NULL, NULL},
1046 {VER, "ColumnName" , NS(Sq3StmtC_ColumnName) , NULL, NULL},
1047 {VER, "ColumnText" , NS(Sq3StmtC_ColumnText) , NULL, NULL},
1048 {VER, "ColumnType" , NS(Sq3StmtC_ColumnType) , NULL, NULL},
1049 {VER, "DataCount" , NS(Sq3StmtC_DataCount) , NULL, NULL},
1050 {VER, "ExpandedSql" , NS(Sq3StmtC_ExpandedSql) , NULL, NULL},
1051 {VER, "Explain" , NS(Sq3StmtC_Explain) , NULL, NULL},
1052 {VER, "Finalize" , NS(Sq3StmtC_Finalize) , NULL, NULL},
1053 {VER, "GetPzTail" , NS(Sq3StmtC_GetPzTail) , NULL, NULL},
1054 // skip class-overload: Sq3StmtHandleGet → HandleGet, NS(Sq3StmtC_HandleGet)
1055 {VER, "IsExplain" , NS(Sq3StmtC_IsExplain) , NULL, NULL},
1056 // skip class-overload: Sq3StmtLog → Log, NS(Sq3StmtC_Log)
1057 {VER, "Readonly" , NS(Sq3StmtC_Readonly) , NULL, NULL},
1058 {VER, "Reset" , NS(Sq3StmtC_Reset) , NULL, NULL},
1059 {VER, "Sql" , NS(Sq3StmtC_Sql) , NULL, NULL},
1060 {VER, "Status" , NS(Sq3StmtC_Status) , NULL, NULL},
1061
1062// doc-key: Sq3StmtC,Sq3Stmt,omo
1063 {VER, "Step" , NS(Sq3StmtC_Step) , NULL, NULL},
1064
1065// END-OBJ - created by 'tcl_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
1066 {0, NULL, NULL, NULL, NULL}
1067};
1068
1074
1075int NS(pSq3StmtC_Init) ( MK_RT_ARGS Tcl_Interp *interp, Tcl_Namespace *ns)
1076{
1077 ClassInit
1078
1079 return TCL_OK;
1080error:
1081 return TCL_ERROR;
1082}
#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)
tag: nhi1-release-250425
#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 …