1996-07-09 08:22:35 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
|
|
|
* pgtcl.c--
|
1997-09-07 07:04:48 +02:00
|
|
|
*
|
|
|
|
* libpgtcl is a tcl package for front-ends to interface with pglite
|
|
|
|
* It's the tcl equivalent of the old libpq C interface.
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
|
|
|
* Copyright (c) 1994, Regents of the University of California
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* IDENTIFICATION
|
1998-03-15 09:03:00 +01:00
|
|
|
* $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/pgtcl.c,v 1.10 1998/03/15 08:02:57 scrappy Exp $
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
1996-11-11 13:14:45 +01:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include "postgres.h"
|
1996-07-09 08:22:35 +02:00
|
|
|
#include "tcl.h"
|
|
|
|
#include "libpgtcl.h"
|
|
|
|
#include "pgtclCmds.h"
|
1996-11-11 13:14:45 +01:00
|
|
|
#include "pgtclId.h"
|
1996-07-09 08:22:35 +02:00
|
|
|
|
|
|
|
/*
|
1998-03-15 09:03:00 +01:00
|
|
|
* Pgtcl_Init
|
|
|
|
* initialization package for the PGLITE Tcl package
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
int
|
1998-03-15 09:03:00 +01:00
|
|
|
Pgtcl_Init (Tcl_Interp *interp)
|
1996-07-09 08:22:35 +02:00
|
|
|
{
|
1998-03-15 09:03:00 +01:00
|
|
|
|
|
|
|
/* finish off the ChannelType struct. Much easier to do it here then
|
|
|
|
* to guess where it might be by position in the struct. This is needed
|
|
|
|
* for Tcl7.6 and beyond, which have the getfileproc.
|
|
|
|
*/
|
|
|
|
#if (TCL_MAJOR_VERSION == 7 && TCL_MINOR_VERSION == 6)
|
|
|
|
Pg_ConnType.getFileProc = PgGetFileProc;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* register all pgtcl commands */
|
|
|
|
Tcl_CreateCommand(interp,
|
|
|
|
"pg_conndefaults",
|
|
|
|
Pg_conndefaults,
|
|
|
|
(ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
|
|
|
|
|
|
|
|
Tcl_CreateCommand(interp,
|
|
|
|
"pg_connect",
|
|
|
|
Pg_connect,
|
|
|
|
(ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
|
|
|
|
|
|
|
|
Tcl_CreateCommand(interp,
|
|
|
|
"pg_disconnect",
|
|
|
|
Pg_disconnect,
|
|
|
|
(ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
|
|
|
|
|
|
|
|
Tcl_CreateCommand(interp,
|
|
|
|
"pg_exec",
|
|
|
|
Pg_exec,
|
|
|
|
(ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
|
|
|
|
|
|
|
|
Tcl_CreateCommand(interp,
|
|
|
|
"pg_select",
|
|
|
|
Pg_select,
|
|
|
|
(ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
|
|
|
|
|
|
|
|
Tcl_CreateCommand(interp,
|
|
|
|
"pg_result",
|
|
|
|
Pg_result,
|
|
|
|
(ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
|
|
|
|
|
|
|
|
Tcl_CreateCommand(interp,
|
|
|
|
"pg_lo_open",
|
|
|
|
Pg_lo_open,
|
|
|
|
(ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
|
|
|
|
|
|
|
|
Tcl_CreateCommand(interp,
|
|
|
|
"pg_lo_close",
|
|
|
|
Pg_lo_close,
|
|
|
|
(ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
|
|
|
|
|
|
|
|
Tcl_CreateCommand(interp,
|
|
|
|
"pg_lo_read",
|
|
|
|
Pg_lo_read,
|
|
|
|
(ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
|
|
|
|
|
|
|
|
Tcl_CreateCommand(interp,
|
|
|
|
"pg_lo_write",
|
|
|
|
Pg_lo_write,
|
|
|
|
(ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
|
|
|
|
|
|
|
|
Tcl_CreateCommand(interp,
|
|
|
|
"pg_lo_lseek",
|
|
|
|
Pg_lo_lseek,
|
|
|
|
(ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
|
|
|
|
|
|
|
|
Tcl_CreateCommand(interp,
|
|
|
|
"pg_lo_creat",
|
|
|
|
Pg_lo_creat,
|
|
|
|
(ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
|
|
|
|
|
|
|
|
Tcl_CreateCommand(interp,
|
|
|
|
"pg_lo_tell",
|
|
|
|
Pg_lo_tell,
|
|
|
|
(ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
|
|
|
|
|
|
|
|
Tcl_CreateCommand(interp,
|
|
|
|
"pg_lo_unlink",
|
|
|
|
Pg_lo_unlink,
|
|
|
|
(ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
|
|
|
|
|
|
|
|
Tcl_CreateCommand(interp,
|
|
|
|
"pg_lo_import",
|
|
|
|
Pg_lo_import,
|
|
|
|
(ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
|
|
|
|
|
|
|
|
Tcl_CreateCommand(interp,
|
|
|
|
"pg_lo_export",
|
|
|
|
Pg_lo_export,
|
|
|
|
(ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
|
|
|
|
|
|
|
|
Tcl_CreateCommand(interp,
|
|
|
|
"pg_listen",
|
|
|
|
Pg_listen,
|
|
|
|
(ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
|
|
|
|
|
|
|
|
Tcl_CreateCommand(interp,
|
|
|
|
"pg_notifies",
|
|
|
|
Pg_notifies,
|
|
|
|
(ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
|
|
|
|
|
|
|
|
Tcl_PkgProvide(interp, "Pgtcl", "1.1");
|
|
|
|
|
|
|
|
return TCL_OK;
|
1996-07-09 08:22:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
1996-10-30 07:18:42 +01:00
|
|
|
int
|
1998-03-15 09:03:00 +01:00
|
|
|
Pgtcl_SafeInit (Tcl_Interp *interp)
|
1996-10-30 07:18:42 +01:00
|
|
|
{
|
1998-03-15 09:03:00 +01:00
|
|
|
return Pgtcl_Init(interp);
|
1996-10-30 07:18:42 +01:00
|
|
|
}
|