Skip to content

Commit

Permalink
Update version to 2.6.0 and drop support for Tcl 8.3 and earlier.
Browse files Browse the repository at this point in the history
  • Loading branch information
resuna committed Mar 20, 2018
1 parent 9f33b49 commit 0c2eca9
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 57 deletions.
18 changes: 9 additions & 9 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for pgtcl 2.5.1.
# Generated by GNU Autoconf 2.69 for pgtcl 2.6.0.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -577,8 +577,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='pgtcl'
PACKAGE_TARNAME='pgtcl'
PACKAGE_VERSION='2.5.1'
PACKAGE_STRING='pgtcl 2.5.1'
PACKAGE_VERSION='2.6.0'
PACKAGE_STRING='pgtcl 2.6.0'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''

Expand Down Expand Up @@ -1304,7 +1304,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures pgtcl 2.5.1 to adapt to many kinds of systems.
\`configure' configures pgtcl 2.6.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
Expand Down Expand Up @@ -1365,7 +1365,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of pgtcl 2.5.1:";;
short | recursive ) echo "Configuration of pgtcl 2.6.0:";;
esac
cat <<\_ACEOF
Expand Down Expand Up @@ -1468,7 +1468,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
pgtcl configure 2.5.1
pgtcl configure 2.6.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -1833,7 +1833,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by pgtcl $as_me 2.5.1, which was
It was created by pgtcl $as_me 2.6.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
Expand Down Expand Up @@ -9416,7 +9416,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by pgtcl $as_me 2.5.1, which was
This file was extended by pgtcl $as_me 2.6.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -9469,7 +9469,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
pgtcl config.status 2.5.1
pgtcl config.status 2.6.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
Expand Down
2 changes: 1 addition & 1 deletion configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dnl to configure the system for the local environment.
# so you can encode the package version directly into the source files.
#-----------------------------------------------------------------------

AC_INIT([pgtcl], [2.5.1])
AC_INIT([pgtcl], [2.6.0])

#-----
# Version with patch stripped
Expand Down
38 changes: 17 additions & 21 deletions generic/pgtclCmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,10 @@
#include "libpq/libpq-fs.h" /* large-object interface */
#include "tokenize.h"

#ifndef CONST84
# define CONST84
#endif

/*
* Local function forward declarations
*/
static int execute_put_values(Tcl_Interp *interp, CONST84 char *array_varname,
static int execute_put_values(Tcl_Interp *interp, const char *array_varname,
PGresult *result, char *nullString, int tupno);

static int count_parameters(Tcl_Interp *interp, const char *queryString,
Expand Down Expand Up @@ -389,7 +385,7 @@ Pg_connect(ClientData cData, Tcl_Interp *interp, int objc,
int async = 0;


static CONST84 char *options[] = {
static const char *options[] = {
"-host", "-port", "-tty", "-options", "-user",
"-password", "-conninfo", "-connlist", "-connhandle",
"-async", (char *)NULL
Expand Down Expand Up @@ -613,7 +609,7 @@ Pg_disconnect(ClientData cData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST obj
{
Pg_ConnectionId *connid;
Tcl_Channel conn_chan;
CONST84 char *connString;
const char *connString;
Tcl_Obj *tresult;

if (objc != 2)
Expand Down Expand Up @@ -697,7 +693,7 @@ Pg_exec(ClientData cData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
Pg_ConnectionId *connid;
PGconn *conn;
PGresult *result;
CONST84 char *connString = NULL;
const char *connString = NULL;
const char *execString = NULL;
char *newExecString = NULL;
const char **paramValues = NULL;
Expand Down Expand Up @@ -884,7 +880,7 @@ Pg_exec_prepared(ClientData cData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST
Pg_ConnectionId *connid;
PGconn *conn;
PGresult *result;
CONST84 char *connString;
const char *connString;
const char *statementNameString;
const char **paramValues = NULL;

Expand Down Expand Up @@ -1122,7 +1118,7 @@ Pg_result(ClientData cData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
Pg_resultid *resultid;


static CONST84 char *options[] = {
static const char *options[] = {
"-status", "-error", "-foreach", "-conn", "-oid",
"-numTuples", "-cmdTuples", "-numAttrs", "-assign", "-assignbyidx",
"-getTuple", "-tupleArray", "-tupleArrayWithoutNulls", "-attributes", "-lAttributes",
Expand All @@ -1137,7 +1133,7 @@ Pg_result(ClientData cData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
OPT_CLEAR, OPT_LIST, OPT_LLIST, OPT_DICT, OPT_NULL_VALUE_STRING
};

static CONST84 char *errorOptions[] = {
static const char *errorOptions[] = {
"severity", "sqlstate", "primary", "detail",
"hint", "position", "internal_position", "internal_query",
"context", "file", "line", "function", (char *)NULL
Expand Down Expand Up @@ -1382,7 +1378,7 @@ Pg_result(ClientData cData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
*/
for (tupno = 0; tupno < PQntuples(result); tupno++)
{
CONST84 char *field0 = PGgetvalue(result, resultid->nullValueString, tupno, 0);
const char *field0 = PGgetvalue(result, resultid->nullValueString, tupno, 0);

for (i = 1; i < PQnfields(result); i++)
{
Expand Down Expand Up @@ -1806,7 +1802,7 @@ Pg_execute(ClientData cData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]
int tupno;
int ntup;
int loop_rc;
CONST84 char *array_varname = NULL;
const char *array_varname = NULL;
char *arg;
char *connString;
char *queryString;
Expand Down Expand Up @@ -2054,7 +2050,7 @@ Pg_execute(ClientData cData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]
column names, or into an array indexed by the column names.
**********************************/
static int
execute_put_values(Tcl_Interp *interp, CONST84 char *array_varname,
execute_put_values(Tcl_Interp *interp, const char *array_varname,
PGresult *result, char *nullValueString, int tupno)
{
int i;
Expand Down Expand Up @@ -3477,7 +3473,7 @@ Pg_sendquery(ClientData cData, Tcl_Interp *interp, int objc,
Pg_ConnectionId *connid;
PGconn *conn;
int status;
CONST84 char *connString = NULL;
const char *connString = NULL;
const char *execString = NULL;
char *newExecString = NULL;
const char **paramValues = NULL;
Expand Down Expand Up @@ -3836,7 +3832,7 @@ Pg_getdata(ClientData cData, Tcl_Interp *interp, int objc,
char *connString;
int optIndex;

static CONST84 char *options[] = {
static const char *options[] = {
"-result", "-connection", NULL
};

Expand Down Expand Up @@ -4597,9 +4593,9 @@ Pg_dbinfo(ClientData cData, Tcl_Interp *interp, int objc,
Tcl_Channel conn_chan;
const char *paramname;

static CONST84 char *cmdargs = "connections|results|version|protocol|param|backendpid|socket|sql_count|dbname|user|password|host|port|options|status|transaction_status|error_message|needs_password|used_password|used_ssl";
static const char *cmdargs = "connections|results|version|protocol|param|backendpid|socket|sql_count|dbname|user|password|host|port|options|status|transaction_status|error_message|needs_password|used_password|used_ssl";

static CONST84 char *options[] = {
static const char *options[] = {
"connections", "results", "version", "protocol",
"param", "backendpid", "socket", "sql_count",
"dbname", "user", "password", "host", "port",
Expand Down Expand Up @@ -4933,7 +4929,7 @@ Pg_sql(ClientData cData, Tcl_Interp *interp, int objc,
PGconn *conn;
PGresult *result = NULL;
int iResult = 0;
CONST84 char *connString;
const char *connString;
const char *execString;
const char **paramValues = NULL;
int *binValues = NULL;
Expand All @@ -4946,9 +4942,9 @@ Pg_sql(ClientData cData, Tcl_Interp *interp, int objc,
int params=0,binparams=0,binresults=0,callback=0,async=0,prepared=0;
unsigned char flags = 0;

static CONST84 char *cmdargs = "";
static const char *cmdargs = "";

static CONST84 char *options[] = {
static const char *options[] = {
"-params", "-binparams", "-binresults", "-callback",
"-async", "-prepared", NULL
};
Expand Down
18 changes: 7 additions & 11 deletions generic/pgtclId.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@
#include "pgtclCmds.h"
#include "pgtclId.h"

#ifndef CONST84
# define CONST84
#endif

static int
PgEndCopy(Pg_ConnectionId * connid, int *errorCodePtr)
{
Expand Down Expand Up @@ -284,7 +280,7 @@ PgConnCmd(ClientData cData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
Pg_ConnectionId *connid;
int returnCode = TCL_ERROR;

static CONST84 char *options[] = {
static const char *options[] = {
"quote", "escape_bytea", "unescape_bytea", "disconnect", "exec",
"sqlexec", "execute", "select",
"listen", "on_connection_loss", "lo_creat", "lo_open", "lo_close",
Expand Down Expand Up @@ -659,7 +655,7 @@ PgResultCmd(ClientData cData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[
* Get back the connection from the Id
*/
PGconn *
PgGetConnectionId(Tcl_Interp *interp, CONST84 char *id, Pg_ConnectionId ** connid_p)
PgGetConnectionId(Tcl_Interp *interp, const char *id, Pg_ConnectionId ** connid_p)
{
Tcl_Channel conn_chan;
Pg_ConnectionId *connid;
Expand Down Expand Up @@ -820,7 +816,7 @@ PgDelConnectionId(DRIVER_DEL_PROTO)
*/

int
PgSetResultId(Tcl_Interp *interp, CONST84 char *connid_c, PGresult *res, int *idPtr)
PgSetResultId(Tcl_Interp *interp, const char *connid_c, PGresult *res, int *idPtr)
{
Tcl_Channel conn_chan;
Pg_ConnectionId *connid;
Expand Down Expand Up @@ -911,7 +907,7 @@ PgSetResultId(Tcl_Interp *interp, CONST84 char *connid_c, PGresult *res, int *id


static int
getresid(Tcl_Interp *interp, CONST84 char *id, Pg_ConnectionId ** connid_p)
getresid(Tcl_Interp *interp, const char *id, Pg_ConnectionId ** connid_p)
{
Tcl_Channel conn_chan;
char *mark;
Expand Down Expand Up @@ -956,7 +952,7 @@ getresid(Tcl_Interp *interp, CONST84 char *id, Pg_ConnectionId ** connid_p)
* Get back the result pointer from the Id
*/
PGresult *
PgGetResultId(Tcl_Interp *interp, CONST84 char *id, Pg_resultid **resultidPtr)
PgGetResultId(Tcl_Interp *interp, const char *id, Pg_resultid **resultidPtr)
{
Pg_ConnectionId *connid;
int resid;
Expand All @@ -978,7 +974,7 @@ PgGetResultId(Tcl_Interp *interp, CONST84 char *id, Pg_resultid **resultidPtr)
* Remove a result Id from the hash tables
*/
void
PgDelResultId(Tcl_Interp *interp, CONST84 char *id)
PgDelResultId(Tcl_Interp *interp, const char *id)
{
Pg_ConnectionId *connid;
Pg_resultid *resultid;
Expand Down Expand Up @@ -1006,7 +1002,7 @@ PgDelResultId(Tcl_Interp *interp, CONST84 char *id)
* Get the connection Id from the result Id
*/
int
PgGetConnByResultId(Tcl_Interp *interp, CONST84 char *resid_c)
PgGetConnByResultId(Tcl_Interp *interp, const char *resid_c)
{
char *mark;
Tcl_Channel conn_chan;
Expand Down
16 changes: 6 additions & 10 deletions generic/pgtclId.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
*-------------------------------------------------------------------------
*/

#ifndef CONST84
# define CONST84
#endif

#define RES_HARD_MAX 128
#define RES_START 16

Expand Down Expand Up @@ -103,21 +99,21 @@ typedef struct Pg_ConnectionId_s

extern int PgSetConnectionId(Tcl_Interp *interp, PGconn *conn, char *connhandle);

#define DRIVER_OUTPUT_PROTO ClientData cData, CONST84 char *buf, int bufSize, \
#define DRIVER_OUTPUT_PROTO ClientData cData, const 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

extern PGconn *PgGetConnectionId(Tcl_Interp *interp, CONST84 char *id,
extern PGconn *PgGetConnectionId(Tcl_Interp *interp, const char *id,
Pg_ConnectionId **);
extern int PgDelConnectionId(DRIVER_DEL_PROTO);
extern int PgOutputProc(DRIVER_OUTPUT_PROTO);
extern int PgInputProc(DRIVER_INPUT_PROTO);
extern int PgSetResultId(Tcl_Interp *interp, CONST84 char *connid, PGresult *res, int *idPtr);
extern PGresult *PgGetResultId(Tcl_Interp *interp, CONST84 char *id, Pg_resultid **resultidPtr);
extern void PgDelResultId(Tcl_Interp *interp, CONST84 char *id);
extern int PgGetConnByResultId(Tcl_Interp *interp, CONST84 char *resid);
extern int PgSetResultId(Tcl_Interp *interp, const char *connid, PGresult *res, int *idPtr);
extern PGresult *PgGetResultId(Tcl_Interp *interp, const char *id, Pg_resultid **resultidPtr);
extern void PgDelResultId(Tcl_Interp *interp, const char *id);
extern int PgGetConnByResultId(Tcl_Interp *interp, const char *resid);
extern void PgStartNotifyEventSource(Pg_ConnectionId * connid);
extern void PgStopNotifyEventSource(Pg_ConnectionId * connid, pqbool allevents);
extern void PgNotifyTransferEvents(Pg_ConnectionId * connid);
Expand Down
6 changes: 1 addition & 5 deletions generic/pgtclSqlite.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@

#include <sqlite3.h>

#ifndef CONST84
# define CONST84
#endif

#define LAPPEND_STRING(i, o, s) Tcl_ListObjAppendElement((i), (o), Tcl_NewStringObj((s), -1));

// From tclsqlite.c, part 1 of the hack, sqlite3 conveniently guarantees that the first element in
Expand Down Expand Up @@ -883,7 +879,7 @@ Pg_sqlite(ClientData clientdata, Tcl_Interp *interp, int objc, Tcl_Obj *CONST ob
sqlite3 *sqlite_db;
int cmdIndex;

static CONST84 char *subCommands[] = {
static const char *subCommands[] = {
"info", "import_postgres_result", "write_tabsep", "read_tabsep", "read_tabsep_keylist",
(char *)NULL
};
Expand Down

0 comments on commit 0c2eca9

Please sign in to comment.