Check-in [dfae39d1f3]
Not logged in
Overview
Comment:changes for 8.1
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: dfae39d1f30e7e7fce43655c592564694b9a48bf
User & Date: johannes@zellner.org on 1999-05-08 14:22:49
Other Links: manifest | tags
Context
1999-05-10
11:10
before initial relase check-in: 8e3e39bef5 user: johannes@zellner.org tags: trunk
1999-05-08
14:22
changes for 8.1 check-in: dfae39d1f3 user: johannes@zellner.org tags: trunk
1999-03-01
12:38
*** empty log message *** check-in: 701dc63beb user: johannes@zellner.org tags: trunk
Changes

Modified Makefile.in from [8b163bbc13] to [52046d456f].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# -*- make -*-
#
# FILE: "/home/joze/src/tclreadline/Makefile.in"
# LAST MODIFIED: "Sun Feb 28 19:44:53 1999 (joze)"
# (C) 1998, 1999 by Johannes Zellner
# Johannes.Zellner@physik.uni-karlsruhe.de
# $Id$
# ---
#
# tclreadline -- gnu readline for tcl
# Copyright (C) 1999  Johannes Zellner
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#
# Johannes.Zellner@physik.uni-karlsruhe.de
# http://krisal.physik.uni-karlsruhe.de/~joze

# ================================================================== 


MAJOR_VERSION = @TCLREADLINE_MAJOR_VERSION@
MINOR_VERSION = @TCLREADLINE_MINOR_VERSION@
VERSION = @TCLREADLINE_VERSION@

#host = @host@
#host_cpu = @host_cpu@
#host_vendor = @host_vendor@
#host_os = @host_os@

srcdir=@srcdir@
VPATH=@srcdir@

#----------------------------------------------------------------
# Things you can change to personalize the Makefile for your own
# site (you can make these changes in either Makefile.in or
# Makefile, but changes to Makefile will get lost if you re-run
# the configuration script).
#----------------------------------------------------------------

# Default top-level directories in which to install architecture-
# specific files (exec_prefix) and machine-independent files such
# as scripts (prefix).  The values specified here may be overridden
# at configure-time with the --exec-prefix and --prefix options
# to the "configure" script.

prefix =		@prefix@
exec_prefix =		@exec_prefix@

# The following definition can be set to non-null for special systems
# like AFS with replication.  It allows the pathnames used for installation
# to be different than those used for actually reference files at
# run-time.  INSTALL_ROOT is prepended to $prefix and $exec_prefix
# when installing files.
INSTALL_ROOT =

# Directory from which applications will reference the library of Tcl
# scripts (note: you can set the TCLREADLINE_LIBRARY environment variable at
# run-time to override the compiled-in location):
TCLREADLINE_LIBRARY = @TCLREADLINE_LIBRARY@

# Path name to use when installing library scripts:
LIBRARY_INSTALL_DIR =	$(INSTALL_ROOT)$(TCLREADLINE_LIBRARY)

# Directory in which to install the archive libitk.a:
LIB_INSTALL_DIR =	$(INSTALL_ROOT)$(exec_prefix)/lib

# Path to use at runtime to refer to LIB_INSTALL_DIR:
LIB_RUNTIME_DIR =	$(exec_prefix)/lib

# Top-level directory for manual entries:
MAN_INSTALL_DIR =	$(INSTALL_ROOT)$(prefix)/man

# Directory in which to install manual entries for the built-in
# Tcl commands implemented by Tk:
MANN_INSTALL_DIR =	$(MAN_INSTALL_DIR)/mann


# To change the compiler switches, for example to change from -O
# to -g, change the following line:
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@

# To disable ANSI-C procedure prototypes reverse the comment characters
# on the following lines:
PROTO_FLAGS =
#PROTO_FLAGS = -DNO_PROTOTYPE


# Some versions of make, like SGI's, use the following variable to
# determine which shell to use for executing commands:
SHELL =		/bin/sh

# Tk used to let the configure script choose which program to use
# for installing, but there are just too many different versions of
# "install" around;  better to use the install-sh script that comes
# with the distribution, which is slower but guaranteed to work.

