Check-in [5f3ab55c4a]
Not logged in
Overview
Comment:Harmonize file headers, indent and whitespace in all files
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | origin/devel
Files: files | file ages | folders
SHA1: 5f3ab55c4ac7b9891b42f188cb0f9175f3588409
User & Date: quentin@minster.io on 2014-02-26 00:38:52
Other Links: branch diff | manifest | tags
Context
2014-02-26
22:37
Cleanup of compilation warnings * Add the -Wall compilation flag * Use rl_ding() instead of undeclared ding() check-in: a9511ba2db user: quentin@minster.io tags: trunk, origin/devel
00:38
Harmonize file headers, indent and whitespace in all files check-in: 5f3ab55c4a user: quentin@minster.io tags: trunk, origin/devel
2014-02-19
00:07
Apply the Gentoo patchset Gentoo ebuild: dev-tcltk/tclreadline-2.1.0-r4 Fully applied patches: * direct sed patches from the ebuild * tclreadline-2.1.0-gold.patch * tclreadline-2.1.0-rl-executing-macro.patch * tclreadline-2.1.0-rl-history-expand.patch * tclreadline-2.1.0-rl-prompt.patch Partially applied patches: * tclreadline-2.1.0-alloc-free.patch check-in: f61c58e424 user: quentin@minster.io tags: trunk, origin/devel
Changes

Modified COPYING from [a7c8b5b8da] to [c1821e21e0].

1
2
3
4
5
6
7
8
9
   
   Copyright (c) 1998 - 2001, Johannes Zellner <johannes@zellner.org>
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
   are met:
   
     * Redistributions of source code must retain the above copyright

|







1
2
3
4
5
6
7
8
9
   
   Copyright (c) 1998 - 2014, Johannes Zellner <johannes@zellner.org>
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
   are met:
   
     * Redistributions of source code must retain the above copyright

Modified Makefile.am from [e10a890a98] to [45d2bf5cbc].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
## -*- automake -*-
## FILE: "/home/joze/src/tclreadline/Makefile.am"
## LAST MODIFICATION: "Mit, 10 Jan 2001 06:29:33 +0100 (joze)"
## (C) 2000 - 2001 by Johannes Zellner, <johannes@zellner.org>
## $Id$
## ---
## tclreadline -- gnu readline for tcl
## http://www.zellner.org/tclreadline/
## Copyright (c) 1998 - 2001, Johannes Zellner <johannes@zellner.org>
## This software is copyright under the BSD license.
## ---

## AUTOMAKE_OPTIONS = foreign

lib_LTLIBRARIES = libtclreadline.la


|
<
<




|







1
2


3
4
5
6
7
8
9
10
11
12
13
14
## -*- automake -*-
## FILE: Makefile.am


## $Id$
## ---
## tclreadline -- gnu readline for tcl
## http://www.zellner.org/tclreadline/
## Copyright (c) 1998 - 2014, Johannes Zellner <johannes@zellner.org>
## This software is copyright under the BSD license.
## ---

## AUTOMAKE_OPTIONS = foreign

lib_LTLIBRARIES = libtclreadline.la

Modified README from [58b66551a6] to [cd868e87e1].

1
2
3
4
5
6
7
8
9
10
11


12
13
14
15
16
17
18
FILE: "/home/joze/src/tclreadline/README"
LAST MODIFICATION: "Mit, 10 Jan 2001 06:29:33 +0100 (joze)"
(C) 1998 - 2001 by Johannes Zellner, <johannes@zellner.org>
$Id$
---

tclreadline -- gnu readline for tcl
http://www.zellner.org/tclreadline/
Copyright (c) 1998 - 2001, Johannes Zellner <johannes@zellner.org>

This software is copyright under the BSD license.




tclreadline


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


<


|
<

>
>







1


2
3

4
5
6

7
8
9
10
11
12
13
14
15
16
FILE: README


$Id$
---

tclreadline -- gnu readline for tcl
http://www.zellner.org/tclreadline/
Copyright (c) 1998 - 2014, Johannes Zellner <johannes@zellner.org>

This software is copyright under the BSD license.
---



tclreadline


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

Modified SCENARIO from [797d1f2bf8] to [704bad2f7f].

whitespace changes only

Modified autogen.sh from [e610613007] to [8923c07aed].

1
2
3
4
5






6
7
8
9
10
11
12
#!/bin/sh
# FILE: "/home/joze/src/tclreadline/autogen.sh"
# LAST MODIFICATION: "Mit, 10 Jan 2001 06:28:43 +0100 (joze)"
# (C) 2000 - 2001 by Johannes Zellner, <johannes@zellner.org>
# $Id$







srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.

ORIGDIR=`pwd`
cd $srcdir
PROJECT=tclreadline

|
<
<

>
>
>
>
>
>







1
2


3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh
# FILE: autogen.sh


# $Id$
# ---
# tclreadline -- gnu readline for tcl
# http://www.zellner.org/tclreadline/
# Copyright (c) 1998 - 2014, Johannes Zellner <johannes@zellner.org>
# This software is copyright under the BSD license.
# ---

srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.

ORIGDIR=`pwd`
cd $srcdir
PROJECT=tclreadline
42
43
44
45
46
47
48
49


50
51
52
53
54
55
56
57
58
59
60
61
62

if test -z "$*"; then
	echo "I am going to run ./configure with no arguments - if you wish "
        echo "to pass any to it, please specify them on the $0 command line."
fi

case $CC in
*xlc | *xlc\ * | *lcc | *lcc\ *) am_opt=--include-deps;;


esac

aclocal $ACLOCAL_FLAGS

# optionally feature autoheader
(autoheader --version)  < /dev/null > /dev/null 2>&1 && autoheader

automake -a $am_opt
autoconf
cd $ORIGDIR

$srcdir/configure --enable-maintainer-mode "$@"








|
>
>













46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68

if test -z "$*"; then
	echo "I am going to run ./configure with no arguments - if you wish "
        echo "to pass any to it, please specify them on the $0 command line."
fi

case $CC in
    *xlc | *xlc\ * | *lcc | *lcc\ *)
        am_opt=--include-deps
        ;;
esac

aclocal $ACLOCAL_FLAGS

# optionally feature autoheader
(autoheader --version)  < /dev/null > /dev/null 2>&1 && autoheader

automake -a $am_opt
autoconf
cd $ORIGDIR

$srcdir/configure --enable-maintainer-mode "$@"

Modified aux/tcltags from [14371eb7a9] to [f7acdd7bce].

1
2
3
4
5





6
7
8
9
10
11
12
#!/usr/local/bin/tclsh
# FILE: "/home/joze/bin/script/tcltags"
# LAST MODIFIED: "Mon Sep 28 10:09:29 1998 (joze)"
# $Id$
# ---






set tags [open "tags" a+]
#set tags stdout
#_BoxHandle	Z_Box.c	/^int _BoxHandle (Box *boxPtr, Tcl_Interp *interp, int argc, char **argv)$/;"	f

