GRASS Programmer's Manual 6.4.1(2011)
|
00001 00015 #include <stdlib.h> 00016 #include <grass/dbmi.h> 00017 #include "macros.h" 00018 #include "dbstubs.h" 00019 00026 int db_d_list_indexes(void) 00027 { 00028 dbIndex *list; 00029 dbString table_name; 00030 int count; 00031 int stat; 00032 00033 /* arg(s) */ 00034 db_init_string(&table_name); 00035 DB_RECV_STRING(&table_name); 00036 00037 /* call the procedure */ 00038 stat = db_driver_list_indexes(&table_name, &list, &count); 00039 db_free_string(&table_name); 00040 00041 /* send the return code */ 00042 if (stat != DB_OK) { 00043 DB_SEND_FAILURE(); 00044 return DB_OK; 00045 } 00046 DB_SEND_SUCCESS(); 00047 00048 /* send results */ 00049 DB_SEND_INDEX_ARRAY(list, count); 00050 db_free_index_array(list, count); 00051 return DB_OK; 00052 }