GRASS Programmer's Manual  6.4.3(2013)-r
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Pages
d_delete.c
Go to the documentation of this file.
1 
15 #include <grass/dbmi.h>
16 #include "macros.h"
17 #include "dbstubs.h"
18 
25 int db_d_delete(void)
26 {
27  dbToken token;
28  dbCursor *cursor;
29  int stat;
30 
31  /* get the arg(s) */
32  DB_RECV_TOKEN(&token);
33  cursor = (dbCursor *) db_find_token(token);
34  if (cursor == NULL || !db_test_cursor_type_update(cursor)) {
35  db_error("** not an update cursor **");
37  return DB_FAILED;
38  }
39 
40  /* call the procedure */
41  stat = db_driver_delete(cursor);
42 
43  /* send the return code */
44  if (stat != DB_OK) {
46  return DB_OK;
47  }
49 
50  /* no results */
51  return DB_OK;
52 }