00001 #include <grass/dbmi.h> 00002 #include "macros.h" 00003 00004 /* Note: renamed from db_version to db_gversion to avoid name conflict 00005 with Berkeley DB etc */ 00012 db_gversion (dbDriver *driver, dbString *client_version, dbString *driver_version) 00013 00014 { 00015 int ret_code; 00016 00017 /* initialize the strings */ 00018 db_init_string (client_version); 00019 db_init_string (driver_version); 00020 00021 /* set client version from DB_VERSION */ 00022 db_set_string (client_version, DB_VERSION); 00023 00024 /* start the procedure call */ 00025 db__set_protocol_fds (driver->send, driver->recv); 00026 DB_START_PROCEDURE_CALL(DB_PROC_VERSION); 00027 00028 /* no arguments */ 00029 00030 /* get the return code for the procedure call */ 00031 DB_RECV_RETURN_CODE(&ret_code); 00032 00033 if (ret_code != DB_OK) 00034 return ret_code; /* ret_code SHOULD == DB_FAILED */ 00035 00036 /* get the driver version */ 00037 DB_RECV_STRING(driver_version); 00038 00039 return DB_OK; 00040 }