--- Liam Healy <[EMAIL PROTECTED]> wrote:
> Can you explain why you would want it to not compile as a
> loadable module? (i.e. under what circumstances you would not define
> COMPILE_SQLITE_EXTENSIONS_AS_LOADABLE_MODULE).

When you don't want the overhead/hassle of using shared libraries 
and you just want the external functions every time.

diff -u -3 -p -r1.174 func.c
--- src/func.c  3 Sep 2007 11:04:22 -0000       1.174
+++ src/func.c  28 Sep 2007 18:43:52 -0000
@@ -1426,6 +1426,7 @@ void sqlite3RegisterBuiltinFunctions(sql
     }
   }
   sqlite3RegisterDateTimeFunctions(db);
+  RegisterExtensionFunctions(db);
   if( !db->mallocFailed ){
     int rc = sqlite3_overload_function(db, "MATCH", 2);
     assert( rc==SQLITE_NOMEM || rc==SQLITE_OK );

> 
> On 9/28/07, Joe Wilson <[EMAIL PROTECTED]> wrote:
> > --- Liam Healy <[EMAIL PROTECTED]> wrote:
> > > Thanks.  I have included your changes in extension-functions.c so now
> > > sqlite3_load_extension is usable.  I had been using
> > > sqlite3RegisterExtraFunctions which is not the official interface, and
> > > that is why I never encountered this problem.  Also, I have improved
> > > the Mac OSX instructions for those that use Macs.
> > >
> > > The new version has been uploaded to sqlite.org/contrib.
> >
> > The following patch allows extension-functions.c to be compiled as
> > either as a standalone shared library extension module, or statically
> > (against the sqlite3.h/sqlite3.c amalgamation) depending on whether
> > COMPILE_SQLITE_EXTENSIONS_AS_LOADABLE_MODULE is #defined.
> >
> > I tested it against
> >
> >  http://www.sqlite.org/contrib/download/extension-functions.c?get=22
> >
> > from 2007-09-28 16:25:46 and it seems to work.
> >
> >
> > --- extension-functions.c-orig  2007-09-28 12:52:13.000000000 -0400
> > +++ extension-functions.c       2007-09-28 12:52:13.000000000 -0400
> > @@ -87,8 +87,12 @@
> >
> >  //#if SQLITE_WITH_EXTRA_FUNCTIONS
> >
> > +#ifdef COMPILE_SQLITE_EXTENSIONS_AS_LOADABLE_MODULE
> >  #include "sqlite3ext.h"
> >  SQLITE_EXTENSION_INIT1
> > +#else
> > +#include "sqlite3.h"
> > +#endif
> >
> >  #include <ctype.h>
> >  /* relicoder */
> > @@ -1618,8 +1622,7 @@
> >  ** functions.  This should be the only routine in this file with
> >  ** external linkage.
> >  */
> > -int sqlite3_extension_init(sqlite3 *db, char **pzErrMsg, const 
> > sqlite3_api_routines *pApi){
> > -  SQLITE_EXTENSION_INIT2(pApi);
> > +int RegisterExtensionFunctions(sqlite3 *db){
> >    static const struct FuncDef {
> >       char *zName;
> >       signed char nArg;
> > @@ -1748,6 +1751,15 @@
> >    return 0;
> >  }
> >
> > +#ifdef COMPILE_SQLITE_EXTENSIONS_AS_LOADABLE_MODULE
> > +int sqlite3_extension_init(
> > +    sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi){
> > +  SQLITE_EXTENSION_INIT2(pApi);
> > +  RegisterExtensionFunctions(db);
> > +  return 0;
> > +}
> > +#endif /* COMPILE_SQLITE_EXTENSIONS_AS_LOADABLE_MODULE */
> > +
> >  //#endif
> >
> >  map map_make(cmp_func cmp){
> >



       
____________________________________________________________________________________
Building a website is a piece of cake. Yahoo! Small Business gives you all the 
tools to get online.
http://smallbusiness.yahoo.com/webhosting 

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to