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