c_list_drivers.c

Go to the documentation of this file.
00001 #include <grass/dbmi.h>
00002 
00009 char *
00010 db_list_drivers(void)
00011 {
00012     dbDbmscap *list, *cur;
00013     dbString drivernames;
00014 
00015     db_init_string(&drivernames);
00016 
00017     /* read the dbmscap info */
00018     if(NULL == (list = db_read_dbmscap()))
00019         return NULL;
00020     else
00021     {
00022         /* build the comma separated string of existing drivers */
00023         for (cur = list; cur; cur = cur->next)
00024         {
00025             if (cur->driverName == '\0')
00026                break;
00027             else
00028             {
00029                if(cur != list)
00030                   db_append_string ( &drivernames, ",");
00031                db_append_string ( &drivernames, cur->driverName);
00032             }
00033         }
00034     }
00035     
00036     return db_get_string (&drivernames);
00037 }

Generated on Sun Apr 6 17:31:38 2008 for GRASS by  doxygen 1.5.5