github.com/jdgcs/sqlite3@v1.12.1-0.20210908114423-bc5f96e4dd51/internal/mptest/main_linux_386.go (about) 1 // Code generated by 'ccgo -export-defines "" -o internal/mptest/main_linux_386.go -trace-translation-units testdata/sqlite-src-3360000/mptest/mptest.c -Itestdata/sqlite-amalgamation-3360000 -l modernc.org/sqlite/lib -DNDEBUG -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DSQLITE_CORE -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1', DO NOT EDIT. 2 3 package main 4 5 import ( 6 "math" 7 "reflect" 8 "sync/atomic" 9 "unsafe" 10 11 "modernc.org/libc" 12 "modernc.org/libc/sys/types" 13 "modernc.org/sqlite/lib" 14 ) 15 16 var _ = math.Pi 17 var _ reflect.Kind 18 var _ atomic.Value 19 var _ unsafe.Pointer 20 var _ types.Size_t 21 22 func main() { libc.Start(main1) } 23 24 const ( 25 BIG_ENDIAN = 4321 26 BUFSIZ = 8192 27 BYTE_ORDER = 1234 28 DEFAULT_TIMEOUT = 10000 29 E2BIG = 7 30 EACCES = 13 31 EADDRINUSE = 98 32 EADDRNOTAVAIL = 99 33 EADV = 68 34 EAFNOSUPPORT = 97 35 EAGAIN = 11 36 EALREADY = 114 37 EBADE = 52 38 EBADF = 9 39 EBADFD = 77 40 EBADMSG = 74 41 EBADR = 53 42 EBADRQC = 56 43 EBADSLT = 57 44 EBFONT = 59 45 EBUSY = 16 46 ECANCELED = 125 47 ECHILD = 10 48 ECHRNG = 44 49 ECOMM = 70 50 ECONNABORTED = 103 51 ECONNREFUSED = 111 52 ECONNRESET = 104 53 EDEADLK = 35 54 EDEADLOCK = 35 55 EDESTADDRREQ = 89 56 EDOM = 33 57 EDOTDOT = 73 58 EDQUOT = 122 59 EEXIST = 17 60 EFAULT = 14 61 EFBIG = 27 62 EHOSTDOWN = 112 63 EHOSTUNREACH = 113 64 EHWPOISON = 133 65 EIDRM = 43 66 EILSEQ = 84 67 EINPROGRESS = 115 68 EINTR = 4 69 EINVAL = 22 70 EIO = 5 71 EISCONN = 106 72 EISDIR = 21 73 EISNAM = 120 74 EKEYEXPIRED = 127 75 EKEYREJECTED = 129 76 EKEYREVOKED = 128 77 EL2HLT = 51 78 EL2NSYNC = 45 79 EL3HLT = 46 80 EL3RST = 47 81 ELIBACC = 79 82 ELIBBAD = 80 83 ELIBEXEC = 83 84 ELIBMAX = 82 85 ELIBSCN = 81 86 ELNRNG = 48 87 ELOOP = 40 88 EMEDIUMTYPE = 124 89 EMFILE = 24 90 EMLINK = 31 91 EMSGSIZE = 90 92 EMULTIHOP = 72 93 ENAMETOOLONG = 36 94 ENAVAIL = 119 95 ENETDOWN = 100 96 ENETRESET = 102 97 ENETUNREACH = 101 98 ENFILE = 23 99 ENOANO = 55 100 ENOBUFS = 105 101 ENOCSI = 50 102 ENODATA = 61 103 ENODEV = 19 104 ENOENT = 2 105 ENOEXEC = 8 106 ENOKEY = 126 107 ENOLCK = 37 108 ENOLINK = 67 109 ENOMEDIUM = 123 110 ENOMEM = 12 111 ENOMSG = 42 112 ENONET = 64 113 ENOPKG = 65 114 ENOPROTOOPT = 92 115 ENOSPC = 28 116 ENOSR = 63 117 ENOSTR = 60 118 ENOSYS = 38 119 ENOTBLK = 15 120 ENOTCONN = 107 121 ENOTDIR = 20 122 ENOTEMPTY = 39 123 ENOTNAM = 118 124 ENOTRECOVERABLE = 131 125 ENOTSOCK = 88 126 ENOTSUP = 95 127 ENOTTY = 25 128 ENOTUNIQ = 76 129 ENXIO = 6 130 EOF = -1 131 EOPNOTSUPP = 95 132 EOVERFLOW = 75 133 EOWNERDEAD = 130 134 EPERM = 1 135 EPFNOSUPPORT = 96 136 EPIPE = 32 137 EPROTO = 71 138 EPROTONOSUPPORT = 93 139 EPROTOTYPE = 91 140 ERANGE = 34 141 EREMCHG = 78 142 EREMOTE = 66 143 EREMOTEIO = 121 144 ERESTART = 85 145 ERFKILL = 132 146 EROFS = 30 147 ESHUTDOWN = 108 148 ESOCKTNOSUPPORT = 94 149 ESPIPE = 29 150 ESRCH = 3 151 ESRMNT = 69 152 ESTALE = 116 153 ESTRPIPE = 86 154 ETIME = 62 155 ETIMEDOUT = 110 156 ETOOMANYREFS = 109 157 ETXTBSY = 26 158 EUCLEAN = 117 159 EUNATCH = 49 160 EUSERS = 87 161 EWOULDBLOCK = 11 162 EXDEV = 18 163 EXFULL = 54 164 EXIT_FAILURE = 1 165 EXIT_SUCCESS = 0 166 FD_SETSIZE = 1024 167 FILENAME_MAX = 4096 168 FOPEN_MAX = 16 169 FTS5_TOKENIZE_AUX = 0x0008 170 FTS5_TOKENIZE_DOCUMENT = 0x0004 171 FTS5_TOKENIZE_PREFIX = 0x0002 172 FTS5_TOKENIZE_QUERY = 0x0001 173 FTS5_TOKEN_COLOCATED = 0x0001 174 FULLY_WITHIN = 2 175 F_LOCK = 1 176 F_OK = 0 177 F_TEST = 3 178 F_TLOCK = 2 179 F_ULOCK = 0 180 HAVE_USLEEP = 1 181 LITTLE_ENDIAN = 1234 182 L_INCR = 1 183 L_SET = 0 184 L_XTND = 2 185 L_ctermid = 9 186 L_tmpnam = 20 187 MX_ARG = 2 188 NDEBUG = 1 189 NOT_WITHIN = 0 190 PARTLY_WITHIN = 1 191 PDP_ENDIAN = 3412 192 P_tmpdir = "/tmp" 193 RAND_MAX = 2147483647 194 R_OK = 4 195 SEEK_CUR = 1 196 SEEK_END = 2 197 SEEK_SET = 0 198 SQLITE3_H = 0 199 SQLITE3_TEXT = 3 200 SQLITE_ABORT = 4 201 SQLITE_ABORT_ROLLBACK = 516 202 SQLITE_ACCESS_EXISTS = 0 203 SQLITE_ACCESS_READ = 2 204 SQLITE_ACCESS_READWRITE = 1 205 SQLITE_ALTER_TABLE = 26 206 SQLITE_ANALYZE = 28 207 SQLITE_ANY = 5 208 SQLITE_API = 0 209 SQLITE_APICALL = 0 210 SQLITE_ATTACH = 24 211 SQLITE_AUTH = 23 212 SQLITE_AUTH_USER = 279 213 SQLITE_BLOB = 4 214 SQLITE_BUSY = 5 215 SQLITE_BUSY_RECOVERY = 261 216 SQLITE_BUSY_SNAPSHOT = 517 217 SQLITE_BUSY_TIMEOUT = 773 218 SQLITE_CALLBACK = 0 219 SQLITE_CANTOPEN = 14 220 SQLITE_CANTOPEN_CONVPATH = 1038 221 SQLITE_CANTOPEN_DIRTYWAL = 1294 222 SQLITE_CANTOPEN_FULLPATH = 782 223 SQLITE_CANTOPEN_ISDIR = 526 224 SQLITE_CANTOPEN_NOTEMPDIR = 270 225 SQLITE_CANTOPEN_SYMLINK = 1550 226 SQLITE_CDECL = 0 227 SQLITE_CHANGESETAPPLY_INVERT = 0x0002 228 SQLITE_CHANGESETAPPLY_NOSAVEPOINT = 0x0001 229 SQLITE_CHANGESETSTART_INVERT = 0x0002 230 SQLITE_CHANGESET_ABORT = 2 231 SQLITE_CHANGESET_CONFLICT = 3 232 SQLITE_CHANGESET_CONSTRAINT = 4 233 SQLITE_CHANGESET_DATA = 1 234 SQLITE_CHANGESET_FOREIGN_KEY = 5 235 SQLITE_CHANGESET_NOTFOUND = 2 236 SQLITE_CHANGESET_OMIT = 0 237 SQLITE_CHANGESET_REPLACE = 1 238 SQLITE_CHECKPOINT_FULL = 1 239 SQLITE_CHECKPOINT_PASSIVE = 0 240 SQLITE_CHECKPOINT_RESTART = 2 241 SQLITE_CHECKPOINT_TRUNCATE = 3 242 SQLITE_CONFIG_COVERING_INDEX_SCAN = 20 243 SQLITE_CONFIG_GETMALLOC = 5 244 SQLITE_CONFIG_GETMUTEX = 11 245 SQLITE_CONFIG_GETPCACHE = 15 246 SQLITE_CONFIG_GETPCACHE2 = 19 247 SQLITE_CONFIG_HEAP = 8 248 SQLITE_CONFIG_LOG = 16 249 SQLITE_CONFIG_LOOKASIDE = 13 250 SQLITE_CONFIG_MALLOC = 4 251 SQLITE_CONFIG_MEMDB_MAXSIZE = 29 252 SQLITE_CONFIG_MEMSTATUS = 9 253 SQLITE_CONFIG_MMAP_SIZE = 22 254 SQLITE_CONFIG_MULTITHREAD = 2 255 SQLITE_CONFIG_MUTEX = 10 256 SQLITE_CONFIG_PAGECACHE = 7 257 SQLITE_CONFIG_PCACHE = 14 258 SQLITE_CONFIG_PCACHE2 = 18 259 SQLITE_CONFIG_PCACHE_HDRSZ = 24 260 SQLITE_CONFIG_PMASZ = 25 261 SQLITE_CONFIG_SCRATCH = 6 262 SQLITE_CONFIG_SERIALIZED = 3 263 SQLITE_CONFIG_SINGLETHREAD = 1 264 SQLITE_CONFIG_SMALL_MALLOC = 27 265 SQLITE_CONFIG_SORTERREF_SIZE = 28 266 SQLITE_CONFIG_SQLLOG = 21 267 SQLITE_CONFIG_STMTJRNL_SPILL = 26 268 SQLITE_CONFIG_URI = 17 269 SQLITE_CONFIG_WIN32_HEAPSIZE = 23 270 SQLITE_CONSTRAINT = 19 271 SQLITE_CONSTRAINT_CHECK = 275 272 SQLITE_CONSTRAINT_COMMITHOOK = 531 273 SQLITE_CONSTRAINT_FOREIGNKEY = 787 274 SQLITE_CONSTRAINT_FUNCTION = 1043 275 SQLITE_CONSTRAINT_NOTNULL = 1299 276 SQLITE_CONSTRAINT_PINNED = 2835 277 SQLITE_CONSTRAINT_PRIMARYKEY = 1555 278 SQLITE_CONSTRAINT_ROWID = 2579 279 SQLITE_CONSTRAINT_TRIGGER = 1811 280 SQLITE_CONSTRAINT_UNIQUE = 2067 281 SQLITE_CONSTRAINT_VTAB = 2323 282 SQLITE_COPY = 0 283 SQLITE_CORE = 1 284 SQLITE_CORRUPT = 11 285 SQLITE_CORRUPT_INDEX = 779 286 SQLITE_CORRUPT_SEQUENCE = 523 287 SQLITE_CORRUPT_VTAB = 267 288 SQLITE_CREATE_INDEX = 1 289 SQLITE_CREATE_TABLE = 2 290 SQLITE_CREATE_TEMP_INDEX = 3 291 SQLITE_CREATE_TEMP_TABLE = 4 292 SQLITE_CREATE_TEMP_TRIGGER = 5 293 SQLITE_CREATE_TEMP_VIEW = 6 294 SQLITE_CREATE_TRIGGER = 7 295 SQLITE_CREATE_VIEW = 8 296 SQLITE_CREATE_VTABLE = 29 297 SQLITE_DBCONFIG_DEFENSIVE = 1010 298 SQLITE_DBCONFIG_DQS_DDL = 1014 299 SQLITE_DBCONFIG_DQS_DML = 1013 300 SQLITE_DBCONFIG_ENABLE_FKEY = 1002 301 SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER = 1004 302 SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION = 1005 303 SQLITE_DBCONFIG_ENABLE_QPSG = 1007 304 SQLITE_DBCONFIG_ENABLE_TRIGGER = 1003 305 SQLITE_DBCONFIG_ENABLE_VIEW = 1015 306 SQLITE_DBCONFIG_LEGACY_ALTER_TABLE = 1012 307 SQLITE_DBCONFIG_LEGACY_FILE_FORMAT = 1016 308 SQLITE_DBCONFIG_LOOKASIDE = 1001 309 SQLITE_DBCONFIG_MAINDBNAME = 1000 310 SQLITE_DBCONFIG_MAX = 1017 311 SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE = 1006 312 SQLITE_DBCONFIG_RESET_DATABASE = 1009 313 SQLITE_DBCONFIG_TRIGGER_EQP = 1008 314 SQLITE_DBCONFIG_TRUSTED_SCHEMA = 1017 315 SQLITE_DBCONFIG_WRITABLE_SCHEMA = 1011 316 SQLITE_DBSTATUS_CACHE_HIT = 7 317 SQLITE_DBSTATUS_CACHE_MISS = 8 318 SQLITE_DBSTATUS_CACHE_SPILL = 12 319 SQLITE_DBSTATUS_CACHE_USED = 1 320 SQLITE_DBSTATUS_CACHE_USED_SHARED = 11 321 SQLITE_DBSTATUS_CACHE_WRITE = 9 322 SQLITE_DBSTATUS_DEFERRED_FKS = 10 323 SQLITE_DBSTATUS_LOOKASIDE_HIT = 4 324 SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL = 6 325 SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE = 5 326 SQLITE_DBSTATUS_LOOKASIDE_USED = 0 327 SQLITE_DBSTATUS_MAX = 12 328 SQLITE_DBSTATUS_SCHEMA_USED = 2 329 SQLITE_DBSTATUS_STMT_USED = 3 330 SQLITE_DELETE = 9 331 SQLITE_DENY = 1 332 SQLITE_DEPRECATED = 0 333 SQLITE_DESERIALIZE_FREEONCLOSE = 1 334 SQLITE_DESERIALIZE_READONLY = 4 335 SQLITE_DESERIALIZE_RESIZEABLE = 2 336 SQLITE_DETACH = 25 337 SQLITE_DETERMINISTIC = 0x000000800 338 SQLITE_DIRECTONLY = 0x000080000 339 SQLITE_DONE = 101 340 SQLITE_DROP_INDEX = 10 341 SQLITE_DROP_TABLE = 11 342 SQLITE_DROP_TEMP_INDEX = 12 343 SQLITE_DROP_TEMP_TABLE = 13 344 SQLITE_DROP_TEMP_TRIGGER = 14 345 SQLITE_DROP_TEMP_VIEW = 15 346 SQLITE_DROP_TRIGGER = 16 347 SQLITE_DROP_VIEW = 17 348 SQLITE_DROP_VTABLE = 30 349 SQLITE_EMPTY = 16 350 SQLITE_ENABLE_COLUMN_METADATA = 1 351 SQLITE_ENABLE_FTS5 = 1 352 SQLITE_ENABLE_GEOPOLY = 1 353 SQLITE_ENABLE_JSON1 = 1 354 SQLITE_ENABLE_MEMORY_MANAGEMENT = 1 355 SQLITE_ENABLE_OFFSET_SQL_FUNC = 1 356 SQLITE_ENABLE_PREUPDATE_HOOK = 1 357 SQLITE_ENABLE_RBU = 1 358 SQLITE_ENABLE_RTREE = 1 359 SQLITE_ENABLE_SESSION = 1 360 SQLITE_ENABLE_SNAPSHOT = 1 361 SQLITE_ENABLE_STAT4 = 1 362 SQLITE_ENABLE_UNLOCK_NOTIFY = 1 363 SQLITE_ERROR = 1 364 SQLITE_ERROR_MISSING_COLLSEQ = 257 365 SQLITE_ERROR_RETRY = 513 366 SQLITE_ERROR_SNAPSHOT = 769 367 SQLITE_EXPERIMENTAL = 0 368 SQLITE_FAIL = 3 369 SQLITE_FCNTL_BEGIN_ATOMIC_WRITE = 31 370 SQLITE_FCNTL_BUSYHANDLER = 15 371 SQLITE_FCNTL_CHUNK_SIZE = 6 372 SQLITE_FCNTL_CKPT_DONE = 37 373 SQLITE_FCNTL_CKPT_START = 39 374 SQLITE_FCNTL_CKSM_FILE = 41 375 SQLITE_FCNTL_COMMIT_ATOMIC_WRITE = 32 376 SQLITE_FCNTL_COMMIT_PHASETWO = 22 377 SQLITE_FCNTL_DATA_VERSION = 35 378 SQLITE_FCNTL_EXTERNAL_READER = 40 379 SQLITE_FCNTL_FILE_POINTER = 7 380 SQLITE_FCNTL_GET_LOCKPROXYFILE = 2 381 SQLITE_FCNTL_HAS_MOVED = 20 382 SQLITE_FCNTL_JOURNAL_POINTER = 28 383 SQLITE_FCNTL_LAST_ERRNO = 4 384 SQLITE_FCNTL_LOCKSTATE = 1 385 SQLITE_FCNTL_LOCK_TIMEOUT = 34 386 SQLITE_FCNTL_MMAP_SIZE = 18 387 SQLITE_FCNTL_OVERWRITE = 11 388 SQLITE_FCNTL_PDB = 30 389 SQLITE_FCNTL_PERSIST_WAL = 10 390 SQLITE_FCNTL_POWERSAFE_OVERWRITE = 13 391 SQLITE_FCNTL_PRAGMA = 14 392 SQLITE_FCNTL_RBU = 26 393 SQLITE_FCNTL_RESERVE_BYTES = 38 394 SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE = 33 395 SQLITE_FCNTL_SET_LOCKPROXYFILE = 3 396 SQLITE_FCNTL_SIZE_HINT = 5 397 SQLITE_FCNTL_SIZE_LIMIT = 36 398 SQLITE_FCNTL_SYNC = 21 399 SQLITE_FCNTL_SYNC_OMITTED = 8 400 SQLITE_FCNTL_TEMPFILENAME = 16 401 SQLITE_FCNTL_TRACE = 19 402 SQLITE_FCNTL_VFSNAME = 12 403 SQLITE_FCNTL_VFS_POINTER = 27 404 SQLITE_FCNTL_WAL_BLOCK = 24 405 SQLITE_FCNTL_WIN32_AV_RETRY = 9 406 SQLITE_FCNTL_WIN32_GET_HANDLE = 29 407 SQLITE_FCNTL_WIN32_SET_HANDLE = 23 408 SQLITE_FCNTL_ZIPVFS = 25 409 SQLITE_FLOAT = 2 410 SQLITE_FORMAT = 24 411 SQLITE_FULL = 13 412 SQLITE_FUNCTION = 31 413 SQLITE_GET_LOCKPROXYFILE = 2 414 SQLITE_IGNORE = 2 415 SQLITE_INDEX_CONSTRAINT_EQ = 2 416 SQLITE_INDEX_CONSTRAINT_FUNCTION = 150 417 SQLITE_INDEX_CONSTRAINT_GE = 32 418 SQLITE_INDEX_CONSTRAINT_GLOB = 66 419 SQLITE_INDEX_CONSTRAINT_GT = 4 420 SQLITE_INDEX_CONSTRAINT_IS = 72 421 SQLITE_INDEX_CONSTRAINT_ISNOT = 69 422 SQLITE_INDEX_CONSTRAINT_ISNOTNULL = 70 423 SQLITE_INDEX_CONSTRAINT_ISNULL = 71 424 SQLITE_INDEX_CONSTRAINT_LE = 8 425 SQLITE_INDEX_CONSTRAINT_LIKE = 65 426 SQLITE_INDEX_CONSTRAINT_LT = 16 427 SQLITE_INDEX_CONSTRAINT_MATCH = 64 428 SQLITE_INDEX_CONSTRAINT_NE = 68 429 SQLITE_INDEX_CONSTRAINT_REGEXP = 67 430 SQLITE_INDEX_SCAN_UNIQUE = 1 431 SQLITE_INNOCUOUS = 0x000200000 432 SQLITE_INSERT = 18 433 SQLITE_INTEGER = 1 434 SQLITE_INTERNAL = 2 435 SQLITE_INTERRUPT = 9 436 SQLITE_IOCAP_ATOMIC = 0x00000001 437 SQLITE_IOCAP_ATOMIC16K = 0x00000040 438 SQLITE_IOCAP_ATOMIC1K = 0x00000004 439 SQLITE_IOCAP_ATOMIC2K = 0x00000008 440 SQLITE_IOCAP_ATOMIC32K = 0x00000080 441 SQLITE_IOCAP_ATOMIC4K = 0x00000010 442 SQLITE_IOCAP_ATOMIC512 = 0x00000002 443 SQLITE_IOCAP_ATOMIC64K = 0x00000100 444 SQLITE_IOCAP_ATOMIC8K = 0x00000020 445 SQLITE_IOCAP_BATCH_ATOMIC = 0x00004000 446 SQLITE_IOCAP_IMMUTABLE = 0x00002000 447 SQLITE_IOCAP_POWERSAFE_OVERWRITE = 0x00001000 448 SQLITE_IOCAP_SAFE_APPEND = 0x00000200 449 SQLITE_IOCAP_SEQUENTIAL = 0x00000400 450 SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN = 0x00000800 451 SQLITE_IOERR = 10 452 SQLITE_IOERR_ACCESS = 3338 453 SQLITE_IOERR_AUTH = 7178 454 SQLITE_IOERR_BEGIN_ATOMIC = 7434 455 SQLITE_IOERR_BLOCKED = 2826 456 SQLITE_IOERR_CHECKRESERVEDLOCK = 3594 457 SQLITE_IOERR_CLOSE = 4106 458 SQLITE_IOERR_COMMIT_ATOMIC = 7690 459 SQLITE_IOERR_CONVPATH = 6666 460 SQLITE_IOERR_CORRUPTFS = 8458 461 SQLITE_IOERR_DATA = 8202 462 SQLITE_IOERR_DELETE = 2570 463 SQLITE_IOERR_DELETE_NOENT = 5898 464 SQLITE_IOERR_DIR_CLOSE = 4362 465 SQLITE_IOERR_DIR_FSYNC = 1290 466 SQLITE_IOERR_FSTAT = 1802 467 SQLITE_IOERR_FSYNC = 1034 468 SQLITE_IOERR_GETTEMPPATH = 6410 469 SQLITE_IOERR_LOCK = 3850 470 SQLITE_IOERR_MMAP = 6154 471 SQLITE_IOERR_NOMEM = 3082 472 SQLITE_IOERR_RDLOCK = 2314 473 SQLITE_IOERR_READ = 266 474 SQLITE_IOERR_ROLLBACK_ATOMIC = 7946 475 SQLITE_IOERR_SEEK = 5642 476 SQLITE_IOERR_SHMLOCK = 5130 477 SQLITE_IOERR_SHMMAP = 5386 478 SQLITE_IOERR_SHMOPEN = 4618 479 SQLITE_IOERR_SHMSIZE = 4874 480 SQLITE_IOERR_SHORT_READ = 522 481 SQLITE_IOERR_TRUNCATE = 1546 482 SQLITE_IOERR_UNLOCK = 2058 483 SQLITE_IOERR_VNODE = 6922 484 SQLITE_IOERR_WRITE = 778 485 SQLITE_LAST_ERRNO = 4 486 SQLITE_LIKE_DOESNT_MATCH_BLOBS = 1 487 SQLITE_LIMIT_ATTACHED = 7 488 SQLITE_LIMIT_COLUMN = 2 489 SQLITE_LIMIT_COMPOUND_SELECT = 4 490 SQLITE_LIMIT_EXPR_DEPTH = 3 491 SQLITE_LIMIT_FUNCTION_ARG = 6 492 SQLITE_LIMIT_LENGTH = 0 493 SQLITE_LIMIT_LIKE_PATTERN_LENGTH = 8 494 SQLITE_LIMIT_SQL_LENGTH = 1 495 SQLITE_LIMIT_TRIGGER_DEPTH = 10 496 SQLITE_LIMIT_VARIABLE_NUMBER = 9 497 SQLITE_LIMIT_VDBE_OP = 5 498 SQLITE_LIMIT_WORKER_THREADS = 11 499 SQLITE_LOCKED = 6 500 SQLITE_LOCKED_SHAREDCACHE = 262 501 SQLITE_LOCKED_VTAB = 518 502 SQLITE_LOCK_EXCLUSIVE = 4 503 SQLITE_LOCK_NONE = 0 504 SQLITE_LOCK_PENDING = 3 505 SQLITE_LOCK_RESERVED = 2 506 SQLITE_LOCK_SHARED = 1 507 SQLITE_MISMATCH = 20 508 SQLITE_MISUSE = 21 509 SQLITE_MUTEX_APPDEF = 1 510 SQLITE_MUTEX_FAST = 0 511 SQLITE_MUTEX_NOOP = 1 512 SQLITE_MUTEX_RECURSIVE = 1 513 SQLITE_MUTEX_STATIC_APP1 = 8 514 SQLITE_MUTEX_STATIC_APP2 = 9 515 SQLITE_MUTEX_STATIC_APP3 = 10 516 SQLITE_MUTEX_STATIC_LRU = 6 517 SQLITE_MUTEX_STATIC_LRU2 = 7 518 SQLITE_MUTEX_STATIC_MAIN = 2 519 SQLITE_MUTEX_STATIC_MASTER = 2 520 SQLITE_MUTEX_STATIC_MEM = 3 521 SQLITE_MUTEX_STATIC_MEM2 = 4 522 SQLITE_MUTEX_STATIC_OPEN = 4 523 SQLITE_MUTEX_STATIC_PMEM = 7 524 SQLITE_MUTEX_STATIC_PRNG = 5 525 SQLITE_MUTEX_STATIC_VFS1 = 11 526 SQLITE_MUTEX_STATIC_VFS2 = 12 527 SQLITE_MUTEX_STATIC_VFS3 = 13 528 SQLITE_NOLFS = 22 529 SQLITE_NOMEM = 7 530 SQLITE_NOTADB = 26 531 SQLITE_NOTFOUND = 12 532 SQLITE_NOTICE = 27 533 SQLITE_NOTICE_RECOVER_ROLLBACK = 539 534 SQLITE_NOTICE_RECOVER_WAL = 283 535 SQLITE_NULL = 5 536 SQLITE_OK = 0 537 SQLITE_OK_LOAD_PERMANENTLY = 256 538 SQLITE_OK_SYMLINK = 512 539 SQLITE_OPEN_AUTOPROXY = 0x00000020 540 SQLITE_OPEN_CREATE = 0x00000004 541 SQLITE_OPEN_DELETEONCLOSE = 0x00000008 542 SQLITE_OPEN_EXCLUSIVE = 0x00000010 543 SQLITE_OPEN_FULLMUTEX = 0x00010000 544 SQLITE_OPEN_MAIN_DB = 0x00000100 545 SQLITE_OPEN_MAIN_JOURNAL = 0x00000800 546 SQLITE_OPEN_MASTER_JOURNAL = 0x00004000 547 SQLITE_OPEN_MEMORY = 0x00000080 548 SQLITE_OPEN_NOFOLLOW = 0x01000000 549 SQLITE_OPEN_NOMUTEX = 0x00008000 550 SQLITE_OPEN_PRIVATECACHE = 0x00040000 551 SQLITE_OPEN_READONLY = 0x00000001 552 SQLITE_OPEN_READWRITE = 0x00000002 553 SQLITE_OPEN_SHAREDCACHE = 0x00020000 554 SQLITE_OPEN_SUBJOURNAL = 0x00002000 555 SQLITE_OPEN_SUPER_JOURNAL = 0x00004000 556 SQLITE_OPEN_TEMP_DB = 0x00000200 557 SQLITE_OPEN_TEMP_JOURNAL = 0x00001000 558 SQLITE_OPEN_TRANSIENT_DB = 0x00000400 559 SQLITE_OPEN_URI = 0x00000040 560 SQLITE_OPEN_WAL = 0x00080000 561 SQLITE_OS_UNIX = 1 562 SQLITE_PERM = 3 563 SQLITE_PRAGMA = 19 564 SQLITE_PREPARE_NORMALIZE = 0x02 565 SQLITE_PREPARE_NO_VTAB = 0x04 566 SQLITE_PREPARE_PERSISTENT = 0x01 567 SQLITE_PROTOCOL = 15 568 SQLITE_RANGE = 25 569 SQLITE_READ = 20 570 SQLITE_READONLY = 8 571 SQLITE_READONLY_CANTINIT = 1288 572 SQLITE_READONLY_CANTLOCK = 520 573 SQLITE_READONLY_DBMOVED = 1032 574 SQLITE_READONLY_DIRECTORY = 1544 575 SQLITE_READONLY_RECOVERY = 264 576 SQLITE_READONLY_ROLLBACK = 776 577 SQLITE_RECURSIVE = 33 578 SQLITE_REINDEX = 27 579 SQLITE_REPLACE = 5 580 SQLITE_ROLLBACK = 1 581 SQLITE_ROW = 100 582 SQLITE_SAVEPOINT = 32 583 SQLITE_SCANSTAT_EST = 2 584 SQLITE_SCANSTAT_EXPLAIN = 4 585 SQLITE_SCANSTAT_NAME = 3 586 SQLITE_SCANSTAT_NLOOP = 0 587 SQLITE_SCANSTAT_NVISIT = 1 588 SQLITE_SCANSTAT_SELECTID = 5 589 SQLITE_SCHEMA = 17 590 SQLITE_SELECT = 21 591 SQLITE_SERIALIZE_NOCOPY = 0x001 592 SQLITE_SESSION_CONFIG_STRMSIZE = 1 593 SQLITE_SESSION_OBJCONFIG_SIZE = 1 594 SQLITE_SET_LOCKPROXYFILE = 3 595 SQLITE_SHM_EXCLUSIVE = 8 596 SQLITE_SHM_LOCK = 2 597 SQLITE_SHM_NLOCK = 8 598 SQLITE_SHM_SHARED = 4 599 SQLITE_SHM_UNLOCK = 1 600 SQLITE_SOUNDEX = 1 601 SQLITE_SOURCE_ID = "2021-06-18 18:36:39 5c9a6c06871cb9fe42814af9c039eb6da5427a6ec28f187af7ebfb62eafa66e5" 602 SQLITE_STATUS_MALLOC_COUNT = 9 603 SQLITE_STATUS_MALLOC_SIZE = 5 604 SQLITE_STATUS_MEMORY_USED = 0 605 SQLITE_STATUS_PAGECACHE_OVERFLOW = 2 606 SQLITE_STATUS_PAGECACHE_SIZE = 7 607 SQLITE_STATUS_PAGECACHE_USED = 1 608 SQLITE_STATUS_PARSER_STACK = 6 609 SQLITE_STATUS_SCRATCH_OVERFLOW = 4 610 SQLITE_STATUS_SCRATCH_SIZE = 8 611 SQLITE_STATUS_SCRATCH_USED = 3 612 SQLITE_STDCALL = 0 613 SQLITE_STMTSTATUS_AUTOINDEX = 3 614 SQLITE_STMTSTATUS_FULLSCAN_STEP = 1 615 SQLITE_STMTSTATUS_MEMUSED = 99 616 SQLITE_STMTSTATUS_REPREPARE = 5 617 SQLITE_STMTSTATUS_RUN = 6 618 SQLITE_STMTSTATUS_SORT = 2 619 SQLITE_STMTSTATUS_VM_STEP = 4 620 SQLITE_SUBTYPE = 0x000100000 621 SQLITE_SYNC_DATAONLY = 0x00010 622 SQLITE_SYNC_FULL = 0x00003 623 SQLITE_SYNC_NORMAL = 0x00002 624 SQLITE_SYSAPI = 0 625 SQLITE_TESTCTRL_ALWAYS = 13 626 SQLITE_TESTCTRL_ASSERT = 12 627 SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS = 10 628 SQLITE_TESTCTRL_BITVEC_TEST = 8 629 SQLITE_TESTCTRL_BYTEORDER = 22 630 SQLITE_TESTCTRL_EXPLAIN_STMT = 19 631 SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS = 29 632 SQLITE_TESTCTRL_FAULT_INSTALL = 9 633 SQLITE_TESTCTRL_FIRST = 5 634 SQLITE_TESTCTRL_IMPOSTER = 25 635 SQLITE_TESTCTRL_INTERNAL_FUNCTIONS = 17 636 SQLITE_TESTCTRL_ISINIT = 23 637 SQLITE_TESTCTRL_ISKEYWORD = 16 638 SQLITE_TESTCTRL_LAST = 32 639 SQLITE_TESTCTRL_LOCALTIME_FAULT = 18 640 SQLITE_TESTCTRL_NEVER_CORRUPT = 20 641 SQLITE_TESTCTRL_ONCE_RESET_THRESHOLD = 19 642 SQLITE_TESTCTRL_OPTIMIZATIONS = 15 643 SQLITE_TESTCTRL_PARSER_COVERAGE = 26 644 SQLITE_TESTCTRL_PENDING_BYTE = 11 645 SQLITE_TESTCTRL_PRNG_RESET = 7 646 SQLITE_TESTCTRL_PRNG_RESTORE = 6 647 SQLITE_TESTCTRL_PRNG_SAVE = 5 648 SQLITE_TESTCTRL_PRNG_SEED = 28 649 SQLITE_TESTCTRL_RESERVE = 14 650 SQLITE_TESTCTRL_RESULT_INTREAL = 27 651 SQLITE_TESTCTRL_SCRATCHMALLOC = 17 652 SQLITE_TESTCTRL_SEEK_COUNT = 30 653 SQLITE_TESTCTRL_SORTER_MMAP = 24 654 SQLITE_TESTCTRL_TRACEFLAGS = 31 655 SQLITE_TESTCTRL_TUNE = 32 656 SQLITE_TESTCTRL_VDBE_COVERAGE = 21 657 SQLITE_TEXT = 3 658 SQLITE_THREADSAFE = 1 659 SQLITE_TOOBIG = 18 660 SQLITE_TRACE_CLOSE = 0x08 661 SQLITE_TRACE_PROFILE = 0x02 662 SQLITE_TRACE_ROW = 0x04 663 SQLITE_TRACE_STMT = 0x01 664 SQLITE_TRANSACTION = 22 665 SQLITE_TXN_NONE = 0 666 SQLITE_TXN_READ = 1 667 SQLITE_TXN_WRITE = 2 668 SQLITE_UPDATE = 23 669 SQLITE_UTF16 = 4 670 SQLITE_UTF16BE = 3 671 SQLITE_UTF16LE = 2 672 SQLITE_UTF16_ALIGNED = 8 673 SQLITE_UTF8 = 1 674 SQLITE_VERSION = "3.36.0" 675 SQLITE_VERSION_NUMBER = 3036000 676 SQLITE_VTAB_CONSTRAINT_SUPPORT = 1 677 SQLITE_VTAB_DIRECTONLY = 3 678 SQLITE_VTAB_INNOCUOUS = 2 679 SQLITE_WARNING = 28 680 SQLITE_WARNING_AUTOINDEX = 284 681 SQLITE_WIN32_DATA_DIRECTORY_TYPE = 1 682 SQLITE_WIN32_TEMP_DIRECTORY_TYPE = 2 683 STDERR_FILENO = 2 684 STDIN_FILENO = 0 685 STDOUT_FILENO = 1 686 TMP_MAX = 238328 687 WCONTINUED = 8 688 WEXITED = 4 689 WNOHANG = 1 690 WNOWAIT = 0x01000000 691 WSTOPPED = 2 692 WUNTRACED = 2 693 W_OK = 2 694 X_OK = 1 695 X_ALLOCA_H = 1 696 X_ANSI_STDARG_H_ = 0 697 X_ASM_GENERIC_ERRNO_BASE_H = 0 698 X_ASM_GENERIC_ERRNO_H = 0 699 X_ASSERT_H = 1 700 X_ATFILE_SOURCE = 1 701 X_BITS_BYTESWAP_H = 1 702 X_BITS_ERRNO_H = 1 703 X_BITS_FLOATN_COMMON_H = 0 704 X_BITS_FLOATN_H = 0 705 X_BITS_POSIX_OPT_H = 1 706 X_BITS_PTHREADTYPES_ARCH_H = 1 707 X_BITS_PTHREADTYPES_COMMON_H = 1 708 X_BITS_STDINT_INTN_H = 1 709 X_BITS_STDIO_LIM_H = 1 710 X_BITS_TYPESIZES_H = 1 711 X_BITS_TYPES_H = 1 712 X_BITS_TYPES_LOCALE_T_H = 1 713 X_BITS_TYPES___LOCALE_T_H = 1 714 X_BITS_UINTN_IDENTITY_H = 1 715 X_BSD_SIZE_T_ = 0 716 X_BSD_SIZE_T_DEFINED_ = 0 717 X_CTYPE_H = 1 718 X_DEFAULT_SOURCE = 1 719 X_ENDIAN_H = 1 720 X_ERRNO_H = 1 721 X_FEATURES_H = 1 722 X_FILE_OFFSET_BITS = 64 723 X_FTS5_H = 0 724 X_GCC_SIZE_T = 0 725 X_GCC_WCHAR_T = 0 726 X_GETOPT_CORE_H = 1 727 X_GETOPT_POSIX_H = 1 728 X_IOFBF = 0 729 X_IOLBF = 1 730 X_IONBF = 2 731 X_IO_EOF_SEEN = 0x0010 732 X_IO_ERR_SEEN = 0x0020 733 X_IO_USER_LOCK = 0x8000 734 X_LFS64_ASYNCHRONOUS_IO = 1 735 X_LFS64_LARGEFILE = 1 736 X_LFS64_STDIO = 1 737 X_LFS_ASYNCHRONOUS_IO = 1 738 X_LFS_LARGEFILE = 1 739 X_POSIX2_CHAR_TERM = 200809 740 X_POSIX2_C_BIND = 200809 741 X_POSIX2_C_DEV = 200809 742 X_POSIX2_C_VERSION = 200809 743 X_POSIX2_LOCALEDEF = 200809 744 X_POSIX2_SW_DEV = 200809 745 X_POSIX2_VERSION = 200809 746 X_POSIX_ADVISORY_INFO = 200809 747 X_POSIX_ASYNCHRONOUS_IO = 200809 748 X_POSIX_ASYNC_IO = 1 749 X_POSIX_BARRIERS = 200809 750 X_POSIX_CHOWN_RESTRICTED = 0 751 X_POSIX_CLOCK_SELECTION = 200809 752 X_POSIX_CPUTIME = 0 753 X_POSIX_C_SOURCE = 200809 754 X_POSIX_FSYNC = 200809 755 X_POSIX_IPV6 = 200809 756 X_POSIX_JOB_CONTROL = 1 757 X_POSIX_MAPPED_FILES = 200809 758 X_POSIX_MEMLOCK = 200809 759 X_POSIX_MEMLOCK_RANGE = 200809 760 X_POSIX_MEMORY_PROTECTION = 200809 761 X_POSIX_MESSAGE_PASSING = 200809 762 X_POSIX_MONOTONIC_CLOCK = 0 763 X_POSIX_NO_TRUNC = 1 764 X_POSIX_PRIORITIZED_IO = 200809 765 X_POSIX_PRIORITY_SCHEDULING = 200809 766 X_POSIX_RAW_SOCKETS = 200809 767 X_POSIX_READER_WRITER_LOCKS = 200809 768 X_POSIX_REALTIME_SIGNALS = 200809 769 X_POSIX_REENTRANT_FUNCTIONS = 1 770 X_POSIX_REGEXP = 1 771 X_POSIX_SAVED_IDS = 1 772 X_POSIX_SEMAPHORES = 200809 773 X_POSIX_SHARED_MEMORY_OBJECTS = 200809 774 X_POSIX_SHELL = 1 775 X_POSIX_SOURCE = 1 776 X_POSIX_SPAWN = 200809 777 X_POSIX_SPIN_LOCKS = 200809 778 X_POSIX_SPORADIC_SERVER = -1 779 X_POSIX_SYNCHRONIZED_IO = 200809 780 X_POSIX_THREADS = 200809 781 X_POSIX_THREAD_ATTR_STACKADDR = 200809 782 X_POSIX_THREAD_ATTR_STACKSIZE = 200809 783 X_POSIX_THREAD_CPUTIME = 0 784 X_POSIX_THREAD_PRIORITY_SCHEDULING = 200809 785 X_POSIX_THREAD_PRIO_INHERIT = 200809 786 X_POSIX_THREAD_PRIO_PROTECT = 200809 787 X_POSIX_THREAD_PROCESS_SHARED = 200809 788 X_POSIX_THREAD_ROBUST_PRIO_INHERIT = 200809 789 X_POSIX_THREAD_ROBUST_PRIO_PROTECT = -1 790 X_POSIX_THREAD_SAFE_FUNCTIONS = 200809 791 X_POSIX_THREAD_SPORADIC_SERVER = -1 792 X_POSIX_TIMEOUTS = 200809 793 X_POSIX_TIMERS = 200809 794 X_POSIX_TRACE = -1 795 X_POSIX_TRACE_EVENT_FILTER = -1 796 X_POSIX_TRACE_INHERIT = -1 797 X_POSIX_TRACE_LOG = -1 798 X_POSIX_TYPED_MEMORY_OBJECTS = -1 799 X_POSIX_V6_ILP32_OFF32 = 1 800 X_POSIX_V6_ILP32_OFFBIG = 1 801 X_POSIX_V7_ILP32_OFF32 = 1 802 X_POSIX_V7_ILP32_OFFBIG = 1 803 X_POSIX_VDISABLE = 0 804 X_POSIX_VERSION = 200809 805 X_SIZET_ = 0 806 X_SIZE_T = 0 807 X_SIZE_T_ = 0 808 X_SIZE_T_DECLARED = 0 809 X_SIZE_T_DEFINED = 0 810 X_SIZE_T_DEFINED_ = 0 811 X_SQLITE3RTREE_H_ = 0 812 X_STDARG_H = 0 813 X_STDC_PREDEF_H = 1 814 X_STDIO_H = 1 815 X_STDLIB_H = 1 816 X_STRINGS_H = 1 817 X_STRING_H = 1 818 X_STRUCT_TIMESPEC = 1 819 X_SYS_CDEFS_H = 1 820 X_SYS_SELECT_H = 1 821 X_SYS_SIZE_T_H = 0 822 X_SYS_TYPES_H = 1 823 X_THREAD_SHARED_TYPES_H = 1 824 X_T_SIZE = 0 825 X_T_SIZE_ = 0 826 X_T_WCHAR = 0 827 X_T_WCHAR_ = 0 828 X_UNISTD_H = 1 829 X_VA_LIST = 0 830 X_VA_LIST_ = 0 831 X_VA_LIST_DEFINED = 0 832 X_VA_LIST_T_H = 0 833 X_WCHAR_T = 0 834 X_WCHAR_T_ = 0 835 X_WCHAR_T_DECLARED = 0 836 X_WCHAR_T_DEFINED = 0 837 X_WCHAR_T_DEFINED_ = 0 838 X_WCHAR_T_H = 0 839 X_XBS5_ILP32_OFF32 = 1 840 X_XBS5_ILP32_OFFBIG = 1 841 X_XOPEN_ENH_I18N = 1 842 X_XOPEN_LEGACY = 1 843 X_XOPEN_REALTIME = 1 844 X_XOPEN_REALTIME_THREADS = 1 845 X_XOPEN_SHM = 1 846 X_XOPEN_UNIX = 1 847 X_XOPEN_VERSION = 700 848 X_XOPEN_XCU_VERSION = 4 849 X_XOPEN_XPG2 = 1 850 X_XOPEN_XPG3 = 1 851 X_XOPEN_XPG4 = 1 852 I386 = 1 853 Linux = 1 854 Unix = 1 855 ) 856 857 // Get the `_PC_*' symbols for the NAME argument to `pathconf' and `fpathconf'; 858 // the `_SC_*' symbols for the NAME argument to `sysconf'; 859 // and the `_CS_*' symbols for the NAME argument to `confstr'. 860 // `sysconf', `pathconf', and `confstr' NAME values. Generic version. 861 // Copyright (C) 1993-2018 Free Software Foundation, Inc. 862 // This file is part of the GNU C Library. 863 // 864 // The GNU C Library is free software; you can redistribute it and/or 865 // modify it under the terms of the GNU Lesser General Public 866 // License as published by the Free Software Foundation; either 867 // version 2.1 of the License, or (at your option) any later version. 868 // 869 // The GNU C Library is distributed in the hope that it will be useful, 870 // but WITHOUT ANY WARRANTY; without even the implied warranty of 871 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 872 // Lesser General Public License for more details. 873 // 874 // You should have received a copy of the GNU Lesser General Public 875 // License along with the GNU C Library; if not, see 876 // <http://www.gnu.org/licenses/>. 877 878 // Values for the NAME argument to `pathconf' and `fpathconf'. 879 const ( /* confname.h:24:1: */ 880 _PC_LINK_MAX = 0 881 _PC_MAX_CANON = 1 882 _PC_MAX_INPUT = 2 883 _PC_NAME_MAX = 3 884 _PC_PATH_MAX = 4 885 _PC_PIPE_BUF = 5 886 _PC_CHOWN_RESTRICTED = 6 887 _PC_NO_TRUNC = 7 888 _PC_VDISABLE = 8 889 _PC_SYNC_IO = 9 890 _PC_ASYNC_IO = 10 891 _PC_PRIO_IO = 11 892 _PC_SOCK_MAXBUF = 12 893 _PC_FILESIZEBITS = 13 894 _PC_REC_INCR_XFER_SIZE = 14 895 _PC_REC_MAX_XFER_SIZE = 15 896 _PC_REC_MIN_XFER_SIZE = 16 897 _PC_REC_XFER_ALIGN = 17 898 _PC_ALLOC_SIZE_MIN = 18 899 _PC_SYMLINK_MAX = 19 900 _PC_2_SYMLINKS = 20 901 ) 902 903 // Values for the NAME argument to `confstr'. 904 const ( /* confname.h:533:1: */ 905 _CS_PATH = 0 // The default search path. 906 907 _CS_V6_WIDTH_RESTRICTED_ENVS = 1 908 909 _CS_GNU_LIBC_VERSION = 2 910 _CS_GNU_LIBPTHREAD_VERSION = 3 911 912 _CS_V5_WIDTH_RESTRICTED_ENVS = 4 913 914 _CS_V7_WIDTH_RESTRICTED_ENVS = 5 915 916 _CS_LFS_CFLAGS = 1000 917 _CS_LFS_LDFLAGS = 1001 918 _CS_LFS_LIBS = 1002 919 _CS_LFS_LINTFLAGS = 1003 920 _CS_LFS64_CFLAGS = 1004 921 _CS_LFS64_LDFLAGS = 1005 922 _CS_LFS64_LIBS = 1006 923 _CS_LFS64_LINTFLAGS = 1007 924 925 _CS_XBS5_ILP32_OFF32_CFLAGS = 1100 926 _CS_XBS5_ILP32_OFF32_LDFLAGS = 1101 927 _CS_XBS5_ILP32_OFF32_LIBS = 1102 928 _CS_XBS5_ILP32_OFF32_LINTFLAGS = 1103 929 _CS_XBS5_ILP32_OFFBIG_CFLAGS = 1104 930 _CS_XBS5_ILP32_OFFBIG_LDFLAGS = 1105 931 _CS_XBS5_ILP32_OFFBIG_LIBS = 1106 932 _CS_XBS5_ILP32_OFFBIG_LINTFLAGS = 1107 933 _CS_XBS5_LP64_OFF64_CFLAGS = 1108 934 _CS_XBS5_LP64_OFF64_LDFLAGS = 1109 935 _CS_XBS5_LP64_OFF64_LIBS = 1110 936 _CS_XBS5_LP64_OFF64_LINTFLAGS = 1111 937 _CS_XBS5_LPBIG_OFFBIG_CFLAGS = 1112 938 _CS_XBS5_LPBIG_OFFBIG_LDFLAGS = 1113 939 _CS_XBS5_LPBIG_OFFBIG_LIBS = 1114 940 _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS = 1115 941 942 _CS_POSIX_V6_ILP32_OFF32_CFLAGS = 1116 943 _CS_POSIX_V6_ILP32_OFF32_LDFLAGS = 1117 944 _CS_POSIX_V6_ILP32_OFF32_LIBS = 1118 945 _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS = 1119 946 _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS = 1120 947 _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS = 1121 948 _CS_POSIX_V6_ILP32_OFFBIG_LIBS = 1122 949 _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS = 1123 950 _CS_POSIX_V6_LP64_OFF64_CFLAGS = 1124 951 _CS_POSIX_V6_LP64_OFF64_LDFLAGS = 1125 952 _CS_POSIX_V6_LP64_OFF64_LIBS = 1126 953 _CS_POSIX_V6_LP64_OFF64_LINTFLAGS = 1127 954 _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS = 1128 955 _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS = 1129 956 _CS_POSIX_V6_LPBIG_OFFBIG_LIBS = 1130 957 _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS = 1131 958 959 _CS_POSIX_V7_ILP32_OFF32_CFLAGS = 1132 960 _CS_POSIX_V7_ILP32_OFF32_LDFLAGS = 1133 961 _CS_POSIX_V7_ILP32_OFF32_LIBS = 1134 962 _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS = 1135 963 _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS = 1136 964 _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS = 1137 965 _CS_POSIX_V7_ILP32_OFFBIG_LIBS = 1138 966 _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS = 1139 967 _CS_POSIX_V7_LP64_OFF64_CFLAGS = 1140 968 _CS_POSIX_V7_LP64_OFF64_LDFLAGS = 1141 969 _CS_POSIX_V7_LP64_OFF64_LIBS = 1142 970 _CS_POSIX_V7_LP64_OFF64_LINTFLAGS = 1143 971 _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS = 1144 972 _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS = 1145 973 _CS_POSIX_V7_LPBIG_OFFBIG_LIBS = 1146 974 _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS = 1147 975 976 _CS_V6_ENV = 1148 977 _CS_V7_ENV = 1149 978 ) 979 980 // Values for the argument to `sysconf'. 981 const ( /* confname.h:71:1: */ 982 _SC_ARG_MAX = 0 983 _SC_CHILD_MAX = 1 984 _SC_CLK_TCK = 2 985 _SC_NGROUPS_MAX = 3 986 _SC_OPEN_MAX = 4 987 _SC_STREAM_MAX = 5 988 _SC_TZNAME_MAX = 6 989 _SC_JOB_CONTROL = 7 990 _SC_SAVED_IDS = 8 991 _SC_REALTIME_SIGNALS = 9 992 _SC_PRIORITY_SCHEDULING = 10 993 _SC_TIMERS = 11 994 _SC_ASYNCHRONOUS_IO = 12 995 _SC_PRIORITIZED_IO = 13 996 _SC_SYNCHRONIZED_IO = 14 997 _SC_FSYNC = 15 998 _SC_MAPPED_FILES = 16 999 _SC_MEMLOCK = 17 1000 _SC_MEMLOCK_RANGE = 18 1001 _SC_MEMORY_PROTECTION = 19 1002 _SC_MESSAGE_PASSING = 20 1003 _SC_SEMAPHORES = 21 1004 _SC_SHARED_MEMORY_OBJECTS = 22 1005 _SC_AIO_LISTIO_MAX = 23 1006 _SC_AIO_MAX = 24 1007 _SC_AIO_PRIO_DELTA_MAX = 25 1008 _SC_DELAYTIMER_MAX = 26 1009 _SC_MQ_OPEN_MAX = 27 1010 _SC_MQ_PRIO_MAX = 28 1011 _SC_VERSION = 29 1012 _SC_PAGESIZE = 30 1013 _SC_RTSIG_MAX = 31 1014 _SC_SEM_NSEMS_MAX = 32 1015 _SC_SEM_VALUE_MAX = 33 1016 _SC_SIGQUEUE_MAX = 34 1017 _SC_TIMER_MAX = 35 1018 1019 // Values for the argument to `sysconf' 1020 // corresponding to _POSIX2_* symbols. 1021 _SC_BC_BASE_MAX = 36 1022 _SC_BC_DIM_MAX = 37 1023 _SC_BC_SCALE_MAX = 38 1024 _SC_BC_STRING_MAX = 39 1025 _SC_COLL_WEIGHTS_MAX = 40 1026 _SC_EQUIV_CLASS_MAX = 41 1027 _SC_EXPR_NEST_MAX = 42 1028 _SC_LINE_MAX = 43 1029 _SC_RE_DUP_MAX = 44 1030 _SC_CHARCLASS_NAME_MAX = 45 1031 1032 _SC_2_VERSION = 46 1033 _SC_2_C_BIND = 47 1034 _SC_2_C_DEV = 48 1035 _SC_2_FORT_DEV = 49 1036 _SC_2_FORT_RUN = 50 1037 _SC_2_SW_DEV = 51 1038 _SC_2_LOCALEDEF = 52 1039 1040 _SC_PII = 53 1041 _SC_PII_XTI = 54 1042 _SC_PII_SOCKET = 55 1043 _SC_PII_INTERNET = 56 1044 _SC_PII_OSI = 57 1045 _SC_POLL = 58 1046 _SC_SELECT = 59 1047 _SC_UIO_MAXIOV = 60 1048 _SC_IOV_MAX = 60 1049 _SC_PII_INTERNET_STREAM = 61 1050 _SC_PII_INTERNET_DGRAM = 62 1051 _SC_PII_OSI_COTS = 63 1052 _SC_PII_OSI_CLTS = 64 1053 _SC_PII_OSI_M = 65 1054 _SC_T_IOV_MAX = 66 1055 1056 // Values according to POSIX 1003.1c (POSIX threads). 1057 _SC_THREADS = 67 1058 _SC_THREAD_SAFE_FUNCTIONS = 68 1059 _SC_GETGR_R_SIZE_MAX = 69 1060 _SC_GETPW_R_SIZE_MAX = 70 1061 _SC_LOGIN_NAME_MAX = 71 1062 _SC_TTY_NAME_MAX = 72 1063 _SC_THREAD_DESTRUCTOR_ITERATIONS = 73 1064 _SC_THREAD_KEYS_MAX = 74 1065 _SC_THREAD_STACK_MIN = 75 1066 _SC_THREAD_THREADS_MAX = 76 1067 _SC_THREAD_ATTR_STACKADDR = 77 1068 _SC_THREAD_ATTR_STACKSIZE = 78 1069 _SC_THREAD_PRIORITY_SCHEDULING = 79 1070 _SC_THREAD_PRIO_INHERIT = 80 1071 _SC_THREAD_PRIO_PROTECT = 81 1072 _SC_THREAD_PROCESS_SHARED = 82 1073 1074 _SC_NPROCESSORS_CONF = 83 1075 _SC_NPROCESSORS_ONLN = 84 1076 _SC_PHYS_PAGES = 85 1077 _SC_AVPHYS_PAGES = 86 1078 _SC_ATEXIT_MAX = 87 1079 _SC_PASS_MAX = 88 1080 1081 _SC_XOPEN_VERSION = 89 1082 _SC_XOPEN_XCU_VERSION = 90 1083 _SC_XOPEN_UNIX = 91 1084 _SC_XOPEN_CRYPT = 92 1085 _SC_XOPEN_ENH_I18N = 93 1086 _SC_XOPEN_SHM = 94 1087 1088 _SC_2_CHAR_TERM = 95 1089 _SC_2_C_VERSION = 96 1090 _SC_2_UPE = 97 1091 1092 _SC_XOPEN_XPG2 = 98 1093 _SC_XOPEN_XPG3 = 99 1094 _SC_XOPEN_XPG4 = 100 1095 1096 _SC_CHAR_BIT = 101 1097 _SC_CHAR_MAX = 102 1098 _SC_CHAR_MIN = 103 1099 _SC_INT_MAX = 104 1100 _SC_INT_MIN = 105 1101 _SC_LONG_BIT = 106 1102 _SC_WORD_BIT = 107 1103 _SC_MB_LEN_MAX = 108 1104 _SC_NZERO = 109 1105 _SC_SSIZE_MAX = 110 1106 _SC_SCHAR_MAX = 111 1107 _SC_SCHAR_MIN = 112 1108 _SC_SHRT_MAX = 113 1109 _SC_SHRT_MIN = 114 1110 _SC_UCHAR_MAX = 115 1111 _SC_UINT_MAX = 116 1112 _SC_ULONG_MAX = 117 1113 _SC_USHRT_MAX = 118 1114 1115 _SC_NL_ARGMAX = 119 1116 _SC_NL_LANGMAX = 120 1117 _SC_NL_MSGMAX = 121 1118 _SC_NL_NMAX = 122 1119 _SC_NL_SETMAX = 123 1120 _SC_NL_TEXTMAX = 124 1121 1122 _SC_XBS5_ILP32_OFF32 = 125 1123 _SC_XBS5_ILP32_OFFBIG = 126 1124 _SC_XBS5_LP64_OFF64 = 127 1125 _SC_XBS5_LPBIG_OFFBIG = 128 1126 1127 _SC_XOPEN_LEGACY = 129 1128 _SC_XOPEN_REALTIME = 130 1129 _SC_XOPEN_REALTIME_THREADS = 131 1130 1131 _SC_ADVISORY_INFO = 132 1132 _SC_BARRIERS = 133 1133 _SC_BASE = 134 1134 _SC_C_LANG_SUPPORT = 135 1135 _SC_C_LANG_SUPPORT_R = 136 1136 _SC_CLOCK_SELECTION = 137 1137 _SC_CPUTIME = 138 1138 _SC_THREAD_CPUTIME = 139 1139 _SC_DEVICE_IO = 140 1140 _SC_DEVICE_SPECIFIC = 141 1141 _SC_DEVICE_SPECIFIC_R = 142 1142 _SC_FD_MGMT = 143 1143 _SC_FIFO = 144 1144 _SC_PIPE = 145 1145 _SC_FILE_ATTRIBUTES = 146 1146 _SC_FILE_LOCKING = 147 1147 _SC_FILE_SYSTEM = 148 1148 _SC_MONOTONIC_CLOCK = 149 1149 _SC_MULTI_PROCESS = 150 1150 _SC_SINGLE_PROCESS = 151 1151 _SC_NETWORKING = 152 1152 _SC_READER_WRITER_LOCKS = 153 1153 _SC_SPIN_LOCKS = 154 1154 _SC_REGEXP = 155 1155 _SC_REGEX_VERSION = 156 1156 _SC_SHELL = 157 1157 _SC_SIGNALS = 158 1158 _SC_SPAWN = 159 1159 _SC_SPORADIC_SERVER = 160 1160 _SC_THREAD_SPORADIC_SERVER = 161 1161 _SC_SYSTEM_DATABASE = 162 1162 _SC_SYSTEM_DATABASE_R = 163 1163 _SC_TIMEOUTS = 164 1164 _SC_TYPED_MEMORY_OBJECTS = 165 1165 _SC_USER_GROUPS = 166 1166 _SC_USER_GROUPS_R = 167 1167 _SC_2_PBS = 168 1168 _SC_2_PBS_ACCOUNTING = 169 1169 _SC_2_PBS_LOCATE = 170 1170 _SC_2_PBS_MESSAGE = 171 1171 _SC_2_PBS_TRACK = 172 1172 _SC_SYMLOOP_MAX = 173 1173 _SC_STREAMS = 174 1174 _SC_2_PBS_CHECKPOINT = 175 1175 1176 _SC_V6_ILP32_OFF32 = 176 1177 _SC_V6_ILP32_OFFBIG = 177 1178 _SC_V6_LP64_OFF64 = 178 1179 _SC_V6_LPBIG_OFFBIG = 179 1180 1181 _SC_HOST_NAME_MAX = 180 1182 _SC_TRACE = 181 1183 _SC_TRACE_EVENT_FILTER = 182 1184 _SC_TRACE_INHERIT = 183 1185 _SC_TRACE_LOG = 184 1186 1187 _SC_LEVEL1_ICACHE_SIZE = 185 1188 _SC_LEVEL1_ICACHE_ASSOC = 186 1189 _SC_LEVEL1_ICACHE_LINESIZE = 187 1190 _SC_LEVEL1_DCACHE_SIZE = 188 1191 _SC_LEVEL1_DCACHE_ASSOC = 189 1192 _SC_LEVEL1_DCACHE_LINESIZE = 190 1193 _SC_LEVEL2_CACHE_SIZE = 191 1194 _SC_LEVEL2_CACHE_ASSOC = 192 1195 _SC_LEVEL2_CACHE_LINESIZE = 193 1196 _SC_LEVEL3_CACHE_SIZE = 194 1197 _SC_LEVEL3_CACHE_ASSOC = 195 1198 _SC_LEVEL3_CACHE_LINESIZE = 196 1199 _SC_LEVEL4_CACHE_SIZE = 197 1200 _SC_LEVEL4_CACHE_ASSOC = 198 1201 _SC_LEVEL4_CACHE_LINESIZE = 199 1202 // Leave room here, maybe we need a few more cache levels some day. 1203 1204 _SC_IPV6 = 235 1205 _SC_RAW_SOCKETS = 236 1206 1207 _SC_V7_ILP32_OFF32 = 237 1208 _SC_V7_ILP32_OFFBIG = 238 1209 _SC_V7_LP64_OFF64 = 239 1210 _SC_V7_LPBIG_OFFBIG = 240 1211 1212 _SC_SS_REPL_MAX = 241 1213 1214 _SC_TRACE_EVENT_NAME_MAX = 242 1215 _SC_TRACE_NAME_MAX = 243 1216 _SC_TRACE_SYS_MAX = 244 1217 _SC_TRACE_USER_EVENT_MAX = 245 1218 1219 _SC_XOPEN_STREAMS = 246 1220 1221 _SC_THREAD_ROBUST_PRIO_INHERIT = 247 1222 _SC_THREAD_ROBUST_PRIO_PROTECT = 248 1223 ) 1224 1225 // In 4.3bsd-net2, leave these undefined to indicate that size_t, etc. 1226 // are already defined. 1227 // BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here. 1228 // NetBSD 5 requires the I386_ANSI_H and X86_64_ANSI_H checks here. 1229 1230 // A null pointer constant. 1231 1232 // XPG requires a few symbols from <sys/wait.h> being defined. 1233 // Definitions of flag bits for `waitpid' et al. 1234 // Copyright (C) 1992-2018 Free Software Foundation, Inc. 1235 // This file is part of the GNU C Library. 1236 // 1237 // The GNU C Library is free software; you can redistribute it and/or 1238 // modify it under the terms of the GNU Lesser General Public 1239 // License as published by the Free Software Foundation; either 1240 // version 2.1 of the License, or (at your option) any later version. 1241 // 1242 // The GNU C Library is distributed in the hope that it will be useful, 1243 // but WITHOUT ANY WARRANTY; without even the implied warranty of 1244 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1245 // Lesser General Public License for more details. 1246 // 1247 // You should have received a copy of the GNU Lesser General Public 1248 // License along with the GNU C Library; if not, see 1249 // <http://www.gnu.org/licenses/>. 1250 1251 // Bits in the third argument to `waitpid'. 1252 1253 // Bits in the fourth argument to `waitid'. 1254 1255 // The following values are used by the `waitid' function. 1256 1257 // The Linux kernel defines these bare, rather than an enum, 1258 // which causes a conflict if the include order is reversed. 1259 1260 const ( /* waitflags.h:52:1: */ 1261 P_ALL = 0 // Wait for any child. 1262 P_PID = 1 // Wait for specified process. 1263 P_PGID = 2 1264 ) 1265 1266 // Copyright (C) 1991-2018 Free Software Foundation, Inc. 1267 // This file is part of the GNU C Library. 1268 // 1269 // The GNU C Library is free software; you can redistribute it and/or 1270 // modify it under the terms of the GNU Lesser General Public 1271 // License as published by the Free Software Foundation; either 1272 // version 2.1 of the License, or (at your option) any later version. 1273 // 1274 // The GNU C Library is distributed in the hope that it will be useful, 1275 // but WITHOUT ANY WARRANTY; without even the implied warranty of 1276 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1277 // Lesser General Public License for more details. 1278 // 1279 // You should have received a copy of the GNU Lesser General Public 1280 // License along with the GNU C Library; if not, see 1281 // <http://www.gnu.org/licenses/>. 1282 1283 // ISO C99 Standard: 7.2 Diagnostics <assert.h> 1284 1285 // Copyright (C) 1991-2018 Free Software Foundation, Inc. 1286 // This file is part of the GNU C Library. 1287 // 1288 // The GNU C Library is free software; you can redistribute it and/or 1289 // modify it under the terms of the GNU Lesser General Public 1290 // License as published by the Free Software Foundation; either 1291 // version 2.1 of the License, or (at your option) any later version. 1292 // 1293 // The GNU C Library is distributed in the hope that it will be useful, 1294 // but WITHOUT ANY WARRANTY; without even the implied warranty of 1295 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1296 // Lesser General Public License for more details. 1297 // 1298 // You should have received a copy of the GNU Lesser General Public 1299 // License along with the GNU C Library; if not, see 1300 // <http://www.gnu.org/licenses/>. 1301 1302 // void assert (int expression); 1303 // 1304 // If NDEBUG is defined, do nothing. 1305 // If not, and EXPRESSION is zero, print an error message and abort. 1306 1307 // void assert_perror (int errnum); 1308 // 1309 // If NDEBUG is defined, do nothing. If not, and ERRNUM is not zero, print an 1310 // error message with the error text for ERRNUM and abort. 1311 // (This is a GNU extension.) 1312 1313 // Copyright (C) 1991-2018 Free Software Foundation, Inc. 1314 // This file is part of the GNU C Library. 1315 // 1316 // The GNU C Library is free software; you can redistribute it and/or 1317 // modify it under the terms of the GNU Lesser General Public 1318 // License as published by the Free Software Foundation; either 1319 // version 2.1 of the License, or (at your option) any later version. 1320 // 1321 // The GNU C Library is distributed in the hope that it will be useful, 1322 // but WITHOUT ANY WARRANTY; without even the implied warranty of 1323 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1324 // Lesser General Public License for more details. 1325 // 1326 // You should have received a copy of the GNU Lesser General Public 1327 // License along with the GNU C Library; if not, see 1328 // <http://www.gnu.org/licenses/>. 1329 1330 // ISO C99 Standard 7.4: Character handling <ctype.h> 1331 1332 // Copyright (C) 1991-2018 Free Software Foundation, Inc. 1333 // This file is part of the GNU C Library. 1334 // 1335 // The GNU C Library is free software; you can redistribute it and/or 1336 // modify it under the terms of the GNU Lesser General Public 1337 // License as published by the Free Software Foundation; either 1338 // version 2.1 of the License, or (at your option) any later version. 1339 // 1340 // The GNU C Library is distributed in the hope that it will be useful, 1341 // but WITHOUT ANY WARRANTY; without even the implied warranty of 1342 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1343 // Lesser General Public License for more details. 1344 // 1345 // You should have received a copy of the GNU Lesser General Public 1346 // License along with the GNU C Library; if not, see 1347 // <http://www.gnu.org/licenses/>. 1348 1349 // bits/types.h -- definitions of __*_t types underlying *_t types. 1350 // Copyright (C) 2002-2018 Free Software Foundation, Inc. 1351 // This file is part of the GNU C Library. 1352 // 1353 // The GNU C Library is free software; you can redistribute it and/or 1354 // modify it under the terms of the GNU Lesser General Public 1355 // License as published by the Free Software Foundation; either 1356 // version 2.1 of the License, or (at your option) any later version. 1357 // 1358 // The GNU C Library is distributed in the hope that it will be useful, 1359 // but WITHOUT ANY WARRANTY; without even the implied warranty of 1360 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1361 // Lesser General Public License for more details. 1362 // 1363 // You should have received a copy of the GNU Lesser General Public 1364 // License along with the GNU C Library; if not, see 1365 // <http://www.gnu.org/licenses/>. 1366 1367 // Never include this file directly; use <sys/types.h> instead. 1368 1369 // These are all the characteristics of characters. 1370 // If there get to be more than 16 distinct characteristics, 1371 // many things must be changed that use `unsigned short int's. 1372 // 1373 // The characteristics are stored always in network byte order (big 1374 // endian). We define the bit value interpretations here dependent on the 1375 // machine's byte order. 1376 1377 // Copyright (C) 1992-2018 Free Software Foundation, Inc. 1378 // This file is part of the GNU C Library. 1379 // 1380 // The GNU C Library is free software; you can redistribute it and/or 1381 // modify it under the terms of the GNU Lesser General Public 1382 // License as published by the Free Software Foundation; either 1383 // version 2.1 of the License, or (at your option) any later version. 1384 // 1385 // The GNU C Library is distributed in the hope that it will be useful, 1386 // but WITHOUT ANY WARRANTY; without even the implied warranty of 1387 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1388 // Lesser General Public License for more details. 1389 // 1390 // You should have received a copy of the GNU Lesser General Public 1391 // License along with the GNU C Library; if not, see 1392 // <http://www.gnu.org/licenses/>. 1393 1394 const ( /* ctype.h:46:1: */ 1395 _ISupper = 256 // UPPERCASE. 1396 _ISlower = 512 // lowercase. 1397 _ISalpha = 1024 // Alphabetic. 1398 _ISdigit = 2048 // Numeric. 1399 _ISxdigit = 4096 // Hexadecimal numeric. 1400 _ISspace = 8192 // Whitespace. 1401 _ISprint = 16384 // Printing. 1402 _ISgraph = 32768 // Graphical. 1403 _ISblank = 1 // Blank (usually SPC and TAB). 1404 _IScntrl = 2 // Control character. 1405 _ISpunct = 4 // Punctuation. 1406 _ISalnum = 8 1407 ) 1408 1409 type ptrdiff_t = int32 /* <builtin>:3:26 */ 1410 1411 type size_t = uint32 /* <builtin>:9:23 */ 1412 1413 type wchar_t = int32 /* <builtin>:15:24 */ 1414 1415 // Define the standard macros for the user, 1416 // if this invocation was from the user program. 1417 1418 // Define va_list, if desired, from __gnuc_va_list. 1419 // We deliberately do not define va_list when called from 1420 // stdio.h, because ANSI C says that stdio.h is not supposed to define 1421 // va_list. stdio.h needs to have access to that data type, 1422 // but must not use that name. It should use the name __gnuc_va_list, 1423 // which is safe because it is reserved for the implementation. 1424 1425 // The macro _VA_LIST_ is the same thing used by this file in Ultrix. 1426 // But on BSD NET2 we must not test or define or undef it. 1427 // (Note that the comments in NET 2's ansi.h 1428 // are incorrect for _VA_LIST_--see stdio.h!) 1429 // The macro _VA_LIST_DEFINED is used in Windows NT 3.5 1430 // The macro _VA_LIST is used in SCO Unix 3.2. 1431 // The macro _VA_LIST_T_H is used in the Bull dpx2 1432 // The macro __va_list__ is used by BeOS. 1433 type va_list = uintptr /* stdarg.h:99:24 */ 1434 1435 // CAPI3REF: 64-Bit Integer Types 1436 // KEYWORDS: sqlite_int64 sqlite_uint64 1437 // 1438 // Because there is no cross-platform way to specify 64-bit integer types 1439 // SQLite includes typedefs for 64-bit signed and unsigned integers. 1440 // 1441 // The sqlite3_int64 and sqlite3_uint64 are the preferred type definitions. 1442 // The sqlite_int64 and sqlite_uint64 types are supported for backwards 1443 // compatibility only. 1444 // 1445 // ^The sqlite3_int64 and sqlite_int64 types can store integer values 1446 // between -9223372036854775808 and +9223372036854775807 inclusive. ^The 1447 // sqlite3_uint64 and sqlite_uint64 types can store integer values 1448 // between 0 and +18446744073709551615 inclusive. 1449 type sqlite_int64 = int64 /* sqlite3.h:278:25 */ 1450 type sqlite_uint64 = uint64 /* sqlite3.h:279:34 */ 1451 type sqlite3_int64 = sqlite_int64 /* sqlite3.h:281:22 */ 1452 type sqlite3_uint64 = sqlite_uint64 /* sqlite3.h:282:23 */ 1453 1454 // The type for a callback function. 1455 // This is legacy and deprecated. It is included for historical 1456 // compatibility and is not documented. 1457 type sqlite3_callback = uintptr /* sqlite3.h:338:13 */ 1458 1459 // CAPI3REF: Result Codes 1460 // KEYWORDS: {result code definitions} 1461 // 1462 // Many SQLite functions return an integer result code from the set shown 1463 // here in order to indicate success or failure. 1464 // 1465 // New error codes may be added in future versions of SQLite. 1466 // 1467 // See also: [extended result code definitions] 1468 // beginning-of-error-codes 1469 // end-of-error-codes 1470 1471 // CAPI3REF: Extended Result Codes 1472 // KEYWORDS: {extended result code definitions} 1473 // 1474 // In its default configuration, SQLite API routines return one of 30 integer 1475 // [result codes]. However, experience has shown that many of 1476 // these result codes are too coarse-grained. They do not provide as 1477 // much information about problems as programmers might like. In an effort to 1478 // address this, newer versions of SQLite (version 3.3.8 [dateof:3.3.8] 1479 // and later) include 1480 // support for additional result codes that provide more detailed information 1481 // about errors. These [extended result codes] are enabled or disabled 1482 // on a per database connection basis using the 1483 // [sqlite3_extended_result_codes()] API. Or, the extended code for 1484 // the most recent error can be obtained using 1485 // [sqlite3_extended_errcode()]. 1486 1487 // CAPI3REF: Flags For File Open Operations 1488 // 1489 // These bit values are intended for use in the 1490 // 3rd parameter to the [sqlite3_open_v2()] interface and 1491 // in the 4th parameter to the [sqlite3_vfs.xOpen] method. 1492 1493 // Reserved: 0x00F00000 1494 // Legacy compatibility: 1495 1496 // CAPI3REF: Device Characteristics 1497 // 1498 // The xDeviceCharacteristics method of the [sqlite3_io_methods] 1499 // object returns an integer which is a vector of these 1500 // bit values expressing I/O characteristics of the mass storage 1501 // device that holds the file that the [sqlite3_io_methods] 1502 // refers to. 1503 // 1504 // The SQLITE_IOCAP_ATOMIC property means that all writes of 1505 // any size are atomic. The SQLITE_IOCAP_ATOMICnnn values 1506 // mean that writes of blocks that are nnn bytes in size and 1507 // are aligned to an address which is an integer multiple of 1508 // nnn are atomic. The SQLITE_IOCAP_SAFE_APPEND value means 1509 // that when data is appended to a file, the data is appended 1510 // first then the size of the file is extended, never the other 1511 // way around. The SQLITE_IOCAP_SEQUENTIAL property means that 1512 // information is written to disk in the same order as calls 1513 // to xWrite(). The SQLITE_IOCAP_POWERSAFE_OVERWRITE property means that 1514 // after reboot following a crash or power loss, the only bytes in a 1515 // file that were written at the application level might have changed 1516 // and that adjacent bytes, even bytes within the same sector are 1517 // guaranteed to be unchanged. The SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN 1518 // flag indicates that a file cannot be deleted when open. The 1519 // SQLITE_IOCAP_IMMUTABLE flag indicates that the file is on 1520 // read-only media and cannot be changed even by processes with 1521 // elevated privileges. 1522 // 1523 // The SQLITE_IOCAP_BATCH_ATOMIC property means that the underlying 1524 // filesystem supports doing multiple write operations atomically when those 1525 // write operations are bracketed by [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] and 1526 // [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE]. 1527 1528 // CAPI3REF: File Locking Levels 1529 // 1530 // SQLite uses one of these integer values as the second 1531 // argument to calls it makes to the xLock() and xUnlock() methods 1532 // of an [sqlite3_io_methods] object. 1533 1534 // CAPI3REF: Synchronization Type Flags 1535 // 1536 // When SQLite invokes the xSync() method of an 1537 // [sqlite3_io_methods] object it uses a combination of 1538 // these integer values as the second argument. 1539 // 1540 // When the SQLITE_SYNC_DATAONLY flag is used, it means that the 1541 // sync operation only needs to flush data to mass storage. Inode 1542 // information need not be flushed. If the lower four bits of the flag 1543 // equal SQLITE_SYNC_NORMAL, that means to use normal fsync() semantics. 1544 // If the lower four bits equal SQLITE_SYNC_FULL, that means 1545 // to use Mac OS X style fullsync instead of fsync(). 1546 // 1547 // Do not confuse the SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL flags 1548 // with the [PRAGMA synchronous]=NORMAL and [PRAGMA synchronous]=FULL 1549 // settings. The [synchronous pragma] determines when calls to the 1550 // xSync VFS method occur and applies uniformly across all platforms. 1551 // The SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL flags determine how 1552 // energetic or rigorous or forceful the sync operations are and 1553 // only make a difference on Mac OSX for the default SQLite code. 1554 // (Third-party VFS implementations might also make the distinction 1555 // between SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL, but among the 1556 // operating systems natively supported by SQLite, only Mac OSX 1557 // cares about the difference.) 1558 1559 // CAPI3REF: OS Interface Open File Handle 1560 // 1561 // An [sqlite3_file] object represents an open file in the 1562 // [sqlite3_vfs | OS interface layer]. Individual OS interface 1563 // implementations will 1564 // want to subclass this object by appending additional fields 1565 // for their own use. The pMethods entry is a pointer to an 1566 // [sqlite3_io_methods] object that defines methods for performing 1567 // I/O operations on the open file. 1568 type sqlite3_file1 = struct{ pMethods uintptr } /* sqlite3.h:684:9 */ 1569 1570 // CAPI3REF: Result Codes 1571 // KEYWORDS: {result code definitions} 1572 // 1573 // Many SQLite functions return an integer result code from the set shown 1574 // here in order to indicate success or failure. 1575 // 1576 // New error codes may be added in future versions of SQLite. 1577 // 1578 // See also: [extended result code definitions] 1579 // beginning-of-error-codes 1580 // end-of-error-codes 1581 1582 // CAPI3REF: Extended Result Codes 1583 // KEYWORDS: {extended result code definitions} 1584 // 1585 // In its default configuration, SQLite API routines return one of 30 integer 1586 // [result codes]. However, experience has shown that many of 1587 // these result codes are too coarse-grained. They do not provide as 1588 // much information about problems as programmers might like. In an effort to 1589 // address this, newer versions of SQLite (version 3.3.8 [dateof:3.3.8] 1590 // and later) include 1591 // support for additional result codes that provide more detailed information 1592 // about errors. These [extended result codes] are enabled or disabled 1593 // on a per database connection basis using the 1594 // [sqlite3_extended_result_codes()] API. Or, the extended code for 1595 // the most recent error can be obtained using 1596 // [sqlite3_extended_errcode()]. 1597 1598 // CAPI3REF: Flags For File Open Operations 1599 // 1600 // These bit values are intended for use in the 1601 // 3rd parameter to the [sqlite3_open_v2()] interface and 1602 // in the 4th parameter to the [sqlite3_vfs.xOpen] method. 1603 1604 // Reserved: 0x00F00000 1605 // Legacy compatibility: 1606 1607 // CAPI3REF: Device Characteristics 1608 // 1609 // The xDeviceCharacteristics method of the [sqlite3_io_methods] 1610 // object returns an integer which is a vector of these 1611 // bit values expressing I/O characteristics of the mass storage 1612 // device that holds the file that the [sqlite3_io_methods] 1613 // refers to. 1614 // 1615 // The SQLITE_IOCAP_ATOMIC property means that all writes of 1616 // any size are atomic. The SQLITE_IOCAP_ATOMICnnn values 1617 // mean that writes of blocks that are nnn bytes in size and 1618 // are aligned to an address which is an integer multiple of 1619 // nnn are atomic. The SQLITE_IOCAP_SAFE_APPEND value means 1620 // that when data is appended to a file, the data is appended 1621 // first then the size of the file is extended, never the other 1622 // way around. The SQLITE_IOCAP_SEQUENTIAL property means that 1623 // information is written to disk in the same order as calls 1624 // to xWrite(). The SQLITE_IOCAP_POWERSAFE_OVERWRITE property means that 1625 // after reboot following a crash or power loss, the only bytes in a 1626 // file that were written at the application level might have changed 1627 // and that adjacent bytes, even bytes within the same sector are 1628 // guaranteed to be unchanged. The SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN 1629 // flag indicates that a file cannot be deleted when open. The 1630 // SQLITE_IOCAP_IMMUTABLE flag indicates that the file is on 1631 // read-only media and cannot be changed even by processes with 1632 // elevated privileges. 1633 // 1634 // The SQLITE_IOCAP_BATCH_ATOMIC property means that the underlying 1635 // filesystem supports doing multiple write operations atomically when those 1636 // write operations are bracketed by [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] and 1637 // [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE]. 1638 1639 // CAPI3REF: File Locking Levels 1640 // 1641 // SQLite uses one of these integer values as the second 1642 // argument to calls it makes to the xLock() and xUnlock() methods 1643 // of an [sqlite3_io_methods] object. 1644 1645 // CAPI3REF: Synchronization Type Flags 1646 // 1647 // When SQLite invokes the xSync() method of an 1648 // [sqlite3_io_methods] object it uses a combination of 1649 // these integer values as the second argument. 1650 // 1651 // When the SQLITE_SYNC_DATAONLY flag is used, it means that the 1652 // sync operation only needs to flush data to mass storage. Inode 1653 // information need not be flushed. If the lower four bits of the flag 1654 // equal SQLITE_SYNC_NORMAL, that means to use normal fsync() semantics. 1655 // If the lower four bits equal SQLITE_SYNC_FULL, that means 1656 // to use Mac OS X style fullsync instead of fsync(). 1657 // 1658 // Do not confuse the SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL flags 1659 // with the [PRAGMA synchronous]=NORMAL and [PRAGMA synchronous]=FULL 1660 // settings. The [synchronous pragma] determines when calls to the 1661 // xSync VFS method occur and applies uniformly across all platforms. 1662 // The SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL flags determine how 1663 // energetic or rigorous or forceful the sync operations are and 1664 // only make a difference on Mac OSX for the default SQLite code. 1665 // (Third-party VFS implementations might also make the distinction 1666 // between SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL, but among the 1667 // operating systems natively supported by SQLite, only Mac OSX 1668 // cares about the difference.) 1669 1670 // CAPI3REF: OS Interface Open File Handle 1671 // 1672 // An [sqlite3_file] object represents an open file in the 1673 // [sqlite3_vfs | OS interface layer]. Individual OS interface 1674 // implementations will 1675 // want to subclass this object by appending additional fields 1676 // for their own use. The pMethods entry is a pointer to an 1677 // [sqlite3_io_methods] object that defines methods for performing 1678 // I/O operations on the open file. 1679 type sqlite3_file = sqlite3_file1 /* sqlite3.h:684:29 */ 1680 type sqlite3_io_methods1 = struct { 1681 iVersion int32 1682 xClose uintptr 1683 xRead uintptr 1684 xWrite uintptr 1685 xTruncate uintptr 1686 xSync uintptr 1687 xFileSize uintptr 1688 xLock uintptr 1689 xUnlock uintptr 1690 xCheckReservedLock uintptr 1691 xFileControl uintptr 1692 xSectorSize uintptr 1693 xDeviceCharacteristics uintptr 1694 xShmMap uintptr 1695 xShmLock uintptr 1696 xShmBarrier uintptr 1697 xShmUnmap uintptr 1698 xFetch uintptr 1699 xUnfetch uintptr 1700 } /* sqlite3.h:684:9 */ 1701 1702 // CAPI3REF: OS Interface File Virtual Methods Object 1703 // 1704 // Every file opened by the [sqlite3_vfs.xOpen] method populates an 1705 // [sqlite3_file] object (or, more commonly, a subclass of the 1706 // [sqlite3_file] object) with a pointer to an instance of this object. 1707 // This object defines the methods used to perform various operations 1708 // against the open file represented by the [sqlite3_file] object. 1709 // 1710 // If the [sqlite3_vfs.xOpen] method sets the sqlite3_file.pMethods element 1711 // to a non-NULL pointer, then the sqlite3_io_methods.xClose method 1712 // may be invoked even if the [sqlite3_vfs.xOpen] reported that it failed. The 1713 // only way to prevent a call to xClose following a failed [sqlite3_vfs.xOpen] 1714 // is for the [sqlite3_vfs.xOpen] to set the sqlite3_file.pMethods element 1715 // to NULL. 1716 // 1717 // The flags argument to xSync may be one of [SQLITE_SYNC_NORMAL] or 1718 // [SQLITE_SYNC_FULL]. The first choice is the normal fsync(). 1719 // The second choice is a Mac OS X style fullsync. The [SQLITE_SYNC_DATAONLY] 1720 // flag may be ORed in to indicate that only the data of the file 1721 // and not its inode needs to be synced. 1722 // 1723 // The integer values to xLock() and xUnlock() are one of 1724 // <ul> 1725 // <li> [SQLITE_LOCK_NONE], 1726 // <li> [SQLITE_LOCK_SHARED], 1727 // <li> [SQLITE_LOCK_RESERVED], 1728 // <li> [SQLITE_LOCK_PENDING], or 1729 // <li> [SQLITE_LOCK_EXCLUSIVE]. 1730 // </ul> 1731 // xLock() increases the lock. xUnlock() decreases the lock. 1732 // The xCheckReservedLock() method checks whether any database connection, 1733 // either in this process or in some other process, is holding a RESERVED, 1734 // PENDING, or EXCLUSIVE lock on the file. It returns true 1735 // if such a lock exists and false otherwise. 1736 // 1737 // The xFileControl() method is a generic interface that allows custom 1738 // VFS implementations to directly control an open file using the 1739 // [sqlite3_file_control()] interface. The second "op" argument is an 1740 // integer opcode. The third argument is a generic pointer intended to 1741 // point to a structure that may contain arguments or space in which to 1742 // write return values. Potential uses for xFileControl() might be 1743 // functions to enable blocking locks with timeouts, to change the 1744 // locking strategy (for example to use dot-file locks), to inquire 1745 // about the status of a lock, or to break stale locks. The SQLite 1746 // core reserves all opcodes less than 100 for its own use. 1747 // A [file control opcodes | list of opcodes] less than 100 is available. 1748 // Applications that define a custom xFileControl method should use opcodes 1749 // greater than 100 to avoid conflicts. VFS implementations should 1750 // return [SQLITE_NOTFOUND] for file control opcodes that they do not 1751 // recognize. 1752 // 1753 // The xSectorSize() method returns the sector size of the 1754 // device that underlies the file. The sector size is the 1755 // minimum write that can be performed without disturbing 1756 // other bytes in the file. The xDeviceCharacteristics() 1757 // method returns a bit vector describing behaviors of the 1758 // underlying device: 1759 // 1760 // <ul> 1761 // <li> [SQLITE_IOCAP_ATOMIC] 1762 // <li> [SQLITE_IOCAP_ATOMIC512] 1763 // <li> [SQLITE_IOCAP_ATOMIC1K] 1764 // <li> [SQLITE_IOCAP_ATOMIC2K] 1765 // <li> [SQLITE_IOCAP_ATOMIC4K] 1766 // <li> [SQLITE_IOCAP_ATOMIC8K] 1767 // <li> [SQLITE_IOCAP_ATOMIC16K] 1768 // <li> [SQLITE_IOCAP_ATOMIC32K] 1769 // <li> [SQLITE_IOCAP_ATOMIC64K] 1770 // <li> [SQLITE_IOCAP_SAFE_APPEND] 1771 // <li> [SQLITE_IOCAP_SEQUENTIAL] 1772 // <li> [SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN] 1773 // <li> [SQLITE_IOCAP_POWERSAFE_OVERWRITE] 1774 // <li> [SQLITE_IOCAP_IMMUTABLE] 1775 // <li> [SQLITE_IOCAP_BATCH_ATOMIC] 1776 // </ul> 1777 // 1778 // The SQLITE_IOCAP_ATOMIC property means that all writes of 1779 // any size are atomic. The SQLITE_IOCAP_ATOMICnnn values 1780 // mean that writes of blocks that are nnn bytes in size and 1781 // are aligned to an address which is an integer multiple of 1782 // nnn are atomic. The SQLITE_IOCAP_SAFE_APPEND value means 1783 // that when data is appended to a file, the data is appended 1784 // first then the size of the file is extended, never the other 1785 // way around. The SQLITE_IOCAP_SEQUENTIAL property means that 1786 // information is written to disk in the same order as calls 1787 // to xWrite(). 1788 // 1789 // If xRead() returns SQLITE_IOERR_SHORT_READ it must also fill 1790 // in the unread portions of the buffer with zeros. A VFS that 1791 // fails to zero-fill short reads might seem to work. However, 1792 // failure to zero-fill short reads will eventually lead to 1793 // database corruption. 1794 type sqlite3_io_methods = sqlite3_io_methods1 /* sqlite3.h:783:35 */ 1795 1796 // CAPI3REF: OS Interface Object 1797 // 1798 // An instance of the sqlite3_vfs object defines the interface between 1799 // the SQLite core and the underlying operating system. The "vfs" 1800 // in the name of the object stands for "virtual file system". See 1801 // the [VFS | VFS documentation] for further information. 1802 // 1803 // The VFS interface is sometimes extended by adding new methods onto 1804 // the end. Each time such an extension occurs, the iVersion field 1805 // is incremented. The iVersion value started out as 1 in 1806 // SQLite [version 3.5.0] on [dateof:3.5.0], then increased to 2 1807 // with SQLite [version 3.7.0] on [dateof:3.7.0], and then increased 1808 // to 3 with SQLite [version 3.7.6] on [dateof:3.7.6]. Additional fields 1809 // may be appended to the sqlite3_vfs object and the iVersion value 1810 // may increase again in future versions of SQLite. 1811 // Note that due to an oversight, the structure 1812 // of the sqlite3_vfs object changed in the transition from 1813 // SQLite [version 3.5.9] to [version 3.6.0] on [dateof:3.6.0] 1814 // and yet the iVersion field was not increased. 1815 // 1816 // The szOsFile field is the size of the subclassed [sqlite3_file] 1817 // structure used by this VFS. mxPathname is the maximum length of 1818 // a pathname in this VFS. 1819 // 1820 // Registered sqlite3_vfs objects are kept on a linked list formed by 1821 // the pNext pointer. The [sqlite3_vfs_register()] 1822 // and [sqlite3_vfs_unregister()] interfaces manage this list 1823 // in a thread-safe way. The [sqlite3_vfs_find()] interface 1824 // searches the list. Neither the application code nor the VFS 1825 // implementation should use the pNext pointer. 1826 // 1827 // The pNext field is the only field in the sqlite3_vfs 1828 // structure that SQLite will ever modify. SQLite will only access 1829 // or modify this field while holding a particular static mutex. 1830 // The application should never modify anything within the sqlite3_vfs 1831 // object once the object has been registered. 1832 // 1833 // The zName field holds the name of the VFS module. The name must 1834 // be unique across all VFS modules. 1835 // 1836 // [[sqlite3_vfs.xOpen]] 1837 // ^SQLite guarantees that the zFilename parameter to xOpen 1838 // is either a NULL pointer or string obtained 1839 // from xFullPathname() with an optional suffix added. 1840 // ^If a suffix is added to the zFilename parameter, it will 1841 // consist of a single "-" character followed by no more than 1842 // 11 alphanumeric and/or "-" characters. 1843 // ^SQLite further guarantees that 1844 // the string will be valid and unchanged until xClose() is 1845 // called. Because of the previous sentence, 1846 // the [sqlite3_file] can safely store a pointer to the 1847 // filename if it needs to remember the filename for some reason. 1848 // If the zFilename parameter to xOpen is a NULL pointer then xOpen 1849 // must invent its own temporary name for the file. ^Whenever the 1850 // xFilename parameter is NULL it will also be the case that the 1851 // flags parameter will include [SQLITE_OPEN_DELETEONCLOSE]. 1852 // 1853 // The flags argument to xOpen() includes all bits set in 1854 // the flags argument to [sqlite3_open_v2()]. Or if [sqlite3_open()] 1855 // or [sqlite3_open16()] is used, then flags includes at least 1856 // [SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]. 1857 // If xOpen() opens a file read-only then it sets *pOutFlags to 1858 // include [SQLITE_OPEN_READONLY]. Other bits in *pOutFlags may be set. 1859 // 1860 // ^(SQLite will also add one of the following flags to the xOpen() 1861 // call, depending on the object being opened: 1862 // 1863 // <ul> 1864 // <li> [SQLITE_OPEN_MAIN_DB] 1865 // <li> [SQLITE_OPEN_MAIN_JOURNAL] 1866 // <li> [SQLITE_OPEN_TEMP_DB] 1867 // <li> [SQLITE_OPEN_TEMP_JOURNAL] 1868 // <li> [SQLITE_OPEN_TRANSIENT_DB] 1869 // <li> [SQLITE_OPEN_SUBJOURNAL] 1870 // <li> [SQLITE_OPEN_SUPER_JOURNAL] 1871 // <li> [SQLITE_OPEN_WAL] 1872 // </ul>)^ 1873 // 1874 // The file I/O implementation can use the object type flags to 1875 // change the way it deals with files. For example, an application 1876 // that does not care about crash recovery or rollback might make 1877 // the open of a journal file a no-op. Writes to this journal would 1878 // also be no-ops, and any attempt to read the journal would return 1879 // SQLITE_IOERR. Or the implementation might recognize that a database 1880 // file will be doing page-aligned sector reads and writes in a random 1881 // order and set up its I/O subsystem accordingly. 1882 // 1883 // SQLite might also add one of the following flags to the xOpen method: 1884 // 1885 // <ul> 1886 // <li> [SQLITE_OPEN_DELETEONCLOSE] 1887 // <li> [SQLITE_OPEN_EXCLUSIVE] 1888 // </ul> 1889 // 1890 // The [SQLITE_OPEN_DELETEONCLOSE] flag means the file should be 1891 // deleted when it is closed. ^The [SQLITE_OPEN_DELETEONCLOSE] 1892 // will be set for TEMP databases and their journals, transient 1893 // databases, and subjournals. 1894 // 1895 // ^The [SQLITE_OPEN_EXCLUSIVE] flag is always used in conjunction 1896 // with the [SQLITE_OPEN_CREATE] flag, which are both directly 1897 // analogous to the O_EXCL and O_CREAT flags of the POSIX open() 1898 // API. The SQLITE_OPEN_EXCLUSIVE flag, when paired with the 1899 // SQLITE_OPEN_CREATE, is used to indicate that file should always 1900 // be created, and that it is an error if it already exists. 1901 // It is <i>not</i> used to indicate the file should be opened 1902 // for exclusive access. 1903 // 1904 // ^At least szOsFile bytes of memory are allocated by SQLite 1905 // to hold the [sqlite3_file] structure passed as the third 1906 // argument to xOpen. The xOpen method does not have to 1907 // allocate the structure; it should just fill it in. Note that 1908 // the xOpen method must set the sqlite3_file.pMethods to either 1909 // a valid [sqlite3_io_methods] object or to NULL. xOpen must do 1910 // this even if the open fails. SQLite expects that the sqlite3_file.pMethods 1911 // element will be valid after xOpen returns regardless of the success 1912 // or failure of the xOpen call. 1913 // 1914 // [[sqlite3_vfs.xAccess]] 1915 // ^The flags argument to xAccess() may be [SQLITE_ACCESS_EXISTS] 1916 // to test for the existence of a file, or [SQLITE_ACCESS_READWRITE] to 1917 // test whether a file is readable and writable, or [SQLITE_ACCESS_READ] 1918 // to test whether a file is at least readable. The SQLITE_ACCESS_READ 1919 // flag is never actually used and is not implemented in the built-in 1920 // VFSes of SQLite. The file is named by the second argument and can be a 1921 // directory. The xAccess method returns [SQLITE_OK] on success or some 1922 // non-zero error code if there is an I/O error or if the name of 1923 // the file given in the second argument is illegal. If SQLITE_OK 1924 // is returned, then non-zero or zero is written into *pResOut to indicate 1925 // whether or not the file is accessible. 1926 // 1927 // ^SQLite will always allocate at least mxPathname+1 bytes for the 1928 // output buffer xFullPathname. The exact size of the output buffer 1929 // is also passed as a parameter to both methods. If the output buffer 1930 // is not large enough, [SQLITE_CANTOPEN] should be returned. Since this is 1931 // handled as a fatal error by SQLite, vfs implementations should endeavor 1932 // to prevent this by setting mxPathname to a sufficiently large value. 1933 // 1934 // The xRandomness(), xSleep(), xCurrentTime(), and xCurrentTimeInt64() 1935 // interfaces are not strictly a part of the filesystem, but they are 1936 // included in the VFS structure for completeness. 1937 // The xRandomness() function attempts to return nBytes bytes 1938 // of good-quality randomness into zOut. The return value is 1939 // the actual number of bytes of randomness obtained. 1940 // The xSleep() method causes the calling thread to sleep for at 1941 // least the number of microseconds given. ^The xCurrentTime() 1942 // method returns a Julian Day Number for the current date and time as 1943 // a floating point value. 1944 // ^The xCurrentTimeInt64() method returns, as an integer, the Julian 1945 // Day Number multiplied by 86400000 (the number of milliseconds in 1946 // a 24-hour day). 1947 // ^SQLite will use the xCurrentTimeInt64() method to get the current 1948 // date and time if that method is available (if iVersion is 2 or 1949 // greater and the function pointer is not NULL) and will fall back 1950 // to xCurrentTime() if xCurrentTimeInt64() is unavailable. 1951 // 1952 // ^The xSetSystemCall(), xGetSystemCall(), and xNestSystemCall() interfaces 1953 // are not used by the SQLite core. These optional interfaces are provided 1954 // by some VFSes to facilitate testing of the VFS code. By overriding 1955 // system calls with functions under its control, a test program can 1956 // simulate faults and error conditions that would otherwise be difficult 1957 // or impossible to induce. The set of system calls that can be overridden 1958 // varies from one VFS to another, and from one version of the same VFS to the 1959 // next. Applications that use these interfaces must be prepared for any 1960 // or all of these interfaces to be NULL or for their behavior to change 1961 // from one release to the next. Applications must not attempt to access 1962 // any of these methods if the iVersion of the VFS is less than 3. 1963 type sqlite3_vfs1 = struct { 1964 iVersion int32 1965 szOsFile int32 1966 mxPathname int32 1967 pNext uintptr 1968 zName uintptr 1969 pAppData uintptr 1970 xOpen uintptr 1971 xDelete uintptr 1972 xAccess uintptr 1973 xFullPathname uintptr 1974 xDlOpen uintptr 1975 xDlError uintptr 1976 xDlSym uintptr 1977 xDlClose uintptr 1978 xRandomness uintptr 1979 xSleep uintptr 1980 xCurrentTime uintptr 1981 xGetLastError uintptr 1982 xCurrentTimeInt64 uintptr 1983 xSetSystemCall uintptr 1984 xGetSystemCall uintptr 1985 xNextSystemCall uintptr 1986 } /* sqlite3.h:1387:9 */ 1987 1988 // CAPI3REF: OS Interface Object 1989 // 1990 // An instance of the sqlite3_vfs object defines the interface between 1991 // the SQLite core and the underlying operating system. The "vfs" 1992 // in the name of the object stands for "virtual file system". See 1993 // the [VFS | VFS documentation] for further information. 1994 // 1995 // The VFS interface is sometimes extended by adding new methods onto 1996 // the end. Each time such an extension occurs, the iVersion field 1997 // is incremented. The iVersion value started out as 1 in 1998 // SQLite [version 3.5.0] on [dateof:3.5.0], then increased to 2 1999 // with SQLite [version 3.7.0] on [dateof:3.7.0], and then increased 2000 // to 3 with SQLite [version 3.7.6] on [dateof:3.7.6]. Additional fields 2001 // may be appended to the sqlite3_vfs object and the iVersion value 2002 // may increase again in future versions of SQLite. 2003 // Note that due to an oversight, the structure 2004 // of the sqlite3_vfs object changed in the transition from 2005 // SQLite [version 3.5.9] to [version 3.6.0] on [dateof:3.6.0] 2006 // and yet the iVersion field was not increased. 2007 // 2008 // The szOsFile field is the size of the subclassed [sqlite3_file] 2009 // structure used by this VFS. mxPathname is the maximum length of 2010 // a pathname in this VFS. 2011 // 2012 // Registered sqlite3_vfs objects are kept on a linked list formed by 2013 // the pNext pointer. The [sqlite3_vfs_register()] 2014 // and [sqlite3_vfs_unregister()] interfaces manage this list 2015 // in a thread-safe way. The [sqlite3_vfs_find()] interface 2016 // searches the list. Neither the application code nor the VFS 2017 // implementation should use the pNext pointer. 2018 // 2019 // The pNext field is the only field in the sqlite3_vfs 2020 // structure that SQLite will ever modify. SQLite will only access 2021 // or modify this field while holding a particular static mutex. 2022 // The application should never modify anything within the sqlite3_vfs 2023 // object once the object has been registered. 2024 // 2025 // The zName field holds the name of the VFS module. The name must 2026 // be unique across all VFS modules. 2027 // 2028 // [[sqlite3_vfs.xOpen]] 2029 // ^SQLite guarantees that the zFilename parameter to xOpen 2030 // is either a NULL pointer or string obtained 2031 // from xFullPathname() with an optional suffix added. 2032 // ^If a suffix is added to the zFilename parameter, it will 2033 // consist of a single "-" character followed by no more than 2034 // 11 alphanumeric and/or "-" characters. 2035 // ^SQLite further guarantees that 2036 // the string will be valid and unchanged until xClose() is 2037 // called. Because of the previous sentence, 2038 // the [sqlite3_file] can safely store a pointer to the 2039 // filename if it needs to remember the filename for some reason. 2040 // If the zFilename parameter to xOpen is a NULL pointer then xOpen 2041 // must invent its own temporary name for the file. ^Whenever the 2042 // xFilename parameter is NULL it will also be the case that the 2043 // flags parameter will include [SQLITE_OPEN_DELETEONCLOSE]. 2044 // 2045 // The flags argument to xOpen() includes all bits set in 2046 // the flags argument to [sqlite3_open_v2()]. Or if [sqlite3_open()] 2047 // or [sqlite3_open16()] is used, then flags includes at least 2048 // [SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]. 2049 // If xOpen() opens a file read-only then it sets *pOutFlags to 2050 // include [SQLITE_OPEN_READONLY]. Other bits in *pOutFlags may be set. 2051 // 2052 // ^(SQLite will also add one of the following flags to the xOpen() 2053 // call, depending on the object being opened: 2054 // 2055 // <ul> 2056 // <li> [SQLITE_OPEN_MAIN_DB] 2057 // <li> [SQLITE_OPEN_MAIN_JOURNAL] 2058 // <li> [SQLITE_OPEN_TEMP_DB] 2059 // <li> [SQLITE_OPEN_TEMP_JOURNAL] 2060 // <li> [SQLITE_OPEN_TRANSIENT_DB] 2061 // <li> [SQLITE_OPEN_SUBJOURNAL] 2062 // <li> [SQLITE_OPEN_SUPER_JOURNAL] 2063 // <li> [SQLITE_OPEN_WAL] 2064 // </ul>)^ 2065 // 2066 // The file I/O implementation can use the object type flags to 2067 // change the way it deals with files. For example, an application 2068 // that does not care about crash recovery or rollback might make 2069 // the open of a journal file a no-op. Writes to this journal would 2070 // also be no-ops, and any attempt to read the journal would return 2071 // SQLITE_IOERR. Or the implementation might recognize that a database 2072 // file will be doing page-aligned sector reads and writes in a random 2073 // order and set up its I/O subsystem accordingly. 2074 // 2075 // SQLite might also add one of the following flags to the xOpen method: 2076 // 2077 // <ul> 2078 // <li> [SQLITE_OPEN_DELETEONCLOSE] 2079 // <li> [SQLITE_OPEN_EXCLUSIVE] 2080 // </ul> 2081 // 2082 // The [SQLITE_OPEN_DELETEONCLOSE] flag means the file should be 2083 // deleted when it is closed. ^The [SQLITE_OPEN_DELETEONCLOSE] 2084 // will be set for TEMP databases and their journals, transient 2085 // databases, and subjournals. 2086 // 2087 // ^The [SQLITE_OPEN_EXCLUSIVE] flag is always used in conjunction 2088 // with the [SQLITE_OPEN_CREATE] flag, which are both directly 2089 // analogous to the O_EXCL and O_CREAT flags of the POSIX open() 2090 // API. The SQLITE_OPEN_EXCLUSIVE flag, when paired with the 2091 // SQLITE_OPEN_CREATE, is used to indicate that file should always 2092 // be created, and that it is an error if it already exists. 2093 // It is <i>not</i> used to indicate the file should be opened 2094 // for exclusive access. 2095 // 2096 // ^At least szOsFile bytes of memory are allocated by SQLite 2097 // to hold the [sqlite3_file] structure passed as the third 2098 // argument to xOpen. The xOpen method does not have to 2099 // allocate the structure; it should just fill it in. Note that 2100 // the xOpen method must set the sqlite3_file.pMethods to either 2101 // a valid [sqlite3_io_methods] object or to NULL. xOpen must do 2102 // this even if the open fails. SQLite expects that the sqlite3_file.pMethods 2103 // element will be valid after xOpen returns regardless of the success 2104 // or failure of the xOpen call. 2105 // 2106 // [[sqlite3_vfs.xAccess]] 2107 // ^The flags argument to xAccess() may be [SQLITE_ACCESS_EXISTS] 2108 // to test for the existence of a file, or [SQLITE_ACCESS_READWRITE] to 2109 // test whether a file is readable and writable, or [SQLITE_ACCESS_READ] 2110 // to test whether a file is at least readable. The SQLITE_ACCESS_READ 2111 // flag is never actually used and is not implemented in the built-in 2112 // VFSes of SQLite. The file is named by the second argument and can be a 2113 // directory. The xAccess method returns [SQLITE_OK] on success or some 2114 // non-zero error code if there is an I/O error or if the name of 2115 // the file given in the second argument is illegal. If SQLITE_OK 2116 // is returned, then non-zero or zero is written into *pResOut to indicate 2117 // whether or not the file is accessible. 2118 // 2119 // ^SQLite will always allocate at least mxPathname+1 bytes for the 2120 // output buffer xFullPathname. The exact size of the output buffer 2121 // is also passed as a parameter to both methods. If the output buffer 2122 // is not large enough, [SQLITE_CANTOPEN] should be returned. Since this is 2123 // handled as a fatal error by SQLite, vfs implementations should endeavor 2124 // to prevent this by setting mxPathname to a sufficiently large value. 2125 // 2126 // The xRandomness(), xSleep(), xCurrentTime(), and xCurrentTimeInt64() 2127 // interfaces are not strictly a part of the filesystem, but they are 2128 // included in the VFS structure for completeness. 2129 // The xRandomness() function attempts to return nBytes bytes 2130 // of good-quality randomness into zOut. The return value is 2131 // the actual number of bytes of randomness obtained. 2132 // The xSleep() method causes the calling thread to sleep for at 2133 // least the number of microseconds given. ^The xCurrentTime() 2134 // method returns a Julian Day Number for the current date and time as 2135 // a floating point value. 2136 // ^The xCurrentTimeInt64() method returns, as an integer, the Julian 2137 // Day Number multiplied by 86400000 (the number of milliseconds in 2138 // a 24-hour day). 2139 // ^SQLite will use the xCurrentTimeInt64() method to get the current 2140 // date and time if that method is available (if iVersion is 2 or 2141 // greater and the function pointer is not NULL) and will fall back 2142 // to xCurrentTime() if xCurrentTimeInt64() is unavailable. 2143 // 2144 // ^The xSetSystemCall(), xGetSystemCall(), and xNestSystemCall() interfaces 2145 // are not used by the SQLite core. These optional interfaces are provided 2146 // by some VFSes to facilitate testing of the VFS code. By overriding 2147 // system calls with functions under its control, a test program can 2148 // simulate faults and error conditions that would otherwise be difficult 2149 // or impossible to induce. The set of system calls that can be overridden 2150 // varies from one VFS to another, and from one version of the same VFS to the 2151 // next. Applications that use these interfaces must be prepared for any 2152 // or all of these interfaces to be NULL or for their behavior to change 2153 // from one release to the next. Applications must not attempt to access 2154 // any of these methods if the iVersion of the VFS is less than 3. 2155 type sqlite3_vfs = sqlite3_vfs1 /* sqlite3.h:1387:28 */ 2156 type sqlite3_syscall_ptr = uintptr /* sqlite3.h:1388:14 */ 2157 2158 // CAPI3REF: Memory Allocation Routines 2159 // 2160 // An instance of this object defines the interface between SQLite 2161 // and low-level memory allocation routines. 2162 // 2163 // This object is used in only one place in the SQLite interface. 2164 // A pointer to an instance of this object is the argument to 2165 // [sqlite3_config()] when the configuration option is 2166 // [SQLITE_CONFIG_MALLOC] or [SQLITE_CONFIG_GETMALLOC]. 2167 // By creating an instance of this object 2168 // and passing it to [sqlite3_config]([SQLITE_CONFIG_MALLOC]) 2169 // during configuration, an application can specify an alternative 2170 // memory allocation subsystem for SQLite to use for all of its 2171 // dynamic memory needs. 2172 // 2173 // Note that SQLite comes with several [built-in memory allocators] 2174 // that are perfectly adequate for the overwhelming majority of applications 2175 // and that this object is only useful to a tiny minority of applications 2176 // with specialized memory allocation requirements. This object is 2177 // also used during testing of SQLite in order to specify an alternative 2178 // memory allocator that simulates memory out-of-memory conditions in 2179 // order to verify that SQLite recovers gracefully from such 2180 // conditions. 2181 // 2182 // The xMalloc, xRealloc, and xFree methods must work like the 2183 // malloc(), realloc() and free() functions from the standard C library. 2184 // ^SQLite guarantees that the second argument to 2185 // xRealloc is always a value returned by a prior call to xRoundup. 2186 // 2187 // xSize should return the allocated size of a memory allocation 2188 // previously obtained from xMalloc or xRealloc. The allocated size 2189 // is always at least as big as the requested size but may be larger. 2190 // 2191 // The xRoundup method returns what would be the allocated size of 2192 // a memory allocation given a particular requested size. Most memory 2193 // allocators round up memory allocations at least to the next multiple 2194 // of 8. Some allocators round up to a larger multiple or to a power of 2. 2195 // Every memory allocation request coming in through [sqlite3_malloc()] 2196 // or [sqlite3_realloc()] first calls xRoundup. If xRoundup returns 0, 2197 // that causes the corresponding memory allocation to fail. 2198 // 2199 // The xInit method initializes the memory allocator. For example, 2200 // it might allocate any required mutexes or initialize internal data 2201 // structures. The xShutdown method is invoked (indirectly) by 2202 // [sqlite3_shutdown()] and should deallocate any resources acquired 2203 // by xInit. The pAppData pointer is used as the only parameter to 2204 // xInit and xShutdown. 2205 // 2206 // SQLite holds the [SQLITE_MUTEX_STATIC_MAIN] mutex when it invokes 2207 // the xInit method, so the xInit method need not be threadsafe. The 2208 // xShutdown method is only called from [sqlite3_shutdown()] so it does 2209 // not need to be threadsafe either. For all other methods, SQLite 2210 // holds the [SQLITE_MUTEX_STATIC_MEM] mutex as long as the 2211 // [SQLITE_CONFIG_MEMSTATUS] configuration option is turned on (which 2212 // it is by default) and so the methods are automatically serialized. 2213 // However, if [SQLITE_CONFIG_MEMSTATUS] is disabled, then the other 2214 // methods must be threadsafe or else make their own arrangements for 2215 // serialization. 2216 // 2217 // SQLite will never invoke xInit() more than once without an intervening 2218 // call to xShutdown(). 2219 type sqlite3_mem_methods1 = struct { 2220 xMalloc uintptr 2221 xFree uintptr 2222 xRealloc uintptr 2223 xSize uintptr 2224 xRoundup uintptr 2225 xInit uintptr 2226 xShutdown uintptr 2227 pAppData uintptr 2228 } /* sqlite3.h:1685:9 */ 2229 2230 // CAPI3REF: Memory Allocation Routines 2231 // 2232 // An instance of this object defines the interface between SQLite 2233 // and low-level memory allocation routines. 2234 // 2235 // This object is used in only one place in the SQLite interface. 2236 // A pointer to an instance of this object is the argument to 2237 // [sqlite3_config()] when the configuration option is 2238 // [SQLITE_CONFIG_MALLOC] or [SQLITE_CONFIG_GETMALLOC]. 2239 // By creating an instance of this object 2240 // and passing it to [sqlite3_config]([SQLITE_CONFIG_MALLOC]) 2241 // during configuration, an application can specify an alternative 2242 // memory allocation subsystem for SQLite to use for all of its 2243 // dynamic memory needs. 2244 // 2245 // Note that SQLite comes with several [built-in memory allocators] 2246 // that are perfectly adequate for the overwhelming majority of applications 2247 // and that this object is only useful to a tiny minority of applications 2248 // with specialized memory allocation requirements. This object is 2249 // also used during testing of SQLite in order to specify an alternative 2250 // memory allocator that simulates memory out-of-memory conditions in 2251 // order to verify that SQLite recovers gracefully from such 2252 // conditions. 2253 // 2254 // The xMalloc, xRealloc, and xFree methods must work like the 2255 // malloc(), realloc() and free() functions from the standard C library. 2256 // ^SQLite guarantees that the second argument to 2257 // xRealloc is always a value returned by a prior call to xRoundup. 2258 // 2259 // xSize should return the allocated size of a memory allocation 2260 // previously obtained from xMalloc or xRealloc. The allocated size 2261 // is always at least as big as the requested size but may be larger. 2262 // 2263 // The xRoundup method returns what would be the allocated size of 2264 // a memory allocation given a particular requested size. Most memory 2265 // allocators round up memory allocations at least to the next multiple 2266 // of 8. Some allocators round up to a larger multiple or to a power of 2. 2267 // Every memory allocation request coming in through [sqlite3_malloc()] 2268 // or [sqlite3_realloc()] first calls xRoundup. If xRoundup returns 0, 2269 // that causes the corresponding memory allocation to fail. 2270 // 2271 // The xInit method initializes the memory allocator. For example, 2272 // it might allocate any required mutexes or initialize internal data 2273 // structures. The xShutdown method is invoked (indirectly) by 2274 // [sqlite3_shutdown()] and should deallocate any resources acquired 2275 // by xInit. The pAppData pointer is used as the only parameter to 2276 // xInit and xShutdown. 2277 // 2278 // SQLite holds the [SQLITE_MUTEX_STATIC_MAIN] mutex when it invokes 2279 // the xInit method, so the xInit method need not be threadsafe. The 2280 // xShutdown method is only called from [sqlite3_shutdown()] so it does 2281 // not need to be threadsafe either. For all other methods, SQLite 2282 // holds the [SQLITE_MUTEX_STATIC_MEM] mutex as long as the 2283 // [SQLITE_CONFIG_MEMSTATUS] configuration option is turned on (which 2284 // it is by default) and so the methods are automatically serialized. 2285 // However, if [SQLITE_CONFIG_MEMSTATUS] is disabled, then the other 2286 // methods must be threadsafe or else make their own arrangements for 2287 // serialization. 2288 // 2289 // SQLite will never invoke xInit() more than once without an intervening 2290 // call to xShutdown(). 2291 type sqlite3_mem_methods = sqlite3_mem_methods1 /* sqlite3.h:1685:36 */ 2292 2293 // CAPI3REF: Constants Defining Special Destructor Behavior 2294 // 2295 // These are special values for the destructor that is passed in as the 2296 // final argument to routines like [sqlite3_result_blob()]. ^If the destructor 2297 // argument is SQLITE_STATIC, it means that the content pointer is constant 2298 // and will never change. It does not need to be destroyed. ^The 2299 // SQLITE_TRANSIENT value means that the content will likely change in 2300 // the near future and that SQLite should make its own private copy of 2301 // the content before returning. 2302 // 2303 // The typedef is necessary to work around problems in certain 2304 // C++ compilers. 2305 type sqlite3_destructor_type = uintptr /* sqlite3.h:5665:14 */ 2306 2307 // The interface to the virtual-table mechanism is currently considered 2308 // to be experimental. The interface might change in incompatible ways. 2309 // If this is a problem for you, do not use the interface at this time. 2310 // 2311 // When the virtual-table mechanism stabilizes, we will declare the 2312 // interface fixed, support it indefinitely, and remove this comment. 2313 2314 // Structures used by the virtual table interface 2315 type sqlite3_vtab1 = struct { 2316 pModule uintptr 2317 nRef int32 2318 zErrMsg uintptr 2319 } /* sqlite3.h:6784:9 */ 2320 2321 // The interface to the virtual-table mechanism is currently considered 2322 // to be experimental. The interface might change in incompatible ways. 2323 // If this is a problem for you, do not use the interface at this time. 2324 // 2325 // When the virtual-table mechanism stabilizes, we will declare the 2326 // interface fixed, support it indefinitely, and remove this comment. 2327 2328 // Structures used by the virtual table interface 2329 type sqlite3_vtab = sqlite3_vtab1 /* sqlite3.h:6784:29 */ 2330 type sqlite3_index_info1 = struct { 2331 nConstraint int32 2332 aConstraint uintptr 2333 nOrderBy int32 2334 aOrderBy uintptr 2335 aConstraintUsage uintptr 2336 idxNum int32 2337 idxStr uintptr 2338 needToFreeIdxStr int32 2339 orderByConsumed int32 2340 estimatedCost float64 2341 estimatedRows sqlite3_int64 2342 idxFlags int32 2343 colUsed sqlite3_uint64 2344 } /* sqlite3.h:6785:9 */ 2345 2346 type sqlite3_index_info = sqlite3_index_info1 /* sqlite3.h:6785:35 */ 2347 type sqlite3_vtab_cursor1 = struct{ pVtab uintptr } /* sqlite3.h:6786:9 */ 2348 2349 type sqlite3_vtab_cursor = sqlite3_vtab_cursor1 /* sqlite3.h:6786:36 */ 2350 type sqlite3_module1 = struct { 2351 iVersion int32 2352 xCreate uintptr 2353 xConnect uintptr 2354 xBestIndex uintptr 2355 xDisconnect uintptr 2356 xDestroy uintptr 2357 xOpen uintptr 2358 xClose uintptr 2359 xFilter uintptr 2360 xNext uintptr 2361 xEof uintptr 2362 xColumn uintptr 2363 xRowid uintptr 2364 xUpdate uintptr 2365 xBegin uintptr 2366 xSync uintptr 2367 xCommit uintptr 2368 xRollback uintptr 2369 xFindFunction uintptr 2370 xRename uintptr 2371 xSavepoint uintptr 2372 xRelease uintptr 2373 xRollbackTo uintptr 2374 xShadowName uintptr 2375 } /* sqlite3.h:6784:9 */ 2376 2377 type sqlite3_module = sqlite3_module1 /* sqlite3.h:6787:31 */ 2378 2379 // CAPI3REF: Virtual Table Indexing Information 2380 // KEYWORDS: sqlite3_index_info 2381 // 2382 // The sqlite3_index_info structure and its substructures is used as part 2383 // of the [virtual table] interface to 2384 // pass information into and receive the reply from the [xBestIndex] 2385 // method of a [virtual table module]. The fields under **Inputs** are the 2386 // inputs to xBestIndex and are read-only. xBestIndex inserts its 2387 // results into the **Outputs** fields. 2388 // 2389 // ^(The aConstraint[] array records WHERE clause constraints of the form: 2390 // 2391 // <blockquote>column OP expr</blockquote> 2392 // 2393 // where OP is =, <, <=, >, or >=.)^ ^(The particular operator is 2394 // stored in aConstraint[].op using one of the 2395 // [SQLITE_INDEX_CONSTRAINT_EQ | SQLITE_INDEX_CONSTRAINT_ values].)^ 2396 // ^(The index of the column is stored in 2397 // aConstraint[].iColumn.)^ ^(aConstraint[].usable is TRUE if the 2398 // expr on the right-hand side can be evaluated (and thus the constraint 2399 // is usable) and false if it cannot.)^ 2400 // 2401 // ^The optimizer automatically inverts terms of the form "expr OP column" 2402 // and makes other simplifications to the WHERE clause in an attempt to 2403 // get as many WHERE clause terms into the form shown above as possible. 2404 // ^The aConstraint[] array only reports WHERE clause terms that are 2405 // relevant to the particular virtual table being queried. 2406 // 2407 // ^Information about the ORDER BY clause is stored in aOrderBy[]. 2408 // ^Each term of aOrderBy records a column of the ORDER BY clause. 2409 // 2410 // The colUsed field indicates which columns of the virtual table may be 2411 // required by the current scan. Virtual table columns are numbered from 2412 // zero in the order in which they appear within the CREATE TABLE statement 2413 // passed to sqlite3_declare_vtab(). For the first 63 columns (columns 0-62), 2414 // the corresponding bit is set within the colUsed mask if the column may be 2415 // required by SQLite. If the table has at least 64 columns and any column 2416 // to the right of the first 63 is required, then bit 63 of colUsed is also 2417 // set. In other words, column iCol may be required if the expression 2418 // (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol))) evaluates to 2419 // non-zero. 2420 // 2421 // The [xBestIndex] method must fill aConstraintUsage[] with information 2422 // about what parameters to pass to xFilter. ^If argvIndex>0 then 2423 // the right-hand side of the corresponding aConstraint[] is evaluated 2424 // and becomes the argvIndex-th entry in argv. ^(If aConstraintUsage[].omit 2425 // is true, then the constraint is assumed to be fully handled by the 2426 // virtual table and might not be checked again by the byte code.)^ ^(The 2427 // aConstraintUsage[].omit flag is an optimization hint. When the omit flag 2428 // is left in its default setting of false, the constraint will always be 2429 // checked separately in byte code. If the omit flag is change to true, then 2430 // the constraint may or may not be checked in byte code. In other words, 2431 // when the omit flag is true there is no guarantee that the constraint will 2432 // not be checked again using byte code.)^ 2433 // 2434 // ^The idxNum and idxPtr values are recorded and passed into the 2435 // [xFilter] method. 2436 // ^[sqlite3_free()] is used to free idxPtr if and only if 2437 // needToFreeIdxPtr is true. 2438 // 2439 // ^The orderByConsumed means that output from [xFilter]/[xNext] will occur in 2440 // the correct order to satisfy the ORDER BY clause so that no separate 2441 // sorting step is required. 2442 // 2443 // ^The estimatedCost value is an estimate of the cost of a particular 2444 // strategy. A cost of N indicates that the cost of the strategy is similar 2445 // to a linear scan of an SQLite table with N rows. A cost of log(N) 2446 // indicates that the expense of the operation is similar to that of a 2447 // binary search on a unique indexed field of an SQLite table with N rows. 2448 // 2449 // ^The estimatedRows value is an estimate of the number of rows that 2450 // will be returned by the strategy. 2451 // 2452 // The xBestIndex method may optionally populate the idxFlags field with a 2453 // mask of SQLITE_INDEX_SCAN_* flags. Currently there is only one such flag - 2454 // SQLITE_INDEX_SCAN_UNIQUE. If the xBestIndex method sets this flag, SQLite 2455 // assumes that the strategy may visit at most one row. 2456 // 2457 // Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then 2458 // SQLite also assumes that if a call to the xUpdate() method is made as 2459 // part of the same statement to delete or update a virtual table row and the 2460 // implementation returns SQLITE_CONSTRAINT, then there is no need to rollback 2461 // any database changes. In other words, if the xUpdate() returns 2462 // SQLITE_CONSTRAINT, the database contents must be exactly as they were 2463 // before xUpdate was called. By contrast, if SQLITE_INDEX_SCAN_UNIQUE is not 2464 // set and xUpdate returns SQLITE_CONSTRAINT, any database changes made by 2465 // the xUpdate method are automatically rolled back by SQLite. 2466 // 2467 // IMPORTANT: The estimatedRows field was added to the sqlite3_index_info 2468 // structure for SQLite [version 3.8.2] ([dateof:3.8.2]). 2469 // If a virtual table extension is 2470 // used with an SQLite version earlier than 3.8.2, the results of attempting 2471 // to read or write the estimatedRows field are undefined (but are likely 2472 // to include crashing the application). The estimatedRows field should 2473 // therefore only be used if [sqlite3_libversion_number()] returns a 2474 // value greater than or equal to 3008002. Similarly, the idxFlags field 2475 // was added for [version 3.9.0] ([dateof:3.9.0]). 2476 // It may therefore only be used if 2477 // sqlite3_libversion_number() returns a value greater than or equal to 2478 // 3009000. 2479 type sqlite3_index_constraint = struct { 2480 iColumn int32 2481 op uint8 2482 usable uint8 2483 _ [2]byte 2484 iTermOffset int32 2485 } /* sqlite3.h:6785:9 */ 2486 2487 // CAPI3REF: Virtual Table Indexing Information 2488 // KEYWORDS: sqlite3_index_info 2489 // 2490 // The sqlite3_index_info structure and its substructures is used as part 2491 // of the [virtual table] interface to 2492 // pass information into and receive the reply from the [xBestIndex] 2493 // method of a [virtual table module]. The fields under **Inputs** are the 2494 // inputs to xBestIndex and are read-only. xBestIndex inserts its 2495 // results into the **Outputs** fields. 2496 // 2497 // ^(The aConstraint[] array records WHERE clause constraints of the form: 2498 // 2499 // <blockquote>column OP expr</blockquote> 2500 // 2501 // where OP is =, <, <=, >, or >=.)^ ^(The particular operator is 2502 // stored in aConstraint[].op using one of the 2503 // [SQLITE_INDEX_CONSTRAINT_EQ | SQLITE_INDEX_CONSTRAINT_ values].)^ 2504 // ^(The index of the column is stored in 2505 // aConstraint[].iColumn.)^ ^(aConstraint[].usable is TRUE if the 2506 // expr on the right-hand side can be evaluated (and thus the constraint 2507 // is usable) and false if it cannot.)^ 2508 // 2509 // ^The optimizer automatically inverts terms of the form "expr OP column" 2510 // and makes other simplifications to the WHERE clause in an attempt to 2511 // get as many WHERE clause terms into the form shown above as possible. 2512 // ^The aConstraint[] array only reports WHERE clause terms that are 2513 // relevant to the particular virtual table being queried. 2514 // 2515 // ^Information about the ORDER BY clause is stored in aOrderBy[]. 2516 // ^Each term of aOrderBy records a column of the ORDER BY clause. 2517 // 2518 // The colUsed field indicates which columns of the virtual table may be 2519 // required by the current scan. Virtual table columns are numbered from 2520 // zero in the order in which they appear within the CREATE TABLE statement 2521 // passed to sqlite3_declare_vtab(). For the first 63 columns (columns 0-62), 2522 // the corresponding bit is set within the colUsed mask if the column may be 2523 // required by SQLite. If the table has at least 64 columns and any column 2524 // to the right of the first 63 is required, then bit 63 of colUsed is also 2525 // set. In other words, column iCol may be required if the expression 2526 // (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol))) evaluates to 2527 // non-zero. 2528 // 2529 // The [xBestIndex] method must fill aConstraintUsage[] with information 2530 // about what parameters to pass to xFilter. ^If argvIndex>0 then 2531 // the right-hand side of the corresponding aConstraint[] is evaluated 2532 // and becomes the argvIndex-th entry in argv. ^(If aConstraintUsage[].omit 2533 // is true, then the constraint is assumed to be fully handled by the 2534 // virtual table and might not be checked again by the byte code.)^ ^(The 2535 // aConstraintUsage[].omit flag is an optimization hint. When the omit flag 2536 // is left in its default setting of false, the constraint will always be 2537 // checked separately in byte code. If the omit flag is change to true, then 2538 // the constraint may or may not be checked in byte code. In other words, 2539 // when the omit flag is true there is no guarantee that the constraint will 2540 // not be checked again using byte code.)^ 2541 // 2542 // ^The idxNum and idxPtr values are recorded and passed into the 2543 // [xFilter] method. 2544 // ^[sqlite3_free()] is used to free idxPtr if and only if 2545 // needToFreeIdxPtr is true. 2546 // 2547 // ^The orderByConsumed means that output from [xFilter]/[xNext] will occur in 2548 // the correct order to satisfy the ORDER BY clause so that no separate 2549 // sorting step is required. 2550 // 2551 // ^The estimatedCost value is an estimate of the cost of a particular 2552 // strategy. A cost of N indicates that the cost of the strategy is similar 2553 // to a linear scan of an SQLite table with N rows. A cost of log(N) 2554 // indicates that the expense of the operation is similar to that of a 2555 // binary search on a unique indexed field of an SQLite table with N rows. 2556 // 2557 // ^The estimatedRows value is an estimate of the number of rows that 2558 // will be returned by the strategy. 2559 // 2560 // The xBestIndex method may optionally populate the idxFlags field with a 2561 // mask of SQLITE_INDEX_SCAN_* flags. Currently there is only one such flag - 2562 // SQLITE_INDEX_SCAN_UNIQUE. If the xBestIndex method sets this flag, SQLite 2563 // assumes that the strategy may visit at most one row. 2564 // 2565 // Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then 2566 // SQLite also assumes that if a call to the xUpdate() method is made as 2567 // part of the same statement to delete or update a virtual table row and the 2568 // implementation returns SQLITE_CONSTRAINT, then there is no need to rollback 2569 // any database changes. In other words, if the xUpdate() returns 2570 // SQLITE_CONSTRAINT, the database contents must be exactly as they were 2571 // before xUpdate was called. By contrast, if SQLITE_INDEX_SCAN_UNIQUE is not 2572 // set and xUpdate returns SQLITE_CONSTRAINT, any database changes made by 2573 // the xUpdate method are automatically rolled back by SQLite. 2574 // 2575 // IMPORTANT: The estimatedRows field was added to the sqlite3_index_info 2576 // structure for SQLite [version 3.8.2] ([dateof:3.8.2]). 2577 // If a virtual table extension is 2578 // used with an SQLite version earlier than 3.8.2, the results of attempting 2579 // to read or write the estimatedRows field are undefined (but are likely 2580 // to include crashing the application). The estimatedRows field should 2581 // therefore only be used if [sqlite3_libversion_number()] returns a 2582 // value greater than or equal to 3008002. Similarly, the idxFlags field 2583 // was added for [version 3.9.0] ([dateof:3.9.0]). 2584 // It may therefore only be used if 2585 // sqlite3_libversion_number() returns a value greater than or equal to 2586 // 3009000. 2587 type sqlite3_index_orderby = struct { 2588 iColumn int32 2589 desc uint8 2590 _ [3]byte 2591 } /* sqlite3.h:6785:9 */ 2592 2593 // CAPI3REF: Virtual Table Indexing Information 2594 // KEYWORDS: sqlite3_index_info 2595 // 2596 // The sqlite3_index_info structure and its substructures is used as part 2597 // of the [virtual table] interface to 2598 // pass information into and receive the reply from the [xBestIndex] 2599 // method of a [virtual table module]. The fields under **Inputs** are the 2600 // inputs to xBestIndex and are read-only. xBestIndex inserts its 2601 // results into the **Outputs** fields. 2602 // 2603 // ^(The aConstraint[] array records WHERE clause constraints of the form: 2604 // 2605 // <blockquote>column OP expr</blockquote> 2606 // 2607 // where OP is =, <, <=, >, or >=.)^ ^(The particular operator is 2608 // stored in aConstraint[].op using one of the 2609 // [SQLITE_INDEX_CONSTRAINT_EQ | SQLITE_INDEX_CONSTRAINT_ values].)^ 2610 // ^(The index of the column is stored in 2611 // aConstraint[].iColumn.)^ ^(aConstraint[].usable is TRUE if the 2612 // expr on the right-hand side can be evaluated (and thus the constraint 2613 // is usable) and false if it cannot.)^ 2614 // 2615 // ^The optimizer automatically inverts terms of the form "expr OP column" 2616 // and makes other simplifications to the WHERE clause in an attempt to 2617 // get as many WHERE clause terms into the form shown above as possible. 2618 // ^The aConstraint[] array only reports WHERE clause terms that are 2619 // relevant to the particular virtual table being queried. 2620 // 2621 // ^Information about the ORDER BY clause is stored in aOrderBy[]. 2622 // ^Each term of aOrderBy records a column of the ORDER BY clause. 2623 // 2624 // The colUsed field indicates which columns of the virtual table may be 2625 // required by the current scan. Virtual table columns are numbered from 2626 // zero in the order in which they appear within the CREATE TABLE statement 2627 // passed to sqlite3_declare_vtab(). For the first 63 columns (columns 0-62), 2628 // the corresponding bit is set within the colUsed mask if the column may be 2629 // required by SQLite. If the table has at least 64 columns and any column 2630 // to the right of the first 63 is required, then bit 63 of colUsed is also 2631 // set. In other words, column iCol may be required if the expression 2632 // (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol))) evaluates to 2633 // non-zero. 2634 // 2635 // The [xBestIndex] method must fill aConstraintUsage[] with information 2636 // about what parameters to pass to xFilter. ^If argvIndex>0 then 2637 // the right-hand side of the corresponding aConstraint[] is evaluated 2638 // and becomes the argvIndex-th entry in argv. ^(If aConstraintUsage[].omit 2639 // is true, then the constraint is assumed to be fully handled by the 2640 // virtual table and might not be checked again by the byte code.)^ ^(The 2641 // aConstraintUsage[].omit flag is an optimization hint. When the omit flag 2642 // is left in its default setting of false, the constraint will always be 2643 // checked separately in byte code. If the omit flag is change to true, then 2644 // the constraint may or may not be checked in byte code. In other words, 2645 // when the omit flag is true there is no guarantee that the constraint will 2646 // not be checked again using byte code.)^ 2647 // 2648 // ^The idxNum and idxPtr values are recorded and passed into the 2649 // [xFilter] method. 2650 // ^[sqlite3_free()] is used to free idxPtr if and only if 2651 // needToFreeIdxPtr is true. 2652 // 2653 // ^The orderByConsumed means that output from [xFilter]/[xNext] will occur in 2654 // the correct order to satisfy the ORDER BY clause so that no separate 2655 // sorting step is required. 2656 // 2657 // ^The estimatedCost value is an estimate of the cost of a particular 2658 // strategy. A cost of N indicates that the cost of the strategy is similar 2659 // to a linear scan of an SQLite table with N rows. A cost of log(N) 2660 // indicates that the expense of the operation is similar to that of a 2661 // binary search on a unique indexed field of an SQLite table with N rows. 2662 // 2663 // ^The estimatedRows value is an estimate of the number of rows that 2664 // will be returned by the strategy. 2665 // 2666 // The xBestIndex method may optionally populate the idxFlags field with a 2667 // mask of SQLITE_INDEX_SCAN_* flags. Currently there is only one such flag - 2668 // SQLITE_INDEX_SCAN_UNIQUE. If the xBestIndex method sets this flag, SQLite 2669 // assumes that the strategy may visit at most one row. 2670 // 2671 // Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then 2672 // SQLite also assumes that if a call to the xUpdate() method is made as 2673 // part of the same statement to delete or update a virtual table row and the 2674 // implementation returns SQLITE_CONSTRAINT, then there is no need to rollback 2675 // any database changes. In other words, if the xUpdate() returns 2676 // SQLITE_CONSTRAINT, the database contents must be exactly as they were 2677 // before xUpdate was called. By contrast, if SQLITE_INDEX_SCAN_UNIQUE is not 2678 // set and xUpdate returns SQLITE_CONSTRAINT, any database changes made by 2679 // the xUpdate method are automatically rolled back by SQLite. 2680 // 2681 // IMPORTANT: The estimatedRows field was added to the sqlite3_index_info 2682 // structure for SQLite [version 3.8.2] ([dateof:3.8.2]). 2683 // If a virtual table extension is 2684 // used with an SQLite version earlier than 3.8.2, the results of attempting 2685 // to read or write the estimatedRows field are undefined (but are likely 2686 // to include crashing the application). The estimatedRows field should 2687 // therefore only be used if [sqlite3_libversion_number()] returns a 2688 // value greater than or equal to 3008002. Similarly, the idxFlags field 2689 // was added for [version 3.9.0] ([dateof:3.9.0]). 2690 // It may therefore only be used if 2691 // sqlite3_libversion_number() returns a value greater than or equal to 2692 // 3009000. 2693 type sqlite3_index_constraint_usage = struct { 2694 argvIndex int32 2695 omit uint8 2696 _ [3]byte 2697 } /* sqlite3.h:6785:9 */ 2698 2699 // CAPI3REF: Mutex Methods Object 2700 // 2701 // An instance of this structure defines the low-level routines 2702 // used to allocate and use mutexes. 2703 // 2704 // Usually, the default mutex implementations provided by SQLite are 2705 // sufficient, however the application has the option of substituting a custom 2706 // implementation for specialized deployments or systems for which SQLite 2707 // does not provide a suitable implementation. In this case, the application 2708 // creates and populates an instance of this structure to pass 2709 // to sqlite3_config() along with the [SQLITE_CONFIG_MUTEX] option. 2710 // Additionally, an instance of this structure can be used as an 2711 // output variable when querying the system for the current mutex 2712 // implementation, using the [SQLITE_CONFIG_GETMUTEX] option. 2713 // 2714 // ^The xMutexInit method defined by this structure is invoked as 2715 // part of system initialization by the sqlite3_initialize() function. 2716 // ^The xMutexInit routine is called by SQLite exactly once for each 2717 // effective call to [sqlite3_initialize()]. 2718 // 2719 // ^The xMutexEnd method defined by this structure is invoked as 2720 // part of system shutdown by the sqlite3_shutdown() function. The 2721 // implementation of this method is expected to release all outstanding 2722 // resources obtained by the mutex methods implementation, especially 2723 // those obtained by the xMutexInit method. ^The xMutexEnd() 2724 // interface is invoked exactly once for each call to [sqlite3_shutdown()]. 2725 // 2726 // ^(The remaining seven methods defined by this structure (xMutexAlloc, 2727 // xMutexFree, xMutexEnter, xMutexTry, xMutexLeave, xMutexHeld and 2728 // xMutexNotheld) implement the following interfaces (respectively): 2729 // 2730 // <ul> 2731 // <li> [sqlite3_mutex_alloc()] </li> 2732 // <li> [sqlite3_mutex_free()] </li> 2733 // <li> [sqlite3_mutex_enter()] </li> 2734 // <li> [sqlite3_mutex_try()] </li> 2735 // <li> [sqlite3_mutex_leave()] </li> 2736 // <li> [sqlite3_mutex_held()] </li> 2737 // <li> [sqlite3_mutex_notheld()] </li> 2738 // </ul>)^ 2739 // 2740 // The only difference is that the public sqlite3_XXX functions enumerated 2741 // above silently ignore any invocations that pass a NULL pointer instead 2742 // of a valid mutex handle. The implementations of the methods defined 2743 // by this structure are not required to handle this case. The results 2744 // of passing a NULL pointer instead of a valid mutex handle are undefined 2745 // (i.e. it is acceptable to provide an implementation that segfaults if 2746 // it is passed a NULL pointer). 2747 // 2748 // The xMutexInit() method must be threadsafe. It must be harmless to 2749 // invoke xMutexInit() multiple times within the same process and without 2750 // intervening calls to xMutexEnd(). Second and subsequent calls to 2751 // xMutexInit() must be no-ops. 2752 // 2753 // xMutexInit() must not use SQLite memory allocation ([sqlite3_malloc()] 2754 // and its associates). Similarly, xMutexAlloc() must not use SQLite memory 2755 // allocation for a static mutex. ^However xMutexAlloc() may use SQLite 2756 // memory allocation for a fast or recursive mutex. 2757 // 2758 // ^SQLite will invoke the xMutexEnd() method when [sqlite3_shutdown()] is 2759 // called, but only if the prior call to xMutexInit returned SQLITE_OK. 2760 // If xMutexInit fails in any way, it is expected to clean up after itself 2761 // prior to returning. 2762 type sqlite3_mutex_methods1 = struct { 2763 xMutexInit uintptr 2764 xMutexEnd uintptr 2765 xMutexAlloc uintptr 2766 xMutexFree uintptr 2767 xMutexEnter uintptr 2768 xMutexTry uintptr 2769 xMutexLeave uintptr 2770 xMutexHeld uintptr 2771 xMutexNotheld uintptr 2772 } /* sqlite3.h:7619:9 */ 2773 2774 // CAPI3REF: Mutex Methods Object 2775 // 2776 // An instance of this structure defines the low-level routines 2777 // used to allocate and use mutexes. 2778 // 2779 // Usually, the default mutex implementations provided by SQLite are 2780 // sufficient, however the application has the option of substituting a custom 2781 // implementation for specialized deployments or systems for which SQLite 2782 // does not provide a suitable implementation. In this case, the application 2783 // creates and populates an instance of this structure to pass 2784 // to sqlite3_config() along with the [SQLITE_CONFIG_MUTEX] option. 2785 // Additionally, an instance of this structure can be used as an 2786 // output variable when querying the system for the current mutex 2787 // implementation, using the [SQLITE_CONFIG_GETMUTEX] option. 2788 // 2789 // ^The xMutexInit method defined by this structure is invoked as 2790 // part of system initialization by the sqlite3_initialize() function. 2791 // ^The xMutexInit routine is called by SQLite exactly once for each 2792 // effective call to [sqlite3_initialize()]. 2793 // 2794 // ^The xMutexEnd method defined by this structure is invoked as 2795 // part of system shutdown by the sqlite3_shutdown() function. The 2796 // implementation of this method is expected to release all outstanding 2797 // resources obtained by the mutex methods implementation, especially 2798 // those obtained by the xMutexInit method. ^The xMutexEnd() 2799 // interface is invoked exactly once for each call to [sqlite3_shutdown()]. 2800 // 2801 // ^(The remaining seven methods defined by this structure (xMutexAlloc, 2802 // xMutexFree, xMutexEnter, xMutexTry, xMutexLeave, xMutexHeld and 2803 // xMutexNotheld) implement the following interfaces (respectively): 2804 // 2805 // <ul> 2806 // <li> [sqlite3_mutex_alloc()] </li> 2807 // <li> [sqlite3_mutex_free()] </li> 2808 // <li> [sqlite3_mutex_enter()] </li> 2809 // <li> [sqlite3_mutex_try()] </li> 2810 // <li> [sqlite3_mutex_leave()] </li> 2811 // <li> [sqlite3_mutex_held()] </li> 2812 // <li> [sqlite3_mutex_notheld()] </li> 2813 // </ul>)^ 2814 // 2815 // The only difference is that the public sqlite3_XXX functions enumerated 2816 // above silently ignore any invocations that pass a NULL pointer instead 2817 // of a valid mutex handle. The implementations of the methods defined 2818 // by this structure are not required to handle this case. The results 2819 // of passing a NULL pointer instead of a valid mutex handle are undefined 2820 // (i.e. it is acceptable to provide an implementation that segfaults if 2821 // it is passed a NULL pointer). 2822 // 2823 // The xMutexInit() method must be threadsafe. It must be harmless to 2824 // invoke xMutexInit() multiple times within the same process and without 2825 // intervening calls to xMutexEnd(). Second and subsequent calls to 2826 // xMutexInit() must be no-ops. 2827 // 2828 // xMutexInit() must not use SQLite memory allocation ([sqlite3_malloc()] 2829 // and its associates). Similarly, xMutexAlloc() must not use SQLite memory 2830 // allocation for a static mutex. ^However xMutexAlloc() may use SQLite 2831 // memory allocation for a fast or recursive mutex. 2832 // 2833 // ^SQLite will invoke the xMutexEnd() method when [sqlite3_shutdown()] is 2834 // called, but only if the prior call to xMutexInit returned SQLITE_OK. 2835 // If xMutexInit fails in any way, it is expected to clean up after itself 2836 // prior to returning. 2837 type sqlite3_mutex_methods = sqlite3_mutex_methods1 /* sqlite3.h:7619:38 */ 2838 2839 // CAPI3REF: Custom Page Cache Object 2840 // 2841 // The sqlite3_pcache_page object represents a single page in the 2842 // page cache. The page cache will allocate instances of this 2843 // object. Various methods of the page cache use pointers to instances 2844 // of this object as parameters or as their return value. 2845 // 2846 // See [sqlite3_pcache_methods2] for additional information. 2847 type sqlite3_pcache_page1 = struct { 2848 pBuf uintptr 2849 pExtra uintptr 2850 } /* sqlite3.h:8375:9 */ 2851 2852 // CAPI3REF: Custom Page Cache Object 2853 // 2854 // The sqlite3_pcache_page object represents a single page in the 2855 // page cache. The page cache will allocate instances of this 2856 // object. Various methods of the page cache use pointers to instances 2857 // of this object as parameters or as their return value. 2858 // 2859 // See [sqlite3_pcache_methods2] for additional information. 2860 type sqlite3_pcache_page = sqlite3_pcache_page1 /* sqlite3.h:8375:36 */ 2861 2862 // CAPI3REF: Application Defined Page Cache. 2863 // KEYWORDS: {page cache} 2864 // 2865 // ^(The [sqlite3_config]([SQLITE_CONFIG_PCACHE2], ...) interface can 2866 // register an alternative page cache implementation by passing in an 2867 // instance of the sqlite3_pcache_methods2 structure.)^ 2868 // In many applications, most of the heap memory allocated by 2869 // SQLite is used for the page cache. 2870 // By implementing a 2871 // custom page cache using this API, an application can better control 2872 // the amount of memory consumed by SQLite, the way in which 2873 // that memory is allocated and released, and the policies used to 2874 // determine exactly which parts of a database file are cached and for 2875 // how long. 2876 // 2877 // The alternative page cache mechanism is an 2878 // extreme measure that is only needed by the most demanding applications. 2879 // The built-in page cache is recommended for most uses. 2880 // 2881 // ^(The contents of the sqlite3_pcache_methods2 structure are copied to an 2882 // internal buffer by SQLite within the call to [sqlite3_config]. Hence 2883 // the application may discard the parameter after the call to 2884 // [sqlite3_config()] returns.)^ 2885 // 2886 // [[the xInit() page cache method]] 2887 // ^(The xInit() method is called once for each effective 2888 // call to [sqlite3_initialize()])^ 2889 // (usually only once during the lifetime of the process). ^(The xInit() 2890 // method is passed a copy of the sqlite3_pcache_methods2.pArg value.)^ 2891 // The intent of the xInit() method is to set up global data structures 2892 // required by the custom page cache implementation. 2893 // ^(If the xInit() method is NULL, then the 2894 // built-in default page cache is used instead of the application defined 2895 // page cache.)^ 2896 // 2897 // [[the xShutdown() page cache method]] 2898 // ^The xShutdown() method is called by [sqlite3_shutdown()]. 2899 // It can be used to clean up 2900 // any outstanding resources before process shutdown, if required. 2901 // ^The xShutdown() method may be NULL. 2902 // 2903 // ^SQLite automatically serializes calls to the xInit method, 2904 // so the xInit method need not be threadsafe. ^The 2905 // xShutdown method is only called from [sqlite3_shutdown()] so it does 2906 // not need to be threadsafe either. All other methods must be threadsafe 2907 // in multithreaded applications. 2908 // 2909 // ^SQLite will never invoke xInit() more than once without an intervening 2910 // call to xShutdown(). 2911 // 2912 // [[the xCreate() page cache methods]] 2913 // ^SQLite invokes the xCreate() method to construct a new cache instance. 2914 // SQLite will typically create one cache instance for each open database file, 2915 // though this is not guaranteed. ^The 2916 // first parameter, szPage, is the size in bytes of the pages that must 2917 // be allocated by the cache. ^szPage will always a power of two. ^The 2918 // second parameter szExtra is a number of bytes of extra storage 2919 // associated with each page cache entry. ^The szExtra parameter will 2920 // a number less than 250. SQLite will use the 2921 // extra szExtra bytes on each page to store metadata about the underlying 2922 // database page on disk. The value passed into szExtra depends 2923 // on the SQLite version, the target platform, and how SQLite was compiled. 2924 // ^The third argument to xCreate(), bPurgeable, is true if the cache being 2925 // created will be used to cache database pages of a file stored on disk, or 2926 // false if it is used for an in-memory database. The cache implementation 2927 // does not have to do anything special based with the value of bPurgeable; 2928 // it is purely advisory. ^On a cache where bPurgeable is false, SQLite will 2929 // never invoke xUnpin() except to deliberately delete a page. 2930 // ^In other words, calls to xUnpin() on a cache with bPurgeable set to 2931 // false will always have the "discard" flag set to true. 2932 // ^Hence, a cache created with bPurgeable false will 2933 // never contain any unpinned pages. 2934 // 2935 // [[the xCachesize() page cache method]] 2936 // ^(The xCachesize() method may be called at any time by SQLite to set the 2937 // suggested maximum cache-size (number of pages stored by) the cache 2938 // instance passed as the first argument. This is the value configured using 2939 // the SQLite "[PRAGMA cache_size]" command.)^ As with the bPurgeable 2940 // parameter, the implementation is not required to do anything with this 2941 // value; it is advisory only. 2942 // 2943 // [[the xPagecount() page cache methods]] 2944 // The xPagecount() method must return the number of pages currently 2945 // stored in the cache, both pinned and unpinned. 2946 // 2947 // [[the xFetch() page cache methods]] 2948 // The xFetch() method locates a page in the cache and returns a pointer to 2949 // an sqlite3_pcache_page object associated with that page, or a NULL pointer. 2950 // The pBuf element of the returned sqlite3_pcache_page object will be a 2951 // pointer to a buffer of szPage bytes used to store the content of a 2952 // single database page. The pExtra element of sqlite3_pcache_page will be 2953 // a pointer to the szExtra bytes of extra storage that SQLite has requested 2954 // for each entry in the page cache. 2955 // 2956 // The page to be fetched is determined by the key. ^The minimum key value 2957 // is 1. After it has been retrieved using xFetch, the page is considered 2958 // to be "pinned". 2959 // 2960 // If the requested page is already in the page cache, then the page cache 2961 // implementation must return a pointer to the page buffer with its content 2962 // intact. If the requested page is not already in the cache, then the 2963 // cache implementation should use the value of the createFlag 2964 // parameter to help it determined what action to take: 2965 // 2966 // <table border=1 width=85% align=center> 2967 // <tr><th> createFlag <th> Behavior when page is not already in cache 2968 // <tr><td> 0 <td> Do not allocate a new page. Return NULL. 2969 // <tr><td> 1 <td> Allocate a new page if it easy and convenient to do so. 2970 // Otherwise return NULL. 2971 // <tr><td> 2 <td> Make every effort to allocate a new page. Only return 2972 // NULL if allocating a new page is effectively impossible. 2973 // </table> 2974 // 2975 // ^(SQLite will normally invoke xFetch() with a createFlag of 0 or 1. SQLite 2976 // will only use a createFlag of 2 after a prior call with a createFlag of 1 2977 // failed.)^ In between the xFetch() calls, SQLite may 2978 // attempt to unpin one or more cache pages by spilling the content of 2979 // pinned pages to disk and synching the operating system disk cache. 2980 // 2981 // [[the xUnpin() page cache method]] 2982 // ^xUnpin() is called by SQLite with a pointer to a currently pinned page 2983 // as its second argument. If the third parameter, discard, is non-zero, 2984 // then the page must be evicted from the cache. 2985 // ^If the discard parameter is 2986 // zero, then the page may be discarded or retained at the discretion of 2987 // page cache implementation. ^The page cache implementation 2988 // may choose to evict unpinned pages at any time. 2989 // 2990 // The cache must not perform any reference counting. A single 2991 // call to xUnpin() unpins the page regardless of the number of prior calls 2992 // to xFetch(). 2993 // 2994 // [[the xRekey() page cache methods]] 2995 // The xRekey() method is used to change the key value associated with the 2996 // page passed as the second argument. If the cache 2997 // previously contains an entry associated with newKey, it must be 2998 // discarded. ^Any prior cache entry associated with newKey is guaranteed not 2999 // to be pinned. 3000 // 3001 // When SQLite calls the xTruncate() method, the cache must discard all 3002 // existing cache entries with page numbers (keys) greater than or equal 3003 // to the value of the iLimit parameter passed to xTruncate(). If any 3004 // of these pages are pinned, they are implicitly unpinned, meaning that 3005 // they can be safely discarded. 3006 // 3007 // [[the xDestroy() page cache method]] 3008 // ^The xDestroy() method is used to delete a cache allocated by xCreate(). 3009 // All resources associated with the specified cache should be freed. ^After 3010 // calling the xDestroy() method, SQLite considers the [sqlite3_pcache*] 3011 // handle invalid, and will not use it with any other sqlite3_pcache_methods2 3012 // functions. 3013 // 3014 // [[the xShrink() page cache method]] 3015 // ^SQLite invokes the xShrink() method when it wants the page cache to 3016 // free up as much of heap memory as possible. The page cache implementation 3017 // is not obligated to free any memory, but well-behaved implementations should 3018 // do their best. 3019 type sqlite3_pcache_methods21 = struct { 3020 iVersion int32 3021 pArg uintptr 3022 xInit uintptr 3023 xShutdown uintptr 3024 xCreate uintptr 3025 xCachesize uintptr 3026 xPagecount uintptr 3027 xFetch uintptr 3028 xUnpin uintptr 3029 xRekey uintptr 3030 xTruncate uintptr 3031 xDestroy uintptr 3032 xShrink uintptr 3033 } /* sqlite3.h:8540:9 */ 3034 3035 // CAPI3REF: Application Defined Page Cache. 3036 // KEYWORDS: {page cache} 3037 // 3038 // ^(The [sqlite3_config]([SQLITE_CONFIG_PCACHE2], ...) interface can 3039 // register an alternative page cache implementation by passing in an 3040 // instance of the sqlite3_pcache_methods2 structure.)^ 3041 // In many applications, most of the heap memory allocated by 3042 // SQLite is used for the page cache. 3043 // By implementing a 3044 // custom page cache using this API, an application can better control 3045 // the amount of memory consumed by SQLite, the way in which 3046 // that memory is allocated and released, and the policies used to 3047 // determine exactly which parts of a database file are cached and for 3048 // how long. 3049 // 3050 // The alternative page cache mechanism is an 3051 // extreme measure that is only needed by the most demanding applications. 3052 // The built-in page cache is recommended for most uses. 3053 // 3054 // ^(The contents of the sqlite3_pcache_methods2 structure are copied to an 3055 // internal buffer by SQLite within the call to [sqlite3_config]. Hence 3056 // the application may discard the parameter after the call to 3057 // [sqlite3_config()] returns.)^ 3058 // 3059 // [[the xInit() page cache method]] 3060 // ^(The xInit() method is called once for each effective 3061 // call to [sqlite3_initialize()])^ 3062 // (usually only once during the lifetime of the process). ^(The xInit() 3063 // method is passed a copy of the sqlite3_pcache_methods2.pArg value.)^ 3064 // The intent of the xInit() method is to set up global data structures 3065 // required by the custom page cache implementation. 3066 // ^(If the xInit() method is NULL, then the 3067 // built-in default page cache is used instead of the application defined 3068 // page cache.)^ 3069 // 3070 // [[the xShutdown() page cache method]] 3071 // ^The xShutdown() method is called by [sqlite3_shutdown()]. 3072 // It can be used to clean up 3073 // any outstanding resources before process shutdown, if required. 3074 // ^The xShutdown() method may be NULL. 3075 // 3076 // ^SQLite automatically serializes calls to the xInit method, 3077 // so the xInit method need not be threadsafe. ^The 3078 // xShutdown method is only called from [sqlite3_shutdown()] so it does 3079 // not need to be threadsafe either. All other methods must be threadsafe 3080 // in multithreaded applications. 3081 // 3082 // ^SQLite will never invoke xInit() more than once without an intervening 3083 // call to xShutdown(). 3084 // 3085 // [[the xCreate() page cache methods]] 3086 // ^SQLite invokes the xCreate() method to construct a new cache instance. 3087 // SQLite will typically create one cache instance for each open database file, 3088 // though this is not guaranteed. ^The 3089 // first parameter, szPage, is the size in bytes of the pages that must 3090 // be allocated by the cache. ^szPage will always a power of two. ^The 3091 // second parameter szExtra is a number of bytes of extra storage 3092 // associated with each page cache entry. ^The szExtra parameter will 3093 // a number less than 250. SQLite will use the 3094 // extra szExtra bytes on each page to store metadata about the underlying 3095 // database page on disk. The value passed into szExtra depends 3096 // on the SQLite version, the target platform, and how SQLite was compiled. 3097 // ^The third argument to xCreate(), bPurgeable, is true if the cache being 3098 // created will be used to cache database pages of a file stored on disk, or 3099 // false if it is used for an in-memory database. The cache implementation 3100 // does not have to do anything special based with the value of bPurgeable; 3101 // it is purely advisory. ^On a cache where bPurgeable is false, SQLite will 3102 // never invoke xUnpin() except to deliberately delete a page. 3103 // ^In other words, calls to xUnpin() on a cache with bPurgeable set to 3104 // false will always have the "discard" flag set to true. 3105 // ^Hence, a cache created with bPurgeable false will 3106 // never contain any unpinned pages. 3107 // 3108 // [[the xCachesize() page cache method]] 3109 // ^(The xCachesize() method may be called at any time by SQLite to set the 3110 // suggested maximum cache-size (number of pages stored by) the cache 3111 // instance passed as the first argument. This is the value configured using 3112 // the SQLite "[PRAGMA cache_size]" command.)^ As with the bPurgeable 3113 // parameter, the implementation is not required to do anything with this 3114 // value; it is advisory only. 3115 // 3116 // [[the xPagecount() page cache methods]] 3117 // The xPagecount() method must return the number of pages currently 3118 // stored in the cache, both pinned and unpinned. 3119 // 3120 // [[the xFetch() page cache methods]] 3121 // The xFetch() method locates a page in the cache and returns a pointer to 3122 // an sqlite3_pcache_page object associated with that page, or a NULL pointer. 3123 // The pBuf element of the returned sqlite3_pcache_page object will be a 3124 // pointer to a buffer of szPage bytes used to store the content of a 3125 // single database page. The pExtra element of sqlite3_pcache_page will be 3126 // a pointer to the szExtra bytes of extra storage that SQLite has requested 3127 // for each entry in the page cache. 3128 // 3129 // The page to be fetched is determined by the key. ^The minimum key value 3130 // is 1. After it has been retrieved using xFetch, the page is considered 3131 // to be "pinned". 3132 // 3133 // If the requested page is already in the page cache, then the page cache 3134 // implementation must return a pointer to the page buffer with its content 3135 // intact. If the requested page is not already in the cache, then the 3136 // cache implementation should use the value of the createFlag 3137 // parameter to help it determined what action to take: 3138 // 3139 // <table border=1 width=85% align=center> 3140 // <tr><th> createFlag <th> Behavior when page is not already in cache 3141 // <tr><td> 0 <td> Do not allocate a new page. Return NULL. 3142 // <tr><td> 1 <td> Allocate a new page if it easy and convenient to do so. 3143 // Otherwise return NULL. 3144 // <tr><td> 2 <td> Make every effort to allocate a new page. Only return 3145 // NULL if allocating a new page is effectively impossible. 3146 // </table> 3147 // 3148 // ^(SQLite will normally invoke xFetch() with a createFlag of 0 or 1. SQLite 3149 // will only use a createFlag of 2 after a prior call with a createFlag of 1 3150 // failed.)^ In between the xFetch() calls, SQLite may 3151 // attempt to unpin one or more cache pages by spilling the content of 3152 // pinned pages to disk and synching the operating system disk cache. 3153 // 3154 // [[the xUnpin() page cache method]] 3155 // ^xUnpin() is called by SQLite with a pointer to a currently pinned page 3156 // as its second argument. If the third parameter, discard, is non-zero, 3157 // then the page must be evicted from the cache. 3158 // ^If the discard parameter is 3159 // zero, then the page may be discarded or retained at the discretion of 3160 // page cache implementation. ^The page cache implementation 3161 // may choose to evict unpinned pages at any time. 3162 // 3163 // The cache must not perform any reference counting. A single 3164 // call to xUnpin() unpins the page regardless of the number of prior calls 3165 // to xFetch(). 3166 // 3167 // [[the xRekey() page cache methods]] 3168 // The xRekey() method is used to change the key value associated with the 3169 // page passed as the second argument. If the cache 3170 // previously contains an entry associated with newKey, it must be 3171 // discarded. ^Any prior cache entry associated with newKey is guaranteed not 3172 // to be pinned. 3173 // 3174 // When SQLite calls the xTruncate() method, the cache must discard all 3175 // existing cache entries with page numbers (keys) greater than or equal 3176 // to the value of the iLimit parameter passed to xTruncate(). If any 3177 // of these pages are pinned, they are implicitly unpinned, meaning that 3178 // they can be safely discarded. 3179 // 3180 // [[the xDestroy() page cache method]] 3181 // ^The xDestroy() method is used to delete a cache allocated by xCreate(). 3182 // All resources associated with the specified cache should be freed. ^After 3183 // calling the xDestroy() method, SQLite considers the [sqlite3_pcache*] 3184 // handle invalid, and will not use it with any other sqlite3_pcache_methods2 3185 // functions. 3186 // 3187 // [[the xShrink() page cache method]] 3188 // ^SQLite invokes the xShrink() method when it wants the page cache to 3189 // free up as much of heap memory as possible. The page cache implementation 3190 // is not obligated to free any memory, but well-behaved implementations should 3191 // do their best. 3192 type sqlite3_pcache_methods2 = sqlite3_pcache_methods21 /* sqlite3.h:8540:40 */ 3193 3194 // This is the obsolete pcache_methods object that has now been replaced 3195 // by sqlite3_pcache_methods2. This object is not used by SQLite. It is 3196 // retained in the header file for backwards compatibility only. 3197 type sqlite3_pcache_methods1 = struct { 3198 pArg uintptr 3199 xInit uintptr 3200 xShutdown uintptr 3201 xCreate uintptr 3202 xCachesize uintptr 3203 xPagecount uintptr 3204 xFetch uintptr 3205 xUnpin uintptr 3206 xRekey uintptr 3207 xTruncate uintptr 3208 xDestroy uintptr 3209 } /* sqlite3.h:8563:9 */ 3210 3211 // This is the obsolete pcache_methods object that has now been replaced 3212 // by sqlite3_pcache_methods2. This object is not used by SQLite. It is 3213 // retained in the header file for backwards compatibility only. 3214 type sqlite3_pcache_methods = sqlite3_pcache_methods1 /* sqlite3.h:8563:39 */ 3215 3216 // CAPI3REF: Database Snapshot 3217 // KEYWORDS: {snapshot} {sqlite3_snapshot} 3218 // 3219 // An instance of the snapshot object records the state of a [WAL mode] 3220 // database for some specific point in history. 3221 // 3222 // In [WAL mode], multiple [database connections] that are open on the 3223 // same database file can each be reading a different historical version 3224 // of the database file. When a [database connection] begins a read 3225 // transaction, that connection sees an unchanging copy of the database 3226 // as it existed for the point in time when the transaction first started. 3227 // Subsequent changes to the database from other connections are not seen 3228 // by the reader until a new read transaction is started. 3229 // 3230 // The sqlite3_snapshot object records state information about an historical 3231 // version of the database file so that it is possible to later open a new read 3232 // transaction that sees that historical version of the database rather than 3233 // the most recent version. 3234 type sqlite3_snapshot1 = struct{ hidden [48]uint8 } /* sqlite3.h:9630:9 */ 3235 3236 // CAPI3REF: Database Snapshot 3237 // KEYWORDS: {snapshot} {sqlite3_snapshot} 3238 // 3239 // An instance of the snapshot object records the state of a [WAL mode] 3240 // database for some specific point in history. 3241 // 3242 // In [WAL mode], multiple [database connections] that are open on the 3243 // same database file can each be reading a different historical version 3244 // of the database file. When a [database connection] begins a read 3245 // transaction, that connection sees an unchanging copy of the database 3246 // as it existed for the point in time when the transaction first started. 3247 // Subsequent changes to the database from other connections are not seen 3248 // by the reader until a new read transaction is started. 3249 // 3250 // The sqlite3_snapshot object records state information about an historical 3251 // version of the database file so that it is possible to later open a new read 3252 // transaction that sees that historical version of the database rather than 3253 // the most recent version. 3254 type sqlite3_snapshot = sqlite3_snapshot1 /* sqlite3.h:9632:3 */ 3255 3256 // CAPI3REF: Flags for sqlite3_deserialize() 3257 // 3258 // The following are allowed values for 6th argument (the F argument) to 3259 // the [sqlite3_deserialize(D,S,P,N,M,F)] interface. 3260 // 3261 // The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization 3262 // in the P argument is held in memory obtained from [sqlite3_malloc64()] 3263 // and that SQLite should take ownership of this memory and automatically 3264 // free it when it has finished using it. Without this flag, the caller 3265 // is responsible for freeing any dynamically allocated memory. 3266 // 3267 // The SQLITE_DESERIALIZE_RESIZEABLE flag means that SQLite is allowed to 3268 // grow the size of the database using calls to [sqlite3_realloc64()]. This 3269 // flag should only be used if SQLITE_DESERIALIZE_FREEONCLOSE is also used. 3270 // Without this flag, the deserialized database cannot increase in size beyond 3271 // the number of bytes specified by the M parameter. 3272 // 3273 // The SQLITE_DESERIALIZE_READONLY flag means that the deserialized database 3274 // should be treated as read-only. 3275 3276 // Undo the hack that converts floating point types to integer for 3277 // builds on processors without floating point support. 3278 3279 //******* Begin file sqlite3rtree.h ******** 3280 // 2010 August 30 3281 // 3282 // The author disclaims copyright to this source code. In place of 3283 // a legal notice, here is a blessing: 3284 // 3285 // May you do good and not evil. 3286 // May you find forgiveness for yourself and forgive others. 3287 // May you share freely, never taking more than you give. 3288 // 3289 // 3290 3291 type sqlite3_rtree_geometry1 = struct { 3292 pContext uintptr 3293 nParam int32 3294 aParam uintptr 3295 pUser uintptr 3296 xDelUser uintptr 3297 } /* sqlite3.h:9957:9 */ 3298 3299 // CAPI3REF: Flags for sqlite3_deserialize() 3300 // 3301 // The following are allowed values for 6th argument (the F argument) to 3302 // the [sqlite3_deserialize(D,S,P,N,M,F)] interface. 3303 // 3304 // The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization 3305 // in the P argument is held in memory obtained from [sqlite3_malloc64()] 3306 // and that SQLite should take ownership of this memory and automatically 3307 // free it when it has finished using it. Without this flag, the caller 3308 // is responsible for freeing any dynamically allocated memory. 3309 // 3310 // The SQLITE_DESERIALIZE_RESIZEABLE flag means that SQLite is allowed to 3311 // grow the size of the database using calls to [sqlite3_realloc64()]. This 3312 // flag should only be used if SQLITE_DESERIALIZE_FREEONCLOSE is also used. 3313 // Without this flag, the deserialized database cannot increase in size beyond 3314 // the number of bytes specified by the M parameter. 3315 // 3316 // The SQLITE_DESERIALIZE_READONLY flag means that the deserialized database 3317 // should be treated as read-only. 3318 3319 // Undo the hack that converts floating point types to integer for 3320 // builds on processors without floating point support. 3321 3322 //******* Begin file sqlite3rtree.h ******** 3323 // 2010 August 30 3324 // 3325 // The author disclaims copyright to this source code. In place of 3326 // a legal notice, here is a blessing: 3327 // 3328 // May you do good and not evil. 3329 // May you find forgiveness for yourself and forgive others. 3330 // May you share freely, never taking more than you give. 3331 // 3332 // 3333 3334 type sqlite3_rtree_geometry = sqlite3_rtree_geometry1 /* sqlite3.h:9957:39 */ 3335 type sqlite3_rtree_query_info1 = struct { 3336 pContext uintptr 3337 nParam int32 3338 aParam uintptr 3339 pUser uintptr 3340 xDelUser uintptr 3341 aCoord uintptr 3342 anQueue uintptr 3343 nCoord int32 3344 iLevel int32 3345 mxLevel int32 3346 iRowid sqlite3_int64 3347 rParentScore sqlite3_rtree_dbl 3348 eParentWithin int32 3349 eWithin int32 3350 rScore sqlite3_rtree_dbl 3351 apSqlParam uintptr 3352 } /* sqlite3.h:9958:9 */ 3353 3354 type sqlite3_rtree_query_info = sqlite3_rtree_query_info1 /* sqlite3.h:9958:41 */ 3355 3356 // The double-precision datatype used by RTree depends on the 3357 // SQLITE_RTREE_INT_ONLY compile-time option. 3358 type sqlite3_rtree_dbl = float64 /* sqlite3.h:9966:18 */ 3359 3360 // CAPI3REF: Values for sqlite3session_config(). 3361 3362 // Make sure we can call this stuff from C++. 3363 3364 //******* End of sqlite3session.h ******** 3365 //******* Begin file fts5.h ******** 3366 // 2014 May 31 3367 // 3368 // The author disclaims copyright to this source code. In place of 3369 // a legal notice, here is a blessing: 3370 // 3371 // May you do good and not evil. 3372 // May you find forgiveness for yourself and forgive others. 3373 // May you share freely, never taking more than you give. 3374 // 3375 // 3376 // 3377 // Interfaces to extend FTS5. Using the interfaces defined in this file, 3378 // FTS5 may be extended with: 3379 // 3380 // * custom tokenizers, and 3381 // * custom auxiliary functions. 3382 3383 // ************************************************************************ 3384 // 3385 // CUSTOM AUXILIARY FUNCTIONS 3386 // 3387 // Virtual table implementations may overload SQL functions by implementing 3388 // the sqlite3_module.xFindFunction() method. 3389 3390 type Fts5ExtensionApi1 = struct { 3391 iVersion int32 3392 xUserData uintptr 3393 xColumnCount uintptr 3394 xRowCount uintptr 3395 xColumnTotalSize uintptr 3396 xTokenize uintptr 3397 xPhraseCount uintptr 3398 xPhraseSize uintptr 3399 xInstCount uintptr 3400 xInst uintptr 3401 xRowid uintptr 3402 xColumnText uintptr 3403 xColumnSize uintptr 3404 xQueryPhrase uintptr 3405 xSetAuxdata uintptr 3406 xGetAuxdata uintptr 3407 xPhraseFirst uintptr 3408 xPhraseNext uintptr 3409 xPhraseFirstColumn uintptr 3410 xPhraseNextColumn uintptr 3411 } /* sqlite3.h:11813:9 */ 3412 3413 // CAPI3REF: Values for sqlite3session_config(). 3414 3415 // Make sure we can call this stuff from C++. 3416 3417 //******* End of sqlite3session.h ******** 3418 //******* Begin file fts5.h ******** 3419 // 2014 May 31 3420 // 3421 // The author disclaims copyright to this source code. In place of 3422 // a legal notice, here is a blessing: 3423 // 3424 // May you do good and not evil. 3425 // May you find forgiveness for yourself and forgive others. 3426 // May you share freely, never taking more than you give. 3427 // 3428 // 3429 // 3430 // Interfaces to extend FTS5. Using the interfaces defined in this file, 3431 // FTS5 may be extended with: 3432 // 3433 // * custom tokenizers, and 3434 // * custom auxiliary functions. 3435 3436 // ************************************************************************ 3437 // 3438 // CUSTOM AUXILIARY FUNCTIONS 3439 // 3440 // Virtual table implementations may overload SQL functions by implementing 3441 // the sqlite3_module.xFindFunction() method. 3442 3443 type Fts5ExtensionApi = Fts5ExtensionApi1 /* sqlite3.h:11813:33 */ 3444 type Fts5PhraseIter1 = struct { 3445 a uintptr 3446 b uintptr 3447 } /* sqlite3.h:11815:9 */ 3448 3449 type Fts5PhraseIter = Fts5PhraseIter1 /* sqlite3.h:11815:31 */ 3450 3451 type fts5_extension_function = uintptr /* sqlite3.h:11817:14 */ 3452 type fts5_tokenizer1 = struct { 3453 xCreate uintptr 3454 xDelete uintptr 3455 xTokenize uintptr 3456 } /* sqlite3.h:12276:9 */ 3457 3458 type fts5_tokenizer = fts5_tokenizer1 /* sqlite3.h:12276:31 */ 3459 3460 // Flags that may be passed as the third argument to xTokenize() 3461 3462 // Flags that may be passed by the tokenizer implementation back to FTS5 3463 // as the third argument to the supplied xToken callback. 3464 3465 // 3466 // END OF CUSTOM TOKENIZERS 3467 // 3468 3469 // ************************************************************************ 3470 // 3471 // FTS5 EXTENSION REGISTRATION API 3472 type fts5_api1 = struct { 3473 iVersion int32 3474 xCreateTokenizer uintptr 3475 xFindTokenizer uintptr 3476 xCreateFunction uintptr 3477 } /* sqlite3.h:12312:9 */ 3478 3479 // Flags that may be passed as the third argument to xTokenize() 3480 3481 // Flags that may be passed by the tokenizer implementation back to FTS5 3482 // as the third argument to the supplied xToken callback. 3483 3484 // 3485 // END OF CUSTOM TOKENIZERS 3486 // 3487 3488 // ************************************************************************ 3489 // 3490 // FTS5 EXTENSION REGISTRATION API 3491 type fts5_api = fts5_api1 /* sqlite3.h:12312:25 */ 3492 3493 // The tag name of this struct is _G_fpos_t to preserve historic 3494 // C++ mangled names for functions taking fpos_t arguments. 3495 // That name should not be used in new code. 3496 type _G_fpos_t = struct { 3497 __pos int32 3498 __state struct { 3499 __count int32 3500 __value struct{ __wch uint32 } 3501 } 3502 } /* __fpos_t.h:10:9 */ 3503 3504 // bits/types.h -- definitions of __*_t types underlying *_t types. 3505 // Copyright (C) 2002-2018 Free Software Foundation, Inc. 3506 // This file is part of the GNU C Library. 3507 // 3508 // The GNU C Library is free software; you can redistribute it and/or 3509 // modify it under the terms of the GNU Lesser General Public 3510 // License as published by the Free Software Foundation; either 3511 // version 2.1 of the License, or (at your option) any later version. 3512 // 3513 // The GNU C Library is distributed in the hope that it will be useful, 3514 // but WITHOUT ANY WARRANTY; without even the implied warranty of 3515 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 3516 // Lesser General Public License for more details. 3517 // 3518 // You should have received a copy of the GNU Lesser General Public 3519 // License along with the GNU C Library; if not, see 3520 // <http://www.gnu.org/licenses/>. 3521 3522 // Never include this file directly; use <sys/types.h> instead. 3523 3524 // The tag name of this struct is _G_fpos64_t to preserve historic 3525 // C++ mangled names for functions taking fpos_t and/or fpos64_t 3526 // arguments. That name should not be used in new code. 3527 type _G_fpos64_t = struct { 3528 __pos int64 3529 __state struct { 3530 __count int32 3531 __value struct{ __wch uint32 } 3532 } 3533 } /* __fpos64_t.h:10:9 */ 3534 3535 type _IO_FILE = struct { 3536 _flags int32 3537 _IO_read_ptr uintptr 3538 _IO_read_end uintptr 3539 _IO_read_base uintptr 3540 _IO_write_base uintptr 3541 _IO_write_ptr uintptr 3542 _IO_write_end uintptr 3543 _IO_buf_base uintptr 3544 _IO_buf_end uintptr 3545 _IO_save_base uintptr 3546 _IO_backup_base uintptr 3547 _IO_save_end uintptr 3548 _markers uintptr 3549 _chain uintptr 3550 _fileno int32 3551 _flags2 int32 3552 _old_offset int32 3553 _cur_column uint16 3554 _vtable_offset int8 3555 _shortbuf [1]int8 3556 _lock uintptr 3557 _offset int64 3558 _codecvt uintptr 3559 _wide_data uintptr 3560 _freeres_list uintptr 3561 _freeres_buf uintptr 3562 __pad5 size_t 3563 _mode int32 3564 _unused2 [40]int8 3565 } /* __FILE.h:4:1 */ 3566 3567 // The opaque type of streams. This is the definition used elsewhere. 3568 type FILE = _IO_FILE /* FILE.h:7:25 */ 3569 3570 // These macros are used by bits/stdio.h and internal headers. 3571 3572 // Many more flag bits are defined internally. 3573 3574 type off_t = int64 /* stdio.h:65:19 */ 3575 3576 type ssize_t = int32 /* stdio.h:77:19 */ 3577 3578 // The type of the second argument to `fgetpos' and `fsetpos'. 3579 type fpos_t = _G_fpos64_t /* stdio.h:86:20 */ 3580 3581 // If we are compiling with optimizing read this file. It contains 3582 // several optimizing inline functions and macros. 3583 3584 // Copyright (C) 1991-2018 Free Software Foundation, Inc. 3585 // This file is part of the GNU C Library. 3586 // 3587 // The GNU C Library is free software; you can redistribute it and/or 3588 // modify it under the terms of the GNU Lesser General Public 3589 // License as published by the Free Software Foundation; either 3590 // version 2.1 of the License, or (at your option) any later version. 3591 // 3592 // The GNU C Library is distributed in the hope that it will be useful, 3593 // but WITHOUT ANY WARRANTY; without even the implied warranty of 3594 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 3595 // Lesser General Public License for more details. 3596 // 3597 // You should have received a copy of the GNU Lesser General Public 3598 // License along with the GNU C Library; if not, see 3599 // <http://www.gnu.org/licenses/>. 3600 3601 // POSIX Standard: 2.10 Symbolic Constants <unistd.h> 3602 3603 // Copyright (C) 1991-2018 Free Software Foundation, Inc. 3604 // This file is part of the GNU C Library. 3605 // 3606 // The GNU C Library is free software; you can redistribute it and/or 3607 // modify it under the terms of the GNU Lesser General Public 3608 // License as published by the Free Software Foundation; either 3609 // version 2.1 of the License, or (at your option) any later version. 3610 // 3611 // The GNU C Library is distributed in the hope that it will be useful, 3612 // but WITHOUT ANY WARRANTY; without even the implied warranty of 3613 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 3614 // Lesser General Public License for more details. 3615 // 3616 // You should have received a copy of the GNU Lesser General Public 3617 // License along with the GNU C Library; if not, see 3618 // <http://www.gnu.org/licenses/>. 3619 3620 // These may be used to determine what facilities are present at compile time. 3621 // Their values can be obtained at run time from `sysconf'. 3622 3623 // POSIX Standard approved as ISO/IEC 9945-1 as of September 2008. 3624 3625 // These are not #ifdef __USE_POSIX2 because they are 3626 // in the theoretically application-owned namespace. 3627 3628 // The utilities on GNU systems also correspond to this version. 3629 3630 // The utilities on GNU systems also correspond to this version. 3631 3632 // This symbol was required until the 2001 edition of POSIX. 3633 3634 // If defined, the implementation supports the 3635 // C Language Bindings Option. 3636 3637 // If defined, the implementation supports the 3638 // C Language Development Utilities Option. 3639 3640 // If defined, the implementation supports the 3641 // Software Development Utilities Option. 3642 3643 // If defined, the implementation supports the 3644 // creation of locales with the localedef utility. 3645 3646 // X/Open version number to which the library conforms. It is selectable. 3647 3648 // Commands and utilities from XPG4 are available. 3649 3650 // We are compatible with the old published standards as well. 3651 3652 // The X/Open Unix extensions are available. 3653 3654 // The enhanced internationalization capabilities according to XPG4.2 3655 // are present. 3656 3657 // The legacy interfaces are also available. 3658 3659 // Get values of POSIX options: 3660 // 3661 // If these symbols are defined, the corresponding features are 3662 // always available. If not, they may be available sometimes. 3663 // The current values can be obtained with `sysconf'. 3664 // 3665 // _POSIX_JOB_CONTROL Job control is supported. 3666 // _POSIX_SAVED_IDS Processes have a saved set-user-ID 3667 // and a saved set-group-ID. 3668 // _POSIX_REALTIME_SIGNALS Real-time, queued signals are supported. 3669 // _POSIX_PRIORITY_SCHEDULING Priority scheduling is supported. 3670 // _POSIX_TIMERS POSIX.4 clocks and timers are supported. 3671 // _POSIX_ASYNCHRONOUS_IO Asynchronous I/O is supported. 3672 // _POSIX_PRIORITIZED_IO Prioritized asynchronous I/O is supported. 3673 // _POSIX_SYNCHRONIZED_IO Synchronizing file data is supported. 3674 // _POSIX_FSYNC The fsync function is present. 3675 // _POSIX_MAPPED_FILES Mapping of files to memory is supported. 3676 // _POSIX_MEMLOCK Locking of all memory is supported. 3677 // _POSIX_MEMLOCK_RANGE Locking of ranges of memory is supported. 3678 // _POSIX_MEMORY_PROTECTION Setting of memory protections is supported. 3679 // _POSIX_MESSAGE_PASSING POSIX.4 message queues are supported. 3680 // _POSIX_SEMAPHORES POSIX.4 counting semaphores are supported. 3681 // _POSIX_SHARED_MEMORY_OBJECTS POSIX.4 shared memory objects are supported. 3682 // _POSIX_THREADS POSIX.1c pthreads are supported. 3683 // _POSIX_THREAD_ATTR_STACKADDR Thread stack address attribute option supported. 3684 // _POSIX_THREAD_ATTR_STACKSIZE Thread stack size attribute option supported. 3685 // _POSIX_THREAD_SAFE_FUNCTIONS Thread-safe functions are supported. 3686 // _POSIX_THREAD_PRIORITY_SCHEDULING 3687 // POSIX.1c thread execution scheduling supported. 3688 // _POSIX_THREAD_PRIO_INHERIT Thread priority inheritance option supported. 3689 // _POSIX_THREAD_PRIO_PROTECT Thread priority protection option supported. 3690 // _POSIX_THREAD_PROCESS_SHARED Process-shared synchronization supported. 3691 // _POSIX_PII Protocol-independent interfaces are supported. 3692 // _POSIX_PII_XTI XTI protocol-indep. interfaces are supported. 3693 // _POSIX_PII_SOCKET Socket protocol-indep. interfaces are supported. 3694 // _POSIX_PII_INTERNET Internet family of protocols supported. 3695 // _POSIX_PII_INTERNET_STREAM Connection-mode Internet protocol supported. 3696 // _POSIX_PII_INTERNET_DGRAM Connectionless Internet protocol supported. 3697 // _POSIX_PII_OSI ISO/OSI family of protocols supported. 3698 // _POSIX_PII_OSI_COTS Connection-mode ISO/OSI service supported. 3699 // _POSIX_PII_OSI_CLTS Connectionless ISO/OSI service supported. 3700 // _POSIX_POLL Implementation supports `poll' function. 3701 // _POSIX_SELECT Implementation supports `select' and `pselect'. 3702 // 3703 // _XOPEN_REALTIME X/Open realtime support is available. 3704 // _XOPEN_REALTIME_THREADS X/Open realtime thread support is available. 3705 // _XOPEN_SHM Shared memory interface according to XPG4.2. 3706 // 3707 // _XBS5_ILP32_OFF32 Implementation provides environment with 32-bit 3708 // int, long, pointer, and off_t types. 3709 // _XBS5_ILP32_OFFBIG Implementation provides environment with 32-bit 3710 // int, long, and pointer and off_t with at least 3711 // 64 bits. 3712 // _XBS5_LP64_OFF64 Implementation provides environment with 32-bit 3713 // int, and 64-bit long, pointer, and off_t types. 3714 // _XBS5_LPBIG_OFFBIG Implementation provides environment with at 3715 // least 32 bits int and long, pointer, and off_t 3716 // with at least 64 bits. 3717 // 3718 // If any of these symbols is defined as -1, the corresponding option is not 3719 // true for any file. If any is defined as other than -1, the corresponding 3720 // option is true for all files. If a symbol is not defined at all, the value 3721 // for a specific file can be obtained from `pathconf' and `fpathconf'. 3722 // 3723 // _POSIX_CHOWN_RESTRICTED Only the super user can use `chown' to change 3724 // the owner of a file. `chown' can only be used 3725 // to change the group ID of a file to a group of 3726 // which the calling process is a member. 3727 // _POSIX_NO_TRUNC Pathname components longer than 3728 // NAME_MAX generate an error. 3729 // _POSIX_VDISABLE If defined, if the value of an element of the 3730 // `c_cc' member of `struct termios' is 3731 // _POSIX_VDISABLE, no character will have the 3732 // effect associated with that element. 3733 // _POSIX_SYNC_IO Synchronous I/O may be performed. 3734 // _POSIX_ASYNC_IO Asynchronous I/O may be performed. 3735 // _POSIX_PRIO_IO Prioritized Asynchronous I/O may be performed. 3736 // 3737 // Support for the Large File Support interface is not generally available. 3738 // If it is available the following constants are defined to one. 3739 // _LFS64_LARGEFILE Low-level I/O supports large files. 3740 // _LFS64_STDIO Standard I/O supports large files. 3741 // 3742 3743 // Define POSIX options for Linux. 3744 // Copyright (C) 1996-2018 Free Software Foundation, Inc. 3745 // This file is part of the GNU C Library. 3746 // 3747 // The GNU C Library is free software; you can redistribute it and/or 3748 // modify it under the terms of the GNU Lesser General Public License as 3749 // published by the Free Software Foundation; either version 2.1 of the 3750 // License, or (at your option) any later version. 3751 // 3752 // The GNU C Library is distributed in the hope that it will be useful, 3753 // but WITHOUT ANY WARRANTY; without even the implied warranty of 3754 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 3755 // Lesser General Public License for more details. 3756 // 3757 // You should have received a copy of the GNU Lesser General Public 3758 // License along with the GNU C Library; see the file COPYING.LIB. If 3759 // not, see <http://www.gnu.org/licenses/>. 3760 3761 // Job control is supported. 3762 3763 // Processes have a saved set-user-ID and a saved set-group-ID. 3764 3765 // Priority scheduling is supported. 3766 3767 // Synchronizing file data is supported. 3768 3769 // The fsync function is present. 3770 3771 // Mapping of files to memory is supported. 3772 3773 // Locking of all memory is supported. 3774 3775 // Locking of ranges of memory is supported. 3776 3777 // Setting of memory protections is supported. 3778 3779 // Some filesystems allow all users to change file ownership. 3780 3781 // `c_cc' member of 'struct termios' structure can be disabled by 3782 // using the value _POSIX_VDISABLE. 3783 3784 // Filenames are not silently truncated. 3785 3786 // X/Open realtime support is available. 3787 3788 // X/Open thread realtime support is available. 3789 3790 // XPG4.2 shared memory is supported. 3791 3792 // Tell we have POSIX threads. 3793 3794 // We have the reentrant functions described in POSIX. 3795 3796 // We provide priority scheduling for threads. 3797 3798 // We support user-defined stack sizes. 3799 3800 // We support user-defined stacks. 3801 3802 // We support priority inheritence. 3803 3804 // We support priority protection, though only for non-robust 3805 // mutexes. 3806 3807 // We support priority inheritence for robust mutexes. 3808 3809 // We do not support priority protection for robust mutexes. 3810 3811 // We support POSIX.1b semaphores. 3812 3813 // Real-time signals are supported. 3814 3815 // We support asynchronous I/O. 3816 // Alternative name for Unix98. 3817 // Support for prioritization is also available. 3818 3819 // The LFS support in asynchronous I/O is also available. 3820 3821 // The rest of the LFS is also available. 3822 3823 // POSIX shared memory objects are implemented. 3824 3825 // CPU-time clocks support needs to be checked at runtime. 3826 3827 // Clock support in threads must be also checked at runtime. 3828 3829 // GNU libc provides regular expression handling. 3830 3831 // Reader/Writer locks are available. 3832 3833 // We have a POSIX shell. 3834 3835 // We support the Timeouts option. 3836 3837 // We support spinlocks. 3838 3839 // The `spawn' function family is supported. 3840 3841 // We have POSIX timers. 3842 3843 // The barrier functions are available. 3844 3845 // POSIX message queues are available. 3846 3847 // Thread process-shared synchronization is supported. 3848 3849 // The monotonic clock might be available. 3850 3851 // The clock selection interfaces are available. 3852 3853 // Advisory information interfaces are available. 3854 3855 // IPv6 support is available. 3856 3857 // Raw socket support is available. 3858 3859 // We have at least one terminal. 3860 3861 // Neither process nor thread sporadic server interfaces is available. 3862 3863 // trace.h is not available. 3864 3865 // Typed memory objects are not available. 3866 3867 // Get the environment definitions from Unix98. 3868 // Copyright (C) 1999-2018 Free Software Foundation, Inc. 3869 // This file is part of the GNU C Library. 3870 // 3871 // The GNU C Library is free software; you can redistribute it and/or 3872 // modify it under the terms of the GNU Lesser General Public 3873 // License as published by the Free Software Foundation; either 3874 // version 2.1 of the License, or (at your option) any later version. 3875 // 3876 // The GNU C Library is distributed in the hope that it will be useful, 3877 // but WITHOUT ANY WARRANTY; without even the implied warranty of 3878 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 3879 // Lesser General Public License for more details. 3880 // 3881 // You should have received a copy of the GNU Lesser General Public 3882 // License along with the GNU C Library; if not, see 3883 // <http://www.gnu.org/licenses/>. 3884 3885 // Determine the wordsize from the preprocessor defines. 3886 3887 // This header should define the following symbols under the described 3888 // situations. A value `1' means that the model is always supported, 3889 // `-1' means it is never supported. Undefined means it cannot be 3890 // statically decided. 3891 // 3892 // _POSIX_V7_ILP32_OFF32 32bit int, long, pointers, and off_t type 3893 // _POSIX_V7_ILP32_OFFBIG 32bit int, long, and pointers and larger off_t type 3894 // 3895 // _POSIX_V7_LP64_OFF32 64bit long and pointers and 32bit off_t type 3896 // _POSIX_V7_LPBIG_OFFBIG 64bit long and pointers and large off_t type 3897 // 3898 // The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG, 3899 // _POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32, 3900 // _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were 3901 // used in previous versions of the Unix standard and are available 3902 // only for compatibility. 3903 3904 // We have 32-bit wide `int', `long int' and pointers and all platforms 3905 // support LFS. -mx32 has 64-bit wide `off_t'. 3906 3907 // -m32 has 32-bit wide `off_t'. 3908 3909 // We optionally provide an environment with the above size but an 64-bit 3910 // side `off_t'. Therefore we don't define _POSIX_V7_ILP32_OFFBIG. 3911 3912 // Environments with 64-bit wide pointers can be provided, 3913 // so these macros aren't defined: 3914 // # undef _POSIX_V7_LP64_OFF64 3915 // # undef _POSIX_V7_LPBIG_OFFBIG 3916 // # undef _POSIX_V6_LP64_OFF64 3917 // # undef _POSIX_V6_LPBIG_OFFBIG 3918 // # undef _XBS5_LP64_OFF64 3919 // # undef _XBS5_LPBIG_OFFBIG 3920 // and sysconf tests for it at runtime. 3921 3922 // Standard file descriptors. 3923 3924 // All functions that are not declared anywhere else. 3925 3926 // bits/types.h -- definitions of __*_t types underlying *_t types. 3927 // Copyright (C) 2002-2018 Free Software Foundation, Inc. 3928 // This file is part of the GNU C Library. 3929 // 3930 // The GNU C Library is free software; you can redistribute it and/or 3931 // modify it under the terms of the GNU Lesser General Public 3932 // License as published by the Free Software Foundation; either 3933 // version 2.1 of the License, or (at your option) any later version. 3934 // 3935 // The GNU C Library is distributed in the hope that it will be useful, 3936 // but WITHOUT ANY WARRANTY; without even the implied warranty of 3937 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 3938 // Lesser General Public License for more details. 3939 // 3940 // You should have received a copy of the GNU Lesser General Public 3941 // License along with the GNU C Library; if not, see 3942 // <http://www.gnu.org/licenses/>. 3943 3944 // Never include this file directly; use <sys/types.h> instead. 3945 3946 // Copyright (C) 1989-2018 Free Software Foundation, Inc. 3947 // 3948 // This file is part of GCC. 3949 // 3950 // GCC is free software; you can redistribute it and/or modify 3951 // it under the terms of the GNU General Public License as published by 3952 // the Free Software Foundation; either version 3, or (at your option) 3953 // any later version. 3954 // 3955 // GCC is distributed in the hope that it will be useful, 3956 // but WITHOUT ANY WARRANTY; without even the implied warranty of 3957 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 3958 // GNU General Public License for more details. 3959 // 3960 // Under Section 7 of GPL version 3, you are granted additional 3961 // permissions described in the GCC Runtime Library Exception, version 3962 // 3.1, as published by the Free Software Foundation. 3963 // 3964 // You should have received a copy of the GNU General Public License and 3965 // a copy of the GCC Runtime Library Exception along with this program; 3966 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 3967 // <http://www.gnu.org/licenses/>. 3968 3969 // ISO C Standard: 7.17 Common definitions <stddef.h> 3970 3971 // Any one of these symbols __need_* means that GNU libc 3972 // wants us just to define one data type. So don't define 3973 // the symbols that indicate this file's entire job has been done. 3974 3975 // This avoids lossage on SunOS but only if stdtypes.h comes first. 3976 // There's no way to win with the other order! Sun lossage. 3977 3978 // On 4.3bsd-net2, make sure ansi.h is included, so we have 3979 // one less case to deal with in the following. 3980 // On FreeBSD 5, machine/ansi.h does not exist anymore... 3981 3982 // In 4.3bsd-net2, machine/ansi.h defines these symbols, which are 3983 // defined if the corresponding type is *not* defined. 3984 // FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_. 3985 // NetBSD defines _I386_ANSI_H_ and _X86_64_ANSI_H_ instead of _ANSI_H_ 3986 3987 // Sequent's header files use _PTRDIFF_T_ in some conflicting way. 3988 // Just ignore it. 3989 3990 // On VxWorks, <type/vxTypesBase.h> may have defined macros like 3991 // _TYPE_size_t which will typedef size_t. fixincludes patched the 3992 // vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is 3993 // not defined, and so that defining this macro defines _GCC_SIZE_T. 3994 // If we find that the macros are still defined at this point, we must 3995 // invoke them so that the type is defined as expected. 3996 3997 // In case nobody has defined these types, but we aren't running under 3998 // GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and 3999 // __WCHAR_TYPE__ have reasonable values. This can happen if the 4000 // parts of GCC is compiled by an older compiler, that actually 4001 // include gstddef.h, such as collect2. 4002 4003 // Signed type of difference of two pointers. 4004 4005 // Define this type if we are doing the whole job, 4006 // or if we want this type in particular. 4007 4008 // Unsigned type of `sizeof' something. 4009 4010 // Define this type if we are doing the whole job, 4011 // or if we want this type in particular. 4012 4013 // Wide character type. 4014 // Locale-writers should change this as necessary to 4015 // be big enough to hold unique values not between 0 and 127, 4016 // and not (wchar_t) -1, for each defined multibyte character. 4017 4018 // Define this type if we are doing the whole job, 4019 // or if we want this type in particular. 4020 4021 // In 4.3bsd-net2, leave these undefined to indicate that size_t, etc. 4022 // are already defined. 4023 // BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here. 4024 // NetBSD 5 requires the I386_ANSI_H and X86_64_ANSI_H checks here. 4025 4026 // A null pointer constant. 4027 4028 // The Single Unix specification says that some more types are 4029 // available here. 4030 type gid_t = uint32 /* unistd.h:232:17 */ 4031 4032 type uid_t = uint32 /* unistd.h:237:17 */ 4033 4034 type useconds_t = uint32 /* unistd.h:255:22 */ 4035 4036 type pid_t = int32 /* unistd.h:260:17 */ 4037 4038 type intptr_t = int32 /* unistd.h:267:20 */ 4039 4040 type socklen_t = uint32 /* unistd.h:274:21 */ 4041 4042 // In 4.3bsd-net2, leave these undefined to indicate that size_t, etc. 4043 // are already defined. 4044 // BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here. 4045 // NetBSD 5 requires the I386_ANSI_H and X86_64_ANSI_H checks here. 4046 4047 // A null pointer constant. 4048 4049 // XPG requires a few symbols from <sys/wait.h> being defined. 4050 // Definitions of flag bits for `waitpid' et al. 4051 // Copyright (C) 1992-2018 Free Software Foundation, Inc. 4052 // This file is part of the GNU C Library. 4053 // 4054 // The GNU C Library is free software; you can redistribute it and/or 4055 // modify it under the terms of the GNU Lesser General Public 4056 // License as published by the Free Software Foundation; either 4057 // version 2.1 of the License, or (at your option) any later version. 4058 // 4059 // The GNU C Library is distributed in the hope that it will be useful, 4060 // but WITHOUT ANY WARRANTY; without even the implied warranty of 4061 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 4062 // Lesser General Public License for more details. 4063 // 4064 // You should have received a copy of the GNU Lesser General Public 4065 // License along with the GNU C Library; if not, see 4066 // <http://www.gnu.org/licenses/>. 4067 4068 // Bits in the third argument to `waitpid'. 4069 4070 // Bits in the fourth argument to `waitid'. 4071 4072 // The following values are used by the `waitid' function. 4073 4074 // The Linux kernel defines these bare, rather than an enum, 4075 // which causes a conflict if the include order is reversed. 4076 4077 type idtype_t = uint32 /* waitflags.h:57:3 */ 4078 // Definitions of status bits for `wait' et al. 4079 // Copyright (C) 1992-2018 Free Software Foundation, Inc. 4080 // This file is part of the GNU C Library. 4081 // 4082 // The GNU C Library is free software; you can redistribute it and/or 4083 // modify it under the terms of the GNU Lesser General Public 4084 // License as published by the Free Software Foundation; either 4085 // version 2.1 of the License, or (at your option) any later version. 4086 // 4087 // The GNU C Library is distributed in the hope that it will be useful, 4088 // but WITHOUT ANY WARRANTY; without even the implied warranty of 4089 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 4090 // Lesser General Public License for more details. 4091 // 4092 // You should have received a copy of the GNU Lesser General Public 4093 // License along with the GNU C Library; if not, see 4094 // <http://www.gnu.org/licenses/>. 4095 4096 // Everything extant so far uses these same bits. 4097 4098 // If WIFEXITED(STATUS), the low-order 8 bits of the status. 4099 4100 // If WIFSIGNALED(STATUS), the terminating signal. 4101 4102 // If WIFSTOPPED(STATUS), the signal that stopped the child. 4103 4104 // Nonzero if STATUS indicates normal termination. 4105 4106 // Nonzero if STATUS indicates termination by a signal. 4107 4108 // Nonzero if STATUS indicates the child is stopped. 4109 4110 // Nonzero if STATUS indicates the child continued after a stop. We only 4111 // define this if <bits/waitflags.h> provides the WCONTINUED flag bit. 4112 4113 // Nonzero if STATUS indicates the child dumped core. 4114 4115 // Macros for constructing status values. 4116 4117 // Define the macros <sys/wait.h> also would define this way. 4118 4119 // _FloatN API tests for enablement. 4120 // Macros to control TS 18661-3 glibc features on x86. 4121 // Copyright (C) 2017-2018 Free Software Foundation, Inc. 4122 // This file is part of the GNU C Library. 4123 // 4124 // The GNU C Library is free software; you can redistribute it and/or 4125 // modify it under the terms of the GNU Lesser General Public 4126 // License as published by the Free Software Foundation; either 4127 // version 2.1 of the License, or (at your option) any later version. 4128 // 4129 // The GNU C Library is distributed in the hope that it will be useful, 4130 // but WITHOUT ANY WARRANTY; without even the implied warranty of 4131 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 4132 // Lesser General Public License for more details. 4133 // 4134 // You should have received a copy of the GNU Lesser General Public 4135 // License along with the GNU C Library; if not, see 4136 // <http://www.gnu.org/licenses/>. 4137 4138 // Copyright (C) 1991-2018 Free Software Foundation, Inc. 4139 // This file is part of the GNU C Library. 4140 // 4141 // The GNU C Library is free software; you can redistribute it and/or 4142 // modify it under the terms of the GNU Lesser General Public 4143 // License as published by the Free Software Foundation; either 4144 // version 2.1 of the License, or (at your option) any later version. 4145 // 4146 // The GNU C Library is distributed in the hope that it will be useful, 4147 // but WITHOUT ANY WARRANTY; without even the implied warranty of 4148 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 4149 // Lesser General Public License for more details. 4150 // 4151 // You should have received a copy of the GNU Lesser General Public 4152 // License along with the GNU C Library; if not, see 4153 // <http://www.gnu.org/licenses/>. 4154 4155 // Defined to 1 if the current compiler invocation provides a 4156 // floating-point type with the IEEE 754 binary128 format, and this 4157 // glibc includes corresponding *f128 interfaces for it. The required 4158 // libgcc support was added some time after the basic compiler 4159 // support, for x86_64 and x86. 4160 4161 // Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct 4162 // from the default float, double and long double types in this glibc. 4163 4164 // Defined to 1 if the current compiler invocation provides a 4165 // floating-point type with the right format for _Float64x, and this 4166 // glibc includes corresponding *f64x interfaces for it. 4167 4168 // Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format 4169 // of long double. Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has 4170 // the format of _Float128, which must be different from that of long 4171 // double. 4172 4173 // Defined to concatenate the literal suffix to be used with _Float128 4174 // types, if __HAVE_FLOAT128 is 1. 4175 4176 // Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. 4177 4178 // The remaining of this file provides support for older compilers. 4179 4180 // The type _Float128 exists only since GCC 7.0. 4181 4182 // __builtin_huge_valf128 doesn't exist before GCC 7.0. 4183 4184 // Older GCC has only a subset of built-in functions for _Float128 on 4185 // x86, and __builtin_infq is not usable in static initializers. 4186 // Converting a narrower sNaN to _Float128 produces a quiet NaN, so 4187 // attempts to use _Float128 sNaNs will not work properly with older 4188 // compilers. 4189 4190 // In math/math.h, __MATH_TG will expand signbit to __builtin_signbit*, 4191 // e.g.: __builtin_signbitf128, before GCC 6. However, there has never 4192 // been a __builtin_signbitf128 in GCC and the type-generic builtin is 4193 // only available since GCC 6. 4194 4195 // Macros to control TS 18661-3 glibc features where the same 4196 // definitions are appropriate for all platforms. 4197 // Copyright (C) 2017-2018 Free Software Foundation, Inc. 4198 // This file is part of the GNU C Library. 4199 // 4200 // The GNU C Library is free software; you can redistribute it and/or 4201 // modify it under the terms of the GNU Lesser General Public 4202 // License as published by the Free Software Foundation; either 4203 // version 2.1 of the License, or (at your option) any later version. 4204 // 4205 // The GNU C Library is distributed in the hope that it will be useful, 4206 // but WITHOUT ANY WARRANTY; without even the implied warranty of 4207 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 4208 // Lesser General Public License for more details. 4209 // 4210 // You should have received a copy of the GNU Lesser General Public 4211 // License along with the GNU C Library; if not, see 4212 // <http://www.gnu.org/licenses/>. 4213 4214 // Copyright (C) 1991-2018 Free Software Foundation, Inc. 4215 // This file is part of the GNU C Library. 4216 // 4217 // The GNU C Library is free software; you can redistribute it and/or 4218 // modify it under the terms of the GNU Lesser General Public 4219 // License as published by the Free Software Foundation; either 4220 // version 2.1 of the License, or (at your option) any later version. 4221 // 4222 // The GNU C Library is distributed in the hope that it will be useful, 4223 // but WITHOUT ANY WARRANTY; without even the implied warranty of 4224 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 4225 // Lesser General Public License for more details. 4226 // 4227 // You should have received a copy of the GNU Lesser General Public 4228 // License along with the GNU C Library; if not, see 4229 // <http://www.gnu.org/licenses/>. 4230 4231 // Properties of long double type. ldbl-96 version. 4232 // Copyright (C) 2016-2018 Free Software Foundation, Inc. 4233 // This file is part of the GNU C Library. 4234 // 4235 // The GNU C Library is free software; you can redistribute it and/or 4236 // modify it under the terms of the GNU Lesser General Public 4237 // License published by the Free Software Foundation; either 4238 // version 2.1 of the License, or (at your option) any later version. 4239 // 4240 // The GNU C Library is distributed in the hope that it will be useful, 4241 // but WITHOUT ANY WARRANTY; without even the implied warranty of 4242 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 4243 // Lesser General Public License for more details. 4244 // 4245 // You should have received a copy of the GNU Lesser General Public 4246 // License along with the GNU C Library; if not, see 4247 // <http://www.gnu.org/licenses/>. 4248 4249 // long double is distinct from double, so there is nothing to 4250 // define here. 4251 4252 // This header should be included at the bottom of each bits/floatn.h. 4253 // It defines the following macros for each _FloatN and _FloatNx type, 4254 // where the same definitions, or definitions based only on the macros 4255 // in bits/floatn.h, are appropriate for all glibc configurations. 4256 4257 // Defined to 1 if the current compiler invocation provides a 4258 // floating-point type with the right format for this type, and this 4259 // glibc includes corresponding *fN or *fNx interfaces for it. 4260 4261 // Defined to 1 if the corresponding __HAVE_<type> macro is 1 and the 4262 // type is the first with its format in the sequence of (the default 4263 // choices for) float, double, long double, _Float16, _Float32, 4264 // _Float64, _Float128, _Float32x, _Float64x, _Float128x for this 4265 // glibc; that is, if functions present once per floating-point format 4266 // rather than once per type are present for this type. 4267 // 4268 // All configurations supported by glibc have _Float32 the same format 4269 // as float, _Float64 and _Float32x the same format as double, the 4270 // _Float64x the same format as either long double or _Float128. No 4271 // configurations support _Float128x or, as of GCC 7, have compiler 4272 // support for a type meeting the requirements for _Float128x. 4273 4274 // Defined to 1 if the corresponding _FloatN type is not binary compatible 4275 // with the corresponding ISO C type in the current compilation unit as 4276 // opposed to __HAVE_DISTINCT_FLOATN, which indicates the default types built 4277 // in glibc. 4278 4279 // Defined to 1 if any _FloatN or _FloatNx types that are not 4280 // ABI-distinct are however distinct types at the C language level (so 4281 // for the purposes of __builtin_types_compatible_p and _Generic). 4282 4283 // Defined to concatenate the literal suffix to be used with _FloatN 4284 // or _FloatNx types, if __HAVE_<type> is 1. The corresponding 4285 // literal suffixes exist since GCC 7, for C only. 4286 4287 // Defined to a complex type if __HAVE_<type> is 1. 4288 4289 // The remaining of this file provides support for older compilers. 4290 4291 // If double, long double and _Float64 all have the same set of 4292 // values, TS 18661-3 requires the usual arithmetic conversions on 4293 // long double and _Float64 to produce _Float64. For this to be the 4294 // case when building with a compiler without a distinct _Float64 4295 // type, _Float64 must be a typedef for long double, not for 4296 // double. 4297 4298 // Returned by `div'. 4299 type div_t = struct { 4300 quot int32 4301 rem int32 4302 } /* stdlib.h:62:5 */ 4303 4304 // Returned by `ldiv'. 4305 type ldiv_t = struct { 4306 quot int32 4307 rem int32 4308 } /* stdlib.h:70:5 */ 4309 4310 // Returned by `lldiv'. 4311 type lldiv_t = struct { 4312 quot int64 4313 rem int64 4314 } /* stdlib.h:80:5 */ 4315 4316 // Copyright (C) 1991-2018 Free Software Foundation, Inc. 4317 // This file is part of the GNU C Library. 4318 // 4319 // The GNU C Library is free software; you can redistribute it and/or 4320 // modify it under the terms of the GNU Lesser General Public 4321 // License as published by the Free Software Foundation; either 4322 // version 2.1 of the License, or (at your option) any later version. 4323 // 4324 // The GNU C Library is distributed in the hope that it will be useful, 4325 // but WITHOUT ANY WARRANTY; without even the implied warranty of 4326 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 4327 // Lesser General Public License for more details. 4328 // 4329 // You should have received a copy of the GNU Lesser General Public 4330 // License along with the GNU C Library; if not, see 4331 // <http://www.gnu.org/licenses/>. 4332 4333 // POSIX Standard: 2.6 Primitive System Data Types <sys/types.h> 4334 4335 // Copyright (C) 1991-2018 Free Software Foundation, Inc. 4336 // This file is part of the GNU C Library. 4337 // 4338 // The GNU C Library is free software; you can redistribute it and/or 4339 // modify it under the terms of the GNU Lesser General Public 4340 // License as published by the Free Software Foundation; either 4341 // version 2.1 of the License, or (at your option) any later version. 4342 // 4343 // The GNU C Library is distributed in the hope that it will be useful, 4344 // but WITHOUT ANY WARRANTY; without even the implied warranty of 4345 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 4346 // Lesser General Public License for more details. 4347 // 4348 // You should have received a copy of the GNU Lesser General Public 4349 // License along with the GNU C Library; if not, see 4350 // <http://www.gnu.org/licenses/>. 4351 4352 // bits/types.h -- definitions of __*_t types underlying *_t types. 4353 // Copyright (C) 2002-2018 Free Software Foundation, Inc. 4354 // This file is part of the GNU C Library. 4355 // 4356 // The GNU C Library is free software; you can redistribute it and/or 4357 // modify it under the terms of the GNU Lesser General Public 4358 // License as published by the Free Software Foundation; either 4359 // version 2.1 of the License, or (at your option) any later version. 4360 // 4361 // The GNU C Library is distributed in the hope that it will be useful, 4362 // but WITHOUT ANY WARRANTY; without even the implied warranty of 4363 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 4364 // Lesser General Public License for more details. 4365 // 4366 // You should have received a copy of the GNU Lesser General Public 4367 // License along with the GNU C Library; if not, see 4368 // <http://www.gnu.org/licenses/>. 4369 4370 // Never include this file directly; use <sys/types.h> instead. 4371 4372 type u_char = uint8 /* types.h:33:18 */ 4373 type u_short = uint16 /* types.h:34:19 */ 4374 type u_int = uint32 /* types.h:35:17 */ 4375 type u_long = uint32 /* types.h:36:18 */ 4376 type quad_t = int64 /* types.h:37:18 */ 4377 type u_quad_t = uint64 /* types.h:38:20 */ 4378 type fsid_t = struct{ __val [2]int32 } /* types.h:39:18 */ 4379 type loff_t = int64 /* types.h:42:18 */ 4380 4381 type ino_t = uint64 /* types.h:49:19 */ 4382 4383 type dev_t = uint64 /* types.h:59:17 */ 4384 4385 type mode_t = uint32 /* types.h:69:18 */ 4386 4387 type nlink_t = uint32 /* types.h:74:19 */ 4388 4389 type id_t = uint32 /* types.h:103:16 */ 4390 4391 type daddr_t = int32 /* types.h:114:19 */ 4392 type caddr_t = uintptr /* types.h:115:19 */ 4393 4394 type key_t = int32 /* types.h:121:17 */ 4395 4396 // bits/types.h -- definitions of __*_t types underlying *_t types. 4397 // Copyright (C) 2002-2018 Free Software Foundation, Inc. 4398 // This file is part of the GNU C Library. 4399 // 4400 // The GNU C Library is free software; you can redistribute it and/or 4401 // modify it under the terms of the GNU Lesser General Public 4402 // License as published by the Free Software Foundation; either 4403 // version 2.1 of the License, or (at your option) any later version. 4404 // 4405 // The GNU C Library is distributed in the hope that it will be useful, 4406 // but WITHOUT ANY WARRANTY; without even the implied warranty of 4407 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 4408 // Lesser General Public License for more details. 4409 // 4410 // You should have received a copy of the GNU Lesser General Public 4411 // License along with the GNU C Library; if not, see 4412 // <http://www.gnu.org/licenses/>. 4413 4414 // Never include this file directly; use <sys/types.h> instead. 4415 4416 // Returned by `clock'. 4417 type clock_t = int32 /* clock_t.h:7:19 */ 4418 4419 // bits/types.h -- definitions of __*_t types underlying *_t types. 4420 // Copyright (C) 2002-2018 Free Software Foundation, Inc. 4421 // This file is part of the GNU C Library. 4422 // 4423 // The GNU C Library is free software; you can redistribute it and/or 4424 // modify it under the terms of the GNU Lesser General Public 4425 // License as published by the Free Software Foundation; either 4426 // version 2.1 of the License, or (at your option) any later version. 4427 // 4428 // The GNU C Library is distributed in the hope that it will be useful, 4429 // but WITHOUT ANY WARRANTY; without even the implied warranty of 4430 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 4431 // Lesser General Public License for more details. 4432 // 4433 // You should have received a copy of the GNU Lesser General Public 4434 // License along with the GNU C Library; if not, see 4435 // <http://www.gnu.org/licenses/>. 4436 4437 // Never include this file directly; use <sys/types.h> instead. 4438 4439 // Clock ID used in clock and timer functions. 4440 type clockid_t = int32 /* clockid_t.h:7:21 */ 4441 4442 // bits/types.h -- definitions of __*_t types underlying *_t types. 4443 // Copyright (C) 2002-2018 Free Software Foundation, Inc. 4444 // This file is part of the GNU C Library. 4445 // 4446 // The GNU C Library is free software; you can redistribute it and/or 4447 // modify it under the terms of the GNU Lesser General Public 4448 // License as published by the Free Software Foundation; either 4449 // version 2.1 of the License, or (at your option) any later version. 4450 // 4451 // The GNU C Library is distributed in the hope that it will be useful, 4452 // but WITHOUT ANY WARRANTY; without even the implied warranty of 4453 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 4454 // Lesser General Public License for more details. 4455 // 4456 // You should have received a copy of the GNU Lesser General Public 4457 // License along with the GNU C Library; if not, see 4458 // <http://www.gnu.org/licenses/>. 4459 4460 // Never include this file directly; use <sys/types.h> instead. 4461 4462 // Returned by `time'. 4463 type time_t = int32 /* time_t.h:7:18 */ 4464 4465 // bits/types.h -- definitions of __*_t types underlying *_t types. 4466 // Copyright (C) 2002-2018 Free Software Foundation, Inc. 4467 // This file is part of the GNU C Library. 4468 // 4469 // The GNU C Library is free software; you can redistribute it and/or 4470 // modify it under the terms of the GNU Lesser General Public 4471 // License as published by the Free Software Foundation; either 4472 // version 2.1 of the License, or (at your option) any later version. 4473 // 4474 // The GNU C Library is distributed in the hope that it will be useful, 4475 // but WITHOUT ANY WARRANTY; without even the implied warranty of 4476 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 4477 // Lesser General Public License for more details. 4478 // 4479 // You should have received a copy of the GNU Lesser General Public 4480 // License along with the GNU C Library; if not, see 4481 // <http://www.gnu.org/licenses/>. 4482 4483 // Never include this file directly; use <sys/types.h> instead. 4484 4485 // Timer ID returned by `timer_create'. 4486 type timer_t = uintptr /* timer_t.h:7:19 */ 4487 4488 // Copyright (C) 1989-2018 Free Software Foundation, Inc. 4489 // 4490 // This file is part of GCC. 4491 // 4492 // GCC is free software; you can redistribute it and/or modify 4493 // it under the terms of the GNU General Public License as published by 4494 // the Free Software Foundation; either version 3, or (at your option) 4495 // any later version. 4496 // 4497 // GCC is distributed in the hope that it will be useful, 4498 // but WITHOUT ANY WARRANTY; without even the implied warranty of 4499 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 4500 // GNU General Public License for more details. 4501 // 4502 // Under Section 7 of GPL version 3, you are granted additional 4503 // permissions described in the GCC Runtime Library Exception, version 4504 // 3.1, as published by the Free Software Foundation. 4505 // 4506 // You should have received a copy of the GNU General Public License and 4507 // a copy of the GCC Runtime Library Exception along with this program; 4508 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 4509 // <http://www.gnu.org/licenses/>. 4510 4511 // ISO C Standard: 7.17 Common definitions <stddef.h> 4512 4513 // Any one of these symbols __need_* means that GNU libc 4514 // wants us just to define one data type. So don't define 4515 // the symbols that indicate this file's entire job has been done. 4516 4517 // This avoids lossage on SunOS but only if stdtypes.h comes first. 4518 // There's no way to win with the other order! Sun lossage. 4519 4520 // On 4.3bsd-net2, make sure ansi.h is included, so we have 4521 // one less case to deal with in the following. 4522 // On FreeBSD 5, machine/ansi.h does not exist anymore... 4523 4524 // In 4.3bsd-net2, machine/ansi.h defines these symbols, which are 4525 // defined if the corresponding type is *not* defined. 4526 // FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_. 4527 // NetBSD defines _I386_ANSI_H_ and _X86_64_ANSI_H_ instead of _ANSI_H_ 4528 4529 // Sequent's header files use _PTRDIFF_T_ in some conflicting way. 4530 // Just ignore it. 4531 4532 // On VxWorks, <type/vxTypesBase.h> may have defined macros like 4533 // _TYPE_size_t which will typedef size_t. fixincludes patched the 4534 // vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is 4535 // not defined, and so that defining this macro defines _GCC_SIZE_T. 4536 // If we find that the macros are still defined at this point, we must 4537 // invoke them so that the type is defined as expected. 4538 4539 // In case nobody has defined these types, but we aren't running under 4540 // GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and 4541 // __WCHAR_TYPE__ have reasonable values. This can happen if the 4542 // parts of GCC is compiled by an older compiler, that actually 4543 // include gstddef.h, such as collect2. 4544 4545 // Signed type of difference of two pointers. 4546 4547 // Define this type if we are doing the whole job, 4548 // or if we want this type in particular. 4549 4550 // Unsigned type of `sizeof' something. 4551 4552 // Define this type if we are doing the whole job, 4553 // or if we want this type in particular. 4554 4555 // Wide character type. 4556 // Locale-writers should change this as necessary to 4557 // be big enough to hold unique values not between 0 and 127, 4558 // and not (wchar_t) -1, for each defined multibyte character. 4559 4560 // Define this type if we are doing the whole job, 4561 // or if we want this type in particular. 4562 4563 // In 4.3bsd-net2, leave these undefined to indicate that size_t, etc. 4564 // are already defined. 4565 // BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here. 4566 // NetBSD 5 requires the I386_ANSI_H and X86_64_ANSI_H checks here. 4567 4568 // A null pointer constant. 4569 4570 // Old compatibility names for C types. 4571 type ulong = uint32 /* types.h:148:27 */ 4572 type ushort = uint16 /* types.h:149:28 */ 4573 type uint = uint32 /* types.h:150:22 */ 4574 4575 // These size-specific names are used by some of the inet code. 4576 4577 // Define intN_t types. 4578 // Copyright (C) 2017-2018 Free Software Foundation, Inc. 4579 // This file is part of the GNU C Library. 4580 // 4581 // The GNU C Library is free software; you can redistribute it and/or 4582 // modify it under the terms of the GNU Lesser General Public 4583 // License as published by the Free Software Foundation; either 4584 // version 2.1 of the License, or (at your option) any later version. 4585 // 4586 // The GNU C Library is distributed in the hope that it will be useful, 4587 // but WITHOUT ANY WARRANTY; without even the implied warranty of 4588 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 4589 // Lesser General Public License for more details. 4590 // 4591 // You should have received a copy of the GNU Lesser General Public 4592 // License along with the GNU C Library; if not, see 4593 // <http://www.gnu.org/licenses/>. 4594 4595 // bits/types.h -- definitions of __*_t types underlying *_t types. 4596 // Copyright (C) 2002-2018 Free Software Foundation, Inc. 4597 // This file is part of the GNU C Library. 4598 // 4599 // The GNU C Library is free software; you can redistribute it and/or 4600 // modify it under the terms of the GNU Lesser General Public 4601 // License as published by the Free Software Foundation; either 4602 // version 2.1 of the License, or (at your option) any later version. 4603 // 4604 // The GNU C Library is distributed in the hope that it will be useful, 4605 // but WITHOUT ANY WARRANTY; without even the implied warranty of 4606 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 4607 // Lesser General Public License for more details. 4608 // 4609 // You should have received a copy of the GNU Lesser General Public 4610 // License along with the GNU C Library; if not, see 4611 // <http://www.gnu.org/licenses/>. 4612 4613 // Never include this file directly; use <sys/types.h> instead. 4614 4615 type int8_t = int8 /* stdint-intn.h:24:18 */ 4616 type int16_t = int16 /* stdint-intn.h:25:19 */ 4617 type int32_t = int32 /* stdint-intn.h:26:19 */ 4618 type int64_t = int64 /* stdint-intn.h:27:19 */ 4619 4620 // For GCC 2.7 and later, we can use specific type-size attributes. 4621 4622 type u_int8_t = uint32 /* types.h:177:1 */ 4623 type u_int16_t = uint32 /* types.h:178:1 */ 4624 type u_int32_t = uint32 /* types.h:179:1 */ 4625 type u_int64_t = uint32 /* types.h:180:1 */ 4626 4627 type register_t = int32 /* types.h:182:13 */ 4628 4629 // A set of signals to be blocked, unblocked, or waited for. 4630 type sigset_t = struct{ __val [32]uint32 } /* sigset_t.h:7:20 */ 4631 4632 // Get definition of timer specification structures. 4633 4634 // bits/types.h -- definitions of __*_t types underlying *_t types. 4635 // Copyright (C) 2002-2018 Free Software Foundation, Inc. 4636 // This file is part of the GNU C Library. 4637 // 4638 // The GNU C Library is free software; you can redistribute it and/or 4639 // modify it under the terms of the GNU Lesser General Public 4640 // License as published by the Free Software Foundation; either 4641 // version 2.1 of the License, or (at your option) any later version. 4642 // 4643 // The GNU C Library is distributed in the hope that it will be useful, 4644 // but WITHOUT ANY WARRANTY; without even the implied warranty of 4645 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 4646 // Lesser General Public License for more details. 4647 // 4648 // You should have received a copy of the GNU Lesser General Public 4649 // License along with the GNU C Library; if not, see 4650 // <http://www.gnu.org/licenses/>. 4651 4652 // Never include this file directly; use <sys/types.h> instead. 4653 4654 // A time value that is accurate to the nearest 4655 // microsecond but also has a range of years. 4656 type timeval = struct { 4657 tv_sec int32 4658 tv_usec int32 4659 } /* struct_timeval.h:8:1 */ 4660 4661 // NB: Include guard matches what <linux/time.h> uses. 4662 4663 // bits/types.h -- definitions of __*_t types underlying *_t types. 4664 // Copyright (C) 2002-2018 Free Software Foundation, Inc. 4665 // This file is part of the GNU C Library. 4666 // 4667 // The GNU C Library is free software; you can redistribute it and/or 4668 // modify it under the terms of the GNU Lesser General Public 4669 // License as published by the Free Software Foundation; either 4670 // version 2.1 of the License, or (at your option) any later version. 4671 // 4672 // The GNU C Library is distributed in the hope that it will be useful, 4673 // but WITHOUT ANY WARRANTY; without even the implied warranty of 4674 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 4675 // Lesser General Public License for more details. 4676 // 4677 // You should have received a copy of the GNU Lesser General Public 4678 // License along with the GNU C Library; if not, see 4679 // <http://www.gnu.org/licenses/>. 4680 4681 // Never include this file directly; use <sys/types.h> instead. 4682 4683 // POSIX.1b structure for a time value. This is like a `struct timeval' but 4684 // has nanoseconds instead of microseconds. 4685 type timespec = struct { 4686 tv_sec int32 4687 tv_nsec int32 4688 } /* struct_timespec.h:9:1 */ 4689 4690 type suseconds_t = int32 /* select.h:43:23 */ 4691 4692 // Some versions of <linux/posix_types.h> define this macros. 4693 // It's easier to assume 8-bit bytes than to get CHAR_BIT. 4694 4695 // fd_set for select and pselect. 4696 type fd_set = struct{ __fds_bits [32]int32 } /* select.h:70:5 */ 4697 4698 // Maximum number of file descriptors in `fd_set'. 4699 4700 // Sometimes the fd_set member is assumed to have this type. 4701 type fd_mask = int32 /* select.h:77:19 */ 4702 4703 // Define some inlines helping to catch common problems. 4704 4705 type blksize_t = int32 /* types.h:202:21 */ 4706 4707 // Types from the Large File Support interface. 4708 type blkcnt_t = int64 /* types.h:222:22 */ // Type to count number of disk blocks. 4709 type fsblkcnt_t = uint64 /* types.h:226:24 */ // Type to count file system blocks. 4710 type fsfilcnt_t = uint64 /* types.h:230:24 */ // Type to count file system inodes. 4711 4712 // Now add the thread types. 4713 // Declaration of common pthread types for all architectures. 4714 // Copyright (C) 2017-2018 Free Software Foundation, Inc. 4715 // This file is part of the GNU C Library. 4716 // 4717 // The GNU C Library is free software; you can redistribute it and/or 4718 // modify it under the terms of the GNU Lesser General Public 4719 // License as published by the Free Software Foundation; either 4720 // version 2.1 of the License, or (at your option) any later version. 4721 // 4722 // The GNU C Library is distributed in the hope that it will be useful, 4723 // but WITHOUT ANY WARRANTY; without even the implied warranty of 4724 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 4725 // Lesser General Public License for more details. 4726 // 4727 // You should have received a copy of the GNU Lesser General Public 4728 // License along with the GNU C Library; if not, see 4729 // <http://www.gnu.org/licenses/>. 4730 4731 // For internal mutex and condition variable definitions. 4732 // Common threading primitives definitions for both POSIX and C11. 4733 // Copyright (C) 2017-2018 Free Software Foundation, Inc. 4734 // This file is part of the GNU C Library. 4735 // 4736 // The GNU C Library is free software; you can redistribute it and/or 4737 // modify it under the terms of the GNU Lesser General Public 4738 // License as published by the Free Software Foundation; either 4739 // version 2.1 of the License, or (at your option) any later version. 4740 // 4741 // The GNU C Library is distributed in the hope that it will be useful, 4742 // but WITHOUT ANY WARRANTY; without even the implied warranty of 4743 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 4744 // Lesser General Public License for more details. 4745 // 4746 // You should have received a copy of the GNU Lesser General Public 4747 // License along with the GNU C Library; if not, see 4748 // <http://www.gnu.org/licenses/>. 4749 4750 // Arch-specific definitions. Each architecture must define the following 4751 // macros to define the expected sizes of pthread data types: 4752 // 4753 // __SIZEOF_PTHREAD_ATTR_T - size of pthread_attr_t. 4754 // __SIZEOF_PTHREAD_MUTEX_T - size of pthread_mutex_t. 4755 // __SIZEOF_PTHREAD_MUTEXATTR_T - size of pthread_mutexattr_t. 4756 // __SIZEOF_PTHREAD_COND_T - size of pthread_cond_t. 4757 // __SIZEOF_PTHREAD_CONDATTR_T - size of pthread_condattr_t. 4758 // __SIZEOF_PTHREAD_RWLOCK_T - size of pthread_rwlock_t. 4759 // __SIZEOF_PTHREAD_RWLOCKATTR_T - size of pthread_rwlockattr_t. 4760 // __SIZEOF_PTHREAD_BARRIER_T - size of pthread_barrier_t. 4761 // __SIZEOF_PTHREAD_BARRIERATTR_T - size of pthread_barrierattr_t. 4762 // 4763 // Also, the following macros must be define for internal pthread_mutex_t 4764 // struct definitions (struct __pthread_mutex_s): 4765 // 4766 // __PTHREAD_COMPAT_PADDING_MID - any additional members after 'kind' 4767 // and before '__spin' (for 64 bits) or 4768 // '__nusers' (for 32 bits). 4769 // __PTHREAD_COMPAT_PADDING_END - any additional members at the end of 4770 // the internal structure. 4771 // __PTHREAD_MUTEX_LOCK_ELISION - 1 if the architecture supports lock 4772 // elision or 0 otherwise. 4773 // __PTHREAD_MUTEX_NUSERS_AFTER_KIND - control where to put __nusers. The 4774 // preferred value for new architectures 4775 // is 0. 4776 // __PTHREAD_MUTEX_USE_UNION - control whether internal __spins and 4777 // __list will be place inside a union for 4778 // linuxthreads compatibility. 4779 // The preferred value for new architectures 4780 // is 0. 4781 // 4782 // For a new port the preferred values for the required defines are: 4783 // 4784 // #define __PTHREAD_COMPAT_PADDING_MID 4785 // #define __PTHREAD_COMPAT_PADDING_END 4786 // #define __PTHREAD_MUTEX_LOCK_ELISION 0 4787 // #define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 0 4788 // #define __PTHREAD_MUTEX_USE_UNION 0 4789 // 4790 // __PTHREAD_MUTEX_LOCK_ELISION can be set to 1 if the hardware plans to 4791 // eventually support lock elision using transactional memory. 4792 // 4793 // The additional macro defines any constraint for the lock alignment 4794 // inside the thread structures: 4795 // 4796 // __LOCK_ALIGNMENT - for internal lock/futex usage. 4797 // 4798 // Same idea but for the once locking primitive: 4799 // 4800 // __ONCE_ALIGNMENT - for pthread_once_t/once_flag definition. 4801 // 4802 // And finally the internal pthread_rwlock_t (struct __pthread_rwlock_arch_t) 4803 // must be defined. 4804 // 4805 // Copyright (C) 2002-2018 Free Software Foundation, Inc. 4806 // This file is part of the GNU C Library. 4807 // 4808 // The GNU C Library is free software; you can redistribute it and/or 4809 // modify it under the terms of the GNU Lesser General Public 4810 // License as published by the Free Software Foundation; either 4811 // version 2.1 of the License, or (at your option) any later version. 4812 // 4813 // The GNU C Library is distributed in the hope that it will be useful, 4814 // but WITHOUT ANY WARRANTY; without even the implied warranty of 4815 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 4816 // Lesser General Public License for more details. 4817 // 4818 // You should have received a copy of the GNU Lesser General Public 4819 // License along with the GNU C Library; if not, see 4820 // <http://www.gnu.org/licenses/>. 4821 4822 // Determine the wordsize from the preprocessor defines. 4823 4824 // Definitions for internal mutex struct. 4825 4826 type __pthread_rwlock_arch_t = struct { 4827 __readers uint32 4828 __writers uint32 4829 __wrphase_futex uint32 4830 __writers_futex uint32 4831 __pad3 uint32 4832 __pad4 uint32 4833 __flags uint8 4834 __shared uint8 4835 __rwelision int8 4836 __pad2 uint8 4837 __cur_writer int32 4838 } /* pthreadtypes-arch.h:65:1 */ 4839 4840 // Extra attributes for the cleanup functions. 4841 4842 // Common definition of pthread_mutex_t. 4843 4844 type __pthread_internal_slist = struct{ __next uintptr } /* thread-shared-types.h:88:9 */ 4845 4846 // Lock elision support. 4847 4848 type __pthread_mutex_s = struct { 4849 __lock int32 4850 __count uint32 4851 __owner int32 4852 __kind int32 4853 __nusers uint32 4854 __20 struct { 4855 _ [0]uint32 4856 __elision_data struct { 4857 __espins int16 4858 __eelision int16 4859 } 4860 } 4861 } /* thread-shared-types.h:118:1 */ 4862 4863 // Common definition of pthread_cond_t. 4864 4865 type __pthread_cond_s = struct { 4866 __0 struct{ __wseq uint64 } 4867 __8 struct{ __g1_start uint64 } 4868 __g_refs [2]uint32 4869 __g_size [2]uint32 4870 __g1_orig_size uint32 4871 __wrefs uint32 4872 __g_signals [2]uint32 4873 } /* thread-shared-types.h:171:1 */ 4874 4875 // Thread identifiers. The structure of the attribute type is not 4876 // exposed on purpose. 4877 type pthread_t = uint32 /* pthreadtypes.h:27:27 */ 4878 4879 // Data structures for mutex handling. The structure of the attribute 4880 // type is not exposed on purpose. 4881 type pthread_mutexattr_t = struct { 4882 _ [0]uint32 4883 __size [4]int8 4884 } /* pthreadtypes.h:36:3 */ 4885 4886 // Data structure for condition variable handling. The structure of 4887 // the attribute type is not exposed on purpose. 4888 type pthread_condattr_t = struct { 4889 _ [0]uint32 4890 __size [4]int8 4891 } /* pthreadtypes.h:45:3 */ 4892 4893 // Keys for thread-specific data 4894 type pthread_key_t = uint32 /* pthreadtypes.h:49:22 */ 4895 4896 // Once-only execution 4897 type pthread_once_t = int32 /* pthreadtypes.h:53:30 */ 4898 4899 type pthread_attr_t1 = struct { 4900 _ [0]uint32 4901 __size [36]int8 4902 } /* pthreadtypes.h:56:1 */ 4903 4904 type pthread_attr_t = pthread_attr_t1 /* pthreadtypes.h:62:30 */ 4905 4906 type pthread_mutex_t = struct{ __data __pthread_mutex_s } /* pthreadtypes.h:72:3 */ 4907 4908 type pthread_cond_t = struct{ __data __pthread_cond_s } /* pthreadtypes.h:80:3 */ 4909 4910 // Data structure for reader-writer lock variable handling. The 4911 // structure of the attribute type is deliberately not exposed. 4912 type pthread_rwlock_t = struct{ __data __pthread_rwlock_arch_t } /* pthreadtypes.h:91:3 */ 4913 4914 type pthread_rwlockattr_t = struct { 4915 _ [0]uint32 4916 __size [8]int8 4917 } /* pthreadtypes.h:97:3 */ 4918 4919 // POSIX spinlock data type. 4920 type pthread_spinlock_t = int32 /* pthreadtypes.h:103:22 */ 4921 4922 // POSIX barriers data type. The structure of the type is 4923 // deliberately not exposed. 4924 type pthread_barrier_t = struct { 4925 _ [0]uint32 4926 __size [20]int8 4927 } /* pthreadtypes.h:112:3 */ 4928 4929 type pthread_barrierattr_t = struct { 4930 _ [0]uint32 4931 __size [4]int8 4932 } /* pthreadtypes.h:118:3 */ 4933 4934 // Reentrant versions of the `random' family of functions. 4935 // These functions all use the following data structure to contain 4936 // state, rather than global state variables. 4937 4938 type random_data = struct { 4939 fptr uintptr 4940 rptr uintptr 4941 state uintptr 4942 rand_type int32 4943 rand_deg int32 4944 rand_sep int32 4945 end_ptr uintptr 4946 } /* stdlib.h:423:1 */ 4947 4948 // Data structure for communication with thread safe versions. This 4949 // type is to be regarded as opaque. It's only exported because users 4950 // have to allocate objects of this type. 4951 type drand48_data = struct { 4952 __x [3]uint16 4953 __old_x [3]uint16 4954 __c uint16 4955 __init uint16 4956 __a uint64 4957 } /* stdlib.h:490:1 */ 4958 4959 // POSIX.1-2008 extended locale interface (see locale.h). 4960 // Definition of locale_t. 4961 // Copyright (C) 2017-2018 Free Software Foundation, Inc. 4962 // This file is part of the GNU C Library. 4963 // 4964 // The GNU C Library is free software; you can redistribute it and/or 4965 // modify it under the terms of the GNU Lesser General Public 4966 // License as published by the Free Software Foundation; either 4967 // version 2.1 of the License, or (at your option) any later version. 4968 // 4969 // The GNU C Library is distributed in the hope that it will be useful, 4970 // but WITHOUT ANY WARRANTY; without even the implied warranty of 4971 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 4972 // Lesser General Public License for more details. 4973 // 4974 // You should have received a copy of the GNU Lesser General Public 4975 // License along with the GNU C Library; if not, see 4976 // <http://www.gnu.org/licenses/>. 4977 4978 // Definition of struct __locale_struct and __locale_t. 4979 // Copyright (C) 1997-2018 Free Software Foundation, Inc. 4980 // This file is part of the GNU C Library. 4981 // Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. 4982 // 4983 // The GNU C Library is free software; you can redistribute it and/or 4984 // modify it under the terms of the GNU Lesser General Public 4985 // License as published by the Free Software Foundation; either 4986 // version 2.1 of the License, or (at your option) any later version. 4987 // 4988 // The GNU C Library is distributed in the hope that it will be useful, 4989 // but WITHOUT ANY WARRANTY; without even the implied warranty of 4990 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 4991 // Lesser General Public License for more details. 4992 // 4993 // You should have received a copy of the GNU Lesser General Public 4994 // License along with the GNU C Library; if not, see 4995 // <http://www.gnu.org/licenses/>. 4996 4997 // POSIX.1-2008: the locale_t type, representing a locale context 4998 // (implementation-namespace version). This type should be treated 4999 // as opaque by applications; some details are exposed for the sake of 5000 // efficiency in e.g. ctype functions. 5001 5002 type __locale_struct = struct { 5003 __locales [13]uintptr 5004 __ctype_b uintptr 5005 __ctype_tolower uintptr 5006 __ctype_toupper uintptr 5007 __names [13]uintptr 5008 } /* __locale_t.h:28:1 */ 5009 5010 type locale_t = uintptr /* locale_t.h:24:20 */ 5011 5012 // The suffix to append to the child command lines, if any 5013 5014 // The directory separator character(s) 5015 5016 // Mark a parameter as unused to suppress compiler warnings 5017 5018 // Global data 5019 type Global = struct { 5020 argv0 uintptr 5021 zVfs uintptr 5022 zDbFile uintptr 5023 db uintptr 5024 zErrLog uintptr 5025 pErrLog uintptr 5026 zLog uintptr 5027 pLog uintptr 5028 zName [32]int8 5029 taskId int32 5030 iTrace int32 5031 bSqlTrace int32 5032 bIgnoreSqlErrors int32 5033 nError int32 5034 nTest int32 5035 iTimeout int32 5036 bSync int32 5037 } /* mptest.c:72:8 */ 5038 5039 // The suffix to append to the child command lines, if any 5040 5041 // The directory separator character(s) 5042 5043 // Mark a parameter as unused to suppress compiler warnings 5044 5045 // Global data 5046 var g Global /* mptest.c:90:3: */ 5047 5048 // Default timeout 5049 5050 // Print a message adding zPrefix[] to the beginning of every line. 5051 func printWithPrefix(tls *libc.TLS, pOut uintptr, zPrefix uintptr, zMsg uintptr) { /* mptest.c:98:13: */ 5052 bp := tls.Alloc(24) 5053 defer tls.Free(24) 5054 5055 for (zMsg != 0) && (*(*int8)(unsafe.Pointer(zMsg)) != 0) { 5056 var i int32 5057 for i = 0; ((*(*int8)(unsafe.Pointer(zMsg + uintptr(i))) != 0) && (int32(*(*int8)(unsafe.Pointer(zMsg + uintptr(i)))) != '\n')) && (int32(*(*int8)(unsafe.Pointer(zMsg + uintptr(i)))) != '\r'); i++ { 5058 } 5059 libc.Xfprintf(tls, pOut, ts /* "%s%.*s\n" */, libc.VaList(bp, zPrefix, i, zMsg)) 5060 zMsg += uintptr(i) 5061 for (int32(*(*int8)(unsafe.Pointer(zMsg))) == '\n') || (int32(*(*int8)(unsafe.Pointer(zMsg))) == '\r') { 5062 zMsg++ 5063 } 5064 } 5065 } 5066 5067 // Compare two pointers to strings, where the pointers might be NULL. 5068 func safe_strcmp(tls *libc.TLS, a uintptr, b uintptr) int32 { /* mptest.c:111:12: */ 5069 if a == b { 5070 return 0 5071 } 5072 if a == uintptr(0) { 5073 return -1 5074 } 5075 if b == uintptr(0) { 5076 return 1 5077 } 5078 return libc.Xstrcmp(tls, a, b) 5079 } 5080 5081 // Return TRUE if string z[] matches glob pattern zGlob[]. 5082 // Return FALSE if the pattern does not match. 5083 // 5084 // Globbing rules: 5085 // 5086 // '*' Matches any sequence of zero or more characters. 5087 // 5088 // '?' Matches exactly one character. 5089 // 5090 // [...] Matches one character from the enclosed list of 5091 // characters. 5092 // 5093 // [^...] Matches one character not in the enclosed list. 5094 // 5095 // '#' Matches any sequence of one or more digits with an 5096 // optional + or - sign in front 5097 func strglob(tls *libc.TLS, zGlob uintptr, z uintptr) int32 { /* mptest.c:136:5: */ 5098 var c int32 5099 var c2 int32 5100 var invert int32 5101 var seen int32 5102 5103 for (libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1)))))) != 0 { 5104 if c == '*' { 5105 for ((libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1)))))) == '*') || (c == '?') { 5106 if (c == '?') && ((int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) == 0) { 5107 return 0 5108 } 5109 } 5110 if c == 0 { 5111 return 1 5112 } else if c == '[' { 5113 for (*(*int8)(unsafe.Pointer(z)) != 0) && (strglob(tls, (zGlob-uintptr(1)), z) != 0) { 5114 z++ 5115 } 5116 return (libc.Bool32((int32(*(*int8)(unsafe.Pointer(z)))) != 0)) 5117 } 5118 for (libc.AssignInt32(&c2, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))))) != 0 { 5119 for c2 != c { 5120 c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))) 5121 if c2 == 0 { 5122 return 0 5123 } 5124 } 5125 if strglob(tls, zGlob, z) != 0 { 5126 return 1 5127 } 5128 } 5129 return 0 5130 } else if c == '?' { 5131 if (int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) == 0 { 5132 return 0 5133 } 5134 } else if c == '[' { 5135 var prior_c int32 = 0 5136 seen = 0 5137 invert = 0 5138 c = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))) 5139 if c == 0 { 5140 return 0 5141 } 5142 c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1)))) 5143 if c2 == '^' { 5144 invert = 1 5145 c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1)))) 5146 } 5147 if c2 == ']' { 5148 if c == ']' { 5149 seen = 1 5150 } 5151 c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1)))) 5152 } 5153 for (c2 != 0) && (c2 != ']') { 5154 if (((c2 == '-') && (int32(*(*int8)(unsafe.Pointer(zGlob))) != ']')) && (int32(*(*int8)(unsafe.Pointer(zGlob))) != 0)) && (prior_c > 0) { 5155 c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1)))) 5156 if (c >= prior_c) && (c <= c2) { 5157 seen = 1 5158 } 5159 prior_c = 0 5160 } else { 5161 if c == c2 { 5162 seen = 1 5163 } 5164 prior_c = c2 5165 } 5166 c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1)))) 5167 } 5168 if (c2 == 0) || ((seen ^ invert) == 0) { 5169 return 0 5170 } 5171 } else if c == '#' { 5172 if ((int32(*(*int8)(unsafe.Pointer(z))) == '-') || (int32(*(*int8)(unsafe.Pointer(z))) == '+')) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + 1)))))*2))) & int32(_ISdigit)) != 0) { 5173 z++ 5174 } 5175 if !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z)))))*2))) & int32(_ISdigit)) != 0) { 5176 return 0 5177 } 5178 z++ 5179 for (int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z)))))*2))) & int32(_ISdigit)) != 0 { 5180 z++ 5181 } 5182 } else { 5183 if c != (int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) { 5184 return 0 5185 } 5186 } 5187 } 5188 return (libc.Bool32(int32(*(*int8)(unsafe.Pointer(z))) == 0)) 5189 } 5190 5191 // Close output stream pOut if it is not stdout or stderr 5192 func maybeClose(tls *libc.TLS, pOut uintptr) { /* mptest.c:208:13: */ 5193 if (pOut != libc.Xstdout) && (pOut != libc.Xstderr) { 5194 libc.Xfclose(tls, pOut) 5195 } 5196 } 5197 5198 // Print an error message 5199 func errorMessage(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:215:13: */ 5200 bp := tls.Alloc(38) 5201 defer tls.Free(38) 5202 5203 var ap va_list 5204 _ = ap 5205 var zMsg uintptr 5206 // var zPrefix [30]int8 at bp+8, 30 5207 5208 ap = va 5209 zMsg = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap) 5210 _ = ap 5211 sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zPrefix[0] */, ts+8 /* "%s:ERROR: " */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+32 /* &.zName */)) 5212 if g.pLog != 0 { 5213 printWithPrefix(tls, g.pLog, bp+8 /* &zPrefix[0] */, zMsg) 5214 libc.Xfflush(tls, g.pLog) 5215 } 5216 if (g.pErrLog != 0) && (safe_strcmp(tls, g.zErrLog, g.zLog) != 0) { 5217 printWithPrefix(tls, g.pErrLog, bp+8 /* &zPrefix[0] */, zMsg) 5218 libc.Xfflush(tls, g.pErrLog) 5219 } 5220 sqlite3.Xsqlite3_free(tls, zMsg) 5221 g.nError++ 5222 } 5223 5224 // Print an error message and then quit. 5225 func fatalError(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:241:13: */ 5226 bp := tls.Alloc(38) 5227 defer tls.Free(38) 5228 5229 var ap va_list 5230 _ = ap 5231 var zMsg uintptr 5232 // var zPrefix [30]int8 at bp+8, 30 5233 5234 ap = va 5235 zMsg = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap) 5236 _ = ap 5237 sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zPrefix[0] */, ts+19 /* "%s:FATAL: " */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+32 /* &.zName */)) 5238 if g.pLog != 0 { 5239 printWithPrefix(tls, g.pLog, bp+8 /* &zPrefix[0] */, zMsg) 5240 libc.Xfflush(tls, g.pLog) 5241 maybeClose(tls, g.pLog) 5242 } 5243 if (g.pErrLog != 0) && (safe_strcmp(tls, g.zErrLog, g.zLog) != 0) { 5244 printWithPrefix(tls, g.pErrLog, bp+8 /* &zPrefix[0] */, zMsg) 5245 libc.Xfflush(tls, g.pErrLog) 5246 maybeClose(tls, g.pErrLog) 5247 } 5248 sqlite3.Xsqlite3_free(tls, zMsg) 5249 if g.db != 0 { 5250 var nTry int32 = 0 5251 g.iTimeout = 0 5252 for (trySql(tls, ts+30 /* "UPDATE client SE..." */, 0) == SQLITE_BUSY) && 5253 ((libc.PostIncInt32(&nTry, 1)) < 100) { 5254 sqlite3.Xsqlite3_sleep(tls, 10) 5255 } 5256 } 5257 sqlite3.Xsqlite3_close(tls, g.db) 5258 libc.Xexit(tls, 1) 5259 } 5260 5261 // Print a log message 5262 func logMessage(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:276:13: */ 5263 bp := tls.Alloc(38) 5264 defer tls.Free(38) 5265 5266 var ap va_list 5267 _ = ap 5268 var zMsg uintptr 5269 // var zPrefix [30]int8 at bp+8, 30 5270 5271 ap = va 5272 zMsg = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap) 5273 _ = ap 5274 sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zPrefix[0] */, ts+60 /* "%s: " */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+32 /* &.zName */)) 5275 if g.pLog != 0 { 5276 printWithPrefix(tls, g.pLog, bp+8 /* &zPrefix[0] */, zMsg) 5277 libc.Xfflush(tls, g.pLog) 5278 } 5279 sqlite3.Xsqlite3_free(tls, zMsg) 5280 } 5281 5282 // Return the length of a string omitting trailing whitespace 5283 func clipLength(tls *libc.TLS, z uintptr) int32 { /* mptest.c:294:12: */ 5284 var n int32 = int32(libc.Xstrlen(tls, z)) 5285 for (n > 0) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n - 1)))))))*2))) & int32(_ISspace)) != 0) { 5286 n-- 5287 } 5288 return n 5289 } 5290 5291 // Auxiliary SQL function to return the name of the VFS 5292 func vfsNameFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* mptest.c:303:13: */ 5293 bp := tls.Alloc(4) 5294 defer tls.Free(4) 5295 5296 var db uintptr = sqlite3.Xsqlite3_context_db_handle(tls, context) 5297 *(*uintptr)(unsafe.Pointer(bp /* zVfs */)) = uintptr(0) 5298 _ = argc 5299 _ = argv 5300 sqlite3.Xsqlite3_file_control(tls, db, ts+65 /* "main" */, SQLITE_FCNTL_VFSNAME, bp /* &zVfs */) 5301 if *(*uintptr)(unsafe.Pointer(bp /* zVfs */)) != 0 { 5302 sqlite3.Xsqlite3_result_text(tls, context, *(*uintptr)(unsafe.Pointer(bp /* zVfs */)), -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sqlite3.Xsqlite3_free}))) 5303 } 5304 } 5305 5306 // Busy handler with a g.iTimeout-millisecond timeout 5307 func busyHandler(tls *libc.TLS, pCD uintptr, count int32) int32 { /* mptest.c:321:12: */ 5308 bp := tls.Alloc(8) 5309 defer tls.Free(8) 5310 5311 _ = pCD 5312 if (count * 10) > g.iTimeout { 5313 if g.iTimeout > 0 { 5314 errorMessage(tls, ts+70 /* "timeout after %d..." */, libc.VaList(bp, g.iTimeout)) 5315 } 5316 return 0 5317 } 5318 sqlite3.Xsqlite3_sleep(tls, 10) 5319 return 1 5320 } 5321 5322 // SQL Trace callback 5323 func sqlTraceCallback(tls *libc.TLS, NotUsed1 uintptr, zSql uintptr) { /* mptest.c:334:13: */ 5324 bp := tls.Alloc(16) 5325 defer tls.Free(16) 5326 5327 _ = NotUsed1 5328 logMessage(tls, ts+89 /* "[%.*s]" */, libc.VaList(bp, clipLength(tls, zSql), zSql)) 5329 } 5330 5331 // SQL error log callback 5332 func sqlErrorCallback(tls *libc.TLS, pArg uintptr, iErrCode int32, zMsg uintptr) { /* mptest.c:342:13: */ 5333 bp := tls.Alloc(24) 5334 defer tls.Free(24) 5335 5336 _ = pArg 5337 if (iErrCode == SQLITE_ERROR) && (g.bIgnoreSqlErrors != 0) { 5338 return 5339 } 5340 if ((iErrCode & 0xff) == SQLITE_SCHEMA) && (g.iTrace < 3) { 5341 return 5342 } 5343 if ((g.iTimeout == 0) && ((iErrCode & 0xff) == SQLITE_BUSY)) && (g.iTrace < 3) { 5344 return 5345 } 5346 if (iErrCode & 0xff) == SQLITE_NOTICE { 5347 logMessage(tls, ts+96 /* "(info) %s" */, libc.VaList(bp, zMsg)) 5348 } else { 5349 errorMessage(tls, ts+106 /* "(errcode=%d) %s" */, libc.VaList(bp+8, iErrCode, zMsg)) 5350 } 5351 } 5352 5353 // Prepare an SQL statement. Issue a fatal error if unable. 5354 func prepareSql(tls *libc.TLS, zFormat uintptr, va uintptr) uintptr { /* mptest.c:357:21: */ 5355 bp := tls.Alloc(20) 5356 defer tls.Free(20) 5357 5358 var ap va_list 5359 _ = ap 5360 var zSql uintptr 5361 var rc int32 5362 *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */)) = uintptr(0) 5363 ap = va 5364 zSql = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap) 5365 _ = ap 5366 rc = sqlite3.Xsqlite3_prepare_v2(tls, g.db, zSql, -1, bp+16 /* &pStmt */, uintptr(0)) 5367 if rc != SQLITE_OK { 5368 sqlite3.Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */))) 5369 fatalError(tls, ts+122 /* "%s\n%s\n" */, libc.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, g.db), zSql)) 5370 } 5371 sqlite3.Xsqlite3_free(tls, zSql) 5372 return *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */)) 5373 } 5374 5375 // Run arbitrary SQL. Issue a fatal error on failure. 5376 func runSql(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:377:13: */ 5377 bp := tls.Alloc(16) 5378 defer tls.Free(16) 5379 5380 var ap va_list 5381 _ = ap 5382 var zSql uintptr 5383 var rc int32 5384 ap = va 5385 zSql = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap) 5386 _ = ap 5387 rc = sqlite3.Xsqlite3_exec(tls, g.db, zSql, uintptr(0), uintptr(0), uintptr(0)) 5388 if rc != SQLITE_OK { 5389 fatalError(tls, ts+122 /* "%s\n%s\n" */, libc.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, g.db), zSql)) 5390 } 5391 sqlite3.Xsqlite3_free(tls, zSql) 5392 } 5393 5394 // Try to run arbitrary SQL. Return success code. 5395 func trySql(tls *libc.TLS, zFormat uintptr, va uintptr) int32 { /* mptest.c:394:12: */ 5396 var ap va_list 5397 _ = ap 5398 var zSql uintptr 5399 var rc int32 5400 ap = va 5401 zSql = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap) 5402 _ = ap 5403 rc = sqlite3.Xsqlite3_exec(tls, g.db, zSql, uintptr(0), uintptr(0), uintptr(0)) 5404 sqlite3.Xsqlite3_free(tls, zSql) 5405 return rc 5406 } 5407 5408 // Structure for holding an arbitrary length string 5409 type String1 = struct { 5410 z uintptr 5411 n int32 5412 nAlloc int32 5413 } /* mptest.c:408:9 */ 5414 5415 // Structure for holding an arbitrary length string 5416 type String = String1 /* mptest.c:408:23 */ 5417 5418 // Free a string 5419 func stringFree(tls *libc.TLS, p uintptr) { /* mptest.c:416:13: */ 5420 if (*String)(unsafe.Pointer(p)).z != 0 { 5421 sqlite3.Xsqlite3_free(tls, (*String)(unsafe.Pointer(p)).z) 5422 } 5423 libc.Xmemset(tls, p, 0, uint32(unsafe.Sizeof(String{}))) 5424 } 5425 5426 // Append n bytes of text to a string. If n<0 append the entire string. 5427 func stringAppend(tls *libc.TLS, p uintptr, z uintptr, n int32) { /* mptest.c:422:13: */ 5428 if n < 0 { 5429 n = int32(libc.Xstrlen(tls, z)) 5430 } 5431 if ((*String)(unsafe.Pointer(p)).n + n) >= (*String)(unsafe.Pointer(p)).nAlloc { 5432 var nAlloc int32 = ((((*String)(unsafe.Pointer(p)).nAlloc * 2) + n) + 100) 5433 var zNew uintptr = sqlite3.Xsqlite3_realloc(tls, (*String)(unsafe.Pointer(p)).z, nAlloc) 5434 if zNew == uintptr(0) { 5435 fatalError(tls, ts+129 /* "out of memory" */, 0) 5436 } 5437 (*String)(unsafe.Pointer(p)).z = zNew 5438 (*String)(unsafe.Pointer(p)).nAlloc = nAlloc 5439 } 5440 libc.Xmemcpy(tls, ((*String)(unsafe.Pointer(p)).z + uintptr((*String)(unsafe.Pointer(p)).n)), z, uint32(n)) 5441 *(*int32)(unsafe.Pointer(p + 4 /* &.n */)) += (n) 5442 *(*int8)(unsafe.Pointer((*String)(unsafe.Pointer(p)).z + uintptr((*String)(unsafe.Pointer(p)).n))) = int8(0) 5443 } 5444 5445 // Reset a string to an empty string 5446 func stringReset(tls *libc.TLS, p uintptr) { /* mptest.c:437:13: */ 5447 if (*String)(unsafe.Pointer(p)).z == uintptr(0) { 5448 stringAppend(tls, p, ts+143 /* " " */, 1) 5449 } 5450 (*String)(unsafe.Pointer(p)).n = 0 5451 *(*int8)(unsafe.Pointer((*String)(unsafe.Pointer(p)).z)) = int8(0) 5452 } 5453 5454 // Append a new token onto the end of the string 5455 func stringAppendTerm(tls *libc.TLS, p uintptr, z uintptr) { /* mptest.c:444:13: */ 5456 var i int32 5457 if (*String)(unsafe.Pointer(p)).n != 0 { 5458 stringAppend(tls, p, ts+143 /* " " */, 1) 5459 } 5460 if z == uintptr(0) { 5461 stringAppend(tls, p, ts+145 /* "nil" */, 3) 5462 return 5463 } 5464 for i = 0; (*(*int8)(unsafe.Pointer(z + uintptr(i))) != 0) && !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(i))))))*2))) & int32(_ISspace)) != 0); i++ { 5465 } 5466 if (i > 0) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == 0) { 5467 stringAppend(tls, p, z, i) 5468 return 5469 } 5470 stringAppend(tls, p, ts+149 /* "'" */, 1) 5471 for *(*int8)(unsafe.Pointer(z)) != 0 { 5472 for i = 0; (*(*int8)(unsafe.Pointer(z + uintptr(i))) != 0) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) != '\''); i++ { 5473 } 5474 if *(*int8)(unsafe.Pointer(z + uintptr(i))) != 0 { 5475 stringAppend(tls, p, z, (i + 1)) 5476 stringAppend(tls, p, ts+149 /* "'" */, 1) 5477 z += (uintptr(i + 1)) 5478 } else { 5479 stringAppend(tls, p, z, i) 5480 break 5481 } 5482 } 5483 stringAppend(tls, p, ts+149 /* "'" */, 1) 5484 } 5485 5486 // Callback function for evalSql() 5487 func evalCallback(tls *libc.TLS, pCData uintptr, argc int32, argv uintptr, azCol uintptr) int32 { /* mptest.c:474:12: */ 5488 var p uintptr = pCData 5489 var i int32 5490 _ = azCol 5491 for i = 0; i < argc; i++ { 5492 stringAppendTerm(tls, p, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4))) 5493 } 5494 return 0 5495 } 5496 5497 // Run arbitrary SQL and record the results in an output string 5498 // given by the first parameter. 5499 func evalSql(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) int32 { /* mptest.c:486:12: */ 5500 bp := tls.Alloc(42) 5501 defer tls.Free(42) 5502 5503 var ap va_list 5504 _ = ap 5505 var zSql uintptr 5506 var rc int32 5507 *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrMsg */)) = uintptr(0) 5508 ap = va 5509 zSql = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap) 5510 _ = ap 5511 5512 rc = sqlite3.Xsqlite3_exec(tls, g.db, zSql, *(*uintptr)(unsafe.Pointer(&struct { 5513 f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32 5514 }{evalCallback})), p, bp+8 /* &zErrMsg */) 5515 sqlite3.Xsqlite3_free(tls, zSql) 5516 if rc != 0 { 5517 // var zErr [30]int8 at bp+12, 30 5518 5519 sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+12 /* &zErr[0] */, ts+151 /* "error(%d)" */, libc.VaList(bp, rc)) 5520 stringAppendTerm(tls, p, bp+12 /* &zErr[0] */) 5521 if *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrMsg */)) != 0 { 5522 stringAppendTerm(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrMsg */))) 5523 sqlite3.Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrMsg */))) 5524 } 5525 } 5526 return rc 5527 } 5528 5529 // Auxiliary SQL function to recursively evaluate SQL. 5530 func evalFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* mptest.c:512:13: */ 5531 bp := tls.Alloc(16) 5532 defer tls.Free(16) 5533 5534 var db uintptr = sqlite3.Xsqlite3_context_db_handle(tls, context) 5535 var zSql uintptr = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) 5536 // var res String at bp, 12 5537 5538 *(*uintptr)(unsafe.Pointer(bp + 12 /* zErrMsg */)) = uintptr(0) 5539 var rc int32 5540 _ = argc 5541 libc.Xmemset(tls, bp /* &res */, 0, uint32(unsafe.Sizeof(String{}))) 5542 rc = sqlite3.Xsqlite3_exec(tls, db, zSql, *(*uintptr)(unsafe.Pointer(&struct { 5543 f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32 5544 }{evalCallback})), bp /* &res */, bp+12 /* &zErrMsg */) 5545 if *(*uintptr)(unsafe.Pointer(bp + 12 /* zErrMsg */)) != 0 { 5546 sqlite3.Xsqlite3_result_error(tls, context, *(*uintptr)(unsafe.Pointer(bp + 12 /* zErrMsg */)), -1) 5547 sqlite3.Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 12 /* zErrMsg */))) 5548 } else if rc != 0 { 5549 sqlite3.Xsqlite3_result_error_code(tls, context, rc) 5550 } else { 5551 sqlite3.Xsqlite3_result_text(tls, context, (*String)(unsafe.Pointer(bp /* &res */)).z, -1, libc.UintptrFromInt32(-1)) 5552 } 5553 stringFree(tls, bp /* &res */) 5554 } 5555 5556 // Look up the next task for client iClient in the database. 5557 // Return the task script and the task number and mark that 5558 // task as being under way. 5559 func startScript(tls *libc.TLS, iClient int32, pzScript uintptr, pTaskId uintptr, pzTaskName uintptr) int32 { /* mptest.c:541:12: */ 5560 bp := tls.Alloc(80) 5561 defer tls.Free(80) 5562 5563 var pStmt uintptr = uintptr(0) 5564 var taskId int32 5565 var rc int32 5566 var totalTime int32 = 0 5567 5568 *(*uintptr)(unsafe.Pointer(pzScript)) = uintptr(0) 5569 g.iTimeout = 0 5570 for 1 != 0 { 5571 rc = trySql(tls, ts+161 /* "BEGIN IMMEDIATE" */, 0) 5572 if rc == SQLITE_BUSY { 5573 sqlite3.Xsqlite3_sleep(tls, 10) 5574 totalTime = totalTime + (10) 5575 continue 5576 } 5577 if rc != SQLITE_OK { 5578 fatalError(tls, ts+177 /* "in startScript: ..." */, libc.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, g.db))) 5579 } 5580 if (g.nError != 0) || (g.nTest != 0) { 5581 runSql(tls, ts+196, /* "UPDATE counters ..." */ 5582 libc.VaList(bp+8, g.nError, g.nTest)) 5583 g.nError = 0 5584 g.nTest = 0 5585 } 5586 pStmt = prepareSql(tls, ts+249 /* "SELECT 1 FROM cl..." */, libc.VaList(bp+24, iClient)) 5587 rc = sqlite3.Xsqlite3_step(tls, pStmt) 5588 sqlite3.Xsqlite3_finalize(tls, pStmt) 5589 if rc == SQLITE_ROW { 5590 runSql(tls, ts+295 /* "DELETE FROM clie..." */, libc.VaList(bp+32, iClient)) 5591 g.iTimeout = DEFAULT_TIMEOUT 5592 runSql(tls, ts+326 /* "COMMIT TRANSACTI..." */, 0) 5593 return SQLITE_DONE 5594 } 5595 pStmt = prepareSql(tls, 5596 5597 ts+346 /* "SELECT script, i..." */, libc.VaList(bp+40, iClient)) 5598 rc = sqlite3.Xsqlite3_step(tls, pStmt) 5599 if rc == SQLITE_ROW { 5600 var n int32 = sqlite3.Xsqlite3_column_bytes(tls, pStmt, 0) 5601 *(*uintptr)(unsafe.Pointer(pzScript)) = sqlite3.Xsqlite3_malloc(tls, (n + 1)) 5602 libc.Xstrcpy(tls, *(*uintptr)(unsafe.Pointer(pzScript)), sqlite3.Xsqlite3_column_text(tls, pStmt, 0)) 5603 *(*int32)(unsafe.Pointer(pTaskId)) = libc.AssignInt32(&taskId, sqlite3.Xsqlite3_column_int(tls, pStmt, 1)) 5604 *(*uintptr)(unsafe.Pointer(pzTaskName)) = sqlite3.Xsqlite3_mprintf(tls, ts+438 /* "%s" */, libc.VaList(bp+48, sqlite3.Xsqlite3_column_text(tls, pStmt, 2))) 5605 sqlite3.Xsqlite3_finalize(tls, pStmt) 5606 runSql(tls, 5607 5608 ts+441 /* "UPDATE task SE..." */, libc.VaList(bp+56, taskId)) 5609 g.iTimeout = DEFAULT_TIMEOUT 5610 runSql(tls, ts+326 /* "COMMIT TRANSACTI..." */, 0) 5611 return SQLITE_OK 5612 } 5613 sqlite3.Xsqlite3_finalize(tls, pStmt) 5614 if rc == SQLITE_DONE { 5615 if totalTime > 30000 { 5616 errorMessage(tls, ts+524 /* "Waited over 30 s..." */, 0) 5617 runSql(tls, ts+573 /* "DELETE FROM clie..." */, libc.VaList(bp+64, iClient)) 5618 sqlite3.Xsqlite3_close(tls, g.db) 5619 libc.Xexit(tls, 1) 5620 } 5621 for trySql(tls, ts+613 /* "COMMIT" */, 0) == SQLITE_BUSY { 5622 sqlite3.Xsqlite3_sleep(tls, 10) 5623 totalTime = totalTime + (10) 5624 } 5625 sqlite3.Xsqlite3_sleep(tls, 100) 5626 totalTime = totalTime + (100) 5627 continue 5628 } 5629 fatalError(tls, ts+438 /* "%s" */, libc.VaList(bp+72, sqlite3.Xsqlite3_errmsg(tls, g.db))) 5630 } 5631 g.iTimeout = DEFAULT_TIMEOUT 5632 return int32(0) 5633 } 5634 5635 // Mark a script as having finished. Remove the CLIENT table entry 5636 // if bShutdown is true. 5637 func finishScript(tls *libc.TLS, iClient int32, taskId int32, bShutdown int32) int32 { /* mptest.c:623:12: */ 5638 bp := tls.Alloc(16) 5639 defer tls.Free(16) 5640 5641 runSql(tls, 5642 5643 ts+620 /* "UPDATE task SE..." */, libc.VaList(bp, taskId)) 5644 if bShutdown != 0 { 5645 runSql(tls, ts+295 /* "DELETE FROM clie..." */, libc.VaList(bp+8, iClient)) 5646 } 5647 return SQLITE_OK 5648 } 5649 5650 // Start up a client process for iClient, if it is not already 5651 // running. If the client is already running, then this routine 5652 // is a no-op. 5653 func startClient(tls *libc.TLS, iClient int32) { /* mptest.c:638:13: */ 5654 bp := tls.Alloc(96) 5655 defer tls.Free(96) 5656 5657 runSql(tls, ts+701 /* "INSERT OR IGNORE..." */, libc.VaList(bp, iClient)) 5658 if sqlite3.Xsqlite3_changes(tls, g.db) != 0 { 5659 var zSys uintptr 5660 var rc int32 5661 zSys = sqlite3.Xsqlite3_mprintf(tls, ts+743, /* "%s \"%s\" --client..." */ 5662 libc.VaList(bp+8, g.argv0, g.zDbFile, iClient, g.iTrace)) 5663 if g.bSqlTrace != 0 { 5664 zSys = sqlite3.Xsqlite3_mprintf(tls, ts+774 /* "%z --sqltrace" */, libc.VaList(bp+40, zSys)) 5665 } 5666 if g.bSync != 0 { 5667 zSys = sqlite3.Xsqlite3_mprintf(tls, ts+788 /* "%z --sync" */, libc.VaList(bp+48, zSys)) 5668 } 5669 if g.zVfs != 0 { 5670 zSys = sqlite3.Xsqlite3_mprintf(tls, ts+798 /* "%z --vfs \"%s\"" */, libc.VaList(bp+56, zSys, g.zVfs)) 5671 } 5672 if g.iTrace >= 2 { 5673 logMessage(tls, ts+812 /* "system('%q')" */, libc.VaList(bp+72, zSys)) 5674 } 5675 zSys = sqlite3.Xsqlite3_mprintf(tls, ts+825 /* "%z &" */, libc.VaList(bp+80, zSys)) 5676 rc = libc.Xsystem(tls, zSys) 5677 if rc != 0 { 5678 errorMessage(tls, ts+830 /* "system() fails w..." */, libc.VaList(bp+88, rc)) 5679 } 5680 sqlite3.Xsqlite3_free(tls, zSys) 5681 } 5682 } 5683 5684 // Read the entire content of a file into memory 5685 func readFile(tls *libc.TLS, zFilename uintptr) uintptr { /* mptest.c:684:13: */ 5686 bp := tls.Alloc(8) 5687 defer tls.Free(8) 5688 5689 var in uintptr = libc.Xfopen(tls, zFilename, ts+864 /* "rb" */) 5690 var sz int32 5691 var z uintptr 5692 if in == uintptr(0) { 5693 fatalError(tls, ts+867 /* "cannot open \"%s\"..." */, libc.VaList(bp, zFilename)) 5694 } 5695 libc.Xfseek(tls, in, 0, SEEK_END) 5696 sz = libc.Xftell(tls, in) 5697 libc.Xrewind(tls, in) 5698 z = sqlite3.Xsqlite3_malloc(tls, (int32(sz + 1))) 5699 sz = int32(libc.Xfread(tls, z, uint32(1), uint32(sz), in)) 5700 *(*int8)(unsafe.Pointer(z + uintptr(sz))) = int8(0) 5701 libc.Xfclose(tls, in) 5702 return z 5703 } 5704 5705 // Return the length of the next token. 5706 func tokenLength(tls *libc.TLS, z uintptr, pnLine uintptr) int32 { /* mptest.c:704:12: */ 5707 var n int32 = 0 5708 if ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z)))))*2))) & int32(_ISspace)) != 0) || ((int32(*(*int8)(unsafe.Pointer(z))) == '/') && (int32(*(*int8)(unsafe.Pointer(z + 1))) == '*')) { 5709 var inC int32 = 0 5710 var c int32 5711 if int32(*(*int8)(unsafe.Pointer(z))) == '/' { 5712 inC = 1 5713 n = 2 5714 } 5715 for (libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&n, 1))))))) != 0 { 5716 if c == '\n' { 5717 (*(*int32)(unsafe.Pointer(pnLine)))++ 5718 } 5719 if (int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(c)))*2))) & int32(_ISspace)) != 0 { 5720 continue 5721 } 5722 if ((inC != 0) && (c == '*')) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) == '/') { 5723 n++ 5724 inC = 0 5725 } else if (!(inC != 0) && (c == '/')) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) == '*') { 5726 n++ 5727 inC = 1 5728 } else if !(inC != 0) { 5729 break 5730 } 5731 } 5732 n-- 5733 } else if (int32(*(*int8)(unsafe.Pointer(z))) == '-') && (int32(*(*int8)(unsafe.Pointer(z + 1))) == '-') { 5734 for n = 2; (*(*int8)(unsafe.Pointer(z + uintptr(n))) != 0) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) != '\n'); n++ { 5735 } 5736 if *(*int8)(unsafe.Pointer(z + uintptr(n))) != 0 { 5737 (*(*int32)(unsafe.Pointer(pnLine)))++ 5738 n++ 5739 } 5740 } else if (int32(*(*int8)(unsafe.Pointer(z))) == '"') || (int32(*(*int8)(unsafe.Pointer(z))) == '\'') { 5741 var delim int32 = int32(*(*int8)(unsafe.Pointer(z))) 5742 for n = 1; *(*int8)(unsafe.Pointer(z + uintptr(n))) != 0; n++ { 5743 if int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) == '\n' { 5744 (*(*int32)(unsafe.Pointer(pnLine)))++ 5745 } 5746 if int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) == delim { 5747 n++ 5748 if int32(*(*int8)(unsafe.Pointer(z + uintptr((n + 1))))) != delim { 5749 break 5750 } 5751 } 5752 } 5753 } else { 5754 var c int32 5755 for n = 1; (((((libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))))) != 0) && !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(c)))*2))) & int32(_ISspace)) != 0)) && (c != '"')) && (c != '\'')) && (c != ';'); n++ { 5756 } 5757 } 5758 return n 5759 } 5760 5761 // Copy a single token into a string buffer. 5762 func extractToken(tls *libc.TLS, zIn uintptr, nIn int32, zOut uintptr, nOut int32) int32 { /* mptest.c:749:12: */ 5763 var i int32 5764 if nIn <= 0 { 5765 *(*int8)(unsafe.Pointer(zOut)) = int8(0) 5766 return 0 5767 } 5768 for i = 0; ((i < nIn) && (i < (nOut - 1))) && !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zIn + uintptr(i))))))*2))) & int32(_ISspace)) != 0); i++ { 5769 *(*int8)(unsafe.Pointer(zOut + uintptr(i))) = *(*int8)(unsafe.Pointer(zIn + uintptr(i))) 5770 } 5771 *(*int8)(unsafe.Pointer(zOut + uintptr(i))) = int8(0) 5772 return i 5773 } 5774 5775 // Find the number of characters up to the start of the next "--end" token. 5776 func findEnd(tls *libc.TLS, z uintptr, pnLine uintptr) int32 { /* mptest.c:763:12: */ 5777 var n int32 = 0 5778 for (*(*int8)(unsafe.Pointer(z + uintptr(n))) != 0) && ((libc.Xstrncmp(tls, (z+uintptr(n)), ts+896 /* "--end" */, uint32(5)) != 0) || !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n + 5)))))))*2))) & int32(_ISspace)) != 0)) { 5779 n = n + (tokenLength(tls, (z + uintptr(n)), pnLine)) 5780 } 5781 return n 5782 } 5783 5784 // Find the number of characters up to the first character past the 5785 // of the next "--endif" or "--else" token. Nested --if commands are 5786 // also skipped. 5787 func findEndif(tls *libc.TLS, z uintptr, stopAtElse int32, pnLine uintptr) int32 { /* mptest.c:776:12: */ 5788 var n int32 = 0 5789 for *(*int8)(unsafe.Pointer(z + uintptr(n))) != 0 { 5790 var len int32 = tokenLength(tls, (z + uintptr(n)), pnLine) 5791 if ((libc.Xstrncmp(tls, (z+uintptr(n)), ts+902 /* "--endif" */, uint32(7)) == 0) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n + 7)))))))*2))) & int32(_ISspace)) != 0)) || 5792 (((stopAtElse != 0) && (libc.Xstrncmp(tls, (z+uintptr(n)), ts+910 /* "--else" */, uint32(6)) == 0)) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n + 6)))))))*2))) & int32(_ISspace)) != 0)) { 5793 return (n + len) 5794 } 5795 if (libc.Xstrncmp(tls, (z+uintptr(n)), ts+917 /* "--if" */, uint32(4)) == 0) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n + 4)))))))*2))) & int32(_ISspace)) != 0) { 5796 var skip int32 = findEndif(tls, ((z + uintptr(n)) + uintptr(len)), 0, pnLine) 5797 n = n + (skip + len) 5798 } else { 5799 n = n + (len) 5800 } 5801 } 5802 return n 5803 } 5804 5805 // Wait for a client process to complete all its tasks 5806 func waitForClient(tls *libc.TLS, iClient int32, iTimeout int32, zErrPrefix uintptr) { /* mptest.c:798:13: */ 5807 bp := tls.Alloc(32) 5808 defer tls.Free(32) 5809 5810 var pStmt uintptr 5811 var rc int32 5812 if iClient > 0 { 5813 pStmt = prepareSql(tls, 5814 5815 ts+922, /* "SELECT 1 FROM ta..." */ 5816 libc.VaList(bp, iClient)) 5817 } else { 5818 pStmt = prepareSql(tls, 5819 5820 ts+1018 /* "SELECT 1 FROM ta..." */, 0) 5821 } 5822 g.iTimeout = 0 5823 for (((libc.AssignInt32(&rc, sqlite3.Xsqlite3_step(tls, pStmt))) == SQLITE_BUSY) || (rc == SQLITE_ROW)) && 5824 (iTimeout > 0) { 5825 sqlite3.Xsqlite3_reset(tls, pStmt) 5826 sqlite3.Xsqlite3_sleep(tls, 50) 5827 iTimeout = iTimeout - (50) 5828 } 5829 sqlite3.Xsqlite3_finalize(tls, pStmt) 5830 g.iTimeout = DEFAULT_TIMEOUT 5831 if rc != SQLITE_DONE { 5832 if zErrPrefix == uintptr(0) { 5833 zErrPrefix = ts + 1099 /* "" */ 5834 } 5835 if iClient > 0 { 5836 errorMessage(tls, ts+1100 /* "%stimeout waitin..." */, libc.VaList(bp+8, zErrPrefix, iClient)) 5837 } else { 5838 errorMessage(tls, ts+1132 /* "%stimeout waitin..." */, libc.VaList(bp+24, zErrPrefix)) 5839 } 5840 } 5841 } 5842 5843 // Return a pointer to the tail of a filename 5844 func filenameTail(tls *libc.TLS, z uintptr) uintptr { /* mptest.c:836:13: */ 5845 var i int32 5846 var j int32 5847 for i = libc.AssignInt32(&j, 0); *(*int8)(unsafe.Pointer(z + uintptr(i))) != 0; i++ { 5848 if (int32(*(*int8)(unsafe.Pointer(z + uintptr(i))))) == '/' { 5849 j = (i + 1) 5850 } 5851 } 5852 return (z + uintptr(j)) 5853 } 5854 5855 // Interpret zArg as a boolean value. Return either 0 or 1. 5856 func booleanValue(tls *libc.TLS, zArg uintptr) int32 { /* mptest.c:845:12: */ 5857 bp := tls.Alloc(8) 5858 defer tls.Free(8) 5859 5860 var i int32 5861 if zArg == uintptr(0) { 5862 return 0 5863 } 5864 for i = 0; (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i)))) >= '0') && (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i)))) <= '9'); i++ { 5865 } 5866 if (i > 0) && (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i)))) == 0) { 5867 return libc.Xatoi(tls, zArg) 5868 } 5869 if (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1166 /* "on" */) == 0) || (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1169 /* "yes" */) == 0) { 5870 return 1 5871 } 5872 if (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1173 /* "off" */) == 0) || (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1177 /* "no" */) == 0) { 5873 return 0 5874 } 5875 errorMessage(tls, ts+1180 /* "unknown boolean:..." */, libc.VaList(bp, zArg)) 5876 return 0 5877 } 5878 5879 // This routine exists as a convenient place to set a debugger 5880 // breakpoint. 5881 func test_breakpoint(tls *libc.TLS) { /* mptest.c:864:13: */ 5882 atomic.AddInt32(&cnt, 1) 5883 } 5884 5885 var cnt int32 = 0 /* mptest.c:864:56 */ 5886 5887 // Maximum number of arguments to a --command 5888 5889 // Run a script. 5890 func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFilename uintptr) { /* mptest.c:872:13: */ 5891 bp := tls.Alloc(1606) 5892 defer tls.Free(1606) 5893 5894 *(*int32)(unsafe.Pointer(bp + 372 /* lineno */)) = 1 5895 var prevLine int32 = 1 5896 var ii int32 = 0 5897 var iBegin int32 = 0 5898 var n int32 5899 var c int32 5900 var j int32 5901 var len int32 5902 var nArg int32 5903 // var sResult String at bp+360, 12 5904 5905 // var zCmd [30]int8 at bp+376, 30 5906 5907 // var zError [1000]int8 at bp+606, 1000 5908 5909 // var azArg [2][100]int8 at bp+406, 200 5910 5911 libc.Xmemset(tls, bp+360 /* &sResult */, 0, uint32(unsafe.Sizeof(String{}))) 5912 stringReset(tls, bp+360 /* &sResult */) 5913 for (libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(zScript + uintptr(ii)))))) != 0 { 5914 prevLine = *(*int32)(unsafe.Pointer(bp + 372 /* lineno */)) 5915 len = tokenLength(tls, (zScript + uintptr(ii)), bp+372 /* &lineno */) 5916 if ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(c)))*2))) & int32(_ISspace)) != 0) || ((c == '/') && (int32(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + 1))))) == '*')) { 5917 ii = ii + (len) 5918 continue 5919 } 5920 if ((c != '-') || (int32(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + 1))))) != '-')) || !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + 2))))))*2))) & int32(_ISalpha)) != 0) { 5921 ii = ii + (len) 5922 continue 5923 } 5924 5925 // Run any prior SQL before processing the new --command 5926 if ii > iBegin { 5927 var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp, (ii-iBegin), (zScript+uintptr(iBegin)))) 5928 evalSql(tls, bp+360 /* &sResult */, zSql, 0) 5929 sqlite3.Xsqlite3_free(tls, zSql) 5930 iBegin = (ii + len) 5931 } 5932 5933 // Parse the --command 5934 if g.iTrace >= 2 { 5935 logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+16, len, (zScript+uintptr(ii)))) 5936 } 5937 n = extractToken(tls, ((zScript + uintptr(ii)) + uintptr(2)), (len - 2), bp+376 /* &zCmd[0] */, int32(unsafe.Sizeof([30]int8{}))) 5938 for nArg = 0; (n < (len - 2)) && (nArg < MX_ARG); nArg++ { 5939 for (n < (len - 2)) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zScript + uintptr(((ii + 2) + n)))))))*2))) & int32(_ISspace)) != 0) { 5940 n++ 5941 } 5942 if n >= (len - 2) { 5943 break 5944 } 5945 n = n + (extractToken(tls, (((zScript + uintptr(ii)) + uintptr(2)) + uintptr(n)), ((len - 2) - n), 5946 (bp + 406 /* &azArg[0] */ + uintptr(nArg)*100), int32(unsafe.Sizeof([100]int8{})))) 5947 } 5948 for j = nArg; j < MX_ARG; j++ { 5949 *(*int8)(unsafe.Pointer((bp + 406 /* &azArg[0] */ + uintptr(libc.PostIncInt32(&j, 1))*100))) = int8(0) 5950 } 5951 5952 // --sleep N 5953 // 5954 // Pause for N milliseconds 5955 if libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1207 /* "sleep" */) == 0 { 5956 sqlite3.Xsqlite3_sleep(tls, libc.Xatoi(tls, (bp+406 /* &azArg[0] */))) 5957 } else 5958 5959 // --exit N 5960 // 5961 // Exit this process. If N>0 then exit without shutting down 5962 // SQLite. (In other words, simulate a crash.) 5963 if libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1213 /* "exit" */) == 0 { 5964 var rc int32 = libc.Xatoi(tls, (bp + 406 /* &azArg[0] */)) 5965 finishScript(tls, iClient, taskId, 1) 5966 if rc == 0 { 5967 sqlite3.Xsqlite3_close(tls, g.db) 5968 } 5969 libc.Xexit(tls, rc) 5970 } else 5971 5972 // --testcase NAME 5973 // 5974 // Begin a new test case. Announce in the log that the test case 5975 // has begun. 5976 if libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1218 /* "testcase" */) == 0 { 5977 if g.iTrace == 1 { 5978 logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+32, (len-1), (zScript+uintptr(ii)))) 5979 } 5980 stringReset(tls, bp+360 /* &sResult */) 5981 } else 5982 5983 // --finish 5984 // 5985 // Mark the current task as having finished, even if it is not. 5986 // This can be used in conjunction with --exit to simulate a crash. 5987 if (libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1227 /* "finish" */) == 0) && (iClient > 0) { 5988 finishScript(tls, iClient, taskId, 1) 5989 } else 5990 5991 // --reset 5992 // 5993 // Reset accumulated results back to an empty string 5994 if libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1234 /* "reset" */) == 0 { 5995 stringReset(tls, bp+360 /* &sResult */) 5996 } else 5997 5998 // --match ANSWER... 5999 // 6000 // Check to see if output matches ANSWER. Report an error if not. 6001 if libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1240 /* "match" */) == 0 { 6002 var jj int32 6003 var zAns uintptr = (zScript + uintptr(ii)) 6004 for jj = 7; (jj < (len - 1)) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zAns + uintptr(jj))))))*2))) & int32(_ISspace)) != 0); jj++ { 6005 } 6006 zAns += uintptr(jj) 6007 if (((len - jj) - 1) != (*String)(unsafe.Pointer(bp+360 /* &sResult */)).n) || (libc.Xstrncmp(tls, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z, zAns, (uint32((len-jj)-1))) != 0) { 6008 errorMessage(tls, ts+1246, /* "line %d of %s:\nE..." */ 6009 libc.VaList(bp+48, prevLine, zFilename, ((len-jj)-1), zAns, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z)) 6010 } 6011 g.nTest++ 6012 stringReset(tls, bp+360 /* &sResult */) 6013 } else 6014 6015 // --glob ANSWER... 6016 // --notglob ANSWER.... 6017 // 6018 // Check to see if output does or does not match the glob pattern 6019 // ANSWER. 6020 if (libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1291 /* "glob" */) == 0) || (libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1296 /* "notglob" */) == 0) { 6021 var jj int32 6022 var zAns uintptr = (zScript + uintptr(ii)) 6023 var zCopy uintptr 6024 var isGlob int32 = (libc.Bool32(int32(*(*int8)(unsafe.Pointer(bp + 376 /* &zCmd[0] */))) == 'g')) 6025 for jj = (9 - (3 * isGlob)); (jj < (len - 1)) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zAns + uintptr(jj))))))*2))) & int32(_ISspace)) != 0); jj++ { 6026 } 6027 zAns += uintptr(jj) 6028 zCopy = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+88, ((len-jj)-1), zAns)) 6029 if ((libc.Bool32(sqlite3.Xsqlite3_strglob(tls, zCopy, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z) == 0)) ^ isGlob) != 0 { 6030 errorMessage(tls, ts+1304, /* "line %d of %s:\nE..." */ 6031 libc.VaList(bp+104, prevLine, zFilename, zCopy, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z)) 6032 } 6033 sqlite3.Xsqlite3_free(tls, zCopy) 6034 g.nTest++ 6035 stringReset(tls, bp+360 /* &sResult */) 6036 } else 6037 6038 // --output 6039 // 6040 // Output the result of the previous SQL. 6041 if libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1347 /* "output" */) == 0 { 6042 logMessage(tls, ts+438 /* "%s" */, libc.VaList(bp+136, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z)) 6043 } else 6044 6045 // --source FILENAME 6046 // 6047 // Run a subscript from a separate file. 6048 if libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1354 /* "source" */) == 0 { 6049 var zNewFile uintptr 6050 var zNewScript uintptr 6051 var zToDel uintptr = uintptr(0) 6052 zNewFile = (bp + 406 /* &azArg[0] */) 6053 if !((int32(*(*int8)(unsafe.Pointer(zNewFile)))) == '/') { 6054 var k int32 6055 for k = (int32(libc.Xstrlen(tls, zFilename)) - 1); (k >= 0) && !((int32(*(*int8)(unsafe.Pointer(zFilename + uintptr(k))))) == '/'); k-- { 6056 } 6057 if k > 0 { 6058 zNewFile = libc.AssignUintptr(&zToDel, sqlite3.Xsqlite3_mprintf(tls, ts+1361 /* "%.*s/%s" */, libc.VaList(bp+144, k, zFilename, zNewFile))) 6059 } 6060 } 6061 zNewScript = readFile(tls, zNewFile) 6062 if g.iTrace != 0 { 6063 logMessage(tls, ts+1369 /* "begin script [%s..." */, libc.VaList(bp+168, zNewFile)) 6064 } 6065 runScript(tls, 0, 0, zNewScript, zNewFile) 6066 sqlite3.Xsqlite3_free(tls, zNewScript) 6067 if g.iTrace != 0 { 6068 logMessage(tls, ts+1388 /* "end script [%s]\n" */, libc.VaList(bp+176, zNewFile)) 6069 } 6070 sqlite3.Xsqlite3_free(tls, zToDel) 6071 } else 6072 6073 // --print MESSAGE.... 6074 // 6075 // Output the remainder of the line to the log file 6076 if libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1405 /* "print" */) == 0 { 6077 var jj int32 6078 for jj = 7; (jj < len) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + jj)))))))*2))) & int32(_ISspace)) != 0); jj++ { 6079 } 6080 logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+184, (len-jj), ((zScript+uintptr(ii))+uintptr(jj)))) 6081 } else 6082 6083 // --if EXPR 6084 // 6085 // Skip forward to the next matching --endif or --else if EXPR is false. 6086 if libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1411 /* "if" */) == 0 { 6087 var jj int32 6088 var rc int32 6089 var pStmt uintptr 6090 for jj = 4; (jj < len) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + jj)))))))*2))) & int32(_ISspace)) != 0); jj++ { 6091 } 6092 pStmt = prepareSql(tls, ts+1414 /* "SELECT %.*s" */, libc.VaList(bp+200, (len-jj), ((zScript+uintptr(ii))+uintptr(jj)))) 6093 rc = sqlite3.Xsqlite3_step(tls, pStmt) 6094 if (rc != SQLITE_ROW) || (sqlite3.Xsqlite3_column_int(tls, pStmt, 0) == 0) { 6095 ii = ii + (findEndif(tls, ((zScript + uintptr(ii)) + uintptr(len)), 1, bp+372 /* &lineno */)) 6096 } 6097 sqlite3.Xsqlite3_finalize(tls, pStmt) 6098 } else 6099 6100 // --else 6101 // 6102 // This command can only be encountered if currently inside an --if that 6103 // is true. Skip forward to the next matching --endif. 6104 if libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1426 /* "else" */) == 0 { 6105 ii = ii + (findEndif(tls, ((zScript + uintptr(ii)) + uintptr(len)), 0, bp+372 /* &lineno */)) 6106 } else 6107 6108 // --endif 6109 // 6110 // This command can only be encountered if currently inside an --if that 6111 // is true or an --else of a false if. This is a no-op. 6112 if libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1431 /* "endif" */) == 0 { 6113 // no-op 6114 } else 6115 6116 // --start CLIENT 6117 // 6118 // Start up the given client. 6119 if (libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1437 /* "start" */) == 0) && (iClient == 0) { 6120 var iNewClient int32 = libc.Xatoi(tls, (bp + 406 /* &azArg[0] */)) 6121 if iNewClient > 0 { 6122 startClient(tls, iNewClient) 6123 } 6124 } else 6125 6126 // --wait CLIENT TIMEOUT 6127 // 6128 // Wait until all tasks complete for the given client. If CLIENT is 6129 // "all" then wait for all clients to complete. Wait no longer than 6130 // TIMEOUT milliseconds (default 10,000) 6131 if (libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1443 /* "wait" */) == 0) && (iClient == 0) { 6132 var iTimeout int32 6133 if nArg >= 2 { 6134 iTimeout = libc.Xatoi(tls, (bp + 406 /* &azArg[0] */ + 1*100)) 6135 } else { 6136 iTimeout = 10000 6137 } 6138 sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([1000]int8{})), bp+606 /* &zError[0] */, ts+1448, /* "line %d of %s\n" */ 6139 libc.VaList(bp+216, prevLine, zFilename)) 6140 waitForClient(tls, libc.Xatoi(tls, (bp+406 /* &azArg[0] */)), iTimeout, bp+606 /* &zError[0] */) 6141 } else 6142 6143 // --task CLIENT 6144 // <task-content-here> 6145 // --end 6146 // 6147 // Assign work to a client. Start the client if it is not running 6148 // already. 6149 if (libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1463 /* "task" */) == 0) && (iClient == 0) { 6150 var iTarget int32 = libc.Xatoi(tls, (bp + 406 /* &azArg[0] */)) 6151 var iEnd int32 6152 var zTask uintptr 6153 var zTName uintptr 6154 iEnd = findEnd(tls, ((zScript + uintptr(ii)) + uintptr(len)), bp+372 /* &lineno */) 6155 if iTarget < 0 { 6156 errorMessage(tls, ts+1468, /* "line %d of %s: b..." */ 6157 libc.VaList(bp+232, prevLine, zFilename, iTarget)) 6158 } else { 6159 zTask = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+256, iEnd, ((zScript+uintptr(ii))+uintptr(len)))) 6160 if nArg > 1 { 6161 zTName = sqlite3.Xsqlite3_mprintf(tls, ts+438 /* "%s" */, libc.VaList(bp+272, (bp+406 /* &azArg[0] */ +1*100))) 6162 } else { 6163 zTName = sqlite3.Xsqlite3_mprintf(tls, ts+1505 /* "%s:%d" */, libc.VaList(bp+280, filenameTail(tls, zFilename), prevLine)) 6164 } 6165 startClient(tls, iTarget) 6166 runSql(tls, 6167 ts+1511 /* "INSERT INTO task..." */, libc.VaList(bp+296, iTarget, zTask, zTName)) 6168 sqlite3.Xsqlite3_free(tls, zTask) 6169 sqlite3.Xsqlite3_free(tls, zTName) 6170 } 6171 iEnd = iEnd + (tokenLength(tls, (((zScript + uintptr(ii)) + uintptr(len)) + uintptr(iEnd)), bp+372 /* &lineno */)) 6172 len = len + (iEnd) 6173 iBegin = (ii + len) 6174 } else 6175 6176 // --breakpoint 6177 // 6178 // This command calls "test_breakpoint()" which is a routine provided 6179 // as a convenient place to set a debugger breakpoint. 6180 if libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1567 /* "breakpoint" */) == 0 { 6181 test_breakpoint(tls) 6182 } else 6183 6184 // --show-sql-errors BOOLEAN 6185 // 6186 // Turn display of SQL errors on and off. 6187 if libc.Xstrcmp(tls, bp+376 /* &zCmd[0] */, ts+1578 /* "show-sql-errors" */) == 0 { 6188 g.bIgnoreSqlErrors = func() int32 { 6189 if nArg >= 1 { 6190 return libc.BoolInt32(!(booleanValue(tls, (bp+406 /* &azArg[0] */)) != 0)) 6191 } 6192 return 1 6193 }() 6194 } else { 6195 errorMessage(tls, ts+1594, /* "line %d of %s: u..." */ 6196 libc.VaList(bp+320, prevLine, zFilename, bp+376 /* &zCmd[0] */)) 6197 } 6198 ii = ii + (len) 6199 } 6200 if iBegin < ii { 6201 var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+344, (ii-iBegin), (zScript+uintptr(iBegin)))) 6202 runSql(tls, zSql, 0) 6203 sqlite3.Xsqlite3_free(tls, zSql) 6204 } 6205 stringFree(tls, bp+360 /* &sResult */) 6206 } 6207 6208 // Look for a command-line option. If present, return a pointer. 6209 // Return NULL if missing. 6210 // 6211 // hasArg==0 means the option is a flag. It is either present or not. 6212 // hasArg==1 means the option has an argument. Return a pointer to the 6213 // argument. 6214 func findOption(tls *libc.TLS, azArg uintptr, pnArg uintptr, zOption uintptr, hasArg int32) uintptr { /* mptest.c:1201:13: */ 6215 bp := tls.Alloc(8) 6216 defer tls.Free(8) 6217 6218 var i int32 6219 var j int32 6220 var zReturn uintptr = uintptr(0) 6221 var nArg int32 = *(*int32)(unsafe.Pointer(pnArg)) 6222 6223 for i = 0; i < nArg; i++ { 6224 var z uintptr 6225 if (i + hasArg) >= nArg { 6226 break 6227 } 6228 z = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)) 6229 if int32(*(*int8)(unsafe.Pointer(z))) != '-' { 6230 continue 6231 } 6232 z++ 6233 if int32(*(*int8)(unsafe.Pointer(z))) == '-' { 6234 if int32(*(*int8)(unsafe.Pointer(z + 1))) == 0 { 6235 break 6236 } 6237 z++ 6238 } 6239 if libc.Xstrcmp(tls, z, zOption) == 0 { 6240 if (hasArg != 0) && (i == (nArg - 1)) { 6241 fatalError(tls, ts+1630 /* "command-line opt..." */, libc.VaList(bp, z)) 6242 } 6243 if hasArg != 0 { 6244 zReturn = *(*uintptr)(unsafe.Pointer(azArg + uintptr((i+1))*4)) 6245 } else { 6246 zReturn = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)) 6247 } 6248 j = ((i + 1) + (libc.Bool32(hasArg != 0))) 6249 for j < nArg { 6250 *(*uintptr)(unsafe.Pointer(azArg + uintptr(libc.PostIncInt32(&i, 1))*4)) = *(*uintptr)(unsafe.Pointer(azArg + uintptr(libc.PostIncInt32(&j, 1))*4)) 6251 } 6252 *(*int32)(unsafe.Pointer(pnArg)) = i 6253 return zReturn 6254 } 6255 } 6256 return zReturn 6257 } 6258 6259 // Print a usage message for the program and exit 6260 func usage(tls *libc.TLS, argv0 uintptr) { /* mptest.c:1241:13: */ 6261 bp := tls.Alloc(8) 6262 defer tls.Free(8) 6263 6264 var i int32 6265 var zTail uintptr = argv0 6266 for i = 0; *(*int8)(unsafe.Pointer(argv0 + uintptr(i))) != 0; i++ { 6267 if (int32(*(*int8)(unsafe.Pointer(argv0 + uintptr(i))))) == '/' { 6268 zTail = ((argv0 + uintptr(i)) + uintptr(1)) 6269 } 6270 } 6271 libc.Xfprintf(tls, libc.Xstderr, ts+1678 /* "Usage: %s DATABA..." */, libc.VaList(bp, zTail)) 6272 libc.Xfprintf(tls, libc.Xstderr, 6273 6274 ts+1717 /* "Options:\n --er..." */, 0) 6275 libc.Xexit(tls, 1) 6276 } 6277 6278 // Report on unrecognized arguments 6279 func unrecognizedArguments(tls *libc.TLS, argv0 uintptr, nArg int32, azArg uintptr) { /* mptest.c:1265:13: */ 6280 bp := tls.Alloc(16) 6281 defer tls.Free(16) 6282 6283 var i int32 6284 libc.Xfprintf(tls, libc.Xstderr, ts+2289 /* "%s: unrecognized..." */, libc.VaList(bp, argv0)) 6285 for i = 0; i < nArg; i++ { 6286 libc.Xfprintf(tls, libc.Xstderr, ts+2317 /* " %s" */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)))) 6287 } 6288 libc.Xfprintf(tls, libc.Xstderr, ts+2321 /* "\n" */, 0) 6289 libc.Xexit(tls, 1) 6290 } 6291 6292 func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18: */ 6293 bp := tls.Alloc(248) 6294 defer tls.Free(248) 6295 6296 var zClient uintptr 6297 var iClient int32 6298 // var n int32 at bp+232, 4 6299 6300 var i int32 6301 var openFlags int32 = SQLITE_OPEN_READWRITE 6302 var rc int32 6303 // var zScript uintptr at bp+236, 4 6304 6305 // var taskId int32 at bp+240, 4 6306 6307 var zTrace uintptr 6308 var zCOption uintptr 6309 var zJMode uintptr 6310 var zNRep uintptr 6311 var nRep int32 = 1 6312 var iRep int32 6313 var iTmout int32 = 0 // Default: no timeout 6314 var zTmout uintptr 6315 6316 g.argv0 = *(*uintptr)(unsafe.Pointer(argv)) 6317 g.iTrace = 1 6318 if argc < 2 { 6319 usage(tls, *(*uintptr)(unsafe.Pointer(argv))) 6320 } 6321 g.zDbFile = *(*uintptr)(unsafe.Pointer(argv + 1*4)) 6322 if strglob(tls, ts+2323 /* "*.test" */, g.zDbFile) != 0 { 6323 usage(tls, *(*uintptr)(unsafe.Pointer(argv))) 6324 } 6325 if libc.Xstrcmp(tls, sqlite3.Xsqlite3_sourceid(tls), ts+2330 /* "2021-06-18 18:36..." */) != 0 { 6326 libc.Xfprintf(tls, libc.Xstderr, 6327 6328 ts+2415, /* "SQLite library a..." */ 6329 libc.VaList(bp, sqlite3.Xsqlite3_sourceid(tls), ts+2330 /* "2021-06-18 18:36..." */)) 6330 libc.Xexit(tls, 1) 6331 } 6332 *(*int32)(unsafe.Pointer(bp + 232 /* n */)) = (argc - 2) 6333 sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([32]int8{})), uintptr(unsafe.Pointer(&g))+32 /* &.zName */, ts+2475 /* "%05d.mptest" */, libc.VaList(bp+16, libc.Xgetpid(tls))) 6334 zJMode = findOption(tls, (argv + uintptr(2)*4), bp+232 /* &n */, ts+2487 /* "journalmode" */, 1) 6335 zNRep = findOption(tls, (argv + uintptr(2)*4), bp+232 /* &n */, ts+2499 /* "repeat" */, 1) 6336 if zNRep != 0 { 6337 nRep = libc.Xatoi(tls, zNRep) 6338 } 6339 if nRep < 1 { 6340 nRep = 1 6341 } 6342 g.zVfs = findOption(tls, (argv + uintptr(2)*4), bp+232 /* &n */, ts+2506 /* "vfs" */, 1) 6343 zClient = findOption(tls, (argv + uintptr(2)*4), bp+232 /* &n */, ts+2510 /* "client" */, 1) 6344 g.zErrLog = findOption(tls, (argv + uintptr(2)*4), bp+232 /* &n */, ts+2517 /* "errlog" */, 1) 6345 g.zLog = findOption(tls, (argv + uintptr(2)*4), bp+232 /* &n */, ts+2524 /* "log" */, 1) 6346 zTrace = findOption(tls, (argv + uintptr(2)*4), bp+232 /* &n */, ts+2528 /* "trace" */, 1) 6347 if zTrace != 0 { 6348 g.iTrace = libc.Xatoi(tls, zTrace) 6349 } 6350 if findOption(tls, (argv+uintptr(2)*4), bp+232 /* &n */, ts+2534 /* "quiet" */, 0) != uintptr(0) { 6351 g.iTrace = 0 6352 } 6353 zTmout = findOption(tls, (argv + uintptr(2)*4), bp+232 /* &n */, ts+2540 /* "timeout" */, 1) 6354 if zTmout != 0 { 6355 iTmout = libc.Xatoi(tls, zTmout) 6356 } 6357 g.bSqlTrace = (libc.Bool32(findOption(tls, (argv+uintptr(2)*4), bp+232 /* &n */, ts+2548 /* "sqltrace" */, 0) != uintptr(0))) 6358 g.bSync = (libc.Bool32(findOption(tls, (argv+uintptr(2)*4), bp+232 /* &n */, ts+2557 /* "sync" */, 0) != uintptr(0))) 6359 if g.zErrLog != 0 { 6360 g.pErrLog = libc.Xfopen(tls, g.zErrLog, ts+2562 /* "a" */) 6361 } else { 6362 g.pErrLog = libc.Xstderr 6363 } 6364 if g.zLog != 0 { 6365 g.pLog = libc.Xfopen(tls, g.zLog, ts+2562 /* "a" */) 6366 } else { 6367 g.pLog = libc.Xstdout 6368 } 6369 6370 sqlite3.Xsqlite3_config(tls, SQLITE_CONFIG_LOG, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(&struct { 6371 f func(*libc.TLS, uintptr, int32, uintptr) 6372 }{sqlErrorCallback})), 0)) 6373 if zClient != 0 { 6374 iClient = libc.Xatoi(tls, zClient) 6375 if iClient < 1 { 6376 fatalError(tls, ts+2564 /* "illegal client n..." */, libc.VaList(bp+40, iClient)) 6377 } 6378 sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([32]int8{})), uintptr(unsafe.Pointer(&g))+32 /* &.zName */, ts+2591, /* "%05d.client%02d" */ 6379 libc.VaList(bp+48, libc.Xgetpid(tls), iClient)) 6380 } else { 6381 var nTry int32 = 0 6382 if g.iTrace > 0 { 6383 libc.Xprintf(tls, ts+2607 /* "BEGIN: %s" */, libc.VaList(bp+64, *(*uintptr)(unsafe.Pointer(argv)))) 6384 for i = 1; i < argc; i++ { 6385 libc.Xprintf(tls, ts+2317 /* " %s" */, libc.VaList(bp+72, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4)))) 6386 } 6387 libc.Xprintf(tls, ts+2321 /* "\n" */, 0) 6388 libc.Xprintf(tls, ts+2617 /* "With SQLite 3.36..." */, 0) 6389 for i = 0; (libc.AssignUintptr(&zCOption, sqlite3.Xsqlite3_compileoption_get(tls, i))) != uintptr(0); i++ { 6390 libc.Xprintf(tls, ts+2722 /* "-DSQLITE_%s\n" */, libc.VaList(bp+80, zCOption)) 6391 } 6392 libc.Xfflush(tls, libc.Xstdout) 6393 } 6394 iClient = 0 6395 for ok := true; ok; ok = (((rc != 0) && ((libc.PreIncInt32(&nTry, 1)) < 60)) && (sqlite3.Xsqlite3_sleep(tls, 1000) > 0)) { 6396 if (nTry % 5) == 4 { 6397 libc.Xprintf(tls, ts+2735, /* "... %strying to ..." */ 6398 libc.VaList(bp+88, func() uintptr { 6399 if nTry > 5 { 6400 return ts + 2764 /* "still " */ 6401 } 6402 return ts + 1099 /* "" */ 6403 }(), g.zDbFile)) 6404 } 6405 rc = libc.Xunlink(tls, g.zDbFile) 6406 if (rc != 0) && ((*(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) == ENOENT) { 6407 rc = 0 6408 } 6409 } 6410 if rc != 0 { 6411 fatalError(tls, ts+2771, /* "unable to unlink..." */ 6412 libc.VaList(bp+104, g.zDbFile, nTry)) 6413 } 6414 openFlags = openFlags | (SQLITE_OPEN_CREATE) 6415 } 6416 rc = sqlite3.Xsqlite3_open_v2(tls, g.zDbFile, (uintptr(unsafe.Pointer(&g)) + 12 /* &.db */), openFlags, g.zVfs) 6417 if rc != 0 { 6418 fatalError(tls, ts+2812 /* "cannot open [%s]" */, libc.VaList(bp+120, g.zDbFile)) 6419 } 6420 if iTmout > 0 { 6421 sqlite3.Xsqlite3_busy_timeout(tls, g.db, iTmout) 6422 } 6423 6424 if zJMode != 0 { 6425 runSql(tls, ts+2829 /* "PRAGMA journal_m..." */, libc.VaList(bp+128, zJMode)) 6426 } 6427 if !(g.bSync != 0) { 6428 trySql(tls, ts+2853 /* "PRAGMA synchrono..." */, 0) 6429 } 6430 sqlite3.Xsqlite3_enable_load_extension(tls, g.db, 1) 6431 sqlite3.Xsqlite3_busy_handler(tls, g.db, *(*uintptr)(unsafe.Pointer(&struct { 6432 f func(*libc.TLS, uintptr, int32) int32 6433 }{busyHandler})), uintptr(0)) 6434 sqlite3.Xsqlite3_create_function(tls, g.db, ts+2876 /* "vfsname" */, 0, SQLITE_UTF8, uintptr(0), 6435 *(*uintptr)(unsafe.Pointer(&struct { 6436 f func(*libc.TLS, uintptr, int32, uintptr) 6437 }{vfsNameFunc})), uintptr(0), uintptr(0)) 6438 sqlite3.Xsqlite3_create_function(tls, g.db, ts+2884 /* "eval" */, 1, SQLITE_UTF8, uintptr(0), 6439 *(*uintptr)(unsafe.Pointer(&struct { 6440 f func(*libc.TLS, uintptr, int32, uintptr) 6441 }{evalFunc})), uintptr(0), uintptr(0)) 6442 g.iTimeout = DEFAULT_TIMEOUT 6443 if g.bSqlTrace != 0 { 6444 sqlite3.Xsqlite3_trace(tls, g.db, *(*uintptr)(unsafe.Pointer(&struct { 6445 f func(*libc.TLS, uintptr, uintptr) 6446 }{sqlTraceCallback})), uintptr(0)) 6447 } 6448 if iClient > 0 { 6449 if *(*int32)(unsafe.Pointer(bp + 232 /* n */)) > 0 { 6450 unrecognizedArguments(tls, *(*uintptr)(unsafe.Pointer(argv)), *(*int32)(unsafe.Pointer(bp + 232 /* n */)), (argv + uintptr(2)*4)) 6451 } 6452 if g.iTrace != 0 { 6453 logMessage(tls, ts+2889 /* "start-client" */, 0) 6454 } 6455 for 1 != 0 { 6456 *(*uintptr)(unsafe.Pointer(bp + 244 /* zTaskName */)) = uintptr(0) 6457 rc = startScript(tls, iClient, bp+236 /* &zScript */, bp+240 /* &taskId */, bp+244 /* &zTaskName */) 6458 if rc == SQLITE_DONE { 6459 break 6460 } 6461 if g.iTrace != 0 { 6462 logMessage(tls, ts+2902 /* "begin %s (%d)" */, libc.VaList(bp+136, *(*uintptr)(unsafe.Pointer(bp + 244 /* zTaskName */)), *(*int32)(unsafe.Pointer(bp + 240 /* taskId */)))) 6463 } 6464 runScript(tls, iClient, *(*int32)(unsafe.Pointer(bp + 240 /* taskId */)), *(*uintptr)(unsafe.Pointer(bp + 236 /* zScript */)), *(*uintptr)(unsafe.Pointer(bp + 244 /* zTaskName */))) 6465 if g.iTrace != 0 { 6466 logMessage(tls, ts+2916 /* "end %s (%d)" */, libc.VaList(bp+152, *(*uintptr)(unsafe.Pointer(bp + 244 /* zTaskName */)), *(*int32)(unsafe.Pointer(bp + 240 /* taskId */)))) 6467 } 6468 finishScript(tls, iClient, *(*int32)(unsafe.Pointer(bp + 240 /* taskId */)), 0) 6469 sqlite3.Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 244 /* zTaskName */))) 6470 sqlite3.Xsqlite3_sleep(tls, 10) 6471 } 6472 if g.iTrace != 0 { 6473 logMessage(tls, ts+2928 /* "end-client" */, 0) 6474 } 6475 } else { 6476 var pStmt uintptr 6477 var iTimeout int32 6478 if *(*int32)(unsafe.Pointer(bp + 232 /* n */)) == 0 { 6479 fatalError(tls, ts+2939 /* "missing script f..." */, 0) 6480 } 6481 if *(*int32)(unsafe.Pointer(bp + 232 /* n */)) > 1 { 6482 unrecognizedArguments(tls, *(*uintptr)(unsafe.Pointer(argv)), *(*int32)(unsafe.Pointer(bp + 232 /* n */)), (argv + uintptr(2)*4)) 6483 } 6484 runSql(tls, 6485 6486 ts+2963 /* "DROP TABLE IF EX..." */, 0) 6487 *(*uintptr)(unsafe.Pointer(bp + 236 /* zScript */)) = readFile(tls, *(*uintptr)(unsafe.Pointer(argv + 2*4))) 6488 for iRep = 1; iRep <= nRep; iRep++ { 6489 if g.iTrace != 0 { 6490 logMessage(tls, ts+3399 /* "begin script [%s..." */, libc.VaList(bp+168, *(*uintptr)(unsafe.Pointer(argv + 2*4)), iRep)) 6491 } 6492 runScript(tls, 0, 0, *(*uintptr)(unsafe.Pointer(bp + 236 /* zScript */)), *(*uintptr)(unsafe.Pointer(argv + 2*4))) 6493 if g.iTrace != 0 { 6494 logMessage(tls, ts+3427 /* "end script [%s] ..." */, libc.VaList(bp+184, *(*uintptr)(unsafe.Pointer(argv + 2*4)), iRep)) 6495 } 6496 } 6497 sqlite3.Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 236 /* zScript */))) 6498 waitForClient(tls, 0, 2000, ts+3453 /* "during shutdown...." */) 6499 trySql(tls, ts+3473 /* "UPDATE client SE..." */, 0) 6500 sqlite3.Xsqlite3_sleep(tls, 10) 6501 g.iTimeout = 0 6502 iTimeout = 1000 6503 for (((libc.AssignInt32(&rc, trySql(tls, ts+3502 /* "SELECT 1 FROM cl..." */, 0))) == SQLITE_BUSY) || 6504 (rc == SQLITE_ROW)) && (iTimeout > 0) { 6505 sqlite3.Xsqlite3_sleep(tls, 10) 6506 iTimeout = iTimeout - (10) 6507 } 6508 sqlite3.Xsqlite3_sleep(tls, 100) 6509 pStmt = prepareSql(tls, ts+3523 /* "SELECT nError, n..." */, 0) 6510 iTimeout = 1000 6511 for ((libc.AssignInt32(&rc, sqlite3.Xsqlite3_step(tls, pStmt))) == SQLITE_BUSY) && (iTimeout > 0) { 6512 sqlite3.Xsqlite3_sleep(tls, 10) 6513 iTimeout = iTimeout - (10) 6514 } 6515 if rc == SQLITE_ROW { 6516 *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 80 /* &.nError */)) += (sqlite3.Xsqlite3_column_int(tls, pStmt, 0)) 6517 *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 84 /* &.nTest */)) += (sqlite3.Xsqlite3_column_int(tls, pStmt, 1)) 6518 } 6519 sqlite3.Xsqlite3_finalize(tls, pStmt) 6520 } 6521 sqlite3.Xsqlite3_close(tls, g.db) 6522 maybeClose(tls, g.pLog) 6523 maybeClose(tls, g.pErrLog) 6524 if iClient == 0 { 6525 libc.Xprintf(tls, ts+3558 /* "Summary: %d erro..." */, libc.VaList(bp+200, g.nError, g.nTest)) 6526 libc.Xprintf(tls, ts+3594 /* "END: %s" */, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(argv)))) 6527 for i = 1; i < argc; i++ { 6528 libc.Xprintf(tls, ts+2317 /* " %s" */, libc.VaList(bp+224, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4)))) 6529 } 6530 libc.Xprintf(tls, ts+2321 /* "\n" */, 0) 6531 } 6532 return (libc.Bool32(g.nError > 0)) 6533 } 6534 6535 var ts1 = "%s%.*s\n\x00%s:ERROR: \x00%s:FATAL: \x00UPDATE client SET wantHalt=1;\x00%s: \x00main\x00timeout after %dms\x00[%.*s]\x00(info) %s\x00(errcode=%d) %s\x00%s\n%s\n\x00out of memory\x00 \x00nil\x00'\x00error(%d)\x00BEGIN IMMEDIATE\x00in startScript: %s\x00UPDATE counters SET nError=nError+%d, nTest=nTest+%d\x00SELECT 1 FROM client WHERE id=%d AND wantHalt\x00DELETE FROM client WHERE id=%d\x00COMMIT TRANSACTION;\x00SELECT script, id, name FROM task WHERE client=%d AND starttime IS NULL ORDER BY id LIMIT 1\x00%s\x00UPDATE task SET starttime=strftime('%%Y-%%m-%%d %%H:%%M:%%f','now') WHERE id=%d;\x00Waited over 30 seconds with no work. Giving up.\x00DELETE FROM client WHERE id=%d; COMMIT;\x00COMMIT\x00UPDATE task SET endtime=strftime('%%Y-%%m-%%d %%H:%%M:%%f','now') WHERE id=%d;\x00INSERT OR IGNORE INTO client VALUES(%d,0)\x00%s \"%s\" --client %d --trace %d\x00%z --sqltrace\x00%z --sync\x00%z --vfs \"%s\"\x00system('%q')\x00%z &\x00system() fails with error code %d\x00rb\x00cannot open \"%s\" for reading\x00--end\x00--endif\x00--else\x00--if\x00SELECT 1 FROM task WHERE client=%d AND client IN (SELECT id FROM client) AND endtime IS NULL\x00SELECT 1 FROM task WHERE client IN (SELECT id FROM client) AND endtime IS NULL\x00\x00%stimeout waiting for client %d\x00%stimeout waiting for all clients\x00on\x00yes\x00off\x00no\x00unknown boolean: [%s]\x00%.*s\x00sleep\x00exit\x00testcase\x00finish\x00reset\x00match\x00line %d of %s:\nExpected [%.*s]\n Got [%s]\x00glob\x00notglob\x00line %d of %s:\nExpected [%s]\n Got [%s]\x00output\x00source\x00%.*s/%s\x00begin script [%s]\n\x00end script [%s]\n\x00print\x00if\x00SELECT %.*s\x00else\x00endif\x00start\x00wait\x00line %d of %s\n\x00task\x00line %d of %s: bad client number: %d\x00%s:%d\x00INSERT INTO task(client,script,name) VALUES(%d,'%q',%Q)\x00breakpoint\x00show-sql-errors\x00line %d of %s: unknown command --%s\x00command-line option \"--%s\" requires an argument\x00Usage: %s DATABASE ?OPTIONS? ?SCRIPT?\n\x00Options:\n --errlog FILENAME Write errors to FILENAME\n --journalmode MODE Use MODE as the journal_mode\n --log FILENAME Log messages to FILENAME\n --quiet Suppress unnecessary output\n --vfs NAME Use NAME as the VFS\n --repeat N Repeat the test N times\n --sqltrace Enable SQL tracing\n --sync Enable synchronous disk writes\n --timeout MILLISEC Busy timeout is MILLISEC\n --trace BOOLEAN Enable or disable tracing\n\x00%s: unrecognized arguments:\x00 %s\x00\n\x00*.test\x002021-06-18 18:36:39 5c9a6c06871cb9fe42814af9c039eb6da5427a6ec28f187af7ebfb62eafa66e5\x00SQLite library and header mismatch\nLibrary: %s\nHeader: %s\n\x00%05d.mptest\x00journalmode\x00repeat\x00vfs\x00client\x00errlog\x00log\x00trace\x00quiet\x00timeout\x00sqltrace\x00sync\x00a\x00illegal client number: %d\n\x00%05d.client%02d\x00BEGIN: %s\x00With SQLite 3.36.0 2021-06-18 18:36:39 5c9a6c06871cb9fe42814af9c039eb6da5427a6ec28f187af7ebfb62eafa66e5\n\x00-DSQLITE_%s\n\x00... %strying to unlink '%s'\n\x00still \x00unable to unlink '%s' after %d attempts\n\x00cannot open [%s]\x00PRAGMA journal_mode=%Q;\x00PRAGMA synchronous=OFF\x00vfsname\x00eval\x00start-client\x00begin %s (%d)\x00end %s (%d)\x00end-client\x00missing script filename\x00DROP TABLE IF EXISTS task;\nDROP TABLE IF EXISTS counters;\nDROP TABLE IF EXISTS client;\nCREATE TABLE task(\n id INTEGER PRIMARY KEY,\n name TEXT,\n client INTEGER,\n starttime DATE,\n endtime DATE,\n script TEXT\n);CREATE INDEX task_i1 ON task(client, starttime);\nCREATE INDEX task_i2 ON task(client, endtime);\nCREATE TABLE counters(nError,nTest);\nINSERT INTO counters VALUES(0,0);\nCREATE TABLE client(id INTEGER PRIMARY KEY, wantHalt);\n\x00begin script [%s] cycle %d\n\x00end script [%s] cycle %d\n\x00during shutdown...\n\x00UPDATE client SET wantHalt=1\x00SELECT 1 FROM client\x00SELECT nError, nTest FROM counters\x00Summary: %d errors out of %d tests\n\x00END: %s\x00" 6536 var ts = (*reflect.StringHeader)(unsafe.Pointer(&ts1)).Data