[GRASS-CVS] markus: grass6/db/drivers/sqlite create_table.c, 1.2, 1.2.4.1 db.c, 1.3, 1.3.4.1 describe.c, 1.4.4.2, 1.4.4.3 execute.c, 1.4.4.1, 1.4.4.2 fetch.c, 1.3.4.3, 1.3.4.4 grass-sqlite.html, 1.1.2.3, 1.1.2.4 index.c, 1.2, 1.2.4.1 listtab.c, 1.3.4.1, 1.3.4.2 proto.h, 1.1, 1.1.4.1 select.c, 1.5.4.1, 1.5.4.2

grass at intevation.de grass at intevation.de
Sat Nov 24 07:52:31 EST 2007


Author: markus

Update of /grassrepository/grass6/db/drivers/sqlite
In directory doto:/tmp/cvs-serv16759

Modified Files:
      Tag: releasebranch_6_2
	create_table.c db.c describe.c execute.c fetch.c 
	grass-sqlite.html index.c listtab.c proto.h select.c 
Log Message:
less compiler warnings (merge from HEAD)

Index: create_table.c
===================================================================
RCS file: /grassrepository/grass6/db/drivers/sqlite/create_table.c,v
retrieving revision 1.2
retrieving revision 1.2.4.1
diff -u -d -r1.2 -r1.2.4.1
--- create_table.c	9 Feb 2006 03:08:49 -0000	1.2
+++ create_table.c	24 Nov 2007 12:52:29 -0000	1.2.4.1
@@ -1,20 +1,30 @@
-/***********************************************************
-*
-* MODULE:       SQLite driver 
-*   	    	
-* AUTHOR(S):    Radim Blazek
-*
-* COPYRIGHT:    (C) 2005 by the GRASS Development Team
-*
-* This program is free software under the GNU General Public
-* License (>=v2). Read the file COPYING that comes with GRASS
-* for details.
-*
-**************************************************************/
+/**
+ * \file create_table.c
+ *
+ * \brief Low level SQLite table creation.
+ *
+ * This program is free software under the GNU General Public License
+ * (>=v2). Read the file COPYING that comes with GRASS for details.
+ *
+ * \author Radim Blazek
+ *
+ * \date 2005-2007
+ */
+
 #include <grass/dbmi.h>
 #include "globals.h"
 #include "proto.h"
 
