GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
d_list_idx.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 
27 {
28  dbIndex *list;
29  dbString table_name;
30  int count;
31  int stat;
32 
33  /* arg(s) */
34  db_init_string(&table_name);
35  DB_RECV_STRING(&table_name);
36 
37  /* call the procedure */
38  stat = db_driver_list_indexes(&table_name, &list, &count);
39  db_free_string(&table_name);
40 
41  /* send the return code */
42  if (stat != DB_OK) {
44  return DB_OK;
45  }
47 
48  /* send results */
49  DB_SEND_INDEX_ARRAY(list, count);
50  db_free_index_array(list, count);
51  return DB_OK;
52 }
int(* db_driver_list_indexes)()
void db_free_index_array(dbIndex *list, int count)
int count
int stat
Definition: g3dcolor.c:369
int db_d_list_indexes(void)
List indexes.
Definition: d_list_idx.c:26
#define DB_SEND_INDEX_ARRAY(x, n)
Definition: macros.h:104
#define DB_SEND_FAILURE()
Definition: macros.h:9
#define DB_SEND_SUCCESS()
Definition: macros.h:7
void db_free_string(dbString *x)
Definition: string.c:142
void db_init_string(dbString *x)
Definition: string.c:11
#define DB_RECV_STRING(x)
Definition: macros.h:18