theSq3Lite 10.0
Loading...
Searching...
No Matches
Sq3BlobC_rb.c
Go to the documentation of this file.
1
9/* LABEL-START */
10#define META_FILE_NAME "Sq3BlobC_rb.c"
11
13
14#define OT_CLASS NS(Sq3BlobC)
15#define OT_CLASS_NAME "Sq3BlobC"
16
17#define OT_LNG2META(O) Sq3Blob(VAL2MNG(O))
18
20
21// new Class type object
22static MK_TYP Sq3BlobCTT = NULL;
24
25// GS marker in "Data_Wrap_Struct"
26static void NS(sMark) (MK_PTR);
27
28// ruby datatype of the wrapped struct
29static rb_data_type_t NS(Sq3BlobC_T) = {
30 "Sq3BlobC",
31 {
32 NS(sMark),
33 MK(AtomDeleteSoft),
34 0, /* dsize */
35 0, /* reserved[1] */
36 },
37 NULL, /* parent */
38 NULL, /* data */
39 RUBY_TYPED_FREE_IMMEDIATELY
40};
41
42// >>THIS<< is a Phase-1-CONSTRUCTOR: a constructor which create the SELF object
43// A Phase-2-CONSTRUCTOR is a constructor which configure an already existing object
44// DO: create a new SELF and link this SELF with the MQ-Object "mng"
45// clazz is the toplevel "subclass" or "Sq3BlobC"
46mk_inline OT_OBJ_T NS(LNG_CONSTR) (OT_CLS_T clazz, MK_MNG mng, int objc, VALUE* objv) {
47 return MK(AtomObjCrt)(clazz,&NS(Sq3BlobC_T),mng,objc,objv);
48}
49// MQ: ObjNew feature: called to return a new or an already existing RUBY-SELF-Object
50// -> moved to: msgque_rb.h
51// OT_OBJ_T NS(Sq3BlobC_ObjNew) (MK_BLOB hdl) {
52// return MK(AtomObjNew) (Sq3BlobC_X2obj(hdl));
53// }
54// MQ: ObjNew feature: selfCreate will be called from "ObjNew->MkSelfNew" if MkObj need a SELF pointer
55static MK_PTR NS(Sq3BlobC_selfCreate) (MK_RT_ARGS MK_OBJ obj, MK_PTR envP) {
56 OT_OBJ_T self = NS(LNG_CONSTR) (OT_CLASS, obj, 0, NULL);
57 return VAL2PTR(self);
58}
59// MQ: called on instance-destruction for a "selfCreate" instance → goal: destroy the SELF
60static void NS(Sq3BlobC_selfDelete) (MK_RT_ARGS MK_PTR ptr, MK_PTR envP) {
62}
63// MQ: called to destroy link from SELF to META
64static void NS(Sq3BlobC_selfUnlink) (MK_RT_ARGS MK_PTR ptr, MK_PTR envP) {
65 OT_OBJ_T self = PTR2VAL(ptr);
66 RDATA(self)->data = NULL;
67}
68// initialize the RUBY and MO class specific object
69#define S_INIT NS(sInit)(MK_RT_CALL_ONLY)
70static void NS(sInit)(MK_RT_ARGS_ONLY) {
71
72 // add "selfCreate" and "selfDelete" feature to the MQ-Sq3BlobC-Type
73 Sq3BlobCTT->selfCreate = NS(Sq3BlobC_selfCreate);
74 Sq3BlobCTT->selfDelete = NS(Sq3BlobC_selfDelete);
75 Sq3BlobCTT->selfUnlink = NS(Sq3BlobC_selfUnlink);
76
77 // create the RUBY class
78 OT_CLASS = rb_define_class_under(OT_PKG, "Sq3BlobC", MK_BASE_CLASS);
79 rb_undef_alloc_func(OT_CLASS);
80
81 /* define the "NULL" object */
82 VALUE nullO = TypedData_Wrap_Struct (OT_CLASS, &NS(Sq3BlobC_T), MK_NULL);
83 NS(Sq3BlobC_MK_NULL) = nullO;
85}
86
87#define OT_SETUP_hdl OT_SETUP_hdl_tmpl(Sq3BlobC);
88#define OT_SETUP_hdl__null_allow OT_SETUP_hdl_tmpl__null_allow(Sq3BlobC);
89#define OT_SETUP_hdl_constr AllRtSetup_NULL; \
90 OT_OBJ_T clazz = self; \
91 Sq3BlobC_type hdl = (Sq3BlobC_type) &MkERROR;
92#define OT_SETUP_hdl_destr OT_SETUP_hdl_tmpl__null_allow(Sq3BlobC);
93#define OT_SETUP_hdl_static AllRtSetup_NULL; \
94 __attribute__((unused)) MK_TYP hdl = Sq3BlobC##_TT;
95#define OT_SETUP_hdl_static_constr OT_SETUP_hdl_static
96
97#if !defined(SetupRtFromObj_X)
98 #define SetupRtFromObj_X(hdl) AllRtSetup_X(hdl)
99 #define SetupRtFromObj_XN(hdl) AllRtSetup_XN(hdl)
100#endif
101
102/* LABEL-END */
103
104// BEGIN-DOC - created by 'rb_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
105
106// doc-key: Sq3BlobC,Sq3Blob,sCo,func
107#define Open_doc "Sq3BlobC Sq3BlobC.Open(sq3lite:Sq3LiteC, zDb:string, zTable:string, zColumn:string, iRow:int64, flags:int32)"
108#define new_doc "Sq3BlobC Sq3BlobC.new(sq3lite:Sq3LiteC, zDb:string, zTable:string, zColumn:string, iRow:int64, flags:int32)"
109
110// doc-key: Sq3BlobC,Sq3Blob,sc_,func
111#define GetNull_doc "Sq3BlobC Sq3BlobC.GetNull()"
112#define HandleResolve_doc "Sq3BlobC Sq3BlobC.HandleResolve(netHdl:MK_HDL)"
113#define Instances_doc "Sq3BlobC Sq3BlobC.Instances()"
114
115// doc-key: Sq3BlobC,Sq3Blob,oc_,func
116#define Next_doc "Sq3BlobC blob.Next()"
117#define Prev_doc "Sq3BlobC blob.Prev()"
118
119// doc-key: Sq3BlobC,Sq3Blob,oci,func
120#define Read_doc "MkBufferC sq3blob.Read(Z_inout:MkBufferC, iOffset:int32)"
121
122// doc-key: Sq3BlobC,Sq3Blob,om_,func
123#define Bytes_doc "int32 sq3blob.Bytes()"
124// skip class-overload: HandleGet → MkObjectHandleGet
125#define Reopen_doc "sq3blob.Reopen(arg1:int64)"
126#define Write_doc "sq3blob.Write(z:MkBufferC, iOffset:int32)"
127
128// END-DOC - created by 'rb_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
129
130/*****************************************************************************/
131/* */
132/* O B J E C T */
133/* */
134/*****************************************************************************/
135
136// BEGIN-Sq3BlobC - created by 'rb_MqC.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
137
141
142// doc-key: Sq3BlobC,Sq3BlobC-Class-Export,sc_
143
145static OT_ProcRet NS(Sq3BlobC_HandleResolve) (OtClass_ARGS) {
148 MK_HDL netHdl = 0;
151 SQ3_BLOB retVal = Sq3BlobHandleResolve (netHdl);
152 OT_retObj_SET_BLOB(retVal);
153 end: MK_UNUSED /* LONG JUMP on error */
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_RB_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 end: MK_UNUSED /* LONG JUMP on error */
181}
182
184static OT_ProcRet NS(Sq3BlobC_Prev) (Sq3BlobC_ARGS) {
188 SQ3_BLOB retVal = Sq3BlobPrev (hdl);
189 OT_retObj_SET_BLOB(retVal);
190 end: MK_UNUSED /* LONG JUMP on error */
192}
193
194// doc-key: Sq3BlobC,Sq3BlobC-Class-Introspection,sc_
195
197static OT_ProcRet NS(Sq3BlobC_Instances) (OtClass_ARGS) {
201 SQ3_BLOB retVal = Sq3BlobInstances ();
202 OT_retObj_SET_BLOB(retVal);
203 end: MK_UNUSED /* LONG JUMP on error */
205}
206
208// Sq3BlobC_Class_RB_API
209
213
214// doc-key: Sq3BlobC,Sq3BlobC-Class-Misc,sc_
215
217static OT_ProcRet NS(Sq3BlobC_GetNull) (OtClass_ARGS) {
221 SQ3_BLOB retVal = Sq3BlobGetNull ();
222 OT_retObj_SET_BLOB(retVal);
223 end: MK_UNUSED /* LONG JUMP on error */
225}
226
228// Sq3BlobC_Class_RB_API
229
233
234// doc-key: Sq3BlobC,Sq3BlobC-Misc,oci
235
237static OT_ProcRet NS(Sq3BlobC_Read) (Sq3BlobC_ARGS) {
240 MK_BUF Z_inout = NULL;
242 MK_I32 iOffset = 0;
245 MkErrorC_Check(hdl,Sq3BlobRead (hdl, &Z_inout, iOffset));
246 OT_retObj_SET_BUF(Z_inout);
247 end: MK_UNUSED /* LONG JUMP on error */
249}
250
251// doc-key: Sq3BlobC,Sq3BlobC-Misc,om_
252
254static OT_ProcRet NS(Sq3BlobC_Bytes) (Sq3BlobC_ARGS) {
259 end: MK_UNUSED /* LONG JUMP on error */
261}
262
264static OT_ProcRet NS(Sq3BlobC_Reopen) (Sq3BlobC_ARGS) {
267 MK_I64 arg1 = 0;
270 MkErrorC_Check(hdl,Sq3BlobReopen (hdl, arg1));
272 end: MK_UNUSED /* LONG JUMP on error */
274}
275
277static OT_ProcRet NS(Sq3BlobC_Write) (Sq3BlobC_ARGS) {
280 MK_BUF z = 0;
282 MK_I32 iOffset = 0;
285 MkErrorC_Check(hdl,Sq3BlobWrite (hdl, z, iOffset));
287 end: MK_UNUSED /* LONG JUMP on error */
289}
290
292// Sq3BlobC_Misc_RB_API
293
297
298// doc-key: Sq3BlobC,Sq3BlobC-TOR,sCo
299
301static OT_ProcRet NS(Sq3BlobC_Open) (OtClass_ARGS) {
304 SQ3_LITE sq3lite = 0;
306 MK_STRN zDb = 0;
308 MK_STRN zTable = 0;
310 MK_STRN zColumn = 0;
312 MK_I64 iRow = 0;
314 MK_I32 flags = 0;
317 SQ3_BLOB ppBlob;
318 MkErrorC_Check(sq3lite,Sq3BlobOpen (sq3lite, zDb, zTable, zColumn, iRow, flags, &ppBlob));
319 OT_CONSTRUCTOR_POST(ppBlob)
320 OT_retObj_SET_BLOB(ppBlob);
321 end: MK_UNUSED /* LONG JUMP on error */
323}
324
326static OT_ProcRet NS(Sq3BlobC_new) (CONSTR_ARGS) {
329 SQ3_LITE sq3lite = 0;
331 MK_STRN zDb = 0;
333 MK_STRN zTable = 0;
335 MK_STRN zColumn = 0;
337 MK_I64 iRow = 0;
339 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_CONSTR(ppBlob);
345 end: MK_UNUSED /* LONG JUMP on error */
347}
348
350// Sq3BlobC_TOR_RB_API
351
352// END-Sq3BlobC - created by 'rb_MqC.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
353
354/*****************************************************************************/
355/* */
356/* public */
357/* */
358/*****************************************************************************/
359
360void NS(sMark) (MK_PTR ptr) {
361}
362
363void NS(Sq3BlobC_Init) (MK_RT_ARGS_ONLY) {
364
365 // init type
367 S_INIT;
368
369 // BEGIN-CLASS - created by 'rb_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
370
371 // doc-key: Sq3BlobC,Sq3Blob,sCo
372 OT_METH_S ( Sq3BlobC, Open, Sq3BlobC_Open )
373 OT_METH_C ( Sq3BlobC, new, Sq3BlobC_new )
374
375 // doc-key: Sq3BlobC,Sq3Blob,sc_
376 OT_METH_O ( Sq3BlobC, GetNull, Sq3BlobC_GetNull )
377 OT_METH_S ( Sq3BlobC, GetNull, Sq3BlobC_GetNull )
378 OT_METH_O ( Sq3BlobC, HandleResolve, Sq3BlobC_HandleResolve )
379 OT_METH_S ( Sq3BlobC, HandleResolve, Sq3BlobC_HandleResolve )
380 OT_METH_O ( Sq3BlobC, Instances, Sq3BlobC_Instances )
381 OT_METH_S ( Sq3BlobC, Instances, Sq3BlobC_Instances )
382
383 // END-CLASS - created by 'rb_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
384
385 // BEGIN-OBJ - created by 'rb_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
386
387 // doc-key: Sq3BlobC,Sq3Blob,oc_
388 OT_METH_O ( Sq3BlobC, Next, Sq3BlobC_Next )
389 OT_METH_O ( Sq3BlobC, Prev, Sq3BlobC_Prev )
390
391 // doc-key: Sq3BlobC,Sq3Blob,oci
392 OT_METH_O ( Sq3BlobC, Read, Sq3BlobC_Read )
393
394 // doc-key: Sq3BlobC,Sq3Blob,om_
395 OT_METH_O ( Sq3BlobC, Bytes, Sq3BlobC_Bytes )
396 // skip class-overload: Sq3BlobHandleGet → HandleGet, Sq3BlobC_HandleGet
397 OT_METH_O ( Sq3BlobC, Reopen, Sq3BlobC_Reopen )
398 OT_METH_O ( Sq3BlobC, Write, Sq3BlobC_Write )
399
400 // END-OBJ - created by 'rb_MqS.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
401
402}
#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 PTR2VAL(nat)
#define OT_CHECK_NI4(val)
#define OT_CHECK_NI8(val)
#define OT_CONSTRUCTOR_POST(x)
#define OT_METH_S(c, s, f)
#define MK_BASE_CLASS
#define OT_CLS_T
#define OT_retObj_SET_BUF(nat)
#define OT_retObj_CONSTR(mng)
#define OT_CHECK_REQUIRED(val)
#define OT_retObj_SET_None
#define OT_retObj_SET_I32(nat)
#define OT_METH_O(c, s, f)
#define OT_SETUP_CONSTRUCTOR_ARGS(min, max, d)
#define INCR_REF(valP)
#define OT_OBJ_T
#define OT_retObj_RETURN
#define OT_OBJECT_DELETE_HARD(obj)
#define OT_CHECK_OPTIONAL(val)
#define VAL2PTR(val)
#define OT_CHECK_NOARGS
#define MkErrorC_Check(mng, PROC)
#define OT_ProcRet
#define OT_METH_C(c, s, f)
#define CONSTR_ARGS
#define OtClass_ARGS
#define OT_CHECK_STRN(val)
tag: nhi1-release-250425
#define SQ3(n)
#define OT_retObj_SET_BLOB(nat)
#define Sq3BlobC_MK_NULL
#define OT_PKG
#define Sq3BlobC_ARGS
#define NS(n)
#define Instances_doc
#define OT_SETUP_hdl_static_constr
Definition Sq3BlobC_rb.c:95
#define Write_doc
#define OT_SETUP_hdl
Definition Sq3BlobC_rb.c:87
#define Read_doc
#define GetNull_doc
#define Next_doc
static MK_TYP Sq3BlobCTT
Definition Sq3BlobC_rb.c:22
#define HandleResolve_doc
#define Prev_doc
#define OT_CLASS
Definition Sq3BlobC_rb.c:14
#define OT_SETUP_hdl_static
Definition Sq3BlobC_rb.c:93
#define OT_SETUP_hdl_constr
Definition Sq3BlobC_rb.c:89
#define new_doc
#define S_INIT
Definition Sq3BlobC_rb.c:69
#define Reopen_doc
#define Bytes_doc
#define Open_doc
#define mk_inline
#define MK_NULL_NO
#define MK_NULL_YES
#define MK_UNUSED
#define MK_NULL
#define MK_DEPRECATED
MK_PTRB * MK_PTR
const MK_STRB * MK_STRN
MK_PTRB * MK_MNG
signed long long MK_I64
int32_t MK_HDL
signed int MK_I32
#define MK_RT_ARGS
#define MK_RT_ARGS_ONLY
#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 …
__thread MK_TYP Sq3BlobC_TT
class as MkTypeDefS-class-type …
#define Sq3BlobC_T
class as MkTypeDefS-class-type (cast from Sq3BlobC_TT into MkTypeS) …
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)
MkSelfUnlinkF selfUnlink
MkSelfDeleteF selfDelete
MkSelfCreateF selfCreate
Struct to represent the data of the Sq3BlobC …
Struct to represent the data of the Sq3LiteC …