foreach file "$argv" {


|
<


>
>
>
>
>







1
2

3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/local/bin/tclsh
# FILE: aux/tcltags

# $Id$
# ---
# tclreadline -- gnu readline for tcl
# http://www.zellner.org/tclreadline/
# Copyright (c) 1998 - 2014, Johannes Zellner <johannes@zellner.org>
# This software is copyright under the BSD license.
# ---

set tags [open "tags" a+]
#set tags stdout
#_BoxHandle	Z_Box.c	/^int _BoxHandle (Box *boxPtr, Tcl_Interp *interp, int argc, char **argv)$/;"	f

foreach file "$argv" {

Modified aux/vimtags from [f85b0cc88e] to [3390267426].

1
2
3
4
5
6
7





8
9
10
11
12
13
14
#!/usr/local/bin/tclsh
# ==================================================================
# FILE: "/home/joze/bin/script/vimtags"
# LAST MODIFIED: "Thu Oct 01 13:20:11 1998 (joze)"
# (c) 1998 by Johannes Zellner
# Johannes.Zellner@physik.uni-karlsruhe.de
# $Id$





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


if [file readable tags] {
    set tags [open tags r]
    set vim [open tags.vim w]
    while {[gets $tags line] != -1} {


|
<
<
<

>
>
>
>
>







1
2
3



4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/local/bin/tclsh
# ==================================================================
# FILE: aux/vimtags



# $Id$
# ---
# tclreadline -- gnu readline for tcl
# http://www.zellner.org/tclreadline/
# Copyright (c) 1998 - 2014, Johannes Zellner <johannes@zellner.org>
# This software is copyright under the BSD license.
# ================================================================== 


if [file readable tags] {
    set tags [open tags r]
    set vim [open tags.vim w]
    while {[gets $tags line] != -1} {

Modified configure.ac from [84c8e6ef95] to [d1e0c2eb78].

1
2
3
4
5
6
7
8
9
10

11
12
13
14
15
16
17
dnl -*- autoconf -*-
dnl FILE: "/home/joze/src/tclreadline/configure.in"
dnl LAST MODIFICATION: "Mit, 10 Jan 2001 06:26:43 +0100 (joze)"
dnl (C) 1998 - 2001 by Johannes Zellner, <johannes@zellner.org>
dnl $Id$
dnl ---
dnl tclreadline -- gnu readline for tcl
dnl http://www.zellner.org/tclreadline/
dnl Copyright (c) 1998 - 2001, Johannes Zellner <johannes@zellner.org>
dnl This software is copyright under the BSD license.


AC_INIT(tclreadline.c)
AC_CONFIG_HEADERS(config.h)
AC_PREREQ(2.13)
AC_REVISION($Revision$)
AC_CONFIG_AUX_DIR(./aux)


|
<
<




|

>







1
2


3
4
5
6
7
8
9
10
11
12
13
14
15
16
dnl -*- autoconf -*-
dnl FILE: configure.in


dnl $Id$
dnl ---
dnl tclreadline -- gnu readline for tcl
dnl http://www.zellner.org/tclreadline/
dnl Copyright (c) 1998 - 2014, Johannes Zellner <johannes@zellner.org>
dnl This software is copyright under the BSD license.
dnl ---

AC_INIT(tclreadline.c)
AC_CONFIG_HEADERS(config.h)
AC_PREREQ(2.13)
AC_REVISION($Revision$)
AC_CONFIG_AUX_DIR(./aux)

Modified pkgIndex.tcl.in from [e32c88be89] to [ebbb8f66db].

1
2
3
4
5
6
7
8
9

10
11
12
# FILE: "/home/joze/src/tclreadline/pkgIndex.tcl.in"
# LAST MODIFICATION: "Mit, 10 Jan 2001 06:29:33 +0100 (joze)"
# (C) 1998 - 2001 by Johannes Zellner, <johannes@zellner.org>
# $Id$
# ---
# tclreadline -- gnu readline for tcl
# http://www.zellner.org/tclreadline/
# Copyright (c) 1998 - 2001, Johannes Zellner <johannes@zellner.org>
# This software is copyright under the BSD license.


package ifneeded tclreadline @VERSION@ \
    [list source [file join $dir tclreadlineInit.tcl]]
|
<
<




|

>



1


2
3
4
5
6
7
8
9
10
11
# FILE: pkgIndex.tcl.in


# $Id$
# ---
# tclreadline -- gnu readline for tcl
# http://www.zellner.org/tclreadline/
# Copyright (c) 1998 - 2014, Johannes Zellner <johannes@zellner.org>
# This software is copyright under the BSD license.
# ---

package ifneeded tclreadline @VERSION@ \
    [list source [file join $dir tclreadlineInit.tcl]]

Modified sample.tclshrc from [25ec261415] to [d65998f0e1].

1
2
3
4
5






6

7
8
9
10
11
12
13
#!/bin/sh
# FILE: "/home/joze/src/tclreadline/sample.tclshrc"
# LAST MODIFICATION: "Thu, 23 Mar 2000 21:13:08 +0100 (joze)"
# (C) 1998 - 2000 by Johannes Zellner, <johannes@zellner.org>
# $Id$






# vim:set ft=tcl: \

exec tclsh "$0" "$@"


if {$tcl_interactive} {

    package require tclreadline


|
<
<

>
>
>
>
>
>
|
>







1
2


3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh
# FILE: sample.tclshrc


# $Id$
# ---
# tclreadline -- gnu readline for tcl
# http://www.zellner.org/tclreadline/
# Copyright (c) 1998 - 2014, Johannes Zellner <johannes@zellner.org>
# This software is copyright under the BSD license.
# ---

# exec with tclsh \
exec tclsh "$0" "$@"


if {$tcl_interactive} {

    package require tclreadline

54
55
56
57
58
59
60

    # ::tclreadline::readline customcompleter ""

    # go to tclrealdine's main loop.
    #
    tclreadline::Loop
}









>
59
60
61
62
63
64
65
66
    # ::tclreadline::readline customcompleter ""

    # go to tclrealdine's main loop.
    #
    tclreadline::Loop
}

# vim:set ft=tcl:

Modified tclreadline.c from [fb738417f9] to [eb4c3e5998].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

 /* ==================================================================
    FILE: "/home/joze/src/tclreadline/tclreadline.c"
    LAST MODIFICATION: "Mit, 10 Jan 2001 06:29:33 +0100 (joze)"
    (C) 1998 - 2001 by Johannes Zellner, <johannes@zellner.org>
    $Id$
    ---
    tclreadline -- gnu readline for tcl
    http://www.zellner.org/tclreadline/
    Copyright (c) 1998 - 2001, Johannes Zellner <johannes@zellner.org>
    This software is copyright under the BSD license.
    ================================================================== */  

#ifdef HAVE_CONFIG_H
#   include "config.h"
#endif

<

|
<
<




|








1
2


3
4
5
6
7
8
9
10
11
12
13
14

 /* ==================================================================
    FILE: tclreadline.c


    $Id$
    ---
    tclreadline -- gnu readline for tcl
    http://www.zellner.org/tclreadline/
    Copyright (c) 1998 - 2014, Johannes Zellner <johannes@zellner.org>
    This software is copyright under the BSD license.
    ================================================================== */  

#ifdef HAVE_CONFIG_H
#   include "config.h"
#endif

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
#else
#   include <readline/readline.h>
#   include <readline/history.h>
#endif


/*
 * this prototype is missing
 * in readline.h
 */
void rl_extend_line_buffer(int len);

#ifdef EXECUTING_MACRO_HACK
/**
 * this prototype is private in readline's file `macro.c'.
 * We need it here to decide, if we should read more
 * characters from a macro. Dirty, but it should work.
 */
extern char* EXECUTING_MACRO_NAME;
#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) malloc((int) size)
#define FREE(ptr) if (ptr) { free((char*) ptr); ptr = 0; }

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









|






|











|
|







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
#else
#   include <readline/readline.h>
#   include <readline/history.h>
#endif


/*
 * this prototype may be missing
 * in readline.h
 */
void rl_extend_line_buffer(int len);

#ifdef EXECUTING_MACRO_HACK
/**
 * this prototype may be private in readline's file `macro.c'.
 * We need it here to decide, if we should read more
 * characters from a macro. Dirty, but it should work.
 */
extern char* EXECUTING_MACRO_NAME;
#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) malloc(size)
#define FREE(ptr) free(ptr); ptr = NULL

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


193
194
195
196
197
198
199

200
201
202
203
204
205
206
207
	}
	Tcl_DStringAppend(&result, ptr, 1);
    }
    result_c = strdup(Tcl_DStringValue(&result));
    return result_c;
}


static int TclReadlineCmd(ClientData clientData, Tcl_Interp *interp, int objc,
			  Tcl_Obj *CONST objv[])
{
    int obj_idx, status;

    static char *subCmds[] = {
	"read", "initialize", "write", "add", "complete",
	"customcompleter", "builtincompleter", "eofchar",







>
|







190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
	}
	Tcl_DStringAppend(&result, ptr, 1);
    }
    result_c = strdup(Tcl_DStringValue(&result));
    return result_c;
}

static int
TclReadlineCmd(ClientData clientData, Tcl_Interp *interp, int objc,
			  Tcl_Obj *CONST objv[])
{
    int obj_idx, status;

    static char *subCmds[] = {
	"read", "initialize", "write", "add", "complete",
	"customcompleter", "builtincompleter", "eofchar",
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
	Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?");
	return TCL_ERROR;
    }

    status = Tcl_GetIndexFromObj
    (interp, objv[1], subCmds, "option", 0, (int *) &obj_idx);

    if (status != TCL_OK) {
	return status;
    }

    switch (obj_idx) {

	case TCLRL_READ:

	    rl_callback_handler_install(
			       objc == 3 ? Tcl_GetStringFromObj(objv[2], 0)







|

<







218
219
220
221
222
223
224
225
226

227
228
229
230
231
232
233
	Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?");
	return TCL_ERROR;
    }

    status = Tcl_GetIndexFromObj
    (interp, objv[1], subCmds, "option", 0, (int *) &obj_idx);

    if (status != TCL_OK)
	return status;


    switch (obj_idx) {

	case TCLRL_READ:

	    rl_callback_handler_install(
			       objc == 3 ? Tcl_GetStringFromObj(objv[2], 0)
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
	    }

	    Tcl_DeleteFileHandler(0);

	    switch (tclrl_state) {

		case LINE_COMPLETE:

		    return TCL_OK;
		    /* NOTREACHED */
		    break;

		case LINE_EOF:
		    if (tclrl_eof_string)
			return Tcl_Eval(interp, tclrl_eof_string);







<







261
262
263
264
265
266
267

268
269
270
271
272
273
274
	    }

	    Tcl_DeleteFileHandler(0);

	    switch (tclrl_state) {

		case LINE_COMPLETE:

		    return TCL_OK;
		    /* NOTREACHED */
		    break;

		case LINE_EOF:
		    if (tclrl_eof_string)
			return Tcl_Eval(interp, tclrl_eof_string);
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524

	char* expansion = (char*) NULL;
	int status = history_expand(ptr, &expansion);

	if (status >= 2) {
	    /* TODO: make this a valid tcl output */
	    printf("%s\n", expansion);
		free(ptr);
		free(expansion);
		return;
	} else if (status <= -1) {
	    Tcl_AppendResult
	    (tclrl_interp, "error in history expansion: ", expansion, "\n", (char*) NULL);
	    TclReadlineTerminate(TCL_ERROR);
		free(ptr);
		free(expansion);
		return;
	} else {
        Tcl_AppendResult(tclrl_interp, expansion, (char*) NULL);
    }

#ifdef EXECUTING_MACRO_NAME
	/**







|
|





|
|







498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520

	char* expansion = (char*) NULL;
	int status = history_expand(ptr, &expansion);

	if (status >= 2) {
	    /* TODO: make this a valid tcl output */
	    printf("%s\n", expansion);
            FREE(ptr);
            FREE(expansion);
		return;
	} else if (status <= -1) {
	    Tcl_AppendResult
	    (tclrl_interp, "error in history expansion: ", expansion, "\n", (char*) NULL);
	    TclReadlineTerminate(TCL_ERROR);
            FREE(ptr);
            FREE(expansion);
		return;
	} else {
        Tcl_AppendResult(tclrl_interp, expansion, (char*) NULL);
    }

#ifdef EXECUTING_MACRO_NAME
	/**
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
	     * line into readline's history.
	     */
	    if (expansion && *expansion && (!tclrl_last_line ||
		    strcmp(tclrl_last_line, expansion))) {
		add_history(expansion);
	    }
	    if (tclrl_last_line)
		free(tclrl_last_line);
	    tclrl_last_line = strdup(expansion);
#ifdef EXECUTING_MACRO_NAME
	}
#endif
	/**
	 * tell the calling routines to terminate.
	 */







|







530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
	     * line into readline's history.
	     */
	    if (expansion && *expansion && (!tclrl_last_line ||
		    strcmp(tclrl_last_line, expansion))) {
		add_history(expansion);
	    }
	    if (tclrl_last_line)
                FREE(tclrl_last_line);
	    tclrl_last_line = strdup(expansion);
#ifdef EXECUTING_MACRO_NAME
	}
#endif
	/**
	 * tell the calling routines to terminate.
	 */
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
	    " \"", quoted_text, "\" ", start_s, " ", end_s,
	    " \"", quoted_rl_line_buffer, "\"", (char*) NULL);
	if (TCL_OK != state) {
	    Tcl_AppendResult (tclrl_interp, " `", tclrl_custom_completer,
		" \"", quoted_text, "\" ", start_s, " ", end_s,
		" \"", quoted_rl_line_buffer, "\"' failed.", (char*) NULL);
	    TclReadlineTerminate(state);
		free(quoted_text);
		free(quoted_rl_line_buffer);
	    return matches;
	}
	free(quoted_text);
	quoted_text = NULL;
	free(quoted_rl_line_buffer);
	quoted_rl_line_buffer = NULL;
	obj = Tcl_GetObjResult(tclrl_interp);
	status = Tcl_ListObjGetElements(tclrl_interp, obj, &objc, &objv);
	if (TCL_OK != status)
	    return matches;

	if (objc) {
	    int i, length;







|
|


|
<
|
<







699
700
701
702
703
704
705
706
707
708
709
710

711

712
713
714
715
716
717
718
	    " \"", quoted_text, "\" ", start_s, " ", end_s,
	    " \"", quoted_rl_line_buffer, "\"", (char*) NULL);
	if (TCL_OK != state) {
	    Tcl_AppendResult (tclrl_interp, " `", tclrl_custom_completer,
		" \"", quoted_text, "\" ", start_s, " ", end_s,
		" \"", quoted_rl_line_buffer, "\"' failed.", (char*) NULL);
	    TclReadlineTerminate(state);
            FREE(quoted_text);
            FREE(quoted_rl_line_buffer);
	    return matches;
	}
        FREE(quoted_text);

        FREE(quoted_rl_line_buffer);

	obj = Tcl_GetObjResult(tclrl_interp);
	status = Tcl_ListObjGetElements(tclrl_interp, obj, &objc, &objv);
	if (TCL_OK != status)
	    return matches;

	if (objc) {
	    int i, length;
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
	    }

	    /**
	     * this is a special one:
	     * if the script returns exactly two arguments
	     * and the second argument is the empty string,
	     * the rl_completion_append_character is set
	     * temporaryly to NULL.
	     */
	    if (2 == objc && !strlen(matches[1])) {
		i--;
		FREE(matches[1]);
		rl_completion_append_character = '\0';
	    }








|







728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
	    }

	    /**
	     * this is a special one:
	     * if the script returns exactly two arguments
	     * and the second argument is the empty string,
	     * the rl_completion_append_character is set
             * temporarily to NULL.
	     */
	    if (2 == objc && !strlen(matches[1])) {
		i--;
		FREE(matches[1]);
		rl_completion_append_character = '\0';
	    }

784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807

808
809
810
811
812
813
814

	    new = (cmds_t *) MALLOC(sizeof(cmds_t));
	    new->next = (cmds_t *) NULL;

	    if (!cmds) {
		cmds = new;
		cmds->prev = new;
	    }
	    else {
		cmds->prev->next = new;
		cmds->prev = new;
	    }

	    tmp = strdup(text);
	    argc = TclReadlineParse(args, sizeof(args), tmp);

	    new->cmd = (char**) MALLOC(sizeof(char*) * (argc + 1));

	    for (i = 0; i < argc; i++)
		new->cmd[i] = args[i];

	    new->cmd[argc] = (char*) NULL;

	    return (char*) NULL;

	    break;


	case _CMD_GET:

	    local_line = strdup(rl_line_buffer);
	    sub = TclReadlineParse(args, sizeof(args), local_line);







<
|















>







778
779
780
781
782
783
784

785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808

	    new = (cmds_t *) MALLOC(sizeof(cmds_t));
	    new->next = (cmds_t *) NULL;

	    if (!cmds) {
		cmds = new;
		cmds->prev = new;

            } else {
		cmds->prev->next = new;
		cmds->prev = new;
	    }

	    tmp = strdup(text);
	    argc = TclReadlineParse(args, sizeof(args), tmp);

	    new->cmd = (char**) MALLOC(sizeof(char*) * (argc + 1));

	    for (i = 0; i < argc; i++)
		new->cmd[i] = args[i];

	    new->cmd[argc] = (char*) NULL;

	    return (char*) NULL;
            /* NOTREACHED */
	    break;


	case _CMD_GET:

	    local_line = strdup(rl_line_buffer);
	    sub = TclReadlineParse(args, sizeof(args), local_line);
846
847
848
849
850
851
852

853
854
855
856
857
858
859
860

861
862
863
864
865
866
867
868
869
870
871
			return strdup(new->cmd[sub]);
		    else
			return (char*) NULL;

		}
		else
		    return (char*) NULL;


		/* NOTREACHED */
		break;
	    }


	default:
	    return (char*) NULL;

	    break;

    }
    /* NOTREACHED */
}

static int
TclReadlineParse(char** args, int maxargs, char* buf)
{
    int nr = 0;








>



<




>



<







840
841
842
843
844
845
846
847
848
849
850

851
852
853
854
855
856
857
858

859
860
861
862
863
864
865
			return strdup(new->cmd[sub]);
		    else
			return (char*) NULL;

		}
		else
		    return (char*) NULL;
            }

		/* NOTREACHED */
		break;



	default:
	    return (char*) NULL;
            /* NOTREACHED */
	    break;

    }

}

static int
TclReadlineParse(char** args, int maxargs, char* buf)
{
    int nr = 0;

887
888
889
890
891
892
893

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

    *args = '\0';
    return nr;
}








>
881
882
883
884
885
886
887
888
	while (('\0' != *buf) && !ISWHITE(*buf))
	    buf++;
    }

    *args = '\0';
    return nr;
}

Modified tclreadline.h.in from [7eccbb5738] to [d85f8fea8d].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

 /* ==================================================================
    FILE: "/home/joze/src/tclreadline/tclreadline.h.in"
    LAST MODIFICATION: "Mit, 10 Jan 2001 06:29:33 +0100 (joze)"
    (C) 1998 - 2001 by Johannes Zellner, <johannes@zellner.org>
    $Id$
    vim:set ft=c:
    ---
    tclreadline -- gnu readline for tcl
    http://www.zellner.org/tclreadline/
    Copyright (c) 1998 - 2001, Johannes Zellner <johannes@zellner.org>
    This software is copyright under the BSD license.
    ================================================================== */  

