Merge commit 'origin/master'
[versaplex.git] / vxodbc / convert.h
blob2f5bf29ae2063f3b2ed5812c395c1d64444180a2
1 /* File: convert.h
3 * Description: See "convert.c"
5 * Comments: See "notice.txt" for copyright and license information.
7 */
9 #ifndef __CONVERT_H__
10 #define __CONVERT_H__
12 #include "psqlodbc.h"
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 /* copy_and_convert results */
18 #define COPY_OK 0
19 #define COPY_UNSUPPORTED_TYPE 1
20 #define COPY_UNSUPPORTED_CONVERSION 2
21 #define COPY_RESULT_TRUNCATED 3
22 #define COPY_GENERAL_ERROR 4
23 #define COPY_NO_DATA_FOUND 5
25 typedef struct
27 int infinity;
28 int m;
29 int d;
30 int y;
31 int hh;
32 int mm;
33 int ss;
34 int fr;
35 } SIMPLE_TIME;
37 int copy_and_convert_field_bindinfo(StatementClass *stmt, OID field_type, void *value, int col);
38 int copy_and_convert_field(StatementClass *stmt, OID field_type,
39 void *value, SQLSMALLINT fCType, PTR rgbValue,
40 SQLLEN cbValueMax, SQLLEN *pcbValue, SQLLEN *pIndicator);
42 BOOL convert_money(const char *s, char *sout, size_t soutmax);
43 char parse_datetime(const char *buf, SIMPLE_TIME *st);
44 size_t convert_linefeeds(const char *s, char *dst, size_t max, BOOL convlf, BOOL *changed);
45 size_t convert_special_chars(const char *si, char *dst, SQLLEN used, UInt4 flags,int ccsc, int escape_ch);
47 int convert_pgbinary_to_char(const char *value, char *rgbValue, ssize_t cbValueMax);
48 size_t convert_from_pgbinary(const UCHAR *value, UCHAR *rgbValue, SQLLEN cbValueMax);
49 SQLLEN pg_hex2bin(const UCHAR *in, UCHAR *out, SQLLEN len);
50 Int4 findTag(const char *str, char dollar_quote, int ccsc);
52 #ifdef __cplusplus
54 #endif
55 #endif