[GRASS-SVN] r48016 - grass/trunk/vector/v.external.out

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Sep 1 05:23:39 EDT 2011


Author: martinl
Date: 2011-09-01 02:23:39 -0700 (Thu, 01 Sep 2011)
New Revision: 48016

Modified:
   grass/trunk/vector/v.external.out/format.c
   grass/trunk/vector/v.external.out/list.c
   grass/trunk/vector/v.external.out/local_proto.h
Log:
v.external.out: replace space with underscore in format names (like in v.out.ogr)


Modified: grass/trunk/vector/v.external.out/format.c
===================================================================
--- grass/trunk/vector/v.external.out/format.c	2011-09-01 08:58:40 UTC (rev 48015)
+++ grass/trunk/vector/v.external.out/format.c	2011-09-01 09:23:39 UTC (rev 48016)
@@ -3,9 +3,12 @@
 
 #include "ogr_api.h"
 
-void check_format(const char *format)
+void check_format(char *format)
 {
-    OGRSFDriverH driver = OGRGetDriverByName(format);
+    OGRSFDriverH driver;
+    
+    G_strchg(format, '_', ' ');
+    driver = OGRGetDriverByName(format);
 
     if (!driver)
 	G_fatal_error(_("Format <%s> not supported"), format);

Modified: grass/trunk/vector/v.external.out/list.c
===================================================================
--- grass/trunk/vector/v.external.out/list.c	2011-09-01 08:58:40 UTC (rev 48015)
+++ grass/trunk/vector/v.external.out/list.c	2011-09-01 09:23:39 UTC (rev 48016)
@@ -10,8 +10,10 @@
     char first = TRUE;
     int i;
 
+    OGRSFDriverH driver;
+    
     for (i = 0; i < OGRGetDriverCount(); i++) {
-	OGRSFDriverH driver = OGRGetDriver(i);
+	driver = OGRGetDriver(i);
 
 	if (!OGR_Dr_TestCapability(driver, ODrCCreateDataSource))
 	    continue;
@@ -23,9 +25,9 @@
     p = buf;
 
     for (i = 0; i < OGRGetDriverCount(); i++) {
-	OGRSFDriverH driver = OGRGetDriver(i);
 	const char *name;
 
+	driver = OGRGetDriver(i);
 	if (!OGR_Dr_TestCapability(driver, ODrCCreateDataSource))
 	    continue;
 
@@ -35,6 +37,7 @@
 	    *p++ = ',';
 
 	name = OGR_Dr_GetName(driver);
+	G_strchg(buf, ' ', '_');
 	strcpy(p, name);
 	p += strlen(name);
     }
@@ -51,10 +54,11 @@
     /*         Copyright (c) 1999, Frank Warmerdam                          */
     /* -------------------------------------------------------------------- */
     int iDr;
+    OGRSFDriverH driver;
 
     G_message(_("Supported Formats:"));
     for (iDr = 0; iDr < OGRGetDriverCount(); iDr++) {
-	OGRSFDriverH driver = OGRGetDriver(iDr);
+	driver = OGRGetDriver(iDr);
 
 	if (!OGR_Dr_TestCapability(driver, ODrCCreateDataSource))
 	    continue;

Modified: grass/trunk/vector/v.external.out/local_proto.h
===================================================================
--- grass/trunk/vector/v.external.out/local_proto.h	2011-09-01 08:58:40 UTC (rev 48015)
+++ grass/trunk/vector/v.external.out/local_proto.h	2011-09-01 09:23:39 UTC (rev 48016)
@@ -14,7 +14,7 @@
 		struct _options *, struct _flags*);
 
 /* format.c */
-void check_format(const char *);
+void check_format(char *);
 
 /* link.c */
 void make_link(const char *,



More information about the grass-commit mailing list