#ifndef TCLREADLINE_H_
#define TCLREADLINE_H_

#include <tcl.h>
<

|
<
<

<



|








1
2


3

4
5
6
7
8
9
10
11
12
13
14

 /* ==================================================================
    FILE: tclreadline.h.in


    $Id$

    ---
    tclreadline -- gnu readline for tcl
    http://www.zellner.org/tclreadline/
    Copyright (c) 1998 - 2014, Johannes Zellner <johannes@zellner.org>
    This software is copyright under the BSD license.
    ================================================================== */  

#ifndef TCLREADLINE_H_
#define TCLREADLINE_H_

#include <tcl.h>

Modified tclreadline.n.in from [561d62d80a] to [ec7927137d].

1
2
3
4
5
6
7
8
9
10
11

12
13
14
15
16
17
18
.TH tclreadline n "@PATCHLEVEL_STR@" "Johannes Zellner"

.\" FILE: "/home/joze/src/tclreadline/tclreadline.n.in"
.\" LAST MODIFICATION: "Mit, 10 Jan 2001 06:29:33 +0100 (joze)"
.\" (C) 1998 - 2001 by Johannes Zellner, <johannes@zellner.org>
.\" $Id$
.\" ---
.\" tclreadline -- gnu readline for tcl
.\" http://www.zellner.org/tclreadline/
.\" Copyright (c) 1998 - 2001, Johannes Zellner <johannes@zellner.org>
.\" This software is copyright under the BSD license.



