GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
sqlCtype.c
Go to the documentation of this file.
1 #include <grass/dbmi.h>
2 
9 int db_sqltype_to_Ctype(int sqltype)
10 {
11  switch (sqltype) {
12  case DB_SQL_TYPE_INTEGER:
13  return DB_C_TYPE_INT;
14  case DB_SQL_TYPE_SMALLINT:
15  return DB_C_TYPE_INT;
16  case DB_SQL_TYPE_REAL:
17  return DB_C_TYPE_DOUBLE;
18  case DB_SQL_TYPE_DOUBLE_PRECISION:
19  return DB_C_TYPE_DOUBLE;
20  case DB_SQL_TYPE_SERIAL:
21  return DB_C_TYPE_INT;
22  }
23 
24  switch (sqltype & ~DB_DATETIME_MASK) {
25  case DB_SQL_TYPE_DATE:
26  case DB_SQL_TYPE_TIME:
27  case DB_SQL_TYPE_TIMESTAMP:
28  case DB_SQL_TYPE_INTERVAL:
29  return DB_C_TYPE_DATETIME;
30  }
31 
32  return DB_C_TYPE_STRING;
33 }
int db_sqltype_to_Ctype(int sqltype)
Definition: sqlCtype.c:9