+
+/**
+ * \fn int db__driver_create_table (dbTable *table)
+ *
+ * \brief SQLite create table.
+ *
+ * \param[in] table
+ * \return int DB_FAILED on error; DB_OK on success
+ */
+
 int
 db__driver_create_table (dbTable *table)
 {
@@ -24,7 +34,7 @@
     int sqltype;
     sqlite3_stmt *statement;
     dbString sql;
-    char  *rest;
+    const char *rest;
     int   ret;
     
     G_debug (3, "db__driver_create_table()");
@@ -88,7 +98,7 @@
         append_error( "Cannot create table:\n");
         append_error( db_get_string(&sql) );
         append_error( "\n" );
-        append_error ( sqlite3_errmsg(sqlite) );
+        append_error ((char *) sqlite3_errmsg (sqlite));
         report_error();
         sqlite3_finalize ( statement );
         db_free_string ( &sql);
@@ -100,7 +110,7 @@
     if ( ret != SQLITE_DONE )
     {
         append_error("Error in sqlite3_step():\n");
-        append_error ( sqlite3_errmsg(sqlite) );
+        append_error ((char *) sqlite3_errmsg (sqlite));
         report_error( );
         return DB_FAILED;
     }

Index: db.c
===================================================================
RCS file: /grassrepository/grass6/db/drivers/sqlite/db.c,v
retrieving revision 1.3
retrieving revision 1.3.4.1
diff -u -d -r1.3 -r1.3.4.1
--- db.c	9 Feb 2006 03:08:49 -0000	1.3
+++ db.c	24 Nov 2007 12:52:29 -0000	1.3.4.1
@@ -1,16 +1,16 @@
-/***********************************************************
-*
-* MODULE:       SQLite driver 
-*   	    	
-* AUTHOR(S):    Radim Blazek
-*
-* COPYRIGHT:    (C) 2005 by the GRASS Development Team
-*
-* This program is free software under the GNU General Public
-* License (>=v2). Read the file COPYING that comes with GRASS
-* for details.
-*
-**************************************************************/
+/**
+ * \file db.c
+ *
+ * \brief Low Level SQLite databse driver.
+ *
+ * This program is free software under the GNU General Public License
+ * (>=v2). Read the file COPYING that comes with GRASS for details.
+ *
+ * \author Radim Blazek
+ *
+ * \date 2005-2007
+ */
+
 #include <stdlib.h>
 #include <string.h>
 #include <grass/gis.h>
@@ -18,6 +18,16 @@
 #include "globals.h"
 #include "proto.h"
 
+
+/**
+ * \fn int db__driver_open_database (dbHandle *handle)
+ *
+ * \brief Open SQLite database.
+ *
+ * \param[in,out] handle database handle
+ * \return int DB_FAILED on error; DB_OK on success
+ */
+
 int db__driver_open_database (dbHandle *handle)
 
 {
@@ -77,7 +87,7 @@
 
     if ( sqlite3_open(name2,&sqlite) != SQLITE_OK ) {
 	append_error ( "Cannot open database: " );
-        append_error ( sqlite3_errmsg(sqlite) );
+        append_error ((char *) sqlite3_errmsg (sqlite));
 	report_error ();
 	return DB_FAILED;
     }
@@ -85,11 +95,21 @@
     return DB_OK;
 }
 
-int db__driver_close_database()
+
+/**
+ * \fn int db__driver_close_database (void)
+ *
+ * \brief Close SQLite database.
+ *
+ * \return int always returns DB_OK
+ */
+
+int db__driver_close_database (void)
 {
     G_debug(3, "db_close_database()" );
 
     init_error();
     sqlite3_close ( sqlite );
+
     return DB_OK;
 }

Index: describe.c
===================================================================
RCS file: /grassrepository/grass6/db/drivers/sqlite/describe.c,v
retrieving revision 1.4.4.2
retrieving revision 1.4.4.3
diff -u -d -r1.4.4.2 -r1.4.4.3
--- describe.c	1 Jul 2007 22:24:59 -0000	1.4.4.2
+++ describe.c	24 Nov 2007 12:52:29 -0000	1.4.4.3
@@ -1,29 +1,42 @@
-/***********************************************************
-*
-* MODULE:       SQLite driver 
-*   	    	
-* AUTHOR(S):    Radim Blazek
-*
-* COPYRIGHT:    (C) 2005 by the GRASS Development Team
-*
-* This program is free software under the GNU General Public
-* License (>=v2). Read the file COPYING that comes with GRASS
-* for details.
-*
-**************************************************************/
+/**
+ * \file describe.c
+ *
+ * \brief Low level SQLite database driver.
+ *
+ * This program is free software under the GNU General Public License
+ * (>=v2). Read the file COPYING that comes with GRASS for details.
+ *
+ * \author Radim Blazek
+ *
+ * \date 2005-2007
+ */
+
 #include <string.h>
 #include <grass/dbmi.h>
 #include <grass/datetime.h>
+#include <grass/glocale.h>
 #include "globals.h"
 #include "proto.h"
-#include <grass/glocale.h>
 
-int db__driver_describe_table (dbString *table_name, dbTable **table)
+/* function prototypes */
+static int affinity_type (const char *);
+
 
+/**
+ * \fn int db__driver_describe_table (dbString *table_name, dbTable **table)
+ *
+ * \brief Low level SQLite describe database table.
+ *
+ * \param[in] table_name
+ * \param[in] table
+ * \return int DB_FAILED on error; DB_OK on success
+ */
+
+int db__driver_describe_table (dbString *table_name, dbTable **table)
 {
     dbString sql;
     sqlite3_stmt *statement;
-    char  *rest;
+    const char *rest;
     int   ret;
 
     db_init_string ( &sql );
@@ -35,13 +48,12 @@
     ret = sqlite3_prepare ( sqlite, db_get_string(&sql), -1,
                             &statement, &rest );
 
-
     if ( ret != SQLITE_OK )
     {
         append_error("Error in sqlite3_prepare():");
         append_error( db_get_string(&sql) );
         append_error( "\n" );
-        append_error ( sqlite3_errmsg(sqlite) );
+        append_error ((char *) sqlite3_errmsg (sqlite));
         report_error( );
         db_free_string ( &sql );
         return DB_FAILED;
@@ -61,7 +73,20 @@
     return DB_OK;
 }
 
-/* describe table, if c is not NULL cur->cols and cur->ncols is also set */
+
+/**
+ * \fn int describe_table (sqlite3_stmt *statement, dbTable **table, cursor *c)
+ *
+ * \brief SQLite describe table.
+ *
+ * NOTE: If <b>c</b> is not NULL c->cols and c->ncols are also set.
+ *
+ * \param[in] statement
+ * \param[in] table
+ * \param[in] c SQLite cursor. See NOTE.
+ * \return int DB_FAILED on error; DB_OK on success
+ */
+
 int describe_table( sqlite3_stmt *statement, 
 			dbTable **table, cursor *c)
 {
@@ -195,6 +220,18 @@
     return DB_OK;
 }
 
+
+/**
+ * \fn void get_column_info (sqlite3_stmt *statement, int col, int *litetype, int *sqltype)
+ *
+ * \brief Low level SQLite get column information.
+ *
+ * \param[in] statement
+ * \param[in] col
+ * \param[in,out] litetype
+ * \param[in,out] sqltype
+ */
+
 void get_column_info ( sqlite3_stmt *statement, int col, 
 		int *litetype, int *sqltype )
 {
@@ -257,7 +294,7 @@
 *   4. Otherwise, the affinity is NUMERIC.
 */
 
-int affinity_type ( const char *declared )
+static int affinity_type (const char *declared)
 {
     char *lc;
     int aff = SQLITE_FLOAT;

Index: execute.c
===================================================================
RCS file: /grassrepository/grass6/db/drivers/sqlite/execute.c,v
retrieving revision 1.4.4.1
retrieving revision 1.4.4.2
diff -u -d -r1.4.4.1 -r1.4.4.2
--- execute.c	4 Jun 2007 11:55:25 -0000	1.4.4.1
+++ execute.c	24 Nov 2007 12:52:29 -0000	1.4.4.2
@@ -1,29 +1,39 @@
-/***********************************************************
-*
-* MODULE:       SQLite driver 
-*   	    	
-* AUTHOR(S):    Radim Blazek
-*               Transactions by Antonio Galea
-*
-* COPYRIGHT:    (C) 2005 by the GRASS Development Team
-*
-* This program is free software under the GNU General Public
-* License (>=v2). Read the file COPYING that comes with GRASS
-* for details.
-*
-**************************************************************/
+/**
+ * \file execute.c
+ *
+ * \brief Low level SQLite sql execute.
+ *
+ * This program is free software under the GNU General Public License
+ * (>=v2). Read the file COPYING that comes with GRASS for details.
+ *
+ * \author Radim Blazek
+ * \author Antonio Galea
+ *
+ * \date 2005-2007
+ */
+
 #include <stdlib.h>
 #include <grass/gis.h>
 #include <grass/dbmi.h>
 #include "globals.h"
 #include "proto.h"
 
+
+/**
+ * \fn int db__driver_execute_immediate (dbString *sql)
+ *
+ * \brief Low level SQLite execute sql text.
+ *
+ * \param[in] sql SQL statement
+ * \return int DB_FAILED on error; DB_OK on success
+ */
+
 int db__driver_execute_immediate(dbString *sql)
 {
     char *s;
     int  ret;
     sqlite3_stmt *stmt;
-    char *rest = NULL;
+    const char *rest;
 
     s = db_get_string (sql);
 
@@ -34,7 +44,7 @@
     if ( ret != SQLITE_OK )
     {
         append_error("Error in sqlite3_prepare():\n");
-	append_error ( sqlite3_errmsg(sqlite) );
+	append_error ((char *) sqlite3_errmsg (sqlite));
         report_error( );
         return DB_FAILED;
     }
@@ -44,7 +54,7 @@
     if ( ret != SQLITE_DONE )
     {
         append_error("Error in sqlite3_step():\n");
-	append_error ( sqlite3_errmsg(sqlite) );
+	append_error ((char *) sqlite3_errmsg (sqlite));
         report_error( );
         return DB_FAILED;
     }
@@ -54,7 +64,7 @@
      if ( ret != SQLITE_OK )
      {
 	 append_error("Error in sqlite3_finalize():\n");
-	 append_error ( sqlite3_errmsg(sqlite) );
+	 append_error ((char *) sqlite3_errmsg (sqlite));
 	 report_error( );
 	 return DB_FAILED;
      }
@@ -65,7 +75,16 @@
      */
      
      return DB_OK;
- }
+}
+
+
+/**
+ * \fn int db__driver_begin_transaction (void)
+ *
+ * \brief Low level SQLite begin SQL transaction.
+ *
+ * \return int DB_FAILED on error; DB_OK on success
+ */
 
 int db__driver_begin_transaction(void)
 {
@@ -76,7 +95,7 @@
    if ( ret != SQLITE_OK )
    {
       append_error("Cannot 'BEGIN' transaction:\n");
-      append_error ( sqlite3_errmsg(sqlite) );
+      append_error ((char *) sqlite3_errmsg (sqlite));
       report_error( );
       return DB_FAILED;
    }
@@ -84,6 +103,15 @@
    return DB_OK;
 }
 
+
+/**
+ * \fn int db__driver_commit_transaction (void)
+ *
+ * \brief Low level SQLite commit transaction.
+ *
+ * \return int DB_FAILED on error; DB_OK on success
+ */
+
 int db__driver_commit_transaction(void)
 {
    int  ret;
@@ -93,12 +121,10 @@
    if ( ret != SQLITE_OK )
    {
        append_error("Cannot 'COMMIT' transaction:\n");
-       append_error ( sqlite3_errmsg(sqlite) );
+       append_error ((char *) sqlite3_errmsg (sqlite));
        report_error( );
        return DB_FAILED;
    }
 
    return DB_OK;
 }
-
-

Index: fetch.c
===================================================================
RCS file: /grassrepository/grass6/db/drivers/sqlite/fetch.c,v
retrieving revision 1.3.4.3
retrieving revision 1.3.4.4
diff -u -d -r1.3.4.3 -r1.3.4.4
--- fetch.c	1 Jul 2007 22:24:59 -0000	1.3.4.3
+++ fetch.c	24 Nov 2007 12:52:29 -0000	1.3.4.4
@@ -1,26 +1,40 @@
-/***********************************************************
-*
-* MODULE:       SQLite driver 
-*   	    	
-* AUTHOR(S):    Radim Blazek
-*
-* COPYRIGHT:    (C) 2005 by the GRASS Development Team
-*
-* This program is free software under the GNU General Public
-* License (>=v2). Read the file COPYING that comes with GRASS
-* for details.
-*
-**************************************************************/
+/**
+ * \file fetch.c
+ *
+ * \brief Low level SQLite database functions.
+ *
+ * This program is free software under the GNU General Public License
+ * (>=v2). Read the file COPYING that comes with GRASS for details.
+ *
+ * \author Radim Blazek
+ *
+ * \date 2005-2007
+ */
+
 #include <stdlib.h>
 #include <string.h>
 #include <grass/dbmi.h>
+#include <grass/glocale.h>
 #include "globals.h"
 #include "proto.h" 
-#include <grass/glocale.h>
+
+
+/**
+ * \fn int db__driver_fetch (dbCursor *cn, int position, int *more)
+ *
+ * \brief Low level SQLite database table record fetch.
+ *
+ * NOTE: <b>position</b> is one of:
+ * DB_NEXT, DB_FIRST, DB_CURRENT, DB_PREVIOUS, DB_LAST.
+ *
+ * \param[in] cn open database cursor
+ * \param[in] position database position. See NOTE.
+ * \param[in,out] more 1 = more data; 0 = no more data
+ * \return int
+ */
 
 int
 db__driver_fetch (dbCursor *cn, int position, int *more)
-
 {
     cursor     *c;
     dbToken    token;    
@@ -55,7 +69,7 @@
 		if ( ret != SQLITE_DONE ) 
 		{
 		    append_error ("Cannot step:\n");
-		    append_error ( sqlite3_errmsg(sqlite) );
+		    append_error ((char *) sqlite3_errmsg (sqlite));
 		    report_error();
 		    return DB_FAILED;
 		}
@@ -133,11 +147,11 @@
 		if (sqltype == 6 ) { /* date string */
 		   /* Example: '1999-01-25' */
 		   G_debug(3, "sqlite fetched date: %s",sqlite3_column_text ( c->statement, col));
-		   ns = sscanf( sqlite3_column_text ( c->statement, col), "%4d-%2d-%2d",
+		   ns = sscanf((char *) sqlite3_column_text ( c->statement, col), "%4d-%2d-%2d",
                              &(value->t.year), &(value->t.month), &(value->t.day) );
 		   if ( ns != 3 ) {
 			append_error ( "Cannot scan date:");
-			append_error ( sqlite3_column_text ( c->statement, col) );
+			append_error ((char *) sqlite3_column_text (c->statement, col));
 			report_error();
 			return DB_FAILED;
                    }
@@ -145,8 +159,7 @@
                    value->t.minute = 0;
                    value->t.seconds = 0.0;
 		} else { /* other string */
-		    db_set_string ( &(value->s),
-				sqlite3_column_text ( c->statement, col) );
+		    db_set_string ( &(value->s), (char *) sqlite3_column_text ( c->statement, col));
 		}
 		break;
 
@@ -169,6 +182,16 @@
     return DB_OK;
 }
 
+
+/**
+ * \fn int db__driver_get_num_rows (dbCursor *cn)
+ *
+ * \brief Gets number of rows in SQLite database table.
+ *
+ * \param[in] cn open database cursor
+ * \return int number of rows in table
+ */
+
 int
 db__driver_get_num_rows  (dbCursor *cn)
 
@@ -217,4 +240,3 @@
 
     return ( c->nrows );
 }
-

Index: grass-sqlite.html
===================================================================
RCS file: /grassrepository/grass6/db/drivers/sqlite/grass-sqlite.html,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -d -r1.1.2.3 -r1.1.2.4
--- grass-sqlite.html	11 Apr 2007 12:26:12 -0000	1.1.2.3
+++ grass-sqlite.html	24 Nov 2007 12:52:29 -0000	1.1.2.4
@@ -74,6 +74,7 @@
 
 <em><a href="http://www.sqlite.org">SQLite web site</a>,
 <a href="http://www.sqlite.org/quickstart.html">SQLite manual</a>,
+<a HREF="db.connect.html">db.connect</a>,
 <a HREF="db.execute.html">db.execute</a>,
 <a HREF="sql.html">SQL support in GRASS GIS</a>,
 <a HREF="http://www.sqlite.org/cvstrac/wiki?p=ManagementTools">sqlite - Management Tools</a>

Index: index.c
===================================================================
RCS file: /grassrepository/grass6/db/drivers/sqlite/index.c,v
retrieving revision 1.2
retrieving revision 1.2.4.1
diff -u -d -r1.2 -r1.2.4.1
--- index.c	9 Feb 2006 03:08:49 -0000	1.2
+++ index.c	24 Nov 2007 12:52:29 -0000	1.2.4.1
@@ -1,27 +1,37 @@
-/***********************************************************
-*
-* MODULE:       SQLite driver 
-*   	    	
-* AUTHOR(S):    Radim Blazek
-*
-* COPYRIGHT:    (C) 2005 by the GRASS Development Team
-*
-* This program is free software under the GNU General Public
-* License (>=v2). Read the file COPYING that comes with GRASS
-* for details.
-*
-**************************************************************/
+/**
+ * \file index.c
+ *
+ * \brief Low level SQLite database index functions.
+ *
+ * This program is free software under the GNU General Public License
+ * (>=v2). Read the file COPYING that comes with GRASS for details.
+ *
+ * \author Radim Blazek
+ *
+ * \date 2005-2007
+ */
+
 #include <grass/dbmi.h>
 #include "globals.h"
 #include "proto.h"
 
+
+/**
+ * \fn int db__driver_create_index (dbIndex *index)
+ *
+ * \brief Create SQLite database index.
+ *
+ * \param[in] index index to be created
+ * \return int DB_FAILED on error; DB_OK on success
+ */
+
 int
 db__driver_create_index ( dbIndex *index )
 {
     int i, ncols;
     sqlite3_stmt *statement;
     dbString sql;
-    char  *rest;
+    const char *rest;
     int   ret;
     
     G_debug (3, "db__create_index()");
@@ -61,7 +71,7 @@
         append_error( "Cannot create index:\n");
 	append_error( db_get_string(&sql) );
 	append_error( "\n" );
-	append_error ( sqlite3_errmsg(sqlite) );
+	append_error ((char *) sqlite3_errmsg (sqlite));
 	report_error();
         sqlite3_finalize ( statement );
 	db_free_string ( &sql);
@@ -73,7 +83,7 @@
     if ( ret != SQLITE_DONE )
     {
         append_error("Error in sqlite3_step():\n");
-        append_error ( sqlite3_errmsg(sqlite) );
+        append_error ((char *) sqlite3_errmsg (sqlite));
         report_error( );
         return DB_FAILED;
     }

Index: listtab.c
===================================================================
RCS file: /grassrepository/grass6/db/drivers/sqlite/listtab.c,v
retrieving revision 1.3.4.1
retrieving revision 1.3.4.2
diff -u -d -r1.3.4.1 -r1.3.4.2
--- listtab.c	4 May 2007 09:48:22 -0000	1.3.4.1
+++ listtab.c	24 Nov 2007 12:52:29 -0000	1.3.4.2
@@ -1,29 +1,40 @@
-/***********************************************************
-*
-* MODULE:       SQLite driver 
-*   	    	
-* AUTHOR(S):    Radim Blazek
-*
-* COPYRIGHT:    (C) 2005 by the GRASS Development Team
-*
-* This program is free software under the GNU General Public
-* License (>=v2). Read the file COPYING that comes with GRASS
-* for details.
-*
-**************************************************************/
+/**
+ * \file listtab.c
+ *
+ * \brief Low level SQLite table functions.
+ *
+ * This program is free software under the GNU General Public License
+ * (>=v2). Read the file COPYING that comes with GRASS for details.
+ *
+ * \author Radim Blazek
+ *
+ * \date 2005-2007
+ */
+
 #include <stdlib.h>
 #include <string.h>
 #include <grass/dbmi.h>
 #include "globals.h"
 #include "proto.h"
 
-int db__driver_list_tables (dbString **tlist, int *tcount, int system)
 
+/**
+ * \fn int db__driver_list_tables (dbString **tlist, int *tcount, int system)
+ *
+ * \brief List SQLite database tables.
+ *
+ * \param[in] tlist list of tables
+ * \param[in] tcount number of tables
+ * \param[in] system
+ * \return int DB_FAILED on error; DB_OK on success
+ */
+
+int db__driver_list_tables (dbString **tlist, int *tcount, int system)
 {
     int i, nrows;
     dbString *list;
     sqlite3_stmt *statement;
-    char  *rest;
+    const char *rest;
     int   ret;
 
     init_error();
@@ -34,7 +45,7 @@
 
     if ( ret != SQLITE_OK ) {
         append_error( "Cannot list tables\n");
-        append_error ( sqlite3_errmsg(sqlite) );
+        append_error ((char *) sqlite3_errmsg (sqlite));
         report_error();
         sqlite3_finalize ( statement );
         return DB_FAILED;
@@ -61,8 +72,7 @@
     while ( sqlite3_step ( statement ) == SQLITE_ROW )
     {
         G_debug ( 3, "table: %s", sqlite3_column_text ( statement, 0) );
-	db_set_string ( &list[i], 
-		sqlite3_column_text ( statement, 0) );
+	    db_set_string (&list[i], (char *) sqlite3_column_text (statement, 0));
         i++;
     }
 

Index: proto.h
===================================================================
RCS file: /grassrepository/grass6/db/drivers/sqlite/proto.h,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -u -d -r1.1 -r1.1.4.1
--- proto.h	16 Sep 2005 08:23:43 -0000	1.1
+++ proto.h	24 Nov 2007 12:52:29 -0000	1.1.4.1
@@ -1,3 +1,6 @@
+#ifndef __SQLITE_PROTO_H__
+#define __SQLITE_PROTO_H__
+
 /* error.c */
 void init_error ( void );
 void append_error ( char * );
@@ -10,4 +13,5 @@
 /* describe.c*/
 int describe_table ( sqlite3_stmt *, dbTable **, cursor * );
 void get_column_info ( sqlite3_stmt *, int, int *, int * );
-int affinity_type ( const char * );
+
+#endif /* __SQLITE_PROTO_H__ */

Index: select.c
===================================================================
RCS file: /grassrepository/grass6/db/drivers/sqlite/select.c,v
retrieving revision 1.5.4.1
retrieving revision 1.5.4.2
diff -u -d -r1.5.4.1 -r1.5.4.2
--- select.c	4 May 2007 09:48:22 -0000	1.5.4.1
+++ select.c	24 Nov 2007 12:52:29 -0000	1.5.4.2
@@ -1,24 +1,35 @@
-/***********************************************************
-*
-* MODULE:       SQLite driver 
-*   	    	
-* AUTHOR(S):    Radim Blazek
-*
-* COPYRIGHT:    (C) 2005 by the GRASS Development Team
-*
-* This program is free software under the GNU General Public
-* License (>=v2). Read the file COPYING that comes with GRASS
-* for details.
-*
-**************************************************************/
+/**
+ * \file select.c
+ *
+ * \brief Low level SQLite database functions.
+ *
+ * This program is free software under the GNU General Public License
+ * (>=v2). Read the file COPYING that comes with GRASS for details.
+ *
+ * \author Radim Blazek
+ *
+ * \date 2005-2007
+ */
+
 #include <stdlib.h>
 #include <grass/dbmi.h>
 #include <grass/gis.h>
 #include "globals.h"
 #include "proto.h"
 
-int db__driver_open_select_cursor (dbString *sel, dbCursor *dbc, int mode)
 
+/**
+ * \fn int db__driver_open_select_cursor (dbString *sel, dbCursor *dbc, int mode)
+ *
+ * \brief Open SQLite cursor for select.
+ *
+ * \param[in] sel
+ * \param[in,out] dbc
+ * \param[in] mode
+ * \return int DB_FAILED on error; DB_OK on success
+ */
+
+int db__driver_open_select_cursor (dbString *sel, dbCursor *dbc, int mode)
 {
     cursor   *c;
     dbTable  *table;
@@ -51,7 +62,7 @@
         append_error("Error in sqlite3_prepare():");
 	append_error(db_get_string(sel) );
 	append_error( "\n" );
-        append_error ( sqlite3_errmsg(sqlite) );
+        append_error ((char *) sqlite3_errmsg (sqlite));
         report_error( );
         return DB_FAILED;
     }




More information about the grass-commit mailing list