GRASS Programmer's Manual
6.4.2(2012)
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
c_listdb.c
Go to the documentation of this file.
1
15
#include <grass/dbmi.h>
16
#include "
macros.h
"
17
30
int
db_list_databases
(dbDriver *
driver
, dbString * path,
int
npaths,
31
dbHandle ** handles,
int
*count)
32
{
33
int
ret_code;
34
int
i;
35
dbHandle *
h
;
36
37
/* start the procedure call */
38
db__set_protocol_fds
(driver->send, driver->recv);
39
DB_START_PROCEDURE_CALL
(DB_PROC_LIST_DATABASES);
40
41
/* arguments */
42
DB_SEND_STRING_ARRAY
(path, npaths);
43
44
/* get the return code for the procedure call */
45
DB_RECV_RETURN_CODE
(&ret_code);
46
47
if
(ret_code != DB_OK)
48
return
ret_code;
/* ret_code SHOULD == DB_FAILED */
49
50
/* results */
51
DB_RECV_INT
(count);
52
h =
db_alloc_handle_array
(*count);
53
for
(i = 0; i < *count; i++) {
54
DB_RECV_HANDLE
(&h[i]);
55
}
56
*handles =
h
;
57
58
return
DB_OK;
59
}
lib
db
dbmi_client
c_listdb.c
Generated on Sun Sep 9 2012 18:55:30 for GRASS Programmer's Manual by
1.8.1.2