GRASS Programmer's Manual  6.5.svn(2014)-r66266
 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 }
void db__set_protocol_fds(FILE *send, FILE *recv)
Definition: xdr.c:71
int db_list_databases(dbDriver *driver, dbString *path, int npaths, dbHandle **handles, int *count)
List databases.
Definition: c_listdb.c:30
#define DB_RECV_INT(x)
Definition: macros.h:39
#define DB_RECV_HANDLE(x)
Definition: macros.h:59
int count
dbHandle * db_alloc_handle_array(int count)
Definition: handle.c:90
#define DB_START_PROCEDURE_CALL(x)
Definition: macros.h:2
#define DB_RECV_RETURN_CODE(x)
Definition: macros.h:4
Definition: driver.h:25
tuple h
panel.defaultSize = wx.CheckBox(panel, id = wx.ID_ANY, label = _(&quot;Use default size&quot;)) panel...
#define DB_SEND_STRING_ARRAY(x, n)
Definition: macros.h:14