Check-in Differences
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Difference From bb5e27dd2e2f5f96 To a8f81849a4393fba

2013-11-17
22:22
supporting .dropgeo with DB prefix check-in: f2e4e26566 user: sandro tags: trunk
2013-11-07
11:10
supporting spatialite_shutdown() check-in: bb5e27dd2e user: sandro tags: trunk
2013-08-30
11:21
implementing -silent (suppressing the welcome message) check-in: a8f81849a4 user: sandro tags: trunk
2013-08-24
08:08
upgrading to automake 1.13.4 check-in: ba4af74587 user: sandro tags: trunk

Changes to config.h.

    98     98   /* Define to 1 if you have the <memory.h> header file. */
    99     99   #define HAVE_MEMORY_H 1
   100    100   
   101    101   /* Define to 1 if you have the `memset' function. */
   102    102   #define HAVE_MEMSET 1
   103    103   
   104    104   /* Define to 1 if you have the `readline' function. */
   105         -#define HAVE_READLINE 1
          105  +/* #undef HAVE_READLINE */
   106    106   
   107    107   /* Define to 1 if you have the `sqrt' function. */
   108    108   /* #undef HAVE_SQRT */
   109    109   
   110    110   /* Define to 1 if `stat' has the bug that it succeeds when given the
   111    111      zero-length file name argument. */
   112    112   /* #undef HAVE_STAT_EMPTY_STRING_BUG */

Changes to exif_loader.c.

  1613   1613   	fprintf (stderr, "sqlite3_close() error: %s\n",
  1614   1614   		 sqlite3_errmsg (handle));
  1615   1615       spatialite_cleanup_ex (cache);
  1616   1616       if (cnt)
  1617   1617   	fprintf (stderr,
  1618   1618   		 "\n\n***   %d EXIF photo%s successfully inserted into the DB\n",
  1619   1619   		 cnt, (cnt > 1) ? "s where" : " was");
  1620         -spatialite_shutdown();
  1621   1620       return 0;
  1622   1621   }

Changes to shell.c.

   115    115    */
   116    116   #define isatty(x) 1
   117    117   #endif
   118    118   
   119    119   /* True if the timer is enabled */
   120    120   static int enableTimer = 0;
   121    121   
   122         -/* sandro 2013-11-07 */
   123         -void *splite_cache = NULL;
   124         -/* end sandro 2013-11-07 */
   125         -
   126    122   /* ctype macros that work with signed characters */
   127    123   #define IsSpace(X)  isspace((unsigned char)X)
   128    124   #define IsDigit(X)  isdigit((unsigned char)X)
   129    125   #define ToLower(X)  (char)tolower((unsigned char)X)
   130    126   
   131    127   #if !defined(_WIN32) && !defined(WIN32) && !defined(_WRS_KERNEL)
   132    128   #include <sys/time.h>
................................................................................
   263    259   static int bail_on_error = 0;
   264    260   
   265    261   /*
   266    262   ** sandro 2013-08-30
   267    263   ** If the following flag is set, no welcome message will be
   268    264   ** printed at all.
   269    265   */
   270         -static int splite_silent = 0;
          266  +static int silent = 0;
   271    267   
   272    268   /*
   273    269   ** Threat stdin as an interactive input if the following variable
   274    270   ** is true.  Otherwise, assume stdin is connected to a file or pipe.
   275    271   */
   276    272   static int stdin_is_interactive = 1;
   277    273   
................................................................................
  2249   2245             shellstaticFunc, 0, 0);
  2250   2246       }
  2251   2247       if( db==0 || SQLITE_OK!=sqlite3_errcode(db) ){
  2252   2248         fprintf(stderr,"Error: unable to open database \"%s\": %s\n", 
  2253   2249             p->zDbFilename, sqlite3_errmsg(db));
  2254   2250         exit(1);
  2255   2251       }
  2256         -    spatialite_init_ex (p->db, splite_cache, (splite_silent == 0) ? 1 : 0);
  2257   2252   #ifndef SQLITE_OMIT_LOAD_EXTENSION
  2258   2253       sqlite3_enable_load_extension(p->db, 1);
  2259   2254   #endif
  2260   2255   
  2261   2256   /* Sandro Furieri 2009-11-08 */
  2262   2257   	  sqlite3_exec (p->db, "PRAGMA foreign_keys = 1", NULL, 0, NULL);
  2263   2258   /* end Sandro Furieri 2008-11-08 */