INSTALL = $(TOP_DIR)/aux/install-sh -c
INSTALL_PROGRAM =	${INSTALL}
INSTALL_DATA =		${INSTALL} -m 644
MKINSTALLDIRS =		$(TOP_DIR)/aux/mkinstalldirs

# The symbols below provide support for dynamic loading and shared
# libraries.  The values of the symbols are normally set by the
# configure script.  You shouldn't normally need to modify any of
# these definitions by hand.

SHLIB_CFLAGS = @SHLIB_CFLAGS@

<
|
|
|
<




















|
|
>





|

|
|
|
|

|
|














|
|














|


|


|


|



|















|






|
|
|
|







1

2
3
4

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# -*- make -*-

# FILE: "/krispc6/home/joze/src/tclreadline/Makefile.in"
# LAST MODIFICATION: "Sat May  8 15:10:15 1999 (joze)"
# (C) 1998, 1999 by Johannes Zellner, <johannes@zellner.org>

# $Id$
# ---
#
# tclreadline -- gnu readline for tcl
# Copyright (C) 1999  Johannes Zellner
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#
# johannes@zellner.org
# http://www.zellner.org/tclreadline/
#
# ================================================================== 


MAJOR_VERSION = @TCLREADLINE_MAJOR_VERSION@
MINOR_VERSION = @TCLREADLINE_MINOR_VERSION@
VERSION       = @TCLREADLINE_VERSION@

#host         = @host@
#host_cpu     = @host_cpu@
#host_vendor  = @host_vendor@
#host_os      = @host_os@

srcdir        = @srcdir@
VPATH         = @srcdir@

#----------------------------------------------------------------
# Things you can change to personalize the Makefile for your own
# site (you can make these changes in either Makefile.in or
# Makefile, but changes to Makefile will get lost if you re-run
# the configuration script).
#----------------------------------------------------------------

# Default top-level directories in which to install architecture-
# specific files (exec_prefix) and machine-independent files such
# as scripts (prefix).  The values specified here may be overridden
# at configure-time with the --exec-prefix and --prefix options
# to the "configure" script.

prefix      = @prefix@
exec_prefix = @exec_prefix@

# The following definition can be set to non-null for special systems
# like AFS with replication.  It allows the pathnames used for installation
# to be different than those used for actually reference files at
# run-time.  INSTALL_ROOT is prepended to $prefix and $exec_prefix
# when installing files.
INSTALL_ROOT =

# Directory from which applications will reference the library of Tcl
# scripts (note: you can set the TCLREADLINE_LIBRARY environment variable at
# run-time to override the compiled-in location):
TCLREADLINE_LIBRARY = @TCLREADLINE_LIBRARY@

# Path name to use when installing library scripts:
LIBRARY_INSTALL_DIR = $(INSTALL_ROOT)$(TCLREADLINE_LIBRARY)

# Directory in which to install the archive libitk.a:
LIB_INSTALL_DIR = $(INSTALL_ROOT)$(exec_prefix)/lib

# Path to use at runtime to refer to LIB_INSTALL_DIR:
LIB_RUNTIME_DIR = $(exec_prefix)/lib

# Top-level directory for manual entries:
MAN_INSTALL_DIR = $(INSTALL_ROOT)$(prefix)/man

# Directory in which to install manual entries for the built-in
# Tcl commands implemented by Tk:
MANN_INSTALL_DIR = $(MAN_INSTALL_DIR)/mann


# To change the compiler switches, for example to change from -O
# to -g, change the following line:
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@

# To disable ANSI-C procedure prototypes reverse the comment characters
# on the following lines:
PROTO_FLAGS =
#PROTO_FLAGS = -DNO_PROTOTYPE


# Some versions of make, like SGI's, use the following variable to
# determine which shell to use for executing commands:
SHELL = /bin/sh

# Tk used to let the configure script choose which program to use
# for installing, but there are just too many different versions of
# "install" around;  better to use the install-sh script that comes
# with the distribution, which is slower but guaranteed to work.

INSTALL         = $(TOP_DIR)/aux/install-sh -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA    = ${INSTALL} -m 644
MKINSTALLDIRS   = $(TOP_DIR)/aux/mkinstalldirs

# The symbols below provide support for dynamic loading and shared
# libraries.  The values of the symbols are normally set by the
# configure script.  You shouldn't normally need to modify any of
# these definitions by hand.

