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_sq3.h
Go to the documentation of this file.
1
12/* LABEL-START */
13#pragma once
14
15#include "LibSq3Lite_sq3.h"
16/* LABEL-END */
17
18#include "Sq3BlobC_def_sq3.h"
19
21
22// =========================================================================
23// BEGIN-Sq3BlobC-fupu - created by 'c_Native.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
24
25// -> no data
26
27// END-Sq3BlobC-fupu - created by 'c_Native.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
28
29// =========================================================================
30// BEGIN-Sq3BlobC-inline - created by 'c_Native.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
31
32#ifndef PARSE_C_HEADER_TO_META
33
34 // doc-key: Sq3BlobC,Sq3BlobC-Misc,om_
35
38 SQ3_INSTANCE_HDL(sq3blob);
39 return sqlite3_blob_bytes(sq3blob->nat);
40 }
41
44 SQ3_INSTANCE_HDL(sq3blob);
45 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_blob_read(sq3blob->nat, (MK_PTR)(Z), N, iOffset);
46 Sq3ErrorE_Check(sq3blob, errVal);
47 return MK_OK;
48 error:
49 return MK_ERROR;
50 }
51
54 SQ3_INSTANCE_HDL(sq3blob);
55 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_blob_reopen(sq3blob->nat, arg1);
56 Sq3ErrorE_Check(sq3blob, errVal);
57 return MK_OK;
58 error:
59 return MK_ERROR;
60 }
61
64 SQ3_INSTANCE_HDL(sq3blob);
65 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_blob_write(sq3blob->nat, z, n, iOffset);
66 Sq3ErrorE_Check(sq3blob, errVal);
67 return MK_OK;
68 error:
69 return MK_ERROR;
70 }
71#endif
72
73#ifndef PARSE_C_HEADER_TO_META
74
75 // doc-key: Sq3BlobC,Sq3BlobC-TOR,sCo
76
78 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) {
79 *ppBlob = NULL;
80 struct sqlite3 * sq3lite_hdl = sq3lite->nat;
81 sqlite3_blob* ppBlob_val = NULL;
82 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_blob_open(sq3lite_hdl, zDb, zTable, zColumn, iRow, flags, &ppBlob_val);
83 *ppBlob = Sq3BlobC_ObjCreate(ppBlob_val);
85 return MK_OK;
86 error:
87 return MK_ERROR;
88 }
89
90 // doc-key: Sq3BlobC,Sq3BlobC-TOR,om_
91
94 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_blob_close(sq3blob->nat);
95 Sq3ErrorE_Check(sq3blob, errVal);
96 return MK_OK;
97 error:
98 return MK_ERROR;
99 }
100#endif
101
102// END-Sq3BlobC-inline - created by 'c_Native.tcl -i NHI1_HOME/theSq3Lite/c/gen/c_sq3lite.meta' - DO NOT change
103
109 SQ3_BLOB sq3blob,
110 MK_BUF *Z_inout,
111 MK_I32 iOffset
112) {
113 SQ3_INSTANCE_RT_X(sq3blob);
114
115 MkBufferCreateTLS_inout_T(MkBuffer64C,buf,Z_inout);
116 MK_I32 size = Sq3BlobBytes(sq3blob) - iOffset;
117 MkBufferSizeNew(buf,size);
118 MkBinaryR bin = MkBufferGetBIN_e(buf);
119 Sq3BlobReadHide_E(sq3blob,(MK_BIN)bin.data,(MK_I32)bin.size,iOffset);
120 *Z_inout = buf;
121 return MK_OK;
122error:
123 return MkErrorStack_1X_NULL(sq3blob);
124}
125
131 SQ3_BLOB sq3blob,
132 MK_BUF z,
133 MK_I32 iOffset
134) {
135 SQ3_INSTANCE_RT_X(sq3blob);
136
138 Sq3BlobWriteHide_E(sq3blob,bin.data,(MK_I32)bin.size,iOffset);
139 return MK_OK;
140error:
141 return MkErrorStack_1X_NULL(sq3blob);
142}
143
LibSq3Lite_sq3.h - 10 Apr 2025 - aotto1968.
#define BEGIN_SQ3_C_DECLS
#define END_SQ3_C_DECLS
Sq3BlobC_def_sq3.h - 10 Apr 2025 - aotto1968.
#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 tclsq3lite error and convert into a tclsq3lite 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