On Thu, Aug 29, 2013 at 3:53 AM, Pepijn Van Eeckhoudt <
[email protected]> wrote:

> http://www.sqlite.org/loadext.html states that:
>         ...omitting the second argument for the load_extension() SQL
>         interface - and the extension loader logic will attempt to
>         figure out the entry point on its own. It will first try the
>         generic extension name "sqlite3_extension_init". If that does
>         not work, it constructs a entry point using the template
>         "sqlite3_X_init" where the X is replaced by the lowercase
>         equivalent of every ASCII character in the filename...
>
> The documentation for sqlite3LoadExtension on the other hand says:
>         The entry point is zProc.  zProc may be 0 in which case a
>         default entry point name (sqlite3_extension_init) is used.  Use
>         of the default name is recommended.
>
> AFAICT the second description matches what the code actually does.


Recently the extension loader was enhanced (I think for 3.7.17) so that it
tries the first naming schema first, then if that fails it tries
sqlite3_extension_init.  So with newer versions SQLite either method
works.  And the first method is certainly easier on the user.



> The
> example extensions in ext/misc all use sqlite3_<extension_name>_init.
> This avoids name clashes but makes it a little bit more cumbersome for
> people to load the extensions.
>
> What is the recommended practice for naming the extension entry point?
> Should I use sqlite3_extension_init or sqlite3_<extension_name>_init?
>
> Thanks,
>
> Pepijn
>
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
[email protected]
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to