GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
xdrcolumn.c
Go to the documentation of this file.
1 #include <grass/dbmi.h>
2 #include "macros.h"
3 
4 
5 int db__send_column_definition(dbColumn * column)
6 {
7  DB_SEND_STRING(&column->columnName);
8  DB_SEND_STRING(&column->description);
9  DB_SEND_INT(column->sqlDataType);
10  DB_SEND_INT(column->hostDataType);
11  DB_SEND_INT(column->precision);
12  DB_SEND_INT(column->scale);
13  DB_SEND_INT(column->dataLen);
14  DB_SEND_INT(column->select);
15  DB_SEND_INT(column->update);
16  DB_SEND_CHAR(column->nullAllowed);
17  DB_SEND_CHAR(column->useDefaultValue);
18  DB_SEND_CHAR(column->hasDefaultValue);
19  if (column->hasDefaultValue) {
21  }
22 
23  return DB_OK;
24 }
25 
26 int db__recv_column_definition(dbColumn * column)
27 {
28  DB_RECV_STRING(&column->columnName);
29  DB_RECV_STRING(&column->description);
30  DB_RECV_INT(&column->sqlDataType);
31  DB_RECV_INT(&column->hostDataType);
32  DB_RECV_INT(&column->precision);
33  DB_RECV_INT(&column->scale);
34  DB_RECV_INT(&column->dataLen);
35  DB_RECV_INT(&column->select);
36  DB_RECV_INT(&column->update);
37  DB_RECV_CHAR(&column->nullAllowed);
38  DB_RECV_CHAR(&column->useDefaultValue);
39  DB_RECV_CHAR(&column->hasDefaultValue);
40  if (column->hasDefaultValue) {
42  }
43 
44  return DB_OK;
45 }
46 
47 
48 int db__send_column_value(dbColumn * column)
49 {
50  return db__send_value(db_get_column_value(column),
52 }
53 
54 
55 int db__recv_column_value(dbColumn * column)
56 {
57  return db__recv_value(db_get_column_value(column),
59 }
60 
61 int db__send_column_default_value(dbColumn * column)
62 {
65 }
66 
67 int db__recv_column_default_value(dbColumn * column)
68 {
71 }
#define DB_SEND_CHAR(x)
Definition: macros.h:23
#define DB_SEND_INT(x)
Definition: macros.h:37
#define DB_RECV_INT(x)
Definition: macros.h:39
int db__recv_column_default_value(dbColumn *column)
Definition: xdrcolumn.c:67
dbValue * db_get_column_default_value(dbColumn *column)
returns column default value for given column structure
int db__recv_value(dbValue *value, int Ctype)
Definition: xdrvalue.c:30
int db_sqltype_to_Ctype(int sqltype)
Definition: sqlCtype.c:9
#define DB_RECV_COLUMN_DEFAULT_VALUE(x)
Definition: macros.h:94
int db_get_column_sqltype(dbColumn *column)
returns column sqltype for column (the function db_sqltype_name() returns sqltype description) ...
int db__send_value(dbValue *value, int Ctype)
Definition: xdrvalue.c:4
int db__recv_column_definition(dbColumn *column)
Definition: xdrcolumn.c:26
#define DB_RECV_CHAR(x)
Definition: macros.h:25
int db__recv_column_value(dbColumn *column)
Definition: xdrcolumn.c:55
dbValue * db_get_column_value(dbColumn *column)
returns column value for given column structure
#define DB_SEND_STRING(x)
Definition: macros.h:12
int db__send_column_value(dbColumn *column)
Definition: xdrcolumn.c:48
#define DB_SEND_COLUMN_DEFAULT_VALUE(x)
Definition: macros.h:92
int db__send_column_definition(dbColumn *column)
Definition: xdrcolumn.c:5
int db__send_column_default_value(dbColumn *column)
Definition: xdrcolumn.c:61
#define DB_RECV_STRING(x)
Definition: macros.h:18