GRASS Programmer's Manual
6.4.2(2012)
|
00001 00015 #include <grass/dbmi.h> 00016 #include "macros.h" 00017 00029 int db_grant_on_table(dbDriver * driver, const char *tableName, int priv, int to) 00030 { 00031 int ret_code; 00032 dbString name; 00033 00034 db_init_string(&name); 00035 db_set_string(&name, tableName); 00036 00037 /* start the procedure call */ 00038 db__set_protocol_fds(driver->send, driver->recv); 00039 DB_START_PROCEDURE_CALL(DB_PROC_GRANT_ON_TABLE); 00040 00041 /* send the argument(s) to the procedure */ 00042 DB_SEND_STRING(&name); 00043 DB_SEND_INT(priv); 00044 DB_SEND_INT(to); 00045 00046 db_free_string(&name); 00047 00048 /* get the return code for the procedure call */ 00049 DB_RECV_RETURN_CODE(&ret_code); 00050 00051 if (ret_code != DB_OK) 00052 return ret_code; /* ret_code SHOULD == DB_FAILED */ 00053 00054 /* no results */ 00055 return DB_OK; 00056 }