Commit 55a420e1 authored by unknown's avatar unknown

Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.0

into  ramayana.hindu.god:/home/tsmith/m/bk/maint/50


client/mysqldump.c:
  Auto merged
include/my_sys.h:
  Auto merged
libmysql/CMakeLists.txt:
  Auto merged
libmysql/Makefile.shared:
  Auto merged
myisam/ft_boolean_search.c:
  Auto merged
myisam/sort.c:
  Auto merged
mysql-test/t/cast.test:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/ha_myisam.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/set_var.h:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
mysql-test/mysql-test-run.pl:
  Manual merge
mysql-test/r/ctype_ucs.result:
  Manual merge
mysql-test/r/func_misc.result:
  Manual merge
mysql-test/t/binlog_killed.test:
  Manual merge
mysql-test/t/ctype_ucs.test:
  Manual merge
mysql-test/t/func_misc.test:
  Manual merge
sql/item_strfunc.h:
  Manual merge
strings/ctype-simple.c:
  Manual merge
parents 416e1d9d 7991e6a6
......@@ -4,8 +4,6 @@
*.bb
*.bbg
*.bin
*.vcproj.cmake
cmake_install.cmake
*.cdf
*.core
*.d
......@@ -33,6 +31,7 @@ cmake_install.cmake
*.spec
*.user
*.vcproj
*.vcproj.cmake
*/*.dir/*
*/*_pure_*warnings
*/.deps
......@@ -347,6 +346,7 @@ client/tmp.diff
client_debug/*
client_release/*
client_test
cmake_install.cmake
cmd-line-utils/libedit/common.h
cmd-line-utils/libedit/makelist
comon.h
......@@ -366,6 +366,9 @@ contrib/*.vcproj
core
core.*
core.2430
cscope.in.out
cscope.out
cscope.po.out
db-*.*.*
dbug/*.ds?
dbug/*.vcproj
......@@ -377,6 +380,8 @@ dbug/main.r
dbug/output*.r
dbug/user.ps
dbug/user.t
debian/control
debian/defs.mk
depcomp
emacs.h
examples/*.ds?
......@@ -413,6 +418,7 @@ heap/hp_test2
help
help.c
help.h
include/abi_check
include/check_abi
include/my_config.h
include/my_global.h
......@@ -472,6 +478,7 @@ libmysql/release/libmysql.exp
libmysql/vio_priv.h
libmysql_r/*.c
libmysql_r/acconfig.h
libmysql_r/client_settings.h
libmysql_r/conf_to_src
libmysql_r/my_static.h
libmysql_r/mysys_priv.h
......@@ -1257,6 +1264,7 @@ support-files/mysql-3.23.29-gamma.spec
support-files/mysql-log-rotate
support-files/mysql.server
support-files/mysql.spec
support-files/mysqld_multi.server
support-files/ndb-config-2-node.ini
tags
test/ndbapi/bank/bankCreator
......@@ -1315,6 +1323,7 @@ test_xml
tests/*.ds?
tests/*.vcproj
tests/.libs -prune
tests/bug25714
tests/client_test
tests/connect_test
tests/mysql_client_test
......@@ -1342,11 +1351,3 @@ win/vs71cache.txt
win/vs8cache.txt
zlib/*.ds?
zlib/*.vcproj
debian/control
debian/defs.mk
include/abi_check
support-files/mysqld_multi.server
tests/bug25714
cscope.in.out
cscope.out
cscope.po.out
#!/usr/bin/bash
function _find_mysql_root () (
while [ "x$PWD" != "x/" ]; do
# Check if some directories are present
if [ -d BUILD -a -d sql -a -d mysys ]; then
echo "$PWD"
return 0
fi
cd ..
done
return 1
)
make -k clean || true
/bin/rm -f */.deps/*.P config.cache
path=`dirname $0`
. "$path/autorun.sh"
warning_flags="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused"
compiler_flags="-g -O3 -fno-omit-frame-pointer"
export CC CXX CFLAGS CXXFLAGS LDFLAGS LIBS
CC="gcc"
CXX="gcc"
CFLAGS="$warning_flags $compiler_flags"
CXXFLAGS=""
LDFLAGS="-O3 -g -static-libgcc"
LIBS=-lmtmalloc
root=$(_find_mysql_root)
$root/configure \
--prefix=/usr/local/mysql \
--localstatedir=/usr/local/mysql/data \
--libexecdir=/usr/local/mysql/bin \
--with-extra-charsets=complex \
--enable-thread-safe-client \
--enable-local-infile \
--with-zlib-dir=bundled \
--with-big-tables \
--with-readline \
--with-archive-storage-engine \
--with-named-curses=-lcurses \
--with-big-tables \
--with-innodb \
--with-berkeley-db \
--with-example-storage-engine \
--with-blackhole-storage-engine \
--with-ndbcluster \
--with-federated-storage-engine \
--with-csv-storage-engine \
--with-ssl \
--with-embedded-server \
--disable-shared
#!/usr/bin/perl
my $status = 0;
my $pending = $ENV{'BK_PENDING'};
exit 0 unless -f $pending;
open FI, "<", $pending || exit 0;
while(<FI>) {
my ($file, $stuff) = split /\|/, $_, 2;
next unless -f $file;
$file =~ s/^(.*)\/([^\/]*)$/$2/;
my $path = $1;
opendir DIR, $path;
my @files = sort map { lc } readdir DIR;
closedir DIR;
my %count = ();
$count{$_}++ for @files;
@files = grep { $count{$_} > 1 } keys %count;
if(@files > 0) {
print "$path/$file: duplicate file names: " . (join " ", @files) . "\n";
$status = 1;
}
}
close FI;
exit $status;
......@@ -13,6 +13,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.7 FATAL_ERROR)
PROJECT(MySql)
# This reads user configuration, generated by configure.js.
......@@ -109,6 +111,15 @@ IF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR
STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS_INIT ${CMAKE_CXX_FLAGS_INIT})
STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS_DEBUG_INIT ${CMAKE_CXX_FLAGS_DEBUG_INIT})
# Disable automatic manifest generation.
STRING(REPLACE "/MANIFEST" "/MANIFEST:NO" CMAKE_EXE_LINKER_FLAGS
${CMAKE_EXE_LINKER_FLAGS})
# Explicitly disable it since it is the default for newer versions of VS
STRING(REGEX MATCH "MANIFEST:NO" tmp_manifest ${CMAKE_EXE_LINKER_FLAGS})
IF(NOT tmp_manifest)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO")
ENDIF(NOT tmp_manifest)
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR
CMAKE_GENERATOR MATCHES "Visual Studio 8")
......@@ -156,14 +167,6 @@ IF(EMBED_MANIFESTS)
MESSAGE(FATAL_ERROR "Sign tool, signtool.exe, can't be found.")
ENDIF(HAVE_SIGN_TOOL)
# Disable automatic manifest generation.
STRING(REPLACE "/MANIFEST" "/MANIFEST:NO" CMAKE_EXE_LINKER_FLAGS
${CMAKE_EXE_LINKER_FLAGS})
# Explicitly disable it since it is the default for newer versions of VS
STRING(REGEX MATCH "MANIFEST:NO" tmp_manifest ${CMAKE_EXE_LINKER_FLAGS})
IF(NOT tmp_manifest)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO")
ENDIF(NOT tmp_manifest)
# Set the processor architecture.
IF(CMAKE_GENERATOR MATCHES "Visual Studio 8 2005 Win64")
SET(PROCESSOR_ARCH "amd64")
......
You can find information about how to install binary distributions at
http://dev.mysql.com/doc/refman/5.0/en/quick-standard-installation.html
The MySQL Reference Manual is also available in various formats on
http://dev.mysql.com/doc; if you're interested in the DocBook XML
sources go to http://svn.mysql.com.
......@@ -13,14 +13,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
noinst_SCRIPTS = Support/generate-text-files.pl
EXTRA_DIST = $(noinst_SCRIPTS) manual.chm mysql.info INSTALL-BINARY
TXT_FILES= ../INSTALL-SOURCE ../INSTALL-WIN-SOURCE \
INSTALL-BINARY ../support-files/MacOSX/ReadMe.txt
all-local: $(TXT_FILES)
EXTRA_DIST = mysql.info INSTALL-BINARY
# make sure that "make install" installs the info page, too
# automake only seems to take care of this automatically,
......@@ -32,31 +25,5 @@ install-data-hook: $(srcdir)/mysql.info
uninstall-local:
@RM@ -f $(DESTDIR)$(infodir)/mysql.info
# Problems with "make distclean", works differently for make files
# generated by different versions of the automake. Some require the
# generated files explicitly in DISTCLEANFILES.
DISTCLEANFILES = $(TXT_FILES)
# This target is not used in builds, just for convinience
CLEAN_FILES: $(TXT_FILES)
touch $(TXT_FILES)
GT = $(srcdir)/Support/generate-text-files.pl
../INSTALL-SOURCE: $(srcdir)/mysql.info $(GT)
perl -w $(GT) $(srcdir)/mysql.info "installing-source" "windows-source-build" > $@
../INSTALL-WIN-SOURCE: $(srcdir)/mysql.info $(GT)
perl -w $(GT) $(srcdir)/mysql.info "windows-source-build" "post-installation" > $@
# We put the description for the binary installation here so that
# people who download source wont have to see it. It is moved up to
# the toplevel by the script that makes the binary tar files.
INSTALL-BINARY: $(srcdir)/mysql.info $(GT)
perl -w $(GT) $(srcdir)/mysql.info "installing-binary" "installing-source" > $@
../support-files/MacOSX/ReadMe.txt: $(srcdir)/mysql.info $(GT)
perl -w $(GT) $(srcdir)/mysql.info "mac-os-x-installation" "netware-installation" > $@
# Don't update the files from bitkeeper
%::SCCS/s.%
#!/usr/bin/perl -w -*- perl -*-
# Copyright (C) 2000, 2003, 2005 MySQL AB
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# Generate text files from top directory from the manual.
$from = shift(@ARGV);
$fnode = shift(@ARGV);
$tnode = shift(@ARGV);
open(IN, "$from") || die "Cannot open $from: $!";
$in = 0;
while (<IN>)
{
if ($in)
{
if (/Node: $tnode,/ || /\[index/)
{
$in = 0;
}
elsif (/^File: mysql.info/ || (/^/))
{
# Just Skip node beginnings
}
else
{
print;
}
}
else
{
if (/Node: $fnode,/)
{
$in = 1;
# Skip first empty line
<IN>;
}
}
}
close(IN);
die "Could not find node \"$tnode\"" if ($in == 1);
exit 0;
*********************************************************
This is a dummy placeholder file for "manual.chm" in the
MySQL source trees.
Note, that the documentation has been moved into a separate
BitKeeper source tree named "mysqldoc" - do not attempt to edit this
file! All changes to it should be done in the mysqldoc tree.
This dummy file is being replaced with the actual file from the
mysqldoc tree when building the official source distribution.
*********************************************************
This is mysql.info, produced by makeinfo version 4.8 from manual.texi.
START-INFO-DIR-ENTRY
* mysql: (mysql). MySQL documentation.
END-INFO-DIR-ENTRY

File: mysql.info, Node: Top, Next: (dir), Prev: (dir), Up: (dir)
This is an empty placeholder file for the MySQL manual.
The MySQL manual is now maintained in a separate BitKeeper source tree!
Please see `http://www.mysql.com/doc/en/Installing_source_tree.html'
for more info on how to work with BitKeeper.
This file will be replaced with the current `mysql.info' when building
the official source distribution.
You can find a specific manual for any older version of MySQL in the
binary or source distribution for that version.

Tag Table:
Node: Top166

End Tag Table
The MySQL Reference Manual is available in various formats on
http://dev.mysql.com/doc; if you're interested in the DocBook XML
sources go to http://svn.mysql.com.
You can find information about how to install from a source distributions at
http://dev.mysql.com/doc/refman/5.0/en/installing-source.html
The MySQL Reference Manual is also available in various formats on
http://dev.mysql.com/doc; if you're interested in the DocBook XML
sources go to http://svn.mysql.com.
You can find information about how to install from a Windows source
distributions at
http://dev.mysql.com/doc/refman/5.0/en/windows-source-build.html
The MySQL Reference Manual is also available in various formats on
http://dev.mysql.com/doc; if you're interested in the DocBook XML
sources go to http://svn.mysql.com.
......@@ -51,5 +51,5 @@ enum options_client
OPT_TRIGGERS,
OPT_IGNORE_TABLE,OPT_INSERT_IGNORE,OPT_SHOW_WARNINGS,OPT_DROP_DATABASE,
OPT_TZ_UTC, OPT_AUTO_CLOSE, OPT_SSL_VERIFY_SERVER_CERT,
OPT_DEBUG_INFO, OPT_ERROR_LOG_FILE
OPT_DEBUG_INFO, OPT_ERROR_LOG_FILE, OPT_DUMP_DATE
};
......@@ -140,6 +140,7 @@ static my_bool info_flag=0,ignore_errors=0,wait_flag=0,quick=0,
default_pager_set= 0, opt_sigint_ignore= 0,
show_warnings= 0;
static volatile int executing_query= 0, interrupted_query= 0;
static my_bool preserve_comments= 0;
static ulong opt_max_allowed_packet, opt_net_buffer_length;
static uint verbose=0,opt_silent=0,opt_mysql_port=0, opt_local_infile=0;
static my_string opt_mysql_unix_port=0;
......@@ -759,6 +760,10 @@ static struct my_option my_long_options[] =
{"show-warnings", OPT_SHOW_WARNINGS, "Show warnings after every statement.",
(gptr*) &show_warnings, (gptr*) &show_warnings, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
{"comments", 'c', "Preserve comments. Send comments to the server."
" Comments are discarded by default, enable with --enable-comments",
(gptr*) &preserve_comments, (gptr*) &preserve_comments,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
......@@ -1047,6 +1052,17 @@ static int read_and_execute(bool interactive)
if (!interactive)
{
line=batch_readline(status.line_buff);
/*
Skip UTF8 Byte Order Marker (BOM) 0xEFBBBF.
Editors like "notepad" put this marker in
the very beginning of a text file when
you save the file using "Unicode UTF-8" format.
*/
if (!line_number &&
(uchar) line[0] == 0xEF &&
(uchar) line[1] == 0xBB &&
(uchar) line[2] == 0xBF)
line+= 3;
line_number++;
if (!glob_buffer.length())
status.query_start_line=line_number;
......@@ -1136,10 +1152,6 @@ static int read_and_execute(bool interactive)
status.exit_status=0;
break;
}
if (!in_string && (line[0] == '#' ||
(line[0] == '-' && line[1] == '-') ||
line[0] == 0))
continue; // Skip comment lines
/*
Check if line is a mysql command line
......@@ -1265,15 +1277,21 @@ static bool add_line(String &buffer,char *line,char *in_string,
for (pos=out=line ; (inchar= (uchar) *pos) ; pos++)
{
if (my_isspace(charset_info,inchar) && out == line &&
buffer.is_empty())
continue;
if (!preserve_comments)
{
// Skip spaces at the beggining of a statement
if (my_isspace(charset_info,inchar) && (out == line) &&
buffer.is_empty())
continue;
}
#ifdef USE_MB
// Accept multi-byte characters as-is
int length;
if (use_mb(charset_info) &&
(length= my_ismbchar(charset_info, pos, end_of_line)))
{
if (!*ml_comment)
if (!*ml_comment || preserve_comments)
{
while (length--)
*out++ = *pos++;
......@@ -1299,8 +1317,13 @@ static bool add_line(String &buffer,char *line,char *in_string,
}
if ((com=find_command(NullS,(char) inchar)))
{
const String tmp(line,(uint) (out-line), charset_info);
buffer.append(tmp);
// Flush previously accepted characters
if (out != line)
{
buffer.append(line, (uint) (out-line));
out= line;
}
if ((*com->func)(&buffer,pos-1) > 0)
DBUG_RETURN(1); // Quit
if (com->takes_params)
......@@ -1328,7 +1351,6 @@ static bool add_line(String &buffer,char *line,char *in_string,
pos+= delimiter_length - 1; // Point at last delim char
}
}
out=line;
}
else
{
......@@ -1341,46 +1363,105 @@ static bool add_line(String &buffer,char *line,char *in_string,
}
}
else if (!*ml_comment && !*in_string &&
(*pos == *delimiter && is_prefix(pos + 1, delimiter + 1) ||
buffer.length() == 0 && (out - line) >= 9 &&
!my_strcasecmp(charset_info, line, "delimiter")))
{
uint old_delimiter_length= delimiter_length;
strlen(pos) >= 10 &&
!my_strnncoll(charset_info, (uchar*) pos, 10,
(const uchar*) "delimiter ", 10))
{
// Flush previously accepted characters
if (out != line)
{
buffer.append(line, (uint32) (out - line));
out= line;
}
// Flush possible comments in the buffer
if (!buffer.is_empty())
{
if (com_go(&buffer, 0) > 0) // < 0 is not fatal
DBUG_RETURN(1);
buffer.length(0);
}
/*
Delimiter wants the get rest of the given line as argument to
allow one to change ';' to ';;' and back
*/
buffer.append(pos);
if (com_delimiter(&buffer, pos) > 0)
DBUG_RETURN(1);
buffer.length(0);
break;
}
else if (!*ml_comment && !*in_string && is_prefix(pos, delimiter))
{
// Found a statement. Continue parsing after the delimiter
pos+= delimiter_length;
if (preserve_comments)
{
while (my_isspace(charset_info, *pos))
*out++= *pos++;
}
// Flush previously accepted characters
if (out != line)
buffer.append(line, (uint) (out - line)); // Add this line
{
buffer.append(line, (uint32) (out-line));
out= line;
}
if (preserve_comments && ((*pos == '#') ||
((*pos == '-') &&
(pos[1] == '-') &&
my_isspace(charset_info, pos[2]))))
{
// Add trailing single line comments to this statement
buffer.append(pos);
pos+= strlen(pos);
}
pos--;
if ((com= find_command(buffer.c_ptr(), 0)))
{
if (com->func == com_delimiter)
{
/*
Delimiter wants the get rest of the given line as argument to
allow one to change ';' to ';;' and back
*/
char *end= strend(pos);
buffer.append(pos, (uint) (end - pos));
/* Ensure pos will point at \0 after the pos+= below */
pos= end - old_delimiter_length + 1;
}
if ((*com->func)(&buffer, buffer.c_ptr()) > 0)
DBUG_RETURN(1); // Quit
if ((*com->func)(&buffer, buffer.c_ptr()) > 0)
DBUG_RETURN(1); // Quit
}
else
{
if (com_go(&buffer, 0) > 0) // < 0 is not fatal
DBUG_RETURN(1);
if (com_go(&buffer, 0) > 0) // < 0 is not fatal
DBUG_RETURN(1);
}
buffer.length(0);
out= line;
pos+= old_delimiter_length - 1;
}
else if (!*ml_comment && (!*in_string && (inchar == '#' ||
inchar == '-' && pos[1] == '-' &&
my_isspace(charset_info,pos[2]))))
break; // comment to end of line
{
// Flush previously accepted characters
if (out != line)
{
buffer.append(line, (uint32) (out - line));
out= line;
}
// comment to end of line
if (preserve_comments)
buffer.append(pos);
break;
}
else if (!*in_string && inchar == '/' && *(pos+1) == '*' &&
*(pos+2) != '!')
{
pos++;
if (preserve_comments)
{
*out++= *pos++; // copy '/'
*out++= *pos; // copy '*'
}
else
pos++;
*ml_comment= 1;
if (out != line)
{
......@@ -1390,8 +1471,21 @@ static bool add_line(String &buffer,char *line,char *in_string,
}
else if (*ml_comment && !ss_comment && inchar == '*' && *(pos + 1) == '/')
{
pos++;
if (preserve_comments)
{
*out++= *pos++; // copy '*'
*out++= *pos; // copy '/'
}
else
pos++;
*ml_comment= 0;
if (out != line)
{
buffer.append(line, (uint32) (out - line));
out= line;
}
// Consumed a 2 chars or more, and will add 1 at most,
// so using the 'line' buffer to edit data in place is ok.
need_space= 1;
}
else
......@@ -1406,14 +1500,12 @@ static bool add_line(String &buffer,char *line,char *in_string,
else if (!*ml_comment && !*in_string &&
(inchar == '\'' || inchar == '"' || inchar == '`'))
*in_string= (char) inchar;
if (!*ml_comment)
if (!*ml_comment || preserve_comments)
{
if (need_space && !my_isspace(charset_info, (char)inchar))
{
*out++= ' ';
need_space= 0;
}
*out++= (char) inchar;
need_space= 0;
*out++= (char) inchar;
}
}
}
......@@ -1423,7 +1515,7 @@ static bool add_line(String &buffer,char *line,char *in_string,
uint length=(uint) (out-line);
if (buffer.length() + length >= buffer.alloced_length())
buffer.realloc(buffer.length()+length+IO_SIZE);
if (!(*ml_comment) && buffer.append(line,length))
if ((!*ml_comment || preserve_comments) && buffer.append(line, length))
DBUG_RETURN(1);
}
DBUG_RETURN(0);
......
......@@ -89,7 +89,7 @@ static my_bool verbose= 0, opt_no_create_info= 0, opt_no_data= 0,
opt_drop=1,opt_keywords=0,opt_lock=1,opt_compress=0,
opt_delayed=0,create_options=1,opt_quoted=0,opt_databases=0,
opt_alldbs=0,opt_create_db=0,opt_lock_all_tables=0,
opt_set_charset=0,
opt_set_charset=0, opt_dump_date=1,
opt_autocommit=0,opt_disable_keys=1,opt_xml=0,
opt_delete_master_logs=0, tty_password=0,
opt_single_transaction=0, opt_comments= 0, opt_compact= 0,
......@@ -412,6 +412,9 @@ static struct my_option my_long_options[] =
"isolated from them. Option automatically turns off --lock-tables.",
(gptr*) &opt_single_transaction, (gptr*) &opt_single_transaction, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"dump-date", OPT_DUMP_DATE, "Put a dump date to the end of the output.",
(gptr*) &opt_dump_date, (gptr*) &opt_dump_date, 0,
GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
{"skip-opt", OPT_SKIP_OPTIMIZATION,
"Disable --opt. Disables --add-drop-table, --add-locks, --create-options, --quick, --extended-insert, --lock-tables, --set-charset, and --disable-keys.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
......@@ -633,10 +636,15 @@ static void write_footer(FILE *sql_file)
fputs("\n", sql_file);
if (opt_comments)
{
char time_str[20];
get_date(time_str, GETDATE_DATE_TIME, 0);
fprintf(sql_file, "-- Dump completed on %s\n",
time_str);
if (opt_dump_date)
{
char time_str[20];
get_date(time_str, GETDATE_DATE_TIME, 0);
fprintf(sql_file, "-- Dump completed on %s\n",
time_str);
}
else
fprintf(sql_file, "-- Dump completed\n");
}
check_io(sql_file);
}
......
......@@ -5,8 +5,7 @@
ASRC = $(srcdir)/vi.c $(srcdir)/emacs.c $(srcdir)/common.c
AHDR = vi.h emacs.h common.h
# Make sure to include stuff from this directory first, to get right "config.h"
INCLUDES = -I. -I$(top_builddir)/include -I$(top_srcdir)/include
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include
noinst_LIBRARIES = libedit.a
......@@ -31,7 +30,14 @@ EXTRA_DIST = makelist.sh np/unvis.c np/strlcpy.c np/vis.c np/vis.h np/strlcat.c
CLEANFILES = makelist common.h emacs.h vi.h fcns.h help.h fcns.c help.c
DEFS = -DUNDEF_THREADS_HACK -DHAVE_CONFIG_H -DNO_KILL_INTR
# Make sure to include stuff from this directory first, to get right "config.h"
# Automake puts into DEFAULT_INCLUDES this source and corresponding
# build directory together with ../../include to let all make files
# find the central "config.h". This variable is used before INCLUDES
# above. But in automake 1.10 the order of these are changed. Put the
# includes of this directory into DEFS to always be sure it is first
# before DEFAULT_INCLUDES on the compile line.
DEFS = -DUNDEF_THREADS_HACK -DHAVE_CONFIG_H -DNO_KILL_INTR -I. -I$(srcdir)
SUFFIXES = .sh
......
Basic Installation
==================
These are installation instructions for Readline-5.0.
These are installation instructions for Readline-5.2.
The simplest way to compile readline is:
......@@ -238,6 +238,9 @@ SHLIB_XLDFLAGS Additional flags to pass to SHOBJ_LD for shared library
SHLIB_LIBS Any additional libraries that shared libraries should be
linked against when they are created.
SHLIB_LIBPREF The prefix to use when generating the filename of the shared
library. The default is `lib'; Cygwin uses `cyg'.
SHLIB_LIBSUFF The suffix to add to `libreadline' and `libhistory' when
generating the filename of the shared library. Many systems
use `so'; HP-UX uses `sl'.
......@@ -254,6 +257,17 @@ SHLIB_LIBVERSION The string to append to the filename to indicate the version
numbers; use `$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' on those systems.
Other Unix versions use different schemes.
SHLIB_DLLVERSION The version number for shared libraries that determines API
compatibility between readline versions and the underlying
system. Used only on Cygwin. Defaults to $SHLIB_MAJOR, but
can be overridden at configuration time by defining DLLVERSION
in the environment.
SHLIB_DOT The character used to separate the name of the shared library
from the suffix and version information. The default is `.';
systems like Cygwin which don't separate version information
from the library name should set this to the empty string.
SHLIB_STATUS Set this to `supported' when you have defined the other
necessary variables. Make uses this to determine whether
or not shared library creation should be attempted. If
......
Introduction
============
This is the Gnu Readline library, version 5.0.
This is the Gnu Readline library, version 5.2.
The Readline library provides a set of functions for use by applications
that allow users to edit command lines as they are typed in. Both
......@@ -102,6 +102,9 @@ SHLIB_XLDFLAGS Additional flags to pass to SHOBJ_LD for shared library
SHLIB_LIBS Any additional libraries that shared libraries should be
linked against when they are created.
SHLIB_LIBPREF The prefix to use when generating the filename of the shared
library. The default is `lib'; Cygwin uses `cyg'.
SHLIB_LIBSUFF The suffix to add to `libreadline' and `libhistory' when
generating the filename of the shared library. Many systems
use `so'; HP-UX uses `sl'.
......@@ -118,6 +121,17 @@ SHLIB_LIBVERSION The string to append to the filename to indicate the version
numbers; use `$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' on those systems.
Other Unix versions use different schemes.
SHLIB_DLLVERSION The version number for shared libraries that determines API
compatibility between readline versions and the underlying
system. Used only on Cygwin. Defaults to $SHLIB_MAJOR, but
can be overridden at configuration time by defining DLLVERSION
in the environment.
SHLIB_DOT The character used to separate the name of the shared library
from the suffix and version information. The default is `.';
systems like Cygwin which don't separate version information
from the library name should set this to the empty string.
SHLIB_STATUS Set this to `supported' when you have defined the other
necessary variables. Make uses this to determine whether
or not shared library creation should be attempted.
......@@ -169,4 +183,4 @@ list (mirrored to the Usenet newsgroup gnu.bash.bug) often contains
Readline bug reports and fixes.
Chet Ramey
chet@po.cwru.edu
chet.ramey@case.edu
This diff is collapsed.
/* callback.c -- functions to use readline as an X `callback' mechanism. */
/* Copyright (C) 1987, 1989, 1992 Free Software Foundation, Inc.
/* Copyright (C) 1987-2005 Free Software Foundation, Inc.
This file is part of the GNU Readline Library, a library for
reading lines of text with interactive input and history editing.
......@@ -21,7 +21,9 @@
59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
#include "config_readline.h"
#if defined (HAVE_CONFIG_H)
# include <config.h>
#endif
#include "rlconf.h"
......@@ -41,10 +43,16 @@
#include "rldefs.h"
#include "readline.h"
#include "rlprivate.h"
#include "xmalloc.h"
/* Private data for callback registration functions. See comments in
rl_callback_read_char for more details. */
_rl_callback_func_t *_rl_callback_func = 0;
_rl_callback_generic_arg *_rl_callback_data = 0;
/* **************************************************************** */
/* */
/* Callback Readline Functions */
/* Callback Readline Functions */
/* */
/* **************************************************************** */
......@@ -70,7 +78,8 @@ _rl_callback_newline ()
{
in_handler = 1;
(*rl_prep_term_function) (_rl_meta_flag);
if (rl_prep_term_function)
(*rl_prep_term_function) (_rl_meta_flag);
#if defined (HANDLE_SIGNALS)
rl_set_signals ();
......@@ -87,6 +96,7 @@ rl_callback_handler_install (prompt, linefunc)
rl_vcpfunc_t *linefunc;
{
rl_set_prompt (prompt);
RL_SETSTATE (RL_STATE_CALLBACK);
rl_linefunc = linefunc;
_rl_callback_newline ();
}
......@@ -96,7 +106,8 @@ void
rl_callback_read_char ()
{
char *line;
int eof;
int eof, jcode;
static procenv_t olevel;
if (rl_linefunc == NULL)
{
......@@ -104,16 +115,89 @@ rl_callback_read_char ()
abort ();
}
eof = readline_internal_char ();
memcpy ((void *)olevel, (void *)readline_top_level, sizeof (procenv_t));
jcode = setjmp (readline_top_level);
if (jcode)
{
(*rl_redisplay_function) ();
_rl_want_redisplay = 0;
memcpy ((void *)readline_top_level, (void *)olevel, sizeof (procenv_t));
return;
}
/* We loop in case some function has pushed input back with rl_execute_next. */
for (;;)
do
{
if (RL_ISSTATE (RL_STATE_ISEARCH))
{
eof = _rl_isearch_callback (_rl_iscxt);
if (eof == 0 && (RL_ISSTATE (RL_STATE_ISEARCH) == 0) && RL_ISSTATE (RL_STATE_INPUTPENDING))
rl_callback_read_char ();
return;
}
else if (RL_ISSTATE (RL_STATE_NSEARCH))
{
eof = _rl_nsearch_callback (_rl_nscxt);
return;
}
else if (RL_ISSTATE (RL_STATE_NUMERICARG))
{
eof = _rl_arg_callback (_rl_argcxt);
if (eof == 0 && (RL_ISSTATE (RL_STATE_NUMERICARG) == 0) && RL_ISSTATE (RL_STATE_INPUTPENDING))
rl_callback_read_char ();
/* XXX - this should handle _rl_last_command_was_kill better */
else if (RL_ISSTATE (RL_STATE_NUMERICARG) == 0)
_rl_internal_char_cleanup ();
return;
}
else if (RL_ISSTATE (RL_STATE_MULTIKEY))
{
eof = _rl_dispatch_callback (_rl_kscxt); /* For now */
while ((eof == -1 || eof == -2) && RL_ISSTATE (RL_STATE_MULTIKEY) && _rl_kscxt && (_rl_kscxt->flags & KSEQ_DISPATCHED))
eof = _rl_dispatch_callback (_rl_kscxt);
if (RL_ISSTATE (RL_STATE_MULTIKEY) == 0)
{
_rl_internal_char_cleanup ();
_rl_want_redisplay = 1;
}
}
else if (_rl_callback_func)
{
/* This allows functions that simply need to read an additional
character (like quoted-insert) to register a function to be
called when input is available. _rl_callback_data is simply a
pointer to a struct that has the argument count originally
passed to the registering function and space for any additional
parameters. */
eof = (*_rl_callback_func) (_rl_callback_data);
/* If the function `deregisters' itself, make sure the data is
cleaned up. */
if (_rl_callback_func == 0)
{
if (_rl_callback_data)
{
_rl_callback_data_dispose (_rl_callback_data);
_rl_callback_data = 0;
}
_rl_internal_char_cleanup ();
}
}
else
eof = readline_internal_char ();
if (rl_done == 0 && _rl_want_redisplay)
{
(*rl_redisplay_function) ();
_rl_want_redisplay = 0;
}
if (rl_done)
{
line = readline_internal_teardown (eof);
(*rl_deprep_term_function) ();
if (rl_deprep_term_function)
(*rl_deprep_term_function) ();
#if defined (HANDLE_SIGNALS)
rl_clear_signals ();
#endif
......@@ -129,11 +213,8 @@ rl_callback_read_char ()
if (in_handler == 0 && rl_linefunc)
_rl_callback_newline ();
}
if (rl_pending_input || _rl_pushed_input_available ())
eof = readline_internal_char ();
else
break;
}
while (rl_pending_input || _rl_pushed_input_available () || RL_ISSTATE (RL_STATE_MACROINPUT));
}
/* Remove the handler, and make sure the terminal is in its normal state. */
......@@ -141,14 +222,37 @@ void
rl_callback_handler_remove ()
{
rl_linefunc = NULL;
RL_UNSETSTATE (RL_STATE_CALLBACK);
if (in_handler)
{
in_handler = 0;
(*rl_deprep_term_function) ();
if (rl_deprep_term_function)
(*rl_deprep_term_function) ();
#if defined (HANDLE_SIGNALS)
rl_clear_signals ();
#endif
}
}
_rl_callback_generic_arg *
_rl_callback_data_alloc (count)
int count;
{
_rl_callback_generic_arg *arg;
arg = (_rl_callback_generic_arg *)xmalloc (sizeof (_rl_callback_generic_arg));
arg->count = count;
arg->i1 = arg->i2 = 0;
return arg;
}
void _rl_callback_data_dispose (arg)
_rl_callback_generic_arg *arg;
{
if (arg)
free (arg);
}
#endif
......@@ -59,11 +59,7 @@
#define largest_char 255 /* Largest character value. */
#define CTRL_CHAR(c) ((c) < control_character_threshold && (((c) & 0x80) == 0))
#if largest_char >= 255
#define META_CHAR(c) ((c) > meta_character_threshold)
#else
#define META_CHAR(c) ((c) > meta_character_threshold && (c) <= largest_char)
#endif
#define CTRL(c) ((c) & control_character_mask)
#define META(c) ((c) | meta_character_bit)
......@@ -90,6 +86,8 @@
/* Some systems define these; we want our definitions. */
#undef ISPRINT
/* Beware: these only work with single-byte ASCII characters. */
#define ISALNUM(c) (IN_CTYPE_DOMAIN (c) && isalnum (c))
#define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha (c))
#define ISDIGIT(c) (IN_CTYPE_DOMAIN (c) && isdigit (c))
......
......@@ -21,7 +21,9 @@
59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
#include "config_readline.h"
#if defined (HAVE_CONFIG_H)
# include <config.h>
#endif
#include <stdio.h>
......
This diff is collapsed.
......@@ -4,9 +4,27 @@ dnl
dnl report bugs to chet@po.cwru.edu
dnl
dnl Process this file with autoconf to produce a configure script.
AC_REVISION([for Readline 5.0, version 2.52, from autoconf version] AC_ACVERSION)
AC_INIT(readline, 5.0-rc1, bug-readline@gnu.org)
# Copyright (C) 1987-2005 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
AC_REVISION([for Readline 5.2, version 2.61])
AC_INIT(readline, 5.2, bug-readline@gnu.org)
dnl make sure we are using a recent autoconf version
AC_PREREQ(2.50)
......@@ -16,20 +34,28 @@ AC_CONFIG_AUX_DIR(./support)
AC_CONFIG_HEADERS(config.h)
dnl update the value of RL_READLINE_VERSION in readline.h when this changes
LIBVERSION=5.0
LIBVERSION=5.2
AC_CANONICAL_HOST
dnl configure defaults
opt_curses=no
opt_purify=no
dnl arguments to configure
AC_ARG_WITH(curses, AC_HELP_STRING([--with-curses], [use the curses library instead of the termcap library]), opt_curses=$withval)
AC_ARG_WITH(purify, AC_HELP_STRING([--with-purify], [configure to postprocess with purify]), opt_purify=$withval)
if test "$opt_curses" = "yes"; then
prefer_curses=yes
fi
if test "$opt_purify" = yes; then
PURIFY="purify"
else
PURIFY=
fi
dnl option parsing for optional features
opt_multibyte=yes
opt_static_libs=yes
......@@ -43,6 +69,36 @@ if test $opt_multibyte = no; then
AC_DEFINE(NO_MULTIBYTE_SUPPORT)
fi
dnl load up the cross-building cache file -- add more cases and cache
dnl files as necessary
dnl Note that host and target machine are the same, and different than the
dnl build machine.
CROSS_COMPILE=
if test "x$cross_compiling" = "xyes"; then
case "${host}" in
*-cygwin*)
cross_cache=${srcdir}/cross-build/cygwin.cache
;;
*-mingw*)
cross_cache=${srcdir}/cross-build/mingw.cache
;;
i[[3456]]86-*-beos*)
cross_cache=${srcdir}/cross-build/x86-beos.cache
;;
*) echo "configure: cross-compiling for $host is not supported" >&2
;;
esac
if test -n "${cross_cache}" && test -r "${cross_cache}"; then
echo "loading cross-build cache file ${cross_cache}"
. ${cross_cache}
fi
unset cross_cache
CROSS_COMPILE='-DCROSS_COMPILING'
AC_SUBST(CROSS_COMPILE)
fi
echo ""
echo "Beginning configuration for readline-$LIBVERSION for ${host_cpu}-${host_vendor}-${host_os}"
echo ""
......@@ -83,14 +139,24 @@ AC_HEADER_STDC
AC_HEADER_STAT
AC_HEADER_DIRENT
AC_CHECK_FUNCS(lstat memmove putenv select setenv setlocale \
strcasecmp strpbrk tcgetattr vsnprintf isascii isxdigit)
AC_CHECK_FUNCS(fcntl kill lstat)
AC_CHECK_FUNCS(memmove putenv select setenv setlocale \
strcasecmp strpbrk tcgetattr vsnprintf)
AC_CHECK_FUNCS(isascii isxdigit)
AC_CHECK_FUNCS(getpwent getpwnam getpwuid)
AC_FUNC_STRCOLL
AC_CHECK_HEADERS(unistd.h stdlib.h varargs.h stdarg.h string.h strings.h \
limits.h sys/ptem.h sys/pte.h sys/stream.h sys/select.h \
termcap.h termios.h termio.h sys/file.h locale.h memory.h )
AC_CHECK_HEADERS(fcntl.h unistd.h stdlib.h varargs.h stdarg.h string.h strings.h \
limits.h locale.h pwd.h memory.h termcap.h termios.h termio.h)
AC_CHECK_HEADERS(sys/pte.h sys/stream.h sys/select.h sys/file.h)
AC_CHECK_HEADERS(sys/ptem.h,,,
[[
#if HAVE_SYS_STREAM_H
# include <sys/stream.h>
#endif
]])
BASH_SYS_SIGNAL_VINTAGE
BASH_SYS_REINSTALL_SIGHANDLERS
......@@ -143,7 +209,13 @@ esac
#
if test -f ${srcdir}/support/shobj-conf; then
AC_MSG_CHECKING(configuration for building shared libraries)
eval `${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
eval `TERMCAP_LIB=$TERMCAP_LIB ${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
# case "$SHLIB_LIBS" in
# *curses*|*termcap*|*termlib*) ;;
# *) SHLIB_LIBS="$SHLIB_LIBS $TERMCAP_LIB" ;;
# esac
AC_SUBST(SHOBJ_CC)
AC_SUBST(SHOBJ_CFLAGS)
AC_SUBST(SHOBJ_LD)
......@@ -153,8 +225,11 @@ if test -f ${srcdir}/support/shobj-conf; then
AC_SUBST(SHOBJ_STATUS)
AC_SUBST(SHLIB_STATUS)
AC_SUBST(SHLIB_XLDFLAGS)
AC_SUBST(SHLIB_DOT)
AC_SUBST(SHLIB_LIBPREF)
AC_SUBST(SHLIB_LIBSUFF)
AC_SUBST(SHLIB_LIBVERSION)
AC_SUBST(SHLIB_DLLVERSION)
AC_SUBST(SHLIB_LIBS)
AC_MSG_RESULT($SHLIB_STATUS)
......@@ -191,6 +266,12 @@ msdosdjgpp*) BUILD_DIR=`pwd.exe` ;; # to prevent //d/path/file
*) BUILD_DIR=`pwd` ;;
esac
case "$BUILD_DIR" in
*\ *) BUILD_DIR=`echo "$BUILD_DIR" | sed 's: :\\\\ :g'` ;;
*) ;;
esac
AC_SUBST(PURIFY)
AC_SUBST(BUILD_DIR)
AC_SUBST(CFLAGS)
......
This diff is collapsed.
......@@ -21,7 +21,9 @@
59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
#include "config_readline.h"
#if defined (HAVE_CONFIG_H)
# include <config.h>
#endif
#if !defined (BUFSIZ)
#include <stdio.h>
......@@ -174,6 +176,7 @@ static FUNMAP default_funmap[] = {
{ "vi-put", rl_vi_put },
{ "vi-redo", rl_vi_redo },
{ "vi-replace", rl_vi_replace },
{ "vi-rubout", rl_vi_rubout },
{ "vi-search", rl_vi_search },
{ "vi-search-again", rl_vi_search_again },
{ "vi-set-mark", rl_vi_set_mark },
......
......@@ -22,7 +22,9 @@
#define READLINE_LIBRARY
#include "config_readline.h"
#if defined (HAVE_CONFIG_H)
# include <config.h>
#endif
#include <stdio.h>
......@@ -54,8 +56,6 @@
typedef int _hist_search_func_t PARAMS((const char *, int));
extern int rl_byte_oriented; /* declared in mbutil.c */
static char error_pointer;
static char *subst_lhs;
......@@ -87,14 +87,14 @@ char history_comment_char = '\0';
/* The list of characters which inhibit the expansion of text if found
immediately following history_expansion_char. */
char *history_no_expand_chars = (char*) " \t\n\r=";
char *history_no_expand_chars = " \t\n\r=";
/* If set to a non-zero value, single quotes inhibit history expansion.
The default is 0. */
int history_quotes_inhibit_expansion = 0;
/* Used to split words by history_tokenize_internal. */
char *history_word_delimiters = (char*) HISTORY_WORD_DELIMITERS;
char *history_word_delimiters = HISTORY_WORD_DELIMITERS;
/* If set, this points to a function that is called to verify that a
particular history expansion should be performed. */
......@@ -203,24 +203,25 @@ get_history_event (string, caller_index, delimiting_quote)
}
/* Only a closing `?' or a newline delimit a substring search string. */
for (local_index = i; (c = string[i]); i++)
for (local_index = i; c = string[i]; i++)
{
#if defined (HANDLE_MULTIBYTE)
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
{
int v;
mbstate_t ps;
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
{
int v;
mbstate_t ps;
memset (&ps, 0, sizeof (mbstate_t));
/* These produce warnings because we're passing a const string to a
function that takes a non-const string. */
_rl_adjust_point ((char *)string, i, &ps);
if ((v = _rl_get_char_len ((char *)string + i, &ps)) > 1)
{
i += v - 1;
continue;
}
}
memset (&ps, 0, sizeof (mbstate_t));
/* These produce warnings because we're passing a const string to a
function that takes a non-const string. */
_rl_adjust_point ((char *)string, i, &ps);
if ((v = _rl_get_char_len ((char *)string + i, &ps)) > 1)
{
i += v - 1;
continue;
}
}
else
#endif /* HANDLE_MULTIBYTE */
if ((!substring_okay && (whitespace (c) || c == ':' ||
(history_search_delimiter_chars && member (c, history_search_delimiter_chars)) ||
......@@ -228,6 +229,7 @@ get_history_event (string, caller_index, delimiting_quote)
string[i] == '\n' ||
(substring_okay && string[i] == '?'))
break;
}
which = i - local_index;
temp = (char *)xmalloc (1 + which);
......@@ -560,12 +562,12 @@ history_expand_internal (string, start, end_index_ptr, ret_string, current_line)
#if defined (HANDLE_MULTIBYTE)
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
{
int chr, l;
int ch, l;
l = _rl_find_prev_mbchar (string, i, MB_FIND_ANY);
chr = string[l];
ch = string[l];
/* XXX - original patch had i - 1 ??? If i == 0 it would fail. */
if (i && (chr == '\'' || chr == '"'))
quoted_search_delimiter = chr;
if (i && (ch == '\'' || ch == '"'))
quoted_search_delimiter = ch;
}
else
#endif /* HANDLE_MULTIBYTE */
......@@ -1426,6 +1428,8 @@ history_tokenize_word (string, ind)
{
if (peek == '<' && string[i + 2] == '-')
i++;
else if (peek == '<' && string[i + 2] == '<')
i++;
i += 2;
return i;
}
......
......@@ -30,7 +30,9 @@
# include <floss.h>
#endif
#include "config_readline.h"
#if defined (HAVE_CONFIG_H)
# include <config.h>
#endif
#include <stdio.h>
......@@ -184,8 +186,7 @@ read_history_range (filename, from, to)
file_size = (size_t)finfo.st_size;
/* check for overflow on very large files */
if ((long long) file_size != (long long) finfo.st_size ||
file_size + 1 < file_size)
if (file_size != finfo.st_size || file_size + 1 < file_size)
{
errno = overflow_errno;
goto error_and_exit;
......@@ -255,7 +256,11 @@ read_history_range (filename, from, to)
for (line_end = line_start; line_end < bufend; line_end++)
if (*line_end == '\n')
{
*line_end = '\0';
/* Change to allow Windows-like \r\n end of line delimiter. */
if (line_end > line_start && line_end[-1] == '\r')
line_end[-1] = '\0';
else
*line_end = '\0';
if (*line_start)
{
......@@ -334,8 +339,7 @@ history_truncate_file (fname, lines)
file_size = (size_t)finfo.st_size;
/* check for overflow on very large files */
if ((long long) file_size != (long long) finfo.st_size ||
file_size + 1 < file_size)
if (file_size != finfo.st_size || file_size + 1 < file_size)
{
close (file);
#if defined (EFBIG)
......
/* history.c -- standalone history library */
/* Copyright (C) 1989-2003 Free Software Foundation, Inc.
/* Copyright (C) 1989-2005 Free Software Foundation, Inc.
This file contains the GNU History Library (the Library), a set of
routines for managing the text of previously typed lines.
......@@ -25,7 +25,9 @@
you can call. I think I have done that. */
#define READLINE_LIBRARY
#include "config_readline.h"
#if defined (HAVE_CONFIG_H)
# include <config.h>
#endif
#include <stdio.h>
......@@ -202,11 +204,27 @@ history_get (offset)
int local_index;
local_index = offset - history_base;
return (local_index >= history_length || local_index < 0 || !the_history)
return (local_index >= history_length || local_index < 0 || the_history == 0)
? (HIST_ENTRY *)NULL
: the_history[local_index];
}
HIST_ENTRY *
alloc_history_entry (string, ts)
char *string;
char *ts;
{
HIST_ENTRY *temp;
temp = (HIST_ENTRY *)xmalloc (sizeof (HIST_ENTRY));
temp->line = string ? savestring (string) : string;
temp->data = (char *)NULL;
temp->timestamp = ts;
return temp;
}
time_t
history_get_time (hist)
HIST_ENTRY *hist;
......@@ -288,11 +306,7 @@ add_history (string)
}
}
temp = (HIST_ENTRY *)xmalloc (sizeof (HIST_ENTRY));
temp->line = savestring (string);
temp->data = (char *)NULL;
temp->timestamp = hist_inittime ();
temp = alloc_history_entry (string, hist_inittime ());
the_history[history_length] = (HIST_ENTRY *)NULL;
the_history[history_length - 1] = temp;
......@@ -326,6 +340,26 @@ free_history_entry (hist)
free (hist);
return (x);
}
HIST_ENTRY *
copy_history_entry (hist)
HIST_ENTRY *hist;
{
HIST_ENTRY *ret;
char *ts;
if (hist == 0)
return hist;
ret = alloc_history_entry (hist->line, (char *)NULL);
ts = hist->timestamp ? savestring (hist->timestamp) : hist->timestamp;
ret->timestamp = ts;
ret->data = hist->data;
return ret;
}
/* Make the history entry at WHICH have LINE and DATA. This returns
the old entry so you can dispose of the data. In the case of an
......@@ -338,7 +372,7 @@ replace_history_entry (which, line, data)
{
HIST_ENTRY *temp, *old_value;
if (which >= history_length)
if (which < 0 || which >= history_length)
return ((HIST_ENTRY *)NULL);
temp = (HIST_ENTRY *)xmalloc (sizeof (HIST_ENTRY));
......@@ -352,6 +386,51 @@ replace_history_entry (which, line, data)
return (old_value);
}
/* Replace the DATA in the specified history entries, replacing OLD with
NEW. WHICH says which one(s) to replace: WHICH == -1 means to replace
all of the history entries where entry->data == OLD; WHICH == -2 means
to replace the `newest' history entry where entry->data == OLD; and
WHICH >= 0 means to replace that particular history entry's data, as
long as it matches OLD. */
void
replace_history_data (which,old, new)
int which;
histdata_t *old, *new;
{
HIST_ENTRY *entry;
register int i, last;
if (which < -2 || which >= history_length || history_length == 0 || the_history == 0)
return;
if (which >= 0)
{
entry = the_history[which];
if (entry && entry->data == old)
entry->data = new;
return;
}
last = -1;
for (i = 0; i < history_length; i++)
{
entry = the_history[i];
if (entry == 0)
continue;
if (entry->data == old)
{
last = i;
if (which == -1)
entry->data = new;
}
}
if (which == -2 && last >= 0)
{
entry = the_history[last];
entry->data = new; /* XXX - we don't check entry->old */
}
}
/* Remove history element WHICH from the history. The removed
element is returned to you so you can free the line, data,
and containing structure. */
......@@ -362,17 +441,15 @@ remove_history (which)
HIST_ENTRY *return_value;
register int i;
if (which >= history_length || !history_length)
return_value = (HIST_ENTRY *)NULL;
else
{
return_value = the_history[which];
if (which < 0 || which >= history_length || history_length == 0 || the_history == 0)
return ((HIST_ENTRY *)NULL);
for (i = which; i < history_length; i++)
the_history[i] = the_history[i + 1];
return_value = the_history[which];
history_length--;
}
for (i = which; i < history_length; i++)
the_history[i] = the_history[i + 1];
history_length--;
return (return_value);
}
......
......@@ -22,7 +22,9 @@
#define READLINE_LIBRARY
#include "config_readline.h"
#if defined (HAVE_CONFIG_H)
# include <config.h>
#endif
#include <stdio.h>
#if defined (HAVE_STDLIB_H)
......
/* input.c -- character input functions for readline. */
/* Copyright (C) 1994 Free Software Foundation, Inc.
/* Copyright (C) 1994-2005 Free Software Foundation, Inc.
This file is part of the GNU Readline Library, a library for
reading lines of text with interactive input and history editing.
......@@ -25,7 +25,9 @@
# include <floss.h>
#endif
#include "config_readline.h"
#if defined (HAVE_CONFIG_H)
# include <config.h>
#endif
#include <sys/types.h>
#include <fcntl.h>
......@@ -177,6 +179,7 @@ rl_gather_tyi ()
struct timeval timeout;
#endif
chars_avail = 0;
tty = fileno (rl_instream);
#if defined (HAVE_SELECT)
......@@ -218,6 +221,13 @@ rl_gather_tyi ()
}
#endif /* O_NDELAY */
#if defined (__MINGW32__)
/* Use getch/_kbhit to check for available console input, in the same way
that we read it normally. */
chars_avail = isatty (tty) ? _kbhit () : 0;
result = 0;
#endif
/* If there's nothing available, don't waste time trying to read
something. */
if (chars_avail <= 0)
......@@ -261,7 +271,7 @@ rl_set_keyboard_input_timeout (u)
int o;
o = _keyboard_input_timeout;
if (u > 0)
if (u >= 0)
_keyboard_input_timeout = u;
return (o);
}
......@@ -301,6 +311,11 @@ _rl_input_available ()
return (chars_avail);
#endif
#endif
#if defined (__MINGW32__)
if (isatty (tty))
return (_kbhit ());
#endif
return 0;
......@@ -405,7 +420,7 @@ rl_read_key ()
else
{
/* If input is coming from a macro, then use that. */
if ((c= _rl_next_macro_key ()))
if (c = _rl_next_macro_key ())
return (c);
/* If the user has an event function, then call it periodically. */
......@@ -442,6 +457,10 @@ rl_getc (stream)
while (1)
{
#if defined (__MINGW32__)
if (isatty (fileno (stream)))
return (getch ());
#endif
result = read (fileno (stream), &c, sizeof (unsigned char));
if (result == sizeof (unsigned char))
......@@ -483,7 +502,7 @@ rl_getc (stream)
this is simply an interrupted system call to read ().
Otherwise, some error ocurred, also signifying EOF. */
if (errno != EINTR)
return (EOF);
return (RL_ISSTATE (RL_STATE_READCMD) ? READERR : EOF);
}
}
......@@ -517,6 +536,12 @@ _rl_read_mbchar (mbchar, size)
ps = ps_back;
continue;
}
else if (mbchar_bytes_length == 0)
{
mbchar[0] = '\0'; /* null wide character */
mb_len = 1;
break;
}
else if (mbchar_bytes_length > (size_t)(0))
break;
}
......@@ -525,21 +550,21 @@ _rl_read_mbchar (mbchar, size)
}
/* Read a multibyte-character string whose first character is FIRST into
the buffer MB of length MBLEN. Returns the last character read, which
the buffer MB of length MLEN. Returns the last character read, which
may be FIRST. Used by the search functions, among others. Very similar
to _rl_read_mbchar. */
int
_rl_read_mbstring (first, mb, mb_len)
_rl_read_mbstring (first, mb, mlen)
int first;
char *mb;
int mb_len;
int mlen;
{
int i, c;
mbstate_t ps;
c = first;
memset (mb, 0, mb_len);
for (i = 0; i < mb_len; i++)
memset (mb, 0, mlen);
for (i = 0; i < mlen; i++)
{
mb[i] = (char)c;
memset (&ps, 0, sizeof (mbstate_t));
......
This diff is collapsed.
......@@ -20,7 +20,9 @@
Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
#include "config_readline.h"
#if defined (HAVE_CONFIG_H)
# include <config.h>
#endif
#if defined (HAVE_STDLIB_H)
# include <stdlib.h>
......
......@@ -21,7 +21,9 @@
59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
#include "config_readline.h"
#if defined (HAVE_CONFIG_H)
# include <config.h>
#endif
#include <sys/types.h>
......@@ -76,7 +78,8 @@ static int rl_yank_nth_arg_internal PARAMS((int, int, int));
/* How to say that you only want to save a certain amount
of kill material. */
int
rl_set_retained_kills (int num __attribute__((unused)))
rl_set_retained_kills (num)
int num;
{
return 0;
}
......@@ -292,8 +295,8 @@ rl_backward_kill_line (direction, ignore)
/* Kill the whole line, no matter where point is. */
int
rl_kill_full_line (int count __attribute__((unused)),
int ignore __attribute__((unused)))
rl_kill_full_line (count, ignore)
int count, ignore;
{
rl_begin_undo_group ();
rl_point = 0;
......@@ -310,7 +313,8 @@ rl_kill_full_line (int count __attribute__((unused)),
/* This does what C-w does in Unix. We can't prevent people from
using behaviour that they expect. */
int
rl_unix_word_rubout (int count, int key __attribute__((unused)))
rl_unix_word_rubout (count, key)
int count, key;
{
int orig_point;
......@@ -342,7 +346,8 @@ rl_unix_word_rubout (int count, int key __attribute__((unused)))
/* This deletes one filename component in a Unix pathname. That is, it
deletes backward to directory separator (`/') or whitespace. */
int
rl_unix_filename_rubout (int count, int key __attribute__((unused)))
rl_unix_filename_rubout (count, key)
int count, key;
{
int orig_point, c;
......@@ -385,8 +390,8 @@ rl_unix_filename_rubout (int count, int key __attribute__((unused)))
into the line at all, and if you aren't, then you know what you are
doing. */
int
rl_unix_line_discard (int count __attribute__((unused)),
int key __attribute__((unused)))
rl_unix_line_discard (count, key)
int count, key;
{
if (rl_point == 0)
rl_ding ();
......@@ -422,16 +427,16 @@ region_kill_internal (delete)
/* Copy the text in the region to the kill ring. */
int
rl_copy_region_to_kill (int count __attribute__((unused)),
int key __attribute__((unused)))
rl_copy_region_to_kill (count, ignore)
int count, ignore;
{
return (region_kill_internal (0));
}
/* Kill the text between the point and mark. */
int
rl_kill_region (int count __attribute__((unused)),
int ignore __attribute__((unused)))
rl_kill_region (count, ignore)
int count, ignore;
{
int r, npoint;
......@@ -495,7 +500,8 @@ rl_copy_backward_word (count, key)
/* Yank back the last killed text. This ignores arguments. */
int
rl_yank (int count __attribute__((unused)), int ignore __attribute__((unused)))
rl_yank (count, ignore)
int count, ignore;
{
if (rl_kill_ring == 0)
{
......@@ -513,7 +519,8 @@ rl_yank (int count __attribute__((unused)), int ignore __attribute__((unused)))
delete that text from the line, rotate the index down, and
yank back some other text. */
int
rl_yank_pop (int count __attribute__((unused)), int key __attribute__((unused)))
rl_yank_pop (count, key)
int count, key;
{
int l, n;
......@@ -575,6 +582,7 @@ rl_yank_nth_arg_internal (count, ignore, history_skip)
if (!arg || !*arg)
{
rl_ding ();
FREE (arg);
return -1;
}
......
......@@ -21,7 +21,9 @@
59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
#include "config_readline.h"
#if defined (HAVE_CONFIG_H)
# include <config.h>
#endif
#include <sys/types.h>
......@@ -98,6 +100,8 @@ _rl_with_macro_input (string)
int
_rl_next_macro_key ()
{
int c;
if (rl_executing_macro == 0)
return (0);
......@@ -107,7 +111,14 @@ _rl_next_macro_key ()
return (_rl_next_macro_key ());
}
#if defined (READLINE_CALLBACKS)
c = rl_executing_macro[executing_macro_index++];
if (RL_ISSTATE (RL_STATE_CALLBACK) && RL_ISSTATE (RL_STATE_READCMD|RL_STATE_MOREINPUT) && rl_executing_macro[executing_macro_index] == 0)
_rl_pop_executing_macro ();
return c;
#else
return (rl_executing_macro[executing_macro_index++]);
#endif
}
/* Save the currently executing macro on a stack of saved macros. */
......@@ -189,8 +200,8 @@ _rl_kill_kbd_macro ()
definition to the end of the existing macro, and start by
re-executing the existing macro. */
int
rl_start_kbd_macro (int ignore1 __attribute__((unused)),
int ignore2 __attribute__((unused)))
rl_start_kbd_macro (ignore1, ignore2)
int ignore1, ignore2;
{
if (RL_ISSTATE (RL_STATE_MACRODEF))
{
......@@ -214,7 +225,8 @@ rl_start_kbd_macro (int ignore1 __attribute__((unused)),
A numeric argument says to execute the macro right now,
that many times, counting the definition as the first time. */
int
rl_end_kbd_macro (int count, int ignore __attribute__((unused)))
rl_end_kbd_macro (count, ignore)
int count, ignore;
{
if (RL_ISSTATE (RL_STATE_MACRODEF) == 0)
{
......@@ -233,7 +245,8 @@ rl_end_kbd_macro (int count, int ignore __attribute__((unused)))
/* Execute the most recently defined keyboard macro.
COUNT says how many times to execute it. */
int
rl_call_last_kbd_macro (int count, int ignore __attribute__((unused)))
rl_call_last_kbd_macro (count, ignore)
int count, ignore;
{
if (current_macro == 0)
_rl_abort_internal ();
......
/* mbutil.c -- readline multibyte character utility functions */
/* Copyright (C) 2001-2004 Free Software Foundation, Inc.
/* Copyright (C) 2001-2005 Free Software Foundation, Inc.
This file is part of the GNU Readline Library, a library for
reading lines of text with interactive input and history editing.
......@@ -21,16 +21,11 @@
59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE 500
#if defined (HAVE_CONFIG_H)
# include <config.h>
#endif
#include "config_readline.h"
#include <sys/types.h>
/* To get SuSE 9.3 to define wcwidth() (in wchar.h) */
#include <fcntl.h>
#include "posixjmp.h"
......@@ -82,18 +77,20 @@ _rl_find_next_mbchar_internal (string, seed, count, find_non_zero)
char *string;
int seed, count, find_non_zero;
{
size_t tmp = 0;
size_t tmp;
mbstate_t ps;
int point = 0;
int point;
wchar_t wc;
tmp = 0;
memset(&ps, 0, sizeof (mbstate_t));
if (seed < 0)
seed = 0;
if (count <= 0)
return seed;
point = seed + _rl_adjust_point(string, seed, &ps);
point = seed + _rl_adjust_point (string, seed, &ps);
/* if this is true, means that seed was not pointed character
started byte. So correct the point and consume count */
if (seed < point)
......@@ -131,15 +128,16 @@ _rl_find_next_mbchar_internal (string, seed, count, find_non_zero)
if (find_non_zero)
{
tmp = mbrtowc (&wc, string + point, strlen (string + point), &ps);
while (wcwidth (wc) == 0)
while (tmp > 0 && wcwidth (wc) == 0)
{
point += tmp;
tmp = mbrtowc (&wc, string + point, strlen (string + point), &ps);
if (tmp == (size_t)(0) || tmp == (size_t)(-1) || tmp == (size_t)(-2))
if (MB_NULLWCH (tmp) || MB_INVALIDCH (tmp))
break;
}
}
return point;
return point;
}
static int
......@@ -318,6 +316,28 @@ _rl_is_mbchar_matched (string, seed, end, mbchar, length)
return 0;
return 1;
}
wchar_t
_rl_char_value (buf, ind)
char *buf;
int ind;
{
size_t tmp;
wchar_t wc;
mbstate_t ps;
int l;
if (MB_LEN_MAX == 1 || rl_byte_oriented)
return ((wchar_t) buf[ind]);
l = strlen (buf);
if (ind >= l - 1)
return ((wchar_t) buf[ind]);
memset (&ps, 0, sizeof (mbstate_t));
tmp = mbrtowc (&wc, buf + ind, l - ind, &ps);
if (MB_INVALIDCH (tmp) || MB_NULLWCH (tmp))
return ((wchar_t) buf[ind]);
return wc;
}
#endif /* HANDLE_MULTIBYTE */
/* Find next `count' characters started byte point of the specified seed.
......
This diff is collapsed.
......@@ -21,7 +21,9 @@
59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
#include "config_readline.h"
#if defined (HAVE_CONFIG_H)
# include <config.h>
#endif
#include <sys/types.h>
......@@ -111,7 +113,7 @@ _rl_init_eightbit ()
if (lspec == 0 || *lspec == 0)
lspec = setlocale (LC_CTYPE, (char *)NULL);
if (lspec == 0)
lspec = (char*) "";
lspec = "";
t = setlocale (LC_CTYPE, lspec);
if (t && *t && (t[0] != 'C' || t[1]) && (STREQ (t, "POSIX") == 0))
......
......@@ -27,7 +27,9 @@
#include "rlconf.h"
#include "config_readline.h"
#if defined (HAVE_CONFIG_H)
# include <config.h>
#endif
#include <stdio.h>
#include <sys/types.h>
......
This diff is collapsed.
/* Readline.h -- the names of functions callable from within readline. */
/* Copyright (C) 1987-2004 Free Software Foundation, Inc.
/* Copyright (C) 1987-2005 Free Software Foundation, Inc.
This file is part of the GNU Readline Library, a library for
reading lines of text with interactive input and history editing.
......@@ -40,9 +40,9 @@ extern "C" {
#endif
/* Hex-encoded Readline version number. */
#define RL_READLINE_VERSION 0x0500 /* Readline 5.0 */
#define RL_READLINE_VERSION 0x0502 /* Readline 5.2 */
#define RL_VERSION_MAJOR 5
#define RL_VERSION_MINOR 0
#define RL_VERSION_MINOR 2
/* Readline data structures. */
......@@ -241,6 +241,7 @@ extern int rl_vi_column PARAMS((int, int));
extern int rl_vi_delete_to PARAMS((int, int));
extern int rl_vi_change_to PARAMS((int, int));
extern int rl_vi_yank_to PARAMS((int, int));
extern int rl_vi_rubout PARAMS((int, int));
extern int rl_vi_delete PARAMS((int, int));
extern int rl_vi_back_to_indent PARAMS((int, int));
extern int rl_vi_first_print PARAMS((int, int));
......@@ -302,6 +303,8 @@ extern int rl_bind_keyseq_in_map PARAMS((const char *, rl_command_func_t *, Keym
extern int rl_bind_keyseq_if_unbound PARAMS((const char *, rl_command_func_t *));
extern int rl_bind_keyseq_if_unbound_in_map PARAMS((const char *, rl_command_func_t *, Keymap));
extern int rl_generic_bind PARAMS((int, const char *, char *, Keymap));
extern char *rl_variable_value PARAMS((const char *));
extern int rl_variable_bind PARAMS((const char *, const char *));
/* Backwards compatibility, use rl_bind_keyseq_in_map instead. */
......@@ -401,6 +404,7 @@ extern int rl_reset_terminal PARAMS((const char *));
extern void rl_resize_terminal PARAMS((void));
extern void rl_set_screen_size PARAMS((int, int));
extern void rl_get_screen_size PARAMS((int *, int *));
extern void rl_reset_screen_size PARAMS((void));
extern char *rl_get_termcap PARAMS((const char *));
......@@ -528,6 +532,11 @@ extern const char *rl_terminal_name;
extern FILE *rl_instream;
extern FILE *rl_outstream;
/* If non-zero, Readline gives values of LINES and COLUMNS from the environment
greater precedence than values fetched from the kernel when computing the
screen dimensions. */
extern int rl_prefer_env_winsize;
/* If non-zero, then this is the address of a function to call just
before readline_internal () prints the first prompt. */
extern rl_hook_func_t *rl_startup_hook;
......@@ -748,6 +757,10 @@ extern int rl_ignore_completion_duplicates;
completion character will be inserted as any other. */
extern int rl_inhibit_completion;
/* Input error; can be returned by (*rl_getc_function) if readline is reading
a top-level command (RL_ISSTATE (RL_STATE_READCMD)). */
#define READERR (-2)
/* Definitions available for use by readline clients. */
#define RL_PROMPT_START_IGNORE '\001'
#define RL_PROMPT_END_IGNORE '\002'
......@@ -759,29 +772,33 @@ extern int rl_inhibit_completion;
#define MULT_MATCH 2
/* Possible state values for rl_readline_state */
#define RL_STATE_NONE 0x00000 /* no state; before first call */
#define RL_STATE_INITIALIZING 0x00001 /* initializing */
#define RL_STATE_INITIALIZED 0x00002 /* initialization done */
#define RL_STATE_TERMPREPPED 0x00004 /* terminal is prepped */
#define RL_STATE_READCMD 0x00008 /* reading a command key */
#define RL_STATE_METANEXT 0x00010 /* reading input after ESC */
#define RL_STATE_DISPATCHING 0x00020 /* dispatching to a command */
#define RL_STATE_MOREINPUT 0x00040 /* reading more input in a command function */
#define RL_STATE_ISEARCH 0x00080 /* doing incremental search */
#define RL_STATE_NSEARCH 0x00100 /* doing non-inc search */
#define RL_STATE_SEARCH 0x00200 /* doing a history search */
#define RL_STATE_NUMERICARG 0x00400 /* reading numeric argument */
#define RL_STATE_MACROINPUT 0x00800 /* getting input from a macro */
#define RL_STATE_MACRODEF 0x01000 /* defining keyboard macro */
#define RL_STATE_OVERWRITE 0x02000 /* overwrite mode */
#define RL_STATE_COMPLETING 0x04000 /* doing completion */
#define RL_STATE_SIGHANDLER 0x08000 /* in readline sighandler */
#define RL_STATE_UNDOING 0x10000 /* doing an undo */
#define RL_STATE_INPUTPENDING 0x20000 /* rl_execute_next called */
#define RL_STATE_TTYCSAVED 0x40000 /* tty special chars saved */
#define RL_STATE_DONE 0x80000 /* done; accepted line */
#define RL_STATE_NONE 0x000000 /* no state; before first call */
#define RL_STATE_INITIALIZING 0x000001 /* initializing */
#define RL_STATE_INITIALIZED 0x000002 /* initialization done */
#define RL_STATE_TERMPREPPED 0x000004 /* terminal is prepped */
#define RL_STATE_READCMD 0x000008 /* reading a command key */
#define RL_STATE_METANEXT 0x000010 /* reading input after ESC */
#define RL_STATE_DISPATCHING 0x000020 /* dispatching to a command */
#define RL_STATE_MOREINPUT 0x000040 /* reading more input in a command function */
#define RL_STATE_ISEARCH 0x000080 /* doing incremental search */
#define RL_STATE_NSEARCH 0x000100 /* doing non-inc search */
#define RL_STATE_SEARCH 0x000200 /* doing a history search */
#define RL_STATE_NUMERICARG 0x000400 /* reading numeric argument */
#define RL_STATE_MACROINPUT 0x000800 /* getting input from a macro */
#define RL_STATE_MACRODEF 0x001000 /* defining keyboard macro */
#define RL_STATE_OVERWRITE 0x002000 /* overwrite mode */
#define RL_STATE_COMPLETING 0x004000 /* doing completion */
#define RL_STATE_SIGHANDLER 0x008000 /* in readline sighandler */
#define RL_STATE_UNDOING 0x010000 /* doing an undo */
#define RL_STATE_INPUTPENDING 0x020000 /* rl_execute_next called */
#define RL_STATE_TTYCSAVED 0x040000 /* tty special chars saved */
#define RL_STATE_CALLBACK 0x080000 /* using the callback interface */
#define RL_STATE_VIMOTION 0x100000 /* reading vi motion arg */
#define RL_STATE_MULTIKEY 0x200000 /* reading multiple-key command */
#define RL_STATE_VICMDONCE 0x400000 /* entered vi command mode at least once */
#define RL_STATE_DONE 0x800000 /* done; accepted line */
#define RL_SETSTATE(x) (rl_readline_state |= (x))
#define RL_UNSETSTATE(x) (rl_readline_state &= ~(x))
......
......@@ -37,9 +37,12 @@
/* Ugly but working hack for binding prefix meta. */
#define PREFIX_META_HACK
/* The final, last-ditch effort file name for an init file. */
/* The next-to-last-ditch effort file name for a user-specific init file. */
#define DEFAULT_INPUTRC "~/.inputrc"
/* The ultimate last-ditch filenname for an init file -- system-wide. */
#define SYS_INPUTRC "/etc/inputrc"
/* If defined, expand tabs to spaces. */
#define DISPLAY_TABS
......
......@@ -2,7 +2,7 @@
for readline. This should be included after any files that define
system-specific constants like _POSIX_VERSION or USG. */
/* Copyright (C) 1987,1989 Free Software Foundation, Inc.
/* Copyright (C) 1987-2005 Free Software Foundation, Inc.
This file contains the Readline Library (the Library), a set of
routines for providing Emacs style line input to programs that ask
......@@ -38,7 +38,11 @@
# if defined (HAVE_TERMIO_H)
# define TERMIO_TTY_DRIVER
# else
# define NEW_TTY_DRIVER
# if !defined (__MINGW32__)
# define NEW_TTY_DRIVER
# else
# define NO_TTY_DRIVER
# endif
# endif
#endif
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -21,8 +21,7 @@
59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
#include "config_readline.h"
#include <config.h>
#ifdef HAVE_STRING_H
# include <string.h>
#endif
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -130,7 +130,7 @@ KEYMAP_ENTRY_ARRAY vi_movement_keymap = {
{ ISFUNC, rl_revert_line }, /* U */
{ ISFUNC, (rl_command_func_t *)0x0 }, /* V */
{ ISFUNC, rl_vi_next_word }, /* W */
{ ISFUNC, rl_rubout }, /* X */
{ ISFUNC, rl_vi_rubout }, /* X */
{ ISFUNC, rl_vi_yank_to }, /* Y */
{ ISFUNC, (rl_command_func_t *)0x0 }, /* Z */
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment