⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sqliteint.h

📁 嵌入式数据系统软件!
💻 H
📖 第 1 页 / 共 5 页
字号:
/*** 2001 September 15**** The author disclaims copyright to this source code.  In place of** a legal notice, here is a blessing:****    May you do good and not evil.**    May you find forgiveness for yourself and forgive others.**    May you share freely, never taking more than you give.***************************************************************************** Internal interface definitions for SQLite.**** @(#) $Id: sqliteInt.h,v 1.626 2007/12/13 03:45:08 drh Exp $*/#ifndef _SQLITEINT_H_#define _SQLITEINT_H_/*** The macro unlikely() is a hint that surrounds a boolean** expression that is usually false.  Macro likely() surrounds** a boolean expression that is usually true.  GCC is able to** use these hints to generate better code, sometimes.*/#if defined(__GNUC__)# define likely(X)    __builtin_expect((X),1)# define unlikely(X)  __builtin_expect((X),0)#else# define likely(X)    !!(X)# define unlikely(X)  !!(X)#endif/*** These #defines should enable >2GB file support on Posix if the** underlying operating system supports it.  If the OS lacks** large file support, or if the OS is windows, these should be no-ops.**** Ticket #2739:  The _LARGEFILE_SOURCE macro must appear before any** system #includes.  Hence, this block of code must be the very first** code in all source files.**** Large file support can be disabled using the -DSQLITE_DISABLE_LFS switch** on the compiler command line.  This is necessary if you are compiling** on a recent machine (ex: RedHat 7.2) but you want your code to work** on an older machine (ex: RedHat 6.0).  If you compile on RedHat 7.2** without this option, LFS is enable.  But LFS does not exist in the kernel** in RedHat 6.0, so the code won't work.  Hence, for maximum binary** portability you should omit LFS.**** Similar is true for MacOS.  LFS is only supported on MacOS 9 and later.*/#ifndef SQLITE_DISABLE_LFS# define _LARGE_FILE       1# ifndef _FILE_OFFSET_BITS#   define _FILE_OFFSET_BITS 64# endif# define _LARGEFILE_SOURCE 1#endif#include "sqliteLimit.h"/*** For testing purposes, the various size limit constants are really** variables that we can modify in the testfixture.*/#ifdef SQLITE_TEST  #undef SQLITE_MAX_LENGTH  #undef SQLITE_MAX_COLUMN  #undef SQLITE_MAX_SQL_LENGTH  #undef SQLITE_MAX_EXPR_DEPTH  #undef SQLITE_MAX_COMPOUND_SELECT  #undef SQLITE_MAX_VDBE_OP  #undef SQLITE_MAX_FUNCTION_ARG  #undef SQLITE_MAX_VARIABLE_NUMBER  #undef SQLITE_MAX_PAGE_SIZE  #undef SQLITE_MAX_PAGE_COUNT  #undef SQLITE_MAX_LIKE_PATTERN_LENGTH  #define SQLITE_MAX_LENGTH              sqlite3MAX_LENGTH  #define SQLITE_MAX_COLUMN              sqlite3MAX_COLUMN  #define SQLITE_MAX_SQL_LENGTH          sqlite3MAX_SQL_LENGTH  #define SQLITE_MAX_EXPR_DEPTH          sqlite3MAX_EXPR_DEPTH  #define SQLITE_MAX_COMPOUND_SELECT     sqlite3MAX_COMPOUND_SELECT  #define SQLITE_MAX_VDBE_OP             sqlite3MAX_VDBE_OP  #define SQLITE_MAX_FUNCTION_ARG        sqlite3MAX_FUNCTION_ARG  #define SQLITE_MAX_VARIABLE_NUMBER     sqlite3MAX_VARIABLE_NUMBER  #define SQLITE_MAX_PAGE_SIZE           sqlite3MAX_PAGE_SIZE  #define SQLITE_MAX_PAGE_COUNT          sqlite3MAX_PAGE_COUNT  #define SQLITE_MAX_LIKE_PATTERN_LENGTH sqlite3MAX_LIKE_PATTERN_LENGTH  extern int sqlite3MAX_LENGTH;  extern int sqlite3MAX_COLUMN;  extern int sqlite3MAX_SQL_LENGTH;  extern int sqlite3MAX_EXPR_DEPTH;  extern int sqlite3MAX_COMPOUND_SELECT;  extern int sqlite3MAX_VDBE_OP;  extern int sqlite3MAX_FUNCTION_ARG;  extern int sqlite3MAX_VARIABLE_NUMBER;  extern int sqlite3MAX_PAGE_SIZE;  extern int sqlite3MAX_PAGE_COUNT;  extern int sqlite3MAX_LIKE_PATTERN_LENGTH;#endif/*** The SQLITE_THREADSAFE macro must be defined as either 0 or 1.** Older versions of SQLite used an optional THREADSAFE macro.** We support that for legacy*/#if !defined(SQLITE_THREADSAFE)#if defined(THREADSAFE)# define SQLITE_THREADSAFE THREADSAFE#else# define SQLITE_THREADSAFE 1#endif#endif/*** We need to define _XOPEN_SOURCE as follows in order to enable** recursive mutexes on most unix systems.  But Mac OS X is different.** The _XOPEN_SOURCE define causes problems for Mac OS X we are told,** so it is omitted there.  See ticket #2673.**** Later we learn that _XOPEN_SOURCE is poorly or incorrectly** implemented on some systems.  So we avoid defining it at all** if it is already defined or if it is unneeded because we are** not doing a threadsafe build.  Ticket #2681.**** See also ticket #2741.*/#if !defined(_XOPEN_SOURCE) && !defined(__DARWIN__) && SQLITE_THREADSAFE#  define _XOPEN_SOURCE 500  /* Needed to enable pthread recursive mutexes */#endif#if defined(SQLITE_TCL) || defined(TCLSH)# include <tcl.h>#endif/*** Many people are failing to set -DNDEBUG=1 when compiling SQLite.** Setting NDEBUG makes the code smaller and run faster.  So the following** lines are added to automatically set NDEBUG unless the -DSQLITE_DEBUG=1** option is set.  Thus NDEBUG becomes an opt-in rather than an opt-out** feature.*/#if !defined(NDEBUG) && !defined(SQLITE_DEBUG) # define NDEBUG 1#endif#include "sqlite3.h"#include "hash.h"#include "parse.h"#include <stdio.h>#include <stdlib.h>#include <string.h>#include <assert.h>#include <stddef.h>#define sqlite3_isnan(X)  ((X)!=(X))/*** If compiling for a processor that lacks floating point support,** substitute integer for floating-point*/#ifdef SQLITE_OMIT_FLOATING_POINT# define double sqlite_int64# define LONGDOUBLE_TYPE sqlite_int64# ifndef SQLITE_BIG_DBL#   define SQLITE_BIG_DBL (0x7fffffffffffffff)# endif# define SQLITE_OMIT_DATETIME_FUNCS 1# define SQLITE_OMIT_TRACE 1# undef SQLITE_MIXED_ENDIAN_64BIT_FLOAT#endif#ifndef SQLITE_BIG_DBL# define SQLITE_BIG_DBL (1e99)#endif/*** OMIT_TEMPDB is set to 1 if SQLITE_OMIT_TEMPDB is defined, or 0** afterward. Having this macro allows us to cause the C compiler ** to omit code used by TEMP tables without messy #ifndef statements.*/#ifdef SQLITE_OMIT_TEMPDB#define OMIT_TEMPDB 1#else#define OMIT_TEMPDB 0#endif/*** If the following macro is set to 1, then NULL values are considered** distinct when determining whether or not two entries are the same** in a UNIQUE index.  This is the way PostgreSQL, Oracle, DB2, MySQL,** OCELOT, and Firebird all work.  The SQL92 spec explicitly says this** is the way things are suppose to work.**** If the following macro is set to 0, the NULLs are indistinct for** a UNIQUE index.  In this mode, you can only have a single NULL entry** for a column declared UNIQUE.  This is the way Informix and SQL Server** work.*/#define NULL_DISTINCT_FOR_UNIQUE 1/*** The "file format" number is an integer that is incremented whenever** the VDBE-level file format changes.  The following macros define the** the default file format for new databases and the maximum file format** that the library can read.*/#define SQLITE_MAX_FILE_FORMAT 4#ifndef SQLITE_DEFAULT_FILE_FORMAT# define SQLITE_DEFAULT_FILE_FORMAT 1#endif/*** Provide a default value for TEMP_STORE in case it is not specified** on the command-line*/#ifndef TEMP_STORE# define TEMP_STORE 1#endif/*** GCC does not define the offsetof() macro so we'll have to do it** ourselves.*/#ifndef offsetof#define offsetof(STRUCTURE,FIELD) ((int)((char*)&((STRUCTURE*)0)->FIELD))#endif/*** Check to see if this machine uses EBCDIC.  (Yes, believe it or** not, there are still machines out there that use EBCDIC.)*/#if 'A' == '\301'# define SQLITE_EBCDIC 1#else# define SQLITE_ASCII 1#endif/*** Integers of known sizes.  These typedefs might change for architectures** where the sizes very.  Preprocessor macros are available so that the** types can be conveniently redefined at compile-type.  Like this:****         cc '-DUINTPTR_TYPE=long long int' ...*/#ifndef UINT32_TYPE# define UINT32_TYPE unsigned int#endif#ifndef UINT16_TYPE# define UINT16_TYPE unsigned short int#endif#ifndef INT16_TYPE# define INT16_TYPE short int#endif#ifndef UINT8_TYPE# define UINT8_TYPE unsigned char#endif#ifndef INT8_TYPE# define INT8_TYPE signed char#endif#ifndef LONGDOUBLE_TYPE# define LONGDOUBLE_TYPE long double#endiftypedef sqlite_int64 i64;          /* 8-byte signed integer */typedef sqlite_uint64 u64;         /* 8-byte unsigned integer */typedef UINT32_TYPE u32;           /* 4-byte unsigned integer */typedef UINT16_TYPE u16;           /* 2-byte unsigned integer */typedef INT16_TYPE i16;            /* 2-byte signed integer */typedef UINT8_TYPE u8;             /* 1-byte unsigned integer */typedef UINT8_TYPE i8;             /* 1-byte signed integer *//*** Macros to determine whether the machine is big or little endian,** evaluated at runtime.*/#ifdef SQLITE_AMALGAMATIONconst int sqlite3One;#elseextern const int sqlite3one;#endif#if defined(i386) || defined(__i386__) || defined(_M_IX86)# define SQLITE_BIGENDIAN    0# define SQLITE_LITTLEENDIAN 1# define SQLITE_UTF16NATIVE  SQLITE_UTF16LE#else# define SQLITE_BIGENDIAN    (*(char *)(&sqlite3one)==0)# define SQLITE_LITTLEENDIAN (*(char *)(&sqlite3one)==1)# define SQLITE_UTF16NATIVE (SQLITE_BIGENDIAN?SQLITE_UTF16BE:SQLITE_UTF16LE)#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -