c_version.c

Go to the documentation of this file.
00001 
00015 #include <grass/dbmi.h>
00016 #include "macros.h"
00017 
00031 int db_gversion(dbDriver * driver, dbString * client_version,
00032                 dbString * driver_version)
00033 {
00034     int ret_code;
00035 
00036     /* initialize the strings */
00037     db_init_string(client_version);
00038     db_init_string(driver_version);
00039 
00040     /* set client version from DB_VERSION */
00041     db_set_string(client_version, DB_VERSION);
00042 
00043     /* start the procedure call */
00044     db__set_protocol_fds(driver->send, driver->recv);
00045     DB_START_PROCEDURE_CALL(DB_PROC_VERSION);
00046 
00047     /* no arguments */
00048 
00049     /* get the return code for the procedure call */
00050     DB_RECV_RETURN_CODE(&ret_code);
00051 
00052     if (ret_code != DB_OK)
00053         return ret_code;        /* ret_code SHOULD == DB_FAILED */
00054 
00055     /* get the driver version */
00056     DB_RECV_STRING(driver_version);
00057 
00058     return DB_OK;
00059 }

Generated on Sat Oct 24 03:24:24 2009 for GRASS Programmer's Manual by  doxygen 1.6.1