Check-in [5d555b6f90]
Not logged in
Overview
Comment:Thu Dec 16 22:22:08 CET 1999
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:5d555b6f901af41d409b0552c2e9fd24212a71e9
User & Date: johannes@zellner.org on 1999-12-16 21:53:35
Other Links: manifest | tags
Context
1999-12-16
22:11
Thu Dec 16 22:39:33 CET 1999 check-in: 5ceb4bf9b1 user: johannes@zellner.org tags: trunk
21:53
Thu Dec 16 22:22:08 CET 1999 check-in: 5d555b6f90 user: johannes@zellner.org tags: trunk
21:53
introduced tclshrl and wishrl because a user wants statically linked binaries. check-in: f90495f90f user: johannes@zellner.org tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Show Whitespace Changes Patch

Added wishrl.c version [6d8e8d8f9e].

            1  +
            2  + /* ==================================================================
            3  +
            4  +    FILE: "/home/joze/src/tclreadline/wishrl.c"
            5  +    LAST MODIFICATION: "Thu Dec 16 22:05:05 1999 (joze)"
            6  +    (C) 1998, 1999 by Johannes Zellner, <johannes@zellner.org>
            7  +    $Id$
            8  +    ---
            9  +
           10  +    tclreadline -- gnu readline for tcl
           11  +    Copyright (C) 1999  Johannes Zellner
           12  +
           13  +    This program is free software; you can redistribute it and/or
           14  +    modify it under the terms of the GNU General Public License
           15  +    as published by the Free Software Foundation; either version 2
           16  +    of the License, or (at your option) any later version.
           17  +
           18  +    This program is distributed in the hope that it will be useful,
           19  +    but WITHOUT ANY WARRANTY; without even the implied warranty of
           20  +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           21  +    GNU General Public License for more details.
           22  +
           23  +    You should have received a copy of the GNU General Public License
           24  +    along with this program; if not, write to the Free Software
           25  +    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           26  +
           27  +    <johannes@zellner.org>, http://www.zellner.org/tclreadline/
           28  +
           29  +    ================================================================== */  
           30  +
           31  +#ifdef HAVE_CONFIG_H
           32  +#   include "config.h"
           33  +#endif
           34  +
           35  +#include <tcl.h>
           36  +#include <tk.h>
           37  +#include <tclreadline.h>
           38  +
           39  +extern int Tclreadline_Init(Tcl_Interp *interp);
           40  +extern int Tclreadline_SafeInit(Tcl_Interp *interp);
           41  +
           42  +int
           43  +TclreadlineAppInit(Tcl_Interp* interp)
           44  +{
           45  +    char file[0xff];
           46  +    int status;
           47  +
           48  +    if (TCL_ERROR == Tcl_Init(interp)) {
           49  +	return TCL_ERROR;
           50  +    }
           51  +    if (TCL_ERROR == Tk_Init(interp)) {
           52  +	return TCL_ERROR;
           53  +    }
           54  +    if (TCL_ERROR == Tclreadline_Init(interp)) {
           55  +	return TCL_ERROR;
           56  +    }
           57  +    Tcl_StaticPackage(interp, "tclreadline",
           58  +	Tclreadline_Init, Tclreadline_SafeInit);
           59  +#if (TCL_MAJOR_VERSION == 7) && (TCL_MINOR_VERSION == 4)
           60  +    tcl_RcFileName = "~/.wishrc";
           61  +#else
           62  +    Tcl_SetVar(interp, "tcl_rcFileName", "~/.wishrc", TCL_GLOBAL_ONLY);
           63  +#endif
           64  +    sprintf(file, "%s/tclreadlineInit.tcl", TCLRL_LIBRARY);
           65  +    if ((status = Tcl_EvalFile(interp, file))) {
           66  +	fprintf(stderr, "(TclreadlineAppInit) unable to eval %s\n", file);
           67  +	exit (1);
           68  +    }
           69  +    return TCL_OK;
           70  +}
           71  +
           72  +int
           73  +main(int argc, char *argv[])
           74  +{
           75  +    Tk_Main(argc, argv, TclreadlineAppInit);
           76  +    return 0;
           77  +}