00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _tdsconvert_h_
00021 #define _tdsconvert_h_
00022
00023 #ifdef __cplusplus
00024 extern "C"
00025 {
00026 #if 0
00027 }
00028 #endif
00029 #endif
00030
00031
00032
00033 typedef union conv_result
00034 {
00035 TDS_TINYINT ti;
00036 TDS_SMALLINT si;
00037 TDS_INT i;
00038 TDS_INT8 bi;
00039 TDS_FLOAT f;
00040 TDS_REAL r;
00041 TDS_CHAR *c;
00042 TDS_MONEY m;
00043 TDS_MONEY4 m4;
00044 TDS_DATETIME dt;
00045 TDS_DATETIME4 dt4;
00046 TDS_NUMERIC n;
00047 TDS_CHAR *ib;
00048 TDS_UNIQUE u;
00049
00050 struct cc_t {
00051 TDS_CHAR *c;
00052 TDS_UINT len;
00053 } cc;
00054 struct cb_t {
00055 TDS_CHAR *ib;
00056 TDS_UINT len;
00057 } cb;
00058 }
00059 CONV_RESULT;
00060
00061
00062
00063
00064 #define TDS_CONVERT_FAIL -1
00065 #define TDS_CONVERT_NOAVAIL -2
00066 #define TDS_CONVERT_SYNTAX -3
00067 #define TDS_CONVERT_NOMEM -4
00068 #define TDS_CONVERT_OVERFLOW -5
00069
00070
00071 #define TDS_CONVERT_CHAR 256
00072 #define TDS_CONVERT_BINARY 257
00073
00074 struct tds_time
00075 {
00076 int tm_year;
00077 int tm_mon;
00078 int tm_mday;
00079 int tm_hour;
00080 int tm_min;
00081 int tm_sec;
00082 int tm_ms;
00083 };
00084
00085 unsigned char tds_willconvert(int srctype, int desttype);
00086
00087 TDS_INT tds_get_null_type(int srctype);
00088 TDS_INT tds_convert(const TDSCONTEXT * context, int srctype, const TDS_CHAR * src, TDS_UINT srclen, int desttype, CONV_RESULT * cr);
00089
00090 size_t tds_strftime(char *buf, size_t maxsize, const char *format, const TDSDATEREC * timeptr);
00091
00092 #ifdef __cplusplus
00093 #if 0
00094 {
00095 #endif
00096 }
00097 #endif
00098
00099 #endif