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
Sq3LiteC_Error_C_API

Sq3LiteC - work with an errorMore...

+ Collaboration diagram for Sq3LiteC_Error_C_API:

Functions

static enum Sq3ErrorE Sq3LiteErrCode (SQ3_LITE db)
 Error Codes And Messages …
 
static MK_STRN Sq3LiteErrMsg (SQ3_LITE sq3lite)
 Error Codes And Messages …
 
static enum MkErrorE Sq3LiteErrorOffset (SQ3_LITE db)
 Error Codes And Messages …
 
static enum Sq3ExtendetResultCodesE Sq3LiteExtendetErrCode (SQ3_LITE db)
 Error Codes And Messages …
 
static enum MkErrorE Sq3LiteSystemErrno (SQ3_LITE sq3lite)
 Low-level system error code …
 
static MK_STRN Sq3LiteErrStr (MK_I32 arg0)
 Error Codes And Messages …
 

Sq3LiteC - Sq3LiteC_Error_C_API - function

enum Sq3ErrorE Sq3LiteErrCodeP (SQ3_LITE db)
 Non-inline replacement for Sq3LiteErrCode
 
MK_STRN Sq3LiteErrMsgP (SQ3_LITE sq3lite)
 Non-inline replacement for Sq3LiteErrMsg
 
enum MkErrorE Sq3LiteErrorOffsetP (SQ3_LITE db)
 Non-inline replacement for Sq3LiteErrorOffset
 
enum Sq3ExtendetResultCodesE Sq3LiteExtendetErrCodeP (SQ3_LITE db)
 Non-inline replacement for Sq3LiteExtendetErrCode
 
enum MkErrorE Sq3LiteSystemErrnoP (SQ3_LITE sq3lite)
 Non-inline replacement for Sq3LiteSystemErrno
 
MK_STRN Sq3LiteErrStrP (MK_I32 arg0)
 Non-inline replacement for Sq3LiteErrStr
 

Sq3LiteC - Sq3LiteC_Error_C_API - overload

#define Sq3LiteErrorOffset_E(...)
 
#define Sq3LiteErrorOffset_C(...)
 
#define Sq3LiteSystemErrno_E(...)
 
#define Sq3LiteSystemErrno_C(...)
 

Detailed Description

Sq3LiteC - work with an error

Macro Definition Documentation

◆ Sq3LiteErrorOffset_C

#define Sq3LiteErrorOffset_C ( ...)
Value:
if (MkErrorCheckI(Sq3LiteErrorOffset(__VA_ARGS__)))
static enum MkErrorE Sq3LiteErrorOffset(SQ3_LITE db)
Error Codes And Messages …

Definition at line 381 of file sqlite3_overload_sq3.h.

◆ Sq3LiteErrorOffset_E

#define Sq3LiteErrorOffset_E ( ...)
Value:
MkErrorCheck(Sq3LiteErrorOffset(__VA_ARGS__))

Definition at line 380 of file sqlite3_overload_sq3.h.

◆ Sq3LiteSystemErrno_C

#define Sq3LiteSystemErrno_C ( ...)
Value:
if (MkErrorCheckI(Sq3LiteSystemErrno(__VA_ARGS__)))
static enum MkErrorE Sq3LiteSystemErrno(SQ3_LITE sq3lite)
Low-level system error code …

Definition at line 383 of file sqlite3_overload_sq3.h.

◆ Sq3LiteSystemErrno_E

#define Sq3LiteSystemErrno_E ( ...)
Value:
MkErrorCheck(Sq3LiteSystemErrno(__VA_ARGS__))

Definition at line 382 of file sqlite3_overload_sq3.h.

Function Documentation

◆ Sq3LiteErrCode()

static enum Sq3ErrorE Sq3LiteErrCode ( SQ3_LITE db)
inlinestatic

Error Codes And Messages …

If the most recent sqlite3_* API call associated with database connection D failed, then the Sq3LiteErrCode(D) interface returns the numeric result code or extended result code for that API call. The Sq3LiteExtendetErrCode() interface is the same except that it always returns the extended result code even when extended result codes are disabled.

The values returned by Sq3LiteErrCode() and/or Sq3LiteExtendetErrCode() might change with each API call. Except, there are some interfaces that are guaranteed to never change the value of the error code. The error-code preserving interfaces include the following:

The Sq3LiteErrMsg() and sqlite3_errmsg16() return English-language text that describes the error, as either UTF-8 or UTF-16 respectively. (See how SQLite handles invalid UTF for exceptions to this rule.) Memory to hold the error message string is managed internally. The application does not need to worry about freeing the result. However, the error string might be overwritten or deallocated by subsequent calls to other SQLite interface functions.

The Sq3LiteErrStr() interface returns the English-language text that describes the result code, as UTF-8. Memory to hold the error message string is managed internally and must not be freed by the application.

If the most recent error references a specific token in the input SQL, the Sq3LiteErrorOffset() interface returns the byte offset of the start of that token. The byte offset returned by Sq3LiteErrorOffset() assumes that the input SQL is UTF8. If the most recent error does not reference a specific token in the input SQL, then the Sq3LiteErrorOffset() function returns -1.

When the serialized threading mode is in use, it might be the case that a second error occurs on a separate thread in between the time of the first error and the call to these interfaces. When that happens, the second error will be reported since these interfaces always report the most recent result. To avoid this, each thread can obtain exclusive use of the database connection D by invoking sqlite3_mutex_enter(sqlite3_db_mutex(D)) before beginning to use D and invoking sqlite3_mutex_leave(sqlite3_db_mutex(D)) after all calls to the interfaces listed here are completed.

