GRASS Programmer's Manual
6.4.2(2012)
|
00001 00015 #include <grass/dbmi.h> 00016 #include "macros.h" 00017 00028 int db_describe_table(dbDriver * driver, dbString * name, dbTable ** table) 00029 { 00030 int ret_code; 00031 00032 /* start the procedure call */ 00033 db__set_protocol_fds(driver->send, driver->recv); 00034 DB_START_PROCEDURE_CALL(DB_PROC_DESCRIBE_TABLE); 00035 00036 /* send the argument(s) to the procedure */ 00037 DB_SEND_STRING(name); 00038 00039 /* get the return code for the procedure call */ 00040 DB_RECV_RETURN_CODE(&ret_code); 00041 00042 if (ret_code != DB_OK) 00043 return ret_code; /* ret_code SHOULD == DB_FAILED */ 00044 00045 /* get the results */ 00046 DB_RECV_TABLE_DEFINITION(table); 00047 return DB_OK; 00048 }