.\"	# CS - begin code excerpt
.de CS
.RS
.nf
.ta .25i .5i .75i 1i


|
<
<




|

>







1
2
3


4
5
6
7
8
9
10
11
12
13
14
15
16
17
.TH tclreadline n "@PATCHLEVEL_STR@" "Johannes Zellner"

.\" FILE: tclreadline.n.in


.\" $Id$
.\" ---
.\" tclreadline -- gnu readline for tcl
.\" http://www.zellner.org/tclreadline/
.\" Copyright (c) 1998 - 2014, Johannes Zellner <johannes@zellner.org>
.\" This software is copyright under the BSD license.
.\" ---


.\"	# CS - begin code excerpt
.de CS
.RS
.nf
.ta .25i .5i .75i 1i

Modified tclreadlineCompleter.tcl from [cf379af2f8] to [1ea8a61e03].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# -*- tclsh -*-
# FILE: "/home/joze/src/tclreadline/tclreadlineCompleter.tcl"
# LAST MODIFICATION: "Mit, 10 Jan 2001 06:29:33 +0100 (joze)"
# (C) 1998 - 2001 by Johannes Zellner, <johannes@zellner.org>
# $Id$
# vim:set ts=4:
# ---
#
# tclreadline -- gnu readline for tcl
# http://www.zellner.org/tclreadline/
# Copyright (c) 1998 - 2001, Johannes Zellner <johannes@zellner.org>
#
# This software is copyright under the BSD license.
#
# ================================================================== 


