[GRASS-dev] Re: new v.in.geonames: problems with UTF-8 Unicode text

Ivan Shmakov ivan at theory.asu.ru
Fri Jul 11 13:12:23 EDT 2008


>>>>> Glynn Clements <glynn at gclements.plus.com> writes:

[...]

 > I have made these changes locally (patch attached).

	BTW, as some of the changes are actually plain clean-ups, could
	they be considered for an ``immediate'' commit?

[...]

 > Index: db/drivers/sqlite/proto.h
 > ===================================================================
 > --- db/drivers/sqlite/proto.h	(revision 32073)
 > +++ db/drivers/sqlite/proto.h	(working copy)
 > @@ -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 */

[...]

 > Index: db/drivers/sqlite/main.c
 > ===================================================================
 > --- db/drivers/sqlite/main.c	(revision 32073)
 > +++ db/drivers/sqlite/main.c	(working copy)
 > @@ -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[])

 >  {
 > Index: db/drivers/sqlite/globals.h
 > ===================================================================
 > --- db/drivers/sqlite/globals.h	(revision 32073)
 > +++ db/drivers/sqlite/globals.h	(working copy)
 > @@ -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

 > Index: db/drivers/sqlite/error.c
 > ===================================================================
 > --- db/drivers/sqlite/error.c	(revision 32073)
 > +++ db/drivers/sqlite/error.c	(working copy)
 > @@ -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);
 >  }



More information about the grass-dev mailing list