Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: third_party/sqlite/src/src/global.c

Issue 6990047: Import SQLite 3.7.6.3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/sqlite/src/src/func.c ('k') | third_party/sqlite/src/src/hash.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 ** 2008 June 13 2 ** 2008 June 13
3 ** 3 **
4 ** The author disclaims copyright to this source code. In place of 4 ** The author disclaims copyright to this source code. In place of
5 ** a legal notice, here is a blessing: 5 ** a legal notice, here is a blessing:
6 ** 6 **
7 ** May you do good and not evil. 7 ** May you do good and not evil.
8 ** May you find forgiveness for yourself and forgive others. 8 ** May you find forgiveness for yourself and forgive others.
9 ** May you share freely, never taking more than you give. 9 ** May you share freely, never taking more than you give.
10 ** 10 **
11 ************************************************************************* 11 *************************************************************************
12 ** 12 **
13 ** This file contains definitions of global variables and contants. 13 ** This file contains definitions of global variables and contants.
14 */ 14 */
15 #include "sqliteInt.h" 15 #include "sqliteInt.h"
16 16
17
18 /* An array to map all upper-case characters into their corresponding 17 /* An array to map all upper-case characters into their corresponding
19 ** lower-case character. 18 ** lower-case character.
20 ** 19 **
21 ** SQLite only considers US-ASCII (or EBCDIC) characters. We do not 20 ** SQLite only considers US-ASCII (or EBCDIC) characters. We do not
22 ** handle case conversions for the UTF character set since the tables 21 ** handle case conversions for the UTF character set since the tables
23 ** involved are nearly as big or bigger than SQLite itself. 22 ** involved are nearly as big or bigger than SQLite itself.
24 */ 23 */
25 const unsigned char sqlite3UpperToLower[] = { 24 const unsigned char sqlite3UpperToLower[] = {
26 #ifdef SQLITE_ASCII 25 #ifdef SQLITE_ASCII
27 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 26 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 /* 62 /*
64 ** The following 256 byte lookup table is used to support SQLites built-in 63 ** The following 256 byte lookup table is used to support SQLites built-in
65 ** equivalents to the following standard library functions: 64 ** equivalents to the following standard library functions:
66 ** 65 **
67 ** isspace() 0x01 66 ** isspace() 0x01
68 ** isalpha() 0x02 67 ** isalpha() 0x02
69 ** isdigit() 0x04 68 ** isdigit() 0x04
70 ** isalnum() 0x06 69 ** isalnum() 0x06
71 ** isxdigit() 0x08 70 ** isxdigit() 0x08
72 ** toupper() 0x20 71 ** toupper() 0x20
72 ** SQLite identifier character 0x40
73 ** 73 **
74 ** Bit 0x20 is set if the mapped character requires translation to upper 74 ** Bit 0x20 is set if the mapped character requires translation to upper
75 ** case. i.e. if the character is a lower-case ASCII character. 75 ** case. i.e. if the character is a lower-case ASCII character.
76 ** If x is a lower-case ASCII character, then its upper-case equivalent 76 ** If x is a lower-case ASCII character, then its upper-case equivalent
77 ** is (x - 0x20). Therefore toupper() can be implemented as: 77 ** is (x - 0x20). Therefore toupper() can be implemented as:
78 ** 78 **
79 ** (x & ~(map[x]&0x20)) 79 ** (x & ~(map[x]&0x20))
80 ** 80 **
81 ** Standard function tolower() is implemented using the sqlite3UpperToLower[] 81 ** Standard function tolower() is implemented using the sqlite3UpperToLower[]
82 ** array. tolower() is used more often than toupper() by SQLite. 82 ** array. tolower() is used more often than toupper() by SQLite.
83 ** 83 **
84 ** Bit 0x40 is set if the character non-alphanumeric and can be used in an
85 ** SQLite identifier. Identifiers are alphanumerics, "_", "$", and any
86 ** non-ASCII UTF character. Hence the test for whether or not a character is
87 ** part of an identifier is 0x46.
88 **
84 ** SQLite's versions are identical to the standard versions assuming a 89 ** SQLite's versions are identical to the standard versions assuming a
85 ** locale of "C". They are implemented as macros in sqliteInt.h. 90 ** locale of "C". They are implemented as macros in sqliteInt.h.
86 */ 91 */
87 #ifdef SQLITE_ASCII 92 #ifdef SQLITE_ASCII
88 const unsigned char sqlite3CtypeMap[256] = { 93 const unsigned char sqlite3CtypeMap[256] = {
89 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 00..07 ........ */ 94 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 00..07 ........ */
90 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, /* 08..0f ........ */ 95 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, /* 08..0f ........ */
91 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 10..17 ........ */ 96 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 10..17 ........ */
92 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 18..1f ........ */ 97 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 18..1f ........ */
93 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 20..27 !"#$%&' */ 98 0x01, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, /* 20..27 !"#$%&' */
94 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 28..2f ()*+,-./ */ 99 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 28..2f ()*+,-./ */
95 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, /* 30..37 01234567 */ 100 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, /* 30..37 01234567 */
96 0x0c, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 38..3f 89:;<=>? */ 101 0x0c, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 38..3f 89:;<=>? */
97 102
98 0x00, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x02, /* 40..47 @ABCDEFG */ 103 0x00, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x02, /* 40..47 @ABCDEFG */
99 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* 48..4f HIJKLMNO */ 104 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* 48..4f HIJKLMNO */
100 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* 50..57 PQRSTUVW */ 105 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* 50..57 PQRSTUVW */
101 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, /* 58..5f XYZ[\]^_ */ 106 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x40, /* 58..5f XYZ[\]^_ */
102 0x00, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x22, /* 60..67 `abcdefg */ 107 0x00, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x22, /* 60..67 `abcdefg */
103 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, /* 68..6f hijklmno */ 108 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, /* 68..6f hijklmno */
104 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, /* 70..77 pqrstuvw */ 109 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, /* 70..77 pqrstuvw */
105 0x22, 0x22, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, /* 78..7f xyz{|}~. */ 110 0x22, 0x22, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, /* 78..7f xyz{|}~. */
106 111
107 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 80..87 ........ */ 112 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* 80..87 ........ */
108 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 88..8f ........ */ 113 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* 88..8f ........ */
109 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 90..97 ........ */ 114 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* 90..97 ........ */
110 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 98..9f ........ */ 115 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* 98..9f ........ */
111 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* a0..a7 ........ */ 116 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* a0..a7 ........ */
112 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* a8..af ........ */ 117 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* a8..af ........ */
113 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* b0..b7 ........ */ 118 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* b0..b7 ........ */
114 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* b8..bf ........ */ 119 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* b8..bf ........ */
115 120
116 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* c0..c7 ........ */ 121 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* c0..c7 ........ */
117 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* c8..cf ........ */ 122 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* c8..cf ........ */
118 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* d0..d7 ........ */ 123 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* d0..d7 ........ */
119 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* d8..df ........ */ 124 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* d8..df ........ */
120 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* e0..e7 ........ */ 125 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* e0..e7 ........ */
121 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* e8..ef ........ */ 126 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* e8..ef ........ */
122 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* f0..f7 ........ */ 127 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* f0..f7 ........ */
123 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* f8..ff ........ */ 128 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 /* f8..ff ........ */
124 }; 129 };
125 #endif 130 #endif
126 131
127 132
128 133
129 /* 134 /*
130 ** The following singleton contains the global configuration for 135 ** The following singleton contains the global configuration for
131 ** the SQLite library. 136 ** the SQLite library.
132 */ 137 */
133 SQLITE_WSD struct Sqlite3Config sqlite3Config = { 138 SQLITE_WSD struct Sqlite3Config sqlite3Config = {
(...skipping 18 matching lines...) Expand all
152 0, /* mxParserStack */ 157 0, /* mxParserStack */
153 0, /* sharedCacheEnabled */ 158 0, /* sharedCacheEnabled */
154 /* All the rest should always be initialized to zero */ 159 /* All the rest should always be initialized to zero */
155 0, /* isInit */ 160 0, /* isInit */
156 0, /* inProgress */ 161 0, /* inProgress */
157 0, /* isMutexInit */ 162 0, /* isMutexInit */
158 0, /* isMallocInit */ 163 0, /* isMallocInit */
159 0, /* isPCacheInit */ 164 0, /* isPCacheInit */
160 0, /* pInitMutex */ 165 0, /* pInitMutex */
161 0, /* nRefInitMutex */ 166 0, /* nRefInitMutex */
167 0, /* xLog */
168 0, /* pLogArg */
162 }; 169 };
163 170
164 171
165 /* 172 /*
166 ** Hash table for global functions - functions common to all 173 ** Hash table for global functions - functions common to all
167 ** database connections. After initialization, this table is 174 ** database connections. After initialization, this table is
168 ** read-only. 175 ** read-only.
169 */ 176 */
170 SQLITE_WSD FuncDefHash sqlite3GlobalFunctions; 177 SQLITE_WSD FuncDefHash sqlite3GlobalFunctions;
171 178
172 /* 179 /*
180 ** Constant tokens for values 0 and 1.
181 */
182 const Token sqlite3IntTokens[] = {
183 { "0", 1 },
184 { "1", 1 }
185 };
186
187
188 /*
173 ** The value of the "pending" byte must be 0x40000000 (1 byte past the 189 ** The value of the "pending" byte must be 0x40000000 (1 byte past the
174 ** 1-gibabyte boundary) in a compatible database. SQLite never uses 190 ** 1-gibabyte boundary) in a compatible database. SQLite never uses
175 ** the database page that contains the pending byte. It never attempts 191 ** the database page that contains the pending byte. It never attempts
176 ** to read or write that page. The pending byte page is set assign 192 ** to read or write that page. The pending byte page is set assign
177 ** for use by the VFS layers as space for managing file locks. 193 ** for use by the VFS layers as space for managing file locks.
178 ** 194 **
179 ** During testing, it is often desirable to move the pending byte to 195 ** During testing, it is often desirable to move the pending byte to
180 ** a different position in the file. This allows code that has to 196 ** a different position in the file. This allows code that has to
181 ** deal with the pending byte to run on files that are much smaller 197 ** deal with the pending byte to run on files that are much smaller
182 ** than 1 GiB. The sqlite3_test_control() interface can be used to 198 ** than 1 GiB. The sqlite3_test_control() interface can be used to
183 ** move the pending byte. 199 ** move the pending byte.
184 ** 200 **
185 ** IMPORTANT: Changing the pending byte to any value other than 201 ** IMPORTANT: Changing the pending byte to any value other than
186 ** 0x40000000 results in an incompatible database file format! 202 ** 0x40000000 results in an incompatible database file format!
187 ** Changing the pending byte during operating results in undefined 203 ** Changing the pending byte during operating results in undefined
188 ** and dileterious behavior. 204 ** and dileterious behavior.
189 */ 205 */
206 #ifndef SQLITE_OMIT_WSD
190 int sqlite3PendingByte = 0x40000000; 207 int sqlite3PendingByte = 0x40000000;
208 #endif
209
210 #include "opcodes.h"
211 /*
212 ** Properties of opcodes. The OPFLG_INITIALIZER macro is
213 ** created by mkopcodeh.awk during compilation. Data is obtained
214 ** from the comments following the "case OP_xxxx:" statements in
215 ** the vdbe.c file.
216 */
217 const unsigned char sqlite3OpcodeProperty[] = OPFLG_INITIALIZER;
OLDNEW
« no previous file with comments | « third_party/sqlite/src/src/func.c ('k') | third_party/sqlite/src/src/hash.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698