提交 16d6e990 authored 作者: Michal Bielicki's avatar Michal Bielicki

And here the replacement libedit. Fixes some problems on solaris and hopefully…

And here the replacement libedit. Fixes some problems on solaris and hopefully on OpenBSD as well :)


git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7502 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 8cc4b29d
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
2007-08-31 Jess Thrysoee
* version-info: 0:26:0
* libedit.pc.in,Makefile.am,configure.ac,patches/extra_dist_list.sh:
Added pkg-config support for libedit. Patch by Masatake YAMATO.
2007-08-13 Jess Thrysoee
* version-info: 0:25:0
* all: sync with upstream source.
2007-03-02 Jess Thrysoee
* version-info: 0:24:0
* all: sync with upstream source.
2006-10-22 Jess Thrysoee
* version-info: 0:23:0
* src/shlib_version: Upstream bumped minor version from 9 to 10.
* all: sync with upstream source. More readline functions.
2006-10-22 Jess Thrysoee
* version-info: 0:22:0
* all: sync with upstream source.
2006-08-29 Jess Thrysoee
* version-info: 0:21:0
* all: License cleanup. All 4-clause advertising BSD licenses has been
changed to the 3-clause version by upstream.
* src/fgetln.c: use src/tools/compat/fgetln.c instead of
othersrc/libexec/tnftpd/libnetbsd/fgetln.c
2006-08-16 Jess Thrysoee
* version-info: 0:20:0
* all: sync with upstream source.
2006-06-03 Jess Thrysoee
* version-info: 0:19:0
* COPYING: added global license file
* all: sync with upstream source.
2006-02-13 Jess Thrysoee
* version-info: 0:18:0
* src/readline.c: Partial rl_getc_function support, patch by Kjeld Borch
Egevang.
* src/readline.c: Make write_history and read_history returncode readline
compatible. Upstream patch.
2006-01-03 Jess Thrysoee
* version-info: 0:17:0
* patches/cvs_export.sh: strlcat.c and strlcpy.c was moved to
src/common/lib/libc/string in the upstream cvs repository.
* all: sync with upstream source.
2005-10-22 Jess Thrysoee
* version-info: 0:16:0
* patches/*.patch, configure.ac: define SCCSID, undef LIBC_SCCS. Remove
fourteen cosmetic patches.
* all: sync with upstream source.
2005-09-11 Jess Thrysoee
* version-info: 0:15:0
* src/Makefile.am: fix typo that meant generated files were distributes,
and make generated file targets dependent on the the 'makelist' input
files.
* all: sync with upstream source. This is just a manpage update
2005-08-28 Jess Thrysoee
* version-info: 0:14:0
* src/sys.h: include config.h to avoid "redefinition of
`u_int32_t'". Patch by Norihiko Murase.
* src/search.c: explicitly include sys/types.h, because regex.h on
FreeBSD needs it and does not include it itself. Patch by Norihiko Murase.
* acinclude.m4: added EL_GETPW_R_DRAFT test and use AC_TRY_LINK instead
of AC_TRY_COMPILE. Suggested by Norihiko Murase.
* all: sync with upstream source.
2005-08-16 Jess Thrysoee
* version-info: 0:13:0
* all: sync with upstream source.
2005-08-05 Jess Thrysoee
* version-info: 0:12:0
* all: sync with upstream source.
2005-07-24 Jess Thrysoee
* version-info: 0:11:0
* histedit.h, histedit.c, readline.c, editline/readline.h: From
upstream; added remove_history().
2005-07-07 Jess Thrysoee
* version-info: 0:10:0
* history.c, key.c: From upstream source; Fix memory leaks found by
valgrind.
2005-06-28 Jess Thrysoee
* version-info: 0:9:0
* src/readline.c: getpwent_r is not POSIX, always use getpwent.
Reported by Gerrit P. Haase.
* src/Makefile.am: Added libtool -no-undefined. This is needed on Cygwin
to get a shared editline library. Should not affect other platforms.
Suggested by Gerrit P. Haase.
2005-06-15 Jess Thrysoee
* version-info: 0:8:0
* all: sync with upstream source.
2005-06-01 Jess Thrysoee
* version-info: 0:7:0
* all: sync with upstream source.
* src/readline.c, src/filecomplete.c: Solaris use POSIX draft versions
of getpwent_r, getpwnam_r and getpwuid_r which return 'struct passwd *'.
Define HAVE_GETPW_R_POSIX if these functions are (non draft) POSIX
compatible. Patch by Julien Torrs.
2005-05-28 Jess Thrysoee
* version-info: 0:6:0
* all: sync with upstream source.
2005-03-11 Jess Thrysoee
* version-info: 0:5:0
* all: sync with upstream source.
2004-12-07 Jess Thrysoee
* version-info: 0:4:0
* src/readline.c: d_namlen (in struct dirent) is not portable, always
use strlen. Patch by Scott Rankin.
2004-11-27 Jess Thrysoee
* version-info: 0:3:0
* src/history.c: bug #26785 fixed upstream, removed local patch.
2004-11-06 Jess Thrysoee
* version-info: 0:2:0
* all: sync with upstream source.
* doc/Makefile.am: If mdoc2man fails, remove empty file. Patch by
Darren Tucker.
2004-10-14 Jess Thrysoee
* version-info: 0:1:0
* doc/Makefile.am: 'make install' twice fails. Remove old links before
trying to link the man pages. Patch by Rick Richardson.
2004-09-28 Jess Thrysoee
* version-info: 0:0:0
* acinclude.m4 configure.ac src/Makefile.am: Adhere to
LibTools library interface versions recommendation.
http://www.gnu.org/software/libtool/manual.html#SEC32
* doc/Makefile.am: name all manpage links as el_* (e.g. el_history.3)
to avoid conflicts.
2004-09-08 Jess Thrysoee
* all: Initial package.
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software
Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
Basic Installation
==================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. (Caching is
disabled by default to prevent problems with accidental use of stale
cache files.)
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You only need
`configure.ac' if you want to change it or regenerate `configure' using
a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. Run `./configure --help'
for details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not support the `VPATH'
variable, you have to compile the package for one architecture at a
time in the source code directory. After you have installed the
package for one architecture, use `make distclean' before reconfiguring
for another architecture.
Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=PATH' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' cannot figure out
automatically, but needs to determine by the type of machine the package
will run on. Usually, assuming the package is built to be run on the
_same_ architectures, `configure' can figure that out, but if it prints
a message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the `--target=TYPE' option to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
will cause the specified gcc to be used as the C compiler (unless it is
overridden in the site shell script).
`configure' Invocation
======================
`configure' recognizes the following options to control how it
operates.
`--help'
`-h'
Print a summary of the options to `configure', and exit.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.
AUTOMAKE_OPTIONS = foreign
SUBDIRS = src examples doc
EXTRA_DIST = libedit.pc.in
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libedit.pc
## GENERATED BY SCRIPT - DO NOT EDIT BELOW
EXTRA_DIST += patches/README \
patches/00-vis.h.patch \
patches/01-term.c.patch \
patches/02-el_term.h.patch \
patches/03-unvis.c.patch \
patches/04-strlcpy.c.patch \
patches/05-strlcat.c.patch \
patches/06-readline.c.patch \
patches/07-sys.h.patch \
patches/08-el.h.patch \
patches/09-search.c.patch \
patches/10-readline.h.patch \
patches/11-el.c.patch \
patches/12-history.c.patch \
patches/13-vis.c.patch \
patches/14-fgetln.c.patch \
patches/15-filecomplete.c.patch \
patches/16-tc1.c.patch \
patches/17-editline.3.roff.patch \
patches/18-editrc.5.roff.patch \
patches/cvs_export.sh \
patches/patches_make.sh \
patches/patches_apply.sh \
patches/patches_check.sh \
patches/extra_dist_list.sh \
patches/update_version.sh \
patches/update_dist.sh \
patches/timestamp.cvsexport
差异被折叠。
Thanks to the NetBSD Project maintainers of libedit!
dnl
dnl read lib version from file (and trim trailing newline)
dnl
define([EL_RELEASE], [patsubst(esyscmd([. src/shlib_version; echo $major.$minor]), [
])])
dnl
dnl read cvsexport timestamp from file (and trim trailing newline)
dnl
dnl define([EL_TIMESTAMP_CVSEXPORT], [patsubst(esyscmd([cat patches/timestamp.cvsexport]), [
define([EL_TIMESTAMP_CVSEXPORT], [patsubst(esyscmd([date +"%Y%m%d"]), [
])])
dnl
dnl NetBSD use the -mdoc macro package for manpages, but e.g.
dnl AIX and Solaris only support the -man package.
dnl
AC_DEFUN([EL_MANTYPE],
[
MANTYPE=
TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
if ${NROFF} -mdoc ${srcdir}/doc/editrc.5.roff >/dev/null 2>&1; then
MANTYPE=mdoc
fi
AC_SUBST(MANTYPE)
])
dnl
dnl Check if getpwnam_r and getpwuid_r are POSIX.1 compatible
dnl POSIX draft version returns 'struct passwd *' (used on Solaris)
dnl NOTE: getpwent_r is not POSIX so we always use getpwent
dnl
AC_DEFUN([EL_GETPW_R_POSIX],
[
AC_MSG_CHECKING([whether getpwnam_r and getpwuid_r are posix like])
# The prototype for the POSIX version is:
# int getpwnam_r(char *, struct passwd *, char *, size_t, struct passwd **)
# int getpwuid_r(uid_t, struct passwd *, char *, size_t, struct passwd **);
AC_TRY_LINK([#include <stdlib.h>
#include <sys/types.h>
#include <pwd.h>],
[getpwnam_r(NULL, NULL, NULL, (size_t)0, NULL);
getpwuid_r((uid_t)0, NULL, NULL, (size_t)0, NULL);],
[AC_DEFINE([HAVE_GETPW_R_POSIX], 1, [Define to 1 if you have getpwnam_r and getpwuid_r that are POSIX.1 compatible.])
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
])
AC_DEFUN([EL_GETPW_R_DRAFT],
[
AC_MSG_CHECKING([whether getpwnam_r and getpwuid_r are posix _draft_ like])
# The prototype for the POSIX draft version is:
# struct passwd *getpwuid_r(uid_t, struct passwd *, char *, int);
# struct passwd *getpwnam_r(char *, struct passwd *, char *, int);
AC_TRY_LINK([#include <stdlib.h>
#include <sys/types.h>
#include <pwd.h>],
[getpwnam_r(NULL, NULL, NULL, (size_t)0);
getpwuid_r((uid_t)0, NULL, NULL, (size_t)0);],
[AC_DEFINE([HAVE_GETPW_R_DRAFT], 1, [Define to 1 if you have getpwnam_r and getpwuid_r that are draft POSIX.1 versions.])
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
])
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if the `closedir' function returns void instead of `int'. */
#undef CLOSEDIR_VOID
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
systems. This function is required for `alloca.c' support on those systems.
*/
#undef CRAY_STACKSEG_END
/* Define to 1 if using `alloca.c'. */
#undef C_ALLOCA
/* Define to 1 if you have `alloca', as a function or macro. */
#undef HAVE_ALLOCA
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
*/
#undef HAVE_ALLOCA_H
/* Define to 1 if you have the <curses.h> header file. */
#undef HAVE_CURSES_H
/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
*/
#undef HAVE_DIRENT_H
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the `endpwent' function. */
#undef HAVE_ENDPWENT
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define to 1 if you have the `fork' function. */
#undef HAVE_FORK
/* Define to 1 if you have getpwnam_r and getpwuid_r that are draft POSIX.1
versions. */
#undef HAVE_GETPW_R_DRAFT
/* Define to 1 if you have getpwnam_r and getpwuid_r that are POSIX.1
compatible. */
#undef HAVE_GETPW_R_POSIX
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the `isascii' function. */
#undef HAVE_ISASCII
/* Define to 1 if you have the `issetugid' function. */
#undef HAVE_ISSETUGID
/* Define to 1 if you have the `curses' library (-lcurses). */
#undef HAVE_LIBCURSES
/* Define to 1 if you have the `ncurses' library (-lncurses). */
#undef HAVE_LIBNCURSES
/* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
/* Define to 1 if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H
/* Define to 1 if you have the `memchr' function. */
#undef HAVE_MEMCHR
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `memset' function. */
#undef HAVE_MEMSET
/* Define to 1 if you have the <ncurses.h> header file. */
#undef HAVE_NCURSES_H
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
#undef HAVE_NDIR_H
/* Define to 1 if you have the `regcomp' function. */
#undef HAVE_REGCOMP
/* Define to 1 if you have the `re_comp' function. */
#undef HAVE_RE_COMP
/* Define to 1 if `stat' has the bug that it succeeds when given the
zero-length file name argument. */
#undef HAVE_STAT_EMPTY_STRING_BUG
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the `strcasecmp' function. */
#undef HAVE_STRCASECMP
/* Define to 1 if you have the `strchr' function. */
#undef HAVE_STRCHR
/* Define to 1 if you have the `strcspn' function. */
#undef HAVE_STRCSPN
/* Define to 1 if you have the `strdup' function. */
#undef HAVE_STRDUP
/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the `strrchr' function. */
#undef HAVE_STRRCHR
/* Define to 1 if you have the `strstr' function. */
#undef HAVE_STRSTR
/* Define to 1 if you have the `strtol' function. */
#undef HAVE_STRTOL
/* Define to 1 if you have the <sys/cdefs.h> header file. */
#undef HAVE_SYS_CDEFS_H
/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
*/
#undef HAVE_SYS_DIR_H
/* Define to 1 if you have the <sys/ioctl.h> header file. */
#undef HAVE_SYS_IOCTL_H
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
*/
#undef HAVE_SYS_NDIR_H
/* Define to 1 if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
#undef HAVE_SYS_WAIT_H
/* Define to 1 if you have the <term.h> header file. */
#undef HAVE_TERM_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if the system has the type `u_int32_t'. */
#undef HAVE_U_INT32_T
/* Define to 1 if you have the `vfork' function. */
#undef HAVE_VFORK
/* Define to 1 if you have the <vfork.h> header file. */
#undef HAVE_VFORK_H
/* Define to 1 if `fork' works. */
#undef HAVE_WORKING_FORK
/* Define to 1 if `vfork' works. */
#undef HAVE_WORKING_VFORK
/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
slash. */
#undef LSTAT_FOLLOWS_SLASHED_SYMLINK
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define as the return type of signal handlers (`int' or `void'). */
#undef RETSIGTYPE
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at runtime.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown */
#undef STACK_DIRECTION
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Version number of package */
#undef VERSION
/* Solaris's term.h does horrid things. */
#undef _SUNOS
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define to `int' if <sys/types.h> does not define. */
#undef pid_t
/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t
/* Define as `fork' if `vfork' does not work. */
#undef vfork
#include <sys.h>
#define SCCSID
#undef LIBC_SCCS
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_INIT(libedit, [EL_RELEASE],, libedit-[EL_TIMESTAMP_CVSEXPORT])
AC_CONFIG_SRCDIR([src/strlcat.c])
AC_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE
AC_PROG_LIBTOOL
# libtool -version-info
AC_SUBST(LT_VERSION, [0:26:0])
# AC_PROG_LIBTOOL runs AC_CANONICAL_HOST
case $host in
*-sun-*) AC_DEFINE([_SUNOS], [], [Solaris's term.h does horrid things.]);;
esac
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_LN_S
AC_PROG_AWK
EL_MANTYPE
AC_CHECK_LIB(curses, tgetent,,
[AC_CHECK_LIB(ncurses, tgetent,,
[AC_MSG_ERROR([libtermcap, libcurses or libncurses are required!])] )] )
# Checks for header files.
AC_FUNC_ALLOCA
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([fcntl.h limits.h malloc.h stdlib.h string.h sys/ioctl.h sys/param.h unistd.h curses.h ncurses.h sys/cdefs.h])
AC_CHECK_HEADER([termios.h], [], [AC_MSG_ERROR([termios.h is required!])],[])
## include curses.h to prevent "Present But Cannot Be Compiled"
AC_CHECK_HEADERS([term.h],,,
[[#if HAVE_CURSES_H
# include <curses.h>
#elif HAVE_NCURSES_H
# include <ncurses.h>
#endif
]])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_CHECK_TYPES([u_int32_t])
# Checks for library functions.
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_FORK
AC_PROG_GCC_TRADITIONAL
## _AIX is offended by rpl_malloc and rpl_realloc
#AC_FUNC_MALLOC
#AC_FUNC_REALLOC
AC_TYPE_SIGNAL
AC_FUNC_STAT
AC_CHECK_FUNCS([endpwent isascii memchr memset re_comp regcomp strcasecmp strchr strcspn strdup strerror strrchr strstr strtol issetugid])
EL_GETPW_R_POSIX
EL_GETPW_R_DRAFT
AH_BOTTOM([
#include <sys.h>
#define SCCSID
#undef LIBC_SCCS
])
AC_CONFIG_FILES([Makefile
libedit.pc
src/Makefile
doc/Makefile
examples/Makefile])
AC_OUTPUT
#! /bin/sh
./configure "$@" --disable-shared --with-pic
EL_MANS = editline.3 editrc.5
man_MANS = $(EL_MANS)
EL_MAN_LINKS = el_init.3 el_end.3 el_reset.3 el_gets.3 el_getc.3 \
el_push.3 el_parse.3 el_set.3 el_get.3 el_source.3 \
el_resize.3 el_line.3 el_insertstr.3 el_deletestr.3 \
el_history_init.3 el_history_end.3 el_history.3 el_tok_init.3 \
el_tok_end.3 el_tok_reset.3 el_tok_line.3 el_tok_str.3
install-data-hook: $(EL_MAN_LINKS)
$(EL_MAN_LINKS):
(cd $(DESTDIR)$(man3dir) && rm -f $@ && $(LN_S) editline.3 $@)
$(EL_MANS):
if test "$(MANTYPE)" = "mdoc"; then\
cp $(srcdir)/$@.roff $@;\
else\
$(AWK) -f $(srcdir)/mdoc2man.awk $(srcdir)/$@.roff > $@ || rm -f $@;\
fi;
uninstall-local:
(cd $(DESTDIR)$(man3dir) && rm -f $(EL_MAN_LINKS))
CLEANFILES = $(EL_MANS)
EXTRA_DIST = editline.3.roff editrc.5.roff mdoc2man.awk
changelog.txt: ../ChangeLog
@sed 's/@/ (at)/g;s/</\&lt;/g;s/>/\&gt;/g;s/è/\&egrave;/g' $(srcdir)/$< > $@;
差异被折叠。
差异被折叠。
差异被折叠。
LDADD = $(top_builddir)/src/libedit.la
AM_CFLAGS = -I$(top_srcdir)/src
noinst_PROGRAMS = test fileman
test_SOURCES = test.c
fileman_SOURCES = fileman.c
差异被折叠。
/* $NetBSD: test.c,v 1.18 2005/06/01 11:37:52 lukem Exp $ */
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Christos Zoulas of Cornell University.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* test.c: A little test program
*/
#include <stdio.h>
#include <string.h>
#include <signal.h>
#include <sys/wait.h>
#include <ctype.h>
#include <stdlib.h>
#include <unistd.h>
#include <dirent.h>
#include "histedit.h"
/* from src/sys/sys/cdefs.h */
#ifndef __UNCONST
# define __UNCONST(a) ((void *)(unsigned long)(const void *)(a))
#endif
static int continuation = 0;
volatile sig_atomic_t gotsig = 0;
static unsigned char complete(EditLine *, int);
int main(int, char **);
static char *prompt(EditLine *);
static void sig(int);
static char *
prompt(EditLine *el)
{
static char a[] = "Edit$ ";
static char b[] = "Edit> ";
return (continuation ? b : a);
}
static void
sig(int i)
{
gotsig = i;
}
static unsigned char
complete(EditLine *el, int ch)
{
DIR *dd = opendir(".");
struct dirent *dp;
const char* ptr;
const LineInfo *lf = el_line(el);
int len;
/*
* Find the last word
*/
for (ptr = lf->cursor - 1;
!isspace((unsigned char)*ptr) && ptr > lf->buffer; ptr--)
continue;
len = lf->cursor - ++ptr;
for (dp = readdir(dd); dp != NULL; dp = readdir(dd)) {
if (len > strlen(dp->d_name))
continue;
if (strncmp(dp->d_name, ptr, len) == 0) {
closedir(dd);
if (el_insertstr(el, &dp->d_name[len]) == -1)
return (CC_ERROR);
else
return (CC_REFRESH);
}
}
closedir(dd);
return (CC_ERROR);
}
int
main(int argc, char *argv[])
{
EditLine *el = NULL;
int num;
const char *buf;
Tokenizer *tok;
#if 0
int lastevent = 0;
#endif
int ncontinuation;
History *hist;
HistEvent ev;
(void) signal(SIGINT, sig);
(void) signal(SIGQUIT, sig);
(void) signal(SIGHUP, sig);
(void) signal(SIGTERM, sig);
hist = history_init(); /* Init the builtin history */
/* Remember 100 events */
history(hist, &ev, H_SETSIZE, 100);
tok = tok_init(NULL); /* Initialize the tokenizer */
/* Initialize editline */
el = el_init(*argv, stdin, stdout, stderr);
el_set(el, EL_EDITOR, "vi"); /* Default editor is vi */
el_set(el, EL_SIGNAL, 1); /* Handle signals gracefully */
el_set(el, EL_PROMPT, prompt); /* Set the prompt function */
/* Tell editline to use this history interface */
el_set(el, EL_HIST, history, hist);
/* Add a user-defined function */
el_set(el, EL_ADDFN, "ed-complete", "Complete argument", complete);
/* Bind tab to it */
el_set(el, EL_BIND, "^I", "ed-complete", NULL);
/*
* Bind j, k in vi command mode to previous and next line, instead
* of previous and next history.
*/
el_set(el, EL_BIND, "-a", "k", "ed-prev-line", NULL);
el_set(el, EL_BIND, "-a", "j", "ed-next-line", NULL);
/*
* Source the user's defaults file.
*/
el_source(el, NULL);
while ((buf = el_gets(el, &num)) != NULL && num != 0) {
int ac, cc, co;
#ifdef DEBUG
int i;
#endif
const char **av;
const LineInfo *li;
li = el_line(el);
#ifdef DEBUG
(void) fprintf(stderr, "==> got %d %s", num, buf);
(void) fprintf(stderr, " > li `%.*s_%.*s'\n",
(li->cursor - li->buffer), li->buffer,
(li->lastchar - 1 - li->cursor),
(li->cursor >= li->lastchar) ? "" : li->cursor);
#endif
if (gotsig) {
(void) fprintf(stderr, "Got signal %d.\n", gotsig);
gotsig = 0;
el_reset(el);
}
if (!continuation && num == 1)
continue;
ac = cc = co = 0;
ncontinuation = tok_line(tok, li, &ac, &av, &cc, &co);
if (ncontinuation < 0) {
(void) fprintf(stderr, "Internal error\n");
continuation = 0;
continue;
}
#ifdef DEBUG
(void) fprintf(stderr, " > nc %d ac %d cc %d co %d\n",
ncontinuation, ac, cc, co);
#endif
#if 0
if (continuation) {
/*
* Append to the right event in case the user
* moved around in history.
*/
if (history(hist, &ev, H_SET, lastevent) == -1)
err(1, "%d: %s", lastevent, ev.str);
history(hist, &ev, H_ADD , buf);
} else {
history(hist, &ev, H_ENTER, buf);
lastevent = ev.num;
}
#else
/* Simpler */
history(hist, &ev, continuation ? H_APPEND : H_ENTER, buf);
#endif
continuation = ncontinuation;
ncontinuation = 0;
if (continuation)
continue;
#ifdef DEBUG
for (i = 0; i < ac; i++) {
(void) fprintf(stderr, " > arg# %2d ", i);
if (i != cc)
(void) fprintf(stderr, "`%s'\n", av[i]);
else
(void) fprintf(stderr, "`%.*s_%s'\n",
co, av[i], av[i] + co);
}
#endif
if (strcmp(av[0], "history") == 0) {
int rv;
switch (ac) {
case 1:
for (rv = history(hist, &ev, H_LAST); rv != -1;
rv = history(hist, &ev, H_PREV))
(void) fprintf(stdout, "%4d %s",
ev.num, ev.str);
break;
case 2:
if (strcmp(av[1], "clear") == 0)
history(hist, &ev, H_CLEAR);
else
goto badhist;
break;
case 3:
if (strcmp(av[1], "load") == 0)
history(hist, &ev, H_LOAD, av[2]);
else if (strcmp(av[1], "save") == 0)
history(hist, &ev, H_SAVE, av[2]);
break;
badhist:
default:
(void) fprintf(stderr,
"Bad history arguments\n");
break;
}
} else if (el_parse(el, ac, av) == -1) {
switch (fork()) {
case 0:
execvp(av[0], (char *const *)__UNCONST(av));
perror(av[0]);
_exit(1);
/*NOTREACHED*/
break;
case -1:
perror("fork");
break;
default:
if (wait(&num) == -1)
perror("wait");
(void) fprintf(stderr, "Exit %x\n", num);
break;
}
}
tok_reset(tok);
}
el_end(el);
tok_end(tok);
history_end(hist);
return (0);
}
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: libedit
Description: command line editor library provides generic line editing, history, and tokenization functions.
Version: @VERSION@
Requires:
Libs: -L${libdir} -ledit -lcurses
Cflags: -I${includedir} -I${includedir}/editline
--- export/src/vis.h 2007-08-31 00:02:46.000000000 +0200
+++ ../src/vis.h 2007-08-31 00:03:08.000000000 +0200
@@ -34,7 +34,7 @@
#ifndef _VIS_H_
#define _VIS_H_
-#include <sys/types.h>
+#include <config.h>
/*
* to select alternate encoding format
@@ -72,8 +72,6 @@
*/
#define UNVIS_END 1 /* no more characters */
-#include <sys/cdefs.h>
-
__BEGIN_DECLS
char *vis(char *, int, int, int);
char *svis(char *, int, int, int, const char *);
@@ -84,7 +82,7 @@
int strunvis(char *, const char *);
int strunvisx(char *, const char *, int);
#ifndef __LIBC12_SOURCE__
-int unvis(char *, int, int *, int) __RENAME(__unvis13);
+int unvis(char *, int, int *, int);
#endif
__END_DECLS
--- export/src/term.c 2007-08-31 00:02:46.000000000 +0200
+++ ../src/term.c 2007-08-31 00:03:08.000000000 +0200
@@ -51,19 +51,18 @@
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
-#ifdef HAVE_TERMCAP_H
-#include <termcap.h>
-#endif
+
#ifdef HAVE_CURSES_H
-#include <curses.h>
-#endif
-#ifdef HAVE_NCURSES_H
-#include <ncurses.h>
+# include <curses.h>
+#elif HAVE_NCURSES_H
+# include <ncurses.h>
#endif
+
/* Solaris's term.h does horrid things. */
-#if (defined(HAVE_TERM_H) && !defined(SUNOS))
-#include <term.h>
+#if (defined(HAVE_TERM_H) && !defined(_SUNOS))
+# include <term.h>
#endif
+
#include <sys/types.h>
#include <sys/ioctl.h>
--- export/src/el_term.h 2007-08-31 00:02:46.000000000 +0200
+++ ../src/el_term.h 2007-08-31 00:03:08.000000000 +0200
@@ -81,6 +81,15 @@
#define A_K_EN 5
#define A_K_NKEYS 6
+#ifdef _SUNOS
+extern int tgetent(char *, const char *);
+extern int tgetflag(char *);
+extern int tgetnum(char *);
+extern int tputs(const char *, int, int (*)(int));
+extern char* tgoto(const char*, int, int);
+extern char* tgetstr(char*, char**);
+#endif
+
protected void term_move_to_line(EditLine *, int);
protected void term_move_to_char(EditLine *, int);
protected void term_clear_EOL(EditLine *, int);
--- export/src/unvis.c 2007-08-31 00:02:46.000000000 +0200
+++ ../src/unvis.c 2007-08-31 00:03:08.000000000 +0200
@@ -29,7 +29,7 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
+#include <config.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)unvis.c 8.1 (Berkeley) 6/4/93";
@@ -38,7 +38,6 @@
#endif
#endif /* LIBC_SCCS and not lint */
-#include "namespace.h"
#include <sys/types.h>
#include <assert.h>
--- export/src/strlcpy.c 2007-08-31 00:02:46.000000000 +0200
+++ ../src/strlcpy.c 2007-08-31 00:03:08.000000000 +0200
@@ -17,19 +17,12 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#if !defined(_KERNEL) && !defined(_STANDALONE)
-#if HAVE_NBTOOL_CONFIG_H
-#include "nbtool_config.h"
-#endif
+#include <config.h>
-#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: strlcpy.c,v 1.3 2007/06/04 18:19:27 christos Exp $");
#endif /* LIBC_SCCS and not lint */
-#ifdef _LIBC
-#include "namespace.h"
-#endif
#include <sys/types.h>
#include <assert.h>
#include <string.h>
@@ -39,10 +32,6 @@
__weak_alias(strlcpy, _strlcpy)
# endif
#endif
-#else
-#include <lib/libkern/libkern.h>
-#endif /* !_KERNEL && !_STANDALONE */
-
#if !HAVE_STRLCPY
/*
--- export/src/strlcat.c 2007-08-31 00:02:46.000000000 +0200
+++ ../src/strlcat.c 2007-08-31 00:03:08.000000000 +0200
@@ -17,19 +17,12 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#if !defined(_KERNEL) && !defined(_STANDALONE)
-#if HAVE_NBTOOL_CONFIG_H
-#include "nbtool_config.h"
-#endif
+#include <config.h>
-#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: strlcat.c,v 1.3 2007/06/04 18:19:27 christos Exp $");
#endif /* LIBC_SCCS and not lint */
-#ifdef _LIBC
-#include "namespace.h"
-#endif
#include <sys/types.h>
#include <assert.h>
#include <string.h>
@@ -40,10 +33,6 @@
# endif
#endif
-#else
-#include <lib/libkern/libkern.h>
-#endif /* !_KERNEL && !_STANDALONE */
-
#if !HAVE_STRLCAT
/*
* Appends src to string dst of size siz (unlike strncat, siz is the
--- export/src/readline.c 2007-08-31 00:02:46.000000000 +0200
+++ ../src/readline.c 2007-08-31 00:03:08.000000000 +0200
@@ -32,7 +32,26 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "config.h"
+/* AIX requires this to be the first thing in the file. */
+#if defined (_AIX) && !defined (__GNUC__)
+ #pragma alloca
+#endif
+
+#include <config.h>
+
+#ifdef __GNUC__
+# undef alloca
+# define alloca(n) __builtin_alloca (n)
+#else
+# ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+# else
+# ifndef _AIX
+extern char *alloca ();
+# endif
+# endif
+#endif
+
#if !defined(lint) && !defined(SCCSID)
__RCSID("$NetBSD: readline.c,v 1.72 2007/08/12 07:41:51 christos Exp $");
#endif /* not lint && not SCCSID */
@@ -50,20 +69,17 @@
#include <errno.h>
#include <fcntl.h>
#include <setjmp.h>
-#ifdef HAVE_VIS_H
#include <vis.h>
-#else
-#include "np/vis.h"
-#endif
-#ifdef HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
#include "el.h"
#include "fcns.h" /* for EL_NUM_FCNS */
#include "histedit.h"
-#include "readline/readline.h"
+#include "editline/readline.h"
#include "filecomplete.h"
+#if !defined(SIZE_T_MAX)
+# define SIZE_T_MAX (size_t)(-1)
+#endif
+
void rl_prep_terminal(int);
void rl_deprep_terminal(void);
@@ -198,7 +214,7 @@
return (HIST_ENTRY *) NULL;
rl_he.line = ev.str;
- rl_he.data = NULL;
+ rl_he.data = (histdata_t) &(ev.num);
return (&rl_he);
}
@@ -1440,8 +1456,7 @@
char *
username_completion_function(const char *text, int state)
{
- struct passwd *pwd, pwres;
- char pwbuf[1024];
+ struct passwd *pwd;
if (text[0] == '\0')
return (NULL);
@@ -1452,9 +1467,9 @@
if (state == 0)
setpwent();
- while (getpwent_r(&pwres, pwbuf, sizeof(pwbuf), &pwd) == 0
- && pwd != NULL && text[0] == pwd->pw_name[0]
- && strcmp(text, pwd->pw_name) == 0);
+ while ((pwd = getpwent())
+ && pwd != NULL && text[0] == pwd->pw_name[0]
+ && strcmp(text, pwd->pw_name) == 0);
if (pwd == NULL) {
endpwent();
--- export/src/sys.h 2007-08-31 00:02:46.000000000 +0200
+++ ../src/sys.h 2007-08-31 00:03:08.000000000 +0200
@@ -40,6 +40,8 @@
#ifndef _h_sys
#define _h_sys
+#include <config.h>
+
#ifdef HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#endif
@@ -48,6 +50,14 @@
# define __attribute__(A)
#endif
+#ifndef __P
+# define __P(x) x
+#endif
+
+#ifndef _DIAGASSERT
+# define _DIAGASSERT(x)
+#endif
+
#ifndef __BEGIN_DECLS
# ifdef __cplusplus
# define __BEGIN_DECLS extern "C" {
@@ -71,6 +81,10 @@
/* When we want to hide everything */
#endif
+#ifndef HAVE_U_INT32_T
+typedef unsigned int u_int32_t;
+#endif
+
#ifndef _PTR_T
# define _PTR_T
typedef void *ptr_t;
--- export/src/el.h 2007-08-31 00:02:46.000000000 +0200
+++ ../src/el.h 2007-08-31 00:03:08.000000000 +0200
@@ -96,7 +96,7 @@
#include "tty.h"
#include "prompt.h"
#include "key.h"
-#include "term.h"
+#include "el_term.h"
#include "refresh.h"
#include "chared.h"
#include "common.h"
--- export/src/search.c 2007-08-31 00:02:46.000000000 +0200
+++ ../src/search.c 2007-08-31 00:03:08.000000000 +0200
@@ -45,6 +45,7 @@
* search.c: History and character search functions
*/
#include <stdlib.h>
+#include <sys/types.h>
#if defined(REGEX)
#include <regex.h>
#elif defined(REGEXP)
--- export/src/editline/readline.h 2007-08-31 00:02:46.000000000 +0200
+++ ../src/editline/readline.h 2007-08-31 00:03:08.000000000 +0200
@@ -46,9 +46,11 @@
typedef char **CPPFunction(const char *, int, int);
typedef char *rl_compentry_func_t(const char *, int);
+typedef void *histdata_t;
+
typedef struct _hist_entry {
const char *line;
- const char *data;
+ histdata_t *data;
} HIST_ENTRY;
typedef struct _keymap_entry {
@@ -69,7 +71,7 @@
#ifndef CTRL
#include <sys/ioctl.h>
-#if !defined(__sun__) && !defined(__hpux__)
+#ifdef __GLIBC__
#include <sys/ttydefaults.h>
#endif
#ifndef CTRL
--- export/src/el.c 2007-08-31 00:02:46.000000000 +0200
+++ ../src/el.c 2007-08-31 00:03:08.000000000 +0200
@@ -473,12 +473,17 @@
fp = NULL;
if (fname == NULL) {
-#ifdef HAVE_ISSETUGID
static const char elpath[] = "/.editrc";
+#ifdef MAXPATHLEN
char path[MAXPATHLEN];
+#else
+ char path[4096];
+#endif
+#ifdef HAVE_ISSETUGID
if (issetugid())
return (-1);
+#endif
if ((ptr = getenv("HOME")) == NULL)
return (-1);
if (strlcpy(path, ptr, sizeof(path)) >= sizeof(path))
@@ -486,14 +491,6 @@
if (strlcat(path, elpath, sizeof(path)) >= sizeof(path))
return (-1);
fname = path;
-#else
- /*
- * If issetugid() is missing, always return an error, in order
- * to keep from inadvertently opening up the user to a security
- * hole.
- */
- return (-1);
-#endif
}
if (fp == NULL)
fp = fopen(fname, "r");
--- export/src/history.c 2007-08-31 00:02:46.000000000 +0200
+++ ../src/history.c 2007-08-31 00:03:08.000000000 +0200
@@ -47,11 +47,7 @@
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
-#ifdef HAVE_VIS_H
#include <vis.h>
-#else
-#include "np/vis.h"
-#endif
#include <sys/stat.h>
static const char hist_cookie[] = "_HiStOrY_V2_\n";
--- export/src/vis.c 2007-08-31 00:02:46.000000000 +0200
+++ ../src/vis.c 2007-08-31 00:03:08.000000000 +0200
@@ -58,12 +58,30 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
+/* AIX requires this to be the first thing in the file. */
+#if defined (_AIX) && !defined (__GNUC__)
+ #pragma alloca
+#endif
+
+#include <config.h>
+
+#ifdef __GNUC__
+# undef alloca
+# define alloca(n) __builtin_alloca (n)
+#else
+# ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+# else
+# ifndef _AIX
+extern char *alloca ();
+# endif
+# endif
+#endif
+
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: vis.c,v 1.35 2006/08/28 20:42:12 christos Exp $");
#endif /* LIBC_SCCS and not lint */
-#include "namespace.h"
#include <sys/types.h>
#include <assert.h>
--- export/src/fgetln.c 2007-08-31 00:02:46.000000000 +0200
+++ ../src/fgetln.c 2007-08-31 00:03:08.000000000 +0200
@@ -37,6 +37,7 @@
#endif
#if !HAVE_FGETLN
+#include <config.h>
#include <stdlib.h>
#ifndef HAVE_NBTOOL_CONFIG_H
/* These headers are required, but included from nbtool_config.h */
--- export/src/filecomplete.c 2007-08-31 00:02:46.000000000 +0200
+++ ../src/filecomplete.c 2007-08-31 00:03:08.000000000 +0200
@@ -31,8 +31,27 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
+
+/* AIX requires this to be the first thing in the file. */
+#if defined (_AIX) && !defined (__GNUC__)
+ #pragma alloca
+#endif
+
+#include <config.h>
+
+#ifdef __GNUC__
+# undef alloca
+# define alloca(n) __builtin_alloca (n)
+#else
+# ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+# else
+# ifndef _AIX
+extern char *alloca ();
+# endif
+# endif
+#endif
-#include "config.h"
#if !defined(lint) && !defined(SCCSID)
__RCSID("$NetBSD: filecomplete.c,v 1.10 2006/11/09 16:58:38 christos Exp $");
#endif /* not lint && not SCCSID */
@@ -49,14 +68,8 @@
#include <limits.h>
#include <errno.h>
#include <fcntl.h>
-#ifdef HAVE_VIS_H
#include <vis.h>
-#else
-#include "np/vis.h"
-#endif
-#ifdef HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
+
#include "el.h"
#include "fcns.h" /* for EL_NUM_FCNS */
#include "histedit.h"
@@ -101,11 +114,23 @@
temp[len - 2] = '\0';
}
if (temp[0] == 0) {
+#ifdef HAVE_GETPW_R_POSIX
if (getpwuid_r(getuid(), &pwres, pwbuf, sizeof(pwbuf), &pass) != 0)
pass = NULL;
+#elif HAVE_GETPW_R_DRAFT
+ pass = getpwuid_r(getuid(), &pwres, pwbuf, sizeof(pwbuf));
+#else
+ pass = getpwuid(getuid());
+#endif
} else {
+#ifdef HAVE_GETPW_R_POSIX
if (getpwnam_r(temp, &pwres, pwbuf, sizeof(pwbuf), &pass) != 0)
pass = NULL;
+#elif HAVE_GETPW_R_DRAFT
+ pass = getpwnam_r(temp, &pwres, pwbuf, sizeof(pwbuf));
+#else
+ pass = getpwnam(temp);
+#endif
}
free(temp); /* value no more needed */
if (pass == NULL)
@@ -211,11 +236,8 @@
/* otherwise, get first entry where first */
/* filename_len characters are equal */
if (entry->d_name[0] == filename[0]
-#if defined(__SVR4) || defined(__linux__)
+ /* Some dirents have d_namlen, but it is not portable. */
&& strlen(entry->d_name) >= filename_len
-#else
- && entry->d_namlen >= filename_len
-#endif
&& strncmp(entry->d_name, filename,
filename_len) == 0)
break;
@@ -223,12 +245,8 @@
if (entry) { /* match found */
-#if defined(__SVR4) || defined(__linux__)
+ /* Some dirents have d_namlen, but it is not portable. */
len = strlen(entry->d_name);
-#else
- len = entry->d_namlen;
-#endif
-
temp = malloc(strlen(dirname) + len + 1);
if (temp == NULL)
return NULL;
--- export/examples/tc1.c 2007-08-31 00:02:46.000000000 +0200
+++ ../examples/tc1.c 2007-08-31 00:03:08.000000000 +0200
@@ -32,20 +32,6 @@
* SUCH DAMAGE.
*/
-#include "config.h"
-#ifndef lint
-__COPYRIGHT("@(#) Copyright (c) 1992, 1993\n\
- The Regents of the University of California. All rights reserved.\n");
-#endif /* not lint */
-
-#if !defined(lint) && !defined(SCCSID)
-#if 0
-static char sccsid[] = "@(#)test.c 8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("$NetBSD: tc1.c,v 1.1 2006/08/31 20:20:38 rpaulo Exp $");
-#endif
-#endif /* not lint && not SCCSID */
-
/*
* test.c: A little test program
*/
@@ -60,6 +46,11 @@
#include "histedit.h"
+/* from src/sys/sys/cdefs.h */
+#ifndef __UNCONST
+# define __UNCONST(a) ((void *)(unsigned long)(const void *)(a))
+#endif
+
static int continuation = 0;
volatile sig_atomic_t gotsig = 0;
--- export/doc/editline.3.roff 2007-08-31 00:02:46.000000000 +0200
+++ ../doc/editline.3.roff 2007-08-31 00:03:08.000000000 +0200
@@ -115,10 +115,11 @@
These functions are available in the
.Nm libedit
library (which needs the
-.Nm libtermcap
+.Nm libcurses
library).
Programs should be linked with
-.Fl ledit ltermcap .
+.Fl ledit
+.Fl lcurses .
.Sh LINE EDITING FUNCTIONS
The line editing functions use a common data structure,
.Fa EditLine ,
@@ -711,8 +712,10 @@
to be used by all other tokenizer functions.
.Fa IFS
contains the Input Field Separators, which defaults to
-.Aq space ,
-.Aq tab ,
+.Aq space
+,
+.Aq tab
+,
and
.Aq newline
if
--- export/doc/editrc.5.roff 2007-08-31 00:02:46.000000000 +0200
+++ ../doc/editrc.5.roff 2007-08-31 00:03:08.000000000 +0200
@@ -157,7 +157,7 @@
.Ar command
can contain control characters of the form
.Sm off
-.Sq No ^ Ar character
+.Sq ^character
.Sm on
.Po
e.g.
@@ -183,7 +183,7 @@
.It Ic \ev
Vertical tab
.Sm off
-.It Sy \e Ar nnn
+.It Sy \ennn
.Sm on
The ASCII character corresponding to the octal number
.Ar nnn .
@@ -222,11 +222,11 @@
causing an error.
.Fl v
causes messages to be verbose.
-.It Ic edit Op Li on | Li off
+.It Ic edit Op on | off
Enable or disable the
.Nm editline
functionality in a program.
-.It Ic history Ar list | Ar size Dv n | Ar unique Dv n
+.It Ic history Ar list | Ar size n | Ar unique n
The
.Ar list
command lists all entries in the history.
Files in this directory are used to update the source in this distribution with
updates from the FreeBSD CVS source.
1) cvs_export.sh - get the source from cvs (to ./export)
2) patches_apply.sh - try to patch ./export with current pathes.
3) patches_check.sh - check updated ./export against dist
4) update_dist.sh - update dist and version
If by hand:
*) copy ./export/* files to dist '""cp -rf export/* ..'
*) 'rm -rf export; cp -rf export.unpatched export' - get clean ./export hierarchy
*) patches_make.sh - make new patches to be distributed
*) update 'vi ../Makefile.am with' list ':r !./extra_dist_list.sh' (vim cmd)
*) update LT_VERSION in configure.ac according to the below Note
5) update ChangeLog
6) autoreconf && make distcheck!!!
http://developer.gnome.org/doc/books/WGA/dealing-with-libraries.html#AEN555 A
Note about Version Numbers
The three numbers stand for CURRENT:REVISION:AGE, or C:R:A for short. The
libtool script typically tacks these three numbers onto the end of the name of
the .so file it creates. The formula for calculating the file numbers on Linux
and Solaris is (C - A).(A).(R), so the example given here would create the
file libgrump.so.3.2.1. Other operating systems might use a different library
file name convention; libtool takes care of the details.
As you release new versions of your library, you will update the library's
C:R:A. Although the rules for changing these version numbers can quickly
become confusing, a few simple tips should help keep you on track. The libtool
documentation goes into greater depth.
In essence, every time you make a change to the library and release it, the
C:R:A should change. A new library should start with 0:0:0. Each time you
change the public interface (i.e., your installed header files), you should
increment the CURRENT number. This is called your interface number. The main
use of this interface number is to tag successive revisions of your API.
The AGE number is how many consecutive versions of the API the current
implementation supports. Thus if the CURRENT library API is the sixth
published version of the interface and it is also binary compatible with the
fourth and fifth versions (i.e., the last two), the C:R:A might be 6:0:2. When
you break binary compatibility, you need to set AGE to 0 and of course
increment CURRENT.
The REVISION marks a change in the source code of the library that doesn't
affect the interface-for example, a minor bug fix. Anytime you increment
CURRENT, you should set REVISION back to 0.
#!/bin/bash
## export NetBSD source to ./export
rm -r export
rm -r export.unpatched
## cvs ... -dexport/src doesn't work
mkdir -p export
cd export
PSERV=:pserver:anoncvs@anoncvs.netbsd.org
## initial login (pw anoncvs)
##cvs -d :pserver:anoncvs@anoncvs.netbsd.org:/cvsroot login
for i in src/common/lib/libc/string/strlcat.c\
src/common/lib/libc/string/strlcpy.c\
src/lib/libc/gen/vis.c\
src/lib/libc/gen/unvis.c\
src/include/vis.h \
src/tools/compat/fgetln.c
do
echo $i
cvs -d $PSERV:/cvsroot export -Dnow -dsrc $i
done
cvs -d $PSERV:/cvsroot export -Dnow -dsrc src/lib/libedit
## hierarchy canges
rm src/readline/Makefile
rm src/TEST/Makefile
rm src/Makefile
rm src/config.h
mv src/TEST examples
mkdir doc
mv src/editline.3 doc/editline.3.roff
mv src/editrc.5 doc/editrc.5.roff
mv src/readline src/editline
mv src/term.h src/el_term.h
cd ..
date +"%Y%m%d" > timestamp.cvsexport
cp -rf export export.unpatched
#!/bin/bash -e
## update EXTRA_DIST list in Makefile.am
f="Makefile.am"
""cd ..
## remove old list
ed $f <<EOF
/^## GENERATED BY SCRIPT/,\$d
w
EOF
## insert new list
echo "## GENERATED BY SCRIPT - DO NOT EDIT BELOW" >> $f
echo "" >> $f
echo "EXTRA_DIST += patches/README \\" >> $f
for i in $(ls -1 patches/*.patch);do printf '%*s%s \\\n' 13 ' ' $i >> $f;done
echo " patches/cvs_export.sh \\
patches/patches_make.sh \\
patches/patches_apply.sh \\
patches/patches_check.sh \\
patches/extra_dist_list.sh \\
patches/update_version.sh \\
patches/update_dist.sh \\
patches/timestamp.cvsexport" >> $f
echo "" >> $f
#!/bin/bash
## apply patches to the ./export hierarchy
for patch in *.patch
do
patch -d export -p1 < $patch
done
#!/bin/bash
## check updated ./export against dist, should be something like:
#Only in ../doc: Makefile.am
#Only in ../doc: Makefile.in
#Only in ../doc: mdoc2man.awk
#Only in ../examples: Makefile.am
#Only in ../examples: Makefile.in
#Only in ../examples: fileman.c
#Only in ../src: Makefile.am
#Only in ../src: Makefile.in
for dir in export/*
do
diff -aur $dir ../${dir#export/}
done
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
# $NetBSD: shlib_version,v 1.16 2006/11/24 00:01:17 christos Exp $
# Remember to update distrib/sets/lists/base/shl.* when changing
#
major=2
minor=10
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论