shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 1 | /* |
| 2 | ** 2010 February 23 |
| 3 | ** |
| 4 | ** The author disclaims copyright to this source code. In place of |
| 5 | ** a legal notice, here is a blessing: |
| 6 | ** |
| 7 | ** May you do good and not evil. |
| 8 | ** May you find forgiveness for yourself and forgive others. |
| 9 | ** May you share freely, never taking more than you give. |
| 10 | ** |
| 11 | ************************************************************************* |
| 12 | ** |
| 13 | ** This file implements routines used to report what compile-time options |
| 14 | ** SQLite was built with. |
| 15 | */ |
| 16 | |
| 17 | #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS |
| 18 | |
| 19 | #include "sqliteInt.h" |
| 20 | |
| 21 | /* |
shaneh | 915c8bd | 2010-02-24 19:36:10 +0000 | [diff] [blame] | 22 | ** An array of names of all compile-time options. This array should |
| 23 | ** be sorted A-Z. |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 24 | ** |
| 25 | ** This array looks large, but in a typical installation actually uses |
shaneh | 915c8bd | 2010-02-24 19:36:10 +0000 | [diff] [blame] | 26 | ** only a handful of compile-time options, so most times this array is usually |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 27 | ** rather short and uses little memory space. |
| 28 | */ |
| 29 | static const char * const azCompileOpt[] = { |
shaneh | 915c8bd | 2010-02-24 19:36:10 +0000 | [diff] [blame] | 30 | |
| 31 | /* These macros are provided to "stringify" the value of the define |
| 32 | ** for those options in which the value is meaningful. */ |
| 33 | #define CTIMEOPT_VAL_(opt) #opt |
| 34 | #define CTIMEOPT_VAL(opt) CTIMEOPT_VAL_(opt) |
| 35 | |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 36 | #if SQLITE_32BIT_ROWID |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 37 | "32BIT_ROWID", |
| 38 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 39 | #if SQLITE_4_BYTE_ALIGNED_MALLOC |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 40 | "4_BYTE_ALIGNED_MALLOC", |
| 41 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 42 | #if SQLITE_CASE_SENSITIVE_LIKE |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 43 | "CASE_SENSITIVE_LIKE", |
| 44 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 45 | #if SQLITE_CHECK_PAGES |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 46 | "CHECK_PAGES", |
| 47 | #endif |
mistachkin | f35b8f8 | 2016-05-28 00:13:21 +0000 | [diff] [blame] | 48 | #if defined(__clang__) && defined(__clang_version__) |
mistachkin | 756e09c | 2016-05-27 20:30:02 +0000 | [diff] [blame] | 49 | "COMPILER=clang-" __clang_version__, |
mistachkin | f35b8f8 | 2016-05-28 00:13:21 +0000 | [diff] [blame] | 50 | #elif defined(_MSC_VER) |
| 51 | "COMPILER=msvc-" CTIMEOPT_VAL(_MSC_VER), |
mistachkin | 7ce6cdd | 2016-05-27 21:13:43 +0000 | [diff] [blame] | 52 | #elif defined(__GNUC__) && defined(__VERSION__) |
| 53 | "COMPILER=gcc-" __VERSION__, |
mistachkin | 15e2dde | 2016-05-27 18:09:45 +0000 | [diff] [blame] | 54 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 55 | #if SQLITE_COVERAGE_TEST |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 56 | "COVERAGE_TEST", |
| 57 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 58 | #if SQLITE_DEBUG |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 59 | "DEBUG", |
| 60 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 61 | #if SQLITE_DEFAULT_LOCKING_MODE |
shaneh | 915c8bd | 2010-02-24 19:36:10 +0000 | [diff] [blame] | 62 | "DEFAULT_LOCKING_MODE=" CTIMEOPT_VAL(SQLITE_DEFAULT_LOCKING_MODE), |
| 63 | #endif |
drh | d16d0bc | 2013-04-16 18:24:34 +0000 | [diff] [blame] | 64 | #if defined(SQLITE_DEFAULT_MMAP_SIZE) && !defined(SQLITE_DEFAULT_MMAP_SIZE_xc) |
drh | 9b4c59f | 2013-04-15 17:03:42 +0000 | [diff] [blame] | 65 | "DEFAULT_MMAP_SIZE=" CTIMEOPT_VAL(SQLITE_DEFAULT_MMAP_SIZE), |
drh | 34f7490 | 2013-04-03 13:09:18 +0000 | [diff] [blame] | 66 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 67 | #if SQLITE_DISABLE_DIRSYNC |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 68 | "DISABLE_DIRSYNC", |
| 69 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 70 | #if SQLITE_DISABLE_LFS |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 71 | "DISABLE_LFS", |
| 72 | #endif |
drh | 7a7f688 | 2015-12-03 20:50:10 +0000 | [diff] [blame] | 73 | #if SQLITE_ENABLE_8_3_NAMES |
| 74 | "ENABLE_8_3_NAMES", |
| 75 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 76 | #if SQLITE_ENABLE_API_ARMOR |
drh | 9ca9573 | 2014-10-24 00:35:58 +0000 | [diff] [blame] | 77 | "ENABLE_API_ARMOR", |
| 78 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 79 | #if SQLITE_ENABLE_ATOMIC_WRITE |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 80 | "ENABLE_ATOMIC_WRITE", |
| 81 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 82 | #if SQLITE_ENABLE_CEROD |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 83 | "ENABLE_CEROD", |
| 84 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 85 | #if SQLITE_ENABLE_COLUMN_METADATA |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 86 | "ENABLE_COLUMN_METADATA", |
| 87 | #endif |
drh | cda9a93 | 2015-05-07 20:26:20 +0000 | [diff] [blame] | 88 | #if SQLITE_ENABLE_DBSTAT_VTAB |
| 89 | "ENABLE_DBSTAT_VTAB", |
| 90 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 91 | #if SQLITE_ENABLE_EXPENSIVE_ASSERT |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 92 | "ENABLE_EXPENSIVE_ASSERT", |
| 93 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 94 | #if SQLITE_ENABLE_FTS1 |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 95 | "ENABLE_FTS1", |
| 96 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 97 | #if SQLITE_ENABLE_FTS2 |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 98 | "ENABLE_FTS2", |
| 99 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 100 | #if SQLITE_ENABLE_FTS3 |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 101 | "ENABLE_FTS3", |
| 102 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 103 | #if SQLITE_ENABLE_FTS3_PARENTHESIS |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 104 | "ENABLE_FTS3_PARENTHESIS", |
| 105 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 106 | #if SQLITE_ENABLE_FTS4 |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 107 | "ENABLE_FTS4", |
| 108 | #endif |
drh | 5006565 | 2015-10-08 19:29:18 +0000 | [diff] [blame] | 109 | #if SQLITE_ENABLE_FTS5 |
| 110 | "ENABLE_FTS5", |
| 111 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 112 | #if SQLITE_ENABLE_ICU |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 113 | "ENABLE_ICU", |
| 114 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 115 | #if SQLITE_ENABLE_IOTRACE |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 116 | "ENABLE_IOTRACE", |
| 117 | #endif |
drh | 5006565 | 2015-10-08 19:29:18 +0000 | [diff] [blame] | 118 | #if SQLITE_ENABLE_JSON1 |
| 119 | "ENABLE_JSON1", |
| 120 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 121 | #if SQLITE_ENABLE_LOAD_EXTENSION |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 122 | "ENABLE_LOAD_EXTENSION", |
| 123 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 124 | #if SQLITE_ENABLE_LOCKING_STYLE |
shaneh | 915c8bd | 2010-02-24 19:36:10 +0000 | [diff] [blame] | 125 | "ENABLE_LOCKING_STYLE=" CTIMEOPT_VAL(SQLITE_ENABLE_LOCKING_STYLE), |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 126 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 127 | #if SQLITE_ENABLE_MEMORY_MANAGEMENT |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 128 | "ENABLE_MEMORY_MANAGEMENT", |
| 129 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 130 | #if SQLITE_ENABLE_MEMSYS3 |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 131 | "ENABLE_MEMSYS3", |
| 132 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 133 | #if SQLITE_ENABLE_MEMSYS5 |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 134 | "ENABLE_MEMSYS5", |
| 135 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 136 | #if SQLITE_ENABLE_OVERSIZE_CELL_CHECK |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 137 | "ENABLE_OVERSIZE_CELL_CHECK", |
| 138 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 139 | #if SQLITE_ENABLE_RTREE |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 140 | "ENABLE_RTREE", |
| 141 | #endif |
dan | 8ad169a | 2013-08-12 20:14:04 +0000 | [diff] [blame] | 142 | #if defined(SQLITE_ENABLE_STAT4) |
dan | f52bb8d | 2013-08-03 20:24:58 +0000 | [diff] [blame] | 143 | "ENABLE_STAT4", |
dan | 8ad169a | 2013-08-12 20:14:04 +0000 | [diff] [blame] | 144 | #elif defined(SQLITE_ENABLE_STAT3) |
| 145 | "ENABLE_STAT3", |
drh | faacf17 | 2011-08-12 01:51:45 +0000 | [diff] [blame] | 146 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 147 | #if SQLITE_ENABLE_UNLOCK_NOTIFY |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 148 | "ENABLE_UNLOCK_NOTIFY", |
| 149 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 150 | #if SQLITE_ENABLE_UPDATE_DELETE_LIMIT |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 151 | "ENABLE_UPDATE_DELETE_LIMIT", |
| 152 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 153 | #if SQLITE_HAS_CODEC |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 154 | "HAS_CODEC", |
| 155 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 156 | #if HAVE_ISNAN || SQLITE_HAVE_ISNAN |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 157 | "HAVE_ISNAN", |
| 158 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 159 | #if SQLITE_HOMEGROWN_RECURSIVE_MUTEX |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 160 | "HOMEGROWN_RECURSIVE_MUTEX", |
| 161 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 162 | #if SQLITE_IGNORE_AFP_LOCK_ERRORS |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 163 | "IGNORE_AFP_LOCK_ERRORS", |
| 164 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 165 | #if SQLITE_IGNORE_FLOCK_LOCK_ERRORS |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 166 | "IGNORE_FLOCK_LOCK_ERRORS", |
| 167 | #endif |
| 168 | #ifdef SQLITE_INT64_TYPE |
| 169 | "INT64_TYPE", |
| 170 | #endif |
drh | 41d2e66 | 2015-12-01 21:23:07 +0000 | [diff] [blame] | 171 | #ifdef SQLITE_LIKE_DOESNT_MATCH_BLOBS |
| 172 | "LIKE_DOESNT_MATCH_BLOBS", |
| 173 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 174 | #if SQLITE_LOCK_TRACE |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 175 | "LOCK_TRACE", |
| 176 | #endif |
drh | d16d0bc | 2013-04-16 18:24:34 +0000 | [diff] [blame] | 177 | #if defined(SQLITE_MAX_MMAP_SIZE) && !defined(SQLITE_MAX_MMAP_SIZE_xc) |
drh | 9b4c59f | 2013-04-15 17:03:42 +0000 | [diff] [blame] | 178 | "MAX_MMAP_SIZE=" CTIMEOPT_VAL(SQLITE_MAX_MMAP_SIZE), |
| 179 | #endif |
drh | 5a201fb | 2011-08-31 20:47:50 +0000 | [diff] [blame] | 180 | #ifdef SQLITE_MAX_SCHEMA_RETRY |
| 181 | "MAX_SCHEMA_RETRY=" CTIMEOPT_VAL(SQLITE_MAX_SCHEMA_RETRY), |
| 182 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 183 | #if SQLITE_MEMDEBUG |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 184 | "MEMDEBUG", |
| 185 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 186 | #if SQLITE_MIXED_ENDIAN_64BIT_FLOAT |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 187 | "MIXED_ENDIAN_64BIT_FLOAT", |
| 188 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 189 | #if SQLITE_NO_SYNC |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 190 | "NO_SYNC", |
| 191 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 192 | #if SQLITE_OMIT_ALTERTABLE |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 193 | "OMIT_ALTERTABLE", |
| 194 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 195 | #if SQLITE_OMIT_ANALYZE |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 196 | "OMIT_ANALYZE", |
| 197 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 198 | #if SQLITE_OMIT_ATTACH |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 199 | "OMIT_ATTACH", |
| 200 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 201 | #if SQLITE_OMIT_AUTHORIZATION |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 202 | "OMIT_AUTHORIZATION", |
| 203 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 204 | #if SQLITE_OMIT_AUTOINCREMENT |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 205 | "OMIT_AUTOINCREMENT", |
| 206 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 207 | #if SQLITE_OMIT_AUTOINIT |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 208 | "OMIT_AUTOINIT", |
| 209 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 210 | #if SQLITE_OMIT_AUTOMATIC_INDEX |
drh | c633908 | 2010-04-07 16:54:58 +0000 | [diff] [blame] | 211 | "OMIT_AUTOMATIC_INDEX", |
| 212 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 213 | #if SQLITE_OMIT_AUTORESET |
drh | 602acb4 | 2011-01-17 17:42:37 +0000 | [diff] [blame] | 214 | "OMIT_AUTORESET", |
| 215 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 216 | #if SQLITE_OMIT_AUTOVACUUM |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 217 | "OMIT_AUTOVACUUM", |
| 218 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 219 | #if SQLITE_OMIT_BETWEEN_OPTIMIZATION |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 220 | "OMIT_BETWEEN_OPTIMIZATION", |
| 221 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 222 | #if SQLITE_OMIT_BLOB_LITERAL |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 223 | "OMIT_BLOB_LITERAL", |
| 224 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 225 | #if SQLITE_OMIT_BTREECOUNT |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 226 | "OMIT_BTREECOUNT", |
| 227 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 228 | #if SQLITE_OMIT_BUILTIN_TEST |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 229 | "OMIT_BUILTIN_TEST", |
| 230 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 231 | #if SQLITE_OMIT_CAST |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 232 | "OMIT_CAST", |
| 233 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 234 | #if SQLITE_OMIT_CHECK |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 235 | "OMIT_CHECK", |
| 236 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 237 | #if SQLITE_OMIT_COMPLETE |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 238 | "OMIT_COMPLETE", |
| 239 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 240 | #if SQLITE_OMIT_COMPOUND_SELECT |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 241 | "OMIT_COMPOUND_SELECT", |
| 242 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 243 | #if SQLITE_OMIT_CTE |
dan | 03af216 | 2014-03-05 17:29:34 +0000 | [diff] [blame] | 244 | "OMIT_CTE", |
| 245 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 246 | #if SQLITE_OMIT_DATETIME_FUNCS |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 247 | "OMIT_DATETIME_FUNCS", |
| 248 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 249 | #if SQLITE_OMIT_DECLTYPE |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 250 | "OMIT_DECLTYPE", |
| 251 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 252 | #if SQLITE_OMIT_DEPRECATED |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 253 | "OMIT_DEPRECATED", |
| 254 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 255 | #if SQLITE_OMIT_DISKIO |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 256 | "OMIT_DISKIO", |
| 257 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 258 | #if SQLITE_OMIT_EXPLAIN |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 259 | "OMIT_EXPLAIN", |
| 260 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 261 | #if SQLITE_OMIT_FLAG_PRAGMAS |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 262 | "OMIT_FLAG_PRAGMAS", |
| 263 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 264 | #if SQLITE_OMIT_FLOATING_POINT |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 265 | "OMIT_FLOATING_POINT", |
| 266 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 267 | #if SQLITE_OMIT_FOREIGN_KEY |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 268 | "OMIT_FOREIGN_KEY", |
| 269 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 270 | #if SQLITE_OMIT_GET_TABLE |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 271 | "OMIT_GET_TABLE", |
| 272 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 273 | #if SQLITE_OMIT_INCRBLOB |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 274 | "OMIT_INCRBLOB", |
| 275 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 276 | #if SQLITE_OMIT_INTEGRITY_CHECK |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 277 | "OMIT_INTEGRITY_CHECK", |
| 278 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 279 | #if SQLITE_OMIT_LIKE_OPTIMIZATION |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 280 | "OMIT_LIKE_OPTIMIZATION", |
| 281 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 282 | #if SQLITE_OMIT_LOAD_EXTENSION |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 283 | "OMIT_LOAD_EXTENSION", |
| 284 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 285 | #if SQLITE_OMIT_LOCALTIME |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 286 | "OMIT_LOCALTIME", |
| 287 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 288 | #if SQLITE_OMIT_LOOKASIDE |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 289 | "OMIT_LOOKASIDE", |
| 290 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 291 | #if SQLITE_OMIT_MEMORYDB |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 292 | "OMIT_MEMORYDB", |
| 293 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 294 | #if SQLITE_OMIT_OR_OPTIMIZATION |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 295 | "OMIT_OR_OPTIMIZATION", |
| 296 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 297 | #if SQLITE_OMIT_PAGER_PRAGMAS |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 298 | "OMIT_PAGER_PRAGMAS", |
| 299 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 300 | #if SQLITE_OMIT_PRAGMA |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 301 | "OMIT_PRAGMA", |
| 302 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 303 | #if SQLITE_OMIT_PROGRESS_CALLBACK |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 304 | "OMIT_PROGRESS_CALLBACK", |
| 305 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 306 | #if SQLITE_OMIT_QUICKBALANCE |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 307 | "OMIT_QUICKBALANCE", |
| 308 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 309 | #if SQLITE_OMIT_REINDEX |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 310 | "OMIT_REINDEX", |
| 311 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 312 | #if SQLITE_OMIT_SCHEMA_PRAGMAS |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 313 | "OMIT_SCHEMA_PRAGMAS", |
| 314 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 315 | #if SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 316 | "OMIT_SCHEMA_VERSION_PRAGMAS", |
| 317 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 318 | #if SQLITE_OMIT_SHARED_CACHE |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 319 | "OMIT_SHARED_CACHE", |
| 320 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 321 | #if SQLITE_OMIT_SUBQUERY |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 322 | "OMIT_SUBQUERY", |
| 323 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 324 | #if SQLITE_OMIT_TCL_VARIABLE |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 325 | "OMIT_TCL_VARIABLE", |
| 326 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 327 | #if SQLITE_OMIT_TEMPDB |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 328 | "OMIT_TEMPDB", |
| 329 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 330 | #if SQLITE_OMIT_TRACE |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 331 | "OMIT_TRACE", |
| 332 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 333 | #if SQLITE_OMIT_TRIGGER |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 334 | "OMIT_TRIGGER", |
| 335 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 336 | #if SQLITE_OMIT_TRUNCATE_OPTIMIZATION |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 337 | "OMIT_TRUNCATE_OPTIMIZATION", |
| 338 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 339 | #if SQLITE_OMIT_UTF16 |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 340 | "OMIT_UTF16", |
| 341 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 342 | #if SQLITE_OMIT_VACUUM |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 343 | "OMIT_VACUUM", |
| 344 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 345 | #if SQLITE_OMIT_VIEW |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 346 | "OMIT_VIEW", |
| 347 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 348 | #if SQLITE_OMIT_VIRTUALTABLE |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 349 | "OMIT_VIRTUALTABLE", |
| 350 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 351 | #if SQLITE_OMIT_WAL |
drh | 4d9a7bf | 2010-07-07 01:52:31 +0000 | [diff] [blame] | 352 | "OMIT_WAL", |
| 353 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 354 | #if SQLITE_OMIT_WSD |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 355 | "OMIT_WSD", |
| 356 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 357 | #if SQLITE_OMIT_XFER_OPT |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 358 | "OMIT_XFER_OPT", |
| 359 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 360 | #if SQLITE_PERFORMANCE_TRACE |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 361 | "PERFORMANCE_TRACE", |
| 362 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 363 | #if SQLITE_PROXY_DEBUG |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 364 | "PROXY_DEBUG", |
| 365 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 366 | #if SQLITE_RTREE_INT_ONLY |
drh | df32414 | 2012-09-13 12:10:55 +0000 | [diff] [blame] | 367 | "RTREE_INT_ONLY", |
| 368 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 369 | #if SQLITE_SECURE_DELETE |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 370 | "SECURE_DELETE", |
| 371 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 372 | #if SQLITE_SMALL_STACK |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 373 | "SMALL_STACK", |
| 374 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 375 | #if SQLITE_SOUNDEX |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 376 | "SOUNDEX", |
| 377 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 378 | #if SQLITE_SYSTEM_MALLOC |
mistachkin | 1fa85a1 | 2013-12-03 22:32:48 +0000 | [diff] [blame] | 379 | "SYSTEM_MALLOC", |
| 380 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 381 | #if SQLITE_TCL |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 382 | "TCL", |
| 383 | #endif |
drh | d16d0bc | 2013-04-16 18:24:34 +0000 | [diff] [blame] | 384 | #if defined(SQLITE_TEMP_STORE) && !defined(SQLITE_TEMP_STORE_xc) |
shaneh | 915c8bd | 2010-02-24 19:36:10 +0000 | [diff] [blame] | 385 | "TEMP_STORE=" CTIMEOPT_VAL(SQLITE_TEMP_STORE), |
| 386 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 387 | #if SQLITE_TEST |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 388 | "TEST", |
| 389 | #endif |
drh | d16d0bc | 2013-04-16 18:24:34 +0000 | [diff] [blame] | 390 | #if defined(SQLITE_THREADSAFE) |
shaneh | 915c8bd | 2010-02-24 19:36:10 +0000 | [diff] [blame] | 391 | "THREADSAFE=" CTIMEOPT_VAL(SQLITE_THREADSAFE), |
| 392 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 393 | #if SQLITE_USE_ALLOCA |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 394 | "USE_ALLOCA", |
| 395 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 396 | #if SQLITE_USER_AUTHENTICATION |
drh | 09e6054 | 2014-09-10 22:46:46 +0000 | [diff] [blame] | 397 | "USER_AUTHENTICATION", |
| 398 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 399 | #if SQLITE_WIN32_MALLOC |
mistachkin | 1fa85a1 | 2013-12-03 22:32:48 +0000 | [diff] [blame] | 400 | "WIN32_MALLOC", |
| 401 | #endif |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 402 | #if SQLITE_ZERO_MALLOC |
shaneh | 915c8bd | 2010-02-24 19:36:10 +0000 | [diff] [blame] | 403 | "ZERO_MALLOC" |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 404 | #endif |
| 405 | }; |
| 406 | |
| 407 | /* |
| 408 | ** Given the name of a compile-time option, return true if that option |
| 409 | ** was used and false if not. |
| 410 | ** |
| 411 | ** The name can optionally begin with "SQLITE_" but the "SQLITE_" prefix |
| 412 | ** is not required for a match. |
| 413 | */ |
| 414 | int sqlite3_compileoption_used(const char *zOptName){ |
| 415 | int i, n; |
drh | 9ca9573 | 2014-10-24 00:35:58 +0000 | [diff] [blame] | 416 | |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 417 | #if SQLITE_ENABLE_API_ARMOR |
drh | 9ca9573 | 2014-10-24 00:35:58 +0000 | [diff] [blame] | 418 | if( zOptName==0 ){ |
| 419 | (void)SQLITE_MISUSE_BKPT; |
| 420 | return 0; |
| 421 | } |
| 422 | #endif |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 423 | if( sqlite3StrNICmp(zOptName, "SQLITE_", 7)==0 ) zOptName += 7; |
| 424 | n = sqlite3Strlen30(zOptName); |
| 425 | |
| 426 | /* Since ArraySize(azCompileOpt) is normally in single digits, a |
| 427 | ** linear search is adequate. No need for a binary search. */ |
| 428 | for(i=0; i<ArraySize(azCompileOpt); i++){ |
drh | d16d0bc | 2013-04-16 18:24:34 +0000 | [diff] [blame] | 429 | if( sqlite3StrNICmp(zOptName, azCompileOpt[i], n)==0 |
drh | 97348b3 | 2014-09-25 02:44:29 +0000 | [diff] [blame] | 430 | && sqlite3IsIdChar((unsigned char)azCompileOpt[i][n])==0 |
drh | d16d0bc | 2013-04-16 18:24:34 +0000 | [diff] [blame] | 431 | ){ |
| 432 | return 1; |
| 433 | } |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 434 | } |
| 435 | return 0; |
| 436 | } |
| 437 | |
| 438 | /* |
| 439 | ** Return the N-th compile-time option string. If N is out of range, |
| 440 | ** return a NULL pointer. |
| 441 | */ |
drh | 380083c | 2010-02-23 20:32:15 +0000 | [diff] [blame] | 442 | const char *sqlite3_compileoption_get(int N){ |
shaneh | dc97a8c | 2010-02-23 20:08:35 +0000 | [diff] [blame] | 443 | if( N>=0 && N<ArraySize(azCompileOpt) ){ |
| 444 | return azCompileOpt[N]; |
| 445 | } |
| 446 | return 0; |
| 447 | } |
| 448 | |
| 449 | #endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */ |