GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
c_list_idx.c
Go to the documentation of this file.
1 
15 #include <grass/dbmi.h>
16 #include "macros.h"
17 
29 int db_list_indexes(dbDriver * driver, dbString * table_name, dbIndex ** list,
30  int *count)
31 {
32  int ret_code;
33 
34  /* start the procedure call */
35  db__set_protocol_fds(driver->send, driver->recv);
36  DB_START_PROCEDURE_CALL(DB_PROC_LIST_INDEXES);
37 
38  /* arguments */
39  DB_SEND_STRING(table_name);
40 
41  /* get the return code for the procedure call */
42  DB_RECV_RETURN_CODE(&ret_code);
43 
44  if (ret_code != DB_OK)
45  return ret_code; /* ret_code SHOULD == DB_FAILED */
46 
47  /* results */
48  DB_RECV_INDEX_ARRAY(list, count);
49 
50  return DB_OK;
51 }
void db__set_protocol_fds(FILE *send, FILE *recv)
Definition: xdr.c:71
#define DB_RECV_INDEX_ARRAY(x, n)
Definition: macros.h:108
int count
#define DB_START_PROCEDURE_CALL(x)
Definition: macros.h:2
int db_list_indexes(dbDriver *driver, dbString *table_name, dbIndex **list, int *count)
List indexes.
Definition: c_list_idx.c:29
#define DB_RECV_RETURN_CODE(x)
Definition: macros.h:4
#define DB_SEND_STRING(x)
Definition: macros.h:12
Definition: driver.h:25