GRASS 8 Programmer's Manual 8.6.0dev(2026)-55de52a352
Loading...
Searching...
No Matches
d_insert.c
Go to the documentation of this file.
1/*!
2 * \file db/dbmi_driver/d_insert.c
3 *
4 * \brief DBMI Library (driver) - insert new record
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#include "dbstubs.h"
15
16/*!
17 \brief Insert new record into table
18
19 \return DB_OK on success
20 \return DB_FAILED on failure
21 */
22int db_d_insert(void)
23{
24 dbToken token;
26 int stat;
27
28 /* get the arg(s) */
29 DB_RECV_TOKEN(&token);
30 cursor = (dbCursor *)db_find_token(token);
32 db_error("** not an insert cursor **");
34 return DB_FAILED;
35 }
37
38 /* call the procedure */
40
41 /* send the return code */
42 if (stat != DB_OK) {
44 return DB_OK;
45 }
47
48 /* no results */
49 return DB_OK;
50}
#define NULL
Definition ccmath.h:32
int db_d_insert(void)
Insert new record into table.
Definition d_insert.c:22
Main header of GRASS DataBase Management Interface.
int dbToken
Definition dbmi.h:143
#define DB_FAILED
Definition dbmi.h:70
#define DB_OK
Definition dbmi.h:69
int(* db_driver_insert)(dbCursor *)
int db_test_cursor_type_insert(dbCursor *)
Check if cursor type is 'insert'.
Definition cursor.c:168
dbAddress db_find_token(dbToken)
Find token.
void db_error(const char *)
Report error message.
#define DB_RECV_TABLE_DATA(x)
Definition macros.h:153
#define DB_SEND_SUCCESS()
Definition macros.h:13
#define DB_RECV_TOKEN(x)
Definition macros.h:219
#define DB_SEND_FAILURE()
Definition macros.h:18