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_py.c
Go to the documentation of this file.
1
12/* LABEL-START */
13
14#define META_FILE_NAME "Sq3BlobC_py.c"
15
17
18// PY class
19#define OT_CLASS (&NS(Sq3BlobCR))
20#define OT_CLASS_NAME "Sq3BlobC"
21
22#define OT_LNG2META(O) Sq3Blob(VAL2MNG(O))
23
24#define OT_retObj_CONSTR(mng) OT_retObj_SET(NS(Sq3BlobC_CTOR)(MK_RT_CALL (PyTypeObject*)class,mng))
25
26#define OT_SETUP_hdl OT_SETUP_hdl_tmpl(Sq3BlobC)
27#define OT_SETUP_hdl__null_allow OT_SETUP_hdl_tmpl__null_allow(Sq3BlobC)
28#define OT_SETUP_hdl_constr MK_RT_UNUSED AllRtSetup_NULL; \
29 SQ3_BLOB hdl = (SQ3_BLOB) OT_CLASS;
30#define OT_SETUP_hdl_destr OT_SETUP_hdl_tmpl__null_allow(Sq3BlobC)
31#define OT_SETUP_hdl_static MK_RT_UNUSED AllRtSetup_NULL; \
32 __attribute__((unused)) MK_TYP hdl = Sq3BlobC##_TT;
33
34#define OT_SETUP_hdl_static_constr OT_SETUP_hdl_static
35
36#if !defined(SetupRtFromObj_X)
37 #define SetupRtFromObj_X(hdl) AllRtSetup_X(hdl)
38 #define SetupRtFromObj_XN(hdl) AllRtSetup_XN(hdl)
39#endif
40
41// MO class
42#undef Sq3BlobCTT
43#define Sq3BlobCTT SQ3(Sq3LiteThreadState).Sq3BlobCTT
44/* Sq3BlobC_MK_NULL defined in LibSq3Lite_py.h */
45
46__attribute__((unused)) mk_inline
47OT_OBJ_T NS(Sq3BlobC_CTOR) (MK_RT_ARGS OT_CLS_T type, SQ3_BLOB hdl) {
48 return MK(AtomCreate)(MK_RT_CALL type,Sq3BlobC_X2obj(hdl));
49}
50
51// helper: mk_dbg_color_ln(MK_COLOR_YELLOW,"hdl<%p>, self<%p>", obj, self);
52
53// META: ObjNew feature: selfCreate will be called from "ObjNew->MkSelfNew" if MkObj need a SELF pointer
54static MK_PTR NS(Sq3BlobC_selfCreate) (MK_RT_ARGS MK_OBJ const obj, MK_PTR const env) {
55 return MK(AtomCreate) (MK_RT_CALL OT_CLASS,obj);
56}
57// META: called if MkObj must be destroyed and if the SELF is still alive → goal: destroy the SELF
58static void NS(Sq3BlobC_selfDelete) (MK_RT_ARGS MK_PTR self, MK_PTR const env) {
59 MK(AtomDeleteHard) (MK_RT_CALL OT_SELF);
60}
61// META: called to destroy link from SELF to META
62static void NS(Sq3BlobC_selfUnlink) (MK_RT_ARGS MK_PTR self, MK_PTR const env) {
63 MkObjectC_Obj *selfO = (MkObjectC_Obj*) self;
64 selfO->hdl = NULL;
65}
66
67// initialize the PY and MO class specific object
68#define ClassInit \
69 /* if not already done, initialize NEW META type */ \
70 if (Sq3BlobCTT == NULL) Sq3BlobCTT = Sq3BlobSTT; \
71 \
72 /* protect against double call */ \
73 if (Sq3BlobCTT->selfCreate == NS(Sq3BlobC_selfCreate)) return MK_OK; \
74 \
75 /* add "selfCreate" and "selfDelete" feature to the META-Class */ \
76 Sq3BlobCTT->selfCreate = NS(Sq3BlobC_selfCreate); \
77 Sq3BlobCTT->selfDelete = NS(Sq3BlobC_selfDelete); \
78 Sq3BlobCTT->selfUnlink = NS(Sq3BlobC_selfUnlink); \
79 \
80 if (!PyType_HasFeature(OT_CLASS,Py_TPFLAGS_READY)) { \
81 NS(Sq3BlobCR).tp_base = Sq3BlobC_base; \
82 OtErrorCheckLng (PyType_Ready(OT_CLASS)); \
83 } \
84 OtErrorCheckLng(PyModule_AddObjectRef(m, "Sq3BlobC", (PyObject *)OT_CLASS)); \
85 \
86 /* define the "NULL" object */ \
87 Sq3BlobC_MK_NULL = Py_NewRef(MK(AtomCreate) (MK_RT_CALL OT_CLASS, NULL /*obj*/));
88
89/* LABEL-END */
90
91#define META_CONTEXT_S MK_ERROR_DEFAULT
92
93// MARK_D
99
100// BEGIN-DOC - created by 'py_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
101
102// doc-key: Sq3BlobC,Sq3Blob,sCo,func
103#define Open_doc "Sq3BlobC Sq3BlobC.Open(sq3lite:Sq3LiteC, zDb:string, zTable:string, zColumn:string, iRow:int64, flags:int32)"
104#define new_doc "Sq3BlobC Sq3BlobC.new(sq3lite:Sq3LiteC, zDb:string, zTable:string, zColumn:string, iRow:int64, flags:int32)"
105
106// doc-key: Sq3BlobC,Sq3Blob,sc_,func
107#define GetNull_doc "Sq3BlobC Sq3BlobC.GetNull()"
108#define HandleResolve_doc "Sq3BlobC Sq3BlobC.HandleResolve(netHdl:MK_HDL)"
109#define Instances_doc "Sq3BlobC Sq3BlobC.Instances()"
110
111// doc-key: Sq3BlobC,Sq3Blob,oc_,func
112#define Next_doc "Sq3BlobC blob.Next()"
113#define Prev_doc "Sq3BlobC blob.Prev()"
114
115// doc-key: Sq3BlobC,Sq3Blob,oci,func
116#define Read_doc "MkBufferC sq3blob.Read(Z_inout:MkBufferC, iOffset:int32)"
117
118// doc-key: Sq3BlobC,Sq3Blob,om_,func
119#define Bytes_doc "int32 sq3blob.Bytes()"
120// skip class-overload: HandleGet → MkObjectHandleGet
121#define Reopen_doc "sq3blob.Reopen(arg1:int64)"
122#define Write_doc "sq3blob.Write(z:MkBufferC, iOffset:int32)"
123
124// END-DOC - created by 'py_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
125
126// MARK_M
132
133// BEGIN-Sq3BlobC - created by 'py_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_PY_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_PY_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_PY_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_PY_API
317
321
322// doc-key: Sq3BlobC,Sq3BlobC-TOR,sCo
323
325static OT_ProcRet NS(Sq3BlobC_Open) (OtClass_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;
341 SQ3_BLOB ppBlob;
342 MkErrorC_Check(sq3lite,Sq3BlobOpen (sq3lite, zDb, zTable, zColumn, iRow, flags, &ppBlob));
343 OT_CONSTRUCTOR_POST(ppBlob)
344 OT_retObj_SET_BLOB(ppBlob);
345 goto end;
346 error:
348 end:
350}
351
353static OT_ProcRet NS(Sq3BlobC_new) (CONSTR_ARGS) {
356 SQ3_LITE sq3lite = 0;
358 MK_STRN zDb = 0;
360 MK_STRN zTable = 0;
362 MK_STRN zColumn = 0;
364 MK_I64 iRow = 0;
366 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_CONSTR(ppBlob);
372 goto end;
373 error:
375 end:
377}
378
380// Sq3BlobC_TOR_PY_API
381
382// END-Sq3BlobC - created by 'py_MqC.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
383
384// MARK_T
390
391static PyMethodDef Sq3BlobC_Methods[] = {
392
393 // BEGIN-CLASS - created by 'py_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
394
395 // doc-key: Sq3BlobC,Sq3Blob,sCo
396 { "Open" , (PyCFunction) NS(Sq3BlobC_Open) , METH_VARARGS|METH_CLASS , Open_doc },
397
398 // doc-key: Sq3BlobC,Sq3Blob,sc_
399 { "GetNull" , (PyCFunction) NS(Sq3BlobC_GetNull) , METH_NOARGS|METH_CLASS , GetNull_doc },
400 { "HandleResolve" , (PyCFunction) NS(Sq3BlobC_HandleResolve) , METH_O|METH_CLASS , HandleResolve_doc },
401 { "Instances" , (PyCFunction) NS(Sq3BlobC_Instances) , METH_NOARGS|METH_CLASS , Instances_doc },
402
403 // END-CLASS - created by 'py_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
404
405 // BEGIN-OBJ - created by 'py_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
406
407 // doc-key: Sq3BlobC,Sq3Blob,oc_
408 { "Next" , (PyCFunction) NS(Sq3BlobC_Next) , METH_NOARGS , Next_doc },
409 { "Prev" , (PyCFunction) NS(Sq3BlobC_Prev) , METH_NOARGS , Prev_doc },
410
411 // doc-key: Sq3BlobC,Sq3Blob,oci
412 { "Read" , (PyCFunction) NS(Sq3BlobC_Read) , METH_VARARGS , Read_doc },
413
414 // doc-key: Sq3BlobC,Sq3Blob,om_
415 { "Bytes" , (PyCFunction) NS(Sq3BlobC_Bytes) , METH_NOARGS , Bytes_doc },
416 // skip class-overload: Sq3BlobHandleGet → HandleGet, NS(Sq3BlobC_HandleGet)
417 { "Reopen" , (PyCFunction) NS(Sq3BlobC_Reopen) , METH_O , Reopen_doc },
418 { "Write" , (PyCFunction) NS(Sq3BlobC_Write) , METH_VARARGS , Write_doc },
419
420 // END-OBJ - created by 'py_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
421
422 {NULL, NULL, 0, NULL} /* Sentinel */
423};
424
430
432 PyVarObject_HEAD_INIT(NULL, 0)
433 .tp_name = "pymsgque.Sq3BlobC",
434 .tp_doc = "PyMsgque Sq3BlobC Type",
435 .tp_basicsize = sizeof(Sq3BlobC_Obj),
436 .tp_itemsize = 0,
437 .tp_new = (newfunc) NS(Sq3BlobC_new),
438 .tp_flags = Py_TPFLAGS_DEFAULT,
439 .tp_methods = Sq3BlobC_Methods,
440 .tp_base = NULL
441};
442
443int NS(pSq3BlobC_Init) ( MK_RT_ARGS PyObject* m)
444{
446
447 return 0;
448error:
449 return -1;
450}
451
452// 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)
LibSq3Lite_private_py.h - 17 Apr 2025 - aotto1968.
#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:34
#define Write_doc
#define OT_SETUP_hdl
Definition Sq3BlobC_py.c:26
#define Read_doc
#define OT_retObj_CONSTR(mng)
Definition Sq3BlobC_py.c:24
#define GetNull_doc
#define Next_doc
#define HandleResolve_doc
#define Prev_doc
#define OT_CLASS
Definition Sq3BlobC_py.c:19
#define OT_SETUP_hdl_static
Definition Sq3BlobC_py.c:31
#define OT_SETUP_hdl_constr
Definition Sq3BlobC_py.c:28
static PyMethodDef Sq3BlobC_Methods[]
#define new_doc
#define Reopen_doc
#define ClassInit
Definition Sq3BlobC_py.c:68
#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 …