Index: ChangeLog ================================================================== --- ChangeLog +++ ChangeLog @@ -1,6 +1,10 @@ +2000-09-20 Johannes Zellner + + * made tclreadline.h installing to ${prefix}/include + 2000-08-27 Johannes Zellner * added Mark to AUTHORS :) 2000-08-27 Mark Patton Index: Makefile.am ================================================================== --- Makefile.am +++ Makefile.am @@ -1,8 +1,8 @@ ## -*- automake -*- ## FILE: "/home/joze/src/tclreadline/Makefile.am" -## LAST MODIFICATION: "Don, 20 Jul 2000 03:15:27 +0200 (joze)" +## LAST MODIFICATION: "Mit, 20 Sep 2000 16:25:22 +0200 (joze)" ## (C) 2000 by Johannes Zellner, ## $Id$ ## --- ## tclreadline -- gnu readline for tcl ## http://www.zellner.org/tclreadline/ @@ -13,10 +13,12 @@ ## AUTOMAKE_OPTIONS = foreign lib_LTLIBRARIES = libtclreadline.la libtclreadline_la_SOURCES = config.h tclreadline.c tclreadline.h +include_HEADERS = tclreadline.h + INCLUDES = -I$(TCL_INCLUDE_DIR) -I$(READLINE_INCLUDE_DIR) ## libtclreadline_la_LIBADD = $(LIBS) libtclreadline_la_LDFLAGS = -release $(MAJOR).$(MINOR).$(PATCHLEVEL) Index: configure.in ================================================================== --- configure.in +++ configure.in @@ -1,8 +1,8 @@ dnl -*- autoconf -*- dnl FILE: "/home/joze/src/tclreadline/configure.in" -dnl LAST MODIFICATION: "Son, 27 Aug 2000 16:10:18 +0200 (joze)" +dnl LAST MODIFICATION: "Mit, 20 Sep 2000 17:25:06 +0200 (joze)" dnl (C) 1998 - 2000 by Johannes Zellner, dnl $Id$ dnl --- dnl tclreadline -- gnu readline for tcl dnl http://www.zellner.org/tclreadline/ @@ -15,11 +15,11 @@ AC_REVISION($Revision$) AC_CONFIG_AUX_DIR(./aux) MAJOR=2 MINOR=0 -PATCHLEVEL=3 +PATCHLEVEL=4 VERSION=$MAJOR.$MINOR PATCHLEVEL_STR=$VERSION.$PATCHLEVEL AC_SUBST(MAJOR) AC_SUBST(MINOR) @@ -94,11 +94,13 @@ # AC_PREFIX_DEFAULT(/usr/local) if test "${prefix}" = "NONE"; then prefix=$TCL_PREFIX fi -TCLRL_DIR="${prefix}/lib/tclreadline$VERSION" +TCLRL_LIBDIR="${prefix}/lib" +AC_SUBST(TCLRL_LIBDIR) +TCLRL_DIR="${TCLRL_LIBDIR}/tclreadline$VERSION" AC_SUBST(TCLRL_DIR) # HEADERS AC_HEADER_STDC AC_CHECK_HEADERS(string.h) Index: tclreadline.c ================================================================== --- tclreadline.c +++ tclreadline.c @@ -1,9 +1,9 @@ /* ================================================================== FILE: "/home/joze/src/tclreadline/tclreadline.c" - LAST MODIFICATION: "Son, 27 Aug 2000 16:11:02 +0200 (joze)" + LAST MODIFICATION: "Mit, 20 Sep 2000 19:27:47 +0200 (joze)" (C) 1998 - 2000 by Johannes Zellner, $Id$ --- tclreadline -- gnu readline for tcl http://www.zellner.org/tclreadline/ @@ -43,10 +43,13 @@ */ extern char* _rl_executing_macro; #endif #include "tclreadline.h" +static const char* tclrl_library = TCLRL_LIBRARY; +static const char* tclrl_version_str = TCLRL_VERSION_STR; +static const char* tclrl_patchlevel_str = TCLRL_PATCHLEVEL_STR; #define MALLOC(size) Tcl_Alloc((int) size) #define FREE(ptr) if (ptr) { Tcl_Free((char*) ptr); ptr = 0; } enum { @@ -80,14 +83,10 @@ static char** TclReadlineCompletion(char* text, int start, int end); static char* TclReadline0generator(char* text, int state); static char* TclReadlineKnownCommands(char* text, int state, int mode); static int TclReadlineParse(char** args, int maxargs, char* buf); -/* must be non-static */ -int Tclreadline_SafeInit(Tcl_Interp* interp); -int Tclreadline_Init(Tcl_Interp* interp); - enum { LINE_PENDING = -1, LINE_EOF = (1 << 8), LINE_COMPLETE = (1 << 9) @@ -569,30 +568,30 @@ if (TCL_OK != (status = Tcl_LinkVar(interp, "::tclreadline::library", (char*) &tclrl_library, TCL_LINK_STRING | TCL_LINK_READ_ONLY))) return status; if (TCL_OK != (status = Tcl_LinkVar(interp, "::tclreadline::version", - (char*) &TCLRL_VERSION, TCL_LINK_STRING | TCL_LINK_READ_ONLY))) + (char*) &tclrl_version_str, TCL_LINK_STRING | TCL_LINK_READ_ONLY))) return status; if (TCL_OK != (status = Tcl_LinkVar(interp, "::tclreadline::patchLevel", - (char*) &TCLRL_PATCHLEVEL, TCL_LINK_STRING | TCL_LINK_READ_ONLY))) + (char*) &tclrl_patchlevel_str, TCL_LINK_STRING | TCL_LINK_READ_ONLY))) return status; if (TCL_OK != (status = Tcl_LinkVar(interp, "::tclreadline::license", (char*) &tclrl_license, TCL_LINK_STRING | TCL_LINK_READ_ONLY))) return status; if (TCL_OK != (status = Tcl_LinkVar(interp, "tclreadline_library", (char*) &tclrl_library, TCL_LINK_STRING | TCL_LINK_READ_ONLY))) return status; if (TCL_OK != (status = Tcl_LinkVar(interp, "tclreadline_version", - (char*) &TCLRL_VERSION, TCL_LINK_STRING | TCL_LINK_READ_ONLY))) + (char*) &tclrl_version_str, TCL_LINK_STRING | TCL_LINK_READ_ONLY))) return status; if (TCL_OK != (status = Tcl_LinkVar(interp, "tclreadline_patchLevel", - (char*) &TCLRL_PATCHLEVEL, TCL_LINK_STRING | TCL_LINK_READ_ONLY))) + (char*) &tclrl_patchlevel_str, TCL_LINK_STRING | TCL_LINK_READ_ONLY))) return status; - return Tcl_PkgProvide(interp, "tclreadline", TCLRL_VERSION); + return Tcl_PkgProvide(interp, "tclreadline", (char*)tclrl_version_str); } static int TclReadlineInitialize(Tcl_Interp* interp, char* historyfile) { Index: tclreadline.h.in ================================================================== --- tclreadline.h.in +++ tclreadline.h.in @@ -1,9 +1,9 @@ /* ================================================================== FILE: "/home/joze/src/tclreadline/tclreadline.h.in" - LAST MODIFICATION: "Sat, 01 Jul 2000 23:46:41 +0200 (joze)" + LAST MODIFICATION: "Mit, 20 Sep 2000 17:18:12 +0200 (joze)" (C) 1998 - 2000 by Johannes Zellner, $Id$ vim:set ft=c: --- tclreadline -- gnu readline for tcl @@ -10,14 +10,31 @@ http://www.zellner.org/tclreadline/ Copyright (c) 1998 - 2000, Johannes Zellner This software is copyright under the BSD license. ================================================================== */ -static char *TCLRL_VERSION = "@VERSION@"; - -static char* tclrl_library = "@TCLRL_DIR@"; - -/* - * NOTE, that PATCHLEVEL is the complete version string. - */ -static char *TCLRL_PATCHLEVEL = "@PATCHLEVEL_STR@"; - +#ifndef TCLREADLINE_H_ +#define TCLREADLINE_H_ + +#include + +#define TCLRL_LIBRARY "@TCLRL_DIR@" + +/* VERSION STRINGS */ +#define TCLRL_VERSION_STR "@VERSION@" +#define TCLRL_PATCHLEVEL_STR "@PATCHLEVEL_STR@" + +/* VERSION NUMBERS */ +#define TCLRL_MAJOR @MAJOR@ +#define TCLRL_MINOR @MINOR@ +#define TCLRL_PATCHLEVEL @PATCHLEVEL@ + +#ifdef __cplusplus +extern "C" { +#endif +int Tclreadline_Init(Tcl_Interp *interp); +int Tclreadline_SafeInit(Tcl_Interp *interp); +#ifdef __cplusplus +} +#endif + +#endif /* TCLREADLINE_H_ */ Index: tclreadlineInit.tcl.in ================================================================== --- tclreadlineInit.tcl.in +++ tclreadlineInit.tcl.in @@ -1,8 +1,8 @@ #!/usr/local/bin/tclsh # FILE: "/home/joze/src/tclreadline/tclreadlineInit.tcl.in" -# LAST MODIFICATION: "Sat, 01 Jul 2000 23:54:15 +0200 (joze)" +# LAST MODIFICATION: "Mit, 20 Sep 2000 19:29:26 +0200 (joze)" # (C) 1998 - 2000 by Johannes Zellner, # $Id$ # --- # tclreadline -- gnu readline for tcl # http://www.zellner.org/tclreadline/ @@ -16,11 +16,11 @@ } proc ::tclreadline::Init {} { uplevel #0 { if ![info exists tclreadline::library] { - if [catch {load @TCLRL_DIR@/../libtclreadline[info sharedlibextension]} msg] { + if [catch {load [file join @TCLRL_LIBDIR@ libtclreadline[info sharedlibextension]]} msg] { puts stderr $msg exit 2 } } }