Index: config.h ================================================================== --- config.h +++ config.h @@ -100,11 +100,11 @@ /* Define to 1 if you have the `memset' function. */ #define HAVE_MEMSET 1 /* Define to 1 if you have the `readline' function. */ -/* #undef HAVE_READLINE */ +#define HAVE_READLINE 1 /* Define to 1 if you have the `sqrt' function. */ /* #undef HAVE_SQRT */ /* Define to 1 if `stat' has the bug that it succeeds when given the Index: exif_loader.c ================================================================== --- exif_loader.c +++ exif_loader.c @@ -1615,7 +1615,8 @@ spatialite_cleanup_ex (cache); if (cnt) fprintf (stderr, "\n\n*** %d EXIF photo%s successfully inserted into the DB\n", cnt, (cnt > 1) ? "s where" : " was"); +spatialite_shutdown(); return 0; } Index: shell.c ================================================================== --- shell.c +++ shell.c @@ -117,10 +117,14 @@ #endif /* True if the timer is enabled */ static int enableTimer = 0; +/* sandro 2013-11-07 */ +void *splite_cache = NULL; +/* end sandro 2013-11-07 */ + /* ctype macros that work with signed characters */ #define IsSpace(X) isspace((unsigned char)X) #define IsDigit(X) isdigit((unsigned char)X) #define ToLower(X) (char)tolower((unsigned char)X) @@ -261,11 +265,11 @@ /* ** sandro 2013-08-30 ** If the following flag is set, no welcome message will be ** printed at all. */ -static int silent = 0; +static int splite_silent = 0; /* ** Threat stdin as an interactive input if the following variable ** is true. Otherwise, assume stdin is connected to a file or pipe. */ @@ -2247,10 +2251,11 @@ if( db==0 || SQLITE_OK!=sqlite3_errcode(db) ){ fprintf(stderr,"Error: unable to open database \"%s\": %s\n", p->zDbFilename, sqlite3_errmsg(db)); exit(1); } + spatialite_init_ex (p->db, splite_cache, (splite_silent == 0) ? 1 : 0); #ifndef SQLITE_OMIT_LOAD_EXTENSION sqlite3_enable_load_extension(p->db, 1); #endif /* Sandro Furieri 2009-11-08 */ @@ -2667,11 +2672,11 @@ dxf = gaiaCreateDxfParser (srid, force_dims, prefix, layer_name, special_rings); if (dxf == NULL) goto stop_dxf; /* attempting to parse the DXF input file */ - if (gaiaParseDxfFile (dxf, dxf_path)) + if (gaiaParseDxfFile_r (splite_cache, dxf, dxf_path)) { /* loading into the DB */ if (!gaiaLoadFromDxfParser (p->db, dxf, mode, append)) fprintf (stderr, "DB error while loading: %s\n", dxf_path); } @@ -4106,10 +4111,13 @@ struct callback_data data; const char *zInitFile = 0; char *zFirstCmd = 0; int i; int rc = 0; + +/* initializing the SpatiaLite's internal cache */ + splite_cache = spatialite_alloc_connection (); if( strcmp(sqlite3_sourceid(),SQLITE_SOURCE_ID)!=0 ){ fprintf(stderr, "SQLite header and source version mismatch\n%s\n%s\n", sqlite3_sourceid(), SQLITE_SOURCE_ID); exit(1); @@ -4123,14 +4131,12 @@ 2013-08-30: supporting "silent mode" */ for(i=1; i