Check-in [5ceb4bf9b1]
Not logged in
Overview
SHA1:5ceb4bf9b1a64c4e6d3a2df0cd9f61005950d0d1
Date: 1999-12-16 22:11:00
User: johannes@zellner.org
Comment:Thu Dec 16 22:39:33 CET 1999
Timelines: family | ancestors | descendants | both | trunk
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
1999-12-17
12:19
[93501d5366] Fri Dec 17 13:19:24 CET 1999 (user: johannes@zellner.org, tags: trunk)
1999-12-16
22:11
[5ceb4bf9b1] Thu Dec 16 22:39:33 CET 1999 (user: johannes@zellner.org, tags: trunk)
21:53
[5d555b6f90] Thu Dec 16 22:22:08 CET 1999 (user: johannes@zellner.org, tags: trunk)
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Added tclshrl.c version [9cd021378e].

            1  +
            2  + /* ==================================================================
            3  +
            4  +    FILE: "/home/joze/src/tclreadline/tclshrl.c"
            5  +    LAST MODIFICATION: "Thu Dec 16 21:51:19 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 <tclreadline.h>
           37  +
           38  +#if 0
           39  +#include <assert.h>
           40  +#endif
           41  +
           42  +extern int Tclreadline_Init(Tcl_Interp *interp);
           43  +extern int Tclreadline_SafeInit(Tcl_Interp *interp);
           44  +
           45  +int
           46  +TclreadlineAppInit(Tcl_Interp* interp)
           47  +{
           48  +    char file[0xff];
           49  +    int status;
           50  +#if 0
           51  +    assert(Tcl_InitStubs(interp, TCL_VERSION, 0));
           52  +#endif
           53  +    if (TCL_ERROR == Tcl_Init(interp)) {
           54  +	return TCL_ERROR;
           55  +    }
           56  +    if (TCL_ERROR == Tclreadline_Init(interp)) {
           57  +	return TCL_ERROR;
           58  +    }
           59  +    Tcl_StaticPackage(interp, "tclreadline",
           60  +	Tclreadline_Init, Tclreadline_SafeInit);
           61  +#if (TCL_MAJOR_VERSION == 7) && (TCL_MINOR_VERSION == 4)
           62  +    tcl_RcFileName = "~/.tclshrc";
           63  +#else
           64  +    Tcl_SetVar(interp, "tcl_rcFileName", "~/.tclshrc", TCL_GLOBAL_ONLY);
           65  +#endif
           66  +    sprintf(file, "%s/tclreadlineInit.tcl", TCLRL_LIBRARY);
           67  +    if ((status = Tcl_EvalFile(interp, file))) {
           68  +	fprintf(stderr, "(TclreadlineAppInit) unable to eval %s\n", file);
           69  +	exit (1);
           70  +    }
           71  +    return TCL_OK;
           72  +}
           73  +
           74  +int
           75  +main(int argc, char *argv[])
           76  +{
           77  +    Tcl_Main(argc, argv, TclreadlineAppInit);
           78  +    return 0;
           79  +}