~ubuntu-branches/ubuntu/oneiric/psqlodbc/oneiric

« back to all changes in this revision

Viewing changes to bind.h

  • Committer: Bazaar Package Importer
  • Author(s): Peter Eisentraut
  • Date: 2008-05-09 10:40:32 UTC
  • mfrom: (1.1.5 upstream) (4.1.1 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080509104032-brus47zgn7ak380w
Tags: 1:08.03.0200-1
* New upstream release
  - Disables some broken code (closes: #396218)
  - Obsoletes psqlodbc-413534.diff and most of psqlodbc-358949.diff

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
#define __BIND_H__
11
11
 
12
12
#include "psqlodbc.h"
13
 
#include <libpq-fe.h>
 
13
#include "descriptor.h"
14
14
 
15
15
/*
16
16
 * BindInfoClass -- stores information about a bound column
17
17
 */
18
18
struct BindInfoClass_
19
19
{
20
 
        Int4    buflen;                 /* size of buffer */
 
20
        SQLLEN  buflen;                 /* size of buffer */
21
21
        char    *buffer;                /* pointer to the buffer */
22
 
        Int4    *used;                  /* used space in the buffer (for strings
 
22
        SQLLEN  *used;                  /* used space in the buffer (for strings
23
23
                                         * not counting the '\0') */
24
 
        Int2    returntype;             /* kind of conversion to be applied when
 
24
        SQLLEN  *indicator;             /* indicator == used in many cases ? */
 
25
        SQLSMALLINT     returntype;     /* kind of conversion to be applied when
25
26
                                         * returning (SQL_C_DEFAULT,
26
27
                                         * SQL_C_CHAR... etc) */
27
 
        Int2    precision;              /* the precision for numeric or timestamp type */
28
 
        Int2    scale;                  /* the scale for numeric type */
 
28
        SQLSMALLINT     precision;      /* the precision for numeric or timestamp type */
 
29
        SQLSMALLINT     scale;          /* the scale for numeric type */
29
30
        /* area for work variables */
30
31
        char    dummy_data;             /* currently not used */                
31
32
};
32
33
typedef struct
33
34
{
34
35
        char    *ttlbuf;                /* to save the large result */
35
 
        Int4    ttlbuflen;              /* the buffer length */
36
 
        Int4    ttlbufused;             /* used length of the buffer */
37
 
        Int4    data_left;              /* amount of data left to read
 
36
        SQLLEN  ttlbuflen;              /* the buffer length */
 
37
        SQLLEN  ttlbufused;             /* used length of the buffer */
 
38
        SQLLEN  data_left;              /* amount of data left to read
38
39
                                         * (SQLGetData) */
39
40
}       GetDataClass;
40
41
 
43
44
 */
44
45
struct ParameterInfoClass_
45
46
{
46
 
        Int4    buflen;
 
47
        SQLLEN  buflen;
47
48
        char    *buffer;
48
 
        Int4    *used;
49
 
        Int2    CType;
50
 
        Int2    precision;      /* the precision for numeric or timestamp type */
51
 
        Int2    scale;          /* the scale for numeric type */
 
49
        SQLLEN  *used;
 
50
        SQLLEN  *indicator;     /* indicator == used in many cases ? */
 
51
        SQLSMALLINT     CType;
 
52
        SQLSMALLINT     precision;      /* the precision for numeric or timestamp type */
 
53
        SQLSMALLINT     scale;          /* the scale for numeric type */
52
54
        /* area for work variables */
53
55
        char    data_at_exec;
54
56
};
55
57
 
56
58
typedef struct 
57
59
{
58
 
        Int4    *EXEC_used;     /* amount of data */
 
60
        SQLLEN  *EXEC_used;     /* amount of data */
59
61
        char    *EXEC_buffer;   /* the data */
60
 
        Oid     lobj_oid;
 
62
        OID     lobj_oid;
61
63
}       PutDataClass;
62
64
 
63
65
/*
65
67
 */
66
68
struct ParameterImplClass_
67
69
{
68
 
        Int2            paramType;
69
 
        Int2            SQLType;
70
 
        Int4            PGType;
71
 
        UInt4           column_size;
72
 
        Int2            decimal_digits;
73
 
        Int2            precision;      /* the precision for numeric or timestamp type */
74
 
        Int2            scale;          /* the scale for numeric type */
 
70
        pgNAME          paramName;      /* this is unavailable even in 8.1 */
 
71
        SQLSMALLINT     paramType;
 
72
        SQLSMALLINT     SQLType;
 
73
        OID             PGType;
 
74
        SQLULEN         column_size;
 
75
        SQLSMALLINT     decimal_digits;
 
76
        SQLSMALLINT     precision;      /* the precision for numeric or timestamp type */
 
77
        SQLSMALLINT     scale;          /* the scale for numeric type */
75
78
};
76
79
 
77
80
typedef struct
78
81
{
79
82
        GetDataClass    fdata;
80
 
        Int4            allocated;
 
83
        SQLSMALLINT     allocated;
81
84
        GetDataClass    *gdata;
82
85
}       GetDataInfo;
83
86
typedef struct
84
87
{
85
 
        Int4            allocated;
 
88
        SQLSMALLINT     allocated;
86
89
        PutDataClass    *pdata;
87
90
}       PutDataInfo;
88
91
 
92
95
void    extend_iparameter_bindings(IPDFields *opts, int num_params);
93
96
void    reset_a_parameter_binding(APDFields *opts, int ipar);
94
97
void    reset_a_iparameter_binding(IPDFields *opts, int ipar);
 
98
int     CountParameters(const StatementClass *stmt, Int2 *inCount, Int2 *ioCount, Int2 *outputCount);
95
99
void    GetDataInfoInitialize(GetDataInfo *gdata);
96
100
void    extend_getdata_info(GetDataInfo *gdata, int num_columns, BOOL shrink);
97
101
void    reset_a_getdata_info(GetDataInfo *gdata, int icol);
100
104
void    extend_putdata_info(PutDataInfo *pdata, int num_params, BOOL shrink);
101
105
void    reset_a_putdata_info(PutDataInfo *pdata, int ipar);
102
106
void    PDATA_free_params(PutDataInfo *pdata, char option);
 
107
void    SC_param_next(const StatementClass*, int *param_number, ParameterInfoClass **, ParameterImplClass **);
 
108
 
 
109
RETCODE       prepareParameters(StatementClass *stmt);
 
110
int     decideHowToPrepare(StatementClass *stmt, BOOL force);
103
111
 
104
112
#endif