GRASS Programmer's Manual 6.4.1(2011)
d_add_col.c
Go to the documentation of this file.
00001 
00015 #include <stdlib.h>
00016 #include <grass/dbmi.h>
00017 #include "macros.h"
00018 #include "dbstubs.h"
00019 
00026 int db_d_add_column(void)
00027 {
00028     dbColumn column;
00029     dbString name;
00030     int stat;
00031 
00032     db_init_string(&name);
00033     db_init_column(&column);
00034 
00035     /* get the arg(s) */
00036     DB_RECV_STRING(&name);
00037     DB_RECV_COLUMN_DEFINITION(&column);
00038 
00039     /* call the procedure */
00040     stat = db_driver_add_column(&name, &column);
00041     db_free_string(&name);
00042     db_free_column(&column);
00043 
00044     /* send the return code */
00045     if (stat != DB_OK) {
00046         DB_SEND_FAILURE();
00047         return DB_OK;
00048     }
00049     DB_SEND_SUCCESS();
00050 
00051     /* no results */
00052 
00053     return DB_OK;
00054 }
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines