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_Misc_C_API

Sq3BlobC - various functions to perform misc operations … More...

+ Collaboration diagram for Sq3BlobC_Misc_C_API:

Functions

static MK_I32 Sq3BlobBytes (SQ3_BLOB sq3blob)
 Return The Size Of An Open BLOB …
 
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 Sq3BlobWriteHide (SQ3_BLOB sq3blob, MK_PTRN z, MK_I32 n, MK_I32 iOffset)
 Write Data Into A BLOB Incrementally …
 
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 Sq3BlobWrite_RT (MK_RT mkrt, SQ3_BLOB sq3blob, MK_BUF z, MK_I32 iOffset)
 Write Data Into A BLOB Incrementally …
 

Sq3BlobC - Sq3BlobC_Misc_C_API - function

enum MkErrorE Sq3BlobReadP (MK_RT mkrt, SQ3_BLOB sq3blob, MK_BUF *Z_inout, MK_I32 iOffset)
 Non-inline replacement for Sq3BlobRead
 
MK_I32 Sq3BlobBytesP (SQ3_BLOB sq3blob)
 Non-inline replacement for Sq3BlobBytes
 
enum MkErrorE Sq3BlobReadHideP (SQ3_BLOB sq3blob, MK_PTR Z, MK_I32 N, MK_I32 iOffset)
 Non-inline replacement for Sq3BlobReadHide
 
enum MkErrorE Sq3BlobReopenP (SQ3_BLOB sq3blob, MK_I64 arg1)
 Non-inline replacement for Sq3BlobReopen
 
enum MkErrorE Sq3BlobWriteP (MK_RT mkrt, SQ3_BLOB sq3blob, MK_BUF z, MK_I32 iOffset)
 Non-inline replacement for Sq3BlobWrite
 
enum MkErrorE Sq3BlobWriteHideP (SQ3_BLOB sq3blob, MK_PTRN z, MK_I32 n, MK_I32 iOffset)
 Non-inline replacement for Sq3BlobWriteHide
 

Sq3BlobC - Sq3BlobC_Misc_C_API - overload

#define Sq3BlobRead_NULL(...)
 
#define Sq3BlobRead(...)
 
#define Sq3BlobRead_E(...)
 
#define Sq3BlobRead_C(...)
 
#define Sq3BlobReadHide_E(...)
 
#define Sq3BlobReadHide_C(...)
 
#define Sq3BlobReopen_E(...)
 
#define Sq3BlobReopen_C(...)
 
#define Sq3BlobWrite_NULL(...)
 
#define Sq3BlobWrite(...)
 
#define Sq3BlobWrite_E(...)
 
#define Sq3BlobWrite_C(...)
 
#define Sq3BlobWriteHide_E(...)
 
#define Sq3BlobWriteHide_C(...)
 

Detailed Description

Sq3BlobC - various functions to perform misc operations …

Macro Definition Documentation

◆ Sq3BlobRead

#define Sq3BlobRead ( ...)
Value:
#define MK_RT_CALL
static enum MkErrorE Sq3BlobRead_RT(MK_RT mkrt, SQ3_BLOB sq3blob, MK_BUF *Z_inout, MK_I32 iOffset)
Read Data From A BLOB Incrementally …

Definition at line 50 of file sqlite3_overload_sq3.h.

◆ Sq3BlobRead_C

#define Sq3BlobRead_C ( ...)
Value:
if (MkErrorCheckI(Sq3BlobRead(__VA_ARGS__)))
#define Sq3BlobRead(...)

Definition at line 52 of file sqlite3_overload_sq3.h.

◆ Sq3BlobRead_E

#define Sq3BlobRead_E ( ...)
Value:
MkErrorCheck(Sq3BlobRead(__VA_ARGS__))

Definition at line 51 of file sqlite3_overload_sq3.h.

◆ Sq3BlobRead_NULL

#define Sq3BlobRead_NULL ( ...)
Value:
#define MK_RT_CALL_NULL

Definition at line 49 of file sqlite3_overload_sq3.h.

◆ Sq3BlobReadHide_C

