GRASS GIS 7 Programmer's Manual  7.7.svn(2018)-r73362
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
handle.c File Reference

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

#include <stdlib.h>
#include <grass/dbmi.h>
Include dependency graph for handle.c:

Go to the source code of this file.

Functions

void db_init_handle (dbHandle *handle)
 Initialize handle (i.e database/schema) More...
 
int db_set_handle (dbHandle *handle, const char *dbName, const char *dbSchema)
 Set handle (database and schema name) More...
 
const char * db_get_handle_dbname (dbHandle *handle)
 Get handle database name. More...
 
const char * db_get_handle_dbschema (dbHandle *handle)
 Get handle schema name. More...
 
void db_free_handle (dbHandle *handle)
 Free dbHandle structure. More...
 
void db_free_handle_array (dbHandle *handle, int count)
 Free array of handles. More...
 
dbHandledb_alloc_handle_array (int count)
 Allocate array of handles. More...
 

Detailed Description

DBMI Library (base) - handle 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 handle.c.

Function Documentation

dbHandle* db_alloc_handle_array ( int  count)

Allocate array of handles.

Parameters
countnumber of handles in the array
Returns
pointer to first dbHandle in the array

Definition at line 109 of file handle.c.

References count, db_calloc(), and db_init_handle().

Referenced by db_list_databases().

void db_free_handle ( dbHandle handle)

Free dbHandle structure.

Parameters
handlepointer to dbHandle

Definition at line 79 of file handle.c.

References db_free_string(), _db_handle::dbName, and _db_handle::dbSchema.

Referenced by db_d_create_database(), db_d_delete_database(), db_d_find_database(), db_d_open_database(), db_find_database(), and db_free_handle_array().

void db_free_handle_array ( dbHandle handle,
int  count 
)

Free array of handles.

Parameters
handlepointer to first dbHandle in the array
countnumber of handles in the array

Definition at line 91 of file handle.c.

References count, db_free(), and db_free_handle().

Referenced by db_d_list_databases().

const char* db_get_handle_dbname ( dbHandle handle)

Get handle database name.

Parameters
handlepointer to dbHandle
Returns
pointer to string with database name

Definition at line 57 of file handle.c.

References db_get_string(), and _db_handle::dbName.

Referenced by db_d_open_database(), and db_find_database().

const char* db_get_handle_dbschema ( dbHandle handle)

Get handle schema name.

Parameters
handlepointer to dbHandle
Returns
pointer to string with schema name

Definition at line 69 of file handle.c.

References db_get_string(), and _db_handle::dbSchema.

Referenced by db_d_open_database(), and db_find_database().

int db_set_handle ( dbHandle handle,
const char *  dbName,
const char *  dbSchema 
)

Set handle (database and schema name)

Parameters
handlepointer to dbHandle
dbNamedatabase name
dbSchemaschema name
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 39 of file handle.c.

References DB_OK, db_set_string(), _db_handle::dbName, and _db_handle::dbSchema.

Referenced by db_find_database(), db_start_driver_open_database(), IL_vector_input_data_2d(), Vect_get_column_names(), Vect_get_column_names_types(), Vect_get_column_types(), and Vect_write_ascii().