1
/*-------------------------------------------------------------------------
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
10
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
11
* Portions Copyright (c) 1994, Regents of the University of California
13
* $Id: pgtclId.h,v 1.24 2003/08/04 02:40:16 momjian Exp $
15
*-------------------------------------------------------------------------
18
extern void PgSetConnectionId(Tcl_Interp *interp, PGconn *conn);
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
29
/* Tcl 7.6 and beyond use this signature */
30
#define DRIVER_OUTPUT_PROTO ClientData cData, CONST84 char *buf, int bufSize, \
32
#define DRIVER_INPUT_PROTO ClientData cData, char *buf, int bufSize, \
34
#define DRIVER_DEL_PROTO ClientData cData, Tcl_Interp *interp
37
extern PGconn *PgGetConnectionId(Tcl_Interp *interp, CONST84 char *id,
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,
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);
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
57
#define HAVE_TCL_GETFILEPROC 0
60
#if HAVE_TCL_GETFILEPROC
61
extern Tcl_File PgGetFileProc(ClientData cData, int direction);
64
extern Tcl_ChannelType Pg_ConnType;