diff options
author | Bruce Momjian <bruce@momjian.us> | 1998-06-16 04:10:17 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 1998-06-16 04:10:17 +0000 |
commit | 583891833ff102b805a752ded0ad38bb8087dcf9 (patch) | |
tree | 9dbeb199ed4cf0c73edb100837977fce3bb9ab86 /src/interfaces/libpgtcl/pgtclId.h | |
parent | 693b156a7003d774752095585df0c609c3dce9d9 (diff) | |
download | postgresql-583891833ff102b805a752ded0ad38bb8087dcf9.tar.gz postgresql-583891833ff102b805a752ded0ad38bb8087dcf9.zip |
The attached patch modifies libpgtcl per previous discussion: the
pg_notifies statement is eliminated, and callbacks defined by
pg_listen are instead invoked automatically from the Tcl idle loop
whenever a NOTIFY message is received.
I have done only cursory testing, so there may be problems still
lurking (particularly on non-Unix machines?). But it seems to
work.
Patch is against today's cvs sources. Note that this will not work
with the 6.3.2 release since it depends on the new libpq.
The diffs are a bit large so I've gzipped them. A patch to update
libpgtcl.sgml is included too.
regards, tom lane
Diffstat (limited to 'src/interfaces/libpgtcl/pgtclId.h')
-rw-r--r-- | src/interfaces/libpgtcl/pgtclId.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/interfaces/libpgtcl/pgtclId.h b/src/interfaces/libpgtcl/pgtclId.h index 648531fdc7f..815b11db345 100644 --- a/src/interfaces/libpgtcl/pgtclId.h +++ b/src/interfaces/libpgtcl/pgtclId.h @@ -8,14 +8,15 @@ * * Copyright (c) 1994, Regents of the University of California * -* $Id: pgtclId.h,v 1.6 1998/03/15 08:03:00 scrappy Exp $ +* $Id: pgtclId.h,v 1.7 1998/06/16 04:10:17 momjian Exp $ * *------------------------------------------------------------------------- */ extern void PgSetConnectionId(Tcl_Interp *interp, PGconn *conn); -#if (TCL_MAJOR_VERSION == 7 && TCL_MINOR_VERSION == 5) +#if TCL_MAJOR_VERSION == 7 && TCL_MINOR_VERSION == 5 +/* Only Tcl 7.5 had drivers with this signature */ # define DRIVER_DEL_PROTO ClientData cData, Tcl_Interp *interp, \ Tcl_File inFile, Tcl_File outFile # define DRIVER_OUTPUT_PROTO ClientData cData, Tcl_File outFile, char *buf, \ @@ -23,6 +24,7 @@ extern void PgSetConnectionId(Tcl_Interp *interp, PGconn *conn); # define DRIVER_INPUT_PROTO ClientData cData, Tcl_File inFile, char *buf, \ int bufSize, int *errorCodePtr #else +/* Tcl 7.6 and beyond use this signature */ # define DRIVER_OUTPUT_PROTO ClientData cData, char *buf, int bufSize, \ int *errorCodePtr # define DRIVER_INPUT_PROTO ClientData cData, char *buf, int bufSize, \ @@ -39,8 +41,19 @@ extern int PgSetResultId(Tcl_Interp *interp, char *connid, PGresult *res); extern PGresult *PgGetResultId(Tcl_Interp *interp, char *id); extern void PgDelResultId(Tcl_Interp *interp, char *id); extern int PgGetConnByResultId(Tcl_Interp *interp, char *resid); +extern void PgStartNotifyEventSource(Pg_ConnectionId *connid); +extern void PgStopNotifyEventSource(Pg_ConnectionId *connid); +extern void PgNotifyTransferEvents(Pg_ConnectionId *connid); +extern void PgNotifyInterpDelete(ClientData clientData, Tcl_Interp *interp); -#if (TCL_MAJOR_VERSION < 8) +/* GetFileProc is needed in Tcl 7.6 and later */ +#if (TCL_MAJOR_VERSION * 100 + TCL_MINOR_VERSION) >= 706 +#define HAVE_TCL_GETFILEPROC 1 +#else +#define HAVE_TCL_GETFILEPROC 0 +#endif + +#if HAVE_TCL_GETFILEPROC extern Tcl_File PgGetFileProc(ClientData cData, int direction); #endif |