................................................................................
  2670   2665   	  open_db (p);
  2671   2666         /* creating a DXF parser */
  2672   2667             dxf = gaiaCreateDxfParser (srid, force_dims, prefix, layer_name,
  2673   2668                   special_rings);
  2674   2669             if (dxf == NULL)
  2675   2670                 goto stop_dxf;
  2676   2671         /* attempting to parse the DXF input file */
  2677         -          if (gaiaParseDxfFile_r (splite_cache, dxf, dxf_path))
         2672  +          if (gaiaParseDxfFile (dxf, dxf_path))
  2678   2673             {
  2679   2674         /* loading into the DB */
  2680   2675                 if (!gaiaLoadFromDxfParser (p->db, dxf, mode, append))
  2681   2676                     fprintf (stderr, "DB error while loading: %s\n", dxf_path);
  2682   2677             }
  2683   2678             else
  2684   2679                 fprintf (stderr, "Unable to parse: %s\n", dxf_path);
................................................................................
  4109   4104   int main(int argc, char **argv){
  4110   4105     char *zErrMsg = 0;
  4111   4106     struct callback_data data;
  4112   4107     const char *zInitFile = 0;
  4113   4108     char *zFirstCmd = 0;
  4114   4109     int i;
  4115   4110     int rc = 0;
  4116         -  
  4117         -/* initializing the SpatiaLite's internal cache */
  4118         -  splite_cache = spatialite_alloc_connection ();
  4119   4111   
  4120   4112     if( strcmp(sqlite3_sourceid(),SQLITE_SOURCE_ID)!=0 ){
  4121   4113       fprintf(stderr, "SQLite header and source version mismatch\n%s\n%s\n",
  4122   4114               sqlite3_sourceid(), SQLITE_SOURCE_ID);
  4123   4115       exit(1);
  4124   4116     }
  4125   4117     Argv0 = argv[0];
................................................................................
  4129   4121   ===========================
  4130   4122   registering the SpatiaLite extension
  4131   4123   2013-08-30: supporting "silent mode"
  4132   4124   */
  4133   4125     for(i=1; i<argc && argv[i][0]=='-'; i++){
  4134   4126       char *z = argv[i];
  4135   4127       if( z[1]=='-' ){ z++; }
  4136         -    if( strcmp(z,"-silent")==0 ){ splite_silent = 1;}
         4128  +    if( strcmp(z,"-silent")==0 ){ silent = 1;}
  4137   4129   	}
         4130  +fprintf(stderr, "silent %d %d\n", silent, (silent == 0) ? 1 : 0);
         4131  +    spatialite_init ((silent == 0) ? 1 : 0);
  4138   4132   
  4139   4133     stdin_is_interactive = isatty(0);
  4140   4134   
  4141   4135     /* Make sure we have a valid signal handler early, before anything
  4142   4136     ** else is done.
  4143   4137     */
  4144   4138   #ifdef SIGINT
................................................................................
  4304   4298         data.echoOn = 1;
  4305   4299       }else if( strcmp(z,"-stats")==0 ){
  4306   4300         data.statsOn = 1;
  4307   4301       }else if( strcmp(z,"-bail")==0 ){
  4308   4302         bail_on_error = 1;
  4309   4303       }else if( strcmp(z,"-silent")==0 ){
  4310   4304   /* sandro 2013-08-30 */
  4311         -      splite_silent = 1;
         4305  +      silent = 1;
  4312   4306   /* end sandro */
  4313   4307       }else if( strcmp(z,"-version")==0 ){
  4314   4308         printf("%s %s\n", sqlite3_libversion(), sqlite3_sourceid());
  4315   4309         return 0;
  4316   4310       }else if( strcmp(z,"-interactive")==0 ){
  4317   4311         stdin_is_interactive = 1;
  4318   4312       }else if( strcmp(z,"-batch")==0 ){
................................................................................
  4383   4377         printf(
  4384   4378           "SQLite version %s %.19s\n" 
  4385   4379           "Enter \".help\" for instructions\n"
  4386   4380           "Enter SQL statements terminated with a \";\"\n",
  4387   4381           sqlite3_libversion(), sqlite3_sourceid()
  4388   4382         );
  4389   4383   */
  4390         -     open_db(&data);
  4391   4384        if (isatty (1))
  4392   4385             printf ("SQLite version ......: %s\n",
  4393   4386        sqlite3_libversion ());
  4394   4387        auto_fdo_start (data.db);
  4395   4388        if (isatty (1))
  4396   4389            printf ("Enter \".help\" for instructions\n");
  4397   4390   /* end Sandro Furieri 2008-11-20 */
................................................................................
  4436   4429   
  4437   4430   
  4438   4431   /*
  4439   4432   Sandro Furieri 30 May 2008
  4440   4433   ===========================
  4441   4434   memory cleanup for SpatiaLite extension
  4442   4435   */
  4443         -    
  4444         -  spatialite_cleanup_ex (splite_cache);
  4445         -  spatialite_shutdown ();
         4436  +    sqlite3_reset_auto_extension ();
  4446   4437   
  4447   4438     return rc;
  4448   4439   }

Changes to spatialite_convert.c.

  7023   7023   
  7024   7024   /* closing the DB */
  7025   7025     stop:
  7026   7026       fprintf (stderr, "*** ERROR: conversion failed\n");
  7027   7027     end:
  7028   7028       sqlite3_close (handle);
  7029   7029       spatialite_cleanup_ex (cache);
  7030         -    spatialite_shutdown ();
  7031   7030       return 0;
  7032   7031   }

