[GRASS-SVN] r32252 - grass/branches/develbranch_6/db/drivers/sqlite

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jul 24 06:15:16 EDT 2008


Author: neteler
Date: 2008-07-24 06:15:16 -0400 (Thu, 24 Jul 2008)
New Revision: 32252

Modified:
   grass/branches/develbranch_6/db/drivers/sqlite/error.c
   grass/branches/develbranch_6/db/drivers/sqlite/globals.h
   grass/branches/develbranch_6/db/drivers/sqlite/main.c
   grass/branches/develbranch_6/db/drivers/sqlite/proto.h
Log:
glynn: Clean-up (merge from trunk)

Modified: grass/branches/develbranch_6/db/drivers/sqlite/error.c
===================================================================
--- grass/branches/develbranch_6/db/drivers/sqlite/error.c	2008-07-24 09:02:39 UTC (rev 32251)
+++ grass/branches/develbranch_6/db/drivers/sqlite/error.c	2008-07-24 10:15:16 UTC (rev 32252)
@@ -14,8 +14,11 @@
 #include <stdio.h>
 #include <grass/gis.h>
 #include <grass/dbmi.h>
+#include "proto.h"
 #include "globals.h"
 
+static dbString *errMsg = NULL; /* error message */
+
 /* init error message */
 void
 init_error ( void )
@@ -30,7 +33,7 @@
 
 /* append error message */
 void
-append_error ( char *msg )
+append_error ( const char *msg )
 {
     db_append_string ( errMsg, msg);
 }

Modified: grass/branches/develbranch_6/db/drivers/sqlite/globals.h
===================================================================
--- grass/branches/develbranch_6/db/drivers/sqlite/globals.h	2008-07-24 09:02:39 UTC (rev 32251)
+++ grass/branches/develbranch_6/db/drivers/sqlite/globals.h	2008-07-24 10:15:16 UTC (rev 32252)
@@ -1,5 +1,8 @@
 #include <sqlite3.h>
 
+#ifndef DBMI_SQLITE_PROTO_H
+#define DBMI_SQLITE_PROTO_H
+
 /* cursors */
 typedef struct _cursor {
     sqlite3_stmt *statement;
@@ -12,12 +15,7 @@
 
 } cursor;  
 
-#ifdef MAIN
-    sqlite3 *sqlite;
-    dbString *errMsg = NULL; /* error message */
-#else
-    extern sqlite3 *sqlite;
-    extern dbString *errMsg;
-#endif 
+extern sqlite3 *sqlite;
 
+#endif
 

Modified: grass/branches/develbranch_6/db/drivers/sqlite/main.c
===================================================================
--- grass/branches/develbranch_6/db/drivers/sqlite/main.c	2008-07-24 09:02:39 UTC (rev 32251)
+++ grass/branches/develbranch_6/db/drivers/sqlite/main.c	2008-07-24 10:15:16 UTC (rev 32252)
@@ -11,12 +11,14 @@
 * for details.
 *
 **************************************************************/
-#define MAIN
+
 #include <stdlib.h>
 #include <grass/dbmi.h>
 #include "globals.h"
 #include "dbdriver.h"
 
+sqlite3 *sqlite;
+
 int main (int argc, char *argv[])
 
 {

Modified: grass/branches/develbranch_6/db/drivers/sqlite/proto.h
===================================================================
--- grass/branches/develbranch_6/db/drivers/sqlite/proto.h	2008-07-24 09:02:39 UTC (rev 32251)
+++ grass/branches/develbranch_6/db/drivers/sqlite/proto.h	2008-07-24 10:15:16 UTC (rev 32252)
@@ -1,9 +1,11 @@
 #ifndef __SQLITE_PROTO_H__
 #define __SQLITE_PROTO_H__
 
+#include "globals.h"
+
 /* error.c */
 void init_error ( void );
-void append_error ( char * );
+void append_error ( const char * );
 void report_error ( void );
 
 /* cursor.c */



More information about the grass-commit mailing list