2 $Id: dbdimp.h,v 1.1 2004-04-29 09:21:28 ivan Exp $
4 Copyright (c) 1997,1998,1999,2000 Edmund Mergl
5 Portions Copyright (c) 1994,1995,1996,1997 Tim Bunce
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.
12 #define snprintf _snprintf
15 /* Define drh implementor data structure */
17 dbih_drc_t com; /* MUST be first element in structure */
20 /* Define dbh implementor data structure */
22 dbih_dbc_t com; /* MUST be first element in structure */
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' */
29 int pg_enable_utf8; /* should we attempt to make utf8 strings? */
33 /* Define sth implementor data structure */
35 dbih_stc_t com; /* MUST be first element in structure */
37 PGresult* result; /* result structure */
38 int cur_tuple; /* current tuple */
39 int rows; /* number of affected rows */
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 */
48 /* (In/)Out Parameter Details */
49 bool has_inout_params;
53 #define sword signed int
54 #define sb2 signed short
55 #define ub2 unsigned short
57 typedef struct phs_st phs_t; /* scalar placeholder */
59 struct phs_st { /* scalar placeholder EXPERIMENTAL */
60 sword ftype; /* external OCI field type */
62 SV *sv; /* the scalar holding the value */
63 int sv_type; /* original sv type at time of bind */
66 IV maxlen; /* max possible len (=allocated buffer) */
68 /* these will become an array */
69 sb2 indp; /* null indicator */
72 IV alen; /* effective length ( <= maxlen ) */
74 int alen_incnull; /* 0 or 1 if alen should include null */
75 char name[1]; /* struct is malloc'd bigger as needed */
79 SV * dbd_db_pg_notifies (SV *dbh, imp_dbh_t *imp_dbh);