You write the code as if it were a loadable extension. If you compile "inline" (ie, appended to the amalgamation) the headers will detect the SQLITE_CORE symbol being defined and generate direct calls rather than indirect calls. There is really no need to change the code from the code you would use from a loadable extension, unless you want to "hide" the loadable extension init() symbol when compiled as part of the amalgamation (or inline using the SQLITE_CORE define) and use the EXTRA_INIT hook to do initialization.
--- The fact that there's a Highway to Hell but only a Stairway to Heaven says a lot about anticipated traffic volume. >-----Original Message----- >From: sqlite-users [mailto:sqlite-users- >boun...@mailinglists.sqlite.org] On Behalf Of Max Vlasov >Sent: Thursday, 5 April, 2018 09:24 >To: SQLite mailing list >Subject: [sqlite] Access to sqlite3_api_routines outside of a >loadable extension context > >Hi, >I'm considering creating a virtual table or user function that might >possible work either as a loadable extension or as a general, >statically >created one. In order to avoid repeating during developing, I thought >that >I might use sqlite3_api_routines structure as a universal access to >sqlite >code routines in both cases. But it seems it is impossible to access >the >structure outside of a loadable extension context. Or am I missing >something? > >Probably some direct access to sqlite3Apis variable is possible, but >I >suspect such practice isn't recommended. > >Thanks >_______________________________________________ >sqlite-users mailing list >sqlite-users@mailinglists.sqlite.org >http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users