xdrvalue.c

Go to the documentation of this file.
00001 #include "dbmi.h"
00002 #include "macros.h"
00003 
00004 int
00005 db__send_value (value, Ctype)
00006     dbValue *value;
00007     int Ctype;
00008 {
00009     DB_SEND_CHAR (value->isNull);
00010     if (value->isNull) return DB_OK;
00011 
00012     switch (Ctype)
00013     {
00014     case DB_C_TYPE_INT:      DB_SEND_INT(value->i);       break;
00015     case DB_C_TYPE_DOUBLE:   DB_SEND_DOUBLE(value->d);    break;
00016     case DB_C_TYPE_STRING:   DB_SEND_STRING(&value->s);   break;
00017     case DB_C_TYPE_DATETIME: DB_SEND_DATETIME(&value->t); break;
00018     default:
00019         db_error ("send data: invalid C-type");
00020         return DB_FAILED;
00021     }
00022     return DB_OK;
00023 }
00024 
00025 int
00026 db__recv_value (value, Ctype)
00027     dbValue *value;
00028     int Ctype;
00029 {
00030     DB_RECV_CHAR (&value->isNull);
00031     if (value->isNull) return DB_OK;
00032 
00033     switch (Ctype)
00034     {
00035     case DB_C_TYPE_INT:      DB_RECV_INT(&value->i);       break;
00036     case DB_C_TYPE_DOUBLE:   DB_RECV_DOUBLE(&value->d);    break;
00037     case DB_C_TYPE_STRING:   DB_RECV_STRING(&value->s);   break;
00038     case DB_C_TYPE_DATETIME: DB_RECV_DATETIME(&value->t); break;
00039     default:
00040         db_error ("send data: invalid C-type");
00041         return DB_FAILED;
00042     }
00043     return DB_OK;
00044 }

Generated on Mon Jan 1 19:49:05 2007 for GRASS by  doxygen 1.5.1