~ubuntu-branches/ubuntu/lucid/psqlodbc/lucid

« back to all changes in this revision

Viewing changes to convert.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2004-05-13 10:47:36 UTC
  • Revision ID: james.westby@ubuntu.com-20040513104736-a530gmn0p3knep89
Tags: upstream-07.03.0200
ImportĀ upstreamĀ versionĀ 07.03.0200

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* File:                        convert.h
 
2
 *
 
3
 * Description:         See "convert.c"
 
4
 *
 
5
 * Comments:            See "notice.txt" for copyright and license information.
 
6
 *
 
7
 */
 
8
 
 
9
#ifndef __CONVERT_H__
 
10
#define __CONVERT_H__
 
11
 
 
12
#include "psqlodbc.h"
 
13
 
 
14
/* copy_and_convert results */
 
15
#define COPY_OK                                                 0
 
16
#define COPY_UNSUPPORTED_TYPE                                   1
 
17
#define COPY_UNSUPPORTED_CONVERSION                             2
 
18
#define COPY_RESULT_TRUNCATED                                   3
 
19
#define COPY_GENERAL_ERROR                                              4
 
20
#define COPY_NO_DATA_FOUND                                              5
 
21
/* convert_escape results */
 
22
#define CONVERT_ESCAPE_OK                                       0
 
23
#define CONVERT_ESCAPE_OVERFLOW                                 1
 
24
#define CONVERT_ESCAPE_ERROR                                    -1
 
25
 
 
26
typedef struct
 
27
{
 
28
        int             infinity;
 
29
        int                     m;
 
30
        int                     d;
 
31
        int                     y;
 
32
        int                     hh;
 
33
        int                     mm;
 
34
        int                     ss;
 
35
        int                     fr;
 
36
} SIMPLE_TIME;
 
37
 
 
38
int                     copy_and_convert_field_bindinfo(StatementClass *stmt, Int4 field_type, void *value, int col);
 
39
int copy_and_convert_field(StatementClass *stmt, Int4 field_type, void *value, Int2 fCType,
 
40
                                           PTR rgbValue, SDWORD cbValueMax, SDWORD *pcbValue);
 
41
 
 
42
int             copy_statement_with_parameters(StatementClass *stmt, BOOL);
 
43
BOOL            convert_money(const char *s, char *sout, size_t soutmax);
 
44
char            parse_datetime(const char *buf, SIMPLE_TIME *st);
 
45
int                     convert_linefeeds(const char *s, char *dst, size_t max, BOOL convlf, BOOL *changed);
 
46
int                     convert_special_chars(const char *si, char *dst, int used, BOOL convlf,int ccsc);
 
47
 
 
48
int                     convert_pgbinary_to_char(const char *value, char *rgbValue, int cbValueMax);
 
49
int                     convert_from_pgbinary(const unsigned char *value, unsigned char *rgbValue, int cbValueMax);
 
50
int                     convert_to_pgbinary(const unsigned char *in, char *out, int len);
 
51
int             pg_hex2bin(const UCHAR *in, UCHAR *out, int len);
 
52
void            encode(const char *in, char *out);
 
53
void            decode(const char *in, char *out);
 
54
int convert_lo(StatementClass *stmt, const void *value, Int2 fCType, PTR rgbValue,
 
55
                   SDWORD cbValueMax, SDWORD *pcbValue);
 
56
 
 
57
#endif