grass  7.8.6
About: GRASS (Geographic Resources Analysis Support System) is a raster- and vector-based GIS, image processing system, graphics production system and spatial modeling system.
  Fossies Dox: grass-7.8.6.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

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

static void add_entry (dbDbmscap **list, char *name, char *startup, char *comment)
 
static char * dbmscap_filename (int err_flag)
 
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...
 
static int cmp_entry (dbDbmscap *a, dbDbmscap *b)
 
void db_free_dbmscap (dbDbmscap *list)
 Free dbmscap. More...
 

Variables

static char * dbmscap_files []
 

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

◆ add_entry()

static void add_entry ( dbDbmscap **  list,
char *  name,
char *  startup,
char *  comment 
)
static

Definition at line 216 of file dbmscap.c.

References cmp_entry(), cur, db_malloc(), list, name, _dbmscap::next, and NULL.

Referenced by db_read_dbmscap().

◆ cmp_entry()

static int cmp_entry ( dbDbmscap a,
dbDbmscap b 
)
static

Definition at line 212 of file dbmscap.c.

References a, and b.

Referenced by add_entry().

◆ db_copy_dbmscap_entry()

void db_copy_dbmscap_entry ( dbDbmscap dst,
dbDbmscap src 
)

Copy dbmscap entry.

Parameters
dstdestination
srcsource

Definition at line 81 of file dbmscap.c.

References dst, and src.

Referenced by db_start_driver().

◆ db_dbmscap_filename()

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.

References dbmscap_filename().

Referenced by db_read_dbmscap().

◆ db_free_dbmscap()

void db_free_dbmscap ( dbDbmscap list)

Free dbmscap.

Parameters
listpointer to dbDbmscap

Definition at line 259 of file dbmscap.c.

References cur, db_free(), and next().

Referenced by db_start_driver().

◆ db_has_dbms()

int db_has_dbms ( void  )

Check dbms.

Returns
1 if true
0 if false

Definition at line 70 of file dbmscap.c.

References dbmscap_filename(), and NULL.

◆ db_read_dbmscap()

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 add_entry(), db_dbmscap_filename(), db_syserror(), file, G_asprintf(), G_convert_dirseps_to_host(), G_debug(), G_free(), G_gisbase(), G_str_replace(), line(), list, name, NULL, opendir(), and readdir().

Referenced by db_list_drivers(), and db_start_driver().

◆ dbmscap_filename()

static char * dbmscap_filename ( int  err_flag)
static

Definition at line 35 of file dbmscap.c.

References db_error(), dbmscap_files, err_flag, file, getenv(), and NULL.

Referenced by db_dbmscap_filename(), and db_has_dbms().

Variable Documentation

◆ dbmscap_files

char* dbmscap_files[]
static
Initial value:
= {
"/etc/dbmscap",
"/lib/dbmscap",
"/usr/lib/dbmscap",
"/usr/local/lib/dbmscap",
"/usr/local/dbmi/lib/dbmscap",
}
#define NULL
Definition: ccmath.h:32

Definition at line 23 of file dbmscap.c.

Referenced by dbmscap_filename().