Index: Makefile.in ================================================================== --- Makefile.in +++ Makefile.in @@ -1,11 +1,9 @@ # -*- 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 +# FILE: "/krispc6/home/joze/src/tclreadline/Makefile.in" +# LAST MODIFICATION: "Sat May 8 15:10:15 1999 (joze)" +# (C) 1998, 1999 by Johannes Zellner, # $Id$ # --- # # tclreadline -- gnu readline for tcl # Copyright (C) 1999 Johannes Zellner @@ -22,26 +20,27 @@ # # 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 +# 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@ +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 @@ -52,12 +51,12 @@ # 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@ +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 @@ -68,24 +67,24 @@ # 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) +LIBRARY_INSTALL_DIR = $(INSTALL_ROOT)$(TCLREADLINE_LIBRARY) # Directory in which to install the archive libitk.a: -LIB_INSTALL_DIR = $(INSTALL_ROOT)$(exec_prefix)/lib +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 +LIB_RUNTIME_DIR = $(exec_prefix)/lib # Top-level directory for manual entries: -MAN_INSTALL_DIR = $(INSTALL_ROOT)$(prefix)/man +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 +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@ @@ -97,21 +96,21 @@ #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 +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 +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. @@ -129,15 +128,18 @@ # 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@ +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. @@ -184,11 +186,11 @@ all: $(TCLREADLINE_LIB_FILE) pkgIndex.tcl @TCLREADLINE_LIB_FILE@: ${OBJS} rm -f $(TCLREADLINE_LIB_FILE) - @MAKE_LIB@ + @MAKE_LIB@ $(TERMCAP_LIB) $(READLINE_LIB) $(RANLIB) $(TCLREADLINE_LIB_FILE) install: install-binaries install-libraries install-man install-man: $(MANN_INSTALL_DIR)/$(MAN) @@ -212,11 +214,11 @@ FORCE: $(MANN_INSTALL_DIR)/$(MAN): FORCE - $(INSTALL_DATA) $(srcdir)/$(MAN) $@ && chmod 644 $@ -pkgIndex.tcl: FORCE +pkgIndex.tcl: @echo "eval pkg_mkIndex $(TOP_DIR) tclreadline*.tcl" | tclsh Makefile: $(TOP_DIR)/Makefile.in $(SHELL) config.status Index: README ================================================================== --- README +++ README @@ -1,10 +1,9 @@ - - 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 + + FILE: "/krispc6/home/joze/src/tclreadline/README" + LAST MODIFICATION: "Sat May 8 14:05:41 1999 (joze)" + (C) 1998, 1999 by Johannes Zellner, $Id$ --- tclreadline -- gnu readline for tcl Copyright (C) 1999 Johannes Zellner @@ -21,12 +20,11 @@ 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 + , http://www.zellner.org/tclreadline/ tclreadline ADDED sample.tclshrc Index: sample.tclshrc ================================================================== --- sample.tclshrc +++ sample.tclshrc @@ -0,0 +1,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 +} + Index: tclreadline.c ================================================================== --- tclreadline.c +++ tclreadline.c @@ -1,11 +1,11 @@ /* ================================================================== - 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 + + FILE: "/krispc6/home/joze/src/tclreadline/tclreadline.c" + LAST MODIFICATION: "Sat May 8 16:20:59 1999 (joze)" + (C) 1998, 1999 by Johannes Zellner, $Id$ --- tclreadline -- gnu readline for tcl Copyright (C) 1999 Johannes Zellner @@ -22,36 +22,39 @@ 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 + , http://www.zellner.org/tclreadline/ + ================================================================== */ #include #include #include #include +#define READLINE_LIBRARY #include #include #include #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) +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; + struct cmds_t *prev; + char **cmd; + struct cmds_t *next; } cmds_t; #define STRIPLEFT(ptr) \ do { \ @@ -74,29 +77,26 @@ STRIPLEFT (ptr); \ STRIPRIGHT (ptr); \ } while (0) - - - /* * forward declarations. */ -int TclReadlineCmd (ClientData clientData, Tcl_Interp *interp, +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); +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; @@ -124,11 +124,10 @@ return TCL_ERROR; } c = argv[1][0]; length = strlen(argv[1]); - if (c == 'r' && strncmp (argv[1], "read", length) == 0) { char *expansion = (char *) NULL; @@ -228,14 +227,12 @@ 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) { @@ -418,24 +415,16 @@ *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; } Index: tclreadline.h.in ================================================================== --- tclreadline.h.in +++ tclreadline.h.in @@ -1,12 +1,11 @@ /* ================================================================== - 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 + 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, $Id$ --- tclreadline -- gnu readline for tcl Copyright (C) 1999 Johannes Zellner @@ -23,12 +22,12 @@ 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 + johannes@zellner.org + http://www.zellner.org/tclreadline/ ================================================================== */ static char *TCLREADLINE_VERSION = "@TCLREADLINE_VERSION@"; Index: tclreadline.n.in ================================================================== --- tclreadline.n.in +++ tclreadline.n.in @@ -1,11 +1,11 @@ .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 +.\" 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, .\" $Id$ .\" --- .\" .\" tclreadline -- gnu readline for the tcl scripting language .\" Copyright (C) 1999 Johannes Zellner @@ -22,12 +22,11 @@ .\" .\" 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 +.\" , http://www.zellner.org/tclreadline/ .SH NAME tclreadline \- gnu readline for the tcl scripting language @@ -192,18 +191,18 @@ .PP The official \fBtclreadline\fP web site at: .PP .RS 4 -http://krisal.physik.uni-karlsruhe.de/tclreadline/index.html +http://www.zellner.org/tclreadline/ .RE .SH AUTHOR(S) Johannes Zellner .br - + .br If you want to be listed here, you have to contribute to the code :-) (see below). Index: tclreadlineConfig.sh.in ================================================================== --- tclreadlineConfig.sh.in +++ tclreadlineConfig.sh.in @@ -1,11 +1,9 @@ -# -*- 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 +#!/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, # $Id$ # --- # # tclreadline -- gnu readline for tcl # Copyright (C) 1999 Johannes Zellner @@ -22,12 +20,12 @@ # # 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 +# 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 Index: tclreadlineInit.tcl.in ================================================================== --- tclreadlineInit.tcl.in +++ tclreadlineInit.tcl.in @@ -1,11 +1,9 @@ #!/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 +# 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, # $Id$ # --- # # tclreadline -- gnu readline for tcl # Copyright (C) 1999 Johannes Zellner @@ -22,12 +20,12 @@ # # 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 +# johannes@zellner.org +# http://www.zellner.org/tclreadline/ # # ================================================================== package provide tclreadline @TCLREADLINE_VERSION@ @@ -41,13 +39,11 @@ 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 } } Index: tclreadlineSetup.tcl.in ================================================================== --- tclreadlineSetup.tcl.in +++ tclreadlineSetup.tcl.in @@ -1,11 +1,9 @@ #!/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 +# 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, # $Id$ # --- # # tclreadline -- gnu readline for tcl # Copyright (C) 1999 Johannes Zellner @@ -22,12 +20,12 @@ # # 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 +# johannes@zellner.org +# http://www.zellner.org/tclreadline/ # # ================================================================== package provide tclreadline @TCLREADLINE_VERSION@