Parcourir la source

dbmilib: initial doxygenization of dbmi_driver (merge from devbr6, https://trac.osgeo.org/grass/changeset/32636)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@32637 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa il y a 17 ans
Parent
commit
57f2f1d296
38 fichiers modifiés avec 740 ajouts et 192 suppressions
  1. 1 1
      lib/db/dbmi_client/c_drop_col.c
  2. 1 1
      lib/db/dbmi_client/c_execute.c
  3. 1 2
      lib/db/dbmi_client/c_list_tabs.c
  4. 0 1
      lib/db/dbmi_client/c_openupdate.c
  5. 1 1
      lib/db/dbmi_client/c_priv.c
  6. 20 6
      lib/db/dbmi_driver/d_add_col.c
  7. 21 2
      lib/db/dbmi_driver/d_begin_work.x
  8. 18 4
      lib/db/dbmi_driver/d_bindupdate.c
  9. 20 6
      lib/db/dbmi_driver/d_close_cur.c
  10. 20 6
      lib/db/dbmi_driver/d_closedb.c
  11. 20 6
      lib/db/dbmi_driver/d_create_idx.c
  12. 19 5
      lib/db/dbmi_driver/d_create_tab.c
  13. 19 5
      lib/db/dbmi_driver/d_createdb.c
  14. 19 5
      lib/db/dbmi_driver/d_delete.c
  15. 19 5
      lib/db/dbmi_driver/d_deletedb.c
  16. 19 5
      lib/db/dbmi_driver/d_desc_table.c
  17. 19 5
      lib/db/dbmi_driver/d_drop_col.c
  18. 19 5
      lib/db/dbmi_driver/d_drop_index.c
  19. 18 4
      lib/db/dbmi_driver/d_drop_tab.c
  20. 30 14
      lib/db/dbmi_driver/d_execute.c
  21. 18 5
      lib/db/dbmi_driver/d_fetch.c
  22. 19 5
      lib/db/dbmi_driver/d_finddb.c
  23. 20 6
      lib/db/dbmi_driver/d_insert.c
  24. 19 5
      lib/db/dbmi_driver/d_list_idx.c
  25. 19 5
      lib/db/dbmi_driver/d_list_tabs.c
  26. 19 5
      lib/db/dbmi_driver/d_listdb.c
  27. 23 5
      lib/db/dbmi_driver/d_mkdir.c
  28. 19 5
      lib/db/dbmi_driver/d_opendb.c
  29. 19 5
      lib/db/dbmi_driver/d_openinsert.c
  30. 19 5
      lib/db/dbmi_driver/d_openselect.c
  31. 19 5
      lib/db/dbmi_driver/d_openupdate.c
  32. 20 5
      lib/db/dbmi_driver/d_priv.c
  33. 19 5
      lib/db/dbmi_driver/d_rows.c
  34. 20 6
      lib/db/dbmi_driver/d_update.c
  35. 20 6
      lib/db/dbmi_driver/d_version.c
  36. 19 21
      lib/db/dbmi_driver/driver.c
  37. 45 3
      lib/db/dbmi_driver/driver_state.c
  38. 80 1
      lib/db/dbmilib.dox

+ 1 - 1
lib/db/dbmi_client/c_drop_col.c

@@ -16,7 +16,7 @@
 #include "macros.h"
 
 /*!
-  \brief driver db driver
+  \brief Drop column
 
   \param driver db driver
   \param tableName table name

+ 1 - 1
lib/db/dbmi_client/c_execute.c

@@ -48,7 +48,7 @@ int db_execute_immediate(dbDriver * driver, dbString * SQLstatement)
 /*!
   \brief Begin transaction
 
-  \return driver db driver
+  \param driver db driver
 
   \return DB_OK on success
   \return DB_FAILED on failure

+ 1 - 2
lib/db/dbmi_client/c_list_tabs.c

@@ -36,8 +36,7 @@ static int cmp_dbstr(const void *pa, const void *pb)
    \return DB_OK on success
    \return DB_FAILED on failure
  */
-int
-db_list_tables(dbDriver * driver, dbString ** names, int *count, int system)
+int db_list_tables(dbDriver * driver, dbString ** names, int *count, int system)
 {
     int ret_code;
 

+ 0 - 1
lib/db/dbmi_client/c_openupdate.c

@@ -27,7 +27,6 @@
   \return DB_OK on success
   \return DB_FAILED on failure
  */
-
 int db_open_update_cursor(dbDriver * driver, dbString * table_name,
 			  dbString * select, dbCursor * cursor, int mode)
 {

+ 1 - 1
lib/db/dbmi_client/c_priv.c

@@ -16,7 +16,7 @@
 #include "macros.h"
 
 /*!
-  \brief Grant privileges 
+  \brief Grant privileges on table
 
   \param driver db driver
   \param tableName table name

+ 20 - 6
lib/db/dbmi_driver/d_add_col.c

@@ -1,15 +1,29 @@
+/*!
+ * \file db/dbmi_driver/d_add_col.c
+ * 
+ * \brief DBMI Library (driver) - add column to table
+ *
+ * (C) 1999-2008 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.
+ *
+ * \author Joel Jones (CERL/UIUC), Radim Blazek
+ */
+
 #include <stdlib.h>
 #include <grass/dbmi.h>
 #include "macros.h"
 #include "dbstubs.h"
 
 /*!
-   \fn 
-   \brief 
-   \return 
-   \param 
- */
-int db_d_add_column()
+   \brief Add column to table
+
+   \return DB_OK on success
+   \return DB_FAILED on failure
+*/
+int db_d_add_column(void)
 {
     dbColumn column;
     dbString name;

+ 21 - 2
lib/db/dbmi_driver/d_begin_work.x

@@ -1,8 +1,27 @@
+/*!
+ * \file db/dbmi_driver/d_begin_work.c
+ * 
+ * \brief DBMI Library (driver) - ?
+ *
+ * (C) 1999-2008 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.
+ *
+ * \author Joel Jones (CERL/UIUC), Radim Blazek
+ */
+
 #include "dbmi.h"
 #include "macros.h"
 
-int
-db_d_begin_work()
+/*!
+   \brief ?
+
+   \return DB_OK on success
+   \return DB_FAILED on failure
+*/
+int db_d_begin_work(void)
 {
     int stat;
     int result;

+ 18 - 4
lib/db/dbmi_driver/d_bindupdate.c

@@ -1,12 +1,26 @@
+/*!
+ * \file db/dbmi_driver/d_bindupdate.c
+ * 
+ * \brief DBMI Library (driver) - bind update
+ *
+ * (C) 1999-2008 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.
+ *
+ * \author Joel Jones (CERL/UIUC), Radim Blazek
+ */
+
 #include <grass/dbmi.h>
 #include "macros.h"
 #include "dbstubs.h"
 
 /*!
-   \fn 
-   \brief 
-   \return 
-   \param 
+  \brief ADD
+
+  \return DB_OK on success
+  \return DB_FAILED on failure
  */
 int db_d_bind_update()
 {

+ 20 - 6
lib/db/dbmi_driver/d_close_cur.c

@@ -1,15 +1,29 @@
+/*!
+ * \file db/dbmi_driver/d_close_cur.c
+ * 
+ * \brief DBMI Library (driver) - close cursor
+ *
+ * (C) 1999-2008 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.
+ *
+ * \author Joel Jones (CERL/UIUC), Radim Blazek
+ */
+
 #include <stdlib.h>
 #include <grass/dbmi.h>
 #include "macros.h"
 #include "dbstubs.h"
 
 /*!
-   \fn 
-   \brief 
-   \return 
-   \param 
- */
-int db_d_close_cursor()
+  \brief Close cursor
+  
+  \return DB_OK on success
+  \return DB_FAILED on failure
+*/
+int db_d_close_cursor(void)
 {
     dbCursor *cursor;
     dbToken token;

+ 20 - 6
lib/db/dbmi_driver/d_closedb.c

@@ -1,14 +1,28 @@
+/*!
+ * \file db/dbmi_driver/d_closedb.c
+ * 
+ * \brief DBMI Library (driver) - close database connection
+ *
+ * (C) 1999-2008 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.
+ *
+ * \author Joel Jones (CERL/UIUC), Radim Blazek
+ */
+
 #include <grass/dbmi.h>
 #include "macros.h"
 #include "dbstubs.h"
 
 /*!
-   \fn 
-   \brief 
-   \return 
-   \param 
- */
-int db_d_close_database()
+  \brief Close database connection
+
+  \return DB_OK on success
+  \return DB_FAILED on failure
+*/
+int db_d_close_database(void)
 {
     int stat;
 

+ 20 - 6
lib/db/dbmi_driver/d_create_idx.c

@@ -1,15 +1,29 @@
+/*!
+ * \file db/dbmi_driver/d_create_idx.c
+ * 
+ * \brief DBMI Library (driver) - create index
+ *
+ * (C) 1999-2008 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.
+ *
+ * \author Joel Jones (CERL/UIUC), Radim Blazek
+ */
+
 #include <stdlib.h>
 #include <grass/dbmi.h>
 #include "macros.h"
 #include "dbstubs.h"
 
 /*!
-   \fn 
-   \brief 
-   \return 
-   \param 
- */
-int db_d_create_index()
+  \brief Create index
+
+  \return DB_OK on success
+  \return DB_FAILED on failure
+*/
+int db_d_create_index(void)
 {
     dbIndex index;
     int stat;

+ 19 - 5
lib/db/dbmi_driver/d_create_tab.c

@@ -1,15 +1,29 @@
+/*!
+ * \file db/dbmi_driver/d_create_tab.c
+ * 
+ * \brief DBMI Library (driver) - create table
+ *
+ * (C) 1999-2008 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.
+ *
+ * \author Joel Jones (CERL/UIUC), Radim Blazek
+ */
+
 #include <stdlib.h>
 #include <grass/dbmi.h>
 #include "macros.h"
 #include "dbstubs.h"
 
 /*!
-   \fn 
-   \brief 
-   \return 
-   \param 
+  \brief Create table
+
+  \return DB_OK on success
+  \return DB_FAILED on failure
  */
-int db_d_create_table()
+int db_d_create_table(void)
 {
     dbTable *table;
     int stat;

+ 19 - 5
lib/db/dbmi_driver/d_createdb.c

@@ -1,15 +1,29 @@
+/*!
+ * \file db/dbmi_driver/d_createdb.c
+ * 
+ * \brief DBMI Library (driver) - create database
+ *
+ * (C) 1999-2008 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.
+ *
+ * \author Joel Jones (CERL/UIUC), Radim Blazek
+ */
+
 #include <stdlib.h>
 #include <grass/dbmi.h>
 #include "macros.h"
 #include "dbstubs.h"
 
 /*!
-   \fn 
-   \brief 
-   \return 
-   \param 
+  \brief Create database
+  
+  \return DB_OK on success
+  \return DB_FAILED on failure
  */
-int db_d_create_database()
+int db_d_create_database(void)
 {
     dbHandle handle;
     int stat;

+ 19 - 5
lib/db/dbmi_driver/d_delete.c

@@ -1,14 +1,28 @@
+/*!
+ * \file db/dbmi_driver/d_delete.c
+ * 
+ * \brief DBMI Library (driver) - delete record
+ *
+ * (C) 1999-2008 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.
+ *
+ * \author Joel Jones (CERL/UIUC), Radim Blazek
+ */
+
 #include <grass/dbmi.h>
 #include "macros.h"
 #include "dbstubs.h"
 
 /*!
-   \fn 
-   \brief 
-   \return 
-   \param 
+  \brief Delete record (?)
+
+  \return DB_OK on success
+  \return DB_FAILED on failure
  */
-int db_d_delete()
+int db_d_delete(void)
 {
     dbToken token;
     dbCursor *cursor;

+ 19 - 5
lib/db/dbmi_driver/d_deletedb.c

@@ -1,15 +1,29 @@
+/*!
+ * \file db/dbmi_driver/d_deletedb.c
+ * 
+ * \brief DBMI Library (driver) - delete database
+ *
+ * (C) 1999-2008 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.
+ *
+ * \author Joel Jones (CERL/UIUC), Radim Blazek
+ */
+
 #include <stdlib.h>
 #include <grass/dbmi.h>
 #include "macros.h"
 #include "dbstubs.h"
 
 /*!
-   \fn 
-   \brief 
-   \return 
-   \param 
+  \brief Delete database
+  
+  \return DB_OK on success
+  \return DB_FAILED on failure
  */
-int db_d_delete_database()
+int db_d_delete_database(void)
 {
     dbHandle handle;
     int stat;

+ 19 - 5
lib/db/dbmi_driver/d_desc_table.c

@@ -1,15 +1,29 @@
+/*!
+ * \file db/dbmi_driver/d_desc_table.c
+ * 
+ * \brief DBMI Library (driver) - describe table
+ *
+ * (C) 1999-2008 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.
+ *
+ * \author Joel Jones (CERL/UIUC), Radim Blazek
+ */
+
 #include <stdlib.h>
 #include <grass/dbmi.h>
 #include "macros.h"
 #include "dbstubs.h"
 
 /*!
-   \fn 
-   \brief 
-   \return 
-   \param 
+  \brief Describe table
+  
+  \return DB_OK on success
+  \return DB_FAILED on failure
  */
-int db_d_describe_table()
+int db_d_describe_table(void)
 {
     dbTable *table;
     dbString name;

+ 19 - 5
lib/db/dbmi_driver/d_drop_col.c

@@ -1,15 +1,29 @@
+/*!
+ * \file db/dbmi_driver/d_drop_col.c
+ * 
+ * \brief DBMI Library (driver) - drop column
+ *
+ * (C) 1999-2008 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.
+ *
+ * \author Joel Jones (CERL/UIUC), Radim Blazek
+ */
+
 #include <stdlib.h>
 #include <grass/dbmi.h>
 #include "macros.h"
 #include "dbstubs.h"
 
 /*!
-   \fn 
-   \brief 
-   \return 
-   \param 
+  \brief Drop column
+
+  \return DB_OK on success
+  \return DB_FAILED on failure
  */
-int db_d_drop_column()
+int db_d_drop_column(void)
 {
     dbString tableName;
     dbString columnName;

+ 19 - 5
lib/db/dbmi_driver/d_drop_index.c

@@ -1,14 +1,28 @@
+/*!
+ * \file db/dbmi_driver/d_drop_index.c
+ * 
+ * \brief DBMI Library (driver) - drop index
+ *
+ * (C) 1999-2008 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.
+ *
+ * \author Joel Jones (CERL/UIUC), Radim Blazek
+ */
+
 #include <stdlib.h>
 #include <grass/dbmi.h>
 #include "macros.h"
 #include "dbstubs.h"
 
 /*!
-   \fn 
-   \brief 
-   \return 
-   \param 
- */
+  \brief Drop index
+  
+  \return DB_OK on success
+  \return DB_FAILED on failure
+*/
 int db_d_drop_index(void)
 {
     dbString name;

+ 18 - 4
lib/db/dbmi_driver/d_drop_tab.c

@@ -1,13 +1,27 @@
+/*!
+ * \file db/dbmi_driver/d_drop_tab.c
+ * 
+ * \brief DBMI Library (driver) - drop table
+ *
+ * (C) 1999-2008 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.
+ *
+ * \author Joel Jones (CERL/UIUC), Radim Blazek
+ */
+
 #include <stdlib.h>
 #include <grass/dbmi.h>
 #include "macros.h"
 #include "dbstubs.h"
 
 /*!
-   \fn 
-   \brief 
-   \return 
-   \param 
+  \brief Drop table
+  
+  \return DB_OK on success
+  \return DB_FAILED on failure
  */
 int db_d_drop_table(void)
 {

+ 30 - 14
lib/db/dbmi_driver/d_execute.c

@@ -1,15 +1,29 @@
+/*!
+ * \file db/dbmi_driver/d_execute.c
+ * 
+ * \brief DBMI Library (driver) - execute SQL statements
+ *
+ * (C) 1999-2008 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.
+ *
+ * \author Joel Jones (CERL/UIUC), Radim Blazek
+ */
+
 #include <stdlib.h>
 #include <grass/dbmi.h>
 #include "macros.h"
 #include "dbstubs.h"
 
 /*!
-   \fn 
-   \brief 
-   \return 
-   \param 
+  \brief Execute SQL statements
+
+  \return DB_OK on success
+  \return DB_FAILED on failure
  */
-int db_d_execute_immediate()
+int db_d_execute_immediate(void)
 {
     int stat;
     dbString SQLstatement;
@@ -34,12 +48,12 @@ int db_d_execute_immediate()
 }
 
 /*!
-   \fn 
-   \brief 
-   \return 
-   \param 
+  \brief Begin transaction
+
+  \return DB_OK on success
+  \return DB_FAILED on failure
  */
-int db_d_begin_transaction()
+int db_d_begin_transaction(void)
 {
     int stat;
 
@@ -58,10 +72,12 @@ int db_d_begin_transaction()
 }
 
 /*!
-   \fn 
-   \brief 
-   \return 
-   \param 
+  \brief Commit transaction
+  
+  \param driver db driver
+  
+  \return DB_OK on success
+  \return DB_FAILED on failure
  */
 int db_d_commit_transaction()
 {

+ 18 - 5
lib/db/dbmi_driver/d_fetch.c

@@ -1,3 +1,17 @@
+/*!
+ * \file db/dbmi_driver/d_fetch.c
+ * 
+ * \brief DBMI Library (driver) - fetch data
+ *
+ * (C) 1999-2008 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.
+ *
+ * \author Joel Jones (CERL/UIUC), Radim Blazek
+ */
+
 #include <grass/dbmi.h>
 #include "macros.h"
 #include "dbstubs.h"
@@ -5,12 +19,11 @@
 
 static int valid_cursor(dbCursor * cursor, int position);
 
-
 /*!
-   \fn 
-   \brief 
-   \return 
-   \param 
+  \brief Fetch data
+
+  \return DB_OK on success
+  \return DB_FAILED on failure
  */
 int db_d_fetch(void)
 {

+ 19 - 5
lib/db/dbmi_driver/d_finddb.c

@@ -1,15 +1,29 @@
+/*!
+ * \file db/dbmi_driver/d_finddb.c
+ * 
+ * \brief DBMI Library (driver) - find database
+ *
+ * (C) 1999-2008 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.
+ *
+ * \author Joel Jones (CERL/UIUC), Radim Blazek
+ */
+
 #include <stdlib.h>
 #include <grass/dbmi.h>
 #include "macros.h"
 #include "dbstubs.h"
 
 /*!
-   \fn 
-   \brief 
-   \return 
-   \param 
+  \brief Find database
+
+  \return DB_OK on success
+  \return DB_FAILED on failure
  */
-int db_d_find_database()
+int db_d_find_database(void)
 {
     dbHandle handle;
     int found;

+ 20 - 6
lib/db/dbmi_driver/d_insert.c

@@ -1,14 +1,28 @@
+/*!
+ * \file db/dbmi_driver/d_insert.c
+ * 
+ * \brief DBMI Library (driver) - insert new record
+ *
+ * (C) 1999-2008 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.
+ *
+ * \author Joel Jones (CERL/UIUC), Radim Blazek
+ */
+
 #include <grass/dbmi.h>
 #include "macros.h"
 #include "dbstubs.h"
 
 /*!
-   \fn 
-   \brief 
-   \return 
-   \param 
- */
-int db_d_insert()
+  \brief Insert new record into table
+
+  \return DB_OK on success
+  \return DB_FAILED on failure
+*/
+int db_d_insert(void)
 {
     dbToken token;
     dbCursor *cursor;

+ 19 - 5
lib/db/dbmi_driver/d_list_idx.c

@@ -1,15 +1,29 @@
+/*!
+ * \file db/dbmi_driver/d_list_idx.c
+ * 
+ * \brief DBMI Library (driver) - list indexes
+ *
+ * (C) 1999-2008 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.
+ *
+ * \author Joel Jones (CERL/UIUC), Radim Blazek
+ */
+
 #include <stdlib.h>
 #include <grass/dbmi.h>
 #include "macros.h"
 #include "dbstubs.h"
 
 /*!
-   \fn 
-   \brief 
-   \return 
-   \param 
+  \brief List indexes
+
+  \return DB_OK on success
+  \return DB_FAILED on failure
  */
-int db_d_list_indexes()
+int db_d_list_indexes(void)
 {
     dbIndex *list;
     dbString table_name;

+ 19 - 5
lib/db/dbmi_driver/d_list_tabs.c

@@ -1,14 +1,28 @@
+/*!
+ * \file db/dbmi_driver/d_list_tabs.c
+ * 
+ * \brief DBMI Library (driver) - list tables
+ *
+ * (C) 1999-2008 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.
+ *
+ * \author Joel Jones (CERL/UIUC), Radim Blazek
+ */
+
 #include <grass/dbmi.h>
 #include "macros.h"
 #include "dbstubs.h"
 
 /*!
-   \fn 
-   \brief 
-   \return 
-   \param 
+   \brief List available tables for given connection
+
+   \return DB_OK on success
+   \return DB_FAILED on failure
  */
-int db_d_list_tables()
+int db_d_list_tables(void)
 {
     dbString *names;
     int count;

+ 19 - 5
lib/db/dbmi_driver/d_listdb.c

@@ -1,14 +1,28 @@
+/*!
+ * \file db/dbmi_driver/d_listdb.c
+ * 
+ * \brief DBMI Library (driver) - list databases
+ *
+ * (C) 1999-2008 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.
+ *
+ * \author Joel Jones (CERL/UIUC), Radim Blazek
+ */
+
 #include <stdlib.h>
 #include <grass/dbmi.h>
 #include "macros.h"
 #include "dbstubs.h"
 
 /*!
-   \fn int db_d_list_databases(void)
-   \brief 
-   \return 
-   \param 
- */
+  \brief List databases
+  
+  \return DB_OK on success
+  \return DB_FAILED on failure
+*/
 int db_d_list_databases(void)
 {
     dbHandle *handles;

+ 23 - 5
lib/db/dbmi_driver/d_mkdir.c

@@ -1,3 +1,17 @@
+/*!
+ * \file db/dbmi_driver/d_mkdir.c
+ * 
+ * \brief DBMI Library (driver) - creare directories
+ *
+ * (C) 1999-2008 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.
+ *
+ * \author Joel Jones (CERL/UIUC), Radim Blazek
+ */
+
 #include <string.h>
 #include <unistd.h>
 #include <sys/stat.h>
@@ -12,11 +26,15 @@ static int make_dir(const char *path, int mode);
 
 
 /*!
-   \fn 
-   \brief 
-   \return 
-   \param 
- */
+  \brief Create db directory
+
+  \param path full path
+  \param mode mode
+  \param parentdirs parent directories
+
+  \return DB_OK on success
+  \return DB_FAILED on failure
+*/
 int db_driver_mkdir(const char *path, int mode, int parentdirs)
 {
     if (parentdirs) {

+ 19 - 5
lib/db/dbmi_driver/d_opendb.c

@@ -1,15 +1,29 @@
+/*!
+ * \file db/dbmi_driver/d_opendb.c
+ * 
+ * \brief DBMI Library (driver) - open database connection
+ *
+ * (C) 1999-2008 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.
+ *
+ * \author Joel Jones (CERL/UIUC), Radim Blazek
+ */
+
 #include <stdlib.h>
 #include <grass/dbmi.h>
 #include "macros.h"
 #include "dbstubs.h"
 
 /*!
-   \fn 
-   \brief 
-   \return 
-   \param 
+  \brief Open database connection
+
+  \return DB_OK on success
+  \return DB_FAILED on failure
  */
-int db_d_open_database()
+int db_d_open_database(void)
 {
     dbHandle handle;
     int stat;

+ 19 - 5
lib/db/dbmi_driver/d_openinsert.c

@@ -1,14 +1,28 @@
+/*!
+ * \file db/dbmi_driver/d_openinsert.c
+ * 
+ * \brief DBMI Library (driver) - open insert cursor
+ *
+ * (C) 1999-2008 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.
+ *
+ * \author Joel Jones (CERL/UIUC), Radim Blazek
+ */
+
 #include <grass/dbmi.h>
 #include "macros.h"
 #include "dbstubs.h"
 
 /*!
-   \fn 
-   \brief 
-   \return 
-   \param 
+  \brief Open insert cursor
+
+  \return DB_OK on success
+  \return DB_FAILED on failure
  */
-int db_d_open_insert_cursor()
+int db_d_open_insert_cursor(void)
 {
     dbCursor *cursor;
     dbTable *table;

+ 19 - 5
lib/db/dbmi_driver/d_openselect.c

@@ -1,15 +1,29 @@
+/*!
+ * \file db/dbmi_driver/d_openselect.c
+ * 
+ * \brief DBMI Library (driver) - open select cursor
+ *
+ * (C) 1999-2008 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.
+ *
+ * \author Joel Jones (CERL/UIUC), Radim Blazek
+ */
+
 #include <stdlib.h>
 #include <grass/dbmi.h>
 #include "macros.h"
 #include "dbstubs.h"
 
 /*!
-   \fn 
-   \brief 
-   \return 
-   \param 
+  \brief Open select cursor
+
+  \return DB_OK on success
+  \return DB_FAILED on failure
  */
-int db_d_open_select_cursor()
+int db_d_open_select_cursor(void)
 {
     dbCursor *cursor;
     int stat;

+ 19 - 5
lib/db/dbmi_driver/d_openupdate.c

@@ -1,15 +1,29 @@
+/*!
+ * \file db/dbmi_driver/d_openupdate.c
+ * 
+ * \brief DBMI Library (driver) - open update cursor
+ *
+ * (C) 1999-2008 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.
+ *
+ * \author Joel Jones (CERL/UIUC), Radim Blazek
+ */
+
 #include <stdlib.h>
 #include <grass/dbmi.h>
 #include "macros.h"
 #include "dbstubs.h"
 
 /*!
-   \fn 
-   \brief 
-   \return 
-   \param 
+  \brief Open update cursor
+
+  \return DB_OK on success
+  \return DB_FAILED on failure
  */
-int db_d_open_update_cursor()
+int db_d_open_update_cursor(void)
 {
     dbCursor *cursor;
     int stat;

+ 20 - 5
lib/db/dbmi_driver/d_priv.c

@@ -1,14 +1,29 @@
+/*!
+ * \file db/dbmi_driver/d_priv.c
+ * 
+ * \brief DBMI Library (driver) - privileges management
+ *
+ * (C) 1999-2008 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.
+ *
+ * \author Joel Jones (CERL/UIUC), Radim Blazek
+ */
+
 #include <stdlib.h>
 #include <grass/dbmi.h>
 #include "macros.h"
 #include "dbstubs.h"
 
 /*!
-   \brief Grant privileges on table 
-   \return 
-   \param 
- */
-int db_d_grant_on_table()
+  \brief Grant privileges on table 
+  
+  \return DB_OK on success
+  \return DB_FAILED on failure
+*/
+int db_d_grant_on_table(void)
 {
     dbString tableName;
     int priv, to;

+ 19 - 5
lib/db/dbmi_driver/d_rows.c

@@ -1,14 +1,28 @@
+/*!
+ * \file db/dbmi_driver/d_rows.c
+ * 
+ * \brief DBMI Library (driver) - get number of records
+ *
+ * (C) 1999-2008 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.
+ *
+ * \author Joel Jones (CERL/UIUC), Radim Blazek
+ */
+
 #include <grass/dbmi.h>
 #include "macros.h"
 #include "dbstubs.h"
 
 /*!
-   \fn 
-   \brief 
-   \return 
-   \param 
+  \brief Get number of selected rows
+
+  \return DB_OK on success
+  \return DB_FAILED on failure
  */
-int db_d_get_num_rows()
+int db_d_get_num_rows(void)
 {
     dbToken token;
     dbCursor *cursor;

+ 20 - 6
lib/db/dbmi_driver/d_update.c

@@ -1,14 +1,28 @@
+/*!
+ * \file db/dbmi_driver/d_update.c
+ * 
+ * \brief DBMI Library (driver) - update statemets
+ *
+ * (C) 1999-2008 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.
+ *
+ * \author Joel Jones (CERL/UIUC), Radim Blazek
+ */
+
 #include <grass/dbmi.h>
 #include "macros.h"
 #include "dbstubs.h"
 
 /*!
-   \fn 
-   \brief 
-   \return 
-   \param 
- */
-int db_d_update()
+  \brief ?
+
+  \return DB_OK on success
+  \return DB_FAILED on failure
+*/
+int db_d_update(void)
 {
     dbToken token;
     dbCursor *cursor;

+ 20 - 6
lib/db/dbmi_driver/d_version.c

@@ -1,13 +1,27 @@
+/*!
+ * \file db/dbmi_driver/d_version.c
+ * 
+ * \brief DBMI Library (driver) - version info
+ *
+ * (C) 1999-2008 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.
+ *
+ * \author Joel Jones (CERL/UIUC), Radim Blazek
+ */
+
 #include <grass/dbmi.h>
 #include "macros.h"
 
 /*!
-   \fn 
-   \brief 
-   \return 
-   \param 
- */
-int db_d_version()
+  \brief Get version info
+
+  \return DB_OK on success
+  \return DB_FAILED on failure
+*/
+int db_d_version(void)
 {
     /* no arg(s) */
 

+ 19 - 21
lib/db/dbmi_driver/driver.c

@@ -1,22 +1,19 @@
-
-/****************************************************************************
+/*!
+ * \file db/dbmi_driver/driver.c
+ * 
+ * \brief DBMI Library (driver) - drivers
  *
- * MODULE:       DBMI library - drivers
- * AUTHOR(S):    Joel Jones (CERL/UIUC) <jjones zorro.cecer.army.mil>
- *               (overall original contributor of db libraries)
- *               This file (and driver directory) originates with GRASS 5.0:
- *               Radim Blazek <radim.blazek gmail.com> (original contributor)
- *               Glynn Clements <glynn gclements.plus.com>,
- *               Markus Neteler <neteler itc.it>,
- *               Huidae Cho <grass4u gmail.com>,
- * PURPOSE:      database management driver functions 
- * COPYRIGHT:    (C) 2003-2006 by the GRASS Development Team
+ * (C) 1999-2008 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.
+ * This program is free software under the GNU General Public
+ * License (>=v2). Read the file COPYING that comes with GRASS
+ * for details.
  *
- *****************************************************************************/
+ * \author Joel Jones (CERL/UIUC), Radim Blazek
+ * \author Modified by Glynn Clements <glynn gclements.plus.com>,
+ * Markus Neteler <neteler itc.it>,
+ * Huidae Cho <grass4u gmail.com>
+ */
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -31,11 +28,12 @@
 extern char *getenv();
 
 /*!
-   \fn int db_driver (int argc,
-   char *argv[])
-   \brief 
-   \return 
-   \param 
+  \brief Get driver (?)
+
+  \param argc, argv arguments
+
+  \return 0 on success
+  \return 1 on failure
  */
 int db_driver(int argc, char *argv[])
 {

+ 45 - 3
lib/db/dbmi_driver/driver_state.c

@@ -1,3 +1,17 @@
+/*!
+ * \file db/dbmi_driver/driver_state.c
+ * 
+ * \brief DBMI Library (driver) - drivers state
+ *
+ * (C) 1999-2008 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.
+ *
+ * \author Joel Jones (CERL/UIUC), Radim Blazek
+ */
+
 #include <stdlib.h>
 #include <grass/dbmi.h>
 #include "dbstubs.h"
@@ -5,25 +19,41 @@
 
 static dbDriverState state;
 
-
+/*!
+  \brief Initialize driver state
+*/
 void db__init_driver_state(void)
 {
     db_zero((void *)&state, sizeof(state));
 }
 
+/*!
+  \brief Get driver state
 
+  \return pointer to dbDriverState
+*/
 dbDriverState *db__get_driver_state(void)
 {
     return &state;
 }
 
+/*!
+  \brief Test database connection
 
+  \return 1 opened
+  \return 0 closed
+*/
 int db__test_database_open(void)
 {
     return state.open ? 1 : 0;
 }
 
+/*!
+  \brief Mark database as opened
 
+  \param dbname database name
+  \param dbschema database schema name
+*/
 void db__mark_database_open(const char *dbname, const char *dbschema)
 {
     state.dbname = db_store(dbname);
@@ -31,7 +61,9 @@ void db__mark_database_open(const char *dbname, const char *dbschema)
     state.open = 1;
 }
 
-
+/*!
+  \brief Mark database as closed
+*/
 void db__mark_database_closed(void)
 {
     free(state.dbname);
@@ -39,7 +71,11 @@ void db__mark_database_closed(void)
     state.open = 0;
 }
 
+/*!
+  \brief Add cursor do driver state
 
+  \param cursor db cursor to be added
+*/
 void db__add_cursor_to_driver_state(dbCursor * cursor)
 {
     dbCursor **list;
@@ -66,7 +102,11 @@ void db__add_cursor_to_driver_state(dbCursor * cursor)
     list[i] = cursor;
 }
 
+/*!
+  \brief Drop cursor from driver state
 
+  \param cursor db cursor to be dropped
+*/
 void db__drop_cursor_from_driver_state(dbCursor * cursor)
 {
     int i;
@@ -76,7 +116,9 @@ void db__drop_cursor_from_driver_state(dbCursor * cursor)
 	    state.cursor_list[i] = NULL;
 }
 
-
+/*!
+  \brief Close all cursors
+*/
 void db__close_all_cursors(void)
 {
     int i;

+ 80 - 1
lib/db/dbmilib.dox

@@ -176,9 +176,88 @@ See details here:<br>
  - db_update()
 
  - db__copy_table()
+
 \section dbmi_driver DBMI DRIVER functions
 
-[ to be moved here from below list ]
+ - db_driver()
+
+ - db_driver_mkdir()
+
+ - db_d_add_column()
+
+ - db_d_begin_transaction()
+
+ - db_d_bind_update()
+
+ - db_d_close_cursor()
+
+ - db_d_close_database()
+
+ - db_d_commit_transaction()
+
+ - db_d_create_database()
+
+ - db_d_create_index()
+
+ - db_d_create_table()
+
+ - db_d_delete()
+
+ - db_d_delete_database()
+
+ - db_d_describe_table()
+
+ - db_d_drop_column()
+
+ - db_d_drop_index()
+
+ - db_d_drop_table()
+
+ - db_d_execute_immediate()
+
+ - db_d_fetch()
+
+ - db_d_find_database()
+
+ - db_d_get_num_rows()
+
+ - db_driver_mkdir()
+
+ - db_d_grant_on_table()
+
+ - db_d_insert()
+
+ - db_d_list_databases()
+
+ - db_d_list_indexes()
+
+ - db_d_list_tables()
+
+ - db_d_open_database()
+
+ - db_d_open_insert_cursor()
+
+ - db_d_open_select_cursor()
+
+ - db_d_open_update_cursor()
+
+ - db_d_update()
+
+ - db_d_update()
+ 
+ - db__add_cursor_to_driver_state()
+
+ - db__close_all_cursors()
+
+ - db__drop_cursor_from_driver_state()
+  
+ - db__init_driver_state()
+
+ - db__mark_database_closed()
+
+ - db__mark_database_open()
+
+ - db__test_database_open()
 
 \section dbmi_functions DBMI functions list (incomplete)