Changes to spatialite_dxf.c.

   476    476       else if (unlinked_rings)
   477    477   	special_rings = GAIA_DXF_RING_UNLINKED;
   478    478       dxf = gaiaCreateDxfParser (srid, force_dims, prefix, selected_layer,
   479    479   			       special_rings);
   480    480       if (dxf == NULL)
   481    481   	goto stop;
   482    482   /* attempting to parse the DXF input file */
   483         -    if (gaiaParseDxfFile_r (cache, dxf, dxf_path))
          483  +    if (gaiaParseDxfFile (dxf, dxf_path))
   484    484         {
   485    485   	  /* loading into the DB */
   486    486   	  if (!gaiaLoadFromDxfParser (handle, dxf, mode, append))
   487    487   	      fprintf (stderr, "DB error while loading: %s\n", dxf_path);
   488    488         }
   489    489       else
   490    490   	fprintf (stderr, "Unable to parse: %s\n", dxf_path);
................................................................................
   537    537   	  /* closing the DB connection */
   538    538   	  ret = sqlite3_close (handle);
   539    539   	  if (ret != SQLITE_OK)
   540    540   	      fprintf (stderr, "sqlite3_close() error: %s\n",
   541    541   		       sqlite3_errmsg (handle));
   542    542         }
   543    543       spatialite_cleanup_ex (cache);
   544         -    spatialite_shutdown ();
   545    544       return 0;
   546    545   }

Changes to spatialite_gml.c.

  1937   1937   	  sqlite3_close (handle);
  1938   1938   	  handle = disk_db_handle;
  1939   1939   	  printf ("\tIN_MEMORY database succesfully exported\n");
  1940   1940         }
  1941   1941   
  1942   1942       sqlite3_close (handle);
  1943   1943       spatialite_cleanup_ex (cache);
  1944         -    spatialite_shutdown ();
  1945   1944       return 0;
  1946   1945   }

Changes to spatialite_network.c.

  2119   2119         {
  2120   2120   	  do_help ();
  2121   2121   	  return -1;
  2122   2122         }
  2123   2123       validate (path, table, from_column, to_column, cost_column, geom_column,
  2124   2124   	      name_column, oneway_tofrom, oneway_fromto, bidirectional,
  2125   2125   	      out_table, force_creation, a_star_supported);
  2126         -    spatialite_shutdown ();
  2127   2126       return 0;
  2128   2127   }

Changes to spatialite_osm_filter.c.

  1860   1860   
  1861   1861     stop:
  1862   1862       free (mask);
  1863   1863       sqlite3_close (handle);
  1864   1864       spatialite_cleanup_ex (cache);
  1865   1865       if (out != NULL)
  1866   1866   	fclose (out);
  1867         -    spatialite_shutdown ();
  1868   1867       return 0;
  1869   1868   }

Changes to spatialite_osm_map.c.

  2828   2828   	  printf ("\tIN_MEMORY database succesfully exported\n");
  2829   2829         }
  2830   2830   
  2831   2831   /* VACUUMing */
  2832   2832       db_vacuum (handle);
  2833   2833       sqlite3_close (handle);
  2834   2834       spatialite_cleanup_ex (cache);
  2835         -    spatialite_shutdown ();
  2836   2835       return 0;
  2837   2836   }

Changes to spatialite_osm_net.c.

  2743   2743   	  printf ("\tIN_MEMORY database succesfully exported\n");
  2744   2744         }
  2745   2745   /* VACUUMing */
  2746   2746       db_vacuum (handle);
  2747   2747       sqlite3_close (handle);
  2748   2748       spatialite_cleanup_ex (cache);
  2749   2749       free_params (&params);
  2750         -    spatialite_shutdown ();
  2751   2750       return 0;
  2752   2751   }

Changes to spatialite_osm_raw.c.

  1221   1221   	  handle = disk_db_handle;
  1222   1222   	  printf ("\tIN_MEMORY database succesfully exported\n");
  1223   1223         }
  1224   1224   
  1225   1225   /* closing the DB connection */
  1226   1226       sqlite3_close (handle);
  1227   1227       spatialite_cleanup_ex (cache);
  1228         -    spatialite_shutdown ();
  1229   1228       return 0;
  1230   1229   }

Changes to spatialite_tool.c.

   535    535       if (import && in_dbf)
   536    536   	do_import_dbf (db_path, dbf_path, table, charset);
   537    537       if (import && in_shp)
   538    538   	do_import_shp (db_path, shp_path, table, charset, srid, column,
   539    539   		       coerce2d, compressed);
   540    540       if (export)
   541    541   	do_export (db_path, shp_path, table, column, charset, type);
   542         -    spatialite_shutdown ();
   543    542       return 0;
   544    543   }