~ubuntu-branches/ubuntu/gutsy/libpgjava/gutsy

« back to all changes in this revision

Viewing changes to src/interfaces/libpgtcl/pgtclId.h

  • Committer: Bazaar Package Importer
  • Author(s): Arnaud Vandyck
  • Date: 2005-04-21 14:25:11 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20050421142511-wibh5vc31fkrorx7
Tags: 7.4.7-3
Built with sources...

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*-------------------------------------------------------------------------
 
2
 *
 
3
 * pgtclId.h
 
4
 *
 
5
 *      Contains Tcl "channel" interface routines, plus useful routines
 
6
 *      to convert between strings and pointers.  These are needed because
 
7
 *      everything in Tcl is a string, but in C, pointers to data structures
 
8
 *      are needed.
 
9
 *
 
10
 * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
 
11
 * Portions Copyright (c) 1994, Regents of the University of California
 
12
 *
 
13
 * $Id: pgtclId.h,v 1.24 2003/08/04 02:40:16 momjian Exp $
 
14
 *
 
15
 *-------------------------------------------------------------------------
 
16
 */
 
17
 
 
18
extern void PgSetConnectionId(Tcl_Interp *interp, PGconn *conn);
 
19
 
 
20
#if TCL_MAJOR_VERSION == 7 && TCL_MINOR_VERSION == 5
 
21
/* Only Tcl 7.5 had drivers with this signature */
 
22
#define DRIVER_DEL_PROTO ClientData cData, Tcl_Interp *interp, \
 
23
        Tcl_File inFile, Tcl_File outFile
 
24
#define DRIVER_OUTPUT_PROTO ClientData cData, Tcl_File outFile, char *buf, \
 
25
        int bufSize, int *errorCodePtr
 
26
#define DRIVER_INPUT_PROTO ClientData cData, Tcl_File inFile, char *buf, \
 
27
        int bufSize, int *errorCodePtr
 
28
#else
 
29
/* Tcl 7.6 and beyond use this signature */
 
30
#define DRIVER_OUTPUT_PROTO ClientData cData, CONST84 char *buf, int bufSize, \
 
31
        int *errorCodePtr
 
32
#define DRIVER_INPUT_PROTO ClientData cData, char *buf, int bufSize, \
 
33
        int *errorCodePtr
 
34
#define DRIVER_DEL_PROTO ClientData cData, Tcl_Interp *interp
 
35
#endif
 
36
 
 
37
extern PGconn *PgGetConnectionId(Tcl_Interp *interp, CONST84 char *id,
 
38
                                  Pg_ConnectionId **);
 
39
extern int      PgDelConnectionId(DRIVER_DEL_PROTO);
 
40
extern int      PgOutputProc(DRIVER_OUTPUT_PROTO);
 
41
extern int      PgInputProc(DRIVER_INPUT_PROTO);
 
42
extern int PgSetResultId(Tcl_Interp *interp, CONST84 char *connid,
 
43
                          PGresult *res);
 
44
extern PGresult *PgGetResultId(Tcl_Interp *interp, CONST84 char *id);
 
45
extern void PgDelResultId(Tcl_Interp *interp, CONST84 char *id);
 
46
extern int      PgGetConnByResultId(Tcl_Interp *interp, CONST84 char *resid);
 
47
extern void PgStartNotifyEventSource(Pg_ConnectionId * connid);
 
48
extern void PgStopNotifyEventSource(Pg_ConnectionId * connid, bool allevents);
 
49
extern void PgNotifyTransferEvents(Pg_ConnectionId * connid);
 
50
extern void PgConnLossTransferEvents(Pg_ConnectionId * connid);
 
51
extern void PgNotifyInterpDelete(ClientData clientData, Tcl_Interp *interp);
 
52
 
 
53
/* GetFileProc is needed in Tcl 7.6 *only* ... it went away again in 8.0 */
 
54
#if TCL_MAJOR_VERSION == 7 && TCL_MINOR_VERSION >= 6
 
55
#define HAVE_TCL_GETFILEPROC 1
 
56
#else
 
57
#define HAVE_TCL_GETFILEPROC 0
 
58
#endif
 
59
 
 
60
#if HAVE_TCL_GETFILEPROC
 
61
extern Tcl_File PgGetFileProc(ClientData cData, int direction);
 
62
#endif
 
63
 
 
64
extern Tcl_ChannelType Pg_ConnType;