/ Check-in [e2ef6667]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Remove SQLITE_TEST macros from fts5_test_mi.c. Add the SQLITE_FTS5_ENABLE_TEST_MI compile time symbol - to make it easier to create builds that include the fts5 matchinfo demo by default.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | branch-3.11-matchinfo
Files: files | file ages | folders
SHA1:e2ef6667772eeac6eee3aed5d0609c2a0ef5d8cf
User & Date: dan 2016-02-18 16:16:43
Context
2016-02-19
10:19
Add an "#ifndef SQLITE_AMALGAMATION" guard around a typedef in fts5_test_mi.c to avoid redefining "u32" if it is compiled as part of the amalgamation. Cherrypick of [f9c49ba1]. check-in: ce0f1ed5 user: dan tags: branch-3.11-matchinfo
2016-02-18
16:16
Remove SQLITE_TEST macros from fts5_test_mi.c. Add the SQLITE_FTS5_ENABLE_TEST_MI compile time symbol - to make it easier to create builds that include the fts5 matchinfo demo by default. check-in: e2ef6667 user: dan tags: branch-3.11-matchinfo
13:32
Remove an unnecessary "include <tcl.h>" line from fts5_test_mi.c. check-in: 31d8b69e user: dan tags: trunk
2016-02-17
14:48
Remove the "#ifdef SQLITE_TEST" condition from fts5_test_mi.c. Update fts5_main.c so that if SQLITE_FTS5_TEST_MI is defined when it is built the fts5_test_mi.c entry point is automatically called. This makes it easier to build versions of fts5 that include the matchinfo() demo by default. check-in: 87e6e225 user: dan tags: trunk
2016-02-15
17:29
Version 3.11.0 check-in: 3d862f20 user: drh tags: trunk, release, version-3.11.0
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ext/fts5/fts5_main.c.

2661
2662
2663
2664
2665
2666
2667











2668
2669
2670
2671
2672
2673
2674
    }
    if( rc==SQLITE_OK ){
      rc = sqlite3_create_function(
          db, "fts5_source_id", 0, SQLITE_UTF8, p, fts5SourceIdFunc, 0, 0
      );
    }
  }











  return rc;
}

/*
** The following functions are used to register the module with SQLite. If
** this module is being built as part of the SQLite core (SQLITE_CORE is
** defined), then sqlite3_open() will call sqlite3Fts5Init() directly.







>
>
>
>
>
>
>
>
>
>
>







2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
    }
    if( rc==SQLITE_OK ){
      rc = sqlite3_create_function(
          db, "fts5_source_id", 0, SQLITE_UTF8, p, fts5SourceIdFunc, 0, 0
      );
    }
  }

  /* If SQLITE_FTS5_ENABLE_TEST_MI is defined, assume that the file
  ** fts5_test_mi.c is compiled and linked into the executable. And call
  ** its entry point to enable the matchinfo() demo.  */
#ifdef SQLITE_FTS5_ENABLE_TEST_MI
  if( rc==SQLITE_OK ){
    extern int sqlite3Fts5TestRegisterMatchinfo(sqlite3*);
    rc = sqlite3Fts5TestRegisterMatchinfo(db);
  }
#endif

  return rc;
}

/*
** The following functions are used to register the module with SQLite. If
** this module is being built as part of the SQLite core (SQLITE_CORE is
** defined), then sqlite3_open() will call sqlite3Fts5Init() directly.

Changes to ext/fts5/fts5_test_mi.c.

37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
...
416
417
418
419
420
421
422
423
424
** This file exports a single function that may be called to register the
** matchinfo() implementation with a database handle:
**
**   int sqlite3Fts5TestRegisterMatchinfo(sqlite3 *db);
*/


#ifdef SQLITE_TEST
#ifdef SQLITE_ENABLE_FTS5

#include "fts5.h"
#include <tcl.h>
#include <assert.h>
#include <string.h>

typedef struct Fts5MatchinfoCtx Fts5MatchinfoCtx;
typedef unsigned int u32;

struct Fts5MatchinfoCtx {
................................................................................
  /* Register the implementation of matchinfo() */
  rc = pApi->xCreateFunction(pApi, "matchinfo", 0, fts5MatchinfoFunc, 0);

  return rc;
}

#endif /* SQLITE_ENABLE_FTS5 */
#endif /* SQLITE_TEST */








<



<







 







<

37
38
39
40
41
42
43

44
45
46

47
48
49
50
51
52
53
...
414
415
416
417
418
419
420

421
** This file exports a single function that may be called to register the
** matchinfo() implementation with a database handle:
**
**   int sqlite3Fts5TestRegisterMatchinfo(sqlite3 *db);
*/



#ifdef SQLITE_ENABLE_FTS5

#include "fts5.h"

#include <assert.h>
#include <string.h>

typedef struct Fts5MatchinfoCtx Fts5MatchinfoCtx;
typedef unsigned int u32;

struct Fts5MatchinfoCtx {
................................................................................
  /* Register the implementation of matchinfo() */
  rc = pApi->xCreateFunction(pApi, "matchinfo", 0, fts5MatchinfoFunc, 0);

  return rc;
}

#endif /* SQLITE_ENABLE_FTS5 */