00001 #include <grass/dbmi.h> 00002 #include "macros.h" 00003 00010 int 00011 db_grant_on_table ( dbDriver *driver, char *tableName, int priv, int to) 00012 { 00013 int ret_code; 00014 dbString name; 00015 00016 db_init_string ( &name ); 00017 db_set_string ( &name, tableName ); 00018 00019 /* start the procedure call */ 00020 db__set_protocol_fds (driver->send, driver->recv); 00021 DB_START_PROCEDURE_CALL(DB_PROC_GRANT_ON_TABLE); 00022 00023 /* send the argument(s) to the procedure */ 00024 DB_SEND_STRING (&name); 00025 DB_SEND_INT (priv); 00026 DB_SEND_INT (to); 00027 00028 db_free_string ( &name ); 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 /* no results */ 00037 return DB_OK; 00038 }