theSq3Lite 10.0
Loading...
Searching...
No Matches
Sq3BlobC_tcl.c
Go to the documentation of this file.
1
9/* LABEL-START */
10
11#define META_FILE_NAME "Sq3BlobC_tcl.c"
12
14
15#define OT_CLASS NS(Sq3BlobC)
16#define OT_CLASS_NAME "Sq3BlobC"
17
18#define OBJECT2BLOB(O) MkAssertCastM(Sq3BlobC,(Tcl_ObjectGetMetadata(O, &MK(AtomMeta))))
19
20// TCL class
22
23// META class
25MkThreadLocal OT_OBJ_T SQ3(Sq3BlobC_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(Sq3BlobC_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(Sq3BlobC_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(Sq3BlobC_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 = Sq3BlobC##_TT;
58
59#define OT_SETUP_hdl SetupHdlFromMetaData_2(BLOB,SQ3_BLOB);
60#define OT_SETUP_hdl__null_allow SetupHdlFromMetaData__null_allow_2(BLOB,SQ3_BLOB);
61#define OT_SETUP_hdl_destr SetupHdlFromMetaData__null_allow_2(BLOB,SQ3_BLOB);
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_BLOB hdl = (SQ3_BLOB) &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 (Sq3BlobCTT == NULL) Sq3BlobCTT = Sq3BlobSTT; \
80 \
81 /* protect against double call */ \
82 if (Sq3BlobCTT->selfCreate == NS(Sq3BlobC_selfCreate)) return MK_OK; \
83 \
84 /* add "selfCreate" and "selfDelete" feature to the MQ-Class */ \
85 Sq3BlobCTT->selfCreate = NS(Sq3BlobC_selfCreate); \
86 Sq3BlobCTT->selfDelete = NS(Sq3BlobC_selfDelete); \
87 Sq3BlobCTT->selfUnlink = NS(Sq3BlobC_selfUnlink); \
88 \
89 /* create the TCL-class */ \
90 OT_SELF_T classO = MK(ClassDef)(interp,ns,Sq3BlobCTT); \
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(Sq3BlobC_MK_NULL) = Tcl_GetObjectName(interp, \
104 MK(AtomCreate) (MK_RT_CALL interp, NULL /*obj*/, OT_CLASS, "MK_NULL" /*name*/, "::tclsq3lite::Sq3BlobC" /*ns*/) \
105 ); \
106 Tcl_IncrRefCount(SQ3(Sq3BlobC_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: Sq3BlobC,Sq3Blob,sCo,func
115#define CTOR_doc "Sq3BlobC [Sq3BlobC CTOR sq3lite:Sq3LiteC zDb:string zTable:string zColumn:string iRow:int64 flags:int32]"
116#define Open_doc "Sq3BlobC [Sq3BlobC Open sq3lite:Sq3LiteC zDb:string zTable:string zColumn:string iRow:int64 flags:int32]"
117
118// doc-key: Sq3BlobC,Sq3Blob,sc_,func
119#define GetNull_doc "Sq3BlobC [Sq3BlobC GetNull]"
120#define HandleResolve_doc "Sq3BlobC [Sq3BlobC HandleResolve netHdl:MK_HDL]"
121#define Instances_doc "Sq3BlobC [Sq3BlobC Instances]"
122
123// doc-key: Sq3BlobC,Sq3Blob,oc_,func
124#define Next_doc "Sq3BlobC [$blob Next]"
125#define Prev_doc "Sq3BlobC [$blob Prev]"
126
127// doc-key: Sq3BlobC,Sq3Blob,oci,func
128#define Read_doc "MkBufferC [$sq3blob Read Z_inout:MkBufferC iOffset:int32]"
129
130// doc-key: Sq3BlobC,Sq3Blob,om_,func
131#define Bytes_doc "int32 [$sq3blob Bytes]"
132// skip class-overload: HandleGet → MkObjectHandleGet
133#define Reopen_doc "$sq3blob Reopen arg1:int64"
134#define Write_doc "$sq3blob Write z:MkBufferC iOffset:int32"
135
136// END-DOC - created by 'tcl_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
137
138/*****************************************************************************/
139/* */
140/* C O N / D E - S T R U C T O R */
141/* */
142/*****************************************************************************/
143
147
148/*****************************************************************************/
149/* */
150/* O B J E C T */
151/* */
152/*****************************************************************************/
153
154// BEGIN-Sq3BlobC - created by 'tcl_MqC.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
155
159
160// doc-key: Sq3BlobC,Sq3BlobC-Class-Export,sc_
161
163static OT_ProcRet NS(Sq3BlobC_HandleResolve) (OtClass_ARGS) {
166 MK_HDL netHdl = 0;
169 SQ3_BLOB retVal = Sq3BlobHandleResolve (netHdl);
170 OT_retObj_SET_BLOB(retVal);
171 goto end;
172 error:
174 end:
176}
177
178// doc-key: Sq3BlobC,Sq3BlobC-Class-Export,om_
179
180// skip on class-overload: Sq3BlobHandleGet → MkObjectHandleGet
182static OT_ProcRet NS(Sq3BlobC_HandleGet) (Sq3BlobC_ARGS) {OT_ERROR_LNG_RETURN;}
183
185// Sq3BlobC_Class_TCL_API
186
190
191// doc-key: Sq3BlobC,Sq3BlobC-Class-Introspection,oc_
192
194static OT_ProcRet NS(Sq3BlobC_Next) (Sq3BlobC_ARGS) {
198 SQ3_BLOB retVal = Sq3BlobNext (hdl);
199 OT_retObj_SET_BLOB(retVal);
200 goto end;
201 error:
203 end:
205}
206
208static OT_ProcRet NS(Sq3BlobC_Prev) (Sq3BlobC_ARGS) {
212 SQ3_BLOB retVal = Sq3BlobPrev (hdl);
213 OT_retObj_SET_BLOB(retVal);
214 goto end;
215 error:
217 end:
219}
220
221// doc-key: Sq3BlobC,Sq3BlobC-Class-Introspection,sc_
222
224static OT_ProcRet NS(Sq3BlobC_Instances) (OtClass_ARGS) {
228 SQ3_BLOB retVal = Sq3BlobInstances ();
229 OT_retObj_SET_BLOB(retVal);
230 goto end;
231 error:
233 end:
235}
236
238// Sq3BlobC_Class_TCL_API
239
243
244// doc-key: Sq3BlobC,Sq3BlobC-Class-Misc,sc_
245
247static OT_ProcRet NS(Sq3BlobC_GetNull) (OtClass_ARGS) {
251 SQ3_BLOB retVal = Sq3BlobGetNull ();
252 OT_retObj_SET_BLOB(retVal);
253 goto end;
254 error:
256 end:
258}
259
261// Sq3BlobC_Class_TCL_API
262
266
267// doc-key: Sq3BlobC,Sq3BlobC-Misc,oci
268
270static OT_ProcRet NS(Sq3BlobC_Read) (Sq3BlobC_ARGS) {
273 MK_BUF Z_inout = NULL;
275 MK_I32 iOffset = 0;
278 MkErrorC_Check(hdl,Sq3BlobRead (hdl, &Z_inout, iOffset));
279 OT_retObj_SET_BUF(Z_inout);
280 goto end;
281 error:
283 end:
285}
286
287// doc-key: Sq3BlobC,Sq3BlobC-Misc,om_
288
290static OT_ProcRet NS(Sq3BlobC_Bytes) (Sq3BlobC_ARGS) {
295 goto end;
296 error:
298 end:
300}
301
303static OT_ProcRet NS(Sq3BlobC_Reopen) (Sq3BlobC_ARGS) {
306 MK_I64 arg1 = 0;
309 MkErrorC_Check(hdl,Sq3BlobReopen (hdl, arg1));
311 goto end;
312 error:
314 end:
316}
317
319static OT_ProcRet NS(Sq3BlobC_Write) (Sq3BlobC_ARGS) {
322 MK_BUF z = 0;
324 MK_I32 iOffset = 0;
327 MkErrorC_Check(hdl,Sq3BlobWrite (hdl, z, iOffset));
329 goto end;
330 error:
332 end:
334}
335
337// Sq3BlobC_Misc_TCL_API
338
342
343// doc-key: Sq3BlobC,Sq3BlobC-TOR,sCo
344
346static OT_ProcRet NS(Sq3BlobC_CTOR) (CONSTR_ARGS) {
349 SQ3_LITE sq3lite = 0;
351 MK_STRN zDb = 0;
353 MK_STRN zTable = 0;
355 MK_STRN zColumn = 0;
357 MK_I64 iRow = 0;
359 MK_I32 flags = 0;
361 SQ3_BLOB ppBlob;
362 MkErrorC_Check(sq3lite,Sq3BlobOpen (sq3lite, zDb, zTable, zColumn, iRow, flags, &ppBlob));
363 OT_CONSTRUCTOR_POST(ppBlob)
364 OT_retObj_CONSTR(ppBlob);
365 goto end;
366 error:
368 end:
370}
371
373static OT_ProcRet NS(Sq3BlobC_Open) (OtClass_ARGS) {
376 SQ3_LITE sq3lite = 0;
378 MK_STRN zDb = 0;
380 MK_STRN zTable = 0;
382 MK_STRN zColumn = 0;
384 MK_I64 iRow = 0;
386 MK_I32 flags = 0;
389 SQ3_BLOB ppBlob;
390 MkErrorC_Check(sq3lite,Sq3BlobOpen (sq3lite, zDb, zTable, zColumn, iRow, flags, &ppBlob));
391 OT_CONSTRUCTOR_POST(ppBlob)
392 OT_retObj_SET_BLOB(ppBlob);
393 goto end;
394 error:
396 end:
398}
399
401// Sq3BlobC_TOR_TCL_API
402
403// END-Sq3BlobC - created by 'tcl_MqC.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
404
406
407// ---------------------------------------------------------------------------------------
408
409static Tcl_MethodType NS(sOtClassDef)[] = {
410// BEGIN-CLASS - created by 'tcl_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
411
412// doc-key: Sq3BlobC,Sq3Blob,sCo
413 {VER, "Open" , NS(Sq3BlobC_Open) , NULL, NULL},
414
415// doc-key: Sq3BlobC,Sq3Blob,sc_
416 {VER, "GetNull" , NS(Sq3BlobC_GetNull) , NULL, NULL},
417 {VER, "HandleResolve" , NS(Sq3BlobC_HandleResolve) , NULL, NULL},
418 {VER, "Instances" , NS(Sq3BlobC_Instances) , NULL, NULL},
419
420// END-CLASS - created by 'tcl_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
421 {0, NULL, NULL, NULL}
422};
423
424// ---------------------------------------------------------------------------------------
425
426static Tcl_MethodType NS(sInstanceDef)[] = {
427// BEGIN-OBJ - created by 'tcl_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
428
429// doc-key: Sq3BlobC,Sq3Blob,oC_
430 {VER, "<constructor>" , NS(Sq3BlobC_CTOR) , NULL, NULL},
431
432// doc-key: Sq3BlobC,Sq3Blob,oc_
433 {VER, "Next" , NS(Sq3BlobC_Next) , NULL, NULL},
434 {VER, "Prev" , NS(Sq3BlobC_Prev) , NULL, NULL},
435
436// doc-key: Sq3BlobC,Sq3Blob,oci
437 {VER, "Read" , NS(Sq3BlobC_Read) , NULL, NULL},
438
439// doc-key: Sq3BlobC,Sq3Blob,om_
440 {VER, "Bytes" , NS(Sq3BlobC_Bytes) , NULL, NULL},
441 // skip class-overload: Sq3BlobHandleGet → HandleGet, NS(Sq3BlobC_HandleGet)
442 {VER, "Reopen" , NS(Sq3BlobC_Reopen) , NULL, NULL},
443 {VER, "Write" , NS(Sq3BlobC_Write) , NULL, NULL},
444
445// END-OBJ - created by 'tcl_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
446 {0, NULL, NULL, NULL, NULL}
447};
448
454
455int NS(pSq3BlobC_Init) ( MK_RT_ARGS Tcl_Interp *interp, Tcl_Namespace *ns)
456{
458
459 return TCL_OK;
460error:
461 return TCL_ERROR;
462}
#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)
tag: nhi1-release-250425
#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 …