/ Check-in [7813b17d]
Login

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

Overview
Comment:Fix the test_spellfix.c extension so that it can be made loadable at run-time. Add spellfix to the shell when building using the build-shell.sh script.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7813b17d8b9fe48ddc841fe1c4bb75f7747073de
User & Date: drh 2013-01-25 19:11:31
Context
2013-01-26
19:31
Add a single test case to fts4unicode.test to verify that title-case maps to lower case. check-in: 955a9459 user: drh tags: trunk
2013-01-25
19:11
Fix the test_spellfix.c extension so that it can be made loadable at run-time. Add spellfix to the shell when building using the build-shell.sh script. check-in: 7813b17d user: drh tags: trunk
18:33
Enhance the command-line shell so that adding a non-zero numeric argument to the ".exit" command causes an immediate exit without cleaning up. This can be used (for example) to cause journal files to be left behind. check-in: 8ba951d1 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/shell.c.

  1481   1481       sqlite3_enable_load_extension(p->db, 1);
  1482   1482   #endif
  1483   1483   #ifdef SQLITE_ENABLE_REGEXP
  1484   1484       {
  1485   1485         extern int sqlite3_add_regexp_func(sqlite3*);
  1486   1486         sqlite3_add_regexp_func(db);
  1487   1487       }
         1488  +#endif
         1489  +#ifdef SQLITE_ENABLE_SPELLFIX
         1490  +    {
         1491  +      extern int sqlite3_spellfix1_register(sqlite3*);
         1492  +      sqlite3_spellfix1_register(db);
         1493  +    }
  1488   1494   #endif
  1489   1495     }
  1490   1496   }
  1491   1497   
  1492   1498   /*
  1493   1499   ** Do C-language style dequoting.
  1494   1500   **

Changes to src/test8.c.

  1385   1385   
  1386   1386     if( objc!=2 ){
  1387   1387       Tcl_WrongNumArgs(interp, 1, objv, "DB");
  1388   1388       return TCL_ERROR;
  1389   1389     }
  1390   1390     if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR;
  1391   1391   
  1392         -  sqlite3Spellfix1Register(db);
         1392  +  sqlite3_spellfix1_register(db);
  1393   1393     return TCL_OK;
  1394   1394   }
  1395   1395   
  1396   1396   #endif /* ifndef SQLITE_OMIT_VIRTUALTABLE */
  1397   1397   
  1398   1398   /*
  1399   1399   ** Register commands with the TCL interpreter.

Changes to src/test_spellfix.c.

    17     17   #if SQLITE_CORE
    18     18   # include "sqliteInt.h"
    19     19   #else
    20     20   # include <string.h>
    21     21   # include <stdio.h>
    22     22   # include <stdlib.h>
    23     23   # include "sqlite3ext.h"
           24  +# include <assert.h>
           25  +# define ALWAYS(X)  1
           26  +# define NEVER(X)   0
           27  +  typedef unsigned char u8;
           28  +  typedef unsigned short u16;
    24     29     SQLITE_EXTENSION_INIT1
    25     30   #endif /* !SQLITE_CORE */
    26     31   #include <ctype.h>
    27     32   
    28     33   /*
    29     34   ** Character classes for ASCII characters:
    30     35   **
................................................................................
  2805   2810     return rc;
  2806   2811   }
  2807   2812   
  2808   2813   #if SQLITE_CORE || defined(SQLITE_TEST)
  2809   2814   /*
  2810   2815   ** Register the spellfix1 virtual table and its associated functions.
  2811   2816   */
  2812         -int sqlite3Spellfix1Register(sqlite3 *db){
         2817  +int sqlite3_spellfix1_register(sqlite3 *db){
  2813   2818     return spellfix1Register(db);
  2814   2819   }
  2815   2820   #endif
  2816   2821   
  2817   2822   
  2818   2823   #if !SQLITE_CORE
  2819   2824   /*
  2820   2825   ** Extension load function.
  2821   2826   */
  2822         -int sqlite3_extension_init(
         2827  +int sqlite3_spellfix1_init(
  2823   2828     sqlite3 *db, 
  2824   2829     char **pzErrMsg, 
  2825   2830     const sqlite3_api_routines *pApi
  2826   2831   ){
  2827   2832     SQLITE_EXTENSION_INIT2(pApi);
  2828   2833     return spellfix1Register(db);
  2829   2834   }
  2830   2835   #endif /* !SQLITE_CORE */

Changes to tool/build-shell.sh.

    12     12   gcc -o sqlite3 -g -Os -I. \
    13     13      -DSQLITE_THREADSAFE=0 \
    14     14      -DSQLITE_ENABLE_VFSTRACE \
    15     15      -DSQLITE_ENABLE_STAT3 \
    16     16      -DSQLITE_ENABLE_FTS4 \
    17     17      -DSQLITE_ENABLE_RTREE \
    18     18      -DSQLITE_ENABLE_REGEXP \
           19  +   -DSQLITE_ENABLE_SPELLFIX -DSQLITE_CORE=1 \
    19     20      -DHAVE_READLINE \
    20     21      -DHAVE_USLEEP=1 \
    21         -   ../sqlite/src/shell.c ../sqlite/src/test_vfstrace.c \
           22  +   ../sqlite/src/shell.c \
    22     23      ../sqlite/src/test_regexp.c \
           24  +   ../sqlite/src/test_spellfix.c \
           25  +   ../sqlite/src/test_vfstrace.c \
    23     26      sqlite3.c -ldl -lreadline -lncurses