Lines Matching defs:char
327 ** the ((void*)&((char*)0)[X]) construct. But MSVC chokes on ((void*)(X)).
340 # define SQLITE_INT_TO_PTR(X) ((void*)&((char*)0)[X])
341 # define SQLITE_PTR_TO_INT(X) ((int)(((char*)X)-(char*)0))
668 SQLITE_API const char sqlite3_version[] = SQLITE_VERSION;
669 SQLITE_API const char *sqlite3_libversion(void);
670 SQLITE_API const char *sqlite3_sourceid(void);
794 typedef int (*sqlite3_callback)(void*,int,char**, char**);
859 const char *sql, /* SQL to be evaluated */
860 int (*callback)(void*,int,char**,char**), /* Callback function */
862 char **errmsg /* Error msg written here */
1327 const char *zName; /* Name of this virtual file system */
1329 int (*xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*,
1331 int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir);
1332 int (*xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut);
1333 int (*xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut);
1334 void *(*xDlOpen)(sqlite3_vfs*, const char *zFilename);
1335 void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg);
1336 void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void);
1338 int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut);
1341 int (*xGetLastError)(sqlite3_vfs*, int, char *);
2029 SQLITE_API int sqlite3_complete(const char *sql);
2189 const char *zSql, /* SQL to be evaluated */
2190 char ***pazResult, /* Results of the query */
2193 char **pzErrmsg /* Error msg written here */
2195 SQLITE_API void sqlite3_free_table(char **result);
2243 ** char *zText = "It's a happy day!";
2249 ** char *zSQL = sqlite3_mprintf("INSERT INTO table VALUES('%q')", zText);
2277 ** char *zSQL = sqlite3_mprintf("INSERT INTO table VALUES(%Q)", zText);
2289 SQLITE_API char *sqlite3_mprintf(const char*,...);
2290 SQLITE_API char *sqlite3_vmprintf(const char*, va_list);
2291 SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...);
2493 int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
2583 SQLITE_API SQLITE_EXPERIMENTAL void *sqlite3_trace(sqlite3*, void(*xTrace)(void*,const char*), void*);
2585 void(*xProfile)(void*,const char*,sqlite3_uint64), void*);
2698 const char *filename, /* Database filename (UTF-8) */
2706 const char *filename, /* Database filename (UTF-8) */
2709 const char *zVfs /* Name of VFS module to use */
2747 SQLITE_API const char *sqlite3_errmsg(sqlite3*);
2955 const char *zSql, /* SQL statement, UTF-8 encoded */
2958 const char **pzTail /* OUT: Pointer to unused portion of zSql */
2962 const char *zSql, /* SQL statement, UTF-8 encoded */
2965 const char **pzTail /* OUT: Pointer to unused portion of zSql */
2989 SQLITE_API const char *sqlite3_sql(sqlite3_stmt *pStmt);
3128 SQLITE_API int sqlite3_bind_text(sqlite3_stmt*, int, const char*, int n, void(*)(void*));
3178 SQLITE_API const char *sqlite3_bind_parameter_name(sqlite3_stmt*, int);
3194 SQLITE_API int sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
3238 SQLITE_API const char *sqlite3_column_name(sqlite3_stmt*, int N);
3284 SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt*,int);
3286 SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt*,int);
3288 SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt*,int);
3320 SQLITE_API const char *sqlite3_column_decltype(sqlite3_stmt*,int);
3590 SQLITE_API const unsigned char *sqlite3_column_text(sqlite3_stmt*, int iCol);
3721 const char *zFunctionName,
3823 SQLITE_API const unsigned char *sqlite3_value_text(sqlite3_value*);
4067 SQLITE_API void sqlite3_result_error(sqlite3_context*, const char*, int);
4075 SQLITE_API void sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*));
4130 const char *zName,
4137 const char *zName,
4180 void(*)(void*,sqlite3*,int eTextRep,const char*)
4258 SQLITE_API char *sqlite3_temp_directory;
4407 void(*)(void *,int ,char const *,char const *,sqlite3_int64),
4510 ** <tr><td> 5th <td> const char* <td> Data type
4511 ** <tr><td> 6th <td> const char* <td> Name of default collation sequence
4548 const char *zDbName, /* Database name or NULL */
4549 const char *zTableName, /* Table name */
4550 const char *zColumnName, /* Column name */
4551 char const **pzDataType, /* OUTPUT: Declared data type */
4552 char const **pzCollSeq, /* OUTPUT: Collation sequence name */
4585 const char *zFile, /* Name of the shared library containing extension */
4586 const char *zProc, /* Entry point. Derived from zFile if 0 */
4587 char **pzErrMsg /* Put error message here if not 0 */
4676 int argc, const char *const*argv,
4677 sqlite3_vtab **ppVTab, char**);
4679 int argc, const char *const*argv,
4680 sqlite3_vtab **ppVTab, char**);
4686 int (*xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr,
4697 int (*xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName,
4700 int (*xRename)(sqlite3_vtab *pVtab, const char *zNew);
4759 unsigned char op; /* Constraint operator */
4760 unsigned char usable; /* True if this constraint is usable */
4766 unsigned char desc; /* True for DESC. False for ASC. */
4771 unsigned char omit; /* Do not code a test for this constraint */
4774 char *idxStr; /* String, possibly obtained from sqlite3_malloc */
4812 const char *zName, /* Name of the module */
4818 const char *zName, /* Name of the module */
4846 char *zErrMsg; /* Error message from sqlite3_mprintf() */
4882 SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_declare_vtab(sqlite3*, const char *zSQL);
4901 SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
4987 const char *zDb,
4988 const char *zTable,
4989 const char *zColumn,
5129 SQLITE_API sqlite3_vfs *sqlite3_vfs_find(const char *zVfsName);
5423 SQLITE_API int sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);
6032 const char *zDestName, /* Destination database name */
6034 const char *zSourceName /* Source database name */
6172 SQLITE_API int sqlite3_strnicmp(const char *, const char *, int);
6253 const char *pKey; int nKey; /* Key associated with this element */
6260 SQLITE_PRIVATE void *sqlite3HashInsert(Hash*, const char *pKey, int nKey, void *pData);
6261 SQLITE_PRIVATE void *sqlite3HashFind(const Hash*, const char *pKey, int nKey);
6531 #define offsetof(STRUCTURE,FIELD) ((int)((char*)&((STRUCTURE*)0)->FIELD))
6576 # define UINT8_TYPE unsigned char
6583 # define INT8_TYPE signed char
6620 # define SQLITE_BIGENDIAN (*(char *)(&sqlite3one)==0)
6621 # define SQLITE_LITTLEENDIAN (*(char *)(&sqlite3one)==1)
6654 # define EIGHT_BYTE_ALIGNMENT(X) ((((char*)(X) - (char*)0)&3)==0)
6656 # define EIGHT_BYTE_ALIGNMENT(X) ((((char*)(X) - (char*)0)&7)==0)
6859 const char *zFilename, /* Name of database file to open */
6890 SQLITE_PRIVATE int sqlite3BtreeCommitPhaseOne(Btree*, const char *zMaster);
6904 SQLITE_PRIVATE const char *sqlite3BtreeGetFilename(Btree *);
6905 SQLITE_PRIVATE const char *sqlite3BtreeGetJournalname(Btree *);
6982 SQLITE_PRIVATE char *sqlite3BtreeIntegrityCheck(Btree*, int *aRoot, int nRoot, int, int*);
7091 signed char p4type; /* One of the P4_xxx constants for p4 */
7100 char *z; /* Pointer to data for string (char array) types */
7113 char *zComment; /* Comment to improve readability */
7141 signed char p1; /* First operand */
7142 signed char p2; /* Second parameter (often the jump destination) */
7143 signed char p3; /* Third parameter */
7405 SQLITE_PRIVATE int sqlite3VdbeAddOp4(Vdbe*,int,int,int,int,const char *zP4,int);
7414 SQLITE_PRIVATE void sqlite3VdbeChangeP4(Vdbe*, int addr, const char *zP4, int N);
7430 SQLITE_PRIVATE int sqlite3VdbeSetColName(Vdbe*, int, int, const char *, void(*)(void*));
7433 SQLITE_PRIVATE void sqlite3VdbeSetSql(Vdbe*, const char *z, int n, int);
7440 SQLITE_PRIVATE char *sqlite3VdbeExpandSql(Vdbe*, const char*);
7443 SQLITE_PRIVATE UnpackedRecord *sqlite3VdbeRecordUnpack(KeyInfo*,int,const void*,char*,int);
7449 SQLITE_PRIVATE void sqlite3VdbeComment(Vdbe*, const char*, ...);
7451 SQLITE_PRIVATE void sqlite3VdbeNoopComment(Vdbe*, const char*, ...);
7553 const char*,
7560 SQLITE_PRIVATE int sqlite3PagerReadFileheader(Pager*, int, unsigned char*);
7591 SQLITE_PRIVATE int sqlite3PagerCommitPhaseOne(Pager*,const char *zMaster, int);
7602 SQLITE_PRIVATE const char *sqlite3PagerFilename(Pager*);
7605 SQLITE_PRIVATE const char *sqlite3PagerJournalname(Pager*);
8044 SQLITE_PRIVATE int sqlite3OsOpen(sqlite3_vfs *, const char *, sqlite3_file*, int, int *);
8045 SQLITE_PRIVATE int sqlite3OsDelete(sqlite3_vfs *, const char *, int);
8046 SQLITE_PRIVATE int sqlite3OsAccess(sqlite3_vfs *, const char *, int, int *pResOut);
8047 SQLITE_PRIVATE int sqlite3OsFullPathname(sqlite3_vfs *, const char *, int, char *);
8049 SQLITE_PRIVATE void *sqlite3OsDlOpen(sqlite3_vfs *, const char *);
8050 SQLITE_PRIVATE void sqlite3OsDlError(sqlite3_vfs *, int, char *);
8051 SQLITE_PRIVATE void (*sqlite3OsDlSym(sqlite3_vfs *, void *, const char *))(void);
8054 SQLITE_PRIVATE int sqlite3OsRandomness(sqlite3_vfs *, int, char *);
8062 SQLITE_PRIVATE int sqlite3OsOpenMalloc(sqlite3_vfs *, const char *, sqlite3_file **, int,int*);
8155 char *zName; /* Name of this database */
8301 signed char nextAutovac; /* Autovac setting after VACUUM if >=0 */
8322 void (*xTrace)(void*,const char*); /* Trace function */
8324 void (*xProfile)(void*,const char*,u64); /* Profiling function */
8331 void (*xUpdateCallback)(void*,int, const char*,const char*,sqlite_int64);
8332 void(*xCollNeeded)(void*,sqlite3*,int eTextRep,const char*);
8336 char *zErrMsg; /* Most recent error message (UTF-8 encoded) */
8337 char *zErrMsg16; /* Most recent error message (UTF-16 encoded) */
8344 int (*xAuth)(void*,int,const char*,const char*,const char*,const char*);
8460 char *zName; /* SQL name of the function. */
8519 char *zName; /* Savepoint name (nul-terminated) */
8540 const char *zName; /* Name passed to create_module() */
8550 char *zName; /* Name of this column */
8552 char *zDflt; /* Original text of the default value */
8553 char *zType; /* Data type for this column */
8554 char *zColl; /* Collating sequence. If NULL, use the default */
8557 char affinity; /* One of the SQLITE_AFF_... values */
8585 char *zName; /* Name of the collating sequence, UTF-8 encoded */
8725 char *zName; /* Name of the table or view */
8736 char *zColAff; /* String defining the affinity of each column */
8746 char **azModuleArg; /* Text of all module args. [0] is module name */
8800 char *zTo; /* Name of table that the key points to (aka: Parent) */
8810 char *zCol; /* Name of column in zTo. If 0 use PRIMARY KEY */
8926 char *zName; /* Name of this index */
8934 char *zColAff; /* String defining the affinity of each column */
8938 char **azColl; /* Array of collation sequence names for index */
8948 char *z; /* Value if eType is SQLITE_TEXT or SQLITE_BLOB */
8964 const char *z; /* Text of the token. Not NULL-terminated! */
9093 char affinity; /* The affinity of the column or 0 if not a column */
9096 char *zToken; /* Token value. Zero terminated and dequoted */
9210 char *zName; /* Token associated with this expression */
9211 char *zSpan; /* Original text of the expression */
9226 const char *zStart; /* First character of input text */
9227 const char *zEnd; /* One character past the end of input text */
9247 char *zName; /* Name of the identifier */
9288 char *zDatabase; /* Name of database holding this table */
9289 char *zName; /* Name of the table */
9290 char *zAlias; /* The "B" part of a "A AS B" phrase. zName is the "A" */
9300 char *zIndex; /* Identifier from "INDEXED BY <zIndex>" clause */
9478 char affinity; /* MakeRecord with this affinity for SRT_Set */
9606 char *zErrMsg; /* An error message */
9673 const char *zTail; /* All SQL text past the last semicolon parsed */
9676 const char *zAuthContext; /* The 6th parameter to db->xAuth callbacks */
9699 const char *zAuthContext; /* Put saved Parse.zAuthContext here */
9729 char *zName; /* The name of the trigger */
9730 char *table; /* The table or view to which the trigger applies */
9811 const char *zDb; /* Make sure all objects are contained in this database */
9812 const char *zType; /* Type of the container - used for error messages */
9822 char *zBase; /* A base allocation. Not from malloc. */
9823 char *zText; /* The string collected so far */
9839 char **pzErrMsg; /* Error message stored here */
9946 # define sqlite3Toupper(x) ((x)&~(sqlite3CtypeMap[(unsigned char)(x)]&0x20))
9947 # define sqlite3Isspace(x) (sqlite3CtypeMap[(unsigned char)(x)]&0x01)
9948 # define sqlite3Isalnum(x) (sqlite3CtypeMap[(unsigned char)(x)]&0x06)
9949 # define sqlite3Isalpha(x) (sqlite3CtypeMap[(unsigned char)(x)]&0x02)
9950 # define sqlite3Isdigit(x) (sqlite3CtypeMap[(unsigned char)(x)]&0x04)
9951 # define sqlite3Isxdigit(x) (sqlite3CtypeMap[(unsigned char)(x)]&0x08)
9952 # define sqlite3Tolower(x) (sqlite3UpperToLower[(unsigned char)(x)])
9954 # define sqlite3Toupper(x) toupper((unsigned char)(x))
9955 # define sqlite3Isspace(x) isspace((unsigned char)(x))
9956 # define sqlite3Isalnum(x) isalnum((unsigned char)(x))
9957 # define sqlite3Isalpha(x) isalpha((unsigned char)(x))
9958 # define sqlite3Isdigit(x) isdigit((unsigned char)(x))
9959 # define sqlite3Isxdigit(x) isxdigit((unsigned char)(x))
9960 # define sqlite3Tolower(x) tolower((unsigned char)(x))
9966 SQLITE_PRIVATE int sqlite3StrICmp(const char *, const char *);
9967 SQLITE_PRIVATE int sqlite3IsNumber(const char*, int*, u8);
9968 SQLITE_PRIVATE int sqlite3Strlen30(const char*);
9977 SQLITE_PRIVATE char *sqlite3DbStrDup(sqlite3*,const char*);
9978 SQLITE_PRIVATE char *sqlite3DbStrNDup(sqlite3*,const char*, int);
10032 SQLITE_PRIVATE void sqlite3VXPrintf(StrAccum*, int, const char*, va_list);
10034 SQLITE_PRIVATE void sqlite3XPrintf(StrAccum*, const char*, ...);
10036 SQLITE_PRIVATE char *sqlite3MPrintf(sqlite3*,const char*, ...);
10037 SQLITE_PRIVATE char *sqlite3VMPrintf(sqlite3*,const char*, va_list);
10038 SQLITE_PRIVATE char *sqlite3MAppendf(sqlite3*,char*,const char*,...);
10040 SQLITE_PRIVATE void sqlite3DebugPrintf(const char*, ...);
10043 SQLITE_PRIVATE void *sqlite3TestTextToPtr(const char*);
10045 SQLITE_PRIVATE void sqlite3SetString(char **, sqlite3*, const char*, ...);
10046 SQLITE_PRIVATE void sqlite3ErrorMsg(Parse*, const char*, ...);
10048 SQLITE_PRIVATE int sqlite3Dequote(char*);
10049 SQLITE_PRIVATE int sqlite3KeywordCode(const unsigned char*, int);
10050 SQLITE_PRIVATE int sqlite3RunParser(Parse*, const char*, char **);
10057 SQLITE_PRIVATE Expr *sqlite3Expr(sqlite3*,int,const char*);
10068 SQLITE_PRIVATE int sqlite3Init(sqlite3*, char**);
10069 SQLITE_PRIVATE int sqlite3InitCallback(void*, int, char**, char**);
10120 SQLITE_PRIVATE int sqlite3IdListIndex(IdList*,const char*);
10142 SQLITE_PRIVATE Expr *sqlite3LimitWhere(Parse *, SrcList *, Expr *, ExprList *, Expr *, Expr *, char *);
10166 SQLITE_PRIVATE Table *sqlite3FindTable(sqlite3*,const char*, const char*);
10167 SQLITE_PRIVATE Table *sqlite3LocateTable(Parse*,int isView,const char*, const char*);
10168 SQLITE_PRIVATE Index *sqlite3FindIndex(sqlite3*,const char*, const char*);
10169 SQLITE_PRIVATE void sqlite3UnlinkAndDeleteTable(sqlite3*,int,const char*);
10170 SQLITE_PRIVATE void sqlite3UnlinkAndDeleteIndex(sqlite3*,int,const char*);
10172 SQLITE_PRIVATE int sqlite3RunVacuum(char**, sqlite3*);
10173 SQLITE_PRIVATE char *sqlite3NameFromToken(sqlite3*, Token*);
10194 SQLITE_PRIVATE int sqlite3ExprNeedsNoAffinityChange(const Expr*, char);
10195 SQLITE_PRIVATE int sqlite3IsRowid(const char*);
10206 SQLITE_PRIVATE void sqlite3HaltConstraint(Parse*, int, char*, int);
10213 SQLITE_PRIVATE FuncDef *sqlite3FindFunction(sqlite3*,const char*,int,int,u8,int);
10251 SQLITE_PRIVATE void sqlite3UnlinkAndDeleteTrigger(sqlite3*,int,const char*);
10271 SQLITE_PRIVATE int sqlite3AuthCheck(Parse*,int, const char*, const char*, const char*);
10272 SQLITE_PRIVATE void sqlite3AuthContextPush(Parse*, AuthContext*, const char*);
10274 SQLITE_PRIVATE int sqlite3AuthReadCol(Parse*, const char *, const char *, int);
10283 SQLITE_PRIVATE int sqlite3BtreeFactory(sqlite3 *db, const char *zFilename,
10285 SQLITE_PRIVATE int sqlite3FixInit(DbFixer*, Parse*, int, const char*, const Token*);
10291 SQLITE_PRIVATE int sqlite3AtoF(const char *z, double*);
10292 SQLITE_PRIVATE int sqlite3GetInt32(const char *, int*);
10293 SQLITE_PRIVATE int sqlite3FitsIn64Bits(const char *, int);
10295 SQLITE_PRIVATE int sqlite3Utf8CharLen(const char *pData, int nByte);
10305 SQLITE_PRIVATE int sqlite3PutVarint(unsigned char*, u64);
10306 SQLITE_PRIVATE int sqlite3PutVarint32(unsigned char*, u32);
10307 SQLITE_PRIVATE u8 sqlite3GetVarint(const unsigned char *, u64 *);
10308 SQLITE_PRIVATE u8 sqlite3GetVarint32(const unsigned char *, u32 *);
10329 #define putVarint32(A,B) (u8)(((u32)(B)<(u32)0x80) ? (*(A) = (unsigned char)(B)),1 : sqlite3PutVarint32((A), (B)))
10334 SQLITE_PRIVATE const char *sqlite3IndexAffinityStr(Vdbe *, Index *);
10336 SQLITE_PRIVATE char sqlite3CompareAffinity(Expr *pExpr, char aff2);
10337 SQLITE_PRIVATE int sqlite3IndexAffinityOk(Expr *pExpr, char idx_affinity);
10338 SQLITE_PRIVATE char sqlite3ExprAffinity(Expr *pExpr);
10339 SQLITE_PRIVATE int sqlite3Atoi64(const char*, i64*);
10340 SQLITE_PRIVATE void sqlite3Error(sqlite3*, int, const char*,...);
10341 SQLITE_PRIVATE void *sqlite3HexToBlob(sqlite3*, const char *z, int n);
10343 SQLITE_PRIVATE const char *sqlite3ErrStr(int);
10345 SQLITE_PRIVATE CollSeq *sqlite3FindCollSeq(sqlite3*,u8 enc, const char*,int);
10346 SQLITE_PRIVATE CollSeq *sqlite3LocateCollSeq(Parse *pParse, const char*zName);
10350 SQLITE_PRIVATE int sqlite3CheckObjectName(Parse *, const char *);
10359 SQLITE_PRIVATE char *sqlite3Utf16to8(sqlite3 *, const void*, int);
10361 SQLITE_PRIVATE char *sqlite3Utf8to16(sqlite3 *, u8, char *, int, int *);
10366 SQLITE_PRIVATE const unsigned char sqlite3OpcodeProperty[];
10367 SQLITE_PRIVATE const unsigned char sqlite3UpperToLower[];
10368 SQLITE_PRIVATE const unsigned char sqlite3CtypeMap[];
10377 SQLITE_PRIVATE int sqlite3GetToken(const unsigned char *, int *);
10378 SQLITE_PRIVATE void sqlite3NestedParse(Parse*, const char*, ...);
10384 SQLITE_PRIVATE int sqlite3ResolveOrderGroupBy(Parse*, Select*, ExprList*, const char*);
10388 SQLITE_PRIVATE CollSeq *sqlite3GetCollSeq(sqlite3*, u8, CollSeq *, const char*);
10389 SQLITE_PRIVATE char sqlite3AffinityType(const char*);
10393 SQLITE_PRIVATE int sqlite3FindDbName(sqlite3 *, const char *);
10398 SQLITE_PRIVATE int sqlite3IsLikeFunction(sqlite3*,Expr*,int*,char*);
10404 SQLITE_PRIVATE int sqlite3CreateFunc(sqlite3 *, const char *, int, int, void *,
10410 SQLITE_PRIVATE void sqlite3StrAccumInit(StrAccum*, char*, int, int);
10411 SQLITE_PRIVATE void sqlite3StrAccumAppend(StrAccum*,const char*,int);
10412 SQLITE_PRIVATE char *sqlite3StrAccumFinish(StrAccum*);
10438 SQLITE_PRIVATE void sqlite3TableLock(Parse *, int, int, u8, const char *);
10444 SQLITE_PRIVATE int sqlite3Utf8To8(unsigned char*);
10458 SQLITE_PRIVATE int sqlite3VtabSync(sqlite3 *db, char **);
10471 SQLITE_PRIVATE int sqlite3VtabCallCreate(sqlite3*, int, const char *, char **);
10473 SQLITE_PRIVATE int sqlite3VtabCallDestroy(sqlite3*, int, const char *);
10477 SQLITE_PRIVATE int sqlite3VdbeParameterIndex(Vdbe*, const char*, int);
10480 SQLITE_PRIVATE void sqlite3ExprListCheckLength(Parse*, ExprList*, const char*);
10538 SQLITE_PRIVATE int sqlite3JournalOpen(sqlite3_vfs *, const char *, sqlite3_file *, int, int);
10573 SQLITE_PRIVATE void sqlite3ParserTrace(FILE*, char *);
10584 SQLITE_PRIVATE void (*sqlite3IoTrace)(const char*,...);
10616 SQLITE_PRIVATE const unsigned char sqlite3UpperToLower[] = {
10685 SQLITE_PRIVATE const unsigned char sqlite3CtypeMap[256] = {
10795 SQLITE_PRIVATE const unsigned char sqlite3OpcodeProperty[] = OPFLG_INITIALIZER;
10997 char validYMD; /* True (1) if Y,M,D are valid */
10998 char validHMS; /* True (1) if h,m,s are valid */
10999 char validJD; /* True (1) if iJD is valid */
11000 char validTZ; /* True (1) if tz is valid */
11017 static int getDigits(const char *zDate, ...){
11075 static int parseTimezone(const char *zDate, DateTime *p){
11110 static int parseHhMmSs(const char *zDate, DateTime *p){
11198 static int parseYyyyMmDd(const char *zDate, DateTime *p){
11259 const char *zDate,
11433 static int parseModifier(const char *zMod, DateTime *p){
11437 char *z, zBuf[30];
11440 z[n] = (char)sqlite3UpperToLower[(u8)zMod[n]];
11557 const char *z2 = z;
11641 const unsigned char *z;
11652 if( !z || parseDateOrTime(context, (char*)z, p) ){
11657 if( (z = sqlite3_value_text(argv[i]))==0 || parseModifier((char*)z, p) ){
11699 char zBuf[100];
11719 char zBuf[100];
11738 char zBuf[100];
11772 char *z;
11774 const char *zFmt = (const char*)sqlite3_value_text(argv[0]);
11775 char zBuf[100];
11879 z[j++] = (char)(((x.iJD+129600000)/86400000) % 7) + '0';
11956 char *zFormat = (char *)sqlite3_user_data(context);
11959 char zBuf[20];
12133 const char *zPath,
12148 SQLITE_PRIVATE int sqlite3OsDelete(sqlite3_vfs *pVfs, const char *zPath, int dirSync){
12153 const char *zPath,
12162 const char *zPath,
12164 char *zPathOut
12170 SQLITE_PRIVATE void *sqlite3OsDlOpen(sqlite3_vfs *pVfs, const char *zPath){
12173 SQLITE_PRIVATE void sqlite3OsDlError(sqlite3_vfs *pVfs, int nByte, char *zBufOut){
12176 SQLITE_PRIVATE void (*sqlite3OsDlSym(sqlite3_vfs *pVfs, void *pHdle, const char *zSym))(void){
12183 SQLITE_PRIVATE int sqlite3OsRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){
12195 const char *zFile,
12244 SQLITE_API sqlite3_vfs *sqlite3_vfs_find(const char *zVfs){
12676 char nBacktrace; /* Number of backtraces on this alloc */
12677 char nBacktraceSlots; /* Available backtrace slots */
12722 char zTitle[100]; /* The title text */
12836 static void randomFill(char *pBuf, int nByte){
12862 char *z;
12906 randomFill((char*)pInt, nByte);
12907 memset(((char*)pInt)+nByte, 0x65, nReserve-nByte);
12920 char *z;
12940 z = (char*)pBt;
12967 randomFill(&((char*)pNew)[pOldHdr->iSize], nByte - pOldHdr->iSize);
13011 SQLITE_PRIVATE void sqlite3MemdebugSettitle(const char *zTitle){
13034 SQLITE_PRIVATE void sqlite3MemdebugDump(const char *zFilename){
13046 char *z = (char*)pHdr;
13677 SQLITE_PRIVATE void sqlite3Memsys3Dump(const char *zFilename){
14296 SQLITE_PRIVATE void sqlite3Memsys5Dump(const char *zFilename){
14808 char name[32];
15698 mem0.aScratchFree = (u32*)&((char*)sqlite3GlobalConfig.pScratch)
15714 mem0.aPageFree = (u32*)&((char*)sqlite3GlobalConfig.pPage)
15917 p = (void*)&((char*)sqlite3GlobalConfig.pScratch)[i];
16218 SQLITE_PRIVATE char *sqlite3DbStrDup(sqlite3 *db, const char *z){
16219 char *zNew;
16232 SQLITE_PRIVATE char *sqlite3DbStrNDup(sqlite3 *db, const char *z, int n){
16233 char *zNew;
16251 SQLITE_PRIVATE void sqlite3SetString(char **pz, sqlite3 *db, const char *zFormat, ...){
16253 char *z;
16374 typedef unsigned char etByte;
16381 char fmttype; /* The format field code letter */
16401 static const char aDigits[] = "0123456789ABCDEF0123456789abcdef";
16402 static const char aPrefix[] = "-x0\000X0";
16452 static char et_getdigit(LONGDOUBLE_TYPE *val, int *cnt){
16460 return (char)digit;
16468 static const char zSpaces[] = " ";
16521 const char *fmt, /* Format string */
16525 char *bufpt; /* Pointer to the conversion buffer */
16542 char buf[etBUFSIZE]; /* Conversion buffer */
16543 char prefix; /* Prefix character. "+" or "-" or " " or '\0'. */
16545 char *zExtra; /* Extra memory used for etTCLESCAPE conversions */
16560 bufpt = (char *)fmt;
16678 flag_longlong = sizeof(char*)==sizeof(i64);
16679 flag_long = sizeof(char*)==sizeof(long int);
16717 static const char zOrd[] = "thstndrd";
16727 register const char *cset; /* Use registers for speed */
16742 const char *pre;
16743 char x;
16873 *(bufpt++) = (char)((exp/100)+'0'); /* 100's digit */
16876 *(bufpt++) = (char)(exp/10+'0'); /* 10's digit */
16877 *(bufpt++) = (char)(exp%10+'0'); /* 1's digit */
16912 buf[0] = (char)c;
16914 for(idx=1; idx<precision; idx++) buf[idx] = (char)c;
16923 bufpt = va_arg(ap,char*);
16940 char ch;
16941 char q = ((xtype==etSQLESCAPE3)?'"':'\''); /* Quote character */
16942 char *escarg = va_arg(ap,char*);
16978 sqlite3StrAccumAppend(pAccum, (const char*)pToken->z, pToken->n);
17032 SQLITE_PRIVATE void sqlite3StrAccumAppend(StrAccum *p, const char *z, int N){
17046 char *zNew;
17084 SQLITE_PRIVATE char *sqlite3StrAccumFinish(StrAccum *p){
17112 SQLITE_PRIVATE void sqlite3StrAccumInit(StrAccum *p, char *zBase, int n, int mx){
17127 SQLITE_PRIVATE char *sqlite3VMPrintf(sqlite3 *db, const char *zFormat, va_list ap){
17128 char *z;
17129 char zBase[SQLITE_PRINT_BUF_SIZE];
17147 SQLITE_PRIVATE char *sqlite3MPrintf(sqlite3 *db, const char *zFormat, ...){
17149 char *z;
17164 SQLITE_PRIVATE char *sqlite3MAppendf(sqlite3 *db, char *zStr, const char *zFormat, ...){
17166 char *z;
17178 SQLITE_API char *sqlite3_vmprintf(const char *zFormat, va_list ap){
17179 char *z;
17180 char zBase[SQLITE_PRINT_BUF_SIZE];
17195 SQLITE_API char *sqlite3_mprintf(const char *zFormat, ...){
17197 char *z;
17213 SQLITE_API char *sqlite3_snprintf(int n, char *zBuf, const char *zFormat, ...){
17214 char *z;
17236 SQLITE_PRIVATE void sqlite3DebugPrintf(const char *zFormat, ...){
17239 char zBuf[500];
17255 SQLITE_PRIVATE void sqlite3XPrintf(StrAccum *p, const char *zFormat, ...){
17288 unsigned char isInit; /* True if initialized */
17289 unsigned char i, j; /* State variables */
17290 unsigned char s[256]; /* State variables */
17310 unsigned char t;
17338 char k[256];
17369 unsigned char *zBuf = pBuf;
17479 typedef unsigned char Bool;
17597 char *z; /* String or BLOB value */
17603 char *zMalloc; /* Dynamic buffer allocated by sqlite3_malloc() */
17741 char **azVar; /* Name of variables */
17748 char *zErrMsg; /* Error message written here */
17762 char *zSql; /* Text of the SQL statement that generated this */
17794 SQLITE_PRIVATE u32 sqlite3VdbeSerialPut(unsigned char*, int, Mem*, int);
17795 SQLITE_PRIVATE u32 sqlite3VdbeSerialGet(const unsigned char*, u32, Mem*);
17811 SQLITE_PRIVATE int sqlite3VdbeMemSetStr(Mem*, const char*, int, u8, void(*)(void*));
17829 SQLITE_PRIVATE const char *sqlite3OpcodeName(int);
17851 SQLITE_PRIVATE void sqlite3VdbeMemPrettyPrint(Mem *pMem, char *zBuf);
17878 static const unsigned char sqlite3Utf8Trans1[] = {
17993 const unsigned char *zIn, /* First byte of UTF-8 character */
17994 const unsigned char **pzNext /* Write first byte past UTF-8 char here */
18032 unsigned char *zOut; /* Output buffer */
18033 unsigned char *zIn; /* Input iterator */
18034 unsigned char *zTerm; /* End of input */
18035 unsigned char *z; /* Output iterator */
18046 char zBuf[100];
18151 pMem->z = (char*)zOut;
18157 char zBuf[100];
18212 SQLITE_PRIVATE int sqlite3Utf8CharLen(const char *zIn, int nByte){
18242 SQLITE_PRIVATE int sqlite3Utf8To8(unsigned char *zIn){
18243 unsigned char *zOut = zIn;
18244 unsigned char *zStart = zIn;
18266 SQLITE_PRIVATE char *sqlite3Utf16to8(sqlite3 *db, const void *z, int nByte){
18292 SQLITE_PRIVATE char *sqlite3Utf8to16(sqlite3 *db, u8 enc, char *z, int n, int *pnOut){
18314 unsigned char const *z = zIn;
18328 return (int)(z-(unsigned char const *)zIn);
18339 unsigned char zBuf[20];
18340 unsigned char *z;
18472 SQLITE_PRIVATE int sqlite3Strlen30(const char *z){
18473 const char *z2 = z;
18500 SQLITE_PRIVATE void sqlite3Error(sqlite3 *db, int err_code, const char *zFormat, ...){
18504 char *z;
18533 SQLITE_PRIVATE void sqlite3ErrorMsg(Parse *pParse, const char *zFormat, ...){
18570 SQLITE_PRIVATE int sqlite3Dequote(char *z){
18571 char quote;
18605 SQLITE_PRIVATE int sqlite3StrICmp(const char *zLeft, const char *zRight){
18606 register unsigned char *a, *b;
18607 a = (unsigned char *)zLeft;
18608 b = (unsigned char *)zRight;
18612 SQLITE_API int sqlite3_strnicmp(const char *zLeft, const char *zRight, int N){
18613 register unsigned char *a, *b;
18614 a = (unsigned char *)zLeft;
18615 b = (unsigned char *)zRight;
18633 SQLITE_PRIVATE int sqlite3IsNumber(const char *z, int *realnum, u8 enc){
18671 SQLITE_PRIVATE int sqlite3AtoF(const char *z, double *pResult){
18673 const char *zBegin = z;
18812 static int compare2pow63(const char *zNum){
18832 SQLITE_PRIVATE int sqlite3Atoi64(const char *zNum, i64 *pNum){
18836 const char *zStart;
18885 SQLITE_PRIVATE int sqlite3FitsIn64Bits(const char *zNum, int negFlag){
18916 SQLITE_PRIVATE int sqlite3GetInt32(const char *zNum, int *pValue){
18978 SQLITE_PRIVATE int sqlite3PutVarint(unsigned char *p, u64 v){
19011 SQLITE_PRIVATE int sqlite3PutVarint32(unsigned char *p, u32 v){
19030 SQLITE_PRIVATE u8 sqlite3GetVarint(const unsigned char *p, u64 *v){
19196 SQLITE_PRIVATE u8 sqlite3GetVarint32(const unsigned char *p, u32 *v){
19335 SQLITE_PRIVATE void sqlite3Put4byte(unsigned char *p, u32 v){
19369 SQLITE_PRIVATE void *sqlite3HexToBlob(sqlite3 *db, const char *z, int n){
19370 char *zBlob;
19373 zBlob = (char *)sqlite3DbMallocRaw(db, n/2 + 1);
19535 static unsigned int strHash(const char *z, int nKey){
19539 h = (h<<3) ^ h ^ sqlite3UpperToLower[(unsigned char)*z++];
19621 const char *pKey, /* The key we are searching for */
19683 SQLITE_PRIVATE void *sqlite3HashFind(const Hash *pH, const char *pKey, int nKey){
19713 SQLITE_PRIVATE void *sqlite3HashInsert(Hash *pH, const char *pKey, int nKey, void *data){
19764 SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){
19765 static const char *const azName[] = { "?",
20201 char* pathToDel; /* Name of file to delete on close, NULL if not */
20202 unsigned char locktype; /* Type of lock currently held on this file */
20261 memset(&((char*)pBuf)[got], 0, amt-got);
20293 pBuf = &((char*)pBuf)[wrote];
20725 ** The returned char pointer has to be freed.
20727 static char *convertUtf8PathToCp( const char *in ){
20729 char *out = (char *)calloc( CCHMAXPATH, 1 );
20738 if( UniStrToUcs( ucUtf8, tempPath, (char *)in, CCHMAXPATH ) != ULS_SUCCESS )
20751 ** The returned char pointer has to be freed.
20756 char *convertCpPathToUtf8( const char *in ){
20758 char *out = (char *)calloc( CCHMAXPATH, 1 );
20767 if( UniStrToUcs( uclCp, tempPath, (char *)in, CCHMAXPATH ) != ULS_SUCCESS )
20806 static int getTempname(int nBuf, char *zBuf ){
20807 static const unsigned char zChars[] =
20812 char zTempPathBuf[3];
20822 sprintf( (char*)zTempPath, "%c:", (char)( 'A' + ulDriveNum - 1 ) );
20837 char *zTempPathUTF = convertCpPathToUtf8( zTempPath );
20848 zBuf[j] = (char)zChars[ ((unsigned char)zBuf[j])%(sizeof(zChars)-1) ];
20863 const char *zRelative, /* Possibly relative input path */
20865 char *zFull /* Output buffer */
20867 char *zRelativeCp = convertUtf8PathToCp( zRelative );
20868 char zFullCp[CCHMAXPATH] = "\0";
20869 char *zFullUTF;
20885 const char *zName, /* Name of the file */
20897 char *zNameCp;
20898 char zTmpname[CCHMAXPATH+1]; /* Buffer to hold name of temp file */
20941 char pathUtf8[CCHMAXPATH];
21000 const char *zFilename, /* Name of file to delete */
21004 char *zFilenameCp = convertUtf8PathToCp( zFilename );
21017 const char *zFilename, /* Name of file to check */
21023 char *zFilenameCp = convertUtf8PathToCp( zFilename );
21058 static void *os2DlOpen(sqlite3_vfs *pVfs, const char *zFilename){
21062 char *zFilenameCp = convertUtf8PathToCp(zFilename);
21071 static void os2DlError(sqlite3_vfs *pVfs, int nBuf, char *zBufOut){
21074 static void *os2DlSym(sqlite3_vfs *pVfs, void *pHandle, const char *zSymbol){
21082 char _zSymbol[256] = "_";
21102 static int os2Randomness(sqlite3_vfs *pVfs, int nBuf, char *zBuf ){
21222 static int os2GetLastError(sqlite3_vfs *pVfs, int nBuf, char *zBuf){
21454 unsigned char locktype; /* The type of lock held on this fd */
21477 unsigned char transCntrChng; /* True if the transaction counter changed */
21478 unsigned char dbUpdate; /* True if any part of database file changed */
21479 unsigned char inNormalWrite; /* True if in a normal write operation */
21485 char aPadding[32];
21789 static const char *locktypeName(int locktype){
21811 char *zOpName, *zType;
21950 char *zCanonicalName; /* Canonical filename */
21973 static int vxworksSimplifyName(char *z, int n){
22007 static struct vxworksFileId *vxworksFindFileId(const char *zAbsoluteName){
22016 pNew->zCanonicalName = (char*)&pNew[1];
22252 char aSemName[MAX_PATHNAME+2]; /* Name of that semaphore */
23295 const char *zLockFile = (const char*)pFile->lockingContext;
23333 char *zLockFile = (char *)pFile->lockingContext;
23385 char *zLockFile = (char *)pFile->lockingContext;
23838 const char *dbPath; /* Name of the open file */
23846 unsigned char unLockFlag; /* 1 = unlock, 0 = lock */
23847 unsigned char startEndFlag; /* 1=rel to end of fork, 0=rel to start */
23860 const char *path, /* Name of the file to be locked or unlocked */
24289 memset(&((char*)pBuf)[got], 0, amt-got);
24364 char oldCntr[4];
24368 if( rc!=4 || memcmp(oldCntr, &((char*)pBuf)[24-offset], 4)!=0 ){
24378 pBuf = &((char*)pBuf)[wrote];
24761 static const sqlite3_io_methods *FINDER##Impl(const char *z, unixFile *p){ \
24765 static const sqlite3_io_methods *(*const FINDER)(const char*,unixFile *p) \
24840 static const sqlite3_io_methods *posixWflIoFinderImpl(const char*z, unixFile*p){
24846 *(*const posixWflIoFinder)(const char*,unixFile *p) = posixWflIoFinderImpl;
24882 const char *filePath, /* name of the database file */
24886 const char *zFilesystem; /* Filesystem type name */
24936 *(*const autolockIoFinder)(const char*,unixFile*) = autolockIoFinderImpl;
24949 const char *filePath, /* name of the database file */
24974 *(*const autolockIoFinder)(const char*,unixFile*) = autolockIoFinderImpl;
24981 typedef const sqlite3_io_methods *(*finder_type)(const char*,unixFile*);
24999 const char *zFilename, /* Name of the file being opened */
25095 char *zLockFile;
25098 zLockFile = (char *)sqlite3_malloc(nFilename);
25115 char *zSemName = pNew->pOpen->aSemName;
25159 static int openDirectory(const char *zFilename, int *pFd){
25162 char zDirname[MAX_PATHNAME+1];
25185 static int getTempname(int nBuf, char *zBuf){
25186 static const char *azDirs[] = {
25194 static const unsigned char zChars[] =
25200 const char *zDir = ".";
25234 zBuf[j] = (char)zChars[ ((unsigned char)zBuf[j])%(sizeof(zChars)-1) ];
25247 static int proxyTransformUnixFile(unixFile*, const char*);
25266 static UnixUnusedFd *findReusableFd(const char *zPath, int flags){
25332 const char *zPath, /* Pathname of file to be opened */
25362 char zTmpname[MAX_PATHNAME+1];
25363 const char *zName = zPath;
25485 char *envforce = getenv("SQLITE_FORCE_PROXY_LOCKING");
25537 const char *zPath, /* Name of file to be deleted */
25578 const char *zPath, /* Path of the file to examine */
25615 const char *zPath, /* Possibly relative input path */
25617 char *zOut /* Output buffer */
25651 static void *unixDlOpen(sqlite3_vfs *NotUsed, const char *zFilename){
25663 static void unixDlError(sqlite3_vfs *NotUsed, int nBuf, char *zBufOut){
25664 char *zErr;
25673 static void (*unixDlSym(sqlite3_vfs *NotUsed, void *p, const char*zSym))(void){
25681 ** parameters void* and const char* and returning a pointer to a function.
25691 void (*(*x)(void*,const char*))(void);
25693 x = (void(*(*)(void*,const char*))(void))dlsym;
25710 static int unixRandomness(sqlite3_vfs *NotUsed, int nBuf, char *zBuf){
25827 static int unixGetLastError(sqlite3_vfs *NotUsed, int NotUsed2, char *NotUsed3){
26013 char *conchFilePath; /* Name of the conch file */
26015 char *lockProxyPath; /* Name of the proxy lock file */
26016 char *dbPath; /* Name of the open file */
26033 static int proxyGenerateHostID(char *pHostID){
26035 unsigned char *key = (unsigned char *)pHostID;
26058 unsigned char pa = key[i]&0x7F;
26073 static void proxyGetHostIDPath(char *path, size_t len){
26077 char suffix[2] = "1";
26088 static int proxyGetHostID(char *pHostID, int *pError){
26090 char path[MAXPATHLEN];
26145 static int proxyGetLockPath(const char *dbPath, char *lPath, size_t maxLen){
26183 char c = dbPath[i];
26198 static int proxyCreateUnixFile(const char *path, unixFile **ppFile) {
26252 char testValue[CONCHLEN];
26253 char conchValue[CONCHLEN];
26254 char lockPath[MAXPATHLEN];
26255 char *tLockPath = NULL;
26293 tLockPath = (char *)&conchValue[HOSTIDLEN];
26372 char *path = tLockPath ? tLockPath : pCtx->lockProxyPath;
26425 static int proxyCreateConchPathname(char *dbPath, char **pConchPath){
26428 char *conchPath; /* buffer in which to construct conch name */
26432 *pConchPath = conchPath = (char *)sqlite3_malloc(len + 8);
26462 static int switchLockProxyPath(unixFile *pFile, const char *path) {
26464 char *oldPath = pCtx->lockProxyPath;
26498 static int proxyGetDbPathForUnixFile(unixFile *pFile, char *dbPath){
26503 assert( (int)strlen((char*)pFile->lockingContext)<=MAXPATHLEN );
26510 int len = strlen((char *)pFile->lockingContext) - strlen(DOTLOCK_SUFFIX);
26511 memcpy(dbPath, (char *)pFile->lockingContext, len + 1);
26514 assert( strlen((char*)pFile->lockingContext)<=MAXPATHLEN );
26515 strcpy(dbPath, (char *)pFile->lockingContext);
26528 static int proxyTransformUnixFile(unixFile *pFile, const char *path) {
26530 char dbPath[MAXPATHLEN+1]; /* Name of the database file */
26531 char *lockPath=NULL;
26541 lockPath=(char *)path;
26597 *(const char **)pArg = pCtx->lockProxyPath;
26599 *(const char **)pArg = ":auto: (not held)";
26602 *(const char **)pArg = NULL;
26610 if( pArg==NULL || (const char *)pArg==0 ){
26619 const char *proxyPath = (const char *)pArg;
27204 unsigned char locktype; /* Type of lock currently held on this file */
27222 const char *zRelative /* UTF-8 file name */
27273 static WCHAR *utf8ToUnicode(const char *zFilename){
27294 static char *unicodeToUtf8(const WCHAR *zWideFilename){
27296 char *zFilename;
27319 static WCHAR *mbcsToUnicode(const char *zFilename){
27344 static char *unicodeToMbcs(const WCHAR *zWideFilename){
27346 char *zFilename;
27367 SQLITE_API char *sqlite3_win32_mbcs_to_utf8(const char *zFilename){
27368 char *zFilenameUtf8;
27384 static char *utf8ToMbcs(const char *zFilename){
27385 char *zFilenameMbcs;
27434 #define HANDLE_TO_WINFILE(a) (winFile*)&((char*)a)[-(int)offsetof(winFile,h)]
27454 static BOOL winceCreateLock(const char *zFilename, winFile *pFile){
27799 memset(&((char*)pBuf)[got], 0, amt-got);
27837 pBuf = &((char*)pBuf)[wrote];
28277 static void *convertUtf8Filename(const char *zFilename){
28296 static int getTempname(int nBuf, char *zBuf){
28297 static char zChars[] =
28302 char zTempPath[MAX_PATH+1];
28306 char *zMulti;
28322 char *zUtf8;
28323 char zMbcsPath[MAX_PATH];
28341 zBuf[j] = (char)zChars[ ((unsigned char)zBuf[j])%(sizeof(zChars)-1) ];
28353 static int getLastErrorMsg(int nBuf, char *zBuf){
28356 ** buffer, excluding the terminating null char.
28360 char *zOut = 0;
28383 char *zTemp = NULL;
28415 const char *zName, /* Name of the file (UTF-8) */
28430 const char *zUtf8Name = zName; /* Filename in UTF-8 encoding */
28431 char zTmpname[MAX_PATH+1]; /* Buffer used to create temp filename */
28507 h = CreateFileA((char*)zConverted,
28573 const char *zFilename, /* Name of file to delete */
28618 const char *zFilename, /* Name of file to check */
28637 attr = GetFileAttributesA((char*)zConverted);
28664 const char *zRelative, /* Possibly relative input path */
28666 char *zFull /* Output buffer */
28685 char *zOut;
28706 char *zTemp;
28707 nByte = GetFullPathNameA((char*)zConverted, 0, 0, 0) + 3;
28713 GetFullPathNameA((char*)zConverted, nByte, zTemp, 0);
28735 const char *zRelative /* UTF-8 file name */
28743 char zFullpath[MAX_PATH+1];
28774 char *p = (char *)zConverted;
28781 dwRet = GetDiskFreeSpaceA((char*)zConverted,
28806 static void *winDlOpen(sqlite3_vfs *pVfs, const char *zFilename){
28821 h = LoadLibraryA((char*)zConverted);
28827 static void winDlError(sqlite3_vfs *pVfs, int nBuf, char *zBufOut){
28831 void (*winDlSym(sqlite3_vfs *pVfs, void *pHandle, const char *zSymbol))(void){
28857 static int winRandomness(sqlite3_vfs *pVfs, int nBuf, char *zBuf){
28981 ** int xGetLastError(sqlite3_vfs *pVfs, int nBuf, char *zBuf){
28990 static int winGetLastError(sqlite3_vfs *pVfs, int nBuf, char *zBuf){
29365 unsigned char *pV = 0;
29703 pPage->pData = (void *)&((char *)pPage)[sizeof(PgHdr) + pCache->szExtra];
30127 #define PGHDR1_TO_PAGE(p) (void*)(((char*)p) - p->pCache->szPage)
30128 #define PAGE_TO_PGHDR1(c, p) (PgHdr1*)(((char*)p) + c->szPage)
30156 pBuf = (void*)&((char*)pBuf)[sz];
30932 p->pFresh = (struct RowSetEntry*)(ROUND8(sizeof(*p)) + (char*)p);
31328 if( P->xCodec==0 ){ O=(char*)D; }else \
31329 if( (O=(char*)(P->xCodec(P->pCodec,D,N,X)))==0 ){ E; }
31332 # define CODEC2(P,D,N,X,E,O) O=(char*)D
31509 char dbFileVers[16]; /* Changes whenever database file changes */
31517 char *zFilename; /* Name of the database file */
31518 char *zJournal; /* Name of the journal file */
31532 char *pTmpSpace; /* Pager.pageSize bytes of space for tmp use */
31577 static const unsigned char aJournalMagic[] = {
31665 unsigned char ac[4];
31683 char ac[4];
31762 static u32 pager_datahash(int nByte, unsigned char *pData){
31771 return pager_datahash(pPage->pPager->pageSize, (unsigned char *)pPage->pData);
31820 static int readMasterJournal(sqlite3_file *pJrnl, char *zMaster, u32 nMaster){
31826 unsigned char aMagic[8]; /* A buffer to hold the magic header */
31916 static const char zeroHdr[28] = {0};
31957 char *zHeader = pPager->pTmpSpace; /* Temporary space used to build header */
32080 unsigned char aMagic[8]; /* A buffer to hold the magic header */
32192 static int writeMasterJournal(Pager *pPager, const char *zMaster){
32646 char *aData; /* Temporary storage for the page */
32861 static int pager_delmaster(Pager *pPager, const char *zMaster){
32866 char *zMasterJournal = 0; /* Contents of master journal file */
32886 char *zJournal;
32887 char *zMasterPtr = 0;
33092 char *zMaster = 0; /* Name of master journal file if any */
33564 char *pNew = (char *)sqlite3PageMalloc(pageSize);
33649 SQLITE_PRIVATE int sqlite3PagerReadFileheader(Pager *pPager, int N, unsigned char *pDest){
34105 char *pData; /* Data to write */
34163 char *pData2;
34322 const char *zFilename, /* Name of the database file to open */
34335 char *zPathname = 0; /* Full path to database file */
34426 pPager->zFilename = (char*)(pPtr += journalFileSize);
34431 pPager->zJournal = (char*)(pPtr += nPathname + 1);
34904 char dbFileVers[sizeof(pPager->dbFileVers)];
35412 char *pData2;
35698 put32bits(((char*)pPgHdr->pData)+24, change_counter);
35765 const char *zMaster, /* If not NULL, the master journal name */
36236 SQLITE_PRIVATE const char *sqlite3PagerFilename(Pager *pPager){
36259 SQLITE_PRIVATE const char *sqlite3PagerJournalname(Pager *pPager){
37583 static const char zMagicHeader[] = SQLITE_FILE_HEADER;
38213 char aSpace[150]; /* Temp space for pIdxKey - to avoid a malloc */
38619 unsigned char *data; /* The page data */
38620 unsigned char *temp; /* Temp area for cell content */
38802 unsigned char *data = pPage->aData;
39037 unsigned char *data = pPage->aData;
39050 data[hdr] = (char)flags;
39240 const char *zFilename, /* Name of the file containing the BTree database */
39252 unsigned char zDbHeader[100]; /* Database header content */
39290 char *zFullPathname = sqlite3Malloc(nFullPathname);
39912 unsigned char *data;
40530 SQLITE_PRIVATE int sqlite3BtreeCommitPhaseOne(Btree *p, const char *zMaster){
41241 unsigned char *pBuf, /* Write the bytes into this buffer */
41244 unsigned char *aPayload;
41386 return accessPayload(pCur, offset, amt, (unsigned char*)pBuf, 0);
41437 static const unsigned char *fetchPayload(
41442 unsigned char *aPayload;
41943 rc = accessPayload(pCur, 0, nCell, (unsigned char*)pCellKey, 0);
42319 unsigned char *aData = pTrunk->aData;
42576 static int clearCell(MemPage *pPage, unsigned char *pCell){
42631 unsigned char *pCell, /* Complete text of the cell */
42643 unsigned char *pPrior;
42644 unsigned char *pPayload;
44049 unsigned char *oldCell;
44050 unsigned char *newCell = 0;
44181 unsigned char *pCell; /* Pointer to cell to delete */
44244 unsigned char *pTmp;
44441 unsigned char *pCell;
44681 unsigned char *pP1;
44787 char *zMsg1,
44788 const char *zFormat,
44819 static int checkRef(IntegrityCk *pCheck, Pgno iPage, char *zContext){
44843 char *zContext /* Context description (used for error msg) */
44873 char *zContext /* Context for error messages */
44880 unsigned char *pOvflData;
44892 pOvflData = (unsigned char *)sqlite3PagerGetData(pOvflPage);
44957 char *zParentContext /* Parent context */
44966 char zContext[100];
44967 char *hit = 0;
45127 SQLITE_PRIVATE char *sqlite3BtreeIntegrityCheck(
45138 char zErr[100];
45238 SQLITE_PRIVATE const char *sqlite3BtreeGetFilename(Btree *p){
45251 SQLITE_PRIVATE const char *sqlite3BtreeGetJournalname(Btree *p){
45392 return accessPayload(pCsr, offset, amt, (unsigned char *)z, 1);
45501 static Btree *findBtree(sqlite3 *pErrorDb, sqlite3 *pDb, const char *zDb){
45543 const char *zDestDb, /* Name of database within pDestDb */
45545 const char *zSrcDb /* Name of database within pSrcDb */
46706 const char *z, /* String pointer */
46758 pMem->zMalloc = pMem->z = (char *)z;
46762 pMem->z = (char *)z;
46923 char *zData; /* Data from the btree layer */
46933 zData = (char *)sqlite3BtreeKeyFetch(pCur, &available);
46935 zData = (char *)sqlite3BtreeDataFetch(pCur, &available);
47040 char *zVal = 0;
47197 SQLITE_PRIVATE void sqlite3VdbeSetSql(Vdbe *p, const char *z, int n, int isPrepareV2){
47211 SQLITE_API const char *sqlite3_sql(sqlite3_stmt *pStmt){
47221 char *zTmp;
47334 const char *zP4, /* The P4 operand */
47845 SQLITE_PRIVATE void sqlite3VdbeChangeP4(Vdbe *p, int addr, const char *zP4, int n){
47853 freeP4(db, n, (void*)*(char**)&zP4);
47867 ** that was cast to a (const char *). */
47886 pKeyInfo->aSortOrder = (unsigned char*)&pKeyInfo->aColl[nField];
47904 pOp->p4type = (signed char)n;
47919 SQLITE_PRIVATE void sqlite3VdbeComment(Vdbe *p, const char *zFormat, ...){
47925 char **pz = &p->aOp[p->nOp-1].zComment;
47932 SQLITE_PRIVATE void sqlite3VdbeNoopComment(Vdbe *p, const char *zFormat, ...){
47939 char **pz = &p->aOp[p->nOp-1].zComment;
47989 static char *displayP4(Op *pOp, char *zTemp, int nTemp){
47990 char *zP4 = zTemp;
48108 char *zP4;
48109 char zPtr[50];
48110 static const char *zFormat1 = "%4d %-13s %4d %4d %4d %-4s %.2X %s\n";
48259 char *z;
48282 pMem->z = (char*)sqlite3OpcodeName(pOp->opcode); /* Opcode */
48387 const char *z = pOp->p4.z;
48406 char z[1000];
48548 p->azVar = allocSpace(p->azVar, nVar*sizeof(char*), &zCsr, zEnd, &nByte);
48740 const char *zName, /* Pointer to buffer containing name */
48855 char *zMaster = 0; /* File-name for the master journal */
48856 char const *zMainFile = sqlite3BtreeGetFilename(db->aDb[0].pBt);
48893 char const *zFile = sqlite3BtreeGetJournalname(pBt);
49745 const unsigned char *buf, /* Buffer to deserialize from */
49757 pMem->u.i = (signed char)buf[0];
49762 pMem->u.i = (((signed char)buf[0])<<8) | buf[1];
49767 pMem->u.i = (((signed char)buf[0])<<16) | (buf[1]<<8) | buf[2];
49777 u64 x = (((signed char)buf[0])<<8) | buf[1];
49823 pMem->z = (char *)buf;
49855 char *pSpace, /* Unaligned space available to hold the object */
49858 const unsigned char *aKey = (const unsigned char *)pKey;
49887 p->aMem = pMem = (Mem*)&((char*)p)[ROUND8(sizeof(UnpackedRecord))];
49967 const unsigned char *aKey1 = (const unsigned char *)pKey1;
50394 SQLITE_API const unsigned char *sqlite3_value_text(sqlite3_value *pVal){
50395 return (const unsigned char *)sqlite3ValueText(pVal, SQLITE_UTF8);
50422 const char *z, /* String pointer */
50445 SQLITE_API void sqlite3_result_error(sqlite3_context *pCtx, const char *z, int n){
50471 const char *z,
50677 const char *zErr = (const char *)sqlite3_value_text(db->pErr);
50723 const char *zName = context->pFunc->zName;
50724 char *zErr;
50969 SQLITE_API const unsigned char *sqlite3_column_text(sqlite3_stmt *pStmt, int i){
50970 const unsigned char *val = sqlite3_value_text( columnMem(pStmt,i) );
51053 SQLITE_API const char *sqlite3_column_name(sqlite3_stmt *pStmt, int N){
51078 SQLITE_API const char *sqlite3_column_decltype(sqlite3_stmt *pStmt, int N){
51096 SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt *pStmt, int N){
51112 SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt *pStmt, int N){
51128 SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt *pStmt, int N){
51266 const char *zData,
51366 SQLITE_API const char *sqlite3_bind_parameter_name(sqlite3_stmt *pStmt, int i){
51380 SQLITE_PRIVATE int sqlite3VdbeParameterIndex(Vdbe *p, const char *zName, int nName){
51388 const char *z = p->azVar[i];
51396 SQLITE_API int sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){
51510 static int findNextHostParameter(const char *zSql, int *pnToken){
51545 SQLITE_PRIVATE char *sqlite3VdbeExpandSql(
51547 const char *zRawSql /* Raw text of the SQL statement */
51557 char zBase[100]; /* Initial working space */
51903 char affinity, /* The affinity to be applied */
51957 SQLITE_PRIVATE void sqlite3VdbeMemPrettyPrint(Mem *pMem, char *zBuf){
51958 char *zCsr = zBuf;
51961 static const char *const encnames[] = {"(X)", "(8)", "(16LE)", "(16BE)"};
51965 char c;
51988 char z = pMem->z[i];
52053 char zBuf[200];
52186 static int fileExists(sqlite3 *db, const char *zFile){
52297 char *zMalloc; /* Holding variable for allocated memory */
52329 char affinity; /* Affinity to use for comparison */
52354 char *zRec; /* Pointer to complete record-data */
52361 char *zData; /* Part of the record being decoded */
52373 const char *zAffinity; /* The affinity to be applied */
52374 char cAff; /* A single character of affinity */
52388 char *zAffinity; /* The affinity string for the record */
52399 char *zName; /* Name of savepoint */
52460 char aTempRec[ROUND8(sizeof(UnpackedRecord)) + sizeof(Mem)*3 + 7];
52492 const char *zDb; /* database name - used by the update hook */
52493 const char *zTbl; /* Table name - used by the opdate hook */
52534 const char *zKey;
52568 const char *zMaster;
52569 char *zSql;
52577 char *z; /* Text of the error report */
52672 char *zTrace;
53135 char *zMalloc; /* Holding variable for allocated memory */
53860 char affinity; /* Affinity to use for comparison */
54053 static const unsigned char and_logic[] = { 0, 0, 0, 0, 1, 2, 0, 2, 2 };
54056 static const unsigned char or_logic[] = { 0, 1, 2, 1, 1, 1, 2, 1, 2 };
54187 char *zRec; /* Pointer to complete record-data */
54194 char *zData; /* Part of the record being decoded */
54243 u.am.zRec = (char*)u.am.pC->aRow;
54301 u.am.zData = (char*)sqlite3BtreeKeyFetch(u.am.pCrsr, &u.am.avail);
54303 u.am.zData = (char*)sqlite3BtreeDataFetch(u.am.pCrsr, &u.am.avail);
54471 const char *zAffinity; /* The affinity to be applied */
54472 char cAff; /* A single character of affinity */
54519 char *zAffinity; /* The affinity string for the record */
54654 char *zName; /* Name of savepoint */
54688 u.aq.pNew->zName = (char *)&u.aq.pNew[1];
55568 char aTempRec[ROUND8(sizeof(UnpackedRecord)) + sizeof(Mem)*3 + 7];
55971 const char *zDb; /* database name - used by the update hook */
55972 const char *zTbl; /* Table name - used by the opdate hook */
56088 const char *zDb = db->aDb[u.bg.pC->iDb].zName;
56089 const char *zTbl = pOp->p4.z;
56429 const char *zKey;
56745 const char *zMaster;
56746 char *zSql;
56884 char *z; /* Text of the error report */
57455 const char *z = pOp->p4.z;
57877 char *zTrace;
57883 char *z = sqlite3VdbeExpandSql(p, u.cm.zTrace);
58055 const char *zDb, /* The attached database containing the blob */
58056 const char *zTable, /* The table containing the blob */
58057 const char *zColumn, /* The column containing the blob */
58099 char *zErr = 0;
58165 const char *zFault = 0;
58448 char *zBuf; /* Space to buffer journal writes */
58453 const char *zJournal; /* Name of the journal file */
58603 const char *zName, /* Name of the journal file */
59092 const char *zType /* "GROUP" or "ORDER" or "" */
59115 char *zToken = pOrig->u.zToken;
59169 const char *zDb, /* Name of the database containing table, or NULL */
59170 const char *zTab, /* Name of table containing column, or NULL */
59171 const char *zCol, /* Name of the column. */
59211 char *zTabName = pItem->zAlias;
59214 char *zTabName = pTab->zName;
59341 char *zAs = pEList->a[j].zName;
59390 const char *zErr;
59526 const char *zColumn;
59527 const char *zTable;
59528 const char *zDb;
59557 const char *zId; /* The function name. */
59669 char *zCol = pE->u.zToken;
59671 char *zAs = pEList->a[i].zName;
59742 const char *zType, /* "ORDER" or "GROUP" */
59860 const char *zType /* "ORDER" or "GROUP" */
59910 const char *zType /* Either "ORDER" or "GROUP", as appropriate */
60030 const char *zSavedContext = pParse->zAuthContext;
60270 SQLITE_PRIVATE char sqlite3ExprAffinity(Expr *pExpr){
60303 char *zColl = 0; /* Dequoted name of collation sequence */
60335 const char *zColl;
60361 SQLITE_PRIVATE char sqlite3CompareAffinity(Expr *pExpr, char aff2){
60362 char aff1 = sqlite3ExprAffinity(pExpr);
60388 static char comparisonAffinity(Expr *pExpr){
60389 char aff;
60411 SQLITE_PRIVATE int sqlite3IndexAffinityOk(Expr *pExpr, char idx_affinity){
60412 char aff = comparisonAffinity(pExpr);
60428 u8 aff = (char)sqlite3ExprAffinity(pExpr2);
60638 pNew->u.zToken = (char*)&pNew[1];
60662 const char *zToken /* Token argument. Might be NULL */
60777 const char *z;
60791 int i = atoi((char*)&z[1]);
61021 char *zToken = pNew->u.zToken = (char*)&zAlloc[nNewSize];
61289 pItem->zSpan = sqlite3DbStrNDup(db, (char*)pSpan->zStart,
61301 const char *zObject
61523 SQLITE_PRIVATE int sqlite3ExprNeedsNoAffinityChange(const Expr *p, char aff){
61556 SQLITE_PRIVATE int sqlite3IsRowid(const char *z){
61715 char aff = comparisonAffinity(pX);
61725 char *pKey;
61727 pKey = (char *)sqlite3IndexKeyinfo(pParse, pIdx);
61829 char affinity;
62014 char affinity; /* Comparison affinity to use */
62114 static char *dup8bytes(Vdbe *v, const char *in){
62115 char *out = sqlite3DbMallocRaw(sqlite3VdbeDb(v), 8);
62130 static void codeReal(Vdbe *v, const char *z, int negateFlag, int iMem){
62133 char *zV;
62137 zV = dup8bytes(v, (char*)&value);
62157 const char *z = pExpr->u.zToken;
62161 char *zV;
62164 zV = dup8bytes(v, (char*)&value);
62574 const char *z;
62575 char *zBlob;
62789 const char *zId; /* The function name */
62870 sqlite3VdbeAddOp4(v, OP_CollSeq, 0, 0, 0, (char *)pColl, P4_COLLSEQ);
62873 (char*)pDef, P4_FUNCDEF);
64017 unsigned char const *zSql = sqlite3_value_text(argv[0]);
64018 unsigned char const *zTableName = sqlite3_value_text(argv[1]);
64022 unsigned char const *zCsr = zSql;
64024 char *zRet;
64042 tname.z = (char*)zCsr;
64083 char *zOutput = 0;
64084 char *zResult;
64085 unsigned char const *zInput = sqlite3_value_text(argv[0]);
64086 unsigned char const *zOld = sqlite3_value_text(argv[1]);
64087 unsigned char const *zNew = sqlite3_value_text(argv[2]);
64089 unsigned const char *z; /* Pointer to token */
64097 char *zParent;
64103 zParent = sqlite3DbStrNDup(db, (const char *)z, n);
64106 if( 0==sqlite3StrICmp((const char *)zOld, zParent) ){
64107 char *zOut = sqlite3MPrintf(db, "%s%.*s\"%w\"",
64108 (zOutput?zOutput:""), z-zInput, zInput, (const char *)zNew
64137 unsigned char const *zSql = sqlite3_value_text(argv[0]);
64138 unsigned char const *zTableName = sqlite3_value_text(argv[1]);
64143 unsigned char const *zCsr = zSql;
64145 char *zRet;
64164 tname.z = (char*)zCsr;
64233 static char *whereOrName(sqlite3 *db, char *zWhere, char *zConstant){
64234 char *zNew;
64251 static char *whereForeignKeys(Parse *pParse, Table *pTab){
64253 char *zWhere = 0;
64267 static char *whereTempTriggers(Parse *pParse, Table *pTab){
64269 char *zWhere = 0;
64296 static void reloadTableSchema(Parse *pParse, Table *pTab, const char *zName){
64298 char *zWhere;
64347 char *zDb; /* Name of database iDb */
64349 char *zName = 0; /* NULL-terminated version of pName */
64352 const char *zTabName; /* Original name of the table */
64355 char *zWhere = 0; /* Where clause to locate temp triggers */
64441 sqlite3VdbeAddOp4(v, OP_VRename, i, 0, 0,(const char*)pVTab, P4_VTAB);
64574 const char *zDb; /* Database name */
64575 const char *zTab; /* Table name */
64576 char *zCol; /* Null-terminated column definition */
64650 zCol = sqlite3DbStrNDup(db, (char*)pColDef->z, pColDef->n);
64652 char *zEnd = &zCol[pColDef->n-1];
64807 const char *zWhere /* Delete entries associated with this table */
64810 const char *zName;
64811 const char *zCols;
64832 const char *zTab = aTable[i].zName;
64864 sqlite3VdbeChangeP4(v, -1, (char *)3, P4_INT32);
64934 (char *)pKey, P4_KEYINFO_HANDOFF);
65162 char *z, *zDb;
65219 const char *zDatabase;
65229 static int analysisLoader(void *pData, int argc, char **argv, char **NotUsed){
65234 const char *z;
65305 char *zSql;
65361 char *zIndex = (char *)sqlite3_column_text(pStmt, 0);
65386 const char *z = (const char *)(
65494 const char *zName;
65495 const char *zFile;
65497 char *zErrDyn = 0;
65501 zFile = (const char *)sqlite3_value_text(argv[0]);
65502 zName = (const char *)sqlite3_value_text(argv[1]);
65523 char *z = db->aDb[i].zName;
65579 char *zKey;
65591 zKey = (char *)sqlite3_value_blob(argv[2]);
65660 const char *zName = (const char *)sqlite3_value_text(argv[0]);
65664 char zErr[128];
65736 char *zAuthArg = pAuthArg->u.zToken;
65759 sqlite3VdbeChangeP4(v, -1, (char *)pFunc, P4_FUNCDEF);
65828 const char *zType, /* "view", "trigger", or "index" */
65862 const char *zDb;
66032 int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
66063 const char *zTab, /* Table name */
66064 const char *zCol, /* Column name */
66068 char *zDb = db->aDb[iDb].zName; /* Name of attached database */
66102 const char *zCol; /* Name of the column of the table */
66154 const char *zArg1,
66155 const char *zArg2,
66156 const char *zArg3
66190 const char *zContext
66256 const char *zName; /* Name of the table */
66274 const char *zName /* Name of the table to be locked */
66377 char *vtab = (char *)sqlite3GetVTable(db, pParse->apVtabLock[i]);
66439 SQLITE_PRIVATE void sqlite3NestedParse(Parse *pParse, const char *zFormat, ...){
66441 char *zSql;
66442 char *zErrMsg = 0;
66445 char saveBuf[SAVE_SZ];
66477 SQLITE_PRIVATE Table *sqlite3FindTable(sqlite3 *db, const char *zName, const char *zDatabase){
66505 const char *zName, /* Name of the table we are looking for */
66506 const char *zDbase /* Name of the database. Might be NULL */
66518 const char *zMsg = isView ? "no such view" : "no such table";
66541 SQLITE_PRIVATE Index *sqlite3FindIndex(sqlite3 *db, const char *zName, const char *zDb){
66578 const char *zName = p->zName;
66592 SQLITE_PRIVATE void sqlite3UnlinkAndDeleteIndex(sqlite3 *db, int iDb, const char *zIdxName){
66757 SQLITE_PRIVATE void sqlite3UnlinkAndDeleteTable(sqlite3 *db, int iDb, const char *zTabName){
66785 SQLITE_PRIVATE char *sqlite3NameFromToken(sqlite3 *db, Token *pName){
66786 char *zName;
66788 zName = sqlite3DbStrNDup(db, (char*)pName->z, pName->n);
66804 sqlite3VdbeChangeP4(v, -1, (char *)5, P4_INT32); /* 5 column table */
66816 SQLITE_PRIVATE int sqlite3FindDbName(sqlite3 *db, const char *zName){
66839 char *zName; /* Name we are searching for */
66899 SQLITE_PRIVATE int sqlite3CheckObjectName(Parse *pParse, const char *zName){
66935 char *zName = 0; /* The name of the new table */
66978 char *zDb = db->aDb[iDb].zName;
67130 sqlite3UpperToLower[*(unsigned char *)(x)]== \
67131 sqlite3UpperToLower[*(unsigned char *)(y)] \
67145 char *z;
67223 SQLITE_PRIVATE char sqlite3AffinityType(const char *zIn){
67225 char aff = SQLITE_AFF_NUMERIC;
67308 pCol->zDflt = sqlite3DbStrNDup(db, (char*)pSpan->zStart,
67341 char *zType = 0;
67420 char *zColl; /* Dequoted name of collation sequence */
67468 SQLITE_PRIVATE CollSeq *sqlite3LocateCollSeq(Parse *pParse, const char *zName){
67519 static int identLength(const char *z){
67540 static void identPut(char *z, int *pIdx, char *zSignedIdent){
67541 unsigned char *zIdent = (unsigned char*)zSignedIdent;
67568 static char *createTableStmt(sqlite3 *db, Table *p){
67570 char *zStmt;
67571 char *zSep, *zSep2, *zEnd;
67598 static const char * const azType[] = {
67606 const char *zType;
67713 char *zType; /* "view" or "table" */
67714 char *zType2; /* "VIEW" or "TABLE" */
67715 char *zStmt; /* Text of the CREATE TABLE or CREATE VIEW statement */
67841 const char *zName = (const char *)pParse->sNameToken.z;
67847 nName = (int)((const char *)pCons->z - zName);
67869 const char *z;
67944 int (*xAuth)(void*,int,const char*,const char*,const char*,const char*);
68209 const char *zTab = SCHEMA_TABLE(iDb);
68210 const char *zDb = db->aDb[iDb].zName;
68211 const char *zArg2 = 0;
68370 char *z;
68404 z = (char*)&pFKey->aCol[nCol];
68529 (char *)pKey, P4_KEYINFO_HANDOFF);
68595 char *zName = 0; /* Name of the index */
68608 char *zExtra;
68729 const char *zDb = pDb->zName;
68747 nullId.n = sqlite3Strlen30((char*)nullId.z);
68778 sizeof(char *)*nCol + /* Index.azColl */
68786 pIndex->azColl = (char**)(&pIndex[1]);
68790 pIndex->zName = (char *)(&pIndex->aSortOrder[nCol]);
68791 zExtra = (char *)(&pIndex->zName[nName+1]);
68818 const char *zColName = pListItem->zName;
68821 char *zColl; /* Collation sequence name */
68892 const char *z1;
68893 const char *z2;
68957 char *zStmt;
69115 const char *zDb = db->aDb[iDb].zName;
69116 const char *zTab = SCHEMA_TABLE(iDb);
69175 char *z;
69188 z = (char*)pArray;
69242 SQLITE_PRIVATE int sqlite3IdListIndex(IdList *pList, const char *zName){
69593 char *zName = sqlite3NameFromToken(pParse->db, pName);
69597 static const char *az[] = { "BEGIN", "RELEASE", "ROLLBACK" };
69744 SQLITE_PRIVATE void sqlite3HaltConstraint(Parse *pParse, int onError, char *p4, int p4type){
69757 static int collationMatch(const char *zColl, Index *pIndex){
69761 const char *z = pIndex->azColl[i];
69776 static void reindexTable(Parse *pParse, Table *pTab, char const *zColl){
69795 static void reindexDatabases(Parse *pParse, char const *zColl){
69828 char *z; /* Name of a table or index */
69829 const char *zDb; /* Name of the database */
69846 char *zColl;
69902 char *zColl = pIdx->azColl[i];
69940 static void callCollNeeded(sqlite3 *db, int enc, const char *zName){
69943 char *zExternal = sqlite3DbStrDup(db, zName);
69950 char const *zExternal;
69971 char *z = pColl->zName;
70003 const char *zName /* Collating sequence name */
70038 const char *zName = pColl->zName;
70068 const char *zName, /* Name of the collating sequence */
70079 pColl[0].zName = (char*)&pColl[3];
70081 pColl[1].zName = (char*)&pColl[3];
70083 pColl[2].zName = (char*)&pColl[3];
70122 const char *zName,
70185 const char *zFunc, /* Name of function */
70244 const char *zName, /* Name of the function. Not null-terminated */
70298 pBest->zName = (char *)&pBest[1];
70498 char *zStmtType /* Either DELETE or UPDATE. For error messages. */
70590 const char *zDb; /* Name of database holding pTab */
70761 const char *pVTab = (const char *)sqlite3GetVTable(db, pTab);
71073 const char *z = 0;
71106 const unsigned char *z = sqlite3_value_text(argv[0]);
71184 const unsigned char *z;
71185 const unsigned char *z2;
71251 sqlite3_result_text(context, (char*)z, (int)(z2-z), SQLITE_TRANSIENT);
71257 sqlite3_result_blob(context, (char*)&z[p1], (int)p2, SQLITE_TRANSIENT);
71268 char *zBuf;
71297 char *z;
71318 char *z1;
71319 const char *z2;
71322 z2 = (char*)sqlite3_value_text(argv[0]);
71325 assert( z2==(char*)sqlite3_value_text(argv[0]) );
71331 z1[i] = (char)sqlite3Toupper(z1[i]);
71339 const char *z2;
71342 z2 = (char*)sqlite3_value_text(argv[0]);
71345 assert( z2==(char*)sqlite3_value_text(argv[0]) );
71353 sqlite3_result_text(context, (char *)z1, -1, sqlite3_free);
71422 unsigned char *p;
71432 sqlite3_result_blob(context, (char*)p, n, sqlite3_free);
71672 const unsigned char *zA, *zB;
71696 const unsigned char *zEsc = sqlite3_value_text(argv[2]);
71698 if( sqlite3Utf8CharLen((char*)zEsc, -1)!=1 ){
71761 static const char hexdigits[] = {
71787 char *zText = 0;
71788 char const *zBlob = sqlite3_value_blob(argv[0]);
71791 zText = (char *)contextMalloc(context, (2*(i64)nBlob)+4);
71810 const unsigned char *zArg = sqlite3_value_text(argv[0]);
71811 char *z;
71848 const unsigned char *pBlob;
71849 char *zHex, *z;
71858 unsigned char c = *pBlob;
71900 const unsigned char *zStr; /* The input string A */
71901 const unsigned char *zPattern; /* The pattern string B */
71902 const unsigned char *zRep; /* The replacement string C */
71903 unsigned char *zOut; /* The output */
71972 sqlite3_result_text(context, (char*)zOut, j, sqlite3_free);
71984 const unsigned char *zIn; /* Input string */
71985 const unsigned char *zCharSet; /* Set of characters to trim */
71989 unsigned char *aLen = 0; /* Length of each character in zCharSet */
71990 unsigned char **azChar = 0; /* Individual characters in zCharSet */
72001 static const unsigned char lenOne[] = { 1 };
72002 static unsigned char * const azOne[] = { (u8*)" " };
72005 azChar = (unsigned char **)azOne;
72010 const unsigned char *z;
72015 azChar = contextMalloc(context, ((i64)nChar)*(sizeof(char*)+1));
72019 aLen = (unsigned char*)&azChar[nChar];
72021 azChar[nChar] = (unsigned char *)z;
72056 sqlite3_result_text(context, (char*)zIn, nIn, SQLITE_TRANSIENT);
72076 char zResult[8];
72079 static const unsigned char iCode[] = {
72125 const char *zFile = (const char *)sqlite3_value_text(argv[0]);
72126 const char *zProc;
72128 char *zErrMsg = 0;
72131 zProc = (const char *)sqlite3_value_text(argv[1]);
72309 const char *zVal;
72311 const char *zSep;
72324 zSep = (char*)sqlite3_value_text(argv[1]);
72332 zVal = (char*)sqlite3_value_text(argv[0]);
72373 static void setLikeOptFlag(sqlite3 *db, const char *zName, u8 flagVal){
72410 SQLITE_PRIVATE int sqlite3IsLikeFunction(sqlite3 *db, Expr *pExpr, int *pIsNocase, char *aWc){
72431 assert( (char*)&likeInfoAlt == (char*)&likeInfoAlt.matchAll );
72432 assert( &((char*)&likeInfoAlt)[1] == (char*)&likeInfoAlt.matchOne );
72433 assert( &((char*)&likeInfoAlt)[2] == (char*)&likeInfoAlt.matchSet );
72723 char *zKey = pFKey->aCol[0].zCol; /* Name of left-most parent key column */
72782 char *zDfltColl; /* Def. collation for column */
72783 char *zIdxCol; /* Name of indexed column */
72913 sqlite3VdbeChangeP4(v, -1, (char*)pKey, P4_KEYINFO_HANDOFF);
73026 const char *zCol; /* Name of column in child table */
73224 const char *zDb; /* Name of database containing pTab */
73279 char *zCol = pTo->aCol[pIdx ? pIdx->aiColumn[i] : pTo->iPKey].zName;
73428 char *zKey = p->aCol[i].zCol;
73489 char const *zFrom; /* Name of child table */
73611 pStep->target.z = (char *)&pStep[1];
73613 memcpy((char *)pStep->target.z, zFrom, nFrom);
73701 const char *z = (data ? pFKey->pNextTo->zTo : pFKey->zTo);
73782 SQLITE_PRIVATE const char *sqlite3IndexAffinityStr(Vdbe *v, Index *pIdx){
73795 pIdx->zColAff = (char *)sqlite3Malloc(pIdx->nColumn+2);
73833 char *zColAff;
73837 zColAff = (char *)sqlite3Malloc(pTab->nCol+1);
74166 char *zTab; /* Name of the table into which we are inserting */
74167 const char *zDb; /* Name of the database holding this table */
74694 const char *pVTab = (const char *)sqlite3GetVTable(db, pTab);
74915 char *zMsg;
75077 const char *zSep;
75078 char *zErr;
75084 char *zCol = pTab->aCol[pIdx->aiColumn[j]].zName;
75213 (char*)pKey, P4_KEYINFO_HANDOFF);
75238 static int xferCompatibleCollation(const char *z1, const char *z2){
75514 (char*)pKey, P4_KEYINFO_HANDOFF);
75518 (char*)pKey, P4_KEYINFO_HANDOFF);
75574 const char *zSql, /* The SQL to be executed */
75577 char **pzErrMsg /* Write error messages here */
75580 const char *zLeftover; /* Tail of unprocessed SQL */
75582 char **azCols = 0; /* Names of result columns */
75592 char **azVals = 0;
75618 azCols = sqlite3DbMallocZero(db, 2*nCol*sizeof(const char*) + 1);
75623 azCols[i] = (char *)sqlite3_column_name(pStmt, i);
75633 azVals[i] = (char *)sqlite3_column_text(pStmt, i);
75751 int (*bind_parameter_index)(sqlite3_stmt*,const char*zName);
75752 const char * (*bind_parameter_name)(sqlite3_stmt*,int);
75753 int (*bind_text)(sqlite3_stmt*,int,const char*,int n,void(*)(void*));
75760 int (*collation_needed)(sqlite3*,void*,void(*)(void*,sqlite3*,int eTextRep,const char*));
75766 const char * (*column_database_name)(sqlite3_stmt*,int);
75768 const char * (*column_decltype)(sqlite3_stmt*,int i);
75773 const char * (*column_name)(sqlite3_stmt*,int);
75775 const char * (*column_origin_name)(sqlite3_stmt*,int);
75777 const char * (*column_table_name)(sqlite3_stmt*,int);
75779 const unsigned char * (*column_text)(sqlite3_stmt*,int iCol);
75784 int (*complete)(const char*sql);
75786 int (*create_collation)(sqlite3*,const char*,int,void*,int(*)(void*,int,const void*,int,const void*));
75788 int (*create_function)(sqlite3*,const char*,int,int,void*,void (*xFunc)(sqlite3_context*,int,sqlite3_value**),void (*xStep)(sqlite3_context*,int,sqlite3_value**),void (*xFinal)(sqlite3_context*));
75790 int (*create_module)(sqlite3*,const char*,const sqlite3_module*,void*);
75793 int (*declare_vtab)(sqlite3*,const char*);
75796 const char * (*errmsg)(sqlite3*);
75798 int (*exec)(sqlite3*,const char*,sqlite3_callback,void*,char**);
75802 void (*free_table)(char**result);
75805 int (*get_table)(sqlite3*,const char*,char***,int*,int*,char**);
75809 const char * (*libversion)(void);
75812 char * (*mprintf)(const char*,...);
75813 int (*open)(const char*,sqlite3**);
75815 int (*prepare)(sqlite3*,const char*,int,sqlite3_stmt**,const char**);
75817 void * (*profile)(sqlite3*,void(*)(void*,const char*,sqlite_uint64),void*);
75823 void (*result_error)(sqlite3_context*,const char*,int);
75828 void (*result_text)(sqlite3_context*,const char*,int,void(*)(void*));
75834 int (*set_authorizer)(sqlite3*,int(*)(void*,int,const char*,const char*,const char*,const char*),void*);
75836 char * (*snprintf)(int,char*,const char*,...);
75838 int (*table_column_metadata)(sqlite3*,const char*,const char*,const char*,char const**,char const**,int*,int*,int*);
75841 void * (*trace)(sqlite3*,void(*xTrace)(void*,const char*),void*);
75843 void * (*update_hook)(sqlite3*,void(*)(void*,int ,char const*,char const*,sqlite_int64),void*);
75852 const unsigned char * (*value_text)(sqlite3_value*);
75857 char *(*vmprintf)(const char*,va_list);
75859 int (*overload_function)(sqlite3*, const char *zFuncName, int nArg);
75861 int (*prepare_v2)(sqlite3*,const char*,int,sqlite3_stmt**,const char**);
75865 int (*create_module_v2)(sqlite3*,const char*,const sqlite3_module*,void*,void (*xDestroy)(void *));
75870 int (*blob_open)(sqlite3*,const char*,const char*,const char*,sqlite3_int64,int,sqlite3_blob**);
75873 int (*create_collation_v2)(sqlite3*,const char*,int,void*,int(*)(void*,int,const void*,int,const void*),void(*)(void*));
75874 int (*file_control)(sqlite3*,const char*,int,void*);
75882 int (*open_v2)(const char*,sqlite3**,int,const char*);
75888 sqlite3_vfs *(*vfs_find)(const char*);
75900 const char *(*sql)(sqlite3_stmt*);
76414 const char *zFile, /* Name of the shared library containing extension */
76415 const char *zProc, /* Entry point. Use "sqlite3_extension_init" if 0 */
76416 char **pzErrMsg /* Put error message here if not 0 */
76420 int (*xInit)(sqlite3*,char**,const sqlite3_api_routines*);
76421 char *zErrmsg = 0;
76458 xInit = (int(*)(sqlite3*,char**,const sqlite3_api_routines*))
76498 const char *zFile, /* Name of the shared library containing extension */
76499 const char *zProc, /* Entry point. Use "sqlite3_extension_init" if 0 */
76500 char **pzErrMsg /* Put error message here if not 0 */
76648 int (*xInit)(sqlite3*,char**,const sqlite3_api_routines*);
76656 char *zErrmsg;
76665 xInit = (int(*)(sqlite3*,char**,const sqlite3_api_routines*))
76709 static u8 getSafetyLevel(const char *z){
76711 static const char zText[] = "onoffalseyestruefull";
76731 static u8 getBoolean(const char *z){
76738 static int getLockingMode(const char *z){
76753 static int getAutoVacuum(const char *z){
76769 static int getTempStore(const char *z){
76809 static int changeTempStorage(Parse *pParse, const char *zStorageType){
76824 static void returnSingleInt(Parse *pParse, const char *zLabel, i64 value){
76831 sqlite3VdbeAddOp4(v, OP_Int64, 0, mem, 0, (char*)pI64, P4_INT64);
76843 static int flagPragma(Parse *pParse, const char *zLeft, const char *zRight){
76845 const char *zName; /* Name of the pragma */
76922 static const char *actionName(u8 action){
76923 const char *zName;
76958 char *zLeft = 0; /* Nul-terminated UTF-8 string <id> */
76959 char *zRight = 0; /* Nul-terminated UTF-8 string <value>, or NULL */
76960 const char *zDb = 0; /* The database name */
77119 const char *zRet = "normal";
77167 static char * const azModeName[] = {
77437 char *proxy_file_path = NULL;
77540 sqlite3VdbeAddOp4(v, OP_String8, 0, 5, 0, (char*)pCol->zDflt, 0);
77660 char *zCol = pFK->aCol[j].zCol;
77661 char *zOnDelete = (char *)actionName(pFK->aAction[0]);
77662 char *zOnUpdate = (char *)actionName(pFK->aAction[1]);
77895 char *zName;
78021 static const char *const azLockName[] = {
78032 const char *zState = "unknown";
78060 char zKey[40];
78077 extern void sqlite3_activate_see(const char*);
78083 extern void sqlite3_activate_cerod(const char*);
78140 const char *zObj, /* Object being parsed at the point of error */
78141 const char *zExtra /* Error information */
78168 SQLITE_PRIVATE int sqlite3InitCallback(void *pInit, int argc, char **argv, char **NotUsed){
78192 char *zErr;
78247 static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){
78253 char const *azArg[4];
78256 char const *zMasterSchema;
78257 char const *zMasterName = SCHEMA_TABLE(iDb);
78263 static const char master_schema[] =
78273 static const char temp_master_schema[] =
78312 sqlite3InitCallback(&initData, 3, (char **)azArg, 0);
78432 char *zSql;
78439 int (*xAuth)(void*,int,const char*,const char*,const char*,const char*);
78501 SQLITE_PRIVATE int sqlite3Init(sqlite3 *db, char **pzErrMsg){
78639 const char *zSql, /* UTF-8 encoded SQL statement. */
78644 const char **pzTail /* OUT: End of parsed string */
78647 char *zErrMsg = 0; /* Error message */
78696 const char *zDb = db->aDb[i].zName;
78709 char *zSqlCopy;
78751 static const char * const azColName[] = {
78812 const char *zSql, /* UTF-8 encoded SQL statement. */
78817 const char **pzTail /* OUT: End of parsed string */
78848 const char *zSql;
78884 const char *zSql, /* UTF-8 encoded SQL statement. */
78887 const char **pzTail /* OUT: End of parsed string */
78896 const char *zSql, /* UTF-8 encoded SQL statement. */
78899 const char **pzTail /* OUT: End of parsed string */
78924 char *zSql8;
78925 const char *zTail8 = 0;
79117 static const char zKeyText[] = "naturaleftouterightfullinnercross";
79139 && sqlite3StrNICmp((char*)p->z, &zKeyText[aKeyword[j].i], p->n)==0 ){
79154 const char *zSp = " ";
79173 static int columnIndex(Table *pTab, const char *zCol){
79193 const char *zCol, /* Name of the column we are looking for */
79336 char *zName; /* Name of column in the right table */
79375 char *zName; /* Name of the term in the USING clause */
79885 static const char *columnType(
79888 const char **pzOriginDb,
79889 const char **pzOriginTab,
79890 const char **pzOriginCol
79892 char const *zType = 0;
79893 char const *zOriginDb = 0;
79894 char const *zOriginTab = 0;
79895 char const *zOriginCol = 0;
80026 const char *zType;
80028 const char *zOrigDb = 0;
80029 const char *zOrigTab = 0;
80030 const char *zOrigCol = 0;
80080 char *zName = pEList->a[i].zName;
80084 char *zCol;
80102 char *zName = 0;
80120 static const char *selectOpName(int id){
80121 char *z;
80157 char *zName; /* Column name */
80202 char *zNewName;
80765 sqlite3VdbeChangeP4(v, addr, (char*)pKeyInfo, P4_KEYINFO);
80824 (char*)pKeyInfo, p4type);
81329 sqlite3VdbeAddOp4(v, OP_Permutation, 0, 0, 0, (char*)aPermute, P4_INTARRAY);
81331 (char*)pKeyMerge, P4_KEYINFO_HANDOFF);
81567 const char *zSavedAuthContext = pParse->zAuthContext;
81866 const char *zSpan = pList->a[i].zSpan;
82004 char *zIndex = pFrom->zIndex;
82172 char *zTName; /* text of name of TABLE */
82182 char *zTabName = pFrom->zAlias;
82193 char *zName = pTab->aCol[j].zName;
82194 char *zColname; /* The computed column name */
82195 char *zToFree; /* Malloced string that needs to be freed */
82413 (char*)pKeyInfo, P4_KEYINFO_HANDOFF);
82477 sqlite3VdbeAddOp4(v, OP_CollSeq, 0, 0, 0, (char *)pColl, P4_COLLSEQ);
82711 (char*)pKeyInfo, P4_KEYINFO_HANDOFF);
82735 (char*)pKeyInfo, P4_KEYINFO_HANDOFF);
82842 0, (char*)pKeyInfo, P4_KEYINFO_HANDOFF);
82944 (char*)pKeyInfo, P4_KEYINFO);
83074 sqlite3VdbeChangeP4(v, -1, (char *)pKeyInfo, P4_KEYINFO_HANDOFF);
83225 char *zPrefix;
83304 char **azResult; /* Accumulated output */
83305 char *zErrMsg; /* Error message text, if an error occurs */
83318 static int sqlite3_get_table_cb(void *pArg, int nCol, char **argv, char **colv){
83322 char *z; /* A single column of result */
83333 char **azNew;
83335 azNew = sqlite3_realloc( p->azResult, sizeof(char*)*p->nAlloc );
83394 const char *zSql, /* The SQL to be executed */
83395 char ***pazResult, /* Write the result table here */
83398 char **pzErrMsg /* Write error messages here */
83413 res.azResult = sqlite3_malloc(sizeof(char*)*res.nAlloc );
83440 char **azNew;
83441 azNew = sqlite3_realloc( res.azResult, sizeof(char*)*res.nData );
83459 char **azResult /* Result returned from from sqlite3_get_table() */
83566 char *zName = 0; /* Name of the trigger */
83673 const char *zDb = db->aDb[iTabDb].zName;
83674 const char *zDbTrig = isTemp ? db->aDb[1].zName : zDb;
83731 char *zName; /* Name of trigger */
83759 char *z;
83765 z = sqlite3DbStrNDup(db, (char*)pAll->z, pAll->n);
83833 char *z = (char*)&pTriggerStep[1];
83947 const char *zDb;
83948 const char *zName;
84006 const char *zDb = db->aDb[iDb].zName;
84007 const char *zTab = SCHEMA_TABLE(iDb);
84050 SQLITE_PRIVATE void sqlite3UnlinkAndDeleteTrigger(sqlite3 *db, int iDb, const char *zName){
84224 static const char *onErrorText(int onError){
84419 sqlite3VdbeChangeP4(v, -1, (const char *)pPrg->pProgram, P4_SUBPROGRAM);
84636 sqlite3VdbeChangeP4(v, -1, (const char *)pValue, P4_MEM);
84925 (char*)pKey, P4_KEYINFO_HANDOFF);
85178 const char *pVTab = (const char*)sqlite3GetVTable(db, pTab);
85256 static int execSql(sqlite3 *db, const char *zSql){
85274 static int execExecSql(sqlite3 *db, const char *zSql){
85282 rc = execSql(db, (char*)sqlite3_column_text(pStmt, 0));
85313 SQLITE_PRIVATE int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db){
85317 char *zSql = 0; /* SQL statements */
85321 void (*saved_xTrace)(void*,const char*); /* Saved db->xTrace */
85379 char *zKey;
85485 static const unsigned char aCopy[] = {
85568 const char *zName, /* Name assigned to this module */
85581 char *zCopy = (char *)(&pMod[1]);
85610 const char *zName, /* Name assigned to this module */
85622 const char *zName, /* Name assigned to this module */
85794 static void addModuleArgument(sqlite3 *db, Table *pTable, char *zArg){
85796 int nBytes = sizeof(char *)*(1+pTable->nModuleArg);
85797 char **azModuleArg;
85865 const char *z = (const char*)pParse->sArg.z;
85892 char *zStmt;
85893 char *zWhere;
85941 const char *zName = pTab->zName;
85988 int (*xConstruct)(sqlite3*,void*,int,const char*const*,sqlite3_vtab**,char**),
85989 char **pzErr
85993 const char *const*azArg = (const char *const*)pTab->azModuleArg;
85995 char *zErr = 0;
85996 char *zModuleName = sqlite3MPrintf(db, "%s", pTab->zName);
86034 const char *zFormat = "vtable constructor did not declare schema: %s";
86049 char *zType = pTab->aCol[iCol].zType;
86094 const char *zMod;
86108 const char *zModule = pTab->azModuleArg[0];
86112 char *zErr = 0;
86155 SQLITE_PRIVATE int sqlite3VtabCallCreate(sqlite3 *db, int iDb, const char *zTab, char **pzErr){
86159 const char *zMod;
86193 SQLITE_API int sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){
86198 char *zErr = 0;
86256 SQLITE_PRIVATE int sqlite3VtabCallDestroy(sqlite3 *db, int iDb, const char *zTab){
86297 x = *(int (**)(sqlite3_vtab *))((char *)p->pModule + offset);
86316 SQLITE_PRIVATE int sqlite3VtabSync(sqlite3 *db, char **pzErrmsg){
86432 char *zLowerName;
86433 unsigned char *z;
86453 for(z=(unsigned char*)zLowerName; *z; z++){
86471 pNew->zName = (char *)&pNew[1];
87076 char idxaff;
87136 const char *z = 0; /* String on RHS of LIKE operator */
87141 char wc[3]; /* Wildcard characters */
87184 z = (char *)sqlite3_value_text(pVal);
87909 const char *zColl; /* Name of the collating sequence for i-th index term */
88510 char *zSample = sqlite3Utf8to16(
89110 static void codeApplyAffinity(Parse *pParse, int base, int n, char *zAff){
89249 char **pzAff /* OUT: Set to point to affinity string */
89259 char *zAff; /* Affinity string to return */
89567 char *zAff;
89946 SQLITE_API char sqlite3_query_plan[BMS*2*40]; /* Text of the join */
90359 char *zMsg;
90392 const char *pVTab = (const char *)sqlite3GetVTable(db, pTab);
90420 (char*)pKey, P4_KEYINFO_HANDOFF);
90445 char *z;
90771 ** and nonterminal numbers. "unsigned char" is
90782 ** and nonterminal numbers. "unsigned char" is
90802 #define YYCODETYPE unsigned char
91493 static char *yyTracePrompt = 0;
91514 SQLITE_PRIVATE void sqlite3ParserTrace(FILE *TraceFILE, char *zTracePrompt){
91525 static const char *const yyTokenName[] = {
91596 static const char *const yyRuleName[] = {
92313 unsigned char nrhs; /* Number of right-hand side symbols in the rule */
93663 yygotominor.yy346.pExpr->affinity = (char)yymsp[-3].minor.yy328;
94061 # define charMap(X) sqlite3UpperToLower[(unsigned char)X]
94064 # define charMap(X) ebcdicToAscii[(unsigned char)X]
94065 const unsigned char ebcdicToAscii[] = {
94113 static int keywordCode(const char *z, int n){
94125 static const char zText[540] = {
94157 static const unsigned char aHash[127] = {
94169 static const unsigned char aNext[121] = {
94181 static const unsigned char aLen[121] = {
94205 static const unsigned char aCode[121] = {
94365 SQLITE_PRIVATE int sqlite3KeywordCode(const unsigned char *z, int n){
94366 return keywordCode((char*)z, n);
94391 #define IdChar(C) ((sqlite3CtypeMap[(unsigned char)C]&0x46)!=0)
94394 SQLITE_PRIVATE const char sqlite3IsEbcdicIdChar[] = {
94417 SQLITE_PRIVATE int sqlite3GetToken(const unsigned char *z, int *tokenType){
94679 *tokenType = keywordCode((char*)z, i);
94694 SQLITE_PRIVATE int sqlite3RunParser(Parse *pParse, const char *zSql, char **pzErrMsg){
94729 pParse->sLastToken.n = sqlite3GetToken((unsigned char*)&zSql[i],&tokenType);
94861 #define IdChar(C) ((sqlite3CtypeMap[(unsigned char)C]&0x46)!=0)
94864 SQLITE_PRIVATE const char sqlite3IsEbcdicIdChar[];
94938 SQLITE_API int sqlite3_complete(const char *zSql){
95026 unsigned char c;
95098 char const *zSql8;
95240 SQLITE_API const char sqlite3_version[] = SQLITE_VERSION;
95242 SQLITE_API const char *sqlite3_libversion(void){ return sqlite3_version; }
95243 SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
95254 SQLITE_PRIVATE void (*sqlite3IoTrace)(const char*, ...) = 0;
95264 SQLITE_API char *sqlite3_temp_directory = 0;
95697 static int allSpaces(const char *z, int n){
95719 && allSpaces(((char*)pKey1)+n, nKey1-n)
95720 && allSpaces(((char*)pKey2)+n, nKey2-n)
95745 (const char *)pKey1, (const char *)pKey2, (nKey1<nKey2)?nKey1:nKey2);
95954 SQLITE_PRIVATE const char *sqlite3ErrStr(int rc){
95955 static const char* const aMsg[] = {
96130 const char *zFunctionName,
96214 const char *zFunctionName,
96242 char *zFunc8;
96269 const char *zName,
96293 SQLITE_API void *sqlite3_trace(sqlite3 *db, void (*xTrace)(void*,const char*), void *pArg){
96312 void (*xProfile)(void*,const char*,sqlite_uint64),
96351 void (*xCallback)(void*,int,char const *,char const *,sqlite_int64),
96430 const char *zFilename, /* Name of the file containing the BTree database */
96473 SQLITE_API const char *sqlite3_errmsg(sqlite3 *db){
96474 const char *z;
96485 z = (char*)sqlite3_value_text(db->pErr);
96571 const char *zName,
96730 const char *zFilename, /* Database filename UTF-8 encoded */
96733 const char *zVfs /* Name of the VFS to use */
96961 const char *zFilename,
96968 const char *filename, /* Database filename (UTF-8) */
96971 const char *zVfs /* Name of VFS module to use */
96984 char const *zFilename8; /* zFilename encoded in UTF-8 instead of UTF-16 */
97019 const char *zName,
97038 const char *zName,
97065 char *zName8;
97086 void(*xCollNeeded)(void*,sqlite3*,int eTextRep,const char*)
97169 const char *zDbName, /* Database name or NULL */
97170 const char *zTableName, /* Table name */
97171 const char *zColumnName, /* Column name */
97172 char const **pzDataType, /* OUTPUT: Declared data type */
97173 char const **pzCollSeq, /* OUTPUT: Collation sequence name */
97179 char *zErrMsg = 0;
97184 char const *zDataType = 0;
97185 char const *zCollSeq = 0;
97306 SQLITE_API int sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){
97508 /* sqlite3_test_control(SQLITE_TESTCTRL_ISKEYWORD, const char *zWord)
97518 const char *zWord = va_arg(ap, const char*);
97969 ** char pTerm[nTerm]; (content of first term)
97971 ** char pDoclist[nDoclist]; (content of doclist)
97976 ** char pTermSuffix[nSuffix];(unshared suffix of next term)
97978 ** char pDoclist[nDoclist]; (content of doclist)
98017 ** char pTerm[nTerm]; (content of first term)
98022 ** char pTermSuffix[nSuffix]; (unshared suffix of next term)
98246 const char *const*argv, /* Tokenizer argument strings */
98263 const char *pInput, int nBytes, /* Input buffer */
98299 const char **ppToken, int *pnBytes, /* OUT: Normalized text for token */
98358 char keyClass; /* HASH_INT, _POINTER, _STRING, _BINARY */
98359 char copyKey; /* True if copy of key made on insert */
98399 SQLITE_PRIVATE void sqlite3Fts3HashInit(Fts3Hash *pNew, char keyClass, char copyKey);
98487 typedef unsigned char u8; /* 1-byte (or larger) unsigned integer */
98514 const char *zDb; /* logical database name */
98515 const char *zName; /* virtual table name */
98517 char **azColumn; /* column names. malloced */
98530 char *zSelectLeaves;
98564 char *pNextId; /* Pointer into the body of aDoclist */
98565 char *aDoclist; /* List of docids for full-text queries */
98601 char *z; /* Text of the token */
98629 char *aDoclist; /* Buffer containing doclist */
98633 char *pCurrent;
98656 SQLITE_PRIVATE int sqlite3Fts3InitVtab(int, sqlite3*, void*, int, const char*const*,
98657 sqlite3_vtab **, char **);
98665 sqlite3_int64, sqlite3_int64, const char *, int, Fts3SegReader**);
98666 SQLITE_PRIVATE int sqlite3Fts3SegReaderPending(Fts3Table*,const char*,int,int,Fts3SegReader**);
98670 int (*)(Fts3Table *, void *, char *, int, char *, int), void *
98672 SQLITE_PRIVATE int sqlite3Fts3ReadBlock(Fts3Table*, sqlite3_int64, char const**, int*);
98683 const char *zTerm;
98690 SQLITE_PRIVATE int sqlite3Fts3PutVarint(char *, sqlite3_int64);
98691 SQLITE_PRIVATE int sqlite3Fts3GetVarint(const char *, sqlite_int64 *);
98692 SQLITE_PRIVATE int sqlite3Fts3GetVarint32(const char *, int *);
98694 SQLITE_PRIVATE void sqlite3Fts3Dequote(char *);
98696 SQLITE_PRIVATE char *sqlite3Fts3FindPositions(Fts3Expr *, sqlite3_int64, int);
98700 SQLITE_PRIVATE const char *sqlite3Fts3NextToken(const char *, int *);
98701 SQLITE_PRIVATE int sqlite3Fts3InitHashTable(sqlite3 *, Fts3Hash *, const char *);
98703 const char *, sqlite3_tokenizer **, const char **, char **
98709 const char *, const char *, const char *
98711 SQLITE_PRIVATE void sqlite3Fts3Snippet2(sqlite3_context *, Fts3Cursor *, const char *,
98712 const char *, const char *, int, int
98718 char **, int, int, const char *, int, Fts3Expr **
98740 SQLITE_PRIVATE int sqlite3Fts3PutVarint(char *p, sqlite_int64 v){
98741 unsigned char *q = (unsigned char *) p;
98744 *q++ = (unsigned char) ((vu & 0x7f) | 0x80);
98748 assert( q - (unsigned char *)p <= FTS3_VARINT_MAX );
98749 return (int) (q - (unsigned char *)p);
98757 SQLITE_PRIVATE int sqlite3Fts3GetVarint(const char *p, sqlite_int64 *v){
98758 const unsigned char *q = (const unsigned char *) p;
98760 while( (*q&0x80)==0x80 && q-(unsigned char *)p<FTS3_VARINT_MAX ){
98766 return (int) (q - (unsigned char *)p);
98773 SQLITE_PRIVATE int sqlite3Fts3GetVarint32(const char *p, int *pi){
98807 SQLITE_PRIVATE void sqlite3Fts3Dequote(char *z){
98808 char quote; /* Quote character (if any ) */
98831 static void fts3GetDeltaVarint(char **pp, sqlite3_int64 *pVal){
98837 static void fts3GetDeltaVarint2(char **pp, char *pEnd, sqlite3_int64 *pVal){
98879 char *zSql = sqlite3_mprintf(
98912 char *zSql; /* SQL statement passed to declare_vtab() */
98913 char *zCols; /* List of user defined columns */
98945 char *zContentCols; /* Columns of %_content table */
98946 char *zSql; /* SQL script to create required tables */
98951 char *z = p->azColumn[i];
99001 const char * const *argv, /* xCreate/xConnect argument array */
99003 char **pzErr /* Write any error message here */
99013 char *zCsr;
99017 const char *zTokenizer = 0; /* Name of tokenizer to use */
99023 char const *z = argv[i];
99047 nCol * sizeof(char *) + /* azColumn */
99061 p->azColumn = (char **)&p[1];
99065 zCsr = (char *)&p->azColumn[nCol];
99081 char *z;
99083 z = (char *)sqlite3Fts3NextToken(argv[i], &n);
99089 assert( zCsr <= &((char *)p)[nByte] );
99130 const char * const *argv, /* xCreate/xConnect argument array */
99132 char **pzErr /* OUT: sqlite3_malloc'd error message */
99140 const char * const *argv, /* xCreate/xConnect argument array */
99142 char **pzErr /* OUT: sqlite3_malloc'd error message */
99310 const char *zTerm, /* Term to select leaves for */
99312 const char *zNode, /* Buffer containing segment interior node */
99317 const char *zCsr = zNode; /* Cursor to iterate through node */
99318 const char *zEnd = &zCsr[nNode];/* End of interior node buffer */
99319 char *zBuffer = 0; /* Buffer to load terms into */
99344 char *zNew;
99346 zNew = (char *)sqlite3_realloc(zBuffer, nAlloc);
99393 char **pp, /* IN/OUT: Output pointer */
99406 static void fts3PoslistCopy(char **pp, char **ppPoslist){
99407 char *pEnd = *ppPoslist;
99408 char c = 0;
99425 char *p = *pp;
99433 static void fts3ColumnlistCopy(char **pp, char **ppPoslist){
99434 char *pEnd = *ppPoslist;
99435 char c = 0;
99441 char *p = *pp;
99467 char **pp, /* IN/OUT: Pointer into offset-list buffer */
99486 static int fts3PutColNumber(char **pp, int iCol){
99489 char *p = *pp; /* Output pointer */
99501 char **pp, /* Output buffer */
99502 char **pp1, /* Left input list */
99503 char **pp2 /* Right input list */
99505 char *p = *pp;
99506 char *p1 = *pp1;
99507 char *p2 = *pp2;
99570 char **pp, /* Output buffer */
99573 char **pp1, /* Left input list */
99574 char **pp2 /* Right input list */
99576 char *p = (pp ? *pp : 0);
99577 char *p1 = *pp1;
99578 char *p2 = *pp2;
99594 char *pSave = p;
99681 char **pp, /* Output buffer */
99682 char *aTmp, /* Temporary buffer space */
99685 char **pp1, /* IN/OUT: Left input list */
99686 char **pp2 /* IN/OUT: Right input list */
99688 char *p1 = *pp1;
99689 char *p2 = *pp2;
99697 char *pTmp1 = aTmp;
99698 char *pTmp2;
99699 char *aTmp2;
99747 char *aBuffer, /* Pre-allocated output buffer */
99749 char *a1, /* Buffer containing first doclist */
99751 char *a2, /* Buffer containing second doclist */
99758 char *p = aBuffer;
99759 char *p1 = a1;
99760 char *p2 = a2;
99761 char *pEnd1 = &a1[n1];
99762 char *pEnd2 = &a2[n2];
99830 char **ppPos = (mergetype==MERGE_PHRASE ? 0 : &p);
99833 char *pSave = p;
99854 char *aTmp = 0;
99855 char **ppPos = 0;
99866 char *pSave = p;
99901 char *aOutput; /* Malloc'd output buffer */
99913 char *zTerm,
99915 char *aDoclist,
99920 char *aNew = sqlite3_malloc(nNew);
99968 const char *zTerm, /* Term to query for */
99973 char **ppOut /* OUT: Malloced result buffer */
100007 char const *zRoot = sqlite3_column_blob(pStmt, 4);
100099 char **paOut, /* OUT: Pointer to malloc'd result buffer */
100102 char *pOut = 0;
100111 char *z = pTok->z; /* Next token of the phrase */
100114 char *pList; /* Pointer to token doclist */
100159 char **paOut, /* OUT: Pointer to malloc'd result buffer */
100180 char *aLeft;
100181 char *aRight;
100198 char *aBuffer;
100232 char *aBuffer = sqlite3_malloc(nRight+nLeft+1);
100282 const char *idxStr, /* Unused */
100286 const char *azSql[] = {
100291 char *zSql; /* SQL statement used to access %_content */
100327 const char *zQuery = (const char *)sqlite3_value_text(apVal[0]);
100475 SQLITE_PRIVATE char *sqlite3Fts3FindPositions(
100482 char *pEnd = &pExpr->aDoclist[pExpr->nDoclist];
100483 char *pCsr = pExpr->pCurrent;
100529 const char *zFunc, /* Function name */
100537 char *zErr = sqlite3_mprintf("illegal first argument to %s", zFunc);
100556 const char *zStart = "<b>";
100557 const char *zEnd = "</b>";
100558 const char *zEllipsis = "<b>...</b>";
100573 case 4: zEllipsis = (const char*)sqlite3_value_text(apVal[3]);
100574 case 3: zEnd = (const char*)sqlite3_value_text(apVal[2]);
100575 case 2: zStart = (const char*)sqlite3_value_text(apVal[1]);
100593 const char *zStart = "<b>";
100594 const char *zEnd = "</b>";
100595 const char *zEllipsis = "<b>...</b>";
100614 case 4: zEllipsis = (const char*)sqlite3_value_text(apVal[3]);
100615 case 3: zEnd = (const char*)sqlite3_value_text(apVal[2]);
100616 case 2: zStart = (const char*)sqlite3_value_text(apVal[1]);
100713 const char *zName, /* Name of SQL function */
100718 const char *zName;
100749 const char *zName /* New name of table */
100753 char *zSql; /* SQL script to run to rename tables */
100894 char **pzErrMsg,
100989 const char **azCol; /* Array of column names for fts3 table */
101001 ** an integer that falls outside of the range of the unsigned char type
101003 ** is defined to accept an argument of type char, and always returns 0 for
101004 ** any values that fall outside of the range of the unsigned char type (i.e.
101007 static int fts3isspace(char c){
101026 const char *z, int n, /* Input string */
101039 const char *zToken;
101058 pRet->pPhrase->aToken[0].z = (char *)&pRet->pPhrase[1];
101107 const char *zInput, int nInput, /* Input string */
101115 char *zTemp = 0;
101123 const char *zToken;
101156 char *zNew = NULL;
101165 zNew = &(((char *)p)[nByte]);
101198 static int fts3ExprParse(ParseContext *, const char *, int, Fts3Expr **, int *);
101210 const char *z, int n, /* Input string */
101215 char *z; /* Keyword text */
101216 unsigned char n; /* Length of the keyword */
101217 unsigned char parenOnly; /* Only valid in paren mode */
101218 unsigned char eType; /* Keyword code */
101231 const char *zInput = z;
101256 char cNext;
101346 const char *zStr = pParse->azCol[ii];
101434 const char *z, int n, /* Text of MATCH query */
101442 const char *zIn = z;
101599 char **azCol, /* Array of column names for fts3 table */
101602 const char *z, int n, /* Text of MATCH query */
101609 sParse.azCol = (const char **)azCol;
101657 const char *zName,
101662 const char zSql[] = "SELECT fts3_tokenizer(?)";
101686 static void exprToString(Fts3Expr *pExpr, char *zBuf){
101746 char **azCol = 0;
101747 const char *zExpr;
101762 (const char *)sqlite3_value_text(argv[0]), &pModule);
101779 zExpr = (const char *)sqlite3_value_text(argv[1]);
101782 azCol = (char **)sqlite3_malloc(nCol*sizeof(char *));
101788 azCol[ii] = (char *)sqlite3_value_text(argv[ii+2]);
101798 char zBuf[4096];
101881 SQLITE_PRIVATE void sqlite3Fts3HashInit(Fts3Hash *pNew, char keyClass, char copyKey){
101920 const char *z = (const char *)pKey;
101931 return strncmp((const char*)pKey1,(const char*)pKey2,n1);
101939 const char *z = (const char *)pKey;
102250 const char *zInput; /* input we are tokenizing */
102254 char *zToken; /* storage for current token */
102263 int argc, const char * const *argv,
102294 const char *zInput, int nInput, /* String to be tokenized */
102334 static const char cType[] = {
102352 static int isVowel(const char*);
102353 static int isConsonant(const char *z){
102355 char x = *z;
102362 static int isVowel(const char *z){
102364 char x = *z;
102391 static int m_gt_0(const char *z){
102401 static int m_eq_1(const char *z){
102415 static int m_gt_1(const char *z){
102429 static int hasVowel(const char *z){
102440 static int doubleConsonant(const char *z){
102452 static int star_oh(const char *z){
102473 char **pz, /* The word being stemmed (Reversed) */
102474 const char *zFrom, /* If the ending matches this... (Reversed) */
102475 const char *zTo, /* ... change the ending to this (not reversed) */
102476 int (*xCond)(const char*) /* Condition that must be true */
102478 char *z = *pz;
102497 static void copy_stemmer(const char *zIn, int nIn, char *zOut, int *pnOut){
102501 char c = zIn[i];
102544 static void porter_stemmer(const char *zIn, int nIn, char *zOut, int *pnOut){
102546 char zReverse[28];
102547 char *z, *z2;
102555 char c = zIn[i];
102767 static const char porterIdChar[] = {
102783 const char **pzToken, /* OUT: *pzToken is the token text */
102790 const char *z = c->zInput;
102909 const unsigned char *zName;
102935 char *zErr = sqlite3_mprintf("unknown tokenizer: %s", zName);
102945 static int fts3IsIdChar(char c){
102946 static const char isFtsIdChar[] = {
102959 SQLITE_PRIVATE const char *sqlite3Fts3NextToken(const char *zStr, int *pn){
102960 const char *z1;
102961 const char *z2 = 0;
102966 char c = *z1;
102998 const char *zArg, /* Possible tokenizer specification */
103000 const char **pzTokenizer, /* OUT: Set to zArg if is tokenizer */
103001 char **pzErr /* OUT: Set to malloced error message */
103004 char *z = (char *)zArg;
103006 char *zCopy;
103007 char *zEnd; /* Pointer to nul-term of zCopy */
103025 z = (char *)sqlite3Fts3NextToken(zCopy, &n);
103034 char const **aArg = 0;
103037 while( z<zEnd && (NULL!=(z = (char *)sqlite3Fts3NextToken(z, &n))) ){
103038 int nNew = sizeof(char *)*(iArg+1);
103039 char const **aNew = (const char **)sqlite3_realloc((void *)aArg, nNew);
103105 const char *zErr = 0;
103107 const char *zName;
103109 const char *zInput;
103112 const char *zArg = 0;
103114 const char *zToken;
103125 zName = (const char *)sqlite3_value_text(argv[0]);
103127 zInput = (const char *)sqlite3_value_text(argv[argc-1]);
103130 zArg = (const char *)sqlite3_value_text(argv[1]);
103137 char *zErr = sqlite3_mprintf("unknown tokenizer: %s", zName);
103186 char *zName,
103191 const char zSql[] = "SELECT fts3_tokenizer(?, ?)";
103208 char *zName,
103213 const char zSql[] = "SELECT fts3_tokenizer(?)";
103306 const char *zName
103313 char *zTest = 0;
103314 char *zTest2 = 0;
103376 char delim[128]; /* flag ASCII delimiters */
103381 const char *pInput; /* input we are tokenizing */
103385 char *pToken; /* storage for current token */
103390 static int simpleDelim(simple_tokenizer *t, unsigned char c){
103398 int argc, const char * const *argv,
103415 unsigned char ch = argv[1][i];
103451 const char *pInput, int nBytes, /* String to be tokenized */
103495 const char **ppToken, /* OUT: *ppToken is the token text */
103503 unsigned char *p = (unsigned char *)c->pInput;
103530 unsigned char ch = p[iStartOffset+i];
103531 c->pToken[i] = (char)(ch<0x80 ? tolower(ch) : ch);
103604 char *aData;
103633 char *aNode; /* Pointer to node data (or NULL) */
103644 char *zTerm; /* Pointer to current term */
103645 char *aDoclist; /* Pointer to doclist of current entry */
103649 char *pOffsetList;
103668 char *zTerm; /* Pointer to previous term buffer */
103671 char *zMalloc; /* Malloc'd space (possibly) used for zTerm */
103674 char *aData; /* Pointer to block from malloc() */
103692 char *zTerm; /* Pointer to previous term buffer */
103695 char *zMalloc; /* Malloc'd space (possibly) used for zTerm */
103697 char *aData; /* Node data */
103739 const char *azSql[] = {
103773 char *zSql;
103776 char *zVarlist; /* The "?, ?, ..." string */
103777 zVarlist = (char *)sqlite3_malloc(2*p->nColumn+2);
103846 char const **pzBlock,
103862 *pzBlock = (char *)sqlite3_column_blob(pStmt, 0);
103917 p->aData = (char *)&p[1];
103929 p->aData = (char *)&p[1];
104007 static int fts3PendingTermsAdd(Fts3Table *p, const char *zText, int iCol){
104013 char const *zToken;
104020 const char**,int*,int*,int*,int*);
104107 const char *zText = (const char *)sqlite3_value_text(apVal[i]);
104220 const char *zText = (const char *)sqlite3_column_text(pSelect, i);
104294 char *pNext; /* Cursor variable */
104312 pReader->zTerm = (char *)fts3HashKey(pElem);
104331 pReader->aNode = (char *)sqlite3_column_blob(pReader->pStmt, 0);
104340 char *zNew = sqlite3_realloc(pReader->zTerm, nNew);
104381 char **ppOffsetList,
104384 char *p = pReader->pOffsetList;
104385 char c = 0;
104446 const char *zRoot, /* Buffer containing root node */
104469 pReader->aNode = (char *)&pReader[1];
104535 char *z1 = fts3HashKey(*(Fts3HashElem **)lhs);
104536 char *z2 = fts3HashKey(*(Fts3HashElem **)rhs);
104554 const char *zTerm, /* Term to search for */
104569 char *zKey = (char *)fts3HashKey(pE);
104731 const char *zTerm, /* Term to compare to */
104790 char *z, /* Pointer to buffer containing block data */
104814 char *zRoot, /* Blob value for "root" field */
104841 const char *zPrev, /* Buffer containing previous term */
104843 const char *zNext, /* Buffer containing next term */
104860 const char *zTerm, /* Pointer to buffer containing term */
104890 assert( pTree->aData==(char *)&pTree[1] );
104891 pTree->aData = (char *)sqlite3_malloc(nReq);
104909 char *zNew = sqlite3_realloc(pTree->zMalloc, nTerm*2);
104920 pTree->zTerm = (char *)zTerm;
104941 pNew->aData = (char *)&pNew[1];
104975 pTree->aData[nStart] = (char)iHeight;
105000 char **paRoot, /* OUT: Data for root node */
105043 if( p->aData!=(char *)&p[1] ){
105066 const char *zTerm, /* Pointer to buffer containing term */
105068 const char *aDoclist, /* Pointer to buffer containing doclist */
105088 pWriter->aData = (char *)sqlite3_malloc(p->nNodeSize);
105153 char *aNew = sqlite3_realloc(pWriter->aData, nReq);
105176 char *zNew = sqlite3_realloc(pWriter->zMalloc, nTerm*2);
105187 pWriter->zTerm = (char *)zTerm;
105210 char *zRoot = NULL; /* Pointer to buffer containing root node */
105369 char **ppList, /* IN/OUT: Pointer to position list */
105372 char *pList = *ppList;
105374 char *pEnd = &pList[nList];
105376 char *p = pList;
105380 char c = 0;
105408 char *zTerm, /* Term to write to the db */
105410 char *aDoclist, /* Doclist associated with zTerm */
105424 char *zTerm, /* Term to write to the db */
105426 char *aDoclist, /* Doclist associated with zTerm */
105463 int (*xFunc)(Fts3Table *, void *, char *, int, char *, int), /* Callback */
105467 char *aBuffer = 0; /* Buffer to merge doclists in */
105489 const char *zTerm = pFilter->zTerm;
105501 char *zTerm = apSegment[0]->zTerm;
105547 char *pList;
105568 char *aNew;
105790 const char *zVal = (const char *)sqlite3_value_text(pVal);
105927 char snStatus; /* Status flag for use while constructing snippets */
105934 char *zOffset; /* Text rendering of aMatch[] */
105936 char *zSnippet; /* Snippet text */
105945 static int fts3snippetIsspace(char c){
105957 char *z; /* Text of the string. Space from malloc. */
105975 static void fts3SnippetAppend(StringBuffer *p, const char *zNew, int nNew){
105980 char *zNew;
106137 const char *zDoc, /* Text of the fulltext table column */
106148 const char *zToken; /* Next token from the tokenizer */
106373 const char *zDoc;
106375 zDoc = (const char*)sqlite3_column_text(pCsr->pStmt, i+1);
106400 char zBuf[200];
106433 const char *zDoc, /* Document text */
106481 const char *zStartMark, /* Markup to appear before each match */
106482 const char *zEndMark, /* Markup to appear after each match */
106483 const char *zEllipsis /* Ellipsis mark */
106494 const char *zDoc;
106527 zDoc = (const char*)sqlite3_column_text(pCursor->pStmt, iCol+1);
106611 const char *zStart, /* Snippet start text - "<b>" */
106612 const char *zEnd, /* Snippet end text - "</b>" */
106613 const char *zEllipsis /* Snippet ellipsis text - "<b>...</b>" */
106638 static void fts3GetDeltaPosition(char **pp, int *piPos){
106717 char **apList, /* IN/OUT: nList position list pointers */
106729 char *pList = apList[i];
106761 char **apList;
106767 char *pCsr;
106832 char **apList; /* Array of position lists */
106921 char *z;
106928 const char *zAppend,
106937 char *zNew = sqlite3_realloc(pStr->z, nAlloc);
106954 const char *zDoc, /* Document to extract snippet from */
106959 const char *zOpen, /* String inserted before highlighted term */
106960 const char *zClose, /* String inserted after highlighted term */
106961 const char *zEllipsis,
106962 char **pzSnippet /* OUT: Snippet text */
106972 const char *ZDUMMY; /* Dummy arguments used with tokenizer */
107073 static int fts3ColumnlistCount(char **ppCollist){
107074 char *pEnd = *ppCollist;
107075 char c = 0;
107088 static void fts3LoadColumnlistCounts(char **pp, u32 *aOut){
107089 char *pCsr = *pp;
107111 char *pCsr;
107112 char *pEnd;
107137 char *pCsr;
107201 const char *zStart, /* Snippet start text - "<b>" */
107202 const char *zEnd, /* Snippet end text - "</b>" */
107203 const char *zEllipsis, /* Snippet ellipsis text - "<b>...</b>" */
107210 char *z = 0;
107212 const char *zDoc;
107217 zDoc = (const char *)sqlite3_column_text(pCsr->pStmt, iCol+1);
107308 typedef unsigned char u8;
107338 char *zDb; /* Name of database containing r-tree table */
107339 char *zName; /* Name of r-tree table */
107845 sqlite3 *, void *, int, const char *const*, sqlite3_vtab **, char **, int
107854 int argc, const char *const*argv,
107856 char **pzErr
107867 int argc, const char *const*argv,
107869 char **pzErr
107915 char *zCreate = sqlite3_mprintf(
108232 int idxNum, const char *idxStr,
108344 char zIdxStr[RTREE_MAX_DIMENSIONS*8+1];
108391 static const unsigned char compatible[] = { 0, 0, 1, 1, 2, 2 };
109747 static int rtreeRename(sqlite3_vtab *pVtab, const char *zNewName){
109750 char *zSql = sqlite3_mprintf(
109791 const char *zDb,
109792 const char *zPrefix,
109798 static const char *azSql[N_STATEMENT] = {
109820 char *zCreate = sqlite3_mprintf(
109848 char *zSql = sqlite3_mprintf(azSql[i], zDb, zPrefix);
109866 static int getPageSize(sqlite3 *db, const char *zDb, int *piPageSize){
109868 char *zSql;
109900 int argc, const char *const*argv, /* Parameters to CREATE TABLE statement */
109902 char **pzErr, /* OUT: Error message, if any */
109912 const char *aErrMsg[] = {
109940 pRtree->zDb = (char *)&pRtree[1];
109967 char *zSql = sqlite3_mprintf("CREATE TABLE x(%s", argv[3]);
109968 char *zTmp;
110014 char *zText = 0;
110026 char zCell[512];
110040 char *zTextNew = sqlite3_mprintf("%s {%s}", zText, zCell);
110093 char **pzErrMsg,
110265 const unsigned char *zA = sqlite3_value_text(argv[0]);
110266 const unsigned char *zB = sqlite3_value_text(argv[1]);
110283 const unsigned char *zE = sqlite3_value_text(argv[2]);
110308 const char *zName, /* Name of ICU function that failed */
110311 char zBuf[128];
110433 const char *zLocale = 0;
110437 zLocale = (const char *)sqlite3_value_text(apArg[1]);
110518 const char *zLocale; /* Locale identifier - (eg. "jp_JP") */
110519 const char *zName; /* SQL Collation sequence name (eg. "japanese") */
110524 zLocale = (const char *)sqlite3_value_text(apArg[0]);
110525 zName = (const char *)sqlite3_value_text(apArg[1]);
110552 const char *zName; /* Function name */
110592 char **pzErrMsg,
110632 char *zLocale;
110644 char *zBuffer;
110654 const char * const *argv, /* Tokenizer creation arguments */
110670 p->zLocale = (char *)&p[1];
110696 const char *zInput, /* Input string */
110776 const char **ppToken, /* OUT: *ppToken is the token text */
110812 char *zNew = sqlite3_realloc(pCsr->zBuffer, nByte);