#define Sq3BlobReadHide_C ( ...)
Value:
if (MkErrorCheckI(Sq3BlobReadHide(__VA_ARGS__)))
static enum MkErrorE Sq3BlobReadHide(SQ3_BLOB sq3blob, MK_PTR Z, MK_I32 N, MK_I32 iOffset)
Read Data From A BLOB Incrementally …

Definition at line 56 of file sqlite3_overload_sq3.h.

◆ Sq3BlobReadHide_E

#define Sq3BlobReadHide_E ( ...)
Value:
MkErrorCheck(Sq3BlobReadHide(__VA_ARGS__))

Definition at line 55 of file sqlite3_overload_sq3.h.

◆ Sq3BlobReopen_C

#define Sq3BlobReopen_C ( ...)
Value:
if (MkErrorCheckI(Sq3BlobReopen(__VA_ARGS__)))
static enum MkErrorE Sq3BlobReopen(SQ3_BLOB sq3blob, MK_I64 arg1)
Move a BLOB Handle to a New Row …

Definition at line 58 of file sqlite3_overload_sq3.h.

◆ Sq3BlobReopen_E

#define Sq3BlobReopen_E ( ...)
Value:
MkErrorCheck(Sq3BlobReopen(__VA_ARGS__))

Definition at line 57 of file sqlite3_overload_sq3.h.

◆ Sq3BlobWrite

#define Sq3BlobWrite ( ...)
Value:
static enum MkErrorE Sq3BlobWrite_RT(MK_RT mkrt, SQ3_BLOB sq3blob, MK_BUF z, MK_I32 iOffset)
Write Data Into A BLOB Incrementally …

Definition at line 60 of file sqlite3_overload_sq3.h.

◆ Sq3BlobWrite_C

#define Sq3BlobWrite_C ( ...)
Value:
if (MkErrorCheckI(Sq3BlobWrite(__VA_ARGS__)))
#define Sq3BlobWrite(...)

Definition at line 62 of file sqlite3_overload_sq3.h.

◆ Sq3BlobWrite_E

#define Sq3BlobWrite_E ( ...)
Value:
MkErrorCheck(Sq3BlobWrite(__VA_ARGS__))

Definition at line 61 of file sqlite3_overload_sq3.h.

◆ Sq3BlobWrite_NULL

#define Sq3BlobWrite_NULL ( ...)
Value:

Definition at line 59 of file sqlite3_overload_sq3.h.

◆ Sq3BlobWriteHide_C

#define Sq3BlobWriteHide_C ( ...)
Value:
if (MkErrorCheckI(Sq3BlobWriteHide(__VA_ARGS__)))
static enum MkErrorE Sq3BlobWriteHide(SQ3_BLOB sq3blob, MK_PTRN z, MK_I32 n, MK_I32 iOffset)
Write Data Into A BLOB Incrementally …

Definition at line 64 of file sqlite3_overload_sq3.h.

◆ Sq3BlobWriteHide_E

#define Sq3BlobWriteHide_E ( ...)
Value:
MkErrorCheck(Sq3BlobWriteHide(__VA_ARGS__))

Definition at line 63 of file sqlite3_overload_sq3.h.

Function Documentation

◆ Sq3BlobBytes()

static MK_I32 Sq3BlobBytes ( SQ3_BLOB sq3blob)
inlinestatic

Return The Size Of An Open BLOB …

Returns the size in bytes of the BLOB accessible via the successfully opened BLOB handle in its only argument. The incremental blob I/O routines can only read or overwriting existing blob content; they cannot change the size of a blob.

This routine only works on a BLOB handle which has been created by a prior successful call to Sq3BlobOpen () and which has not been closed by Sq3BlobClose (). Passing any other pointer in to this routine results in undefined and probably undesirable behavior.

Reference code from sqlite3:

SQLITE_API int sqlite3_blob_bytes(sqlite3_blob *)
#define SQLITE_API
struct sqlite3_blob sqlite3_blob

Definition at line 37 of file Sq3BlobC_sq3.h.