# TODO:
#
#	- tcltest is missing
#	- better completion for CompleteListFromList:
#	  RemoveUsedOptions ...

|
<
<

<

<


|
<

|
<







1
2


3

4

5
6
7

8
9

10
11
12
13
14
15
16
# -*- tclsh -*-
# FILE: tclreadlineCompleter.tcl


# $Id$

# ---

# tclreadline -- gnu readline for tcl
# http://www.zellner.org/tclreadline/
# Copyright (c) 1998 - 2014, Johannes Zellner <johannes@zellner.org>

# This software is copyright under the BSD license.
# ---



# TODO:
#
#	- tcltest is missing
#	- better completion for CompleteListFromList:
#	  RemoveUsedOptions ...

Modified tclreadlineInit.tcl.in from [56eefa1686] to [554b1c74c7].

1
2
3
4
5
6
7
8
9

10
11
12
13
14
15
16
# FILE: "/home/joze/src/tclreadline/tclreadlineInit.tcl.in"
# LAST MODIFICATION: "Mit, 10 Jan 2001 06:29:33 +0100 (joze)"
# (C) 1998 - 2001 by Johannes Zellner, <johannes@zellner.org>
# $Id$
# ---
# tclreadline -- gnu readline for tcl
# http://www.zellner.org/tclreadline/
# Copyright (c) 1998 - 2001, Johannes Zellner <johannes@zellner.org>
# This software is copyright under the BSD license.


