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
Sq3BlobC_tcl.c
Go to the documentation of this file.
1
12/* LABEL-START */
13
14#define META_FILE_NAME "Sq3BlobC_tcl.c"
15
17
18#define OT_CLASS NS(Sq3BlobC)
19#define OT_CLASS_NAME "Sq3BlobC"
20
21#define OBJECT2BLOB(O) MkAssertCastM(Sq3BlobC,(Tcl_ObjectGetMetadata(O, &MK(AtomMeta))))
22
23// TCL class
25
26// META class
28MkThreadLocal OT_OBJ_T SQ3(Sq3BlobC_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(Sq3BlobC_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(Sq3BlobC_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(Sq3BlobC_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 = Sq3BlobC##_TT;
61
62#define OT_SETUP_hdl SetupHdlFromMetaData_2(BLOB,SQ3_BLOB);
63#define OT_SETUP_hdl__null_allow SetupHdlFromMetaData__null_allow_2(BLOB,SQ3_BLOB);
64#define OT_SETUP_hdl_destr SetupHdlFromMetaData__null_allow_2(BLOB,SQ3_BLOB);
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_BLOB hdl = (SQ3_BLOB) &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 (Sq3BlobCTT == NULL) Sq3BlobCTT = Sq3BlobSTT; \
83 \
84 /* protect against double call */ \
85 if (Sq3BlobCTT->selfCreate == NS(Sq3BlobC_selfCreate)) return MK_OK; \
86 \
87 /* add "selfCreate" and "selfDelete" feature to the MQ-Class */ \
88 Sq3BlobCTT->selfCreate = NS(Sq3BlobC_selfCreate); \
89 Sq3BlobCTT->selfDelete = NS(Sq3BlobC_selfDelete); \
90 Sq3BlobCTT->selfUnlink = NS(Sq3BlobC_selfUnlink); \
91 \
92 /* create the TCL-class */ \
93 OT_SELF_T classO = MK(ClassDef)(interp,ns,Sq3BlobCTT); \
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(Sq3BlobC_MK_NULL) = Tcl_GetObjectName(interp, \
107 MK(AtomCreate) (MK_RT_CALL interp, NULL /*obj*/, OT_CLASS, "MK_NULL" /*name*/, "::tclsq3lite::Sq3BlobC" /*ns*/) \
108 ); \
109 Tcl_IncrRefCount(SQ3(Sq3BlobC_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: Sq3BlobC,Sq3Blob,sCo,func
118#define CTOR_doc "Sq3BlobC [Sq3BlobC CTOR sq3lite:Sq3LiteC zDb:string zTable:string zColumn:string iRow:int64 flags:int32]"
119#define Open_doc "Sq3BlobC [Sq3BlobC Open sq3lite:Sq3LiteC zDb:string zTable:string zColumn:string iRow:int64 flags:int32]"
120
121// doc-key: Sq3BlobC,Sq3Blob,sc_,func
122#define GetNull_doc "Sq3BlobC [Sq3BlobC GetNull]"
123#define HandleResolve_doc "Sq3BlobC [Sq3BlobC HandleResolve netHdl:MK_HDL]"
124#define Instances_doc "Sq3BlobC [Sq3BlobC Instances]"
125
126// doc-key: Sq3BlobC,Sq3Blob,oc_,func
127#define Next_doc "Sq3BlobC [$blob Next]"
128#define Prev_doc "Sq3BlobC [$blob Prev]"
129
130// doc-key: Sq3BlobC,Sq3Blob,oci,func
131#define Read_doc "MkBufferC [$sq3blob Read Z_inout:MkBufferC iOffset:int32]"
132
133// doc-key: Sq3BlobC,Sq3Blob,om_,func
134#define Bytes_doc "int32 [$sq3blob Bytes]"
135// skip class-overload: HandleGet → MkObjectHandleGet
136#define Reopen_doc "$sq3blob Reopen arg1:int64"
137#define Write_doc "$sq3blob Write z:MkBufferC iOffset:int32"
138
139// END-DOC - created by 'tcl_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
140
141/*****************************************************************************/
142/* */
143/* C O N / D E - S T R U C T O R */
144/* */
145/*****************************************************************************/
146
150
151/*****************************************************************************/
152/* */
153/* O B J E C T */
154/* */
155/*****************************************************************************/
156
157// BEGIN-Sq3BlobC - created by 'tcl_MqC.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
158
162
163// doc-key: Sq3BlobC,Sq3BlobC-Class-Export,sc_
164
166static OT_ProcRet NS(Sq3BlobC_HandleResolve) (OtClass_ARGS) {
169 MK_HDL netHdl = 0;
172 SQ3_BLOB retVal = Sq3BlobHandleResolve (netHdl);
173 OT_retObj_SET_BLOB(retVal);
174 goto end;
175 error:
177 end:
179}
180
181// doc-key: Sq3BlobC,Sq3BlobC-Class-Export,om_
182
183// skip on class-overload: Sq3BlobHandleGet → MkObjectHandleGet
185static OT_ProcRet NS(Sq3BlobC_HandleGet) (Sq3BlobC_ARGS) {OT_ERROR_LNG_RETURN;}
186
188// Sq3BlobC_Class_TCL_API
189
193
194// doc-key: Sq3BlobC,Sq3BlobC-Class-Introspection,oc_
195
197static OT_ProcRet NS(Sq3BlobC_Next) (Sq3BlobC_ARGS) {
201 SQ3_BLOB retVal = Sq3BlobNext (hdl);
202 OT_retObj_SET_BLOB(retVal);
203 goto end;
204 error:
206 end:
208}
209
211static OT_ProcRet NS(Sq3BlobC_Prev) (Sq3BlobC_ARGS) {
215 SQ3_BLOB retVal = Sq3BlobPrev (hdl);
216 OT_retObj_SET_BLOB(retVal);
217 goto end;
218 error:
220 end:
222}
223
224// doc-key: Sq3BlobC,Sq3BlobC-Class-Introspection,sc_
225
227static OT_ProcRet NS(Sq3BlobC_Instances) (OtClass_ARGS) {
231 SQ3_BLOB retVal = Sq3BlobInstances ();
232 OT_retObj_SET_BLOB(retVal);
233 goto end;
234 error:
236 end:
238}
239
241// Sq3BlobC_Class_TCL_API
242
246
247// doc-key: Sq3BlobC,Sq3BlobC-Class-Misc,sc_
248
250static OT_ProcRet NS(Sq3BlobC_GetNull) (OtClass_ARGS) {
254 SQ3_BLOB retVal = Sq3BlobGetNull ();
255 OT_retObj_SET_BLOB(retVal);
256 goto end;
257 error:
259 end:
261}
262
264// Sq3BlobC_Class_TCL_API
265
269
270// doc-key: Sq3BlobC,Sq3BlobC-Misc,oci
271
273static OT_ProcRet NS(Sq3BlobC_Read) (Sq3BlobC_ARGS) {
276 MK_BUF Z_inout = NULL;
278 MK_I32 iOffset = 0;
281 MkErrorC_Check(hdl,Sq3BlobRead (hdl, &Z_inout, iOffset));
282 OT_retObj_SET_BUF(Z_inout);
283 goto end;
284 error:
286 end:
288}
289
290// doc-key: Sq3BlobC,Sq3BlobC-Misc,om_
291
293static OT_ProcRet NS(Sq3BlobC_Bytes) (Sq3BlobC_ARGS) {
298 goto end;
299 error:
301 end:
303}
304
306static OT_ProcRet NS(Sq3BlobC_Reopen) (Sq3BlobC_ARGS) {
309 MK_I64 arg1 = 0;
312 MkErrorC_Check(hdl,Sq3BlobReopen (hdl, arg1));
314 goto end;
315 error:
317 end:
319}
320
322static OT_ProcRet NS(Sq3BlobC_Write) (Sq3BlobC_ARGS) {
325 MK_BUF z = 0;
327 MK_I32 iOffset = 0;
330 MkErrorC_Check(hdl,Sq3BlobWrite (hdl, z, iOffset));
332 goto end;
333 error:
335 end:
337}
338
340// Sq3BlobC_Misc_TCL_API
341
345
346// doc-key: Sq3BlobC,Sq3BlobC-TOR,sCo
347
349static OT_ProcRet NS(Sq3BlobC_CTOR) (CONSTR_ARGS) {
352 SQ3_LITE sq3lite = 0;
354 MK_STRN zDb = 0;
356 MK_STRN zTable = 0;
358 MK_STRN zColumn = 0;
360 MK_I64 iRow = 0;
362 MK_I32 flags = 0;
364 SQ3_BLOB ppBlob;
365 MkErrorC_Check(sq3lite,Sq3BlobOpen (sq3lite, zDb, zTable, zColumn, iRow, flags, &ppBlob));
366 OT_CONSTRUCTOR_POST(ppBlob)
367 OT_retObj_CONSTR(ppBlob);
368 goto end;
369 error:
371 end:
373}
374
376static OT_ProcRet NS(Sq3BlobC_Open) (OtClass_ARGS) {
379 SQ3_LITE sq3lite = 0;
381 MK_STRN zDb = 0;
383 MK_STRN zTable = 0;
385 MK_STRN zColumn = 0;
387 MK_I64 iRow = 0;
389 MK_I32 flags = 0;
392 SQ3_BLOB ppBlob;
393 MkErrorC_Check(sq3lite,Sq3BlobOpen (sq3lite, zDb, zTable, zColumn, iRow, flags, &ppBlob));
394 OT_CONSTRUCTOR_POST(ppBlob)
395 OT_retObj_SET_BLOB(ppBlob);
396 goto end;
397 error:
399 end:
401}
402
404// Sq3BlobC_TOR_TCL_API
405
406// END-Sq3BlobC - created by 'tcl_MqC.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
407
409
410// ---------------------------------------------------------------------------------------
411
412static Tcl_MethodType NS(sOtClassDef)[] = {
413// BEGIN-CLASS - created by 'tcl_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
414
415// doc-key: Sq3BlobC,Sq3Blob,sCo
416 {VER, "Open" , NS(Sq3BlobC_Open) , NULL, NULL},
417
418// doc-key: Sq3BlobC,Sq3Blob,sc_
419 {VER, "GetNull" , NS(Sq3BlobC_GetNull) , NULL, NULL},
420 {VER, "HandleResolve" , NS(Sq3BlobC_HandleResolve) , NULL, NULL},
421 {VER, "Instances" , NS(Sq3BlobC_Instances) , NULL, NULL},
422
423// END-CLASS - created by 'tcl_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
424 {0, NULL, NULL, NULL}
425};
426
427// ---------------------------------------------------------------------------------------
428
429static Tcl_MethodType NS(sInstanceDef)[] = {
430// BEGIN-OBJ - created by 'tcl_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
431
432// doc-key: Sq3BlobC,Sq3Blob,oC_
433 {VER, "<constructor>" , NS(Sq3BlobC_CTOR) , NULL, NULL},
434
435// doc-key: Sq3BlobC,Sq3Blob,oc_
436 {VER, "Next" , NS(Sq3BlobC_Next) , NULL, NULL},
437 {VER, "Prev" , NS(Sq3BlobC_Prev) , NULL, NULL},
438
439// doc-key: Sq3BlobC,Sq3Blob,oci
440 {VER, "Read" , NS(Sq3BlobC_Read) , NULL, NULL},
441
442// doc-key: Sq3BlobC,Sq3Blob,om_
443 {VER, "Bytes" , NS(Sq3BlobC_Bytes) , NULL, NULL},
444 // skip class-overload: Sq3BlobHandleGet → HandleGet, NS(Sq3BlobC_HandleGet)
445 {VER, "Reopen" , NS(Sq3BlobC_Reopen) , NULL, NULL},
446 {VER, "Write" , NS(Sq3BlobC_Write) , NULL, NULL},
447
448// END-OBJ - created by 'tcl_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
449 {0, NULL, NULL, NULL, NULL}
450};
451
457
458int NS(pSq3BlobC_Init) ( MK_RT_ARGS Tcl_Interp *interp, Tcl_Namespace *ns)
459{
461
462 return TCL_OK;
463error:
464 return TCL_ERROR;
465}
#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_CONSTRUCTOR_POST(x)
#define OT_retObj_SET_BUF(nat)
#define OT_CHECK_REQUIRED(val)
#define OT_retObj_SET_None
#define OT_retObj_SET_I32(nat)
#define OT_SETUP_CONSTRUCTOR_ARGS(...)
#define OT_retObj_RETURN
Tcl_Object OT_SELF_T
#define OT_CHECK_OPTIONAL(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 OT_retObj_SET_BLOB(nat)
#define Sq3BlobC_ARGS
#define NS(n)
#define Instances_doc
static __thread MK_TYP Sq3BlobCTT
#define OT_SETUP_hdl_static_constr
#define Write_doc
#define OT_SETUP_hdl
#define Read_doc
#define GetNull_doc
#define Next_doc
#define HandleResolve_doc
#define Prev_doc
#define VER
#define OT_CLASS
#define OT_SETUP_hdl_static
#define OT_SETUP_hdl_constr
#define CTOR_doc
#define Reopen_doc
#define ClassInit
#define Bytes_doc
#define Open_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
int32_t MK_HDL
signed int MK_I32
#define MkThreadLocal
#define MK_RT_CALL
#define MK_RT_ARGS
#define Sq3BlobHandleResolve(...)
static SQ3_BLOB Sq3BlobPrev(SQ3_BLOB const blob)
get previous instance from linked-list of Sq3BlobS type
#define Sq3BlobInstances()
static SQ3_BLOB Sq3BlobNext(SQ3_BLOB const blob)
get next instance from linked-list of Sq3BlobS type
static SQ3_BLOB Sq3BlobGetNull(void)
Null-Slot - return a Sq3BlobC typed NULL instance …
static MK_I32 Sq3BlobBytes(SQ3_BLOB sq3blob)
Return The Size Of An Open BLOB …
#define Sq3BlobWrite(...)
#define Sq3BlobRead(...)
static enum MkErrorE Sq3BlobReopen(SQ3_BLOB sq3blob, MK_I64 arg1)
Move a BLOB Handle to a New Row …
static enum MkErrorE Sq3BlobOpen(SQ3_LITE sq3lite, MK_STRN zDb, MK_STRN zTable, MK_STRN zColumn, MK_I64 iRow, MK_I32 flags, SQ3_BLOB *ppBlob)
Open A BLOB For Incremental I/O …
#define OT_CHECK_BUF(val, nullB)
#define OT_CHECK_LITE(val, nullB)
Struct to represent the data of the Sq3BlobC …
Struct to represent the data of the Sq3LiteC …