c_add_col.c

Go to the documentation of this file.
00001 
00015 #include <grass/dbmi.h>
00016 #include "macros.h"
00017 
00028 int db_add_column(dbDriver * driver, dbString * tableName, dbColumn * column)
00029 {
00030     int ret_code;
00031 
00032     /* start the procedure call */
00033     db__set_protocol_fds(driver->send, driver->recv);
00034     DB_START_PROCEDURE_CALL(DB_PROC_ADD_COLUMN);
00035 
00036     /* send the argument(s) to the procedure */
00037     DB_SEND_STRING(tableName);
00038     DB_SEND_COLUMN_DEFINITION(column);
00039 
00040     /* get the return code for the procedure call */
00041     DB_RECV_RETURN_CODE(&ret_code);
00042 
00043     if (ret_code != DB_OK)
00044         return ret_code;        /* ret_code SHOULD == DB_FAILED */
00045 
00046     /* no results */
00047     return DB_OK;
00048 }