On Mar 19, 2013, at 1:33 PM, D. Richard Hipp <d...@hwaci.com> wrote:

>   http://www.sqlite.org/releaselog/3_7_16.html

• Enhance the spellfix1 extension so that the edit distance cost table can be 
changed at runtime by inserting a string like 'edit_cost_table=TABLE' into the 
"command" field.


Is there an example of how to compile & load that spellfix1 extension? On Mac 
OS X possibly?

I have downloaded src/test_spellfix.c, compiled it, and created a shared 
object, as per [1], but when trying to use sqlite> .load I get a Segmentation 
fault: 11. 

gcc -bundle -fPIC -Isqlite3 -o spellfix1.so test_spellfix.c

sqlite> .load spellfix1.so
Segmentation fault: 11

Thoughts?

[1]  http://www.sqlite.org/cvstrac/wiki?p=LoadableExtensions





P.S.

<playing 'the girl from ipanema' in the background/>

Never mind… added a sqlite3_extension_init … making sure to call 
SQLITE_EXTENSION_INIT2 though! … sigh...

int sqlite3_extension_init
(
  sqlite3 *db, 
  char **pzErrMsg, 
  const sqlite3_api_routines *pApi
)
{
  SQLITE_EXTENSION_INIT2(pApi);
  return spellfix1Register(db);
}

Now it works:

sqlite> .load spellfix1.so
sqlite> CREATE VIRTUAL TABLE demo USING spellfix1;



_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to