Get SQLite to build

* changed headers
* removed redundant declarations
* ran clang-format
* added sqlite3.mk
This commit is contained in:
ahgamut 2021-05-04 20:09:59 +05:30 committed by Justine Tunney
parent 644f290035
commit 919b6fec10
156 changed files with 2847 additions and 6772 deletions

View file

@ -1,4 +1,5 @@
/* clang-format off */
#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS5)
@ -33,7 +34,7 @@
#ifndef _FTS5_H
#define _FTS5_H
#include "sqlite3.h"
#include "third_party/sqlite3/sqlite3.h"
#ifdef __cplusplus
extern "C" {
@ -603,12 +604,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 <string.h>
#include <assert.h>
#include "libc/assert.h"
#include "libc/str/str.h"
#ifndef SQLITE_AMALGAMATION
@ -1477,8 +1478,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
@ -1806,8 +1807,8 @@ struct fts5yyParser {
typedef struct fts5yyParser fts5yyParser;
#ifndef NDEBUG
#include <stdio.h>
#include <assert.h>
#include "libc/assert.h"
#include "libc/stdio/stdio.h"
static FILE *fts5yyTraceFILE = 0;
static char *fts5yyTracePrompt = 0;
#endif /* NDEBUG */
@ -3012,9 +3013,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
@ -3728,9 +3728,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 ){
@ -4135,8 +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
@ -5096,10 +5093,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.
@ -5113,14 +5108,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>
static void sqlite3Fts5ParserTrace(FILE*, char*);
#include "libc/stdio/stdio.h"
static void sqlite3Fts5ParserTrace(FILE *, char *);
#endif
static int sqlite3Fts5ParserFallback(int);
// static int sqlite3Fts5ParserFallback(int);
struct Fts5Expr {
@ -8152,9 +8147,7 @@ static int sqlite3Fts5ExprPhraseCollist(
**
*/
/* #include "fts5Int.h" */
/* #include "third_party/sqlite3/fts5Int.h" */
typedef struct Fts5HashEntry Fts5HashEntry;
@ -8718,8 +8711,7 @@ static void sqlite3Fts5HashScanEntry(
** the interface defined in fts5Int.h.
*/
/* #include "fts5Int.h" */
/* #include "third_party/sqlite3/fts5Int.h" */
/*
** Overview:
@ -15426,8 +15418,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
@ -18348,9 +18339,7 @@ int sqlite3Fts5Init(sqlite3 *db){
**
*/
/* #include "fts5Int.h" */
/* #include "third_party/sqlite3/fts5Int.h" */
struct Fts5Storage {
Fts5Config *pConfig;
@ -19510,8 +19499,7 @@ static int sqlite3Fts5StorageConfigValue(
******************************************************************************
*/
/* #include "fts5Int.h" */
/* #include "third_party/sqlite3/fts5Int.h" */
/**************************************************************************
** Start of ascii tokenizer implementation.
@ -20931,8 +20919,7 @@ static int sqlite3Fts5TokenizerInit(fts5_api *pApi){
** DO NOT EDIT THIS MACHINE GENERATED FILE.
*/
#include <assert.h>
#include "libc/assert.h"
@ -21709,8 +21696,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.
@ -22078,8 +22064,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;