d_desc_table.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_describe_table(void)
00027 {
00028     dbTable *table;
00029     dbString name;
00030     int stat;
00031 
00032     db_init_string(&name);
00033 
00034     /* get the arg(s) */
00035     DB_RECV_STRING(&name);
00036 
00037     /* call the procedure */
00038     stat = db_driver_describe_table(&name, &table);
00039 
00040     /* send the return code */
00041     if (stat != DB_OK) {
00042         DB_SEND_FAILURE();
00043         return DB_OK;
00044     }
00045     DB_SEND_SUCCESS();
00046 
00047     /* results */
00048     db_set_table_name(table, db_get_string(&name));
00049     DB_SEND_TABLE_DEFINITION(table);
00050 
00051     db_free_string(&name);
00052     db_free_table(table);
00053     return DB_OK;
00054 }

Generated on Sat Oct 24 03:24:24 2009 for GRASS Programmer's Manual by  doxygen 1.6.1