4 #include <grass/dbmi.h>
13 if (n < 0 || n >= table->numColumns)
14 return ((dbColumn *)
NULL);
15 return &table->columns[
n];
25 return &column->value;
35 return &column->defaultValue;
46 column->sqlDataType = sqltype;
56 column->hostDataType =
type;
76 column->scale = scale;
86 return column->precision;
96 column->precision = precision;
107 return column->sqlDataType;
112 return column->hostDataType;
122 column->hasDefaultValue = 1;
132 column->hasDefaultValue = 0;
142 column->hasDefaultValue = 0;
152 return (column->hasDefaultValue != 0);
162 return (column->hasDefaultValue);
172 return (!column->hasDefaultValue);
182 column->useDefaultValue = 1;
192 column->useDefaultValue = 0;
202 return (column->useDefaultValue != 0);
212 column->nullAllowed = 1;
222 column->nullAllowed = 0;
232 return (column->nullAllowed != 0);
242 return column->dataLen;
252 column->dataLen = length;
262 column->select = DB_GRANTED;
272 column->select = DB_NOT_GRANTED;
282 return column->select;
292 column->update = DB_GRANTED;
302 column->update = DB_NOT_GRANTED;
312 return column->update;
322 db_zero((
void *)column,
sizeof(dbColumn));
dbColumn * db_get_table_column(dbTable *table, int n)
returns column structure for given table and column number
void db_set_column_sqltype(dbColumn *column, int sqltype)
define column sqltype for column (the function db_sqltype_name() returns sqltype description) ...
const char * db_get_column_description(dbColumn *column)
returns column description for given column
void db_set_column_precision(dbColumn *column, int precision)
const char * db_get_column_name(dbColumn *column)
returns column name for given column
void db_set_column_select_priv_granted(dbColumn *column)
void db_set_column_select_priv_not_granted(dbColumn *column)
void db_set_column_has_defined_default_value(dbColumn *column)
int db_get_column_update_priv(dbColumn *column)
int db_get_column_precision(dbColumn *column)
void db_init_column(dbColumn *column)
int db_get_column_select_priv(dbColumn *column)
int db_get_column_length(dbColumn *column)
dbValue * db_get_column_default_value(dbColumn *column)
returns column default value for given column structure
void db_unset_column_use_default_value(dbColumn *column)
int db_get_column_scale(dbColumn *column)
int db_set_column_name(dbColumn *column, const char *name)
int db_set_column_description(dbColumn *column, const char *description)
void db_unset_column_null_allowed(dbColumn *column)
int db_test_column_use_default_value(dbColumn *column)
void db_set_column_use_default_value(dbColumn *column)
int db_get_column_sqltype(dbColumn *column)
returns column sqltype for column (the function db_sqltype_name() returns sqltype description) ...
void db_set_column_length(dbColumn *column, int length)
dbValue * db_get_column_value(dbColumn *column)
returns column value for given column structure
int db_test_column_has_default_value(dbColumn *column)
void db_set_column_host_type(dbColumn *column, int type)
int db_test_column_has_defined_default_value(dbColumn *column)
void db_set_column_scale(dbColumn *column, int scale)
void db_set_column_update_priv_granted(dbColumn *column)
int db_test_column_has_undefined_default_value(dbColumn *column)
char * db_get_string(dbString *x)
void db_zero(void *s, int n)
int db_set_string(dbString *x, const char *s)
void db_unset_column_has_default_value(dbColumn *column)
void db_set_column_update_priv_not_granted(dbColumn *column)
int db_test_column_null_allowed(dbColumn *column)
void db_set_column_null_allowed(dbColumn *column)
void db_set_column_has_undefined_default_value(dbColumn *column)
void db_free_string(dbString *x)
int db_get_column_host_type(dbColumn *column)
void db_free_column(dbColumn *column)
frees column structure
void db_init_string(dbString *x)