theSq3Lite 10.0
Loading...
Searching...
No Matches
Sq3BlobC_atl.c
Go to the documentation of this file.
1
9/* LABEL-START */
10
11#define META_FILE_NAME "Sq3BlobC_atl.c"
12
14
15#define OT_CLASS asq3rt->AtlSq3BlobC
16#define OT_NULL asq3rt->AtlSq3BlobC_MK_NULL
17#define OT_CLASS_NAME "Sq3BlobC"
18
19#define SELF2HDL(O) Sq3Blob(VAL2MNG(O))
20
21// LNG: class
22// -> moved to LibSq3Lite_atl.h → OT_SQ3_RT_S → AtlSq3LiteCTT;
23
24// META: ObjNew feature: called to return a new or an already existing ATL-SELF-Object
25// -> moved to LibSq3Lite_atl.h → Sq3LiteC_ObjNew
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 SETUP_asq3rt(env);
30 return AtomMake(obj,OT_CLASS,NULL,NULL,env);
31}
32
33// META: called if MkObj must be destroyed and if the SELF is still alive → goal: destroy the SELF
34static void NS(Sq3BlobC_selfDelete) (MK_RT_ARGS MK_PTR selfP, MK_PTR const env) {
35 OT_SELF_T selfO = selfP;
36 SETUP_asq3rt(env);
37 MK(AtomDeleteHard) (OT_MK_CALL selfO);
38}
39
40// META: called to destroy link from SELF to META
41static void NS(Sq3BlobC_selfUnlink) (MK_RT_ARGS MK_PTR selfP, MK_PTR const env) {
42 OT_SELF_T selfO = selfP;
43 SETUP_asq3rt(env);
44 return MK(AtomUnlink) (OT_MK_CALL selfO);
45}
46
47#define OT_SETUP_hdl SetupHdlFromMetaData_2(SQ3_BLOB)
48#define OT_SETUP_hdl__null_allow SetupHdlFromMetaData__null_allow_2(SQ3_BLOB)
49#define OT_SETUP_hdl_destr SetupHdlFromMetaData__null_allow_2(SQ3_BLOB)
50#define OT_SETUP_hdl_constr SetupHdlConstr(Sq3BlobC)
51#define OT_SETUP_hdl_static_constr OT_SETUP_hdl_static
52#define OT_SETUP_hdl_static SetupHdlStatic(Sq3BlobC)
53
54#define OT_retObj_CONSTR(x) OT_retObj_SET(AtomInit(OT_SELF,Sq3BlobC_X2obj(x),asq3rt))
55
56// initialize the ATL and META class specific object
57#define ClassInit \
58 /* if not already done, initialize NEW META type */ \
59 if (Sq3BlobCTT == NULL) Sq3BlobCTT = Sq3BlobSTT; \
60 \
61 /* protect against double call */ \
62 if (Sq3BlobCTT->selfCreate == NS(Sq3BlobC_selfCreate)) return MK_OK; \
63 \
64 /* add "selfCreate" and "selfDelete" feature to the META-Class */ \
65 Sq3BlobCTT->selfCreate = NS(Sq3BlobC_selfCreate); \
66 Sq3BlobCTT->selfDelete = NS(Sq3BlobC_selfDelete); \
67 Sq3BlobCTT->selfUnlink = NS(Sq3BlobC_selfUnlink); \
68 \
69 /* create the ATL-class */ \
70 OT_CLASS = AltClassDef(Sq3BlobCTT,&asq3rt->AtlSq3BlobC_NS); \
71 if (OT_CLASS == NULL) goto error; \
72 OT_REF_INCR(OT_CLASS); \
73 \
74 /* create the ATL static Methods */ \
75 check_LNG(AtlUnknownSetup (NS(sOtClassDef),asq3rt)) goto error; \
76 \
77 /* create the ATL instance Methods */ \
78 check_LNG(AtlUnknownSetup (NS(sInstanceDef),asq3rt)) goto error; \
79 \
80 /* after class was modified, recompile the class */ \
81 RL_init(2, recompile, RL_T(0,RecompileN)); RL_O(1,OT_CLASS) ; \
82 int retI = RL_EvalEx(0); \
83 if (retI != TCL_OK) return retI; \
84 \
85 /* define the "NULL" object */ \
86 OT_NULL = AtomCreateNULL(OT_CLASS, "::Sq3BlobC::MK_NULL", (MK_PTR)asq3rt); \
87 if (OT_NULL == NULL) goto error; \
88 OT_REF_INCR(OT_NULL);
89/* LABEL-END */
90
91// BEGIN-DOC - created by 'atl_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
92
93// doc-key: Sq3BlobC,Sq3Blob,sCo,func
94#define CTOR_doc "Sq3BlobC [Sq3BlobC::CTOR sq3lite:Sq3LiteC zDb:string zTable:string zColumn:string iRow:int64 flags:int32]"
95#define Open_doc "Sq3BlobC [Sq3BlobC::Open sq3lite:Sq3LiteC zDb:string zTable:string zColumn:string iRow:int64 flags:int32]"
96
97// doc-key: Sq3BlobC,Sq3Blob,sc_,func
98#define GetNull_doc "Sq3BlobC [Sq3BlobC::GetNull]"
99#define HandleResolve_doc "Sq3BlobC [Sq3BlobC::HandleResolve netHdl:MK_HDL]"
100#define Instances_doc "Sq3BlobC [Sq3BlobC::Instances]"
101
102// doc-key: Sq3BlobC,Sq3Blob,oc_,func
103#define Next_doc "Sq3BlobC [Sq3BlobC::Next $blob]"
104#define Prev_doc "Sq3BlobC [Sq3BlobC::Prev $blob]"
105
106// doc-key: Sq3BlobC,Sq3Blob,oci,func
107#define Read_doc "MkBufferC [Sq3BlobC::Read $sq3blob Z_inout:MkBufferC iOffset:int32]"
108
109// doc-key: Sq3BlobC,Sq3Blob,om_,func
110#define Bytes_doc "int32 [Sq3BlobC::Bytes $sq3blob]"
111// skip class-overload: HandleGet → MkObjectHandleGet
112#define Reopen_doc "Sq3BlobC::Reopen $sq3blob arg1:int64"
113#define Write_doc "Sq3BlobC::Write $sq3blob z:MkBufferC iOffset:int32"
114
115// END-DOC - created by 'atl_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
116
117/*****************************************************************************/
118/* */
119/* C O N / D E - S T R U C T O R */
120/* */
121/*****************************************************************************/
122
126
127/*****************************************************************************/
128/* */
129/* O B J E C T */
130/* */
131/*****************************************************************************/
132
133// BEGIN-Sq3BlobC - created by 'atl_MqC.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
134
138
139// doc-key: Sq3BlobC,Sq3BlobC-Class-Export,sc_
140
142static OT_ProcRet NS(Sq3BlobC_HandleResolve) (OtClass_ARGS) {
145 MK_HDL netHdl = 0;
148 SQ3_BLOB retVal = Sq3BlobHandleResolve (netHdl);
149 OT_retObj_SET_BLOB(retVal);
150 goto end;
151 error:
153 end:
155}
156
157// doc-key: Sq3BlobC,Sq3BlobC-Class-Export,om_
158
159// skip on class-overload: Sq3BlobHandleGet → MkObjectHandleGet
161static OT_ProcRet NS(Sq3BlobC_HandleGet) (Sq3BlobC_ARGS) {OT_ERROR_LNG_RETURN;}
162
164// Sq3BlobC_Class_ATL_API
165
169
170// doc-key: Sq3BlobC,Sq3BlobC-Class-Introspection,oc_
171
173static OT_ProcRet NS(Sq3BlobC_Next) (Sq3BlobC_ARGS) {
177 SQ3_BLOB retVal = Sq3BlobNext (hdl);
178 OT_retObj_SET_BLOB(retVal);
179 goto end;
180 error:
182 end:
184}
185
187static OT_ProcRet NS(Sq3BlobC_Prev) (Sq3BlobC_ARGS) {
191 SQ3_BLOB retVal = Sq3BlobPrev (hdl);
192 OT_retObj_SET_BLOB(retVal);
193 goto end;
194 error:
196 end:
198}
199
200// doc-key: Sq3BlobC,Sq3BlobC-Class-Introspection,sc_
201
203static OT_ProcRet NS(Sq3BlobC_Instances) (OtClass_ARGS) {
207 SQ3_BLOB retVal = Sq3BlobInstances ();
208 OT_retObj_SET_BLOB(retVal);
209 goto end;
210 error:
212 end:
214}
215
217// Sq3BlobC_Class_ATL_API
218
222
223// doc-key: Sq3BlobC,Sq3BlobC-Class-Misc,sc_
224
226static OT_ProcRet NS(Sq3BlobC_GetNull) (OtClass_ARGS) {
230 SQ3_BLOB retVal = Sq3BlobGetNull ();
231 OT_retObj_SET_BLOB(retVal);
232 goto end;
233 error:
235 end:
237}
238
240// Sq3BlobC_Class_ATL_API
241
245
246// doc-key: Sq3BlobC,Sq3BlobC-Misc,oci
247
249static OT_ProcRet NS(Sq3BlobC_Read) (Sq3BlobC_ARGS) {
252 MK_BUF Z_inout = NULL;
254 MK_I32 iOffset = 0;
257 MkErrorC_Check(hdl,Sq3BlobRead (hdl, &Z_inout, iOffset));
258 OT_retObj_SET_BUF(Z_inout);
259 goto end;
260 error:
262 end:
264}
265
266// doc-key: Sq3BlobC,Sq3BlobC-Misc,om_
267
269static OT_ProcRet NS(Sq3BlobC_Bytes) (Sq3BlobC_ARGS) {
274 goto end;
275 error:
277 end:
279}
280
282static OT_ProcRet NS(Sq3BlobC_Reopen) (Sq3BlobC_ARGS) {
285 MK_I64 arg1 = 0;
288 MkErrorC_Check(hdl,Sq3BlobReopen (hdl, arg1));
290 goto end;
291 error:
293 end:
295}
296
298static OT_ProcRet NS(Sq3BlobC_Write) (Sq3BlobC_ARGS) {
301 MK_BUF z = 0;
303 MK_I32 iOffset = 0;
306 MkErrorC_Check(hdl,Sq3BlobWrite (hdl, z, iOffset));
308 goto end;
309 error:
311 end:
313}
314
316// Sq3BlobC_Misc_ATL_API
317
321
322// doc-key: Sq3BlobC,Sq3BlobC-TOR,sCo
323
325static OT_ProcRet NS(Sq3BlobC_CTOR) (CONSTR_ARGS) {
328 SQ3_LITE sq3lite = 0;
330 MK_STRN zDb = 0;
332 MK_STRN zTable = 0;
334 MK_STRN zColumn = 0;
336 MK_I64 iRow = 0;
338 MK_I32 flags = 0;
340 SQ3_BLOB ppBlob;
341 MkErrorC_Check(sq3lite,Sq3BlobOpen (sq3lite, zDb, zTable, zColumn, iRow, flags, &ppBlob));
342 OT_CONSTRUCTOR_POST(ppBlob)
343 OT_retObj_CONSTR(ppBlob);
344 goto end;
345 error:
347 end:
349}
350
352static OT_ProcRet NS(Sq3BlobC_Open) (OtClass_ARGS) {
355 SQ3_LITE sq3lite = 0;
357 MK_STRN zDb = 0;
359 MK_STRN zTable = 0;
361 MK_STRN zColumn = 0;
363 MK_I64 iRow = 0;
365 MK_I32 flags = 0;
368 SQ3_BLOB ppBlob;
369 MkErrorC_Check(sq3lite,Sq3BlobOpen (sq3lite, zDb, zTable, zColumn, iRow, flags, &ppBlob));
370 OT_CONSTRUCTOR_POST(ppBlob)
371 OT_retObj_SET_BLOB(ppBlob);
372 goto end;
373 error:
375 end:
377}
378
380// Sq3BlobC_TOR_ATL_API
381
382// END-Sq3BlobC - created by 'atl_MqC.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
383
385
386// ---------------------------------------------------------------------------------------
387
388static const OtObjProcDefS NS(sOtClassDef)[] = {
389 // BEGIN-CLASS - created by 'atl_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
390
391 // doc-key: Sq3BlobC,Sq3Blob,sCo
392 { "::Sq3BlobC::Open" , NS(Sq3BlobC_Open) },
393
394 // doc-key: Sq3BlobC,Sq3Blob,sc_
395 { "::Sq3BlobC::GetNull" , NS(Sq3BlobC_GetNull) },
396 { "::Sq3BlobC::HandleResolve" , NS(Sq3BlobC_HandleResolve) },
397 { "::Sq3BlobC::Instances" , NS(Sq3BlobC_Instances) },
398
399 // END-CLASS - created by 'atl_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
400 { NULL }
401};
402
403// ---------------------------------------------------------------------------------------
404
405static const OtObjProcDefS NS(sInstanceDef)[] = {
406 // BEGIN-OBJ - created by 'atl_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
407
408 // doc-key: Sq3BlobC,Sq3Blob,oC_
409 { "::Sq3BlobC::Sq3BlobC" , NS(Sq3BlobC_CTOR) },
410
411 // doc-key: Sq3BlobC,Sq3Blob,oc_
412 { "::Sq3BlobC::Next" , NS(Sq3BlobC_Next) },
413 { "::Sq3BlobC::Prev" , NS(Sq3BlobC_Prev) },
414
415 // doc-key: Sq3BlobC,Sq3Blob,oci
416 { "::Sq3BlobC::Read" , NS(Sq3BlobC_Read) },
417
418 // doc-key: Sq3BlobC,Sq3Blob,om_
419 { "::Sq3BlobC::Bytes" , NS(Sq3BlobC_Bytes) },
420 // skip class-overload: HandleGet → MkObjectHandleGet
421 { "::Sq3BlobC::Reopen" , NS(Sq3BlobC_Reopen) },
422 { "::Sq3BlobC::Write" , NS(Sq3BlobC_Write) },
423
424 // END-OBJ - created by 'atl_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
425 { NULL }
426};
427
433
434int NS(pSq3BlobC_Init) ( OT_SQ3_ARGS OT_NS_T ns )
435{
437
438 return TCL_OK;
439error:
440 return TCL_ERROR;
441}
#define MK(n)
#define AtomMake(...)
#define OT_SETUP_VARARGS(min, max, d)
#define OT_CHECK_NIH(val)
#define OT_SETUP_NOARG(d)
#define OT_SETUP_ONEARG(d)
#define OT_ERROR_LNG_RETURN
#define OT_CHECK_NI4(val)
#define OT_CHECK_NI8(val)
MOX_NS_T OT_NS_T
#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)
MOX_OBJ_T OT_SELF_T
#define OT_SETUP_CONSTRUCTOR_ARGS(...)
#define OT_retObj_RETURN
#define OT_MK_CALL
#define OT_CHECK_OPTIONAL(val)
#define OT_CHECK_NOARGS
#define MkErrorC_Check(mng, PROC)
#define OT_ProcRet
#define CONSTR_ARGS
#define OT_CHECK_STRN(val)
#define OtClass_ARGS
#define OT_SQ3_ARGS
#define OT_retObj_SET_BLOB(nat)
#define Sq3BlobC_ARGS
#define NS(n)
#define SETUP_asq3rt(r)
tag: nhi1-release-250425
#define Instances_doc
#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 OT_CLASS
#define OT_SETUP_hdl_static
#define OT_SETUP_hdl_constr
#define OT_retObj_CONSTR(x)
#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 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 …