37 {
38 SQ3_INSTANCE_HDL(sq3blob);
39 return sqlite3_blob_bytes(sq3blob->nat);
40 }
#define SQ3_INSTANCE_HDL(x)
sqlite3_blob * nat
internal - link between Sq3BlobS and native library
+ Here is the caller graph for this function:

◆ Sq3BlobBytesP()

MK_I32 Sq3BlobBytesP ( SQ3_BLOB sq3blob)

Non-inline replacement for Sq3BlobBytes

◆ Sq3BlobRead_RT()

static enum MkErrorE Sq3BlobRead_RT ( MK_RT mkrt,
SQ3_BLOB sq3blob,
MK_BUF * Z_inout,
MK_I32 iOffset )
inlinestatic

Read Data From A BLOB Incrementally …

read more at 'Sq3BlobReadHide'

Definition at line 107 of file Sq3BlobC_sq3.h.

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}
#define MkBufferGetBIN_e(...)
#define MkBufferSizeNew(...)
#define MkBufferCreateTLS_inout_T(cls, name, inout)
#define MkErrorStack_1X_NULL(...)
MK_OK
MK_BINB * MK_BIN
signed int MK_I32
#define Sq3BlobReadHide_E(...)
static MK_I32 Sq3BlobBytes(SQ3_BLOB sq3blob)
Return The Size Of An Open BLOB …
#define SQ3_INSTANCE_RT_X(x)
MK_SIZE size
MK_BINN data

◆ Sq3BlobReadHide()

static enum MkErrorE Sq3BlobReadHide ( SQ3_BLOB sq3blob,
MK_PTR Z,
MK_I32 N,
MK_I32 iOffset )
inlinestatic

Read Data From A BLOB Incrementally …

This function is used to read data from an open BLOB handle into a caller-supplied buffer. N bytes of data are copied into buffer Z from the open BLOB, starting at offset iOffset.

If offset iOffset is less than N bytes from the end of the BLOB, SQ3_RESULT_ERROR is returned and no data is read. If N or iOffset is less than zero, SQ3_RESULT_ERROR is returned and no data is read. The size of the blob (and hence the maximum value of N+iOffset) can be determined using the Sq3BlobBytes () interface.

An attempt to read from an expired BLOB handle fails with an error code of SQ3_RESULT_ABORT.

On success, Sq3BlobRead() returns SQ3_RESULT_OK. Otherwise, an error code or an extended error code is returned.

This routine only works on a BLOB handle which has been created by a prior successful call to Sq3BlobOpen () and which has not been closed by Sq3BlobClose (). Passing any other pointer in to this routine results in undefined and probably undesirable behavior.

See also: Sq3BlobWrite ().

Reference code from sqlite3:

SQLITE_API int sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset);
SQLITE_API int sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset)

Definition at line 43 of file Sq3BlobC_sq3.h.

43 {
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 }
MK_ERROR
MK_PTRB * MK_PTR
Sq3ErrorE
Result Codes.
#define Sq3ErrorE_Check(sq3_hdl, PROC)
check on a pysq3lite error and convert into a pysq3lite error …

◆ Sq3BlobReadHideP()

enum MkErrorE Sq3BlobReadHideP ( SQ3_BLOB sq3blob,
MK_PTR Z,
MK_I32 N,
MK_I32 iOffset )

Non-inline replacement for Sq3BlobReadHide

◆ Sq3BlobReadP()

enum MkErrorE Sq3BlobReadP ( MK_RT mkrt,
SQ3_BLOB sq3blob,
MK_BUF * Z_inout,
MK_I32 iOffset )

Non-inline replacement for Sq3BlobRead

◆ Sq3BlobReopen()

static enum MkErrorE Sq3BlobReopen ( SQ3_BLOB sq3blob,
MK_I64 arg1 )
inlinestatic

Move a BLOB Handle to a New Row …

This function is used to move an existing BLOB handle so that it points to a different row of the same database table. The new row is identified by the rowid value passed as the second argument. Only the row can be changed. The database, table and column on which the blob handle is open remain the same. Moving an existing BLOB handle to a new row is faster than closing the existing handle and opening a new one.

