mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-03 16:30:29 +00:00
Get SQLite to build
* changed headers * removed redundant declarations * ran clang-format * added sqlite3.mk
This commit is contained in:
parent
7711eb953a
commit
344347ca4c
122 changed files with 528 additions and 449 deletions
2
third_party/sqlite3/alter.c
vendored
2
third_party/sqlite3/alter.c
vendored
|
@ -12,7 +12,7 @@
|
|||
** This file contains C code routines that used to generate VDBE code
|
||||
** that implements the ALTER TABLE command.
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
/*
|
||||
** The code in this file only exists if we are not omitting the
|
||||
|
|
2
third_party/sqlite3/analyze.c
vendored
2
third_party/sqlite3/analyze.c
vendored
|
@ -140,7 +140,7 @@
|
|||
** integer in the equivalent columns in sqlite_stat4.
|
||||
*/
|
||||
#ifndef SQLITE_OMIT_ANALYZE
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
#if defined(SQLITE_ENABLE_STAT4)
|
||||
#define IsStat4 1
|
||||
|
|
2
third_party/sqlite3/attach.c
vendored
2
third_party/sqlite3/attach.c
vendored
|
@ -11,7 +11,7 @@
|
|||
*************************************************************************
|
||||
** This file contains code used to implement the ATTACH and DETACH commands.
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
#ifndef SQLITE_OMIT_ATTACH
|
||||
/*
|
||||
|
|
2
third_party/sqlite3/auth.c
vendored
2
third_party/sqlite3/auth.c
vendored
|
@ -14,7 +14,7 @@
|
|||
** systems that do not need this facility may omit it by recompiling
|
||||
** the library with -DSQLITE_OMIT_AUTHORIZATION=1
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
/*
|
||||
** All of the code in this file may be omitted by defining a single
|
||||
|
|
4
third_party/sqlite3/backup.c
vendored
4
third_party/sqlite3/backup.c
vendored
|
@ -12,8 +12,8 @@
|
|||
** This file contains the implementation of the sqlite3_backup_XXX()
|
||||
** API functions and the related features.
|
||||
*/
|
||||
#include "btreeInt.h"
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/btreeInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
/*
|
||||
** Structure allocated for each backup operation.
|
||||
|
|
2
third_party/sqlite3/bitvec.c
vendored
2
third_party/sqlite3/bitvec.c
vendored
|
@ -34,7 +34,7 @@
|
|||
** start of a transaction, and is thus usually less than a few thousand,
|
||||
** but can be as large as 2 billion for a really big database.
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
/* Size of the Bitvec structure in bytes. */
|
||||
#define BITVEC_SZ 512
|
||||
|
|
2
third_party/sqlite3/btmutex.c
vendored
2
third_party/sqlite3/btmutex.c
vendored
|
@ -15,7 +15,7 @@
|
|||
** big and we want to break it down some. This packaged seemed like
|
||||
** a good breakout.
|
||||
*/
|
||||
#include "btreeInt.h"
|
||||
#include "third_party/sqlite3/btreeInt.h"
|
||||
#ifndef SQLITE_OMIT_SHARED_CACHE
|
||||
#if SQLITE_THREADSAFE
|
||||
|
||||
|
|
2
third_party/sqlite3/btree.c
vendored
2
third_party/sqlite3/btree.c
vendored
|
@ -13,7 +13,7 @@
|
|||
** See the header comment on "btreeInt.h" for additional information.
|
||||
** Including a description of file format and an overview of operation.
|
||||
*/
|
||||
#include "btreeInt.h"
|
||||
#include "third_party/sqlite3/btreeInt.h"
|
||||
|
||||
/*
|
||||
** The header string that appears at the beginning of every
|
||||
|
|
2
third_party/sqlite3/btree.h
vendored
2
third_party/sqlite3/btree.h
vendored
|
@ -353,7 +353,7 @@ void sqlite3BtreeCursorList(Btree *);
|
|||
#endif
|
||||
|
||||
#ifndef SQLITE_OMIT_WAL
|
||||
int sqlite3BtreeCheckpoint(Btree *, int, int *, int *);
|
||||
/* int sqlite3BtreeCheckpoint(Btree *, int, int *, int *); */
|
||||
#endif
|
||||
|
||||
int sqlite3BtreeTransferRow(BtCursor *, BtCursor *, i64);
|
||||
|
|
2
third_party/sqlite3/btreeInt.h
vendored
2
third_party/sqlite3/btreeInt.h
vendored
|
@ -213,7 +213,7 @@
|
|||
** 4 Number of leaf pointers on this page
|
||||
** * zero or more pages numbers of leaves
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
/* The following value is the maximum cell size assuming a maximum page
|
||||
** size give above.
|
||||
|
|
2
third_party/sqlite3/build.c
vendored
2
third_party/sqlite3/build.c
vendored
|
@ -22,7 +22,7 @@
|
|||
** COMMIT
|
||||
** ROLLBACK
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
#ifndef SQLITE_OMIT_SHARED_CACHE
|
||||
/*
|
||||
|
|
2
third_party/sqlite3/callback.c
vendored
2
third_party/sqlite3/callback.c
vendored
|
@ -14,7 +14,7 @@
|
|||
** of user defined functions and collation sequences.
|
||||
*/
|
||||
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
/*
|
||||
** Invoke the 'collation needed' callback to request a collation sequence
|
||||
|
|
2
third_party/sqlite3/complete.c
vendored
2
third_party/sqlite3/complete.c
vendored
|
@ -16,7 +16,7 @@
|
|||
** separating it out, the code will be automatically omitted from
|
||||
** static links that do not use it.
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
#ifndef SQLITE_OMIT_COMPLETE
|
||||
|
||||
/*
|
||||
|
|
2
third_party/sqlite3/ctime.c
vendored
2
third_party/sqlite3/ctime.c
vendored
|
@ -21,7 +21,7 @@
|
|||
** autoconf-based build
|
||||
*/
|
||||
#if defined(_HAVE_SQLITE_CONFIG_H) && !defined(SQLITECONFIG_H)
|
||||
#include "config.h"
|
||||
#include "third_party/sqlite3/config.h"
|
||||
#define SQLITECONFIG_H 1
|
||||
#endif
|
||||
|
||||
|
|
11
third_party/sqlite3/date.c
vendored
11
third_party/sqlite3/date.c
vendored
|
@ -43,11 +43,12 @@
|
|||
** Willmann-Bell, Inc
|
||||
** Richmond, Virginia (USA)
|
||||
*/
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "sqliteInt.h"
|
||||
#include "libc/assert.h"
|
||||
#include "libc/calls/weirdtypes.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/time/struct/tm.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
#ifndef SQLITE_OMIT_DATETIME_FUNCS
|
||||
|
||||
|
|
2
third_party/sqlite3/dbpage.c
vendored
2
third_party/sqlite3/dbpage.c
vendored
|
@ -31,7 +31,7 @@
|
|||
** update fails. Rows may not be deleted or inserted.
|
||||
*/
|
||||
|
||||
#include "sqliteInt.h" /* Requires access to internal data structures */
|
||||
#include "third_party/sqlite3/sqliteInt.h" /* Requires access to internal data structures */
|
||||
#if (defined(SQLITE_ENABLE_DBPAGE_VTAB) || defined(SQLITE_TEST)) && \
|
||||
!defined(SQLITE_OMIT_VIRTUALTABLE)
|
||||
|
||||
|
|
2
third_party/sqlite3/dbstat.c
vendored
2
third_party/sqlite3/dbstat.c
vendored
|
@ -21,7 +21,7 @@
|
|||
** official SQLite documentation.
|
||||
*/
|
||||
|
||||
#include "sqliteInt.h" /* Requires access to internal data structures */
|
||||
#include "third_party/sqlite3/sqliteInt.h" /* Requires access to internal data structures */
|
||||
#if (defined(SQLITE_ENABLE_DBSTAT_VTAB) || defined(SQLITE_TEST)) && \
|
||||
!defined(SQLITE_OMIT_VIRTUALTABLE)
|
||||
|
||||
|
|
2
third_party/sqlite3/delete.c
vendored
2
third_party/sqlite3/delete.c
vendored
|
@ -12,7 +12,7 @@
|
|||
** This file contains C code routines that are called by the parser
|
||||
** in order to generate code for DELETE FROM statements.
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
/*
|
||||
** While a SrcList can in general represent multiple tables and subqueries
|
||||
|
|
2
third_party/sqlite3/expr.c
vendored
2
third_party/sqlite3/expr.c
vendored
|
@ -12,7 +12,7 @@
|
|||
** This file contains routines used for analyzing expressions and
|
||||
** for generating VDBE code that evaluates expressions in SQLite.
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
/* Forward declarations */
|
||||
static void exprCodeBetween(Parse *, Expr *, int,
|
||||
|
|
2
third_party/sqlite3/fault.c
vendored
2
third_party/sqlite3/fault.c
vendored
|
@ -24,7 +24,7 @@
|
|||
** during a hash table resize is a benign fault.
|
||||
*/
|
||||
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
#ifndef SQLITE_UNTESTABLE
|
||||
|
||||
|
|
2
third_party/sqlite3/fkey.c
vendored
2
third_party/sqlite3/fkey.c
vendored
|
@ -11,7 +11,7 @@
|
|||
** This file contains code used by the compiler to add foreign key
|
||||
** support to compiled SQL statements.
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
#ifndef SQLITE_OMIT_FOREIGN_KEY
|
||||
#ifndef SQLITE_OMIT_TRIGGER
|
||||
|
|
17
third_party/sqlite3/fts3.c
vendored
17
third_party/sqlite3/fts3.c
vendored
|
@ -288,23 +288,20 @@
|
|||
** older data.
|
||||
*/
|
||||
|
||||
#include "fts3Int.h"
|
||||
#include "third_party/sqlite3/fts3Int.h"
|
||||
#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3)
|
||||
|
||||
#if defined(SQLITE_ENABLE_FTS3) && !defined(SQLITE_CORE)
|
||||
#define SQLITE_CORE 1
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdarg.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "fts3.h"
|
||||
#include "libc/assert.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/sqlite3/fts3.h"
|
||||
#ifndef SQLITE_CORE
|
||||
#include "sqlite3ext.h"
|
||||
#include "third_party/sqlite3/sqlite3ext.h"
|
||||
SQLITE_EXTENSION_INIT1
|
||||
#endif
|
||||
|
||||
|
|
2
third_party/sqlite3/fts3.h
vendored
2
third_party/sqlite3/fts3.h
vendored
|
@ -13,7 +13,7 @@
|
|||
** This header file is used by programs that want to link against the
|
||||
** FTS3 library. All it does is declare the sqlite3Fts3Init() interface.
|
||||
*/
|
||||
#include "sqlite3.h"
|
||||
#include "third_party/sqlite3/sqlite3.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
8
third_party/sqlite3/fts3Int.h
vendored
8
third_party/sqlite3/fts3Int.h
vendored
|
@ -37,13 +37,13 @@
|
|||
|
||||
/* If not building as part of the core, include sqlite3ext.h. */
|
||||
#ifndef SQLITE_CORE
|
||||
#include "sqlite3ext.h"
|
||||
#include "third_party/sqlite3/sqlite3ext.h"
|
||||
SQLITE_EXTENSION_INIT3
|
||||
#endif
|
||||
|
||||
#include "fts3_hash.h"
|
||||
#include "fts3_tokenizer.h"
|
||||
#include "sqlite3.h"
|
||||
#include "third_party/sqlite3/fts3_hash.h"
|
||||
#include "third_party/sqlite3/fts3_tokenizer.h"
|
||||
#include "third_party/sqlite3/sqlite3.h"
|
||||
|
||||
/*
|
||||
** This constant determines the maximum depth of an FTS expression tree
|
||||
|
|
6
third_party/sqlite3/fts3_aux.c
vendored
6
third_party/sqlite3/fts3_aux.c
vendored
|
@ -11,11 +11,11 @@
|
|||
******************************************************************************
|
||||
**
|
||||
*/
|
||||
#include "fts3Int.h"
|
||||
#include "third_party/sqlite3/fts3Int.h"
|
||||
#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3)
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include "libc/assert.h"
|
||||
#include "libc/str/str.h"
|
||||
|
||||
typedef struct Fts3auxTable Fts3auxTable;
|
||||
typedef struct Fts3auxCursor Fts3auxCursor;
|
||||
|
|
8
third_party/sqlite3/fts3_expr.c
vendored
8
third_party/sqlite3/fts3_expr.c
vendored
|
@ -15,7 +15,7 @@
|
|||
** syntax is relatively simple, the whole tokenizer/parser system is
|
||||
** hand-coded.
|
||||
*/
|
||||
#include "fts3Int.h"
|
||||
#include "third_party/sqlite3/fts3Int.h"
|
||||
#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3)
|
||||
|
||||
/*
|
||||
|
@ -78,8 +78,8 @@ int sqlite3_fts3_enable_parentheses = 0;
|
|||
*/
|
||||
#define SQLITE_FTS3_DEFAULT_NEAR_PARAM 10
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include "libc/assert.h"
|
||||
#include "libc/str/str.h"
|
||||
|
||||
/*
|
||||
** isNot:
|
||||
|
@ -1096,7 +1096,7 @@ void sqlite3Fts3ExprFree(Fts3Expr *pDel) {
|
|||
|
||||
#ifdef SQLITE_TEST
|
||||
|
||||
#include <stdio.h>
|
||||
#include "libc/stdio/stdio.h"
|
||||
|
||||
/*
|
||||
** Return a pointer to a buffer containing a text representation of the
|
||||
|
|
11
third_party/sqlite3/fts3_hash.c
vendored
11
third_party/sqlite3/fts3_hash.c
vendored
|
@ -23,14 +23,13 @@
|
|||
** * The FTS3 module is being built into the core of
|
||||
** SQLite (in which case SQLITE_ENABLE_FTS3 is defined).
|
||||
*/
|
||||
#include "fts3Int.h"
|
||||
#include "third_party/sqlite3/fts3Int.h"
|
||||
#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3)
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "fts3_hash.h"
|
||||
#include "libc/assert.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/sqlite3/fts3_hash.h"
|
||||
|
||||
/*
|
||||
** Malloc and Free functions
|
||||
|
|
14
third_party/sqlite3/fts3_icu.c
vendored
14
third_party/sqlite3/fts3_icu.c
vendored
|
@ -11,18 +11,14 @@
|
|||
*************************************************************************
|
||||
** This file implements a tokenizer for fts3 based on the ICU library.
|
||||
*/
|
||||
#include "fts3Int.h"
|
||||
#include "third_party/sqlite3/fts3Int.h"
|
||||
#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3)
|
||||
#ifdef SQLITE_ENABLE_ICU
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <unicode/ubrk.h>
|
||||
#include <unicode/ucol.h>
|
||||
#include <unicode/ustring.h>
|
||||
#include <unicode/utf16.h>
|
||||
|
||||
#include "fts3_tokenizer.h"
|
||||
#include "libc/assert.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/unicode/unicode.h"
|
||||
#include "third_party/sqlite3/fts3_tokenizer.h"
|
||||
|
||||
typedef struct IcuTokenizer IcuTokenizer;
|
||||
typedef struct IcuCursor IcuCursor;
|
||||
|
|
13
third_party/sqlite3/fts3_porter.c
vendored
13
third_party/sqlite3/fts3_porter.c
vendored
|
@ -22,15 +22,14 @@
|
|||
** * The FTS3 module is being built into the core of
|
||||
** SQLite (in which case SQLITE_ENABLE_FTS3 is defined).
|
||||
*/
|
||||
#include "fts3Int.h"
|
||||
#include "third_party/sqlite3/fts3Int.h"
|
||||
#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3)
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "fts3_tokenizer.h"
|
||||
#include "libc/assert.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/sqlite3/fts3_tokenizer.h"
|
||||
|
||||
/*
|
||||
** Class derived from sqlite3_tokenizer
|
||||
|
|
6
third_party/sqlite3/fts3_snippet.c
vendored
6
third_party/sqlite3/fts3_snippet.c
vendored
|
@ -11,11 +11,11 @@
|
|||
******************************************************************************
|
||||
*/
|
||||
|
||||
#include "fts3Int.h"
|
||||
#include "third_party/sqlite3/fts3Int.h"
|
||||
#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3)
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include "libc/assert.h"
|
||||
#include "libc/str/str.h"
|
||||
|
||||
/*
|
||||
** Characters that may appear in the second argument to matchinfo().
|
||||
|
|
6
third_party/sqlite3/fts3_tokenize_vtab.c
vendored
6
third_party/sqlite3/fts3_tokenize_vtab.c
vendored
|
@ -38,11 +38,11 @@
|
|||
** pos: Token offset of token within input.
|
||||
**
|
||||
*/
|
||||
#include "fts3Int.h"
|
||||
#include "third_party/sqlite3/fts3Int.h"
|
||||
#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3)
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include "libc/assert.h"
|
||||
#include "libc/str/str.h"
|
||||
|
||||
typedef struct Fts3tokTable Fts3tokTable;
|
||||
typedef struct Fts3tokCursor Fts3tokCursor;
|
||||
|
|
12
third_party/sqlite3/fts3_tokenizer.c
vendored
12
third_party/sqlite3/fts3_tokenizer.c
vendored
|
@ -23,11 +23,11 @@
|
|||
** * The FTS3 module is being built into the core of
|
||||
** SQLite (in which case SQLITE_ENABLE_FTS3 is defined).
|
||||
*/
|
||||
#include "fts3Int.h"
|
||||
#include "third_party/sqlite3/fts3Int.h"
|
||||
#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3)
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include "libc/assert.h"
|
||||
#include "libc/str/str.h"
|
||||
|
||||
/*
|
||||
** Return true if the two-argument version of fts3_tokenizer()
|
||||
|
@ -226,11 +226,11 @@ int sqlite3Fts3InitTokenizer(
|
|||
#ifdef SQLITE_TEST
|
||||
|
||||
#if defined(INCLUDE_SQLITE_TCL_H)
|
||||
#include "sqlite_tcl.h"
|
||||
#include "third_party/sqlite3/sqlite_tcl.h"
|
||||
#else
|
||||
#include "tcl.h"
|
||||
#include "third_party/sqlite3/tcl.h"
|
||||
#endif
|
||||
#include <string.h>
|
||||
#include "libc/str/str.h"
|
||||
|
||||
/*
|
||||
** Implementation of a special SQL scalar function for testing tokenizers
|
||||
|
|
2
third_party/sqlite3/fts3_tokenizer.h
vendored
2
third_party/sqlite3/fts3_tokenizer.h
vendored
|
@ -24,7 +24,7 @@
|
|||
** If tokenizers are to be allowed to call sqlite3_*() functions, then
|
||||
** we will need a way to register the API consistently.
|
||||
*/
|
||||
#include "sqlite3.h"
|
||||
#include "third_party/sqlite3/sqlite3.h"
|
||||
|
||||
/*
|
||||
** Structures used by the tokenizer interface. When a new tokenizer
|
||||
|
|
13
third_party/sqlite3/fts3_tokenizer1.c
vendored
13
third_party/sqlite3/fts3_tokenizer1.c
vendored
|
@ -22,15 +22,14 @@
|
|||
** * The FTS3 module is being built into the core of
|
||||
** SQLite (in which case SQLITE_ENABLE_FTS3 is defined).
|
||||
*/
|
||||
#include "fts3Int.h"
|
||||
#include "third_party/sqlite3/fts3Int.h"
|
||||
#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3)
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "fts3_tokenizer.h"
|
||||
#include "libc/assert.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/sqlite3/fts3_tokenizer.h"
|
||||
|
||||
typedef struct simple_tokenizer {
|
||||
sqlite3_tokenizer base;
|
||||
|
|
13
third_party/sqlite3/fts3_unicode.c
vendored
13
third_party/sqlite3/fts3_unicode.c
vendored
|
@ -15,15 +15,14 @@
|
|||
|
||||
#ifndef SQLITE_DISABLE_FTS3_UNICODE
|
||||
|
||||
#include "fts3Int.h"
|
||||
#include "third_party/sqlite3/fts3Int.h"
|
||||
#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3)
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "fts3_tokenizer.h"
|
||||
#include "libc/assert.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/sqlite3/fts3_tokenizer.h"
|
||||
|
||||
/*
|
||||
** The following two macros - READ_UTF8 and WRITE_UTF8 - have been copied
|
||||
|
|
2
third_party/sqlite3/fts3_unicode2.c
vendored
2
third_party/sqlite3/fts3_unicode2.c
vendored
|
@ -18,7 +18,7 @@
|
|||
#ifndef SQLITE_DISABLE_FTS3_UNICODE
|
||||
#if defined(SQLITE_ENABLE_FTS3) || defined(SQLITE_ENABLE_FTS4)
|
||||
|
||||
#include <assert.h>
|
||||
#include "libc/assert.h"
|
||||
|
||||
/*
|
||||
** Return true if the argument corresponds to a unicode codepoint
|
||||
|
|
11
third_party/sqlite3/fts3_write.c
vendored
11
third_party/sqlite3/fts3_write.c
vendored
|
@ -17,13 +17,14 @@
|
|||
** code in fts3.c.
|
||||
*/
|
||||
|
||||
#include "fts3Int.h"
|
||||
#include "third_party/sqlite3/fts3Int.h"
|
||||
#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3)
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "libc/alg/alg.h"
|
||||
#include "libc/assert.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
|
||||
#define FTS_MAX_APPENDABLE_HEIGHT 16
|
||||
|
||||
|
|
56
third_party/sqlite3/fts5.c
vendored
56
third_party/sqlite3/fts5.c
vendored
|
@ -32,7 +32,7 @@
|
|||
#ifndef _FTS5_H
|
||||
#define _FTS5_H
|
||||
|
||||
#include "sqlite3.h"
|
||||
#include "third_party/sqlite3/sqlite3.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -589,12 +589,12 @@ struct fts5_api {
|
|||
#ifndef _FTS5INT_H
|
||||
#define _FTS5INT_H
|
||||
|
||||
/* #include "fts5.h" */
|
||||
#include "sqlite3ext.h"
|
||||
/* #include "third_party/sqlite3/fts5.h" */
|
||||
#include "third_party/sqlite3/sqlite3ext.h"
|
||||
SQLITE_EXTENSION_INIT1
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include "libc/assert.h"
|
||||
#include "libc/str/str.h"
|
||||
|
||||
#ifndef SQLITE_AMALGAMATION
|
||||
|
||||
|
@ -1424,8 +1424,8 @@ static void sqlite3Fts5UnicodeAscii(u8 *, u8 *);
|
|||
/************ Begin %include sections from the grammar ************************/
|
||||
#line 47 "fts5parse.y"
|
||||
|
||||
/* #include "fts5Int.h" */
|
||||
/* #include "fts5parse.h" */
|
||||
/* #include "third_party/sqlite3/fts5Int.h" */
|
||||
/* #include "third_party/sqlite3/fts5parse.h" */
|
||||
|
||||
/*
|
||||
** Disable all error recovery processing in the parser push-down
|
||||
|
@ -1766,8 +1766,8 @@ struct fts5yyParser {
|
|||
typedef struct fts5yyParser fts5yyParser;
|
||||
|
||||
#ifndef NDEBUG
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include "libc/assert.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
static FILE *fts5yyTraceFILE = 0;
|
||||
static char *fts5yyTracePrompt = 0;
|
||||
#endif /* NDEBUG */
|
||||
|
@ -3054,8 +3054,8 @@ static int sqlite3Fts5ParserFallback(int iToken) {
|
|||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* #include "fts5Int.h" */
|
||||
#include <math.h> /* amalgamator: keep */
|
||||
/* #include "third_party/sqlite3/fts5Int.h" */
|
||||
#include "libc/math.h" /* amalgamator: keep */
|
||||
|
||||
/*
|
||||
** Object used to iterate through all "coalesced phrase instances" in
|
||||
|
@ -3756,7 +3756,7 @@ static int sqlite3Fts5AuxInit(fts5_api *pApi) {
|
|||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* #include "fts5Int.h" */
|
||||
/* #include "third_party/sqlite3/fts5Int.h" */
|
||||
|
||||
static int sqlite3Fts5BufferSize(int *pRc, Fts5Buffer *pBuf, u32 nByte) {
|
||||
if ((u32)pBuf->nSpace < nByte) {
|
||||
|
@ -4133,7 +4133,7 @@ static void sqlite3Fts5TermsetFree(Fts5Termset *p) {
|
|||
** This is an SQLite module implementing full-text search.
|
||||
*/
|
||||
|
||||
/* #include "fts5Int.h" */
|
||||
/* #include "third_party/sqlite3/fts5Int.h" */
|
||||
|
||||
#define FTS5_DEFAULT_PAGE_SIZE 4050
|
||||
#define FTS5_DEFAULT_AUTOMERGE 4
|
||||
|
@ -5071,8 +5071,8 @@ static int sqlite3Fts5ConfigLoad(Fts5Config *pConfig, int iCookie) {
|
|||
**
|
||||
*/
|
||||
|
||||
/* #include "fts5Int.h" */
|
||||
/* #include "fts5parse.h" */
|
||||
/* #include "third_party/sqlite3/fts5Int.h" */
|
||||
/* #include "third_party/sqlite3/fts5parse.h" */
|
||||
|
||||
/*
|
||||
** All token types in the generated fts5parse.h file are greater than 0.
|
||||
|
@ -5086,14 +5086,14 @@ typedef struct Fts5ExprTerm Fts5ExprTerm;
|
|||
/*
|
||||
** Functions generated by lemon from fts5parse.y.
|
||||
*/
|
||||
static void *sqlite3Fts5ParserAlloc(void *(*mallocProc)(u64));
|
||||
static void sqlite3Fts5ParserFree(void *, void (*freeProc)(void *));
|
||||
static void sqlite3Fts5Parser(void *, int, Fts5Token, Fts5Parse *);
|
||||
// static void *sqlite3Fts5ParserAlloc(void *(*mallocProc)(u64));
|
||||
// static void sqlite3Fts5ParserFree(void *, void (*freeProc)(void *));
|
||||
// static void sqlite3Fts5Parser(void *, int, Fts5Token, Fts5Parse *);
|
||||
#ifndef NDEBUG
|
||||
#include <stdio.h>
|
||||
#include "libc/stdio/stdio.h"
|
||||
static void sqlite3Fts5ParserTrace(FILE *, char *);
|
||||
#endif
|
||||
static int sqlite3Fts5ParserFallback(int);
|
||||
// static int sqlite3Fts5ParserFallback(int);
|
||||
|
||||
struct Fts5Expr {
|
||||
Fts5Index *pIndex;
|
||||
|
@ -8044,7 +8044,7 @@ static int sqlite3Fts5ExprPhraseCollist(Fts5Expr *pExpr, int iPhrase,
|
|||
**
|
||||
*/
|
||||
|
||||
/* #include "fts5Int.h" */
|
||||
/* #include "third_party/sqlite3/fts5Int.h" */
|
||||
|
||||
typedef struct Fts5HashEntry Fts5HashEntry;
|
||||
|
||||
|
@ -8594,7 +8594,7 @@ static void sqlite3Fts5HashScanEntry(
|
|||
** the interface defined in fts5Int.h.
|
||||
*/
|
||||
|
||||
/* #include "fts5Int.h" */
|
||||
/* #include "third_party/sqlite3/fts5Int.h" */
|
||||
|
||||
/*
|
||||
** Overview:
|
||||
|
@ -15133,7 +15133,7 @@ static int sqlite3Fts5IndexReset(Fts5Index *p) {
|
|||
** This is an SQLite module implementing full-text search.
|
||||
*/
|
||||
|
||||
/* #include "fts5Int.h" */
|
||||
/* #include "third_party/sqlite3/fts5Int.h" */
|
||||
|
||||
/*
|
||||
** This variable is set to false when running tests for which the on disk
|
||||
|
@ -17930,7 +17930,7 @@ int sqlite3Fts5Init(sqlite3 *db) {
|
|||
**
|
||||
*/
|
||||
|
||||
/* #include "fts5Int.h" */
|
||||
/* #include "third_party/sqlite3/fts5Int.h" */
|
||||
|
||||
struct Fts5Storage {
|
||||
Fts5Config *pConfig;
|
||||
|
@ -19023,7 +19023,7 @@ static int sqlite3Fts5StorageConfigValue(Fts5Storage *p, const char *z,
|
|||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* #include "fts5Int.h" */
|
||||
/* #include "third_party/sqlite3/fts5Int.h" */
|
||||
|
||||
/**************************************************************************
|
||||
** Start of ascii tokenizer implementation.
|
||||
|
@ -20381,7 +20381,7 @@ static int sqlite3Fts5TokenizerInit(fts5_api *pApi) {
|
|||
** DO NOT EDIT THIS MACHINE GENERATED FILE.
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include "libc/assert.h"
|
||||
|
||||
/*
|
||||
** If the argument is a codepoint corresponding to a lowercase letter
|
||||
|
@ -21169,7 +21169,7 @@ static void sqlite3Fts5UnicodeAscii(u8 *aArray, u8 *aAscii) {
|
|||
** Routines for varint serialization and deserialization.
|
||||
*/
|
||||
|
||||
/* #include "fts5Int.h" */
|
||||
/* #include "third_party/sqlite3/fts5Int.h" */
|
||||
|
||||
/*
|
||||
** This is a copy of the sqlite3GetVarint32() routine from the SQLite core.
|
||||
|
@ -21525,7 +21525,7 @@ static int sqlite3Fts5GetVarintLen(u32 iVal) {
|
|||
** One row for each term instance in the database.
|
||||
*/
|
||||
|
||||
/* #include "fts5Int.h" */
|
||||
/* #include "third_party/sqlite3/fts5Int.h" */
|
||||
|
||||
typedef struct Fts5VocabTable Fts5VocabTable;
|
||||
typedef struct Fts5VocabCursor Fts5VocabCursor;
|
||||
|
|
2
third_party/sqlite3/fts5.h
vendored
2
third_party/sqlite3/fts5.h
vendored
|
@ -20,7 +20,7 @@
|
|||
#ifndef _FTS5_H
|
||||
#define _FTS5_H
|
||||
|
||||
#include "sqlite3.h"
|
||||
#include "third_party/sqlite3/sqlite3.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
11
third_party/sqlite3/func.c
vendored
11
third_party/sqlite3/func.c
vendored
|
@ -13,14 +13,13 @@
|
|||
** functions of SQLite. (Some function, and in particular the date and
|
||||
** time functions, are implemented separately.)
|
||||
*/
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "sqliteInt.h"
|
||||
#include "libc/assert.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
#ifndef SQLITE_OMIT_FLOATING_POINT
|
||||
#include <math.h>
|
||||
#include "libc/math.h"
|
||||
#endif
|
||||
#include "vdbeInt.h"
|
||||
#include "third_party/sqlite3/vdbeInt.h"
|
||||
|
||||
/*
|
||||
** Return the collating function associated with a function.
|
||||
|
|
8
third_party/sqlite3/geopoly.c
vendored
8
third_party/sqlite3/geopoly.c
vendored
|
@ -16,7 +16,11 @@
|
|||
** This file is #include-ed onto the end of "rtree.c" so that it has
|
||||
** access to all of the R-Tree internals.
|
||||
*/
|
||||
#include <stdlib.h>
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "third_party/gdtoa/gdtoa.h"
|
||||
#include "third_party/sqlite3/rtree.h"
|
||||
#include "third_party/sqlite3/sqlite3.h"
|
||||
|
||||
/* Enable -DGEOPOLY_ENABLE_DEBUG for debugging facilities */
|
||||
#ifdef GEOPOLY_ENABLE_DEBUG
|
||||
|
@ -40,7 +44,7 @@ static int geo_debug = 0;
|
|||
#define safe_isxdigit(x) sqlite3Isxdigit(x)
|
||||
#else
|
||||
/* Use the standard library for separate compilation */
|
||||
#include <ctype.h> /* amalgamator: keep */
|
||||
#include "libc/str/str.h" /* amalgamator: keep */
|
||||
#define safe_isdigit(x) isdigit((unsigned char)(x))
|
||||
#define safe_isalnum(x) isalnum((unsigned char)(x))
|
||||
#define safe_isxdigit(x) isxdigit((unsigned char)(x))
|
||||
|
|
4
third_party/sqlite3/global.c
vendored
4
third_party/sqlite3/global.c
vendored
|
@ -12,7 +12,7 @@
|
|||
**
|
||||
** This file contains definitions of global variables and constants.
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
/* An array to map all upper-case characters into their corresponding
|
||||
** lower-case character.
|
||||
|
@ -787,7 +787,7 @@ int sqlite3PendingByte = 0x40000000;
|
|||
u32 sqlite3SelectTrace = 0;
|
||||
u32 sqlite3WhereTrace = 0;
|
||||
|
||||
#include "opcodes.h"
|
||||
#include "third_party/sqlite3/opcodes.h"
|
||||
/*
|
||||
** Properties of opcodes. The OPFLG_INITIALIZER macro is
|
||||
** created by mkopcodeh.awk during compilation. Data is obtained
|
||||
|
|
5
third_party/sqlite3/hash.c
vendored
5
third_party/sqlite3/hash.c
vendored
|
@ -12,9 +12,8 @@
|
|||
** This is the implementation of generic hash-tables
|
||||
** used in SQLite.
|
||||
*/
|
||||
#include <assert.h>
|
||||
|
||||
#include "sqliteInt.h"
|
||||
#include "libc/assert.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
/* Turn bulk memory into a hash table object by initializing the
|
||||
** fields of the Hash structure.
|
||||
|
|
13
third_party/sqlite3/icu.c
vendored
13
third_party/sqlite3/icu.c
vendored
|
@ -28,21 +28,18 @@
|
|||
** provide case-independent matching.
|
||||
*/
|
||||
|
||||
#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_ICU) || \
|
||||
#if 0 && !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_ICU) || \
|
||||
defined(SQLITE_ENABLE_ICU_COLLATIONS)
|
||||
|
||||
/* Include ICU headers */
|
||||
#include <assert.h>
|
||||
#include <unicode/ucol.h>
|
||||
#include <unicode/uregex.h>
|
||||
#include <unicode/ustring.h>
|
||||
#include <unicode/utypes.h>
|
||||
#include "libc/assert.h"
|
||||
#include "libc/unicode/unicode.h"
|
||||
|
||||
#ifndef SQLITE_CORE
|
||||
#include "sqlite3ext.h"
|
||||
#include "third_party/sqlite3/sqlite3ext.h"
|
||||
SQLITE_EXTENSION_INIT1
|
||||
#else
|
||||
#include "sqlite3.h"
|
||||
#include "third_party/sqlite3/sqlite3.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
2
third_party/sqlite3/insert.c
vendored
2
third_party/sqlite3/insert.c
vendored
|
@ -12,7 +12,7 @@
|
|||
** This file contains C code routines that are called by the parser
|
||||
** to handle INSERT statements in SQLite.
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
/*
|
||||
** Generate code that will
|
||||
|
|
14
third_party/sqlite3/json1.c
vendored
14
third_party/sqlite3/json1.c
vendored
|
@ -23,13 +23,13 @@
|
|||
*/
|
||||
#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_JSON1)
|
||||
#if !defined(SQLITEINT_H)
|
||||
#include "sqlite3ext.h"
|
||||
#include "third_party/sqlite3/sqlite3ext.h"
|
||||
#endif
|
||||
SQLITE_EXTENSION_INIT1
|
||||
#include <assert.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "libc/assert.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/gdtoa/gdtoa.h"
|
||||
|
||||
/* Mark a function parameter as unused, to suppress nuisance compiler
|
||||
** warnings. */
|
||||
|
@ -58,7 +58,7 @@ SQLITE_EXTENSION_INIT1
|
|||
#define safe_isxdigit(x) sqlite3Isxdigit(x)
|
||||
#else
|
||||
/* Use the standard library for separate compilation */
|
||||
#include <ctype.h> /* amalgamator: keep */
|
||||
#include "libc/str/str.h" /* amalgamator: keep */
|
||||
#define safe_isdigit(x) isdigit((unsigned char)(x))
|
||||
#define safe_isalnum(x) isalnum((unsigned char)(x))
|
||||
#define safe_isxdigit(x) isxdigit((unsigned char)(x))
|
||||
|
@ -708,7 +708,7 @@ static int jsonParseAddNode(JsonParse *, u32, u32, const char *);
|
|||
** inlined.
|
||||
*/
|
||||
#if defined(__GNUC__)
|
||||
#define JSON_NOINLINE __attribute__((noinline))
|
||||
#define JSON_NOINLINE __attribute__((__noinline__))
|
||||
#elif defined(_MSC_VER) && _MSC_VER >= 1310
|
||||
#define JSON_NOINLINE __declspec(noinline)
|
||||
#else
|
||||
|
|
2
third_party/sqlite3/legacy.c
vendored
2
third_party/sqlite3/legacy.c
vendored
|
@ -15,7 +15,7 @@
|
|||
** accessed by users of the library.
|
||||
*/
|
||||
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
/*
|
||||
** Execute SQL code. Return one of the SQLITE_ success/failure
|
||||
|
|
4
third_party/sqlite3/loadext.c
vendored
4
third_party/sqlite3/loadext.c
vendored
|
@ -16,8 +16,8 @@
|
|||
#ifndef SQLITE_CORE
|
||||
#define SQLITE_CORE 1 /* Disable the API redefinition in sqlite3ext.h */
|
||||
#endif
|
||||
#include "sqlite3ext.h"
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqlite3ext.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
#ifndef SQLITE_OMIT_LOAD_EXTENSION
|
||||
/*
|
||||
|
|
8
third_party/sqlite3/main.c
vendored
8
third_party/sqlite3/main.c
vendored
|
@ -14,16 +14,16 @@
|
|||
** other files are for internal use by SQLite and should not be
|
||||
** accessed by users of the library.
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
#ifdef SQLITE_ENABLE_FTS3
|
||||
#include "fts3.h"
|
||||
#include "third_party/sqlite3/fts3.h"
|
||||
#endif
|
||||
#ifdef SQLITE_ENABLE_RTREE
|
||||
#include "rtree.h"
|
||||
#include "third_party/sqlite3/rtree.h"
|
||||
#endif
|
||||
#if defined(SQLITE_ENABLE_ICU) || defined(SQLITE_ENABLE_ICU_COLLATIONS)
|
||||
#include "sqliteicu.h"
|
||||
#include "third_party/sqlite3/sqliteicu.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
3
third_party/sqlite3/malloc.c
vendored
3
third_party/sqlite3/malloc.c
vendored
|
@ -12,9 +12,8 @@
|
|||
**
|
||||
** Memory allocation functions used throughout sqlite.
|
||||
*/
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
/*
|
||||
** Attempt to release up to n bytes of non-essential memory currently
|
||||
|
|
2
third_party/sqlite3/mem0.c
vendored
2
third_party/sqlite3/mem0.c
vendored
|
@ -16,7 +16,7 @@
|
|||
** are merely placeholders. Real drivers must be substituted using
|
||||
** sqlite3_config() before SQLite will operate.
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
/*
|
||||
** This version of the memory allocator is the default. It is
|
||||
|
|
4
third_party/sqlite3/mem1.c
vendored
4
third_party/sqlite3/mem1.c
vendored
|
@ -41,7 +41,7 @@
|
|||
** be necessary when compiling for Delphi,
|
||||
** for example.
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
/*
|
||||
** This version of the memory allocator is the default. It is
|
||||
|
@ -103,7 +103,7 @@ static malloc_zone_t *_sqliteZone_;
|
|||
** the macro SQLITE_MALLOCSIZE to the desired function name.
|
||||
*/
|
||||
#if defined(SQLITE_USE_MALLOC_H)
|
||||
#include <malloc.h>
|
||||
#include "libc/mem/mem.h"
|
||||
#if defined(SQLITE_USE_MALLOC_USABLE_SIZE)
|
||||
#if !defined(SQLITE_MALLOCSIZE)
|
||||
#define SQLITE_MALLOCSIZE(x) malloc_usable_size(x)
|
||||
|
|
4
third_party/sqlite3/mem2.c
vendored
4
third_party/sqlite3/mem2.c
vendored
|
@ -19,7 +19,7 @@
|
|||
** This file contains implementations of the low-level memory allocation
|
||||
** routines specified in the sqlite3_mem_methods object.
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
/*
|
||||
** This version of the memory allocator is used only if the
|
||||
|
@ -37,7 +37,7 @@ extern void backtrace_symbols_fd(void *const *, int, int);
|
|||
#define backtrace(A, B) 1
|
||||
#define backtrace_symbols_fd(A, B, C)
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include "libc/stdio/stdio.h"
|
||||
|
||||
/*
|
||||
** Each memory allocation looks like this:
|
||||
|
|
2
third_party/sqlite3/mem3.c
vendored
2
third_party/sqlite3/mem3.c
vendored
|
@ -23,7 +23,7 @@
|
|||
** This version of the memory allocation subsystem is included
|
||||
** in the build only if SQLITE_ENABLE_MEMSYS3 is defined.
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
/*
|
||||
** This version of the memory allocator is only built into the library
|
||||
|
|
2
third_party/sqlite3/mem5.c
vendored
2
third_party/sqlite3/mem5.c
vendored
|
@ -48,7 +48,7 @@
|
|||
** The sqlite3_status() logic tracks the maximum values of n and M so
|
||||
** that an application can, at any time, verify this constraint.
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
/*
|
||||
** This version of the memory allocator is used only when
|
||||
|
|
2
third_party/sqlite3/memdb.c
vendored
2
third_party/sqlite3/memdb.c
vendored
|
@ -16,7 +16,7 @@
|
|||
** This file also implements interface sqlite3_serialize() and
|
||||
** sqlite3_deserialize().
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
#ifdef SQLITE_ENABLE_DESERIALIZE
|
||||
|
||||
/*
|
||||
|
|
2
third_party/sqlite3/memjournal.c
vendored
2
third_party/sqlite3/memjournal.c
vendored
|
@ -23,7 +23,7 @@
|
|||
** in the common case, they are usually small and no file I/O needs to
|
||||
** occur.
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
/* Forward references to internal structures */
|
||||
typedef struct MemJournal MemJournal;
|
||||
|
|
2
third_party/sqlite3/mutex.c
vendored
2
third_party/sqlite3/mutex.c
vendored
|
@ -13,7 +13,7 @@
|
|||
**
|
||||
** This file contains code that is common across all mutex implementations.
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
#if defined(SQLITE_DEBUG) && !defined(SQLITE_MUTEX_OMIT)
|
||||
/*
|
||||
|
|
2
third_party/sqlite3/mutex_noop.c
vendored
2
third_party/sqlite3/mutex_noop.c
vendored
|
@ -25,7 +25,7 @@
|
|||
** that does error checking on mutexes to make sure they are being
|
||||
** called correctly.
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
#ifndef SQLITE_MUTEX_OMIT
|
||||
|
||||
|
|
2
third_party/sqlite3/mutex_unix.c
vendored
2
third_party/sqlite3/mutex_unix.c
vendored
|
@ -11,7 +11,7 @@
|
|||
*************************************************************************
|
||||
** This file contains the C functions that implement mutexes for pthreads
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
/*
|
||||
** The code in this file is only used if we are compiling threadsafe
|
||||
|
|
6
third_party/sqlite3/mutex_w32.c
vendored
6
third_party/sqlite3/mutex_w32.c
vendored
|
@ -11,18 +11,18 @@
|
|||
*************************************************************************
|
||||
** This file contains the C functions that implement mutexes for Win32.
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
#if SQLITE_OS_WIN
|
||||
/*
|
||||
** Include code that is common to all os_*.c files
|
||||
*/
|
||||
#include "os_common.h"
|
||||
#include "third_party/sqlite3/os_common.h"
|
||||
|
||||
/*
|
||||
** Include the header file for the Windows VFS.
|
||||
*/
|
||||
#include "os_win.h"
|
||||
#include "third_party/sqlite3/os_win.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
4
third_party/sqlite3/notify.c
vendored
4
third_party/sqlite3/notify.c
vendored
|
@ -13,8 +13,8 @@
|
|||
** This file contains the implementation of the sqlite3_unlock_notify()
|
||||
** API method and its associated functionality.
|
||||
*/
|
||||
#include "btreeInt.h"
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/btreeInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
/* Omit this entire file if SQLITE_ENABLE_UNLOCK_NOTIFY is not defined. */
|
||||
#ifdef SQLITE_ENABLE_UNLOCK_NOTIFY
|
||||
|
|
2
third_party/sqlite3/os.c
vendored
2
third_party/sqlite3/os.c
vendored
|
@ -13,7 +13,7 @@
|
|||
** This file contains OS interface code that is common to all
|
||||
** architectures.
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
/*
|
||||
** If we compile with the SQLITE_TEST macro set, then the following block
|
||||
|
|
2
third_party/sqlite3/os.h
vendored
2
third_party/sqlite3/os.h
vendored
|
@ -24,7 +24,7 @@
|
|||
** Attempt to automatically detect the operating system and setup the
|
||||
** necessary pre-processor macros for it.
|
||||
*/
|
||||
#include "os_setup.h"
|
||||
#include "third_party/sqlite3/os_setup.h"
|
||||
|
||||
/* If the SET_FULLSYNC macro is not defined above, then make it
|
||||
** a no-op
|
||||
|
|
2
third_party/sqlite3/os_common.h
vendored
2
third_party/sqlite3/os_common.h
vendored
|
@ -39,7 +39,7 @@
|
|||
** hwtime.h contains inline assembler code for implementing
|
||||
** high-performance timing routines.
|
||||
*/
|
||||
#include "hwtime.h"
|
||||
#include "third_party/sqlite3/hwtime.h"
|
||||
|
||||
static sqlite_uint64 g_start;
|
||||
static sqlite_uint64 g_elapsed;
|
||||
|
|
72
third_party/sqlite3/os_unix.c
vendored
72
third_party/sqlite3/os_unix.c
vendored
|
@ -43,7 +43,7 @@
|
|||
** * Definitions of sqlite3_vfs objects for all locking methods
|
||||
** plus implementations of sqlite3_os_init() and sqlite3_os_end().
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
#if SQLITE_OS_UNIX /* This file is used on unix only */
|
||||
|
||||
/*
|
||||
|
@ -87,16 +87,22 @@
|
|||
/*
|
||||
** standard include files.
|
||||
*/
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/struct/flock.h"
|
||||
#include "libc/calls/weirdtypes.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/isystem/unistd.h"
|
||||
#include "libc/runtime/sysconf.h"
|
||||
#include "libc/sysv/consts/f.h"
|
||||
#include "libc/sysv/consts/map.h"
|
||||
#include "libc/sysv/consts/mremap.h"
|
||||
#include "libc/sysv/consts/o.h"
|
||||
#include "libc/sysv/consts/ok.h"
|
||||
#include "libc/sysv/consts/prot.h"
|
||||
#include "libc/time/struct/tm.h"
|
||||
#include "libc/time/time.h"
|
||||
#if !defined(SQLITE_OMIT_WAL) || SQLITE_MAX_MMAP_SIZE > 0
|
||||
#include <sys/mman.h>
|
||||
#include "libc/mem/mem.h"
|
||||
#endif
|
||||
|
||||
#if SQLITE_ENABLE_LOCKING_STYLE
|
||||
|
@ -133,9 +139,10 @@
|
|||
#endif
|
||||
|
||||
#if OS_VXWORKS
|
||||
#include <limits.h>
|
||||
#include <semaphore.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#include "libc/limits.h"
|
||||
#endif /* OS_VXWORKS */
|
||||
|
||||
#if defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE
|
||||
|
@ -143,7 +150,7 @@
|
|||
#endif
|
||||
|
||||
#ifdef HAVE_UTIME
|
||||
#include <utime.h>
|
||||
#include "libc/time/time.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -296,7 +303,7 @@ static pid_t randomnessPid = 0;
|
|||
/*
|
||||
** Include code that is common to all os_*.c files
|
||||
*/
|
||||
#include "os_common.h"
|
||||
#include "third_party/sqlite3/os_common.h"
|
||||
|
||||
/*
|
||||
** Define various macros that are missing from some systems.
|
||||
|
@ -868,23 +875,18 @@ static int sqliteErrorFromPosixError(int posixError, int sqliteIOErr) {
|
|||
(sqliteIOErr == SQLITE_IOERR_UNLOCK) ||
|
||||
(sqliteIOErr == SQLITE_IOERR_RDLOCK) ||
|
||||
(sqliteIOErr == SQLITE_IOERR_CHECKRESERVEDLOCK));
|
||||
switch (posixError) {
|
||||
case EACCES:
|
||||
case EAGAIN:
|
||||
case ETIMEDOUT:
|
||||
case EBUSY:
|
||||
case EINTR:
|
||||
case ENOLCK:
|
||||
/* random NFS retry error, unless during file system support
|
||||
* introspection, in which it actually means what it says */
|
||||
return SQLITE_BUSY;
|
||||
// changed switch to if-else
|
||||
if (posixError == EACCES || posixError == EAGAIN || posixError == ETIMEDOUT ||
|
||||
posixError == EBUSY || posixError == EINTR || posixError == ENOLCK)
|
||||
/* random NFS retry error, unless during file system support
|
||||
* introspection, in which it actually means what it says */
|
||||
return SQLITE_BUSY;
|
||||
|
||||
case EPERM:
|
||||
return SQLITE_PERM;
|
||||
else if (posixError == EPERM)
|
||||
return SQLITE_PERM;
|
||||
|
||||
default:
|
||||
return sqliteIOErr;
|
||||
}
|
||||
else
|
||||
return sqliteIOErr;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
@ -3373,17 +3375,17 @@ static int unixRead(sqlite3_file *id, void *pBuf, int amt,
|
|||
** prior to returning to the application by the sqlite3ApiExit()
|
||||
** routine.
|
||||
*/
|
||||
switch (pFile->lastErrno) {
|
||||
case ERANGE:
|
||||
case EIO:
|
||||
// changed switch to if-else
|
||||
if (pFile->lastErrno == ERANGE || pFile->lastErrno == EIO
|
||||
#ifdef ENXIO
|
||||
case ENXIO:
|
||||
|| pFile->lastErrno == ENXIO
|
||||
#endif
|
||||
#ifdef EDEVERR
|
||||
case EDEVERR:
|
||||
|| pFile->lastErrno == EDEVERR
|
||||
#endif
|
||||
return SQLITE_IOERR_CORRUPTFS;
|
||||
}
|
||||
)
|
||||
return SQLITE_IOERR_CORRUPTFS;
|
||||
|
||||
return SQLITE_IOERR_READ;
|
||||
} else {
|
||||
storeLastErrno(pFile, 0); /* not a system error */
|
||||
|
|
8
third_party/sqlite3/os_win.c
vendored
8
third_party/sqlite3/os_win.c
vendored
|
@ -12,18 +12,18 @@
|
|||
**
|
||||
** This file contains code that is specific to Windows.
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
#if SQLITE_OS_WIN /* This file is used for Windows only */
|
||||
|
||||
/*
|
||||
** Include code that is common to all os_*.c files
|
||||
*/
|
||||
#include "os_common.h"
|
||||
#include "third_party/sqlite3/os_common.h"
|
||||
|
||||
/*
|
||||
** Include the header file for the Windows VFS.
|
||||
*/
|
||||
#include "os_win.h"
|
||||
#include "third_party/sqlite3/os_win.h"
|
||||
|
||||
/*
|
||||
** Compiling and using WAL mode requires several APIs that are only
|
||||
|
@ -2200,7 +2200,7 @@ static void winLogIoerr(int nRetry, int lineno) {
|
|||
** The MSVC CRT on Windows CE may not have a localtime() function.
|
||||
** So define a substitute.
|
||||
*/
|
||||
#include <time.h>
|
||||
#include "libc/time/time.h"
|
||||
struct tm *__cdecl localtime(const time_t *t) {
|
||||
static struct tm y;
|
||||
FILETIME uTm, lTm;
|
||||
|
|
5
third_party/sqlite3/os_win.h
vendored
5
third_party/sqlite3/os_win.h
vendored
|
@ -18,11 +18,12 @@
|
|||
/*
|
||||
** Include the primary Windows SDK header file.
|
||||
*/
|
||||
#include "windows.h"
|
||||
#include "third_party/sqlite3/windows.h"
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
#include <errno.h> /* amalgamator: dontcache */
|
||||
#include <sys/cygwin.h>
|
||||
|
||||
#include "libc/errno.h" /* amalgamator: dontcache */
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
4
third_party/sqlite3/pager.c
vendored
4
third_party/sqlite3/pager.c
vendored
|
@ -19,8 +19,8 @@
|
|||
** another is writing.
|
||||
*/
|
||||
#ifndef SQLITE_OMIT_DISKIO
|
||||
#include "sqliteInt.h"
|
||||
#include "wal.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
#include "third_party/sqlite3/wal.h"
|
||||
|
||||
/******************* NOTES ON THE DESIGN OF THE PAGER ************************
|
||||
**
|
||||
|
|
6
third_party/sqlite3/parse.c
vendored
6
third_party/sqlite3/parse.c
vendored
|
@ -22,7 +22,7 @@
|
|||
*/
|
||||
#line 58 "parse.y"
|
||||
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
/*
|
||||
** Disable all error recovery processing in the parser push-down
|
||||
|
@ -4652,8 +4652,8 @@ struct yyParser {
|
|||
typedef struct yyParser yyParser;
|
||||
|
||||
#ifndef NDEBUG
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include "libc/assert.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
static FILE *yyTraceFILE = 0;
|
||||
static char *yyTracePrompt = 0;
|
||||
#endif /* NDEBUG */
|
||||
|
|
2
third_party/sqlite3/pcache.c
vendored
2
third_party/sqlite3/pcache.c
vendored
|
@ -11,7 +11,7 @@
|
|||
*************************************************************************
|
||||
** This file implements that page cache.
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
/*
|
||||
** A complete page cache is an instance of this structure. Every
|
||||
|
|
2
third_party/sqlite3/pcache1.c
vendored
2
third_party/sqlite3/pcache1.c
vendored
|
@ -80,7 +80,7 @@
|
|||
** show that method (3) with N==100 provides about a 5% performance boost for
|
||||
** common workloads.
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
typedef struct PCache1 PCache1;
|
||||
typedef struct PgHdr1 PgHdr1;
|
||||
|
|
4
third_party/sqlite3/pragma.c
vendored
4
third_party/sqlite3/pragma.c
vendored
|
@ -11,7 +11,7 @@
|
|||
*************************************************************************
|
||||
** This file contains code used to implement the PRAGMA command.
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
#if !defined(SQLITE_ENABLE_LOCKING_STYLE)
|
||||
#if defined(__APPLE__)
|
||||
|
@ -28,7 +28,7 @@
|
|||
** lexicographical order to facility a binary search of the pragma name.
|
||||
** Do not edit pragma.h directly. Edit and rerun the script in at
|
||||
** ../tool/mkpragmatab.tcl. */
|
||||
#include "pragma.h"
|
||||
#include "third_party/sqlite3/pragma.h"
|
||||
|
||||
/*
|
||||
** Interpret the given string as a safety level. Return 0 for OFF,
|
||||
|
|
2
third_party/sqlite3/prepare.c
vendored
2
third_party/sqlite3/prepare.c
vendored
|
@ -13,7 +13,7 @@
|
|||
** interface, and routines that contribute to loading the database schema
|
||||
** from disk.
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
/*
|
||||
** Fill the InitData structure with an error message that indicates
|
||||
|
|
2
third_party/sqlite3/printf.c
vendored
2
third_party/sqlite3/printf.c
vendored
|
@ -9,7 +9,7 @@
|
|||
** library, though the implementation here has enhancements to support
|
||||
** SQLite.
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
/*
|
||||
** Conversion types fall into various categories as defined by the
|
||||
|
|
2
third_party/sqlite3/random.c
vendored
2
third_party/sqlite3/random.c
vendored
|
@ -15,7 +15,7 @@
|
|||
** Random numbers are used by some of the database backends in order
|
||||
** to generate random integer keys for tables or random filenames.
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
/* All threads share a single random number generator.
|
||||
** This structure is the current state of the generator.
|
||||
|
|
2
third_party/sqlite3/resolve.c
vendored
2
third_party/sqlite3/resolve.c
vendored
|
@ -14,7 +14,7 @@
|
|||
** resolve all identifiers by associating them with a particular
|
||||
** table and column.
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
/*
|
||||
** Magic table number to mean the EXCLUDED table in an UPSERT statement.
|
||||
|
|
2
third_party/sqlite3/rowset.c
vendored
2
third_party/sqlite3/rowset.c
vendored
|
@ -61,7 +61,7 @@
|
|||
** be possible, but the feature was not used, so it was removed in order
|
||||
** to simplify the code.
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
/*
|
||||
** Target size for allocation chunks.
|
||||
|
|
16
third_party/sqlite3/rtree.c
vendored
16
third_party/sqlite3/rtree.c
vendored
|
@ -57,15 +57,15 @@
|
|||
(defined(SQLITE_ENABLE_RTREE) && !defined(SQLITE_OMIT_VIRTUALTABLE))
|
||||
|
||||
#ifndef SQLITE_CORE
|
||||
#include "sqlite3ext.h"
|
||||
#include "third_party/sqlite3/sqlite3ext.h"
|
||||
SQLITE_EXTENSION_INIT1
|
||||
#else
|
||||
#include "sqlite3.h"
|
||||
#include "third_party/sqlite3/sqlite3.h"
|
||||
#endif
|
||||
int sqlite3GetToken(const unsigned char *, int *); /* In the SQLite core */
|
||||
|
||||
#ifndef SQLITE_AMALGAMATION
|
||||
#include "sqlite3rtree.h"
|
||||
#include "third_party/sqlite3/sqlite3rtree.h"
|
||||
typedef sqlite3_int64 i64;
|
||||
typedef sqlite3_uint64 u64;
|
||||
typedef unsigned char u8;
|
||||
|
@ -79,10 +79,10 @@ typedef unsigned int u32;
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "libc/assert.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
|
||||
/* The following macro is used to suppress compiler warnings.
|
||||
*/
|
||||
|
@ -4313,7 +4313,7 @@ static void rtreecheck(sqlite3_context *ctx, int nArg, sqlite3_value **apArg) {
|
|||
|
||||
/* Conditionally include the geopoly code */
|
||||
#ifdef SQLITE_ENABLE_GEOPOLY
|
||||
#include "geopoly.c"
|
||||
#include "third_party/sqlite3/geopoly.c"
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
2
third_party/sqlite3/rtree.h
vendored
2
third_party/sqlite3/rtree.h
vendored
|
@ -13,7 +13,7 @@
|
|||
** This header file is used by programs that want to link against the
|
||||
** RTREE library. All it does is declare the sqlite3RtreeInit() interface.
|
||||
*/
|
||||
#include "sqlite3.h"
|
||||
#include "third_party/sqlite3/sqlite3.h"
|
||||
|
||||
#ifdef SQLITE_OMIT_VIRTUALTABLE
|
||||
#undef SQLITE_ENABLE_RTREE
|
||||
|
|
2
third_party/sqlite3/select.c
vendored
2
third_party/sqlite3/select.c
vendored
|
@ -12,7 +12,7 @@
|
|||
** This file contains C code routines that are called by the parser
|
||||
** to handle SELECT statements in SQLite.
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
/*
|
||||
** An instance of the following object is used to record information about
|
||||
|
|
172
third_party/sqlite3/shell.c
vendored
172
third_party/sqlite3/shell.c
vendored
|
@ -82,30 +82,30 @@
|
|||
#define _LARGEFILE_SOURCE 1
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "sqlite3.h"
|
||||
#include "libc/assert.h"
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/sqlite3/sqlite3.h"
|
||||
typedef sqlite3_int64 i64;
|
||||
typedef sqlite3_uint64 u64;
|
||||
typedef unsigned char u8;
|
||||
#if SQLITE_USER_AUTHENTICATION
|
||||
#include "sqlite3userauth.h"
|
||||
#include "third_party/sqlite3/sqlite3userauth.h"
|
||||
#endif
|
||||
#include <ctype.h>
|
||||
#include <stdarg.h>
|
||||
#include "libc/str/str.h"
|
||||
|
||||
#if !defined(_WIN32) && !defined(WIN32)
|
||||
#include <signal.h>
|
||||
#include "libc/calls/sigbits.h"
|
||||
#if !defined(__RTP__) && !defined(_WRS_KERNEL)
|
||||
#include <pwd.h>
|
||||
#include "third_party/musl/passwd.h"
|
||||
#endif
|
||||
#endif
|
||||
#if (!defined(_WIN32) && !defined(WIN32)) || defined(__MINGW32__)
|
||||
#include <dirent.h>
|
||||
#include <unistd.h>
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/isystem/unistd.h"
|
||||
#define GETPID getpid
|
||||
#if defined(__MINGW32__)
|
||||
#define DIRENT dirent
|
||||
|
@ -116,8 +116,7 @@ typedef unsigned char u8;
|
|||
#else
|
||||
#define GETPID (int)GetCurrentProcessId
|
||||
#endif
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include "libc/calls/weirdtypes.h"
|
||||
|
||||
#if HAVE_READLINE
|
||||
#include <readline/history.h>
|
||||
|
@ -138,7 +137,7 @@ typedef unsigned char u8;
|
|||
|
||||
#elif HAVE_LINENOISE
|
||||
|
||||
#include "linenoise.h"
|
||||
#include "third_party/sqlite3/linenoise.h"
|
||||
#define shell_add_history(X) linenoiseHistoryAdd(X)
|
||||
#define shell_read_history(X) linenoiseHistoryLoad(X)
|
||||
#define shell_write_history(X) linenoiseHistorySave(X)
|
||||
|
@ -177,13 +176,10 @@ typedef unsigned char u8;
|
|||
#endif
|
||||
#else
|
||||
/* Make sure isatty() has a prototype. */
|
||||
extern int isatty(int);
|
||||
|
||||
#if !defined(__RTP__) && !defined(_WRS_KERNEL)
|
||||
/* popen and pclose are not C89 functions and so are
|
||||
** sometimes omitted from the <stdio.h> header */
|
||||
extern FILE *popen(const char *, const char *);
|
||||
extern int pclose(FILE *);
|
||||
** sometimes omitted from the "libc/stdio/stdio.h" header */
|
||||
#else
|
||||
#define SQLITE_OMIT_POPEN 1
|
||||
#endif
|
||||
|
@ -254,8 +250,8 @@ static sqlite3_int64 timeOfDay(void) {
|
|||
}
|
||||
|
||||
#if !defined(_WIN32) && !defined(WIN32) && !defined(__minux)
|
||||
#include <sys/resource.h>
|
||||
#include <sys/time.h>
|
||||
#include "libc/sysv/consts/rusage.h"
|
||||
#include "libc/time/time.h"
|
||||
|
||||
/* VxWorks does not support getrusage() as far as we can determine */
|
||||
#if defined(_WRS_KERNEL) || defined(__RTP__)
|
||||
|
@ -1050,25 +1046,23 @@ static void shellAddSchemaName(sqlite3_context *pCtx, int nVal,
|
|||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
|
||||
#include "windows.h"
|
||||
#include "third_party/sqlite3/windows.h"
|
||||
|
||||
/*
|
||||
** We need several support functions from the SQLite core.
|
||||
*/
|
||||
|
||||
/* #include "sqlite3.h" */
|
||||
/* #include "third_party/sqlite3/sqlite3.h" */
|
||||
|
||||
/*
|
||||
** We need several things from the ANSI and MSVCRT headers.
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
#include <io.h>
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include "libc/calls/weirdtypes.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/limits.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
|
||||
/*
|
||||
** We may need several defines that should have been in "sys/stat.h".
|
||||
|
@ -1203,7 +1197,7 @@ extern INT closedir(LPDIR dirp);
|
|||
*/
|
||||
|
||||
#if defined(_WIN32) && defined(_MSC_VER)
|
||||
/* #include "test_windirent.h" */
|
||||
/* #include "third_party/sqlite3/test_windirent.h" */
|
||||
|
||||
/*
|
||||
** Implementation of the POSIX getenv() function using the Win32 API.
|
||||
|
@ -1399,11 +1393,10 @@ INT closedir(LPDIR dirp) {
|
|||
** is used. If SIZE is included it must be one of the integers 224, 256,
|
||||
** 384, or 512, to determine SHA3 hash variant that is computed.
|
||||
*/
|
||||
/* #include "sqlite3ext.h" */
|
||||
/* #include "third_party/sqlite3/sqlite3ext.h" */
|
||||
SQLITE_EXTENSION_INIT1
|
||||
#include <assert.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include "libc/assert.h"
|
||||
#include "libc/str/str.h"
|
||||
|
||||
#ifndef SQLITE_AMALGAMATION
|
||||
/* typedef sqlite3_uint64 u64; */
|
||||
|
@ -2152,24 +2145,22 @@ int sqlite3_shathree_init(sqlite3 *db, char **pzErrMsg,
|
|||
** And the paths returned in the "name" column of the table are also
|
||||
** relative to directory $dir.
|
||||
*/
|
||||
/* #include "sqlite3ext.h" */
|
||||
/* #include "third_party/sqlite3/sqlite3ext.h" */
|
||||
SQLITE_EXTENSION_INIT1
|
||||
#include <assert.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include "libc/assert.h"
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/weirdtypes.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#if !defined(_WIN32) && !defined(WIN32)
|
||||
#include <dirent.h>
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
#include <utime.h>
|
||||
#include "libc/calls/sigbits.h"
|
||||
#include "libc/isystem/unistd.h"
|
||||
#include "libc/time/time.h"
|
||||
#else
|
||||
#include <direct.h>
|
||||
#include <io.h>
|
||||
|
||||
#include "windows.h"
|
||||
#include "third_party/sqlite3/windows.h"
|
||||
/* # include "test_windirent.h" */
|
||||
#define dirent DIRENT
|
||||
#ifndef chmod
|
||||
|
@ -2181,8 +2172,8 @@ SQLITE_EXTENSION_INIT1
|
|||
#define mkdir(path, mode) _mkdir(path)
|
||||
#define lstat(path, buf) stat(path, buf)
|
||||
#endif
|
||||
#include <errno.h>
|
||||
#include <time.h>
|
||||
#include "libc/errno.h"
|
||||
#include "libc/time/time.h"
|
||||
|
||||
/*
|
||||
** Structure of the fsdir() table-valued function
|
||||
|
@ -3074,11 +3065,10 @@ int sqlite3_fileio_init(sqlite3 *db, char **pzErrMsg,
|
|||
** faster than any human can type.
|
||||
**
|
||||
*/
|
||||
/* #include "sqlite3ext.h" */
|
||||
/* #include "third_party/sqlite3/sqlite3ext.h" */
|
||||
SQLITE_EXTENSION_INIT1
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include "libc/assert.h"
|
||||
#include "libc/str/str.h"
|
||||
|
||||
#ifndef SQLITE_OMIT_VIRTUALTABLE
|
||||
|
||||
|
@ -3585,10 +3575,10 @@ int sqlite3_completion_init(sqlite3 *db, char **pzErrMsg,
|
|||
** If the file being opened is a plain database (not an appended one), then
|
||||
** this shim is a pass-through into the default underlying VFS. (rule 3)
|
||||
**/
|
||||
/* #include "sqlite3ext.h" */
|
||||
/* #include "third_party/sqlite3/sqlite3ext.h" */
|
||||
SQLITE_EXTENSION_INIT1
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include "libc/assert.h"
|
||||
#include "libc/str/str.h"
|
||||
|
||||
/* The append mark at the end of the database is:
|
||||
**
|
||||
|
@ -4188,9 +4178,9 @@ int sqlite3_appendvfs_init(sqlite3 *db, char **pzErrMsg,
|
|||
** This extension is used to implement the --memtrace option of the
|
||||
** command-line shell.
|
||||
*/
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "libc/assert.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
|
||||
/* The original memory allocation routines */
|
||||
static sqlite3_mem_methods memtraceBase;
|
||||
|
@ -4298,11 +4288,10 @@ int sqlite3MemTraceDeactivate(void) {
|
|||
** is *not* limited integers that can be expressed as a
|
||||
** 64-bit machine integer.
|
||||
*/
|
||||
/* #include "sqlite3ext.h" */
|
||||
/* #include "third_party/sqlite3/sqlite3ext.h" */
|
||||
SQLITE_EXTENSION_INIT1
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include "libc/assert.h"
|
||||
#include "libc/str/str.h"
|
||||
|
||||
/*
|
||||
** Compare text in lexicographic order, except strings of digits
|
||||
|
@ -4378,12 +4367,11 @@ int sqlite3_uint_init(sqlite3 *db, char **pzErrMsg,
|
|||
**
|
||||
** The focus here is on simplicity and correctness, not performance.
|
||||
*/
|
||||
/* #include "sqlite3ext.h" */
|
||||
/* #include "third_party/sqlite3/sqlite3ext.h" */
|
||||
SQLITE_EXTENSION_INIT1
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "libc/assert.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/str/str.h"
|
||||
|
||||
/* Mark a function parameter as unused, to suppress nuisance compiler
|
||||
** warnings. */
|
||||
|
@ -5053,10 +5041,10 @@ int sqlite3_decimal_init(sqlite3 *db, char **pzErrMsg,
|
|||
** FROM pow2, c WHERE pow2.x=ieee754_exponent(c.bin);
|
||||
**
|
||||
*/
|
||||
/* #include "sqlite3ext.h" */
|
||||
/* #include "third_party/sqlite3/sqlite3ext.h" */
|
||||
SQLITE_EXTENSION_INIT1
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include "libc/assert.h"
|
||||
#include "libc/str/str.h"
|
||||
|
||||
/* Mark a function parameter as unused, to suppress nuisance compiler
|
||||
** warnings. */
|
||||
|
@ -5311,10 +5299,10 @@ int sqlite3_ieee_init(sqlite3 *db, char **pzErrMsg,
|
|||
** encourages the query planner to order joins such that the bounds of the
|
||||
** series are well-defined.
|
||||
*/
|
||||
/* #include "sqlite3ext.h" */
|
||||
/* #include "third_party/sqlite3/sqlite3ext.h" */
|
||||
SQLITE_EXTENSION_INIT1
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include "libc/assert.h"
|
||||
#include "libc/str/str.h"
|
||||
|
||||
#ifndef SQLITE_OMIT_VIRTUALTABLE
|
||||
|
||||
|
@ -5711,12 +5699,12 @@ int sqlite3_series_init(sqlite3 *db, char **pzErrMsg,
|
|||
** * No support for zip64 extensions
|
||||
** * Only the "inflate/deflate" (zlib) compression method is supported
|
||||
*/
|
||||
/* #include "sqlite3ext.h" */
|
||||
/* #include "third_party/sqlite3/sqlite3ext.h" */
|
||||
SQLITE_EXTENSION_INIT1
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <zlib.h>
|
||||
#include "libc/assert.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/zlib/zlib.h"
|
||||
|
||||
#ifndef SQLITE_OMIT_VIRTUALTABLE
|
||||
|
||||
|
@ -7857,10 +7845,10 @@ int sqlite3_zipfile_init(sqlite3 *db, char **pzErrMsg,
|
|||
** for working with sqlar archives and used by the shell tool's built-in
|
||||
** sqlar support.
|
||||
*/
|
||||
/* #include "sqlite3ext.h" */
|
||||
/* #include "third_party/sqlite3/sqlite3ext.h" */
|
||||
SQLITE_EXTENSION_INIT1
|
||||
#include <assert.h>
|
||||
#include <zlib.h>
|
||||
#include "libc/assert.h"
|
||||
#include "third_party/zlib/zlib.h"
|
||||
|
||||
/*
|
||||
** Implementation of the "sqlar_compress(X)" SQL function.
|
||||
|
@ -7974,7 +7962,7 @@ int sqlite3_sqlar_init(sqlite3 *db, char **pzErrMsg,
|
|||
*/
|
||||
#if !defined(SQLITEEXPERT_H)
|
||||
#define SQLITEEXPERT_H 1
|
||||
/* #include "sqlite3.h" */
|
||||
/* #include "third_party/sqlite3/sqlite3.h" */
|
||||
|
||||
typedef struct sqlite3expert sqlite3expert;
|
||||
|
||||
|
@ -8144,10 +8132,10 @@ void sqlite3_expert_destroy(sqlite3expert *);
|
|||
**
|
||||
*************************************************************************
|
||||
*/
|
||||
/* #include "sqlite3expert.h" */
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
/* #include "third_party/sqlite3/sqlite3expert.h" */
|
||||
#include "libc/assert.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
|
||||
#ifndef SQLITE_OMIT_VIRTUALTABLE
|
||||
|
||||
|
@ -10107,14 +10095,14 @@ void sqlite3_expert_destroy(sqlite3expert *p) {
|
|||
** child page in the database.
|
||||
*/
|
||||
#if !defined(SQLITEINT_H)
|
||||
/* #include "sqlite3ext.h" */
|
||||
/* #include "third_party/sqlite3/sqlite3ext.h" */
|
||||
|
||||
/* typedef unsigned char u8; */
|
||||
|
||||
#endif
|
||||
SQLITE_EXTENSION_INIT1
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include "libc/assert.h"
|
||||
#include "libc/str/str.h"
|
||||
|
||||
#define DBDATA_PADDING_BYTES 100
|
||||
|
||||
|
@ -20668,6 +20656,8 @@ int SQLITE_CDECL wmain(int argc, wchar_t **wargv) {
|
|||
|
||||
setBinaryMode(stdin, 0);
|
||||
setvbuf(stderr, 0, _IONBF, 0); /* Make sure stderr is unbuffered */
|
||||
setvbuf(stdin, (char *)NULL, _IONBF, BUFSIZ);
|
||||
setvbuf(stdout, (char *)NULL, _IONBF, BUFSIZ);
|
||||
stdin_is_interactive = isatty(0);
|
||||
stdout_is_console = isatty(1);
|
||||
|
||||
|
|
4
third_party/sqlite3/sqlite3.h
vendored
4
third_party/sqlite3/sqlite3.h
vendored
|
@ -32,7 +32,7 @@
|
|||
*/
|
||||
#ifndef SQLITE3_H
|
||||
#define SQLITE3_H
|
||||
#include <stdarg.h> /* Needed for the definition of va_list */
|
||||
/* Needed for the definition of va_list */
|
||||
|
||||
/*
|
||||
** Make sure we can call this stuff from C++.
|
||||
|
@ -9547,7 +9547,7 @@ SQLITE_API int sqlite3_system_errno(sqlite3 *);
|
|||
** the most recent version.
|
||||
*/
|
||||
typedef struct sqlite3_snapshot {
|
||||
unsigned char hidden[48];
|
||||
unsigned char dummyhidden[48];
|
||||
} sqlite3_snapshot;
|
||||
|
||||
/*
|
||||
|
|
102
third_party/sqlite3/sqlite3.mk
vendored
Normal file
102
third_party/sqlite3/sqlite3.mk
vendored
Normal file
|
@ -0,0 +1,102 @@
|
|||
#-*-mode:makefile-gmake;indent-tabs-mode:t;tab-width:8;coding:utf-8-*-┐
|
||||
#───vi: set et ft=make ts=8 tw=8 fenc=utf-8 :vi───────────────────────┘
|
||||
|
||||
PKGS += THIRD_PARTY_SQLITE3
|
||||
|
||||
THIRD_PARTY_SQLITE3_ARTIFACTS += THIRD_PARTY_SQLITE3_A
|
||||
THIRD_PARTY_SQLITE3 = $(THIRD_PARTY_SQLITE3_A_DEPS) $(THIRD_PARTY_SQLITE3_A) $(THIRD_PARTY_SQLITE3_COMS)
|
||||
THIRD_PARTY_SQLITE3_A = o/$(MODE)/third_party/sqlite3/libsqlite3.a
|
||||
THIRD_PARTY_SQLITE3_A_FILES := $(wildcard third_party/sqlite3/*)
|
||||
THIRD_PARTY_SQLITE3_A_HDRS = $(filter %.h,$(THIRD_PARTY_SQLITE3_A_FILES))
|
||||
THIRD_PARTY_SQLITE3_A_SRCS_C = $(filter-out %/geopoly.c,$(filter %.c,$(THIRD_PARTY_SQLITE3_A_FILES)))
|
||||
THIRD_PARTY_SQLITE3_BINS = $(THIRD_PARTY_SQLITE3_COMS) $(THIRD_PARTY_SQLITE3_COMS:%=%.dbg)
|
||||
|
||||
THIRD_PARTY_SQLITE3_A_SRCS = \
|
||||
$(THIRD_PARTY_SQLITE3_A_SRCS_C)
|
||||
|
||||
THIRD_PARTY_SQLITE3_A_OBJS = \
|
||||
$(THIRD_PARTY_SQLITE3_A_SRCS_C:%.c=o/$(MODE)/%.o)
|
||||
|
||||
THIRD_PARTY_SQLITE3_COMS = \
|
||||
o/$(MODE)/third_party/sqlite3/sqlite3.com
|
||||
|
||||
THIRD_PARTY_SQLITE3_A_CHECKS = \
|
||||
$(THIRD_PARTY_SQLITE3_A).pkg \
|
||||
$(THIRD_PARTY_SQLITE3_A_HDRS:%=o/$(MODE)/%.ok)
|
||||
|
||||
THIRD_PARTY_SQLITE3_A_DIRECTDEPS = \
|
||||
LIBC_ALG \
|
||||
LIBC_BITS \
|
||||
LIBC_CALLS \
|
||||
LIBC_FMT \
|
||||
LIBC_INTRIN \
|
||||
LIBC_MEM \
|
||||
LIBC_NEXGEN32E \
|
||||
LIBC_RUNTIME \
|
||||
LIBC_STDIO \
|
||||
LIBC_STR \
|
||||
LIBC_STUBS \
|
||||
LIBC_SYSV \
|
||||
LIBC_SYSV_CALLS \
|
||||
LIBC_TIME \
|
||||
LIBC_TINYMATH \
|
||||
LIBC_UNICODE \
|
||||
THIRD_PARTY_GDTOA \
|
||||
THIRD_PARTY_MUSL \
|
||||
THIRD_PARTY_ZLIB
|
||||
|
||||
THIRD_PARTY_SQLITE3_A_DEPS := \
|
||||
$(call uniq,$(foreach x,$(THIRD_PARTY_SQLITE3_A_DIRECTDEPS),$($(x))))
|
||||
|
||||
o/$(MODE)/third_party/sqlite3/sqlite3.com.dbg: \
|
||||
$(THIRD_PARTY_SQLITE3_A_DEPS) \
|
||||
$(THIRD_PARTY_SQLITE3_A) \
|
||||
o/$(MODE)/third_party/sqlite3/shell.o \
|
||||
$(CRT) \
|
||||
$(APE)
|
||||
-@$(APELINK)
|
||||
|
||||
$(THIRD_PARTY_SQLITE3_A): \
|
||||
third_party/sqlite3/ \
|
||||
$(THIRD_PARTY_SQLITE3_A).pkg \
|
||||
$(filter-out %/shell.o,$(THIRD_PARTY_SQLITE3_A_OBJS))
|
||||
|
||||
$(THIRD_PARTY_SQLITE3_A).pkg: \
|
||||
$(filter-out %/shell.o,$(THIRD_PARTY_SQLITE3_A_OBJS)) \
|
||||
$(foreach x,$(THIRD_PARTY_SQLITE3_A_DIRECTDEPS),$($(x)_A).pkg)
|
||||
|
||||
$(THIRD_PARTY_SQLITE3_A_OBJS): \
|
||||
OVERRIDE_CFLAGS = \
|
||||
-DSTACK_FRAME_UNLIMITED \
|
||||
-DSQLITE_CORE \
|
||||
-DSQLITE_OS_UNIX=1 \
|
||||
-DBUILD_sqlite -DNDEBUG \
|
||||
-DSQLITE_THREADSAFE=0 \
|
||||
-DSQLITE_OMIT_LOAD_EXTENSION=1 \
|
||||
-DSQLITE_ENABLE_MATH_FUNCTIONS \
|
||||
-DSQLITE_ENABLE_FTS3 \
|
||||
-DSQLITE_ENABLE_FTS4 \
|
||||
-DSQLITE_ENABLE_FTS5 \
|
||||
-DSQLITE_ENABLE_JSON1 \
|
||||
-DSQLITE_ENABLE_GEOPOLY \
|
||||
-DSQLITE_ENABLE_RTREE \
|
||||
-DSQLITE_ENABLE_SESSION \
|
||||
-DSQLITE_ENABLE_PREUPDATE_HOOK \
|
||||
-DSQLITE_TEMP_STORE=1 \
|
||||
-DHAVE_READLINE=0 \
|
||||
-DHAVE_EDITLINE=0 \
|
||||
-DSQLITE_ENABLE_JSON1 \
|
||||
-DSQLITE_ENABLE_RTREE \
|
||||
-DSQLITE_ENABLE_EXPLAIN_COMMENTS \
|
||||
-DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION \
|
||||
-DSQLITE_ENABLE_STMTVTAB \
|
||||
-DSQLITE_ENABLE_DBPAGE_VTAB \
|
||||
-DSQLITE_ENABLE_DBSTAT_VTAB \
|
||||
-DSQLITE_ENABLE_BYTECODE_VTAB \
|
||||
-DSQLITE_ENABLE_OFFSET_SQL_FUNC \
|
||||
-DSQLITE_ENABLE_DESERIALIZE
|
||||
|
||||
.PHONY: o/$(MODE)/third_party/sqlite3
|
||||
o/$(MODE)/third_party/sqlite3: \
|
||||
$(THIRD_PARTY_SQLITE3_BINS) \
|
||||
$(THIRD_PARTY_SQLITE3_CHECKS)
|
2
third_party/sqlite3/sqlite3ext.h
vendored
2
third_party/sqlite3/sqlite3ext.h
vendored
|
@ -17,7 +17,7 @@
|
|||
*/
|
||||
#ifndef SQLITE3EXT_H
|
||||
#define SQLITE3EXT_H
|
||||
#include "sqlite3.h"
|
||||
#include "third_party/sqlite3/sqlite3.h"
|
||||
|
||||
/*
|
||||
** The following structure holds pointers to all of the SQLite API
|
||||
|
|
14
third_party/sqlite3/sqlite3rbu.c
vendored
14
third_party/sqlite3/sqlite3rbu.c
vendored
|
@ -80,17 +80,17 @@
|
|||
**
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "sqlite3.h"
|
||||
#include "libc/assert.h"
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/sqlite3/sqlite3.h"
|
||||
|
||||
#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_RBU)
|
||||
#include "sqlite3rbu.h"
|
||||
#include "third_party/sqlite3/sqlite3rbu.h"
|
||||
|
||||
#if defined(_WIN32_WCE)
|
||||
#include "windows.h"
|
||||
#include "third_party/sqlite3/windows.h"
|
||||
#endif
|
||||
|
||||
/* Maximum number of prepared UPDATE statements held by this module */
|
||||
|
|
2
third_party/sqlite3/sqlite3rbu.h
vendored
2
third_party/sqlite3/sqlite3rbu.h
vendored
|
@ -267,7 +267,7 @@
|
|||
#ifndef _SQLITE3RBU_H
|
||||
#define _SQLITE3RBU_H
|
||||
|
||||
#include "sqlite3.h" /* Required for error code definitions */
|
||||
#include "third_party/sqlite3/sqlite3.h" /* Required for error code definitions */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
2
third_party/sqlite3/sqlite3rtree.h
vendored
2
third_party/sqlite3/sqlite3rtree.h
vendored
|
@ -14,7 +14,7 @@
|
|||
#ifndef _SQLITE3RTREE_H_
|
||||
#define _SQLITE3RTREE_H_
|
||||
|
||||
#include <sqlite3.h>
|
||||
#include "third_party/sqlite3/sqlite3.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
10
third_party/sqlite3/sqlite3session.c
vendored
10
third_party/sqlite3/sqlite3session.c
vendored
|
@ -1,13 +1,13 @@
|
|||
|
||||
#if defined(SQLITE_ENABLE_SESSION) && defined(SQLITE_ENABLE_PREUPDATE_HOOK)
|
||||
#include "sqlite3session.h"
|
||||
#include "third_party/sqlite3/sqlite3session.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include "libc/assert.h"
|
||||
#include "libc/str/str.h"
|
||||
|
||||
#ifndef SQLITE_AMALGAMATION
|
||||
#include "sqliteInt.h"
|
||||
#include "vdbeInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
#include "third_party/sqlite3/vdbeInt.h"
|
||||
#endif
|
||||
|
||||
typedef struct SessionTable SessionTable;
|
||||
|
|
2
third_party/sqlite3/sqlite3session.h
vendored
2
third_party/sqlite3/sqlite3session.h
vendored
|
@ -9,7 +9,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "sqlite3.h"
|
||||
#include "third_party/sqlite3/sqlite3.h"
|
||||
|
||||
/*
|
||||
** CAPI3REF: Session Object Handle
|
||||
|
|
49
third_party/sqlite3/sqliteInt.h
vendored
49
third_party/sqlite3/sqliteInt.h
vendored
|
@ -56,12 +56,12 @@
|
|||
** compiler warnings due to subsequent content in this file and other files
|
||||
** that are included by this file.
|
||||
*/
|
||||
#include "msvc.h"
|
||||
#include "third_party/sqlite3/msvc.h"
|
||||
|
||||
/*
|
||||
** Special setup for VxWorks
|
||||
*/
|
||||
#include "vxworks.h"
|
||||
#include "third_party/sqlite3/vxworks.h"
|
||||
|
||||
/*
|
||||
** These #defines should enable >2GB file support on POSIX if the
|
||||
|
@ -165,9 +165,9 @@
|
|||
** disabled.
|
||||
*/
|
||||
#if defined(_HAVE_MINGW_H)
|
||||
#include "mingw.h"
|
||||
#include "third_party/sqlite3/mingw.h"
|
||||
#elif defined(_HAVE__MINGW_H)
|
||||
#include "_mingw.h"
|
||||
#include "third_party/sqlite3/_mingw.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -185,18 +185,18 @@
|
|||
** first in QNX. Also, the _USE_32BIT_TIME_T macro must appear first for
|
||||
** MinGW.
|
||||
*/
|
||||
#include "sqlite3.h"
|
||||
#include "third_party/sqlite3/sqlite3.h"
|
||||
|
||||
/*
|
||||
** Include the configuration header output by 'configure' if we're using the
|
||||
** autoconf-based build
|
||||
*/
|
||||
#if defined(_HAVE_SQLITE_CONFIG_H) && !defined(SQLITECONFIG_H)
|
||||
#include "config.h"
|
||||
#include "third_party/sqlite3/config.h"
|
||||
#define SQLITECONFIG_H 1
|
||||
#endif
|
||||
|
||||
#include "sqliteLimit.h"
|
||||
#include "third_party/sqlite3/sqliteLimit.h"
|
||||
|
||||
/* Disable nuisance warnings on Borland compilers */
|
||||
#if defined(__BORLANDC__)
|
||||
|
@ -227,10 +227,10 @@
|
|||
** Include standard header files as necessary
|
||||
*/
|
||||
#ifdef HAVE_STDINT_H
|
||||
#include <stdint.h>
|
||||
#include "libc/calls/weirdtypes.h"
|
||||
#endif
|
||||
#ifdef HAVE_INTTYPES_H
|
||||
#include <inttypes.h>
|
||||
#include "libc/calls/weirdtypes.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -268,7 +268,7 @@
|
|||
** inlined.
|
||||
*/
|
||||
#if defined(__GNUC__)
|
||||
#define SQLITE_NOINLINE __attribute__((noinline))
|
||||
#define SQLITE_NOINLINE __attribute__((__noinline__))
|
||||
#elif defined(_MSC_VER) && _MSC_VER >= 1310
|
||||
#define SQLITE_NOINLINE __declspec(noinline)
|
||||
#else
|
||||
|
@ -585,14 +585,12 @@ extern int sqlite3OSTrace;
|
|||
#define likely(X) (X)
|
||||
#define unlikely(X) (X)
|
||||
|
||||
#include <assert.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "hash.h"
|
||||
#include "parse.h"
|
||||
#include "libc/assert.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/sqlite3/hash.h"
|
||||
#include "third_party/sqlite3/parse.h"
|
||||
|
||||
/*
|
||||
** Use a macro to replace memcpy() if compiled with SQLITE_INLINE_MEMCPY.
|
||||
|
@ -1228,18 +1226,19 @@ typedef u64 Bitmask;
|
|||
** just an array of integers.
|
||||
*/
|
||||
typedef int VList;
|
||||
typedef u32 Pgno;
|
||||
|
||||
/*
|
||||
** Defer sourcing vdbe.h and btree.h until after the "u8" and
|
||||
** "BusyHandler" typedefs. vdbe.h also requires a few of the opaque
|
||||
** pointer types (i.e. FuncDef) defined above.
|
||||
*/
|
||||
#include "btree.h"
|
||||
#include "mutex.h"
|
||||
#include "os.h"
|
||||
#include "pager.h"
|
||||
#include "pcache.h"
|
||||
#include "vdbe.h"
|
||||
#include "third_party/sqlite3/btree.h"
|
||||
#include "third_party/sqlite3/mutex.h"
|
||||
#include "third_party/sqlite3/os.h"
|
||||
#include "third_party/sqlite3/pager.h"
|
||||
#include "third_party/sqlite3/pcache.h"
|
||||
#include "third_party/sqlite3/vdbe.h"
|
||||
|
||||
/* The SQLITE_EXTRA_DURABLE compile-time option used to set the default
|
||||
** synchronous setting to EXTRA. It is no longer supported.
|
||||
|
@ -4181,7 +4180,7 @@ int sqlite3CorruptPgnoError(int, Pgno);
|
|||
*/
|
||||
#if !defined(SQLITE_ASCII) || \
|
||||
(defined(SQLITE_ENABLE_FTS3) && defined(SQLITE_AMALGAMATION))
|
||||
#include <ctype.h>
|
||||
#include "libc/str/str.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
2
third_party/sqlite3/sqliteicu.h
vendored
2
third_party/sqlite3/sqliteicu.h
vendored
|
@ -13,7 +13,7 @@
|
|||
** This header file is used by programs that want to link against the
|
||||
** ICU extension. All it does is declare the sqlite3IcuInit() interface.
|
||||
*/
|
||||
#include "sqlite3.h"
|
||||
#include "third_party/sqlite3/sqlite3.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
4
third_party/sqlite3/status.c
vendored
4
third_party/sqlite3/status.c
vendored
|
@ -13,8 +13,8 @@
|
|||
** This module implements the sqlite3_status() interface and related
|
||||
** functionality.
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "vdbeInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
#include "third_party/sqlite3/vdbeInt.h"
|
||||
|
||||
/*
|
||||
** Variables in which to record status information.
|
||||
|
|
6
third_party/sqlite3/stmt.c
vendored
6
third_party/sqlite3/stmt.c
vendored
|
@ -22,11 +22,11 @@
|
|||
*/
|
||||
#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB)
|
||||
#if !defined(SQLITEINT_H)
|
||||
#include "sqlite3ext.h"
|
||||
#include "third_party/sqlite3/sqlite3ext.h"
|
||||
#endif
|
||||
SQLITE_EXTENSION_INIT1
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include "libc/assert.h"
|
||||
#include "libc/str/str.h"
|
||||
|
||||
#ifndef SQLITE_OMIT_VIRTUALTABLE
|
||||
|
||||
|
|
2
third_party/sqlite3/table.c
vendored
2
third_party/sqlite3/table.c
vendored
|
@ -16,7 +16,7 @@
|
|||
** These routines are in a separate files so that they will not be linked
|
||||
** if they are not used.
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
#ifndef SQLITE_OMIT_GET_TABLE
|
||||
|
||||
|
|
4
third_party/sqlite3/threads.c
vendored
4
third_party/sqlite3/threads.c
vendored
|
@ -25,9 +25,9 @@
|
|||
** of multiple cores can do so, while also allowing applications to stay
|
||||
** single-threaded if desired.
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
#if SQLITE_OS_WIN
|
||||
#include "os_win.h"
|
||||
#include "third_party/sqlite3/os_win.h"
|
||||
#endif
|
||||
|
||||
#if SQLITE_MAX_WORKER_THREADS > 0
|
||||
|
|
7
third_party/sqlite3/tokenize.c
vendored
7
third_party/sqlite3/tokenize.c
vendored
|
@ -15,9 +15,8 @@
|
|||
** individual tokens and sends those tokens one-by-one over to the
|
||||
** parser for analysis.
|
||||
*/
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "sqliteInt.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
/* Character classes for tokenizing
|
||||
**
|
||||
|
@ -625,7 +624,7 @@ const unsigned char ebcdicToAscii[] = {
|
|||
** named keywordhash.h and then included into this source file by
|
||||
** the #include below.
|
||||
*/
|
||||
#include "keywordhash.h"
|
||||
#include "third_party/sqlite3/keywordhash.h"
|
||||
|
||||
/*
|
||||
** If X is a character that can be used in an identifier then
|
||||
|
|
2
third_party/sqlite3/treeview.c
vendored
2
third_party/sqlite3/treeview.c
vendored
|
@ -17,7 +17,7 @@
|
|||
** The interfaces in this file is only available when compiling
|
||||
** with SQLITE_DEBUG.
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
#ifdef SQLITE_DEBUG
|
||||
|
||||
/*
|
||||
|
|
2
third_party/sqlite3/trigger.c
vendored
2
third_party/sqlite3/trigger.c
vendored
|
@ -10,7 +10,7 @@
|
|||
*************************************************************************
|
||||
** This file contains the implementation for TRIGGERs
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
#ifndef SQLITE_OMIT_TRIGGER
|
||||
/*
|
||||
|
|
2
third_party/sqlite3/update.c
vendored
2
third_party/sqlite3/update.c
vendored
|
@ -12,7 +12,7 @@
|
|||
** This file contains C code routines that are called by the parser
|
||||
** to handle UPDATE statements.
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
|
||||
#ifndef SQLITE_OMIT_VIRTUALTABLE
|
||||
/* Forward declaration */
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue