1 /*
2  * Copyright 2013 Luciad (http://www.luciad.com)
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #include <sqlite3ext.h>
17 #include "spatialdb.h"
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
gpkg_libversion()23 GPKG_EXPORT const char *GPKG_CALL gpkg_libversion() {
24   return LIBGPKG_VERSION;
25 }
26 
sqlite3_gpkg_auto_init(sqlite3 * db,const char ** pzErrMsg,const sqlite3_api_routines * pThunk)27 GPKG_EXPORT int GPKG_CALL sqlite3_gpkg_auto_init(sqlite3 *db, const char **pzErrMsg, const sqlite3_api_routines *pThunk) {
28   return spatialdb_init(db, pzErrMsg, pThunk, NULL);
29 }
30 
sqlite3_gpkg_init(sqlite3 * db,const char ** pzErrMsg,const sqlite3_api_routines * pThunk)31 GPKG_EXPORT int GPKG_CALL sqlite3_gpkg_init(sqlite3 *db, const char **pzErrMsg, const sqlite3_api_routines *pThunk) {
32   return spatialdb_init(db, pzErrMsg, pThunk, spatialdb_geopackage_schema());
33 }
34 
sqlite3_gpkg_spl2_init(sqlite3 * db,const char ** pzErrMsg,const sqlite3_api_routines * pThunk)35 GPKG_EXPORT int GPKG_CALL sqlite3_gpkg_spl2_init(sqlite3 *db, const char **pzErrMsg, const sqlite3_api_routines *pThunk) {
36   return spatialdb_init(db, pzErrMsg, pThunk, spatialdb_spatialite2_schema());
37 }
38 
sqlite3_gpkg_spl3_init(sqlite3 * db,const char ** pzErrMsg,const sqlite3_api_routines * pThunk)39 GPKG_EXPORT int GPKG_CALL sqlite3_gpkg_spl3_init(sqlite3 *db, const char **pzErrMsg, const sqlite3_api_routines *pThunk) {
40   return spatialdb_init(db, pzErrMsg, pThunk, spatialdb_spatialite3_schema());
41 }
42 
sqlite3_gpkg_spl4_init(sqlite3 * db,const char ** pzErrMsg,const sqlite3_api_routines * pThunk)43 GPKG_EXPORT int GPKG_CALL sqlite3_gpkg_spl4_init(sqlite3 *db, const char **pzErrMsg, const sqlite3_api_routines *pThunk) {
44   return spatialdb_init(db, pzErrMsg, pThunk, spatialdb_spatialite4_schema());
45 }
46 
47 #ifdef __cplusplus
48 }
49 #endif
50