GRASS 8 Programmer's Manual 8.6.0dev(2026)-55de52a352
Loading...
Searching...
No Matches
c_priv.c
Go to the documentation of this file.
1/*!
2 * \file db/dbmi_client/c_priv.c
3 *
4 * \brief DBMI Library (client) - privileges management
5 *
6 * SPDX-FileCopyrightText: 1999-2008 GRASS Development Team
7 * SPDX-License-Identifier: GPL-2.0-or-later
8 *
9 * \author Joel Jones (CERL/UIUC), Radim Blazek
10 */
11
12#include <grass/dbmi.h>
13#include "macros.h"
14
15/*!
16 \brief Grant privileges on table
17
18 \param driver db driver
19 \param tableName table name
20 \param priv privileges DB_PRIV_SELECT
21 \param to grant to DB_GROUP | DB_PUBLIC
22
23 \return DB_OK on success
24 \return DB_FAILED on failure
25 */
26int db_grant_on_table(dbDriver *driver, const char *tableName, int priv, int to)
27{
28 int ret_code;
30
32 db_set_string(&name, tableName);
33
34 /* start the procedure call */
37
38 /* send the argument(s) to the procedure */
41 DB_SEND_INT(to);
42
44
45 /* get the return code for the procedure call */
47
48 if (ret_code != DB_OK)
49 return ret_code; /* ret_code SHOULD == DB_FAILED */
50
51 /* no results */
52 return DB_OK;
53}
int db_grant_on_table(dbDriver *driver, const char *tableName, int priv, int to)
Grant privileges on table.
Definition c_priv.c:26
Main header of GRASS DataBase Management Interface.
#define DB_PROC_GRANT_ON_TABLE
Definition dbmi.h:57
#define DB_OK
Definition dbmi.h:69
void db_free_string(dbString *)
Free allocated space for dbString.
Definition string.c:148
int db_set_string(dbString *, const char *)
Inserts string to dbString (enlarge string)
Definition string.c:39
void db__set_protocol_fds(FILE *, FILE *)
?
void db_init_string(dbString *)
Initialize dbString.
Definition string.c:23
#define DB_SEND_STRING(x)
Definition macros.h:24
#define DB_SEND_INT(x)
Definition macros.h:82
#define DB_START_PROCEDURE_CALL(x)
Definition macros.h:2
#define DB_RECV_RETURN_CODE(x)
Definition macros.h:7
const char * name
Definition named_colr.c:6