If an interface fails with SQ3_RESULT_MISUSE, that means the interface was invoked incorrectly by the application. In that case, the error code and message may or may not be set.

Reference code from sqlite3:

SQLITE_API const char *sqlite3_errstr(int);
struct sqlite3 sqlite3
#define SQLITE_API
SQLITE_API int sqlite3_error_offset(sqlite3 *db)
SQLITE_API const char * sqlite3_errstr(int)
SQLITE_API int sqlite3_extended_errcode(sqlite3 *db)
SQLITE_API int sqlite3_errcode(sqlite3 *db)
SQLITE_API const void * sqlite3_errmsg16(sqlite3 *)
SQLITE_API const char * sqlite3_errmsg(sqlite3 *)

Definition at line 206 of file Sq3LiteC_sq3.h.

206 {
208 return (enum Sq3ErrorE)sqlite3_errcode(db->nat);
209 }
Sq3ErrorE
Result Codes.
#define SQ3_INSTANCE_HDL(x)
sqlite3 * nat
internal - link between Sq3LiteS and native library
+ Here is the caller graph for this function:

◆ Sq3LiteErrCodeP()

enum Sq3ErrorE Sq3LiteErrCodeP ( SQ3_LITE db)

Non-inline replacement for Sq3LiteErrCode

◆ Sq3LiteErrMsg()

static MK_STRN Sq3LiteErrMsg ( SQ3_LITE sq3lite)
inlinestatic

Error Codes And Messages …

read more at 'Sq3LiteErrCode'

Definition at line 212 of file Sq3LiteC_sq3.h.

212 {
213 SQ3_INSTANCE_HDL(sq3lite);
214 MK_STRN __retVal__L = sqlite3_errmsg(sq3lite->nat);
215 return __retVal__L;
216 }
const MK_STRB * MK_STRN
+ Here is the caller graph for this function:

◆ Sq3LiteErrMsgP()

MK_STRN Sq3LiteErrMsgP ( SQ3_LITE sq3lite)

Non-inline replacement for Sq3LiteErrMsg

◆ Sq3LiteErrorOffset()

static enum MkErrorE Sq3LiteErrorOffset ( SQ3_LITE db)
inlinestatic

Error Codes And Messages …

read more at 'Sq3LiteErrCode'

Definition at line 219 of file Sq3LiteC_sq3.h.

219 {
221 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_error_offset(db->nat);
222 Sq3ErrorE_Check(db, errVal);
223 return MK_OK;
224 error:
225 return MK_ERROR;
226 }
MK_ERROR
MK_OK
#define Sq3ErrorE_Check(sq3_hdl, PROC)
check on a pysq3lite error and convert into a pysq3lite error …
+ Here is the caller graph for this function:

◆ Sq3LiteErrorOffsetP()

enum MkErrorE Sq3LiteErrorOffsetP ( SQ3_LITE db)

Non-inline replacement for Sq3LiteErrorOffset

◆ Sq3LiteErrStr()

static MK_STRN Sq3LiteErrStr ( MK_I32 arg0)
inlinestatic

Error Codes And Messages …

read more at 'Sq3LiteErrCode'

Definition at line 247 of file Sq3LiteC_sq3.h.

247 {
248 MK_STRN __retVal__L = sqlite3_errstr(arg0);
249 return __retVal__L;
250 }
+ Here is the caller graph for this function:

◆ Sq3LiteErrStrP()

MK_STRN Sq3LiteErrStrP ( MK_I32 arg0)

Non-inline replacement for Sq3LiteErrStr

◆ Sq3LiteExtendetErrCode()

static enum Sq3ExtendetResultCodesE Sq3LiteExtendetErrCode ( SQ3_LITE db)
inlinestatic

Error Codes And Messages …

read more at 'Sq3LiteErrCode'

Definition at line 229 of file Sq3LiteC_sq3.h.

229 {
232 }
Sq3ExtendetResultCodesE
Extended Result Codes.
+ Here is the caller graph for this function:

◆ Sq3LiteExtendetErrCodeP()

enum Sq3ExtendetResultCodesE Sq3LiteExtendetErrCodeP ( SQ3_LITE db)

Non-inline replacement for Sq3LiteExtendetErrCode

◆ Sq3LiteSystemErrno()

static enum MkErrorE Sq3LiteSystemErrno ( SQ3_LITE sq3lite)
inlinestatic

Low-level system error code …

Attempt to return the underlying operating system error code or error number that caused the most recent I/O error or failure to open a file. The return value is OS-dependent. For example, on unix systems, after Sq3LiteOpenV2 () returns SQ3_RESULT_CANTOPEN, this interface could be called to get back the underlying "errno" that caused the problem, such as ENOSPC, EAUTH, EISDIR, and so forth.

Reference code from sqlite3:

SQLITE_API int sqlite3_system_errno(sqlite3 *)

Definition at line 235 of file Sq3LiteC_sq3.h.

235 {
236 SQ3_INSTANCE_HDL(sq3lite);
237 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_system_errno(sq3lite->nat);
238 Sq3ErrorE_Check(sq3lite, errVal);
239 return MK_OK;
240 error:
241 return MK_ERROR;
242 }
+ Here is the caller graph for this function:

◆ Sq3LiteSystemErrnoP()

enum MkErrorE Sq3LiteSystemErrnoP ( SQ3_LITE sq3lite)

Non-inline replacement for Sq3LiteSystemErrno