package provide tclreadline @VERSION@

namespace eval tclreadline:: {
    namespace export Init
}

|
<
<




|

>







1


2
3
4
5
6
7
8
9
10
11
12
13
14
15
# FILE: tclreadlineInit.tcl.in


# $Id$
# ---
# tclreadline -- gnu readline for tcl
# http://www.zellner.org/tclreadline/
# Copyright (c) 1998 - 2014, Johannes Zellner <johannes@zellner.org>
# This software is copyright under the BSD license.
# ---

package provide tclreadline @VERSION@

namespace eval tclreadline:: {
    namespace export Init
}

Modified tclreadlineSetup.tcl.in from [91dcec21a3] to [601cc4d255].

1
2
3
4
5
6
7
8
9

10
11
12
13
14
15
16
# FILE: "/home/joze/src/tclreadline/tclreadlineSetup.tcl.in"
# LAST MODIFICATION: "Mit, 10 Jan 2001 06:29:34 +0100 (joze)"
# (C) 1998 - 2001 by Johannes Zellner, <johannes@zellner.org>
# $Id$
# ---
# tclreadline -- gnu readline for tcl
# http://www.zellner.org/tclreadline/
# Copyright (c) 1998 - 2001, Johannes Zellner <johannes@zellner.org>
# This software is copyright under the BSD license.



package provide tclreadline @VERSION@

proc unknown args {

    global auto_noexec auto_noload env unknown_pending tcl_interactive
|
<
<




|

>







1


2
3
4
5
6
7
8
9
10
11
12
13
14
15
# FILE: tclreadlineSetup.tcl.in


# $Id$
# ---
# tclreadline -- gnu readline for tcl
# http://www.zellner.org/tclreadline/
# Copyright (c) 1998 - 2014, Johannes Zellner <johannes@zellner.org>
# This software is copyright under the BSD license.
# ---


package provide tclreadline @VERSION@

proc unknown args {

    global auto_noexec auto_noload env unknown_pending tcl_interactive

Modified tclshrl.c from [6604055b46] to [c7e5e71138].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

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

    FILE: "/home/joze/src/tclreadline/tclshrl.c"
    LAST MODIFICATION: "Mit, 10 Jan 2001 06:29:34 +0100 (joze)"
    (C) 1998 - 2001 by Johannes Zellner, <johannes@zellner.org>
    $Id$
    ---

    tclreadline -- gnu readline for tcl
    http://www.zellner.org/tclreadline/
    Copyright (c) 1998 - 2001, Johannes Zellner <johannes@zellner.org>

    This software is copyright under the BSD license.

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

#ifdef HAVE_CONFIG_H
#   include "config.h"
#endif

#include <tcl.h>
<

|
<
<
<


<


|
<

<








1
2



3
4

5
6
7

8

9
10
11
12
13
14
15

 /* ==================================================================
    FILE: tclshrl.c



    $Id$
    ---

    tclreadline -- gnu readline for tcl
    http://www.zellner.org/tclreadline/
    Copyright (c) 1998 - 2014, Johannes Zellner <johannes@zellner.org>

    This software is copyright under the BSD license.

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

#ifdef HAVE_CONFIG_H
#   include "config.h"
#endif

#include <tcl.h>

Modified wishrl.c from [fd844d639f] to [d3a28cc973].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

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

    FILE: "/home/joze/src/tclreadline/wishrl.c"
    LAST MODIFICATION: "Mit, 10 Jan 2001 06:29:34 +0100 (joze)"
    (C) 1998 - 2001 by Johannes Zellner, <johannes@zellner.org>
    $Id$
    ---

    tclreadline -- gnu readline for tcl
    http://www.zellner.org/tclreadline/
    Copyright (c) 1998 - 2001, Johannes Zellner <johannes@zellner.org>

    This software is copyright under the BSD license.

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

#ifdef HAVE_CONFIG_H
#   include "config.h"
#endif

#include <tcl.h>
<

|
<
<
<


<


|
<

<








1
2



3
4

5
6
7

8

9
10
11
12
13
14
15

 /* ==================================================================
    FILE: wishrl.c



    $Id$
    ---

    tclreadline -- gnu readline for tcl
    http://www.zellner.org/tclreadline/
    Copyright (c) 1998 - 2014, Johannes Zellner <johannes@zellner.org>

    This software is copyright under the BSD license.

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

#ifdef HAVE_CONFIG_H
#   include "config.h"
#endif

#include <tcl.h>