The new row must meet the same criteria as for Sq3BlobOpen () - it must exist and there must be either a blob or text value stored in the nominated column. If the new row is not present in the table, or if it does not contain a blob or text value, or if another error occurs, an SQLite error code is returned and the blob handle is considered aborted. All subsequent calls to Sq3BlobRead (), Sq3BlobWrite () or Sq3BlobReopen () on an aborted blob handle immediately return SQ3_RESULT_ABORT. Calling Sq3BlobBytes () on an aborted blob handle always returns zero.

This function sets the database handle error code and message.

Reference code from sqlite3:

sqlite_int64 sqlite3_int64
SQLITE_API int sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64)

Definition at line 53 of file Sq3BlobC_sq3.h.

53 {
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 }
+ Here is the caller graph for this function:

◆ Sq3BlobReopenP()

enum MkErrorE Sq3BlobReopenP ( SQ3_BLOB sq3blob,
MK_I64 arg1 )

Non-inline replacement for Sq3BlobReopen

◆ Sq3BlobWrite_RT()

static enum MkErrorE Sq3BlobWrite_RT ( MK_RT mkrt,
SQ3_BLOB sq3blob,
MK_BUF z,
MK_I32 iOffset )
inlinestatic

Write Data Into A BLOB Incrementally …

read more at 'Sq3BlobWriteHide'

Definition at line 129 of file Sq3BlobC_sq3.h.

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}
#define Sq3BlobWriteHide_E(...)

◆ Sq3BlobWriteHide()

static enum MkErrorE Sq3BlobWriteHide ( SQ3_BLOB sq3blob,
MK_PTRN z,
MK_I32 n,
MK_I32 iOffset )
inlinestatic

Write Data Into A BLOB Incrementally …

This function is used to write data into an open BLOB handle from a caller-supplied buffer. N bytes of data are copied from the buffer Z into the open BLOB, starting at offset iOffset.

On success, Sq3BlobWrite() returns SQ3_RESULT_OK. Otherwise, an error code or an extended error code is returned. Unless SQ3_RESULT_MISUSE is returned, this function sets the database connection error code and message accessible via Sq3LiteErrCode () and Sq3LiteErrMsg () and related functions.

If the BLOB handle passed as the first argument was not opened for writing (the flags parameter to Sq3BlobOpen () was zero), this function returns SQ3_RESULT_READONLY.

This function may only modify the contents of the BLOB; it is not possible to increase the size of a BLOB using this API. If offset iOffset is less than N bytes from the end of the BLOB, SQ3_RESULT_ERROR is returned and no data is written. The size of the BLOB (and hence the maximum value of N+iOffset) can be determined using the Sq3BlobBytes () interface. If N or iOffset are less than zero SQ3_RESULT_ERROR is returned and no data is written.

An attempt to write to an expired BLOB handle fails with an error code of SQ3_RESULT_ABORT. Writes to the BLOB that occurred before the BLOB handle expired are not rolled back by the expiration of the handle, though of course those changes might have been overwritten by the statement that expired the BLOB handle or by other independent statements.

This routine only works on a BLOB handle which has been created by a prior successful call to Sq3BlobOpen () and which has not been closed by Sq3BlobClose (). Passing any other pointer in to this routine results in undefined and probably undesirable behavior.

See also: Sq3BlobRead ().

Reference code from sqlite3:

SQLITE_API int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
SQLITE_API int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset)

Definition at line 63 of file Sq3BlobC_sq3.h.

63 {
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 }

◆ Sq3BlobWriteHideP()

enum MkErrorE Sq3BlobWriteHideP ( SQ3_BLOB sq3blob,
MK_PTRN z,
MK_I32 n,
MK_I32 iOffset )

Non-inline replacement for Sq3BlobWriteHide

◆ Sq3BlobWriteP()

enum MkErrorE Sq3BlobWriteP ( MK_RT mkrt,
SQ3_BLOB sq3blob,
MK_BUF z,
MK_I32 iOffset )

Non-inline replacement for Sq3BlobWrite