[med-svn] [libtecla] 08/15: Import Upstream version 1.6.2
Andreas Tille
tille at debian.org
Tue Aug 22 19:25:53 UTC 2017
This is an automated email from the git hooks/post-receive script.
tille pushed a commit to branch master
in repository libtecla.
commit 2c894f19900e6a8f63880d3480a33fbb678143f3
Author: Andreas Tille <tille at debian.org>
Date: Tue Aug 22 16:47:33 2017 +0200
Import Upstream version 1.6.2
---
CHANGES | 37 +
LICENSE.TERMS | 2 +-
README | 4 +-
chrqueue.c | 2 +-
chrqueue.h | 2 +-
configure | 6126 +++++++++++++++++++++--------------------
configure.in | 28 +-
cplfile.c | 2 +-
cplfile.h | 2 +-
cplmatch.c | 2 +-
cplmatch.h | 2 +-
demo.c | 2 +-
demo2.c | 2 +-
demo3.c | 2 +-
direader.c | 2 +-
direader.h | 2 +-
enhance.c | 9 +-
errmsg.c | 2 +-
errmsg.h | 2 +-
expand.c | 2 +-
expand.h | 2 +-
freelist.c | 2 +-
freelist.h | 2 +-
getline.c | 11 +-
getline.h | 2 +-
hash.c | 2 +-
hash.h | 2 +-
history.c | 2 +-
history.h | 2 +-
homedir.c | 2 +-
homedir.h | 2 +-
html/changes.html | 37 +
html/cpl_complete_word.html | 847 +++---
html/ef_expand_file.html | 486 ++--
html/enhance.html | 180 +-
html/gl_get_line.html | 4323 ++++++++++++++++-------------
html/gl_io_mode.html | 1143 ++++----
html/index.html | 8 +-
html/libtecla.html | 337 ++-
html/pca_lookup_file.html | 732 ++---
html/release.html | 8 +
html/tecla.html | 2396 ++++++++--------
ioutil.c | 2 +-
ioutil.h | 2 +-
keytab.c | 2 +-
keytab.h | 2 +-
libtecla.h | 4 +-
man/func/cpl_complete_word.in | 2 +-
man/func/ef_expand_file.in | 2 +-
man/func/gl_get_line.in | 2 +-
man/func/gl_io_mode.in | 2 +-
man/func/pca_lookup_file.in | 2 +-
man/libr/libtecla.in | 2 +-
man/misc/tecla.in | 4 +-
man/prog/enhance.in | 2 +-
pathutil.c | 2 +-
pathutil.h | 2 +-
pcache.c | 2 +-
stringrp.c | 2 +-
stringrp.h | 2 +-
strngmem.c | 2 +-
strngmem.h | 2 +-
update_html | 10 +-
63 files changed, 9094 insertions(+), 7722 deletions(-)
diff --git a/CHANGES b/CHANGES
index b02c224..92b1c93 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,43 @@ In the following log, modification dates are listed using the European
convention in which the day comes before the month (ie. DD/MM/YYYY).
The most recent modifications are listed first.
+10/06/2012 mcs at astro.caltech.edu
+ enhance.c configure.in
+ I had incorrectly assumed that system-V pseudo-terminal
+ allocation and system-V streams terminals always went
+ together. However system-V pseudo terminal allocation is
+ now part of UNIX98, and this has been adopted into many BSD
+ style operating systems, without the use of system-V
+ streams. On such systems the lack of system-V streams IOCTL
+ opcodes prevented system-V pseudo-terminal allocation being
+ used. This was hidden under Linux until recently, because
+ it had a stropts.h file, which made it appear as though
+ Linux supported system-V streams terminals.
+
+ I have now created separate configuration tests and options
+ in the configure script for system-V terminal allocation
+ and system-V streams. On systems that only have the former,
+ the latter won't be used.
+
+16/05/2005 mcs at astro.caltech.edu
+ getline.c
+ When an initial input line was presented to gl_get_line()
+ for editing, the new input line was incorrectly appended to
+ the previous input line, instead of replacing it.
+
+10/01/2004 Derek Jones (documented here by mcs at astro.caltech.edu)
+ getline.c
+ Derek discovered that the function that computes the
+ width of the prompt, was not correctly skipping over 3 of
+ the 6 possible prompt-formatting directives. Thus, when
+ the %f,%p or %v prompt-formatting directives were used,
+ the width of the prompt was incorrectly calculated. The
+ fix was to copy the list of directives from
+ gl_display_prompt(). I have also added a comment to
+ gl_display_prompt(), to warn anybody who adds or removes
+ formatting directives there, to also do the same to
+ gl_displayed_prompt_width().
+
31/10/2004 mcs at astro.caltech.edu (problem reported by Godfrey van der Linden)
getline.c
The gl_event_handler() function had the endif of a
diff --git a/LICENSE.TERMS b/LICENSE.TERMS
index e5d9454..7922145 100644
--- a/LICENSE.TERMS
+++ b/LICENSE.TERMS
@@ -1,4 +1,4 @@
-Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd.
+Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd.
All rights reserved.
diff --git a/README b/README
index 72541b3..10cf21e 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-This is version 1.6.1 of the tecla command-line editing library.
+This is version 1.6.2 of the tecla command-line editing library.
For the current official release, please direct your browser to:
@@ -23,7 +23,7 @@ the INSTALL file, which should be in the same directory as this file.
Copyright and Disclaimer
------------------------
-Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd.
+Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd.
All rights reserved.
diff --git a/chrqueue.c b/chrqueue.c
index 346e8f6..a1d1d80 100644
--- a/chrqueue.c
+++ b/chrqueue.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd.
+ * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd.
*
* All rights reserved.
*
diff --git a/chrqueue.h b/chrqueue.h
index 1aca8e0..30c9584 100644
--- a/chrqueue.h
+++ b/chrqueue.h
@@ -2,7 +2,7 @@
#define chrqueue_h
/*
- * Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd.
+ * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd.
*
* All rights reserved.
*
diff --git a/configure b/configure
index 62f49e0..28abc27 100755
--- a/configure
+++ b/configure
@@ -1,81 +1,415 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.57.
+# Generated by GNU Autoconf 2.65.
+#
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+#
#
-# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
-# Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
-## --------------------- ##
-## M4sh Initialization. ##
-## --------------------- ##
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
emulate sh
NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
- set -o posix
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
fi
-# Support unset when possible.
-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
fi
-# Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
PS1='$ '
PS2='> '
PS4='+ '
# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test "x$CONFIG_SHELL" = x; then
+ as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+"
+ as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+ exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1"
+ as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+ eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+ if (eval "$as_required") 2>/dev/null; then :
+ as_have_required=yes
+else
+ as_have_required=no
+fi
+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
- if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ as_found=:
+ case $as_dir in #(
+ /*)
+ for as_base in sh bash ksh sh5; do
+ # Try only shells that exist, to save several forks.
+ as_shell=$as_dir/$as_base
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ CONFIG_SHELL=$as_shell as_have_required=yes
+ if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ break 2
+fi
+fi
+ done;;
+ esac
+ as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+ CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+ if test "x$CONFIG_SHELL" != x; then :
+ # We cannot yet assume a decent shell, so we have to provide a
+ # neutralization value for shells without unset; and this also
+ # works around shells that cannot unset nonexistent variables.
+ BASH_ENV=/dev/null
+ ENV=/dev/null
+ (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+ if test x$as_have_required = xno; then :
+ $as_echo "$0: This script requires a shell more modern than all"
+ $as_echo "$0: the shells that I found on your system."
+ if test x${ZSH_VERSION+set} = xset ; then
+ $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+ $as_echo "$0: be upgraded to zsh 4.3.4 or later."
else
- $as_unset $as_var
+ $as_echo "$0: Please tell bug-autoconf at gnu.org about your system,
+$0: including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do have one."
fi
-done
+ exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+# as_fn_error ERROR [LINENO LOG_FD]
+# ---------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with status $?, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$?; test $as_status -eq 0 && as_status=1
+ if test "$3"; then
+ as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
+ fi
+ $as_echo "$as_me: error: $1" >&2
+ as_fn_exit $as_status
+} # as_fn_error
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
else
as_expr=false
fi
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
as_basename=basename
else
as_basename=false
fi
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
-# Name of the executable.
-as_me=`$as_basename "$0" ||
+as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)$' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
- /^X\/\(\/\/\)$/{ s//\1/; q; }
- /^X\/\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
-
-# PATH needs CR, and LINENO needs CR and PATH.
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
@@ -83,185 +417,134 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-
-
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" || {
- # Find who we are. Look in the path if we contain no path at all
- # relative or not.
- case $0 in
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-
- ;;
- esac
- # We did not find ourselves, most probably we were run as `sh COMMAND'
- # in which case we are not to be found in the path.
- if test "x$as_myself" = x; then
- as_myself=$0
- fi
- if test ! -f "$as_myself"; then
- { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
- { (exit 1); exit 1; }; }
- fi
- case $CONFIG_SHELL in
- '')
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for as_base in sh bash ksh sh5; do
- case $as_dir in
- /*)
- if ("$as_dir/$as_base" -c '
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
- $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
- $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
- CONFIG_SHELL=$as_dir/$as_base
- export CONFIG_SHELL
- exec "$CONFIG_SHELL" "$0" ${1+"$@"}
- fi;;
- esac
- done
-done
-;;
- esac
- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
- # uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line before each line; the second 'sed' does the real
- # work. The second script uses 'N' to pair each line-number line
- # with the numbered line, and appends trailing '-' during
- # substitution so that $LINENO is not a special case at line end.
- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
- sed '=' <$as_myself |
+ as_lineno_1=$LINENO as_lineno_1a=$LINENO
+ as_lineno_2=$LINENO as_lineno_2a=$LINENO
+ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
N
- s,$,-,
- : loop
- s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
t loop
- s,-$,,
- s,^['$as_cr_digits']*\n,,
+ s/-\n.*//
' >$as_me.lineno &&
- chmod +x $as_me.lineno ||
- { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
- { (exit 1); exit 1; }; }
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensible to this).
- . ./$as_me.lineno
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
# Exit status is that of the last command.
exit
}
-
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
- *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T=' ' ;;
- *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
- *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
esac
-if expr a : '\(a\)' >/dev/null 2>&1; then
- as_expr=expr
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
else
- as_expr=false
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- # We could just check for DJGPP; but this test a) works b) is more generic
- # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
- if test -f conf$$.exe; then
- # Don't use ln at all; we don't have any links
- as_ln_s='cp -p'
- else
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -p'
fi
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
else
as_ln_s='cp -p'
fi
-rm -f conf$$ conf$$.exe conf$$.file
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
if mkdir -p . 2>/dev/null; then
- as_mkdir_p=:
+ as_mkdir_p='mkdir -p "$as_dir"'
else
+ test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
-as_executable_p="test -f"
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in #(
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
# Sed expression to map a string onto a valid variable name.
-as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" $as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
# Name of the host.
# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
# so uname gets run too.
ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-exec 6>&1
-
#
# Initializations.
#
ac_default_prefix=/usr/local
+ac_clean_files=
ac_config_libobj_dir=.
+LIBOBJS=
cross_compiling=no
subdirs=
MFLAGS=
MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-# Maximum number of lines to put in a shell here document.
-# This variable seems obsolete. It should probably be removed, and
-# only ac_max_sed_lines should be used.
-: ${ac_max_here_lines=38}
# Identity of this package.
PACKAGE_NAME=
@@ -269,51 +552,156 @@ PACKAGE_TARNAME=
PACKAGE_VERSION=
PACKAGE_STRING=
PACKAGE_BUGREPORT=
+PACKAGE_URL=
ac_unique_file="getline.c"
# Factoring default headers for most tests.
ac_includes_default="\
#include <stdio.h>
-#if HAVE_SYS_TYPES_H
+#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
-#if HAVE_SYS_STAT_H
+#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
-#if STDC_HEADERS
+#ifdef STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
#else
-# if HAVE_STDLIB_H
+# ifdef HAVE_STDLIB_H
# include <stdlib.h>
# endif
#endif
-#if HAVE_STRING_H
-# if !STDC_HEADERS && HAVE_MEMORY_H
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
# include <memory.h>
# endif
# include <string.h>
#endif
-#if HAVE_STRINGS_H
+#ifdef HAVE_STRINGS_H
# include <strings.h>
#endif
-#if HAVE_INTTYPES_H
+#ifdef HAVE_INTTYPES_H
# include <inttypes.h>
-#else
-# if HAVE_STDINT_H
-# include <stdint.h>
-# endif
#endif
-#if HAVE_UNISTD_H
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAJOR_VER MINOR_VER MICRO_VER CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT SET_MAKE LN_S AWK RANLIB ac_ct_RANLIB LD ac_ct_LD build build_cpu bu [...]
+ac_subst_vars='LTLIBOBJS
+LIBOBJS
+MAKE_MAN_PAGES
+TARGET_LIBS
+FILE_MANEXT
+FILE_MANDIR
+MISC_MANEXT
+MISC_MANDIR
+PROG_MANEXT
+PROG_MANDIR
+FUNC_MANEXT
+FUNC_MANDIR
+LIBR_MANEXT
+LIBR_MANDIR
+DEFS_R
+LINK_SHARED
+SHARED_CFLAGS
+SHARED_ALT
+SHARED_EXT
+TARGETS
+EGREP
+GREP
+CPP
+target_os
+target_vendor
+target_cpu
+target
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+LD
+RANLIB
+AWK
+LN_S
+SET_MAKE
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+MICRO_VER
+MINOR_VER
+MAJOR_VER
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+with_file_actions
+with_file_system
+with_man_pages
+'
+ ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP'
+
# Initialize some variables set by options.
ac_init_help=
ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
# The variables have the same names as the options, with
# dashes changed to underlines.
cache_file=/dev/null
@@ -336,34 +724,48 @@ x_libraries=NONE
# and all the variables that are supposed to be based on exec_prefix
# by default will actually change.
# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
includedir='${prefix}/include'
oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
+docdir='${datarootdir}/doc/${PACKAGE}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
ac_prev=
+ac_dashdash=
for ac_option
do
# If the previous option needs an argument, assign it.
if test -n "$ac_prev"; then
- eval "$ac_prev=\$ac_option"
+ eval $ac_prev=\$ac_option
ac_prev=
continue
fi
- ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+ case $ac_option in
+ *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *) ac_optarg=yes ;;
+ esac
# Accept the important Cygnus configure options, so we can diagnose typos.
- case $ac_option in
+ case $ac_dashdash$ac_option in
+ --)
+ ac_dashdash=yes ;;
-bindir | --bindir | --bindi | --bind | --bin | --bi)
ac_prev=bindir ;;
@@ -385,33 +787,59 @@ do
--config-cache | -C)
cache_file=config.cache ;;
- -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ -datadir | --datadir | --datadi | --datad)
ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
- | --da=*)
+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
datadir=$ac_optarg ;;
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
-disable-* | --disable-*)
- ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/-/_/g'`
- eval "enable_$ac_feature=no" ;;
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=no ;;
+
+ -docdir | --docdir | --docdi | --doc | --do)
+ ac_prev=docdir ;;
+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+ docdir=$ac_optarg ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+ ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+ dvidir=$ac_optarg ;;
-enable-* | --enable-*)
- ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/-/_/g'`
- case $ac_option in
- *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
- *) ac_optarg=yes ;;
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
esac
- eval "enable_$ac_feature='$ac_optarg'" ;;
+ eval enable_$ac_useropt=\$ac_optarg ;;
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
@@ -438,6 +866,12 @@ do
-host=* | --host=* | --hos=* | --ho=*)
host_alias=$ac_optarg ;;
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+ ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+ | --ht=*)
+ htmldir=$ac_optarg ;;
+
-includedir | --includedir | --includedi | --included | --include \
| --includ | --inclu | --incl | --inc)
ac_prev=includedir ;;
@@ -462,13 +896,16 @@ do
| --libexe=* | --libex=* | --libe=*)
libexecdir=$ac_optarg ;;
+ -localedir | --localedir | --localedi | --localed | --locale)
+ ac_prev=localedir ;;
+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+ localedir=$ac_optarg ;;
+
-localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst \
- | --locals | --local | --loca | --loc | --lo)
+ | --localstate | --localstat | --localsta | --localst | --locals)
ac_prev=localstatedir ;;
-localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* \
- | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
localstatedir=$ac_optarg ;;
-mandir | --mandir | --mandi | --mand | --man | --ma | --m)
@@ -533,6 +970,16 @@ do
| --progr-tra=* | --program-tr=* | --program-t=*)
program_transform_name=$ac_optarg ;;
+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+ ac_prev=pdfdir ;;
+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+ pdfdir=$ac_optarg ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+ ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+ psdir=$ac_optarg ;;
+
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
@@ -583,26 +1030,36 @@ do
ac_init_version=: ;;
-with-* | --with-*)
- ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- case $ac_option in
- *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
- *) ac_optarg=yes ;;
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
esac
- eval "with_$ac_package='$ac_optarg'" ;;
+ eval with_$ac_useropt=\$ac_optarg ;;
-without-* | --without-*)
- ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package | sed 's/-/_/g'`
- eval "with_$ac_package=no" ;;
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=no ;;
--x)
# Obsolete; use --with-x.
@@ -622,26 +1079,25 @@ do
| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
x_libraries=$ac_optarg ;;
- -*) { echo "$as_me: error: unrecognized option: $ac_option
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; }
+ -*) as_fn_error "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information."
;;
*=*)
ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
# Reject names that are not valid shell variable names.
- expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
- { (exit 1); exit 1; }; }
- ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
- eval "$ac_envvar='$ac_optarg'"
+ case $ac_envvar in #(
+ '' | [0-9]* | *[!_$as_cr_alnum]* )
+ as_fn_error "invalid variable name: \`$ac_envvar'" ;;
+ esac
+ eval $ac_envvar=\$ac_optarg
export $ac_envvar ;;
*)
# FIXME: should be removed in autoconf 3.0.
- echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
: ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
;;
@@ -650,31 +1106,36 @@ done
if test -n "$ac_prev"; then
ac_option=--`echo $ac_prev | sed 's/_/-/g'`
- { echo "$as_me: error: missing argument to $ac_option" >&2
- { (exit 1); exit 1; }; }
+ as_fn_error "missing argument to $ac_option"
fi
-# Be sure to have absolute paths.
-for ac_var in exec_prefix prefix
-do
- eval ac_val=$`echo $ac_var`
- case $ac_val in
- [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
- *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
- { (exit 1); exit 1; }; };;
+if test -n "$ac_unrecognized_opts"; then
+ case $enable_option_checking in
+ no) ;;
+ fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;;
+ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
esac
-done
+fi
-# Be sure to have absolute paths.
-for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
- localstatedir libdir includedir oldincludedir infodir mandir
+# Check all directory arguments for consistency.
+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+ libdir localedir mandir
do
- eval ac_val=$`echo $ac_var`
+ eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+ case $ac_val in
+ */ )
+ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+ eval $ac_var=\$ac_val;;
+ esac
+ # Be sure to have absolute directory names.
case $ac_val in
- [\\/$]* | ?:[\\/]* ) ;;
- *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
- { (exit 1); exit 1; }; };;
+ [\\/$]* | ?:[\\/]* ) continue;;
+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
esac
+ as_fn_error "expected an absolute directory name for --$ac_var: $ac_val"
done
# There might be people who depend on the old broken behavior: `$host'
@@ -688,7 +1149,7 @@ target=$target_alias
if test "x$host_alias" != x; then
if test "x$build_alias" = x; then
cross_compiling=maybe
- echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+ $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used." >&2
elif test "x$build_alias" != "x$host_alias"; then
cross_compiling=yes
@@ -701,74 +1162,72 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias-
test "$silent" = yes && exec 6>/dev/null
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ as_fn_error "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ as_fn_error "pwd does not report name of working directory"
+
+
# Find the source files, if location was not specified.
if test -z "$srcdir"; then
ac_srcdir_defaulted=yes
- # Try the directory containing this script, then its parent.
- ac_confdir=`(dirname "$0") 2>/dev/null ||
-$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$0" : 'X\(//\)[^/]' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$0" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
+ # Try the directory containing this script, then the parent directory.
+ ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_myself" : 'X\(//\)[^/]' \| \
+ X"$as_myself" : 'X\(//\)$' \| \
+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
srcdir=$ac_confdir
- if test ! -r $srcdir/$ac_unique_file; then
+ if test ! -r "$srcdir/$ac_unique_file"; then
srcdir=..
fi
else
ac_srcdir_defaulted=no
fi
-if test ! -r $srcdir/$ac_unique_file; then
- if test "$ac_srcdir_defaulted" = yes; then
- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
- { (exit 1); exit 1; }; }
- else
- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
- { (exit 1); exit 1; }; }
- fi
-fi
-(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
- { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
- { (exit 1); exit 1; }; }
-srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
-ac_env_build_alias_set=${build_alias+set}
-ac_env_build_alias_value=$build_alias
-ac_cv_env_build_alias_set=${build_alias+set}
-ac_cv_env_build_alias_value=$build_alias
-ac_env_host_alias_set=${host_alias+set}
-ac_env_host_alias_value=$host_alias
-ac_cv_env_host_alias_set=${host_alias+set}
-ac_cv_env_host_alias_value=$host_alias
-ac_env_target_alias_set=${target_alias+set}
-ac_env_target_alias_value=$target_alias
-ac_cv_env_target_alias_set=${target_alias+set}
-ac_cv_env_target_alias_value=$target_alias
-ac_env_CC_set=${CC+set}
-ac_env_CC_value=$CC
-ac_cv_env_CC_set=${CC+set}
-ac_cv_env_CC_value=$CC
-ac_env_CFLAGS_set=${CFLAGS+set}
-ac_env_CFLAGS_value=$CFLAGS
-ac_cv_env_CFLAGS_set=${CFLAGS+set}
-ac_cv_env_CFLAGS_value=$CFLAGS
-ac_env_LDFLAGS_set=${LDFLAGS+set}
-ac_env_LDFLAGS_value=$LDFLAGS
-ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
-ac_cv_env_LDFLAGS_value=$LDFLAGS
-ac_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_env_CPPFLAGS_value=$CPPFLAGS
-ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_cv_env_CPPFLAGS_value=$CPPFLAGS
-ac_env_CPP_set=${CPP+set}
-ac_env_CPP_value=$CPP
-ac_cv_env_CPP_set=${CPP+set}
-ac_cv_env_CPP_value=$CPP
+if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+ as_fn_error "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg"
+ pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+ srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_env_${ac_var}_value=\$${ac_var}
+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
#
# Report the --help message.
@@ -797,9 +1256,6 @@ Configuration:
-n, --no-create do not create output files
--srcdir=DIR find the sources in DIR [configure dir or \`..']
-_ACEOF
-
- cat <<_ACEOF
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
[$ac_default_prefix]
@@ -814,18 +1270,25 @@ for instance \`--prefix=\$HOME'.
For better control, use the options below.
Fine tuning of the installation directories:
- --bindir=DIR user executables [EPREFIX/bin]
- --sbindir=DIR system admin executables [EPREFIX/sbin]
- --libexecdir=DIR program executables [EPREFIX/libexec]
- --datadir=DIR read-only architecture-independent data [PREFIX/share]
- --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --libdir=DIR object code libraries [EPREFIX/lib]
- --includedir=DIR C header files [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc [/usr/include]
- --infodir=DIR info documentation [PREFIX/info]
- --mandir=DIR man documentation [PREFIX/man]
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
_ACEOF
cat <<\_ACEOF
@@ -854,148 +1317,436 @@ Some influential environment variables:
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
- CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
- headers in a nonstandard directory <include dir>
+ LIBS libraries to pass to the linker, e.g. -l<library>
+ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+ you have headers in a nonstandard directory <include dir>
CPP C preprocessor
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
+Report bugs to the package provider.
_ACEOF
+ac_status=$?
fi
if test "$ac_init_help" = "recursive"; then
# If there are subdirs, report their specific --help.
- ac_popdir=`pwd`
for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
- test -d $ac_dir || continue
+ test -d "$ac_dir" ||
+ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+ continue
ac_builddir=.
-if test "$ac_dir" != .; then
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A "../" for each directory in $ac_dir_suffix.
- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
- ac_dir_suffix= ac_top_builddir=
-fi
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
case $srcdir in
- .) # No --srcdir option. We are building in place.
+ .) # We are building in place.
ac_srcdir=.
- if test -z "$ac_top_builddir"; then
- ac_top_srcdir=.
- else
- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
- fi ;;
- [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir ;;
- *) # Relative path.
- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_builddir$srcdir ;;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
esac
-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
-# absolute.
-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
-
- cd $ac_dir
- # Check for guested configure; otherwise get Cygnus style configure.
- if test -f $ac_srcdir/configure.gnu; then
- echo
- $SHELL $ac_srcdir/configure.gnu --help=recursive
- elif test -f $ac_srcdir/configure; then
- echo
- $SHELL $ac_srcdir/configure --help=recursive
- elif test -f $ac_srcdir/configure.ac ||
- test -f $ac_srcdir/configure.in; then
- echo
- $ac_configure --help
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+ cd "$ac_dir" || { ac_status=$?; continue; }
+ # Check for guested configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+ elif test -f "$ac_srcdir/configure"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure" --help=recursive
else
- echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
- fi
- cd $ac_popdir
+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi || ac_status=$?
+ cd "$ac_pwd" || { ac_status=$?; break; }
done
fi
-test -n "$ac_init_help" && exit 0
+test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
+configure
+generated by GNU Autoconf 2.65
-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
-Free Software Foundation, Inc.
+Copyright (C) 2009 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
- exit 0
+ exit
fi
-exec 5>config.log
-cat >&5 <<_ACEOF
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-It was created by $as_me, which was
-generated by GNU Autoconf 2.57. Invocation command line was
-
- $ $0 $@
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
-_ACEOF
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
{
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext
+ if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+ ac_retval=1
+fi
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ as_fn_set_status $ac_retval
-/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
-/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
-/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+} # ac_fn_c_try_compile
-_ASUNAME
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- echo "PATH: $as_dir"
-done
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ as_fn_set_status $ac_retval
-} >&5
+} # ac_fn_c_try_link
-cat >&5 <<_ACEOF
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ ac_retval=1
+fi
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ as_fn_set_status $ac_retval
-## ----------- ##
-## Core tests. ##
-## ----------- ##
+} # ac_fn_c_try_cpp
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+ $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_header_compiler=yes
+else
+ ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ ac_header_preproc=yes
+else
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
-# Keep a trace of the command line.
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Strip out --silent because we don't want to record it for future runs.
-# Also quote any args containing shell meta-characters.
-# Make two passes to allow for proper duplicate-argument suppression.
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
+ yes:no: )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+ ;;
+ no:yes:* )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+ ;;
+esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_header_mongrel
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=$ac_status
+fi
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_header_compile
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by $as_me, which was
+generated by GNU Autoconf 2.65. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ $as_echo "PATH: $as_dir"
+ done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
ac_configure_args=
ac_configure_args0=
ac_configure_args1=
-ac_sep=
ac_must_keep_next=false
for ac_pass in 1 2
do
@@ -1006,43 +1757,41 @@ do
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
continue ;;
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
- ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *\'*)
+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
case $ac_pass in
- 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+ 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
2)
- ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+ as_fn_append ac_configure_args1 " '$ac_arg'"
if test $ac_must_keep_next = true; then
- ac_must_keep_next=false # Got value, back to normal.
+ ac_must_keep_next=false # Got value, back to normal.
else
- case $ac_arg in
- *=* | --config-cache | -C | -disable-* | --disable-* \
- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
- | -with-* | --with-* | -without-* | --without-* | --x)
- case "$ac_configure_args0 " in
- "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
- esac
- ;;
- -* ) ac_must_keep_next=true ;;
- esac
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
fi
- ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
- # Get rid of the leading space.
- ac_sep=" "
+ as_fn_append ac_configure_args " '$ac_arg'"
;;
esac
done
done
-$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
-$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
# When interrupted or exit'd, cleanup temporary files, and complete
# config.log. We remove comments because anyway the quotes in there
# would cause problems or look ugly.
-# WARNING: Be sure not to use single quotes in there, as some shells,
-# such as our DU 5.0 friend, will then `close' the trap.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
trap 'exit_status=$?
# Save into config.log some information that might help in debugging.
{
@@ -1055,20 +1804,35 @@ trap 'exit_status=$?
_ASBOX
echo
# The following way of writing the cache mishandles newlines in values,
-{
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
(set) 2>&1 |
- case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
- *ac_space=\ *)
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
sed -n \
- "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
- ;;
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
*)
- sed -n \
- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
;;
- esac;
-}
+ esac |
+ sort
+)
echo
cat <<\_ASBOX
@@ -1079,22 +1843,28 @@ _ASBOX
echo
for ac_var in $ac_subst_vars
do
- eval ac_val=$`echo $ac_var`
- echo "$ac_var='"'"'$ac_val'"'"'"
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
done | sort
echo
if test -n "$ac_subst_files"; then
cat <<\_ASBOX
-## ------------- ##
-## Output files. ##
-## ------------- ##
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
_ASBOX
echo
for ac_var in $ac_subst_files
do
- eval ac_val=$`echo $ac_var`
- echo "$ac_var='"'"'$ac_val'"'"'"
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
done | sort
echo
fi
@@ -1106,26 +1876,26 @@ _ASBOX
## ----------- ##
_ASBOX
echo
- sed "/^$/d" confdefs.h | sort
+ cat confdefs.h
echo
fi
test "$ac_signal" != 0 &&
- echo "$as_me: caught signal $ac_signal"
- echo "$as_me: exit $exit_status"
+ $as_echo "$as_me: caught signal $ac_signal"
+ $as_echo "$as_me: exit $exit_status"
} >&5
- rm -f core core.* *.core &&
- rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
exit $exit_status
- ' 0
+' 0
for ac_signal in 1 2 13 15; do
- trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+ trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
done
ac_signal=0
# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo >confdefs.h
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
# Predefined preprocessor variables.
@@ -1133,112 +1903,128 @@ cat >>confdefs.h <<_ACEOF
#define PACKAGE_NAME "$PACKAGE_NAME"
_ACEOF
-
cat >>confdefs.h <<_ACEOF
#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
_ACEOF
-
cat >>confdefs.h <<_ACEOF
#define PACKAGE_VERSION "$PACKAGE_VERSION"
_ACEOF
-
cat >>confdefs.h <<_ACEOF
#define PACKAGE_STRING "$PACKAGE_STRING"
_ACEOF
-
cat >>confdefs.h <<_ACEOF
#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
_ACEOF
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
# Let the site file select an alternate cache file if it wants to.
-# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
- fi
-fi
-for ac_site_file in $CONFIG_SITE; do
- if test -r "$ac_site_file"; then
- { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
-echo "$as_me: loading site script $ac_site_file" >&6;}
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+ ac_site_file1=$CONFIG_SITE
+elif test "x$prefix" != xNONE; then
+ ac_site_file1=$prefix/share/config.site
+ ac_site_file2=$prefix/etc/config.site
+else
+ ac_site_file1=$ac_default_prefix/share/config.site
+ ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+ test "x$ac_site_file" = xNONE && continue
+ if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
sed 's/^/| /' "$ac_site_file" >&5
. "$ac_site_file"
fi
done
if test -r "$cache_file"; then
- # Some versions of bash will fail to source /dev/null (special
- # files actually), so we avoid doing that.
- if test -f "$cache_file"; then
- { echo "$as_me:$LINENO: loading cache $cache_file" >&5
-echo "$as_me: loading cache $cache_file" >&6;}
+ # Some versions of bash will fail to source /dev/null (special files
+ # actually), so we avoid doing that. DJGPP emulates it as a regular file.
+ if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
case $cache_file in
- [\\/]* | ?:[\\/]* ) . $cache_file;;
- *) . ./$cache_file;;
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
esac
fi
else
- { echo "$as_me:$LINENO: creating cache $cache_file" >&5
-echo "$as_me: creating cache $cache_file" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
>$cache_file
fi
# Check that the precious variables saved in the cache have kept the same
# value.
ac_cache_corrupted=false
-for ac_var in `(set) 2>&1 |
- sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+for ac_var in $ac_precious_vars; do
eval ac_old_set=\$ac_cv_env_${ac_var}_set
eval ac_new_set=\$ac_env_${ac_var}_set
- eval ac_old_val="\$ac_cv_env_${ac_var}_value"
- eval ac_new_val="\$ac_env_${ac_var}_value"
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
case $ac_old_set,$ac_new_set in
set,)
- { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
ac_cache_corrupted=: ;;
,set)
- { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
ac_cache_corrupted=: ;;
,);;
*)
if test "x$ac_old_val" != "x$ac_new_val"; then
- { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
-echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
-echo "$as_me: former value: $ac_old_val" >&2;}
- { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
-echo "$as_me: current value: $ac_new_val" >&2;}
- ac_cache_corrupted=:
+ # differences in whitespace do not lead to failure.
+ ac_old_val_w=`echo x $ac_old_val`
+ ac_new_val_w=`echo x $ac_new_val`
+ if test "$ac_old_val_w" != "$ac_new_val_w"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ ac_cache_corrupted=:
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ eval $ac_var=\$ac_old_val
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
fi;;
esac
# Pass precious variables to config.status.
if test "$ac_new_set" = set; then
case $ac_new_val in
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
- ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
*) ac_arg=$ac_var=$ac_new_val ;;
esac
case " $ac_configure_args " in
*" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
- *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ *) as_fn_append ac_configure_args " '$ac_arg'" ;;
esac
fi
done
if $ac_cache_corrupted; then
- { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
-echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
- { (exit 1); exit 1; }; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
@@ -1250,23 +2036,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
MAJOR_VER="1"
@@ -1275,7 +2044,7 @@ MINOR_VER="6"
-MICRO_VER="1"
+MICRO_VER="2"
CFLAGS="$CFLAGS"
@@ -1287,10 +2056,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
set dummy ${ac_tool_prefix}gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1300,35 +2069,37 @@ for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_CC="${ac_tool_prefix}gcc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
-done
+ done
+IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
+
fi
if test -z "$ac_cv_prog_CC"; then
ac_ct_CC=$CC
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
@@ -1338,39 +2109,50 @@ for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_CC="gcc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
-done
+ done
+IFS=$as_save_IFS
fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
- CC=$ac_ct_CC
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
else
CC="$ac_cv_prog_CC"
fi
if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
set dummy ${ac_tool_prefix}cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1380,77 +2162,37 @@ for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_CC="${ac_tool_prefix}cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
-done
+ done
+IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_CC"; then
- ac_ct_CC=$CC
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
- CC=$ac_ct_CC
-else
- CC="$ac_cv_prog_CC"
-fi
+ fi
fi
if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1461,18 +2203,19 @@ for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
ac_prog_rejected=yes
continue
fi
ac_cv_prog_CC="cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
-done
+ done
+IFS=$as_save_IFS
if test $ac_prog_rejected = yes; then
# We found a bogon in the path, so make sure we never use it.
@@ -1490,24 +2233,25 @@ fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
+
fi
if test -z "$CC"; then
if test -n "$ac_tool_prefix"; then
- for ac_prog in cl
+ for ac_prog in cl.exe
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1517,39 +2261,41 @@ for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
-done
+ done
+IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
+
test -n "$CC" && break
done
fi
if test -z "$CC"; then
ac_ct_CC=$CC
- for ac_prog in cl
+ for ac_prog in cl.exe
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
@@ -1559,67 +2305,78 @@ for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_CC="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
-done
+ done
+IFS=$as_save_IFS
fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
+
test -n "$ac_ct_CC" && break
done
- CC=$ac_ct_CC
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
fi
fi
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&5
-echo "$as_me: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "no acceptable C compiler found in \$PATH
+See \`config.log' for more details." "$LINENO" 5; }
# Provide some information about the compiler.
-echo "$as_me:$LINENO:" \
- "checking for C compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
- (eval $ac_compiler --version </dev/null >&5) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
- (eval $ac_compiler -v </dev/null >&5) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
- (eval $ac_compiler -V </dev/null >&5) 2>&5
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
-cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
@@ -1631,112 +2388,109 @@ main ()
}
_ACEOF
ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.exe b.out"
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
# Try to create an executable without -o first, disregard a.out.
# It will help us diagnose broken compilers, and finding out an intuition
# of exeext.
-echo "$as_me:$LINENO: checking for C compiler default output" >&5
-echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
-ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
- (eval $ac_link_default) 2>&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+ esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link_default") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- # Find the output, starting from the most likely. This scheme is
-# not robust to junk in `.', hence go to wildcards (a.*) only as a last
-# resort.
-
-# Be careful to initialize this variable, since it used to be cached.
-# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
-ac_cv_exeext=
-# b.out is created by i960 compilers.
-for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile. We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
do
test -f "$ac_file" || continue
case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
- ;;
- conftest.$ac_ext )
- # This is the source file.
- ;;
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+ ;;
[ab].out )
- # We found the default executable, but exeext='' is most
- # certainly right.
- break;;
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
*.* )
- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- # FIXME: I believe we export ac_cv_exeext for Libtool,
- # but it would be cool to find out if it's true. Does anybody
- # maintain Libtool? --akim.
- export ac_cv_exeext
- break;;
+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ then :; else
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ fi
+ # We set ac_cv_exeext here because the later test for it is not
+ # safe: cross compilers may not add the suffix if given an `-o'
+ # argument, so we may need to know it at that point already.
+ # Even if this section looks crufty: it has the advantage of
+ # actually working.
+ break;;
* )
- break;;
+ break;;
esac
done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
else
- echo "$as_me: failed program was:" >&5
+ ac_file=''
+fi
+if test -z "$ac_file"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
-See \`config.log' for more details." >&5
-echo "$as_me: error: C compiler cannot create executables
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ as_fn_set_status 77
+as_fn_error "C compiler cannot create executables
+See \`config.log' for more details." "$LINENO" 5; }; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
fi
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
ac_exeext=$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6
-
-# Check the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
-# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
-# If not cross compiling, check that we can run a simple program.
-if test "$cross_compiling" != yes; then
- if { ac_try='./$ac_file'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- cross_compiling=no
- else
- if test "$cross_compiling" = maybe; then
- cross_compiling=yes
- else
- { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
- fi
- fi
-fi
-echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-rm -f a.out a.exe conftest$ac_cv_exeext b.out
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
ac_clean_files=$ac_clean_files_save
-# Check the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
-echo "$as_me:$LINENO: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6
-
-echo "$as_me:$LINENO: checking for suffix of executables" >&5
-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
# If both `conftest.exe' and `conftest' are `present' (well, observable)
# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
# work properly (i.e., refer to `conftest.exe'), while it won't with
@@ -1744,39 +2498,90 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
for ac_file in conftest.exe conftest conftest.*; do
test -f "$ac_file" || continue
case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
*.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- export ac_cv_exeext
- break;;
+ break;;
* ) break;;
esac
done
else
- { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." "$LINENO" 5; }
fi
-
-rm -f conftest$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
rm -f conftest.$ac_ext
EXEEXT=$ac_cv_exeext
ac_exeext=$EXEEXT
-echo "$as_me:$LINENO: checking for suffix of object files" >&5
-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
-if test "${ac_cv_objext+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+ { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if { ac_try='./conftest$ac_cv_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." "$LINENO" 5; }
+ fi
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if test "${ac_cv_objext+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
@@ -1788,46 +2593,46 @@ main ()
}
_ACEOF
rm -f conftest.o conftest.obj
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ for ac_file in conftest.o conftest.obj conftest.*; do
+ test -f "$ac_file" || continue;
case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
*) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
break;;
esac
done
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." "$LINENO" 5; }
fi
-
rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
-echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
OBJEXT=$ac_cv_objext
ac_objext=$OBJEXT
-echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
-if test "${ac_cv_c_compiler_gnu+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
@@ -1841,46 +2646,34 @@ main ()
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+if ac_fn_c_try_compile "$LINENO"; then :
ac_compiler_gnu=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_compiler_gnu=no
+ ac_compiler_gnu=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cv_c_compiler_gnu=$ac_compiler_gnu
fi
-echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
-GCC=`test $ac_compiler_gnu = yes && echo yes`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
ac_test_CFLAGS=${CFLAGS+set}
ac_save_CFLAGS=$CFLAGS
-CFLAGS="-g"
-echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_g+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
@@ -1891,30 +2684,50 @@ main ()
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_prog_cc_g=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ CFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
-ac_cv_prog_cc_g=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
-if test "$ac_test_CFLAGS" = set; then
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
CFLAGS=$ac_save_CFLAGS
elif test $ac_cv_prog_cc_g = yes; then
if test "$GCC" = yes; then
@@ -1929,19 +2742,14 @@ else
CFLAGS=
fi
fi
-echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
-echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_stdc+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
- ac_cv_prog_cc_stdc=no
+ ac_cv_prog_cc_c89=no
ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdarg.h>
#include <stdio.h>
@@ -1965,6 +2773,21 @@ static char *f (char * (*g) (char **, int), char **p, ...)
va_end (v);
return s;
}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
int test (int i, double x);
struct s1 {int (*f) (int a);};
struct s2 {int (*f) (double a);};
@@ -1979,168 +2802,37 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
return 0;
}
_ACEOF
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX -qlanglvl=ansi
-# Ultrix and OSF/1 -std1
-# HP-UX 10.20 and later -Ae
-# HP-UX older versions -Aa -D_HPUX_SOURCE
-# SVR4 -Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
CC="$ac_save_CC $ac_arg"
- rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_prog_cc_stdc=$ac_arg
-break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c89=$ac_arg
fi
-rm -f conftest.$ac_objext
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
done
-rm -f conftest.$ac_ext conftest.$ac_objext
+rm -f conftest.$ac_ext
CC=$ac_save_CC
fi
-
-case "x$ac_cv_prog_cc_stdc" in
- x|xno)
- echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6 ;;
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
*)
- echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
- CC="$CC $ac_cv_prog_cc_stdc" ;;
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
-# Some people use a C++ compiler to compile C. Since we use `exit',
-# in C++ we need to declare it. In case someone uses the same compiler
-# for both compiling C and C++ we need to have the C++ compiler decide
-# the declaration of exit, since it's the most demanding environment.
-cat >conftest.$ac_ext <<_ACEOF
-#ifndef __cplusplus
- choke me
-#endif
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- for ac_declaration in \
- ''\
- '#include <stdlib.h>' \
- 'extern "C" void std::exit (int) throw (); using std::exit;' \
- 'extern "C" void std::exit (int); using std::exit;' \
- 'extern "C" void exit (int) throw ();' \
- 'extern "C" void exit (int);' \
- 'void exit (int);'
-do
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdlib.h>
-$ac_declaration
-int
-main ()
-{
-exit (42);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-continue
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_declaration
-int
-main ()
-{
-exit (42);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-done
-rm -f conftest*
-if test -n "$ac_declaration"; then
- echo '#ifdef __cplusplus' >>confdefs.h
- echo $ac_declaration >>confdefs.h
- echo '#endif' >>confdefs.h
fi
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -2149,46 +2841,48 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
-echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
-if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then :
+ $as_echo_n "(cached) " >&6
else
cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
all:
- @echo 'ac_maketemp="$(MAKE)"'
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
_ACEOF
# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
-if test -n "$ac_maketemp"; then
- eval ac_cv_prog_make_${ac_make}_set=yes
-else
- eval ac_cv_prog_make_${ac_make}_set=no
-fi
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
rm -f conftest.make
fi
-if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
SET_MAKE=
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
SET_MAKE="MAKE=${MAKE-make}"
fi
-echo "$as_me:$LINENO: checking whether ln -s works" >&5
-echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
LN_S=$as_ln_s
if test "$LN_S" = "ln -s"; then
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
else
- echo "$as_me:$LINENO: result: no, using $LN_S" >&5
-echo "${ECHO_T}no, using $LN_S" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
fi
@@ -2197,10 +2891,10 @@ for ac_prog in gawk mawk nawk awk
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_AWK+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
if test -n "$AWK"; then
ac_cv_prog_AWK="$AWK" # Let the user override the test.
@@ -2210,26 +2904,28 @@ for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_AWK="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
-done
+ done
+IFS=$as_save_IFS
fi
fi
AWK=$ac_cv_prog_AWK
if test -n "$AWK"; then
- echo "$as_me:$LINENO: result: $AWK" >&5
-echo "${ECHO_T}$AWK" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
+
test -n "$AWK" && break
done
@@ -2238,10 +2934,10 @@ done
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_RANLIB+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_RANLIB+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
if test -n "$RANLIB"; then
ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
@@ -2251,35 +2947,37 @@ for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
-done
+ done
+IFS=$as_save_IFS
fi
fi
RANLIB=$ac_cv_prog_RANLIB
if test -n "$RANLIB"; then
- echo "$as_me:$LINENO: result: $RANLIB" >&5
-echo "${ECHO_T}$RANLIB" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
+
fi
if test -z "$ac_cv_prog_RANLIB"; then
ac_ct_RANLIB=$RANLIB
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_RANLIB"; then
ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
@@ -2289,27 +2987,38 @@ for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_RANLIB="ranlib"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
-done
+ done
+IFS=$as_save_IFS
fi
fi
ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
if test -n "$ac_ct_RANLIB"; then
- echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
-echo "${ECHO_T}$ac_ct_RANLIB" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
- RANLIB=$ac_ct_RANLIB
+ if test "x$ac_ct_RANLIB" = x; then
+ RANLIB=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ RANLIB=$ac_ct_RANLIB
+ fi
else
RANLIB="$ac_cv_prog_RANLIB"
fi
@@ -2319,10 +3028,10 @@ fi
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
set dummy ${ac_tool_prefix}ld; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_LD+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_LD+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
if test -n "$LD"; then
ac_cv_prog_LD="$LD" # Let the user override the test.
@@ -2332,35 +3041,37 @@ for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_LD="${ac_tool_prefix}ld"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
-done
+ done
+IFS=$as_save_IFS
fi
fi
LD=$ac_cv_prog_LD
if test -n "$LD"; then
- echo "$as_me:$LINENO: result: $LD" >&5
-echo "${ECHO_T}$LD" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
+
fi
if test -z "$ac_cv_prog_LD"; then
ac_ct_LD=$LD
# Extract the first word of "ld", so it can be a program name with args.
set dummy ld; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_LD+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_LD"; then
ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
@@ -2370,27 +3081,38 @@ for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_LD="ld"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
-done
+ done
+IFS=$as_save_IFS
fi
fi
ac_ct_LD=$ac_cv_prog_ac_ct_LD
if test -n "$ac_ct_LD"; then
- echo "$as_me:$LINENO: result: $ac_ct_LD" >&5
-echo "${ECHO_T}$ac_ct_LD" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LD" >&5
+$as_echo "$ac_ct_LD" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
- LD=$ac_ct_LD
+ if test "x$ac_ct_LD" = x; then
+ LD=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ LD=$ac_ct_LD
+ fi
else
LD="$ac_cv_prog_LD"
fi
@@ -2398,104 +3120,130 @@ fi
ac_aux_dir=
-for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
- if test -f $ac_dir/install-sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f $ac_dir/install.sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- elif test -f $ac_dir/shtool; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/shtool install -c"
- break
- fi
+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+ for ac_t in install-sh install.sh shtool; do
+ if test -f "$ac_dir/$ac_t"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/$ac_t -c"
+ break 2
+ fi
+ done
done
if test -z "$ac_aux_dir"; then
- { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
-echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
fi
-ac_config_guess="$SHELL $ac_aux_dir/config.guess"
-ac_config_sub="$SHELL $ac_aux_dir/config.sub"
-ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+
# Make sure we can run config.sub.
-$ac_config_sub sun4 >/dev/null 2>&1 ||
- { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
-echo "$as_me: error: cannot run $ac_config_sub" >&2;}
- { (exit 1); exit 1; }; }
-
-echo "$as_me:$LINENO: checking build system type" >&5
-echo $ECHO_N "checking build system type... $ECHO_C" >&6
-if test "${ac_cv_build+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_build_alias=$build_alias
-test -z "$ac_cv_build_alias" &&
- ac_cv_build_alias=`$ac_config_guess`
-test -z "$ac_cv_build_alias" &&
- { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
-echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
- { (exit 1); exit 1; }; }
-ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
- { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
- { (exit 1); exit 1; }; }
-
-fi
-echo "$as_me:$LINENO: result: $ac_cv_build" >&5
-echo "${ECHO_T}$ac_cv_build" >&6
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+ as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if test "${ac_cv_build+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+ ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+ as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+ as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error "invalid value of canonical build" "$LINENO" 5;;
+esac
build=$ac_cv_build
-build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
-echo "$as_me:$LINENO: checking host system type" >&5
-echo $ECHO_N "checking host system type... $ECHO_C" >&6
-if test "${ac_cv_host+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if test "${ac_cv_host+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
- ac_cv_host_alias=$host_alias
-test -z "$ac_cv_host_alias" &&
- ac_cv_host_alias=$ac_cv_build_alias
-ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
- { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
- { (exit 1); exit 1; }; }
+ if test "x$host_alias" = x; then
+ ac_cv_host=$ac_cv_build
+else
+ ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+ as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
fi
-echo "$as_me:$LINENO: result: $ac_cv_host" >&5
-echo "${ECHO_T}$ac_cv_host" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error "invalid value of canonical host" "$LINENO" 5;;
+esac
host=$ac_cv_host
-host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-echo "$as_me:$LINENO: checking target system type" >&5
-echo $ECHO_N "checking target system type... $ECHO_C" >&6
-if test "${ac_cv_target+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5
+$as_echo_n "checking target system type... " >&6; }
+if test "${ac_cv_target+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "x$target_alias" = x; then
+ ac_cv_target=$ac_cv_host
else
- ac_cv_target_alias=$target_alias
-test "x$ac_cv_target_alias" = "x" &&
- ac_cv_target_alias=$ac_cv_host_alias
-ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
- { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
- { (exit 1); exit 1; }; }
+ ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
+ as_fn_error "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5
+fi
fi
-echo "$as_me:$LINENO: result: $ac_cv_target" >&5
-echo "${ECHO_T}$ac_cv_target" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5
+$as_echo "$ac_cv_target" >&6; }
+case $ac_cv_target in
+*-*-*) ;;
+*) as_fn_error "invalid value of canonical target" "$LINENO" 5;;
+esac
target=$ac_cv_target
-target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_target
+shift
+target_cpu=$1
+target_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+target_os=$*
+IFS=$ac_save_IFS
+case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
# The aliases save the names the user supplied, while $host etc.
@@ -2506,6 +3254,7 @@ test -n "$target_alias" &&
program_prefix=${target_alias}-
+
case $target_os in
solaris2.[0-6]|solaris2.[0-6].*)
LIBS="$LIBS -L/usr/ccs/lib"
@@ -2538,15 +3287,15 @@ ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
fi
if test -z "$CPP"; then
- if test "${ac_cv_prog_CPP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ if test "${ac_cv_prog_CPP+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
# Double quotes because CPP needs to be expanded
for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
@@ -2560,81 +3309,33 @@ do
# <limits.h> exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
- Syntax error
+ Syntax error
_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_c_try_cpp "$LINENO"; then :
+else
# Broken: fails on valid input.
continue
fi
rm -f conftest.err conftest.$ac_ext
- # OK, works on sane cases. Now check whether non-existent headers
+ # OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <ac_nonexistent.h>
_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+if ac_fn_c_try_cpp "$LINENO"; then :
# Broken: success on invalid input.
continue
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
# Passes both tests.
ac_preproc_ok=:
break
@@ -2644,7 +3345,7 @@ rm -f conftest.err conftest.$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
+if $ac_preproc_ok; then :
break
fi
@@ -2656,8 +3357,8 @@ fi
else
ac_cv_prog_CPP=$CPP
fi
-echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
ac_preproc_ok=false
for ac_c_preproc_warn_flag in '' yes
do
@@ -2667,81 +3368,33 @@ do
# <limits.h> exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
- Syntax error
+ Syntax error
_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_c_try_cpp "$LINENO"; then :
+else
# Broken: fails on valid input.
continue
fi
rm -f conftest.err conftest.$ac_ext
- # OK, works on sane cases. Now check whether non-existent headers
+ # OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <ac_nonexistent.h>
_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+if ac_fn_c_try_cpp "$LINENO"; then :
# Broken: success on invalid input.
continue
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
# Passes both tests.
ac_preproc_ok=:
break
@@ -2751,14 +3404,13 @@ rm -f conftest.err conftest.$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- :
+if $ac_preproc_ok; then :
+
else
- { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&5
-echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." "$LINENO" 5; }
fi
ac_ext=c
@@ -2768,32 +3420,142 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-echo "$as_me:$LINENO: checking for egrep" >&5
-echo $ECHO_N "checking for egrep... $ECHO_C" >&6
-if test "${ac_cv_prog_egrep+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
- if echo a | (grep -E '(a|b)') >/dev/null 2>&1
- then ac_cv_prog_egrep='grep -E'
- else ac_cv_prog_egrep='egrep'
+ if test -z "$GREP"; then
+ ac_path_GREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_GREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_GREP"; then
+ as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_GREP=$GREP
+fi
+
fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
-echo "${ECHO_T}$ac_cv_prog_egrep" >&6
- EGREP=$ac_cv_prog_egrep
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
-echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
-if test "${ac_cv_header_stdc+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+ then ac_cv_path_EGREP="$GREP -E"
+ else
+ if test -z "$EGREP"; then
+ ac_path_EGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in egrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+ # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'EGREP' >> "conftest.nl"
+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_EGREP="$ac_path_EGREP"
+ ac_path_EGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_EGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_EGREP"; then
+ as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_EGREP=$EGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdlib.h>
#include <stdarg.h>
@@ -2808,42 +3570,23 @@ main ()
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_header_stdc=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_header_stdc=no
+ ac_cv_header_stdc=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <string.h>
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then
- :
+ $EGREP "memchr" >/dev/null 2>&1; then :
+
else
ac_cv_header_stdc=no
fi
@@ -2853,19 +3596,14 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdlib.h>
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then
- :
+ $EGREP "free" >/dev/null 2>&1; then :
+
else
ac_cv_header_stdc=no
fi
@@ -2875,25 +3613,21 @@ fi
if test $ac_cv_header_stdc = yes; then
# /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then
+ if test "$cross_compiling" = yes; then :
:
else
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <ctype.h>
+#include <stdlib.h>
#if ((' ' & 0x0FF) == 0x020)
# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#else
# define ISLOWER(c) \
- (('a' <= (c) && (c) <= 'i') \
- || ('j' <= (c) && (c) <= 'r') \
- || ('s' <= (c) && (c) <= 'z'))
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
#endif
@@ -2904,101 +3638,41 @@ main ()
int i;
for (i = 0; i < 256; i++)
if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
- exit(2);
- exit (0);
+ || toupper (i) != TOUPPER (i))
+ return 2;
+ return 0;
}
_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- :
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_c_try_run "$LINENO"; then :
-( exit $ac_status )
-ac_cv_header_stdc=no
+else
+ ac_cv_header_stdc=no
fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
+
fi
fi
-echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
if test $ac_cv_header_stdc = yes; then
-cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
-_ACEOF
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
fi
# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-
-
-
-
-
-
-
-
-
for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
- inttypes.h stdint.h unistd.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_Header=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_Header=no"
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ inttypes.h stdint.h unistd.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+eval as_val=\$$as_ac_Header
+ if test "x$as_val" = x""yes; then :
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
@@ -3006,522 +3680,163 @@ fi
done
-echo "$as_me:$LINENO: checking for tigetstr in -lcurses" >&5
-echo $ECHO_N "checking for tigetstr in -lcurses... $ECHO_C" >&6
-if test "${ac_cv_lib_curses_tigetstr+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tigetstr in -lcurses" >&5
+$as_echo_n "checking for tigetstr in -lcurses... " >&6; }
+if test "${ac_cv_lib_curses_tigetstr+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lcurses $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-/* Override any gcc2 internal prototype to avoid an error. */
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
char tigetstr ();
int
main ()
{
-tigetstr ();
+return tigetstr ();
;
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_curses_tigetstr=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_curses_tigetstr=no
+ ac_cv_lib_curses_tigetstr=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_curses_tigetstr" >&5
-echo "${ECHO_T}$ac_cv_lib_curses_tigetstr" >&6
-if test $ac_cv_lib_curses_tigetstr = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_curses_tigetstr" >&5
+$as_echo "$ac_cv_lib_curses_tigetstr" >&6; }
+if test "x$ac_cv_lib_curses_tigetstr" = x""yes; then :
- cat >>confdefs.h <<\_ACEOF
-#define USE_TERMINFO 1
-_ACEOF
+ $as_echo "#define USE_TERMINFO 1" >>confdefs.h
LIBS="$LIBS -lcurses"
else
- echo "$as_me:$LINENO: checking for tigetstr in -lncurses" >&5
-echo $ECHO_N "checking for tigetstr in -lncurses... $ECHO_C" >&6
-if test "${ac_cv_lib_ncurses_tigetstr+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tigetstr in -lncurses" >&5
+$as_echo_n "checking for tigetstr in -lncurses... " >&6; }
+if test "${ac_cv_lib_ncurses_tigetstr+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lncurses $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-/* Override any gcc2 internal prototype to avoid an error. */
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
char tigetstr ();
int
main ()
{
-tigetstr ();
+return tigetstr ();
;
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_ncurses_tigetstr=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_ncurses_tigetstr=no
+ ac_cv_lib_ncurses_tigetstr=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_tigetstr" >&5
-echo "${ECHO_T}$ac_cv_lib_ncurses_tigetstr" >&6
-if test $ac_cv_lib_ncurses_tigetstr = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_tigetstr" >&5
+$as_echo "$ac_cv_lib_ncurses_tigetstr" >&6; }
+if test "x$ac_cv_lib_ncurses_tigetstr" = x""yes; then :
- cat >>confdefs.h <<\_ACEOF
-#define USE_TERMINFO 1
-_ACEOF
+ $as_echo "#define USE_TERMINFO 1" >>confdefs.h
LIBS="$LIBS -lncurses"
else
- echo "$as_me:$LINENO: checking for tgetstr in -lcurses" >&5
-echo $ECHO_N "checking for tgetstr in -lcurses... $ECHO_C" >&6
-if test "${ac_cv_lib_curses_tgetstr+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetstr in -lcurses" >&5
+$as_echo_n "checking for tgetstr in -lcurses... " >&6; }
+if test "${ac_cv_lib_curses_tgetstr+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lcurses $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-/* Override any gcc2 internal prototype to avoid an error. */
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
char tgetstr ();
int
main ()
{
-tgetstr ();
+return tgetstr ();
;
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_curses_tgetstr=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_curses_tgetstr=no
+ ac_cv_lib_curses_tgetstr=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_curses_tgetstr" >&5
-echo "${ECHO_T}$ac_cv_lib_curses_tgetstr" >&6
-if test $ac_cv_lib_curses_tgetstr = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_curses_tgetstr" >&5
+$as_echo "$ac_cv_lib_curses_tgetstr" >&6; }
+if test "x$ac_cv_lib_curses_tgetstr" = x""yes; then :
- cat >>confdefs.h <<\_ACEOF
-#define USE_TERMCAP 1
-_ACEOF
+ $as_echo "#define USE_TERMCAP 1" >>confdefs.h
LIBS="$LIBS -lcurses"
- if test "${ac_cv_header_termcap_h+set}" = set; then
- echo "$as_me:$LINENO: checking for termcap.h" >&5
-echo $ECHO_N "checking for termcap.h... $ECHO_C" >&6
-if test "${ac_cv_header_termcap_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: $ac_cv_header_termcap_h" >&5
-echo "${ECHO_T}$ac_cv_header_termcap_h" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking termcap.h usability" >&5
-echo $ECHO_N "checking termcap.h usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <termcap.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ ac_fn_c_check_header_mongrel "$LINENO" "termcap.h" "ac_cv_header_termcap_h" "$ac_includes_default"
+if test "x$ac_cv_header_termcap_h" = x""yes; then :
+ $as_echo "#define HAVE_TERMCAP_H 1" >>confdefs.h
-ac_header_compiler=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-# Is the header present?
-echo "$as_me:$LINENO: checking termcap.h presence" >&5
-echo $ECHO_N "checking termcap.h presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <termcap.h>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc in
- yes:no )
- { echo "$as_me:$LINENO: WARNING: termcap.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: termcap.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: termcap.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: termcap.h: proceeding with the preprocessor's result" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
- no:yes )
- { echo "$as_me:$LINENO: WARNING: termcap.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: termcap.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: termcap.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: termcap.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: termcap.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: termcap.h: proceeding with the preprocessor's result" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for termcap.h" >&5
-echo $ECHO_N "checking for termcap.h... $ECHO_C" >&6
-if test "${ac_cv_header_termcap_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_header_termcap_h=$ac_header_preproc
fi
-echo "$as_me:$LINENO: result: $ac_cv_header_termcap_h" >&5
-echo "${ECHO_T}$ac_cv_header_termcap_h" >&6
fi
-if test $ac_cv_header_termcap_h = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_TERMCAP_H 1
-_ACEOF
fi
-fi
-
-fi
-
-fi
-
-
-
-
for ac_header in curses.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc in
- yes:no )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
- no:yes )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "curses.h" "ac_cv_header_curses_h" "$ac_includes_default"
+if test "x$ac_cv_header_curses_h" = x""yes; then :
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-for ac_header in term.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <curses.h>
-
-#include <$ac_header>
+#define HAVE_CURSES_H 1
_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_Header=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_Header=no"
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ for ac_header in term.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "term.h" "ac_cv_header_term_h" "#include <curses.h>
+"
+if test "x$ac_cv_header_term_h" = x""yes; then :
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define HAVE_TERM_H 1
_ACEOF
fi
@@ -3529,189 +3844,20 @@ fi
done
else
-
-for ac_header in ncurses/curses.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc in
- yes:no )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
- no:yes )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ for ac_header in ncurses/curses.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "ncurses/curses.h" "ac_cv_header_ncurses_curses_h" "$ac_includes_default"
+if test "x$ac_cv_header_ncurses_curses_h" = x""yes; then :
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-for ac_header in ncurses/term.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
+#define HAVE_NCURSES_CURSES_H 1
_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ncurses/curses.h>
-
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_Header=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_Header=no"
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ for ac_header in ncurses/term.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "ncurses/term.h" "ac_cv_header_ncurses_term_h" "#include <ncurses/curses.h>
+"
+if test "x$ac_cv_header_ncurses_term_h" = x""yes; then :
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define HAVE_NCURSES_TERM_H 1
_ACEOF
fi
@@ -3732,20 +3878,15 @@ done
TARGETS="normal reentrant"
-echo "$as_me:$LINENO: checking for reentrant functions" >&5
-echo $ECHO_N "checking for reentrant functions... $ECHO_C" >&6
-if test "${tecla_cv_reentrant+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for reentrant functions" >&5
+$as_echo_n "checking for reentrant functions... " >&6; }
+if test "${tecla_cv_reentrant+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
KEPT_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=199506L"
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <unistd.h>
@@ -3766,31 +3907,18 @@ main ()
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+if ac_fn_c_try_link "$LINENO"; then :
tecla_cv_reentrant=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-tecla_cv_reentrant=no
+ tecla_cv_reentrant=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
CFLAGS="$KEPT_CFLAGS"
fi
-echo "$as_me:$LINENO: result: $tecla_cv_reentrant" >&5
-echo "${ECHO_T}$tecla_cv_reentrant" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tecla_cv_reentrant" >&5
+$as_echo "$tecla_cv_reentrant" >&6; }
if test $tecla_cv_reentrant = no; then
@@ -3798,157 +3926,22 @@ if test $tecla_cv_reentrant = no; then
fi
-if test "${ac_cv_header_sys_select_h+set}" = set; then
- echo "$as_me:$LINENO: checking for sys/select.h" >&5
-echo $ECHO_N "checking for sys/select.h... $ECHO_C" >&6
-if test "${ac_cv_header_sys_select_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: $ac_cv_header_sys_select_h" >&5
-echo "${ECHO_T}$ac_cv_header_sys_select_h" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking sys/select.h usability" >&5
-echo $ECHO_N "checking sys/select.h usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <sys/select.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking sys/select.h presence" >&5
-echo $ECHO_N "checking sys/select.h presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/select.h>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc in
- yes:no )
- { echo "$as_me:$LINENO: WARNING: sys/select.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: sys/select.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: sys/select.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: sys/select.h: proceeding with the preprocessor's result" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
- no:yes )
- { echo "$as_me:$LINENO: WARNING: sys/select.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: sys/select.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: sys/select.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: sys/select.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: sys/select.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: sys/select.h: proceeding with the preprocessor's result" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for sys/select.h" >&5
-echo $ECHO_N "checking for sys/select.h... $ECHO_C" >&6
-if test "${ac_cv_header_sys_select_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_header_sys_select_h=$ac_header_preproc
-fi
-echo "$as_me:$LINENO: result: $ac_cv_header_sys_select_h" >&5
-echo "${ECHO_T}$ac_cv_header_sys_select_h" >&6
-
-fi
-if test $ac_cv_header_sys_select_h = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_SYS_SELECT_H 1
-_ACEOF
+ac_fn_c_check_header_mongrel "$LINENO" "sys/select.h" "ac_cv_header_sys_select_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_select_h" = x""yes; then :
+ $as_echo "#define HAVE_SYS_SELECT_H 1" >>confdefs.h
fi
-echo "$as_me:$LINENO: checking for select system call" >&5
-echo $ECHO_N "checking for select system call... $ECHO_C" >&6
-if test "${tecla_cv_select+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for select system call" >&5
+$as_echo_n "checking for select system call... " >&6; }
+if test "${tecla_cv_select+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/time.h>
@@ -3972,57 +3965,36 @@ main ()
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+if ac_fn_c_try_link "$LINENO"; then :
tecla_cv_select=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-tecla_cv_select=no
+ tecla_cv_select=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:$LINENO: result: $tecla_cv_select" >&5
-echo "${ECHO_T}$tecla_cv_select" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tecla_cv_select" >&5
+$as_echo "$tecla_cv_select" >&6; }
if test $tecla_cv_select = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_SELECT 1
-_ACEOF
+ $as_echo "#define HAVE_SELECT 1" >>confdefs.h
fi
-echo "$as_me:$LINENO: checking for SysV pseudo-terminals" >&5
-echo $ECHO_N "checking for SysV pseudo-terminals... $ECHO_C" >&6
-if test "${tecla_cv_sysv_pty+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SysV pseudo-terminals" >&5
+$as_echo_n "checking for SysV pseudo-terminals... " >&6; }
+if test "${tecla_cv_sysv_pty+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdlib.h>
#include <unistd.h>
-#include <stropts.h>
int
main ()
@@ -4031,43 +4003,74 @@ main ()
char *name = ptsname(0);
int i1 = grantpt(0);
int i2 = unlockpt(0);
- int i3 = ioctl(0, I_PUSH, "ptem");
return 0;
;
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+if ac_fn_c_try_link "$LINENO"; then :
tecla_cv_sysv_pty=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-tecla_cv_sysv_pty=no
+ tecla_cv_sysv_pty=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:$LINENO: result: $tecla_cv_sysv_pty" >&5
-echo "${ECHO_T}$tecla_cv_sysv_pty" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tecla_cv_sysv_pty" >&5
+$as_echo "$tecla_cv_sysv_pty" >&6; }
if test $tecla_cv_sysv_pty = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_SYSV_PTY 1
+ $as_echo "#define HAVE_SYSV_PTY 1" >>confdefs.h
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SysV streams pseudo-terminals" >&5
+$as_echo_n "checking for SysV streams pseudo-terminals... " >&6; }
+if test "${tecla_cv_sysv_ptem+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <stropts.h>
+
+int
+main ()
+{
+
+ char *name = ptsname(0);
+ int i1 = grantpt(0);
+ int i2 = unlockpt(0);
+ int i3 = ioctl(0, I_PUSH, "ptem");
+ int i4 = ioctl(fd, I_PUSH, "ldterm");
+ return 0;
+
+ ;
+ return 0;
+}
_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ tecla_cv_sysv_ptem=yes
+else
+ tecla_cv_sysv_ptem=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tecla_cv_sysv_ptem" >&5
+$as_echo "$tecla_cv_sysv_ptem" >&6; }
+
+
+if test $tecla_cv_sysv_ptem = yes; then
+ $as_echo "#define HAVE_SYSV_PTEM 1" >>confdefs.h
fi
@@ -4123,32 +4126,26 @@ FILE_MANEXT="5"
-# Check whether --with-file-actions or --without-file-actions was given.
-if test "${with_file_actions+set}" = set; then
- withval="$with_file_actions"
- cat >>confdefs.h <<\_ACEOF
-#define HIDE_FILE_SYSTEM 1
-_ACEOF
+# Check whether --with-file-actions was given.
+if test "${with_file_actions+set}" = set; then :
+ withval=$with_file_actions; $as_echo "#define HIDE_FILE_SYSTEM 1" >>confdefs.h
-fi;
+fi
-# Check whether --with-file-system or --without-file-system was given.
-if test "${with_file_system+set}" = set; then
- withval="$with_file_system"
- cat >>confdefs.h <<\_ACEOF
-#define WITHOUT_FILE_SYSTEM 1
-_ACEOF
-fi;
+# Check whether --with-file-system was given.
+if test "${with_file_system+set}" = set; then :
+ withval=$with_file_system; $as_echo "#define WITHOUT_FILE_SYSTEM 1" >>confdefs.h
+
+fi
+
case $target in
*solaris*)
- cat >>confdefs.h <<\_ACEOF
-#define __EXTENSIONS__ 1
-_ACEOF
+ $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h
SHARED_EXT=".so.${MAJOR_VER}"
SHARED_ALT=".so"
@@ -4177,10 +4174,10 @@ _ACEOF
SHARED_ALT=".so .so.${MAJOR_VER}"
- echo "$as_me:$LINENO: checking for --version-script in GNU ld" >&5
-echo $ECHO_N "checking for --version-script in GNU ld... $ECHO_C" >&6
-if test "${tecla_cv_gnu_ld_script+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --version-script in GNU ld" >&5
+$as_echo_n "checking for --version-script in GNU ld... " >&6; }
+if test "${tecla_cv_gnu_ld_script+set}" = set; then :
+ $as_echo_n "(cached) " >&6
else
if (echo 'void dummy(void) {return;}' > dummy.c; $CC -c -fpic dummy.c; \
@@ -4192,8 +4189,8 @@ else
rm -f dummy.c dummy.o dummy.so
fi
-echo "$as_me:$LINENO: result: $tecla_cv_gnu_ld_script" >&5
-echo "${ECHO_T}$tecla_cv_gnu_ld_script" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tecla_cv_gnu_ld_script" >&5
+$as_echo "$tecla_cv_gnu_ld_script" >&6; }
if test $tecla_cv_gnu_ld_script = yes; then
VERSION_OPT='--version-script=$$(srcdir)/libtecla.map'
else
@@ -4223,9 +4220,7 @@ echo "${ECHO_T}$tecla_cv_gnu_ld_script" >&6
SHARED_CFLAGS=""
;;
*dec-osf*)
- cat >>confdefs.h <<\_ACEOF
-#define _OSF_SOURCE 1
-_ACEOF
+ $as_echo "#define _OSF_SOURCE 1" >>confdefs.h
;;
*freebsd*)
@@ -4271,13 +4266,13 @@ fi
-# Check whether --with-man-pages or --without-man-pages was given.
-if test "${with_man_pages+set}" = set; then
- withval="$with_man_pages"
- MAKE_MAN_PAGES="$withval"
+# Check whether --with-man-pages was given.
+if test "${with_man_pages+set}" = set; then :
+ withval=$with_man_pages; MAKE_MAN_PAGES="$withval"
else
MAKE_MAN_PAGES="yes"
-fi;
+fi
+
OUTPUT_FILES="Makefile"
@@ -4291,7 +4286,8 @@ if test "$MAKE_MAN_PAGES"_ = "yes"_; then
fi
- ac_config_files="$ac_config_files $OUTPUT_FILES"
+ac_config_files="$ac_config_files $OUTPUT_FILES"
+
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
@@ -4310,104 +4306,115 @@ _ACEOF
# The following way of writing the cache mishandles newlines in values,
# but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
+# So, we kill variables containing newlines.
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
-{
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+
(set) 2>&1 |
- case `(ac_space=' '; set | grep ac_space) 2>&1` in
- *ac_space=\ *)
- # `set' does not quote correctly, so add quotes (double-quote
- # substitution turns \\\\ into \\, and sed turns \\ into \).
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes: double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \.
sed -n \
- "s/'/'\\\\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
- ;;
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
*)
# `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n \
- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
;;
- esac;
-} |
+ esac |
+ sort
+) |
sed '
+ /^ac_cv_env_/b end
t clear
- : clear
+ :clear
s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
t end
- /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
- : end' >>confcache
-if diff $cache_file confcache >/dev/null 2>&1; then :; else
- if test -w $cache_file; then
- test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ test "x$cache_file" != "x/dev/null" &&
+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
cat confcache >$cache_file
else
- echo "not updating unwritable cache $cache_file"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
fi
fi
rm -f confcache
test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=/{
-s/:*\$(srcdir):*/:/;
-s/:*\${srcdir}:*/:/;
-s/:*@srcdir@:*/:/;
-s/^\([^=]*=[ ]*\):*/\1/;
-s/:*$//;
-s/^[^=]*=[ ]*$//;
-}'
-fi
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
# Transform confdefs.h into DEFS.
# Protect against shell expansion while executing Makefile rules.
# Protect against Makefile macro expansion.
#
# If the first sed substitution is executed (which looks for macros that
-# take arguments), then we branch to the quote section. Otherwise,
+# take arguments), then branch to the quote section. Otherwise,
# look for a macro that doesn't take arguments.
-cat >confdef2opt.sed <<\_ACEOF
+ac_script='
+:mline
+/\\$/{
+ N
+ s,\\\n,,
+ b mline
+}
t clear
-: clear
-s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g
+:clear
+s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g
t quote
-s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g
+s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g
t quote
-d
-: quote
-s,[ `~#$^&*(){}\\|;'"<>?],\\&,g
-s,\[,\\&,g
-s,\],\\&,g
-s,\$,$$,g
-p
-_ACEOF
-# We use echo to avoid assuming a particular line-breaking character.
-# The extra dot is to prevent the shell from consuming trailing
-# line-breaks from the sub-command output. A line-break within
-# single-quotes doesn't work because, if this script is created in a
-# platform that uses two characters for line-breaks (e.g., DOS), tr
-# would break.
-ac_LF_and_DOT=`echo; echo .`
-DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
-rm -f confdef2opt.sed
+b any
+:quote
+s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g
+s/\[/\\&/g
+s/\]/\\&/g
+s/\$/$$/g
+H
+:any
+${
+ g
+ s/^\n//
+ s/\n/ /g
+ p
+}
+'
+DEFS=`sed -n "$ac_script" confdefs.h`
ac_libobjs=
ac_ltlibobjs=
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
# 1. Remove the extension, and $U if already installed.
- ac_i=`echo "$ac_i" |
- sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
- # 2. Add them.
- ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
- ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
done
LIBOBJS=$ac_libobjs
@@ -4416,11 +4423,13 @@ LTLIBOBJS=$ac_ltlibobjs
: ${CONFIG_STATUS=./config.status}
+ac_write_fail=0
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
-echo "$as_me: creating $CONFIG_STATUS" >&6;}
-cat >$CONFIG_STATUS <<_ACEOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
#! $SHELL
# Generated by $as_me.
# Run this file to recreate the current configuration.
@@ -4430,80 +4439,252 @@ cat >$CONFIG_STATUS <<_ACEOF
debug=false
ac_cs_recheck=false
ac_cs_silent=false
-SHELL=\${CONFIG_SHELL-$SHELL}
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-## --------------------- ##
-## M4sh Initialization. ##
-## --------------------- ##
-
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
emulate sh
NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
- set -o posix
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
fi
-# Support unset when possible.
-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
fi
-# Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
PS1='$ '
PS2='> '
PS4='+ '
# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- $as_unset $as_var
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error ERROR [LINENO LOG_FD]
+# ---------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with status $?, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$?; test $as_status -eq 0 && as_status=1
+ if test "$3"; then
+ as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
fi
-done
+ $as_echo "$as_me: error: $1" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
else
as_expr=false
fi
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
as_basename=basename
else
as_basename=false
fi
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
-# Name of the executable.
-as_me=`$as_basename "$0" ||
+as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)$' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
- /^X\/\(\/\/\)$/{ s//\1/; q; }
- /^X\/\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
-
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
-# PATH needs CR, and LINENO needs CR and PATH.
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
@@ -4511,180 +4692,145 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-
-
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" || {
- # Find who we are. Look in the path if we contain no path at all
- # relative or not.
- case $0 in
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-
- ;;
- esac
- # We did not find ourselves, most probably we were run as `sh COMMAND'
- # in which case we are not to be found in the path.
- if test "x$as_myself" = x; then
- as_myself=$0
- fi
- if test ! -f "$as_myself"; then
- { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
-echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
- { (exit 1); exit 1; }; }
- fi
- case $CONFIG_SHELL in
- '')
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for as_base in sh bash ksh sh5; do
- case $as_dir in
- /*)
- if ("$as_dir/$as_base" -c '
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
- $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
- $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
- CONFIG_SHELL=$as_dir/$as_base
- export CONFIG_SHELL
- exec "$CONFIG_SHELL" "$0" ${1+"$@"}
- fi;;
- esac
- done
-done
-;;
- esac
-
- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
- # uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line before each line; the second 'sed' does the real
- # work. The second script uses 'N' to pair each line-number line
- # with the numbered line, and appends trailing '-' during
- # substitution so that $LINENO is not a special case at line end.
- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
- sed '=' <$as_myself |
- sed '
- N
- s,$,-,
- : loop
- s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
- t loop
- s,-$,,
- s,^['$as_cr_digits']*\n,,
- ' >$as_me.lineno &&
- chmod +x $as_me.lineno ||
- { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
-echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
- { (exit 1); exit 1; }; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensible to this).
- . ./$as_me.lineno
- # Exit status is that of the last command.
- exit
-}
-
-
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
- *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T=' ' ;;
- *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
- *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
esac
-if expr a : '\(a\)' >/dev/null 2>&1; then
- as_expr=expr
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
else
- as_expr=false
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- # We could just check for DJGPP; but this test a) works b) is more generic
- # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
- if test -f conf$$.exe; then
- # Don't use ln at all; we don't have any links
- as_ln_s='cp -p'
- else
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -p'
fi
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
else
as_ln_s='cp -p'
fi
-rm -f conf$$ conf$$.exe conf$$.file
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
+
+} # as_fn_mkdir_p
if mkdir -p . 2>/dev/null; then
- as_mkdir_p=:
+ as_mkdir_p='mkdir -p "$as_dir"'
else
+ test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
-as_executable_p="test -f"
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in #(
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
# Sed expression to map a string onto a valid variable name.
-as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
-
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" $as_nl"
-
-# CDPATH.
-$as_unset CDPATH
exec 6>&1
-
-# Open the log real soon, to keep \$[0] and so on meaningful, and to
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling. Logging --version etc. is OK.
-exec 5>>config.log
-{
- echo
- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
-} >&5
-cat >&5 <<_CSEOF
-
+# values after options handling.
+ac_log="
This file was extended by $as_me, which was
-generated by GNU Autoconf 2.57. Invocation command line was
+generated by GNU Autoconf 2.65. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -4692,125 +4838,111 @@ generated by GNU Autoconf 2.57. Invocation command line was
CONFIG_COMMANDS = $CONFIG_COMMANDS
$ $0 $@
-_CSEOF
-echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
-echo >&5
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
_ACEOF
-# Files that config.status was made for.
-if test -n "$ac_config_files"; then
- echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
-fi
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
-if test -n "$ac_config_headers"; then
- echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
-fi
-if test -n "$ac_config_links"; then
- echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
-fi
-if test -n "$ac_config_commands"; then
- echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
-fi
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
-cat >>$CONFIG_STATUS <<\_ACEOF
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
ac_cs_usage="\
-\`$as_me' instantiates files from templates according to the
-current configuration.
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration. Unless the files
+and actions are specified as TAGs, all are instantiated by default.
-Usage: $0 [OPTIONS] [FILE]...
+Usage: $0 [OPTION]... [TAG]...
-h, --help print this help, then exit
- -V, --version print version number, then exit
- -q, --quiet do not print progress messages
+ -V, --version print version number and configuration settings, then exit
+ --config print configuration, then exit
+ -q, --quiet, --silent
+ do not print progress messages
-d, --debug don't remove temporary files
--recheck update $as_me by reconfiguring in the same conditions
- --file=FILE[:TEMPLATE]
+ --file=FILE[:TEMPLATE]
instantiate the configuration file FILE
Configuration files:
$config_files
-Report bugs to <bug-autoconf at gnu.org>."
-_ACEOF
+Report bugs to the package provider."
-cat >>$CONFIG_STATUS <<_ACEOF
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
config.status
-configured by $0, generated by GNU Autoconf 2.57,
- with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+configured by $0, generated by GNU Autoconf 2.65,
+ with options \\"\$ac_cs_config\\"
-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
+Copyright (C) 2009 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
-srcdir=$srcdir
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-# If no file are specified by the user, then we need to provide default
-# value. By we need to know if files were specified by the user.
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
ac_need_defaults=:
while test $# != 0
do
case $1 in
--*=*)
- ac_option=`expr "x$1" : 'x\([^=]*\)='`
- ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
ac_shift=:
;;
- -*)
+ *)
ac_option=$1
ac_optarg=$2
ac_shift=shift
;;
- *) # This is not an option, so the user has probably given explicit
- # arguments.
- ac_option=$1
- ac_need_defaults=false;;
esac
case $ac_option in
# Handling of the options.
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
ac_cs_recheck=: ;;
- --version | --vers* | -V )
- echo "$ac_cs_version"; exit 0 ;;
- --he | --h)
- # Conflict between --help and --header
- { { echo "$as_me:$LINENO: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&2;}
- { (exit 1); exit 1; }; };;
- --help | --hel | -h )
- echo "$ac_cs_usage"; exit 0 ;;
- --debug | --d* | -d )
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ $as_echo "$ac_cs_version"; exit ;;
+ --config | --confi | --conf | --con | --co | --c )
+ $as_echo "$ac_cs_config"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
debug=: ;;
--file | --fil | --fi | --f )
$ac_shift
- CONFIG_FILES="$CONFIG_FILES $ac_optarg"
- ac_need_defaults=false;;
- --header | --heade | --head | --hea )
- $ac_shift
- CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ as_fn_append CONFIG_FILES " '$ac_optarg'"
ac_need_defaults=false;;
+ --he | --h | --help | --hel | -h )
+ $as_echo "$ac_cs_usage"; exit ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil | --si | --s)
ac_cs_silent=: ;;
# This is an error.
- -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2;}
- { (exit 1); exit 1; }; } ;;
+ -*) as_fn_error "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
- *) ac_config_targets="$ac_config_targets $1" ;;
+ *) as_fn_append ac_config_targets " $1"
+ ac_need_defaults=false ;;
esac
shift
@@ -4824,30 +4956,44 @@ if $ac_cs_silent; then
fi
_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
if \$ac_cs_recheck; then
- echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
- exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ shift
+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ CONFIG_SHELL='$SHELL'
+ export CONFIG_SHELL
+ exec "\$@"
fi
_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ $as_echo "$ac_log"
+} >&5
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-
-
-cat >>$CONFIG_STATUS <<\_ACEOF
+# Handling of arguments.
for ac_config_target in $ac_config_targets
do
- case "$ac_config_target" in
- # Handling of arguments.
- "$OUTPUT_FILES" ) CONFIG_FILES="$CONFIG_FILES $OUTPUT_FILES" ;;
- *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
-echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
- { (exit 1); exit 1; }; };;
+ case $ac_config_target in
+ "$OUTPUT_FILES") CONFIG_FILES="$CONFIG_FILES $OUTPUT_FILES" ;;
+
+ *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
done
+
# If the user did not use the arguments to specify the items to instantiate,
# then the envvar interface is used. Set only those that are not.
# We use the long form for the default assignment because of an extremely
@@ -4857,333 +5003,403 @@ if $ac_need_defaults; then
fi
# Have a temporary directory for convenience. Make it in the build tree
-# simply because there is no reason to put it here, and in addition,
+# simply because there is no reason against having it here, and in addition,
# creating and moving files from /tmp can sometimes cause problems.
-# Create a temporary directory, and hook for its removal unless debugging.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
$debug ||
{
- trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
- trap '{ (exit 1); exit 1; }' 1 2 13 15
+ tmp=
+ trap 'exit_status=$?
+ { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
+ trap 'as_fn_exit 1' 1 2 13 15
}
-
# Create a (secure) tmp directory for tmp files.
{
- tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
test -n "$tmp" && test -d "$tmp"
} ||
{
- tmp=./confstat$$-$RANDOM
- (umask 077 && mkdir $tmp)
-} ||
-{
- echo "$me: cannot create a temporary directory in ." >&2
- { (exit 1); exit 1; }
-}
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+ eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+ ac_cs_awk_cr='\r'
+else
+ ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-#
-# CONFIG_FILES section.
-#
+{
+ echo "cat >conf$$subs.awk <<_ACEOF" &&
+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+ echo "_ACEOF"
+} >conf$$subs.sh ||
+ as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ . ./conf$$subs.sh ||
+ as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+
+ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+ if test $ac_delim_n = $ac_delim_num; then
+ break
+ elif $ac_last_try; then
+ as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+ N
+ s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
-# No need to generate the scripts if there are no CONFIG_FILES.
-# This happens for instance when ./config.status config.h
-if test -n "\$CONFIG_FILES"; then
- # Protect against being on the right side of a sed subst in config.status.
- sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
- s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
-s, at SHELL@,$SHELL,;t t
-s, at PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
-s, at PACKAGE_NAME@,$PACKAGE_NAME,;t t
-s, at PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
-s, at PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
-s, at PACKAGE_STRING@,$PACKAGE_STRING,;t t
-s, at PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
-s, at exec_prefix@,$exec_prefix,;t t
-s, at prefix@,$prefix,;t t
-s, at program_transform_name@,$program_transform_name,;t t
-s, at bindir@,$bindir,;t t
-s, at sbindir@,$sbindir,;t t
-s, at libexecdir@,$libexecdir,;t t
-s, at datadir@,$datadir,;t t
-s, at sysconfdir@,$sysconfdir,;t t
-s, at sharedstatedir@,$sharedstatedir,;t t
-s, at localstatedir@,$localstatedir,;t t
-s, at libdir@,$libdir,;t t
-s, at includedir@,$includedir,;t t
-s, at oldincludedir@,$oldincludedir,;t t
-s, at infodir@,$infodir,;t t
-s, at mandir@,$mandir,;t t
-s, at build_alias@,$build_alias,;t t
-s, at host_alias@,$host_alias,;t t
-s, at target_alias@,$target_alias,;t t
-s, at DEFS@,$DEFS,;t t
-s, at ECHO_C@,$ECHO_C,;t t
-s, at ECHO_N@,$ECHO_N,;t t
-s, at ECHO_T@,$ECHO_T,;t t
-s, at LIBS@,$LIBS,;t t
-s, at MAJOR_VER@,$MAJOR_VER,;t t
-s, at MINOR_VER@,$MINOR_VER,;t t
-s, at MICRO_VER@,$MICRO_VER,;t t
-s, at CC@,$CC,;t t
-s, at CFLAGS@,$CFLAGS,;t t
-s, at LDFLAGS@,$LDFLAGS,;t t
-s, at CPPFLAGS@,$CPPFLAGS,;t t
-s, at ac_ct_CC@,$ac_ct_CC,;t t
-s, at EXEEXT@,$EXEEXT,;t t
-s, at OBJEXT@,$OBJEXT,;t t
-s, at SET_MAKE@,$SET_MAKE,;t t
-s, at LN_S@,$LN_S,;t t
-s, at AWK@,$AWK,;t t
-s, at RANLIB@,$RANLIB,;t t
-s, at ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
-s, at LD@,$LD,;t t
-s, at ac_ct_LD@,$ac_ct_LD,;t t
-s, at build@,$build,;t t
-s, at build_cpu@,$build_cpu,;t t
-s, at build_vendor@,$build_vendor,;t t
-s, at build_os@,$build_os,;t t
-s, at host@,$host,;t t
-s, at host_cpu@,$host_cpu,;t t
-s, at host_vendor@,$host_vendor,;t t
-s, at host_os@,$host_os,;t t
-s, at target@,$target,;t t
-s, at target_cpu@,$target_cpu,;t t
-s, at target_vendor@,$target_vendor,;t t
-s, at target_os@,$target_os,;t t
-s, at CPP@,$CPP,;t t
-s, at EGREP@,$EGREP,;t t
-s, at TARGETS@,$TARGETS,;t t
-s, at SHARED_EXT@,$SHARED_EXT,;t t
-s, at SHARED_ALT@,$SHARED_ALT,;t t
-s, at SHARED_CFLAGS@,$SHARED_CFLAGS,;t t
-s, at LINK_SHARED@,$LINK_SHARED,;t t
-s, at DEFS_R@,$DEFS_R,;t t
-s, at LIBR_MANDIR@,$LIBR_MANDIR,;t t
-s, at LIBR_MANEXT@,$LIBR_MANEXT,;t t
-s, at FUNC_MANDIR@,$FUNC_MANDIR,;t t
-s, at FUNC_MANEXT@,$FUNC_MANEXT,;t t
-s, at PROG_MANDIR@,$PROG_MANDIR,;t t
-s, at PROG_MANEXT@,$PROG_MANEXT,;t t
-s, at MISC_MANDIR@,$MISC_MANDIR,;t t
-s, at MISC_MANEXT@,$MISC_MANEXT,;t t
-s, at FILE_MANDIR@,$FILE_MANDIR,;t t
-s, at FILE_MANEXT@,$FILE_MANEXT,;t t
-s, at TARGET_LIBS@,$TARGET_LIBS,;t t
-s, at MAKE_MAN_PAGES@,$MAKE_MAN_PAGES,;t t
-s, at LIBOBJS@,$LIBOBJS,;t t
-s, at LTLIBOBJS@,$LTLIBOBJS,;t t
-CEOF
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
+
+ print line
+}
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+ cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+ || as_fn_error "could not setup config files machinery" "$LINENO" 5
_ACEOF
- cat >>$CONFIG_STATUS <<\_ACEOF
- # Split the substitutions into bite-sized pieces for seds with
- # small command number limits, like on Digital OSF/1 and HP-UX.
- ac_max_sed_lines=48
- ac_sed_frag=1 # Number of current file.
- ac_beg=1 # First line for current file.
- ac_end=$ac_max_sed_lines # Line after last line for current file.
- ac_more_lines=:
- ac_sed_cmds=
- while $ac_more_lines; do
- if test $ac_beg -gt 1; then
- sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
- else
- sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
- fi
- if test ! -s $tmp/subs.frag; then
- ac_more_lines=false
- else
- # The purpose of the label and of the branching condition is to
- # speed up the sed processing (if there are no `@' at all, there
- # is no need to browse any of the substitutions).
- # These are the two extra sed commands mentioned above.
- (echo ':t
- /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
- else
- ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
- fi
- ac_sed_frag=`expr $ac_sed_frag + 1`
- ac_beg=$ac_end
- ac_end=`expr $ac_end + $ac_max_sed_lines`
- fi
- done
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds=cat
- fi
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[ ]*\):*/\1/
+s/:*$//
+s/^[^=]*=[ ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
fi # test -n "$CONFIG_FILES"
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case $ac_file in
- - | *:- | *:-:* ) # input from stdin
- cat >$tmp/stdin
- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
- *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
- * ) ac_file_in=$ac_file.in ;;
+
+eval set X " :F $CONFIG_FILES "
+shift
+for ac_tag
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
- # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
- ac_dir=`(dirname "$ac_file") 2>/dev/null ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- { if $as_mkdir_p; then
- mkdir -p "$ac_dir"
- else
- as_dir="$ac_dir"
- as_dirs=
- while test ! -d "$as_dir"; do
- as_dirs="$as_dir $as_dirs"
- as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+ esac
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ as_fn_append ac_file_inputs " '$ac_f'"
done
- test ! -n "$as_dirs" || mkdir $as_dirs
- fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
- { (exit 1); exit 1; }; }; }
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input='Generated from '`
+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+ fi
+ # Neutralize special characters interpreted by sed in replacement strings.
+ case $configure_input in #(
+ *\&* | *\|* | *\\* )
+ ac_sed_conf_input=`$as_echo "$configure_input" |
+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
+ *) ac_sed_conf_input=$configure_input;;
+ esac
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$tmp/stdin" \
+ || as_fn_error "could not create $ac_file" "$LINENO" 5 ;;
+ esac
+ ;;
+ esac
+
+ ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir="$ac_dir"; as_fn_mkdir_p
ac_builddir=.
-if test "$ac_dir" != .; then
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A "../" for each directory in $ac_dir_suffix.
- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
- ac_dir_suffix= ac_top_builddir=
-fi
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
case $srcdir in
- .) # No --srcdir option. We are building in place.
+ .) # We are building in place.
ac_srcdir=.
- if test -z "$ac_top_builddir"; then
- ac_top_srcdir=.
- else
- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
- fi ;;
- [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir ;;
- *) # Relative path.
- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_builddir$srcdir ;;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
esac
-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
-# absolute.
-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
- if test x"$ac_file" != x-; then
- { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
- rm -f "$ac_file"
- fi
- # Let's still pretend it is `configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
- if test x"$ac_file" = x-; then
- configure_input=
- else
- configure_input="$ac_file. "
- fi
- configure_input=$configure_input"Generated from `echo $ac_file_in |
- sed 's,.*/,,'` by configure."
-
- # First look for the input files in the build tree, otherwise in the
- # src tree.
- ac_file_inputs=`IFS=:
- for f in $ac_file_in; do
- case $f in
- -) echo $tmp/stdin ;;
- [\\/$]*)
- # Absolute (can't be DOS-style, as IFS=:)
- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
- { (exit 1); exit 1; }; }
- echo $f;;
- *) # Relative
- if test -f "$f"; then
- # Build tree
- echo $f
- elif test -f "$srcdir/$f"; then
- # Source tree
- echo $srcdir/$f
- else
- # /dev/null tree
- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
- { (exit 1); exit 1; }; }
- fi;;
- esac
- done` || { (exit 1); exit 1; }
_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
- sed "$ac_vpsub
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+ s&@infodir@&$infodir&g
+ s&@localedir@&$localedir&g
+ s&@mandir@&$mandir&g
+ s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
$extrasub
_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
:t
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s, at configure_input@,$configure_input,;t t
-s, at srcdir@,$ac_srcdir,;t t
-s, at abs_srcdir@,$ac_abs_srcdir,;t t
-s, at top_srcdir@,$ac_top_srcdir,;t t
-s, at abs_top_srcdir@,$ac_abs_top_srcdir,;t t
-s, at builddir@,$ac_builddir,;t t
-s, at abs_builddir@,$ac_abs_builddir,;t t
-s, at top_builddir@,$ac_top_builddir,;t t
-s, at abs_top_builddir@,$ac_abs_top_builddir,;t t
-" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
- rm -f $tmp/stdin
- if test x"$ac_file" != x-; then
- mv $tmp/out $ac_file
- else
- cat $tmp/out
- rm -f $tmp/out
- fi
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+ || as_fn_error "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined." >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined." >&2;}
+
+ rm -f "$tmp/stdin"
+ case $ac_file in
+ -) cat "$tmp/out" && rm -f "$tmp/out";;
+ *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+ esac \
+ || as_fn_error "could not create $ac_file" "$LINENO" 5
+ ;;
-done
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-{ (exit 0); exit 0; }
+ esac
+
+done # for ac_tag
+
+
+as_fn_exit 0
_ACEOF
-chmod +x $CONFIG_STATUS
ac_clean_files=$ac_clean_files_save
+test $ac_write_fail = 0 ||
+ as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
# configure is writing to config.log, and then calls config.status.
# config.status does its own redirection, appending to config.log.
@@ -5203,6 +5419,10 @@ if test "$no_create" != yes; then
exec 5>>config.log
# Use ||, not &&, to avoid exiting from the if with $? = 1, which
# would make configure fail if this is the last instruction.
- $ac_cs_success || { (exit 1); exit 1; }
+ $ac_cs_success || as_fn_exit $?
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
diff --git a/configure.in b/configure.in
index 78e7170..55dc878 100644
--- a/configure.in
+++ b/configure.in
@@ -43,7 +43,7 @@ dnl incremented. The micro version number must be a small integer
dnl number.
AC_SUBST(MICRO_VER)
-MICRO_VER="1"
+MICRO_VER="2"
dnl The AC_PROG_CC line looks for a C compiler, and if gcc is chosen,
dnl sets the $GCC shell variable to "yes". Make sure that CFLAGS is
@@ -258,12 +258,10 @@ AC_CACHE_CHECK(for SysV pseudo-terminals, tecla_cv_sysv_pty, [
AC_TRY_LINK([
#include <stdlib.h>
#include <unistd.h>
-#include <stropts.h>
], [
char *name = ptsname(0);
int i1 = grantpt(0);
int i2 = unlockpt(0);
- int i3 = ioctl(0, I_PUSH, "ptem");
return 0;
], tecla_cv_sysv_pty=yes, tecla_cv_sysv_pty=no)
])
@@ -275,6 +273,30 @@ if test $tecla_cv_sysv_pty = yes; then
AC_DEFINE(HAVE_SYSV_PTY)
fi
+dnl Check if this system uses the system-V streams pseudo terminal interface.
+
+AC_CACHE_CHECK(for SysV streams pseudo-terminals, tecla_cv_sysv_ptem, [
+ AC_TRY_LINK([
+#include <stdlib.h>
+#include <unistd.h>
+#include <stropts.h>
+ ], [
+ char *name = ptsname(0);
+ int i1 = grantpt(0);
+ int i2 = unlockpt(0);
+ int i3 = ioctl(0, I_PUSH, "ptem");
+ int i4 = ioctl(fd, I_PUSH, "ldterm");
+ return 0;
+ ], tecla_cv_sysv_ptem=yes, tecla_cv_sysv_ptem=no)
+])
+
+dnl If the system-V pseudo-terminal interface is available, arrange
+dnl for HAVE_SYSV_PTEM to be defined by CFLAGS.
+
+if test $tecla_cv_sysv_ptem = yes; then
+ AC_DEFINE(HAVE_SYSV_PTEM)
+fi
+
dnl The following variable contains the extension to append to
dnl "libtecla" and "libtecla_r" when creating shared libraries on the
dnl target platform. This is system dependent and is ignored if
diff --git a/cplfile.c b/cplfile.c
index eee3166..35d15eb 100644
--- a/cplfile.c
+++ b/cplfile.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd.
+ * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd.
*
* All rights reserved.
*
diff --git a/cplfile.h b/cplfile.h
index a7ca9fb..669c158 100644
--- a/cplfile.h
+++ b/cplfile.h
@@ -2,7 +2,7 @@
#define cplfile_h
/*
- * Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd.
+ * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd.
*
* All rights reserved.
*
diff --git a/cplmatch.c b/cplmatch.c
index ece93d3..0c83f6d 100644
--- a/cplmatch.c
+++ b/cplmatch.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd.
+ * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd.
*
* All rights reserved.
*
diff --git a/cplmatch.h b/cplmatch.h
index cb50006..0976265 100644
--- a/cplmatch.h
+++ b/cplmatch.h
@@ -2,7 +2,7 @@
#define cplmatch_h
/*
- * Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd.
+ * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd.
*
* All rights reserved.
*
diff --git a/demo.c b/demo.c
index d29b11a..e115472 100644
--- a/demo.c
+++ b/demo.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd
+ * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd
*
* All rights reserved.
*
diff --git a/demo2.c b/demo2.c
index 63a9a0c..8bfd739 100644
--- a/demo2.c
+++ b/demo2.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd.
+ * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd.
*
* All rights reserved.
*
diff --git a/demo3.c b/demo3.c
index aa204d0..7dff98a 100644
--- a/demo3.c
+++ b/demo3.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2003, 2004 by Martin C. Shepherd
+ * Copyright (c) 2002, 2003, 2004, 2012 by Martin C. Shepherd
*
* All rights reserved.
*
diff --git a/direader.c b/direader.c
index 68db93f..ec993db 100644
--- a/direader.c
+++ b/direader.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd.
+ * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd.
*
* All rights reserved.
*
diff --git a/direader.h b/direader.h
index c529231..b7dbcbb 100644
--- a/direader.h
+++ b/direader.h
@@ -2,7 +2,7 @@
#define dirreader_h
/*
- * Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd.
+ * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd.
*
* All rights reserved.
*
diff --git a/enhance.c b/enhance.c
index bd5af1f..c6dccbb 100644
--- a/enhance.c
+++ b/enhance.c
@@ -21,12 +21,15 @@
#include <dirent.h>
#if HAVE_SYSV_PTY
-#include <stropts.h> /* System-V stream I/O */
char *ptsname(int fd);
int grantpt(int fd);
int unlockpt(int fd);
#endif
+#if HAVE_SYSV_PTEM
+#include <stropts.h> /* System-V stream I/O */
+#endif
+
#include "libtecla.h"
/*
@@ -50,7 +53,7 @@ int unlockpt(int fd);
* Specify the maximum suffix length for the control and slave device
* names.
*/
-#define PTY_MAX_SUFFIX 10
+#define PTY_MAX_SUFFIX 20
/*
* Set the maximum length of the master and slave terminal device filenames,
@@ -348,7 +351,7 @@ static int pty_open_slave(const char *prog, char *slave_name)
* Solaris, which pushes these automatically when a slave is opened,
* this is redundant, so ignore errors when pushing the modules.
*/
-#if HAVE_SYSV_PTY
+#if HAVE_SYSV_PTEM
(void) ioctl(fd, I_PUSH, "ptem");
(void) ioctl(fd, I_PUSH, "ldterm");
/*
diff --git a/errmsg.c b/errmsg.c
index 6abce9b..95748f5 100644
--- a/errmsg.c
+++ b/errmsg.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd.
+ * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd.
*
* All rights reserved.
*
diff --git a/errmsg.h b/errmsg.h
index 565d7cd..091bfdd 100644
--- a/errmsg.h
+++ b/errmsg.h
@@ -2,7 +2,7 @@
#define errmsg_h
/*
- * Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd.
+ * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd.
*
* All rights reserved.
*
diff --git a/expand.c b/expand.c
index b3d80e2..d22e069 100644
--- a/expand.c
+++ b/expand.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd.
+ * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd.
*
* All rights reserved.
*
diff --git a/expand.h b/expand.h
index 8c0bad8..ca05dc7 100644
--- a/expand.h
+++ b/expand.h
@@ -2,7 +2,7 @@
#define expand_h
/*
- * Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd.
+ * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd.
*
* All rights reserved.
*
diff --git a/freelist.c b/freelist.c
index 2a85ba1..d539639 100644
--- a/freelist.c
+++ b/freelist.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd.
+ * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd.
*
* All rights reserved.
*
diff --git a/freelist.h b/freelist.h
index 09d966f..6edd9fa 100644
--- a/freelist.h
+++ b/freelist.h
@@ -2,7 +2,7 @@
#define freelist_h
/*
- * Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd.
+ * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd.
*
* All rights reserved.
*
diff --git a/getline.c b/getline.c
index 324aadb..09da82e 100644
--- a/getline.c
+++ b/getline.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd.
+ * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd.
*
* All rights reserved.
*
@@ -9822,6 +9822,8 @@ static int gl_display_prompt(GetLine *gl)
switch(pptr[1]) {
/*
* Add or remove a text attribute from the new set of attributes.
+ * If you add or remove a directive from this list, be sure to update
+ * the equivalent list of directives in gl_displayed_prompt_width().
*/
case 'B': case 'U': case 'S': case 'P': case 'F': case 'V':
case 'b': case 'u': case 's': case 'p': case 'f': case 'v':
@@ -10038,7 +10040,8 @@ static int gl_displayed_prompt_width(GetLine *gl)
* Check for and skip attribute changing directives.
*/
switch(pptr[1]) {
- case 'B': case 'b': case 'U': case 'u': case 'S': case 's':
+ case 'B': case 'U': case 'S': case 'P': case 'F': case 'V':
+ case 'b': case 'u': case 's': case 'p': case 'f': case 'v':
pptr++;
continue;
/*
@@ -10424,8 +10427,10 @@ static int gl_present_line(GetLine *gl, const char *prompt,
/*
* Load the line into the buffer.
*/
- if(start_line != gl->line)
+ if(start_line != gl->line) {
+ gl->ntotal = 0;
gl_buffer_string(gl, start_line, start_len, 0);
+ };
/*
* Strip off any trailing newline and carriage return characters.
*/
diff --git a/getline.h b/getline.h
index 60a9c33..9dba35f 100644
--- a/getline.h
+++ b/getline.h
@@ -2,7 +2,7 @@
#define getline_h
/*
- * Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd.
+ * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd.
*
* All rights reserved.
*
diff --git a/hash.c b/hash.c
index acaaff6..e61c564 100644
--- a/hash.c
+++ b/hash.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd.
+ * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd.
*
* All rights reserved.
*
diff --git a/hash.h b/hash.h
index 6cee6a2..4cad68a 100644
--- a/hash.h
+++ b/hash.h
@@ -2,7 +2,7 @@
#define hash_h
/*
- * Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd.
+ * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd.
*
* All rights reserved.
*
diff --git a/history.c b/history.c
index cffa33e..f798ff8 100644
--- a/history.c
+++ b/history.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd.
+ * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd.
*
* All rights reserved.
*
diff --git a/history.h b/history.h
index d32ee8f..e0278cd 100644
--- a/history.h
+++ b/history.h
@@ -2,7 +2,7 @@
#define history_h
/*
- * Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd.
+ * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd.
*
* All rights reserved.
*
diff --git a/homedir.c b/homedir.c
index eb666c3..29257f8 100644
--- a/homedir.c
+++ b/homedir.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd.
+ * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd.
*
* All rights reserved.
*
diff --git a/homedir.h b/homedir.h
index 0ad3e94..096708d 100644
--- a/homedir.h
+++ b/homedir.h
@@ -2,7 +2,7 @@
#define homedir_h
/*
- * Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd.
+ * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd.
*
* All rights reserved.
*
diff --git a/html/changes.html b/html/changes.html
index 9be5251..7b0d488 100644
--- a/html/changes.html
+++ b/html/changes.html
@@ -4,6 +4,43 @@ In the following log, modification dates are listed using the European
convention in which the day comes before the month (ie. DD/MM/YYYY).
The most recent modifications are listed first.
+10/06/2012 mcs at astro.caltech.edu
+ enhance.c configure.in
+ I had incorrectly assumed that system-V pseudo-terminal
+ allocation and system-V streams terminals always went
+ together. However system-V pseudo terminal allocation is
+ now part of UNIX98, and this has been adopted into many BSD
+ style operating systems, without the use of system-V
+ streams. On such systems the lack of system-V streams IOCTL
+ opcodes prevented system-V pseudo-terminal allocation being
+ used. This was hidden under Linux until recently, because
+ it had a stropts.h file, which made it appear as though
+ Linux supported system-V streams terminals.
+
+ I have now created separate configuration tests and options
+ in the configure script for system-V terminal allocation
+ and system-V streams. On systems that only have the former,
+ the latter won't be used.
+
+16/05/2005 mcs at astro.caltech.edu
+ getline.c
+ When an initial input line was presented to gl_get_line()
+ for editing, the new input line was incorrectly appended to
+ the previous input line, instead of replacing it.
+
+10/01/2004 Derek Jones (documented here by mcs at astro.caltech.edu)
+ getline.c
+ Derek discovered that the function that computes the
+ width of the prompt, was not correctly skipping over 3 of
+ the 6 possible prompt-formatting directives. Thus, when
+ the %f,%p or %v prompt-formatting directives were used,
+ the width of the prompt was incorrectly calculated. The
+ fix was to copy the list of directives from
+ gl_display_prompt(). I have also added a comment to
+ gl_display_prompt(), to warn anybody who adds or removes
+ formatting directives there, to also do the same to
+ gl_displayed_prompt_width().
+
31/10/2004 mcs at astro.caltech.edu (problem reported by Godfrey van der Linden)
getline.c
The gl_event_handler() function had the endif of a
diff --git a/html/cpl_complete_word.html b/html/cpl_complete_word.html
index 0c976c0..dc6b6f3 100644
--- a/html/cpl_complete_word.html
+++ b/html/cpl_complete_word.html
@@ -1,382 +1,477 @@
-<head>
-<title>Manual Page</title>
-</head>
-<body>
-<pre>
-<a href="cpl_complete_word.html"><b>cpl_complete_word</b></a> <a href="cpl_complete_word.html"><b>cpl_complete_word</b></a>
+Content-type: text/html
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML><HEAD><TITLE>Man page of cpl_complete_word</TITLE>
+</HEAD><BODY>
+<H1>cpl_complete_word</H1>
+Section: C Library Functions (3)<BR><A HREF="#index">Index</A>
+<A HREF="index.html">Return to Main Contents</A><HR>
+<A NAME="lbAB"> </A>
+<H2>NAME</H2>
-</pre><h2>NAME</h2><pre>
- cpl_complete_word, cfc_file_start, cfc_literal_escapes,
- cfc_set_check_fn, cpl_add_completion, cpl_file_completions,
- cpl_last_error, cpl_list_completions, cpl_recall_matches,
- cpl_record_error, del_CplFileConf, del_WordCompletion, new_CplFileConf,
- new_WordCompletion - lookup possible completions for a word
+cpl_complete_word, cfc_file_start, cfc_literal_escapes, cfc_set_check_fn, cpl_add_completion, cpl_file_completions, cpl_last_error, cpl_list_completions, cpl_recall_matches, cpl_record_error, del_CplFileConf, del_WordCompletion, new_CplFileConf, new_WordCompletion - lookup possible completions for a word
+<A NAME="lbAC"> </A>
+<H2>SYNOPSIS</H2>
-</pre><h2>SYNOPSIS</h2><pre>
- #include <stdio.h>
- #include <libtecla.h>
+<PRE>
+#include <<A HREF="file:///usr/include/stdio.h">stdio.h</A>>
+#include <<A HREF="file:///usr/include/libtecla.h">libtecla.h</A>>
- WordCompletion *new_WordCompletion(void);
+WordCompletion *new_WordCompletion(void);
- WordCompletion *del_WordCompletion(WordCompletion *cpl);
-
-
- #define CPL_MATCH_FN(fn) int (fn)(WordCompletion *cpl, \
- void *data, \
- const char *line, \
- int word_end)
- typedef CPL_MATCH_FN(CplMatchFn);
-
- CPL_MATCH_FN(cpl_file_completions);
-
-
- CplMatches *cpl_complete_word(WordCompletion *cpl,
- const char *line,
- int word_end, void *data,
- CplMatchFn *match_fn);
-
- CplMatches *cpl_recall_matches(WordCompletion *cpl);
-
- int cpl_list_completions(CplMatches *result, FILE *fp,
- int term_width);
-
- int cpl_add_completion(WordCompletion *cpl,
- const char *line, int word_start,
- int word_end, const char *suffix,
- const char *type_suffix,
- const char *cont_suffix);
-
- void cpl_record_error(WordCompletion *cpl,
- const char *errmsg);
-
- const char *cpl_last_error(WordCompletion *cpl);
-
-
- #define CPL_CHECK_FN(fn) int (fn)(void *data, \
- const char *pathname)
-
- typedef CPL_CHECK_FN(CplCheckFn);
-
- CPL_CHECK_FN(cpl_check_exe);
-
- CplFileConf *new_CplFileConf(void);
-
- CplFileConf *del_CplFileConf(CplFileConf *cfc);
-
- void cfc_literal_escapes(CplFileConf *cfc, int literal);
-
- void cfc_file_start(CplFileConf *cfc, int start_index);
-
- void cfc_set_check_fn(CplFileConf *cfc, CplCheckFn *chk_fn,
- void *chk_data);
-
-
-
-</pre><h2>DESCRIPTION</h2><pre>
- The cpl_complete_word() function is part of the tecla library (see the
- <a href="libtecla.html"><b>libtecla</b></a> man page). It is usually called behind the
- scenes by <a href="gl_get_line.html"><b>gl_get_line</b></a>, but can also be called sepa-
- rately.
-
- Given an input line containing an incomplete word to be completed, it
- calls a user-provided callback function (or the provided file-comple-
- tion callback function) to look up all possible completion suffixes for
- that word. The callback function is expected to look backward in the
- line, starting from the specified cursor position, to find the start of
- the word to be completed, then to look up all possible completions of
- that word and record them, one at a time by calling cpl_add_comple-
- tion().
-
-
- Descriptions of the functions of this module are as follows:
-
- WordCompletion *new_WordCompletion(void)
-
- This function creates the resources used by the cpl_complete_word()
- function. In particular, it maintains the memory that is used to return
- the results of calling cpl_complete_word().
-
- WordCompletion *del_WordCompletion(WordCompletion *cpl)
-
- This function deletes the resources that were returned by a previous
- call to new_WordCompletion(). It always returns NULL (ie. a deleted
- object). It does nothing if the cpl argument is NULL.
-
- The callback functions which lookup possible completions should be
- defined with the following macro (which is defined in libtecla.h).
-
- #define CPL_MATCH_FN(fn) int (fn)(WordCompletion *cpl, \
- void *data, \
- const char *line, \
- int word_end)
-
- Functions of this type are called by cpl_complete_word(), and all of
- the arguments of the callback are those that were passed to said func-
- tion. In particular, the line argument contains the input line contain-
- ing the word to be completed, and word_end is the index of the charac-
- ter that follows the last character of the incomplete word within this
- string. The callback is expected to look backwards from word_end for
- the start of the incomplete word. What constitutes the start of a word
- clearly depends on the application, so it makes sense for the callback
- to take on this responsibility. For example, the builtin filename com-
- pletion function looks backwards until it hits an unescaped space, or
- the start of the line. Having found the start of the word, the call-
- back should then lookup all possible completions of this word, and
- record each completion via separate calls to cpl_add_completion(). If
- the callback needs access to an application-specific symbol table, it
- can pass it and any other data that it needs, via the data argument.
- This removes any need for globals.
-
- The callback function should return 0 if no errors occur. On failure it
- should return 1, and register a terse description of the error by call-
- ing cpl_record_error().
-
- void cpl_record_error(WordCompletion *cpl,
- const char *errmsg);
-
- The last error message recorded by calling cpl_record_error(), can sub-
- sequently be queried by calling cpl_last_error(), as described later.
-
- int cpl_add_completion(WordCompletion *cpl,
- const char *line, int word_start,
- int word_end, const char *suffix,
- const char *type_suffix,
- const char *cont_suffix);
-
- The cpl_add_completion() function is called zero or more times by the
- completion callback function to record each possible completion in the
- specified WordCompletion object. These completions are subsequently
- returned by cpl_complete_word(), as described later. The cpl, line, and
- word_end arguments should be those that were passed to the callback
- function. The word_start argument should be the index within the input
- line string of the start of the word that is being completed. This
- should equal word_end if a zero-length string is being completed. The
- suffix argument is the string that would have to be appended to the
- incomplete word to complete it. If this needs any quoting (eg. the
- addition of backslashes before special charaters) to be valid within
- the displayed input line, this should be included. A copy of the suffix
- string is allocated internally, so there is no need to maintain your
- copy of the string after cpl_add_completion() returns.
-
- Note that in the array of possible completions which the cpl_com-
- plete_word() function returns, the suffix recorded by cpl_add_comple-
- tion() is listed along with the concatentation of this suffix with the
- word that lies between word_start and word_end in the input line.
-
- The type_suffix argument specifies an optional string to be appended to
- the completion if it is displayed as part of a list of completions by
- cpl_list_completions(). The intention is that this indicate to the user
- the type of each completion. For example, the file completion function
- places a directory separator after completions that are directories, to
- indicate their nature to the user. Similary, if the completion were a
- function, you could indicate this to the user by setting type_suffix to
- "()". Note that the type_suffix string isn't copied, so if the argument
- isn't a literal string between speech marks, be sure that the string
- remains valid for at least as long as the results of cpl_com-
- plete_word() are needed.
-
- The cont_suffix is a continuation suffix to append to the completed
- word in the input line if this is the only completion. This is some-
- thing that isn't part of the completion itself, but that gives the user
- an indication about how they might continue to extend the token. For
- example, the file-completion callback function adds a directory separa-
- tor if the completed word is a directory. If the completed word were a
- function name, you could similarly aid the user by arranging for an
- open parenthesis to be appended.
-
- CplMatches *cpl_complete_word(WordCompletion *cpl,
- const char *line,
- int word_end, void *data,
- CplMatchFn *match_fn);
-
- The cpl_complete_word() is normally called behind the scenes by
- <a href="gl_get_line.html"><b>gl_get_line</b></a>, but can also be called separately if you
- separately allocate a WordCompletion object. It performs word comple-
- tion, as described at the beginning of this section. Its first argument
- is a resource object previously returned by new_WordCompletion(). The
- line argument is the input line string, containing the word to be com-
- pleted. The word_end argument contains the index of the character in
- the input line, that just follows the last character of the word to be
- completed. When called by gl_get_line(), this is the character over
- which the user pressed TAB. The match_fn argument is the function
- pointer of the callback function which will lookup possible completions
- of the word, as described above, and the data argument provides a way
- for the application to pass arbitrary data to the callback function.
-
- If no errors occur, the cpl_complete_word() function returns a pointer
- to a CplMatches container, as defined below. This container is allo-
- cated as part of the cpl object that was passed to cpl_complete_word(),
- and will thus change on each call which uses the same cpl argument.
-
- typedef struct {
- char *completion; /* A matching completion */
- /* string */
- char *suffix; /* The part of the */
- /* completion string which */
- /* would have to be */
- /* appended to complete the */
- /* original word. */
- const char *type_suffix; /* A suffix to be added when */
- /* listing completions, to */
- /* indicate the type of the */
- /* completion. */
- } CplMatch;
-
- typedef struct {
- char *suffix; /* The common initial part */
- /* of all of the completion */
- /* suffixes. */
- const char *cont_suffix; /* Optional continuation */
- /* string to be appended to */
- /* the sole completion when */
- /* nmatch==1. */
- CplMatch *matches; /* The array of possible */
- /* completion strings, */
- /* sorted into lexical */
- /* order. */
- int nmatch; /* The number of elements in */
- /* the above matches[] */
- /* array. */
- } CplMatches;
-
- If an error occurs during completion, cpl_complete_word() returns NULL.
- A description of the error can be acquired by calling the
- cpl_last_error() function.
-
- const char *cpl_last_error(WordCompletion *cpl);
-
- The cpl_last_error() function returns a terse description of the error
- which occurred on the last call to cpl_complete_word() or cpl_add_com-
- pletion().
-
- CplMatches *cpl_recall_matches(WordCompletion *cpl);
-
- As a convenience, the return value of the last call to cpl_com-
- plete_word() can be recalled at a later time by calling
- cpl_recall_matches(). If cpl_complete_word() returned NULL, so will
- cpl_recall_matches().
-
- int cpl_list_completions(CplMatches *result, FILE *fp,
- int terminal_width);
-
- When the cpl_complete_word() function returns multiple possible comple-
- tions, the cpl_list_completions() function can be called upon to list
- them, suitably arranged across the available width of the terminal. It
- arranges for the displayed columns of completions to all have the same
- width, set by the longest completion. It also appends the type_suffix
- strings that were recorded with each completion, thus indicating their
- types to the user.
-
-
-</pre><h2>THE BUILT-IN FILENAME-COMPLETION CALLBACK</h2><pre>
- By default the <a href="gl_get_line.html"><b>gl_get_line</b></a> function, passes the follow-
- ing completion callback function to cpl_complete_word(). This function
- can also be used separately, either by sending it to cpl_com-
- plete_word(), or by calling it directly from your own completion call-
- back function.
-
- CPL_MATCH_FN(cpl_file_completions);
-
- Certain aspects of the behavior of this callback can be changed via its
- data argument. If you are happy with its default behavior you can pass
- NULL in this argument. Otherwise it should be a pointer to a CplFile-
- Conf object, previously allocated by calling new_CplFileConf().
-
- CplFileConf *new_CplFileConf(void);
-
- CplFileConf objects encapsulate the configuration parameters of
- cpl_file_completions(). These parameters, which start out with default
- values, can be changed by calling the accessor functions described
- below.
-
- By default, the cpl_file_completions() callback function searches back-
- wards for the start of the filename being completed, looking for the
- first un-escaped space or the start of the input line. If you wish to
- specify a different location, call cfc_file_start() with the index at
- which the filename starts in the input line. Passing start_index=-1 re-
- enables the default behavior.
-
- void cfc_file_start(CplFileConf *cfc, int start_index);
-
- By default, when cpl_file_completions() looks at a filename in the
- input line, each lone backslash in the input line is interpreted as
- being a special character which removes any special significance of the
- character which follows it, such as a space which should be taken as
- part of the filename rather than delimiting the start of the filename.
- These backslashes are thus ignored while looking for completions, and
- subsequently added before spaces, tabs and literal backslashes in the
- list of completions. To have unescaped backslashes treated as normal
- characters, call cfc_literal_escapes() with a non-zero value in its
- literal argument.
-
- void cfc_literal_escapes(CplFileConf *cfc, int literal);
-
- By default, cpl_file_completions() reports all files who's names start
- with the prefix that is being completed. If you only want a selected
- subset of these files to be reported in the list of completions, you
- can arrange this by providing a callback function which takes the full
- pathname of a file, and returns 0 if the file should be ignored, or 1
- if the file should be included in the list of completions. To register
- such a function for use by cpl_file_completions(), call
- cfc_set_check_fn(), and pass it a pointer to the function, together
- with a pointer to any data that you would like passed to this callback
- whenever it is called. Your callback can make its decisions based on
- any property of the file, such as the filename itself, whether the file
- is readable, writable or executable, or even based on what the file
- contains.
-
- #define CPL_CHECK_FN(fn) int (fn)(void *data, \
- const char *pathname)
- typedef CPL_CHECK_FN(CplCheckFn);
-
- void cfc_set_check_fn(CplFileConf *cfc,
- CplCheckFn *chk_fn, void *chk_data);
-
- The cpl_check_exe() function is a provided callback of the above type,
- for use with cpl_file_completions(). It returns non-zero if the file-
- name that it is given represents a normal file that the user has exe-
- cute permission to. You could use this to have cpl_file_completions()
- only list completions of executable files.
-
- When you have finished with a CplFileConf variable, you can pass it to
- the del_CplFileConf() destructor function to reclaim its memory.
-
- CplFileConf *del_CplFileConf(CplFileConf *cfc);
-
-
-
-</pre><h2>THREAD SAFETY</h2><pre>
- In multi-threaded programs, you should use the libtecla_r.a version of
- the library. This uses POSIX reentrant functions where available (hence
- the _r suffix), and disables features that rely on non-reentrant system
- functions. In the case of this module, the only disabled feature is
- username completion in ~username/ expressions, in cpl_file_comple-
- tions().
-
- Using the libtecla_r.a version of the library, it is safe to use the
- facilities of this module in multiple threads, provided that each
- thread uses a separately allocated WordCompletion object. In other
- words, if two threads want to do word completion, they should each call
- new_WordCompletion() to allocate their own completion objects.
-
-
-</pre><h2>FILES</h2><pre>
- libtecla.a - The tecla library
- libtecla.h - The tecla header file.
-
-
-</pre><h2>SEE ALSO</h2><pre>
- <a href="libtecla.html"><b>libtecla</b></a>, <a href="gl_get_line.html"><b>gl_get_line</b></a>, <a href="ef_expand_file.html"><b>ef_expand_file</b></a>,
- <a href="pca_lookup_file.html"><b>pca_lookup_file</b></a>
-
-
-</pre><h2>AUTHOR</h2><pre>
- Martin Shepherd (mcs at astro.caltech.edu)
-
-
-
- <a href="cpl_complete_word.html"><b>cpl_complete_word</b></a>
-</pre>
-</body>
+WordCompletion *del_WordCompletion(WordCompletion *cpl);
+
+
+#define CPL_MATCH_FN(fn) int (fn)(WordCompletion *cpl, \
+ void *data, \
+ const char *line, \
+ int word_end)
+typedef CPL_MATCH_FN(CplMatchFn);
+
+CPL_MATCH_FN(cpl_file_completions);
+
+
+CplMatches *cpl_complete_word(WordCompletion *cpl,
+ const char *line,
+ int word_end, void *data,
+ CplMatchFn *match_fn);
+
+CplMatches *cpl_recall_matches(WordCompletion *cpl);
+
+int cpl_list_completions(CplMatches *result, FILE *fp,
+ int term_width);
+
+int cpl_add_completion(WordCompletion *cpl,
+ const char *line, int word_start,
+ int word_end, const char *suffix,
+ const char *type_suffix,
+ const char *cont_suffix);
+
+void cpl_record_error(WordCompletion *cpl,
+ const char *errmsg);
+
+const char *cpl_last_error(WordCompletion *cpl);
+
+
+#define CPL_CHECK_FN(fn) int (fn)(void *data, \
+ const char *pathname)
+
+typedef CPL_CHECK_FN(CplCheckFn);
+
+CPL_CHECK_FN(cpl_check_exe);
+
+CplFileConf *new_CplFileConf(void);
+
+CplFileConf *del_CplFileConf(CplFileConf *cfc);
+
+void cfc_literal_escapes(CplFileConf *cfc, int literal);
+
+void cfc_file_start(CplFileConf *cfc, int start_index);
+
+void cfc_set_check_fn(CplFileConf *cfc, CplCheckFn *chk_fn,
+ void *chk_data);
+
+</PRE>
+
+<P>
+<A NAME="lbAD"> </A>
+<H2>DESCRIPTION</H2>
+
+<P>
+The <B>cpl_complete_word()</B> function is part of the tecla library
+(see the <A HREF="libtecla.html">libtecla</A>(3) man page). It is usually called behind the scenes
+by <B><A HREF="gl_get_line.html">gl_get_line</A>(3)</B>, but can also be called separately.
+<P>
+Given an input line containing an incomplete word to be completed, it
+calls a user-provided callback function (or the provided
+file-completion callback function) to look up all possible completion
+suffixes for that word. The callback function is expected to look
+backward in the line, starting from the specified cursor position, to
+find the start of the word to be completed, then to look up all
+possible completions of that word and record them, one at a time by
+calling <B>cpl_add_completion()</B>.
+<P>
+<P>
+Descriptions of the functions of this module are as follows:
+<P>
+<PRE>
+ WordCompletion *new_WordCompletion(void)
+</PRE>
+
+<P>
+This function creates the resources used by the <B>cpl_complete_word()</B>
+function. In particular, it maintains the memory that is used to
+return the results of calling <B>cpl_complete_word()</B>.
+<P>
+<PRE>
+ WordCompletion *del_WordCompletion(WordCompletion *cpl)
+</PRE>
+
+<P>
+This function deletes the resources that were returned by a previous
+call to <B>new_WordCompletion()</B>. It always returns <B>NULL</B> (ie. a
+deleted object). It does nothing if the <B>cpl</B> argument is
+<B>NULL</B>.
+<P>
+The callback functions which lookup possible completions should be
+defined with the following macro (which is defined in libtecla.h).
+<P>
+<PRE>
+ #define CPL_MATCH_FN(fn) int (fn)(WordCompletion *cpl, \
+ void *data, \
+ const char *line, \
+ int word_end)
+</PRE>
+
+<P>
+Functions of this type are called by <B>cpl_complete_word()</B>, and
+all of the arguments of the callback are those that were passed to
+said function. In particular, the <B>line</B> argument contains the
+input line containing the word to be completed, and <B>word_end</B> is
+the index of the character that follows the last character of the
+incomplete word within this string. The callback is expected to look
+backwards from <B>word_end</B> for the start of the incomplete
+word. What constitutes the start of a word clearly depends on the
+application, so it makes sense for the callback to take on this
+responsibility. For example, the builtin filename completion function
+looks backwards until it hits an unescaped space, or the start of the
+line. Having found the start of the word, the callback should then
+lookup all possible completions of this word, and record each
+completion via separate calls to <B>cpl_add_completion()</B>. If the
+callback needs access to an application-specific symbol table, it can
+pass it and any other data that it needs, via the <B>data</B>
+argument. This removes any need for globals.
+<P>
+The callback function should return 0 if no errors occur. On failure
+it should return 1, and register a terse description of the error by
+calling <B>cpl_record_error()</B>.
+<P>
+<PRE>
+ void cpl_record_error(WordCompletion *cpl,
+ const char *errmsg);
+</PRE>
+
+<P>
+The last error message recorded by calling <B>cpl_record_error()</B>,
+can subsequently be queried by calling <B>cpl_last_error()</B>, as
+described later.
+<P>
+<PRE>
+ int cpl_add_completion(WordCompletion *cpl,
+ const char *line, int word_start,
+ int word_end, const char *suffix,
+ const char *type_suffix,
+ const char *cont_suffix);
+</PRE>
+
+<P>
+The <B>cpl_add_completion()</B> function is called zero or more times
+by the completion callback function to record each possible completion
+in the specified <B>WordCompletion</B> object. These completions are
+subsequently returned by <B>cpl_complete_word()</B>, as described
+later. The <B>cpl</B>, <B>line</B>, and <B>word_end</B> arguments should
+be those that were passed to the callback function. The
+<B>word_start</B> argument should be the index within the input line
+string of the start of the word that is being completed. This should
+equal <B>word_end</B> if a zero-length string is being completed. The
+<B>suffix</B> argument is the string that would have to be appended to
+the incomplete word to complete it. If this needs any quoting
+(eg. the addition of backslashes before special charaters) to be valid
+within the displayed input line, this should be included. A copy of
+the suffix string is allocated internally, so there is no need to
+maintain your copy of the string after <B>cpl_add_completion()</B>
+returns.
+<P>
+Note that in the array of possible completions which the
+<B>cpl_complete_word()</B> function returns, the suffix recorded by
+<B>cpl_add_completion()</B> is listed along with the concatentation of
+this suffix with the word that lies between <B>word_start</B> and
+<B>word_end</B> in the input line.
+<P>
+The <B>type_suffix</B> argument specifies an optional string to be
+appended to the completion if it is displayed as part of a list of
+completions by <B>cpl_list_completions()</B>. The intention is that
+this indicate to the user the type of each completion. For example,
+the file completion function places a directory separator after
+completions that are directories, to indicate their nature to the
+user. Similary, if the completion were a function, you could indicate
+this to the user by setting <B>type_suffix</B> to "()". Note that the
+<B>type_suffix</B> string isn't copied, so if the argument isn't a
+literal string between speech marks, be sure that the string remains
+valid for at least as long as the results of <B>cpl_complete_word()</B>
+are needed.
+<P>
+The <B>cont_suffix</B> is a continuation suffix to append to the
+completed word in the input line if this is the only completion. This
+is something that isn't part of the completion itself, but that gives
+the user an indication about how they might continue to extend the
+token. For example, the file-completion callback function adds a
+directory separator if the completed word is a directory. If the
+completed word were a function name, you could similarly aid the user
+by arranging for an open parenthesis to be appended.
+<P>
+<PRE>
+ CplMatches *cpl_complete_word(WordCompletion *cpl,
+ const char *line,
+ int word_end, void *data,
+ CplMatchFn *match_fn);
+</PRE>
+
+<P>
+The <B>cpl_complete_word()</B> is normally called behind the scenes by
+<B><A HREF="gl_get_line.html">gl_get_line</A>(3)</B>, but can also be called separately if you
+separately allocate a <B>WordCompletion</B> object. It performs word
+completion, as described at the beginning of this section. Its first
+argument is a resource object previously returned by
+<B>new_WordCompletion()</B>. The <B>line</B> argument is the input line
+string, containing the word to be completed. The <B>word_end</B>
+argument contains the index of the character in the input line, that
+just follows the last character of the word to be completed. When
+called by <B>gl_get_line()</B>, this is the character over which the
+user pressed <B>TAB</B>. The <B>match_fn argument is the function
+pointer of the callback function which will lookup possible
+completions of the word, as described above, and the data</B>
+argument provides a way for the application to pass arbitrary data to
+the callback function.
+<P>
+If no errors occur, the <B>cpl_complete_word()</B> function returns a
+pointer to a <B>CplMatches</B> container, as defined below. This
+container is allocated as part of the <B>cpl</B> object that was passed
+to <B>cpl_complete_word()</B>, and will thus change on each call which
+uses the same <B>cpl</B> argument.
+<P>
+<PRE>
+ typedef struct {
+ char *completion; /* A matching completion */
+ /* string */
+ char *suffix; /* The part of the */
+ /* completion string which */
+ /* would have to be */
+ /* appended to complete the */
+ /* original word. */
+ const char *type_suffix; /* A suffix to be added when */
+ /* listing completions, to */
+ /* indicate the type of the */
+ /* completion. */
+ } CplMatch;
+
+ typedef struct {
+ char *suffix; /* The common initial part */
+ /* of all of the completion */
+ /* suffixes. */
+ const char *cont_suffix; /* Optional continuation */
+ /* string to be appended to */
+ /* the sole completion when */
+ /* nmatch==1. */
+ CplMatch *matches; /* The array of possible */
+ /* completion strings, */
+ /* sorted into lexical */
+ /* order. */
+ int nmatch; /* The number of elements in */
+ /* the above matches[] */
+ /* array. */
+ } CplMatches;
+</PRE>
+
+<P>
+If an error occurs during completion, <B>cpl_complete_word()</B>
+returns NULL. A description of the error can be acquired by calling
+the <B>cpl_last_error() function.
+<P>
+</B><PRE>
+ const char *cpl_last_error(WordCompletion *cpl);
+</PRE>
+
+<P>
+The <B>cpl_last_error() function returns a terse description of the
+error which occurred on the last call to cpl_complete_word()</B> or
+<B>cpl_add_completion()</B>.
+<P>
+<PRE>
+ CplMatches *cpl_recall_matches(WordCompletion *cpl);
+</PRE>
+
+<P>
+As a convenience, the return value of the last call to
+<B>cpl_complete_word()</B> can be recalled at a later time by calling
+<B>cpl_recall_matches()</B>. If <B>cpl_complete_word()</B> returned
+<B>NULL</B>, so will <B>cpl_recall_matches()</B>.
+<P>
+<PRE>
+ int cpl_list_completions(CplMatches *result, FILE *fp,
+ int terminal_width);
+</PRE>
+
+<P>
+When the <B>cpl_complete_word()</B> function returns multiple possible
+completions, the <B>cpl_list_completions()</B> function can be called
+upon to list them, suitably arranged across the available width of the
+terminal. It arranges for the displayed columns of completions to all
+have the same width, set by the longest completion. It also appends
+the <B>type_suffix</B> strings that were recorded with each completion,
+thus indicating their types to the user.
+<P>
+<A NAME="lbAE"> </A>
+<H2>THE BUILT-IN FILENAME-COMPLETION CALLBACK</H2>
+
+<P>
+By default the <B><A HREF="gl_get_line.html">gl_get_line</A>(3)</B> function, passes the following
+completion callback function to <B>cpl_complete_word()</B>. This
+function can also be used separately, either by sending it to
+<B>cpl_complete_word()</B>, or by calling it directly from your
+own completion callback function.
+<P>
+<PRE>
+ CPL_MATCH_FN(cpl_file_completions);
+</PRE>
+
+<P>
+Certain aspects of the behavior of this callback can be changed via
+its <B>data</B> argument. If you are happy with its default behavior
+you can pass <B>NULL</B> in this argument. Otherwise it should be a
+pointer to a <B>CplFileConf</B> object, previously allocated by calling
+<B>new_CplFileConf()</B>.
+<P>
+<PRE>
+ CplFileConf *new_CplFileConf(void);
+</PRE>
+
+<P>
+<B>CplFileConf</B> objects encapsulate the configuration parameters of
+<B>cpl_file_completions()</B>. These parameters, which start out with
+default values, can be changed by calling the accessor functions
+described below.
+<P>
+By default, the <B>cpl_file_completions() callback function
+searches backwards for the start of the filename being completed,
+looking for the first un-escaped space or the start of the input
+line. If you wish to specify a different location, call
+cfc_file_start()</B> with the index at which the filename starts in
+the input line. Passing start_index=-1 re-enables the default
+behavior.
+<P>
+<PRE>
+ void cfc_file_start(CplFileConf *cfc, int start_index);
+</PRE>
+
+<P>
+By default, when <B>cpl_file_completions()</B> looks at a filename in
+the input line, each lone backslash in the input line is interpreted
+as being a special character which removes any special significance of
+the character which follows it, such as a space which should be taken
+as part of the filename rather than delimiting the start of the
+filename. These backslashes are thus ignored while looking for
+completions, and subsequently added before spaces, tabs and literal
+backslashes in the list of completions. To have unescaped backslashes
+treated as normal characters, call <B>cfc_literal_escapes()</B> with a
+non-zero value in its <B>literal</B> argument.
+<P>
+<PRE>
+ void cfc_literal_escapes(CplFileConf *cfc, int literal);
+</PRE>
+
+<P>
+By default, <B>cpl_file_completions()</B> reports all files who's names
+start with the prefix that is being completed. If you only want a
+selected subset of these files to be reported in the list of
+completions, you can arrange this by providing a callback function
+which takes the full pathname of a file, and returns <B>0</B> if the
+file should be ignored, or <B>1</B> if the file should be included in
+the list of completions. To register such a function for use by
+<B>cpl_file_completions()</B>, call <B>cfc_set_check_fn()</B>, and pass
+it a pointer to the function, together with a pointer to any data that
+you would like passed to this callback whenever it is called. Your
+callback can make its decisions based on any property of the file,
+such as the filename itself, whether the file is readable, writable or
+executable, or even based on what the file contains.
+<P>
+<PRE>
+ #define CPL_CHECK_FN(fn) int (fn)(void *data, \
+ const char *pathname)
+ typedef CPL_CHECK_FN(CplCheckFn);
+
+ void cfc_set_check_fn(CplFileConf *cfc,
+ CplCheckFn *chk_fn, void *chk_data);
+</PRE>
+
+<P>
+The <B>cpl_check_exe()</B> function is a provided callback of the above
+type, for use with <B>cpl_file_completions()</B>. It returns non-zero
+if the filename that it is given represents a normal file that the
+user has execute permission to. You could use this to have
+<B>cpl_file_completions()</B> only list completions of executable
+files.
+<P>
+When you have finished with a <B>CplFileConf</B> variable, you can pass
+it to the <B>del_CplFileConf()</B> destructor function to reclaim its
+memory.
+<P>
+<PRE>
+ CplFileConf *del_CplFileConf(CplFileConf *cfc);
+</PRE>
+
+<P>
+<P>
+<A NAME="lbAF"> </A>
+<H2>THREAD SAFETY</H2>
+
+<P>
+In multi-threaded programs, you should use the <B>libtecla_r.a</B>
+version of the library. This uses POSIX reentrant functions where
+available (hence the <B>_r</B> suffix), and disables features that rely
+on non-reentrant system functions. In the case of this module, the
+only disabled feature is username completion in <B>~username/</B>
+expressions, in <B>cpl_file_completions()</B>.
+<P>
+Using the <B>libtecla_r.a</B> version of the library, it is safe to use
+the facilities of this module in multiple threads, provided that each
+thread uses a separately allocated <B>WordCompletion</B> object. In
+other words, if two threads want to do word completion, they should
+each call <B>new_WordCompletion()</B> to allocate their own completion
+objects.
+<P>
+<A NAME="lbAG"> </A>
+<H2>FILES</H2>
+
+<PRE>
+libtecla.a - The tecla library
+libtecla.h - The tecla header file.
+</PRE>
+
+<P>
+<A NAME="lbAH"> </A>
+<H2>SEE ALSO</H2>
+
+<P>
+<PRE>
+<A HREF="libtecla.html">libtecla</A>(3), <A HREF="gl_get_line.html">gl_get_line</A>(3), <A HREF="ef_expand_file.html">ef_expand_file</A>(3),
+<A HREF="pca_lookup_file.html">pca_lookup_file</A>(3)
+</PRE>
+
+<P>
+<A NAME="lbAI"> </A>
+<H2>AUTHOR</H2>
+
+Martin Shepherd (<A HREF="mailto:mcs at astro.caltech.edu">mcs at astro.caltech.edu</A>)
+<P>
+
+<HR>
+<A NAME="index"> </A><H2>Index</H2>
+<DL>
+<DT><A HREF="#lbAB">NAME</A><DD>
+<DT><A HREF="#lbAC">SYNOPSIS</A><DD>
+<DT><A HREF="#lbAD">DESCRIPTION</A><DD>
+<DT><A HREF="#lbAE">THE BUILT-IN FILENAME-COMPLETION CALLBACK</A><DD>
+<DT><A HREF="#lbAF">THREAD SAFETY</A><DD>
+<DT><A HREF="#lbAG">FILES</A><DD>
+<DT><A HREF="#lbAH">SEE ALSO</A><DD>
+<DT><A HREF="#lbAI">AUTHOR</A><DD>
+</DL>
+<HR>
+This document was created by
+<A HREF="/cgi-bin/man/man2html">man2html</A>,
+using the manual pages.<BR>
+Time: 03:25:06 GMT, June 12, 2012
+</BODY>
+</HTML>
diff --git a/html/ef_expand_file.html b/html/ef_expand_file.html
index c780cf6..d8d88eb 100644
--- a/html/ef_expand_file.html
+++ b/html/ef_expand_file.html
@@ -1,213 +1,273 @@
-<head>
-<title>Manual Page</title>
-</head>
-<body>
-<pre>
-<a href="ef_expand_file.html"><b>ef_expand_file</b></a> <a href="ef_expand_file.html"><b>ef_expand_file</b></a>
-
-
-
-</pre><h2>NAME</h2><pre>
- ef_expand_file, del_ExpandFile, ef_last_error, ef_list_expansions,
- new_ExpandFile - expand filenames containing ~user/$envvar and wildcard
- expressions
-
-</pre><h2>SYNOPSIS</h2><pre>
- #include <libtecla.h>
-
- ExpandFile *new_ExpandFile(void);
-
- ExpandFile *del_ExpandFile(ExpandFile *ef);
-
- FileExpansion *ef_expand_file(ExpandFile *ef,
- const char *path,
- int pathlen);
-
- int ef_list_expansions(FileExpansion *result, FILE *fp,
- int term_width);
-
- const char *ef_last_error(ExpandFile *ef);
-
-
-</pre><h2>DESCRIPTION</h2><pre>
- The ef_expand_file() function is part of the tecla library (see the
- <a href="libtecla.html"><b>libtecla</b></a> man page). It expands a specified filename,
- converting ~user/ and ~/ expressions at the start of the filename to
- the corresponding home directories, replacing $envvar with the value of
- the corresponding environment variable, and then, if there are any
- wildcards, matching these against existing filenames. Backslashes in
- the input filename are interpreted as escaping any special meanings of
- the characters that follow them. Only backslahes that are themselves
- preceded by backslashes are preserved in the expanded filename.
-
- In the presence of wildcards, the returned list of filenames only
- includes the names of existing files which match the wildcards. Other-
- wise, the original filename is returned after expansion of tilde and
- dollar expressions, and the result is not checked against existing
- files. This mimics the file-globbing behavior of the unix tcsh shell.
-
- The supported wildcards and their meanings are:
- * - Match any sequence of zero or more characters.
- ? - Match any single character.
- [chars] - Match any single character that appears in
- 'chars'. If 'chars' contains an expression of
- the form a-b, then any character between a and
- b, including a and b, matches. The '-'
- character looses its special meaning as a
- range specifier when it appears at the start
- of the sequence of characters. The ']'
- character also looses its significance as the
- terminator of the range expression if it
- appears immediately after the opening '[', at
- which point it is treated one of the
- characters of the range. If you want both '-'
- and ']' to be part of the range, the '-'
- should come first and the ']' second.
-
- [^chars] - The same as [chars] except that it matches any
- single character that doesn't appear in
- 'chars'.
-
- Note that wildcards never match the initial dot in filenames that start
- with '.'. The initial '.' must be explicitly specified in the filename.
- This again mimics the globbing behavior of most unix shells, and its
- rational is based in the fact that in unix, files with names that start
- with '.' are usually hidden configuration files, which are not listed
- by default by the ls command.
-
- The following is a complete example of how to use the file expansion
- function.
-
- #include <stdio.h>
- #include <libtecla.h>
-
- int main(int argc, char *argv[])
- {
- ExpandFile *ef; /* The expansion resource object */
- char *filename; /* The filename being expanded */
- FileExpansion *expn; /* The results of the expansion */
- int i;
-
- ef = new_ExpandFile();
- if(!ef)
- return 1;
-
- for(arg = *(argv++); arg; arg = *(argv++)) {
- if((expn = ef_expand_file(ef, arg, -1)) == NULL) {
- fprintf(stderr, "Error expanding %s (%s).\n", arg,
- ef_last_error(ef));
- } else {
- printf("%s matches the following files:\n", arg);
- for(i=0; i<expn->nfile; i++)
- printf(" %s\n", expn->files[i]);
- }
- }
-
- ef = del_ExpandFile(ef);
- return 0;
- }
-
- Descriptions of the functions used above are as follows:
-
- ExpandFile *new_ExpandFile(void)
-
- This function creates the resources used by the ef_expand_file() func-
- tion. In particular, it maintains the memory that is used to record the
- array of matching filenames that is returned by ef_expand_file(). This
- array is expanded as needed, so there is no built in limit to the num-
- ber of files that can be matched.
-
- ExpandFile *del_ExpandFile(ExpandFile *ef)
-
- This function deletes the resources that were returned by a previous
- call to new_ExpandFile(). It always returns NULL (ie a deleted object).
- It does nothing if the ef argument is NULL.
-
- A container of the following type is returned by ef_expand_file().
-
- typedef struct {
- int exists; /* True if the files in files[] exist */
- int nfile; /* The number of files in files[] */
- char **files; /* An array of 'nfile' filenames. */
- } FileExpansion;
-
- FileExpansion *ef_expand_file(ExpandFile *ef,
- const char *path,
- int pathlen)
-
- The ef_expand_file() function performs filename expansion, as docu-
- mented at the start of this section. Its first argument is a resource
- object returned by new_ExpandFile(). A pointer to the start of the
- filename to be matched is passed via the path argument. This must be a
- normal NUL terminated string, but unless a length of -1 is passed in
- pathlen, only the first pathlen characters will be used in the filename
- expansion. If the length is specified as -1, the whole of the string
- will be expanded.
-
- The function returns a pointer to a container who's contents are the
- results of the expansion. If there were no wildcards in the filename,
- the nfile member will be 1, and the exists member should be queried if
- it is important to know if the expanded file currently exists or not.
- If there were wildcards, then the contained files[] array will contain
- the names of the nfile existing files that matched the wildcarded file-
- name, and the exists member will have the value 1. Note that the
- returned container belongs to the specified ef object, and its contents
- will change on each call, so if you need to retain the results of more
- than one call to ef_expand_file(), you should either make a private
- copy of the returned results, or create multiple file-expansion
- resource objects via multiple calls to new_ExpandFile().
-
- On error, NULL is returned, and an explanation of the error can be
- determined by calling ef_last_error(ef).
-
- const char *ef_last_error(ExpandFile *ef)
-
- This function returns the message which describes the error that
- occurred on the last call to ef_expand_file(), for the given (Expand-
- File *ef) resource object.
-
- int ef_list_expansions(FileExpansion *result, FILE *fp,
- int terminal_width);
-
- The ef_list_expansions() function provides a convenient way to list the
- filename expansions returned by ef_expand_file(). Like the unix ls com-
- mand, it arranges the filenames into equal width columns, each column
- having the width of the largest file. The number of columns used is
- thus determined by the length of the longest filename, and the speci-
- fied terminal width. Beware that filenames that are longer than the
- specified terminal width are printed without being truncated, so output
- longer than the specified terminal width can occur. The list is written
- to the stdio stream specified by the fp argument.
-
-
-</pre><h2>THREAD SAFETY</h2><pre>
- In multi-threaded programs, you should use the libtecla_r.a version of
- the library. This uses POSIX reentrant functions where available (hence
- the _r suffix), and disables features that rely on non-reentrant system
- functions. Currently there are no features disabled in this module.
-
- Using the libtecla_r.a version of the library, it is safe to use the
- facilities of this module in multiple threads, provided that each
- thread uses a separately allocated ExpandFile object. In other words,
- if two threads want to do file expansion, they should each call
- new_ExpandFile() to allocate their own file-expansion objects.
-
-
-</pre><h2>FILES</h2><pre>
- libtecla.a - The tecla library
- libtecla.h - The tecla header file.
-
-
-</pre><h2>SEE ALSO</h2><pre>
- <a href="libtecla.html"><b>libtecla</b></a>, <a href="gl_get_line.html"><b>gl_get_line</b></a>, <a href="cpl_complete_word.html"><b>cpl_complete_word</b></a>,
- <a href="pca_lookup_file.html"><b>pca_lookup_file</b></a>
-
-
-</pre><h2>AUTHOR</h2><pre>
- Martin Shepherd (mcs at astro.caltech.edu)
-
-
-
- <a href="ef_expand_file.html"><b>ef_expand_file</b></a>
-</pre>
-</body>
+Content-type: text/html
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML><HEAD><TITLE>Man page of ef_expand_file</TITLE>
+</HEAD><BODY>
+<H1>ef_expand_file</H1>
+Section: C Library Functions (3)<BR><A HREF="#index">Index</A>
+<A HREF="index.html">Return to Main Contents</A><HR>
+
+<A NAME="lbAB"> </A>
+<H2>NAME</H2>
+
+ef_expand_file, del_ExpandFile, ef_last_error, ef_list_expansions, new_ExpandFile - expand filenames containing ~user/$envvar and wildcard expressions
+<A NAME="lbAC"> </A>
+<H2>SYNOPSIS</H2>
+
+<PRE>
+#include <<A HREF="file:///usr/include/libtecla.h">libtecla.h</A>>
+
+ExpandFile *new_ExpandFile(void);
+
+ExpandFile *del_ExpandFile(ExpandFile *ef);
+
+FileExpansion *ef_expand_file(ExpandFile *ef,
+ const char *path,
+ int pathlen);
+
+int ef_list_expansions(FileExpansion *result, FILE *fp,
+ int term_width);
+
+const char *ef_last_error(ExpandFile *ef);
+</PRE>
+
+<P>
+<A NAME="lbAD"> </A>
+<H2>DESCRIPTION</H2>
+
+<P>
+The <B>ef_expand_file()</B> function is part of the tecla library
+(see the <A HREF="libtecla.html">libtecla</A>(3) man page). It expands a specified filename,
+converting <B>~user/</B> and <B>~/</B> expressions at the start of the
+filename to the corresponding home directories, replacing
+<B>$envvar</B> with the value of the corresponding environment
+variable, and then, if there are any wildcards, matching these against
+existing filenames. Backslashes in the input filename are interpreted
+as escaping any special meanings of the characters that follow them.
+Only backslahes that are themselves preceded by backslashes are
+preserved in the expanded filename.
+<P>
+In the presence of wildcards, the returned list of filenames only
+includes the names of existing files which match the
+wildcards. Otherwise, the original filename is returned after
+expansion of tilde and dollar expressions, and the result is not
+checked against existing files. This mimics the file-globbing behavior
+of the unix <B>tcsh</B> shell.
+<P>
+The supported wildcards and their meanings are:
+<PRE>
+ * - Match any sequence of zero or more characters.
+ ? - Match any single character.
+ [chars] - Match any single character that appears in
+ 'chars'. If 'chars' contains an expression of
+ the form a-b, then any character between a and
+ b, including a and b, matches. The '-'
+ character looses its special meaning as a
+ range specifier when it appears at the start
+ of the sequence of characters. The ']'
+ character also looses its significance as the
+ terminator of the range expression if it
+ appears immediately after the opening '[', at
+ which point it is treated one of the
+ characters of the range. If you want both '-'
+ and ']' to be part of the range, the '-'
+ should come first and the ']' second.
+
+ [^chars] - The same as [chars] except that it matches any
+ single character that doesn't appear in
+ 'chars'.
+</PRE>
+
+<P>
+Note that wildcards never match the initial dot in filenames that
+start with '.'. The initial '.' must be explicitly specified in the
+filename. This again mimics the globbing behavior of most unix shells,
+and its rational is based in the fact that in unix, files with names
+that start with '.' are usually hidden configuration files, which are
+not listed by default by the ls command.
+<P>
+The following is a complete example of how to use the file expansion
+function.
+<P>
+<PRE>
+ #include <<A HREF="file:///usr/include/stdio.h">stdio.h</A>>
+ #include <<A HREF="file:///usr/include/libtecla.h">libtecla.h</A>>
+
+ int main(int argc, char *argv[])
+ {
+ ExpandFile *ef; /* The expansion resource object */
+ char *filename; /* The filename being expanded */
+ FileExpansion *expn; /* The results of the expansion */
+ int i;
+
+ ef = new_ExpandFile();
+ if(!ef)
+ return 1;
+
+ for(arg = *(argv++); arg; arg = *(argv++)) {
+ if((expn = ef_expand_file(ef, arg, -1)) == NULL) {
+ fprintf(stderr, "Error expanding %s (%s).\n", arg,
+ ef_last_error(ef));
+ } else {
+ printf("%s matches the following files:\n", arg);
+ for(i=0; i<expn->nfile; i++)
+ printf(" %s\n", expn->files[i]);
+ }
+ }
+
+ ef = del_ExpandFile(ef);
+ return 0;
+ }
+</PRE>
+
+<P>
+Descriptions of the functions used above are as follows:
+<P>
+<PRE>
+ ExpandFile *new_ExpandFile(void)
+</PRE>
+
+<P>
+This function creates the resources used by the <B>ef_expand_file()</B>
+function. In particular, it maintains the memory that is used to record the
+array of matching filenames that is returned by <B>ef_expand_file()</B>. This
+array is expanded as needed, so there is no built in limit to the number of
+files that can be matched.
+<P>
+<PRE>
+ ExpandFile *del_ExpandFile(ExpandFile *ef)
+</PRE>
+
+<P>
+This function deletes the resources that were returned by a previous call to
+<B>new_ExpandFile()</B>. It always returns <B>NULL</B> (ie a deleted object). It
+does nothing if the <B>ef</B> argument is <B>NULL</B>.
+<P>
+A container of the following type is returned by <B>ef_expand_file()</B>.
+<P>
+<PRE>
+ typedef struct {
+ int exists; /* True if the files in files[] exist */
+ int nfile; /* The number of files in files[] */
+ char **files; /* An array of 'nfile' filenames. */
+ } FileExpansion;
+</PRE>
+
+<P>
+<PRE>
+ FileExpansion *ef_expand_file(ExpandFile *ef,
+ const char *path,
+ int pathlen)
+</PRE>
+
+<P>
+The <B>ef_expand_file()</B> function performs filename expansion, as documented
+at the start of this section. Its first argument is a resource object returned
+by <B>new_ExpandFile()</B>. A pointer to the start of the filename to be matched
+is passed via the <B>path</B> argument. This must be a normal <B>NUL</B>
+terminated string, but unless a length of -1 is passed in <B>pathlen</B>, only
+the first <B>pathlen</B> characters will be used in the filename expansion. If
+the length is specified as -1, the whole of the string will be
+expanded.
+<P>
+The function returns a pointer to a container who's contents are the
+results of the expansion. If there were no wildcards in the filename,
+the <B>nfile</B> member will be 1, and the <B>exists</B> member should
+be queried if it is important to know if the expanded file currently
+exists or not. If there were wildcards, then the contained
+<B>files[]</B> array will contain the names of the <B>nfile</B> existing
+files that matched the wildcarded filename, and the <B>exists</B>
+member will have the value 1. Note that the returned container belongs
+to the specified <B>ef</B> object, and its contents will change on each
+call, so if you need to retain the results of more than one call to
+<B>ef_expand_file()</B>, you should either make a private copy of the
+returned results, or create multiple file-expansion resource objects
+via multiple calls to <B>new_ExpandFile()</B>.
+<P>
+On error, <B>NULL</B> is returned, and an explanation of the error can
+be determined by calling <B>ef_last_error(ef)</B>.
+<P>
+<PRE>
+ const char *ef_last_error(ExpandFile *ef)
+</PRE>
+
+<P>
+This function returns the message which describes the error that
+occurred on the last call to <B>ef_expand_file()</B>, for the given
+<B>(ExpandFile *ef)</B> resource object.
+<P>
+<PRE>
+ int ef_list_expansions(FileExpansion *result, FILE *fp,
+ int terminal_width);
+</PRE>
+
+<P>
+The <B>ef_list_expansions()</B> function provides a convenient way to
+list the filename expansions returned by <B>ef_expand_file()</B>. Like
+the unix <B>ls</B> command, it arranges the filenames into equal width
+columns, each column having the width of the largest file. The number
+of columns used is thus determined by the length of the longest
+filename, and the specified terminal width. Beware that filenames that
+are longer than the specified terminal width are printed without being
+truncated, so output longer than the specified terminal width can
+occur. The list is written to the stdio stream specified by the
+<B>fp</B> argument.
+<P>
+<A NAME="lbAE"> </A>
+<H2>THREAD SAFETY</H2>
+
+<P>
+In multi-threaded programs, you should use the <B>libtecla_r.a</B>
+version of the library. This uses POSIX reentrant functions where
+available (hence the <B>_r</B> suffix), and disables features that rely
+on non-reentrant system functions. Currently there are no features
+disabled in this module.
+<P>
+Using the <B>libtecla_r.a</B> version of the library, it is safe to use
+the facilities of this module in multiple threads, provided that each
+thread uses a separately allocated <B>ExpandFile</B> object. In other
+words, if two threads want to do file expansion, they should each call
+<B>new_ExpandFile()</B> to allocate their own file-expansion objects.
+<P>
+<A NAME="lbAF"> </A>
+<H2>FILES</H2>
+
+<PRE>
+libtecla.a - The tecla library
+libtecla.h - The tecla header file.
+</PRE>
+
+<P>
+<A NAME="lbAG"> </A>
+<H2>SEE ALSO</H2>
+
+<PRE>
+<A HREF="libtecla.html">libtecla</A>(3), <A HREF="gl_get_line.html">gl_get_line</A>(3), <A HREF="cpl_complete_word.html">cpl_complete_word</A>(3),
+<A HREF="pca_lookup_file.html">pca_lookup_file</A>(3)
+</PRE>
+
+<P>
+<A NAME="lbAH"> </A>
+<H2>AUTHOR</H2>
+
+Martin Shepherd (<A HREF="mailto:mcs at astro.caltech.edu">mcs at astro.caltech.edu</A>)
+<P>
+
+<HR>
+<A NAME="index"> </A><H2>Index</H2>
+<DL>
+<DT><A HREF="#lbAB">NAME</A><DD>
+<DT><A HREF="#lbAC">SYNOPSIS</A><DD>
+<DT><A HREF="#lbAD">DESCRIPTION</A><DD>
+<DT><A HREF="#lbAE">THREAD SAFETY</A><DD>
+<DT><A HREF="#lbAF">FILES</A><DD>
+<DT><A HREF="#lbAG">SEE ALSO</A><DD>
+<DT><A HREF="#lbAH">AUTHOR</A><DD>
+</DL>
+<HR>
+This document was created by
+<A HREF="/cgi-bin/man/man2html">man2html</A>,
+using the manual pages.<BR>
+Time: 03:25:06 GMT, June 12, 2012
+</BODY>
+</HTML>
diff --git a/html/enhance.html b/html/enhance.html
index 62b4e2f..11e5397 100644
--- a/html/enhance.html
+++ b/html/enhance.html
@@ -1,75 +1,105 @@
-<head>
-<title>Manual Page</title>
-</head>
-<body>
-<pre>
-<a href="enhance.html"><b>enhance</b></a> <a href="enhance.html"><b>enhance</b></a>
-
-
-
-</pre><h2>NAME</h2><pre>
- enhance - A program that adds command-line editing to third party pro-
- grams.
-
-</pre><h2>SYNOPSIS</h2><pre>
- enhance command [ argument ... ]
-
-
-</pre><h2>DESCRIPTION</h2><pre>
- The enhance program provides enhanced command-line editing facilities
- to users of third party applications, to which one doesn't have any
- source code. It does this by placing a pseudo-terminal between the
- application and the real terminal. It uses the tecla command-line edit-
- ing library to read input from the real terminal, then forwards each
- just completed input line to the application via the pseudo-terminal.
- All output from the application is forwarded back unchanged to the real
- terminal.
-
- Whenever the application stops generating output for more than a tenth
- of a second, the enhance program treats the latest incomplete output
- line as the prompt, and redisplays any incompleted input line that the
- user has typed after it. Note that the small delay, which is impercep-
- tible to the user, isn't necessary for correct operation of the pro-
- gram. It is just an optimization, designed to stop the input line from
- being redisplayed so often that it slows down output.
-
- Note that the user-level command-line editing facilities provided by
- the Tecla library are documented in the <a href="tecla.html"><b>tecla</b></a> man page
-
-
-</pre><h2>DEFICIENCIES</h2><pre>
- The one major problem that hasn't been solved yet, is how to deal with
- applications that change whether typed input is echo'd by their con-
- trolling terminal. For example, programs that ask for a password, such
- as ftp and telnet, temporarily tell their controlling terminal not to
- echo what the user types. Since this request goes to the application
- side of the psuedo terminal, the enhance program has no way of knowing
- that this has happened, and continues to echo typed input to its con-
- trolling terminal, while the user types their password.
-
- Furthermore, before executing the host application, the enhance program
- initially sets the pseudo terminal to noecho mode, so that everything
- that it sends to the program doesn't get redundantly echoed. If a pro-
- gram that switches to noecho mode explicitly restores echoing after-
- wards, rather than restoring the terminal modes that were previously in
- force, then subsequently, every time that you enter a new input line, a
- duplicate copy will be displayed on the next line.
-
-
-</pre><h2>FILES</h2><pre>
- libtecla.a - The tecla library.
- ~/.teclarc - The tecla personal customization file.
-
-
-</pre><h2>SEE ALSO</h2><pre>
- <a href="tecla.html"><b>tecla</b></a>, <a href="libtecla.html"><b>libtecla</b></a>
-
-
-</pre><h2>AUTHOR</h2><pre>
- Martin Shepherd (mcs at astro.caltech.edu)
-
-
-
- <a href="enhance.html"><b>enhance</b></a>
-</pre>
-</body>
+Content-type: text/html
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML><HEAD><TITLE>Man page of enhance</TITLE>
+</HEAD><BODY>
+<H1>enhance</H1>
+Section: User Commands (1)<BR><A HREF="#index">Index</A>
+<A HREF="index.html">Return to Main Contents</A><HR>
+
+<A NAME="lbAB"> </A>
+<H2>NAME</H2>
+
+enhance - A program that adds command-line editing to third party programs.
+<A NAME="lbAC"> </A>
+<H2>SYNOPSIS</H2>
+
+<PRE>
+enhance command [ argument ... ]
+</PRE>
+
+<P>
+<A NAME="lbAD"> </A>
+<H2>DESCRIPTION</H2>
+
+<P>
+The <B>enhance</B> program provides enhanced command-line editing
+facilities to users of third party applications, to which one doesn't
+have any source code. It does this by placing a pseudo-terminal
+between the application and the real terminal. It uses the tecla
+command-line editing library to read input from the real terminal,
+then forwards each just completed input line to the application via
+the pseudo-terminal. All output from the application is forwarded
+back unchanged to the real terminal.
+<P>
+Whenever the application stops generating output for more than a tenth
+of a second, the <B>enhance</B> program treats the latest incomplete
+output line as the prompt, and redisplays any incompleted input line
+that the user has typed after it. Note that the small delay, which is
+imperceptible to the user, isn't necessary for correct operation of
+the program. It is just an optimization, designed to stop the input
+line from being redisplayed so often that it slows down output.
+<P>
+Note that the user-level command-line editing facilities provided by
+the Tecla library are documented in the <B><A HREF="tecla.html">tecla</A>(7)</B> man page
+<P>
+<A NAME="lbAE"> </A>
+<H2>DEFICIENCIES</H2>
+
+<P>
+The one major problem that hasn't been solved yet, is how to deal with
+applications that change whether typed input is echo'd by their
+controlling terminal. For example, programs that ask for a password,
+such as ftp and telnet, temporarily tell their controlling terminal
+not to echo what the user types. Since this request goes to the
+application side of the psuedo terminal, the <B>enhance</B> program has
+no way of knowing that this has happened, and continues to echo typed
+input to its controlling terminal, while the user types their
+password.
+<P>
+Furthermore, before executing the host application, the <B>enhance</B>
+program initially sets the pseudo terminal to noecho mode, so that
+everything that it sends to the program doesn't get redundantly
+echoed. If a program that switches to noecho mode explicitly restores
+echoing afterwards, rather than restoring the terminal modes that were
+previously in force, then subsequently, every time that you enter a
+new input line, a duplicate copy will be displayed on the next line.
+<P>
+<A NAME="lbAF"> </A>
+<H2>FILES</H2>
+
+<PRE>
+libtecla.a - The tecla library.
+~/.teclarc - The tecla personal customization file.
+</PRE>
+
+<P>
+<A NAME="lbAG"> </A>
+<H2>SEE ALSO</H2>
+
+<A HREF="tecla.html">tecla</A>(7), <A HREF="libtecla.html">libtecla</A>(3)
+<BR>
+<A NAME="lbAH"> </A>
+<H2>AUTHOR</H2>
+
+Martin Shepherd (<A HREF="mailto:mcs at astro.caltech.edu">mcs at astro.caltech.edu</A>)
+<P>
+
+<HR>
+<A NAME="index"> </A><H2>Index</H2>
+<DL>
+<DT><A HREF="#lbAB">NAME</A><DD>
+<DT><A HREF="#lbAC">SYNOPSIS</A><DD>
+<DT><A HREF="#lbAD">DESCRIPTION</A><DD>
+<DT><A HREF="#lbAE">DEFICIENCIES</A><DD>
+<DT><A HREF="#lbAF">FILES</A><DD>
+<DT><A HREF="#lbAG">SEE ALSO</A><DD>
+<DT><A HREF="#lbAH">AUTHOR</A><DD>
+</DL>
+<HR>
+This document was created by
+<A HREF="/cgi-bin/man/man2html">man2html</A>,
+using the manual pages.<BR>
+Time: 03:25:06 GMT, June 12, 2012
+</BODY>
+</HTML>
diff --git a/html/gl_get_line.html b/html/gl_get_line.html
index 3df39d6..644f8ed 100644
--- a/html/gl_get_line.html
+++ b/html/gl_get_line.html
@@ -1,1996 +1,2407 @@
-<head>
-<title>Manual Page</title>
-</head>
-<body>
-<pre>
-<a href="gl_get_line.html"><b>gl_get_line</b></a> <a href="gl_get_line.html"><b>gl_get_line</b></a>
+Content-type: text/html
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML><HEAD><TITLE>Man page of gl_get_line</TITLE>
+</HEAD><BODY>
+<H1>gl_get_line</H1>
+Section: C Library Functions (3)<BR><A HREF="#index">Index</A>
+<A HREF="index.html">Return to Main Contents</A><HR>
+<A NAME="lbAB"> </A>
+<H2>NAME</H2>
-</pre><h2>NAME</h2><pre>
- gl_get_line, new_GetLine, del_GetLine, gl_customize_completion,
- gl_change_terminal, gl_configure_getline, gl_load_history, gl_save_his-
- tory, gl_group_history, gl_show_history, gl_watch_fd, gl_inactiv-
- ity_timeout, gl_terminal_size, gl_set_term_size, gl_resize_history,
- gl_limit_history, gl_clear_history, gl_toggle_history, gl_lookup_his-
- tory, gl_state_of_history, gl_range_of_history, gl_size_of_history,
- gl_echo_mode, gl_replace_prompt, gl_prompt_style, gl_ignore_signal,
- gl_trap_signal, gl_last_signal, gl_completion_action, gl_display_text,
- gl_return_status, gl_error_message, gl_catch_blocked, gl_list_signals,
- gl_bind_keyseq, gl_erase_terminal, gl_automatic_history, gl_append_his-
- tory, gl_query_char, gl_read_char - allow the user to compose an input
- line
+gl_get_line, new_GetLine, del_GetLine, gl_customize_completion,
+gl_change_terminal, gl_configure_getline, gl_load_history,
+gl_save_history, gl_group_history, gl_show_history, gl_watch_fd,
+gl_inactivity_timeout, gl_terminal_size, gl_set_term_size,
+gl_resize_history, gl_limit_history, gl_clear_history,
+gl_toggle_history, gl_lookup_history, gl_state_of_history,
+gl_range_of_history, gl_size_of_history, gl_echo_mode,
+gl_replace_prompt, gl_prompt_style, gl_ignore_signal, gl_trap_signal,
+gl_last_signal, gl_completion_action, gl_display_text,
+gl_return_status, gl_error_message, gl_catch_blocked, gl_list_signals,
+gl_bind_keyseq, gl_erase_terminal, gl_automatic_history, gl_append_history,
+gl_query_char, gl_read_char - allow the user to compose an input line
+<A NAME="lbAC"> </A>
+<H2>SYNOPSIS</H2>
-</pre><h2>SYNOPSIS</h2><pre>
- #include <stdio.h>
- #include <libtecla.h>
+<PRE>
+#include <<A HREF="file:///usr/include/stdio.h">stdio.h</A>>
+#include <<A HREF="file:///usr/include/libtecla.h">libtecla.h</A>>
- GetLine *new_GetLine(size_t linelen, size_t histlen);
+GetLine *new_GetLine(size_t linelen, size_t histlen);
- GetLine *del_GetLine(GetLine *gl);
+GetLine *del_GetLine(GetLine *gl);
- char *gl_get_line(GetLine *gl, const char *prompt,
- const char *start_line, int start_pos);
+char *gl_get_line(GetLine *gl, const char *prompt,
+ const char *start_line, int start_pos);
- int gl_query_char(GetLine *gl, const char *prompt,
- char defchar);
+int gl_query_char(GetLine *gl, const char *prompt,
+ char defchar);
- int gl_read_char(GetLine *gl);
+int gl_read_char(GetLine *gl);
- int gl_customize_completion(GetLine *gl, void *data,
- CplMatchFn *match_fn);
+int gl_customize_completion(GetLine *gl, void *data,
+ CplMatchFn *match_fn);
- int gl_change_terminal(GetLine *gl, FILE *input_fp,
- FILE *output_fp, const char *term);
+int gl_change_terminal(GetLine *gl, FILE *input_fp,
+ FILE *output_fp, const char *term);
- int gl_configure_getline(GetLine *gl,
- const char *app_string,
- const char *app_file,
- const char *user_file);
+int gl_configure_getline(GetLine *gl,
+ const char *app_string,
+ const char *app_file,
+ const char *user_file);
- int gl_bind_keyseq(GetLine *gl, GlKeyOrigin origin,
- const char *keyseq, const char *action);
+int gl_bind_keyseq(GetLine *gl, GlKeyOrigin origin,
+ const char *keyseq, const char *action);
- int gl_save_history(GetLine *gl, const char *filename,
- const char *comment, int max_lines);
+int gl_save_history(GetLine *gl, const char *filename,
+ const char *comment, int max_lines);
- int gl_load_history(GetLine *gl, const char *filename,
- const char *comment);
+int gl_load_history(GetLine *gl, const char *filename,
+ const char *comment);
- int gl_watch_fd(GetLine *gl, int fd, GlFdEvent event,
- GlFdEventFn *callback, void *data);
+int gl_watch_fd(GetLine *gl, int fd, GlFdEvent event,
+ GlFdEventFn *callback, void *data);
- int gl_inactivity_timeout(GetLine *gl, GlTimeoutFn *callback,
- void *data, unsigned long sec,
- unsigned long nsec);
+int gl_inactivity_timeout(GetLine *gl, GlTimeoutFn *callback,
+ void *data, unsigned long sec,
+ unsigned long nsec);
- int gl_group_history(GetLine *gl, unsigned stream);
+int gl_group_history(GetLine *gl, unsigned stream);
- int gl_show_history(GetLine *gl, FILE *fp,
- const char *fmt, int all_groups,
- int max_lines);
+int gl_show_history(GetLine *gl, FILE *fp,
+ const char *fmt, int all_groups,
+ int max_lines);
- int gl_resize_history(GetLine *gl, size_t bufsize);
+int gl_resize_history(GetLine *gl, size_t bufsize);
- void gl_limit_history(GetLine *gl, int max_lines);
+void gl_limit_history(GetLine *gl, int max_lines);
- void gl_clear_history(GetLine *gl, int all_groups);
+void gl_clear_history(GetLine *gl, int all_groups);
- void gl_toggle_history(GetLine *gl, int enable);
+void gl_toggle_history(GetLine *gl, int enable);
- GlTerminalSize gl_terminal_size(GetLine *gl,
- int def_ncolumn,
- int def_nline);
+GlTerminalSize gl_terminal_size(GetLine *gl,
+ int def_ncolumn,
+ int def_nline);
- int gl_set_term_size(GetLine *gl, int ncolumn, int nline);
+int gl_set_term_size(GetLine *gl, int ncolumn, int nline);
- int gl_lookup_history(GetLine *gl, unsigned long id,
- GlHistoryLine *hline);
+int gl_lookup_history(GetLine *gl, unsigned long id,
+ GlHistoryLine *hline);
- void gl_state_of_history(GetLine *gl,
- GlHistoryState *state);
+void gl_state_of_history(GetLine *gl,
+ GlHistoryState *state);
- void gl_range_of_history(GetLine *gl,
- GlHistoryRange *range);
+void gl_range_of_history(GetLine *gl,
+ GlHistoryRange *range);
- void gl_size_of_history(GetLine *gl, GlHistorySize *size);
+void gl_size_of_history(GetLine *gl, GlHistorySize *size);
- void gl_echo_mode(GetLine *gl, int enable);
+void gl_echo_mode(GetLine *gl, int enable);
- void gl_replace_prompt(GetLine *gl, const char *prompt);
+void gl_replace_prompt(GetLine *gl, const char *prompt);
- void gl_prompt_style(GetLine *gl, GlPromptStyle style);
+void gl_prompt_style(GetLine *gl, GlPromptStyle style);
- int gl_ignore_signal(GetLine *gl, int signo);
+int gl_ignore_signal(GetLine *gl, int signo);
- int gl_trap_signal(GetLine *gl, int signo, unsigned flags,
- GlAfterSignal after, int errno_value);
+int gl_trap_signal(GetLine *gl, int signo, unsigned flags,
+ GlAfterSignal after, int errno_value);
- int gl_last_signal(GetLine *gl);
+int gl_last_signal(GetLine *gl);
- int gl_completion_action(GetLine *gl,
- void *data, CplMatchFn *match_fn,
- int list_only, const char *name,
- const char *keyseq);
+int gl_completion_action(GetLine *gl,
+ void *data, CplMatchFn *match_fn,
+ int list_only, const char *name,
+ const char *keyseq);
- int gl_register_action(GetLine *gl, void *data,
- GlActionFn *fn, const char *name,
- const char *keyseq);
-
- int gl_display_text(GetLine *gl, int indentation,
- const char *prefix,
- const char *suffix, int fill_char,
- int def_width, int start,
- const char *string);
-
- GlReturnStatus gl_return_status(GetLine *gl);
-
- const char *gl_error_message(GetLine *gl, char *buff,
- size_t n);
-
- void gl_catch_blocked(GetLine *gl);
-
- int gl_list_signals(GetLine *gl, sigset_t *set);
-
- int gl_append_history(GetLine *gl, const char *line);
-
- int gl_automatic_history(GetLine *gl, int enable);
-
-
-
-</pre><h2>DESCRIPTION</h2><pre>
- The gl_get_line() function is part of the tecla library (see the libte-
- cla(@LIBR_MANEXT@) man page). If the user is typing at a terminal, each
- call prompts them for an line of input, then provides interactive edit-
- ing facilities, similar to those of the unix tcsh shell. In addition to
- simple command-line editing, it supports recall of previously entered
- command lines, TAB completion of file names, and in-line wild-card
- expansion of filenames. Documentation of both the user-level command-
- line editing features and all user configuration options, can be found
- in the <a href="tecla.html"><b>tecla</b></a> man page. This man page concerns itself
- with documentation for programmers interested in using this library in
- their application.
-
-
-</pre><h2>AN EXAMPLE</h2><pre>
- The following shows a complete example of how to use the gl_get_line()
- function to get input from the user:
-
- #include <stdio.h>
- #include <locale.h>
- #include <libtecla.h>
-
- int main(int argc, char *argv[])
- {
- char *line; /* The line that the user typed */
- GetLine *gl; /* The gl_get_line() resource object */
-
- setlocale(LC_CTYPE, ""); /* Adopt the user's choice */
- /* of character set. */
-
- gl = new_GetLine(1024, 2048);
- if(!gl)
- return 1;
-
- while((line=gl_get_line(gl, "$ ", NULL, -1)) != NULL &&
- strcmp(line, "exit\n") != 0)
- printf("You typed: %s\n", line);
-
- gl = del_GetLine(gl);
- return 0;
- }
-
- In the example, first the resources needed by the gl_get_line() func-
- tion are created by calling new_GetLine(). This allocates the memory
- used in subsequent calls to the gl_get_line() function, including the
- history buffer for recording previously entered lines. Then one or more
- lines are read from the user, until either an error occurs, or the user
- types exit. Then finally the resources that were allocated by new_Get-
- Line(), are returned to the system by calling del_GetLine(). Note the
- use of the NULL return value of del_GetLine() to make gl NULL. This is
- a safety precaution. If the program subsequently attempts to pass gl to
- gl_get_line(), said function will complain, and return an error,
- instead of attempting to use the deleted resource object.
-
-
-
-</pre><h2>THE FUNCTIONS USED IN THE EXAMPLE</h2><pre>
- The descriptions of the functions used in the example are as follows:
-
- GetLine *new_GetLine(size_t linelen, size_t histlen)
-
- This function creates the resources used by the gl_get_line() function
- and returns an opaque pointer to the object that contains them. The
- maximum length of an input line is specified via the linelen argument,
- and the number of bytes to allocate for storing history lines is set by
- the histlen argument. History lines are stored back-to-back in a single
- buffer of this size. Note that this means that the number of history
- lines that can be stored at any given time, depends on the lengths of
- the individual lines. If you want to place an upper limit on the num-
- ber of lines that can be stored, see the gl_limit_history() function
- described later. If you don't want history at all, specify histlen as
- zero, and no history buffer will be allocated.
-
- On error, a message is printed to stderr and NULL is returned.
-
- GetLine *del_GetLine(GetLine *gl)
-
- This function deletes the resources that were returned by a previous
- call to new_GetLine(). It always returns NULL (ie a deleted object). It
- does nothing if the gl argument is NULL.
-
- char *gl_get_line(GetLine *gl, const char *prompt,
- const char *start_line, int start_pos);
-
- The gl_get_line() function can be called any number of times to read
- input from the user. The gl argument must have been previously returned
- by a call to new_GetLine(). The prompt argument should be a normal NUL
- terminated string, specifying the prompt to present the user with. By
- default prompts are displayed literally, but if enabled with the
- gl_prompt_style() function (see later), prompts can contain directives
- to do underlining, switch to and from bold fonts, or turn highlighting
- on and off.
-
- If you want to specify the initial contents of the line, for the user
- to edit, pass the desired string via the start_line argument. You can
- then specify which character of this line the cursor is initially posi-
- tioned over, using the start_pos argument. This should be -1 if you
- want the cursor to follow the last character of the start line. If you
- don't want to preload the line in this manner, send start_line as NULL,
- and set start_pos to -1. Note that the line pointer returned by one
- call to gl_get_line() can be passed back to the next call to
- gl_get_line() via the start_line. This allows the application to take
- the last entered line, and if it contains an error, to then present it
- back to the user for re-editing, with the cursor initially positioned
- where the error was encountered.
-
- The gl_get_line() function returns a pointer to the line entered by the
- user, or NULL on error or at the end of the input. The returned pointer
- is part of the specified gl resource object, and thus should not be
- free'd by the caller, or assumed to be unchanging from one call to the
- next. When reading from a user at a terminal, there will always be a
- newline character at the end of the returned line. When standard input
- is being taken from a pipe or a file, there will similarly be a newline
- unless the input line was too long to store in the internal buffer. In
- the latter case you should call gl_get_line() again to read the rest of
- the line. Note that this behavior makes gl_get_line() similar to
- fgets(). In fact when stdin isn't connected to a termi-
- nal,gl_get_line() just calls fgets().
-
-
-</pre><h2>THE RETURN STATUS OF GL_GET_LINE</h2><pre>
- As described above, the gl_get_line() function has two possible return
- values; a pointer to the completed input line, or NULL. Extra informa-
- tion about what caused gl_get_line() to return is available both by
- inspecting errno, and by calling the gl_return_status() function.
-
-
- GlReturnStatus gl_return_status(GetLine *gl);
-
-
- The following are the possible enumerated values that this function
- returns.
-
-
- GLR_NEWLINE - The last call to gl_get_line()
- successfully returned a completed
- input line.
-
- GLR_BLOCKED - gl_get_line() was in non-blocking
- server mode, and returned early to
- avoid blocking the process while
- waiting for terminal I/O. The
- gl_pending_io() function can be
- used to see what type of I/O
- gl_get_line() was waiting for.
- (see the <a href="gl_io_mode.html"><b>gl_io_mode</b></a> man page
- for details).
-
- GLR_SIGNAL - A signal was caught by
- gl_get_line() that had an
- after-signal disposition of
- GLS_ABORT (See gl_trap_signal()).
-
- GLR_TIMEOUT - The inactivity timer expired while
- gl_get_line() was waiting for
- input, and the timeout callback
- function returned GLTO_ABORT.
- See gl_inactivity_timeout() for
- information about timeouts.
-
- GLR_FDABORT - An application I/O callack returned
- GLFD_ABORT (see gl_watch_fd()).
-
- GLR_EOF - End of file reached. This can happen
- when input is coming from a file or a
- pipe, instead of the terminal. It also
- occurs if the user invokes the
- list-or-eof or del-char-or-list-or-eof
- actions at the start of a new line.
-
- GLR_ERROR - An unexpected error caused
- gl_get_line() to abort (consult
- errno and/or
- gl_error_message() for details.
-
-
- When gl_return_status() returns GLR_ERROR, and the value of errno isn't
- sufficient to explain what happened, you can use the gl_error_message()
- function to request a description of the last error that occurred.
-
-
- const char *gl_error_message(GetLine *gl, char *buff,
- size_t n);
-
-
- The return value is a pointer to the message that occurred. If the buff
- argument is NULL, this will be a pointer to a buffer within gl, who's
- value will probably change on the next call to any function associated
- with gl_get_line(). Otherwise, if a non-NULL buff argument is provided,
- the error message, including a '\0' terminator, will be written within
- the first n elements of this buffer, and the return value will be a
- pointer to the first element of this buffer. If the message won't fit
- in the provided buffer, it will be truncated to fit.
-
-
-</pre><h2>OPTIONAL PROMPT FORMATTING</h2><pre>
- Whereas by default the prompt string that you specify is displayed lit-
- erally, without any special interpretation of the characters within it,
- the gl_prompt_style() function can be used to enable optional format-
- ting directives within the prompt.
-
- void gl_prompt_style(GetLine *gl, GlPromptStyle style);
-
- The style argument, which specifies the formatting style, can take any
- of the following values:
-
- GL_FORMAT_PROMPT - In this style, the formatting
- directives described below, when
- included in prompt strings, are
- interpreted as follows:
-
- %B - Display subsequent
- characters with a bold
- font.
- %b - Stop displaying characters
- with the bold font.
- %F - Make subsequent characters
- flash.
- %f - Turn off flashing
- characters.
- %U - Underline subsequent
- characters.
- %u - Stop underlining
- characters.
- %P - Switch to a pale (half
- brightness) font.
- %p - Stop using the pale font.
- %S - Highlight subsequent
- characters (also known as
- standout mode).
- %s - Stop highlighting
- characters.
- %V - Turn on reverse video.
- %v - Turn off reverse video.
- %% - Display a single %
- character.
-
- For example, in this mode, a prompt
- string like "%UOK%u$ " would
- display the prompt "OK$ ",
- but with the OK part
- underlined.
-
- Note that although a pair of
- characters that starts with a %
- character, but doesn't match any of
- the above directives is displayed
- literally, if a new directive is
- subsequently introduced which does
- match, the displayed prompt will
- change, so it is better to always
- use %% to display a literal %.
-
- Also note that not all terminals
- support all of these text
- attributes, and that some substitute
- a different attribute for missing
- ones.
-
- GL_LITERAL_PROMPT - In this style, the prompt string is
- printed literally. This is the
- default style.
-
-
-</pre><h2>ALTERNATE CONFIGURATION SOURCES</h2><pre>
- As mentioned above, by default users have the option of configuring the
- behavior of gl_get_line() via a configuration file called .teclarc in
- their home directories. The fact that all applications share this same
- configuration file is both an advantage and a disadvantage. In most
- cases it is an advantage, since it encourages uniformity, and frees the
- user from having to configure each application separately. In some
- applications, however, this single means of configuration is a problem.
- This is particularly true of embedded software, where there's no
- filesystem to read a configuration file from, and also in applications
- where a radically different choice of keybindings is needed to emulate
- a legacy keyboard interface. To cater for such cases, the following
- function allows the application to control where configuration informa-
- tion is read from.
-
-
- int gl_configure_getline(GetLine *gl,
- const char *app_string,
- const char *app_file,
- const char *user_file);
-
-
- It allows the configuration commands that would normally be read from a
- user's ~/.teclarc file, to be read from any or none of, a string, an
- application specific configuration file, and/or a user-specific config-
- uration file. If this function is called before the first call to
- gl_get_line(), the default behavior of reading ~/.teclarc on the first
- call to gl_get_line() is disabled, so all configuration must be
- achieved using the configuration sources specified with this function.
-
- If app_string != NULL, then it is interpreted as a string containing
- one or more configuration commands, separated from each other in the
- string by embedded newline characters. If app_file != NULL then it is
- interpreted as the full pathname of an application-specific configura-
- tion file. If user_file != NULL then it is interpreted as the full
- pathname of a user-specific configuration file, such as ~/.teclarc. For
- example, in the following call,
-
-
- gl_configure_getline(gl, "edit-mode vi \n nobeep",
- "/usr/share/myapp/teclarc",
- "~/.teclarc");
-
-
- the app_string argument causes the calling application to start in vi
- edit-mode, instead of the default emacs mode, and turns off the use of
- the terminal bell by the library. It then attempts to read system-wide
- configuration commands from an optional file called
- /usr/share/myapp/teclarc, then finally reads user-specific configura-
- tion commands from an optional .teclarc file in the user's home direc-
- tory. Note that the arguments are listed in ascending order of prior-
- ity, with the contents of app_string being potentially overriden by
- commands in app_file, and commands in app_file potentially being over-
- riden by commands in user_file.
-
- You can call this function as many times as needed, the results being
- cumulative, but note that copies of any filenames specified via the
- app_file and user_file arguments are recorded internally for subsequent
- use by the read-init-files key-binding function, so if you plan to call
- this function multiple times, be sure that the last call specifies the
- filenames that you want re-read when the user requests that the config-
- uration files be re-read.
-
- Individual key sequences can also be bound and unbound using the
- gl_bind_keyseq() function.
-
-
- int gl_bind_keyseq(GetLine *gl, GlKeyOrigin origin,
- const char *keyseq,
- const char *action);
-
-
- The origin argument specifies the priority of the binding, according to
- who it is being established for, and must be one of the following two
- values.
-
- GL_USER_KEY - The user requested this key-binding.
- GL_APP_KEY - This is a default binding set by the
- application.
-
- When both user and application bindings for a given key-sequence have
- been specified, the user binding takes precedence. The application's
- binding is subsequently reinstated if the user's binding is later
- unbound via either another to this function, or a call to gl_config-
- ure_getline().
-
- The keyseq argument specifies the key-sequence to be bound or unbound,
- and is expressed in the same way as in a ~/.teclarc configuration file.
- The action argument must either be a string containing the name of the
- action to bind the key-sequence to, or it must be NULL or "" to unbind
- the key-sequence.
-
-
-</pre><h2>CUSTOMIZED WORD COMPLETION</h2><pre>
- If in your application, you would like to have TAB completion complete
- other things in addition to or instead of filenames, you can arrange
- this by registering an alternate completion callback function, via a
- call to the gl_customize_completion() function.
-
- int gl_customize_completion(GetLine *gl, void *data,
- CplMatchFn *match_fn);
-
- The data argument provides a way for your application to pass arbi-
- trary, application-specific information to the callback function. This
- is passed to the callback every time that it is called. It might for
- example, point to the symbol table from which possible completions are
- to be sought. The match_fn argument specifies the callback function to
- be called. The CplMatchFn function type is defined in libtecla.h, as is
- a CPL_MATCH_FN() macro that you can use to declare and prototype call-
- back functions. The declaration and responsibilities of callback func-
- tions are described in depth in the <a href="cpl_complete_word.html"><b>cpl_complete_word</b></a>
- man page.
-
- In brief, the callback function is responsible for looking backwards in
- the input line, back from the point at which the user pressed TAB, to
- find the start of the word being completed. It then must lookup possi-
- ble completions of this word, and record them one by one in the Word-
- Completion object that is passed to it as an argument, by calling the
- cpl_add_completion() function. If the callback function wishes to pro-
- vide filename completion in addition to its own specific completions,
- it has the option of itself calling the builtin file-name completion
- callback. This also, is documented in the cpl_com-
- plete_word(@FUNC_MANEXT@) man page.
-
- Note that if you would like gl_get_line() to return the current input
- line when a successful completion is been made, you can arrange this
- when you call cpl_add_completion(), by making the last character of the
- continuation suffix a newline character. If you do this, the input line
- will be updated to display the completion, together with any
- contiuation suffix up to the newline character, then gl_get_line() will
- return this input line.
-
-
- If, for some reason, your callback function needs to write something to
- the terminal, it must call gl_normal_io() before doing so. This will
- start a new line after the input line that is currently being edited,
- reinstate normal terminal I/O, and tell gl_get_line() that the input
- line will need to be redrawn when the callback returns.
-
-
-</pre><h2>ADDING COMPLETION ACTIONS</h2><pre>
- In the previous section the ability to customize the behavior of the
- only default completion action, complete-word, was described. In this
- section the ability to install additional action functions, so that
- different types of word completion can be bound to different key-
- sequences, is described. This is achieved by using the gl_comple-
- tion_action() function.
-
-
- int gl_completion_action(GetLine *gl,
- void *data, CplMatchFn *match_fn,
- int list_only, const char *name,
- const char *keyseq);
-
-
- The data and match_fn arguments are as described in the cpl_com-
- plete_word man page, and specify the callback function that should be
- invoked to identify possible completions. The list_only argument
- determines whether the action that is being defined should attempt to
- complete the word as far as possible in the input line before display-
- ing any possible ambiguous completions, or whether it should simply
- display the list of possible completions without touching the input
- line. The former option is selected by specifying a value of 0, and the
- latter by specifying a value of 1. The name argument specifies the name
- by which configuration files and future invokations of this function
- should refer to the action. This must either be the name of an existing
- completion action to be changed, or be a new unused name for a new
- action. Finally, the keyseq argument specifies the default key-sequence
- to bind the action to. If this is NULL, no new keysequence will be
- bound to the action.
-
- Beware that in order for the user to be able to change the key-sequence
- that is bound to actions that are installed in this manner, when you
- call gl_completion_action() to install a given action for the first
- time, you should do this between calling new_GetLine() and the first
- call to gl_get_line(). Otherwise, when the user's configuration file
- is read on the first call to gl_get_line(), the name of the your addi-
- tional action won't be known, and any reference to it in the configura-
- tion file will generate an error.
-
- As discussed for gl_customize_completion(), if your callback function,
- for some reason, needs to write anything to the terminal, it must call
- gl_normal_io() before doing so.
-
-
-</pre><h2>DEFINING CUSTOM ACTIONS</h2><pre>
- Although the built-in key-binding actions are sufficient for the needs
- of most applications, occasionally a specialized application may need
- to define one or more custom actions, bound to application-specific
- key-sequences. For example, a sales application would benefit from hav-
- ing a key-sequence that displayed the part name that corresponded to a
- part number preceding the cursor. Such a feature is clearly beyond the
- scope of the built-in action functions. So for such special cases, the
- gl_register_action() function is provided.
-
-
- int gl_register_action(GetLine *gl, void *data,
+int gl_register_action(GetLine *gl, void *data,
GlActionFn *fn, const char *name,
const char *keyseq);
-
- This function lets the application register an external function, fn,
- that will thereafter be called whenever either the specified key-
- sequence, keyseq, is entered by the user, or the user enters any other
- key-sequence that the user subsequently binds to the specified action
- name, name, in their configuration file. The data argument can be a
- pointer to anything that the application wishes to have passed to the
- action function, fn, whenever that function is invoked.
-
- The action function, fn, should be declared using the following macro,
- which is defined in libtecla.h.
-
-
- #define GL_ACTION_FN(fn) GlAfterAction (fn)(GetLine *gl, \
- void *data, int count, size_t curpos, \
- const char *line)
-
-
- The gl and data arguments are those that were previously passed to
- gl_register_action() when the action function was registered. The count
- argument is a numeric argument which the user has the option of enter-
- ing using the digit-argument action, before invoking the action. If the
- user doesn't enter a number, then the count argument is set to 1. Nomi-
- nally this argument is interpreted as a repeat count, meaning that the
- action should be repeated that many times. In practice however, for
- some actions a repeat count makes little sense. In such cases, actions
- can either simply ignore the count argument, or use its value for a
- different purpose.
-
- A copy of the current input line is passed in the read-only line argu-
- ment. The current cursor position within this string is given by the
- index contained in the curpos argument. Note that direct manipulation
- of the input line and the cursor position is not permitted. This is
- because the rules dicated by various modes, such as vi mode versus
- emacs mode, no-echo mode, and insert mode versus overstrike mode etc,
- make it too complex for an application writer to write a conforming
- editing action, as well as constrain future changes to the internals of
- gl_get_line(). A potential solution to this dilema would be to allow
- the action function to edit the line using the existing editing
- actions. This is currently under consideration.
-
- If the action function wishes to write text to the terminal, without
- this getting mixed up with the displayed text of the input line, or
- read from the terminal without having to handle raw terminal I/O, then
- before doing either of these operations, it must temporarily suspend
- line editing by calling the gl_normal_io() function. This function
- flushes any pending output to the terminal, moves the cursor to the
- start of the line that follows the last terminal line of the input
- line, then restores the terminal to a state that is suitable for use
- with the C stdio facilities. The latter includes such things as restor-
- ing the normal mapping of \n to \r\n, and, when in server mode, restor-
- ing the normal blocking form of terminal I/O. Having called this func-
- tion, the action function can read from and write to the terminal with-
- out the fear of creating a mess. It isn't necessary for the action
- function to restore the original editing environment before it returns.
- This is done automatically by gl_get_line() after the action function
- returns. The following is a simple example of an action function which
- writes the sentence "Hello world" on a new terminal line after the line
- being edited. When this function returns, the input line is redrawn on
- the line that follows the "Hello world" line, and line editing resumes.
-
-
- static GL_ACTION_FN(say_hello_fn)
- {
- if(gl_normal_io(gl)) /* Temporarily suspend editing */
- return GLA_ABORT;
- printf("Hello world\n");
- return GLA_CONTINUE;
- }
-
-
- Action functions must return one of the following values, to tell
- gl_get_line() how to procede.
-
-
- GLA_ABORT - Cause gl_get_line() to return NULL.
- GLA_RETURN - Cause gl_get_line() to return the
- completed input line.
- GLA_CONTINUE - Resume command-line editing.
-
-
- Note that the name argument of gl_register_action() specifies the name
- by which a user can refer to the action in their configuration file.
- This allows them to re-bind the action to an alternate key-seqeunce. In
- order for this to work, it is necessary to call gl_register_action()
- between calling new_GetLine() and the first call to gl_get_line().
-
-
-</pre><h2>HISTORY FILES</h2><pre>
- To save the contents of the history buffer before quitting your appli-
- cation, and subsequently restore them when you next start the applica-
- tion, the following functions are provided.
-
-
- int gl_save_history(GetLine *gl, const char *filename,
- const char *comment, int max_lines);
- int gl_load_history(GetLine *gl, const char *filename,
- const char *comment);
-
-
- The filename argument specifies the name to give the history file when
- saving, or the name of an existing history file, when loading. This may
- contain home-directory and environment variable expressions, such as
- "~/.myapp_history" or "$HOME/.myapp_history".
-
- Along with each history line, extra information about it, such as when
- it was entered by the user, and what its nesting level is, is recorded
- as a comment preceding the line in the history file. Writing this as a
- comment allows the history file to double as a command file, just in
- case you wish to replay a whole session using it. Since comment pre-
- fixes differ in different languages, the comment argument is provided
- for specifying the comment prefix. For example, if your application
- were a unix shell, such as the bourne shell, you would specify "#"
- here. Whatever you choose for the comment character, you must specify
- the same prefix to gl_load_history() that you used when you called
- gl_save_history() to write the history file.
-
- The max_lines must be either -1 to specify that all lines in the his-
- tory list be saved, or a positive number specifying a ceiling on how
- many of the most recent lines should be saved.
-
- Both fuctions return non-zero on error, after writing an error message
- to stderr. Note that gl_load_history() does not consider the non-exis-
- tence of a file to be an error.
-
-
-</pre><h2>MULTIPLE HISTORY LISTS</h2><pre>
- If your application uses a single GetLine object for entering many dif-
- ferent types of input lines, you may wish gl_get_line() to distinguish
- the different types of lines in the history list, and only recall lines
- that match the current type of line. To support this requirement,
- gl_get_line() marks lines being recorded in the history list with an
- integer identifier chosen by the application. Initially this identi-
- fier is set to 0 by new_GetLine(), but it can be changed subsequently
- by calling gl_group_history().
-
-
- int gl_group_history(GetLine *gl, unsigned id);
-
-
- The integer identifier id can be any number chosen by the application,
- but note that gl_save_history() and gl_load_history() preserve the
- association between identifiers and historical input lines between pro-
- gram invokations, so you should choose fixed identifiers for the dif-
- ferent types of input line used by your application.
-
- Whenever gl_get_line() appends a new input line to the history list,
- the current history identifier is recorded with it, and when it is
- asked to recall a historical input line, it only recalls lines that are
- marked with the current identifier.
-
-
-</pre><h2>DISPLAYING HISTORY</h2><pre>
- The history list can be displayed by calling gl_show_history().
-
-
- int gl_show_history(GetLine *gl, FILE *fp,
- const char *fmt,
- int all_groups,
- int max_lines);
-
-
- This displays the current contents of the history list to the stdio
- output stream fp. If the max_lines argument is greater than or equal to
- zero, then no more than this number of the most recent lines will be
- displayed. If the all_groups argument is non-zero, lines from all his-
- tory groups are displayed. Otherwise just those of the currently
- selected history group are displayed. The format string argument, fmt,
- determines how the line is displayed. This can contain arbitrary char-
- acters which are written verbatim, interleaved with any of the follow-
- ing format directives:
-
- %D - The date on which the line was originally
- entered, formatted like 2001-11-20.
- %T - The time of day when the line was entered,
- formatted like 23:59:59.
- %N - The sequential entry number of the line in
- the history buffer.
- %G - The number of the history group which the
- line belongs to.
- %% - A literal % character.
- %H - The history line itself.
-
- Thus a format string like "%D %T %H0 would output something like:
-
- 2001-11-20 10:23:34 Hello world
-
- Note the inclusion of an explicit newline character in the format
- string.
-
-
-</pre><h2>LOOKING UP HISTORY</h2><pre>
- The gl_lookup_history() function allows the calling application to look
- up lines in the history list.
-
-
- typedef struct {
- const char *line; /* The requested historical */
- /* line. */
- unsigned group; /* The history group to which */
- /* the line belongs. */
- time_t timestamp; /* The date and time at which */
- /* the line was originally */
- /* entered. */
- } GlHistoryLine;
-
- int gl_lookup_history(GetLine *gl, unsigned long id,
- GlHistoryLine *hline);
-
-
- The id argument indicates which line to look up, where the first line
- that was entered in the history list after new_GetLine() was called, is
- denoted by 0, and subsequently entered lines are denoted with succes-
- sively higher numbers. Note that the range of lines currently preserved
- in the history list can be queried by calling the gl_range_of_history()
- function, described later. If the requested line is in the history
- list, the details of the line are recorded in the variable pointed to
- by the hline argument, and 1 is returned. Otherwise 0 is returned, and
- the variable pointed to by hline is left unchanged.
-
- Beware that the string returned in hline->line is part of the history
- buffer, so it must not be modified by the caller, and will be recycled
- on the next call to any function that takes gl as its argument. There-
- fore you should make a private copy of this string if you need to keep
- it around.
-
-
-</pre><h2>MANUAL HISTORY ARCHIVAL</h2><pre>
- By default, whenever a line is entered by the user, it is automatically
- appended to the history list, just before gl_get_line() returns the
- line to the caller. This is convenient for the majority of applica-
- tions, but there are also applications that need finer grained control
- over what gets added to the history list. In such cases, the automatic
- addition of entered lines to the history list can be turned off by
- calling the gl_automatic_history() function.
-
-
- int gl_automatic_history(GetLine *gl, int enable);
-
-
- If this function is called with its enable argument set to 0,
- gl_get_line() won't automatically archive subsequently entered lines.
- Automatic archiving can be reenabled at a later time, by calling this
- function again, with its enable argument set to 1. While automatic
- history archiving is disabled, the calling application can use the
- gl_append_history() to append lines to the history list as needed.
-
-
- int gl_append_history(GetLine *gl, const char *line);
-
-
- The line argument specifies the line to be added to the history list.
- This must be a normal ' ' terminated string. If this string contains
- any newline characters, the line that gets archived in the history list
- will be terminated by the first of these. Otherwise it will be termi-
- nated by the ' ' terminator. If the line is longer than the maximum
- input line length, that was specified when new_GetLine() was called,
- when the line is recalled, it will get truncated to the actual
- gl_get_line() line length.
-
- If successful, gl_append_history() returns 0. Otherwise it returns non-
- zero, and sets errno to one of the following values.
-
-
- EINVAL - One of the arguments passed to
- gl_append_history() was NULL.
- ENOMEM - The specified line was longer than the allocated
- size of the history buffer (as specified when
- new_GetLine() was called), so it couldn't be
- archived.
-
-
- A textual description of the error can optionally be obtained by call-
- ing gl_error_message(). Note that after such an error, the history list
- remains in a valid state to receive new history lines, so there is lit-
- tle harm in simply ignoring the return status of gl_append_history().
-
-
-</pre><h2>MISCELLANEOUS HISTORY CONFIGURATION</h2><pre>
- If you wish to change the size of the history buffer that was origi-
- nally specified in the call to new_GetLine(), you can do so with the
- gl_resize_history() function.
-
-
- int gl_resize_history(GetLine *gl, size_t histlen);
-
-
- The histlen argument specifies the new size in bytes, and if you spec-
- ify this as 0, the buffer will be deleted.
-
- As mentioned in the discussion of new_GetLine(), the number of lines
- that can be stored in the history buffer, depends on the lengths of the
- individual lines. For example, a 1000 byte buffer could equally store
- 10 lines of average length 100 bytes, or 2 lines of average length 50
- bytes. Although the buffer is never expanded when new lines are added,
- a list of pointers into the buffer does get expanded when needed to
- accomodate the number of lines currently stored in the buffer. To place
- an upper limit on the number of lines in the buffer, and thus a ceiling
- on the amount of memory used in this list, you can call the
- gl_limit_history() function.
-
-
- void gl_limit_history(GetLine *gl, int max_lines);
-
-
- The max_lines should either be a positive number >= 0, specifying an
- upper limit on the number of lines in the buffer, or be -1 to cancel
- any previously specified limit. When a limit is in effect, only the
- max_lines most recently appended lines are kept in the buffer. Older
- lines are discarded.
-
- To discard lines from the history buffer, use the gl_clear_history()
- function.
-
- void gl_clear_history(GetLine *gl, int all_groups);
-
- The all_groups argument tells the function whether to delete just the
- lines associated with the current history group (see gl_group_his-
- tory()), or all historical lines in the buffer.
-
- The gl_toggle_history() function allows you to toggle history on and
- off without losing the current contents of the history list.
-
-
- void gl_toggle_history(GetLine *gl, int enable);
-
-
- Setting the enable argument to 0 turns off the history mechanism, and
- setting it to 1 turns it back on. When history is turned off, no new
- lines will be added to the history list, and history lookup key-bind-
- ings will act as though there is nothing in the history buffer.
-
-
-</pre><h2>QUERYING HISTORY INFORMATION</h2><pre>
- The configured state of the history list can be queried with the
- gl_history_state() function.
-
-
- typedef struct {
- int enabled; /* True if history is enabled */
- unsigned group; /* The current history group */
- int max_lines; /* The current upper limit on the */
- /* number of lines in the history */
- /* list, or -1 if unlimited. */
- } GlHistoryState;
-
- void gl_state_of_history(GetLine *gl,
- GlHistoryState *state);
-
- On return, the status information is recorded in the variable pointed
- to by the state argument.
-
- The gl_range_of_history() function returns the number and range of
- lines in the history list.
-
-
- typedef struct {
- unsigned long oldest; /* The sequential entry number */
- /* of the oldest line in the */
- /* history list. */
- unsigned long newest; /* The sequential entry number */
- /* of the newest line in the */
- /* history list. */
- int nlines; /* The number of lines in the */
- /* history list. */
- } GlHistoryRange;
-
- void gl_range_of_history(GetLine *gl, GlHistoryRange *range);
-
- The return values are recorded in the variable pointed to by the range
- argument. If the nlines member of this structure is greater than zero,
- then the oldest and newest members report the range of lines in the
- list, and newest=oldest+nlines-1. Otherwise they are both zero.
-
- The gl_size_of_history() function returns the total size of the history
- buffer and the amount of the buffer that is currently occupied.
-
- typedef struct {
- size_t size; /* The size of the history buffer */
- /* (bytes). */
- size_t used; /* The number of bytes of the */
- /* history buffer that are */
- /* currently occupied. */
- } GlHistorySize;
-
- void gl_size_of_history(GetLine *gl, GlHistorySize *size);
-
- On return, the size information is recorded in the variable pointed to
- by the size argument.
-
-
-</pre><h2>CHANGING TERMINALS</h2><pre>
- The new_GetLine() constructor function assumes that input is to be read
- from stdin, and output written to stdout. The following function allows
- you to switch to different input and output streams.
-
- int gl_change_terminal(GetLine *gl, FILE *input_fp,
- FILE *output_fp, const char *term);
-
- The gl argument is the object that was returned by new_GetLine(). The
- input_fp argument specifies the stream to read from, and output_fp
- specifies the stream to be written to. Only if both of these refer to a
- terminal, will interactive terminal input be enabled. Otherwise
- gl_get_line() will simply call fgets() to read command input. If both
- streams refer to a terminal, then they must refer to the same terminal,
- and the type of this terminal must be specified via the term argument.
- The value of the term argument is looked up in the terminal information
- database (terminfo or termcap), in order to determine which special
- control sequences are needed to control various aspects of the termi-
- nal. new_GetLine() for example, passes the return value of
- getenv("TERM") in this argument. Note that if one or both of input_fp
- and output_fp don't refer to a terminal, then it is legal to pass NULL
- instead of a terminal type.
-
- Note that if you want to pass file descriptors to gl_change_terminal(),
- you can do this by creating stdio stream wrappers using the POSIX
- fdopen() function.
-
-
-</pre><h2>EXTERNAL EVENT HANDLING</h2><pre>
- By default, gl_get_line() doesn't return until either a complete input
- line has been entered by the user, or an error occurs. In programs that
- need to watch for I/O from other sources than the terminal, there are
- two options.
-
-
- 1. Use the functions described in the
- <a href="gl_io_mode.html"><b>gl_io_mode</b></a> man page to switch
- gl_get_line() into non-blocking server mode. In this mode,
- gl_get_line() becomes a non-blocking, incremental
- line-editing function that can safely be called from
- an external event loop. Although this is a very
- versatile method, it involves taking on some
- responsibilities that are normally performed behind
- the scenes by gl_get_line().
-
- 2. While gl_get_line() is waiting for keyboard
- input from the user, you can ask it to also watch for
- activity on arbitrary file descriptors, such as
- network sockets, pipes etc, and have it call functions
- of your choosing when activity is seen. This works on
- any system that has the select() system call,
- which is most, if not all flavors of unix.
-
-
- Registering a file descriptor to be watched by gl_get_line() involves
- calling the gl_watch_fd() function.
-
-
- int gl_watch_fd(GetLine *gl, int fd, GlFdEvent event,
- GlFdEventFn *callback, void *data);
-
-
- If this returns non-zero, then it means that either your arguments are
- invalid, or that this facility isn't supported on the host system.
-
- The fd argument is the file descriptor to be watched. The event argu-
- ment specifies what type of activity is of interest, chosen from the
- following enumerated values:
-
-
- GLFD_READ - Watch for the arrival of data to be read.
- GLFD_WRITE - Watch for the ability to write to the file
- descriptor without blocking.
- GLFD_URGENT - Watch for the arrival of urgent
- out-of-band data on the file descriptor.
-
-
- The callback argument is the function to call when the selected
- activity is seen. It should be defined with the following macro, which
- is defined in libtecla.h.
-
-
- #define GL_FD_EVENT_FN(fn) GlFdStatus (fn)(GetLine *gl, \
- void *data, int fd, \
- GlFdEvent event)
-
- The data argument of the gl_watch_fd() function is passed to the call-
- back function for its own use, and can point to anything you like,
- including NULL. The file descriptor and the event argument are also
- passed to the callback function, and this potentially allows the same
- callback function to be registered to more than one type of event
- and/or more than one file descriptor. The return value of the callback
- function should be one of the following values.
-
-
- GLFD_ABORT - Tell gl_get_line() to abort. When this
- happens, gl_get_line() returns
- NULL, and a following call to
- gl_return_status() will return
- GLR_FDABORT. Note that if the
- application needs errno always to
- have a meaningful value when
- gl_get_line() returns NULL,
- the callback function should set
- errno appropriately.
- GLFD_REFRESH - Redraw the input line then continue
- waiting for input. Return this if
- your callback wrote to the terminal.
- GLFD_CONTINUE - Continue to wait for input, without
- redrawing the line.
-
- Note that before calling the callback, gl_get_line() blocks most sig-
- nals, and leaves its own signal handlers installed, so if you need to
- catch a particular signal you will need to both temporarily install
- your own signal handler, and unblock the signal. Be sure to re-block
- the signal (if it was originally blocked) and reinstate the original
- signal handler, if any, before returning.
-
-
-
- If the callback function needs to read or write to the terminal, it
- should ideally first call gl_normal_io(gl) to temporarily suspend line
- editing. This will restore the terminal to canonical, blocking-I/O,
- mode, and move the cursor to the start of a new terminal line. Later,
- when the callback returns, gl_get_line() will notice that gl_nor-
- mal_io() was called, redisplay the input line and resume editing. Note
- that in this case the return values, GLFD_REFRESH and GLFD_CONTINUE are
- equivalent.
-
-
-
- To support cases where the callback function calls a third-party func-
- tion which occasionally and u0prisicre-enabledesbeforee themicallback
- automatic conversion of "0 to "
- function is called. If the callack knows that the third-party function
- wrote to the terminal, it should then return the GLFD_REFRESH return
- value, to tell gl_get_line() to redisplay the input line.
-
-
-
- To remove a callback function that you previously registered for a
- given file descriptor and event, simply call gl_watch_fd() with the
- same file descriptor and event arguments, but with a callback argument
- of 0. The data argument is ignored in this case.
-
-
-</pre><h2>SETTING AN INACTIVITY TIMEOUT</h2><pre>
- On systems with the select() system call, the gl_inactivity_timeout()
- function can be used to set or cancel an inactivity timeout. Inactivity
- in this case refers both to keyboard input, and to I/O on any file
- descriptors registered by prior and subsequent calls to gl_watch_fd().
- On oddball systems that don't have select(), this call has no effect.
-
-
- int gl_inactivity_timeout(GetLine *gl, GlTimeoutFn *callback,
- void *data, unsigned long sec,
- unsigned long nsec);
-
-
- The timeout is specified in the form of an integral number of seconds
- and an integral number of nanoseconds, via the sec and nsec arguments
- respectively. Subsequently, whenever no activity is seen for this time
- period, the function specified via the callback argument is called. The
- data argument of gl_inactivity_timeout() is passed verbatim to this
- callback function whenever it is invoked, and can thus be used to pass
- arbitrary application-specific information to the callback. The follow-
- ing macro is provided in libtecla.h for applications to use to declare
- and prototype timeout callback functions.
-
-
- #define GL_TIMEOUT_FN(fn) \
- GlAfterTimeout (fn)(GetLine *gl, void *data)
-
-
- On returning, the application's callback is expected to return one of
- the following enumerators to tell gl_get_line() how to procede after
- the timeout has been handled by the callback.
-
-
- GLTO_ABORT - Tell gl_get_line() to abort. When
- this happens, gl_get_line() will
- return NULL, and a following call
- to gl_return_status() will return
- GLR_TIMEOUT. Note that if the
- application needs errno always to
- have a meaningful value when
- gl_get_line() returns NULL,
- the callback function should set
- errno appropriately.
- GLTO_REFRESH - Redraw the input line, then continue
- waiting for input. You should return
- this value if your callback wrote to the
- terminal without having first called
- gl_normal_io(gl).
- GLTO_CONTINUE - In normal blocking-I/O mode, continue to
- wait for input, without redrawing the
- user's input line.
- In non-blocking server I/O mode (see
- <a href="gl_io_mode.html"><b>gl_io_mode</b></a>), cause gl_get_line()
- to act as though I/O blocked. This means
- that gl_get_line() will immediately
- return NULL, and a following call
- to gl_return_status() will return
- GLR_BLOCKED.
-
-
- Note that before calling the callback, gl_get_line() blocks most sig-
- nals, and leaves its own signal handlers installed, so if you need to
- catch a particular signal you will need to both temporarily install
- your own signal handler, and unblock the signal. Be sure to re-block
- the signal (if it was originally blocked) and reinstate the original
- signal handler, if any, before returning.
-
-
-
- If the callback function needs to read or write to the terminal, it
- should ideally first call gl_normal_io(gl) to temporarily suspend line
- editing. This will restore the terminal to canonical, blocking-I/O,
- mode, and move the cursor to the start of a new terminal line. Later,
- when the callback returns, gl_get_line() will notice that gl_nor-
- mal_io() was called, redisplay the input line and resume editing. Note
- that in this case the return values, GLTO_REFRESH and GLTO_CONTINUE are
- equivalent.
-
-
-
- To support cases where the callback function calls a third-party func-
- tion which occasionally and u0prisicre-enabledesbeforee themicallback
- automatic conversion of "0 to "
- function is called. If the callack knows that the third-party function
- wrote to the terminal, it should then return the GLTO_REFRESH return
- value, to tell gl_get_line() to redisplay the input line.
-
-
-
- Note that although the timeout argument includes a nano-second compo-
- nent, few computer clocks presently have resolutions that are finer
- than a few milliseconds, so asking for less than a few milliseconds is
- equivalent to requesting zero seconds on a lot of systems. If this
- would be a problem, you should base your timeout selection on the
- actual resolution of the host clock (eg. by calling
- sysconf(_SC_CLK_TCK)).
-
-
-
- To turn off timeouts, simply call gl_inactivity_timeout() with a call-
- back argument of 0. The data argument is ignored in this case.
-
-
-</pre><h2>SIGNAL HANDLING DEFAULTS</h2><pre>
- By default, the gl_get_line() function intercepts a number of signals.
- This is particularly important for signals which would by default ter-
- minate the process, since the terminal needs to be restored to a usable
- state before this happens. In this section, the signals that are
- trapped by default, and how gl_get_line() responds to them, is
- described. Changing these defaults is the topic of the following sec-
- tion.
-
- When the following subset of signals are caught, gl_get_line() first
- restores the terminal settings and signal handling to how they were
- before gl_get_line() was called, resends the signal, to allow the call-
- ing application's signal handlers to handle it, then if the process
- still exists, gl_get_line() returns NULL and sets errno as specified
- below.
-
-
- SIGINT - This signal is generated both by the keyboard
- interrupt key (usually ^C), and the keyboard
- break key.
-
- errno=EINTR
-
- SIGHUP - This signal is generated when the controlling
- terminal exits.
-
- errno=ENOTTY
-
- SIGPIPE - This signal is generated when a program attempts
- to write to a pipe who's remote end isn't being
- read by any process. This can happen for example
- if you have called gl_change_terminal() to
- redirect output to a pipe hidden under a pseudo
- terminal.
-
- errno=EPIPE
-
- SIGQUIT - This signal is generated by the keyboard quit
- key (usually ^\).
-
- errno=EINTR
-
- SIGABRT - This signal is generated by the standard C,
- abort() function. By default it both
- terminates the process and generates a core
- dump.
-
- errno=EINTR
-
- SIGTERM - This is the default signal that the UN*X
- kill command sends to processes.
-
- errno=EINTR
-
- Note that in the case of all of the above signals, POSIX mandates that
- by default the process is terminated, with the addition of a core dump
- in the case of the SIGQUIT signal. In other words, if the calling
- application doesn't override the default handler by supplying its own
- signal handler, receipt of the corresponding signal will terminate the
- application before gl_get_line() returns.
-
- If gl_get_line() aborts with errno set to EINTR, you can find out what
- signal caused it to abort, by calling the following function.
-
- int gl_last_signal(const GetLine *gl);
-
- This returns the numeric code (eg. SIGINT) of the last signal that was
- received during the most recent call to gl_get_line(), or -1 if no sig-
- nals were received.
-
- On systems that support it, when a SIGWINCH (window change) signal is
- received, gl_get_line() queries the terminal to find out its new size,
- redraws the current input line to accomodate the new size, then returns
- to waiting for keyboard input from the user. Unlike other signals, this
- signal isn't resent to the application.
-
- Finally, the following signals cause gl_get_line() to first restore the
- terminal and signal environment to that which prevailed before
- gl_get_line() was called, then resend the signal to the application. If
- the process still exists after the signal has been delivered, then
- gl_get_line() then re-establishes its own signal handlers, switches the
- terminal back to raw mode, redisplays the input line, and goes back to
- awaiting terminal input from the user.
-
- SIGCONT - This signal is generated when a suspended
- process is resumed.
-
- SIGPOLL - On SVR4 systems, this signal notifies the
- process of an asynchronous I/O event. Note
- that under 4.3+BSD, SIGIO and SIGPOLL are
- the same. On other systems, SIGIO is ignored
- by default, so gl_get_line() doesn't
- trap it by default.
-
- SIGPWR - This signal is generated when a power failure
- occurs (presumably when the system is on a
- UPS).
-
- SIGALRM - This signal is generated when a timer
- expires.
-
- SIGUSR1 - An application specific signal.
-
- SIGUSR2 - Another application specific signal.
-
- SIGVTALRM - This signal is generated when a virtual
- timer expires (see man setitimer(2)).
-
- SIGXCPU - This signal is generated when a process
- exceeds its soft CPU time limit.
-
- SIGXFSZ - This signal is generated when a process
- exceeds its soft file-size limit.
-
- SIGTSTP - This signal is generated by the terminal
- suspend key, which is usually ^Z, or the
- delayed terminal suspend key, which is
- usually ^Y.
-
- SIGTTIN - This signal is generated if the program
- attempts to read from the terminal while the
- program is running in the background.
-
- SIGTTOU - This signal is generated if the program
- attempts to write to the terminal while the
- program is running in the background.
-
-
- Obviously not all of the above signals are supported on all systems, so
- code to support them is conditionally compiled into the tecla library.
-
- Note that if SIGKILL or SIGPOLL, which by definition can't be caught,
- or any of the hardware generated exception signals, such as SIGSEGV,
- SIGBUS and SIGFPE, are received and unhandled while gl_get_line() has
- the terminal in raw mode, the program will be terminated without the
- terminal having been restored to a usable state. In practice, job-con-
- trol shells usually reset the terminal settings when a process relin-
- quishes the controlling terminal, so this is only a problem with older
- shells.
-
-
-</pre><h2>CUSTOMIZED SIGNAL HANDLING</h2><pre>
- The previous section listed the signals that gl_get_line() traps by
- default, and described how it responds to them. This section describes
- how to both add and remove signals from the list of trapped signals,
- and how to specify how gl_get_line() should respond to a given signal.
-
- If you don't need gl_get_line() to do anything in response to a signal
- that it normally traps, you can tell to gl_get_line() to ignore that
- signal by calling gl_ignore_signal().
-
- int gl_ignore_signal(GetLine *gl, int signo);
-
- The signo argument is the number of the signal (eg. SIGINT) that you
- want to have ignored. If the specified signal isn't currently one of
- those being trapped, this function does nothing.
-
- The gl_trap_signal() function allows you to either add a new signal to
- the list that gl_get_line() traps, or modify how it responds to a sig-
- nal that it already traps.
-
- int gl_trap_signal(GetLine *gl, int signo, unsigned flags,
- GlAfterSignal after, int errno_value);
-
- The signo argument is the number of the signal that you wish to have
- trapped. The flags argument is a set of flags which determine the envi-
- ronment in which the application's signal handler is invoked, the after
- argument tells gl_get_line() what to do after the application's signal
- handler returns, and errno_value tells gl_get_line() what to set errno
- to if told to abort.
-
- The flags argument is a bitwise OR of zero or more of the following
- enumerators:
-
- GLS_RESTORE_SIG - Restore the caller's signal
- environment while handling the
- signal.
-
- GLS_RESTORE_TTY - Restore the caller's terminal settings
- while handling the signal.
-
- GLS_RESTORE_LINE - Move the cursor to the start of the
- line following the input line before
- invoking the application's signal
- handler.
-
- GLS_REDRAW_LINE - Redraw the input line when the
- application's signal handler returns.
-
- GLS_UNBLOCK_SIG - Normally, if the calling program has
- a signal blocked (man sigprocmask),
- gl_get_line() does not trap that
- signal. This flag tells gl_get_line()
- to trap the signal and unblock it for
- the duration of the call to
- gl_get_line().
-
- GLS_DONT_FORWARD - If this flag is included, the signal
- will not be forwarded to the signal
- handler of the calling program.
-
- Two commonly useful flag combinations are also enumerated as follows:
-
- GLS_RESTORE_ENV = GLS_RESTORE_SIG | GLS_RESTORE_TTY |
- GLS_REDRAW_LINE
-
- GLS_SUSPEND_INPUT = GLS_RESTORE_ENV | GLS_RESTORE_LINE
-
-
- If your signal handler, or the default system signal handler for this
- signal, if you haven't overridden it, never either writes to the termi-
- nal, nor suspends or terminates the calling program, then you can
- safely set the flags argument to 0.
-
- If your signal handler always writes to the terminal, reads from it, or
- suspends or terminates the program, you should specify the flags argu-
- ment as GL_SUSPEND_INPUT, so that:
-
- 1. The cursor doesn't get left in the middle of the input
- line.
- 2. So that the user can type in input and have it echoed.
- 3. So that you don't need to end each output line with
- \r\n, instead of just \n.
-
- The GL_RESTORE_ENV combination is the same as GL_SUSPEND_INPUT, except
- that it doesn't move the cursor, and if your signal handler doesn't
- read or write anything to the terminal, the user won't see any visible
- indication that a signal was caught. This can be useful if you have a
- signal handler that only occasionally writes to the terminal, where
- using GL_SUSPEND_LINE would cause the input line to be unnecessarily
- duplicated when nothing had been written to the terminal. Such a sig-
- nal handler, when it does write to the terminal, should be sure to
- start a new line at the start of its first write, by writing a new line
- before returning. If the signal arrives while the user is entering a
- line that only occupies a signal terminal line, or if the cursor is on
- the last terminal line of a longer input line, this will have the same
- effect as GL_SUSPEND_INPUT. Otherwise it will start writing on a line
- that already contains part of the displayed input line. This doesn't
- do any harm, but it looks a bit ugly, which is why the GL_SUSPEND_INPUT
- combination is better if you know that you are always going to be writ-
- ting to the terminal.
-
- The after argument, which determines what gl_get_line() does after the
- application's signal handler returns (if it returns), can take any one
- of the following values:
-
- GLS_RETURN - Return the completed input line, just as
- though the user had pressed the return
- key.
-
- GLS_ABORT - Cause gl_get_line() to abort. When
- this happens, gl_get_line() returns
- NULL, and a following call to
- gl_return_status() will return
- GLR_SIGNAL. Note that if the
- application needs errno always to
- have a meaningful value when
- gl_get_line() returns NULL,
- the callback function should set
- errno appropriately.
- GLS_CONTINUE - Resume command line editing.
-
- The errno_value argument is intended to be combined with the GLS_ABORT
- option, telling gl_get_line() what to set the standard errno variable
- to before returning NULL to the calling program. It can also, however,
- be used with the GL_RETURN option, in case you wish to have a way to
- distinguish between an input line that was entered using the return
- key, and one that was entered by the receipt of a signal.
-
-
-</pre><h2>RELIABLE SIGNAL HANDLING</h2><pre>
- Signal handling is suprisingly hard to do reliably without race condi-
- tions. In gl_get_line() a lot of care has been taken to allow applica-
- tions to perform reliable signal handling around gl_get_line(). This
- section explains how to make use of this.
-
- As an example of the problems that can arise if the application isn't
- written correctly, imagine that one's application has a SIGINT signal
- handler that sets a global flag. Now suppose that the application tests
- this flag just before invoking gl_get_line(). If a SIGINT signal hap-
- pens to be received in the small window of time between the statement
- that tests the value of this flag, and the statement that calls
- gl_get_line(), then gl_get_line() will not see the signal, and will not
- be interrupted. As a result, the application won't be able to respond
- to the signal until the user gets around to finishing entering the
- input line and gl_get_line() returns. Depending on the application,
- this might or might not be a disaster, but at the very least it would
- puzzle the user.
-
- The way to avoid such problems is to do the following.
-
- 1. If needed, use the gl_trap_signal() function to
- configure gl_get_line() to abort when important
- signals are caught.
-
- 2. Configure gl_get_line() such that if any of the
- signals that it catches are blocked when
- gl_get_line() is called, they will be unblocked
- automatically during times when gl_get_line() is
- waiting for I/O. This can be done either
- on a per signal basis, by calling the
- gl_trap_signal() function, and specifying the
- GLS_UNBLOCK attribute of the signal, or globally by
- calling the gl_catch_blocked() function.
-
-
- void gl_catch_blocked(GetLine *gl);
-
-
- This function simply adds the GLS_UNBLOCK attribute
- to all of the signals that it is currently configured to
- trap.
-
- 3. Just before calling gl_get_line(), block delivery
- of all of the signals that gl_get_line() is
- configured to trap. This can be done using the POSIX
- sigprocmask() function in conjunction with the
- gl_list_signals() function.
-
-
- int gl_list_signals(GetLine *gl, sigset_t *set);
-
-
- This function returns the set of signals that it is
- currently configured to catch in the set argument,
- which is in the form required by sigprocmask().
-
- 4. In the example, one would now test the global flag that
- the signal handler sets, knowing that there is now no
- danger of this flag being set again until
- gl_get_line() unblocks its signals while performing
- I/O.
-
- 5. Eventually gl_get_line() returns, either because
- a signal was caught, an error occurred, or the user
- finished entering their input line.
-
- 6. Now one would check the global signal flag again, and if
- it is set, respond to it, and zero the flag.
-
- 7. Use sigprocmask() to unblock the signals that were
- blocked in step 3.
-
- The same technique can be used around certain POSIX signal-aware func-
- tions, such as sigsetjmp() and sigsuspend(), and in particular, the
- former of these two functions can be used in conjunction with sig-
- longjmp() to implement race-condition free signal handling around other
- long-running system calls. The way to do this, is explained next, by
- showing how gl_get_line() manages to reliably trap signals around calls
- to functions like read() and select() without race conditions.
-
- The first thing that gl_get_line() does, whenever it is called, is to
- use the POSIX sigprocmask() function to block the delivery of all of
- the signals that it is currently configured to catch. This is redundant
- if the application has already blocked them, but it does no harm. It
- undoes this step just before returning.
-
- Whenever gl_get_line() needs to call read() or select() to wait for
- input from the user, it first calls the POSIX sigsetjmp() function,
- being sure to specify a non-zero value for its savesigs argument. The
- reason for the latter argument will become clear shortly.
-
- If sigsetjmp() returns zero, gl_get_line() then does the following.
-
-
- a. It uses the POSIX sigaction() function to register
- a temporary signal handler to all of the signals that it
- is configured to catch. This signal handler does two
- things.
-
- 1. It records the number of the signal that was received
- in a file-scope variable.
-
- 2. It then calls the POSIX siglongjmp()
- function using the buffer that was passed to
- sigsetjmp() for its first argument, and
- a non-zero value for its second argument.
-
- When this signal handler is registered, the sa_mask
- member of the struct sigaction act argument of the
- call to sigaction() is configured to contain all of
- the signals that gl_get_line() is catching. This
- ensures that only one signal will be caught at once by
- our signal handler, which in turn ensures that multiple
- instances of our signal handler don't tread on each
- other's toes.
-
- b. Now that the signal handler has been set up,
- gl_get_line() unblocks all of the signals that it
- is configured to catch.
-
- c. It then calls the read() or select() system
- calls to wait for keyboard input.
-
- d. If this system call returns (ie. no signal is received),
- gl_get_line() blocks delivery of the signals of
- interest again.
-
- e. It then reinstates the signal handlers that were
- displaced by the one that was just installed.
-
-
- Alternatively, if sigsetjmp() returns non-zero, this means that one of
- the signals being trapped was caught while the above steps were execut-
- ing. When this happens, gl_get_line() does the following.
-
- First, note that when a call to siglongjmp() causes sigsetjmp() to
- return, provided that the savesigs argument of sigsetjmp() was non-
- zero, as specified above, the signal process mask is restored to how it
- was when sigsetjmp() was called. This is the important difference
- between sigsetjmp() and the older problematic setjmp(), and is the
- essential ingredient that makes it possible to avoid signal handling
- race conditions. Because of this we are guaranteed that all of the
- signals that we blocked before calling sigsetjmp() are blocked again as
- soon as any signal is caught. The following statements, which are then
- executed, are thus guaranteed to be executed without any further sig-
- nals being caught.
-
- 1. If so instructed by the gl_get_line() configuration
- attributes of the signal that was caught,
- gl_get_line() restores the terminal attributes to
- the state that they had when gl_get_line() was
- called. This is particularly important for signals that
- suspend or terminate the process, since otherwise the
- terminal would be left in an unusable state.
-
- 2. It then reinstates the application's signal handlers.
-
- 3. Then it uses the C standard-library raise()
- function to re-send the application the signal that
- was caught.
-
- 3. Next it unblocks delivery of the signal that we just
- sent. This results in the signal that was just sent
- via raise(), being caught by the application's
- original signal handler, which can now handle it as it
- sees fit.
-
- 4. If the signal handler returns (ie. it doesn't terminate
- the process), gl_get_line() blocks delivery of the
- above signal again.
-
- 5. It then undoes any actions performed in the first of the
- above steps, and redisplays the line, if the signal
- configuration calls for this.
-
- 6. gl_get_line() then either resumes trying to
- read a character, or aborts, depending on the
- configuration of the signal that was caught.
-
- What the above steps do in essence is to take asynchronously delivered
- signals and handle them synchronously, one at a time, at a point in the
- code where gl_get_line() has complete control over its environment.
-
-
-</pre><h2>THE TERMINAL SIZE</h2><pre>
- On most systems the combination of the TIOCGWINSZ ioctl and the SIG-
- WINCH signal is used to maintain an accurate idea of the terminal size.
- The terminal size is newly queried every time that gl_get_line() is
- called and whenever a SIGWINCH signal is received.
-
- On the few systems where this mechanism isn't available, at startup
- new_GetLine() first looks for the LINES and COLUMNS environment vari-
- ables. If these aren't found, or they contain unusable values, then if
- a terminal information database like terminfo or termcap is available,
- the default size of the terminal is looked up in this database. If this
- too fails to provide the terminal size, a default size of 80 columns by
- 24 lines is used.
-
- Even on systems that do support ioctl(TIOCGWINSZ), if the terminal is
- on the other end of a serial line, the terminal driver generally has no
- way of detecting when a resize occurs or of querying what the current
- size is. In such cases no SIGWINCH is sent to the process, and the
- dimensions returned by ioctl(TIOCGWINSZ) aren't correct. The only way
- to handle such instances is to provide a way for the user to enter a
- command that tells the remote system what the new size is. This command
- would then call the gl_set_term_size() function to tell gl_get_line()
- about the change in size.
-
-
- int gl_set_term_size(GetLine *gl, int ncolumn, int nline);
-
-
- The ncolumn and nline arguments are used to specify the new dimensions
- of the terminal, and must not be less than 1. On systems that do sup-
- port ioctl(TIOCGWINSZ), this function first calls ioctl(TIOCSWINSZ) to
- tell the terminal driver about the change in size. In non-blocking
- server-I/O mode, if a line is currently being input, the input line is
- then redrawn to accomodate the changed size. Finally the new values are
- recorded in gl for future use by gl_get_line().
-
- The gl_terminal_size() function allows you to query the current size of
- the terminal, and install an alternate fallback size for cases where
- the size isn't available. Beware that the terminal size won't be
- available if reading from a pipe or a file, so the default values can
- be important even on systems that do support ways of finding out the
- terminal size.
-
- typedef struct {
- int nline; /* The terminal has nline lines */
- int ncolumn; /* The terminal has ncolumn columns */
- } GlTerminalSize;
-
- GlTerminalSize gl_terminal_size(GetLine *gl,
- int def_ncolumn,
- int def_nline);
-
- This function first updates gl_get_line()'s fallback terminal dimen-
- sions, then records its findings in the return value.
-
- The def_ncolumn and def_nline specify the default number of terminal
- columns and lines to use if the terminal size can't be determined via
- ioctl(TIOCGWINSZ) or environment variables.
-
-
-</pre><h2>HIDING WHAT YOU TYPE</h2><pre>
- When entering sensitive information, such as passwords, it is best not
- to have the text that you are entering echoed on the terminal. Fur-
- thermore, such text should not be recorded in the history list, since
- somebody finding your terminal unattended could then recall it, or
- somebody snooping through your directories could see it in your history
- file. With this in mind, the gl_echo_mode() function allows you to tog-
- gle on and off the display and archival of any text that is subse-
- quently entered in calls to gl_get_line().
-
-
- int gl_echo_mode(GetLine *gl, int enable);
-
-
- The enable argument specifies whether entered text should be visible or
- not. If it is 0, then subsequently entered lines will not be visible on
- the terminal, and will not be recorded in the history list. If it is 1,
- then subsequent input lines will be displayed as they are entered, and
- provided that history hasn't been turned off via a call to gl_tog-
- gle_history(), then they will also be archived in the history list.
- Finally, if the enable argument is -1, then the echoing mode is left
- unchanged, which allows you to non-destructively query the current set-
- ting via the return value. In all cases, the return value of the func-
- tion is 0 if echoing was disabled before the function was called, and 1
- if it was enabled.
-
- When echoing is turned off, note that although tab completion will
- invisibly complete your prefix as far as possible, ambiguous comple-
- tions will not be displayed.
-
-
-</pre><h2>SINGLE CHARACTER QUERIES</h2><pre>
- Using gl_get_line() to query the user for a single character reply, is
- inconvenient for the user, since they must hit the enter or return key
- before the character that they typed is returned to the program. Thus
- the gl_query_char() function has been provided for single character
- queries like this.
-
-
- int gl_query_char(GetLine *gl, const char *prompt,
- char defchar);
-
-
- This function displays the specified prompt at the start of a new line,
- and waits for the user to type a character. When the user types a char-
- acter, gl_query_char() displays it to the right of the prompt, starts a
- newline, then returns the character to the calling program. The return
- value of the function is the character that was typed. If the read had
- to be aborted for some reason, EOF is returned instead. In the latter
- case, the application can call the previously documented gl_return_sta-
- tus(), to find out what went wrong. This could, for example, have been
- the reception of a signal, or the optional inactivity timer going off.
-
- If the user simply hits enter, the value of the defchar argument is
- substituted. This means that when the user hits either newline or
- return, the character specified in defchar, is displayed after the
- prompt, as though the user had typed it, as well as being returned to
- the calling application. If such a replacement is not important, simply
- pass '0 as the value of defchar.
-
- If the entered character is an unprintable character, it is displayed
- symbolically. For example, control-A is displayed as ^A, and characters
- beyond 127 are displayed in octal, preceded by a backslash.
-
- As with gl_get_line(), echoing of the entered character can be disabled
- using the gl_echo_mode() function.
-
- If the calling process is suspended while waiting for the user to type
- their response, the cursor is moved to the line following the prompt
- line, then when the process resumes, the prompt is redisplayed, and
- gl_query_char() resumes waiting for the user to type a character.
-
- Note that in non-blocking server mode, (see <a href="gl_io_mode.html"><b>gl_io_mode</b></a>),
- if an incomplete input line is in the process of being read when
- gl_query_char() is called, the partial input line is discarded, and
- erased from the terminal, before the new prompt is displayed. The next
- call to gl_get_line() will thus start editing a new line.
-
-
-</pre><h2>READING RAW CHARACTERS</h2><pre>
- Whereas the gl_query_char() function visibly prompts the user for a
- character, and displays what they typed, the gl_read_char() function
- reads a signal character from the user, without writing anything to the
- terminal, or perturbing any incompletely entered input line. This means
- that it can be called not only from between calls to gl_get_line(), but
- also from callback functions that the application has registered to be
- called by gl_get_line().
-
-
- int gl_read_char(GetLine *gl);
-
-
- On success, the return value of gl_read_char() is the character that
- was read. On failure, EOF is returned, and the gl_return_status() func-
- tion can be called to find out what went wrong. Possibilities include
- the optional inactivity timer going off, the receipt of a signal that
- is configured to abort gl_get_line(), or terminal I/O blocking, when in
- non-blocking server-I/O mode.
-
- Beware that certain keyboard keys, such as function keys, and cursor
- keys, usually generate at least 3 characters each, so a single call to
- gl_read_char() won't be enough to identify such keystrokes.
-
-
-</pre><h2>CLEARING THE TERMINAL</h2><pre>
- The calling program can clear the terminal by calling gl_erase_termi-
- nal(). In non-blocking server-I/O mode, this function also arranges for
- the current input line to be redrawn from scratch when gl_get_line() is
- next called.
-
-
- int gl_erase_terminal(GetLine *gl);
-
-
-
-</pre><h2>DISPLAYING TEXT DYNAMICALLY</h2><pre>
- Between calls to gl_get_line(), the gl_display_text() function provides
- a convenient way to display paragraphs of text, left-justified and
- split over one or more terminal lines according to the constraints of
- the current width of the terminal. Examples of the use of this function
- may be found in the demo programs, where it is used to display intro-
- ductions. In those examples the advanced use of optional prefixes, suf-
- fixes and filled lines to draw a box around the text is also illus-
- trated.
-
-
- int gl_display_text(GetLine *gl, int indentation,
- const char *prefix,
- const char *suffix, int fill_char,
- int def_width, int start,
- const char *string);
-
- If gl isn't currently connected to a terminal, for example if the out-
- put of a program that uses gl_get_line() is being piped to another pro-
- gram or redirected to a file, then the value of the def_width parameter
- is used as the terminal width.
-
- The indentation argument specifies the number of characters to use to
- indent each line of ouput. The fill_char argument specifies the charac-
- ter that will be used to perform this indentation.
-
- The prefix argument can either be NULL, or be a string to place at the
- beginning of each new line (after any indentation). Similarly, the
- suffix argument can either be NULL, or be a string to place at the end
- of each line. The suffix is placed flush against the right edge of the
- terminal, and any space between its first character and the last word
- on that line is filled with the character specified via the fill_char
- argument. Normally the fill-character is a space.
-
- The start argument tells gl_display_text() how many characters have
- already been written to the current terminal line, and thus tells it
- the starting column index of the cursor. Since the return value of
- gl_display_text() is the ending column index of the cursor, by passing
- the return value of one call to the start argument of the next call, a
- paragraph that is broken between more than one string can be composed
- by calling gl_display_text() for each successive portion of the para-
- graph. Note that literal newline characters are necessary at the end of
- each paragraph to force a new line to be started.
-
- On error, gl_display_text() returns -1.
-
-
-</pre><h2>CALLBACK FUNCTION FACILITIES</h2><pre>
- Unless otherwise stated, callback functions, such as tab completion
- callbacks and event callbacks should not call any functions in this
- module. The following functions, however, are designed specifically to
- be used by callback functions.
-
- Calling the gl_replace_prompt() function from a callback tells
- gl_get_line() to display a different prompt when the callback returns.
- Except in non-blocking server mode, it has no effect if used between
- calls to gl_get_line(). In non-blocking server mode (see the
- <a href="gl_io_mode.html"><b>gl_io_mode</b></a> man page, when used between two calls to
- gl_get_line() that are operating on the same input line, the current
- input line will be re-drawn with the new prompt on the following call
- to gl_get_line().
-
-
- void gl_replace_prompt(GetLine *gl, const char *prompt);
-
-
-
-</pre><h2>INTERNATIONAL CHARACTER SETS</h2><pre>
- Since libtecla version 1.4.0, gl_get_line() has been 8-bit clean. This
- means that all 8-bit characters that are printable in the user's cur-
- rent locale are now displayed verbatim and included in the returned
- input line. Assuming that the calling program correctly contains a
- call like the following,
-
- setlocale(LC_CTYPE, "");
-
- then the current locale is determined by the first of the environment
- variables LC_CTYPE, LC_ALL, and LANG, that is found to contain a valid
- locale name. If none of these variables are defined, or the program
- neglects to call setlocale, then the default C locale is used, which is
- US 7-bit ASCII. On most unix-like platforms, you can get a list of
- valid locales by typing the command:
-
- locale -a
-
- at the shell prompt. Further documentation on how the user can make use
- of this to enter international characters can be found in the
- <a href="tecla.html"><b>tecla</b></a> man page.
-
-
-</pre><h2>THREAD SAFETY</h2><pre>
- In a multi-threaded program, you should use the libtecla_r.a version of
- the library. This uses reentrant versions of system functions, where
- available. Unfortunately neither terminfo nor termcap were designed to
- be reentrant, so you can't safely use the functions of the getline mod-
- ule in multiple threads (you can use the separate file-expansion and
- word-completion modules in multiple threads, see the corresponding man
- pages for details). However due to the use of POSIX reentrant functions
- for looking up home directories etc, it is safe to use this module from
- a single thread of a multi-threaded program, provided that your other
- threads don't use any termcap or terminfo functions.
-
-
-</pre><h2>FILES</h2><pre>
- libtecla.a - The tecla library
- libtecla.h - The tecla header file.
- ~/.teclarc - The personal tecla customization file.
-
-
-</pre><h2>SEE ALSO</h2><pre>
- <a href="libtecla.html"><b>libtecla</b></a>, <a href="gl_io_mode.html"><b>gl_io_mode</b></a>, <a href="tecla.html"><b>tecla</b></a>, <a href="ef_expand_file.html"><b>ef_expand_file</b></a>,
- <a href="cpl_complete_word.html"><b>cpl_complete_word</b></a>, <a href="pca_lookup_file.html"><b>pca_lookup_file</b></a>
-
-
-</pre><h2>AUTHOR</h2><pre>
- Martin Shepherd (mcs at astro.caltech.edu)
-
-
-
- <a href="gl_get_line.html"><b>gl_get_line</b></a>
-</pre>
-</body>
+int gl_display_text(GetLine *gl, int indentation,
+ const char *prefix,
+ const char *suffix, int fill_char,
+ int def_width, int start,
+ const char *string);
+
+GlReturnStatus gl_return_status(GetLine *gl);
+
+const char *gl_error_message(GetLine *gl, char *buff,
+ size_t n);
+
+void gl_catch_blocked(GetLine *gl);
+
+int gl_list_signals(GetLine *gl, sigset_t *set);
+
+int gl_append_history(GetLine *gl, const char *line);
+
+int gl_automatic_history(GetLine *gl, int enable);
+
+</PRE>
+
+<P>
+<A NAME="lbAD"> </A>
+<H2>DESCRIPTION</H2>
+
+<P>
+The <B>gl_get_line()</B> function is part of the tecla library (see the
+<B><A HREF="libtecla.html">libtecla</A>(3)</B> man page). If the user is typing at a terminal, each
+call prompts them for an line of input, then provides interactive
+editing facilities, similar to those of the unix <B>tcsh</B> shell. In
+addition to simple command-line editing, it supports recall of
+previously entered command lines, TAB completion of file names, and
+in-line wild-card expansion of filenames. Documentation of both the
+user-level command-line editing features and all user configuration
+options, can be found in the <B><A HREF="tecla.html">tecla</A>(7)</B> man page. This man page
+concerns itself with documentation for programmers interested in using
+this library in their application.
+<P>
+<A NAME="lbAE"> </A>
+<H2>AN EXAMPLE</H2>
+
+<P>
+The following shows a complete example of how to use the
+<B>gl_get_line()</B> function to get input from the user:
+<P>
+<PRE>
+ #include <<A HREF="file:///usr/include/stdio.h">stdio.h</A>>
+ #include <<A HREF="file:///usr/include/locale.h">locale.h</A>>
+ #include <<A HREF="file:///usr/include/libtecla.h">libtecla.h</A>>
+
+ int main(int argc, char *argv[])
+ {
+ char *line; /* The line that the user typed */
+ GetLine *gl; /* The gl_get_line() resource object */
+
+ setlocale(LC_CTYPE, ""); /* Adopt the user's choice */
+ /* of character set. */
+
+ gl = new_GetLine(1024, 2048);
+ if(!gl)
+ return 1;
+
+ while((line=gl_get_line(gl, "$ ", NULL, -1)) != NULL &&
+ strcmp(line, "exit\n") != 0)
+ printf("You typed: %s\n", line);
+
+ gl = del_GetLine(gl);
+ return 0;
+ }
+</PRE>
+
+<P>
+In the example, first the resources needed by the <B>gl_get_line()</B> function
+are created by calling <B>new_GetLine()</B>. This allocates the memory used in
+subsequent calls to the <B>gl_get_line()</B> function, including the history
+buffer for recording previously entered lines. Then one or more lines are read
+from the user, until either an error occurs, or the user types <B>exit</B>. Then
+finally the resources that were allocated by <B>new_GetLine()</B>, are returned
+to the system by calling <B>del_GetLine()</B>. Note the use of the <B>NULL</B>
+return value of <B>del_GetLine()</B> to make <B>gl</B> <B>NULL</B>. This is a
+safety precaution. If the program subsequently attempts to pass <B>gl</B> to
+<B>gl_get_line()</B>, said function will complain, and return an error, instead of
+attempting to use the deleted resource object.
+<P>
+<P>
+<A NAME="lbAF"> </A>
+<H2>THE FUNCTIONS USED IN THE EXAMPLE</H2>
+
+The descriptions of the functions used in the example are as follows:
+<P>
+<PRE>
+ GetLine *new_GetLine(size_t linelen, size_t histlen)
+</PRE>
+
+<P>
+This function creates the resources used by the <B>gl_get_line()</B>
+function and returns an opaque pointer to the object that contains
+them. The maximum length of an input line is specified via the
+<B>linelen</B> argument, and the number of bytes to allocate for
+storing history lines is set by the <B>histlen</B> argument. History
+lines are stored back-to-back in a single buffer of this size. Note
+that this means that the number of history lines that can be stored at
+any given time, depends on the lengths of the individual lines. If
+you want to place an upper limit on the number of lines that can be
+stored, see the <B>gl_limit_history()</B> function described later. If
+you don't want history at all, specify <B>histlen</B> as zero, and no
+history buffer will be allocated.
+<P>
+On error, a message is printed to <B>stderr</B> and <B>NULL</B> is returned.
+<P>
+<PRE>
+ GetLine *del_GetLine(GetLine *gl)
+</PRE>
+
+<P>
+This function deletes the resources that were returned by a previous
+call to <B>new_GetLine()</B>. It always returns <B>NULL</B> (ie a
+deleted object). It does nothing if the <B>gl</B> argument is
+<B>NULL</B>.
+<P>
+<PRE>
+ char *gl_get_line(GetLine *gl, const char *prompt,
+ const char *start_line, int start_pos);
+</PRE>
+
+<P>
+The <B>gl_get_line()</B> function can be called any number of
+times to read input from the user. The <B>gl</B> argument
+must have been previously returned by a call to
+<B>new_GetLine()</B>. The <B>prompt</B> argument should be a
+normal <B>NUL</B> terminated string, specifying the prompt to
+present the user with. By default prompts are displayed
+literally, but if enabled with the <B>gl_prompt_style()</B>
+function (see later), prompts can contain directives to do
+underlining, switch to and from bold fonts, or turn
+highlighting on and off.
+<P>
+If you want to specify the initial contents of the line, for the user
+to edit, pass the desired string via the <B>start_line</B>
+argument. You can then specify which character of this line the cursor
+is initially positioned over, using the <B>start_pos</B> argument. This
+should be -1 if you want the cursor to follow the last character of
+the start line. If you don't want to preload the line in this manner,
+send <B>start_line</B> as <B>NULL</B>, and set <B>start_pos</B> to
+-1. Note that the line pointer returned by one call to
+<B>gl_get_line()</B> can be passed back to the next call to
+<B>gl_get_line()</B> via the <B>start_line</B>. This allows the
+application to take the last entered line, and if it contains an
+error, to then present it back to the user for re-editing, with the
+cursor initially positioned where the error was encountered.
+<P>
+The <B>gl_get_line()</B> function returns a pointer to the line entered
+by the user, or <B>NULL</B> on error or at the end of the input. The
+returned pointer is part of the specified <B>gl</B> resource object,
+and thus should not be free'd by the caller, or assumed to be
+unchanging from one call to the next. When reading from a user at a
+terminal, there will always be a newline character at the end of the
+returned line. When standard input is being taken from a pipe or a
+file, there will similarly be a newline unless the input line was too
+long to store in the internal buffer. In the latter case you should
+call <B>gl_get_line()</B> again to read the rest of the line. Note that
+this behavior makes <B>gl_get_line()</B> similar to <B>fgets()</B>. In
+fact when <B>stdin</B> isn't connected to a terminal,<B>gl_get_line()</B>
+just calls <B>fgets()</B>.
+<P>
+<A NAME="lbAG"> </A>
+<H2>THE RETURN STATUS OF GL_GET_LINE</H2>
+
+<P>
+As described above, the <B>gl_get_line()</B> function has two possible
+return values; a pointer to the completed input line, or
+<B>NULL</B>. Extra information about what caused <B>gl_get_line()</B> to
+return is available both by inspecting <B>errno</B>, and by calling the
+<B>gl_return_status()</B> function.
+<P>
+<P>
+<PRE>
+ GlReturnStatus gl_return_status(GetLine *gl);
+</PRE>
+
+<P>
+<P>
+The following are the possible enumerated values that this
+function returns.
+<P>
+<P>
+<PRE>
+ GLR_NEWLINE - The last call to <B>gl_get_line()</B>
+ successfully returned a completed
+ input line.
+
+ GLR_BLOCKED - <B>gl_get_line()</B> was in non-blocking
+ server mode, and returned early to
+ avoid blocking the process while
+ waiting for terminal I/O. The
+ <B>gl_pending_io()</B> function can be
+ used to see what type of I/O
+ <B>gl_get_line()</B> was waiting for.
+ (see the <B><A HREF="gl_io_mode.html">gl_io_mode</A>(3)</B> man page
+ for details).
+
+ GLR_SIGNAL - A signal was caught by
+ <B>gl_get_line()</B> that had an
+ after-signal disposition of
+ <B>GLS_ABORT</B> (See <B>gl_trap_signal()</B>).
+
+ GLR_TIMEOUT - The inactivity timer expired while
+ <B>gl_get_line()</B> was waiting for
+ input, and the timeout callback
+ function returned <B>GLTO_ABORT</B>.
+ See <B>gl_inactivity_timeout()</B> for
+ information about timeouts.
+
+ GLR_FDABORT - An application I/O callack returned
+ <B>GLFD_ABORT</B> (see <B>gl_watch_fd()</B>).
+
+ GLR_EOF - End of file reached. This can happen
+ when input is coming from a file or a
+ pipe, instead of the terminal. It also
+ occurs if the user invokes the
+ <B>list-or-eof</B> or <B>del-char-or-list-or-eof</B>
+ actions at the start of a new line.
+
+ GLR_ERROR - An unexpected error caused
+ <B>gl_get_line()</B> to abort (consult
+ <B>errno</B> and/or
+ <B>gl_error_message()</B> for details.
+</PRE>
+
+<P>
+<P>
+When <B>gl_return_status()</B> returns <B>GLR_ERROR</B>, and the
+value of <B>errno</B> isn't sufficient to explain what
+happened, you can use the <B>gl_error_message()</B> function
+to request a description of the last error that occurred.
+<P>
+<P>
+<PRE>
+ const char *gl_error_message(GetLine *gl, char *buff,
+ size_t n);
+</PRE>
+
+<P>
+<P>
+The return value is a pointer to the message that
+occurred. If the <B>buff</B> argument is <B>NULL</B>, this
+will be a pointer to a buffer within <B>gl</B>, who's value
+will probably change on the next call to any function
+associated with <B>gl_get_line()</B>. Otherwise, if a
+non-<B>NULL</B> <B>buff</B> argument is provided, the error
+message, including a <B>'\0'</B> terminator, will be written
+within the first <B>n</B> elements of this buffer, and the
+return value will be a pointer to the first element of this
+buffer. If the message won't fit in the provided buffer, it
+will be truncated to fit.
+<P>
+<A NAME="lbAH"> </A>
+<H2>OPTIONAL PROMPT FORMATTING</H2>
+
+<P>
+Whereas by default the prompt string that you specify is
+displayed literally, without any special interpretation of
+the characters within it, the <B>gl_prompt_style()</B>
+function can be used to enable optional formatting
+directives within the prompt.
+<P>
+<PRE>
+ void gl_prompt_style(GetLine *gl, GlPromptStyle style);
+</PRE>
+
+<P>
+The <B>style</B> argument, which specifies the formatting
+style, can take any of the following values:
+<P>
+<PRE>
+ GL_FORMAT_PROMPT - In this style, the formatting
+ directives described below, when
+ included in prompt strings, are
+ interpreted as follows:
+
+ %B - Display subsequent
+ characters with a bold
+ font.
+ %b - Stop displaying characters
+ with the bold font.
+ %F - Make subsequent characters
+ flash.
+ %f - Turn off flashing
+ characters.
+ %U - Underline subsequent
+ characters.
+ %u - Stop underlining
+ characters.
+ %P - Switch to a pale (half
+ brightness) font.
+ %p - Stop using the pale font.
+ %S - Highlight subsequent
+ characters (also known as
+ standout mode).
+ %s - Stop highlighting
+ characters.
+ %V - Turn on reverse video.
+ %v - Turn off reverse video.
+ %% - Display a single %
+ character.
+
+ For example, in this mode, a prompt
+ string like <B>"%UOK%u$ "</B> would
+ display the prompt <B>"OK$ "</B>,
+ but with the <B>OK</B> part
+ underlined.
+
+ Note that although a pair of
+ characters that starts with a %
+ character, but doesn't match any of
+ the above directives is displayed
+ literally, if a new directive is
+ subsequently introduced which does
+ match, the displayed prompt will
+ change, so it is better to always
+ use %% to display a literal %.
+
+ Also note that not all terminals
+ support all of these text
+ attributes, and that some substitute
+ a different attribute for missing
+ ones.
+
+ GL_LITERAL_PROMPT - In this style, the prompt string is
+ printed literally. This is the
+ default style.
+</PRE>
+
+<P>
+<A NAME="lbAI"> </A>
+<H2>ALTERNATE CONFIGURATION SOURCES</H2>
+
+<P>
+As mentioned above, by default users have the option of configuring
+the behavior of <B>gl_get_line()</B> via a configuration file called
+<B>.teclarc</B> in their home directories. The fact that all
+applications share this same configuration file is both an advantage
+and a disadvantage. In most cases it is an advantage, since it
+encourages uniformity, and frees the user from having to configure
+each application separately. In some applications, however, this
+single means of configuration is a problem. This is particularly true
+of embedded software, where there's no filesystem to read a
+configuration file from, and also in applications where a radically
+different choice of keybindings is needed to emulate a legacy keyboard
+interface. To cater for such cases, the following function allows the
+application to control where configuration information is read from.
+<P>
+<P>
+<PRE>
+ int gl_configure_getline(GetLine *gl,
+ const char *app_string,
+ const char *app_file,
+ const char *user_file);
+</PRE>
+
+<P>
+<P>
+It allows the configuration commands that would normally be read from
+a user's <B>~/.teclarc</B> file, to be read from any or none of, a
+string, an application specific configuration file, and/or a
+user-specific configuration file. If this function is called before
+the first call to <B>gl_get_line()</B>, the default behavior of
+reading <B>~/.teclarc</B> on the first call to <B>gl_get_line()</B> is
+disabled, so all configuration must be achieved using the
+configuration sources specified with this function.
+<P>
+If <B>app_string != NULL</B>, then it is interpreted as a string
+containing one or more configuration commands, separated from each
+other in the string by embedded newline characters. If <B>app_file !=
+NULL</B> then it is interpreted as the full pathname of an
+application-specific configuration file. If <B>user_file != NULL</B>
+then it is interpreted as the full pathname of a user-specific
+configuration file, such as <B>~/.teclarc</B>. For example, in the
+following call,
+<P>
+<P>
+<PRE>
+ gl_configure_getline(gl, "edit-mode vi \n nobeep",
+ "/usr/share/myapp/teclarc",
+ "~/.teclarc");
+</PRE>
+
+<P>
+<P>
+the <B>app_string</B> argument causes the calling application to start
+in vi edit-mode, instead of the default emacs mode, and turns off the
+use of the terminal bell by the library. It then attempts to read
+system-wide configuration commands from an optional file called
+<B>/usr/share/myapp/teclarc</B>, then finally reads user-specific
+configuration commands from an optional <B>.teclarc</B> file in the
+user's home directory. Note that the arguments are listed in ascending
+order of priority, with the contents of <B>app_string</B> being
+potentially overriden by commands in <B>app_file</B>, and commands in
+<B>app_file</B> potentially being overriden by commands in
+<B>user_file</B>.
+<P>
+You can call this function as many times as needed, the results being
+cumulative, but note that copies of any filenames specified via the
+<B>app_file</B> and <B>user_file</B> arguments are recorded internally
+for subsequent use by the <B>read-init-files</B> key-binding function,
+so if you plan to call this function multiple times, be sure that the
+last call specifies the filenames that you want re-read when the user
+requests that the configuration files be re-read.
+<P>
+Individual key sequences can also be bound and unbound using the
+<B>gl_bind_keyseq()</B> function.
+<P>
+<P>
+<PRE>
+ int gl_bind_keyseq(GetLine *gl, GlKeyOrigin origin,
+ const char *keyseq,
+ const char *action);
+</PRE>
+
+<P>
+<P>
+The <B>origin</B> argument specifies the priority of the binding,
+according to who it is being established for, and must be one of
+the following two values.
+<P>
+<PRE>
+ GL_USER_KEY - The user requested this key-binding.
+ GL_APP_KEY - This is a default binding set by the
+ application.
+</PRE>
+
+<P>
+When both user and application bindings for a given key-sequence have
+been specified, the user binding takes precedence. The application's
+binding is subsequently reinstated if the user's binding is later
+unbound via either another to this function, or a call to
+<B>gl_configure_getline()</B>.
+<P>
+The <B>keyseq</B> argument specifies the key-sequence to be bound or
+unbound, and is expressed in the same way as in a <B>~/.teclarc</B>
+configuration file. The <B>action</B> argument must either be a string
+containing the name of the action to bind the key-sequence to, or it
+must be <B>NULL</B> or "" to unbind the key-sequence.
+<P>
+<A NAME="lbAJ"> </A>
+<H2>CUSTOMIZED WORD COMPLETION</H2>
+
+<P>
+If in your application, you would like to have TAB completion complete
+other things in addition to or instead of filenames, you can arrange
+this by registering an alternate completion callback function, via a
+call to the <B>gl_customize_completion()</B> function.
+<P>
+<PRE>
+ int gl_customize_completion(GetLine *gl, void *data,
+ CplMatchFn *match_fn);
+</PRE>
+
+<P>
+The <B>data</B> argument provides a way for your application to pass
+arbitrary, application-specific information to the callback
+function. This is passed to the callback every time that it is
+called. It might for example, point to the symbol table from which
+possible completions are to be sought. The <B>match_fn</B> argument
+specifies the callback function to be called. The <B>CplMatchFn</B>
+function type is defined in <B>libtecla.h</B>, as is a
+<B>CPL_MATCH_FN()</B> macro that you can use to declare and prototype
+callback functions. The declaration and responsibilities of callback
+functions are described in depth in the <A HREF="cpl_complete_word.html">cpl_complete_word</A>(3) man
+page.
+<P>
+In brief, the callback function is responsible for looking backwards
+in the input line, back from the point at which the user pressed TAB,
+to find the start of the word being completed. It then must lookup
+possible completions of this word, and record them one by one in the
+<B>WordCompletion</B> object that is passed to it as an argument, by
+calling the <B>cpl_add_completion()</B> function. If the callback
+function wishes to provide filename completion in addition to its own
+specific completions, it has the option of itself calling the builtin
+file-name completion callback. This also, is documented in the
+<B><A HREF="cpl_complete_word.html">cpl_complete_word</A>(3)</B> man page.
+<P>
+Note that if you would like <B>gl_get_line()</B> to return the current
+input line when a successful completion is been made, you can arrange
+this when you call <B>cpl_add_completion()</B>, by making the last
+character of the continuation suffix a newline character. If you do
+this, the input line will be updated to display the completion,
+together with any contiuation suffix up to the newline character, then
+<B>gl_get_line()</B> will return this input line.
+<P>
+<P>
+If, for some reason, your callback function needs to write something
+to the terminal, it must call <B>gl_normal_io()</B> before doing
+so. This will start a new line after the input line that is currently
+being edited, reinstate normal terminal I/O, and tell
+<B>gl_get_line()</B> that the input line will need to be redrawn when
+the callback returns.
+<P>
+<A NAME="lbAK"> </A>
+<H2>ADDING COMPLETION ACTIONS</H2>
+
+<P>
+In the previous section the ability to customize the behavior of the
+only default completion action, <B>complete-word</B>, was described.
+In this section the ability to install additional action functions, so
+that different types of word completion can be bound to different
+key-sequences, is described. This is achieved by using the
+<B>gl_completion_action()</B> function.
+<P>
+<P>
+<PRE>
+ int gl_completion_action(GetLine *gl,
+ void *data, CplMatchFn *match_fn,
+ int list_only, const char *name,
+ const char *keyseq);
+</PRE>
+
+<P>
+<P>
+The <B>data</B> and <B>match_fn</B> arguments are as described
+in the <B>cpl_complete_word</B> man page, and specify the
+callback function that should be invoked to identify
+possible completions. The <B>list_only</B> argument
+determines whether the action that is being defined should
+attempt to complete the word as far as possible in the input
+line before displaying any possible ambiguous completions,
+or whether it should simply display the list of possible
+completions without touching the input line. The former
+option is selected by specifying a value of <B>0</B>, and the
+latter by specifying a value of <B>1</B>. The <B>name</B>
+argument specifies the name by which configuration files and
+future invokations of this function should refer to the
+action. This must either be the name of an existing
+completion action to be changed, or be a new unused name for
+a new action. Finally, the <B>keyseq</B> argument specifies
+the default key-sequence to bind the action to. If this is
+<B>NULL</B>, no new keysequence will be bound to the action.
+<P>
+Beware that in order for the user to be able to change the
+key-sequence that is bound to actions that are installed in
+this manner, when you call <B>gl_completion_action()</B> to
+install a given action for the first time, you should do
+this between calling <B>new_GetLine()</B> and the first call
+to <B>gl_get_line()</B>. Otherwise, when the user's
+configuration file is read on the first call to
+<B>gl_get_line()</B>, the name of the your additional action
+won't be known, and any reference to it in the configuration
+file will generate an error.
+<P>
+As discussed for <B>gl_customize_completion()</B>, if your callback
+function, for some reason, needs to write anything to the terminal, it
+must call <B>gl_normal_io()</B> before doing so.
+<P>
+<A NAME="lbAL"> </A>
+<H2>DEFINING CUSTOM ACTIONS</H2>
+
+<P>
+Although the built-in key-binding actions are sufficient for the needs
+of most applications, occasionally a specialized application may need
+to define one or more custom actions, bound to application-specific
+key-sequences. For example, a sales application would benefit from
+having a key-sequence that displayed the part name that corresponded
+to a part number preceding the cursor. Such a feature is clearly
+beyond the scope of the built-in action functions. So for such special
+cases, the <B>gl_register_action()</B> function is provided.
+<P>
+<P>
+<PRE>
+ int gl_register_action(GetLine *gl, void *data,
+ GlActionFn *fn, const char *name,
+ const char *keyseq);
+</PRE>
+
+<P>
+<P>
+This function lets the application register an external function,
+<B>fn</B>, that will thereafter be called whenever either the specified
+key-sequence, <B>keyseq</B>, is entered by the user, or the user enters
+any other key-sequence that the user subsequently binds to the
+specified action name, <B>name</B>, in their configuration file. The
+<B>data</B> argument can be a pointer to anything that the application
+wishes to have passed to the action function, <B>fn</B>, whenever that
+function is invoked.
+<P>
+The action function, <B>fn</B>, should be declared using the following
+macro, which is defined in <B>libtecla.h</B>.
+<P>
+<P>
+<PRE>
+ #define GL_ACTION_FN(fn) GlAfterAction (fn)(GetLine *gl, \
+ void *data, int count, size_t curpos, \
+ const char *line)
+</PRE>
+
+<P>
+<P>
+The <B>gl</B> and <B>data</B> arguments are those that were previously
+passed to <B>gl_register_action()</B> when the action function was
+registered. The <B>count</B> argument is a numeric argument which the
+user has the option of entering using the <B>digit-argument</B> action,
+before invoking the action. If the user doesn't enter a number, then
+the <B>count</B> argument is set to 1. Nominally this argument is
+interpreted as a repeat count, meaning that the action should be
+repeated that many times. In practice however, for some actions a
+repeat count makes little sense. In such cases, actions can either
+simply ignore the <B>count</B> argument, or use its value for a
+different purpose.
+<P>
+A copy of the current input line is passed in the read-only <B>line</B>
+argument. The current cursor position within this string is given by
+the index contained in the <B>curpos</B> argument. Note that direct
+manipulation of the input line and the cursor position is not
+permitted. This is because the rules dicated by various modes, such as
+vi mode versus emacs mode, no-echo mode, and insert mode versus
+overstrike mode etc, make it too complex for an application writer to
+write a conforming editing action, as well as constrain future changes
+to the internals of <B>gl_get_line()</B>. A potential solution to this
+dilema would be to allow the action function to edit the line using
+the existing editing actions. This is currently under consideration.
+<P>
+If the action function wishes to write text to the terminal, without
+this getting mixed up with the displayed text of the input line, or
+read from the terminal without having to handle raw terminal I/O, then
+before doing either of these operations, it must temporarily suspend
+line editing by calling the <B>gl_normal_io()</B> function. This
+function flushes any pending output to the terminal, moves the cursor
+to the start of the line that follows the last terminal line of the
+input line, then restores the terminal to a state that is suitable for
+use with the C stdio facilities. The latter includes such things as
+restoring the normal mapping of <B>\n</B> to <B>\r\n</B>, and, when
+in server mode, restoring the normal blocking form of terminal
+I/O. Having called this function, the action function can read from
+and write to the terminal without the fear of creating a mess. It
+isn't necessary for the action function to restore the original
+editing environment before it returns. This is done automatically by
+<B>gl_get_line()</B> after the action function returns. The following
+is a simple example of an action function which writes the sentence
+"Hello world" on a new terminal line after the line being edited. When
+this function returns, the input line is redrawn on the line that
+follows the "Hello world" line, and line editing resumes.
+<P>
+<P>
+<PRE>
+ static GL_ACTION_FN(say_hello_fn)
+ {
+ if(gl_normal_io(gl)) /* Temporarily suspend editing */
+ return GLA_ABORT;
+ printf("Hello world\n");
+ return GLA_CONTINUE;
+ }
+</PRE>
+
+<P>
+<P>
+Action functions must return one of the following values, to tell
+<B>gl_get_line()</B> how to procede.
+<P>
+<P>
+<PRE>
+ GLA_ABORT - Cause gl_get_line() to return NULL.
+ GLA_RETURN - Cause gl_get_line() to return the
+ completed input line.
+ GLA_CONTINUE - Resume command-line editing.
+</PRE>
+
+<P>
+<P>
+Note that the <B>name</B> argument of <B>gl_register_action()</B>
+specifies the name by which a user can refer to the action in their
+configuration file. This allows them to re-bind the action to an
+alternate key-seqeunce. In order for this to work, it is necessary to
+call <B>gl_register_action()</B> between calling <B>new_GetLine()</B>
+and the first call to <B>gl_get_line()</B>.
+<P>
+<A NAME="lbAM"> </A>
+<H2>HISTORY FILES</H2>
+
+<P>
+To save the contents of the history buffer before quitting your
+application, and subsequently restore them when you next start the
+application, the following functions are provided.
+<P>
+<P>
+<PRE>
+ int gl_save_history(GetLine *gl, const char *filename,
+ const char *comment, int max_lines);
+ int gl_load_history(GetLine *gl, const char *filename,
+ const char *comment);
+</PRE>
+
+<P>
+<P>
+The <B>filename</B> argument specifies the name to give the history
+file when saving, or the name of an existing history file, when
+loading. This may contain home-directory and environment variable
+expressions, such as "~/.myapp_history" or "$HOME/.myapp_history".
+<P>
+Along with each history line, extra information about it, such as when
+it was entered by the user, and what its nesting level is, is recorded
+as a comment preceding the line in the history file. Writing this as a
+comment allows the history file to double as a command file, just in
+case you wish to replay a whole session using it. Since comment
+prefixes differ in different languages, the <B>comment</B> argument is
+provided for specifying the comment prefix. For example, if your
+application were a unix shell, such as the bourne shell, you would
+specify "#" here. Whatever you choose for the comment character, you
+must specify the same prefix to <B>gl_load_history()</B> that you used
+when you called <B>gl_save_history()</B> to write the history file.
+<P>
+The <B>max_lines</B> must be either -1 to specify that all lines in the
+history list be saved, or a positive number specifying a ceiling on
+how many of the most recent lines should be saved.
+<P>
+Both fuctions return non-zero on error, after writing an error message
+to stderr. Note that <B>gl_load_history()</B> does not consider the
+non-existence of a file to be an error.
+<P>
+<A NAME="lbAN"> </A>
+<H2>MULTIPLE HISTORY LISTS</H2>
+
+<P>
+If your application uses a single <B>GetLine</B> object for entering
+many different types of input lines, you may wish <B>gl_get_line()</B>
+to distinguish the different types of lines in the history list, and
+only recall lines that match the current type of line. To support this
+requirement, <B>gl_get_line()</B> marks lines being recorded in the
+history list with an integer identifier chosen by the application.
+Initially this identifier is set to 0<B> by new_GetLine()</B>,
+but it can be changed subsequently by calling
+<B>gl_group_history()</B>.
+<P>
+<P>
+<PRE>
+ int gl_group_history(GetLine *gl, unsigned id);
+</PRE>
+
+<P>
+<P>
+The integer identifier <B>id</B> can be any number chosen by the
+application, but note that <B>gl_save_history()</B> and
+<B>gl_load_history()</B> preserve the association between identifiers
+and historical input lines between program invokations, so you should
+choose fixed identifiers for the different types of input line used by
+your application.
+<P>
+Whenever <B>gl_get_line()</B> appends a new input line to the history
+list, the current history identifier is recorded with it, and when it
+is asked to recall a historical input line, it only recalls lines that
+are marked with the current identifier.
+<P>
+<A NAME="lbAO"> </A>
+<H2>DISPLAYING HISTORY</H2>
+
+<P>
+The history list can be displayed by calling <B>gl_show_history()</B>.
+<P>
+<P>
+<PRE>
+ int gl_show_history(GetLine *gl, FILE *fp,
+ const char *fmt,
+ int all_groups,
+ int max_lines);
+</PRE>
+
+<P>
+<P>
+This displays the current contents of the history list to the stdio
+output stream <B>fp</B>. If the <B>max_lines</B> argument is greater
+than or equal to zero, then no more than this number of the most
+recent lines will be displayed. If the <B>all_groups</B> argument is
+non-zero, lines from all history groups are displayed. Otherwise just
+those of the currently selected history group are displayed. The
+format string argument, <B>fmt</B>, determines how the line is
+displayed. This can contain arbitrary characters which are written
+verbatim, interleaved with any of the following format directives:
+<P>
+<PRE>
+ %D - The date on which the line was originally
+ entered, formatted like 2001-11-20.
+ %T - The time of day when the line was entered,
+ formatted like 23:59:59.
+ %N - The sequential entry number of the line in
+ the history buffer.
+ %G - The number of the history group which the
+ line belongs to.
+ %% - A literal % character.
+ %H - The history line itself.
+</PRE>
+
+<P>
+Thus a format string like <B>"%D %T %H</B> would output something like:
+<P>
+<PRE>
+ 2001-11-20 10:23:34 Hello world
+</PRE>
+
+<P>
+Note the inclusion of an explicit newline character in the format
+string.
+<P>
+<A NAME="lbAP"> </A>
+<H2>LOOKING UP HISTORY</H2>
+
+<P>
+The <B>gl_lookup_history()</B> function allows the calling application
+to look up lines in the history list.
+<P>
+<P>
+<PRE>
+ typedef struct {
+ const char *line; /* The requested historical */
+ /* line. */
+ unsigned group; /* The history group to which */
+ /* the line belongs. */
+ time_t timestamp; /* The date and time at which */
+ /* the line was originally */
+ /* entered. */
+ } GlHistoryLine;
+
+ int gl_lookup_history(GetLine *gl, unsigned long id,
+ GlHistoryLine *hline);
+</PRE>
+
+<P>
+<P>
+The <B>id</B> argument indicates which line to look up, where the first
+line that was entered in the history list after <B>new_GetLine()</B>
+was called, is denoted by 0, and subsequently entered lines are
+denoted with successively higher numbers. Note that the range of lines
+currently preserved in the history list can be queried by calling the
+<B>gl_range_of_history()</B> function, described later. If the
+requested line is in the history list, the details of the line are
+recorded in the variable pointed to by the <B>hline</B> argument, and
+<B>1</B> is returned. Otherwise <B>0</B> is returned, and the variable
+pointed to by <B>hline</B> is left unchanged.
+<P>
+Beware that the string returned in <B>hline->line</B> is part of the
+history buffer, so it must not be modified by the caller, and will be
+recycled on the next call to any function that takes <B>gl</B> as its
+argument. Therefore you should make a private copy of this string if
+you need to keep it around.
+<P>
+<A NAME="lbAQ"> </A>
+<H2>MANUAL HISTORY ARCHIVAL</H2>
+
+<P>
+By default, whenever a line is entered by the user, it is
+automatically appended to the history list, just before
+<B>gl_get_line()</B> returns the line to the caller. This is convenient
+for the majority of applications, but there are also applications that
+need finer grained control over what gets added to the history
+list. In such cases, the automatic addition of entered lines to the
+history list can be turned off by calling the
+<B>gl_automatic_history()</B> function.
+<P>
+<P>
+<PRE>
+ int gl_automatic_history(GetLine *gl, int enable);
+</PRE>
+
+<P>
+<P>
+If this function is called with its <B>enable</B> argument set to
+<B>0</B>, <B>gl_get_line()</B> won't automatically archive subsequently
+entered lines. Automatic archiving can be reenabled at a later time,
+by calling this function again, with its <B>enable</B> argument set to
+1. While automatic history archiving is disabled, the calling
+application can use the <B>gl_append_history()</B> to append lines to
+the history list as needed.
+<P>
+<P>
+<PRE>
+ int gl_append_history(GetLine *gl, const char *line);
+</PRE>
+
+<P>
+<P>
+The <B>line</B> argument specifies the line to be added to the history
+list. This must be a normal <B>' '</B> terminated string. If this
+string contains any newline characters, the line that gets archived in
+the history list will be terminated by the first of these. Otherwise
+it will be terminated by the <B>' '</B> terminator. If the line is
+longer than the maximum input line length, that was specified when
+<B>new_GetLine()</B> was called, when the line is recalled, it will get
+truncated to the actual <B>gl_get_line()</B> line length.
+<P>
+If successful, <B>gl_append_history()</B> returns 0. Otherwise it
+returns non-zero, and sets <B>errno</B> to one of the following values.
+<P>
+<P>
+<PRE>
+ EINVAL - One of the arguments passed to
+ gl_append_history() was NULL.
+ ENOMEM - The specified line was longer than the allocated
+ size of the history buffer (as specified when
+ new_GetLine() was called), so it couldn't be
+ archived.
+</PRE>
+
+<P>
+<P>
+A textual description of the error can optionally be obtained by
+calling <B>gl_error_message()</B>. Note that after such an error, the
+history list remains in a valid state to receive new history lines, so
+there is little harm in simply ignoring the return status of
+<B>gl_append_history()</B>.
+<P>
+<A NAME="lbAR"> </A>
+<H2>MISCELLANEOUS HISTORY CONFIGURATION</H2>
+
+<P>
+If you wish to change the size of the history buffer that was
+originally specified in the call to <B>new_GetLine()</B>, you can do so
+with the <B>gl_resize_history()</B> function.
+<P>
+<P>
+<PRE>
+ int gl_resize_history(GetLine *gl, size_t histlen);
+</PRE>
+
+<P>
+<P>
+The <B>histlen</B> argument specifies the new size in bytes, and if you
+specify this as 0, the buffer will be deleted.
+<P>
+As mentioned in the discussion of <B>new_GetLine()</B>, the number of
+lines that can be stored in the history buffer, depends on the lengths
+of the individual lines. For example, a 1000 byte buffer could equally
+store 10 lines of average length 100 bytes, or 2 lines of average
+length 50 bytes. Although the buffer is never expanded when new lines
+are added, a list of pointers into the buffer does get expanded when
+needed to accomodate the number of lines currently stored in the
+buffer. To place an upper limit on the number of lines in the buffer,
+and thus a ceiling on the amount of memory used in this list, you can
+call the <B>gl_limit_history()</B> function.
+<P>
+<P>
+<PRE>
+ void gl_limit_history(GetLine *gl, int max_lines);
+</PRE>
+
+<P>
+<P>
+The <B>max_lines</B> should either be a positive number <B>>= 0</B>,
+specifying an upper limit on the number of lines in the buffer, or be
+<B>-1</B> to cancel any previously specified limit. When a limit is in
+effect, only the <B>max_lines</B> most recently appended lines are kept
+in the buffer. Older lines are discarded.
+<P>
+To discard lines from the history buffer, use the
+<B>gl_clear_history()</B> function.
+<P>
+<PRE>
+ void gl_clear_history(GetLine *gl, int all_groups);
+</PRE>
+
+<P>
+The <B>all_groups</B> argument tells the function whether to delete
+just the lines associated with the current history group (see
+<B>gl_group_history()</B>), or all historical lines in the buffer.
+<P>
+The <B>gl_toggle_history()</B> function allows you to toggle history on
+and off without losing the current contents of the history list.
+<P>
+<P>
+<PRE>
+ void gl_toggle_history(GetLine *gl, int enable);
+</PRE>
+
+<P>
+<P>
+Setting the <B>enable</B> argument to 0 turns off the history
+mechanism, and setting it to 1 turns it back on. When history is
+turned off, no new lines will be added to the history list, and
+history lookup key-bindings will act as though there is nothing in the
+history buffer.
+<P>
+<A NAME="lbAS"> </A>
+<H2>QUERYING HISTORY INFORMATION</H2>
+
+<P>
+The configured state of the history list can be queried with the
+<B>gl_history_state()</B> function.
+<P>
+<P>
+<PRE>
+ typedef struct {
+ int enabled; /* True if history is enabled */
+ unsigned group; /* The current history group */
+ int max_lines; /* The current upper limit on the */
+ /* number of lines in the history */
+ /* list, or -1 if unlimited. */
+ } GlHistoryState;
+
+ void gl_state_of_history(GetLine *gl,
+ GlHistoryState *state);
+</PRE>
+
+<P>
+On return, the status information is recorded in the variable pointed
+to by the <B>state</B> argument.
+<P>
+The <B>gl_range_of_history()</B> function returns the number and
+range of lines in the history list.
+<P>
+<P>
+<PRE>
+typedef struct {
+ unsigned long oldest; /* The sequential entry number */
+ /* of the oldest line in the */
+ /* history list. */
+ unsigned long newest; /* The sequential entry number */
+ /* of the newest line in the */
+ /* history list. */
+ int nlines; /* The number of lines in the */
+ /* history list. */
+} GlHistoryRange;
+
+void gl_range_of_history(GetLine *gl, GlHistoryRange *range);
+</PRE>
+
+<P>
+The return values are recorded in the variable pointed to by the
+<B>range</B> argument. If the <B>nlines</B> member of this structure is
+greater than zero, then the <B>oldest</B> and <B>newest</B> members
+report the range of lines in the list, and <B>newest=oldest+nlines-1</B>.
+Otherwise they are both zero.
+<P>
+The <B>gl_size_of_history()</B> function returns the total size of the
+history buffer and the amount of the buffer that is currently
+occupied.
+<P>
+<PRE>
+ typedef struct {
+ size_t size; /* The size of the history buffer */
+ /* (bytes). */
+ size_t used; /* The number of bytes of the */
+ /* history buffer that are */
+ /* currently occupied. */
+ } GlHistorySize;
+
+ void gl_size_of_history(GetLine *gl, GlHistorySize *size);
+</PRE>
+
+<P>
+On return, the size information is recorded in the variable pointed to
+by the <B>size</B> argument.
+<P>
+<A NAME="lbAT"> </A>
+<H2>CHANGING TERMINALS</H2>
+
+<P>
+The <B>new_GetLine()</B> constructor function assumes that input is to
+be read from <B>stdin</B>, and output written to <B>stdout</B>. The
+following function allows you to switch to different input and output
+streams.
+<P>
+<PRE>
+ int gl_change_terminal(GetLine *gl, FILE *input_fp,
+ FILE *output_fp, const char *term);
+</PRE>
+
+<P>
+The <B>gl</B> argument is the object that was returned by
+<B>new_GetLine()</B>. The <B>input_fp</B> argument specifies the stream
+to read from, and <B>output_fp</B> specifies the stream to be written
+to. Only if both of these refer to a terminal, will interactive
+terminal input be enabled. Otherwise <B>gl_get_line()</B> will simply
+call <B>fgets()</B> to read command input. If both streams refer to a
+terminal, then they must refer to the same terminal, and the type of
+this terminal must be specified via the <B>term</B> argument. The value
+of the <B>term</B> argument is looked up in the terminal information
+database (terminfo or termcap), in order to determine which special
+control sequences are needed to control various aspects of the
+terminal. <B>new_GetLine()</B> for example, passes the return value of
+<B>getenv("TERM")</B> in this argument. Note that if one or both of
+<B>input_fp</B> and <B>output_fp</B> don't refer to a terminal, then it
+is legal to pass <B>NULL</B> instead of a terminal type.
+<P>
+Note that if you want to pass file descriptors to
+<B>gl_change_terminal()</B>, you can do this by creating stdio stream
+wrappers using the POSIX <B>fdopen()</B> function.
+<P>
+<A NAME="lbAU"> </A>
+<H2>EXTERNAL EVENT HANDLING</H2>
+
+<P>
+By default, <B>gl_get_line()</B> doesn't return until either a complete
+input line has been entered by the user, or an error occurs. In
+programs that need to watch for I/O from other sources than the
+terminal, there are two options.
+<P>
+<P>
+<PRE>
+ 1. Use the functions described in the
+ <B><A HREF="gl_io_mode.html">gl_io_mode</A>(3)</B> man page to switch
+ <B>gl_get_line()</B> into non-blocking server mode. In this mode,
+ <B>gl_get_line()</B> becomes a non-blocking, incremental
+ line-editing function that can safely be called from
+ an external event loop. Although this is a very
+ versatile method, it involves taking on some
+ responsibilities that are normally performed behind
+ the scenes by <B>gl_get_line()</B>.
+
+ 2. While <B>gl_get_line()</B> is waiting for keyboard
+ input from the user, you can ask it to also watch for
+ activity on arbitrary file descriptors, such as
+ network sockets, pipes etc, and have it call functions
+ of your choosing when activity is seen. This works on
+ any system that has the <B>select()</B> system call,
+ which is most, if not all flavors of unix.
+</PRE>
+
+<P>
+<P>
+Registering a file descriptor to be watched by
+<B>gl_get_line()</B> involves calling the <B>gl_watch_fd()</B> function.
+<P>
+<P>
+<PRE>
+ int gl_watch_fd(GetLine *gl, int fd, GlFdEvent event,
+ GlFdEventFn *callback, void *data);
+</PRE>
+
+<P>
+<P>
+If this returns non-zero, then it means that either your arguments are
+invalid, or that this facility isn't supported on the host system.
+<P>
+The <B>fd</B> argument is the file descriptor to be watched. The
+<B>event</B> argument specifies what type of activity is of interest,
+chosen from the following enumerated values:
+<P>
+<P>
+<PRE>
+ GLFD_READ - Watch for the arrival of data to be read.
+ GLFD_WRITE - Watch for the ability to write to the file
+ descriptor without blocking.
+ GLFD_URGENT - Watch for the arrival of urgent
+ out-of-band data on the file descriptor.
+</PRE>
+
+<P>
+<P>
+The <B>callback</B> argument is the function to call when the selected
+activity is seen. It should be defined with the following macro, which
+is defined in libtecla.h.
+<P>
+<P>
+<PRE>
+ #define GL_FD_EVENT_FN(fn) GlFdStatus (fn)(GetLine *gl, \
+ void *data, int fd, \
+ GlFdEvent event)
+</PRE>
+
+<P>
+The <B>data</B> argument of the <B>gl_watch_fd()</B> function is passed
+to the callback function for its own use, and can point to anything
+you like, including <B>NULL</B>. The file descriptor and the event
+argument are also passed to the callback function, and this
+potentially allows the same callback function to be registered to more
+than one type of event and/or more than one file descriptor. The
+return value of the callback function should be one of the following
+values.
+<P>
+<P>
+<PRE>
+ GLFD_ABORT - Tell gl_get_line() to abort. When this
+ happens, <B>gl_get_line()</B> returns
+ <B>NULL</B>, and a following call to
+ <B>gl_return_status()</B> will return
+ <B>GLR_FDABORT</B>. Note that if the
+ application needs <B>errno</B> always to
+ have a meaningful value when
+ <B>gl_get_line()</B> returns <B>NULL</B>,
+ the callback function should set
+ <B>errno</B> appropriately.
+ GLFD_REFRESH - Redraw the input line then continue
+ waiting for input. Return this if
+ your callback wrote to the terminal.
+ GLFD_CONTINUE - Continue to wait for input, without
+ redrawing the line.
+</PRE>
+
+<P>
+Note that before calling the callback, <B>gl_get_line()</B> blocks most
+signals, and leaves its own signal handlers installed, so if you need
+to catch a particular signal you will need to both temporarily install
+your own signal handler, and unblock the signal. Be sure to re-block
+the signal (if it was originally blocked) and reinstate the original
+signal handler, if any, before returning.
+<P>
+<P>
+<P>
+If the callback function needs to read or write to the terminal, it
+should ideally first call <B>gl_normal_io(gl)</B> to temporarily
+suspend line editing. This will restore the terminal to canonical,
+blocking-I/O, mode, and move the cursor to the start of a new terminal
+line. Later, when the callback returns, <B>gl_get_line()</B> will
+notice that <B>gl_normal_io()</B> was called, redisplay the input line
+and resume editing. Note that in this case the return values,
+<B>GLFD_REFRESH</B> and <B>GLFD_CONTINUE</B> are equivalent.
+<P>
+<P>
+<P>
+To support cases where the callback function calls a third-party
+function which occasionally and unpredictably writes to the terminal,
+the automatic conversion of <B>"</B> to <B>"</B> is re-enabled
+before the callback function is called. If the callack knows that the
+third-party function wrote to the terminal, it should then return the
+<B>GLFD_REFRESH</B> return value, to tell <B>gl_get_line()</B> to
+redisplay the input line.
+<P>
+<P>
+<P>
+To remove a callback function that you previously registered for a
+given file descriptor and event, simply call <B>gl_watch_fd()</B> with
+the same file descriptor and <B>event</B> arguments, but with a
+<B>callback</B> argument of <B>0</B>. The <B>data</B> argument is ignored
+in this case.
+<P>
+<A NAME="lbAV"> </A>
+<H2>SETTING AN INACTIVITY TIMEOUT</H2>
+
+<P>
+On systems with the <B>select()</B> system call, the
+<B>gl_inactivity_timeout()</B> function can be used to set or cancel an
+inactivity timeout. Inactivity in this case refers both to keyboard
+input, and to I/O on any file descriptors registered by prior and
+subsequent calls to <B>gl_watch_fd()</B>. On oddball systems that don't
+have <B>select()</B>, this call has no effect.
+<P>
+<P>
+<PRE>
+ int gl_inactivity_timeout(GetLine *gl, GlTimeoutFn *callback,
+ void *data, unsigned long sec,
+ unsigned long nsec);
+</PRE>
+
+<P>
+<P>
+The timeout is specified in the form of an integral number of seconds
+and an integral number of nanoseconds, via the <B>sec</B> and
+<B>nsec</B> arguments respectively. Subsequently, whenever no activity
+is seen for this time period, the function specified via the
+<B>callback</B> argument is called. The <B>data</B> argument of
+<B>gl_inactivity_timeout()</B> is passed verbatim to this callback function
+whenever it is invoked, and can thus be used to pass arbitrary
+application-specific information to the callback. The following macro
+is provided in <B>libtecla.h</B> for applications to use to declare and
+prototype timeout callback functions.
+<P>
+<P>
+<PRE>
+ #define GL_TIMEOUT_FN(fn) \
+ GlAfterTimeout (fn)(GetLine *gl, void *data)
+</PRE>
+
+<P>
+<P>
+On returning, the application's callback is expected to return one of
+the following enumerators to tell <B>gl_get_line()</B> how to procede
+after the timeout has been handled by the callback.
+<P>
+<P>
+<PRE>
+ GLTO_ABORT - Tell gl_get_line() to abort. When
+ this happens, <B>gl_get_line()</B> will
+ return <B>NULL</B>, and a following call
+ to <B>gl_return_status()</B> will return
+ <B>GLR_TIMEOUT</B>. Note that if the
+ application needs <B>errno</B> always to
+ have a meaningful value when
+ <B>gl_get_line()</B> returns <B>NULL</B>,
+ the callback function should set
+ <B>errno</B> appropriately.
+ GLTO_REFRESH - Redraw the input line, then continue
+ waiting for input. You should return
+ this value if your callback wrote to the
+ terminal without having first called
+ <B>gl_normal_io(gl)</B>.
+ GLTO_CONTINUE - In normal blocking-I/O mode, continue to
+ wait for input, without redrawing the
+ user's input line.
+ In non-blocking server I/O mode (see
+ <A HREF="gl_io_mode.html">gl_io_mode</A>(3)), cause <B>gl_get_line()</B>
+ to act as though I/O blocked. This means
+ that <B>gl_get_line()</B> will immediately
+ return <B>NULL</B>, and a following call
+ to <B>gl_return_status()</B> will return
+ <B>GLR_BLOCKED</B>.
+</PRE>
+
+<P>
+<P>
+Note that before calling the callback, <B>gl_get_line()</B> blocks most
+signals, and leaves its own signal handlers installed, so if you need
+to catch a particular signal you will need to both temporarily install
+your own signal handler, and unblock the signal. Be sure to re-block
+the signal (if it was originally blocked) and reinstate the original
+signal handler, if any, before returning.
+<P>
+<P>
+<P>
+If the callback function needs to read or write to the terminal, it
+should ideally first call <B>gl_normal_io(gl)</B> to temporarily
+suspend line editing. This will restore the terminal to canonical,
+blocking-I/O, mode, and move the cursor to the start of a new terminal
+line. Later, when the callback returns, <B>gl_get_line()</B> will
+notice that <B>gl_normal_io()</B> was called, redisplay the input line
+and resume editing. Note that in this case the return values,
+<B>GLTO_REFRESH</B> and <B>GLTO_CONTINUE</B> are equivalent.
+<P>
+<P>
+<P>
+To support cases where the callback function calls a third-party
+function which occasionally and unpredictably writes to the terminal,
+the automatic conversion of <B>"</B> to <B>"</B> is re-enabled
+before the callback function is called. If the callack knows that the
+third-party function wrote to the terminal, it should then return the
+<B>GLTO_REFRESH</B> return value, to tell <B>gl_get_line()</B> to
+redisplay the input line.
+<P>
+<P>
+<P>
+Note that although the timeout argument includes a nano-second
+component, few computer clocks presently have resolutions that are
+finer than a few milliseconds, so asking for less than a few
+milliseconds is equivalent to requesting zero seconds on a lot of
+systems. If this would be a problem, you should base your timeout
+selection on the actual resolution of the host clock (eg. by calling
+<B>sysconf(_SC_CLK_TCK)</B>).
+<P>
+<P>
+<P>
+To turn off timeouts, simply call <B>gl_inactivity_timeout()</B> with a
+<B>callback</B> argument of <B>0</B>. The <B>data</B> argument is ignored
+in this case.
+<P>
+<A NAME="lbAW"> </A>
+<H2>SIGNAL HANDLING DEFAULTS</H2>
+
+<P>
+By default, the <B>gl_get_line()</B> function intercepts a
+number of signals. This is particularly important for
+signals which would by default terminate the process, since
+the terminal needs to be restored to a usable state before
+this happens. In this section, the signals that are trapped
+by default, and how <B>gl_get_line()</B> responds to them, is
+described. Changing these defaults is the topic of the
+following section.
+<P>
+When the following subset of signals are caught, <B>gl_get_line()</B>
+first restores the terminal settings and signal handling to how they
+were before <B>gl_get_line()</B> was called, resends the signal, to
+allow the calling application's signal handlers to handle it, then if
+the process still exists, <B>gl_get_line()</B> returns <B>NULL</B> and
+sets <B>errno</B> as specified below.
+<P>
+<P>
+<PRE>
+ SIGINT - This signal is generated both by the keyboard
+ interrupt key (usually ^C), and the keyboard
+ break key.
+
+ errno=EINTR
+
+ SIGHUP - This signal is generated when the controlling
+ terminal exits.
+
+ errno=ENOTTY
+
+ SIGPIPE - This signal is generated when a program attempts
+ to write to a pipe who's remote end isn't being
+ read by any process. This can happen for example
+ if you have called <B>gl_change_terminal()</B> to
+ redirect output to a pipe hidden under a pseudo
+ terminal.
+
+ errno=EPIPE
+
+ SIGQUIT - This signal is generated by the keyboard quit
+ key (usually ^\).
+
+ errno=EINTR
+
+ SIGABRT - This signal is generated by the standard C,
+ abort() function. By default it both
+ terminates the process and generates a core
+ dump.
+
+ errno=EINTR
+
+ SIGTERM - This is the default signal that the UN*X
+ kill command sends to processes.
+
+ errno=EINTR
+</PRE>
+
+<P>
+Note that in the case of all of the above signals, POSIX mandates that
+by default the process is terminated, with the addition of a core dump
+in the case of the <B>SIGQUIT</B> signal. In other words, if the
+calling application doesn't override the default handler by supplying
+its own signal handler, receipt of the corresponding signal will
+terminate the application before <B>gl_get_line()</B> returns.
+<P>
+If gl_get_line() aborts with errno set to EINTR, you can find out what
+signal caused it to abort, by calling the following function.
+<P>
+<PRE>
+ int gl_last_signal(const GetLine *gl);
+</PRE>
+
+<P>
+This returns the numeric code (eg. <B>SIGINT</B>) of the last signal
+that was received during the most recent call to <B>gl_get_line()</B>,
+or <B>-1</B> if no signals were received.
+<P>
+On systems that support it, when a SIGWINCH (window change) signal is
+received, <B>gl_get_line()</B> queries the terminal to find out its new
+size, redraws the current input line to accomodate the new size, then
+returns to waiting for keyboard input from the user. Unlike other
+signals, this signal isn't resent to the application.
+<P>
+Finally, the following signals cause <B>gl_get_line()</B> to first
+restore the terminal and signal environment to that which prevailed
+before <B>gl_get_line()</B> was called, then resend the signal to the
+application. If the process still exists after the signal has been
+delivered, then <B>gl_get_line()</B> then re-establishes its own signal
+handlers, switches the terminal back to raw mode, redisplays the input
+line, and goes back to awaiting terminal input from the user.
+<P>
+<PRE>
+ SIGCONT - This signal is generated when a suspended
+ process is resumed.
+
+ SIGPOLL - On SVR4 systems, this signal notifies the
+ process of an asynchronous I/O event. Note
+ that under 4.3+BSD, SIGIO and SIGPOLL are
+ the same. On other systems, SIGIO is ignored
+ by default, so <B>gl_get_line()</B> doesn't
+ trap it by default.
+
+ SIGPWR - This signal is generated when a power failure
+ occurs (presumably when the system is on a
+ UPS).
+
+ SIGALRM - This signal is generated when a timer
+ expires.
+
+ SIGUSR1 - An application specific signal.
+
+ SIGUSR2 - Another application specific signal.
+
+ SIGVTALRM - This signal is generated when a virtual
+ timer expires (see man <A HREF="setitimer.html">setitimer</A>(2)).
+
+ SIGXCPU - This signal is generated when a process
+ exceeds its soft CPU time limit.
+
+ SIGXFSZ - This signal is generated when a process
+ exceeds its soft file-size limit.
+
+ SIGTSTP - This signal is generated by the terminal
+ suspend key, which is usually ^Z, or the
+ delayed terminal suspend key, which is
+ usually ^Y.
+
+ SIGTTIN - This signal is generated if the program
+ attempts to read from the terminal while the
+ program is running in the background.
+
+ SIGTTOU - This signal is generated if the program
+ attempts to write to the terminal while the
+ program is running in the background.
+</PRE>
+
+<P>
+<P>
+Obviously not all of the above signals are supported on all systems,
+so code to support them is conditionally compiled into the tecla
+library.
+<P>
+Note that if <B>SIGKILL</B> or <B>SIGPOLL</B>, which by definition can't
+be caught, or any of the hardware generated exception signals, such as
+<B>SIGSEGV</B>, <B>SIGBUS</B> and <B>SIGFPE</B>, are received and
+unhandled while <B>gl_get_line()</B> has the terminal in raw mode, the
+program will be terminated without the terminal having been restored
+to a usable state. In practice, job-control shells usually reset the
+terminal settings when a process relinquishes the controlling
+terminal, so this is only a problem with older shells.
+<P>
+<A NAME="lbAX"> </A>
+<H2>CUSTOMIZED SIGNAL HANDLING</H2>
+
+<P>
+The previous section listed the signals that
+<B>gl_get_line()</B> traps by default, and described how it
+responds to them. This section describes how to both add and
+remove signals from the list of trapped signals, and how to
+specify how <B>gl_get_line()</B> should respond to a given
+signal.
+<P>
+If you don't need <B>gl_get_line()</B> to do anything in
+response to a signal that it normally traps, you can tell to
+<B>gl_get_line()</B> to ignore that signal by calling
+<B>gl_ignore_signal()</B>.
+<P>
+<PRE>
+ int gl_ignore_signal(GetLine *gl, int signo);
+</PRE>
+
+<P>
+The <B>signo</B> argument is the number of the signal
+(eg. <B>SIGINT</B>) that you want to have ignored. If the
+specified signal isn't currently one of those being trapped,
+this function does nothing.
+<P>
+The <B>gl_trap_signal()</B> function allows you to either add
+a new signal to the list that <B>gl_get_line()</B> traps, or
+modify how it responds to a signal that it already traps.
+<P>
+<PRE>
+ int gl_trap_signal(GetLine *gl, int signo, unsigned flags,
+ GlAfterSignal after, int errno_value);
+</PRE>
+
+<P>
+The <B>signo</B> argument is the number of the signal that
+you wish to have trapped. The <B>flags</B> argument is a set
+of flags which determine the environment in which the
+application's signal handler is invoked, the <B>after</B>
+argument tells <B>gl_get_line()</B> what to do after the
+application's signal handler returns, and <B>errno_value</B>
+tells <B>gl_get_line()</B> what to set <B>errno</B> to if told
+to abort.
+<P>
+The <B>flags</B> argument is a bitwise OR of zero or more of
+the following enumerators:
+<P>
+<PRE>
+ GLS_RESTORE_SIG - Restore the caller's signal
+ environment while handling the
+ signal.
+
+ GLS_RESTORE_TTY - Restore the caller's terminal settings
+ while handling the signal.
+
+ GLS_RESTORE_LINE - Move the cursor to the start of the
+ line following the input line before
+ invoking the application's signal
+ handler.
+
+ GLS_REDRAW_LINE - Redraw the input line when the
+ application's signal handler returns.
+
+ GLS_UNBLOCK_SIG - Normally, if the calling program has
+ a signal blocked (man sigprocmask),
+ gl_get_line() does not trap that
+ signal. This flag tells gl_get_line()
+ to trap the signal and unblock it for
+ the duration of the call to
+ gl_get_line().
+
+ GLS_DONT_FORWARD - If this flag is included, the signal
+ will not be forwarded to the signal
+ handler of the calling program.
+</PRE>
+
+<P>
+Two commonly useful flag combinations are also enumerated as
+follows:
+<P>
+<PRE>
+ GLS_RESTORE_ENV = GLS_RESTORE_SIG | GLS_RESTORE_TTY |
+ GLS_REDRAW_LINE
+
+ GLS_SUSPEND_INPUT = GLS_RESTORE_ENV | GLS_RESTORE_LINE
+</PRE>
+
+<P>
+<P>
+If your signal handler, or the default system signal
+handler for this signal, if you haven't overridden it, never
+either writes to the terminal, nor suspends or terminates
+the calling program, then you can safely set the <B>flags</B>
+argument to <B>0</B>.
+<P>
+If your signal handler always writes to the terminal, reads
+from it, or suspends or terminates the program, you should
+specify the <B>flags</B> argument as <B>GL_SUSPEND_INPUT</B>,
+so that:
+<P>
+<PRE>
+1. The cursor doesn't get left in the middle of the input
+ line.
+2. So that the user can type in input and have it echoed.
+3. So that you don't need to end each output line with
+ <B>\r\n</B>, instead of just <B>\n</B>.
+</PRE>
+
+<P>
+The <B>GL_RESTORE_ENV</B> combination is the same as
+<B>GL_SUSPEND_INPUT</B>, except that it doesn't move the
+cursor, and if your signal handler doesn't read or write
+anything to the terminal, the user won't see any visible
+indication that a signal was caught. This can be useful if
+you have a signal handler that only occasionally writes to
+the terminal, where using <B>GL_SUSPEND_LINE</B> would cause
+the input line to be unnecessarily duplicated when nothing
+had been written to the terminal. Such a signal handler,
+when it does write to the terminal, should be sure to start
+a new line at the start of its first write, by writing a
+\
+n' character, and should be sure to leave the cursor on a
+new line before returning. If the signal arrives while the
+user is entering a line that only occupies a signal terminal
+line, or if the cursor is on the last terminal line of a
+longer input line, this will have the same effect as
+<B>GL_SUSPEND_INPUT</B>. Otherwise it will start writing on a
+line that already contains part of the displayed input line.
+This doesn't do any harm, but it looks a bit ugly, which is
+why the <B>GL_SUSPEND_INPUT</B> combination is better if you
+know that you are always going to be writting to the
+terminal.
+<P>
+The <B>after</B> argument, which determines what
+<B>gl_get_line()</B> does after the application's signal
+handler returns (if it returns), can take any one of the
+following values:
+<P>
+<PRE>
+ GLS_RETURN - Return the completed input line, just as
+ though the user had pressed the return
+ key.
+
+ GLS_ABORT - Cause <B>gl_get_line()</B> to abort. When
+ this happens, <B>gl_get_line()</B> returns
+ <B>NULL</B>, and a following call to
+ <B>gl_return_status()</B> will return
+ <B>GLR_SIGNAL</B>. Note that if the
+ application needs <B>errno</B> always to
+ have a meaningful value when
+ <B>gl_get_line()</B> returns <B>NULL</B>,
+ the callback function should set
+ <B>errno</B> appropriately.
+ GLS_CONTINUE - Resume command line editing.
+</PRE>
+
+<P>
+The <B>errno_value</B> argument is intended to be combined
+with the <B>GLS_ABORT</B> option, telling <B>gl_get_line()</B>
+what to set the standard <B>errno</B> variable to before
+returning <B>NULL</B> to the calling program. It can also,
+however, be used with the <B>GL_RETURN</B> option, in case
+you wish to have a way to distinguish between an input line
+that was entered using the return key, and one that was
+entered by the receipt of a signal.
+<P>
+<A NAME="lbAY"> </A>
+<H2>RELIABLE SIGNAL HANDLING</H2>
+
+<P>
+Signal handling is suprisingly hard to do reliably without race
+conditions. In <B>gl_get_line()</B> a lot of care has been taken to
+allow applications to perform reliable signal handling around
+<B>gl_get_line()</B>. This section explains how to make use of this.
+<P>
+As an example of the problems that can arise if the application isn't
+written correctly, imagine that one's application has a SIGINT signal
+handler that sets a global flag. Now suppose that the application
+tests this flag just before invoking <B>gl_get_line()</B>. If a SIGINT
+signal happens to be received in the small window of time between the
+statement that tests the value of this flag, and the statement that
+calls <B>gl_get_line()</B>, then <B>gl_get_line()</B> will not see the
+signal, and will not be interrupted. As a result, the application
+won't be able to respond to the signal until the user gets around to
+finishing entering the input line and <B>gl_get_line()</B>
+returns. Depending on the application, this might or might not be a
+disaster, but at the very least it would puzzle the user.
+<P>
+The way to avoid such problems is to do the following.
+<P>
+1. If needed, use the <B>gl_trap_signal()</B> function to
+<BR> configure <B>gl_get_line()</B> to abort when important
+<BR> signals are caught.
+<P>
+2. Configure <B>gl_get_line()</B> such that if any of the
+<BR> signals that it catches are blocked when
+<BR> <B>gl_get_line()</B> is called, they will be unblocked
+<BR> automatically during times when <B>gl_get_line()</B> is
+<BR> waiting for I/O. This can be done either
+<BR> on a per signal basis, by calling the
+<BR> <B>gl_trap_signal()</B> function, and specifying the
+<BR> <B>GLS_UNBLOCK</B> attribute of the signal, or globally by
+<BR> calling the <B>gl_catch_blocked()</B> function.
+<P>
+<P>
+<PRE>
+ void gl_catch_blocked(GetLine *gl);
+</PRE>
+
+<P>
+<P>
+<BR> This function simply adds the <B>GLS_UNBLOCK</B> attribute
+<BR> to all of the signals that it is currently configured to
+<BR> trap.
+<P>
+3. Just before calling <B>gl_get_line()</B>, block delivery
+<BR> of all of the signals that <B>gl_get_line()</B> is
+<BR> configured to trap. This can be done using the POSIX
+<BR> <B>sigprocmask()</B> function in conjunction with the
+<BR> <B>gl_list_signals()</B> function.
+<P>
+<P>
+<PRE>
+ int gl_list_signals(GetLine *gl, sigset_t *set);
+</PRE>
+
+<P>
+<P>
+<BR> This function returns the set of signals that it is
+<BR> currently configured to catch in the <B>set</B> argument,
+<BR> which is in the form required by <B>sigprocmask()</B>.
+<P>
+4. In the example, one would now test the global flag that
+<BR> the signal handler sets, knowing that there is now no
+<BR> danger of this flag being set again until
+<BR> <B>gl_get_line()</B> unblocks its signals while performing
+<BR> I/O.
+<P>
+5. Eventually <B>gl_get_line()</B> returns, either because
+<BR> a signal was caught, an error occurred, or the user
+<BR> finished entering their input line.
+<P>
+6. Now one would check the global signal flag again, and if
+<BR> it is set, respond to it, and zero the flag.
+<P>
+7. Use <B>sigprocmask()</B> to unblock the signals that were
+<BR> blocked in step 3.
+<P>
+The same technique can be used around certain POSIX
+signal-aware functions, such as <B>sigsetjmp()</B> and
+<B>sigsuspend()</B>, and in particular, the former of these
+two functions can be used in conjunction with
+<B>siglongjmp()</B> to implement race-condition free signal
+handling around other long-running system calls. The way to
+do this, is explained next, by showing how
+<B>gl_get_line()</B> manages to reliably trap signals around
+calls to functions like <B>read()</B> and <B>select()</B>
+without race conditions.
+<P>
+The first thing that <B>gl_get_line()</B> does, whenever it
+is called, is to use the POSIX <B>sigprocmask()</B> function
+to block the delivery of all of the signals that it is
+currently configured to catch. This is redundant if the
+application has already blocked them, but it does no
+harm. It undoes this step just before returning.
+<P>
+Whenever <B>gl_get_line()</B> needs to call <B>read()</B> or
+<B>select()</B> to wait for input from the user, it first
+calls the POSIX <B>sigsetjmp()</B> function, being sure to
+specify a non-zero value for its <B>savesigs</B> argument.
+The reason for the latter argument will become clear
+shortly.
+<P>
+If <B>sigsetjmp()</B> returns zero, <B>gl_get_line()</B> then
+does the following.
+<P>
+<P>
+<PRE>
+a. It uses the POSIX <B>sigaction()</B> function to register
+ a temporary signal handler to all of the signals that it
+ is configured to catch. This signal handler does two
+ things.
+
+ 1. It records the number of the signal that was received
+ in a file-scope variable.
+
+ 2. It then calls the POSIX <B>siglongjmp()</B>
+ function using the buffer that was passed to
+ <B>sigsetjmp()</B> for its first argument, and
+ a non-zero value for its second argument.
+
+ When this signal handler is registered, the <B>sa_mask</B>
+ member of the <B>struct sigaction act</B> argument of the
+ call to <B>sigaction()</B> is configured to contain all of
+ the signals that <B>gl_get_line()</B> is catching. This
+ ensures that only one signal will be caught at once by
+ our signal handler, which in turn ensures that multiple
+ instances of our signal handler don't tread on each
+ other's toes.
+
+b. Now that the signal handler has been set up,
+ <B>gl_get_line()</B> unblocks all of the signals that it
+ is configured to catch.
+
+c. It then calls the <B>read()</B> or <B>select()</B> system
+ calls to wait for keyboard input.
+
+d. If this system call returns (ie. no signal is received),
+ <B>gl_get_line()</B> blocks delivery of the signals of
+ interest again.
+
+e. It then reinstates the signal handlers that were
+ displaced by the one that was just installed.
+</PRE>
+
+<P>
+<P>
+Alternatively, if <B>sigsetjmp()</B> returns non-zero, this
+means that one of the signals being trapped was caught while
+the above steps were executing. When this happens,
+<B>gl_get_line()</B> does the following.
+<P>
+First, note that when a call to <B>siglongjmp()</B> causes
+<B>sigsetjmp()</B> to return, provided that the
+<B>savesigs</B> argument of <B>sigsetjmp()</B> was non-zero,
+as specified above, the signal process mask is restored to
+how it was when <B>sigsetjmp()</B> was called. This is the
+important difference between <B>sigsetjmp()</B> and the older
+problematic <B>setjmp()</B>, and is the essential ingredient
+that makes it possible to avoid signal handling race
+conditions. Because of this we are guaranteed that all of
+the signals that we blocked before calling <B>sigsetjmp()</B>
+are blocked again as soon as any signal is caught. The
+following statements, which are then executed, are thus
+guaranteed to be executed without any further signals being
+caught.
+<P>
+1. If so instructed by the <B>gl_get_line()</B> configuration
+<BR> attributes of the signal that was caught,
+<BR> <B>gl_get_line()</B> restores the terminal attributes to
+<BR> the state that they had when <B>gl_get_line()</B> was
+<BR> called. This is particularly important for signals that
+<BR> suspend or terminate the process, since otherwise the
+<BR> terminal would be left in an unusable state.
+<P>
+2. It then reinstates the application's signal handlers.
+<P>
+3. Then it uses the C standard-library <B>raise()</B>
+<BR> function to re-send the application the signal that
+<BR> was caught.
+<P>
+3. Next it unblocks delivery of the signal that we just
+<BR> sent. This results in the signal that was just sent
+<BR> via <B>raise()</B>, being caught by the application's
+<BR> original signal handler, which can now handle it as it
+<BR> sees fit.
+<P>
+4. If the signal handler returns (ie. it doesn't terminate
+<BR> the process), <B>gl_get_line()</B> blocks delivery of the
+<BR> above signal again.
+<P>
+5. It then undoes any actions performed in the first of the
+<BR> above steps, and redisplays the line, if the signal
+<BR> configuration calls for this.
+<P>
+6. <B>gl_get_line()</B> then either resumes trying to
+<BR> read a character, or aborts, depending on the
+<BR> configuration of the signal that was caught.
+<P>
+What the above steps do in essence is to take asynchronously
+delivered signals and handle them synchronously, one at a
+time, at a point in the code where <B>gl_get_line()</B> has
+complete control over its environment.
+<P>
+<A NAME="lbAZ"> </A>
+<H2>THE TERMINAL SIZE</H2>
+
+<P>
+On most systems the combination of the <B>TIOCGWINSZ</B> ioctl and the
+<B>SIGWINCH</B> signal is used to maintain an accurate idea of the
+terminal size. The terminal size is newly queried every time that
+<B>gl_get_line()</B> is called and whenever a <B>SIGWINCH</B> signal is
+received.
+<P>
+On the few systems where this mechanism isn't available, at
+startup <B>new_GetLine()</B> first looks for the <B>LINES</B>
+and <B>COLUMNS</B> environment variables. If these aren't
+found, or they contain unusable values, then if a terminal
+information database like terminfo or termcap is available,
+the default size of the terminal is looked up in this
+database. If this too fails to provide the terminal size, a
+default size of 80 columns by 24 lines is used.
+<P>
+Even on systems that do support <B>ioctl(TIOCGWINSZ)</B>, if the
+terminal is on the other end of a serial line, the terminal driver
+generally has no way of detecting when a resize occurs or of querying
+what the current size is. In such cases no <B>SIGWINCH</B> is sent to
+the process, and the dimensions returned by <B>ioctl(TIOCGWINSZ)</B>
+aren't correct. The only way to handle such instances is to provide a
+way for the user to enter a command that tells the remote system what
+the new size is. This command would then call the
+<B>gl_set_term_size()</B> function to tell <B>gl_get_line()</B> about
+the change in size.
+<P>
+<P>
+<PRE>
+ int gl_set_term_size(GetLine *gl, int ncolumn, int nline);
+</PRE>
+
+<P>
+<P>
+The <B>ncolumn</B> and <B>nline</B> arguments are used to specify the
+new dimensions of the terminal, and must not be less than 1. On
+systems that do support <B>ioctl(TIOCGWINSZ)</B>, this function first
+calls <B>ioctl(TIOCSWINSZ)</B> to tell the terminal driver about the
+change in size. In non-blocking server-I/O mode, if a line is
+currently being input, the input line is then redrawn to accomodate
+the changed size. Finally the new values are recorded in <B>gl</B> for
+future use by <B>gl_get_line()</B>.
+<P>
+The <B>gl_terminal_size()</B> function allows you to query
+the current size of the terminal, and install an alternate
+fallback size for cases where the size isn't available.
+Beware that the terminal size won't be available if reading
+from a pipe or a file, so the default values can be
+important even on systems that do support ways of finding
+out the terminal size.
+<P>
+<PRE>
+ typedef struct {
+ int nline; /* The terminal has nline lines */
+ int ncolumn; /* The terminal has ncolumn columns */
+ } GlTerminalSize;
+
+ GlTerminalSize gl_terminal_size(GetLine *gl,
+ int def_ncolumn,
+ int def_nline);
+</PRE>
+
+<P>
+This function first updates <B>gl_get_line()</B>'s fallback terminal
+dimensions, then records its findings in the return value.
+<P>
+The <B>def_ncolumn</B> and <B>def_nline</B> specify the
+default number of terminal columns and lines to use if the
+terminal size can't be determined via <B>ioctl(TIOCGWINSZ)</B> or
+environment variables.
+<P>
+<A NAME="lbBA"> </A>
+<H2>HIDING WHAT YOU TYPE</H2>
+
+<P>
+When entering sensitive information, such as passwords, it is best not
+to have the text that you are entering echoed on the terminal.
+Furthermore, such text should not be recorded in the history list,
+since somebody finding your terminal unattended could then recall it,
+or somebody snooping through your directories could see it in your
+history file. With this in mind, the <B>gl_echo_mode()</B>
+function allows you to toggle on and off the display and archival of
+any text that is subsequently entered in calls to <B>gl_get_line()</B>.
+<P>
+<P>
+<PRE>
+ int gl_echo_mode(GetLine *gl, int enable);
+</PRE>
+
+<P>
+<P>
+The <B>enable</B> argument specifies whether entered text
+should be visible or not. If it is <B>0</B>, then
+subsequently entered lines will not be visible on the
+terminal, and will not be recorded in the history list. If
+it is <B>1</B>, then subsequent input lines will be displayed
+as they are entered, and provided that history hasn't been
+turned off via a call to <B>gl_toggle_history()</B>, then
+they will also be archived in the history list. Finally, if
+the <B>enable</B> argument is <B>-1</B>, then the echoing mode
+is left unchanged, which allows you to non-destructively
+query the current setting via the return value. In all
+cases, the return value of the function is <B>0</B> if
+echoing was disabled before the function was called, and
+<B>1</B> if it was enabled.
+<P>
+When echoing is turned off, note that although tab
+completion will invisibly complete your prefix as far as
+possible, ambiguous completions will not be displayed.
+<P>
+<A NAME="lbBB"> </A>
+<H2>SINGLE CHARACTER QUERIES</H2>
+
+<P>
+Using <B>gl_get_line()</B> to query the user for a single character
+reply, is inconvenient for the user, since they must hit the enter or
+return key before the character that they typed is returned to the
+program. Thus the <B>gl_query_char()</B> function has been provided for
+single character queries like this.
+<P>
+<P>
+<PRE>
+ int gl_query_char(GetLine *gl, const char *prompt,
+ char defchar);
+</PRE>
+
+<P>
+<P>
+This function displays the specified prompt at the start of a new
+line, and waits for the user to type a character. When the user types
+a character, <B>gl_query_char()</B> displays it to the right of the
+prompt, starts a newline, then returns the character to the calling
+program. The return value of the function is the character that was
+typed. If the read had to be aborted for some reason, <B>EOF</B> is
+returned instead. In the latter case, the application can call the
+previously documented <B>gl_return_status()</B>, to find out what went
+wrong. This could, for example, have been the reception of a signal,
+or the optional inactivity timer going off.
+<P>
+If the user simply hits enter, the value of the <B>defchar</B> argument
+is substituted. This means that when the user hits either newline or
+return, the character specified in <B>defchar</B>, is displayed after
+the prompt, as though the user had typed it, as well as being returned
+to the calling application. If such a replacement is not important,
+simply pass <B>'</B> as the value of <B>defchar</B>.
+<P>
+If the entered character is an unprintable character, it is displayed
+symbolically. For example, control-A is displayed as ^A, and
+characters beyond 127 are displayed in octal, preceded by a
+backslash.
+<P>
+As with <B>gl_get_line()</B>, echoing of the entered character can be
+disabled using the <B>gl_echo_mode()</B> function.
+<P>
+If the calling process is suspended while waiting for the user to type
+their response, the cursor is moved to the line following the prompt
+line, then when the process resumes, the prompt is redisplayed, and
+<B>gl_query_char()</B> resumes waiting for the user to type a
+character.
+<P>
+Note that in non-blocking server mode, (see
+<A HREF="gl_io_mode.html">gl_io_mode</A>(3)), if an incomplete input line is in the
+process of being read when <B>gl_query_char()</B> is called, the
+partial input line is discarded, and erased from the terminal, before
+the new prompt is displayed. The next call to <B>gl_get_line()</B> will
+thus start editing a new line.
+<P>
+<A NAME="lbBC"> </A>
+<H2>READING RAW CHARACTERS</H2>
+
+<P>
+Whereas the <B>gl_query_char()</B> function visibly prompts the user
+for a character, and displays what they typed, the
+<B>gl_read_char()</B> function reads a signal character from the user,
+without writing anything to the terminal, or perturbing any
+incompletely entered input line. This means that it can be called not
+only from between calls to <B>gl_get_line()</B>, but also from callback
+functions that the application has registered to be called by
+<B>gl_get_line()</B>.
+<P>
+<P>
+<PRE>
+ int gl_read_char(GetLine *gl);
+</PRE>
+
+<P>
+<P>
+On success, the return value of <B>gl_read_char()</B> is the character
+that was read. On failure, <B>EOF</B> is returned, and the
+<B>gl_return_status()</B> function can be called to find out what went
+wrong. Possibilities include the optional inactivity timer going off,
+the receipt of a signal that is configured to abort gl_get_line(), or
+terminal I/O blocking, when in non-blocking server-I/O mode.
+<P>
+Beware that certain keyboard keys, such as function keys, and cursor
+keys, usually generate at least 3 characters each, so a single call to
+<B>gl_read_char()</B> won't be enough to identify such keystrokes.
+<P>
+<A NAME="lbBD"> </A>
+<H2>CLEARING THE TERMINAL</H2>
+
+<P>
+The calling program can clear the terminal by calling
+<B>gl_erase_terminal()</B>. In non-blocking server-I/O mode, this
+function also arranges for the current input line to be redrawn from
+scratch when <B>gl_get_line()</B> is next called.
+<P>
+<P>
+<PRE>
+ int gl_erase_terminal(GetLine *gl);
+</PRE>
+
+<P>
+<P>
+<A NAME="lbBE"> </A>
+<H2>DISPLAYING TEXT DYNAMICALLY</H2>
+
+<P>
+Between calls to <B>gl_get_line()</B>, the <B>gl_display_text()</B>
+function provides a convenient way to display paragraphs of text,
+left-justified and split over one or more terminal lines according to
+the constraints of the current width of the terminal. Examples of the
+use of this function may be found in the demo programs, where it is
+used to display introductions. In those examples the advanced use of
+optional prefixes, suffixes and filled lines to draw a box around the
+text is also illustrated.
+<P>
+<P>
+<PRE>
+ int gl_display_text(GetLine *gl, int indentation,
+ const char *prefix,
+ const char *suffix, int fill_char,
+ int def_width, int start,
+ const char *string);
+</PRE>
+
+<P>
+If <B>gl</B> isn't currently connected to a terminal, for example if
+the output of a program that uses <B>gl_get_line()</B> is being piped
+to another program or redirected to a file, then the value of the
+<B>def_width</B> parameter is used as the terminal width.
+<P>
+The <B>indentation</B> argument specifies the number of characters to
+use to indent each line of ouput. The <B>fill_char</B> argument
+specifies the character that will be used to perform this indentation.
+<P>
+The <B>prefix</B> argument can either be <B>NULL</B>, or be a string to
+place at the beginning of each new line (after any indentation).
+Similarly, the <B>suffix</B> argument can either be <B>NULL</B>, or be a
+string to place at the end of each line. The suffix is placed flush
+against the right edge of the terminal, and any space between its
+first character and the last word on that line is filled with the
+character specified via the <B>fill_char</B> argument. Normally the
+fill-character is a space.
+<P>
+The <B>start</B> argument tells <B>gl_display_text()</B> how many
+characters have already been written to the current terminal line, and
+thus tells it the starting column index of the cursor. Since the
+return value of <B>gl_display_text()</B> is the ending column index of
+the cursor, by passing the return value of one call to the <B>start</B>
+argument of the next call, a paragraph that is broken between more
+than one string can be composed by calling <B>gl_display_text()</B> for
+each successive portion of the paragraph. Note that literal newline
+characters are necessary at the end of each paragraph to force a new
+line to be started.
+<P>
+On error, <B>gl_display_text()</B> returns -1.
+<P>
+<A NAME="lbBF"> </A>
+<H2>CALLBACK FUNCTION FACILITIES</H2>
+
+<P>
+Unless otherwise stated, callback functions, such as tab
+completion callbacks and event callbacks should not call any
+functions in this module. The following functions, however,
+are designed specifically to be used by callback functions.
+<P>
+Calling the <B>gl_replace_prompt()</B> function from a
+callback tells <B>gl_get_line()</B> to display a different
+prompt when the callback returns. Except in non-blocking
+server mode, it has no effect if used between calls to
+<B>gl_get_line()</B>. In non-blocking server mode (see the
+<B><A HREF="gl_io_mode.html">gl_io_mode</A>(3)</B> man page, when used between two calls to
+<B>gl_get_line()</B> that are operating on the same input
+line, the current input line will be re-drawn with the new
+prompt on the following call to <B>gl_get_line()</B>.
+<P>
+<P>
+<PRE>
+ void gl_replace_prompt(GetLine *gl, const char *prompt);
+</PRE>
+
+<P>
+<P>
+<A NAME="lbBG"> </A>
+<H2>INTERNATIONAL CHARACTER SETS</H2>
+
+<P>
+Since libtecla version 1.4.0, <B>gl_get_line()</B> has been 8-bit
+clean. This means that all 8-bit characters that are printable in the
+user's current locale are now displayed verbatim and included in the
+returned input line. Assuming that the calling program correctly
+contains a call like the following,
+<P>
+<PRE>
+ setlocale(LC_CTYPE, "");
+</PRE>
+
+<P>
+then the current locale is determined by the first of the environment
+variables <B>LC_CTYPE</B>, <B>LC_ALL</B>, and <B>LANG</B>, that is found
+to contain a valid locale name. If none of these variables are
+defined, or the program neglects to call setlocale, then the default
+<B>C</B> locale is used, which is US 7-bit ASCII. On most unix-like
+platforms, you can get a list of valid locales by typing the command:
+<P>
+<PRE>
+ locale -a
+</PRE>
+
+<P>
+at the shell prompt. Further documentation on how the user can make use
+of this to enter international characters can be found in the
+<B><A HREF="tecla.html">tecla</A>(7)</B> man page.
+<P>
+<A NAME="lbBH"> </A>
+<H2>THREAD SAFETY</H2>
+
+<P>
+In a multi-threaded program, you should use the libtecla_r.a version
+of the library. This uses reentrant versions of system functions,
+where available. Unfortunately neither terminfo nor termcap were
+designed to be reentrant, so you can't safely use the functions of the
+getline module in multiple threads (you can use the separate
+file-expansion and word-completion modules in multiple threads, see
+the corresponding man pages for details). However due to the use of
+POSIX reentrant functions for looking up home directories etc, it is
+safe to use this module from a single thread of a multi-threaded
+program, provided that your other threads don't use any termcap or
+terminfo functions.
+<P>
+<A NAME="lbBI"> </A>
+<H2>FILES</H2>
+
+<PRE>
+libtecla.a - The tecla library
+libtecla.h - The tecla header file.
+~/.teclarc - The personal tecla customization file.
+</PRE>
+
+<P>
+<A NAME="lbBJ"> </A>
+<H2>SEE ALSO</H2>
+
+<PRE>
+<A HREF="libtecla.html">libtecla</A>(3), <A HREF="gl_io_mode.html">gl_io_mode</A>(3), <A HREF="tecla.html">tecla</A>(7), <A HREF="ef_expand_file.html">ef_expand_file</A>(3),
+<A HREF="cpl_complete_word.html">cpl_complete_word</A>(3), <A HREF="pca_lookup_file.html">pca_lookup_file</A>(3)
+</PRE>
+
+<P>
+<A NAME="lbBK"> </A>
+<H2>AUTHOR</H2>
+
+Martin Shepherd (<A HREF="mailto:mcs at astro.caltech.edu">mcs at astro.caltech.edu</A>)
+<P>
+
+<HR>
+<A NAME="index"> </A><H2>Index</H2>
+<DL>
+<DT><A HREF="#lbAB">NAME</A><DD>
+<DT><A HREF="#lbAC">SYNOPSIS</A><DD>
+<DT><A HREF="#lbAD">DESCRIPTION</A><DD>
+<DT><A HREF="#lbAE">AN EXAMPLE</A><DD>
+<DT><A HREF="#lbAF">THE FUNCTIONS USED IN THE EXAMPLE</A><DD>
+<DT><A HREF="#lbAG">THE RETURN STATUS OF GL_GET_LINE</A><DD>
+<DT><A HREF="#lbAH">OPTIONAL PROMPT FORMATTING</A><DD>
+<DT><A HREF="#lbAI">ALTERNATE CONFIGURATION SOURCES</A><DD>
+<DT><A HREF="#lbAJ">CUSTOMIZED WORD COMPLETION</A><DD>
+<DT><A HREF="#lbAK">ADDING COMPLETION ACTIONS</A><DD>
+<DT><A HREF="#lbAL">DEFINING CUSTOM ACTIONS</A><DD>
+<DT><A HREF="#lbAM">HISTORY FILES</A><DD>
+<DT><A HREF="#lbAN">MULTIPLE HISTORY LISTS</A><DD>
+<DT><A HREF="#lbAO">DISPLAYING HISTORY</A><DD>
+<DT><A HREF="#lbAP">LOOKING UP HISTORY</A><DD>
+<DT><A HREF="#lbAQ">MANUAL HISTORY ARCHIVAL</A><DD>
+<DT><A HREF="#lbAR">MISCELLANEOUS HISTORY CONFIGURATION</A><DD>
+<DT><A HREF="#lbAS">QUERYING HISTORY INFORMATION</A><DD>
+<DT><A HREF="#lbAT">CHANGING TERMINALS</A><DD>
+<DT><A HREF="#lbAU">EXTERNAL EVENT HANDLING</A><DD>
+<DT><A HREF="#lbAV">SETTING AN INACTIVITY TIMEOUT</A><DD>
+<DT><A HREF="#lbAW">SIGNAL HANDLING DEFAULTS</A><DD>
+<DT><A HREF="#lbAX">CUSTOMIZED SIGNAL HANDLING</A><DD>
+<DT><A HREF="#lbAY">RELIABLE SIGNAL HANDLING</A><DD>
+<DT><A HREF="#lbAZ">THE TERMINAL SIZE</A><DD>
+<DT><A HREF="#lbBA">HIDING WHAT YOU TYPE</A><DD>
+<DT><A HREF="#lbBB">SINGLE CHARACTER QUERIES</A><DD>
+<DT><A HREF="#lbBC">READING RAW CHARACTERS</A><DD>
+<DT><A HREF="#lbBD">CLEARING THE TERMINAL</A><DD>
+<DT><A HREF="#lbBE">DISPLAYING TEXT DYNAMICALLY</A><DD>
+<DT><A HREF="#lbBF">CALLBACK FUNCTION FACILITIES</A><DD>
+<DT><A HREF="#lbBG">INTERNATIONAL CHARACTER SETS</A><DD>
+<DT><A HREF="#lbBH">THREAD SAFETY</A><DD>
+<DT><A HREF="#lbBI">FILES</A><DD>
+<DT><A HREF="#lbBJ">SEE ALSO</A><DD>
+<DT><A HREF="#lbBK">AUTHOR</A><DD>
+</DL>
+<HR>
+This document was created by
+<A HREF="/cgi-bin/man/man2html">man2html</A>,
+using the manual pages.<BR>
+Time: 03:25:06 GMT, June 12, 2012
+</BODY>
+</HTML>
diff --git a/html/gl_io_mode.html b/html/gl_io_mode.html
index 98c15a7..2cdaf37 100644
--- a/html/gl_io_mode.html
+++ b/html/gl_io_mode.html
@@ -1,509 +1,634 @@
-<head>
-<title>Manual Page</title>
-</head>
-<body>
-<pre>
-<a href="gl_io_mode.html"><b>gl_io_mode</b></a> <a href="gl_io_mode.html"><b>gl_io_mode</b></a>
-
-
-
-</pre><h2>NAME</h2><pre>
- gl_io_mode, gl_raw_io, gl_normal_io, gl_tty_signals, gl_abandon_line,
- gl_handle_signal, gl_pending_io - How to use gl_get_line() from an
- external event loop.
-
-</pre><h2>SYNOPSIS</h2><pre>
- #include <libtecla.h>
-
- int gl_io_mode(GetLine *gl, GlIOMode mode);
-
- int gl_raw_io(GetLine *gl);
-
- int gl_normal_io(GetLine *gl);
-
- int gl_tty_signals(void (*term_handler)(int),
- void (*susp_handler)(int),
- void (*cont_handler)(int),
- void (*size_handler)(int));
-
- void gl_abandon_line(GetLine *gl);
-
- void gl_handle_signal(int signo, GetLine *gl, int ngl);
-
- GlPendingIO gl_pending_io(GetLine *gl);
-
-
-
-</pre><h2>DESCRIPTION</h2><pre>
- The gl_get_line() function, which is documented separately in the
- <a href="gl_get_line.html"><b>gl_get_line</b></a> man page, supports two different I/O modes.
- These are selected by calling the gl_io_mode() function.
-
-
- int gl_io_mode(GetLine *gl, GlIOMode mode);
-
-
- The mode argument of this function specifies the new I/O mode, and must
- be one of the following.
-
-
- GL_NORMAL_MODE - Select the normal blocking-I/O mode.
- In this mode gl_get_line()
- doesn't return until either an error
- occurs of the user finishes entering a
- new line. This mode is the focus of
- the <a href="gl_get_line.html"><b>gl_get_line</b></a> man page.
-
- GL_SERVER_MODE - Select non-blocking server I/O mode.
- In this mode, since non-blocking
- terminal I/O is used, the entry of
- each new input line typically requires
- many calls to gl_get_line() from
- an external I/O-driven event loop.
- This mode is the focus of this man
- page.
-
-
- Newly created GetLine objects start in normal I/O mode, so to switch to
- non-blocking server mode requires an initial call to gl_io_mode().
-
-
-</pre><h2>SERVER I/O MODE</h2><pre>
- In non-blocking server I/O mode, the application is required to have an
- event loop which calls gl_get_line() whenever the terminal file
- descriptor can do the type I/O that gl_get_line() is waiting for. To
- determine which type of I/O gl_get_line() is waiting for, the applica-
- tion calls the gl_pending_io() function.
-
-
- GlPendingIO gl_pending_io(GetLine *gl);
-
-
- The return value of this function is one of the following two enumer-
- ated values.
-
-
- GLP_READ - gl_get_line() is waiting to write a
- character to the terminal.
-
- GLP_WRITE - gl_get_line() is waiting to read a
- character from the keyboad.
-
-
- If the application is using either the select() or poll() system calls
- to watch for I/O on a group of file descriptors, then it should call
- the gl_pending_io() function before each call to these functions to see
- which direction of I/O it should tell them to watch for, and configure
- their arguments accordingly. In the case of the select() system call,
- this means using the FD_SET() macro to add the terminal file descriptor
- either to the set of file descriptors to be watched for readability, or
- the set to be watched for writability.
-
- As in normal I/O mode, the return value of gl_get_line() is either a
- pointer to a completed input line, or NULL. However, whereas in normal
- I/O mode a NULL return value always means that an error occurred, in
- non-blocking server mode, NULL is also returned when gl_get_line()
- can't read or write to the terminal without blocking. Thus in non-
- blocking server mode, in order to determine when a NULL return value
- signifies that an error occurred or not, it is necessary to call the
- gl_return_status() function. If this function returns the enumerated
- value, GLR_BLOCKED, as documented in the <a href="gl_get_line.html"><b>gl_get_line</b></a> man
- page, this means that gl_get_line() is waiting for I/O, and no error
- has occurred.
-
- When gl_get_line() returns NULL and gl_return_status() indicates that
- this is due to blocked terminal I/O, the application should call
- gl_get_line() again when the type of I/O reported by gl_pending_io()
- becomes possible. The prompt, start_line and start_pos arguments of
- gl_get_line() will be ignored on these calls. If you need to change
- the prompt of the line that is currently being edited, then you can
- call the gl_replace_prompt() function (documented in the
- <a href="gl_get_line.html"><b>gl_get_line</b></a> man page) between calls to gl_get_line().
-
-
-</pre><h2>GIVING UP THE TERMINAL</h2><pre>
- A complication that is unique to non-blocking server mode is that it
- requires that the terminal be left in raw mode between calls to
- gl_get_line(). If this weren't the case, the external event loop
- wouldn't be able to detect individual key-presses, and the basic line
- editing implemented by the terminal driver would clash with the editing
- provided by gl_get_line(). What this means is that any time that the
- terminal needs to be used for other things than entering a new input
- line with gl_get_line(), it needs to be restored to a usable state. In
- particular, whenever the process is suspended or terminated, the termi-
- nal must be returned to a normal state. If this isn't done, then
- depending on the characteristics of the shell that was used to invoke
- the program, the user may end up with a hung terminal. To this end, the
- gl_normal_io() function is provided for switching the terminal back to
- the state that it was in when raw mode was last established.
-
-
- int gl_normal_io(GetLine *gl);
-
-
- What this function does is first flush any pending output to the termi-
- nal, then move the cursor to the start of the terminal line which fol-
- lows the end of the incompletely entered input line. At this point it
- is safe to suspend or terminate the process, and it is safe for the
- application to read and write to the terminal. To resume entry of the
- input line, the application should call the gl_raw_io() function.
-
-
- int gl_raw_io(GetLine *gl);
-
-
- This function starts a new line, redisplays the partially completed
- input line (if any), restores the cursor position within this line to
- where it was when gl_normal_io() was called, then switches back to raw,
- non-blocking terminal mode ready to continue entry of the input line
- when gl_get_line() is next called.
-
- Note that in non-blocking server mode, if gl_get_line() is called after
- a call to gl_normal_io(), without an intervening call to gl_raw_io(),
- gl_get_line() will call gl_raw_mode() itself, and the terminal will
- remain in this mode when gl_get_line() returns.
-
-
-</pre><h2>SIGNAL HANDLING</h2><pre>
- In the previous section it was pointed out that in non-blocking server
- mode, the terminal must be restored to a sane state whenever a signal
- is received that either suspends or terminates the process. In normal
- I/O mode, this is done for you by gl_get_line(), but in non-blocking
- server mode, since the terminal is left in raw mode between calls to
- gl_get_line(), this signal handling has to be done by the application.
- Since there are many signals that can suspend or terminate a process,
- as well as other signals that are important to gl_get_line(), such as
- the SIGWINCH signal, which tells it when the terminal size has changed,
- the gl_tty_signals() function is provided for installing signal han-
- dlers for all pertinent signals.
-
-
- int gl_tty_signals(void (*term_handler)(int),
- void (*susp_handler)(int),
- void (*cont_handler)(int),
- void (*size_handler)(int));
-
-
- What this does is use gl_get_line()'s internal list of signals to
- assign specified signal handlers to groups of signals. The arguments of
- this function are as follows.
-
-
- term_handler - This is the signal handler that is to be
- used to trap signals that by default
- terminate any process that receives
- them (eg. SIGINT or SIGTERM).
-
- susp_handler - This is the signal handler that is to be
- used to trap signals that by default
- suspend any process that receives them,
- (eg. SIGTSTP or SIGTTOU).
-
- cont_handler - This is the signal handler that is to be
- used to trap signals that are usually
- sent when a process resumes after being
- suspended (usually SIGCONT). Beware that there is
- nothing to stop a user from sending one of these
- signals at other times.
-
- size_handler - This signal handler is used to trap
- signals that are sent to processes when
- their controlling terminals are resized
- by the user (eg. SIGWINCH).
-
-
- These arguments can all be the same, if so desired, and you can specify
- SIG_IGN (ignore this signal) or SIG_DFL (use the system-provided
- default signal handler) instead of a function where pertinent. In par-
- ticular, it is rarely useful to trap SIGCONT, so the cont_handler argu-
- ment will usually be SIG_DFL or SIG_IGN.
-
- The gl_tty_signals() function uses the POSIX sigaction() function to
- install these signal handlers, and it is careful to use the sa_mask
- member of each sigaction structure to ensure that only one of these
- signals is ever delivered at a time. This guards against different
- instances of these signal handlers from simultaneously trying to write
- to common global data, such as a shared sigsetjmp() buffer or a signal-
- received flag.
-
- The signal handlers that are installed by this function, should call
- the gl_handle_signal().
-
-
- void gl_handle_signal(int signo, GetLine *gl, int ngl);
-
-
- The signo argument tells this function which signal it is being asked
- to respond to, and the gl argument should be a pointer to the first
- element of an array of ngl GetLine objects. If your application only
- has one of these objects, just pass its pointer as the gl argument and
- specify ngl as 1.
-
- Depending on the signal that is being handled, this function does dif-
- ferent things.
-
-
- Terminal resize signals (SIGWINCH)
- If the signal indicates that the terminal was resized, then it arranges
- for the next call to gl_get_line() to ask the terminal for its new size
- and redraw the input line accordingly. In order that gl_get_line() be
- called as soon as possible to do this, gl_handle_signal() also arranges
- that the next call to gl_pending_io() will return GLP_WRITE. Thus if
- the application waits for I/O in select() or poll(), then the applica-
- tion needs to ensure that these functions will be reliably aborted when
- a signal is caught and handled by the application. More on this below.
-
-
-</pre><h2>Process termination signals.</h2><pre>
- If the signal that was caught is one of those that by default termi-
- nates any process that receives it, then gl_handle_signal() does the
- following steps.
-
- 1. First it blocks the delivery of all signals that can be
- blocked (ie. SIGKILL and SIGSTOP can't be blocked)
-
- 2. Next it calls gl_normal_io() for each of the ngl
- GetLine objects. Note that this does nothing to any of the
- GetLine objects that aren't currently in raw mode.
-
- 3. Next it sets the signal handler of the signal to its default,
- process-termination disposition.
-
- 4. Next it re-sends the process the signal that was caught.
-
- 5. Finally it unblocks delivery of this signal, which
- results in the process being terminated.
-
-
-</pre><h2>Process suspension signals.</h2><pre>
- If the default disposition of the signal is to suspend the process, the
- same steps are executed as for process termination signals, except that
- when the process is later resumed, gl_handle_signal() continues, and
- does the following steps.
-
- 6. It re-blocks delivery of the signal.
-
- 7. It reinstates the signal handler of the signal to the one
- that was displaced when its default disposition was substituted.
-
- 8. For any of the GetLine objects that were in raw mode when
- gl_handle_signal() was called, gl_handle_signal() then
- calls gl_raw_io(), to resume entry of the input lines on
- those terminals.
-
- 9. Finally, it restores the signal process mask to how it
- was when gl_handle_signal() was called.
-
- Note that the process is suspended or terminated using the original
- signal that was caught, rather than using the uncatchable SIGSTOP and
- SIGKILL signals. This is important, because when a process is suspended
- or terminated, the parent of the process may wish to use the status
- value returned by the wait() system call to figure out which signal was
- responsible. In particular, most shells use this information to print a
- corresponding message to the terminal. Users would be rightly confused
- if when their process received a SIGPIPE signal, the program responded
- by sending itself a SIGKILL signal, and the shell then printed out the
- provocative statement, "Killed!".
-
-
-</pre><h2>INTERRUPTING THE EVENT LOOP</h2><pre>
- If a signal is caught and handled when the application's event loop is
- waiting in select() or poll(), these functions will be aborted with
- errno set to EINTR. When this happens the event loop should call
- gl_pending_io(), before calling select() or poll() again. It should
- then arrange for select() or poll() to wait for the type of I/O that
- this reports. This is necessary, because any signal handler which calls
- gl_handle_signal(), will frequently change the type of I/O that
- gl_get_line() is waiting for.
-
- Unfortunately, if a signal arrives between the statements which config-
- ure the arguments of select() or poll() and the calls to these func-
- tions, then the signal will not be seen by these functions, which will
- then not be aborted. If these functions are waiting for keyboard input
- from the user when the signal is received, and the signal handler
- arranges to redraw the input line to accomodate a terminal resize or
- the resumption of the process, then this redisplay will be end up being
- delayed until the user hits the next key. Apart from puzzling the user,
- this clearly isn't a serious problem. However there is a way, albeit
- complicated, to completely avoid this race condition. The following
- steps illustrate this.
-
- 1. Block all of the signals that gl_get_line() catches,
- by passing the signal set returned by gl_list_signals() to
- sigprocmask().
-
- 2. Call gl_pending_io() and set up the arguments of
- select() or poll() accordingly.
-
- 3. Call sigsetjmp() with a non-zero savesigs argument.
-
- 4. Initially this sigsetjmp() statement will return zero,
- indicating that control isn't resuming there after a matching
- call to siglongjmp().
-
- 5. Replace all of the handlers of the signals that gl_get_line()
- is configured to catch, with a signal handler that first records
- the number of the signal that was caught, in a file-scope variable,
- then calls siglongjmp() with a non-zero value argument, to
- return execution to the above sigsetjmp()
- statement. Registering these signal handlers can conveniently be
- done using the gl_tty_signals() function.
-
- 6. Set the file-scope variable that the above signal handler uses to
- record any signal that is caught to -1, so that we can check
- whether a signal was caught by seeing if it contains a valid signal
- number.
-
- 7. Now unblock the signals that were blocked in step 1. Any signal
- that was received by the process in between step 1 and now will
- now be delivered, and trigger our signal handler, as will any
- signal that is received until we block these signals again.
-
- 8. Now call select() or poll().
-
- 9. When select() returns, again block the signals that were
- unblocked in step 7.
-
- If a signal is arrived any time during the above steps, our signal han-
- dler will be triggered and cause control to return to the sigsetjmp()
- statement, where this time, sigsetjmp() will return non-zero, indicat-
- ing that a signal was caught. When this happens we simply skip the
- above block of statements, and continue with the following statements,
- which are executed regardless of whether or not a signal is caught.
- Note that when sigsetjmp() returns, regardless of why it returned, the
- process signal mask is returned to how it was when sigsetjmp() was
- called. Thus the following statements are always executed with all of
- our signals blocked.
-
- 9. Reinstate the signal handlers that were displaced in step 5.
-
- 10. Check wether a signal was caught, by checking the file-scope
- variable that the signal handler records signal numbers in.
-
- 11. If a signal was caught, send this signal to the application
- again, and unblock just this signal, so that it invokes the
- signal handler which we just reinstated in step 10.
-
- 12. Unblock all of the signals that were blocked in step 7.
-
- Since this is complicated, note that demo3.c includes a working example
- of how to do this. The method used there however, is more general than
- the above. What it provides is a wrapper function around select() which
- encompasses steps 3 to 11. In this wrapper, rather than use
- gl_list_signals() to figure out the signals to block, and and
- gl_tty_signals() to assign and revert signal handlers, one of its argu-
- ments is a sigset_t which specifies which signals to block and assign
- signal handlers to. This function thus doesn't depend on gl_get_line()
- and can thus be used in other situations where race-condition-free sig-
- nal handling is required.
-
-
-</pre><h2>SIGNALS CAUGHT BY GL_GET_LINE</h2><pre>
- Since the application is expected to handle signals in non-blocking
- server mode, gl_get_line() doesn't attempt to duplicate this when it is
- being called. If one of the signals that it is configured to catch is
- sent to the application while gl_get_line() is being called,
- gl_get_line() reinstates the caller's signal handlers, then just before
- returning, re-sends the signal to the process to let the application's
- signal handler handle it. If the process isn't terminated by this sig-
- nal, gl_get_line() returns NULL, and a following call to gl_return_sta-
- tus() returns the enumerated value GLR_SIGNAL.
-
-
-</pre><h2>ABORTING LINE INPUT</h2><pre>
- Often, rather than letting it terminate the process, applications
- respond to the SIGINT user-interrupt signal by aborting the current
- input line. The way to do this in non-blocking server-I/O mode is to
- not call gl_handle_signal() when this signal is caught, but instead to
- call the gl_abandon_line().
-
-
- void gl_abandon_line(GetLine *gl);
-
-
- This function arranges that when gl_get_line() is next called, it first
- flushes any pending output to the terminal, then discardes the current
- input line, outputs a new prompt on the next line, and finally starts
- accepting input of a new input line from the user.
-
-
-</pre><h2>SIGNAL SAFE FUNCTIONS</h2><pre>
- Provided that certain rules are followed, the following functions can
- have been written to be safely callable from signal handlers. Other
- functions in this library should not be called from signal handlers.
-
-
- gl_normal_io()
- gl_raw_io()
- gl_handle_signal()
- gl_abandon_line()
-
-
- In order for this to be true, all signal handlers that call these func-
- tions must be registered in such a way that only one instance of any
- one of them can be running at one time. The way to do this is to use
- the POSIX sigaction() function to register all signal handlers, and
- when doing this, use the sa_mask member of the corresponding sigaction
- structure, to indicate that all of the signals who's handlers invoke
- the above functions, should be blocked when the current signal is being
- handled. This prevents two signal handlers from operating on a GetLine
- object at the same time.
-
- To prevent signal handlers from accessing a GetLine object while
- gl_get_line() or any of its associated public functions are operating
- on it, all public functions associated with gl_get_line(), including
- gl_get_line() itself, temporarily block the delivery of signals when
- they are accessing GetLine objects. Beware that the only signals that
- they block are the signals that gl_get_line() is currently configured
- to catch, so be sure that if you call any of the above functions from
- signal handlers, that the signals that these handlers are assigned to
- are configured to be caught by gl_get_line() (see gl_trap_signal()).
-
-
-</pre><h2>USING TIMEOUTS TO POLL</h2><pre>
- If instead of using select() or poll() to wait for I/O, your applica-
- tion just needs to get out of gl_get_line() periodically to briefly do
- something else before returning to accept input from the user, this can
- be done in non-blocking server mode by using the gl_inactivity_time-
- out() function (see <a href="gl_get_line.html"><b>gl_get_line</b></a>), to specify that a
- callback function that returns GLTO_CONTINUE should be called whenever
- gl_get_line() has been waiting for I/O for more than a specified amount
- of time.
-
- When this callback is triggered, gl_get_line() will return NULL, and a
- following call to gl_return_status() will return GLR_BLOCKED.
-
- Beware that gl_get_line() won't return until the user hasn't typed a
- key for the specified interval, so if the interval is long, and the
- user keeps typing, gl_get_line() may not return for a while. In other
- words there is no guarantee that it will return in the time specified.
-
-
-</pre><h2>THE SERVER DEMO PROGRAM</h2><pre>
- The demo3 program that is distributed with the library, provides a
- working example of how to use non-blocking server I/O mode in a real
- program. As far as the user is concerned, this program operates
- identically to the main demo program (called demo), except that whereas
- the main demo program uses the normal blocking I/O mode, demo3 using
- non-blocking I/O and an external event loop. The source code can be
- found in demo3.c, and the comments therein explain the various steps.
-
-
-</pre><h2>FILES</h2><pre>
- libtecla.a - The tecla library
- libtecla.h - The tecla header file.
-
-
-</pre><h2>SEE ALSO</h2><pre>
- <a href="libtecla.html"><b>libtecla</b></a>, <a href="gl_get_line.html"><b>gl_get_line</b></a>, <a href="tecla.html"><b>tecla</b></a>, <a href="ef_expand_file.html"><b>ef_expand_file</b></a>,
- <a href="cpl_complete_word.html"><b>cpl_complete_word</b></a>, <a href="pca_lookup_file.html"><b>pca_lookup_file</b></a>
-
-
-</pre><h2>AUTHOR</h2><pre>
- Martin Shepherd (mcs at astro.caltech.edu)
-
-
-
- <a href="gl_io_mode.html"><b>gl_io_mode</b></a>
-</pre>
-</body>
+Content-type: text/html
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML><HEAD><TITLE>Man page of gl_io_mode</TITLE>
+</HEAD><BODY>
+<H1>gl_io_mode</H1>
+Section: C Library Functions (3)<BR><A HREF="#index">Index</A>
+<A HREF="index.html">Return to Main Contents</A><HR>
+
+<A NAME="lbAB"> </A>
+<H2>NAME</H2>
+
+<BR> gl_io_mode, gl_raw_io, gl_normal_io, gl_tty_signals, gl_abandon_line,
+<BR> gl_handle_signal, gl_pending_io - How to use gl_get_line() from an external event loop.
+<A NAME="lbAC"> </A>
+<H2>SYNOPSIS</H2>
+
+<PRE>
+#include <<A HREF="file:///usr/include/libtecla.h">libtecla.h</A>>
+
+int gl_io_mode(GetLine *gl, GlIOMode mode);
+
+int gl_raw_io(GetLine *gl);
+
+int gl_normal_io(GetLine *gl);
+
+int gl_tty_signals(void (*term_handler)(int),
+ void (*susp_handler)(int),
+ void (*cont_handler)(int),
+ void (*size_handler)(int));
+
+void gl_abandon_line(GetLine *gl);
+
+void gl_handle_signal(int signo, GetLine *gl, int ngl);
+
+GlPendingIO gl_pending_io(GetLine *gl);
+
+</PRE>
+
+<P>
+<A NAME="lbAD"> </A>
+<H2>DESCRIPTION</H2>
+
+<P>
+The <B>gl_get_line()</B> function, which is documented separately in
+the <B><A HREF="gl_get_line.html">gl_get_line</A>(3)</B> man page, supports two different I/O modes.
+These are selected by calling the <B>gl_io_mode()</B> function.
+<P>
+<P>
+<PRE>
+ int gl_io_mode(GetLine *gl, GlIOMode mode);
+</PRE>
+
+<P>
+<P>
+The <B>mode</B> argument of this function specifies the new I/O mode,
+and must be one of the following.
+<P>
+<P>
+<PRE>
+ GL_NORMAL_MODE - Select the normal blocking-I/O mode.
+ In this mode <B>gl_get_line()</B>
+ doesn't return until either an error
+ occurs of the user finishes entering a
+ new line. This mode is the focus of
+ the <B><A HREF="gl_get_line.html">gl_get_line</A>(3)</B> man page.
+
+ GL_SERVER_MODE - Select non-blocking server I/O mode.
+ In this mode, since non-blocking
+ terminal I/O is used, the entry of
+ each new input line typically requires
+ many calls to <B>gl_get_line()</B> from
+ an external I/O-driven event loop.
+ This mode is the focus of this man
+ page.
+</PRE>
+
+<P>
+<P>
+Newly created <B>GetLine</B> objects start in normal I/O
+mode, so to switch to non-blocking server mode requires an
+initial call to <B>gl_io_mode()</B>.
+<P>
+<A NAME="lbAE"> </A>
+<H2>SERVER I/O MODE</H2>
+
+<P>
+In non-blocking server I/O mode, the application is required
+to have an event loop which calls <B>gl_get_line()</B>
+whenever the terminal file descriptor can do the type I/O
+that <B>gl_get_line()</B> is waiting for. To determine which
+type of I/O <B>gl_get_line()</B> is waiting for, the
+application calls the <B>gl_pending_io()</B> function.
+<P>
+<P>
+<PRE>
+ GlPendingIO gl_pending_io(GetLine *gl);
+</PRE>
+
+<P>
+<P>
+The return value of this function is one of the following two
+enumerated values.
+<P>
+<P>
+<PRE>
+ GLP_READ - gl_get_line() is waiting to write a
+ character to the terminal.
+
+ GLP_WRITE - gl_get_line() is waiting to read a
+ character from the keyboad.
+</PRE>
+
+<P>
+<P>
+If the application is using either the <B>select()</B> or <B>poll()</B>
+system calls to watch for I/O on a group of file descriptors, then it
+should call the <B>gl_pending_io()</B> function before each call to
+these functions to see which direction of I/O it should tell them to
+watch for, and configure their arguments accordingly. In the case of
+the <B>select()</B> system call, this means using the <B>FD_SET()</B>
+macro to add the terminal file descriptor either to the set of file
+descriptors to be watched for readability, or the set to be watched
+for writability.
+<P>
+As in normal I/O mode, the return value of <B>gl_get_line()</B> is
+either a pointer to a completed input line, or <B>NULL</B>. However,
+whereas in normal I/O mode a <B>NULL</B> return value always means that
+an error occurred, in non-blocking server mode, <B>NULL</B> is also
+returned when <B>gl_get_line()</B> can't read or write to the terminal
+without blocking. Thus in non-blocking server mode, in order to
+determine when a <B>NULL</B> return value signifies that an error
+occurred or not, it is necessary to call the <B>gl_return_status()</B>
+function. If this function returns the enumerated value,
+<B>GLR_BLOCKED</B>, as documented in the <B><A HREF="gl_get_line.html">gl_get_line</A>(3)</B> man page,
+this means that <B>gl_get_line()</B> is waiting for I/O, and no error
+has occurred.
+<P>
+When <B>gl_get_line()</B> returns <B>NULL</B> and
+<B>gl_return_status()</B> indicates that this is due to blocked
+terminal I/O, the application should call <B>gl_get_line()</B> again
+when the type of I/O reported by <B>gl_pending_io()</B> becomes
+possible. The <B>prompt</B>, <B>start_line</B> and <B>start_pos</B>
+arguments of <B>gl_get_line()</B> will be ignored on these calls. If
+you need to change the prompt of the line that is currently being
+edited, then you can call the <B>gl_replace_prompt()</B> function
+(documented in the <B><A HREF="gl_get_line.html">gl_get_line</A>(3) man page) between calls to
+gl_get_line()</B>.
+<P>
+<A NAME="lbAF"> </A>
+<H2>GIVING UP THE TERMINAL</H2>
+
+<P>
+A complication that is unique to non-blocking server mode is that it
+requires that the terminal be left in raw mode between calls to
+<B>gl_get_line()</B>. If this weren't the case, the external event loop
+wouldn't be able to detect individual key-presses, and the basic line
+editing implemented by the terminal driver would clash with the
+editing provided by <B>gl_get_line()</B>. What this means is that any
+time that the terminal needs to be used for other things than entering
+a new input line with <B>gl_get_line()</B>, it needs to be restored to
+a usable state. In particular, whenever the process is suspended or
+terminated, the terminal must be returned to a normal state. If this
+isn't done, then depending on the characteristics of the shell that
+was used to invoke the program, the user may end up with a hung
+terminal. To this end, the <B>gl_normal_io()</B> function is provided
+for switching the terminal back to the state that it was in when raw
+mode was last established.
+<P>
+<P>
+<PRE>
+ int gl_normal_io(GetLine *gl);
+</PRE>
+
+<P>
+<P>
+What this function does is first flush any pending output to the
+terminal, then move the cursor to the start of the terminal line which
+follows the end of the incompletely entered input line. At this point
+it is safe to suspend or terminate the process, and it is safe for the
+application to read and write to the terminal. To resume entry of the
+input line, the application should call the <B>gl_raw_io()</B>
+function.
+<P>
+<P>
+<PRE>
+ int gl_raw_io(GetLine *gl);
+</PRE>
+
+<P>
+<P>
+This function starts a new line, redisplays the partially completed
+input line (if any), restores the cursor position within this line to
+where it was when <B>gl_normal_io()</B> was called, then switches back
+to raw, non-blocking terminal mode ready to continue entry of the
+input line when <B>gl_get_line()</B> is next called.
+<P>
+Note that in non-blocking server mode, if <B>gl_get_line()</B> is
+called after a call to <B>gl_normal_io()</B>, without an intervening
+call to <B>gl_raw_io()</B>, <B>gl_get_line()</B> will call
+<B>gl_raw_mode()</B> itself, and the terminal will remain in this mode
+when <B>gl_get_line()</B> returns.
+<P>
+<A NAME="lbAG"> </A>
+<H2>SIGNAL HANDLING</H2>
+
+<P>
+In the previous section it was pointed out that in non-blocking server
+mode, the terminal must be restored to a sane state whenever a signal
+is received that either suspends or terminates the process. In normal
+I/O mode, this is done for you by <B>gl_get_line()</B>, but in
+non-blocking server mode, since the terminal is left in raw mode
+between calls to <B>gl_get_line()</B>, this signal handling has to be
+done by the application. Since there are many signals that can suspend
+or terminate a process, as well as other signals that are important to
+<B>gl_get_line()</B>, such as the <B>SIGWINCH</B> signal, which tells it
+when the terminal size has changed, the <B>gl_tty_signals()</B>
+function is provided for installing signal handlers for all pertinent
+signals.
+<P>
+<P>
+<PRE>
+ int gl_tty_signals(void (*term_handler)(int),
+ void (*susp_handler)(int),
+ void (*cont_handler)(int),
+ void (*size_handler)(int));
+</PRE>
+
+<P>
+<P>
+What this does is use <B>gl_get_line()</B>'s internal list of signals
+to assign specified signal handlers to groups of signals. The
+arguments of this function are as follows.
+<P>
+<P>
+<PRE>
+ term_handler - This is the signal handler that is to be
+ used to trap signals that by default
+ terminate any process that receives
+ them (eg. SIGINT or SIGTERM).
+
+ susp_handler - This is the signal handler that is to be
+ used to trap signals that by default
+ suspend any process that receives them,
+ (eg. SIGTSTP or SIGTTOU).
+
+ cont_handler - This is the signal handler that is to be
+ used to trap signals that are usually
+ sent when a process resumes after being
+ suspended (usually SIGCONT). Beware that there is
+ nothing to stop a user from sending one of these
+ signals at other times.
+
+ size_handler - This signal handler is used to trap
+ signals that are sent to processes when
+ their controlling terminals are resized
+ by the user (eg. SIGWINCH).
+</PRE>
+
+<P>
+<P>
+These arguments can all be the same, if so desired, and you can
+specify <B>SIG_IGN</B> (ignore this signal) or <B>SIG_DFL</B> (use the
+system-provided default signal handler) instead of a function where
+pertinent. In particular, it is rarely useful to trap <B>SIGCONT</B>,
+so the <B>cont_handler</B> argument will usually be <B>SIG_DFL</B> or
+<B>SIG_IGN</B>.
+<P>
+The <B>gl_tty_signals()</B> function uses the POSIX <B>sigaction()</B>
+function to install these signal handlers, and it is careful to use
+the <B>sa_mask</B> member of each sigaction structure to ensure that
+only one of these signals is ever delivered at a time. This guards
+against different instances of these signal handlers from
+simultaneously trying to write to common global data, such as a shared
+<B>sigsetjmp()</B> buffer or a signal-received flag.
+<P>
+The signal handlers that are installed by this function, should call
+the <B>gl_handle_signal().
+<P>
+<P>
+</B><PRE>
+ void gl_handle_signal(int signo, GetLine *gl, int ngl);
+</PRE>
+
+<P>
+<P>
+The <B>signo</B> argument tells this function which signal it is being
+asked to respond to, and the <B>gl</B> argument should be a pointer to
+the first element of an array of <B>ngl</B> <B>GetLine</B> objects. If
+your application only has one of these objects, just pass its pointer
+as the <B>gl</B> argument and specify <B>ngl</B> as <B>1</B>.
+<P>
+Depending on the signal that is being handled, this function does
+different things.
+<P>
+<A NAME="lbAH"> </A>
+<H3>Terminal resize signals (SIGWINCH)</H3>
+
+<P>
+If the signal indicates that the terminal was resized, then it
+arranges for the next call to <B>gl_get_line()</B> to ask the terminal
+for its new size and redraw the input line accordingly. In order that
+<B>gl_get_line()</B> be called as soon as possible to do this,
+<B>gl_handle_signal()</B> also arranges that the next call to
+<B>gl_pending_io()</B> will return <B>GLP_WRITE</B>. Thus if the
+application waits for I/O in <B>select()</B> or <B>poll()</B>, then the
+application needs to ensure that these functions will be reliably
+aborted when a signal is caught and handled by the application. More
+on this below.
+<P>
+<A NAME="lbAI"> </A>
+<H2>Process termination signals.</H2>
+
+<P>
+If the signal that was caught is one of those that by default
+terminates any process that receives it, then <B>gl_handle_signal()</B>
+does the following steps.
+<P>
+1. First it blocks the delivery of all signals that can be
+<BR> blocked (ie. <B>SIGKILL</B> and <B>SIGSTOP</B> can't be blocked)
+<P>
+2. Next it calls <B>gl_normal_io()</B> for each of the <B>ngl</B>
+<BR> <B>GetLine</B> objects. Note that this does nothing to any of the
+<BR> <B>GetLine</B> objects that aren't currently in raw mode.
+<P>
+3. Next it sets the signal handler of the signal to its default,
+<BR> process-termination disposition.
+<P>
+4. Next it re-sends the process the signal that was caught.
+<P>
+5. Finally it unblocks delivery of this signal, which
+<BR> results in the process being terminated.
+<P>
+<A NAME="lbAJ"> </A>
+<H2>Process suspension signals.</H2>
+
+<P>
+If the default disposition of the signal is to suspend the process,
+the same steps are executed as for process termination signals, except
+that when the process is later resumed, <B>gl_handle_signal()</B>
+continues, and does the following steps.
+<P>
+6. It re-blocks delivery of the signal.
+<P>
+7. It reinstates the signal handler of the signal to the one
+<BR> that was displaced when its default disposition was substituted.
+<P>
+8. For any of the <B>GetLine</B> objects that were in raw mode when
+<BR> <B>gl_handle_signal()</B> was called, <B>gl_handle_signal()</B> then
+<BR> calls <B>gl_raw_io()</B>, to resume entry of the input lines on
+<BR> those terminals.
+<P>
+9. Finally, it restores the signal process mask to how it
+<BR> was when <B>gl_handle_signal()</B> was called.
+<P>
+Note that the process is suspended or terminated using the original
+signal that was caught, rather than using the uncatchable
+<B>SIGSTOP</B> and <B>SIGKILL</B> signals. This is important, because
+when a process is suspended or terminated, the parent of the process
+may wish to use the status value returned by the <B>wait()</B> system
+call to figure out which signal was responsible. In particular, most
+shells use this information to print a corresponding message to the
+terminal. Users would be rightly confused if when their process
+received a <B>SIGPIPE</B> signal, the program responded by sending
+itself a <B>SIGKILL</B> signal, and the shell then printed out the
+provocative statement, "Killed!".
+<P>
+<A NAME="lbAK"> </A>
+<H2>INTERRUPTING THE EVENT LOOP</H2>
+
+<P>
+If a signal is caught and handled when the application's event loop is
+waiting in <B>select()</B> or <B>poll()</B>, these functions will be
+aborted with <B>errno</B> set to <B>EINTR</B>. When this happens the
+event loop should call <B>gl_pending_io()</B>, before calling
+<B>select()</B> or <B>poll()</B> again. It should then arrange for
+<B>select()</B> or <B>poll()</B> to wait for the type of I/O that this
+reports. This is necessary, because any signal handler which calls
+<B>gl_handle_signal()</B>, will frequently change the type of I/O that
+<B>gl_get_line()</B> is waiting for.
+<P>
+Unfortunately, if a signal arrives between the statements which
+configure the arguments of <B>select()</B> or <B>poll()</B> and the
+calls to these functions, then the signal will not be seen by these
+functions, which will then not be aborted. If these functions are
+waiting for keyboard input from the user when the signal is received,
+and the signal handler arranges to redraw the input line to accomodate
+a terminal resize or the resumption of the process, then this
+redisplay will be end up being delayed until the user hits the next
+key. Apart from puzzling the user, this clearly isn't a serious
+problem. However there is a way, albeit complicated, to completely
+avoid this race condition. The following steps illustrate this.
+<P>
+1. Block all of the signals that <B>gl_get_line()</B> catches,
+<BR> by passing the signal set returned by <B>gl_list_signals()</B> to
+<BR> <B>sigprocmask()</B>.
+<P>
+2. Call <B>gl_pending_io()</B> and set up the arguments of
+<BR> <B>select()</B> or <B>poll()</B> accordingly.
+<P>
+3. Call <B>sigsetjmp()</B> with a non-zero <B>savesigs</B> argument.
+<P>
+4. Initially this <B>sigsetjmp()</B> statement will return zero,
+<BR> indicating that control isn't resuming there after a matching
+<BR> call to <B>siglongjmp()</B>.
+<P>
+5. Replace all of the handlers of the signals that <B>gl_get_line()</B>
+<BR> is configured to catch, with a signal handler that first records
+<BR> the number of the signal that was caught, in a file-scope variable,
+<BR> then calls <B>siglongjmp()</B> with a non-zero value argument, to
+<BR> return execution to the above <B>sigsetjmp()</B>
+<BR> statement. Registering these signal handlers can conveniently be
+<BR> done using the <B>gl_tty_signals()</B> function.
+<P>
+6. Set the file-scope variable that the above signal handler uses to
+<BR> record any signal that is caught to -1, so that we can check
+<BR> whether a signal was caught by seeing if it contains a valid signal
+<BR> number.
+<P>
+7. Now unblock the signals that were blocked in step 1. Any signal
+<BR> that was received by the process in between step 1 and now will
+<BR> now be delivered, and trigger our signal handler, as will any
+<BR> signal that is received until we block these signals again.
+<P>
+8. Now call <B>select()</B> or <B>poll()</B>.
+<P>
+9. When <B>select()</B> returns, again block the signals that were
+<BR> unblocked in step 7.
+<P>
+If a signal is arrived any time during the above steps, our signal
+handler will be triggered and cause control to return to the
+<B>sigsetjmp()</B> statement, where this time, <B>sigsetjmp()</B> will
+return non-zero, indicating that a signal was caught. When this
+happens we simply skip the above block of statements, and continue
+with the following statements, which are executed regardless of
+whether or not a signal is caught. Note that when <B>sigsetjmp()</B>
+returns, regardless of why it returned, the process signal mask is
+returned to how it was when <B>sigsetjmp()</B> was called. Thus the
+following statements are always executed with all of our signals
+blocked.
+<P>
+9. Reinstate the signal handlers that were displaced in step 5.
+<P>
+10. Check wether a signal was caught, by checking the file-scope
+<BR> variable that the signal handler records signal numbers in.
+<P>
+11. If a signal was caught, send this signal to the application
+<BR> again, and unblock just this signal, so that it invokes the
+<BR> signal handler which we just reinstated in step 10.
+<P>
+12. Unblock all of the signals that were blocked in step 7.
+<P>
+Since this is complicated, note that <B>demo3.c</B> includes a working
+example of how to do this. The method used there however, is more
+general than the above. What it provides is a wrapper function around
+<B>select()</B> which encompasses steps 3 to 11. In this wrapper,
+rather than use <B>gl_list_signals()</B> to figure out the signals to
+block, and and <B>gl_tty_signals()</B> to assign and revert signal
+handlers, one of its arguments is a <B>sigset_t</B> which specifies
+which signals to block and assign signal handlers to. This function
+thus doesn't depend on <B>gl_get_line()</B> and can thus be used in
+other situations where race-condition-free signal handling is
+required.
+<P>
+<A NAME="lbAL"> </A>
+<H2>SIGNALS CAUGHT BY GL_GET_LINE</H2>
+
+<P>
+Since the application is expected to handle signals in non-blocking
+server mode, <B>gl_get_line()</B> doesn't attempt to duplicate this
+when it is being called. If one of the signals that it is configured
+to catch is sent to the application while <B>gl_get_line()</B> is being
+called, <B>gl_get_line()</B> reinstates the caller's signal handlers,
+then just before returning, re-sends the signal to the process to let
+the application's signal handler handle it. If the process isn't
+terminated by this signal, <B>gl_get_line()</B> returns <B>NULL</B>, and
+a following call to <B>gl_return_status()</B> returns the enumerated
+value <B>GLR_SIGNAL</B>.
+<P>
+<A NAME="lbAM"> </A>
+<H2>ABORTING LINE INPUT</H2>
+
+<P>
+Often, rather than letting it terminate the process, applications
+respond to the SIGINT user-interrupt signal by aborting the current
+input line. The way to do this in non-blocking server-I/O mode is to
+not call <B>gl_handle_signal()</B> when this signal is caught, but
+instead to call the <B>gl_abandon_line()</B>.
+<P>
+<P>
+<PRE>
+ void gl_abandon_line(GetLine *gl);
+</PRE>
+
+<P>
+<P>
+This function arranges that when <B>gl_get_line()</B> is next called,
+it first flushes any pending output to the terminal, then discardes
+the current input line, outputs a new prompt on the next line, and
+finally starts accepting input of a new input line from the user.
+<P>
+<A NAME="lbAN"> </A>
+<H2>SIGNAL SAFE FUNCTIONS</H2>
+
+<P>
+Provided that certain rules are followed, the following functions can
+have been written to be safely callable from signal handlers. Other
+functions in this library should not be called from signal handlers.
+<P>
+<P>
+<PRE>
+ gl_normal_io()
+ gl_raw_io()
+ gl_handle_signal()
+ gl_abandon_line()
+</PRE>
+
+<P>
+<P>
+In order for this to be true, all signal handlers that call these
+functions must be registered in such a way that only one instance of
+any one of them can be running at one time. The way to do this is to
+use the POSIX <B>sigaction()</B> function to register all signal
+handlers, and when doing this, use the <B>sa_mask</B> member of the
+corresponding sigaction structure, to indicate that all of the signals
+who's handlers invoke the above functions, should be blocked when the
+current signal is being handled. This prevents two signal handlers
+from operating on a <B>GetLine</B> object at the same time.
+<P>
+To prevent signal handlers from accessing a <B>GetLine</B> object while
+<B>gl_get_line()</B> or any of its associated public functions are
+operating on it, all public functions associated with
+<B>gl_get_line()</B>, including <B>gl_get_line()</B> itself, temporarily
+block the delivery of signals when they are accessing <B>GetLine</B>
+objects. Beware that the only signals that they block are the signals
+that <B>gl_get_line()</B> is currently configured to catch, so be sure
+that if you call any of the above functions from signal handlers, that
+the signals that these handlers are assigned to are configured to be
+caught by <B>gl_get_line()</B> (see <B>gl_trap_signal()</B>).
+<P>
+<A NAME="lbAO"> </A>
+<H2>USING TIMEOUTS TO POLL</H2>
+
+<P>
+If instead of using <B>select()</B> or <B>poll()</B> to wait for I/O,
+your application just needs to get out of <B>gl_get_line()</B>
+periodically to briefly do something else before returning to accept
+input from the user, this can be done in non-blocking server mode by
+using the <B>gl_inactivity_timeout()</B> function (see
+<B><A HREF="gl_get_line.html">gl_get_line</A>(3)</B>), to specify that a callback function that
+returns <B>GLTO_CONTINUE</B> should be called whenever
+<B>gl_get_line()</B> has been waiting for I/O for more than a specified
+amount of time.
+<P>
+When this callback is triggered, <B>gl_get_line()</B> will return
+<B>NULL</B>, and a following call to <B>gl_return_status()</B> will
+return <B>GLR_BLOCKED</B>.
+<P>
+Beware that <B>gl_get_line()</B> won't return until the user
+hasn't typed a key for the specified interval, so if the
+interval is long, and the user keeps typing,
+<B>gl_get_line()</B> may not return for a while. In other
+words there is no guarantee that it will return in the time
+specified.
+<P>
+<A NAME="lbAP"> </A>
+<H2>THE SERVER DEMO PROGRAM</H2>
+
+<P>
+The <B>demo3</B> program that is distributed with the library, provides
+a working example of how to use non-blocking server I/O mode in a real
+program. As far as the user is concerned, this program operates
+identically to the main demo program (called <B>demo</B>), except that
+whereas the main demo program uses the normal blocking I/O mode,
+<B>demo3</B> using non-blocking I/O and an external event loop. The
+source code can be found in <B>demo3.c</B>, and the comments therein
+explain the various steps.
+<P>
+<A NAME="lbAQ"> </A>
+<H2>FILES</H2>
+
+<PRE>
+libtecla.a - The tecla library
+libtecla.h - The tecla header file.
+</PRE>
+
+<P>
+<A NAME="lbAR"> </A>
+<H2>SEE ALSO</H2>
+
+<P>
+<PRE>
+<A HREF="libtecla.html">libtecla</A>(3), <A HREF="gl_get_line.html">gl_get_line</A>(3), <A HREF="tecla.html">tecla</A>(7), <A HREF="ef_expand_file.html">ef_expand_file</A>(3),
+<A HREF="cpl_complete_word.html">cpl_complete_word</A>(3), <A HREF="pca_lookup_file.html">pca_lookup_file</A>(3)
+</PRE>
+
+<P>
+<A NAME="lbAS"> </A>
+<H2>AUTHOR</H2>
+
+Martin Shepherd (<A HREF="mailto:mcs at astro.caltech.edu">mcs at astro.caltech.edu</A>)
+<P>
+
+<HR>
+<A NAME="index"> </A><H2>Index</H2>
+<DL>
+<DT><A HREF="#lbAB">NAME</A><DD>
+<DT><A HREF="#lbAC">SYNOPSIS</A><DD>
+<DT><A HREF="#lbAD">DESCRIPTION</A><DD>
+<DT><A HREF="#lbAE">SERVER I/O MODE</A><DD>
+<DT><A HREF="#lbAF">GIVING UP THE TERMINAL</A><DD>
+<DT><A HREF="#lbAG">SIGNAL HANDLING</A><DD>
+<DL>
+<DT><A HREF="#lbAH">Terminal resize signals (SIGWINCH)</A><DD>
+</DL>
+<DT><A HREF="#lbAI">Process termination signals.</A><DD>
+<DT><A HREF="#lbAJ">Process suspension signals.</A><DD>
+<DT><A HREF="#lbAK">INTERRUPTING THE EVENT LOOP</A><DD>
+<DT><A HREF="#lbAL">SIGNALS CAUGHT BY GL_GET_LINE</A><DD>
+<DT><A HREF="#lbAM">ABORTING LINE INPUT</A><DD>
+<DT><A HREF="#lbAN">SIGNAL SAFE FUNCTIONS</A><DD>
+<DT><A HREF="#lbAO">USING TIMEOUTS TO POLL</A><DD>
+<DT><A HREF="#lbAP">THE SERVER DEMO PROGRAM</A><DD>
+<DT><A HREF="#lbAQ">FILES</A><DD>
+<DT><A HREF="#lbAR">SEE ALSO</A><DD>
+<DT><A HREF="#lbAS">AUTHOR</A><DD>
+</DL>
+<HR>
+This document was created by
+<A HREF="/cgi-bin/man/man2html">man2html</A>,
+using the manual pages.<BR>
+Time: 03:25:06 GMT, June 12, 2012
+</BODY>
+</HTML>
diff --git a/html/index.html b/html/index.html
index 29889da..3390877 100644
--- a/html/index.html
+++ b/html/index.html
@@ -25,9 +25,9 @@ in threaded programs. The option to enable this is discussed in the
Makefile, and specific discussions of thread safety are presented in
the included man pages.
<P>
-The current version is version 1.6.1. This may be obtained from:
+The current version is version 1.6.2. This may be obtained from:
<P>
- <a href="libtecla-1.6.1.tar.gz">http://www.astro.caltech.edu/~mcs/tecla/libtecla-1.6.1.tar.gz</a>
+ <a href="libtecla-1.6.2.tar.gz">http://www.astro.caltech.edu/~mcs/tecla/libtecla-1.6.2.tar.gz</a>
<P>
For the sake of automated scripts, the following URL always points to
@@ -89,6 +89,7 @@ been reported to work on the following systems:
QNX
NetBSD 1.6, 386, gcc
SGI IRIX 6.5
+ Linux in general
</pre>
There haven't been many reports concerning the POSIX reentrant
@@ -106,6 +107,7 @@ taken as an indication that the reentrant version doesn't work.
IBM AIX 4.3.3, gcc
Alpha OSF1, cc
SGI IRIX 6.5
+ Linux in general
</pre>
The only system that is known to have issues with the reentrant
@@ -118,5 +120,5 @@ signal.h.
If you compile the library on a system that isn't mentioned above,
please send E-mail to <b>mcs at astro.caltech.edu</b>.
<HR>
-Martin Shepherd (31-Oct-2004)
+Martin Shepherd (11-Jun-2012)
</BODY>
diff --git a/html/libtecla.html b/html/libtecla.html
index 2b85d7a..f52b728 100644
--- a/html/libtecla.html
+++ b/html/libtecla.html
@@ -1,138 +1,199 @@
-<head>
-<title>Manual Page</title>
-</head>
-<body>
-<pre>
-<a href="libtecla.html"><b>libtecla</b></a> <a href="libtecla.html"><b>libtecla</b></a>
-
-
-
-</pre><h2>NAME</h2><pre>
- libtecla - An interactive command-line input library.
-
-</pre><h2>SYNOPSIS</h2><pre>
- @CC@ ... -ltecla -lcurses
-
-
-</pre><h2>DESCRIPTION</h2><pre>
- The tecla library provides programs with interactive command line edit-
- ing facilities, similar to those of the unix tcsh shell. In addition to
- simple command-line editing, it supports recall of previously entered
- command lines, TAB completion of file names or other tokens, and in-
- line wild-card expansion of filenames. The internal functions which
- perform file-name completion and wild-card expansion are also available
- externally for optional use by the calling program.
-
- The various parts of the library are documented in the following man
- pages:
-
- <a href="tecla.html"><b>tecla</b></a> - Use level documentation of the
- command-line editing facilities
- provided by gl_get_line().
- <a href="gl_get_line.html"><b>gl_get_line</b></a> - The interactive line-input module.
- <a href="gl_io_mode.html"><b>gl_io_mode</b></a> - How to use gl_get_line() in an
- incremental, non-blocking fashion.
- <a href="cpl_complete_word.html"><b>cpl_complete_word</b></a> - The word completion module.
- <a href="ef_expand_file.html"><b>ef_expand_file</b></a> - The filename expansion module.
- <a href="pca_lookup_file.html"><b>pca_lookup_file</b></a> - A directory-list based filename
- lookup and completion module.
-
- In addition there is one optional application distributed with the
- library:
-
- <a href="enhance.html"><b>enhance</b></a> - Add command-line editing to third
- party applications.
-
-
-</pre><h2>THREAD SAFETY</h2><pre>
- If the library is compiled with -D_POSIX_C_SOURCE=199506L, reentrant
- versions of as many functions as possible are used. This includes using
- getpwuid_r() and getpwnam_r() instead of getpwuid() and getpwnam() when
- looking up the home directories of specific users in the password file
- (for ~user/ expansion), and readdir_r() instead of readdir() for read-
- ing directory entries when doing filename completion. The reentrant
- version of the library is usually called libtecla_r.a instead of libte-
- cla.a, so if only the latter is available, it probably isn't the cor-
- rect version to link with threaded programs.
-
- Reentrant functions for iterating through the password file aren't
- available, so when the library is compiled to be reentrant, TAB comple-
- tion of incomplete usernames in ~username/ expressions is disabled.
- This doesn't disable expansion of complete ~username expressions, which
- can be done reentrantly, or expansion of the parts of filenames that
- follow them, so this doesn't remove much functionality.
-
- The terminfo functions setupterm(), tigetstr(), tigetnum() and tputs()
- also aren't reentrant, but very few programs will want to interact with
- multiple terminals, so this shouldn't prevent this library from being
- used in threaded programs.
-
-
-</pre><h2>LIBRARY VERSION NUMBER</h2><pre>
- The version number of the library can be queried using the following
- function.
-
- void libtecla_version(int *major, int *minor, int *micro);
-
-
- On return, this function records the three components of the libtecla
- version number in *major, *minor, *micro. The formal meaning of the
- three components is as follows.
-
-
- major - Incrementing this number implies that a change has
- been made to the library's public interface, which
- makes it binary incompatible with programs that
- were linked with previous shared versions of the
- tecla library.
-
- minor - This number is incremented by one whenever
- additional functionality, such as new functions or
- modules, are added to the library.
-
- micro - This is incremented whenever modifications to the
- library are made which make no changes to the
- public interface, but which fix bugs and/or improve
- the behind-the-scenes implementation.
-
-
-
-</pre><h2>TRIVIA</h2><pre>
- In Spanish, a "tecla" is the key of a keyboard. Since this library cen-
- ters on keyboard input, and given that I wrote much of the library
- while working in Chile, this seemed like a suitable name.
-
-
-</pre><h2>FILES</h2><pre>
- libtecla.a - The tecla library.
- libtecla.h - The tecla header file.
- ~/.teclarc - The tecla personal customization file.
-
-
-</pre><h2>SEE ALSO</h2><pre>
- <a href="gl_get_line.html"><b>gl_get_line</b></a>, <a href="tecla.html"><b>tecla</b></a>, <a href="gl_io_mode.html"><b>gl_io_mode</b></a>, <a href="ef_expand_file.html"><b>ef_expand_file</b></a>,
- <a href="cpl_complete_word.html"><b>cpl_complete_word</b></a>, <a href="pca_lookup_file.html"><b>pca_lookup_file</b></a>, <a href="enhance.html"><b>enhance</b></a>
-
-
-</pre><h2>AUTHOR</h2><pre>
- Martin Shepherd (mcs at astro.caltech.edu)
-
-
-</pre><h2>ACKNOWLEDGMENTS</h2><pre>
- Markus Gyger - Lots of assistance, including help with
- shared libraries, configuration information,
- particularly for Solaris; modifications to
- support C++ compilers, improvements for ksh
- users, faster cursor motion, output
- buffering, and changes to make gl_get_line()
- 8-bit clean.
- Mike MacFaden - Suggestions, feedback and testing that led
- to many of the major new functions that were
- added in version 1.4.0.
- Tim Eliseo - Many vi-mode bindings and fixes.
-
-
-
- <a href="libtecla.html"><b>libtecla</b></a>
-</pre>
-</body>
+Content-type: text/html
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML><HEAD><TITLE>Man page of libtecla</TITLE>
+</HEAD><BODY>
+<H1>libtecla</H1>
+Section: C Library Functions (3)<BR><A HREF="#index">Index</A>
+<A HREF="index.html">Return to Main Contents</A><HR>
+
+<A NAME="lbAB"> </A>
+<H2>NAME</H2>
+
+libtecla - An interactive command-line input library.
+<A NAME="lbAC"> </A>
+<H2>SYNOPSIS</H2>
+
+<PRE>
+gcc ... -ltecla -lcurses
+</PRE>
+
+<P>
+<A NAME="lbAD"> </A>
+<H2>DESCRIPTION</H2>
+
+<P>
+The <B>tecla</B> library provides programs with interactive command
+line editing facilities, similar to those of the unix <B>tcsh</B>
+shell. In addition to simple command-line editing, it supports recall
+of previously entered command lines, TAB completion of file names or
+other tokens, and in-line wild-card expansion of filenames. The
+internal functions which perform file-name completion and wild-card
+expansion are also available externally for optional use by the
+calling program.
+<P>
+The various parts of the library are documented in the following man
+pages:
+<P>
+<PRE>
+ <A HREF="tecla.html">tecla</A>(7) - Use level documentation of the
+ command-line editing facilities
+ provided by <B>gl_get_line()</B>.
+ <A HREF="gl_get_line.html">gl_get_line</A>(3) - The interactive line-input module.
+ <A HREF="gl_io_mode.html">gl_io_mode</A>(3) - How to use <B>gl_get_line()</B> in an
+ incremental, non-blocking fashion.
+ <A HREF="cpl_complete_word.html">cpl_complete_word</A>(3) - The word completion module.
+ <A HREF="ef_expand_file.html">ef_expand_file</A>(3) - The filename expansion module.
+ <A HREF="pca_lookup_file.html">pca_lookup_file</A>(3) - A directory-list based filename
+ lookup and completion module.
+</PRE>
+
+<P>
+In addition there is one optional application distributed
+with the library:
+<P>
+<PRE>
+ <A HREF="enhance.html">enhance</A>(1) - Add command-line editing to third
+ party applications.
+</PRE>
+
+<P>
+<A NAME="lbAE"> </A>
+<H2>THREAD SAFETY</H2>
+
+<P>
+If the library is compiled with -D_POSIX_C_SOURCE=199506L, reentrant
+versions of as many functions as possible are used. This includes
+using getpwuid_r() and getpwnam_r() instead of getpwuid() and
+getpwnam() when looking up the home directories of specific users in
+the password file (for ~user/ expansion), and readdir_r() instead of
+readdir() for reading directory entries when doing filename
+completion. The reentrant version of the library is usually called
+libtecla_r.a instead of libtecla.a, so if only the latter is
+available, it probably isn't the correct version to link with
+threaded programs.
+<P>
+Reentrant functions for iterating through the password file aren't
+available, so when the library is compiled to be reentrant, TAB
+completion of incomplete usernames in <B>~username/</B> expressions is
+disabled. This doesn't disable expansion of complete <B>~username</B>
+expressions, which can be done reentrantly, or expansion of the parts
+of filenames that follow them, so this doesn't remove much
+functionality.
+<P>
+The terminfo functions setupterm(), tigetstr(), tigetnum() and tputs()
+also aren't reentrant, but very few programs will want to interact
+with multiple terminals, so this shouldn't prevent this library from
+being used in threaded programs.
+<P>
+<A NAME="lbAF"> </A>
+<H2>LIBRARY VERSION NUMBER</H2>
+
+<P>
+The version number of the library can be queried using the following
+function.
+<P>
+<PRE>
+ void libtecla_version(int *major, int *minor, int *micro);
+</PRE>
+
+<P>
+<P>
+On return, this function records the three components of the libtecla
+version number in <B>*major</B>, <B>*minor</B>, <B>*micro</B>. The formal
+meaning of the three components is as follows.
+<P>
+<P>
+<PRE>
+ major - Incrementing this number implies that a change has
+ been made to the library's public interface, which
+ makes it binary incompatible with programs that
+ were linked with previous shared versions of the
+ tecla library.
+
+ minor - This number is incremented by one whenever
+ additional functionality, such as new functions or
+ modules, are added to the library.
+
+ micro - This is incremented whenever modifications to the
+ library are made which make no changes to the
+ public interface, but which fix bugs and/or improve
+ the behind-the-scenes implementation.
+</PRE>
+
+<P>
+<P>
+<A NAME="lbAG"> </A>
+<H2>TRIVIA</H2>
+
+<P>
+In Spanish, a "tecla" is the key of a keyboard. Since this library
+centers on keyboard input, and given that I wrote much of the library
+while working in Chile, this seemed like a suitable name.
+<P>
+<A NAME="lbAH"> </A>
+<H2>FILES</H2>
+
+<PRE>
+libtecla.a - The tecla library.
+libtecla.h - The tecla header file.
+~/.teclarc - The tecla personal customization file.
+</PRE>
+
+<P>
+<A NAME="lbAI"> </A>
+<H2>SEE ALSO</H2>
+
+<P>
+<PRE>
+<A HREF="gl_get_line.html">gl_get_line</A>(3), <A HREF="tecla.html">tecla</A>(7), <A HREF="gl_io_mode.html">gl_io_mode</A>(3), <A HREF="ef_expand_file.html">ef_expand_file</A>(3),
+<A HREF="cpl_complete_word.html">cpl_complete_word</A>(3), <A HREF="pca_lookup_file.html">pca_lookup_file</A>(3), <A HREF="enhance.html">enhance</A>(1)
+</PRE>
+
+<P>
+<A NAME="lbAJ"> </A>
+<H2>AUTHOR</H2>
+
+Martin Shepherd (<A HREF="mailto:mcs at astro.caltech.edu">mcs at astro.caltech.edu</A>)
+<P>
+<A NAME="lbAK"> </A>
+<H2>ACKNOWLEDGMENTS</H2>
+
+<P>
+<PRE>
+Markus Gyger - Lots of assistance, including help with
+ shared libraries, configuration information,
+ particularly for Solaris; modifications to
+ support C++ compilers, improvements for ksh
+ users, faster cursor motion, output
+ buffering, and changes to make gl_get_line()
+ 8-bit clean.
+Mike MacFaden - Suggestions, feedback and testing that led
+ to many of the major new functions that were
+ added in version 1.4.0.
+Tim Eliseo - Many vi-mode bindings and fixes.
+</PRE>
+
+<P>
+
+<HR>
+<A NAME="index"> </A><H2>Index</H2>
+<DL>
+<DT><A HREF="#lbAB">NAME</A><DD>
+<DT><A HREF="#lbAC">SYNOPSIS</A><DD>
+<DT><A HREF="#lbAD">DESCRIPTION</A><DD>
+<DT><A HREF="#lbAE">THREAD SAFETY</A><DD>
+<DT><A HREF="#lbAF">LIBRARY VERSION NUMBER</A><DD>
+<DT><A HREF="#lbAG">TRIVIA</A><DD>
+<DT><A HREF="#lbAH">FILES</A><DD>
+<DT><A HREF="#lbAI">SEE ALSO</A><DD>
+<DT><A HREF="#lbAJ">AUTHOR</A><DD>
+<DT><A HREF="#lbAK">ACKNOWLEDGMENTS</A><DD>
+</DL>
+<HR>
+This document was created by
+<A HREF="/cgi-bin/man/man2html">man2html</A>,
+using the manual pages.<BR>
+Time: 03:25:06 GMT, June 12, 2012
+</BODY>
+</HTML>
diff --git a/html/pca_lookup_file.html b/html/pca_lookup_file.html
index d5e1e7b..b7aebbc 100644
--- a/html/pca_lookup_file.html
+++ b/html/pca_lookup_file.html
@@ -1,312 +1,420 @@
-<head>
-<title>Manual Page</title>
-</head>
-<body>
-<pre>
-<a href="pca_lookup_file.html"><b>pca_lookup_file</b></a> <a href="pca_lookup_file.html"><b>pca_lookup_file</b></a>
-
-
-
-</pre><h2>NAME</h2><pre>
- pca_lookup_file, del_PathCache, del_PcaPathConf, new_PathCache,
- new_PcaPathConf, pca_last_error, pca_path_completions, pca_scan_path,
- pca_set_check_fn, ppc_file_start, ppc_literal_escapes - lookup a file
- in a list of directories
-
-</pre><h2>SYNOPSIS</h2><pre>
- #include <libtecla.h>
-
- PathCache *new_PathCache(void);
-
- PathCache *del_PathCache(PathCache *pc);
-
- int pca_scan_path(PathCache *pc, const char *path);
-
- void pca_set_check_fn(PathCache *pc, CplCheckFn *check_fn,
- void *data);
-
- char *pca_lookup_file(PathCache *pc, const char *name,
- int name_len, int literal);
-
- const char *pca_last_error(PathCache *pc);
-
- CPL_MATCH_FN(pca_path_completions);
-
-
-
-</pre><h2>DESCRIPTION</h2><pre>
- The PathCache object is part of the tecla library (see the libte-
- cla(@LIBR_MANEXT@) man page).
-
- PathCache objects allow an application to search for files in any colon
- separated list of directories, such as the unix execution PATH environ-
- ment variable. Files in absolute directories are cached in a PathCache
- object, whereas relative directories are scanned as needed. Using a
- PathCache object, you can look up the full pathname of a simple file-
- name, or you can obtain a list of the possible completions of a given
- filename prefix. By default all files in the list of directories are
- targets for lookup and completion, but a versatile mechanism is pro-
- vided for only selecting specific types of files. The obvious applica-
- tion of this facility is to provide Tab-completion and lookup of exe-
- cutable commands in the unix PATH, so an optional callback which
- rejects all but executable files, is provided.
-
-
-</pre><h2>AN EXAMPLE</h2><pre>
- Under UNIX, the following example program looks up and displays the
- full pathnames of each of the command names on the command line.
-
- #include <stdio.h>
- #include <stdlib.h>
- #include <libtecla.h>
-
- int main(int argc, char *argv[])
- {
- int i;
- /*
- * Create a cache for executable files.
- */
- PathCache *pc = new_PathCache();
- if(!pc)
- exit(1);
- /*
- * Scan the user's PATH for executables.
- */
- if(pca_scan_path(pc, getenv("PATH"))) {
- fprintf(stderr, "%s\n", pca_last_error(pc));
- exit(1);
- }
- /*
- * Arrange to only report executable files.
- */
- pca_set_check_fn(pc, cpl_check_exe, NULL);
- /*
- * Lookup and display the full pathname of each of the
- * commands listed on the command line.
- */
- for(i=1; i<argc; i++) {
- char *cmd = pca_lookup_file(pc, argv[i], -1, 0);
- printf("The full pathname of '%s' is %s\n", argv[i],
- cmd ? cmd : "unknown");
- }
- pc = del_PathCache(pc); /* Clean up */
- return 0;
- }
-
- The following is an example of what this does on my laptop under linux:
-
- $ ./example less more blob
- The full pathname of 'less' is /usr/bin/less
- The full pathname of 'more' is /bin/more
- The full pathname of 'blob' is unknown
- $
-
-
-</pre><h2>FUNCTION DESCRIPTIONS</h2><pre>
- In order to use the facilities of this module, you must first allocate
- a PathCache object by calling the new_PathCache() constructor function.
-
- PathCache *new_PathCache(void)
-
- This function creates the resources needed to cache and lookup files in
- a list of directories. It returns NULL on error.
-
-
-</pre><h2>POPULATING THE CACHE</h2><pre>
- Once you have created a cache, it needs to be populated with files. To
- do this, call the pca_scan_path() function.
-
- int pca_scan_path(PathCache *pc, const char *path);
-
- Whenever this function is called, it discards the current contents of
- the cache, then scans the list of directories specified in its path
- argument for files. The path argument must be a string containing a
- colon-separated list of directories, such as
- "/usr/bin:/home/mcs/bin:.". This can include directories specified by
- absolute pathnames such as "/usr/bin", as well as sub-directories spec-
- ified by relative pathnames such as "." or "bin". Files in the absolute
- directories are immediately cached in the specified PathCache object,
- whereas sub-directories, whose identities obviously change whenever the
- current working directory is changed, are marked to be scanned on the
- fly whenever a file is looked up.
-
- On success this function return 0. On error it returns 1, and a
- description of the error can be obtained by calling pca_last_error(pc).
-
-
-</pre><h2>LOOKING UP FILES</h2><pre>
- Once the cache has been populated with files, you can look up the full
- pathname of a file, simply by specifying its filename to
- pca_lookup_file().
-
- char *pca_lookup_file(PathCache *pc, const char *name,
- int name_len, int literal);
-
- To make it possible to pass this function a filename which is actually
- part of a longer string, the name_len argument can be used to specify
- the length of the filename at the start of the name[] argument. If you
- pass -1 for this length, the length of the string will be determined
- with strlen(). If the name[] string might contain backslashes that
- escape the special meanings of spaces and tabs within the filename,
- give the literal argument, the value 0. Otherwise, if backslashes
- should be treated as normal characters, pass 1 for the value of the
- literal argument.
-
-
-</pre><h2>FILENAME COMPLETION</h2><pre>
- Looking up the potential completions of a filename-prefix in the file-
- name cache, is achieved by passing the provided pca_path_completions()
- callback function to the cpl_complete_word() function (see the cpl_com-
- plete_word(@FUNC_MANEXT@) man page).
-
- CPL_MATCH_FN(pca_path_completions);
-
- This callback requires that its data argument be a pointer to a PcaP-
- athConf object. Configuration objects of this type are allocated by
- calling new_PcaPathConf().
-
- PcaPathConf *new_PcaPathConf(PathCache *pc);
-
- This function returns an object initialized with default configuration
- parameters, which determine how the cpl_path_completions() callback
- function behaves. The functions which allow you to individually change
- these parameters are discussed below.
-
- By default, the pca_path_completions() callback function searches back-
- wards for the start of the filename being completed, looking for the
- first un-escaped space or the start of the input line. If you wish to
- specify a different location, call ppc_file_start() with the index at
- which the filename starts in the input line. Passing start_index=-1 re-
- enables the default behavior.
-
- void ppc_file_start(PcaPathConf *ppc, int start_index);
-
- By default, when pca_path_completions() looks at a filename in the
- input line, each lone backslash in the input line is interpreted as
- being a special character which removes any special significance of the
- character which follows it, such as a space which should be taken as
- part of the filename rather than delimiting the start of the filename.
- These backslashes are thus ignored while looking for completions, and
- subsequently added before spaces, tabs and literal backslashes in the
- list of completions. To have unescaped backslashes treated as normal
- characters, call ppc_literal_escapes() with a non-zero value in its
- literal argument.
-
- void ppc_literal_escapes(PcaPathConf *ppc, int literal);
-
- When you have finished with a PcaPathConf variable, you can pass it to
- the del_PcaPathConf() destructor function to reclaim its memory.
-
- PcaPathConf *del_PcaPathConf(PcaPathConf *ppc);
-
-
-
-</pre><h2>BEING SELECTIVE</h2><pre>
- If you are only interested in certain types or files, such as, for
- example, executable files, or files whose names end in a particular
- suffix, you can arrange for the file completion and lookup functions to
- be selective in the filenames that they return. This is done by regis-
- tering a callback function with your PathCache object. Thereafter,
- whenever a filename is found which either matches a filename being
- looked up, or matches a prefix which is being completed, your callback
- function will be called with the full pathname of the file, plus any
- application-specific data that you provide, and if the callback returns
- 1 the filename will be reported as a match, and if it returns 0, it
- will be ignored. Suitable callback functions and their prototypes
- should be declared with the following macro. The CplCheckFn typedef is
- also provided in case you wish to declare pointers to such functions.
-
- #define CPL_CHECK_FN(fn) int (fn)(void *data, \
- const char *pathname)
- typedef CPL_CHECK_FN(CplCheckFn);
-
- Registering one of these functions involves calling the
- pca_set_check_fn() function. In addition to the callback function,
- passed via the check_fn argument, you can pass a pointer to anything
- via the data argument. This pointer will be passed on to your callback
- function, via its own data argument, whenever it is called, so this
- provides a way to pass appplication specific data to your callback.
-
- void pca_set_check_fn(PathCache *pc, CplCheckFn *check_fn,
- void *data);
-
- Note that these callbacks are passed the full pathname of each matching
- file, so the decision about whether a file is of interest can be based
- on any property of the file, not just its filename. As an example, the
- provided cpl_check_exe() callback function looks at the executable per-
- missions of the file and the permissions of its parent directories, and
- only returns 1 if the user has execute permission to the file. This
- callback function can thus be used to lookup or complete command names
- found in the directories listed in the user's PATH environment vari-
- able. The example program given earlier in this man page provides a
- demonstration of this.
-
- Beware that if somebody tries to complete an empty string, your call-
- back will get called once for every file in the cache, which could num-
- ber in the thousands. If your callback does anything time consuming,
- this could result in an unacceptable delay for the user, so callbacks
- should be kept short.
-
- To improve performance, whenever one of these callbacks is called, the
- choice that it makes is cached, and the next time the corresponding
- file is looked up, instead of calling the callback again, the cached
- record of whether it was accepted or rejected is used. Thus if somebody
- tries to complete an empty string, and hits tab a second time when
- nothing appears to happen, there will only be one long delay, since the
- second pass will operate entirely from the cached dispositions of the
- files. These cached dipositions are discarded whenever pca_scan_path()
- is called, and whenever pca_set_check_fn() is called with changed call-
- back function or data arguments.
-
-
-</pre><h2>ERROR HANDLING</h2><pre>
- If pca_scan_path() reports that an error occurred by returning 1, you
- can obtain a terse description of the error by calling
- pca_last_error(pc). This returns an internal string containing an error
- message.
-
- const char *pca_last_error(PathCache *pc);
-
-
-
-</pre><h2>CLEANING UP</h2><pre>
- Once you have finished using a PathCache object, you can reclaim its
- resources by passing it to the del_PathCache() destructor function.
- This takes a pointer to one of these objects, and always returns NULL.
-
- PathCache *del_PathCache(PathCache *pc);
-
-
-</pre><h2>THREAD SAFETY</h2><pre>
- In multi-threaded programs, you should use the libtecla_r.a version of
- the library. This uses POSIX reentrant functions where available (hence
- the _r suffix), and disables features that rely on non-reentrant system
- functions. In the case of this module, the only disabled feature is
- username completion in ~username/ expressions, in cpl_path_comple-
- tions().
-
- Using the libtecla_r.a version of the library, it is safe to use the
- facilities of this module in multiple threads, provided that each
- thread uses a separately allocated PathCache object. In other words, if
- two threads want to do path searching, they should each call new_Path-
- Cache() to allocate their own caches.
-
-
-</pre><h2>FILES</h2><pre>
- libtecla.a - The tecla library
- libtecla.h - The tecla header file.
-
-
-</pre><h2>SEE ALSO</h2><pre>
- <a href="libtecla.html"><b>libtecla</b></a>, <a href="gl_get_line.html"><b>gl_get_line</b></a>, <a href="ef_expand_file.html"><b>ef_expand_file</b></a>,
- <a href="cpl_complete_word.html"><b>cpl_complete_word</b></a>
-
-
-</pre><h2>AUTHOR</h2><pre>
- Martin Shepherd (mcs at astro.caltech.edu)
-
-
-
- <a href="pca_lookup_file.html"><b>pca_lookup_file</b></a>
-</pre>
-</body>
+Content-type: text/html
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML><HEAD><TITLE>Man page of pca_lookup_file</TITLE>
+</HEAD><BODY>
+<H1>pca_lookup_file</H1>
+Section: C Library Functions (3)<BR><A HREF="#index">Index</A>
+<A HREF="index.html">Return to Main Contents</A><HR>
+
+<A NAME="lbAB"> </A>
+<H2>NAME</H2>
+
+pca_lookup_file, del_PathCache, del_PcaPathConf, new_PathCache, new_PcaPathConf, pca_last_error, pca_path_completions, pca_scan_path, pca_set_check_fn, ppc_file_start, ppc_literal_escapes - lookup a file in a list of directories
+<A NAME="lbAC"> </A>
+<H2>SYNOPSIS</H2>
+
+<PRE>
+#include <<A HREF="file:///usr/include/libtecla.h">libtecla.h</A>>
+
+PathCache *new_PathCache(void);
+
+PathCache *del_PathCache(PathCache *pc);
+
+int pca_scan_path(PathCache *pc, const char *path);
+
+void pca_set_check_fn(PathCache *pc, CplCheckFn *check_fn,
+ void *data);
+
+char *pca_lookup_file(PathCache *pc, const char *name,
+ int name_len, int literal);
+
+const char *pca_last_error(PathCache *pc);
+
+CPL_MATCH_FN(pca_path_completions);
+
+</PRE>
+
+<P>
+<A NAME="lbAD"> </A>
+<H2>DESCRIPTION</H2>
+
+<P>
+The <B>PathCache</B> object is part of the tecla library (see the
+<A HREF="libtecla.html">libtecla</A>(3) man page).
+<P>
+<B>PathCache</B> objects allow an application to search for files in
+any colon separated list of directories, such as the unix execution
+PATH environment variable. Files in absolute directories are cached in
+a <B>PathCache</B> object, whereas relative directories are scanned as
+needed. Using a <B>PathCache</B> object, you can look up the full
+pathname of a simple filename, or you can obtain a list of the
+possible completions of a given filename prefix. By default all files
+in the list of directories are targets for lookup and completion, but
+a versatile mechanism is provided for only selecting specific types of
+files. The obvious application of this facility is to provide
+Tab-completion and lookup of executable commands in the unix PATH, so
+an optional callback which rejects all but executable files, is
+provided.
+<P>
+<A NAME="lbAE"> </A>
+<H2>AN EXAMPLE</H2>
+
+<P>
+Under UNIX, the following example program looks up and displays the
+full pathnames of each of the command names on the command line.
+<P>
+<PRE>
+ #include <<A HREF="file:///usr/include/stdio.h">stdio.h</A>>
+ #include <<A HREF="file:///usr/include/stdlib.h">stdlib.h</A>>
+ #include <<A HREF="file:///usr/include/libtecla.h">libtecla.h</A>>
+
+ int main(int argc, char *argv[])
+ {
+ int i;
+ /*
+ * Create a cache for executable files.
+ */
+ PathCache *pc = new_PathCache();
+ if(!pc)
+ <A HREF="exit.html">exit</A>(1);
+ /*
+ * Scan the user's PATH for executables.
+ */
+ if(pca_scan_path(pc, getenv("PATH"))) {
+ fprintf(stderr, "%s\n", pca_last_error(pc));
+ <A HREF="exit.html">exit</A>(1);
+ }
+ /*
+ * Arrange to only report executable files.
+ */
+ pca_set_check_fn(pc, cpl_check_exe, NULL);
+ /*
+ * Lookup and display the full pathname of each of the
+ * commands listed on the command line.
+ */
+ for(i=1; i<argc; i++) {
+ char *cmd = pca_lookup_file(pc, argv[i], -1, 0);
+ printf("The full pathname of '%s' is %s\n", argv[i],
+ cmd ? cmd : "unknown");
+ }
+ pc = del_PathCache(pc); /* Clean up */
+ return 0;
+ }
+</PRE>
+
+<P>
+The following is an example of what this does on my laptop under
+linux:
+<P>
+<PRE>
+ $ ./example less more blob
+ The full pathname of 'less' is /usr/bin/less
+ The full pathname of 'more' is /bin/more
+ The full pathname of 'blob' is unknown
+ $
+</PRE>
+
+<P>
+<A NAME="lbAF"> </A>
+<H2>FUNCTION DESCRIPTIONS</H2>
+
+<P>
+In order to use the facilities of this module, you must first allocate
+a <B>PathCache</B> object by calling the <B>new_PathCache()</B>
+constructor function.
+<P>
+<PRE>
+ PathCache *new_PathCache(void)
+</PRE>
+
+<P>
+This function creates the resources needed to cache and lookup files
+in a list of directories. It returns <B>NULL</B> on error.
+<P>
+<A NAME="lbAG"> </A>
+<H2>POPULATING THE CACHE</H2>
+
+Once you have created a cache, it needs to be populated with files.
+To do this, call the <B>pca_scan_path()</B> function.
+<P>
+<PRE>
+ int pca_scan_path(PathCache *pc, const char *path);
+</PRE>
+
+<P>
+Whenever this function is called, it discards the current contents of
+the cache, then scans the list of directories specified in its
+<B>path</B> argument for files. The <B>path</B> argument must be a
+string containing a colon-separated list of directories, such as
+<B>"/usr/bin:/home/mcs/bin:."</B>. This can include directories
+specified by absolute pathnames such as <B>"/usr/bin"</B>, as well as
+sub-directories specified by relative pathnames such as <B>"."</B> or
+<B>"bin"</B>. Files in the absolute directories are immediately cached
+in the specified <B>PathCache</B> object, whereas sub-directories,
+whose identities obviously change whenever the current working
+directory is changed, are marked to be scanned on the fly whenever a
+file is looked up.
+<P>
+On success this function return <B>0</B>. On error it returns <B>1</B>,
+and a description of the error can be obtained by calling
+<B>pca_last_error(pc)</B>.
+<P>
+<A NAME="lbAH"> </A>
+<H2>LOOKING UP FILES</H2>
+
+<P>
+Once the cache has been populated with files, you can look up the full
+pathname of a file, simply by specifying its filename to
+<B>pca_lookup_file()</B>.
+<P>
+<PRE>
+ char *pca_lookup_file(PathCache *pc, const char *name,
+ int name_len, int literal);
+</PRE>
+
+<P>
+To make it possible to pass this function a filename which is actually
+part of a longer string, the <B>name_len</B> argument can be used to
+specify the length of the filename at the start of the <B>name[]</B>
+argument. If you pass <B>-1</B> for this length, the length of the
+string will be determined with <B>strlen()</B>. If the <B>name[]</B>
+string might contain backslashes that escape the special meanings of
+spaces and tabs within the filename, give the <B>literal</B> argument,
+the value <B>0</B>. Otherwise, if backslashes should be treated as
+normal characters, pass <B>1</B> for the value of the <B>literal</B>
+argument.
+<P>
+<A NAME="lbAI"> </A>
+<H2>FILENAME COMPLETION</H2>
+
+<P>
+Looking up the potential completions of a filename-prefix in the
+filename cache, is achieved by passing the provided
+<B>pca_path_completions()</B> callback function to the
+<B>cpl_complete_word()</B> function (see the <B><A HREF="cpl_complete_word.html">cpl_complete_word</A>(3)</B>
+man page).
+<P>
+<PRE>
+ CPL_MATCH_FN(pca_path_completions);
+</PRE>
+
+<P>
+This callback requires that its <B>data</B> argument be a pointer to a
+<B>PcaPathConf</B> object. Configuration objects of this type are
+allocated by calling <B>new_PcaPathConf()</B>.
+<P>
+<PRE>
+ PcaPathConf *new_PcaPathConf(PathCache *pc);
+</PRE>
+
+<P>
+This function returns an object initialized with default configuration
+parameters, which determine how the <B>cpl_path_completions()</B>
+callback function behaves. The functions which allow you to
+individually change these parameters are discussed below.
+<P>
+By default, the <B>pca_path_completions()</B> callback function
+searches backwards for the start of the filename being completed,
+looking for the first un-escaped space or the start of the input
+line. If you wish to specify a different location, call
+<B>ppc_file_start()</B> with the index at which the filename starts in
+the input line. Passing <B>start_index=-1</B> re-enables the default
+behavior.
+<P>
+<PRE>
+ void ppc_file_start(PcaPathConf *ppc, int start_index);
+</PRE>
+
+<P>
+By default, when <B>pca_path_completions()</B> looks at a filename in
+the input line, each lone backslash in the input line is interpreted
+as being a special character which removes any special significance of
+the character which follows it, such as a space which should be taken
+as part of the filename rather than delimiting the start of the
+filename. These backslashes are thus ignored while looking for
+completions, and subsequently added before spaces, tabs and literal
+backslashes in the list of completions. To have unescaped backslashes
+treated as normal characters, call <B>ppc_literal_escapes()</B> with a
+non-zero value in its <B>literal</B> argument.
+<P>
+<PRE>
+ void ppc_literal_escapes(PcaPathConf *ppc, int literal);
+</PRE>
+
+<P>
+When you have finished with a <B>PcaPathConf</B> variable, you can pass
+it to the <B>del_PcaPathConf()</B> destructor function to reclaim its
+memory.
+<P>
+<PRE>
+ PcaPathConf *del_PcaPathConf(PcaPathConf *ppc);
+</PRE>
+
+<P>
+<P>
+<A NAME="lbAJ"> </A>
+<H2>BEING SELECTIVE</H2>
+
+If you are only interested in certain types or files, such as, for
+example, executable files, or files whose names end in a particular
+suffix, you can arrange for the file completion and lookup functions
+to be selective in the filenames that they return. This is done by
+registering a callback function with your <B>PathCache</B>
+object. Thereafter, whenever a filename is found which either matches
+a filename being looked up, or matches a prefix which is being
+completed, your callback function will be called with the full
+pathname of the file, plus any application-specific data that you
+provide, and if the callback returns <B>1</B> the filename will be
+reported as a match, and if it returns <B>0</B>, it will be ignored.
+Suitable callback functions and their prototypes should be declared
+with the following macro. The <B>CplCheckFn</B> <B>typedef</B> is also
+provided in case you wish to declare pointers to such functions.
+<P>
+<PRE>
+ #define CPL_CHECK_FN(fn) int (fn)(void *data, \
+ const char *pathname)
+ typedef CPL_CHECK_FN(CplCheckFn);
+</PRE>
+
+<P>
+Registering one of these functions involves calling the
+<B>pca_set_check_fn()</B> function. In addition to the callback
+function, passed via the <B>check_fn</B> argument, you can pass a
+pointer to anything via the <B>data</B> argument. This pointer will be
+passed on to your callback function, via its own <B>data</B> argument,
+whenever it is called, so this provides a way to pass appplication
+specific data to your callback.
+<P>
+<PRE>
+ void pca_set_check_fn(PathCache *pc, CplCheckFn *check_fn,
+ void *data);
+</PRE>
+
+<P>
+Note that these callbacks are passed the full pathname of each
+matching file, so the decision about whether a file is of interest can
+be based on any property of the file, not just its filename. As an
+example, the provided <B>cpl_check_exe()</B> callback function looks at
+the executable permissions of the file and the permissions of its
+parent directories, and only returns <B>1</B> if the user has execute
+permission to the file. This callback function can thus be used to
+lookup or complete command names found in the directories listed in
+the user's <B>PATH</B> environment variable. The example program given
+earlier in this man page provides a demonstration of this.
+<P>
+Beware that if somebody tries to complete an empty string, your
+callback will get called once for every file in the cache, which could
+number in the thousands. If your callback does anything time
+consuming, this could result in an unacceptable delay for the user, so
+callbacks should be kept short.
+<P>
+To improve performance, whenever one of these callbacks is called, the
+choice that it makes is cached, and the next time the corresponding
+file is looked up, instead of calling the callback again, the cached
+record of whether it was accepted or rejected is used. Thus if
+somebody tries to complete an empty string, and hits tab a second time
+when nothing appears to happen, there will only be one long delay,
+since the second pass will operate entirely from the cached
+dispositions of the files. These cached dipositions are discarded
+whenever <B>pca_scan_path()</B> is called, and whenever
+<B>pca_set_check_fn()</B> is called with changed callback function or
+data arguments.
+<P>
+<A NAME="lbAK"> </A>
+<H2>ERROR HANDLING</H2>
+
+<P>
+If <B>pca_scan_path()</B> reports that an error occurred by returning
+<B>1</B>, you can obtain a terse description of the error by calling
+<B>pca_last_error(pc)</B>. This returns an internal string containing
+an error message.
+<P>
+<PRE>
+ const char *pca_last_error(PathCache *pc);
+</PRE>
+
+<P>
+<P>
+<A NAME="lbAL"> </A>
+<H2>CLEANING UP</H2>
+
+<P>
+Once you have finished using a <B>PathCache</B> object, you can reclaim
+its resources by passing it to the <B>del_PathCache()</B> destructor
+function. This takes a pointer to one of these objects, and always
+returns <B>NULL</B>.
+<P>
+<PRE>
+ PathCache *del_PathCache(PathCache *pc);
+</PRE>
+
+<P>
+<A NAME="lbAM"> </A>
+<H2>THREAD SAFETY</H2>
+
+<P>
+In multi-threaded programs, you should use the <B>libtecla_r.a</B>
+version of the library. This uses POSIX reentrant functions where
+available (hence the <B>_r</B> suffix), and disables features that rely
+on non-reentrant system functions. In the case of this module, the
+only disabled feature is username completion in <B>~username/</B>
+expressions, in <B>cpl_path_completions()</B>.
+<P>
+Using the <B>libtecla_r.a</B> version of the library, it is safe to use
+the facilities of this module in multiple threads, provided that each
+thread uses a separately allocated <B>PathCache</B> object. In other
+words, if two threads want to do path searching, they should each call
+<B>new_PathCache()</B> to allocate their own caches.
+<P>
+<A NAME="lbAN"> </A>
+<H2>FILES</H2>
+
+<PRE>
+libtecla.a - The tecla library
+libtecla.h - The tecla header file.
+</PRE>
+
+<P>
+<A NAME="lbAO"> </A>
+<H2>SEE ALSO</H2>
+
+<P>
+<PRE>
+<A HREF="libtecla.html">libtecla</A>(3), <A HREF="gl_get_line.html">gl_get_line</A>(3), <A HREF="ef_expand_file.html">ef_expand_file</A>(3),
+<A HREF="cpl_complete_word.html">cpl_complete_word</A>(3)
+</PRE>
+
+<P>
+<A NAME="lbAP"> </A>
+<H2>AUTHOR</H2>
+
+Martin Shepherd (<A HREF="mailto:mcs at astro.caltech.edu">mcs at astro.caltech.edu</A>)
+<P>
+
+<HR>
+<A NAME="index"> </A><H2>Index</H2>
+<DL>
+<DT><A HREF="#lbAB">NAME</A><DD>
+<DT><A HREF="#lbAC">SYNOPSIS</A><DD>
+<DT><A HREF="#lbAD">DESCRIPTION</A><DD>
+<DT><A HREF="#lbAE">AN EXAMPLE</A><DD>
+<DT><A HREF="#lbAF">FUNCTION DESCRIPTIONS</A><DD>
+<DT><A HREF="#lbAG">POPULATING THE CACHE</A><DD>
+<DT><A HREF="#lbAH">LOOKING UP FILES</A><DD>
+<DT><A HREF="#lbAI">FILENAME COMPLETION</A><DD>
+<DT><A HREF="#lbAJ">BEING SELECTIVE</A><DD>
+<DT><A HREF="#lbAK">ERROR HANDLING</A><DD>
+<DT><A HREF="#lbAL">CLEANING UP</A><DD>
+<DT><A HREF="#lbAM">THREAD SAFETY</A><DD>
+<DT><A HREF="#lbAN">FILES</A><DD>
+<DT><A HREF="#lbAO">SEE ALSO</A><DD>
+<DT><A HREF="#lbAP">AUTHOR</A><DD>
+</DL>
+<HR>
+This document was created by
+<A HREF="/cgi-bin/man/man2html">man2html</A>,
+using the manual pages.<BR>
+Time: 03:25:06 GMT, June 12, 2012
+</BODY>
+</HTML>
diff --git a/html/release.html b/html/release.html
index b048f4f..602ff3d 100644
--- a/html/release.html
+++ b/html/release.html
@@ -2,6 +2,14 @@
<body bgcolor="#add8e6"><pre>
This file lists major changes which accompany each new release.
+Version 1.6.2:
+
+ This release updates the configuration script to ensure that the
+ enhance utility program is compiled correctly on systems that have
+ system V psuedo-terminal allocation but not system V streams.
+
+ There are no new features.
+
Version 1.6.1:
This is primarily a minor bug-fix release.
diff --git a/html/tecla.html b/html/tecla.html
index 6f270c1..2af7ad2 100644
--- a/html/tecla.html
+++ b/html/tecla.html
@@ -1,1120 +1,1276 @@
-<head>
-<title>Manual Page</title>
-</head>
-<body>
-<pre>
-<a href="tecla.html"><b>tecla</b></a> <a href="tecla.html"><b>tecla</b></a>
-
-
-
-</pre><h2>NAME</h2><pre>
- tecla, teclarc - The user interface provided by the Tecla library.
-
-</pre><h2>DESCRIPTION</h2><pre>
- This man page describes the command-line editing features that are
- available to users of programs that read keyboard input via the Tecla
- library. Users of the tcsh shell will find the default key-bindings
- very familiar. Users of the bash shell will also find it quite famil-
- iar, but with a few minor differences, most notably in how forward and
- backward searches through the list of historical commands are per-
- formed. There are two major editing modes, one with emacs-like key-
- bindings and another with vi-like key-bindings. By default emacs mode
- is enabled, but vi mode can alternatively be selected via the user's
- configuration file. This file can also be used to change the bindings
- of individual keys to suit the user's preferences. By default, tab com-
- pletion is provided. If the application hasn't reconfigured this to
- complete other types of symbols, then tab completion completes file-
- names.
-
-
-</pre><h2>KEY SEQUENCE NOTATION</h2><pre>
- In the rest of this man page, and also in all Tecla configuration
- files, key-sequences are expressed as follows.
-
-
- ^A or C-a
- This is a control-A, entered by pressing the control key at
- the same time as the A key.
-
- \E or M-
- In key-sequences, both of these notations can be entered
- either by pressing the escape key, then the following key, or by
- pressing the Meta key at the same time as the following key. Thus
- the key sequence M-p can be typed in two ways, by pressing
- the escape key, followed by pressing p, or by pressing the
- Meta key at the same time as p.
-
- up
- This refers to the up-arrow key.
-
- down
- This refers to the down-arrow key.
-
- left
- This refers to the left-arrow key.
-
- right
- This refers to the right-arrow key.
-
- a
- This is just a normal A key.
-
-
-
-</pre><h2>THE TECLA CONFIGURATION FILE</h2><pre>
- By default, Tecla looks for a file called .teclarc in your home direc-
- tory (ie. ~/.teclarc). If it finds this file, it reads it, interpret-
- ing each line as defining a new key binding or an editing configuration
- option. Since the emacs keybindings are installed by default, if you
- want to use the non-default vi editing mode, the most important item to
- go in this file is the following line:
-
- edit-mode vi
-
- This will re-configure the default bindings for vi-mode. The complete
- set of arguments that this command accepts are:
-
- vi - Install key-bindings like those of the vi
- editor.
- emacs - Install key-bindings like those of the emacs
- editor. This is the default.
- none - Use just the native line editing facilities
- provided by the terminal driver.
-
- To prevent the terminal bell from being rung, such as when an unrecog-
- nized control-sequence is typed, place the following line in the con-
- figuration file:
-
- nobeep
-
- An example of a key binding line in the configuration file is the fol-
- lowing.
-
- bind M-[2~ insert-mode
-
- On many keyboards, the above key sequence is generated when one presses
- the insert key, so with this keybinding, one can toggle between the
- emacs-mode insert and overwrite modes by hitting one key. One could
- also do it by typing out the above sequence of characters one by one.
- As explained above, the M- part of this sequence can be typed either by
- pressing the escape key before the following key, or by pressing the
- Meta key at the same time as the following key. Thus if you had set the
- above key binding, and the insert key on your keyboard didn't generate
- the above key sequence, you could still type it in either of the fol-
- lowing 2 ways.
-
- 1. Hit the escape key momentarily, then press '[', then '2', then
- finally '~'.
-
- 2. Press the meta key at the same time as pressing the '[' key,
- then press '2', then '~'.
-
- If you set a keybinding for a key-sequence that is already bound to a
- function, the new binding overrides the old one. If in the new binding
- you omit the name of the new function to bind to the key-sequence, the
- original binding becomes undefined.
-
- Starting with versions of libtecla later than 1.3.3 it is now possible
- to bind keysequences that begin with a printable character. Previously
- key-sequences were required to start with a control or meta character.
-
- Note that the special keywords "up", "down", "left" and "right" refer
- to the arrow keys, and are thus not treated as keysequences. So, for
- example, to rebind the up and down arrow keys to use the history search
- mechanism instead of the simple history recall method, you could place
- the following in your configuration file:
-
- bind up history-search-backwards
- bind down history-search-backwards
-
- To unbind an existing binding, you can do this with the bind command by
- omitting to name any action to rebind the key sequence to. For exam-
- ple, by not specifying an action function, the following command
- unbinds the default beginning-of-line action from the ^A key sequence:
-
- bind ^A
-
- If you create a ~/.teclarc configuration file, but it appears to have
- no effect on the program, check the documentation of the program to see
- if the author chose a different name for this file.
-
-
-</pre><h2>FILENAME AND TILDE COMPLETION</h2><pre>
- With the default key bindings, pressing the TAB key (aka. ^I) results
- in Tecla attempting to complete the incomplete filename that precedes
- the cursor. Tecla searches backwards from the cursor, looking for the
- start of the filename, stopping when it hits either a space or the
- start of the line. If more than one file has the specified prefix, then
- Tecla completes the filename up to the point at which the ambiguous
- matches start to differ, then lists the possible matches.
-
- In addition to literally written filenames, Tecla can complete files
- that start with ~/ and ~user/ expressions and that contain $envvar
- expressions. In particular, if you hit TAB within an incomplete ~user,
- expression, Tecla will attempt to complete the username, listing any
- ambiguous matches.
-
- The completion binding is implemented using the cpl_word_completions()
- function, which is also available separately to users of this library.
- See the cpl_word_completions(@LIBR_MANEXT@) man page for more details.
-
-
-</pre><h2>FILENAME EXPANSION</h2><pre>
- With the default key bindings, pressing ^X* causes Tecla to expand the
- filename that precedes the cursor, replacing ~/ and ~user/ expressions
- with the corresponding home directories, and replacing $envvar expres-
- sions with the value of the specified environment variable, then if
- there are any wildcards, replacing the so far expanded filename with a
- space-separated list of the files which match the wild cards.
-
- The expansion binding is implemented using the ef_expand_file() func-
- tion. See the <a href="ef_expand_file.html"><b>ef_expand_file</b></a> man page for more details.
-
-
-</pre><h2>RECALLING PREVIOUSLY TYPED LINES</h2><pre>
- Every time that a new line is entered by the user, it is appended to a
- list of historical input lines maintained within the GetLine resource
- object. You can traverse up and down this list using the up and down
- arrow keys. Alternatively, you can do the same with the ^P, and ^N
- keys, and in vi command mode you can alternatively use the k and j
- characters. Thus pressing up-arrow once, replaces the current input
- line with the previously entered line. Pressing up-arrow again,
- replaces this with the line that was entered before it, etc.. Having
- gone back one or more lines into the history list, one can return to
- newer lines by pressing down-arrow one or more times. If you do this
- sufficient times, you will return to the original line that you were
- entering when you first hit up-arrow.
-
- Note that in vi mode, all of the history recall functions switch the
- library into command mode.
-
- In emacs mode the M-p and M-n keys work just like the ^P and ^N keys,
- except that they skip all but those historical lines which share the
- prefix that precedes the cursor. In vi command mode the upper case K
- and J characters do the same thing, except that the string that they
- search for includes the character under the cursor as well as what pre-
- cedes it.
-
- Thus for example, suppose that you were in emacs mode, and you had just
- entered the following list of commands in the order shown:
-
- ls ~/tecla/
- cd ~/tecla
- ls -l getline.c
- emacs ~/tecla/getline.c
-
- If you next typed:
-
- ls
-
- and then hit M-p, then rather than returning the previously typed emacs
- line, which doesn't start with "ls", Tecla would recall the "ls -l get-
- line.c" line. Pressing M-p again would recall the "ls ~/tecla/" line.
-
- Note that if the string that you are searching for, contains any of the
- special characters, *, ?, or '[', then it is interpretted as a pattern
- to be matched. Thus, cotinuing with the above example, after typing in
- the list of commands shown, if you then typed:
-
- *tecla*
-
- and hit M-p, then the "emacs ~/tecla/getline.c" line would be recalled
- first, since it contains the word tecla somewhere in the line, Simi-
- larly, hitting M-p again, would recall the "ls ~/tecla/" line, and hit-
- ting it once more would recall the "ls ~/tecla/" line. The pattern syn-
- tax is the same as that described for filename expansion, in the
- ef_expand_file(@LIBR_MANEXT@ man page.
-
-
-</pre><h2>HISTORY FILES</h2><pre>
- Authors of programs that use the Tecla library have the option of sav-
- ing historical command-lines in a file before exiting, and subsequently
- reading them back in from this file when the program is next started.
- There is no standard name for this file, since it makes sense for each
- application to use its own history file, so that commands from differ-
- ent applications don't get mixed up.
-
-
-</pre><h2>INTERNATIONAL CHARACTER SETS</h2><pre>
- Since libtecla version 1.4.0, Tecla has been 8-bit clean. This means
- that all 8-bit characters that are printable in the user's current
- locale are now displayed verbatim and included in the returned input
- line. Assuming that the calling program correctly contains a call like
- the following,
-
- setlocale(LC_CTYPE, "");
-
- then the current locale is determined by the first of the environment
- variables LC_CTYPE, LC_ALL, and LANG, that is found to contain a valid
- locale name. If none of these variables are defined, or the program
- neglects to call setlocale, then the default C locale is used, which is
- US 7-bit ASCII. On most unix-like platforms, you can get a list of
- valid locales by typing the command:
-
- locale -a
-
- at the shell prompt.
-
-
- Meta keys and locales
- Beware that in most locales other than the default C locale, meta char-
- acters become printable, and they are then no longer considered to
- match M-c style key bindings. This allows international characters to
- be entered with the compose key without unexpectedly triggering meta
- key bindings. You can still invoke meta bindings, since there are actu-
- ally two ways to do this. For example the binding M-c can also be
- invoked by pressing the escape key momentarily, then pressing the c
- key, and this will work regardless of locale. Moreover, many modern
- terminal emulators, such as gnome's gnome-terminal's and KDE's konsole
- terminals, already generate escape pairs like this when you use the
- meta key, rather than a real meta character, and other emulators usu-
- ally have a way to request this behavior, so you can continue to use
- the meta key on most systems.
-
- For example, although xterm terminal emulators generate real 8-bit meta
- characters by default when you use the meta key, they can be configured
- to output the equivalent escape pair by setting their EightBitInput X
- resource to False. You can either do this by placing a line like the
- following in your ~/.Xdefaults file,
-
- XTerm*EightBitInput: False
-
- or by starting an xterm with an -xrm '*EightBitInput: False' command-
- line argument. In recent versions of xterm you can toggle this feature
- on and off with the "Meta Sends Escape" option in the menu that is dis-
- played when you press the left mouse button and the control key within
- an xterm window. In CDE, dtterms can be similarly coerced to generate
- escape pairs in place of meta characters, by setting the Dtterm*KshMode
- resource to True.
-
-
- Entering international characters
- If you don't have a keyboard that generates all of the international
- characters that you need, there is usually a compose key that will
- allow you to enter special characters, or a way to create one. For
- example, under X windows on unix-like systems, if your keyboard doesn't
- have a compose key, you can designate a redundant key to serve this
- purpose with the xmodmap command. For example, on many PC keyboards
- there is a microsoft-windows key, which is otherwise useless under
- Linux. On my laptop the xev program reports that pressing this key gen-
- erates keycode 115, so to turn this key into a compose key, I do the
- following:
-
- xmodmap -e 'keycode 115 = Multi_key'
-
- I can then enter an i with a umlaut over it by typing this key, fol-
- lowed by ", followed by i.
-
-
-</pre><h2>THE AVAILABLE KEY BINDING FUNCTIONS</h2><pre>
- The following is a list of the editing functions provided by the Tecla
- library. The names in the leftmost column of the list can be used in
- configuration files to specify which function a given key or combina-
- tion of keys should invoke. They are also used in the next two sections
- to list the default key-bindings in emacs and vi modes.
-
- user-interrupt - Send a SIGINT signal to the
- parent process.
- abort - Send a SIGABRT signal to the
- parent process.
- suspend - Suspend the parent process.
- stop-output - Pause terminal output.
- start-output - Resume paused terminal output.
- literal-next - Arrange for the next character
- to be treated as a normal
- character. This allows control
- characters to be entered.
- cursor-right - Move the cursor one character
- right.
- cursor-left - Move the cursor one character
- left.
- insert-mode - Toggle between insert mode and
- overwrite mode.
- beginning-of-line - Move the cursor to the
- beginning of the line.
- end-of-line - Move the cursor to the end of
- the line.
- delete-line - Delete the contents of the
- current line.
- kill-line - Delete everything that follows
- the cursor.
- backward-kill-line - Delete all characters between
- the cursor and the start of the
- line.
- forward-word - Move to the end of the word
- which follows the cursor.
- forward-to-word - Move the cursor to the start of
- the word that follows the
- cursor.
- backward-word - Move to the start of the word
- which precedes the cursor.
- goto-column - Move the cursor to the
- 1-relative column in the line
- specified by any preceding
- digit-argument sequences (see
- ENTERING REPEAT COUNTS below).
- find-parenthesis - If the cursor is currently
- over a parenthesis character,
- move it to the matching
- parenthesis character. If not
- over a parenthesis character
- move right to the next close
- parenthesis.
- forward-delete-char - Delete the character under the
- cursor.
- backward-delete-char - Delete the character which
- precedes the cursor.
- list-or-eof - This is intended for binding
- to ^D. When invoked when the
- cursor is within the line it
- displays all possible
- completions then redisplays
- the line unchanged. When
- invoked on an empty line, it
- signals end-of-input (EOF) to
- the caller of gl_get_line().
- del-char-or-list-or-eof - This is intended for binding
- to ^D. When invoked when the
- cursor is within the line it
- invokes forward-delete-char.
- When invoked at the end of the
- line it displays all possible
- completions then redisplays
- the line unchanged. When
- invoked on an empty line, it
- signals end-of-input (EOF) to
- the caller of gl_get_line().
- forward-delete-word - Delete the word which follows
- the cursor.
- backward-delete-word - Delete the word which precedes
- the cursor.
- upcase-word - Convert all of the characters
- of the word which follows the
- cursor, to upper case.
- downcase-word - Convert all of the characters
- of the word which follows the
- cursor, to lower case.
- capitalize-word - Capitalize the word which
- follows the cursor.
- change-case - If the next character is upper
- case, toggle it to lower case
- and vice versa.
- redisplay - Redisplay the line.
- clear-screen - Clear the terminal, then
- redisplay the current line.
- transpose-chars - Swap the character under the
- cursor with the character just
- before the cursor.
- set-mark - Set a mark at the position of
- the cursor.
- exchange-point-and-mark - Move the cursor to the last
- mark that was set, and move
- the mark to where the cursor
- used to be.
- kill-region - Delete the characters that lie
- between the last mark that was
- set, and the cursor.
- copy-region-as-kill - Copy the text between the mark
- and the cursor to the cut
- buffer, without deleting the
- original text.
- yank - Insert the text that was last
- deleted, just before the
- current position of the cursor.
- append-yank - Paste the current contents of
- the cut buffer, after the
- cursor.
- up-history - Recall the next oldest line
- that was entered. Note that
- in vi mode you are left in
- command mode.
- down-history - Recall the next most recent
- line that was entered. If no
- history recall session is
- currently active, the next
- line from a previous recall
- session is recalled. Note that
- in vi mode you are left in
- command mode.
- history-search-backward - Recall the next oldest line
- who's prefix matches the string
- which currently precedes the
- cursor (in vi command-mode the
- character under the cursor is
- also included in the search
- string). Note that in vi mode
- you are left in command mode.
- history-search-forward - Recall the next newest line
- who's prefix matches the string
- which currently precedes the
- cursor (in vi command-mode the
- character under the cursor is
- also included in the search
- string). Note that in vi mode
- you are left in command mode.
- history-re-search-backward -Recall the next oldest line
- who's prefix matches that
- established by the last
- invocation of either
- history-search-forward or
- history-search-backward.
- history-re-search-forward - Recall the next newest line
- who's prefix matches that
- established by the last
- invocation of either
- history-search-forward or
- history-search-backward.
- complete-word - Attempt to complete the
- incomplete word which
- precedes the cursor. Unless
- the host program has customized
- word completion, filename
- completion is attempted. In vi
- commmand mode the character
- under the cursor is also
- included in the word being
- completed, and you are left in
- vi insert mode.
- expand-filename - Within the command line, expand
- wild cards, tilde expressions
- and dollar expressions in the
- filename which immediately
- precedes the cursor. In vi
- commmand mode the character
- under the cursor is also
- included in the filename being
- expanded, and you are left in
- vi insert mode.
- list-glob - List any filenames which match
- the wild-card, tilde and dollar
- expressions in the filename
- which immediately precedes the
- cursor, then redraw the input
- line unchanged.
- list-history - Display the contents of the
- history list for the current
- history group. If a repeat
- count of > 1 is specified,
- only that many of the most
- recent lines are displayed.
- See the "ENTERING REPEAT
- COUNTS" section.
- read-from-file - Temporarily switch to reading
- input from the file who's
- name precedes the cursor.
- read-init-files - Re-read teclarc configuration
- files.
- beginning-of-history - Move to the oldest line in the
- history list. Note that in vi
- mode you are left in command
- mode.
- end-of-history - Move to the newest line in the
- history list (ie. the current
- line). Note that in vi mode
- this leaves you in command
- mode.
- digit-argument - Enter a repeat count for the
- next key-binding function.
- For details, see the ENTERING
- REPEAT COUNTS section.
- newline - Terminate and return the
- current contents of the
- line, after appending a
- newline character. The newline
- character is normally '\n',
- but will be the first
- character of the key-sequence
- that invoked the newline
- action, if this happens to be
- a printable character. If the
- action was invoked by the
- '\n' newline character or the
- '\r' carriage return
- character, the line is
- appended to the history
- buffer.
- repeat-history - Return the line that is being
- edited, then arrange for the
- next most recent entry in the
- history buffer to be recalled
- when Tecla is next called.
- Repeatedly invoking this
- action causes successive
- historical input lines to be
- re-executed. Note that this
- action is equivalent to the
- 'Operate' action in ksh.
- ring-bell - Ring the terminal bell, unless
- the bell has been silenced via
- the nobeep configuration
- option (see the THE TECLA
- CONFIGURATION FILE section).
- forward-copy-char - Copy the next character into
- the cut buffer (NB. use repeat
- counts to copy more than one).
- backward-copy-char - Copy the previous character
- into the cut buffer.
- forward-copy-word - Copy the next word into the cut
- buffer.
- backward-copy-word - Copy the previous word into the
- cut buffer.
- forward-find-char - Move the cursor to the next
- occurrence of the next
- character that you type.
- backward-find-char - Move the cursor to the last
- occurrence of the next
- character that you type.
- forward-to-char - Move the cursor to the
- character just before the next
- occurrence of the next
- character that the user types.
- backward-to-char - Move the cursor to the
- character just after the last
- occurrence before the cursor
- of the next character that the
- user types.
- repeat-find-char - Repeat the last
- backward-find-char,
- forward-find-char,
- backward-to-char or
- forward-to-char.
- invert-refind-char - Repeat the last
- backward-find-char,
- forward-find-char,
- backward-to-char, or
- forward-to-char in the
- opposite direction.
- delete-to-column - Delete the characters from the
- cursor up to the column that
- is specified by the repeat
- count.
- delete-to-parenthesis - Delete the characters from the
- cursor up to and including
- the matching parenthesis, or
- next close parenthesis.
- forward-delete-find - Delete the characters from the
- cursor up to and including the
- following occurence of the
- next character typed.
- backward-delete-find - Delete the characters from the
- cursor up to and including the
- preceding occurence of the
- next character typed.
- forward-delete-to - Delete the characters from the
- cursor up to, but not
- including, the following
- occurence of the next
- character typed.
- backward-delete-to - Delete the characters from the
- cursor up to, but not
- including, the preceding
- occurence of the next
- character typed.
- delete-refind - Repeat the last *-delete-find
- or *-delete-to action.
- delete-invert-refind - Repeat the last *-delete-find
- or *-delete-to action, in the
- opposite direction.
- copy-to-column - Copy the characters from the
- cursor up to the column that
- is specified by the repeat
- count, into the cut buffer.
- copy-to-parenthesis - Copy the characters from the
- cursor up to and including
- the matching parenthesis, or
- next close parenthesis, into
- the cut buffer.
- forward-copy-find - Copy the characters from the
- cursor up to and including the
- following occurence of the
- next character typed, into the
- cut buffer.
- backward-copy-find - Copy the characters from the
- cursor up to and including the
- preceding occurence of the
- next character typed, into the
- cut buffer.
- forward-copy-to - Copy the characters from the
- cursor up to, but not
- including, the following
- occurence of the next
- character typed, into the cut
- buffer.
- backward-copy-to - Copy the characters from the
- cursor up to, but not
- including, the preceding
- occurence of the next
- character typed, into the cut
- buffer.
- copy-refind - Repeat the last *-copy-find
- or *-copy-to action.
- copy-invert-refind - Repeat the last *-copy-find
- or *-copy-to action, in the
- opposite direction.
- vi-mode - Switch to vi mode from emacs
- mode.
- emacs-mode - Switch to emacs mode from vi
- mode.
- vi-insert - From vi command mode, switch to
- insert mode.
- vi-overwrite - From vi command mode, switch to
- overwrite mode.
- vi-insert-at-bol - From vi command mode, move the
- cursor to the start of the line
- and switch to insert mode.
- vi-append-at-eol - From vi command mode, move the
- cursor to the end of the line
- and switch to append mode.
- vi-append - From vi command mode, move the
- cursor one position right, and
- switch to insert mode.
- vi-replace-char - From vi command mode, replace
- the character under the cursor
- with the the next character
- entered.
- vi-forward-change-char - From vi command mode, delete
- the next character then enter
- insert mode.
- vi-backward-change-char - From vi command mode, delete
- the preceding character then
- enter insert mode.
- vi-forward-change-word - From vi command mode, delete
- the next word then enter
- insert mode.
- vi-backward-change-word - From vi command mode, delete
- the preceding word then
- enter insert mode.
- vi-change-rest-of-line - From vi command mode, delete
- from the cursor to the end of
- the line, then enter insert
- mode.
- vi-change-line - From vi command mode, delete
- the current line, then enter
- insert mode.
- vi-change-to-bol - From vi command mode, delete
- all characters between the
- cursor and the beginning of
- the line, then enter insert
- mode.
- vi-change-to-column - From vi command mode, delete
- the characters from the cursor
- up to the column that is
- specified by the repeat count,
- then enter insert mode.
- vi-change-to-parenthesis - Delete the characters from the
- cursor up to and including
- the matching parenthesis, or
- next close parenthesis, then
- enter vi insert mode.
- vi-forward-change-find - From vi command mode, delete
- the characters from the
- cursor up to and including the
- following occurence of the
- next character typed, then
- enter insert mode.
- vi-backward-change-find - From vi command mode, delete
- the characters from the
- cursor up to and including the
- preceding occurence of the
- next character typed, then
- enter insert mode.
- vi-forward-change-to - From vi command mode, delete
- the characters from the
- cursor up to, but not
- including, the following
- occurence of the next
- character typed, then enter
- insert mode.
- vi-backward-change-to - From vi command mode, delete
- the characters from the
- cursor up to, but not
- including, the preceding
- occurence of the next
- character typed, then enter
- insert mode.
- vi-change-refind - Repeat the last
- vi-*-change-find or
- vi-*-change-to action.
- vi-change-invert-refind - Repeat the last
- vi-*-change-find or
- vi-*-change-to action, in the
- opposite direction.
- vi-undo - In vi mode, undo the last
- editing operation.
- vi-repeat-change - In vi command mode, repeat the
- last command that modified the
- line.
-
-
-</pre><h2>DEFAULT KEY BINDINGS IN EMACS MODE</h2><pre>
- The following default key bindings, which can be overriden by the Tecla
- configuration file, are designed to mimic most of the bindings of the
- unix tcsh shell, when it is in emacs editing mode.
-
- This is the default editing mode of the Tecla library.
-
- Under UNIX the terminal driver sets a number of special keys for cer-
- tain functions. The tecla library attempts to use the same keybindings
- to maintain consistency. The key sequences shown for the following 6
- bindings are thus just examples of what they will probably be set to.
- If you have used the stty command to change these keys, then the
- default bindings should match.
-
- ^C -> user-interrupt
- ^\ -> abort
- ^Z -> suspend
- ^Q -> start-output
- ^S -> stop-output
- ^V -> literal-next
-
- The cursor keys are refered to by name, as follows. This is necessary
- because different types of terminals generate different key sequences
- when their cursor keys are pressed.
-
- right -> cursor-right
- left -> cursor-left
- up -> up-history
- down -> down-history
-
- The remaining bindings don't depend on the terminal setttings.
-
- ^F -> cursor-right
- ^B -> cursor-left
- M-i -> insert-mode
- ^A -> beginning-of-line
- ^E -> end-of-line
- ^U -> delete-line
- ^K -> kill-line
- M-f -> forward-word
- M-b -> backward-word
- ^D -> del-char-or-list-or-eof
- ^H -> backward-delete-char
- ^? -> backward-delete-char
- M-d -> forward-delete-word
- M-^H -> backward-delete-word
- M-^? -> backward-delete-word
- M-u -> upcase-word
- M-l -> downcase-word
- M-c -> capitalize-word
- ^R -> redisplay
- ^L -> clear-screen
- ^T -> transpose-chars
- ^@ -> set-mark
- ^X^X -> exchange-point-and-mark
- ^W -> kill-region
- M-w -> copy-region-as-kill
- ^Y -> yank
- ^P -> up-history
- ^N -> down-history
- M-p -> history-search-backward
- M-n -> history-search-forward
- ^I -> complete-word
- ^X* -> expand-filename
- ^X^F -> read-from-file
- ^X^R -> read-init-files
- ^Xg -> list-glob
- ^Xh -> list-history
- M-< -> beginning-of-history
- M-> -> end-of-history
- \n -> newline
- \r -> newline
- M-o -> repeat-history
- M-^V -> vi-mode
-
- M-0, M-1, ... M-9 -> digit-argument (see below)
-
- Note that ^I is what the TAB key generates, and that ^@ can be gener-
- ated not only by pressing the control key and the @ key simultaneously,
- but also by pressing the control key and the space bar at the same
- time.
-
-
-</pre><h2>DEFAULT KEY BINDINGS IN VI MODE</h2><pre>
- The following default key bindings are designed to mimic the vi style
- of editing as closely as possible. This means that very few editing
- functions are provided in the initial character input mode, editing
- functions instead being provided by the vi command mode. Vi command
- mode is entered whenever the escape character is pressed, or whenever a
- key-sequence that starts with a meta character is entered. In addition
- to mimicing vi, libtecla provides bindings for tab completion, wild-
- card expansion of file names, and historical line recall.
-
- To learn how to tell the Tecla library to use vi mode instead of the
- default emacs editing mode, see the earlier section entitled THE TECLA
- CONFIGURATION FILE.
-
- Under UNIX the terminal driver sets a number of special keys for cer-
- tain functions. The Tecla library attempts to use the same keybindings
- to maintain consistency, binding them both in input mode and in command
- mode. The key sequences shown for the following 6 bindings are thus
- just examples of what they will probably be set to. If you have used
- the stty command to change these keys, then the default bindings should
- match.
-
- ^C -> user-interrupt
- ^\ -> abort
- ^Z -> suspend
- ^Q -> start-output
- ^S -> stop-output
- ^V -> literal-next
- M-^C -> user-interrupt
- M-^\ -> abort
- M-^Z -> suspend
- M-^Q -> start-output
- M-^S -> stop-output
-
- Note that above, most of the bindings are defined twice, once as a raw
- control code like ^C and then a second time as a meta character like
- M-^C. The former is the binding for vi input mode, whereas the latter
- is the binding for vi command mode. Once in command mode all key-
- sequences that the user types that they don't explicitly start with an
- escape or a meta key, have their first key secretly converted to a meta
- character before the key sequence is looked up in the key binding ta-
- ble. Thus, once in command mode, when you type the letter i, for exam-
- ple, the Tecla library actually looks up the binding for M-i.
-
- The cursor keys are refered to by name, as follows. This is necessary
- because different types of terminals generate different key sequences
- when their cursor keys are pressed.
-
- right -> cursor-right
- left -> cursor-left
- up -> up-history
- down -> down-history
-
- The cursor keys normally generate a keysequence that start with an
- escape character, so beware that using the arrow keys will put you into
- command mode (if you aren't already in command mode).
-
- The following are the terminal-independent key bindings for vi input
- mode.
-
- ^D -> list-or-eof
- ^G -> list-glob
- ^H -> backward-delete-char
- ^I -> complete-word
- \r -> newline
- \n -> newline
- ^L -> clear-screen
- ^N -> down-history
- ^P -> up-history
- ^R -> redisplay
- ^U -> backward-kill-line
- ^W -> backward-delete-word
- ^X* -> expand-filename
- ^X^F -> read-from-file
- ^X^R -> read-init-files
- ^? -> backward-delete-char
-
- The following are the key bindings that are defined in vi command mode,
- this being specified by them all starting with a meta character. As
- mentioned above, once in command mode the initial meta character is
- optional. For example, you might enter command mode by typing Esc, and
- then press h twice to move the cursor two positions to the left. Both h
- characters get quietly converted to M-h before being compared to the
- key-binding table, the first one because Escape followed by a character
- is always converted to the equivalent meta character, and the second
- because command mode was already active.
-
- M-\ -> cursor-right (Meta-space)
- M-$ -> end-of-line
- M-* -> expand-filename
- M-+ -> down-history
- M-- -> up-history
- M-< -> beginning-of-history
- M-> -> end-of-history
- M-^ -> beginning-of-line
- M-; -> repeat-find-char
- M-, -> invert-refind-char
- M-| -> goto-column
- M-~ -> change-case
- M-. -> vi-repeat-change
- M-% -> find-parenthesis
- M-a -> vi-append
- M-A -> vi-append-at-eol
- M-b -> backward-word
- M-B -> backward-word
- M-C -> vi-change-rest-of-line
- M-cb -> vi-backward-change-word
- M-cB -> vi-backward-change-word
- M-cc -> vi-change-line
- M-ce -> vi-forward-change-word
- M-cE -> vi-forward-change-word
- M-cw -> vi-forward-change-word
- M-cW -> vi-forward-change-word
- M-cF -> vi-backward-change-find
- M-cf -> vi-forward-change-find
- M-cT -> vi-backward-change-to
- M-ct -> vi-forward-change-to
- M-c; -> vi-change-refind
- M-c, -> vi-change-invert-refind
- M-ch -> vi-backward-change-char
- M-c^H -> vi-backward-change-char
- M-c^? -> vi-backward-change-char
- M-cl -> vi-forward-change-char
- M-c\ -> vi-forward-change-char (Meta-c-space)
- M-c^ -> vi-change-to-bol
- M-c0 -> vi-change-to-bol
- M-c$ -> vi-change-rest-of-line
- M-c| -> vi-change-to-column
- M-c% -> vi-change-to-parenthesis
- M-dh -> backward-delete-char
- M-d^H -> backward-delete-char
- M-d^? -> backward-delete-char
- M-dl -> forward-delete-char
- M-d -> forward-delete-char (Meta-d-space)
- M-dd -> delete-line
- M-db -> backward-delete-word
- M-dB -> backward-delete-word
- M-de -> forward-delete-word
- M-dE -> forward-delete-word
- M-dw -> forward-delete-word
- M-dW -> forward-delete-word
- M-dF -> backward-delete-find
- M-df -> forward-delete-find
- M-dT -> backward-delete-to
- M-dt -> forward-delete-to
- M-d; -> delete-refind
- M-d, -> delete-invert-refind
- M-d^ -> backward-kill-line
- M-d0 -> backward-kill-line
- M-d$ -> kill-line
- M-D -> kill-line
- M-d| -> delete-to-column
- M-d% -> delete-to-parenthesis
- M-e -> forward-word
- M-E -> forward-word
- M-f -> forward-find-char
- M-F -> backward-find-char
- M-- -> up-history
- M-h -> cursor-left
- M-H -> beginning-of-history
- M-i -> vi-insert
- M-I -> vi-insert-at-bol
- M-j -> down-history
- M-J -> history-search-forward
- M-k -> up-history
- M-K -> history-search-backward
- M-l -> cursor-right
- M-L -> end-of-history
- M-n -> history-re-search-forward
- M-N -> history-re-search-backward
- M-p -> append-yank
- M-P -> yank
- M-r -> vi-replace-char
- M-R -> vi-overwrite
- M-s -> vi-forward-change-char
- M-S -> vi-change-line
- M-t -> forward-to-char
- M-T -> backward-to-char
- M-u -> vi-undo
- M-w -> forward-to-word
- M-W -> forward-to-word
- M-x -> forward-delete-char
- M-X -> backward-delete-char
- M-yh -> backward-copy-char
- M-y^H -> backward-copy-char
- M-y^? -> backward-copy-char
- M-yl -> forward-copy-char
- M-y\ -> forward-copy-char (Meta-y-space)
- M-ye -> forward-copy-word
- M-yE -> forward-copy-word
- M-yw -> forward-copy-word
- M-yW -> forward-copy-word
- M-yb -> backward-copy-word
- M-yB -> backward-copy-word
- M-yf -> forward-copy-find
- M-yF -> backward-copy-find
- M-yt -> forward-copy-to
- M-yT -> backward-copy-to
- M-y; -> copy-refind
- M-y, -> copy-invert-refind
- M-y^ -> copy-to-bol
- M-y0 -> copy-to-bol
- M-y$ -> copy-rest-of-line
- M-yy -> copy-line
- M-Y -> copy-line
- M-y| -> copy-to-column
- M-y% -> copy-to-parenthesis
- M-^E -> emacs-mode
- M-^H -> cursor-left
- M-^? -> cursor-left
- M-^L -> clear-screen
- M-^N -> down-history
- M-^P -> up-history
- M-^R -> redisplay
- M-^D -> list-or-eof
- M-^I -> complete-word
- M-\r -> newline
- M-\n -> newline
- M-^X^R -> read-init-files
- M-^Xh -> list-history
-
- M-0, M-1, ... M-9 -> digit-argument (see below)
-
- Note that ^I is what the TAB key generates.
-
-
-</pre><h2>ENTERING REPEAT COUNTS</h2><pre>
- Many of the key binding functions described previously, take an
- optional count, typed in before the target keysequence. This is inter-
- preted as a repeat count by most bindings. A notable exception is the
- goto-column binding, which interprets the count as a column number.
-
- By default you can specify this count argument by pressing the meta key
- while typing in the numeric count. This relies on the digit-argument
- action being bound to Meta-0, Meta-1 etc. Once any one of these bind-
- ings has been activated, you can optionally take your finger off the
- meta key to type in the rest of the number, since every numeric digit
- thereafter is treated as part of the number, unless it is preceded by
- the literal-next binding. As soon as a non-digit, or literal digit key
- is pressed the repeat count is terminated and either causes the just
- typed character to be added to the line that many times, or causes the
- next key-binding function to be given that argument.
-
- For example, in emacs mode, typing:
-
- M-12a
-
- causes the letter 'a' to be added to the line 12 times, whereas
-
- M-4M-c
-
- Capitalizes the next 4 words.
-
- In vi command mode the Meta modifier is automatically added to all
- characters typed in, so to enter a count in vi command-mode, just
- involves typing in the number, just as it does in the vi editor itself.
- So for example, in vi command mode, typing:
-
- 4w2x
-
- moves the cursor four words to the right, then deletes two characters.
-
- You can also bind digit-argument to other key sequences. If these end
- in a numeric digit, that digit gets appended to the current repeat
- count. If it doesn't end in a numeric digit, a new repeat count is
- started with a value of zero, and can be completed by typing in the
- number, after letting go of the key which triggered the digit-argument
- action.
-
-
-</pre><h2>FILES</h2><pre>
- libtecla.a - The Tecla library
- libtecla.h - The Tecla header file.
- ~/.teclarc - The personal Tecla customization file.
-
-
-</pre><h2>SEE ALSO</h2><pre>
- <a href="libtecla.html"><b>libtecla</b></a>, <a href="gl_get_line.html"><b>gl_get_line</b></a>, <a href="gl_io_mode.html"><b>gl_io_mode</b></a>, <a href="ef_expand_file.html"><b>ef_expand_file</b></a>,
- <a href="cpl_complete_word.html"><b>cpl_complete_word</b></a>, <a href="pca_lookup_file.html"><b>pca_lookup_file</b></a>
-
-
-</pre><h2>AUTHOR</h2><pre>
- Martin Shepherd (mcs at astro.caltech.edu)
-
-
-
- <a href="tecla.html"><b>tecla</b></a>
-</pre>
-</body>
+Content-type: text/html
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML><HEAD><TITLE>Man page of tecla</TITLE>
+</HEAD><BODY>
+<H1>tecla</H1>
+Section: Environments, Tables, and Troff Macros (7)<BR><A HREF="#index">Index</A>
+<A HREF="index.html">Return to Main Contents</A><HR>
+
+<A NAME="lbAB"> </A>
+<H2>NAME</H2>
+
+tecla, teclarc - The user interface provided by the Tecla library.
+<A NAME="lbAC"> </A>
+<H2>DESCRIPTION</H2>
+
+<P>
+This man page describes the command-line editing features that are
+available to users of programs that read keyboard input via the Tecla
+library. Users of the tcsh shell will find the default key-bindings
+very familiar. Users of the bash shell will also find it quite
+familiar, but with a few minor differences, most notably in how
+forward and backward searches through the list of historical commands
+are performed. There are two major editing modes, one with emacs-like
+key-bindings and another with vi-like key-bindings. By default emacs
+mode is enabled, but vi mode can alternatively be selected via the
+user's configuration file. This file can also be used to change the
+bindings of individual keys to suit the user's preferences. By
+default, tab completion is provided. If the application hasn't
+reconfigured this to complete other types of symbols, then tab
+completion completes file-names.
+<P>
+<A NAME="lbAD"> </A>
+<H2>KEY SEQUENCE NOTATION</H2>
+
+<P>
+In the rest of this man page, and also in all Tecla configuration
+files, key-sequences are expressed as follows.
+<P>
+<P>
+<PRE>
+<B>^A</B> or <B>C-a</B>
+ This is a control-A, entered by pressing the control key at
+ the same time as the <B>A</B> key.
+
+<B>\E</B> or <B>M-</B>
+ In key-sequences, both of these notations can be entered
+ either by pressing the escape key, then the following key, or by
+ pressing the Meta key at the same time as the following key. Thus
+ the key sequence <B>M-p</B> can be typed in two ways, by pressing
+ the escape key, followed by pressing <B>p</B>, or by pressing the
+ Meta key at the same time as <B>p</B>.
+
+<B>up</B>
+ This refers to the up-arrow key.
+
+<B>down</B>
+ This refers to the down-arrow key.
+
+<B>left</B>
+ This refers to the left-arrow key.
+
+<B>right</B>
+ This refers to the right-arrow key.
+
+<B>a</B>
+ This is just a normal A key.
+</PRE>
+
+<P>
+<P>
+<A NAME="lbAE"> </A>
+<H2>THE TECLA CONFIGURATION FILE</H2>
+
+<P>
+By default, Tecla looks for a file called <B>.teclarc</B> in your
+home directory (ie. <B>~/.teclarc</B>). If it finds this file, it
+reads it, interpreting each line as defining a new key binding or an
+editing configuration option. Since the emacs keybindings are
+installed by default, if you want to use the non-default vi editing
+mode, the most important item to go in this file is the following
+line:
+<P>
+<PRE>
+ edit-mode vi
+</PRE>
+
+<P>
+This will re-configure the default bindings for vi-mode. The
+complete set of arguments that this command accepts are:
+<P>
+<PRE>
+ vi - Install key-bindings like those of the vi
+ editor.
+ emacs - Install key-bindings like those of the emacs
+ editor. This is the default.
+ none - Use just the native line editing facilities
+ provided by the terminal driver.
+</PRE>
+
+<P>
+To prevent the terminal bell from being rung, such as when
+an unrecognized control-sequence is typed, place the
+following line in the configuration file:
+<P>
+<PRE>
+ nobeep
+</PRE>
+
+<P>
+An example of a key binding line in the configuration file is
+the following.
+<P>
+<PRE>
+ bind M-[2~ insert-mode
+</PRE>
+
+<P>
+On many keyboards, the above key sequence is generated when one
+presses the <B>insert</B> key, so with this keybinding, one can toggle
+between the emacs-mode insert and overwrite modes by hitting one
+key. One could also do it by typing out the above sequence of
+characters one by one. As explained above, the <B>M-</B> part of this
+sequence can be typed either by pressing the escape key before the
+following key, or by pressing the Meta key at the same time as the
+following key. Thus if you had set the above key binding, and the
+insert key on your keyboard didn't generate the above key sequence,
+you could still type it in either of the following 2 ways.
+<P>
+<PRE>
+ 1. Hit the escape key momentarily, then press '[', then '2', then
+ finally '~'.
+
+ 2. Press the meta key at the same time as pressing the '[' key,
+ then press '2', then '~'.
+</PRE>
+
+<P>
+If you set a keybinding for a key-sequence that is already bound to a function,
+the new binding overrides the old one. If in the new binding you omit the name
+of the new function to bind to the key-sequence, the original binding becomes
+undefined.
+<P>
+Starting with versions of libtecla later than 1.3.3 it is now possible
+to bind keysequences that begin with a printable character. Previously
+key-sequences were required to start with a control or meta character.
+<P>
+Note that the special keywords "up", "down", "left" and "right" refer
+to the arrow keys, and are thus not treated as keysequences. So, for
+example, to rebind the up and down arrow keys to use the history
+search mechanism instead of the simple history recall method, you
+could place the following in your configuration file:
+<P>
+<PRE>
+ bind up history-search-backwards
+ bind down history-search-backwards
+</PRE>
+
+<P>
+To unbind an existing binding, you can do this with the bind command
+by omitting to name any action to rebind the key sequence to. For
+example, by not specifying an action function, the following command
+unbinds the default beginning-of-line action from the ^A key sequence:
+<P>
+<PRE>
+ bind ^A
+</PRE>
+
+<P>
+If you create a <B>~/.teclarc</B> configuration file, but it appears to
+have no effect on the program, check the documentation of the program
+to see if the author chose a different name for this file.
+<P>
+<A NAME="lbAF"> </A>
+<H2>FILENAME AND TILDE COMPLETION</H2>
+
+<P>
+With the default key bindings, pressing the TAB key (aka. <B>^I</B>)
+results in Tecla attempting to complete the incomplete filename that
+precedes the cursor. Tecla searches backwards from the cursor, looking
+for the start of the filename, stopping when it hits either a space or
+the start of the line. If more than one file has the specified prefix,
+then Tecla completes the filename up to the point at which the
+ambiguous matches start to differ, then lists the possible matches.
+<P>
+In addition to literally written filenames, Tecla can
+complete files that start with <B>~/</B> and <B>~user/</B> expressions
+and that contain <B>$envvar</B> expressions. In particular, if you hit
+TAB within an incomplete <B>~user</B>, expression, Tecla
+will attempt to complete the username, listing any ambiguous matches.
+<P>
+The completion binding is implemented using the
+<B>cpl_word_completions()</B> function, which is also available
+separately to users of this library. See the
+<B><A HREF="cpl_complete_word.html">cpl_complete_word</A>(3)</B> man page for more details.
+<P>
+<A NAME="lbAG"> </A>
+<H2>FILENAME EXPANSION</H2>
+
+<P>
+With the default key bindings, pressing <B>^X*</B> causes Tecla to
+expand the filename that precedes the cursor, replacing <B>~/</B> and
+<B>~user/</B> expressions with the corresponding home directories, and
+replacing <B>$envvar</B> expressions with the value of the specified
+environment variable, then if there are any wildcards, replacing the
+so far expanded filename with a space-separated list of the files
+which match the wild cards.
+<P>
+The expansion binding is implemented using the <B>ef_expand_file()</B> function.
+See the <B><A HREF="ef_expand_file.html">ef_expand_file</A>(3)</B> man page for more details.
+<P>
+<A NAME="lbAH"> </A>
+<H2>RECALLING PREVIOUSLY TYPED LINES</H2>
+
+<P>
+Every time that a new line is entered by the user, it is appended to a
+list of historical input lines maintained within the GetLine resource
+object. You can traverse up and down this list using the up and down
+arrow keys. Alternatively, you can do the same with the <B>^P</B>, and
+<B>^N</B> keys, and in vi command mode you can alternatively use the k
+and j characters. Thus pressing up-arrow once, replaces the current
+input line with the previously entered line. Pressing up-arrow again,
+replaces this with the line that was entered before it, etc.. Having
+gone back one or more lines into the history list, one can return to
+newer lines by pressing down-arrow one or more times. If you do this
+sufficient times, you will return to the original line that you were
+entering when you first hit up-arrow.
+<P>
+Note that in vi mode, all of the history recall functions switch the
+library into command mode.
+<P>
+In emacs mode the <B>M-p</B> and <B>M-n</B> keys work just like the
+<B>^P</B> and <B>^N</B> keys, except that they skip all but those
+historical lines which share the prefix that precedes the cursor. In
+vi command mode the upper case <B>K</B> and <B>J</B> characters do the
+same thing, except that the string that they search for includes the
+character under the cursor as well as what precedes it.
+<P>
+Thus for example, suppose that you were in emacs mode, and you had
+just entered the following list of commands in the order shown:
+<P>
+<PRE>
+ ls ~/tecla/
+ cd ~/tecla
+ ls -l getline.c
+ emacs ~/tecla/getline.c
+</PRE>
+
+<P>
+If you next typed:
+<P>
+<PRE>
+ ls
+</PRE>
+
+<P>
+and then hit <B>M-p</B>, then rather than returning the previously
+typed emacs line, which doesn't start with "ls", Tecla
+would recall the "ls -l getline.c" line. Pressing <B>M-p</B> again
+would recall the "ls ~/tecla/" line.
+<P>
+Note that if the string that you are searching for, contains any of
+the special characters, *, ?, or '[', then it is interpretted as a
+pattern to be matched. Thus, cotinuing with the above example, after
+typing in the list of commands shown, if you then typed:
+<P>
+<PRE>
+ *tecla*
+</PRE>
+
+<P>
+and hit <B>M-p</B>, then the "emacs ~/tecla/getline.c" line would be
+recalled first, since it contains the word tecla somewhere in the
+line, Similarly, hitting <B>M-p</B> again, would recall the "ls
+~/tecla/" line, and hitting it once more would recall the "ls
+~/tecla/" line. The pattern syntax is the same as that described for
+filename expansion, in the <B>ef_expand_file(3</B> man
+page.
+<P>
+<A NAME="lbAI"> </A>
+<H2>HISTORY FILES</H2>
+
+<P>
+Authors of programs that use the Tecla library have the option of
+saving historical command-lines in a file before exiting, and
+subsequently reading them back in from this file when the program is
+next started. There is no standard name for this file, since it makes
+sense for each application to use its own history file, so that
+commands from different applications don't get mixed up.
+<P>
+<A NAME="lbAJ"> </A>
+<H2>INTERNATIONAL CHARACTER SETS</H2>
+
+<P>
+Since libtecla version 1.4.0, Tecla has been 8-bit clean. This means
+that all 8-bit characters that are printable in the user's current
+locale are now displayed verbatim and included in the returned input
+line. Assuming that the calling program correctly contains a call
+like the following,
+<P>
+<PRE>
+ setlocale(LC_CTYPE, "");
+</PRE>
+
+<P>
+then the current locale is determined by the first of the environment
+variables <B>LC_CTYPE</B>, <B>LC_ALL</B>, and <B>LANG</B>, that is found
+to contain a valid locale name. If none of these variables are
+defined, or the program neglects to call setlocale, then the default
+<B>C</B> locale is used, which is US 7-bit ASCII. On most unix-like
+platforms, you can get a list of valid locales by typing the command:
+<P>
+<PRE>
+ locale -a
+</PRE>
+
+<P>
+at the shell prompt.
+<P>
+<A NAME="lbAK"> </A>
+<H3>Meta keys and locales</H3>
+
+<P>
+Beware that in most locales other than the default C locale, meta
+characters become printable, and they are then no longer considered to
+match <B>M-c</B> style key bindings. This allows international
+characters to be entered with the compose key without unexpectedly
+triggering meta key bindings. You can still invoke meta bindings,
+since there are actually two ways to do this. For example the binding
+<B>M-c</B> can also be invoked by pressing the escape key momentarily,
+then pressing the <B>c</B> key, and this will work regardless of
+locale. Moreover, many modern terminal emulators, such as gnome's
+gnome-terminal's and KDE's konsole terminals, already generate escape
+pairs like this when you use the meta key, rather than a real meta
+character, and other emulators usually have a way to request this
+behavior, so you can continue to use the meta key on most systems.
+<P>
+For example, although xterm terminal emulators generate real 8-bit
+meta characters by default when you use the meta key, they can be
+configured to output the equivalent escape pair by setting their
+<B>EightBitInput</B> X resource to <B>False</B>. You can either do this
+by placing a line like the following in your <B>~/.Xdefaults</B> file,
+<P>
+<PRE>
+ XTerm*EightBitInput: False
+
+</PRE>
+
+or by starting an xterm with an <B>-xrm '*EightBitInput: False'</B>
+command-line argument. In recent versions of xterm you can toggle this
+feature on and off with the <B>"Meta Sends Escape"</B> option in the
+menu that is displayed when you press the left mouse button and the
+control key within an xterm window. In CDE, dtterms can be similarly
+coerced to generate escape pairs in place of meta characters, by
+setting the <B>Dtterm*KshMode</B> resource to <B>True</B>.
+<P>
+<A NAME="lbAL"> </A>
+<H3>Entering international characters</H3>
+
+<P>
+If you don't have a keyboard that generates all of the
+international characters that you need, there is usually a
+compose key that will allow you to enter special characters,
+or a way to create one. For example, under X windows on
+unix-like systems, if your keyboard doesn't have a compose
+key, you can designate a redundant key to serve this purpose
+with the xmodmap command. For example, on many PC keyboards
+there is a microsoft-windows key, which is otherwise useless
+under Linux. On my laptop the <B>xev</B> program reports that
+pressing this key generates keycode 115, so to turn this key
+into a compose key, I do the following:
+<P>
+<PRE>
+ xmodmap -e 'keycode 115 = Multi_key'
+</PRE>
+
+<P>
+I can then enter an i with a umlaut over it by typing this key,
+followed by <B>"</B>, followed by i.
+<P>
+<A NAME="lbAM"> </A>
+<H2>THE AVAILABLE KEY BINDING FUNCTIONS</H2>
+
+<P>
+The following is a list of the editing functions provided by the Tecla
+library. The names in the leftmost column of the list can be used in
+configuration files to specify which function a given key or
+combination of keys should invoke. They are also used in the next two
+sections to list the default key-bindings in emacs and vi modes.
+<P>
+<PRE>
+ user-interrupt - Send a SIGINT signal to the
+ parent process.
+ abort - Send a SIGABRT signal to the
+ parent process.
+ suspend - Suspend the parent process.
+ stop-output - Pause terminal output.
+ start-output - Resume paused terminal output.
+ literal-next - Arrange for the next character
+ to be treated as a normal
+ character. This allows control
+ characters to be entered.
+ cursor-right - Move the cursor one character
+ right.
+ cursor-left - Move the cursor one character
+ left.
+ insert-mode - Toggle between insert mode and
+ overwrite mode.
+ beginning-of-line - Move the cursor to the
+ beginning of the line.
+ end-of-line - Move the cursor to the end of
+ the line.
+ delete-line - Delete the contents of the
+ current line.
+ kill-line - Delete everything that follows
+ the cursor.
+ backward-kill-line - Delete all characters between
+ the cursor and the start of the
+ line.
+ forward-word - Move to the end of the word
+ which follows the cursor.
+ forward-to-word - Move the cursor to the start of
+ the word that follows the
+ cursor.
+ backward-word - Move to the start of the word
+ which precedes the cursor.
+ goto-column - Move the cursor to the
+ 1-relative column in the line
+ specified by any preceding
+ digit-argument sequences (see
+ ENTERING REPEAT COUNTS below).
+ find-parenthesis - If the cursor is currently
+ over a parenthesis character,
+ move it to the matching
+ parenthesis character. If not
+ over a parenthesis character
+ move right to the next close
+ parenthesis.
+ forward-delete-char - Delete the character under the
+ cursor.
+ backward-delete-char - Delete the character which
+ precedes the cursor.
+ list-or-eof - This is intended for binding
+ to ^D. When invoked when the
+ cursor is within the line it
+ displays all possible
+ completions then redisplays
+ the line unchanged. When
+ invoked on an empty line, it
+ signals end-of-input (EOF) to
+ the caller of gl_get_line().
+ del-char-or-list-or-eof - This is intended for binding
+ to ^D. When invoked when the
+ cursor is within the line it
+ invokes forward-delete-char.
+ When invoked at the end of the
+ line it displays all possible
+ completions then redisplays
+ the line unchanged. When
+ invoked on an empty line, it
+ signals end-of-input (EOF) to
+ the caller of gl_get_line().
+ forward-delete-word - Delete the word which follows
+ the cursor.
+ backward-delete-word - Delete the word which precedes
+ the cursor.
+ upcase-word - Convert all of the characters
+ of the word which follows the
+ cursor, to upper case.
+ downcase-word - Convert all of the characters
+ of the word which follows the
+ cursor, to lower case.
+ capitalize-word - Capitalize the word which
+ follows the cursor.
+ change-case - If the next character is upper
+ case, toggle it to lower case
+ and vice versa.
+ redisplay - Redisplay the line.
+ clear-screen - Clear the terminal, then
+ redisplay the current line.
+ transpose-chars - Swap the character under the
+ cursor with the character just
+ before the cursor.
+ set-mark - Set a mark at the position of
+ the cursor.
+ exchange-point-and-mark - Move the cursor to the last
+ mark that was set, and move
+ the mark to where the cursor
+ used to be.
+ kill-region - Delete the characters that lie
+ between the last mark that was
+ set, and the cursor.
+ copy-region-as-kill - Copy the text between the mark
+ and the cursor to the cut
+ buffer, without deleting the
+ original text.
+ yank - Insert the text that was last
+ deleted, just before the
+ current position of the cursor.
+ append-yank - Paste the current contents of
+ the cut buffer, after the
+ cursor.
+ up-history - Recall the next oldest line
+ that was entered. Note that
+ in vi mode you are left in
+ command mode.
+ down-history - Recall the next most recent
+ line that was entered. If no
+ history recall session is
+ currently active, the next
+ line from a previous recall
+ session is recalled. Note that
+ in vi mode you are left in
+ command mode.
+ history-search-backward - Recall the next oldest line
+ who's prefix matches the string
+ which currently precedes the
+ cursor (in vi command-mode the
+ character under the cursor is
+ also included in the search
+ string). Note that in vi mode
+ you are left in command mode.
+ history-search-forward - Recall the next newest line
+ who's prefix matches the string
+ which currently precedes the
+ cursor (in vi command-mode the
+ character under the cursor is
+ also included in the search
+ string). Note that in vi mode
+ you are left in command mode.
+ history-re-search-backward -Recall the next oldest line
+ who's prefix matches that
+ established by the last
+ invocation of either
+ history-search-forward or
+ history-search-backward.
+ history-re-search-forward - Recall the next newest line
+ who's prefix matches that
+ established by the last
+ invocation of either
+ history-search-forward or
+ history-search-backward.
+ complete-word - Attempt to complete the
+ incomplete word which
+ precedes the cursor. Unless
+ the host program has customized
+ word completion, filename
+ completion is attempted. In vi
+ commmand mode the character
+ under the cursor is also
+ included in the word being
+ completed, and you are left in
+ vi insert mode.
+ expand-filename - Within the command line, expand
+ wild cards, tilde expressions
+ and dollar expressions in the
+ filename which immediately
+ precedes the cursor. In vi
+ commmand mode the character
+ under the cursor is also
+ included in the filename being
+ expanded, and you are left in
+ vi insert mode.
+ list-glob - List any filenames which match
+ the wild-card, tilde and dollar
+ expressions in the filename
+ which immediately precedes the
+ cursor, then redraw the input
+ line unchanged.
+ list-history - Display the contents of the
+ history list for the current
+ history group. If a repeat
+ count of > 1 is specified,
+ only that many of the most
+ recent lines are displayed.
+ See the "ENTERING REPEAT
+ COUNTS" section.
+ read-from-file - Temporarily switch to reading
+ input from the file who's
+ name precedes the cursor.
+ read-init-files - Re-read teclarc configuration
+ files.
+ beginning-of-history - Move to the oldest line in the
+ history list. Note that in vi
+ mode you are left in command
+ mode.
+ end-of-history - Move to the newest line in the
+ history list (ie. the current
+ line). Note that in vi mode
+ this leaves you in command
+ mode.
+ digit-argument - Enter a repeat count for the
+ next key-binding function.
+ For details, see the ENTERING
+ REPEAT COUNTS section.
+ newline - Terminate and return the
+ current contents of the
+ line, after appending a
+ newline character. The newline
+ character is normally '\n',
+ but will be the first
+ character of the key-sequence
+ that invoked the newline
+ action, if this happens to be
+ a printable character. If the
+ action was invoked by the
+ '\n' newline character or the
+ '\r' carriage return
+ character, the line is
+ appended to the history
+ buffer.
+ repeat-history - Return the line that is being
+ edited, then arrange for the
+ next most recent entry in the
+ history buffer to be recalled
+ when Tecla is next called.
+ Repeatedly invoking this
+ action causes successive
+ historical input lines to be
+ re-executed. Note that this
+ action is equivalent to the
+ 'Operate' action in ksh.
+ ring-bell - Ring the terminal bell, unless
+ the bell has been silenced via
+ the <B>nobeep</B> configuration
+ option (see the THE TECLA
+ CONFIGURATION FILE section).
+ forward-copy-char - Copy the next character into
+ the cut buffer (NB. use repeat
+ counts to copy more than one).
+ backward-copy-char - Copy the previous character
+ into the cut buffer.
+ forward-copy-word - Copy the next word into the cut
+ buffer.
+ backward-copy-word - Copy the previous word into the
+ cut buffer.
+ forward-find-char - Move the cursor to the next
+ occurrence of the next
+ character that you type.
+ backward-find-char - Move the cursor to the last
+ occurrence of the next
+ character that you type.
+ forward-to-char - Move the cursor to the
+ character just before the next
+ occurrence of the next
+ character that the user types.
+ backward-to-char - Move the cursor to the
+ character just after the last
+ occurrence before the cursor
+ of the next character that the
+ user types.
+ repeat-find-char - Repeat the last
+ backward-find-char,
+ forward-find-char,
+ backward-to-char or
+ forward-to-char.
+ invert-refind-char - Repeat the last
+ backward-find-char,
+ forward-find-char,
+ backward-to-char, or
+ forward-to-char in the
+ opposite direction.
+ delete-to-column - Delete the characters from the
+ cursor up to the column that
+ is specified by the repeat
+ count.
+ delete-to-parenthesis - Delete the characters from the
+ cursor up to and including
+ the matching parenthesis, or
+ next close parenthesis.
+ forward-delete-find - Delete the characters from the
+ cursor up to and including the
+ following occurence of the
+ next character typed.
+ backward-delete-find - Delete the characters from the
+ cursor up to and including the
+ preceding occurence of the
+ next character typed.
+ forward-delete-to - Delete the characters from the
+ cursor up to, but not
+ including, the following
+ occurence of the next
+ character typed.
+ backward-delete-to - Delete the characters from the
+ cursor up to, but not
+ including, the preceding
+ occurence of the next
+ character typed.
+ delete-refind - Repeat the last *-delete-find
+ or *-delete-to action.
+ delete-invert-refind - Repeat the last *-delete-find
+ or *-delete-to action, in the
+ opposite direction.
+ copy-to-column - Copy the characters from the
+ cursor up to the column that
+ is specified by the repeat
+ count, into the cut buffer.
+ copy-to-parenthesis - Copy the characters from the
+ cursor up to and including
+ the matching parenthesis, or
+ next close parenthesis, into
+ the cut buffer.
+ forward-copy-find - Copy the characters from the
+ cursor up to and including the
+ following occurence of the
+ next character typed, into the
+ cut buffer.
+ backward-copy-find - Copy the characters from the
+ cursor up to and including the
+ preceding occurence of the
+ next character typed, into the
+ cut buffer.
+ forward-copy-to - Copy the characters from the
+ cursor up to, but not
+ including, the following
+ occurence of the next
+ character typed, into the cut
+ buffer.
+ backward-copy-to - Copy the characters from the
+ cursor up to, but not
+ including, the preceding
+ occurence of the next
+ character typed, into the cut
+ buffer.
+ copy-refind - Repeat the last *-copy-find
+ or *-copy-to action.
+ copy-invert-refind - Repeat the last *-copy-find
+ or *-copy-to action, in the
+ opposite direction.
+ vi-mode - Switch to vi mode from emacs
+ mode.
+ emacs-mode - Switch to emacs mode from vi
+ mode.
+ vi-insert - From vi command mode, switch to
+ insert mode.
+ vi-overwrite - From vi command mode, switch to
+ overwrite mode.
+ vi-insert-at-bol - From vi command mode, move the
+ cursor to the start of the line
+ and switch to insert mode.
+ vi-append-at-eol - From vi command mode, move the
+ cursor to the end of the line
+ and switch to append mode.
+ vi-append - From vi command mode, move the
+ cursor one position right, and
+ switch to insert mode.
+ vi-replace-char - From vi command mode, replace
+ the character under the cursor
+ with the the next character
+ entered.
+ vi-forward-change-char - From vi command mode, delete
+ the next character then enter
+ insert mode.
+ vi-backward-change-char - From vi command mode, delete
+ the preceding character then
+ enter insert mode.
+ vi-forward-change-word - From vi command mode, delete
+ the next word then enter
+ insert mode.
+ vi-backward-change-word - From vi command mode, delete
+ the preceding word then
+ enter insert mode.
+ vi-change-rest-of-line - From vi command mode, delete
+ from the cursor to the end of
+ the line, then enter insert
+ mode.
+ vi-change-line - From vi command mode, delete
+ the current line, then enter
+ insert mode.
+ vi-change-to-bol - From vi command mode, delete
+ all characters between the
+ cursor and the beginning of
+ the line, then enter insert
+ mode.
+ vi-change-to-column - From vi command mode, delete
+ the characters from the cursor
+ up to the column that is
+ specified by the repeat count,
+ then enter insert mode.
+ vi-change-to-parenthesis - Delete the characters from the
+ cursor up to and including
+ the matching parenthesis, or
+ next close parenthesis, then
+ enter vi insert mode.
+ vi-forward-change-find - From vi command mode, delete
+ the characters from the
+ cursor up to and including the
+ following occurence of the
+ next character typed, then
+ enter insert mode.
+ vi-backward-change-find - From vi command mode, delete
+ the characters from the
+ cursor up to and including the
+ preceding occurence of the
+ next character typed, then
+ enter insert mode.
+ vi-forward-change-to - From vi command mode, delete
+ the characters from the
+ cursor up to, but not
+ including, the following
+ occurence of the next
+ character typed, then enter
+ insert mode.
+ vi-backward-change-to - From vi command mode, delete
+ the characters from the
+ cursor up to, but not
+ including, the preceding
+ occurence of the next
+ character typed, then enter
+ insert mode.
+ vi-change-refind - Repeat the last
+ vi-*-change-find or
+ vi-*-change-to action.
+ vi-change-invert-refind - Repeat the last
+ vi-*-change-find or
+ vi-*-change-to action, in the
+ opposite direction.
+ vi-undo - In vi mode, undo the last
+ editing operation.
+ vi-repeat-change - In vi command mode, repeat the
+ last command that modified the
+ line.
+</PRE>
+
+<P>
+<A NAME="lbAN"> </A>
+<H2>DEFAULT KEY BINDINGS IN EMACS MODE</H2>
+
+<P>
+The following default key bindings, which can be overriden by
+the Tecla configuration file, are designed to mimic most of
+the bindings of the unix <B>tcsh</B> shell, when it is in
+emacs editing mode.
+<P>
+This is the default editing mode of the Tecla library.
+<P>
+Under UNIX the terminal driver sets a number of special keys for certain
+functions. The tecla library attempts to use the same keybindings to maintain
+consistency. The key sequences shown for the following 6 bindings are thus just
+examples of what they will probably be set to. If you have used the <B>stty</B>
+command to change these keys, then the default bindings should match.
+<P>
+<PRE>
+ ^C -> user-interrupt
+ ^\ -> abort
+ ^Z -> suspend
+ ^Q -> start-output
+ ^S -> stop-output
+ ^V -> literal-next
+</PRE>
+
+<P>
+The cursor keys are refered to by name, as follows. This is necessary
+because different types of terminals generate different key sequences
+when their cursor keys are pressed.
+<P>
+<BR> right -> cursor-right
+<BR> left -> cursor-left
+<BR> up -> up-history
+<BR> down -> down-history
+<P>
+The remaining bindings don't depend on the terminal setttings.
+<P>
+<PRE>
+ ^F -> cursor-right
+ ^B -> cursor-left
+ M-i -> insert-mode
+ ^A -> beginning-of-line
+ ^E -> end-of-line
+ ^U -> delete-line
+ ^K -> kill-line
+ M-f -> forward-word
+ M-b -> backward-word
+ ^D -> del-char-or-list-or-eof
+ ^H -> backward-delete-char
+ ^? -> backward-delete-char
+ M-d -> forward-delete-word
+ M-^H -> backward-delete-word
+ M-^? -> backward-delete-word
+ M-u -> upcase-word
+ M-l -> downcase-word
+ M-c -> capitalize-word
+ ^R -> redisplay
+ ^L -> clear-screen
+ ^T -> transpose-chars
+ ^@ -> set-mark
+ ^X^X -> exchange-point-and-mark
+ ^W -> kill-region
+ M-w -> copy-region-as-kill
+ ^Y -> yank
+ ^P -> up-history
+ ^N -> down-history
+ M-p -> history-search-backward
+ M-n -> history-search-forward
+ ^I -> complete-word
+ ^X* -> expand-filename
+ ^X^F -> read-from-file
+ ^X^R -> read-init-files
+ ^Xg -> list-glob
+ ^Xh -> list-history
+ M-< -> beginning-of-history
+ M-> -> end-of-history
+ \n -> newline
+ \r -> newline
+ M-o -> repeat-history
+ M-^V -> vi-mode
+
+ M-0, M-1, ... M-9 -> digit-argument (see below)
+</PRE>
+
+<P>
+Note that <B>^I</B> is what the TAB key generates, and that <B>^@</B>
+can be generated not only by pressing the control key and the <B>@</B>
+key simultaneously, but also by pressing the control key and the space
+bar at the same time.
+<P>
+<A NAME="lbAO"> </A>
+<H2>DEFAULT KEY BINDINGS IN VI MODE</H2>
+
+<P>
+The following default key bindings are designed to mimic the
+vi style of editing as closely as possible. This means that
+very few editing functions are provided in the initial
+character input mode, editing functions instead being
+provided by the vi command mode. Vi command mode is entered
+whenever the escape character is pressed, or whenever a
+key-sequence that starts with a meta character is entered. In
+addition to mimicing vi, libtecla provides bindings for tab
+completion, wild-card expansion of file names, and historical
+line recall.
+<P>
+To learn how to tell the Tecla library to use vi mode instead
+of the default emacs editing mode, see the earlier section entitled
+THE TECLA CONFIGURATION FILE.
+<P>
+Under UNIX the terminal driver sets a number of special keys
+for certain functions. The Tecla library attempts to use the
+same keybindings to maintain consistency, binding them both
+in input mode and in command mode. The key sequences shown
+for the following 6 bindings are thus just examples of what
+they will probably be set to. If you have used the <B>stty</B>
+command to change these keys, then the default bindings
+should match.
+<P>
+<PRE>
+ ^C -> user-interrupt
+ ^\ -> abort
+ ^Z -> suspend
+ ^Q -> start-output
+ ^S -> stop-output
+ ^V -> literal-next
+ M-^C -> user-interrupt
+ M-^\ -> abort
+ M-^Z -> suspend
+ M-^Q -> start-output
+ M-^S -> stop-output
+</PRE>
+
+<P>
+Note that above, most of the bindings are defined twice, once
+as a raw control code like <B>^C</B> and then a second time as
+a meta character like <B>M-^C</B>. The former is the binding
+for vi input mode, whereas the latter is the binding for vi
+command mode. Once in command mode all key-sequences that the
+user types that they don't explicitly start with an escape or
+a meta key, have their first key secretly converted to a meta
+character before the key sequence is looked up in the key
+binding table. Thus, once in command mode, when you type the
+letter <B>i</B>, for example, the Tecla library actually looks
+up the binding for <B>M-i</B>.
+<P>
+The cursor keys are refered to by name, as follows. This is necessary
+because different types of terminals generate different key sequences
+when their cursor keys are pressed.
+<P>
+<BR> right -> cursor-right
+<BR> left -> cursor-left
+<BR> up -> up-history
+<BR> down -> down-history
+<P>
+The cursor keys normally generate a keysequence that start
+with an escape character, so beware that using the arrow keys
+will put you into command mode (if you aren't already in
+command mode).
+<P>
+The following are the terminal-independent key bindings for vi input
+mode.
+<P>
+<PRE>
+ ^D -> list-or-eof
+ ^G -> list-glob
+ ^H -> backward-delete-char
+ ^I -> complete-word
+ \r -> newline
+ \n -> newline
+ ^L -> clear-screen
+ ^N -> down-history
+ ^P -> up-history
+ ^R -> redisplay
+ ^U -> backward-kill-line
+ ^W -> backward-delete-word
+ ^X* -> expand-filename
+ ^X^F -> read-from-file
+ ^X^R -> read-init-files
+ ^? -> backward-delete-char
+</PRE>
+
+<P>
+The following are the key bindings that are defined in vi
+command mode, this being specified by them all starting with
+a meta character. As mentioned above, once in command mode
+the initial meta character is optional. For example, you
+might enter command mode by typing Esc, and then press h
+twice to move the cursor two positions to the left. Both h
+characters get quietly converted to M-h before being compared
+to the key-binding table, the first one because Escape
+followed by a character is always converted to the equivalent
+meta character, and the second because command mode was
+already active.
+<P>
+<PRE>
+ M-\ -> cursor-right (Meta-space)
+ M-$ -> end-of-line
+ M-* -> expand-filename
+ M-+ -> down-history
+ M-- -> up-history
+ M-< -> beginning-of-history
+ M-> -> end-of-history
+ M-^ -> beginning-of-line
+ M-; -> repeat-find-char
+ M-, -> invert-refind-char
+ M-| -> goto-column
+ M-~ -> change-case
+ M-. -> vi-repeat-change
+ M-% -> find-parenthesis
+ M-a -> vi-append
+ M-A -> vi-append-at-eol
+ M-b -> backward-word
+ M-B -> backward-word
+ M-C -> vi-change-rest-of-line
+ M-cb -> vi-backward-change-word
+ M-cB -> vi-backward-change-word
+ M-cc -> vi-change-line
+ M-ce -> vi-forward-change-word
+ M-cE -> vi-forward-change-word
+ M-cw -> vi-forward-change-word
+ M-cW -> vi-forward-change-word
+ M-cF -> vi-backward-change-find
+ M-cf -> vi-forward-change-find
+ M-cT -> vi-backward-change-to
+ M-ct -> vi-forward-change-to
+ M-c; -> vi-change-refind
+ M-c, -> vi-change-invert-refind
+ M-ch -> vi-backward-change-char
+ M-c^H -> vi-backward-change-char
+ M-c^? -> vi-backward-change-char
+ M-cl -> vi-forward-change-char
+ M-c\ -> vi-forward-change-char (Meta-c-space)
+ M-c^ -> vi-change-to-bol
+ M-c0 -> vi-change-to-bol
+ M-c$ -> vi-change-rest-of-line
+ M-c| -> vi-change-to-column
+ M-c% -> vi-change-to-parenthesis
+ M-dh -> backward-delete-char
+ M-d^H -> backward-delete-char
+ M-d^? -> backward-delete-char
+ M-dl -> forward-delete-char
+ M-d -> forward-delete-char (Meta-d-space)
+ M-dd -> delete-line
+ M-db -> backward-delete-word
+ M-dB -> backward-delete-word
+ M-de -> forward-delete-word
+ M-dE -> forward-delete-word
+ M-dw -> forward-delete-word
+ M-dW -> forward-delete-word
+ M-dF -> backward-delete-find
+ M-df -> forward-delete-find
+ M-dT -> backward-delete-to
+ M-dt -> forward-delete-to
+ M-d; -> delete-refind
+ M-d, -> delete-invert-refind
+ M-d^ -> backward-kill-line
+ M-d0 -> backward-kill-line
+ M-d$ -> kill-line
+ M-D -> kill-line
+ M-d| -> delete-to-column
+ M-d% -> delete-to-parenthesis
+ M-e -> forward-word
+ M-E -> forward-word
+ M-f -> forward-find-char
+ M-F -> backward-find-char
+ M-- -> up-history
+ M-h -> cursor-left
+ M-H -> beginning-of-history
+ M-i -> vi-insert
+ M-I -> vi-insert-at-bol
+ M-j -> down-history
+ M-J -> history-search-forward
+ M-k -> up-history
+ M-K -> history-search-backward
+ M-l -> cursor-right
+ M-L -> end-of-history
+ M-n -> history-re-search-forward
+ M-N -> history-re-search-backward
+ M-p -> append-yank
+ M-P -> yank
+ M-r -> vi-replace-char
+ M-R -> vi-overwrite
+ M-s -> vi-forward-change-char
+ M-S -> vi-change-line
+ M-t -> forward-to-char
+ M-T -> backward-to-char
+ M-u -> vi-undo
+ M-w -> forward-to-word
+ M-W -> forward-to-word
+ M-x -> forward-delete-char
+ M-X -> backward-delete-char
+ M-yh -> backward-copy-char
+ M-y^H -> backward-copy-char
+ M-y^? -> backward-copy-char
+ M-yl -> forward-copy-char
+ M-y\ -> forward-copy-char (Meta-y-space)
+ M-ye -> forward-copy-word
+ M-yE -> forward-copy-word
+ M-yw -> forward-copy-word
+ M-yW -> forward-copy-word
+ M-yb -> backward-copy-word
+ M-yB -> backward-copy-word
+ M-yf -> forward-copy-find
+ M-yF -> backward-copy-find
+ M-yt -> forward-copy-to
+ M-yT -> backward-copy-to
+ M-y; -> copy-refind
+ M-y, -> copy-invert-refind
+ M-y^ -> copy-to-bol
+ M-y0 -> copy-to-bol
+ M-y$ -> copy-rest-of-line
+ M-yy -> copy-line
+ M-Y -> copy-line
+ M-y| -> copy-to-column
+ M-y% -> copy-to-parenthesis
+ M-^E -> emacs-mode
+ M-^H -> cursor-left
+ M-^? -> cursor-left
+ M-^L -> clear-screen
+ M-^N -> down-history
+ M-^P -> up-history
+ M-^R -> redisplay
+ M-^D -> list-or-eof
+ M-^I -> complete-word
+ M-\r -> newline
+ M-\n -> newline
+ M-^X^R -> read-init-files
+ M-^Xh -> list-history
+
+ M-0, M-1, ... M-9 -> digit-argument (see below)
+</PRE>
+
+<P>
+Note that <B>^I</B> is what the TAB key generates.
+<P>
+<A NAME="lbAP"> </A>
+<H2>ENTERING REPEAT COUNTS</H2>
+
+<P>
+Many of the key binding functions described previously, take an
+optional count, typed in before the target keysequence. This is
+interpreted as a repeat count by most bindings. A notable exception is
+the goto-column binding, which interprets the count as a column
+number.
+<P>
+By default you can specify this count argument by pressing the meta
+key while typing in the numeric count. This relies on the
+<B>digit-argument</B> action being bound to Meta-0, Meta-1 etc. Once
+any one of these bindings has been activated, you can optionally take
+your finger off the meta key to type in the rest of the number, since
+every numeric digit thereafter is treated as part of the number,
+unless it is preceded by the <B>literal-next</B> binding. As soon as a
+non-digit, or literal digit key is pressed the repeat count is
+terminated and either causes the just typed character to be added to
+the line that many times, or causes the next key-binding function to
+be given that argument.
+<P>
+For example, in emacs mode, typing:
+<P>
+<PRE>
+ M-12a
+</PRE>
+
+<P>
+causes the letter 'a' to be added to the line 12 times,
+whereas
+<P>
+<PRE>
+ M-4M-c
+</PRE>
+
+<P>
+Capitalizes the next 4 words.
+<P>
+In vi command mode the Meta modifier is automatically added to all
+characters typed in, so to enter a count in vi command-mode, just
+involves typing in the number, just as it does in the vi editor
+itself. So for example, in vi command mode, typing:
+<P>
+<PRE>
+ 4w2x
+</PRE>
+
+<P>
+moves the cursor four words to the right, then deletes two characters.
+<P>
+You can also bind <B>digit-argument</B> to other key sequences. If
+these end in a numeric digit, that digit gets appended to the current
+repeat count. If it doesn't end in a numeric digit, a new repeat count
+is started with a value of zero, and can be completed by typing in the
+number, after letting go of the key which triggered the digit-argument
+action.
+<P>
+<A NAME="lbAQ"> </A>
+<H2>FILES</H2>
+
+<PRE>
+libtecla.a - The Tecla library
+libtecla.h - The Tecla header file.
+~/.teclarc - The personal Tecla customization file.
+</PRE>
+
+<P>
+<A NAME="lbAR"> </A>
+<H2>SEE ALSO</H2>
+
+<P>
+<PRE>
+<A HREF="libtecla.html">libtecla</A>(3), <A HREF="gl_get_line.html">gl_get_line</A>(3), <A HREF="gl_io_mode.html">gl_io_mode</A>(3), <A HREF="ef_expand_file.html">ef_expand_file</A>(3),
+<A HREF="cpl_complete_word.html">cpl_complete_word</A>(3), <A HREF="pca_lookup_file.html">pca_lookup_file</A>(3)
+</PRE>
+
+<BR>
+<A NAME="lbAS"> </A>
+<H2>AUTHOR</H2>
+
+Martin Shepherd (<A HREF="mailto:mcs at astro.caltech.edu">mcs at astro.caltech.edu</A>)
+<P>
+
+<HR>
+<A NAME="index"> </A><H2>Index</H2>
+<DL>
+<DT><A HREF="#lbAB">NAME</A><DD>
+<DT><A HREF="#lbAC">DESCRIPTION</A><DD>
+<DT><A HREF="#lbAD">KEY SEQUENCE NOTATION</A><DD>
+<DT><A HREF="#lbAE">THE TECLA CONFIGURATION FILE</A><DD>
+<DT><A HREF="#lbAF">FILENAME AND TILDE COMPLETION</A><DD>
+<DT><A HREF="#lbAG">FILENAME EXPANSION</A><DD>
+<DT><A HREF="#lbAH">RECALLING PREVIOUSLY TYPED LINES</A><DD>
+<DT><A HREF="#lbAI">HISTORY FILES</A><DD>
+<DT><A HREF="#lbAJ">INTERNATIONAL CHARACTER SETS</A><DD>
+<DL>
+<DT><A HREF="#lbAK">Meta keys and locales</A><DD>
+<DT><A HREF="#lbAL">Entering international characters</A><DD>
+</DL>
+<DT><A HREF="#lbAM">THE AVAILABLE KEY BINDING FUNCTIONS</A><DD>
+<DT><A HREF="#lbAN">DEFAULT KEY BINDINGS IN EMACS MODE</A><DD>
+<DT><A HREF="#lbAO">DEFAULT KEY BINDINGS IN VI MODE</A><DD>
+<DT><A HREF="#lbAP">ENTERING REPEAT COUNTS</A><DD>
+<DT><A HREF="#lbAQ">FILES</A><DD>
+<DT><A HREF="#lbAR">SEE ALSO</A><DD>
+<DT><A HREF="#lbAS">AUTHOR</A><DD>
+</DL>
+<HR>
+This document was created by
+<A HREF="/cgi-bin/man/man2html">man2html</A>,
+using the manual pages.<BR>
+Time: 03:25:06 GMT, June 12, 2012
+</BODY>
+</HTML>
diff --git a/ioutil.c b/ioutil.c
index daf02c9..3d002c7 100644
--- a/ioutil.c
+++ b/ioutil.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd.
+ * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd.
*
* All rights reserved.
*
diff --git a/ioutil.h b/ioutil.h
index b9e8f16..dfa5f08 100644
--- a/ioutil.h
+++ b/ioutil.h
@@ -2,7 +2,7 @@
#define ioutil_h
/*
- * Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd.
+ * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd.
*
* All rights reserved.
*
diff --git a/keytab.c b/keytab.c
index 0820960..eacef8a 100644
--- a/keytab.c
+++ b/keytab.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd.
+ * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd.
*
* All rights reserved.
*
diff --git a/keytab.h b/keytab.h
index b275c98..25556e0 100644
--- a/keytab.h
+++ b/keytab.h
@@ -2,7 +2,7 @@
#define keytab_h
/*
- * Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd.
+ * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd.
*
* All rights reserved.
*
diff --git a/libtecla.h b/libtecla.h
index fbbf220..6c5c739 100644
--- a/libtecla.h
+++ b/libtecla.h
@@ -2,7 +2,7 @@
#define libtecla_h
/*
- * Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd.
+ * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd.
*
* All rights reserved.
*
@@ -51,7 +51,7 @@ extern "C" {
*/
#define TECLA_MAJOR_VER 1
#define TECLA_MINOR_VER 6
-#define TECLA_MICRO_VER 1
+#define TECLA_MICRO_VER 2
/*.......................................................................
* Query the version number of the tecla library.
diff --git a/man/func/cpl_complete_word.in b/man/func/cpl_complete_word.in
index d5331e9..2479657 100644
--- a/man/func/cpl_complete_word.in
+++ b/man/func/cpl_complete_word.in
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd
+.\" Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd
.\"
.\" All rights reserved.
.\"
diff --git a/man/func/ef_expand_file.in b/man/func/ef_expand_file.in
index f23f3eb..6637f9f 100644
--- a/man/func/ef_expand_file.in
+++ b/man/func/ef_expand_file.in
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd
+.\" Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd
.\"
.\" All rights reserved.
.\"
diff --git a/man/func/gl_get_line.in b/man/func/gl_get_line.in
index 1995108..ba0df8d 100644
--- a/man/func/gl_get_line.in
+++ b/man/func/gl_get_line.in
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd
+.\" Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd
.\"
.\" All rights reserved.
.\"
diff --git a/man/func/gl_io_mode.in b/man/func/gl_io_mode.in
index 5789666..0bcca8b 100644
--- a/man/func/gl_io_mode.in
+++ b/man/func/gl_io_mode.in
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2002, 2003, 2004 by Martin C. Shepherd
+.\" Copyright (c) 2002, 2003, 2004, 2012 by Martin C. Shepherd
.\"
.\" All rights reserved.
.\"
diff --git a/man/func/pca_lookup_file.in b/man/func/pca_lookup_file.in
index 861d205..e74114a 100644
--- a/man/func/pca_lookup_file.in
+++ b/man/func/pca_lookup_file.in
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2001, 2002, 2003, 2004 by Martin C. Shepherd
+.\" Copyright (c) 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd
.\"
.\" All rights reserved.
.\"
diff --git a/man/libr/libtecla.in b/man/libr/libtecla.in
index 9f9aa75..4c600a8 100644
--- a/man/libr/libtecla.in
+++ b/man/libr/libtecla.in
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd
+.\" Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd
.\"
.\" All rights reserved.
.\"
diff --git a/man/misc/tecla.in b/man/misc/tecla.in
index 1be2902..567a810 100644
--- a/man/misc/tecla.in
+++ b/man/misc/tecla.in
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd
+.\" Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd
.\"
.\" All rights reserved.
.\"
@@ -194,7 +194,7 @@ will attempt to complete the username, listing any ambiguous matches.
The completion binding is implemented using the
\f3cpl_word_completions()\f1 function, which is also available
separately to users of this library. See the
-\f3cpl_word_completions(@LIBR_MANEXT@)\f1 man page for more details.
+\f3cpl_complete_word(@LIBR_MANEXT@)\f1 man page for more details.
.SH FILENAME EXPANSION
diff --git a/man/prog/enhance.in b/man/prog/enhance.in
index a5c51a6..aacd8a0 100644
--- a/man/prog/enhance.in
+++ b/man/prog/enhance.in
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd
+.\" Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd
.\"
.\" All rights reserved.
.\"
diff --git a/pathutil.c b/pathutil.c
index 7d3e95c..be14484 100644
--- a/pathutil.c
+++ b/pathutil.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd.
+ * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd.
*
* All rights reserved.
*
diff --git a/pathutil.h b/pathutil.h
index 5454d91..55c9b32 100644
--- a/pathutil.h
+++ b/pathutil.h
@@ -2,7 +2,7 @@
#define pathutil_h
/*
- * Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd.
+ * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd.
*
* All rights reserved.
*
diff --git a/pcache.c b/pcache.c
index 74e4ef5..5a489b3 100644
--- a/pcache.c
+++ b/pcache.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd.
+ * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd.
*
* All rights reserved.
*
diff --git a/stringrp.c b/stringrp.c
index 2d84766..de7369a 100644
--- a/stringrp.c
+++ b/stringrp.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd.
+ * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd.
*
* All rights reserved.
*
diff --git a/stringrp.h b/stringrp.h
index c5fdd3a..94a4922 100644
--- a/stringrp.h
+++ b/stringrp.h
@@ -1,7 +1,7 @@
#ifndef stringrp_h
#define stringrp_h
/*
- * Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd.
+ * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd.
*
* All rights reserved.
*
diff --git a/strngmem.c b/strngmem.c
index c2637ec..5390475 100644
--- a/strngmem.c
+++ b/strngmem.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd.
+ * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd.
*
* All rights reserved.
*
diff --git a/strngmem.h b/strngmem.h
index 9efef09..2138cfb 100644
--- a/strngmem.h
+++ b/strngmem.h
@@ -1,7 +1,7 @@
#ifndef stringmem_h
#define stringmem_h
/*
- * Copyright (c) 2000, 2001, 2002, 2003, 2004 by Martin C. Shepherd.
+ * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2012 by Martin C. Shepherd.
*
* All rights reserved.
*
diff --git a/update_html b/update_html
index 70f189e..b6a5613 100755
--- a/update_html
+++ b/update_html
@@ -7,15 +7,7 @@ for dir in man/prog man/libr man/func man/misc man/file; do
page=`basename "$template" .in`
if [ `wc -l < $template` -gt 1 ]; then
html="html/$page.html"
- man2html $template > $html
- for ref in libtecla cpl_complete_word ef_expand_file gl_get_line pca_lookup_file enhance gl_io_mode tecla; do
- link="$ref.html"
- ed -s $html << EOF
- %s|$ref[(][^)][^) ]*[)]|<a href="$link"><b>$ref</b></a>|g
- w
- q
-EOF
- done
+ man2html -r $dir/$page | sed -s 's/\.\.\/man[0-9]*\///g' | sed -s 's/HREF="\.\.\//HREF="/g' | sed -s 's/\.[0-9][0-9]*\.html/.html/g' > $html
fi
done
done
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/libtecla.git
More information about the debian-med-commit
mailing list