1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/persistentdata/persistentstorage/sql/SQLite364/keywordhash.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,112 @@
1.4 +/***** This file contains automatically generated code ******
1.5 +**
1.6 +** The code in this file has been automatically generated by
1.7 +**
1.8 +** $Header: /sqlite/sqlite/tool/mkkeywordhash.c,v 1.32 2008/10/06 05:32:19 danielk1977 Exp $
1.9 +**
1.10 +** The code in this file implements a function that determines whether
1.11 +** or not a given identifier is really an SQL keyword. The same thing
1.12 +** might be implemented more directly using a hand-written hash table.
1.13 +** But by using this automatically generated code, the size of the code
1.14 +** is substantially reduced. This is important for embedded applications
1.15 +** on platforms with limited memory.
1.16 +*/
1.17 +/* Hash score: 159 */
1.18 +static int keywordCode(const char *z, int n){
1.19 + /* zText[] encodes 775 bytes of keywords in 521 bytes */
1.20 + static const char zText[521] =
1.21 + "REINDEXEDESCAPEACHECKEYBEFOREIGNOREGEXPLAINSTEADDATABASELECTABLE"
1.22 + "FTHENDEFERRABLELSEXCEPTRANSACTIONATURALTERAISEXCLUSIVEXISTSCONSTRAINT"
1.23 + "ERSECTRIGGEREFERENCESUNIQUERYATTACHAVINGROUPDATEMPORARYBEGINNER"
1.24 + "ENAMEBETWEENOTNULLIKECASCADELETECASECOLLATECREATECURRENT_DATE"
1.25 + "DETACHIMMEDIATEJOINSERTMATCHPLANALYZEPRAGMABORTVALUESWHENWHERE"
1.26 + "PLACEAFTERESTRICTANDEFAULTAUTOINCREMENTCASTCOLUMNCOMMITCONFLICT"
1.27 + "CROSSCURRENT_TIMESTAMPRIMARYDEFERREDISTINCTDROPFAILIMITFROMFULL"
1.28 + "GLOBYIFINTOFFSETISNULLORDERIGHTOUTEROLLBACKROWUNIONUSINGVACUUM"
1.29 + "VIEWINITIALLY";
1.30 + static const unsigned char aHash[127] = {
1.31 + 65, 92, 109, 63, 0, 44, 0, 0, 71, 0, 66, 0, 0,
1.32 + 103, 12, 67, 15, 0, 107, 72, 104, 100, 0, 19, 0, 0,
1.33 + 113, 0, 111, 76, 0, 22, 80, 0, 9, 0, 0, 59, 60,
1.34 + 0, 58, 6, 0, 39, 77, 89, 0, 110, 88, 0, 0, 45,
1.35 + 0, 90, 24, 0, 17, 0, 114, 40, 23, 0, 5, 98, 25,
1.36 + 83, 0, 0, 116, 93, 50, 115, 47, 7, 42, 0, 78, 0,
1.37 + 87, 26, 0, 86, 0, 0, 0, 82, 79, 84, 75, 97, 14,
1.38 + 34, 96, 0, 70, 0, 18, 74, 99, 31, 0, 112, 69, 105,
1.39 + 52, 46, 95, 0, 0, 81, 101, 0, 108, 0, 35, 0, 0,
1.40 + 28, 0, 73, 48, 53, 0, 20, 51, 0, 43,
1.41 + };
1.42 + static const unsigned char aNext[116] = {
1.43 + 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0,
1.44 + 0, 2, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0,
1.45 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1.46 + 0, 0, 3, 38, 0, 32, 21, 0, 0, 0, 0, 29, 0,
1.47 + 0, 37, 0, 0, 0, 1, 55, 0, 0, 56, 0, 0, 0,
1.48 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 16, 33,
1.49 + 10, 0, 0, 0, 0, 0, 0, 0, 11, 61, 68, 0, 8,
1.50 + 0, 91, 85, 0, 0, 94, 0, 49, 0, 0, 64, 0, 41,
1.51 + 102, 0, 27, 106, 36, 62, 54, 0, 0, 57, 0, 0,
1.52 + };
1.53 + static const unsigned char aLen[116] = {
1.54 + 7, 7, 5, 4, 6, 4, 5, 3, 6, 7, 3, 6, 6,
1.55 + 7, 7, 3, 8, 2, 6, 5, 4, 4, 3, 10, 4, 6,
1.56 + 11, 2, 7, 5, 5, 9, 6, 10, 9, 7, 10, 6, 5,
1.57 + 6, 6, 5, 6, 4, 9, 2, 5, 5, 6, 7, 7, 3,
1.58 + 4, 4, 7, 3, 6, 4, 7, 6, 12, 6, 9, 4, 6,
1.59 + 5, 4, 7, 6, 5, 6, 4, 5, 7, 5, 8, 3, 7,
1.60 + 13, 2, 2, 4, 6, 6, 8, 5, 17, 12, 7, 8, 8,
1.61 + 2, 4, 4, 5, 4, 4, 4, 2, 2, 4, 6, 2, 3,
1.62 + 6, 5, 5, 5, 8, 3, 5, 5, 6, 4, 9, 3,
1.63 + };
1.64 + static const unsigned short int aOffset[116] = {
1.65 + 0, 2, 2, 8, 9, 14, 16, 20, 23, 25, 25, 29, 33,
1.66 + 36, 41, 46, 48, 53, 54, 59, 62, 65, 67, 69, 78, 81,
1.67 + 86, 95, 96, 101, 105, 109, 117, 123, 130, 138, 144, 154, 157,
1.68 + 162, 167, 172, 175, 179, 179, 183, 188, 191, 195, 201, 207, 207,
1.69 + 210, 213, 217, 218, 222, 228, 232, 239, 245, 257, 263, 272, 274,
1.70 + 280, 285, 287, 294, 299, 304, 310, 314, 317, 324, 328, 336, 338,
1.71 + 345, 347, 349, 358, 362, 368, 374, 382, 387, 387, 403, 410, 417,
1.72 + 418, 425, 429, 432, 437, 441, 445, 448, 450, 452, 455, 455, 458,
1.73 + 461, 467, 471, 476, 480, 488, 491, 496, 501, 507, 511, 516,
1.74 + };
1.75 + static const unsigned char aCode[116] = {
1.76 + TK_REINDEX, TK_INDEXED, TK_INDEX, TK_DESC, TK_ESCAPE,
1.77 + TK_EACH, TK_CHECK, TK_KEY, TK_BEFORE, TK_FOREIGN,
1.78 + TK_FOR, TK_IGNORE, TK_LIKE_KW, TK_EXPLAIN, TK_INSTEAD,
1.79 + TK_ADD, TK_DATABASE, TK_AS, TK_SELECT, TK_TABLE,
1.80 + TK_JOIN_KW, TK_THEN, TK_END, TK_DEFERRABLE, TK_ELSE,
1.81 + TK_EXCEPT, TK_TRANSACTION,TK_ON, TK_JOIN_KW, TK_ALTER,
1.82 + TK_RAISE, TK_EXCLUSIVE, TK_EXISTS, TK_CONSTRAINT, TK_INTERSECT,
1.83 + TK_TRIGGER, TK_REFERENCES, TK_UNIQUE, TK_QUERY, TK_ATTACH,
1.84 + TK_HAVING, TK_GROUP, TK_UPDATE, TK_TEMP, TK_TEMP,
1.85 + TK_OR, TK_BEGIN, TK_JOIN_KW, TK_RENAME, TK_BETWEEN,
1.86 + TK_NOTNULL, TK_NOT, TK_NULL, TK_LIKE_KW, TK_CASCADE,
1.87 + TK_ASC, TK_DELETE, TK_CASE, TK_COLLATE, TK_CREATE,
1.88 + TK_CTIME_KW, TK_DETACH, TK_IMMEDIATE, TK_JOIN, TK_INSERT,
1.89 + TK_MATCH, TK_PLAN, TK_ANALYZE, TK_PRAGMA, TK_ABORT,
1.90 + TK_VALUES, TK_WHEN, TK_WHERE, TK_REPLACE, TK_AFTER,
1.91 + TK_RESTRICT, TK_AND, TK_DEFAULT, TK_AUTOINCR, TK_TO,
1.92 + TK_IN, TK_CAST, TK_COLUMNKW, TK_COMMIT, TK_CONFLICT,
1.93 + TK_JOIN_KW, TK_CTIME_KW, TK_CTIME_KW, TK_PRIMARY, TK_DEFERRED,
1.94 + TK_DISTINCT, TK_IS, TK_DROP, TK_FAIL, TK_LIMIT,
1.95 + TK_FROM, TK_JOIN_KW, TK_LIKE_KW, TK_BY, TK_IF,
1.96 + TK_INTO, TK_OFFSET, TK_OF, TK_SET, TK_ISNULL,
1.97 + TK_ORDER, TK_JOIN_KW, TK_JOIN_KW, TK_ROLLBACK, TK_ROW,
1.98 + TK_UNION, TK_USING, TK_VACUUM, TK_VIEW, TK_INITIALLY,
1.99 + TK_ALL,
1.100 + };
1.101 + int h, i;
1.102 + if( n<2 ) return TK_ID;
1.103 + h = ((charMap(z[0])*4) ^
1.104 + (charMap(z[n-1])*3) ^
1.105 + n) % 127;
1.106 + for(i=((int)aHash[h])-1; i>=0; i=((int)aNext[i])-1){
1.107 + if( aLen[i]==n && sqlite3StrNICmp(&zText[aOffset[i]],z,n)==0 ){
1.108 + return aCode[i];
1.109 + }
1.110 + }
1.111 + return TK_ID;
1.112 +}
1.113 +int sqlite3KeywordCode(const unsigned char *z, int n){
1.114 + return keywordCode((char*)z, n);
1.115 +}