This commit was generated by cvs2svn to compensate for changes in r3921,
[freeside.git] / install / 5.005 / DBD-Pg-1.22-fixvercmp / dbdimp.h
1 /*
2    $Id: dbdimp.h,v 1.1 2004-04-29 09:21:28 ivan Exp $
3
4    Copyright (c) 1997,1998,1999,2000 Edmund Mergl
5    Portions Copyright (c) 1994,1995,1996,1997 Tim Bunce
6
7    You may distribute under the terms of either the GNU General Public
8    License or the Artistic License, as specified in the Perl README file.
9 */
10
11 #ifdef WIN32
12 #define snprintf _snprintf
13 #endif
14
15 /* Define drh implementor data structure */
16 struct imp_drh_st {
17     dbih_drc_t com;             /* MUST be first element in structure   */
18 };
19
20 /* Define dbh implementor data structure */
21 struct imp_dbh_st {
22     dbih_dbc_t com;             /* MUST be first element in structure   */
23
24     PGconn    * conn;           /* connection structure */
25     int         init_commit;    /* initialize AutoCommit */
26     int         pg_auto_escape; /* initialize AutoEscape */
27     int         pg_bool_tf;     /* do bools return 't'/'f' */
28 #ifdef SvUTF8_off
29     int         pg_enable_utf8; /* should we attempt to make utf8 strings? */
30 #endif
31 };
32
33 /* Define sth implementor data structure */
34 struct imp_sth_st {
35     dbih_stc_t com;             /* MUST be first element in structure   */
36
37     PGresult* result;           /* result structure */
38     int cur_tuple;              /* current tuple */
39     int rows;                   /* number of affected rows */
40
41     /* Input Details    */
42     char      *statement;       /* sql (see sth_scan)           */
43     HV        *all_params_hv;   /* all params, keyed by name    */
44     AV        *out_params_av;   /* quick access to inout params */
45     int        pg_pad_empty;    /* convert ""->" " when binding */
46     int        all_params_len;  /* length-sum of all params     */
47
48     /* (In/)Out Parameter Details */
49     bool  has_inout_params;
50 };
51
52
53 #define sword  signed int
54 #define sb2    signed short
55 #define ub2    unsigned short
56
57 typedef struct phs_st phs_t;    /* scalar placeholder   */
58
59 struct phs_st {         /* scalar placeholder EXPERIMENTAL      */
60     sword ftype;        /* external OCI field type              */
61
62     SV  *sv;            /* the scalar holding the value         */
63     int sv_type;        /* original sv type at time of bind     */
64     bool is_inout;
65
66     IV  maxlen;         /* max possible len (=allocated buffer) */
67
68     /* these will become an array */
69     sb2 indp;           /* null indicator                       */
70     char *progv;
71     ub2 arcode;
72     IV alen;            /* effective length ( <= maxlen )       */
73
74     int alen_incnull;   /* 0 or 1 if alen should include null   */
75     char name[1];       /* struct is malloc'd bigger as needed  */
76 };
77
78
79 SV * dbd_db_pg_notifies (SV *dbh, imp_dbh_t *imp_dbh);
80
81 /* end of dbdimp.h */