theSq3Lite 10.0
Loading...
Searching...
No Matches
Sq3BlobC_sq3.h
Go to the documentation of this file.
1
9/* LABEL-START */
10#pragma once
11
12#include "LibSq3Lite_sq3.h"
13/* LABEL-END */
14
15#include "Sq3BlobC_def_sq3.h"
16
18
19// =========================================================================
20// BEGIN-Sq3BlobC-fupu - created by 'c_Native.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
21
22// -> no data
23
24// END-Sq3BlobC-fupu - created by 'c_Native.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
25
26// =========================================================================
27// BEGIN-Sq3BlobC-inline - created by 'c_Native.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
28
29#ifndef PARSE_C_HEADER_TO_META
30
31 // doc-key: Sq3BlobC,Sq3BlobC-Misc,om_
32
35 SQ3_INSTANCE_HDL(sq3blob);
36 return sqlite3_blob_bytes(sq3blob->nat);
37 }
38
41 SQ3_INSTANCE_HDL(sq3blob);
42 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_blob_read(sq3blob->nat, (MK_PTR)(Z), N, iOffset);
43 Sq3ErrorE_Check(sq3blob, errVal);
44 return MK_OK;
45 error:
46 return MK_ERROR;
47 }
48
51 SQ3_INSTANCE_HDL(sq3blob);
52 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_blob_reopen(sq3blob->nat, arg1);
53 Sq3ErrorE_Check(sq3blob, errVal);
54 return MK_OK;
55 error:
56 return MK_ERROR;
57 }
58
61 SQ3_INSTANCE_HDL(sq3blob);
62 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_blob_write(sq3blob->nat, z, n, iOffset);
63 Sq3ErrorE_Check(sq3blob, errVal);
64 return MK_OK;
65 error:
66 return MK_ERROR;
67 }
68#endif
69
70#ifndef PARSE_C_HEADER_TO_META
71
72 // doc-key: Sq3BlobC,Sq3BlobC-TOR,sCo
73
75 mk_inline enum MkErrorE Sq3BlobOpen (SQ3_LITE sq3lite, MK_STRN zDb, MK_STRN zTable, MK_STRN zColumn, MK_I64 iRow, MK_I32 flags, SQ3_BLOB *ppBlob) {
76 *ppBlob = NULL;
77 struct sqlite3 * sq3lite_hdl = sq3lite->nat;
78 sqlite3_blob* ppBlob_val = NULL;
79 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_blob_open(sq3lite_hdl, zDb, zTable, zColumn, iRow, flags, &ppBlob_val);
80 *ppBlob = Sq3BlobC_ObjCreate(ppBlob_val);
82 return MK_OK;
83 error:
84 return MK_ERROR;
85 }
86
87 // doc-key: Sq3BlobC,Sq3BlobC-TOR,om_
88
91 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_blob_close(sq3blob->nat);
92 Sq3ErrorE_Check(sq3blob, errVal);
93 return MK_OK;
94 error:
95 return MK_ERROR;
96 }
97#endif
98
99// END-Sq3BlobC-inline - created by 'c_Native.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
100
106 SQ3_BLOB sq3blob,
107 MK_BUF *Z_inout,
108 MK_I32 iOffset
109) {
110 SQ3_INSTANCE_RT_X(sq3blob);
111
112 MkBufferCreateTLS_inout_T(MkBuffer64C,buf,Z_inout);
113 MK_I32 size = Sq3BlobBytes(sq3blob) - iOffset;
114 MkBufferSizeNew(buf,size);
115 MkBinaryR bin = MkBufferGetBIN_e(buf);
116 Sq3BlobReadHide_E(sq3blob,(MK_BIN)bin.data,(MK_I32)bin.size,iOffset);
117 *Z_inout = buf;
118 return MK_OK;
119error:
120 return MkErrorStack_1X_NULL(sq3blob);
121}
122
128 SQ3_BLOB sq3blob,
129 MK_BUF z,
130 MK_I32 iOffset
131) {
132 SQ3_INSTANCE_RT_X(sq3blob);
133
135 Sq3BlobWriteHide_E(sq3blob,bin.data,(MK_I32)bin.size,iOffset);
136 return MK_OK;
137error:
138 return MkErrorStack_1X_NULL(sq3blob);
139}
140
tag: nhi1-release-250425
#define BEGIN_SQ3_C_DECLS
#define END_SQ3_C_DECLS
tag: nhi1-release-250425
#define MkBufferGetBIN_e(...)
#define MkBufferSizeNew(...)
#define MkBufferCreateTLS_inout_T(cls, name, inout)
#define MkErrorStack_1X_NULL(...)
#define mk_inline
MkErrorE
MK_ERROR
MK_OK
MK_PTRB * MK_PTR
const MK_STRB * MK_STRN
const MK_PTRB * MK_PTRN
MK_BINB * MK_BIN
signed long long MK_I64
signed int MK_I32
#define MK_ATTR_RT_INSTANCE
#define MK_PARSER_RT
static SQ3_BLOB Sq3BlobC_ObjCreate(sqlite3_blob *hdl)
return Programming-Language-Micro-Kernel (PLMK) instance from native hdl …
__thread MK_TYP Sq3BlobC_TT
class as MkTypeDefS-class-type …
static enum MkErrorE Sq3BlobWriteHide(SQ3_BLOB sq3blob, MK_PTRN z, MK_I32 n, MK_I32 iOffset)
Write Data Into A BLOB Incrementally …
static enum MkErrorE Sq3BlobWrite_RT(MK_RT mkrt, SQ3_BLOB sq3blob, MK_BUF z, MK_I32 iOffset)
Write Data Into A BLOB Incrementally …
#define Sq3BlobReadHide_E(...)
static MK_I32 Sq3BlobBytes(SQ3_BLOB sq3blob)
Return The Size Of An Open BLOB …
#define Sq3BlobWriteHide_E(...)
static enum MkErrorE Sq3BlobReadHide(SQ3_BLOB sq3blob, MK_PTR Z, MK_I32 N, MK_I32 iOffset)
Read Data From A BLOB Incrementally …
static enum MkErrorE Sq3BlobReopen(SQ3_BLOB sq3blob, MK_I64 arg1)
Move a BLOB Handle to a New Row …
static enum MkErrorE Sq3BlobRead_RT(MK_RT mkrt, SQ3_BLOB sq3blob, MK_BUF *Z_inout, MK_I32 iOffset)
Read Data From A BLOB Incrementally …
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 …
static enum MkErrorE Sq3BlobClose(SQ3_BLOB sq3blob)
Close A BLOB Handle …
Sq3ErrorE
Result Codes.
#define Sq3ErrorE_Check_Static(cls_hdl, PROC)
#define Sq3ErrorE_Check(sq3_hdl, PROC)
check on a rbsq3lite error and convert into a rbsq3lite error …
#define SQ3_INSTANCE_HDL(x)
#define SQ3_INSTANCE_RT_X(x)
SQLITE_API int sqlite3_blob_bytes(sqlite3_blob *)
SQLITE_API int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset)
SQLITE_API int sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64)
struct sqlite3 sqlite3
struct sqlite3_blob sqlite3_blob
SQLITE_API int sqlite3_blob_close(sqlite3_blob *)
SQLITE_API int sqlite3_blob_open(sqlite3 *, const char *zDb, const char *zTable, const char *zColumn, sqlite3_int64 iRow, int flags, sqlite3_blob **ppBlob)
SQLITE_API int sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset)
MK_SIZE size
MK_BINN data
Struct to represent the data of the Sq3BlobC …
sqlite3_blob * nat
internal - link between Sq3BlobS and native library
Struct to represent the data of the Sq3LiteC …
sqlite3 * nat
internal - link between Sq3LiteS and native library