--- Paul Harris <[EMAIL PROTECTED]> wrote: > I wanted to get a LOG10() function in sqlite3, and I found the > extension-functions.tgz file in http://sqlite.org/contrib > > I am using the all-in-one sqlite3.h/c version of sqlite3, and the > extension-functions files don't seem to fit at all. > > For example, it wants to call a function called sqlite3CreateFunc(), > which seems to have been renamed to sqlite3_create_function() > > Should I even bother trying to hack these files into shape, or has > sqlite3 changed so much that these files will only serve to introduce > bugs?
The extension is somewhat out of date, but still usable. sqlite3CreateFunc is an internal sqlite function to register the extension functions, making it incompatible with a seperately compiled sqlite3.c. sqlite3utf8CharLen is another internal function used by the extension. You could convert all the registration functions to use the external API, or drop this file into sqlite/src and update the standard makefile. If you want to live on the edge, put map.h, map.c, func_ext.c, sqlite3.c and sqlite3.h in the same directory and run this: sed 's/sqlite3RegisterBuiltinFunctions(db);/& {extern void sqlite3RegisterExtraFunctions(sqlite3 *db); sqlite3RegisterExtraFunctions(db);};/' sqlite3.c > sqlite3f.c echo "" >> sqlite3f.c echo "#include <errno.h>" >> sqlite3f.c echo "" >> sqlite3f.c sed 's/#include.*//' map.h map.c func_ext.c | \ sed 's/sqlite3utf8CharLen/sqlite3Utf8CharLen/' >> sqlite3f.c Then use sqlite3f.c instead of sqlite3.c to build your program. If you're on Windows, download and install Cygwin or MSYS to get these UNIX commands to build sqlite3f.c. # optional: build sqlite3 command-line shell. # shell.c must be in current directory. gcc sqlite3f.c shell.c -o sqlite3f ____________________________________________________________________________________ Pinpoint customers who are looking for what you sell. http://searchmarketing.yahoo.com/ ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------