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
d_listdb.c
Go to the documentation of this file.
1
15
#include <stdlib.h>
16
#include <grass/dbmi.h>
17
#include "
macros.h
"
18
#include "
dbstubs.h
"
19
26
int
db_d_list_databases
(
void
)
27
{
28
dbHandle *handles;
29
dbString *path;
30
int
npaths;
31
int
i,
count
;
32
int
stat;
33
34
/* arg(s) */
35
DB_RECV_STRING_ARRAY
(&path, &npaths);
36
37
/* call the procedure */
38
stat =
db_driver_list_databases
(path, npaths, &handles, &count);
39
db_free_string_array
(path, npaths);
40
41
/* send the return code */
42
if
(stat != DB_OK) {
43
DB_SEND_FAILURE
();
44
return
DB_OK;
45
}
46
DB_SEND_SUCCESS
();
47
48
/* send results */
49
DB_SEND_INT
(count);
50
for
(i = 0; i < count; i++) {
51
DB_SEND_HANDLE
(&handles[i]);
52
}
53
db_free_handle_array
(handles, count);
54
return
DB_OK;
55
}
lib
db
dbmi_driver
d_listdb.c
Generated on Sun Sep 9 2012 18:55:30 for GRASS Programmer's Manual by
1.8.1.2