SHLIB_CFLAGS = @SHLIB_CFLAGS@
127
128
129
130
131
132
133
134
135
136
137
138



139
140
141
142
143
144
145

#----------------------------------------------------------------
# The information below is modified by the configure script when
# Makefile is generated from Makefile.in.  You shouldn't normally
# modify any of this stuff by hand.
#----------------------------------------------------------------

RANLIB =		@RANLIB@
TOP_DIR =		@srcdir@
TCL_INCLUDE_DIR =	@TCL_INCLUDE_DIR@
READLINE_INCLUDE_DIR =	@READLINE_INCLUDE_DIR@
TCLREADLINE_LIB_FILE =	@TCLREADLINE_LIB_FILE@




#----------------------------------------------------------------
# The information below should be usable as is.  The configure
# script won't modify it and you shouldn't need to modify it
# either.
#----------------------------------------------------------------








|
|
|
|
|
>
>
>







126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147

#----------------------------------------------------------------
# The information below is modified by the configure script when
# Makefile is generated from Makefile.in.  You shouldn't normally
# modify any of this stuff by hand.
#----------------------------------------------------------------

RANLIB               = @RANLIB@
TOP_DIR              = $(srcdir)
TCL_INCLUDE_DIR      = @TCL_INCLUDE_DIR@
READLINE_INCLUDE_DIR = @READLINE_INCLUDE_DIR@
TCLREADLINE_LIB_FILE = @TCLREADLINE_LIB_FILE@

READLINE_LIB         = -L@READLINE_LIB_DIR@ -lreadline
TERMCAP_LIB          = -L@TERMCAP_LIB_DIR@ -l@TERMCAP_LIB@

#----------------------------------------------------------------
# The information below should be usable as is.  The configure
# script won't modify it and you shouldn't need to modify it
# either.
#----------------------------------------------------------------

182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
.SUFFIXES: .c .o .so .sl .tcl

all: $(TCLREADLINE_LIB_FILE) pkgIndex.tcl


@TCLREADLINE_LIB_FILE@: ${OBJS}
	rm -f $(TCLREADLINE_LIB_FILE)
	@MAKE_LIB@
	$(RANLIB) $(TCLREADLINE_LIB_FILE)

install: install-binaries install-libraries install-man
install-man: $(MANN_INSTALL_DIR)/$(MAN)

install-binaries: $(TCLREADLINE_LIB_FILE)
	@$(MKINSTALLDIRS) $(LIBRARY_INSTALL_DIR)







|







184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
.SUFFIXES: .c .o .so .sl .tcl

all: $(TCLREADLINE_LIB_FILE) pkgIndex.tcl


@TCLREADLINE_LIB_FILE@: ${OBJS}
	rm -f $(TCLREADLINE_LIB_FILE)
	@MAKE_LIB@ $(TERMCAP_LIB) $(READLINE_LIB)
	$(RANLIB) $(TCLREADLINE_LIB_FILE)

install: install-binaries install-libraries install-man
install-man: $(MANN_INSTALL_DIR)/$(MAN)

install-binaries: $(TCLREADLINE_LIB_FILE)
	@$(MKINSTALLDIRS) $(LIBRARY_INSTALL_DIR)
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
	$(INSTALL_DATA) tclreadlineConfig.sh $(LIBRARY_INSTALL_DIR)

FORCE:

$(MANN_INSTALL_DIR)/$(MAN): FORCE
	- $(INSTALL_DATA) $(srcdir)/$(MAN) $@ &&  chmod 644 $@

pkgIndex.tcl: FORCE
	@echo "eval pkg_mkIndex $(TOP_DIR) tclreadline*.tcl" | tclsh

Makefile: $(TOP_DIR)/Makefile.in
	$(SHELL) config.status

clean:
	rm -f *.a *.o core errs *~ \#* tags* *.E a.out errors so_locations







|







212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
	$(INSTALL_DATA) tclreadlineConfig.sh $(LIBRARY_INSTALL_DIR)

FORCE:

$(MANN_INSTALL_DIR)/$(MAN): FORCE
	- $(INSTALL_DATA) $(srcdir)/$(MAN) $@ &&  chmod 644 $@

