From 86b2b62547572c5833d00dfbd62e19739a3a61dc Mon Sep 17 00:00:00 2001 From: ygl Date: Sun, 4 Dec 2016 12:56:46 +0800 Subject: [PATCH] updated to sqlite 3.15.2 --- src/_sqlite3_cffi.c | 5081 +++++++++++++++++++++++++++++++++++++++++++ src/sqlite3.c | 104 +- src/sqlite3.h | 6 +- 3 files changed, 5155 insertions(+), 36 deletions(-) create mode 100644 src/_sqlite3_cffi.c diff --git a/src/_sqlite3_cffi.c b/src/_sqlite3_cffi.c new file mode 100644 index 0000000..d4ea68d --- /dev/null +++ b/src/_sqlite3_cffi.c @@ -0,0 +1,5081 @@ +#define _CFFI_ + +/* We try to define Py_LIMITED_API before including Python.h. + + Mess: we can only define it if Py_DEBUG, Py_TRACE_REFS and + Py_REF_DEBUG are not defined. This is a best-effort approximation: + we can learn about Py_DEBUG from pyconfig.h, but it is unclear if + the same works for the other two macros. Py_DEBUG implies them, + but not the other way around. +*/ +#ifndef _CFFI_USE_EMBEDDING +# include +# if !defined(Py_DEBUG) && !defined(Py_TRACE_REFS) && !defined(Py_REF_DEBUG) +# define Py_LIMITED_API +# endif +#endif + +#include +#ifdef __cplusplus +extern "C" { +#endif +#include + +/* This part is from file 'cffi/parse_c_type.h'. It is copied at the + beginning of C sources generated by CFFI's ffi.set_source(). */ + +typedef void *_cffi_opcode_t; + +#define _CFFI_OP(opcode, arg) (_cffi_opcode_t)(opcode | (((uintptr_t)(arg)) << 8)) +#define _CFFI_GETOP(cffi_opcode) ((unsigned char)(uintptr_t)cffi_opcode) +#define _CFFI_GETARG(cffi_opcode) (((intptr_t)cffi_opcode) >> 8) + +#define _CFFI_OP_PRIMITIVE 1 +#define _CFFI_OP_POINTER 3 +#define _CFFI_OP_ARRAY 5 +#define _CFFI_OP_OPEN_ARRAY 7 +#define _CFFI_OP_STRUCT_UNION 9 +#define _CFFI_OP_ENUM 11 +#define _CFFI_OP_FUNCTION 13 +#define _CFFI_OP_FUNCTION_END 15 +#define _CFFI_OP_NOOP 17 +#define _CFFI_OP_BITFIELD 19 +#define _CFFI_OP_TYPENAME 21 +#define _CFFI_OP_CPYTHON_BLTN_V 23 // varargs +#define _CFFI_OP_CPYTHON_BLTN_N 25 // noargs +#define _CFFI_OP_CPYTHON_BLTN_O 27 // O (i.e. a single arg) +#define _CFFI_OP_CONSTANT 29 +#define _CFFI_OP_CONSTANT_INT 31 +#define _CFFI_OP_GLOBAL_VAR 33 +#define _CFFI_OP_DLOPEN_FUNC 35 +#define _CFFI_OP_DLOPEN_CONST 37 +#define _CFFI_OP_GLOBAL_VAR_F 39 +#define _CFFI_OP_EXTERN_PYTHON 41 + +#define _CFFI_PRIM_VOID 0 +#define _CFFI_PRIM_BOOL 1 +#define _CFFI_PRIM_CHAR 2 +#define _CFFI_PRIM_SCHAR 3 +#define _CFFI_PRIM_UCHAR 4 +#define _CFFI_PRIM_SHORT 5 +#define _CFFI_PRIM_USHORT 6 +#define _CFFI_PRIM_INT 7 +#define _CFFI_PRIM_UINT 8 +#define _CFFI_PRIM_LONG 9 +#define _CFFI_PRIM_ULONG 10 +#define _CFFI_PRIM_LONGLONG 11 +#define _CFFI_PRIM_ULONGLONG 12 +#define _CFFI_PRIM_FLOAT 13 +#define _CFFI_PRIM_DOUBLE 14 +#define _CFFI_PRIM_LONGDOUBLE 15 + +#define _CFFI_PRIM_WCHAR 16 +#define _CFFI_PRIM_INT8 17 +#define _CFFI_PRIM_UINT8 18 +#define _CFFI_PRIM_INT16 19 +#define _CFFI_PRIM_UINT16 20 +#define _CFFI_PRIM_INT32 21 +#define _CFFI_PRIM_UINT32 22 +#define _CFFI_PRIM_INT64 23 +#define _CFFI_PRIM_UINT64 24 +#define _CFFI_PRIM_INTPTR 25 +#define _CFFI_PRIM_UINTPTR 26 +#define _CFFI_PRIM_PTRDIFF 27 +#define _CFFI_PRIM_SIZE 28 +#define _CFFI_PRIM_SSIZE 29 +#define _CFFI_PRIM_INT_LEAST8 30 +#define _CFFI_PRIM_UINT_LEAST8 31 +#define _CFFI_PRIM_INT_LEAST16 32 +#define _CFFI_PRIM_UINT_LEAST16 33 +#define _CFFI_PRIM_INT_LEAST32 34 +#define _CFFI_PRIM_UINT_LEAST32 35 +#define _CFFI_PRIM_INT_LEAST64 36 +#define _CFFI_PRIM_UINT_LEAST64 37 +#define _CFFI_PRIM_INT_FAST8 38 +#define _CFFI_PRIM_UINT_FAST8 39 +#define _CFFI_PRIM_INT_FAST16 40 +#define _CFFI_PRIM_UINT_FAST16 41 +#define _CFFI_PRIM_INT_FAST32 42 +#define _CFFI_PRIM_UINT_FAST32 43 +#define _CFFI_PRIM_INT_FAST64 44 +#define _CFFI_PRIM_UINT_FAST64 45 +#define _CFFI_PRIM_INTMAX 46 +#define _CFFI_PRIM_UINTMAX 47 + +#define _CFFI__NUM_PRIM 48 +#define _CFFI__UNKNOWN_PRIM (-1) +#define _CFFI__UNKNOWN_FLOAT_PRIM (-2) +#define _CFFI__UNKNOWN_LONG_DOUBLE (-3) + +#define _CFFI__IO_FILE_STRUCT (-1) + + +struct _cffi_global_s { + const char *name; + void *address; + _cffi_opcode_t type_op; + void *size_or_direct_fn; // OP_GLOBAL_VAR: size, or 0 if unknown + // OP_CPYTHON_BLTN_*: addr of direct function +}; + +struct _cffi_getconst_s { + unsigned long long value; + const struct _cffi_type_context_s *ctx; + int gindex; +}; + +struct _cffi_struct_union_s { + const char *name; + int type_index; // -> _cffi_types, on a OP_STRUCT_UNION + int flags; // _CFFI_F_* flags below + size_t size; + int alignment; + int first_field_index; // -> _cffi_fields array + int num_fields; +}; +#define _CFFI_F_UNION 0x01 // is a union, not a struct +#define _CFFI_F_CHECK_FIELDS 0x02 // complain if fields are not in the + // "standard layout" or if some are missing +#define _CFFI_F_PACKED 0x04 // for CHECK_FIELDS, assume a packed struct +#define _CFFI_F_EXTERNAL 0x08 // in some other ffi.include() +#define _CFFI_F_OPAQUE 0x10 // opaque + +struct _cffi_field_s { + const char *name; + size_t field_offset; + size_t field_size; + _cffi_opcode_t field_type_op; +}; + +struct _cffi_enum_s { + const char *name; + int type_index; // -> _cffi_types, on a OP_ENUM + int type_prim; // _CFFI_PRIM_xxx + const char *enumerators; // comma-delimited string +}; + +struct _cffi_typename_s { + const char *name; + int type_index; /* if opaque, points to a possibly artificial + OP_STRUCT which is itself opaque */ +}; + +struct _cffi_type_context_s { + _cffi_opcode_t *types; + const struct _cffi_global_s *globals; + const struct _cffi_field_s *fields; + const struct _cffi_struct_union_s *struct_unions; + const struct _cffi_enum_s *enums; + const struct _cffi_typename_s *typenames; + int num_globals; + int num_struct_unions; + int num_enums; + int num_typenames; + const char *const *includes; + int num_types; + int flags; /* future extension */ +}; + +struct _cffi_parse_info_s { + const struct _cffi_type_context_s *ctx; + _cffi_opcode_t *output; + unsigned int output_size; + size_t error_location; + const char *error_message; +}; + +struct _cffi_externpy_s { + const char *name; + size_t size_of_result; + void *reserved1, *reserved2; +}; + +#ifdef _CFFI_INTERNAL +static int parse_c_type(struct _cffi_parse_info_s *info, const char *input); +static int search_in_globals(const struct _cffi_type_context_s *ctx, + const char *search, size_t search_len); +static int search_in_struct_unions(const struct _cffi_type_context_s *ctx, + const char *search, size_t search_len); +#endif + +/* this block of #ifs should be kept exactly identical between + c/_cffi_backend.c, cffi/vengine_cpy.py, cffi/vengine_gen.py + and cffi/_cffi_include.h */ +#if defined(_MSC_VER) +# include /* for alloca() */ +# if _MSC_VER < 1600 /* MSVC < 2010 */ + typedef __int8 int8_t; + typedef __int16 int16_t; + typedef __int32 int32_t; + typedef __int64 int64_t; + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; + typedef unsigned __int64 uint64_t; + typedef __int8 int_least8_t; + typedef __int16 int_least16_t; + typedef __int32 int_least32_t; + typedef __int64 int_least64_t; + typedef unsigned __int8 uint_least8_t; + typedef unsigned __int16 uint_least16_t; + typedef unsigned __int32 uint_least32_t; + typedef unsigned __int64 uint_least64_t; + typedef __int8 int_fast8_t; + typedef __int16 int_fast16_t; + typedef __int32 int_fast32_t; + typedef __int64 int_fast64_t; + typedef unsigned __int8 uint_fast8_t; + typedef unsigned __int16 uint_fast16_t; + typedef unsigned __int32 uint_fast32_t; + typedef unsigned __int64 uint_fast64_t; + typedef __int64 intmax_t; + typedef unsigned __int64 uintmax_t; +# else +# include +# endif +# if _MSC_VER < 1800 /* MSVC < 2013 */ +# ifndef __cplusplus + typedef unsigned char _Bool; +# endif +# endif +#else +# include +# if (defined (__SVR4) && defined (__sun)) || defined(_AIX) || defined(__hpux) +# include +# endif +#endif + +#ifdef __GNUC__ +# define _CFFI_UNUSED_FN __attribute__((unused)) +#else +# define _CFFI_UNUSED_FN /* nothing */ +#endif + +#ifdef __cplusplus +# ifndef _Bool + typedef bool _Bool; /* semi-hackish: C++ has no _Bool; bool is builtin */ +# endif +#endif + +/********** CPython-specific section **********/ +#ifndef PYPY_VERSION + + +#if PY_MAJOR_VERSION >= 3 +# define PyInt_FromLong PyLong_FromLong +#endif + +#define _cffi_from_c_double PyFloat_FromDouble +#define _cffi_from_c_float PyFloat_FromDouble +#define _cffi_from_c_long PyInt_FromLong +#define _cffi_from_c_ulong PyLong_FromUnsignedLong +#define _cffi_from_c_longlong PyLong_FromLongLong +#define _cffi_from_c_ulonglong PyLong_FromUnsignedLongLong + +#define _cffi_to_c_double PyFloat_AsDouble +#define _cffi_to_c_float PyFloat_AsDouble + +#define _cffi_from_c_int(x, type) \ + (((type)-1) > 0 ? /* unsigned */ \ + (sizeof(type) < sizeof(long) ? \ + PyInt_FromLong((long)x) : \ + sizeof(type) == sizeof(long) ? \ + PyLong_FromUnsignedLong((unsigned long)x) : \ + PyLong_FromUnsignedLongLong((unsigned long long)x)) : \ + (sizeof(type) <= sizeof(long) ? \ + PyInt_FromLong((long)x) : \ + PyLong_FromLongLong((long long)x))) + +#define _cffi_to_c_int(o, type) \ + ((type)( \ + sizeof(type) == 1 ? (((type)-1) > 0 ? (type)_cffi_to_c_u8(o) \ + : (type)_cffi_to_c_i8(o)) : \ + sizeof(type) == 2 ? (((type)-1) > 0 ? (type)_cffi_to_c_u16(o) \ + : (type)_cffi_to_c_i16(o)) : \ + sizeof(type) == 4 ? (((type)-1) > 0 ? (type)_cffi_to_c_u32(o) \ + : (type)_cffi_to_c_i32(o)) : \ + sizeof(type) == 8 ? (((type)-1) > 0 ? (type)_cffi_to_c_u64(o) \ + : (type)_cffi_to_c_i64(o)) : \ + (Py_FatalError("unsupported size for type " #type), (type)0))) + +#define _cffi_to_c_i8 \ + ((int(*)(PyObject *))_cffi_exports[1]) +#define _cffi_to_c_u8 \ + ((int(*)(PyObject *))_cffi_exports[2]) +#define _cffi_to_c_i16 \ + ((int(*)(PyObject *))_cffi_exports[3]) +#define _cffi_to_c_u16 \ + ((int(*)(PyObject *))_cffi_exports[4]) +#define _cffi_to_c_i32 \ + ((int(*)(PyObject *))_cffi_exports[5]) +#define _cffi_to_c_u32 \ + ((unsigned int(*)(PyObject *))_cffi_exports[6]) +#define _cffi_to_c_i64 \ + ((long long(*)(PyObject *))_cffi_exports[7]) +#define _cffi_to_c_u64 \ + ((unsigned long long(*)(PyObject *))_cffi_exports[8]) +#define _cffi_to_c_char \ + ((int(*)(PyObject *))_cffi_exports[9]) +#define _cffi_from_c_pointer \ + ((PyObject *(*)(char *, CTypeDescrObject *))_cffi_exports[10]) +#define _cffi_to_c_pointer \ + ((char *(*)(PyObject *, CTypeDescrObject *))_cffi_exports[11]) +#define _cffi_get_struct_layout \ + not used any more +#define _cffi_restore_errno \ + ((void(*)(void))_cffi_exports[13]) +#define _cffi_save_errno \ + ((void(*)(void))_cffi_exports[14]) +#define _cffi_from_c_char \ + ((PyObject *(*)(char))_cffi_exports[15]) +#define _cffi_from_c_deref \ + ((PyObject *(*)(char *, CTypeDescrObject *))_cffi_exports[16]) +#define _cffi_to_c \ + ((int(*)(char *, CTypeDescrObject *, PyObject *))_cffi_exports[17]) +#define _cffi_from_c_struct \ + ((PyObject *(*)(char *, CTypeDescrObject *))_cffi_exports[18]) +#define _cffi_to_c_wchar_t \ + ((wchar_t(*)(PyObject *))_cffi_exports[19]) +#define _cffi_from_c_wchar_t \ + ((PyObject *(*)(wchar_t))_cffi_exports[20]) +#define _cffi_to_c_long_double \ + ((long double(*)(PyObject *))_cffi_exports[21]) +#define _cffi_to_c__Bool \ + ((_Bool(*)(PyObject *))_cffi_exports[22]) +#define _cffi_prepare_pointer_call_argument \ + ((Py_ssize_t(*)(CTypeDescrObject *, PyObject *, char **))_cffi_exports[23]) +#define _cffi_convert_array_from_object \ + ((int(*)(char *, CTypeDescrObject *, PyObject *))_cffi_exports[24]) +#define _CFFI_CPIDX 25 +#define _cffi_call_python \ + ((void(*)(struct _cffi_externpy_s *, char *))_cffi_exports[_CFFI_CPIDX]) +#define _CFFI_NUM_EXPORTS 26 + +typedef struct _ctypedescr CTypeDescrObject; + +static void *_cffi_exports[_CFFI_NUM_EXPORTS]; + +#define _cffi_type(index) ( \ + assert((((uintptr_t)_cffi_types[index]) & 1) == 0), \ + (CTypeDescrObject *)_cffi_types[index]) + +static PyObject *_cffi_init(const char *module_name, Py_ssize_t version, + const struct _cffi_type_context_s *ctx) +{ + PyObject *module, *o_arg, *new_module; + void *raw[] = { + (void *)module_name, + (void *)version, + (void *)_cffi_exports, + (void *)ctx, + }; + + module = PyImport_ImportModule("_cffi_backend"); + if (module == NULL) + goto failure; + + o_arg = PyLong_FromVoidPtr((void *)raw); + if (o_arg == NULL) + goto failure; + + new_module = PyObject_CallMethod( + module, (char *)"_init_cffi_1_0_external_module", (char *)"O", o_arg); + + Py_DECREF(o_arg); + Py_DECREF(module); + return new_module; + + failure: + Py_XDECREF(module); + return NULL; +} + +/********** end CPython-specific section **********/ +#else +_CFFI_UNUSED_FN +static void (*_cffi_call_python_org)(struct _cffi_externpy_s *, char *); +# define _cffi_call_python _cffi_call_python_org +#endif + + +#define _cffi_array_len(array) (sizeof(array) / sizeof((array)[0])) + +#define _cffi_prim_int(size, sign) \ + ((size) == 1 ? ((sign) ? _CFFI_PRIM_INT8 : _CFFI_PRIM_UINT8) : \ + (size) == 2 ? ((sign) ? _CFFI_PRIM_INT16 : _CFFI_PRIM_UINT16) : \ + (size) == 4 ? ((sign) ? _CFFI_PRIM_INT32 : _CFFI_PRIM_UINT32) : \ + (size) == 8 ? ((sign) ? _CFFI_PRIM_INT64 : _CFFI_PRIM_UINT64) : \ + _CFFI__UNKNOWN_PRIM) + +#define _cffi_prim_float(size) \ + ((size) == sizeof(float) ? _CFFI_PRIM_FLOAT : \ + (size) == sizeof(double) ? _CFFI_PRIM_DOUBLE : \ + (size) == sizeof(long double) ? _CFFI__UNKNOWN_LONG_DOUBLE : \ + _CFFI__UNKNOWN_FLOAT_PRIM) + +#define _cffi_check_int(got, got_nonpos, expected) \ + ((got_nonpos) == (expected <= 0) && \ + (got) == (unsigned long long)expected) + +#ifdef MS_WIN32 +# define _cffi_stdcall __stdcall +#else +# define _cffi_stdcall /* nothing */ +#endif + +#ifdef __cplusplus +} +#endif + +/************************************************************/ + +#include + +/************************************************************/ + +static void *_cffi_types[] = { +/* 0 */ _CFFI_OP(_CFFI_OP_FUNCTION, 17), // char const *()(sqlite3 *) +/* 1 */ _CFFI_OP(_CFFI_OP_POINTER, 218), // sqlite3 * +/* 2 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 3 */ _CFFI_OP(_CFFI_OP_FUNCTION, 17), // char const *()(sqlite3_stmt *, int) +/* 4 */ _CFFI_OP(_CFFI_OP_POINTER, 221), // sqlite3_stmt * +/* 5 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 7), // int +/* 6 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 7 */ _CFFI_OP(_CFFI_OP_FUNCTION, 17), // char const *()(void) +/* 8 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 9 */ _CFFI_OP(_CFFI_OP_FUNCTION, 83), // double()(sqlite3_stmt *, int) +/* 10 */ _CFFI_OP(_CFFI_OP_NOOP, 4), +/* 11 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 7), +/* 12 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 13 */ _CFFI_OP(_CFFI_OP_FUNCTION, 83), // double()(sqlite3_value *) +/* 14 */ _CFFI_OP(_CFFI_OP_POINTER, 222), // sqlite3_value * +/* 15 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 16 */ _CFFI_OP(_CFFI_OP_FUNCTION, 5), // int()(char const *, sqlite3 * *) +/* 17 */ _CFFI_OP(_CFFI_OP_POINTER, 217), // char const * +/* 18 */ _CFFI_OP(_CFFI_OP_POINTER, 1), // sqlite3 * * +/* 19 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 20 */ _CFFI_OP(_CFFI_OP_FUNCTION, 5), // int()(int) +/* 21 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 7), +/* 22 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 23 */ _CFFI_OP(_CFFI_OP_FUNCTION, 5), // int()(sqlite3 *) +/* 24 */ _CFFI_OP(_CFFI_OP_NOOP, 1), +/* 25 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 26 */ _CFFI_OP(_CFFI_OP_FUNCTION, 5), // int()(sqlite3 *, char const *, int, int, void *, void(*)(sqlite3_context *, int, sqlite3_value * *), void(*)(sqlite3_context *, int, sqlite3_value * *), void(*)(sqlite3_context *)) +/* 27 */ _CFFI_OP(_CFFI_OP_NOOP, 1), +/* 28 */ _CFFI_OP(_CFFI_OP_NOOP, 17), +/* 29 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 7), +/* 30 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 7), +/* 31 */ _CFFI_OP(_CFFI_OP_POINTER, 226), // void * +/* 32 */ _CFFI_OP(_CFFI_OP_POINTER, 190), // void(*)(sqlite3_context *, int, sqlite3_value * *) +/* 33 */ _CFFI_OP(_CFFI_OP_NOOP, 32), +/* 34 */ _CFFI_OP(_CFFI_OP_POINTER, 168), // void(*)(sqlite3_context *) +/* 35 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 36 */ _CFFI_OP(_CFFI_OP_FUNCTION, 5), // int()(sqlite3 *, char const *, int, sqlite3_stmt * *, char const * *) +/* 37 */ _CFFI_OP(_CFFI_OP_NOOP, 1), +/* 38 */ _CFFI_OP(_CFFI_OP_NOOP, 17), +/* 39 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 7), +/* 40 */ _CFFI_OP(_CFFI_OP_POINTER, 4), // sqlite3_stmt * * +/* 41 */ _CFFI_OP(_CFFI_OP_POINTER, 17), // char const * * +/* 42 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 43 */ _CFFI_OP(_CFFI_OP_FUNCTION, 5), // int()(sqlite3 *, char const *, int, void *, int(*)(void *, int, void const *, int, void const *)) +/* 44 */ _CFFI_OP(_CFFI_OP_NOOP, 1), +/* 45 */ _CFFI_OP(_CFFI_OP_NOOP, 17), +/* 46 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 7), +/* 47 */ _CFFI_OP(_CFFI_OP_NOOP, 31), +/* 48 */ _CFFI_OP(_CFFI_OP_POINTER, 121), // int(*)(void *, int, void const *, int, void const *) +/* 49 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 50 */ _CFFI_OP(_CFFI_OP_FUNCTION, 5), // int()(sqlite3 *, int(*)(void *, int, char const *, char const *, char const *, char const *), void *) +/* 51 */ _CFFI_OP(_CFFI_OP_NOOP, 1), +/* 52 */ _CFFI_OP(_CFFI_OP_POINTER, 113), // int(*)(void *, int, char const *, char const *, char const *, char const *) +/* 53 */ _CFFI_OP(_CFFI_OP_NOOP, 31), +/* 54 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 55 */ _CFFI_OP(_CFFI_OP_FUNCTION, 5), // int()(sqlite3 *, int) +/* 56 */ _CFFI_OP(_CFFI_OP_NOOP, 1), +/* 57 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 7), +/* 58 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 59 */ _CFFI_OP(_CFFI_OP_FUNCTION, 5), // int()(sqlite3_backup *) +/* 60 */ _CFFI_OP(_CFFI_OP_POINTER, 219), // sqlite3_backup * +/* 61 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 62 */ _CFFI_OP(_CFFI_OP_FUNCTION, 5), // int()(sqlite3_backup *, int) +/* 63 */ _CFFI_OP(_CFFI_OP_NOOP, 60), +/* 64 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 7), +/* 65 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 66 */ _CFFI_OP(_CFFI_OP_FUNCTION, 5), // int()(sqlite3_stmt *) +/* 67 */ _CFFI_OP(_CFFI_OP_NOOP, 4), +/* 68 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 69 */ _CFFI_OP(_CFFI_OP_FUNCTION, 5), // int()(sqlite3_stmt *, int) +/* 70 */ _CFFI_OP(_CFFI_OP_NOOP, 4), +/* 71 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 7), +/* 72 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 73 */ _CFFI_OP(_CFFI_OP_FUNCTION, 5), // int()(sqlite3_stmt *, int, char const *, int, void(*)(void *)) +/* 74 */ _CFFI_OP(_CFFI_OP_NOOP, 4), +/* 75 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 7), +/* 76 */ _CFFI_OP(_CFFI_OP_NOOP, 17), +/* 77 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 7), +/* 78 */ _CFFI_OP(_CFFI_OP_POINTER, 214), // void(*)(void *) +/* 79 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 80 */ _CFFI_OP(_CFFI_OP_FUNCTION, 5), // int()(sqlite3_stmt *, int, double) +/* 81 */ _CFFI_OP(_CFFI_OP_NOOP, 4), +/* 82 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 7), +/* 83 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 14), // double +/* 84 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 85 */ _CFFI_OP(_CFFI_OP_FUNCTION, 5), // int()(sqlite3_stmt *, int, int) +/* 86 */ _CFFI_OP(_CFFI_OP_NOOP, 4), +/* 87 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 7), +/* 88 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 7), +/* 89 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 90 */ _CFFI_OP(_CFFI_OP_FUNCTION, 5), // int()(sqlite3_stmt *, int, int64_t) +/* 91 */ _CFFI_OP(_CFFI_OP_NOOP, 4), +/* 92 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 7), +/* 93 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 23), // int64_t +/* 94 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 95 */ _CFFI_OP(_CFFI_OP_FUNCTION, 5), // int()(sqlite3_stmt *, int, sqlite3_value const *) +/* 96 */ _CFFI_OP(_CFFI_OP_NOOP, 4), +/* 97 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 7), +/* 98 */ _CFFI_OP(_CFFI_OP_POINTER, 222), // sqlite3_value const * +/* 99 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 100 */ _CFFI_OP(_CFFI_OP_FUNCTION, 5), // int()(sqlite3_stmt *, int, void const *, int, void(*)(void *)) +/* 101 */ _CFFI_OP(_CFFI_OP_NOOP, 4), +/* 102 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 7), +/* 103 */ _CFFI_OP(_CFFI_OP_POINTER, 226), // void const * +/* 104 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 7), +/* 105 */ _CFFI_OP(_CFFI_OP_NOOP, 78), +/* 106 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 107 */ _CFFI_OP(_CFFI_OP_FUNCTION, 5), // int()(sqlite3_value *) +/* 108 */ _CFFI_OP(_CFFI_OP_NOOP, 14), +/* 109 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 110 */ _CFFI_OP(_CFFI_OP_FUNCTION, 5), // int()(void *) +/* 111 */ _CFFI_OP(_CFFI_OP_NOOP, 31), +/* 112 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 113 */ _CFFI_OP(_CFFI_OP_FUNCTION, 5), // int()(void *, int, char const *, char const *, char const *, char const *) +/* 114 */ _CFFI_OP(_CFFI_OP_NOOP, 31), +/* 115 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 7), +/* 116 */ _CFFI_OP(_CFFI_OP_NOOP, 17), +/* 117 */ _CFFI_OP(_CFFI_OP_NOOP, 17), +/* 118 */ _CFFI_OP(_CFFI_OP_NOOP, 17), +/* 119 */ _CFFI_OP(_CFFI_OP_NOOP, 17), +/* 120 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 121 */ _CFFI_OP(_CFFI_OP_FUNCTION, 5), // int()(void *, int, void const *, int, void const *) +/* 122 */ _CFFI_OP(_CFFI_OP_NOOP, 31), +/* 123 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 7), +/* 124 */ _CFFI_OP(_CFFI_OP_NOOP, 103), +/* 125 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 7), +/* 126 */ _CFFI_OP(_CFFI_OP_NOOP, 103), +/* 127 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 128 */ _CFFI_OP(_CFFI_OP_FUNCTION, 93), // int64_t()(sqlite3 *) +/* 129 */ _CFFI_OP(_CFFI_OP_NOOP, 1), +/* 130 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 131 */ _CFFI_OP(_CFFI_OP_FUNCTION, 93), // int64_t()(sqlite3_stmt *, int) +/* 132 */ _CFFI_OP(_CFFI_OP_NOOP, 4), +/* 133 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 7), +/* 134 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 135 */ _CFFI_OP(_CFFI_OP_FUNCTION, 93), // int64_t()(sqlite3_value *) +/* 136 */ _CFFI_OP(_CFFI_OP_NOOP, 14), +/* 137 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 138 */ _CFFI_OP(_CFFI_OP_FUNCTION, 60), // sqlite3_backup *()(sqlite3 *, char const *, sqlite3 *, char const *) +/* 139 */ _CFFI_OP(_CFFI_OP_NOOP, 1), +/* 140 */ _CFFI_OP(_CFFI_OP_NOOP, 17), +/* 141 */ _CFFI_OP(_CFFI_OP_NOOP, 1), +/* 142 */ _CFFI_OP(_CFFI_OP_NOOP, 17), +/* 143 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 144 */ _CFFI_OP(_CFFI_OP_FUNCTION, 224), // unsigned char const *()(sqlite3_stmt *, int) +/* 145 */ _CFFI_OP(_CFFI_OP_NOOP, 4), +/* 146 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 7), +/* 147 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 148 */ _CFFI_OP(_CFFI_OP_FUNCTION, 224), // unsigned char const *()(sqlite3_value *) +/* 149 */ _CFFI_OP(_CFFI_OP_NOOP, 14), +/* 150 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 151 */ _CFFI_OP(_CFFI_OP_FUNCTION, 31), // void *()(sqlite3_context *, int) +/* 152 */ _CFFI_OP(_CFFI_OP_POINTER, 220), // sqlite3_context * +/* 153 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 7), +/* 154 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 155 */ _CFFI_OP(_CFFI_OP_FUNCTION, 103), // void const *()(sqlite3_stmt *, int) +/* 156 */ _CFFI_OP(_CFFI_OP_NOOP, 4), +/* 157 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 7), +/* 158 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 159 */ _CFFI_OP(_CFFI_OP_FUNCTION, 103), // void const *()(sqlite3_value *) +/* 160 */ _CFFI_OP(_CFFI_OP_NOOP, 14), +/* 161 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 162 */ _CFFI_OP(_CFFI_OP_FUNCTION, 226), // void()(sqlite3 *, int, int(*)(void *), void *) +/* 163 */ _CFFI_OP(_CFFI_OP_NOOP, 1), +/* 164 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 7), +/* 165 */ _CFFI_OP(_CFFI_OP_POINTER, 110), // int(*)(void *) +/* 166 */ _CFFI_OP(_CFFI_OP_NOOP, 31), +/* 167 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 168 */ _CFFI_OP(_CFFI_OP_FUNCTION, 226), // void()(sqlite3_context *) +/* 169 */ _CFFI_OP(_CFFI_OP_NOOP, 152), +/* 170 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 171 */ _CFFI_OP(_CFFI_OP_FUNCTION, 226), // void()(sqlite3_context *, char const *, int) +/* 172 */ _CFFI_OP(_CFFI_OP_NOOP, 152), +/* 173 */ _CFFI_OP(_CFFI_OP_NOOP, 17), +/* 174 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 7), +/* 175 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 176 */ _CFFI_OP(_CFFI_OP_FUNCTION, 226), // void()(sqlite3_context *, char const *, int, void(*)(void *)) +/* 177 */ _CFFI_OP(_CFFI_OP_NOOP, 152), +/* 178 */ _CFFI_OP(_CFFI_OP_NOOP, 17), +/* 179 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 7), +/* 180 */ _CFFI_OP(_CFFI_OP_NOOP, 78), +/* 181 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 182 */ _CFFI_OP(_CFFI_OP_FUNCTION, 226), // void()(sqlite3_context *, double) +/* 183 */ _CFFI_OP(_CFFI_OP_NOOP, 152), +/* 184 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 14), +/* 185 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 186 */ _CFFI_OP(_CFFI_OP_FUNCTION, 226), // void()(sqlite3_context *, int) +/* 187 */ _CFFI_OP(_CFFI_OP_NOOP, 152), +/* 188 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 7), +/* 189 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 190 */ _CFFI_OP(_CFFI_OP_FUNCTION, 226), // void()(sqlite3_context *, int, sqlite3_value * *) +/* 191 */ _CFFI_OP(_CFFI_OP_NOOP, 152), +/* 192 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 7), +/* 193 */ _CFFI_OP(_CFFI_OP_POINTER, 14), // sqlite3_value * * +/* 194 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 195 */ _CFFI_OP(_CFFI_OP_FUNCTION, 226), // void()(sqlite3_context *, int64_t) +/* 196 */ _CFFI_OP(_CFFI_OP_NOOP, 152), +/* 197 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 23), +/* 198 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 199 */ _CFFI_OP(_CFFI_OP_FUNCTION, 226), // void()(sqlite3_context *, sqlite3_value *) +/* 200 */ _CFFI_OP(_CFFI_OP_NOOP, 152), +/* 201 */ _CFFI_OP(_CFFI_OP_NOOP, 14), +/* 202 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 203 */ _CFFI_OP(_CFFI_OP_FUNCTION, 226), // void()(sqlite3_context *, void const *, int) +/* 204 */ _CFFI_OP(_CFFI_OP_NOOP, 152), +/* 205 */ _CFFI_OP(_CFFI_OP_NOOP, 103), +/* 206 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 7), +/* 207 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 208 */ _CFFI_OP(_CFFI_OP_FUNCTION, 226), // void()(sqlite3_context *, void const *, int, void(*)(void *)) +/* 209 */ _CFFI_OP(_CFFI_OP_NOOP, 152), +/* 210 */ _CFFI_OP(_CFFI_OP_NOOP, 103), +/* 211 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 7), +/* 212 */ _CFFI_OP(_CFFI_OP_NOOP, 78), +/* 213 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 214 */ _CFFI_OP(_CFFI_OP_FUNCTION, 226), // void()(void *) +/* 215 */ _CFFI_OP(_CFFI_OP_NOOP, 31), +/* 216 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0), +/* 217 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 2), // char +/* 218 */ _CFFI_OP(_CFFI_OP_STRUCT_UNION, 0), // sqlite3 +/* 219 */ _CFFI_OP(_CFFI_OP_STRUCT_UNION, 1), // sqlite3_backup +/* 220 */ _CFFI_OP(_CFFI_OP_STRUCT_UNION, 2), // sqlite3_context +/* 221 */ _CFFI_OP(_CFFI_OP_STRUCT_UNION, 3), // sqlite3_stmt +/* 222 */ _CFFI_OP(_CFFI_OP_STRUCT_UNION, 4), // sqlite3_value +/* 223 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 24), // uint64_t +/* 224 */ _CFFI_OP(_CFFI_OP_POINTER, 225), // unsigned char const * +/* 225 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 4), // unsigned char +/* 226 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 0), // void +}; + +static void _cffi_const_SQLITE_TRANSIENT(char *o) +{ + *(void * *)o = SQLITE_TRANSIENT; +} + +static void * _cffi_d_sqlite3_aggregate_context(sqlite3_context * x0, int x1) +{ + return sqlite3_aggregate_context(x0, x1); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_aggregate_context(PyObject *self, PyObject *args) +{ + sqlite3_context * x0; + int x1; + Py_ssize_t datasize; + void * result; + PyObject *arg0; + PyObject *arg1; + + if (!PyArg_UnpackTuple(args, "sqlite3_aggregate_context", 2, 2, &arg0, &arg1)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(152), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_context *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(152), arg0) < 0) + return NULL; + } + + x1 = _cffi_to_c_int(arg1, int); + if (x1 == (int)-1 && PyErr_Occurred()) + return NULL; + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_aggregate_context(x0, x1); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_pointer((char *)result, _cffi_type(31)); +} +#else +# define _cffi_f_sqlite3_aggregate_context _cffi_d_sqlite3_aggregate_context +#endif + +static int _cffi_d_sqlite3_backup_finish(sqlite3_backup * x0) +{ + return sqlite3_backup_finish(x0); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_backup_finish(PyObject *self, PyObject *arg0) +{ + sqlite3_backup * x0; + Py_ssize_t datasize; + int result; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(60), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_backup *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(60), arg0) < 0) + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_backup_finish(x0); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_backup_finish _cffi_d_sqlite3_backup_finish +#endif + +static sqlite3_backup * _cffi_d_sqlite3_backup_init(sqlite3 * x0, char const * x1, sqlite3 * x2, char const * x3) +{ + return sqlite3_backup_init(x0, x1, x2, x3); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_backup_init(PyObject *self, PyObject *args) +{ + sqlite3 * x0; + char const * x1; + sqlite3 * x2; + char const * x3; + Py_ssize_t datasize; + sqlite3_backup * result; + PyObject *arg0; + PyObject *arg1; + PyObject *arg2; + PyObject *arg3; + + if (!PyArg_UnpackTuple(args, "sqlite3_backup_init", 4, 4, &arg0, &arg1, &arg2, &arg3)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(1), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3 *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(1), arg0) < 0) + return NULL; + } + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(17), arg1, (char **)&x1); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x1 = (char const *)alloca((size_t)datasize); + memset((void *)x1, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x1, _cffi_type(17), arg1) < 0) + return NULL; + } + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(1), arg2, (char **)&x2); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x2 = (sqlite3 *)alloca((size_t)datasize); + memset((void *)x2, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x2, _cffi_type(1), arg2) < 0) + return NULL; + } + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(17), arg3, (char **)&x3); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x3 = (char const *)alloca((size_t)datasize); + memset((void *)x3, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x3, _cffi_type(17), arg3) < 0) + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_backup_init(x0, x1, x2, x3); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_pointer((char *)result, _cffi_type(60)); +} +#else +# define _cffi_f_sqlite3_backup_init _cffi_d_sqlite3_backup_init +#endif + +static int _cffi_d_sqlite3_backup_pagecount(sqlite3_backup * x0) +{ + return sqlite3_backup_pagecount(x0); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_backup_pagecount(PyObject *self, PyObject *arg0) +{ + sqlite3_backup * x0; + Py_ssize_t datasize; + int result; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(60), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_backup *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(60), arg0) < 0) + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_backup_pagecount(x0); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_backup_pagecount _cffi_d_sqlite3_backup_pagecount +#endif + +static int _cffi_d_sqlite3_backup_remaining(sqlite3_backup * x0) +{ + return sqlite3_backup_remaining(x0); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_backup_remaining(PyObject *self, PyObject *arg0) +{ + sqlite3_backup * x0; + Py_ssize_t datasize; + int result; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(60), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_backup *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(60), arg0) < 0) + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_backup_remaining(x0); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_backup_remaining _cffi_d_sqlite3_backup_remaining +#endif + +static int _cffi_d_sqlite3_backup_step(sqlite3_backup * x0, int x1) +{ + return sqlite3_backup_step(x0, x1); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_backup_step(PyObject *self, PyObject *args) +{ + sqlite3_backup * x0; + int x1; + Py_ssize_t datasize; + int result; + PyObject *arg0; + PyObject *arg1; + + if (!PyArg_UnpackTuple(args, "sqlite3_backup_step", 2, 2, &arg0, &arg1)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(60), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_backup *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(60), arg0) < 0) + return NULL; + } + + x1 = _cffi_to_c_int(arg1, int); + if (x1 == (int)-1 && PyErr_Occurred()) + return NULL; + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_backup_step(x0, x1); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_backup_step _cffi_d_sqlite3_backup_step +#endif + +static int _cffi_d_sqlite3_bind_blob(sqlite3_stmt * x0, int x1, void const * x2, int x3, void(* x4)(void *)) +{ + return sqlite3_bind_blob(x0, x1, x2, x3, x4); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_bind_blob(PyObject *self, PyObject *args) +{ + sqlite3_stmt * x0; + int x1; + void const * x2; + int x3; + void(* x4)(void *); + Py_ssize_t datasize; + int result; + PyObject *arg0; + PyObject *arg1; + PyObject *arg2; + PyObject *arg3; + PyObject *arg4; + + if (!PyArg_UnpackTuple(args, "sqlite3_bind_blob", 5, 5, &arg0, &arg1, &arg2, &arg3, &arg4)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(4), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_stmt *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(4), arg0) < 0) + return NULL; + } + + x1 = _cffi_to_c_int(arg1, int); + if (x1 == (int)-1 && PyErr_Occurred()) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(103), arg2, (char **)&x2); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x2 = (void const *)alloca((size_t)datasize); + memset((void *)x2, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x2, _cffi_type(103), arg2) < 0) + return NULL; + } + + x3 = _cffi_to_c_int(arg3, int); + if (x3 == (int)-1 && PyErr_Occurred()) + return NULL; + + x4 = (void(*)(void *))_cffi_to_c_pointer(arg4, _cffi_type(78)); + if (x4 == (void(*)(void *))NULL && PyErr_Occurred()) + return NULL; + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_bind_blob(x0, x1, x2, x3, x4); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_bind_blob _cffi_d_sqlite3_bind_blob +#endif + +static int _cffi_d_sqlite3_bind_double(sqlite3_stmt * x0, int x1, double x2) +{ + return sqlite3_bind_double(x0, x1, x2); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_bind_double(PyObject *self, PyObject *args) +{ + sqlite3_stmt * x0; + int x1; + double x2; + Py_ssize_t datasize; + int result; + PyObject *arg0; + PyObject *arg1; + PyObject *arg2; + + if (!PyArg_UnpackTuple(args, "sqlite3_bind_double", 3, 3, &arg0, &arg1, &arg2)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(4), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_stmt *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(4), arg0) < 0) + return NULL; + } + + x1 = _cffi_to_c_int(arg1, int); + if (x1 == (int)-1 && PyErr_Occurred()) + return NULL; + + x2 = (double)_cffi_to_c_double(arg2); + if (x2 == (double)-1 && PyErr_Occurred()) + return NULL; + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_bind_double(x0, x1, x2); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_bind_double _cffi_d_sqlite3_bind_double +#endif + +static int _cffi_d_sqlite3_bind_int(sqlite3_stmt * x0, int x1, int x2) +{ + return sqlite3_bind_int(x0, x1, x2); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_bind_int(PyObject *self, PyObject *args) +{ + sqlite3_stmt * x0; + int x1; + int x2; + Py_ssize_t datasize; + int result; + PyObject *arg0; + PyObject *arg1; + PyObject *arg2; + + if (!PyArg_UnpackTuple(args, "sqlite3_bind_int", 3, 3, &arg0, &arg1, &arg2)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(4), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_stmt *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(4), arg0) < 0) + return NULL; + } + + x1 = _cffi_to_c_int(arg1, int); + if (x1 == (int)-1 && PyErr_Occurred()) + return NULL; + + x2 = _cffi_to_c_int(arg2, int); + if (x2 == (int)-1 && PyErr_Occurred()) + return NULL; + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_bind_int(x0, x1, x2); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_bind_int _cffi_d_sqlite3_bind_int +#endif + +static int _cffi_d_sqlite3_bind_int64(sqlite3_stmt * x0, int x1, int64_t x2) +{ + return sqlite3_bind_int64(x0, x1, x2); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_bind_int64(PyObject *self, PyObject *args) +{ + sqlite3_stmt * x0; + int x1; + int64_t x2; + Py_ssize_t datasize; + int result; + PyObject *arg0; + PyObject *arg1; + PyObject *arg2; + + if (!PyArg_UnpackTuple(args, "sqlite3_bind_int64", 3, 3, &arg0, &arg1, &arg2)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(4), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_stmt *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(4), arg0) < 0) + return NULL; + } + + x1 = _cffi_to_c_int(arg1, int); + if (x1 == (int)-1 && PyErr_Occurred()) + return NULL; + + x2 = _cffi_to_c_int(arg2, int64_t); + if (x2 == (int64_t)-1 && PyErr_Occurred()) + return NULL; + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_bind_int64(x0, x1, x2); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_bind_int64 _cffi_d_sqlite3_bind_int64 +#endif + +static int _cffi_d_sqlite3_bind_null(sqlite3_stmt * x0, int x1) +{ + return sqlite3_bind_null(x0, x1); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_bind_null(PyObject *self, PyObject *args) +{ + sqlite3_stmt * x0; + int x1; + Py_ssize_t datasize; + int result; + PyObject *arg0; + PyObject *arg1; + + if (!PyArg_UnpackTuple(args, "sqlite3_bind_null", 2, 2, &arg0, &arg1)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(4), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_stmt *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(4), arg0) < 0) + return NULL; + } + + x1 = _cffi_to_c_int(arg1, int); + if (x1 == (int)-1 && PyErr_Occurred()) + return NULL; + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_bind_null(x0, x1); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_bind_null _cffi_d_sqlite3_bind_null +#endif + +static int _cffi_d_sqlite3_bind_parameter_count(sqlite3_stmt * x0) +{ + return sqlite3_bind_parameter_count(x0); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_bind_parameter_count(PyObject *self, PyObject *arg0) +{ + sqlite3_stmt * x0; + Py_ssize_t datasize; + int result; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(4), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_stmt *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(4), arg0) < 0) + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_bind_parameter_count(x0); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_bind_parameter_count _cffi_d_sqlite3_bind_parameter_count +#endif + +static char const * _cffi_d_sqlite3_bind_parameter_name(sqlite3_stmt * x0, int x1) +{ + return sqlite3_bind_parameter_name(x0, x1); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_bind_parameter_name(PyObject *self, PyObject *args) +{ + sqlite3_stmt * x0; + int x1; + Py_ssize_t datasize; + char const * result; + PyObject *arg0; + PyObject *arg1; + + if (!PyArg_UnpackTuple(args, "sqlite3_bind_parameter_name", 2, 2, &arg0, &arg1)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(4), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_stmt *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(4), arg0) < 0) + return NULL; + } + + x1 = _cffi_to_c_int(arg1, int); + if (x1 == (int)-1 && PyErr_Occurred()) + return NULL; + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_bind_parameter_name(x0, x1); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_pointer((char *)result, _cffi_type(17)); +} +#else +# define _cffi_f_sqlite3_bind_parameter_name _cffi_d_sqlite3_bind_parameter_name +#endif + +static int _cffi_d_sqlite3_bind_text(sqlite3_stmt * x0, int x1, char const * x2, int x3, void(* x4)(void *)) +{ + return sqlite3_bind_text(x0, x1, x2, x3, x4); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_bind_text(PyObject *self, PyObject *args) +{ + sqlite3_stmt * x0; + int x1; + char const * x2; + int x3; + void(* x4)(void *); + Py_ssize_t datasize; + int result; + PyObject *arg0; + PyObject *arg1; + PyObject *arg2; + PyObject *arg3; + PyObject *arg4; + + if (!PyArg_UnpackTuple(args, "sqlite3_bind_text", 5, 5, &arg0, &arg1, &arg2, &arg3, &arg4)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(4), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_stmt *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(4), arg0) < 0) + return NULL; + } + + x1 = _cffi_to_c_int(arg1, int); + if (x1 == (int)-1 && PyErr_Occurred()) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(17), arg2, (char **)&x2); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x2 = (char const *)alloca((size_t)datasize); + memset((void *)x2, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x2, _cffi_type(17), arg2) < 0) + return NULL; + } + + x3 = _cffi_to_c_int(arg3, int); + if (x3 == (int)-1 && PyErr_Occurred()) + return NULL; + + x4 = (void(*)(void *))_cffi_to_c_pointer(arg4, _cffi_type(78)); + if (x4 == (void(*)(void *))NULL && PyErr_Occurred()) + return NULL; + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_bind_text(x0, x1, x2, x3, x4); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_bind_text _cffi_d_sqlite3_bind_text +#endif + +static int _cffi_d_sqlite3_bind_text16(sqlite3_stmt * x0, int x1, void const * x2, int x3, void(* x4)(void *)) +{ + return sqlite3_bind_text16(x0, x1, x2, x3, x4); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_bind_text16(PyObject *self, PyObject *args) +{ + sqlite3_stmt * x0; + int x1; + void const * x2; + int x3; + void(* x4)(void *); + Py_ssize_t datasize; + int result; + PyObject *arg0; + PyObject *arg1; + PyObject *arg2; + PyObject *arg3; + PyObject *arg4; + + if (!PyArg_UnpackTuple(args, "sqlite3_bind_text16", 5, 5, &arg0, &arg1, &arg2, &arg3, &arg4)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(4), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_stmt *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(4), arg0) < 0) + return NULL; + } + + x1 = _cffi_to_c_int(arg1, int); + if (x1 == (int)-1 && PyErr_Occurred()) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(103), arg2, (char **)&x2); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x2 = (void const *)alloca((size_t)datasize); + memset((void *)x2, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x2, _cffi_type(103), arg2) < 0) + return NULL; + } + + x3 = _cffi_to_c_int(arg3, int); + if (x3 == (int)-1 && PyErr_Occurred()) + return NULL; + + x4 = (void(*)(void *))_cffi_to_c_pointer(arg4, _cffi_type(78)); + if (x4 == (void(*)(void *))NULL && PyErr_Occurred()) + return NULL; + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_bind_text16(x0, x1, x2, x3, x4); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_bind_text16 _cffi_d_sqlite3_bind_text16 +#endif + +static int _cffi_d_sqlite3_bind_value(sqlite3_stmt * x0, int x1, sqlite3_value const * x2) +{ + return sqlite3_bind_value(x0, x1, x2); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_bind_value(PyObject *self, PyObject *args) +{ + sqlite3_stmt * x0; + int x1; + sqlite3_value const * x2; + Py_ssize_t datasize; + int result; + PyObject *arg0; + PyObject *arg1; + PyObject *arg2; + + if (!PyArg_UnpackTuple(args, "sqlite3_bind_value", 3, 3, &arg0, &arg1, &arg2)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(4), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_stmt *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(4), arg0) < 0) + return NULL; + } + + x1 = _cffi_to_c_int(arg1, int); + if (x1 == (int)-1 && PyErr_Occurred()) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(98), arg2, (char **)&x2); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x2 = (sqlite3_value const *)alloca((size_t)datasize); + memset((void *)x2, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x2, _cffi_type(98), arg2) < 0) + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_bind_value(x0, x1, x2); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_bind_value _cffi_d_sqlite3_bind_value +#endif + +static int _cffi_d_sqlite3_bind_zeroblob(sqlite3_stmt * x0, int x1, int x2) +{ + return sqlite3_bind_zeroblob(x0, x1, x2); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_bind_zeroblob(PyObject *self, PyObject *args) +{ + sqlite3_stmt * x0; + int x1; + int x2; + Py_ssize_t datasize; + int result; + PyObject *arg0; + PyObject *arg1; + PyObject *arg2; + + if (!PyArg_UnpackTuple(args, "sqlite3_bind_zeroblob", 3, 3, &arg0, &arg1, &arg2)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(4), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_stmt *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(4), arg0) < 0) + return NULL; + } + + x1 = _cffi_to_c_int(arg1, int); + if (x1 == (int)-1 && PyErr_Occurred()) + return NULL; + + x2 = _cffi_to_c_int(arg2, int); + if (x2 == (int)-1 && PyErr_Occurred()) + return NULL; + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_bind_zeroblob(x0, x1, x2); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_bind_zeroblob _cffi_d_sqlite3_bind_zeroblob +#endif + +static int _cffi_d_sqlite3_busy_timeout(sqlite3 * x0, int x1) +{ + return sqlite3_busy_timeout(x0, x1); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_busy_timeout(PyObject *self, PyObject *args) +{ + sqlite3 * x0; + int x1; + Py_ssize_t datasize; + int result; + PyObject *arg0; + PyObject *arg1; + + if (!PyArg_UnpackTuple(args, "sqlite3_busy_timeout", 2, 2, &arg0, &arg1)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(1), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3 *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(1), arg0) < 0) + return NULL; + } + + x1 = _cffi_to_c_int(arg1, int); + if (x1 == (int)-1 && PyErr_Occurred()) + return NULL; + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_busy_timeout(x0, x1); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_busy_timeout _cffi_d_sqlite3_busy_timeout +#endif + +static int _cffi_d_sqlite3_changes(sqlite3 * x0) +{ + return sqlite3_changes(x0); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_changes(PyObject *self, PyObject *arg0) +{ + sqlite3 * x0; + Py_ssize_t datasize; + int result; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(1), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3 *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(1), arg0) < 0) + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_changes(x0); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_changes _cffi_d_sqlite3_changes +#endif + +static int _cffi_d_sqlite3_close(sqlite3 * x0) +{ + return sqlite3_close(x0); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_close(PyObject *self, PyObject *arg0) +{ + sqlite3 * x0; + Py_ssize_t datasize; + int result; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(1), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3 *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(1), arg0) < 0) + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_close(x0); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_close _cffi_d_sqlite3_close +#endif + +static void const * _cffi_d_sqlite3_column_blob(sqlite3_stmt * x0, int x1) +{ + return sqlite3_column_blob(x0, x1); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_column_blob(PyObject *self, PyObject *args) +{ + sqlite3_stmt * x0; + int x1; + Py_ssize_t datasize; + void const * result; + PyObject *arg0; + PyObject *arg1; + + if (!PyArg_UnpackTuple(args, "sqlite3_column_blob", 2, 2, &arg0, &arg1)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(4), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_stmt *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(4), arg0) < 0) + return NULL; + } + + x1 = _cffi_to_c_int(arg1, int); + if (x1 == (int)-1 && PyErr_Occurred()) + return NULL; + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_column_blob(x0, x1); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_pointer((char *)result, _cffi_type(103)); +} +#else +# define _cffi_f_sqlite3_column_blob _cffi_d_sqlite3_column_blob +#endif + +static int _cffi_d_sqlite3_column_bytes(sqlite3_stmt * x0, int x1) +{ + return sqlite3_column_bytes(x0, x1); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_column_bytes(PyObject *self, PyObject *args) +{ + sqlite3_stmt * x0; + int x1; + Py_ssize_t datasize; + int result; + PyObject *arg0; + PyObject *arg1; + + if (!PyArg_UnpackTuple(args, "sqlite3_column_bytes", 2, 2, &arg0, &arg1)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(4), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_stmt *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(4), arg0) < 0) + return NULL; + } + + x1 = _cffi_to_c_int(arg1, int); + if (x1 == (int)-1 && PyErr_Occurred()) + return NULL; + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_column_bytes(x0, x1); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_column_bytes _cffi_d_sqlite3_column_bytes +#endif + +static int _cffi_d_sqlite3_column_count(sqlite3_stmt * x0) +{ + return sqlite3_column_count(x0); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_column_count(PyObject *self, PyObject *arg0) +{ + sqlite3_stmt * x0; + Py_ssize_t datasize; + int result; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(4), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_stmt *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(4), arg0) < 0) + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_column_count(x0); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_column_count _cffi_d_sqlite3_column_count +#endif + +static char const * _cffi_d_sqlite3_column_decltype(sqlite3_stmt * x0, int x1) +{ + return sqlite3_column_decltype(x0, x1); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_column_decltype(PyObject *self, PyObject *args) +{ + sqlite3_stmt * x0; + int x1; + Py_ssize_t datasize; + char const * result; + PyObject *arg0; + PyObject *arg1; + + if (!PyArg_UnpackTuple(args, "sqlite3_column_decltype", 2, 2, &arg0, &arg1)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(4), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_stmt *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(4), arg0) < 0) + return NULL; + } + + x1 = _cffi_to_c_int(arg1, int); + if (x1 == (int)-1 && PyErr_Occurred()) + return NULL; + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_column_decltype(x0, x1); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_pointer((char *)result, _cffi_type(17)); +} +#else +# define _cffi_f_sqlite3_column_decltype _cffi_d_sqlite3_column_decltype +#endif + +static double _cffi_d_sqlite3_column_double(sqlite3_stmt * x0, int x1) +{ + return sqlite3_column_double(x0, x1); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_column_double(PyObject *self, PyObject *args) +{ + sqlite3_stmt * x0; + int x1; + Py_ssize_t datasize; + double result; + PyObject *arg0; + PyObject *arg1; + + if (!PyArg_UnpackTuple(args, "sqlite3_column_double", 2, 2, &arg0, &arg1)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(4), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_stmt *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(4), arg0) < 0) + return NULL; + } + + x1 = _cffi_to_c_int(arg1, int); + if (x1 == (int)-1 && PyErr_Occurred()) + return NULL; + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_column_double(x0, x1); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_double(result); +} +#else +# define _cffi_f_sqlite3_column_double _cffi_d_sqlite3_column_double +#endif + +static int _cffi_d_sqlite3_column_int(sqlite3_stmt * x0, int x1) +{ + return sqlite3_column_int(x0, x1); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_column_int(PyObject *self, PyObject *args) +{ + sqlite3_stmt * x0; + int x1; + Py_ssize_t datasize; + int result; + PyObject *arg0; + PyObject *arg1; + + if (!PyArg_UnpackTuple(args, "sqlite3_column_int", 2, 2, &arg0, &arg1)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(4), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_stmt *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(4), arg0) < 0) + return NULL; + } + + x1 = _cffi_to_c_int(arg1, int); + if (x1 == (int)-1 && PyErr_Occurred()) + return NULL; + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_column_int(x0, x1); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_column_int _cffi_d_sqlite3_column_int +#endif + +static int64_t _cffi_d_sqlite3_column_int64(sqlite3_stmt * x0, int x1) +{ + return sqlite3_column_int64(x0, x1); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_column_int64(PyObject *self, PyObject *args) +{ + sqlite3_stmt * x0; + int x1; + Py_ssize_t datasize; + int64_t result; + PyObject *arg0; + PyObject *arg1; + + if (!PyArg_UnpackTuple(args, "sqlite3_column_int64", 2, 2, &arg0, &arg1)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(4), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_stmt *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(4), arg0) < 0) + return NULL; + } + + x1 = _cffi_to_c_int(arg1, int); + if (x1 == (int)-1 && PyErr_Occurred()) + return NULL; + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_column_int64(x0, x1); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int64_t); +} +#else +# define _cffi_f_sqlite3_column_int64 _cffi_d_sqlite3_column_int64 +#endif + +static char const * _cffi_d_sqlite3_column_name(sqlite3_stmt * x0, int x1) +{ + return sqlite3_column_name(x0, x1); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_column_name(PyObject *self, PyObject *args) +{ + sqlite3_stmt * x0; + int x1; + Py_ssize_t datasize; + char const * result; + PyObject *arg0; + PyObject *arg1; + + if (!PyArg_UnpackTuple(args, "sqlite3_column_name", 2, 2, &arg0, &arg1)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(4), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_stmt *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(4), arg0) < 0) + return NULL; + } + + x1 = _cffi_to_c_int(arg1, int); + if (x1 == (int)-1 && PyErr_Occurred()) + return NULL; + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_column_name(x0, x1); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_pointer((char *)result, _cffi_type(17)); +} +#else +# define _cffi_f_sqlite3_column_name _cffi_d_sqlite3_column_name +#endif + +static unsigned char const * _cffi_d_sqlite3_column_text(sqlite3_stmt * x0, int x1) +{ + return sqlite3_column_text(x0, x1); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_column_text(PyObject *self, PyObject *args) +{ + sqlite3_stmt * x0; + int x1; + Py_ssize_t datasize; + unsigned char const * result; + PyObject *arg0; + PyObject *arg1; + + if (!PyArg_UnpackTuple(args, "sqlite3_column_text", 2, 2, &arg0, &arg1)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(4), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_stmt *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(4), arg0) < 0) + return NULL; + } + + x1 = _cffi_to_c_int(arg1, int); + if (x1 == (int)-1 && PyErr_Occurred()) + return NULL; + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_column_text(x0, x1); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_pointer((char *)result, _cffi_type(224)); +} +#else +# define _cffi_f_sqlite3_column_text _cffi_d_sqlite3_column_text +#endif + +static void const * _cffi_d_sqlite3_column_text16(sqlite3_stmt * x0, int x1) +{ + return sqlite3_column_text16(x0, x1); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_column_text16(PyObject *self, PyObject *args) +{ + sqlite3_stmt * x0; + int x1; + Py_ssize_t datasize; + void const * result; + PyObject *arg0; + PyObject *arg1; + + if (!PyArg_UnpackTuple(args, "sqlite3_column_text16", 2, 2, &arg0, &arg1)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(4), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_stmt *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(4), arg0) < 0) + return NULL; + } + + x1 = _cffi_to_c_int(arg1, int); + if (x1 == (int)-1 && PyErr_Occurred()) + return NULL; + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_column_text16(x0, x1); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_pointer((char *)result, _cffi_type(103)); +} +#else +# define _cffi_f_sqlite3_column_text16 _cffi_d_sqlite3_column_text16 +#endif + +static int _cffi_d_sqlite3_column_type(sqlite3_stmt * x0, int x1) +{ + return sqlite3_column_type(x0, x1); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_column_type(PyObject *self, PyObject *args) +{ + sqlite3_stmt * x0; + int x1; + Py_ssize_t datasize; + int result; + PyObject *arg0; + PyObject *arg1; + + if (!PyArg_UnpackTuple(args, "sqlite3_column_type", 2, 2, &arg0, &arg1)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(4), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_stmt *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(4), arg0) < 0) + return NULL; + } + + x1 = _cffi_to_c_int(arg1, int); + if (x1 == (int)-1 && PyErr_Occurred()) + return NULL; + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_column_type(x0, x1); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_column_type _cffi_d_sqlite3_column_type +#endif + +static int _cffi_d_sqlite3_create_collation(sqlite3 * x0, char const * x1, int x2, void * x3, int(* x4)(void *, int, void const *, int, void const *)) +{ + return sqlite3_create_collation(x0, x1, x2, x3, x4); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_create_collation(PyObject *self, PyObject *args) +{ + sqlite3 * x0; + char const * x1; + int x2; + void * x3; + int(* x4)(void *, int, void const *, int, void const *); + Py_ssize_t datasize; + int result; + PyObject *arg0; + PyObject *arg1; + PyObject *arg2; + PyObject *arg3; + PyObject *arg4; + + if (!PyArg_UnpackTuple(args, "sqlite3_create_collation", 5, 5, &arg0, &arg1, &arg2, &arg3, &arg4)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(1), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3 *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(1), arg0) < 0) + return NULL; + } + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(17), arg1, (char **)&x1); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x1 = (char const *)alloca((size_t)datasize); + memset((void *)x1, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x1, _cffi_type(17), arg1) < 0) + return NULL; + } + + x2 = _cffi_to_c_int(arg2, int); + if (x2 == (int)-1 && PyErr_Occurred()) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(31), arg3, (char **)&x3); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x3 = (void *)alloca((size_t)datasize); + memset((void *)x3, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x3, _cffi_type(31), arg3) < 0) + return NULL; + } + + x4 = (int(*)(void *, int, void const *, int, void const *))_cffi_to_c_pointer(arg4, _cffi_type(48)); + if (x4 == (int(*)(void *, int, void const *, int, void const *))NULL && PyErr_Occurred()) + return NULL; + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_create_collation(x0, x1, x2, x3, x4); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_create_collation _cffi_d_sqlite3_create_collation +#endif + +static int _cffi_d_sqlite3_create_function(sqlite3 * x0, char const * x1, int x2, int x3, void * x4, void(* x5)(sqlite3_context *, int, sqlite3_value * *), void(* x6)(sqlite3_context *, int, sqlite3_value * *), void(* x7)(sqlite3_context *)) +{ + return sqlite3_create_function(x0, x1, x2, x3, x4, x5, x6, x7); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_create_function(PyObject *self, PyObject *args) +{ + sqlite3 * x0; + char const * x1; + int x2; + int x3; + void * x4; + void(* x5)(sqlite3_context *, int, sqlite3_value * *); + void(* x6)(sqlite3_context *, int, sqlite3_value * *); + void(* x7)(sqlite3_context *); + Py_ssize_t datasize; + int result; + PyObject *arg0; + PyObject *arg1; + PyObject *arg2; + PyObject *arg3; + PyObject *arg4; + PyObject *arg5; + PyObject *arg6; + PyObject *arg7; + + if (!PyArg_UnpackTuple(args, "sqlite3_create_function", 8, 8, &arg0, &arg1, &arg2, &arg3, &arg4, &arg5, &arg6, &arg7)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(1), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3 *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(1), arg0) < 0) + return NULL; + } + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(17), arg1, (char **)&x1); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x1 = (char const *)alloca((size_t)datasize); + memset((void *)x1, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x1, _cffi_type(17), arg1) < 0) + return NULL; + } + + x2 = _cffi_to_c_int(arg2, int); + if (x2 == (int)-1 && PyErr_Occurred()) + return NULL; + + x3 = _cffi_to_c_int(arg3, int); + if (x3 == (int)-1 && PyErr_Occurred()) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(31), arg4, (char **)&x4); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x4 = (void *)alloca((size_t)datasize); + memset((void *)x4, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x4, _cffi_type(31), arg4) < 0) + return NULL; + } + + x5 = (void(*)(sqlite3_context *, int, sqlite3_value * *))_cffi_to_c_pointer(arg5, _cffi_type(32)); + if (x5 == (void(*)(sqlite3_context *, int, sqlite3_value * *))NULL && PyErr_Occurred()) + return NULL; + + x6 = (void(*)(sqlite3_context *, int, sqlite3_value * *))_cffi_to_c_pointer(arg6, _cffi_type(32)); + if (x6 == (void(*)(sqlite3_context *, int, sqlite3_value * *))NULL && PyErr_Occurred()) + return NULL; + + x7 = (void(*)(sqlite3_context *))_cffi_to_c_pointer(arg7, _cffi_type(34)); + if (x7 == (void(*)(sqlite3_context *))NULL && PyErr_Occurred()) + return NULL; + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_create_function(x0, x1, x2, x3, x4, x5, x6, x7); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_create_function _cffi_d_sqlite3_create_function +#endif + +static int _cffi_d_sqlite3_data_count(sqlite3_stmt * x0) +{ + return sqlite3_data_count(x0); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_data_count(PyObject *self, PyObject *arg0) +{ + sqlite3_stmt * x0; + Py_ssize_t datasize; + int result; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(4), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_stmt *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(4), arg0) < 0) + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_data_count(x0); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_data_count _cffi_d_sqlite3_data_count +#endif + +static int _cffi_d_sqlite3_enable_load_extension(sqlite3 * x0, int x1) +{ + return sqlite3_enable_load_extension(x0, x1); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_enable_load_extension(PyObject *self, PyObject *args) +{ + sqlite3 * x0; + int x1; + Py_ssize_t datasize; + int result; + PyObject *arg0; + PyObject *arg1; + + if (!PyArg_UnpackTuple(args, "sqlite3_enable_load_extension", 2, 2, &arg0, &arg1)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(1), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3 *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(1), arg0) < 0) + return NULL; + } + + x1 = _cffi_to_c_int(arg1, int); + if (x1 == (int)-1 && PyErr_Occurred()) + return NULL; + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_enable_load_extension(x0, x1); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_enable_load_extension _cffi_d_sqlite3_enable_load_extension +#endif + +static int _cffi_d_sqlite3_errcode(sqlite3 * x0) +{ + return sqlite3_errcode(x0); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_errcode(PyObject *self, PyObject *arg0) +{ + sqlite3 * x0; + Py_ssize_t datasize; + int result; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(1), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3 *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(1), arg0) < 0) + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_errcode(x0); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_errcode _cffi_d_sqlite3_errcode +#endif + +static char const * _cffi_d_sqlite3_errmsg(sqlite3 * x0) +{ + return sqlite3_errmsg(x0); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_errmsg(PyObject *self, PyObject *arg0) +{ + sqlite3 * x0; + Py_ssize_t datasize; + char const * result; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(1), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3 *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(1), arg0) < 0) + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_errmsg(x0); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_pointer((char *)result, _cffi_type(17)); +} +#else +# define _cffi_f_sqlite3_errmsg _cffi_d_sqlite3_errmsg +#endif + +static int _cffi_d_sqlite3_finalize(sqlite3_stmt * x0) +{ + return sqlite3_finalize(x0); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_finalize(PyObject *self, PyObject *arg0) +{ + sqlite3_stmt * x0; + Py_ssize_t datasize; + int result; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(4), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_stmt *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(4), arg0) < 0) + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_finalize(x0); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_finalize _cffi_d_sqlite3_finalize +#endif + +static int _cffi_d_sqlite3_get_autocommit(sqlite3 * x0) +{ + return sqlite3_get_autocommit(x0); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_get_autocommit(PyObject *self, PyObject *arg0) +{ + sqlite3 * x0; + Py_ssize_t datasize; + int result; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(1), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3 *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(1), arg0) < 0) + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_get_autocommit(x0); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_get_autocommit _cffi_d_sqlite3_get_autocommit +#endif + +static int64_t _cffi_d_sqlite3_last_insert_rowid(sqlite3 * x0) +{ + return sqlite3_last_insert_rowid(x0); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_last_insert_rowid(PyObject *self, PyObject *arg0) +{ + sqlite3 * x0; + Py_ssize_t datasize; + int64_t result; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(1), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3 *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(1), arg0) < 0) + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_last_insert_rowid(x0); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int64_t); +} +#else +# define _cffi_f_sqlite3_last_insert_rowid _cffi_d_sqlite3_last_insert_rowid +#endif + +static char const * _cffi_d_sqlite3_libversion(void) +{ + return sqlite3_libversion(); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_libversion(PyObject *self, PyObject *noarg) +{ + char const * result; + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_libversion(); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + (void)noarg; /* unused */ + return _cffi_from_c_pointer((char *)result, _cffi_type(17)); +} +#else +# define _cffi_f_sqlite3_libversion _cffi_d_sqlite3_libversion +#endif + +static int _cffi_d_sqlite3_open(char const * x0, sqlite3 * * x1) +{ + return sqlite3_open(x0, x1); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_open(PyObject *self, PyObject *args) +{ + char const * x0; + sqlite3 * * x1; + Py_ssize_t datasize; + int result; + PyObject *arg0; + PyObject *arg1; + + if (!PyArg_UnpackTuple(args, "sqlite3_open", 2, 2, &arg0, &arg1)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(17), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (char const *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(17), arg0) < 0) + return NULL; + } + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(18), arg1, (char **)&x1); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x1 = (sqlite3 * *)alloca((size_t)datasize); + memset((void *)x1, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x1, _cffi_type(18), arg1) < 0) + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_open(x0, x1); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_open _cffi_d_sqlite3_open +#endif + +static int _cffi_d_sqlite3_prepare(sqlite3 * x0, char const * x1, int x2, sqlite3_stmt * * x3, char const * * x4) +{ + return sqlite3_prepare(x0, x1, x2, x3, x4); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_prepare(PyObject *self, PyObject *args) +{ + sqlite3 * x0; + char const * x1; + int x2; + sqlite3_stmt * * x3; + char const * * x4; + Py_ssize_t datasize; + int result; + PyObject *arg0; + PyObject *arg1; + PyObject *arg2; + PyObject *arg3; + PyObject *arg4; + + if (!PyArg_UnpackTuple(args, "sqlite3_prepare", 5, 5, &arg0, &arg1, &arg2, &arg3, &arg4)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(1), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3 *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(1), arg0) < 0) + return NULL; + } + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(17), arg1, (char **)&x1); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x1 = (char const *)alloca((size_t)datasize); + memset((void *)x1, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x1, _cffi_type(17), arg1) < 0) + return NULL; + } + + x2 = _cffi_to_c_int(arg2, int); + if (x2 == (int)-1 && PyErr_Occurred()) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(40), arg3, (char **)&x3); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x3 = (sqlite3_stmt * *)alloca((size_t)datasize); + memset((void *)x3, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x3, _cffi_type(40), arg3) < 0) + return NULL; + } + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(41), arg4, (char **)&x4); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x4 = (char const * *)alloca((size_t)datasize); + memset((void *)x4, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x4, _cffi_type(41), arg4) < 0) + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_prepare(x0, x1, x2, x3, x4); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_prepare _cffi_d_sqlite3_prepare +#endif + +static int _cffi_d_sqlite3_prepare_v2(sqlite3 * x0, char const * x1, int x2, sqlite3_stmt * * x3, char const * * x4) +{ + return sqlite3_prepare_v2(x0, x1, x2, x3, x4); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_prepare_v2(PyObject *self, PyObject *args) +{ + sqlite3 * x0; + char const * x1; + int x2; + sqlite3_stmt * * x3; + char const * * x4; + Py_ssize_t datasize; + int result; + PyObject *arg0; + PyObject *arg1; + PyObject *arg2; + PyObject *arg3; + PyObject *arg4; + + if (!PyArg_UnpackTuple(args, "sqlite3_prepare_v2", 5, 5, &arg0, &arg1, &arg2, &arg3, &arg4)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(1), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3 *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(1), arg0) < 0) + return NULL; + } + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(17), arg1, (char **)&x1); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x1 = (char const *)alloca((size_t)datasize); + memset((void *)x1, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x1, _cffi_type(17), arg1) < 0) + return NULL; + } + + x2 = _cffi_to_c_int(arg2, int); + if (x2 == (int)-1 && PyErr_Occurred()) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(40), arg3, (char **)&x3); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x3 = (sqlite3_stmt * *)alloca((size_t)datasize); + memset((void *)x3, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x3, _cffi_type(40), arg3) < 0) + return NULL; + } + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(41), arg4, (char **)&x4); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x4 = (char const * *)alloca((size_t)datasize); + memset((void *)x4, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x4, _cffi_type(41), arg4) < 0) + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_prepare_v2(x0, x1, x2, x3, x4); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_prepare_v2 _cffi_d_sqlite3_prepare_v2 +#endif + +static void _cffi_d_sqlite3_progress_handler(sqlite3 * x0, int x1, int(* x2)(void *), void * x3) +{ + sqlite3_progress_handler(x0, x1, x2, x3); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_progress_handler(PyObject *self, PyObject *args) +{ + sqlite3 * x0; + int x1; + int(* x2)(void *); + void * x3; + Py_ssize_t datasize; + PyObject *arg0; + PyObject *arg1; + PyObject *arg2; + PyObject *arg3; + + if (!PyArg_UnpackTuple(args, "sqlite3_progress_handler", 4, 4, &arg0, &arg1, &arg2, &arg3)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(1), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3 *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(1), arg0) < 0) + return NULL; + } + + x1 = _cffi_to_c_int(arg1, int); + if (x1 == (int)-1 && PyErr_Occurred()) + return NULL; + + x2 = (int(*)(void *))_cffi_to_c_pointer(arg2, _cffi_type(165)); + if (x2 == (int(*)(void *))NULL && PyErr_Occurred()) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(31), arg3, (char **)&x3); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x3 = (void *)alloca((size_t)datasize); + memset((void *)x3, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x3, _cffi_type(31), arg3) < 0) + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { sqlite3_progress_handler(x0, x1, x2, x3); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + Py_INCREF(Py_None); + return Py_None; +} +#else +# define _cffi_f_sqlite3_progress_handler _cffi_d_sqlite3_progress_handler +#endif + +static int _cffi_d_sqlite3_reset(sqlite3_stmt * x0) +{ + return sqlite3_reset(x0); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_reset(PyObject *self, PyObject *arg0) +{ + sqlite3_stmt * x0; + Py_ssize_t datasize; + int result; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(4), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_stmt *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(4), arg0) < 0) + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_reset(x0); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_reset _cffi_d_sqlite3_reset +#endif + +static void _cffi_d_sqlite3_result_blob(sqlite3_context * x0, void const * x1, int x2, void(* x3)(void *)) +{ + sqlite3_result_blob(x0, x1, x2, x3); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_result_blob(PyObject *self, PyObject *args) +{ + sqlite3_context * x0; + void const * x1; + int x2; + void(* x3)(void *); + Py_ssize_t datasize; + PyObject *arg0; + PyObject *arg1; + PyObject *arg2; + PyObject *arg3; + + if (!PyArg_UnpackTuple(args, "sqlite3_result_blob", 4, 4, &arg0, &arg1, &arg2, &arg3)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(152), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_context *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(152), arg0) < 0) + return NULL; + } + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(103), arg1, (char **)&x1); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x1 = (void const *)alloca((size_t)datasize); + memset((void *)x1, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x1, _cffi_type(103), arg1) < 0) + return NULL; + } + + x2 = _cffi_to_c_int(arg2, int); + if (x2 == (int)-1 && PyErr_Occurred()) + return NULL; + + x3 = (void(*)(void *))_cffi_to_c_pointer(arg3, _cffi_type(78)); + if (x3 == (void(*)(void *))NULL && PyErr_Occurred()) + return NULL; + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { sqlite3_result_blob(x0, x1, x2, x3); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + Py_INCREF(Py_None); + return Py_None; +} +#else +# define _cffi_f_sqlite3_result_blob _cffi_d_sqlite3_result_blob +#endif + +static void _cffi_d_sqlite3_result_double(sqlite3_context * x0, double x1) +{ + sqlite3_result_double(x0, x1); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_result_double(PyObject *self, PyObject *args) +{ + sqlite3_context * x0; + double x1; + Py_ssize_t datasize; + PyObject *arg0; + PyObject *arg1; + + if (!PyArg_UnpackTuple(args, "sqlite3_result_double", 2, 2, &arg0, &arg1)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(152), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_context *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(152), arg0) < 0) + return NULL; + } + + x1 = (double)_cffi_to_c_double(arg1); + if (x1 == (double)-1 && PyErr_Occurred()) + return NULL; + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { sqlite3_result_double(x0, x1); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + Py_INCREF(Py_None); + return Py_None; +} +#else +# define _cffi_f_sqlite3_result_double _cffi_d_sqlite3_result_double +#endif + +static void _cffi_d_sqlite3_result_error(sqlite3_context * x0, char const * x1, int x2) +{ + sqlite3_result_error(x0, x1, x2); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_result_error(PyObject *self, PyObject *args) +{ + sqlite3_context * x0; + char const * x1; + int x2; + Py_ssize_t datasize; + PyObject *arg0; + PyObject *arg1; + PyObject *arg2; + + if (!PyArg_UnpackTuple(args, "sqlite3_result_error", 3, 3, &arg0, &arg1, &arg2)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(152), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_context *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(152), arg0) < 0) + return NULL; + } + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(17), arg1, (char **)&x1); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x1 = (char const *)alloca((size_t)datasize); + memset((void *)x1, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x1, _cffi_type(17), arg1) < 0) + return NULL; + } + + x2 = _cffi_to_c_int(arg2, int); + if (x2 == (int)-1 && PyErr_Occurred()) + return NULL; + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { sqlite3_result_error(x0, x1, x2); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + Py_INCREF(Py_None); + return Py_None; +} +#else +# define _cffi_f_sqlite3_result_error _cffi_d_sqlite3_result_error +#endif + +static void _cffi_d_sqlite3_result_error16(sqlite3_context * x0, void const * x1, int x2) +{ + sqlite3_result_error16(x0, x1, x2); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_result_error16(PyObject *self, PyObject *args) +{ + sqlite3_context * x0; + void const * x1; + int x2; + Py_ssize_t datasize; + PyObject *arg0; + PyObject *arg1; + PyObject *arg2; + + if (!PyArg_UnpackTuple(args, "sqlite3_result_error16", 3, 3, &arg0, &arg1, &arg2)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(152), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_context *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(152), arg0) < 0) + return NULL; + } + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(103), arg1, (char **)&x1); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x1 = (void const *)alloca((size_t)datasize); + memset((void *)x1, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x1, _cffi_type(103), arg1) < 0) + return NULL; + } + + x2 = _cffi_to_c_int(arg2, int); + if (x2 == (int)-1 && PyErr_Occurred()) + return NULL; + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { sqlite3_result_error16(x0, x1, x2); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + Py_INCREF(Py_None); + return Py_None; +} +#else +# define _cffi_f_sqlite3_result_error16 _cffi_d_sqlite3_result_error16 +#endif + +static void _cffi_d_sqlite3_result_error_code(sqlite3_context * x0, int x1) +{ + sqlite3_result_error_code(x0, x1); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_result_error_code(PyObject *self, PyObject *args) +{ + sqlite3_context * x0; + int x1; + Py_ssize_t datasize; + PyObject *arg0; + PyObject *arg1; + + if (!PyArg_UnpackTuple(args, "sqlite3_result_error_code", 2, 2, &arg0, &arg1)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(152), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_context *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(152), arg0) < 0) + return NULL; + } + + x1 = _cffi_to_c_int(arg1, int); + if (x1 == (int)-1 && PyErr_Occurred()) + return NULL; + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { sqlite3_result_error_code(x0, x1); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + Py_INCREF(Py_None); + return Py_None; +} +#else +# define _cffi_f_sqlite3_result_error_code _cffi_d_sqlite3_result_error_code +#endif + +static void _cffi_d_sqlite3_result_error_nomem(sqlite3_context * x0) +{ + sqlite3_result_error_nomem(x0); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_result_error_nomem(PyObject *self, PyObject *arg0) +{ + sqlite3_context * x0; + Py_ssize_t datasize; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(152), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_context *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(152), arg0) < 0) + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { sqlite3_result_error_nomem(x0); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + Py_INCREF(Py_None); + return Py_None; +} +#else +# define _cffi_f_sqlite3_result_error_nomem _cffi_d_sqlite3_result_error_nomem +#endif + +static void _cffi_d_sqlite3_result_error_toobig(sqlite3_context * x0) +{ + sqlite3_result_error_toobig(x0); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_result_error_toobig(PyObject *self, PyObject *arg0) +{ + sqlite3_context * x0; + Py_ssize_t datasize; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(152), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_context *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(152), arg0) < 0) + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { sqlite3_result_error_toobig(x0); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + Py_INCREF(Py_None); + return Py_None; +} +#else +# define _cffi_f_sqlite3_result_error_toobig _cffi_d_sqlite3_result_error_toobig +#endif + +static void _cffi_d_sqlite3_result_int(sqlite3_context * x0, int x1) +{ + sqlite3_result_int(x0, x1); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_result_int(PyObject *self, PyObject *args) +{ + sqlite3_context * x0; + int x1; + Py_ssize_t datasize; + PyObject *arg0; + PyObject *arg1; + + if (!PyArg_UnpackTuple(args, "sqlite3_result_int", 2, 2, &arg0, &arg1)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(152), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_context *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(152), arg0) < 0) + return NULL; + } + + x1 = _cffi_to_c_int(arg1, int); + if (x1 == (int)-1 && PyErr_Occurred()) + return NULL; + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { sqlite3_result_int(x0, x1); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + Py_INCREF(Py_None); + return Py_None; +} +#else +# define _cffi_f_sqlite3_result_int _cffi_d_sqlite3_result_int +#endif + +static void _cffi_d_sqlite3_result_int64(sqlite3_context * x0, int64_t x1) +{ + sqlite3_result_int64(x0, x1); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_result_int64(PyObject *self, PyObject *args) +{ + sqlite3_context * x0; + int64_t x1; + Py_ssize_t datasize; + PyObject *arg0; + PyObject *arg1; + + if (!PyArg_UnpackTuple(args, "sqlite3_result_int64", 2, 2, &arg0, &arg1)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(152), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_context *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(152), arg0) < 0) + return NULL; + } + + x1 = _cffi_to_c_int(arg1, int64_t); + if (x1 == (int64_t)-1 && PyErr_Occurred()) + return NULL; + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { sqlite3_result_int64(x0, x1); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + Py_INCREF(Py_None); + return Py_None; +} +#else +# define _cffi_f_sqlite3_result_int64 _cffi_d_sqlite3_result_int64 +#endif + +static void _cffi_d_sqlite3_result_null(sqlite3_context * x0) +{ + sqlite3_result_null(x0); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_result_null(PyObject *self, PyObject *arg0) +{ + sqlite3_context * x0; + Py_ssize_t datasize; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(152), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_context *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(152), arg0) < 0) + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { sqlite3_result_null(x0); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + Py_INCREF(Py_None); + return Py_None; +} +#else +# define _cffi_f_sqlite3_result_null _cffi_d_sqlite3_result_null +#endif + +static void _cffi_d_sqlite3_result_text(sqlite3_context * x0, char const * x1, int x2, void(* x3)(void *)) +{ + sqlite3_result_text(x0, x1, x2, x3); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_result_text(PyObject *self, PyObject *args) +{ + sqlite3_context * x0; + char const * x1; + int x2; + void(* x3)(void *); + Py_ssize_t datasize; + PyObject *arg0; + PyObject *arg1; + PyObject *arg2; + PyObject *arg3; + + if (!PyArg_UnpackTuple(args, "sqlite3_result_text", 4, 4, &arg0, &arg1, &arg2, &arg3)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(152), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_context *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(152), arg0) < 0) + return NULL; + } + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(17), arg1, (char **)&x1); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x1 = (char const *)alloca((size_t)datasize); + memset((void *)x1, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x1, _cffi_type(17), arg1) < 0) + return NULL; + } + + x2 = _cffi_to_c_int(arg2, int); + if (x2 == (int)-1 && PyErr_Occurred()) + return NULL; + + x3 = (void(*)(void *))_cffi_to_c_pointer(arg3, _cffi_type(78)); + if (x3 == (void(*)(void *))NULL && PyErr_Occurred()) + return NULL; + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { sqlite3_result_text(x0, x1, x2, x3); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + Py_INCREF(Py_None); + return Py_None; +} +#else +# define _cffi_f_sqlite3_result_text _cffi_d_sqlite3_result_text +#endif + +static void _cffi_d_sqlite3_result_text16(sqlite3_context * x0, void const * x1, int x2, void(* x3)(void *)) +{ + sqlite3_result_text16(x0, x1, x2, x3); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_result_text16(PyObject *self, PyObject *args) +{ + sqlite3_context * x0; + void const * x1; + int x2; + void(* x3)(void *); + Py_ssize_t datasize; + PyObject *arg0; + PyObject *arg1; + PyObject *arg2; + PyObject *arg3; + + if (!PyArg_UnpackTuple(args, "sqlite3_result_text16", 4, 4, &arg0, &arg1, &arg2, &arg3)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(152), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_context *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(152), arg0) < 0) + return NULL; + } + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(103), arg1, (char **)&x1); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x1 = (void const *)alloca((size_t)datasize); + memset((void *)x1, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x1, _cffi_type(103), arg1) < 0) + return NULL; + } + + x2 = _cffi_to_c_int(arg2, int); + if (x2 == (int)-1 && PyErr_Occurred()) + return NULL; + + x3 = (void(*)(void *))_cffi_to_c_pointer(arg3, _cffi_type(78)); + if (x3 == (void(*)(void *))NULL && PyErr_Occurred()) + return NULL; + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { sqlite3_result_text16(x0, x1, x2, x3); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + Py_INCREF(Py_None); + return Py_None; +} +#else +# define _cffi_f_sqlite3_result_text16 _cffi_d_sqlite3_result_text16 +#endif + +static void _cffi_d_sqlite3_result_text16be(sqlite3_context * x0, void const * x1, int x2, void(* x3)(void *)) +{ + sqlite3_result_text16be(x0, x1, x2, x3); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_result_text16be(PyObject *self, PyObject *args) +{ + sqlite3_context * x0; + void const * x1; + int x2; + void(* x3)(void *); + Py_ssize_t datasize; + PyObject *arg0; + PyObject *arg1; + PyObject *arg2; + PyObject *arg3; + + if (!PyArg_UnpackTuple(args, "sqlite3_result_text16be", 4, 4, &arg0, &arg1, &arg2, &arg3)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(152), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_context *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(152), arg0) < 0) + return NULL; + } + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(103), arg1, (char **)&x1); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x1 = (void const *)alloca((size_t)datasize); + memset((void *)x1, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x1, _cffi_type(103), arg1) < 0) + return NULL; + } + + x2 = _cffi_to_c_int(arg2, int); + if (x2 == (int)-1 && PyErr_Occurred()) + return NULL; + + x3 = (void(*)(void *))_cffi_to_c_pointer(arg3, _cffi_type(78)); + if (x3 == (void(*)(void *))NULL && PyErr_Occurred()) + return NULL; + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { sqlite3_result_text16be(x0, x1, x2, x3); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + Py_INCREF(Py_None); + return Py_None; +} +#else +# define _cffi_f_sqlite3_result_text16be _cffi_d_sqlite3_result_text16be +#endif + +static void _cffi_d_sqlite3_result_text16le(sqlite3_context * x0, void const * x1, int x2, void(* x3)(void *)) +{ + sqlite3_result_text16le(x0, x1, x2, x3); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_result_text16le(PyObject *self, PyObject *args) +{ + sqlite3_context * x0; + void const * x1; + int x2; + void(* x3)(void *); + Py_ssize_t datasize; + PyObject *arg0; + PyObject *arg1; + PyObject *arg2; + PyObject *arg3; + + if (!PyArg_UnpackTuple(args, "sqlite3_result_text16le", 4, 4, &arg0, &arg1, &arg2, &arg3)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(152), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_context *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(152), arg0) < 0) + return NULL; + } + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(103), arg1, (char **)&x1); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x1 = (void const *)alloca((size_t)datasize); + memset((void *)x1, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x1, _cffi_type(103), arg1) < 0) + return NULL; + } + + x2 = _cffi_to_c_int(arg2, int); + if (x2 == (int)-1 && PyErr_Occurred()) + return NULL; + + x3 = (void(*)(void *))_cffi_to_c_pointer(arg3, _cffi_type(78)); + if (x3 == (void(*)(void *))NULL && PyErr_Occurred()) + return NULL; + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { sqlite3_result_text16le(x0, x1, x2, x3); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + Py_INCREF(Py_None); + return Py_None; +} +#else +# define _cffi_f_sqlite3_result_text16le _cffi_d_sqlite3_result_text16le +#endif + +static void _cffi_d_sqlite3_result_value(sqlite3_context * x0, sqlite3_value * x1) +{ + sqlite3_result_value(x0, x1); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_result_value(PyObject *self, PyObject *args) +{ + sqlite3_context * x0; + sqlite3_value * x1; + Py_ssize_t datasize; + PyObject *arg0; + PyObject *arg1; + + if (!PyArg_UnpackTuple(args, "sqlite3_result_value", 2, 2, &arg0, &arg1)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(152), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_context *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(152), arg0) < 0) + return NULL; + } + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(14), arg1, (char **)&x1); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x1 = (sqlite3_value *)alloca((size_t)datasize); + memset((void *)x1, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x1, _cffi_type(14), arg1) < 0) + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { sqlite3_result_value(x0, x1); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + Py_INCREF(Py_None); + return Py_None; +} +#else +# define _cffi_f_sqlite3_result_value _cffi_d_sqlite3_result_value +#endif + +static void _cffi_d_sqlite3_result_zeroblob(sqlite3_context * x0, int x1) +{ + sqlite3_result_zeroblob(x0, x1); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_result_zeroblob(PyObject *self, PyObject *args) +{ + sqlite3_context * x0; + int x1; + Py_ssize_t datasize; + PyObject *arg0; + PyObject *arg1; + + if (!PyArg_UnpackTuple(args, "sqlite3_result_zeroblob", 2, 2, &arg0, &arg1)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(152), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_context *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(152), arg0) < 0) + return NULL; + } + + x1 = _cffi_to_c_int(arg1, int); + if (x1 == (int)-1 && PyErr_Occurred()) + return NULL; + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { sqlite3_result_zeroblob(x0, x1); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + Py_INCREF(Py_None); + return Py_None; +} +#else +# define _cffi_f_sqlite3_result_zeroblob _cffi_d_sqlite3_result_zeroblob +#endif + +static int _cffi_d_sqlite3_set_authorizer(sqlite3 * x0, int(* x1)(void *, int, char const *, char const *, char const *, char const *), void * x2) +{ + return sqlite3_set_authorizer(x0, x1, x2); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_set_authorizer(PyObject *self, PyObject *args) +{ + sqlite3 * x0; + int(* x1)(void *, int, char const *, char const *, char const *, char const *); + void * x2; + Py_ssize_t datasize; + int result; + PyObject *arg0; + PyObject *arg1; + PyObject *arg2; + + if (!PyArg_UnpackTuple(args, "sqlite3_set_authorizer", 3, 3, &arg0, &arg1, &arg2)) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(1), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3 *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(1), arg0) < 0) + return NULL; + } + + x1 = (int(*)(void *, int, char const *, char const *, char const *, char const *))_cffi_to_c_pointer(arg1, _cffi_type(52)); + if (x1 == (int(*)(void *, int, char const *, char const *, char const *, char const *))NULL && PyErr_Occurred()) + return NULL; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(31), arg2, (char **)&x2); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x2 = (void *)alloca((size_t)datasize); + memset((void *)x2, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x2, _cffi_type(31), arg2) < 0) + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_set_authorizer(x0, x1, x2); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_set_authorizer _cffi_d_sqlite3_set_authorizer +#endif + +static int _cffi_d_sqlite3_sleep(int x0) +{ + return sqlite3_sleep(x0); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_sleep(PyObject *self, PyObject *arg0) +{ + int x0; + int result; + + x0 = _cffi_to_c_int(arg0, int); + if (x0 == (int)-1 && PyErr_Occurred()) + return NULL; + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_sleep(x0); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_sleep _cffi_d_sqlite3_sleep +#endif + +static int _cffi_d_sqlite3_step(sqlite3_stmt * x0) +{ + return sqlite3_step(x0); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_step(PyObject *self, PyObject *arg0) +{ + sqlite3_stmt * x0; + Py_ssize_t datasize; + int result; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(4), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_stmt *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(4), arg0) < 0) + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_step(x0); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_step _cffi_d_sqlite3_step +#endif + +static int _cffi_d_sqlite3_total_changes(sqlite3 * x0) +{ + return sqlite3_total_changes(x0); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_total_changes(PyObject *self, PyObject *arg0) +{ + sqlite3 * x0; + Py_ssize_t datasize; + int result; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(1), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3 *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(1), arg0) < 0) + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_total_changes(x0); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_total_changes _cffi_d_sqlite3_total_changes +#endif + +static void const * _cffi_d_sqlite3_value_blob(sqlite3_value * x0) +{ + return sqlite3_value_blob(x0); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_value_blob(PyObject *self, PyObject *arg0) +{ + sqlite3_value * x0; + Py_ssize_t datasize; + void const * result; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(14), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_value *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(14), arg0) < 0) + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_value_blob(x0); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_pointer((char *)result, _cffi_type(103)); +} +#else +# define _cffi_f_sqlite3_value_blob _cffi_d_sqlite3_value_blob +#endif + +static int _cffi_d_sqlite3_value_bytes(sqlite3_value * x0) +{ + return sqlite3_value_bytes(x0); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_value_bytes(PyObject *self, PyObject *arg0) +{ + sqlite3_value * x0; + Py_ssize_t datasize; + int result; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(14), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_value *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(14), arg0) < 0) + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_value_bytes(x0); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_value_bytes _cffi_d_sqlite3_value_bytes +#endif + +static int _cffi_d_sqlite3_value_bytes16(sqlite3_value * x0) +{ + return sqlite3_value_bytes16(x0); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_value_bytes16(PyObject *self, PyObject *arg0) +{ + sqlite3_value * x0; + Py_ssize_t datasize; + int result; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(14), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_value *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(14), arg0) < 0) + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_value_bytes16(x0); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_value_bytes16 _cffi_d_sqlite3_value_bytes16 +#endif + +static double _cffi_d_sqlite3_value_double(sqlite3_value * x0) +{ + return sqlite3_value_double(x0); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_value_double(PyObject *self, PyObject *arg0) +{ + sqlite3_value * x0; + Py_ssize_t datasize; + double result; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(14), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_value *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(14), arg0) < 0) + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_value_double(x0); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_double(result); +} +#else +# define _cffi_f_sqlite3_value_double _cffi_d_sqlite3_value_double +#endif + +static int _cffi_d_sqlite3_value_int(sqlite3_value * x0) +{ + return sqlite3_value_int(x0); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_value_int(PyObject *self, PyObject *arg0) +{ + sqlite3_value * x0; + Py_ssize_t datasize; + int result; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(14), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_value *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(14), arg0) < 0) + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_value_int(x0); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_value_int _cffi_d_sqlite3_value_int +#endif + +static int64_t _cffi_d_sqlite3_value_int64(sqlite3_value * x0) +{ + return sqlite3_value_int64(x0); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_value_int64(PyObject *self, PyObject *arg0) +{ + sqlite3_value * x0; + Py_ssize_t datasize; + int64_t result; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(14), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_value *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(14), arg0) < 0) + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_value_int64(x0); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int64_t); +} +#else +# define _cffi_f_sqlite3_value_int64 _cffi_d_sqlite3_value_int64 +#endif + +static int _cffi_d_sqlite3_value_numeric_type(sqlite3_value * x0) +{ + return sqlite3_value_numeric_type(x0); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_value_numeric_type(PyObject *self, PyObject *arg0) +{ + sqlite3_value * x0; + Py_ssize_t datasize; + int result; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(14), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_value *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(14), arg0) < 0) + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_value_numeric_type(x0); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_value_numeric_type _cffi_d_sqlite3_value_numeric_type +#endif + +static unsigned char const * _cffi_d_sqlite3_value_text(sqlite3_value * x0) +{ + return sqlite3_value_text(x0); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_value_text(PyObject *self, PyObject *arg0) +{ + sqlite3_value * x0; + Py_ssize_t datasize; + unsigned char const * result; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(14), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_value *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(14), arg0) < 0) + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_value_text(x0); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_pointer((char *)result, _cffi_type(224)); +} +#else +# define _cffi_f_sqlite3_value_text _cffi_d_sqlite3_value_text +#endif + +static void const * _cffi_d_sqlite3_value_text16(sqlite3_value * x0) +{ + return sqlite3_value_text16(x0); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_value_text16(PyObject *self, PyObject *arg0) +{ + sqlite3_value * x0; + Py_ssize_t datasize; + void const * result; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(14), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_value *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(14), arg0) < 0) + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_value_text16(x0); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_pointer((char *)result, _cffi_type(103)); +} +#else +# define _cffi_f_sqlite3_value_text16 _cffi_d_sqlite3_value_text16 +#endif + +static void const * _cffi_d_sqlite3_value_text16be(sqlite3_value * x0) +{ + return sqlite3_value_text16be(x0); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_value_text16be(PyObject *self, PyObject *arg0) +{ + sqlite3_value * x0; + Py_ssize_t datasize; + void const * result; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(14), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_value *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(14), arg0) < 0) + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_value_text16be(x0); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_pointer((char *)result, _cffi_type(103)); +} +#else +# define _cffi_f_sqlite3_value_text16be _cffi_d_sqlite3_value_text16be +#endif + +static void const * _cffi_d_sqlite3_value_text16le(sqlite3_value * x0) +{ + return sqlite3_value_text16le(x0); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_value_text16le(PyObject *self, PyObject *arg0) +{ + sqlite3_value * x0; + Py_ssize_t datasize; + void const * result; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(14), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_value *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(14), arg0) < 0) + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_value_text16le(x0); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_pointer((char *)result, _cffi_type(103)); +} +#else +# define _cffi_f_sqlite3_value_text16le _cffi_d_sqlite3_value_text16le +#endif + +static int _cffi_d_sqlite3_value_type(sqlite3_value * x0) +{ + return sqlite3_value_type(x0); +} +#ifndef PYPY_VERSION +static PyObject * +_cffi_f_sqlite3_value_type(PyObject *self, PyObject *arg0) +{ + sqlite3_value * x0; + Py_ssize_t datasize; + int result; + + datasize = _cffi_prepare_pointer_call_argument( + _cffi_type(14), arg0, (char **)&x0); + if (datasize != 0) { + if (datasize < 0) + return NULL; + x0 = (sqlite3_value *)alloca((size_t)datasize); + memset((void *)x0, 0, (size_t)datasize); + if (_cffi_convert_array_from_object((char *)x0, _cffi_type(14), arg0) < 0) + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + _cffi_restore_errno(); + { result = sqlite3_value_type(x0); } + _cffi_save_errno(); + Py_END_ALLOW_THREADS + + (void)self; /* unused */ + return _cffi_from_c_int(result, int); +} +#else +# define _cffi_f_sqlite3_value_type _cffi_d_sqlite3_value_type +#endif + +static int _cffi_const_SQLITE3_TEXT(unsigned long long *o) +{ + int n = (SQLITE3_TEXT) <= 0; + *o = (unsigned long long)((SQLITE3_TEXT) | 0); /* check that SQLITE3_TEXT is an integer */ + return n; +} + +static int _cffi_const_SQLITE_ABORT(unsigned long long *o) +{ + int n = (SQLITE_ABORT) <= 0; + *o = (unsigned long long)((SQLITE_ABORT) | 0); /* check that SQLITE_ABORT is an integer */ + return n; +} + +static int _cffi_const_SQLITE_ALTER_TABLE(unsigned long long *o) +{ + int n = (SQLITE_ALTER_TABLE) <= 0; + *o = (unsigned long long)((SQLITE_ALTER_TABLE) | 0); /* check that SQLITE_ALTER_TABLE is an integer */ + return n; +} + +static int _cffi_const_SQLITE_ANALYZE(unsigned long long *o) +{ + int n = (SQLITE_ANALYZE) <= 0; + *o = (unsigned long long)((SQLITE_ANALYZE) | 0); /* check that SQLITE_ANALYZE is an integer */ + return n; +} + +static int _cffi_const_SQLITE_ATTACH(unsigned long long *o) +{ + int n = (SQLITE_ATTACH) <= 0; + *o = (unsigned long long)((SQLITE_ATTACH) | 0); /* check that SQLITE_ATTACH is an integer */ + return n; +} + +static int _cffi_const_SQLITE_AUTH(unsigned long long *o) +{ + int n = (SQLITE_AUTH) <= 0; + *o = (unsigned long long)((SQLITE_AUTH) | 0); /* check that SQLITE_AUTH is an integer */ + return n; +} + +static int _cffi_const_SQLITE_BLOB(unsigned long long *o) +{ + int n = (SQLITE_BLOB) <= 0; + *o = (unsigned long long)((SQLITE_BLOB) | 0); /* check that SQLITE_BLOB is an integer */ + return n; +} + +static int _cffi_const_SQLITE_BUSY(unsigned long long *o) +{ + int n = (SQLITE_BUSY) <= 0; + *o = (unsigned long long)((SQLITE_BUSY) | 0); /* check that SQLITE_BUSY is an integer */ + return n; +} + +static int _cffi_const_SQLITE_CANTOPEN(unsigned long long *o) +{ + int n = (SQLITE_CANTOPEN) <= 0; + *o = (unsigned long long)((SQLITE_CANTOPEN) | 0); /* check that SQLITE_CANTOPEN is an integer */ + return n; +} + +static int _cffi_const_SQLITE_CONSTRAINT(unsigned long long *o) +{ + int n = (SQLITE_CONSTRAINT) <= 0; + *o = (unsigned long long)((SQLITE_CONSTRAINT) | 0); /* check that SQLITE_CONSTRAINT is an integer */ + return n; +} + +static int _cffi_const_SQLITE_CORRUPT(unsigned long long *o) +{ + int n = (SQLITE_CORRUPT) <= 0; + *o = (unsigned long long)((SQLITE_CORRUPT) | 0); /* check that SQLITE_CORRUPT is an integer */ + return n; +} + +static int _cffi_const_SQLITE_CREATE_INDEX(unsigned long long *o) +{ + int n = (SQLITE_CREATE_INDEX) <= 0; + *o = (unsigned long long)((SQLITE_CREATE_INDEX) | 0); /* check that SQLITE_CREATE_INDEX is an integer */ + return n; +} + +static int _cffi_const_SQLITE_CREATE_TABLE(unsigned long long *o) +{ + int n = (SQLITE_CREATE_TABLE) <= 0; + *o = (unsigned long long)((SQLITE_CREATE_TABLE) | 0); /* check that SQLITE_CREATE_TABLE is an integer */ + return n; +} + +static int _cffi_const_SQLITE_CREATE_TEMP_INDEX(unsigned long long *o) +{ + int n = (SQLITE_CREATE_TEMP_INDEX) <= 0; + *o = (unsigned long long)((SQLITE_CREATE_TEMP_INDEX) | 0); /* check that SQLITE_CREATE_TEMP_INDEX is an integer */ + return n; +} + +static int _cffi_const_SQLITE_CREATE_TEMP_TABLE(unsigned long long *o) +{ + int n = (SQLITE_CREATE_TEMP_TABLE) <= 0; + *o = (unsigned long long)((SQLITE_CREATE_TEMP_TABLE) | 0); /* check that SQLITE_CREATE_TEMP_TABLE is an integer */ + return n; +} + +static int _cffi_const_SQLITE_CREATE_TEMP_TRIGGER(unsigned long long *o) +{ + int n = (SQLITE_CREATE_TEMP_TRIGGER) <= 0; + *o = (unsigned long long)((SQLITE_CREATE_TEMP_TRIGGER) | 0); /* check that SQLITE_CREATE_TEMP_TRIGGER is an integer */ + return n; +} + +static int _cffi_const_SQLITE_CREATE_TEMP_VIEW(unsigned long long *o) +{ + int n = (SQLITE_CREATE_TEMP_VIEW) <= 0; + *o = (unsigned long long)((SQLITE_CREATE_TEMP_VIEW) | 0); /* check that SQLITE_CREATE_TEMP_VIEW is an integer */ + return n; +} + +static int _cffi_const_SQLITE_CREATE_TRIGGER(unsigned long long *o) +{ + int n = (SQLITE_CREATE_TRIGGER) <= 0; + *o = (unsigned long long)((SQLITE_CREATE_TRIGGER) | 0); /* check that SQLITE_CREATE_TRIGGER is an integer */ + return n; +} + +static int _cffi_const_SQLITE_CREATE_VIEW(unsigned long long *o) +{ + int n = (SQLITE_CREATE_VIEW) <= 0; + *o = (unsigned long long)((SQLITE_CREATE_VIEW) | 0); /* check that SQLITE_CREATE_VIEW is an integer */ + return n; +} + +static int _cffi_const_SQLITE_CREATE_VTABLE(unsigned long long *o) +{ + int n = (SQLITE_CREATE_VTABLE) <= 0; + *o = (unsigned long long)((SQLITE_CREATE_VTABLE) | 0); /* check that SQLITE_CREATE_VTABLE is an integer */ + return n; +} + +static int _cffi_const_SQLITE_DELETE(unsigned long long *o) +{ + int n = (SQLITE_DELETE) <= 0; + *o = (unsigned long long)((SQLITE_DELETE) | 0); /* check that SQLITE_DELETE is an integer */ + return n; +} + +static int _cffi_const_SQLITE_DENY(unsigned long long *o) +{ + int n = (SQLITE_DENY) <= 0; + *o = (unsigned long long)((SQLITE_DENY) | 0); /* check that SQLITE_DENY is an integer */ + return n; +} + +static int _cffi_const_SQLITE_DETACH(unsigned long long *o) +{ + int n = (SQLITE_DETACH) <= 0; + *o = (unsigned long long)((SQLITE_DETACH) | 0); /* check that SQLITE_DETACH is an integer */ + return n; +} + +static int _cffi_const_SQLITE_DONE(unsigned long long *o) +{ + int n = (SQLITE_DONE) <= 0; + *o = (unsigned long long)((SQLITE_DONE) | 0); /* check that SQLITE_DONE is an integer */ + return n; +} + +static int _cffi_const_SQLITE_DROP_INDEX(unsigned long long *o) +{ + int n = (SQLITE_DROP_INDEX) <= 0; + *o = (unsigned long long)((SQLITE_DROP_INDEX) | 0); /* check that SQLITE_DROP_INDEX is an integer */ + return n; +} + +static int _cffi_const_SQLITE_DROP_TABLE(unsigned long long *o) +{ + int n = (SQLITE_DROP_TABLE) <= 0; + *o = (unsigned long long)((SQLITE_DROP_TABLE) | 0); /* check that SQLITE_DROP_TABLE is an integer */ + return n; +} + +static int _cffi_const_SQLITE_DROP_TEMP_INDEX(unsigned long long *o) +{ + int n = (SQLITE_DROP_TEMP_INDEX) <= 0; + *o = (unsigned long long)((SQLITE_DROP_TEMP_INDEX) | 0); /* check that SQLITE_DROP_TEMP_INDEX is an integer */ + return n; +} + +static int _cffi_const_SQLITE_DROP_TEMP_TABLE(unsigned long long *o) +{ + int n = (SQLITE_DROP_TEMP_TABLE) <= 0; + *o = (unsigned long long)((SQLITE_DROP_TEMP_TABLE) | 0); /* check that SQLITE_DROP_TEMP_TABLE is an integer */ + return n; +} + +static int _cffi_const_SQLITE_DROP_TEMP_TRIGGER(unsigned long long *o) +{ + int n = (SQLITE_DROP_TEMP_TRIGGER) <= 0; + *o = (unsigned long long)((SQLITE_DROP_TEMP_TRIGGER) | 0); /* check that SQLITE_DROP_TEMP_TRIGGER is an integer */ + return n; +} + +static int _cffi_const_SQLITE_DROP_TEMP_VIEW(unsigned long long *o) +{ + int n = (SQLITE_DROP_TEMP_VIEW) <= 0; + *o = (unsigned long long)((SQLITE_DROP_TEMP_VIEW) | 0); /* check that SQLITE_DROP_TEMP_VIEW is an integer */ + return n; +} + +static int _cffi_const_SQLITE_DROP_TRIGGER(unsigned long long *o) +{ + int n = (SQLITE_DROP_TRIGGER) <= 0; + *o = (unsigned long long)((SQLITE_DROP_TRIGGER) | 0); /* check that SQLITE_DROP_TRIGGER is an integer */ + return n; +} + +static int _cffi_const_SQLITE_DROP_VIEW(unsigned long long *o) +{ + int n = (SQLITE_DROP_VIEW) <= 0; + *o = (unsigned long long)((SQLITE_DROP_VIEW) | 0); /* check that SQLITE_DROP_VIEW is an integer */ + return n; +} + +static int _cffi_const_SQLITE_DROP_VTABLE(unsigned long long *o) +{ + int n = (SQLITE_DROP_VTABLE) <= 0; + *o = (unsigned long long)((SQLITE_DROP_VTABLE) | 0); /* check that SQLITE_DROP_VTABLE is an integer */ + return n; +} + +static int _cffi_const_SQLITE_EMPTY(unsigned long long *o) +{ + int n = (SQLITE_EMPTY) <= 0; + *o = (unsigned long long)((SQLITE_EMPTY) | 0); /* check that SQLITE_EMPTY is an integer */ + return n; +} + +static int _cffi_const_SQLITE_ERROR(unsigned long long *o) +{ + int n = (SQLITE_ERROR) <= 0; + *o = (unsigned long long)((SQLITE_ERROR) | 0); /* check that SQLITE_ERROR is an integer */ + return n; +} + +static int _cffi_const_SQLITE_FLOAT(unsigned long long *o) +{ + int n = (SQLITE_FLOAT) <= 0; + *o = (unsigned long long)((SQLITE_FLOAT) | 0); /* check that SQLITE_FLOAT is an integer */ + return n; +} + +static int _cffi_const_SQLITE_FORMAT(unsigned long long *o) +{ + int n = (SQLITE_FORMAT) <= 0; + *o = (unsigned long long)((SQLITE_FORMAT) | 0); /* check that SQLITE_FORMAT is an integer */ + return n; +} + +static int _cffi_const_SQLITE_FULL(unsigned long long *o) +{ + int n = (SQLITE_FULL) <= 0; + *o = (unsigned long long)((SQLITE_FULL) | 0); /* check that SQLITE_FULL is an integer */ + return n; +} + +static int _cffi_const_SQLITE_FUNCTION(unsigned long long *o) +{ + int n = (SQLITE_FUNCTION) <= 0; + *o = (unsigned long long)((SQLITE_FUNCTION) | 0); /* check that SQLITE_FUNCTION is an integer */ + return n; +} + +static int _cffi_const_SQLITE_IGNORE(unsigned long long *o) +{ + int n = (SQLITE_IGNORE) <= 0; + *o = (unsigned long long)((SQLITE_IGNORE) | 0); /* check that SQLITE_IGNORE is an integer */ + return n; +} + +static int _cffi_const_SQLITE_INSERT(unsigned long long *o) +{ + int n = (SQLITE_INSERT) <= 0; + *o = (unsigned long long)((SQLITE_INSERT) | 0); /* check that SQLITE_INSERT is an integer */ + return n; +} + +static int _cffi_const_SQLITE_INTEGER(unsigned long long *o) +{ + int n = (SQLITE_INTEGER) <= 0; + *o = (unsigned long long)((SQLITE_INTEGER) | 0); /* check that SQLITE_INTEGER is an integer */ + return n; +} + +static int _cffi_const_SQLITE_INTERNAL(unsigned long long *o) +{ + int n = (SQLITE_INTERNAL) <= 0; + *o = (unsigned long long)((SQLITE_INTERNAL) | 0); /* check that SQLITE_INTERNAL is an integer */ + return n; +} + +static int _cffi_const_SQLITE_INTERRUPT(unsigned long long *o) +{ + int n = (SQLITE_INTERRUPT) <= 0; + *o = (unsigned long long)((SQLITE_INTERRUPT) | 0); /* check that SQLITE_INTERRUPT is an integer */ + return n; +} + +static int _cffi_const_SQLITE_IOERR(unsigned long long *o) +{ + int n = (SQLITE_IOERR) <= 0; + *o = (unsigned long long)((SQLITE_IOERR) | 0); /* check that SQLITE_IOERR is an integer */ + return n; +} + +static int _cffi_const_SQLITE_LOCKED(unsigned long long *o) +{ + int n = (SQLITE_LOCKED) <= 0; + *o = (unsigned long long)((SQLITE_LOCKED) | 0); /* check that SQLITE_LOCKED is an integer */ + return n; +} + +static int _cffi_const_SQLITE_MISMATCH(unsigned long long *o) +{ + int n = (SQLITE_MISMATCH) <= 0; + *o = (unsigned long long)((SQLITE_MISMATCH) | 0); /* check that SQLITE_MISMATCH is an integer */ + return n; +} + +static int _cffi_const_SQLITE_MISUSE(unsigned long long *o) +{ + int n = (SQLITE_MISUSE) <= 0; + *o = (unsigned long long)((SQLITE_MISUSE) | 0); /* check that SQLITE_MISUSE is an integer */ + return n; +} + +static int _cffi_const_SQLITE_NOLFS(unsigned long long *o) +{ + int n = (SQLITE_NOLFS) <= 0; + *o = (unsigned long long)((SQLITE_NOLFS) | 0); /* check that SQLITE_NOLFS is an integer */ + return n; +} + +static int _cffi_const_SQLITE_NOMEM(unsigned long long *o) +{ + int n = (SQLITE_NOMEM) <= 0; + *o = (unsigned long long)((SQLITE_NOMEM) | 0); /* check that SQLITE_NOMEM is an integer */ + return n; +} + +static int _cffi_const_SQLITE_NOTADB(unsigned long long *o) +{ + int n = (SQLITE_NOTADB) <= 0; + *o = (unsigned long long)((SQLITE_NOTADB) | 0); /* check that SQLITE_NOTADB is an integer */ + return n; +} + +static int _cffi_const_SQLITE_NOTFOUND(unsigned long long *o) +{ + int n = (SQLITE_NOTFOUND) <= 0; + *o = (unsigned long long)((SQLITE_NOTFOUND) | 0); /* check that SQLITE_NOTFOUND is an integer */ + return n; +} + +static int _cffi_const_SQLITE_NULL(unsigned long long *o) +{ + int n = (SQLITE_NULL) <= 0; + *o = (unsigned long long)((SQLITE_NULL) | 0); /* check that SQLITE_NULL is an integer */ + return n; +} + +static int _cffi_const_SQLITE_OK(unsigned long long *o) +{ + int n = (SQLITE_OK) <= 0; + *o = (unsigned long long)((SQLITE_OK) | 0); /* check that SQLITE_OK is an integer */ + return n; +} + +static int _cffi_const_SQLITE_PERM(unsigned long long *o) +{ + int n = (SQLITE_PERM) <= 0; + *o = (unsigned long long)((SQLITE_PERM) | 0); /* check that SQLITE_PERM is an integer */ + return n; +} + +static int _cffi_const_SQLITE_PRAGMA(unsigned long long *o) +{ + int n = (SQLITE_PRAGMA) <= 0; + *o = (unsigned long long)((SQLITE_PRAGMA) | 0); /* check that SQLITE_PRAGMA is an integer */ + return n; +} + +static int _cffi_const_SQLITE_PROTOCOL(unsigned long long *o) +{ + int n = (SQLITE_PROTOCOL) <= 0; + *o = (unsigned long long)((SQLITE_PROTOCOL) | 0); /* check that SQLITE_PROTOCOL is an integer */ + return n; +} + +static int _cffi_const_SQLITE_RANGE(unsigned long long *o) +{ + int n = (SQLITE_RANGE) <= 0; + *o = (unsigned long long)((SQLITE_RANGE) | 0); /* check that SQLITE_RANGE is an integer */ + return n; +} + +static int _cffi_const_SQLITE_READ(unsigned long long *o) +{ + int n = (SQLITE_READ) <= 0; + *o = (unsigned long long)((SQLITE_READ) | 0); /* check that SQLITE_READ is an integer */ + return n; +} + +static int _cffi_const_SQLITE_READONLY(unsigned long long *o) +{ + int n = (SQLITE_READONLY) <= 0; + *o = (unsigned long long)((SQLITE_READONLY) | 0); /* check that SQLITE_READONLY is an integer */ + return n; +} + +static int _cffi_const_SQLITE_REINDEX(unsigned long long *o) +{ + int n = (SQLITE_REINDEX) <= 0; + *o = (unsigned long long)((SQLITE_REINDEX) | 0); /* check that SQLITE_REINDEX is an integer */ + return n; +} + +static int _cffi_const_SQLITE_ROW(unsigned long long *o) +{ + int n = (SQLITE_ROW) <= 0; + *o = (unsigned long long)((SQLITE_ROW) | 0); /* check that SQLITE_ROW is an integer */ + return n; +} + +static int _cffi_const_SQLITE_SCHEMA(unsigned long long *o) +{ + int n = (SQLITE_SCHEMA) <= 0; + *o = (unsigned long long)((SQLITE_SCHEMA) | 0); /* check that SQLITE_SCHEMA is an integer */ + return n; +} + +static int _cffi_const_SQLITE_SELECT(unsigned long long *o) +{ + int n = (SQLITE_SELECT) <= 0; + *o = (unsigned long long)((SQLITE_SELECT) | 0); /* check that SQLITE_SELECT is an integer */ + return n; +} + +static int _cffi_const_SQLITE_TEXT(unsigned long long *o) +{ + int n = (SQLITE_TEXT) <= 0; + *o = (unsigned long long)((SQLITE_TEXT) | 0); /* check that SQLITE_TEXT is an integer */ + return n; +} + +static int _cffi_const_SQLITE_TOOBIG(unsigned long long *o) +{ + int n = (SQLITE_TOOBIG) <= 0; + *o = (unsigned long long)((SQLITE_TOOBIG) | 0); /* check that SQLITE_TOOBIG is an integer */ + return n; +} + +static int _cffi_const_SQLITE_TRANSACTION(unsigned long long *o) +{ + int n = (SQLITE_TRANSACTION) <= 0; + *o = (unsigned long long)((SQLITE_TRANSACTION) | 0); /* check that SQLITE_TRANSACTION is an integer */ + return n; +} + +static int _cffi_const_SQLITE_UPDATE(unsigned long long *o) +{ + int n = (SQLITE_UPDATE) <= 0; + *o = (unsigned long long)((SQLITE_UPDATE) | 0); /* check that SQLITE_UPDATE is an integer */ + return n; +} + +static int _cffi_const_SQLITE_UTF8(unsigned long long *o) +{ + int n = (SQLITE_UTF8) <= 0; + *o = (unsigned long long)((SQLITE_UTF8) | 0); /* check that SQLITE_UTF8 is an integer */ + return n; +} + +static const struct _cffi_global_s _cffi_globals[] = { + { "SQLITE3_TEXT", (void *)_cffi_const_SQLITE3_TEXT, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_ABORT", (void *)_cffi_const_SQLITE_ABORT, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_ALTER_TABLE", (void *)_cffi_const_SQLITE_ALTER_TABLE, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_ANALYZE", (void *)_cffi_const_SQLITE_ANALYZE, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_ATTACH", (void *)_cffi_const_SQLITE_ATTACH, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_AUTH", (void *)_cffi_const_SQLITE_AUTH, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_BLOB", (void *)_cffi_const_SQLITE_BLOB, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_BUSY", (void *)_cffi_const_SQLITE_BUSY, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_CANTOPEN", (void *)_cffi_const_SQLITE_CANTOPEN, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_CONSTRAINT", (void *)_cffi_const_SQLITE_CONSTRAINT, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_CORRUPT", (void *)_cffi_const_SQLITE_CORRUPT, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_CREATE_INDEX", (void *)_cffi_const_SQLITE_CREATE_INDEX, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_CREATE_TABLE", (void *)_cffi_const_SQLITE_CREATE_TABLE, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_CREATE_TEMP_INDEX", (void *)_cffi_const_SQLITE_CREATE_TEMP_INDEX, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_CREATE_TEMP_TABLE", (void *)_cffi_const_SQLITE_CREATE_TEMP_TABLE, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_CREATE_TEMP_TRIGGER", (void *)_cffi_const_SQLITE_CREATE_TEMP_TRIGGER, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_CREATE_TEMP_VIEW", (void *)_cffi_const_SQLITE_CREATE_TEMP_VIEW, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_CREATE_TRIGGER", (void *)_cffi_const_SQLITE_CREATE_TRIGGER, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_CREATE_VIEW", (void *)_cffi_const_SQLITE_CREATE_VIEW, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_CREATE_VTABLE", (void *)_cffi_const_SQLITE_CREATE_VTABLE, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_DELETE", (void *)_cffi_const_SQLITE_DELETE, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_DENY", (void *)_cffi_const_SQLITE_DENY, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_DETACH", (void *)_cffi_const_SQLITE_DETACH, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_DONE", (void *)_cffi_const_SQLITE_DONE, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_DROP_INDEX", (void *)_cffi_const_SQLITE_DROP_INDEX, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_DROP_TABLE", (void *)_cffi_const_SQLITE_DROP_TABLE, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_DROP_TEMP_INDEX", (void *)_cffi_const_SQLITE_DROP_TEMP_INDEX, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_DROP_TEMP_TABLE", (void *)_cffi_const_SQLITE_DROP_TEMP_TABLE, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_DROP_TEMP_TRIGGER", (void *)_cffi_const_SQLITE_DROP_TEMP_TRIGGER, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_DROP_TEMP_VIEW", (void *)_cffi_const_SQLITE_DROP_TEMP_VIEW, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_DROP_TRIGGER", (void *)_cffi_const_SQLITE_DROP_TRIGGER, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_DROP_VIEW", (void *)_cffi_const_SQLITE_DROP_VIEW, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_DROP_VTABLE", (void *)_cffi_const_SQLITE_DROP_VTABLE, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_EMPTY", (void *)_cffi_const_SQLITE_EMPTY, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_ERROR", (void *)_cffi_const_SQLITE_ERROR, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_FLOAT", (void *)_cffi_const_SQLITE_FLOAT, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_FORMAT", (void *)_cffi_const_SQLITE_FORMAT, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_FULL", (void *)_cffi_const_SQLITE_FULL, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_FUNCTION", (void *)_cffi_const_SQLITE_FUNCTION, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_IGNORE", (void *)_cffi_const_SQLITE_IGNORE, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_INSERT", (void *)_cffi_const_SQLITE_INSERT, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_INTEGER", (void *)_cffi_const_SQLITE_INTEGER, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_INTERNAL", (void *)_cffi_const_SQLITE_INTERNAL, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_INTERRUPT", (void *)_cffi_const_SQLITE_INTERRUPT, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_IOERR", (void *)_cffi_const_SQLITE_IOERR, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_LOCKED", (void *)_cffi_const_SQLITE_LOCKED, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_MISMATCH", (void *)_cffi_const_SQLITE_MISMATCH, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_MISUSE", (void *)_cffi_const_SQLITE_MISUSE, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_NOLFS", (void *)_cffi_const_SQLITE_NOLFS, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_NOMEM", (void *)_cffi_const_SQLITE_NOMEM, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_NOTADB", (void *)_cffi_const_SQLITE_NOTADB, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_NOTFOUND", (void *)_cffi_const_SQLITE_NOTFOUND, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_NULL", (void *)_cffi_const_SQLITE_NULL, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_OK", (void *)_cffi_const_SQLITE_OK, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_PERM", (void *)_cffi_const_SQLITE_PERM, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_PRAGMA", (void *)_cffi_const_SQLITE_PRAGMA, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_PROTOCOL", (void *)_cffi_const_SQLITE_PROTOCOL, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_RANGE", (void *)_cffi_const_SQLITE_RANGE, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_READ", (void *)_cffi_const_SQLITE_READ, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_READONLY", (void *)_cffi_const_SQLITE_READONLY, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_REINDEX", (void *)_cffi_const_SQLITE_REINDEX, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_ROW", (void *)_cffi_const_SQLITE_ROW, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_SCHEMA", (void *)_cffi_const_SQLITE_SCHEMA, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_SELECT", (void *)_cffi_const_SQLITE_SELECT, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_TEXT", (void *)_cffi_const_SQLITE_TEXT, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_TOOBIG", (void *)_cffi_const_SQLITE_TOOBIG, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_TRANSACTION", (void *)_cffi_const_SQLITE_TRANSACTION, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_TRANSIENT", (void *)_cffi_const_SQLITE_TRANSIENT, _CFFI_OP(_CFFI_OP_CONSTANT, 31), (void *)0 }, + { "SQLITE_UPDATE", (void *)_cffi_const_SQLITE_UPDATE, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "SQLITE_UTF8", (void *)_cffi_const_SQLITE_UTF8, _CFFI_OP(_CFFI_OP_CONSTANT_INT, -1), (void *)0 }, + { "sqlite3_aggregate_context", (void *)_cffi_f_sqlite3_aggregate_context, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 151), (void *)_cffi_d_sqlite3_aggregate_context }, + { "sqlite3_backup_finish", (void *)_cffi_f_sqlite3_backup_finish, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_O, 59), (void *)_cffi_d_sqlite3_backup_finish }, + { "sqlite3_backup_init", (void *)_cffi_f_sqlite3_backup_init, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 138), (void *)_cffi_d_sqlite3_backup_init }, + { "sqlite3_backup_pagecount", (void *)_cffi_f_sqlite3_backup_pagecount, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_O, 59), (void *)_cffi_d_sqlite3_backup_pagecount }, + { "sqlite3_backup_remaining", (void *)_cffi_f_sqlite3_backup_remaining, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_O, 59), (void *)_cffi_d_sqlite3_backup_remaining }, + { "sqlite3_backup_step", (void *)_cffi_f_sqlite3_backup_step, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 62), (void *)_cffi_d_sqlite3_backup_step }, + { "sqlite3_bind_blob", (void *)_cffi_f_sqlite3_bind_blob, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 100), (void *)_cffi_d_sqlite3_bind_blob }, + { "sqlite3_bind_double", (void *)_cffi_f_sqlite3_bind_double, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 80), (void *)_cffi_d_sqlite3_bind_double }, + { "sqlite3_bind_int", (void *)_cffi_f_sqlite3_bind_int, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 85), (void *)_cffi_d_sqlite3_bind_int }, + { "sqlite3_bind_int64", (void *)_cffi_f_sqlite3_bind_int64, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 90), (void *)_cffi_d_sqlite3_bind_int64 }, + { "sqlite3_bind_null", (void *)_cffi_f_sqlite3_bind_null, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 69), (void *)_cffi_d_sqlite3_bind_null }, + { "sqlite3_bind_parameter_count", (void *)_cffi_f_sqlite3_bind_parameter_count, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_O, 66), (void *)_cffi_d_sqlite3_bind_parameter_count }, + { "sqlite3_bind_parameter_name", (void *)_cffi_f_sqlite3_bind_parameter_name, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 3), (void *)_cffi_d_sqlite3_bind_parameter_name }, + { "sqlite3_bind_text", (void *)_cffi_f_sqlite3_bind_text, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 73), (void *)_cffi_d_sqlite3_bind_text }, + { "sqlite3_bind_text16", (void *)_cffi_f_sqlite3_bind_text16, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 100), (void *)_cffi_d_sqlite3_bind_text16 }, + { "sqlite3_bind_value", (void *)_cffi_f_sqlite3_bind_value, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 95), (void *)_cffi_d_sqlite3_bind_value }, + { "sqlite3_bind_zeroblob", (void *)_cffi_f_sqlite3_bind_zeroblob, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 85), (void *)_cffi_d_sqlite3_bind_zeroblob }, + { "sqlite3_busy_timeout", (void *)_cffi_f_sqlite3_busy_timeout, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 55), (void *)_cffi_d_sqlite3_busy_timeout }, + { "sqlite3_changes", (void *)_cffi_f_sqlite3_changes, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_O, 23), (void *)_cffi_d_sqlite3_changes }, + { "sqlite3_close", (void *)_cffi_f_sqlite3_close, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_O, 23), (void *)_cffi_d_sqlite3_close }, + { "sqlite3_column_blob", (void *)_cffi_f_sqlite3_column_blob, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 155), (void *)_cffi_d_sqlite3_column_blob }, + { "sqlite3_column_bytes", (void *)_cffi_f_sqlite3_column_bytes, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 69), (void *)_cffi_d_sqlite3_column_bytes }, + { "sqlite3_column_count", (void *)_cffi_f_sqlite3_column_count, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_O, 66), (void *)_cffi_d_sqlite3_column_count }, + { "sqlite3_column_decltype", (void *)_cffi_f_sqlite3_column_decltype, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 3), (void *)_cffi_d_sqlite3_column_decltype }, + { "sqlite3_column_double", (void *)_cffi_f_sqlite3_column_double, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 9), (void *)_cffi_d_sqlite3_column_double }, + { "sqlite3_column_int", (void *)_cffi_f_sqlite3_column_int, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 69), (void *)_cffi_d_sqlite3_column_int }, + { "sqlite3_column_int64", (void *)_cffi_f_sqlite3_column_int64, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 131), (void *)_cffi_d_sqlite3_column_int64 }, + { "sqlite3_column_name", (void *)_cffi_f_sqlite3_column_name, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 3), (void *)_cffi_d_sqlite3_column_name }, + { "sqlite3_column_text", (void *)_cffi_f_sqlite3_column_text, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 144), (void *)_cffi_d_sqlite3_column_text }, + { "sqlite3_column_text16", (void *)_cffi_f_sqlite3_column_text16, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 155), (void *)_cffi_d_sqlite3_column_text16 }, + { "sqlite3_column_type", (void *)_cffi_f_sqlite3_column_type, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 69), (void *)_cffi_d_sqlite3_column_type }, + { "sqlite3_create_collation", (void *)_cffi_f_sqlite3_create_collation, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 43), (void *)_cffi_d_sqlite3_create_collation }, + { "sqlite3_create_function", (void *)_cffi_f_sqlite3_create_function, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 26), (void *)_cffi_d_sqlite3_create_function }, + { "sqlite3_data_count", (void *)_cffi_f_sqlite3_data_count, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_O, 66), (void *)_cffi_d_sqlite3_data_count }, + { "sqlite3_enable_load_extension", (void *)_cffi_f_sqlite3_enable_load_extension, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 55), (void *)_cffi_d_sqlite3_enable_load_extension }, + { "sqlite3_errcode", (void *)_cffi_f_sqlite3_errcode, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_O, 23), (void *)_cffi_d_sqlite3_errcode }, + { "sqlite3_errmsg", (void *)_cffi_f_sqlite3_errmsg, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_O, 0), (void *)_cffi_d_sqlite3_errmsg }, + { "sqlite3_finalize", (void *)_cffi_f_sqlite3_finalize, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_O, 66), (void *)_cffi_d_sqlite3_finalize }, + { "sqlite3_get_autocommit", (void *)_cffi_f_sqlite3_get_autocommit, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_O, 23), (void *)_cffi_d_sqlite3_get_autocommit }, + { "sqlite3_last_insert_rowid", (void *)_cffi_f_sqlite3_last_insert_rowid, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_O, 128), (void *)_cffi_d_sqlite3_last_insert_rowid }, + { "sqlite3_libversion", (void *)_cffi_f_sqlite3_libversion, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_N, 7), (void *)_cffi_d_sqlite3_libversion }, + { "sqlite3_open", (void *)_cffi_f_sqlite3_open, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 16), (void *)_cffi_d_sqlite3_open }, + { "sqlite3_prepare", (void *)_cffi_f_sqlite3_prepare, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 36), (void *)_cffi_d_sqlite3_prepare }, + { "sqlite3_prepare_v2", (void *)_cffi_f_sqlite3_prepare_v2, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 36), (void *)_cffi_d_sqlite3_prepare_v2 }, + { "sqlite3_progress_handler", (void *)_cffi_f_sqlite3_progress_handler, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 162), (void *)_cffi_d_sqlite3_progress_handler }, + { "sqlite3_reset", (void *)_cffi_f_sqlite3_reset, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_O, 66), (void *)_cffi_d_sqlite3_reset }, + { "sqlite3_result_blob", (void *)_cffi_f_sqlite3_result_blob, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 208), (void *)_cffi_d_sqlite3_result_blob }, + { "sqlite3_result_double", (void *)_cffi_f_sqlite3_result_double, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 182), (void *)_cffi_d_sqlite3_result_double }, + { "sqlite3_result_error", (void *)_cffi_f_sqlite3_result_error, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 171), (void *)_cffi_d_sqlite3_result_error }, + { "sqlite3_result_error16", (void *)_cffi_f_sqlite3_result_error16, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 203), (void *)_cffi_d_sqlite3_result_error16 }, + { "sqlite3_result_error_code", (void *)_cffi_f_sqlite3_result_error_code, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 186), (void *)_cffi_d_sqlite3_result_error_code }, + { "sqlite3_result_error_nomem", (void *)_cffi_f_sqlite3_result_error_nomem, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_O, 168), (void *)_cffi_d_sqlite3_result_error_nomem }, + { "sqlite3_result_error_toobig", (void *)_cffi_f_sqlite3_result_error_toobig, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_O, 168), (void *)_cffi_d_sqlite3_result_error_toobig }, + { "sqlite3_result_int", (void *)_cffi_f_sqlite3_result_int, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 186), (void *)_cffi_d_sqlite3_result_int }, + { "sqlite3_result_int64", (void *)_cffi_f_sqlite3_result_int64, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 195), (void *)_cffi_d_sqlite3_result_int64 }, + { "sqlite3_result_null", (void *)_cffi_f_sqlite3_result_null, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_O, 168), (void *)_cffi_d_sqlite3_result_null }, + { "sqlite3_result_text", (void *)_cffi_f_sqlite3_result_text, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 176), (void *)_cffi_d_sqlite3_result_text }, + { "sqlite3_result_text16", (void *)_cffi_f_sqlite3_result_text16, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 208), (void *)_cffi_d_sqlite3_result_text16 }, + { "sqlite3_result_text16be", (void *)_cffi_f_sqlite3_result_text16be, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 208), (void *)_cffi_d_sqlite3_result_text16be }, + { "sqlite3_result_text16le", (void *)_cffi_f_sqlite3_result_text16le, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 208), (void *)_cffi_d_sqlite3_result_text16le }, + { "sqlite3_result_value", (void *)_cffi_f_sqlite3_result_value, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 199), (void *)_cffi_d_sqlite3_result_value }, + { "sqlite3_result_zeroblob", (void *)_cffi_f_sqlite3_result_zeroblob, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 186), (void *)_cffi_d_sqlite3_result_zeroblob }, + { "sqlite3_set_authorizer", (void *)_cffi_f_sqlite3_set_authorizer, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 50), (void *)_cffi_d_sqlite3_set_authorizer }, + { "sqlite3_sleep", (void *)_cffi_f_sqlite3_sleep, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_O, 20), (void *)_cffi_d_sqlite3_sleep }, + { "sqlite3_step", (void *)_cffi_f_sqlite3_step, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_O, 66), (void *)_cffi_d_sqlite3_step }, + { "sqlite3_total_changes", (void *)_cffi_f_sqlite3_total_changes, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_O, 23), (void *)_cffi_d_sqlite3_total_changes }, + { "sqlite3_value_blob", (void *)_cffi_f_sqlite3_value_blob, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_O, 159), (void *)_cffi_d_sqlite3_value_blob }, + { "sqlite3_value_bytes", (void *)_cffi_f_sqlite3_value_bytes, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_O, 107), (void *)_cffi_d_sqlite3_value_bytes }, + { "sqlite3_value_bytes16", (void *)_cffi_f_sqlite3_value_bytes16, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_O, 107), (void *)_cffi_d_sqlite3_value_bytes16 }, + { "sqlite3_value_double", (void *)_cffi_f_sqlite3_value_double, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_O, 13), (void *)_cffi_d_sqlite3_value_double }, + { "sqlite3_value_int", (void *)_cffi_f_sqlite3_value_int, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_O, 107), (void *)_cffi_d_sqlite3_value_int }, + { "sqlite3_value_int64", (void *)_cffi_f_sqlite3_value_int64, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_O, 135), (void *)_cffi_d_sqlite3_value_int64 }, + { "sqlite3_value_numeric_type", (void *)_cffi_f_sqlite3_value_numeric_type, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_O, 107), (void *)_cffi_d_sqlite3_value_numeric_type }, + { "sqlite3_value_text", (void *)_cffi_f_sqlite3_value_text, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_O, 148), (void *)_cffi_d_sqlite3_value_text }, + { "sqlite3_value_text16", (void *)_cffi_f_sqlite3_value_text16, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_O, 159), (void *)_cffi_d_sqlite3_value_text16 }, + { "sqlite3_value_text16be", (void *)_cffi_f_sqlite3_value_text16be, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_O, 159), (void *)_cffi_d_sqlite3_value_text16be }, + { "sqlite3_value_text16le", (void *)_cffi_f_sqlite3_value_text16le, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_O, 159), (void *)_cffi_d_sqlite3_value_text16le }, + { "sqlite3_value_type", (void *)_cffi_f_sqlite3_value_type, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_O, 107), (void *)_cffi_d_sqlite3_value_type }, +}; + +static const struct _cffi_struct_union_s _cffi_struct_unions[] = { + { "$sqlite3", 218, _CFFI_F_OPAQUE, + (size_t)-1, -1, -1, 0 /* opaque */ }, + { "$sqlite3_backup", 219, _CFFI_F_OPAQUE, + (size_t)-1, -1, -1, 0 /* opaque */ }, + { "$sqlite3_context", 220, _CFFI_F_OPAQUE, + (size_t)-1, -1, -1, 0 /* opaque */ }, + { "$sqlite3_stmt", 221, _CFFI_F_OPAQUE, + (size_t)-1, -1, -1, 0 /* opaque */ }, + { "$sqlite3_value", 222, _CFFI_F_OPAQUE, + (size_t)-1, -1, -1, 0 /* opaque */ }, +}; + +static const struct _cffi_typename_s _cffi_typenames[] = { + { "sqlite3", 218 }, + { "sqlite3_backup", 219 }, + { "sqlite3_context", 220 }, + { "sqlite3_int64", 93 }, + { "sqlite3_stmt", 221 }, + { "sqlite3_uint64", 223 }, + { "sqlite3_value", 222 }, +}; + +static const struct _cffi_type_context_s _cffi_type_context = { + _cffi_types, + _cffi_globals, + NULL, /* no fields */ + _cffi_struct_unions, + NULL, /* no enums */ + _cffi_typenames, + 148, /* num_globals */ + 5, /* num_struct_unions */ + 0, /* num_enums */ + 7, /* num_typenames */ + NULL, /* no includes */ + 227, /* num_types */ + 0, /* flags */ +}; + +#ifdef PYPY_VERSION +PyMODINIT_FUNC +_cffi_pypyinit__sqlite3_cffi(const void *p[]) +{ + p[0] = (const void *)0x2601; + p[1] = &_cffi_type_context; +} +# ifdef _MSC_VER + PyMODINIT_FUNC +# if PY_MAJOR_VERSION >= 3 + PyInit__sqlite3_cffi(void) { return NULL; } +# else + init_sqlite3_cffi(void) { } +# endif +# endif +#elif PY_MAJOR_VERSION >= 3 +PyMODINIT_FUNC +PyInit__sqlite3_cffi(void) +{ + return _cffi_init("_sqlite3_cffi", 0x2601, &_cffi_type_context); +} +#else +PyMODINIT_FUNC +init_sqlite3_cffi(void) +{ + _cffi_init("_sqlite3_cffi", 0x2601, &_cffi_type_context); +} +#endif diff --git a/src/sqlite3.c b/src/sqlite3.c index 4a87906..aaab200 100644 --- a/src/sqlite3.c +++ b/src/sqlite3.c @@ -1,6 +1,6 @@ /****************************************************************************** ** This file is an amalgamation of many separate C source files from SQLite -** version 3.15.1. By combining all the individual C code files into this +** version 3.15.2. By combining all the individual C code files into this ** single large file, the entire code can be compiled as a single translation ** unit. This allows many compilers to do optimizations that would not be ** possible if the files were compiled separately. Performance improvements @@ -381,9 +381,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.15.1" -#define SQLITE_VERSION_NUMBER 3015001 -#define SQLITE_SOURCE_ID "2016-11-04 12:08:49 1136863c76576110e710dd5d69ab6bf347c65e36" +#define SQLITE_VERSION "3.15.2" +#define SQLITE_VERSION_NUMBER 3015002 +#define SQLITE_SOURCE_ID "2016-11-28 19:13:37 bbd85d235f7037c6a033a9690534391ffeacecc8" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -15583,15 +15583,15 @@ struct Parse { } aColCache[SQLITE_N_COLCACHE]; /* One for each column cache entry */ int aTempReg[8]; /* Holding area for temporary registers */ Token sNameToken; /* Token with unqualified schema object name */ - Token sLastToken; /* The last token parsed */ /************************************************************************ ** Above is constant between recursions. Below is reset before and after ** each recursion. The boundary between these two regions is determined - ** using offsetof(Parse,nVar) so the nVar field must be the first field - ** in the recursive region. + ** using offsetof(Parse,sLastToken) so the sLastToken field must be the + ** first field in the recursive region. ************************************************************************/ + Token sLastToken; /* The last token parsed */ ynVar nVar; /* Number of '?' variables seen in the SQL so far */ int nzVar; /* Number of available slots in azVar[] */ u8 iPkSortOrder; /* ASC or DESC for INTEGER PRIMARY KEY */ @@ -15625,7 +15625,7 @@ struct Parse { ** Sizes and pointers of various parts of the Parse object. */ #define PARSE_HDR_SZ offsetof(Parse,aColCache) /* Recursive part w/o aColCache*/ -#define PARSE_RECURSE_SZ offsetof(Parse,nVar) /* Recursive part */ +#define PARSE_RECURSE_SZ offsetof(Parse,sLastToken) /* Recursive part */ #define PARSE_TAIL_SZ (sizeof(Parse)-PARSE_RECURSE_SZ) /* Non-recursive part */ #define PARSE_TAIL(X) (((char*)(X))+PARSE_RECURSE_SZ) /* Pointer to tail */ @@ -88585,6 +88585,10 @@ static int lookupName( sqlite3ErrorMsg(pParse, "misuse of aliased aggregate %s", zAs); return WRC_Abort; } + if( sqlite3ExprVectorSize(pOrig)!=1 ){ + sqlite3ErrorMsg(pParse, "row value misused"); + return WRC_Abort; + } resolveAlias(pParse, pEList, j, pExpr, "", nSubquery); cnt = 1; pMatch = 0; @@ -88961,6 +88965,7 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){ notValid(pParse, pNC, "parameters", NC_IsCheck|NC_PartIdx|NC_IdxExpr); break; } + case TK_BETWEEN: case TK_EQ: case TK_NE: case TK_LT: @@ -88971,10 +88976,17 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){ case TK_ISNOT: { int nLeft, nRight; if( pParse->db->mallocFailed ) break; - assert( pExpr->pRight!=0 ); assert( pExpr->pLeft!=0 ); nLeft = sqlite3ExprVectorSize(pExpr->pLeft); - nRight = sqlite3ExprVectorSize(pExpr->pRight); + if( pExpr->op==TK_BETWEEN ){ + nRight = sqlite3ExprVectorSize(pExpr->x.pList->a[0].pExpr); + if( nRight==nLeft ){ + nRight = sqlite3ExprVectorSize(pExpr->x.pList->a[1].pExpr); + } + }else{ + assert( pExpr->pRight!=0 ); + nRight = sqlite3ExprVectorSize(pExpr->pRight); + } if( nLeft!=nRight ){ testcase( pExpr->op==TK_EQ ); testcase( pExpr->op==TK_NE ); @@ -88984,6 +88996,7 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){ testcase( pExpr->op==TK_GE ); testcase( pExpr->op==TK_IS ); testcase( pExpr->op==TK_ISNOT ); + testcase( pExpr->op==TK_BETWEEN ); sqlite3ErrorMsg(pParse, "row value misused"); } break; @@ -93012,7 +93025,7 @@ static int exprCodeVector(Parse *pParse, Expr *p, int *piFreeable){ iResult = pParse->nMem+1; pParse->nMem += nResult; for(i=0; ix.pList->a[i].pExpr, i+iResult); + sqlite3ExprCodeFactorable(pParse, p->x.pList->a[i].pExpr, i+iResult); } } } @@ -97764,6 +97777,7 @@ static void codeAttach( sqlite3* db = pParse->db; int regArgs; + if( pParse->nErr ) goto attach_end; memset(&sName, 0, sizeof(NameContext)); sName.pParse = pParse; @@ -104309,6 +104323,8 @@ static void instrFunc( zHaystack = sqlite3_value_text(argv[0]); zNeedle = sqlite3_value_text(argv[1]); isText = 1; + if( zNeedle==0 ) return; + assert( zHaystack ); } while( nNeedle<=nHaystack && memcmp(zHaystack, zNeedle, nNeedle)!=0 ){ N++; @@ -124771,6 +124787,7 @@ static int codeEqualityTerm( }else{ Select *pSelect = pX->x.pSelect; sqlite3 *db = pParse->db; + u16 savedDbOptFlags = db->dbOptFlags; ExprList *pOrigRhs = pSelect->pEList; ExprList *pOrigLhs = pX->pLeft->x.pList; ExprList *pRhs = 0; /* New Select.pEList for RHS */ @@ -124814,7 +124831,9 @@ static int codeEqualityTerm( testcase( aiMap==0 ); } pSelect->pEList = pRhs; + db->dbOptFlags |= SQLITE_QueryFlattener; eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, aiMap); + db->dbOptFlags = savedDbOptFlags; testcase( aiMap!=0 && aiMap[0]!=0 ); pSelect->pEList = pOrigRhs; pLeft->x.pList = pOrigLhs; @@ -127633,6 +127652,8 @@ static void exprAnalyze( /* Prevent ON clause terms of a LEFT JOIN from being used to drive ** an index for tables to the left of the join. */ + testcase( pTerm!=&pWC->a[idxTerm] ); + pTerm = &pWC->a[idxTerm]; pTerm->prereqRight |= extraRight; } @@ -165385,20 +165406,20 @@ SQLITE_PRIVATE int sqlite3IcuInit(sqlite3 *db){ void *pContext; /* sqlite3_user_data() context */ void (*xFunc)(sqlite3_context*,int,sqlite3_value**); } scalars[] = { - {"regexp", 2, SQLITE_ANY, 0, icuRegexpFunc}, + {"regexp", 2, SQLITE_ANY|SQLITE_DETERMINISTIC, 0, icuRegexpFunc}, - {"lower", 1, SQLITE_UTF16, 0, icuCaseFunc16}, - {"lower", 2, SQLITE_UTF16, 0, icuCaseFunc16}, - {"upper", 1, SQLITE_UTF16, (void*)1, icuCaseFunc16}, - {"upper", 2, SQLITE_UTF16, (void*)1, icuCaseFunc16}, + {"lower", 1, SQLITE_UTF16|SQLITE_DETERMINISTIC, 0, icuCaseFunc16}, + {"lower", 2, SQLITE_UTF16|SQLITE_DETERMINISTIC, 0, icuCaseFunc16}, + {"upper", 1, SQLITE_UTF16|SQLITE_DETERMINISTIC, (void*)1, icuCaseFunc16}, + {"upper", 2, SQLITE_UTF16|SQLITE_DETERMINISTIC, (void*)1, icuCaseFunc16}, - {"lower", 1, SQLITE_UTF8, 0, icuCaseFunc16}, - {"lower", 2, SQLITE_UTF8, 0, icuCaseFunc16}, - {"upper", 1, SQLITE_UTF8, (void*)1, icuCaseFunc16}, - {"upper", 2, SQLITE_UTF8, (void*)1, icuCaseFunc16}, + {"lower", 1, SQLITE_UTF8|SQLITE_DETERMINISTIC, 0, icuCaseFunc16}, + {"lower", 2, SQLITE_UTF8|SQLITE_DETERMINISTIC, 0, icuCaseFunc16}, + {"upper", 1, SQLITE_UTF8|SQLITE_DETERMINISTIC, (void*)1, icuCaseFunc16}, + {"upper", 2, SQLITE_UTF8|SQLITE_DETERMINISTIC, (void*)1, icuCaseFunc16}, - {"like", 2, SQLITE_UTF8, 0, icuLikeFunc}, - {"like", 3, SQLITE_UTF8, 0, icuLikeFunc}, + {"like", 2, SQLITE_UTF8|SQLITE_DETERMINISTIC, 0, icuLikeFunc}, + {"like", 3, SQLITE_UTF8|SQLITE_DETERMINISTIC, 0, icuLikeFunc}, {"icu_load_collation", 2, SQLITE_UTF8, (void*)db, icuLoadCollation}, }; @@ -176416,13 +176437,15 @@ SQLITE_EXTENSION_INIT1 #ifdef sqlite3Isdigit /* Use the SQLite core versions if this routine is part of the ** SQLite amalgamation */ -# define safe_isdigit(x) sqlite3Isdigit(x) -# define safe_isalnum(x) sqlite3Isalnum(x) +# define safe_isdigit(x) sqlite3Isdigit(x) +# define safe_isalnum(x) sqlite3Isalnum(x) +# define safe_isxdigit(x) sqlite3Isxdigit(x) #else /* Use the standard library for separate compilation */ #include /* amalgamator: keep */ -# define safe_isdigit(x) isdigit((unsigned char)(x)) -# define safe_isalnum(x) isalnum((unsigned char)(x)) +# define safe_isdigit(x) isdigit((unsigned char)(x)) +# define safe_isalnum(x) isalnum((unsigned char)(x)) +# define safe_isxdigit(x) isxdigit((unsigned char)(x)) #endif /* @@ -177069,6 +177092,15 @@ static int jsonParseAddNode( return pParse->nNode++; } +/* +** Return true if z[] begins with 4 (or more) hexadecimal digits +*/ +static int jsonIs4Hex(const char *z){ + int i; + for(i=0; i<4; i++) if( !safe_isxdigit(z[i]) ) return 0; + return 1; +} + /* ** Parse a single JSON value which begins at pParse->zJson[i]. Return the ** index of the first character past the end of the value parsed. @@ -177143,8 +177175,13 @@ static int jsonParseValue(JsonParse *pParse, u32 i){ if( c==0 ) return -1; if( c=='\\' ){ c = pParse->zJson[++j]; - if( c==0 ) return -1; - jnFlags = JNODE_ESCAPE; + if( c=='"' || c=='\\' || c=='/' || c=='b' || c=='f' + || c=='n' || c=='r' || c=='t' + || (c=='u' && jsonIs4Hex(pParse->zJson+j+1)) ){ + jnFlags = JNODE_ESCAPE; + }else{ + return -1; + } }else if( c=='"' ){ break; } @@ -178012,7 +178049,7 @@ static void jsonObjectFinal(sqlite3_context *ctx){ if( pStr ){ jsonAppendChar(pStr, '}'); if( pStr->bErr ){ - if( pStr->bErr==0 ) sqlite3_result_error_nomem(ctx); + if( pStr->bErr==1 ) sqlite3_result_error_nomem(ctx); assert( pStr->bStatic ); }else{ sqlite3_result_text(ctx, pStr->zBuf, pStr->nUsed, @@ -178290,9 +178327,9 @@ static int jsonEachColumn( /* For json_each() path and root are the same so fall through ** into the root case */ } - case JEACH_ROOT: { + default: { const char *zRoot = p->zRoot; - if( zRoot==0 ) zRoot = "$"; + if( zRoot==0 ) zRoot = "$"; sqlite3_result_text(ctx, zRoot, -1, SQLITE_STATIC); break; } @@ -184219,7 +184256,7 @@ static int fts5ExprNodeTest_STRING( } }else{ Fts5IndexIter *pIter = pPhrase->aTerm[j].pIter; - if( pIter->iRowid==iLast ) continue; + if( pIter->iRowid==iLast || pIter->bEof ) continue; bMatch = 0; if( fts5ExprAdvanceto(pIter, bDesc, &iLast, &rc, &pNode->bEof) ){ return rc; @@ -189359,6 +189396,7 @@ static void fts5MultiIterNext( i64 iFrom /* Advance at least as far as this */ ){ int bUseFrom = bFrom; + assert( pIter->base.bEof==0 ); while( p->rc==SQLITE_OK ){ int iFirst = pIter->aFirst[1].iFirst; int bNewTerm = 0; @@ -195623,7 +195661,7 @@ static void fts5SourceIdFunc( ){ assert( nArg==0 ); UNUSED_PARAM2(nArg, apUnused); - sqlite3_result_text(pCtx, "fts5: 2016-11-04 12:08:49 1136863c76576110e710dd5d69ab6bf347c65e36", -1, SQLITE_TRANSIENT); + sqlite3_result_text(pCtx, "fts5: 2016-11-28 19:13:37 bbd85d235f7037c6a033a9690534391ffeacecc8", -1, SQLITE_TRANSIENT); } static int fts5Init(sqlite3 *db){ diff --git a/src/sqlite3.h b/src/sqlite3.h index d02aeb1..8222b79 100644 --- a/src/sqlite3.h +++ b/src/sqlite3.h @@ -121,9 +121,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.15.1" -#define SQLITE_VERSION_NUMBER 3015001 -#define SQLITE_SOURCE_ID "2016-11-04 12:08:49 1136863c76576110e710dd5d69ab6bf347c65e36" +#define SQLITE_VERSION "3.15.2" +#define SQLITE_VERSION_NUMBER 3015002 +#define SQLITE_SOURCE_ID "2016-11-28 19:13:37 bbd85d235f7037c6a033a9690534391ffeacecc8" /* ** CAPI3REF: Run-Time Library Version Numbers