diff options
author | Marc G. Fournier <scrappy@hub.org> | 1998-03-15 08:03:00 +0000 |
---|---|---|
committer | Marc G. Fournier <scrappy@hub.org> | 1998-03-15 08:03:00 +0000 |
commit | 6ac2528616697eb2d155ff693874e37c7273b797 (patch) | |
tree | 80f1258f558ba290b44341828f90a7a7a087abda /src/interfaces/libpgtcl/pgtclId.h | |
parent | 609026bb6b9cc05f9aa0e5a4ad7e06b5a352e969 (diff) | |
download | postgresql-6ac2528616697eb2d155ff693874e37c7273b797.tar.gz postgresql-6ac2528616697eb2d155ff693874e37c7273b797.zip |
From: Randy Kunkee <kunkee@pluto.ops.NeoSoft.com>
It is my hope that the following "patches" to libpgtcl get included
in the next release.
See the update to the README file to get a full description of the changes.
This version of libpgtcl is completely interpreter-safe, implements the
database connection handle as a channel (no events yet, but will make it
a lot easier to do fileevents on it in the future), and supports the SQL
"copy table to stdout" and "copy table from stdin" commands, with the
I/O being from and to the connection handle. The connection and result
handles are formatted in a way to make access to the tables more efficient.
Diffstat (limited to 'src/interfaces/libpgtcl/pgtclId.h')
-rw-r--r-- | src/interfaces/libpgtcl/pgtclId.h | 65 |
1 files changed, 45 insertions, 20 deletions
diff --git a/src/interfaces/libpgtcl/pgtclId.h b/src/interfaces/libpgtcl/pgtclId.h index 130f017ec6e..648531fdc7f 100644 --- a/src/interfaces/libpgtcl/pgtclId.h +++ b/src/interfaces/libpgtcl/pgtclId.h @@ -1,22 +1,47 @@ /*------------------------------------------------------------------------- - * - * pgtclId.h-- - * useful routines to convert between strings and pointers - * Needed because everything in tcl is a string, but often, pointers - * to data structures are needed. - * - * - * Copyright (c) 1994, Regents of the University of California - * - * $Id: pgtclId.h,v 1.5 1997/09/08 21:55:26 momjian Exp $ - * - *------------------------------------------------------------------------- - */ +* +* pgtclId.h-- +* useful routines to convert between strings and pointers +* Needed because everything in tcl is a string, but often, pointers +* to data structures are needed. +* +* +* Copyright (c) 1994, Regents of the University of California +* +* $Id: pgtclId.h,v 1.6 1998/03/15 08:03:00 scrappy Exp $ +* +*------------------------------------------------------------------------- +*/ + +extern void PgSetConnectionId(Tcl_Interp *interp, PGconn *conn); -extern void PgSetConnectionId(Pg_clientData * cd, char *id, PGconn *conn); -extern PGconn *PgGetConnectionId(Pg_clientData * cd, char *id); -extern void PgDelConnectionId(Pg_clientData * cd, char *id); -extern void PgSetResultId(Pg_clientData * cd, char *id, char *connid, PGresult *res); -extern PGresult *PgGetResultId(Pg_clientData * cd, char *id); -extern void PgDelResultId(Pg_clientData * cd, char *id); -extern void PgGetConnByResultId(Pg_clientData * cd, char *id, char *resid); +#if (TCL_MAJOR_VERSION == 7 && TCL_MINOR_VERSION == 5) +# 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, \ + int bufSize, int *errorCodePtr +# define DRIVER_INPUT_PROTO ClientData cData, Tcl_File inFile, char *buf, \ + int bufSize, int *errorCodePtr +#else +# define DRIVER_OUTPUT_PROTO ClientData cData, char *buf, int bufSize, \ + int *errorCodePtr +# define DRIVER_INPUT_PROTO ClientData cData, char *buf, int bufSize, \ + int *errorCodePtr +# define DRIVER_DEL_PROTO ClientData cData, Tcl_Interp *interp +#endif + +extern PGconn *PgGetConnectionId(Tcl_Interp *interp, char *id, \ + Pg_ConnectionId **); +extern PgDelConnectionId(DRIVER_DEL_PROTO); +extern int PgOutputProc(DRIVER_OUTPUT_PROTO); +extern PgInputProc(DRIVER_INPUT_PROTO); +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); + +#if (TCL_MAJOR_VERSION < 8) +extern Tcl_File PgGetFileProc(ClientData cData, int direction); +#endif + +extern Tcl_ChannelType Pg_ConnType; |