pkgIndex.tcl:
	@echo "eval pkg_mkIndex $(TOP_DIR) tclreadline*.tcl" | tclsh

Makefile: $(TOP_DIR)/Makefile.in
	$(SHELL) config.status

clean:
	rm -f *.a *.o core errs *~ \#* tags* *.E a.out errors so_locations

Modified README from [9b0fb9d8aa] to [e9f79be895].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
   
    FILE: "/home/joze/src/tclreadline/README"
    LAST MODIFIED: "Sun Feb 28 18:19:34 1999 (joze)"
    (C) 1998, 1999 by Johannes Zellner
    Johannes.Zellner@physik.uni-karlsruhe.de
    $Id$
    ---

    tclreadline -- gnu readline for tcl
    Copyright (C) 1999  Johannes Zellner

    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation; either version 2
    of the License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

    Johannes.Zellner@physik.uni-karlsruhe.de
    http://krisal.physik.uni-karlsruhe.de/~joze


tclreadline


1. Introduction
---------------
|
|
|
|
<




















|
<







1
2
3
4

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

26
27
28
29
30
31
32

    FILE: "/krispc6/home/joze/src/tclreadline/README"
    LAST MODIFICATION: "Sat May  8 14:05:41 1999 (joze)"
    (C) 1998, 1999 by Johannes Zellner, <johannes@zellner.org>

    $Id$
    ---

    tclreadline -- gnu readline for tcl
    Copyright (C) 1999  Johannes Zellner

    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation; either version 2
    of the License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

    <johannes@zellner.org>, http://www.zellner.org/tclreadline/



tclreadline


1. Introduction
---------------

Added sample.tclshrc version [693bb1ae82].



































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/local/bin/tclsh
#
# FILE: "/krispc6/home/joze/src/tclreadline/sample.tclshrc"
# LAST MODIFICATION: "Sat May  8 14:02:19 1999 (joze)"
# (C) 1999 by Johannes Zellner
# johannes@zellner.org
# $Id$



if {$tcl_interactive} {
    package require tclreadline
    namespace import ::tclreadline::Print
#    ::tclreadline::Print no
    ::tclreadline::Loop
}

Modified tclreadline.c from [83b24cf018] to [73a4a8f6a3].

1
2

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

36
37
38
39
40
41
42
43

44
45
46

47
48
49
50
51
52
53
54
55
56
57
58
59

 /* ==================================================================

    FILE: "/home/joze/src/tclreadline/tclreadline.c"
    LAST MODIFIED: "Sun Feb 28 15:01:31 1999 (joze)"
    (C) 1998, 1999 by Johannes Zellner
    Johannes.Zellner@physik.uni-karlsruhe.de
    $Id$
    ---

    tclreadline -- gnu readline for tcl
    Copyright (C) 1999  Johannes Zellner

    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation; either version 2
    of the License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

    Johannes.Zellner@physik.uni-karlsruhe.de
    http://krisal.physik.uni-karlsruhe.de/~joze
    ================================================================== */  


#include <tcl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <readline.h>
#include <history.h>

#include <tclreadline.h>

#define MALLOC(size) Tcl_Alloc ((int) size)
#define FREE(ptr) if (ptr) Tcl_Free ((char *) ptr)


#define _CMD_SET	(1 << 0)
#define _CMD_GET	(1 << 1)
#define _CMD_SUB_GET	(1 << 2)



typedef struct cmds_t {
    struct cmds_t *prev;
    char **cmd;
    struct cmds_t *next;
} cmds_t;


