GRASS GIS 7 Programmer's Manual  7.5.svn(2017)-r71933
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
dbmscap.c File Reference

DBMI Library (base) - DBmscap management. More...

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <dirent.h>
#include <unistd.h>
#include <grass/dbmi.h>
#include <grass/gis.h>
Include dependency graph for dbmscap.c:

Go to the source code of this file.

Functions

const char * db_dbmscap_filename (void)
 Get dbmscap file name. More...
 
int db_has_dbms (void)
 Check dbms. More...
 
void db_copy_dbmscap_entry (dbDbmscap *dst, dbDbmscap *src)
 Copy dbmscap entry. More...
 
dbDbmscapdb_read_dbmscap (void)
 Read dbmscap. More...
 
void db_free_dbmscap (dbDbmscap *list)
 Free dbmscap. More...
 

Detailed Description

DBMI Library (base) - DBmscap management.

(C) 1999-2009 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

Definition in file dbmscap.c.

Function Documentation

void db_copy_dbmscap_entry ( dbDbmscap dst,
dbDbmscap src 
)

Copy dbmscap entry.

Parameters
dstdestination
srcsource

Definition at line 81 of file dbmscap.c.

References _dbmscap::comment, _dbmscap::driverName, and _dbmscap::startup.

Referenced by db_start_driver().

const char* db_dbmscap_filename ( void  )

Get dbmscap file name.

Returns
pointer to string with file name

Definition at line 59 of file dbmscap.c.

Referenced by db_read_dbmscap().

void db_free_dbmscap ( dbDbmscap list)

Free dbmscap.

Parameters
listpointer to dbDbmscap

Definition at line 259 of file dbmscap.c.

References db_free(), and _dbmscap::next.

Referenced by db_start_driver().

int db_has_dbms ( void  )

Check dbms.

Returns
1 if true
0 if false

Definition at line 70 of file dbmscap.c.

References NULL.

dbDbmscap* db_read_dbmscap ( void  )

Read dbmscap.

dbmscap file was used in grass5.0 but it is not used in grass5.7 until we find it necessary. All code for dbmscap file is commented here.

Instead of in dbmscap file db_read_dbmscap() searches for available dbmi drivers in /driver/db/

Returns
pointer to dbDbmscap

Definition at line 100 of file dbmscap.c.

References db_dbmscap_filename(), db_syserror(), fclose(), fd, G_asprintf(), G_convert_dirseps_to_host(), G_debug(), G_free(), G_gisbase(), G_str_replace(), list, name, NULL, opendir(), and readdir().

Referenced by db_list_drivers(), and db_start_driver().