theSq3Lite 10.0
Loading...
Searching...
No Matches
Sq3BlobC_py.c
Go to the documentation of this file.
1
9/* LABEL-START */
10
11#define META_FILE_NAME "Sq3BlobC_py.c"
12
14
15// PY class
16#define OT_CLASS (&NS(Sq3BlobCR))
17#define OT_CLASS_NAME "Sq3BlobC"
18
19#define OT_LNG2META(O) Sq3Blob(VAL2MNG(O))
20
21#define OT_retObj_CONSTR(mng) OT_retObj_SET(NS(Sq3BlobC_CTOR)(MK_RT_CALL (PyTypeObject*)class,mng))
22
23#define OT_SETUP_hdl OT_SETUP_hdl_tmpl(Sq3BlobC)
24#define OT_SETUP_hdl__null_allow OT_SETUP_hdl_tmpl__null_allow(Sq3BlobC)
25#define OT_SETUP_hdl_constr MK_RT_UNUSED AllRtSetup_NULL; \
26 SQ3_BLOB hdl = (SQ3_BLOB) OT_CLASS;
27#define OT_SETUP_hdl_destr OT_SETUP_hdl_tmpl__null_allow(Sq3BlobC)
28#define OT_SETUP_hdl_static MK_RT_UNUSED AllRtSetup_NULL; \
29 __attribute__((unused)) MK_TYP hdl = Sq3BlobC##_TT;
30
31#define OT_SETUP_hdl_static_constr OT_SETUP_hdl_static
32
33#if !defined(SetupRtFromObj_X)
34 #define SetupRtFromObj_X(hdl) AllRtSetup_X(hdl)
35 #define SetupRtFromObj_XN(hdl) AllRtSetup_XN(hdl)
36#endif
37
38// MO class
39#undef Sq3BlobCTT
40#define Sq3BlobCTT SQ3(Sq3LiteThreadState).Sq3BlobCTT
41/* Sq3BlobC_MK_NULL defined in LibSq3Lite_py.h */
42
43__attribute__((unused)) mk_inline
44OT_OBJ_T NS(Sq3BlobC_CTOR) (MK_RT_ARGS OT_CLS_T type, SQ3_BLOB hdl) {
45 return MK(AtomCreate)(MK_RT_CALL type,Sq3BlobC_X2obj(hdl));
46}
47
48// helper: mk_dbg_color_ln(MK_COLOR_YELLOW,"hdl<%p>, self<%p>", obj, self);
49
50// META: ObjNew feature: selfCreate will be called from "ObjNew->MkSelfNew" if MkObj need a SELF pointer
51static MK_PTR NS(Sq3BlobC_selfCreate) (MK_RT_ARGS MK_OBJ const obj, MK_PTR const env) {
52 return MK(AtomCreate) (MK_RT_CALL OT_CLASS,obj);
53}
54// META: called if MkObj must be destroyed and if the SELF is still alive → goal: destroy the SELF
55static void NS(Sq3BlobC_selfDelete) (MK_RT_ARGS MK_PTR self, MK_PTR const env) {
56 MK(AtomDeleteHard) (MK_RT_CALL OT_SELF);
57}
58// META: called to destroy link from SELF to META
59static void NS(Sq3BlobC_selfUnlink) (MK_RT_ARGS MK_PTR self, MK_PTR const env) {
60 MkObjectC_Obj *selfO = (MkObjectC_Obj*) self;
61 selfO->hdl = NULL;
62}
63
64// initialize the PY and MO class specific object
65#define ClassInit \
66 /* if not already done, initialize NEW META type */ \
67 if (Sq3BlobCTT == NULL) Sq3BlobCTT = Sq3BlobSTT; \
68 \
69 /* protect against double call */ \
70 if (Sq3BlobCTT->selfCreate == NS(Sq3BlobC_selfCreate)) return MK_OK; \
71 \
72 /* add "selfCreate" and "selfDelete" feature to the META-Class */ \
73 Sq3BlobCTT->selfCreate = NS(Sq3BlobC_selfCreate); \
74 Sq3BlobCTT->selfDelete = NS(Sq3BlobC_selfDelete); \
75 Sq3BlobCTT->selfUnlink = NS(Sq3BlobC_selfUnlink); \
76 \
77 if (!PyType_HasFeature(OT_CLASS,Py_TPFLAGS_READY)) { \
78 NS(Sq3BlobCR).tp_base = Sq3BlobC_base; \
79 OtErrorCheckLng (PyType_Ready(OT_CLASS)); \
80 } \
81 OtErrorCheckLng(PyModule_AddObjectRef(m, "Sq3BlobC", (PyObject *)OT_CLASS)); \
82 \
83 /* define the "NULL" object */ \
84 Sq3BlobC_MK_NULL = Py_NewRef(MK(AtomCreate) (MK_RT_CALL OT_CLASS, NULL /*obj*/));
85
86/* LABEL-END */
87
88#define META_CONTEXT_S MK_ERROR_DEFAULT
89
90// MARK_D
96
97// BEGIN-DOC - created by 'py_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
98
99// doc-key: Sq3BlobC,Sq3Blob,sCo,func
100#define Open_doc "Sq3BlobC Sq3BlobC.Open(sq3lite:Sq3LiteC, zDb:string, zTable:string, zColumn:string, iRow:int64, flags:int32)"
101#define new_doc "Sq3BlobC Sq3BlobC.new(sq3lite:Sq3LiteC, zDb:string, zTable:string, zColumn:string, iRow:int64, flags:int32)"
102
103// doc-key: Sq3BlobC,Sq3Blob,sc_,func
104#define GetNull_doc "Sq3BlobC Sq3BlobC.GetNull()"
105#define HandleResolve_doc "Sq3BlobC Sq3BlobC.HandleResolve(netHdl:MK_HDL)"
106#define Instances_doc "Sq3BlobC Sq3BlobC.Instances()"
107
108// doc-key: Sq3BlobC,Sq3Blob,oc_,func
109#define Next_doc "Sq3BlobC blob.Next()"
110#define Prev_doc "Sq3BlobC blob.Prev()"
111
112// doc-key: Sq3BlobC,Sq3Blob,oci,func
113#define Read_doc "MkBufferC sq3blob.Read(Z_inout:MkBufferC, iOffset:int32)"
114
115// doc-key: Sq3BlobC,Sq3Blob,om_,func
116#define Bytes_doc "int32 sq3blob.Bytes()"
117// skip class-overload: HandleGet → MkObjectHandleGet
118#define Reopen_doc "sq3blob.Reopen(arg1:int64)"
119#define Write_doc "sq3blob.Write(z:MkBufferC, iOffset:int32)"
120
121// END-DOC - created by 'py_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
122
123// MARK_M
129
130// BEGIN-Sq3BlobC - created by 'py_MqC.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
131
135
136// doc-key: Sq3BlobC,Sq3BlobC-Class-Export,sc_
137
139static OT_ProcRet NS(Sq3BlobC_HandleResolve) (OtClass_ARGS) {
142 MK_HDL netHdl = 0;
145 SQ3_BLOB retVal = Sq3BlobHandleResolve (netHdl);
146 OT_retObj_SET_BLOB(retVal);
147 goto end;
148 error:
150 end:
152}
153
154// doc-key: Sq3BlobC,Sq3BlobC-Class-Export,om_
155
156// skip on class-overload: Sq3BlobHandleGet → MkObjectHandleGet
158static OT_ProcRet NS(Sq3BlobC_HandleGet) (Sq3BlobC_ARGS) {OT_ERROR_LNG_RETURN;}
159
161// Sq3BlobC_Class_PY_API
162
166
167// doc-key: Sq3BlobC,Sq3BlobC-Class-Introspection,oc_
168
170static OT_ProcRet NS(Sq3BlobC_Next) (Sq3BlobC_ARGS) {
174 SQ3_BLOB retVal = Sq3BlobNext (hdl);
175 OT_retObj_SET_BLOB(retVal);
176 goto end;
177 error:
179 end:
181}
182
184static OT_ProcRet NS(Sq3BlobC_Prev) (Sq3BlobC_ARGS) {
188 SQ3_BLOB retVal = Sq3BlobPrev (hdl);
189 OT_retObj_SET_BLOB(retVal);
190 goto end;
191 error:
193 end:
195}
196
197// doc-key: Sq3BlobC,Sq3BlobC-Class-Introspection,sc_
198
200static OT_ProcRet NS(Sq3BlobC_Instances) (OtClass_ARGS) {
204 SQ3_BLOB retVal = Sq3BlobInstances ();
205 OT_retObj_SET_BLOB(retVal);
206 goto end;
207 error:
209 end:
211}
212
214// Sq3BlobC_Class_PY_API
215
219
220// doc-key: Sq3BlobC,Sq3BlobC-Class-Misc,sc_
221
223static OT_ProcRet NS(Sq3BlobC_GetNull) (OtClass_ARGS) {
227 SQ3_BLOB retVal = Sq3BlobGetNull ();
228 OT_retObj_SET_BLOB(retVal);
229 goto end;
230 error:
232 end:
234}
235
237// Sq3BlobC_Class_PY_API
238
242
243// doc-key: Sq3BlobC,Sq3BlobC-Misc,oci
244
246static OT_ProcRet NS(Sq3BlobC_Read) (Sq3BlobC_ARGS) {
249 MK_BUF Z_inout = NULL;
251 MK_I32 iOffset = 0;
254 MkErrorC_Check(hdl,Sq3BlobRead (hdl, &Z_inout, iOffset));
255 OT_retObj_SET_BUF(Z_inout);
256 goto end;
257 error:
259 end:
261}
262
263// doc-key: Sq3BlobC,Sq3BlobC-Misc,om_
264
266static OT_ProcRet NS(Sq3BlobC_Bytes) (Sq3BlobC_ARGS) {
271 goto end;
272 error:
274 end:
276}
277
279static OT_ProcRet NS(Sq3BlobC_Reopen) (Sq3BlobC_ARGS) {
282 MK_I64 arg1 = 0;
285 MkErrorC_Check(hdl,Sq3BlobReopen (hdl, arg1));
287 goto end;
288 error:
290 end:
292}
293
295static OT_ProcRet NS(Sq3BlobC_Write) (Sq3BlobC_ARGS) {
298 MK_BUF z = 0;
300 MK_I32 iOffset = 0;
303 MkErrorC_Check(hdl,Sq3BlobWrite (hdl, z, iOffset));
305 goto end;
306 error:
308 end:
310}
311
313// Sq3BlobC_Misc_PY_API
314
318
319// doc-key: Sq3BlobC,Sq3BlobC-TOR,sCo
320
322static OT_ProcRet NS(Sq3BlobC_Open) (OtClass_ARGS) {
325 SQ3_LITE sq3lite = 0;
327 MK_STRN zDb = 0;
329 MK_STRN zTable = 0;
331 MK_STRN zColumn = 0;
333 MK_I64 iRow = 0;
335 MK_I32 flags = 0;
338 SQ3_BLOB ppBlob;
339 MkErrorC_Check(sq3lite,Sq3BlobOpen (sq3lite, zDb, zTable, zColumn, iRow, flags, &ppBlob));
340 OT_CONSTRUCTOR_POST(ppBlob)
341 OT_retObj_SET_BLOB(ppBlob);
342 goto end;
343 error:
345 end:
347}
348
350static OT_ProcRet NS(Sq3BlobC_new) (CONSTR_ARGS) {
353 SQ3_LITE sq3lite = 0;
355 MK_STRN zDb = 0;
357 MK_STRN zTable = 0;
359 MK_STRN zColumn = 0;
361 MK_I64 iRow = 0;
363 MK_I32 flags = 0;
365 SQ3_BLOB ppBlob;
366 MkErrorC_Check(sq3lite,Sq3BlobOpen (sq3lite, zDb, zTable, zColumn, iRow, flags, &ppBlob));
367 OT_CONSTRUCTOR_POST(ppBlob)
368 OT_retObj_CONSTR(ppBlob);
369 goto end;
370 error:
372 end:
374}
375
377// Sq3BlobC_TOR_PY_API
378
379// END-Sq3BlobC - created by 'py_MqC.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
380
381// MARK_T
387
388static PyMethodDef Sq3BlobC_Methods[] = {
389
390 // BEGIN-CLASS - created by 'py_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
391
392 // doc-key: Sq3BlobC,Sq3Blob,sCo
393 { "Open" , (PyCFunction) NS(Sq3BlobC_Open) , METH_VARARGS|METH_CLASS , Open_doc },
394
395 // doc-key: Sq3BlobC,Sq3Blob,sc_
396 { "GetNull" , (PyCFunction) NS(Sq3BlobC_GetNull) , METH_NOARGS|METH_CLASS , GetNull_doc },
397 { "HandleResolve" , (PyCFunction) NS(Sq3BlobC_HandleResolve) , METH_O|METH_CLASS , HandleResolve_doc },
398 { "Instances" , (PyCFunction) NS(Sq3BlobC_Instances) , METH_NOARGS|METH_CLASS , Instances_doc },
399
400 // END-CLASS - created by 'py_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
401
402 // BEGIN-OBJ - created by 'py_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
403
404 // doc-key: Sq3BlobC,Sq3Blob,oc_
405 { "Next" , (PyCFunction) NS(Sq3BlobC_Next) , METH_NOARGS , Next_doc },
406 { "Prev" , (PyCFunction) NS(Sq3BlobC_Prev) , METH_NOARGS , Prev_doc },
407
408 // doc-key: Sq3BlobC,Sq3Blob,oci
409 { "Read" , (PyCFunction) NS(Sq3BlobC_Read) , METH_VARARGS , Read_doc },
410
411 // doc-key: Sq3BlobC,Sq3Blob,om_
412 { "Bytes" , (PyCFunction) NS(Sq3BlobC_Bytes) , METH_NOARGS , Bytes_doc },
413 // skip class-overload: Sq3BlobHandleGet → HandleGet, NS(Sq3BlobC_HandleGet)
414 { "Reopen" , (PyCFunction) NS(Sq3BlobC_Reopen) , METH_O , Reopen_doc },
415 { "Write" , (PyCFunction) NS(Sq3BlobC_Write) , METH_VARARGS , Write_doc },
416
417 // END-OBJ - created by 'py_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
418
419 {NULL, NULL, 0, NULL} /* Sentinel */
420};
421
427
429 PyVarObject_HEAD_INIT(NULL, 0)
430 .tp_name = "pymsgque.Sq3BlobC",
431 .tp_doc = "PyMsgque Sq3BlobC Type",
432 .tp_basicsize = sizeof(Sq3BlobC_Obj),
433 .tp_itemsize = 0,
434 .tp_new = (newfunc) NS(Sq3BlobC_new),
435 .tp_flags = Py_TPFLAGS_DEFAULT,
436 .tp_methods = Sq3BlobC_Methods,
437 .tp_base = NULL
438};
439
440int NS(pSq3BlobC_Init) ( MK_RT_ARGS PyObject* m)
441{
443
444 return 0;
445error:
446 return -1;
447}
448
449// vim: nowrap
#define OT_SELF
#define MK(n)
#define OT_SETUP_VARARGS(min, max, d)
#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)
#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)
PyTypeObject * OT_CLS_T
#define OT_SETUP_CONSTRUCTOR_ARGS(...)
#define OT_retObj_RETURN
PyObject * OT_OBJ_T
#define OT_CLASS_TYPE_REF
#define OT_CHECK_OPTIONAL(val)
#define OT_CHECK_NOARGS
#define MkErrorC_Check(mng, PROC)
#define OT_ProcRet
#define CONSTR_ARGS
#define OtClass_ARGS
#define OT_CHECK_STRN(val)
tag: nhi1-release-250425
#define OT_retObj_SET_BLOB(nat)
#define Sq3BlobC_ARGS
#define NS(n)
struct Sq3BlobC_Obj Sq3BlobC_Obj
#define Instances_doc
#define OT_SETUP_hdl_static_constr
Definition Sq3BlobC_py.c:31
#define Write_doc
#define OT_SETUP_hdl
Definition Sq3BlobC_py.c:23
#define Read_doc
#define OT_retObj_CONSTR(mng)
Definition Sq3BlobC_py.c:21
#define GetNull_doc
#define Next_doc
#define HandleResolve_doc
#define Prev_doc
#define OT_CLASS
Definition Sq3BlobC_py.c:16
#define OT_SETUP_hdl_static
Definition Sq3BlobC_py.c:28
#define OT_SETUP_hdl_constr
Definition Sq3BlobC_py.c:25
static PyMethodDef Sq3BlobC_Methods[]
#define new_doc
#define Reopen_doc
#define ClassInit
Definition Sq3BlobC_py.c:65
#define Bytes_doc
#define Open_doc
#define mk_inline
#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_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 …
#define Sq3BlobC_X2obj(x)
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_NIH(val)
#define OT_CHECK_BUF(val, nullB)
#define OT_CHECK_LITE(val, nullB)
PyObject_HEAD MK_OBJ hdl
Struct to represent the data of the Sq3BlobC …
Struct to represent the data of the Sq3LiteC …