#define STRIPLEFT(ptr)          \
do {                            \
    char *tmp = ptr;            \
    while (*tmp && *tmp <= ' ') \


>
|
|
|
<




















|
|







>








>
|
|
|
>



|
|
|







1
2
3
4
5
6

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62

 /* ==================================================================

    FILE: "/krispc6/home/joze/src/tclreadline/tclreadline.c"
    LAST MODIFICATION: "Sat May  8 16:20:59 1999 (joze)"
    (C) 1998, 1999 by Johannes Zellner, <johannes@zellner.org>

    $Id$
    ---

    tclreadline -- gnu readline for tcl
    Copyright (C) 1999  Johannes Zellner

    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation; either version 2
    of the License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

    <johannes@zellner.org>, http://www.zellner.org/tclreadline/

    ================================================================== */  


#include <tcl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define READLINE_LIBRARY
#include <readline.h>
#include <history.h>

#include <tclreadline.h>

#define MALLOC(size) Tcl_Alloc ((int) size)
#define FREE(ptr) if (ptr) Tcl_Free ((char *) ptr)

enum {
    _CMD_SET     = (1 << 0),
    _CMD_GET     = (1 << 1),
    _CMD_SUB_GET = (1 << 2)
};


typedef struct cmds_t {
    struct cmds_t  *prev;
    char          **cmd;
    struct cmds_t  *next;
} cmds_t;


#define STRIPLEFT(ptr)          \
do {                            \
    char *tmp = ptr;            \
    while (*tmp && *tmp <= ' ') \
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#define STRIPWHITE(ptr) \
do {                    \
    STRIPLEFT (ptr);    \
    STRIPRIGHT (ptr);   \
} while (0)





/*
 * forward declarations.
 */
int	TclReadlineCmd	(ClientData clientData, Tcl_Interp *interp,
                         int argc, char **argv);
void	TclReadlineDataAvailableHandler	(ClientData clientData, int mask);
void	TclReadlineLineCompleteHandler	(char *ptr);
int	Tclreadline_SafeInit	(Tcl_Interp *interp);
int	Tclreadline_Init	(Tcl_Interp *interp);
char	*TclReadlineInitialize	(char *historyfile);
char	**TclReadlineCompletion	(char *text, int start, int end);
char	*TclReadline0generator	(char *text, int state);
char	*TclReadline1generator	(char *text, int state);
char	*TclReadlineKnownCommands	(char *text, int state, int mode);
int	TclReadlineEventHook	(void);
int	TclReadlineParse	(char **args, int maxargs, char *buf);


static int line_complete = 0;
static char *line = (char *) NULL;


/*







<
<
<



|

|
|
|
|
|
|
|
|
|
|
|







75
76
77
78
79
80
81



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#define STRIPWHITE(ptr) \
do {                    \
    STRIPLEFT (ptr);    \
    STRIPRIGHT (ptr);   \
} while (0)





/*
 * forward declarations.
 */
int    TclReadlineCmd	(ClientData clientData, Tcl_Interp *interp,
                         int argc, char **argv);
void   TclReadlineDataAvailableHandler	(ClientData clientData, int mask);
void   TclReadlineLineCompleteHandler	(char *ptr);
int    Tclreadline_SafeInit	(Tcl_Interp *interp);
int    Tclreadline_Init	(Tcl_Interp *interp);
char*  TclReadlineInitialize	(char *historyfile);
char** TclReadlineCompletion	(char *text, int start, int end);
char*  TclReadline0generator	(char *text, int state);
char*  TclReadline1generator	(char *text, int state);
char*  TclReadlineKnownCommands	(char *text, int state, int mode);
int    TclReadlineEventHook	(void);
int    TclReadlineParse	(char **args, int maxargs, char *buf);


static int line_complete = 0;
static char *line = (char *) NULL;


/*
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
	for (c = 0; c < argc; c++)
	    fprintf (stderr, "argv[%d] = %s\n", c, argv[c]);
	return TCL_ERROR;
    }

    c = argv[1][0];
    length = strlen(argv[1]);



    if (c == 'r'  && strncmp (argv[1], "read", length) == 0) {
        
        char *expansion = (char *) NULL;
        int status;
        







<







122
123
124
125
126
127
128

129
130
131
132
133
134
135
	for (c = 0; c < argc; c++)
	    fprintf (stderr, "argv[%d] = %s\n", c, argv[c]);
	return TCL_ERROR;
    }

    c = argv[1][0];
    length = strlen(argv[1]);



    if (c == 'r'  && strncmp (argv[1], "read", length) == 0) {
        
        char *expansion = (char *) NULL;
        int status;
        
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
int Tclreadline_SafeInit (Tcl_Interp *interp)
{
    return (Tclreadline_Init (interp));
}

int Tclreadline_Init (Tcl_Interp *interp)
{
    
    Tcl_CreateCommand (interp, "::tclreadline::readline", TclReadlineCmd,
	    (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);

    return (Tcl_PkgProvide (interp, "tclreadline", TCLREADLINE_VERSION));
}

char *TclReadlineInitialize (char *historyfile)
{

    rl_readline_name = "tclreadline";







<


<







225
226
227
228
229
230
231

232
233

234
235
236
237
238
239
240
int Tclreadline_SafeInit (Tcl_Interp *interp)
{
    return (Tclreadline_Init (interp));
}

int Tclreadline_Init (Tcl_Interp *interp)
{

    Tcl_CreateCommand (interp, "::tclreadline::readline", TclReadlineCmd,
	    (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);

    return (Tcl_PkgProvide (interp, "tclreadline", TCLREADLINE_VERSION));
}

char *TclReadlineInitialize (char *historyfile)
{

    rl_readline_name = "tclreadline";
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
         */
        while ((*buf == ' ') || (*buf == '\t') || (*buf == '\n'))
            *buf++ = '\0';

        if (!(*buf)) /* don't count the terminating NULL */
            break;

        /* -----------------
         * Save the argument.
         * -----------------
         */
        *args++ = buf;
        nr++;

        /* ----------------------
         * Skip over the argument.
         * ----------------------
         */
        while ((*buf!='\0') && (*buf!=' ') && (*buf!='\t') && (*buf!='\n'))
            buf++;
    }

    *args = '\0';
    return nr;

}







