r1246 - in packages/libterm-readline-gnu-perl/branches/upstream/current: . Gnu eg t t/comptest
Gunnar Wolf
gwolf@costa.debian.org
Fri Jul 15 11:38:45 UTC 2005
Author: gwolf
Date: 2005-07-15 11:38:44 +0000 (Fri, 15 Jul 2005)
New Revision: 1246
Added:
packages/libterm-readline-gnu-perl/branches/upstream/current/META.yml
Modified:
packages/libterm-readline-gnu-perl/branches/upstream/current/Gnu.pm
packages/libterm-readline-gnu-perl/branches/upstream/current/Gnu.xs
packages/libterm-readline-gnu-perl/branches/upstream/current/Gnu/XS.pm
packages/libterm-readline-gnu-perl/branches/upstream/current/Gnu/euc_jp.pm
packages/libterm-readline-gnu-perl/branches/upstream/current/INSTALL
packages/libterm-readline-gnu-perl/branches/upstream/current/MANIFEST
packages/libterm-readline-gnu-perl/branches/upstream/current/Makefile.PL
packages/libterm-readline-gnu-perl/branches/upstream/current/README
packages/libterm-readline-gnu-perl/branches/upstream/current/eg/fileman
packages/libterm-readline-gnu-perl/branches/upstream/current/eg/perlsh
packages/libterm-readline-gnu-perl/branches/upstream/current/eg/pftp
packages/libterm-readline-gnu-perl/branches/upstream/current/eg/ptksh+
packages/libterm-readline-gnu-perl/branches/upstream/current/ppport.h
packages/libterm-readline-gnu-perl/branches/upstream/current/t/button.pl
packages/libterm-readline-gnu-perl/branches/upstream/current/t/callback.t
packages/libterm-readline-gnu-perl/branches/upstream/current/t/comptest/0123
packages/libterm-readline-gnu-perl/branches/upstream/current/t/comptest/012345
packages/libterm-readline-gnu-perl/branches/upstream/current/t/comptest/023456
packages/libterm-readline-gnu-perl/branches/upstream/current/t/comptest/README
packages/libterm-readline-gnu-perl/branches/upstream/current/t/comptest/a_b
packages/libterm-readline-gnu-perl/branches/upstream/current/t/history.t
packages/libterm-readline-gnu-perl/branches/upstream/current/t/inputrc
packages/libterm-readline-gnu-perl/branches/upstream/current/t/readline.t
packages/libterm-readline-gnu-perl/branches/upstream/current/typemap
Log:
Load /tmp/tmp.9GyUra/libterm-readline-gnu-perl-1.15 into
packages/libterm-readline-gnu-perl/branches/upstream/current.
Modified: packages/libterm-readline-gnu-perl/branches/upstream/current/Gnu/XS.pm
===================================================================
--- packages/libterm-readline-gnu-perl/branches/upstream/current/Gnu/XS.pm 2005-07-14 18:23:28 UTC (rev 1245)
+++ packages/libterm-readline-gnu-perl/branches/upstream/current/Gnu/XS.pm 2005-07-15 11:38:44 UTC (rev 1246)
@@ -2,9 +2,9 @@
#
# XS.pm : perl function definition for Term::ReadLine::Gnu
#
-# $Id: XS.pm,v 1.20 2002-07-27 22:39:49-05 hiroo Exp $
+# $Id: XS.pm,v 1.22 2004-10-17 12:02:23-05 hiroo Exp $
#
-# Copyright (c) 2002 Hiroo Hayashi. All rights reserved.
+# Copyright (c) 2003 Hiroo Hayashi. All rights reserved.
#
# This program is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
@@ -87,6 +87,7 @@
sub rl_discard_keymap ($) { return _rl_discard_keymap(_str2map($_[0])); }
sub rl_set_keymap ($) { return _rl_set_keymap(_str2map($_[0])); }
+# rl_bind_key
sub rl_bind_key ($$;$) {
if (defined $_[2]) {
return _rl_bind_key($_[0], _str2fn($_[1]), _str2map($_[2]));
@@ -95,6 +96,21 @@
}
}
+# rl_bind_key_if_unbound
+sub rl_bind_key_if_unbound ($$;$) {
+ my ($version) = $Attribs{library_version}
+ =~ /(\d+\.\d+)/;
+ if ($version < 5.0) {
+ carp "rl_bind_key_if_unbound() is not supported. Ignored\n";
+ return;
+ }
+ if (defined $_[2]) {
+ return _rl_bind_key_if_unbound($_[0], _str2fn($_[1]), _str2map($_[2]));
+ } else {
+ return _rl_bind_key_if_unbound($_[0], _str2fn($_[1]));
+ }
+}
+
# rl_unbind_key
sub unbind_key ($;$) {
if (defined $_[1]) {
@@ -135,6 +151,21 @@
}
}
+# rl_bind_keyseq
+sub rl_bind_keyseq ($$;$) {
+ my ($version) = $Attribs{library_version}
+ =~ /(\d+\.\d+)/;
+ if ($version < 5.0) {
+ carp "rl_bind_keyseq() is not supported. Ignored\n";
+ return;
+ }
+ if (defined $_[2]) {
+ return _rl_bind_keyseq($_[0], _str2fn($_[1]), _str2map($_[2]));
+ } else {
+ return _rl_bind_keyseq($_[0], _str2fn($_[1]));
+ }
+}
+
sub rl_set_key ($$;$) {
my ($version) = $Attribs{library_version}
=~ /(\d+\.\d+)/;
@@ -149,6 +180,21 @@
}
}
+# rl_bind_keyseq_if_unbound
+sub rl_bind_keyseq_if_unbound ($$;$) {
+ my ($version) = $Attribs{library_version}
+ =~ /(\d+\.\d+)/;
+ if ($version < 5.0) {
+ carp "rl_bind_keyseq_if_unbound() is not supported. Ignored\n";
+ return;
+ }
+ if (defined $_[2]) {
+ return _rl_bind_keyseq_if_unbound($_[0], _str2fn($_[1]), _str2map($_[2]));
+ } else {
+ return _rl_bind_keyseq_if_unbound($_[0], _str2fn($_[1]));
+ }
+}
+
sub rl_macro_bind ($$;$) {
my ($version) = $Attribs{library_version}
=~ /(\d+\.\d+)/;
@@ -212,6 +258,12 @@
}
sub rl_tty_set_default_bindings (;$) {
+ my ($version) = $Attribs{library_version}
+ =~ /(\d+\.\d+)/;
+ if ($version < 4.2) {
+ carp "rl_tty_set_default_bindings() is not supported. Ignored\n";
+ return;
+ }
if (defined $_[0]) {
return _rl_tty_set_defaut_bindings(_str2map($_[1]));
} else {
@@ -219,6 +271,20 @@
}
}
+sub rl_tty_unset_default_bindings (;$) {
+ my ($version) = $Attribs{library_version}
+ =~ /(\d+\.\d+)/;
+ if ($version < 5.0) {
+ carp "rl_tty_unset_default_bindings() is not supported. Ignored\n";
+ return;
+ }
+ if (defined $_[0]) {
+ return _rl_tty_unset_defaut_bindings(_str2map($_[1]));
+ } else {
+ return _rl_tty_unset_defaut_bindings();
+ }
+}
+
sub rl_message {
my $fmt = shift;
my $line = sprintf($fmt, @_);
Property changes on: packages/libterm-readline-gnu-perl/branches/upstream/current/Gnu/XS.pm
___________________________________________________________________
Name: svn:executable
-
+ *
Property changes on: packages/libterm-readline-gnu-perl/branches/upstream/current/Gnu/euc_jp.pm
___________________________________________________________________
Name: svn:executable
-
+ *
Modified: packages/libterm-readline-gnu-perl/branches/upstream/current/Gnu.pm
===================================================================
--- packages/libterm-readline-gnu-perl/branches/upstream/current/Gnu.pm 2005-07-14 18:23:28 UTC (rev 1245)
+++ packages/libterm-readline-gnu-perl/branches/upstream/current/Gnu.pm 2005-07-15 11:38:44 UTC (rev 1246)
@@ -1,9 +1,9 @@
#
# Gnu.pm --- The GNU Readline/History Library wrapper module
#
-# $Id: Gnu.pm,v 1.92 2003-03-16 20:29:39-05 hiroo Exp $
+# $Id: Gnu.pm,v 1.95 2004-10-17 12:44:43-05 hiroo Exp $
#
-# Copyright (c) 2001 Hiroo Hayashi. All rights reserved.
+# Copyright (c) 2004 Hiroo Hayashi. All rights reserved.
#
# This program is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
@@ -58,12 +58,22 @@
use strict;
use Carp;
+# This module can't be loaded directly.
+BEGIN {
+ if (not defined $Term::ReadLine::VERSION) {
+ croak <<END;
+It is invalid to load Term::ReadLine::Gnu directly. Please consult
+the Term::ReadLine documentation for more information.
+END
+ }
+}
+
{
use Exporter ();
use DynaLoader;
use vars qw($VERSION @ISA @EXPORT_OK);
- $VERSION = '1.14';
+ $VERSION = '1.15';
# Term::ReadLine::Gnu::AU makes a function in
# `Term::ReadLine::Gnu::XS' as a method.
@@ -316,7 +326,7 @@
}
# add to history buffer
- $self->add_history($line)
+ $self->add_history($line)
if (defined $self->{MinLength} && $self->{MinLength} > 0
&& length($line) >= $self->{MinLength});
@@ -505,26 +515,30 @@
history_length => ['I', 12],
history_max_entries => ['I', 13],
max_input_history => ['I', 13], # before GRL 4.2
- history_expansion_char => ['C', 14],
- history_subst_char => ['C', 15],
- history_comment_char => ['C', 16],
- history_quotes_inhibit_expansion => ['I', 17],
- rl_erase_empty_line => ['I', 18], # GRL 4.0
- rl_catch_signals => ['I', 19], # GRL 4.0
- rl_catch_sigwinch => ['I', 20], # GRL 4.0
- rl_already_prompted => ['I', 21], # GRL 4.1
- rl_num_chars_to_read => ['I', 22], # GRL 4.2
- rl_dispatching => ['I', 23], # GRL 4.2
- rl_gnu_readline_p => ['I', 24], # GRL 4.2
- rl_readline_state => ['I', 25], # GRL 4.2
- rl_explicit_arg => ['I', 26], # GRL 4.2
- rl_numeric_arg => ['I', 27], # GRL 4.2
- rl_editing_mode => ['I', 28], # GRL 4.2
- rl_attempted_completion_over => ['I', 29], # GRL 4.2
- rl_completion_type => ['I', 30], # GRL 4.2
- rl_readline_version => ['I', 31], # GRL 4.2a
- rl_completion_suppress_append => ['I', 32], # GRL 4.3
- rl_completion_mark_symlink_dirs => ['I', 33], # GRL 4.3
+ history_write_timestamps => ['I', 14], # GRL 5.0
+ history_expansion_char => ['C', 15],
+ history_subst_char => ['C', 16],
+ history_comment_char => ['C', 17],
+ history_quotes_inhibit_expansion => ['I', 18],
+ rl_erase_empty_line => ['I', 19], # GRL 4.0
+ rl_catch_signals => ['I', 20], # GRL 4.0
+ rl_catch_sigwinch => ['I', 21], # GRL 4.0
+ rl_already_prompted => ['I', 22], # GRL 4.1
+ rl_num_chars_to_read => ['I', 23], # GRL 4.2
+ rl_dispatching => ['I', 24], # GRL 4.2
+ rl_gnu_readline_p => ['I', 25], # GRL 4.2
+ rl_readline_state => ['I', 26], # GRL 4.2
+ rl_explicit_arg => ['I', 27], # GRL 4.2
+ rl_numeric_arg => ['I', 28], # GRL 4.2
+ rl_editing_mode => ['I', 29], # GRL 4.2
+ rl_attempted_completion_over => ['I', 30], # GRL 4.2
+ rl_completion_type => ['I', 31], # GRL 4.2
+ rl_readline_version => ['I', 32], # GRL 4.2a
+ rl_completion_suppress_append => ['I', 33], # GRL 4.3
+ rl_completion_quote_character => ['C', 34], # GRL 5.0
+ rl_completion_suppress_quote => ['I', 35], # GRL 5.0
+ rl_completion_found_quote => ['I', 36], # GRL 5.0
+ rl_completion_mark_symlink_dirs => ['I', 37], # GRL 4.3
rl_startup_hook => ['F', 0],
rl_event_hook => ['F', 1],
@@ -540,8 +554,9 @@
history_inhibit_expansion_function => ['F', 11],
rl_pre_input_hook => ['F', 12], # GRL 4.0
rl_completion_display_matches_hook => ['F', 13], # GRL 4.0
- rl_prep_term_function => ['F', 14], # GRL 4.2
- rl_deprep_term_function => ['F', 15], # GRL 4.2
+ rl_completion_word_break_hook => ['F', 14], # GRL 5.0
+ rl_prep_term_function => ['F', 15], # GRL 4.2
+ rl_deprep_term_function => ['F', 16], # GRL 4.2
rl_instream => ['IO', 0],
rl_outstream => ['IO', 1],
@@ -768,6 +783,11 @@
C<add_defun> method. If optional argument C<MAP> is specified, binds
in C<MAP>. Returns non-zero in case of error.
+=item C<bind_key_if_unbound(KEY, FUNCTION [,MAP])>
+
+ int rl_bind_key_if_unbound(int key, FunctionPtr|str function,
+ Keymap|str map = rl_get_keymap()) #GRL5.0
+
=item C<unbind_key(KEY [,MAP])>
int rl_unbind_key(int key, Keymap|str map = rl_get_keymap())
@@ -784,11 +804,21 @@
int rl_unbind_command(str command,
Keymap|str map = rl_get_keymap())
+=item C<bind_keyseq(KEYSEQ, FUNCTION [,MAP])>
+
+ int rl_bind_keyseq(str keyseq, FunctionPtr|str function,
+ Keymap|str map = rl_get_keymap()) # GRL 5.0
+
=item C<set_key(KEYSEQ, FUNCTION [,MAP])>
int rl_set_key(str keyseq, FunctionPtr|str function,
- Keymap|str map = rl_get_keymap())
+ Keymap|str map = rl_get_keymap())
+=item C<bind_keyseq_if_unbound(KEYSEQ, FUNCTION [,MAP])>
+
+ int rl_bind_keyseq_if_unbound(str keyseq, FunctionPtr|str function,
+ Keymap|str map = rl_get_keymap()) # GRL 5.0
+
=item C<generic_bind(TYPE, KEYSEQ, DATA, [,MAP])>
int rl_generic_bind(int type, str keyseq,
@@ -1010,6 +1040,10 @@
void rl_tty_set_default_bindings([Keymap KMAP]) # GRL 4.2
+=item C<tty_unset_default_bindings(KMAP)>
+
+ void rl_tty_unset_default_bindings([Keymap KMAP]) # GRL 5.0
+
=item C<reset_terminal([TERMINAL_NAME])>
int rl_reset_terminal(str terminal_name = getenv($TERM)) # GRL 4.2
@@ -1208,6 +1242,10 @@
sets the history of input, from where it can be used if the actual
C<readline> is present.
+=item C<add_history_time(STRING)>
+
+ void add_history_time(str string) # GRL 5.0
+
=item C<remove_history(WHICH)>
str remove_history(int which)
@@ -1242,6 +1280,10 @@
str history_get(offset)
+=item C<history_get_time(OFFSET)>
+
+ time_t history_get_time(offset)
+
=item C<history_total_bytes>
int history_total_bytes()
@@ -1382,7 +1424,7 @@
int rl_point
int rl_end
int rl_mark
- int rl_done
+ int rl_done
int rl_num_chars_to_read (GRL 4.2)
int rl_pending_input
int rl_dispatching (GRL 4.2)
@@ -1428,11 +1470,15 @@
str rl_basic_word_break_characters
str rl_basic_quote_characters
str rl_completer_word_break_characters
+ pfunc rl_completion_word_break_hook (GRL 5.0)
str rl_completer_quote_characters
str rl_filename_quote_characters
str rl_special_prefixes
int rl_completion_append_character
int rl_completion_suppress_append (GRL 4.3)
+ int rl_completion_quote_charactor (GRL 5.0)
+ int rl_completion_suppress_quote (GRL 5.0)
+ int rl_completion_found_quote (GRL 5.0)
int rl_completion_mark_symlink_dirs (GRL 4.3)
int rl_ignore_completion_duplicates
int rl_filename_completion_desired
@@ -1449,6 +1495,7 @@
int history_base
int history_length
int history_max_entries (called `max_input_history'. read only)
+ int history_write_timestamps (GRL 5.0)
char history_expansion_char
char history_subst_char
char history_comment_char
@@ -1828,6 +1875,12 @@
including command history and auto-completion of Postscript font names
and reserved words.
+=item vshnu (the New Visual Shell)
+
+ http://www.cs.indiana.edu/~kinzler/vshnu/
+
+A visual shell and CLI shell supplement.
+
=back
If you know any other works which can be listed here, please let me
Property changes on: packages/libterm-readline-gnu-perl/branches/upstream/current/Gnu.pm
___________________________________________________________________
Name: svn:executable
-
+ *
Modified: packages/libterm-readline-gnu-perl/branches/upstream/current/Gnu.xs
===================================================================
--- packages/libterm-readline-gnu-perl/branches/upstream/current/Gnu.xs 2005-07-14 18:23:28 UTC (rev 1245)
+++ packages/libterm-readline-gnu-perl/branches/upstream/current/Gnu.xs 2005-07-15 11:38:44 UTC (rev 1246)
@@ -1,9 +1,9 @@
/*
* Gnu.xs --- GNU Readline wrapper module
*
- * $Id: Gnu.xs,v 1.104 2003-03-16 20:25:27-05 hiroo Exp $
+ * $Id: Gnu.xs,v 1.108 2004-10-17 12:37:53-05 hiroo Exp $
*
- * Copyright (c) 2002 Hiroo Hayashi. All rights reserved.
+ * Copyright (c) 2004 Hiroo Hayashi. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the same terms as Perl itself.
@@ -12,6 +12,7 @@
#ifdef __cplusplus
extern "C" {
#endif
+#define PERLIO_NOT_STDIO 0
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
@@ -167,10 +168,19 @@
extern char *rl_get_termcap PARAMS((const char *));
/* features introduced by GNU Readline 4.3 */
-static int rl_completion_suppress_append;
-static int rl_completion_mark_symlink_dirs;
+static int rl_completion_suppress_append = 0;
+static int rl_completion_mark_symlink_dirs = 0;
#endif /* (RL_READLINE_VERSION < 0x0403) */
+#if (RL_VERSION_MAJOR < 5)
+/* features introduced by GNU Readline 5.0 */
+static int history_write_timestamps = 0;
+static int rl_completion_quote_character = 0;
+static int rl_completion_suppress_quote = 0;
+static int rl_completion_found_quote = 0;
+static Function *rl_completion_word_break_hook = NULL;
+#endif /* (RL_VERSION_MAJOR < 5) */
+
/*
* utility/dummy functions
*/
@@ -328,36 +338,46 @@
#else /* (RL_READLINE_VERSION < 0x0402) */
{ &max_input_history, 0, 1 }, /* 13 */
#endif /* (RL_READLINE_VERSION < 0x0402) */
- { (int *)&history_expansion_char, 1, 0 }, /* 14 */
- { (int *)&history_subst_char, 1, 0 }, /* 15 */
- { (int *)&history_comment_char, 1, 0 }, /* 16 */
- { &history_quotes_inhibit_expansion, 0, 0 }, /* 17 */
- { &rl_erase_empty_line, 0, 0 }, /* 18 */
- { &rl_catch_signals, 0, 0 }, /* 19 */
- { &rl_catch_sigwinch, 0, 0 }, /* 20 */
- { &rl_already_prompted, 0, 0 }, /* 21 */
- { &rl_num_chars_to_read, 0, 0 }, /* 22 */
- { &rl_dispatching, 0, 0 }, /* 23 */
- { &rl_gnu_readline_p, 0, 1 }, /* 24 */
- { &rl_readline_state, 0, 0 }, /* 25 */
- { &rl_explicit_arg, 0, 0 }, /* 26 */
- { &rl_numeric_arg, 0, 0 }, /* 27 */
- { &rl_editing_mode, 0, 0 }, /* 28 */
- { &rl_attempted_completion_over, 0, 0 }, /* 29 */
- { &rl_completion_type, 0, 0 }, /* 30 */
- { &rl_readline_version, 0, 1 }, /* 31 */
- { &rl_completion_suppress_append, 0, 0 }, /* 32 */
- { &rl_completion_mark_symlink_dirs, 0, 0 } /* 33 */
+ { &history_write_timestamps, 0, 0 }, /* 14 */
+ { (int *)&history_expansion_char, 1, 0 }, /* 15 */
+ { (int *)&history_subst_char, 1, 0 }, /* 16 */
+ { (int *)&history_comment_char, 1, 0 }, /* 17 */
+ { &history_quotes_inhibit_expansion, 0, 0 }, /* 18 */
+ { &rl_erase_empty_line, 0, 0 }, /* 19 */
+ { &rl_catch_signals, 0, 0 }, /* 20 */
+ { &rl_catch_sigwinch, 0, 0 }, /* 21 */
+ { &rl_already_prompted, 0, 0 }, /* 22 */
+ { &rl_num_chars_to_read, 0, 0 }, /* 23 */
+ { &rl_dispatching, 0, 0 }, /* 24 */
+ { &rl_gnu_readline_p, 0, 1 }, /* 25 */
+ { &rl_readline_state, 0, 0 }, /* 26 */
+ { &rl_explicit_arg, 0, 0 }, /* 27 */
+ { &rl_numeric_arg, 0, 0 }, /* 28 */
+ { &rl_editing_mode, 0, 0 }, /* 29 */
+ { &rl_attempted_completion_over, 0, 0 }, /* 30 */
+ { &rl_completion_type, 0, 0 }, /* 31 */
+ { &rl_readline_version, 0, 1 }, /* 32 */
+ { &rl_completion_suppress_append, 0, 0 }, /* 33 */
+ { &rl_completion_quote_character, 0, 0 }, /* 34 */
+ { &rl_completion_suppress_quote, 0, 0 }, /* 35 */
+ { &rl_completion_found_quote, 0, 0 }, /* 36 */
+ { &rl_completion_mark_symlink_dirs, 0, 0 } /* 37 */
};
/*
+ * PerlIO variables for _rl_store_iostream(), _rl_fetch_iostream()
+ */
+static PerlIO *instreamPIO = NULL;
+static PerlIO *outstreamPIO = NULL;
+
+/*
* function pointer variable table for _rl_store_function(),
* _rl_fetch_funtion()
*/
static int startup_hook_wrapper PARAMS((void));
static int event_hook_wrapper PARAMS((void));
-static int getc_function_wrapper PARAMS((FILE *));
+static int getc_function_wrapper PARAMS((PerlIO *));
static void redisplay_function_wrapper PARAMS((void));
static char *completion_entry_function_wrapper PARAMS((const char *, int));;
static char **attempted_completion_function_wrapper PARAMS((char *, int, int));
@@ -372,6 +392,7 @@
static int pre_input_hook_wrapper PARAMS((void));
static void completion_display_matches_hook_wrapper PARAMS((char **matches,
int len, int max));
+static char *completion_word_break_hook_wrapper PARAMS((void));
static int prep_term_function_wrapper PARAMS((int meta_flag));
static int deprep_term_function_wrapper PARAMS((void));
static int directory_rewrite_hook_wrapper PARAMS((char **));
@@ -380,7 +401,8 @@
CMP_ENT, ATMPT_COMP,
FN_QUOTE, FN_DEQUOTE, CHAR_IS_QUOTEDP,
IGNORE_COMP, DIR_COMP, HIST_INHIBIT_EXP,
- PRE_INPUT_HOOK, COMP_DISP_HOOK, PREP_TERM, DEPREP_TERM, DIR_REWRITE
+ PRE_INPUT_HOOK, COMP_DISP_HOOK, COMP_WD_BRK_HOOK,
+ PREP_TERM, DEPREP_TERM, DIR_REWRITE
};
static struct fn_vars {
@@ -454,19 +476,25 @@
NULL
},
{
- (Function **)&rl_prep_term_function, /* 14 */
+ (Function **)&rl_completion_word_break_hook, /* 14 */
+ NULL,
+ (Function *)completion_word_break_hook_wrapper,
+ NULL
+ },
+ {
+ (Function **)&rl_prep_term_function, /* 15 */
(Function *)rl_prep_terminal,
(Function *)prep_term_function_wrapper,
NULL
},
{
- (Function **)&rl_deprep_term_function, /* 15 */
+ (Function **)&rl_deprep_term_function, /* 16 */
(Function *)rl_deprep_terminal,
(Function *)deprep_term_function_wrapper,
NULL
},
{
- (Function **)&rl_directory_rewrite_hook, /* 16 */
+ (Function **)&rl_directory_rewrite_hook, /* 17 */
NULL,
(Function *)directory_rewrite_hook_wrapper,
NULL
@@ -477,6 +505,9 @@
* Perl function wrappers
*/
+/*
+ * for rl_voidfunc_t : void fn(void)
+ */
static int
voidfunc_wrapper(type)
int type;
@@ -504,6 +535,9 @@
return ret;
}
+/*
+ * for rl_vintfunc_t : void fn(int)
+ */
static int
vintfunc_wrapper(type, arg)
int type;
@@ -534,6 +568,9 @@
return ret;
}
+/*
+ * for rl_icppfunc_t : int fn(char **)
+ */
static int
icppfunc_wrapper(type, arg)
int type;
@@ -580,18 +617,126 @@
return ret;
}
+#if 0
+/*
+ * for rl_icpfunc_t : int fn(char *)
+ */
static int
+icpfunc_wrapper(type, text)
+ int type;
+ char *text;
+{
+ dSP;
+ int count;
+ int ret;
+
+ ENTER;
+ SAVETMPS;
+
+ PUSHMARK(sp);
+ if (text) {
+ XPUSHs(sv_2mortal(newSVpv(text, 0)));
+ } else {
+ XPUSHs(&PL_sv_undef);
+ }
+ PUTBACK;
+
+ count = perl_call_sv(fn_tbl[type].callback, G_SCALAR);
+
+ SPAGAIN;
+
+ if (count != 1)
+ croak("Gnu.xs:icpfunc_wrapper: Internal error\n");
+
+ ret = POPi; /* warns unless integer */
+ PUTBACK;
+ FREETMPS;
+ LEAVE;
+ return ret;
+}
+#endif
+
+/*
+ * for rl_cpvfunc_t : (char *)fn(void)
+ */
+static char *
+cpvfunc_wrapper(type)
+ int type;
+{
+ dSP;
+ int count;
+ char *str;
+ SV *svret;
+
+ ENTER;
+ SAVETMPS;
+
+ PUSHMARK(sp);
+ count = perl_call_sv(fn_tbl[type].callback, G_SCALAR);
+ SPAGAIN;
+
+ if (count != 1)
+ croak("Gnu.xs:cpvfunc_wrapper: Internal error\n");
+
+ svret = POPs;
+ str = SvOK(svret) ? dupstr(SvPV(svret, PL_na)) : NULL;
+ PUTBACK;
+ FREETMPS;
+ LEAVE;
+ return str;
+}
+
+/*
+ * for rl_linebuf_func_t : int fn(char *, int)
+ */
+static int
+icpintfunc_wrapper(type, text, index)
+ int type;
+ char *text;
+ int index;
+{
+ dSP;
+ int count;
+ int ret;
+
+ ENTER;
+ SAVETMPS;
+
+ PUSHMARK(sp);
+ if (text) {
+ XPUSHs(sv_2mortal(newSVpv(text, 0)));
+ } else {
+ XPUSHs(&PL_sv_undef);
+ }
+ XPUSHs(sv_2mortal(newSViv(index)));
+ PUTBACK;
+
+ count = perl_call_sv(fn_tbl[type].callback, G_SCALAR);
+
+ SPAGAIN;
+
+ if (count != 1)
+ croak("Gnu.xs:icpintfunc_wrapper: Internal error\n");
+
+ ret = POPi; /* warns unless integer */
+ PUTBACK;
+ FREETMPS;
+ LEAVE;
+ return ret;
+}
+
+static int
startup_hook_wrapper() { return voidfunc_wrapper(STARTUP_HOOK); }
static int
event_hook_wrapper() { return voidfunc_wrapper(EVENT_HOOK); }
static int
getc_function_wrapper(fp)
- FILE *fp;
+ PerlIO *fp;
{
/*
- * 'FILE *fp' is ignored. Use rl_instream instead in the getc_function.
- * How can I pass 'FILE *fp'?
+ * 'PerlIO *fp' is ignored. Use rl_instream instead in the getc_function.
+ * How can I pass 'PerlIO *fp'?
*/
return voidfunc_wrapper(GETC_FN);
}
@@ -601,6 +746,7 @@
/*
* call a perl function as rl_completion_entry_function
+ * for rl_compentry_func_t : (char *)fn(const char *, int)
*/
static char *
@@ -643,6 +789,7 @@
/*
* call a perl function as rl_attempted_completion_function
+ * for rl_completion_func_t : (char **)fn(const char *, int, int)
*/
static char **
@@ -728,6 +875,7 @@
/*
* call a perl function as rl_filename_quoting_function
+ * for rl_quote_func_t : (char *)fn(char *, int, char *)
*/
static char *
@@ -776,6 +924,7 @@
/*
* call a perl function as rl_filename_dequoting_function
+ * for rl_dequote_func_t : (char *)fn(char *, int)
*/
static char *
@@ -825,38 +974,12 @@
char *text;
int index;
{
- dSP;
- int count;
- int ret;
-
- ENTER;
- SAVETMPS;
-
- PUSHMARK(sp);
- if (text) {
- XPUSHs(sv_2mortal(newSVpv(text, 0)));
- } else {
- XPUSHs(&PL_sv_undef);
- }
- XPUSHs(sv_2mortal(newSViv(index)));
- PUTBACK;
-
- count = perl_call_sv(fn_tbl[CHAR_IS_QUOTEDP].callback, G_SCALAR);
-
- SPAGAIN;
-
- if (count != 1)
- croak("Gnu.xs:char_is_quoted_p_wrapper: Internal error\n");
-
- ret = POPi; /* warns unless integer */
- PUTBACK;
- FREETMPS;
- LEAVE;
- return ret;
+ return icpintfunc_wrapper(CHAR_IS_QUOTEDP, text, index);
}
/*
* call a perl function as rl_ignore_some_completions_function
+ * for rl_compignore_func_t : int fn(char **)
*/
static void
@@ -962,34 +1085,7 @@
char *text;
int index;
{
- dSP;
- int count;
- int ret;
-
- ENTER;
- SAVETMPS;
-
- PUSHMARK(sp);
- if (text) {
- XPUSHs(sv_2mortal(newSVpv(text, 0)));
- } else {
- XPUSHs(&PL_sv_undef);
- }
- XPUSHs(sv_2mortal(newSViv(index)));
- PUTBACK;
-
- count = perl_call_sv(fn_tbl[HIST_INHIBIT_EXP].callback, G_SCALAR);
-
- SPAGAIN;
-
- if (count != 1)
- croak("Gnu.xs:history_inhibit_expansion_function_wrapper: Internal error\n");
-
- ret = POPi; /* warns unless integer */
- PUTBACK;
- FREETMPS;
- LEAVE;
- return ret;
+ return icpintfunc_wrapper(HIST_INHIBIT_EXP, text, index);
}
static int
@@ -998,6 +1094,7 @@
#if (RL_VERSION_MAJOR >= 4)
/*
* call a perl function as rl_completion_display_matches_hook
+ * for rl_compdisp_func_t : void fn(char **, int, int)
*/
static void
@@ -1047,6 +1144,12 @@
}
#endif /* (RL_VERSION_MAJOR < 4) */
+static char *
+completion_word_break_hook_wrapper()
+{
+ return cpvfunc_wrapper(COMP_WD_BRK_HOOK);
+}
+
static int
prep_term_function_wrapper(meta_flag)
int meta_flag;
@@ -1282,7 +1385,21 @@
OUTPUT:
RETVAL
+#if (RL_VERSION_MAJOR >= 5)
int
+_rl_bind_key_if_unbound(key, function, map = rl_get_keymap())
+ int key
+ rl_command_func_t * function
+ Keymap map
+ PROTOTYPE: $$;$
+ CODE:
+ RETVAL = rl_bind_key_if_unbound_in_map(key, function, map);
+ OUTPUT:
+ RETVAL
+
+#endif /* (RL_VERSION_MAJOR >= 5) */
+
+int
_rl_unbind_key(key, map = rl_get_keymap())
int key
Keymap map
@@ -1319,6 +1436,20 @@
#endif /* (RL_READLINE_VERSION >= 0x0202) */
+#if (RL_VERSION_MAJOR >= 5)
+int
+_rl_bind_keyseq(keyseq, function, map = rl_get_keymap())
+ const char *keyseq
+ rl_command_func_t * function
+ Keymap map
+ PROTOTYPE: $$;$
+ CODE:
+ RETVAL = rl_bind_keyseq_in_map(keyseq, function, map);
+ OUTPUT:
+ RETVAL
+
+#endif /* (RL_VERSION_MAJOR >= 5) */
+
#if (RL_READLINE_VERSION >= 0x0402)
# rl_set_key() is introduced by readline-4.2 and equivalent with
# rl_generic_bind(ISFUNC, keyseq, (char *)function, map).
@@ -1335,7 +1466,21 @@
#endif /* (RL_READLINE_VERSION >= 0x0402) */
+#if (RL_VERSION_MAJOR >= 5)
int
+_rl_bind_keyseq_if_unbound(keyseq, function, map = rl_get_keymap())
+ const char *keyseq
+ rl_command_func_t * function
+ Keymap map
+ PROTOTYPE: $$;$
+ CODE:
+ RETVAL = rl_bind_keyseq_if_unbound_in_map(keyseq, function, map);
+ OUTPUT:
+ RETVAL
+
+#endif /* (RL_VERSION_MAJOR >= 5) */
+
+int
_rl_generic_bind_function(keyseq, function, map = rl_get_keymap())
CONST char * keyseq
rl_command_func_t * function
@@ -1743,6 +1888,16 @@
#endif /* (RL_VERSION_MAJOR >= 4) */
+#if (RL_VERSION_MAJOR >= 5)
+void
+_rl_tty_unset_default_bindings(kmap = rl_get_keymap())
+ Keymap kmap
+ PROTOTYPE: ;$
+ CODE:
+ rl_tty_unset_default_bindings(kmap);
+
+#endif /* (RL_VERSION_MAJOR >= 5) */
+
int
rl_reset_terminal(terminal_name = NULL)
CONST char * terminal_name
@@ -2101,6 +2256,14 @@
CONST char * string
PROTOTYPE: $
+#if (RL_VERSION_MAJOR >= 5)
+void
+add_history_time(string)
+ CONST char * string
+ PROTOTYPE: $
+
+#endif /* (RL_VERSION_MAJOR >= 5) */
+
HIST_ENTRY *
remove_history(which)
int which
@@ -2110,10 +2273,18 @@
CLEANUP:
if (RETVAL) {
xfree(RETVAL->line);
+#if (RL_VERSION_MAJOR >= 5)
+ xfree(RETVAL->timestamp);
+#endif /* (RL_VERSION_MAJOR >= 5) */
xfree(RETVAL->data);
xfree((char *)RETVAL);
}
+ # free_history_entry() is introduced by GNU Readline Library 5.0.
+ # Since Term::ReadLine::Gnu does not support the member 'data' of HIST_ENTRY
+ # structure, remove_history() covers it.
+
+ # The 3rd parameter (histdata_t) is not supported. Does anyone use it?
HIST_ENTRY *
replace_history_entry(which, line)
int which
@@ -2126,6 +2297,9 @@
CLEANUP:
if (RETVAL) {
xfree(RETVAL->line);
+#if (RL_VERSION_MAJOR >= 5)
+ xfree(RETVAL->timestamp);
+#endif /* (RL_VERSION_MAJOR >= 5) */
xfree(RETVAL->data);
xfree((char *)RETVAL);
}
@@ -2178,6 +2352,26 @@
int offset
PROTOTYPE: $
+#if (RL_VERSION_MAJOR >= 5)
+ # To keep compatibility, I cannot make a function whose argument
+ # is "HIST_ENTRY *".
+time_t
+history_get_time(offset)
+ int offset
+ PROTOTYPE: $
+ CODE:
+ {
+ HIST_ENTRY *he = history_get(offset);
+ if (he)
+ RETVAL = history_get_time(he);
+ else
+ RETVAL = 0;
+ }
+ OUTPUT:
+ RETVAL
+
+#endif /* (RL_VERSION_MAJOR >= 5) */
+
int
history_total_bytes()
PROTOTYPE:
@@ -2468,19 +2662,25 @@
}
}
-FILE *
+PerlIO *
_rl_store_iostream(stream, id)
- FILE * stream
+ PerlIO *stream
int id
PROTOTYPE: $$
CODE:
{
switch (id) {
case 0:
- RETVAL = rl_instream = stream;
+ if (instreamPIO != NULL)
+ PerlIO_releaseFILE(instreamPIO, rl_instream);
+ rl_instream = PerlIO_findFILE(stream);
+ RETVAL = instreamPIO = stream;
break;
case 1:
- RETVAL = rl_outstream = stream;
+ if (outstreamPIO != NULL)
+ PerlIO_releaseFILE(outstreamPIO, rl_outstream);
+ rl_outstream = PerlIO_findFILE(stream);
+ RETVAL = outstreamPIO = stream;
#ifdef __CYGWIN__
{
/* Cygwin b20.1 library converts NL to CR-NL
@@ -2504,7 +2704,7 @@
OUTPUT:
RETVAL
-FILE *
+PerlIO *
_rl_fetch_iostream(id)
int id
PROTOTYPE: $
@@ -2512,10 +2712,16 @@
{
switch (id) {
case 0:
- RETVAL = rl_instream;
+ if (instreamPIO == NULL)
+ RETVAL = instreamPIO = PerlIO_importFILE(rl_instream, NULL);
+ else
+ RETVAL = instreamPIO;
break;
case 1:
- RETVAL = rl_outstream;
+ if (outstreamPIO == NULL)
+ RETVAL = outstreamPIO = PerlIO_importFILE(rl_outstream, NULL);
+ else
+ RETVAL = outstreamPIO;
break;
default:
warn("Gnu.xs:_rl_fetch_iostream: Illegal `id' value: `%d'", id);
Property changes on: packages/libterm-readline-gnu-perl/branches/upstream/current/Gnu.xs
___________________________________________________________________
Name: svn:executable
-
+ *
Property changes on: packages/libterm-readline-gnu-perl/branches/upstream/current/INSTALL
___________________________________________________________________
Name: svn:executable
-
+ *
Modified: packages/libterm-readline-gnu-perl/branches/upstream/current/MANIFEST
===================================================================
--- packages/libterm-readline-gnu-perl/branches/upstream/current/MANIFEST 2005-07-14 18:23:28 UTC (rev 1245)
+++ packages/libterm-readline-gnu-perl/branches/upstream/current/MANIFEST 2005-07-15 11:38:44 UTC (rev 1246)
@@ -22,3 +22,4 @@
t/inputrc A file for t/readline.t
t/readline.t a test script for the GNU Readline extension
typemap The GNU Readline extension interface types
+META.yml Module meta-data (added by MakeMaker)
Property changes on: packages/libterm-readline-gnu-perl/branches/upstream/current/MANIFEST
___________________________________________________________________
Name: svn:executable
-
+ *
Added: packages/libterm-readline-gnu-perl/branches/upstream/current/META.yml
===================================================================
--- packages/libterm-readline-gnu-perl/branches/upstream/current/META.yml 2005-07-14 18:23:28 UTC (rev 1245)
+++ packages/libterm-readline-gnu-perl/branches/upstream/current/META.yml 2005-07-15 11:38:44 UTC (rev 1246)
@@ -0,0 +1,10 @@
+# http://module-build.sourceforge.net/META-spec.html
+#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
+name: Term-ReadLine-Gnu
+version: 1.15
+version_from: Gnu.pm
+installdirs: site
+requires:
+
+distribution_type: module
+generated_by: ExtUtils::MakeMaker version 6.17
Property changes on: packages/libterm-readline-gnu-perl/branches/upstream/current/Makefile.PL
___________________________________________________________________
Name: svn:executable
-
+ *
Modified: packages/libterm-readline-gnu-perl/branches/upstream/current/README
===================================================================
--- packages/libterm-readline-gnu-perl/branches/upstream/current/README 2005-07-14 18:23:28 UTC (rev 1245)
+++ packages/libterm-readline-gnu-perl/branches/upstream/current/README 2005-07-15 11:38:44 UTC (rev 1246)
@@ -1,9 +1,9 @@
-*- Indented-text -*-
-$Id: README,v 1.24 2003-03-16 22:52:50-05 hiroo Exp $
+$Id: README,v 1.25 2004-10-17 14:54:11-05 hiroo Exp $
Term::ReadLine::Gnu --- GNU Readline Library Wrapper Module
- Copyright (c) 2003 Hiroo Hayashi. All rights reserved.
+ Copyright (c) 2004 Hiroo Hayashi. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
@@ -62,6 +62,24 @@
Revision History:
+1.15 2004-10-17
+ - readline-5.0 support
+ new function
+ bind_key_if_unbound
+ bind_keyseq
+ bind_keyseq_if_unbound
+ tty_unset_default_bindings
+ add_history_time
+ history_get_time
+ new variable
+ history_write_timestamps
+ completion_quote_character
+ completion_suppress_quote
+ completion_found_quote
+ completion_word_break_hook
+ - double IO stream close bug fix (more use of PerlIO)
+ - warning on 'use Term::ReadLine::Gnu;'.
+
1.14 2003-03-16
- kludge not to cause segmentation fault on Perl 5.8.0
w/PerlIO and FileHandle (ex. CPAN.pm)
Property changes on: packages/libterm-readline-gnu-perl/branches/upstream/current/README
___________________________________________________________________
Name: svn:executable
-
+ *
Property changes on: packages/libterm-readline-gnu-perl/branches/upstream/current/eg/fileman
___________________________________________________________________
Name: svn:executable
-
+ *
Property changes on: packages/libterm-readline-gnu-perl/branches/upstream/current/eg/perlsh
___________________________________________________________________
Name: svn:executable
-
+ *
Property changes on: packages/libterm-readline-gnu-perl/branches/upstream/current/eg/pftp
___________________________________________________________________
Name: svn:executable
-
+ *
Property changes on: packages/libterm-readline-gnu-perl/branches/upstream/current/eg/ptksh+
___________________________________________________________________
Name: svn:executable
-
+ *
Property changes on: packages/libterm-readline-gnu-perl/branches/upstream/current/ppport.h
___________________________________________________________________
Name: svn:executable
-
+ *
Property changes on: packages/libterm-readline-gnu-perl/branches/upstream/current/t/button.pl
___________________________________________________________________
Name: svn:executable
-
+ *
Property changes on: packages/libterm-readline-gnu-perl/branches/upstream/current/t/callback.t
___________________________________________________________________
Name: svn:executable
-
+ *
Property changes on: packages/libterm-readline-gnu-perl/branches/upstream/current/t/comptest/0123
___________________________________________________________________
Name: svn:executable
-
+ *
Property changes on: packages/libterm-readline-gnu-perl/branches/upstream/current/t/comptest/012345
___________________________________________________________________
Name: svn:executable
-
+ *
Property changes on: packages/libterm-readline-gnu-perl/branches/upstream/current/t/comptest/023456
___________________________________________________________________
Name: svn:executable
-
+ *
Property changes on: packages/libterm-readline-gnu-perl/branches/upstream/current/t/comptest/README
___________________________________________________________________
Name: svn:executable
-
+ *
Property changes on: packages/libterm-readline-gnu-perl/branches/upstream/current/t/comptest/a_b
___________________________________________________________________
Name: svn:executable
-
+ *
Property changes on: packages/libterm-readline-gnu-perl/branches/upstream/current/t/history.t
___________________________________________________________________
Name: svn:executable
-
+ *
Property changes on: packages/libterm-readline-gnu-perl/branches/upstream/current/t/inputrc
___________________________________________________________________
Name: svn:executable
-
+ *
Property changes on: packages/libterm-readline-gnu-perl/branches/upstream/current/t/readline.t
___________________________________________________________________
Name: svn:executable
-
+ *
Modified: packages/libterm-readline-gnu-perl/branches/upstream/current/typemap
===================================================================
--- packages/libterm-readline-gnu-perl/branches/upstream/current/typemap 2005-07-14 18:23:28 UTC (rev 1245)
+++ packages/libterm-readline-gnu-perl/branches/upstream/current/typemap 2005-07-15 11:38:44 UTC (rev 1246)
@@ -1,10 +1,9 @@
# typemap for Term::ReadLine::Gnu
#
-# $Id: typemap,v 1.7 2003-03-16 00:11:14-05 hiroo Exp $
+# $Id: typemap,v 1.8 2004-10-17 11:44:57-05 hiroo Exp $
const char * T_PV
CONST char * T_PV
-#FILE * T_INOUT
Keymap T_PTROBJ
Function * T_PTROBJ
rl_command_func_t * T_PTROBJ
@@ -21,12 +20,10 @@
OUTPUT
T_STDIO
{
- /* module FileHandle expects PerlIO is blessed to IO::Handle */
- /* This stop segmentation fault on Perl 5.8.0 w/PerlIO */
- GV *gv = newGVgen("IO::Handle");
+ GV *gv = newGVgen("$Package");
PerlIO *fp = PerlIO_importFILE($var,0);
if ( fp && do_open(gv, "+<&", 3, FALSE, 0, 0, fp) )
- sv_setsv($arg, sv_bless(newRV((SV*)gv), gv_stashpv("IO::Handle",1)));
+ sv_setsv($arg, sv_bless(newRV((SV*)gv), gv_stashpv("$Package",1)));
else
$arg = &PL_sv_undef;
}
Property changes on: packages/libterm-readline-gnu-perl/branches/upstream/current/typemap
___________________________________________________________________
Name: svn:executable
-
+ *
More information about the Pkg-perl-cvs-commits
mailing list