<
<
<
<



<
<
<
<








413
414
415
416
417
418
419




420
421
422




423
424
425
426
427
428
429
430
         */
        while ((*buf == ' ') || (*buf == '\t') || (*buf == '\n'))
            *buf++ = '\0';

        if (!(*buf)) /* don't count the terminating NULL */
            break;





        *args++ = buf;
        nr++;





        while ((*buf!='\0') && (*buf!=' ') && (*buf!='\t') && (*buf!='\n'))
            buf++;
    }

    *args = '\0';
    return nr;

}

Modified tclreadline.h.in from [9edfb6a933] to [a6316a5a56].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

 /* ==================================================================
   
    FILE: "/home/joze/src/tclreadline/tclreadline.h.in"
    LAST MODIFIED: "Sun Feb 28 15:04:08 1999 (joze)"
    (C) 1998, 1999 by Johannes Zellner
    Johannes.Zellner@physik.uni-karlsruhe.de
    $Id$
    ---

    tclreadline -- gnu readline for tcl
    Copyright (C) 1999  Johannes Zellner

    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation; either version 2
    of the License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

    Johannes.Zellner@physik.uni-karlsruhe.de
    http://krisal.physik.uni-karlsruhe.de/~joze

    ================================================================== */  

static char *TCLREADLINE_VERSION = "@TCLREADLINE_VERSION@";




|
|
|
<




















|
|





1
2
3
4
5
6

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

 /* ==================================================================
   
    FILE: "/krispc6/home/joze/src/tclreadline/tclreadline.h.in"
    LAST MODIFICATION: "Sat May  8 14:03:02 1999 (joze)"
    (C) 1998, 1999 by Johannes Zellner, <johannes@zellner.org>

    $Id$
    ---

    tclreadline -- gnu readline for tcl
    Copyright (C) 1999  Johannes Zellner

    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation; either version 2
    of the License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

    johannes@zellner.org
    http://www.zellner.org/tclreadline/

    ================================================================== */  

static char *TCLREADLINE_VERSION = "@TCLREADLINE_VERSION@";

Modified tclreadline.n.in from [9557ae4fe6] to [7f71db01a7].

1
2

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
.TH tclreadline n "@TCLREADLINE_VERSION@" "Johannes Zellner"


.\" FILE: "/home/joze/src/tclreadline/tclreadline.n.in"
.\" LAST MODIFIED: "Mon Mar  1 13:38:15 1999 (joze)"
.\" (C) 1999 by Johannes Zellner
.\" Johannes.Zellner@physik.uni-karlsruhe.de
.\" $Id$
.\" ---
.\"
.\" tclreadline -- gnu readline for the tcl scripting language
.\" Copyright (C) 1999  Johannes Zellner
.\"
.\" This program is free software; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License
.\" as published by the Free Software Foundation; either version 2
.\" of the License, or (at your option) any later version.
.\"
.\" This program is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public License
.\" along with this program; if not, write to the Free Software
.\" Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
.\"
.\" Johannes.Zellner@physik.uni-karlsruhe.de
.\" http://krisal.physik.uni-karlsruhe.de/~joze


.SH NAME
tclreadline \- gnu readline for the tcl scripting language


.SH SYNOPSIS


>
|
|
|
<




















|
<







1
2
3
4
5
6

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

28
29
30
31
32
33
34
.TH tclreadline n "@TCLREADLINE_VERSION@" "Johannes Zellner"

.\" (C) 1999 by Johannes Zellner
.\" FILE: "/krispc6/home/joze/src/tclreadline/tclreadline.n.in"
.\" LAST MODIFICATION: "Sat May  8 14:07:46 1999 (joze)"
.\" (C) 1998, 1999 by Johannes Zellner, <johannes@zellner.org>

.\" $Id$
.\" ---
.\"
.\" tclreadline -- gnu readline for the tcl scripting language
.\" Copyright (C) 1999  Johannes Zellner
.\"
.\" This program is free software; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License
.\" as published by the Free Software Foundation; either version 2
.\" of the License, or (at your option) any later version.
.\"
.\" This program is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public License
.\" along with this program; if not, write to the Free Software
.\" Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
.\"
.\" <johannes@zellner.org>, http://www.zellner.org/tclreadline/



.SH NAME
tclreadline \- gnu readline for the tcl scripting language


.SH SYNOPSIS
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217


.PP
The official \fBtclreadline\fP web site at:

.PP
.RS 4
http://krisal.physik.uni-karlsruhe.de/tclreadline/index.html
.RE


.SH AUTHOR(S)
Johannes Zellner
.br
<Johannes.Zellner@physik.uni-karlsruhe.de>
.br
If you want to be listed here, you have to contribute to the code :-)
(see below).


.SH HISTORY
This version of \fBtclreadline\fP is still a development version.
Pretty a lot of features and ideas are not implemented yet. The
reason for this is the lack of time and manpower.
So you are welcome to modify and contribute to the code.
If you have suggestions, please let me know.









|






|













189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216


.PP
The official \fBtclreadline\fP web site at:

.PP
.RS 4
http://www.zellner.org/tclreadline/
.RE


.SH AUTHOR(S)
Johannes Zellner
.br
<johannes@zellner.org>
.br
If you want to be listed here, you have to contribute to the code :-)
(see below).


.SH HISTORY
This version of \fBtclreadline\fP is still a development version.
Pretty a lot of features and ideas are not implemented yet. The
reason for this is the lack of time and manpower.
So you are welcome to modify and contribute to the code.
If you have suggestions, please let me know.


Modified tclreadlineConfig.sh.in from [6ae67959cd] to [b0b13d39ee].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# -*- sh -*-
#
# FILE: "/home/joze/src/tclreadline/tclreadlineConfig.sh.in"
# LAST MODIFIED: "Sun Feb 28 15:27:46 1999 (joze)"
# (C) 1998, 1999 by Johannes Zellner
# Johannes.Zellner@physik.uni-karlsruhe.de
# $Id$
# ---
#
# tclreadline -- gnu readline for tcl
# Copyright (C) 1999  Johannes Zellner
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#
# Johannes.Zellner@physik.uni-karlsruhe.de
# http://krisal.physik.uni-karlsruhe.de/~joze
#
# ================================================================== 
# 
# This shell script (for sh) is generated automatically by tclreadline's
# configure script.  It will create shell variables for most of
# the configuration options discovered by the configure script.
# This script is intended to be included by the configure scripts
<
|
|
|
|
<




















|
|








1
2
3
4

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

#!/bin/sh
# FILE: "/krispc6/home/joze/src/tclreadline/tclreadlineConfig.sh.in"
# LAST MODIFICATION: "Sat May  8 14:03:17 1999 (joze)"
# (C) 1998, 1999 by Johannes Zellner, <johannes@zellner.org>

# $Id$
# ---
#
# tclreadline -- gnu readline for tcl
# Copyright (C) 1999  Johannes Zellner
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#
# johannes@zellner.org
# http://www.zellner.org/tclreadline/
#
# ================================================================== 
# 
# This shell script (for sh) is generated automatically by tclreadline's
# configure script.  It will create shell variables for most of
# the configuration options discovered by the configure script.
# This script is intended to be included by the configure scripts

Modified tclreadlineInit.tcl.in from [bd7543348e] to [49ecba8dbd].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/local/bin/tclsh
#
# FILE: "/home/joze/src/tclreadline/tclreadlineInit.tcl.in"
# LAST MODIFIED: "Sun Feb 28 15:28:36 1999 (joze)"
# (C) 1998, 1999 by Johannes Zellner
# Johannes.Zellner@physik.uni-karlsruhe.de
# $Id$
# ---
#
# tclreadline -- gnu readline for tcl
# Copyright (C) 1999  Johannes Zellner
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#
# Johannes.Zellner@physik.uni-karlsruhe.de
# http://krisal.physik.uni-karlsruhe.de/~joze
#
# ================================================================== 

package provide tclreadline @TCLREADLINE_VERSION@

namespace eval tclreadline:: {
    namespace export Init
}

proc ::tclreadline::Init {} {
    
    global tclreadline_version
    global tclreadline_library
    
    set tclreadline_version @TCLREADLINE_VERSION@
    set tclreadline_library @TCLREADLINE_LIBRARY@

    catch {load @TERMCAP_LOAD_PATH@}
    catch {load @READLINE_LOAD_PATH@}
    if [catch {load @TCLREADLINE_LIBRARY@/@TCLREADLINE_LIB_FILE@} msg] {
        puts stderr $msg
        exit 2
    }
}


<
|
|
|
<




















|
|

















<
<






1

2
3
4

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43


44
45
46
47
48
49
#!/usr/local/bin/tclsh

# FILE: "/krispc6/home/joze/src/tclreadline/tclreadlineInit.tcl.in"
# LAST MODIFICATION: "Sat May  8 15:02:23 1999 (joze)"
# (C) 1998, 1999 by Johannes Zellner, <johannes@zellner.org>

# $Id$
# ---
#
# tclreadline -- gnu readline for tcl
# Copyright (C) 1999  Johannes Zellner
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#
# johannes@zellner.org
# http://www.zellner.org/tclreadline/
#
# ================================================================== 

package provide tclreadline @TCLREADLINE_VERSION@

namespace eval tclreadline:: {
    namespace export Init
}

proc ::tclreadline::Init {} {
    
    global tclreadline_version
    global tclreadline_library
    
    set tclreadline_version @TCLREADLINE_VERSION@
    set tclreadline_library @TCLREADLINE_LIBRARY@



    if [catch {load @TCLREADLINE_LIBRARY@/@TCLREADLINE_LIB_FILE@} msg] {
        puts stderr $msg
        exit 2
    }
}

Modified tclreadlineSetup.tcl.in from [b4f2d71b1d] to [e96ff9502d].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/local/bin/tclsh
#
# FILE: "/home/joze/src/tclreadline/tclreadlineSetup.tcl"
# LAST MODIFIED: "Sun Feb 28 17:43:42 1999 (joze)"
# (C) 1998, 1999 by Johannes Zellner
# Johannes.Zellner@physik.uni-karlsruhe.de
# $Id$
# ---
#
# tclreadline -- gnu readline for tcl
# Copyright (C) 1999  Johannes Zellner
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#
# Johannes.Zellner@physik.uni-karlsruhe.de
# http://krisal.physik.uni-karlsruhe.de/~joze
#
# ================================================================== 

package provide tclreadline @TCLREADLINE_VERSION@

proc unknown args {


<
|
|
|
<




















|
|







1

2
3
4

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/local/bin/tclsh

# FILE: "/krispc6/home/joze/src/tclreadline/tclreadlineSetup.tcl.in"
# LAST MODIFICATION: "Sat May  8 14:03:47 1999 (joze)"
# (C) 1998, 1999 by Johannes Zellner, <johannes@zellner.org>

# $Id$
# ---
#
# tclreadline -- gnu readline for tcl
# Copyright (C) 1999  Johannes Zellner
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#
# johannes@zellner.org
# http://www.zellner.org/tclreadline/
#
# ================================================================== 

package provide tclreadline @TCLREADLINE_VERSION@

proc unknown args {