More trailing white space.
This commit is contained in:
parent
f7abd76933
commit
1528b77539
@ -1,4 +1,4 @@
|
||||
.\" $NetBSD: i386_get_ioperm.2,v 1.7 1999/03/22 19:44:34 garbled Exp $
|
||||
.\" $NetBSD: i386_get_ioperm.2,v 1.8 1999/07/02 15:14:07 simonb Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
.\" All rights reserved.
|
||||
@ -60,7 +60,7 @@ sets the I/O permission bitmap from the data pointed to by
|
||||
.Ar iomap .
|
||||
This call is restricted to the super-user.
|
||||
.Pp
|
||||
The permission bitmap contains
|
||||
The permission bitmap contains
|
||||
1024
|
||||
bits in 32 longwords.
|
||||
If bit
|
||||
@ -102,7 +102,7 @@ allocation in a kernel structure. If you need access to ports beyond
|
||||
use
|
||||
.Xr i386_iopl 2 .
|
||||
.Sh SEE ALSO
|
||||
.Xr i386_iopl 2
|
||||
.Xr i386_iopl 2
|
||||
.Sh REFERENCES
|
||||
i386 Microprocessor Programmer's Reference Manual, Intel
|
||||
.Sh WARNING
|
||||
|
@ -30,7 +30,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" from: @(#)fork.2 6.5 (Berkeley) 3/10/91
|
||||
.\" $NetBSD: i386_get_ldt.2,v 1.5 1999/03/22 19:44:34 garbled Exp $
|
||||
.\" $NetBSD: i386_get_ldt.2,v 1.6 1999/07/02 15:14:07 simonb Exp $
|
||||
.\"
|
||||
.Dd September 20, 1993
|
||||
.Dt I386_GET_LDT 2
|
||||
@ -59,7 +59,7 @@ LDT.
|
||||
Both routines accept a starting selector number
|
||||
.Fa start_sel
|
||||
, an array of memory that
|
||||
will contain the descriptors to be set or returned
|
||||
will contain the descriptors to be set or returned
|
||||
.Fa descs
|
||||
, and the number of entries to set or return
|
||||
.Fa num_sels .
|
||||
|
@ -1,9 +1,9 @@
|
||||
/* $NetBSD: i386_get_ldt.c,v 1.5 1998/02/25 21:24:56 perry Exp $ */
|
||||
/* $NetBSD: i386_get_ldt.c,v 1.6 1999/07/02 15:14:07 simonb Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1993 John Brezak
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
@ -14,7 +14,7 @@
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR `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
|
||||
@ -26,7 +26,7 @@
|
||||
* 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.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
@ -1,9 +1,9 @@
|
||||
/* $NetBSD: i386_set_ldt.c,v 1.5 1998/02/25 21:24:57 perry Exp $ */
|
||||
/* $NetBSD: i386_set_ldt.c,v 1.6 1999/07/02 15:14:07 simonb Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1993 John Brezak
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
@ -14,7 +14,7 @@
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR `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
|
||||
@ -26,7 +26,7 @@
|
||||
* 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.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
@ -1,4 +1,4 @@
|
||||
.\" $NetBSD: i386_vm86.2,v 1.5 1999/03/23 09:40:53 mycroft Exp $
|
||||
.\" $NetBSD: i386_vm86.2,v 1.6 1999/07/02 15:14:07 simonb Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
.\" All rights reserved.
|
||||
@ -16,10 +16,10 @@
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\" 3. All advertising materials mentioning features or use of this software
|
||||
.\" must display the following acknowledgement:
|
||||
.\" This product includes software developed by the NetBSD
|
||||
.\" This product includes software developed by the NetBSD
|
||||
.\" Foundation, Inc. and its contributors.
|
||||
.\" 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||
.\" contributors may be used to endorse or promote products derived
|
||||
.\" 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
@ -57,16 +57,16 @@
|
||||
will set the process into virtual 8086 mode using the registers and
|
||||
selectors specified by the context pointed to by
|
||||
.Ar vmcp .
|
||||
The processor registers are set from
|
||||
The processor registers are set from
|
||||
.Ar vmcp->substr.regs ,
|
||||
and the emulated processor type from
|
||||
and the emulated processor type from
|
||||
.Ar vmcp->substr.ss_cpu_type .
|
||||
.Pp
|
||||
The kernel keeps a pointer to the context, and uses the tables stored at
|
||||
.Ar vmcp->int_byuser
|
||||
and
|
||||
.Ar vmcp->int21_byuser
|
||||
for fast virtual interrupt handling. If the
|
||||
for fast virtual interrupt handling. If the
|
||||
.Ar n th
|
||||
bit is clear in the first of
|
||||
these arrays, then the kernel may directly emulate the real-mode x86 INT
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: i386_vm86.c,v 1.5 1998/09/17 05:15:11 thorpej Exp $ */
|
||||
/* $NetBSD: i386_vm86.c,v 1.6 1999/07/02 15:14:07 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
@ -17,10 +17,10 @@
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the NetBSD
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
|
@ -1,4 +1,4 @@
|
||||
.\" $NetBSD: m68k_sync_icache.2,v 1.3 1999/04/13 16:54:26 kleink Exp $
|
||||
.\" $NetBSD: m68k_sync_icache.2,v 1.4 1999/07/02 15:14:08 simonb Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1999 The NetBSD Foundation, Inc.
|
||||
.\" All rights reserved.
|
||||
@ -41,7 +41,7 @@
|
||||
.Nm m68k_sync_icache
|
||||
.Nd instruction cache synchronization
|
||||
.Sh LIBRARY
|
||||
.Lb libm68k
|
||||
.Lb libm68k
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/types.h>
|
||||
.Fd #include <m68k/sync_icache.h>
|
||||
@ -54,10 +54,10 @@ It should be called prior to executing newly generated code.
|
||||
.Pp
|
||||
The affected address range starts at
|
||||
.Fa start
|
||||
and continues for
|
||||
and continues for
|
||||
.Fa size
|
||||
bytes. If
|
||||
.Fa start
|
||||
bytes. If
|
||||
.Fa start
|
||||
is 0, all the address space of the current execution thread is affected.
|
||||
Addresses outside the specified region may be synchronized, too.
|
||||
.Pp
|
||||
@ -66,7 +66,7 @@ The call always succeeds.
|
||||
.Xr arm32_sync_icache 2
|
||||
.Sh HISTORY
|
||||
.Fn m68k_sync_icache
|
||||
appeared first in
|
||||
appeared first in
|
||||
.Nx 1.4.
|
||||
.Sh AUTHORS
|
||||
Ignatios Souvatzis
|
||||
|
@ -1,4 +1,4 @@
|
||||
.\" $NetBSD: ftime.3,v 1.8 1999/03/22 19:45:13 garbled Exp $
|
||||
.\" $NetBSD: ftime.3,v 1.9 1999/07/02 15:16:40 simonb Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1980, 1991, 1993
|
||||
.\" The Regents of the University of California. All rights reserved.
|
||||
@ -48,7 +48,7 @@
|
||||
.Fn ftime "struct timeb *tp"
|
||||
.Sh DESCRIPTION
|
||||
.Bf -symbolic
|
||||
This interface is obsoleted by
|
||||
This interface is obsoleted by
|
||||
.Xr gettimeofday 2 .
|
||||
It is available from the compatibility library, libcompat.
|
||||
.Ef
|
||||
@ -89,5 +89,5 @@ fields are provided for source compatibility, but are always zero.
|
||||
.Sh HISTORY
|
||||
The
|
||||
.Fn ftime
|
||||
function appeared in
|
||||
function appeared in
|
||||
.Bx 4.1 .
|
||||
|
@ -30,7 +30,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" from: @(#)getpw.3 8.1 (Berkeley) 6/4/93
|
||||
.\" $NetBSD: getpw.3,v 1.4 1998/02/05 18:51:18 perry Exp $
|
||||
.\" $NetBSD: getpw.3,v 1.5 1999/07/02 15:16:40 simonb Exp $
|
||||
.\"
|
||||
.Dd June 4, 1993
|
||||
.Dt GETPW 3
|
||||
@ -44,7 +44,7 @@
|
||||
.Fn getpw uid "char *buf"
|
||||
.Sh DESCRIPTION
|
||||
.Bf -symbolic
|
||||
The getpw function is made obsolete by
|
||||
The getpw function is made obsolete by
|
||||
.Xr getpwuid 3 .
|
||||
It is available from the compatibility library, libcompat.
|
||||
.Ef
|
||||
@ -65,7 +65,7 @@ character.
|
||||
.Sh RETURN VALUES
|
||||
The
|
||||
.Fn getpw
|
||||
function returns the zero if successful, otherwise
|
||||
function returns the zero if successful, otherwise
|
||||
a non-zero if the entry does not exist.
|
||||
.Sh FILES
|
||||
.Bl -tag -width /etc/passwd - compact
|
||||
|
@ -30,7 +30,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" from: @(#)stty.3 8.1 (Berkeley) 6/4/93
|
||||
.\" $NetBSD: stty.3,v 1.5 1999/03/22 19:45:13 garbled Exp $
|
||||
.\" $NetBSD: stty.3,v 1.6 1999/07/02 15:16:40 simonb Exp $
|
||||
.\"
|
||||
.Dd June 4, 1993
|
||||
.Dt STTY 3
|
||||
@ -47,7 +47,7 @@
|
||||
.Fn gtty "int fd" "struct sgttyb *buf"
|
||||
.Sh DESCRIPTION
|
||||
.Bf -symbolic
|
||||
These interfaces are obsoleted by
|
||||
These interfaces are obsoleted by
|
||||
.Xr ioctl 2 .
|
||||
They are available from the compatibility library, libcompat.
|
||||
.Ef
|
||||
@ -75,7 +75,7 @@ the
|
||||
.Fn gtty
|
||||
call is
|
||||
.Ql ioctl(fd, TIOCGETP, buf) .
|
||||
See
|
||||
See
|
||||
.Xr ioctl 2
|
||||
and
|
||||
.Xr tty 4
|
||||
@ -93,5 +93,5 @@ The
|
||||
.Fn stty
|
||||
and
|
||||
.Fn gtty
|
||||
functions appeared in
|
||||
functions appeared in
|
||||
.Bx 4.2 .
|
||||
|
@ -1,4 +1,4 @@
|
||||
.\" $NetBSD: vtimes.3,v 1.6 1999/03/22 19:45:14 garbled Exp $
|
||||
.\" $NetBSD: vtimes.3,v 1.7 1999/07/02 15:16:40 simonb Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1980, 1991, 1993
|
||||
.\" The Regents of the University of California. All rights reserved.
|
||||
@ -46,7 +46,7 @@
|
||||
.Fn vtimes "struct vtimes *par_vm" "struct vtimes *ch_vm"
|
||||
.Sh DESCRIPTION
|
||||
.Bf -symbolic
|
||||
This interface is obsoleted by
|
||||
This interface is obsoleted by
|
||||
.Xr getrusage 2 .
|
||||
It is available from the compatibility library, libcompat.
|
||||
.Ef
|
||||
@ -58,7 +58,7 @@ returns accounting information for the current process and for
|
||||
the terminated child processes of the current
|
||||
process. Either
|
||||
.Fa par_vm
|
||||
or
|
||||
or
|
||||
.Fa ch_vm
|
||||
or both may be 0, in which case only the information for the pointers
|
||||
which are non-zero is returned.
|
||||
@ -103,7 +103,7 @@ pages over 1 cpu-second for its data and stack, then
|
||||
.Fa vm_idsrss
|
||||
would have the value 5*60, where
|
||||
.Fa vm_utime+vm_stime
|
||||
would be the 60.
|
||||
would be the 60.
|
||||
The
|
||||
.Fa vm_idsrss
|
||||
argument
|
||||
@ -117,7 +117,7 @@ function
|
||||
reports the maximum instantaneous sum of the
|
||||
text+data+stack core-resident page count.
|
||||
.Pp
|
||||
The
|
||||
The
|
||||
.Fa vm_majflt
|
||||
field gives the number of page faults which
|
||||
resulted in disk activity; the
|
||||
@ -142,5 +142,5 @@ to the first process to read or write the data.
|
||||
.Sh HISTORY
|
||||
The
|
||||
.Fn vtimes
|
||||
function appeared in
|
||||
function appeared in
|
||||
.Bx 4.2 .
|
||||
|
@ -24,7 +24,7 @@
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $NetBSD: insque.3,v 1.6 1998/02/05 18:51:24 perry Exp $
|
||||
.\" $NetBSD: insque.3,v 1.7 1999/07/02 15:16:41 simonb Exp $
|
||||
.\"
|
||||
.Dd August 12, 1993
|
||||
.Dt INSQUE 3
|
||||
@ -47,7 +47,7 @@
|
||||
.Ft };
|
||||
.br
|
||||
.br
|
||||
.Ft void
|
||||
.Ft void
|
||||
.Fn insque "struct qelem *elem" "struct qelem *pred"
|
||||
.Ft void
|
||||
.Fn remque "struct qelem *elem"
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Copyright (c) 1993 John Brezak
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
@ -12,7 +12,7 @@
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR `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
|
||||
@ -28,7 +28,7 @@
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
__RCSID("$NetBSD: insque.c,v 1.5 1997/10/09 10:20:40 lukem Exp $");
|
||||
__RCSID("$NetBSD: insque.c,v 1.6 1999/07/02 15:16:41 simonb Exp $");
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include <search.h>
|
||||
|
@ -30,7 +30,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" from: @(#)lsearch.3 8.1 (Berkeley) 6/4/93
|
||||
.\" $NetBSD: lsearch.3,v 1.5 1998/08/29 08:32:43 lukem Exp $
|
||||
.\" $NetBSD: lsearch.3,v 1.6 1999/07/02 15:16:41 simonb Exp $
|
||||
.\"
|
||||
.Dd June 4, 1993
|
||||
.Dt LSEARCH 3
|
||||
@ -73,7 +73,7 @@ is a comparison routine which is used to compare two elements.
|
||||
It takes two arguments which point to the
|
||||
.Fa key
|
||||
object and to an array member, in that order, and must return an integer
|
||||
less than, equivalent to, or greater than zero if the
|
||||
less than, equivalent to, or greater than zero if the
|
||||
.Fa key
|
||||
object is considered, respectively, to be less than, equal to, or greater
|
||||
than the array member.
|
||||
|
@ -30,7 +30,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" from: @(#)re_comp.3 8.1 (Berkeley) 6/4/93
|
||||
.\" $NetBSD: re_comp.3,v 1.5 1998/06/01 20:22:01 kleink Exp $
|
||||
.\" $NetBSD: re_comp.3,v 1.6 1999/07/02 15:16:41 simonb Exp $
|
||||
.\"
|
||||
.Dd June 4, 1993
|
||||
.Dt RE_COMP 3
|
||||
@ -57,7 +57,7 @@ It is available from the compatibility library, libcompat.
|
||||
The
|
||||
.Fn re_comp
|
||||
function
|
||||
compiles a string into an internal form suitable for pattern matching.
|
||||
compiles a string into an internal form suitable for pattern matching.
|
||||
The
|
||||
.Fn re_exec
|
||||
function
|
||||
@ -70,7 +70,7 @@ function
|
||||
returns 0 if the string
|
||||
.Fa s
|
||||
was compiled successfully; otherwise a string containing an
|
||||
error message is returned. If
|
||||
error message is returned. If
|
||||
.Fn re_comp
|
||||
is passed 0 or a null string, it returns without changing the currently
|
||||
compiled regular expression.
|
||||
@ -89,10 +89,10 @@ The strings passed to both
|
||||
.Fn re_comp
|
||||
and
|
||||
.Fn re_exec
|
||||
may have trailing or embedded newline characters;
|
||||
may have trailing or embedded newline characters;
|
||||
they are terminated by
|
||||
.Dv NUL Ns s.
|
||||
The regular expressions recognized are described in the manual entry for
|
||||
The regular expressions recognized are described in the manual entry for
|
||||
.Xr ed 1 ,
|
||||
given the above difference.
|
||||
.Sh DIAGNOSTICS
|
||||
@ -125,5 +125,5 @@ The
|
||||
.Fn re_comp
|
||||
and
|
||||
.Fn re_exec
|
||||
functions appeared in
|
||||
functions appeared in
|
||||
.Bx 4.0 .
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Copyright (c) 1993 John Brezak
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
@ -12,7 +12,7 @@
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR `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
|
||||
@ -28,7 +28,7 @@
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
__RCSID("$NetBSD: remque.c,v 1.5 1997/10/09 10:20:54 lukem Exp $");
|
||||
__RCSID("$NetBSD: remque.c,v 1.6 1999/07/02 15:16:41 simonb Exp $");
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include <search.h>
|
||||
|
@ -30,7 +30,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" from: @(#)rexec.3 8.1 (Berkeley) 6/4/93
|
||||
.\" $NetBSD: rexec.3,v 1.8 1999/03/22 19:45:14 garbled Exp $
|
||||
.\" $NetBSD: rexec.3,v 1.9 1999/07/02 15:16:41 simonb Exp $
|
||||
.\"
|
||||
.Dd June 4, 1993
|
||||
.Dt REXEC 3
|
||||
@ -77,7 +77,7 @@ specifies which well-known
|
||||
Internet port to use for
|
||||
the connection; the call
|
||||
.Ql getservbyname(\\*qexec\\*q, \\*qtcp\\*q)
|
||||
(see
|
||||
(see
|
||||
.Xr getservent 3 )
|
||||
will return a pointer to a structure, which contains the
|
||||
necessary port.
|
||||
@ -109,10 +109,10 @@ as the secondary connection is set up after authorization has been
|
||||
verified.
|
||||
If
|
||||
.Fa fd2p
|
||||
is 0, then the
|
||||
is 0, then the
|
||||
.Em stderr
|
||||
(unit 2 of the remote
|
||||
command) will be made the same as the
|
||||
command) will be made the same as the
|
||||
.Em stdout
|
||||
and no
|
||||
provision is made for sending arbitrary signals to the remote process,
|
||||
@ -123,5 +123,5 @@ although you may be able to get its attention by using out-of-band data.
|
||||
.Sh HISTORY
|
||||
The
|
||||
.Fn rexec
|
||||
function appeared in
|
||||
function appeared in
|
||||
.Bx 4.2 .
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rexec.c,v 1.10 1999/05/09 12:28:15 mycroft Exp $ */
|
||||
/* $NetBSD: rexec.c,v 1.11 1999/07/02 15:16:41 simonb Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)rexec.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: rexec.c,v 1.10 1999/05/09 12:28:15 mycroft Exp $");
|
||||
__RCSID("$NetBSD: rexec.c,v 1.11 1999/07/02 15:16:41 simonb Exp $");
|
||||
#endif
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
@ -114,7 +114,7 @@ retry:
|
||||
int s2;
|
||||
struct sockaddr_in sin2;
|
||||
socklen_t sin2len;
|
||||
|
||||
|
||||
s2 = socket(AF_INET, SOCK_STREAM, 0);
|
||||
if (s2 == -1) {
|
||||
warn("Error creating socket");
|
||||
|
@ -30,7 +30,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" from: @(#)ctermid.3 5.2 (Berkeley) 4/19/91
|
||||
.\" $NetBSD: cuserid.3,v 1.5 1998/02/05 18:51:29 perry Exp $
|
||||
.\" $NetBSD: cuserid.3,v 1.6 1999/07/02 15:16:41 simonb Exp $
|
||||
.\"
|
||||
.Dd November 28, 1993
|
||||
.Dt CUSERID 3
|
||||
@ -53,7 +53,7 @@ has been obsoleted by
|
||||
.Pp
|
||||
The
|
||||
.Fn cuserid
|
||||
function returns a character string representation of the user name
|
||||
function returns a character string representation of the user name
|
||||
associated with the effective user ID of the calling process.
|
||||
.Pp
|
||||
If
|
||||
@ -73,25 +73,25 @@ bytes long.
|
||||
Otherwise, the user name is copied to a static buffer.
|
||||
.Pp
|
||||
.Sh RETURN VALUES
|
||||
If
|
||||
If
|
||||
.Fa buf
|
||||
is not the
|
||||
.Dv NULL
|
||||
.Dv NULL
|
||||
pointer,
|
||||
.Fa buf
|
||||
.Fa buf
|
||||
is returned;
|
||||
otherwise the address of the static buffer is returned.
|
||||
.Pp
|
||||
If the user name could not be determined, if
|
||||
If the user name could not be determined, if
|
||||
.Fa buf
|
||||
is not the
|
||||
is not the
|
||||
.Dv NULL
|
||||
pointer, the null character
|
||||
.Sq \e0
|
||||
will be stored at
|
||||
will be stored at
|
||||
.Fa *buf ;
|
||||
otherwise
|
||||
the
|
||||
the
|
||||
.Dv NULL
|
||||
pointer is returned.
|
||||
.Sh SEE ALSO
|
||||
@ -104,16 +104,16 @@ function conforms to
|
||||
.St -p1003.1-88 .
|
||||
.Sh BUGS
|
||||
Due to irreconcilable differences in historic implementations,
|
||||
.Fn cuserid
|
||||
.Fn cuserid
|
||||
was removed from the
|
||||
.St -p1003.1-90
|
||||
.St -p1003.1-90
|
||||
standard.
|
||||
This implementation exists purely for compatibility with existing programs.
|
||||
New programs should use one of the following three alternatives to
|
||||
New programs should use one of the following three alternatives to
|
||||
obtain the user name:
|
||||
.Pp
|
||||
.Bl -enum -offset indent -compact
|
||||
.It
|
||||
.It
|
||||
.Fn getlogin
|
||||
to return the user's login name.
|
||||
.It
|
||||
@ -128,10 +128,10 @@ The
|
||||
.Fn cuserid
|
||||
function uses
|
||||
.Fn getpwuid ;
|
||||
thus the results of a user's call to
|
||||
thus the results of a user's call to
|
||||
.Fn getpwent ,
|
||||
.Fn getpwnam
|
||||
or
|
||||
.Fn getpwuid
|
||||
will be overwritten by subsequent calls to
|
||||
will be overwritten by subsequent calls to
|
||||
.Fn cuserid .
|
||||
|
@ -35,7 +35,7 @@
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: regexp.c,v 1.10 1999/05/04 17:15:51 christos Exp $");
|
||||
__RCSID("$NetBSD: regexp.c,v 1.11 1999/07/02 15:16:42 simonb Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <regexp.h>
|
||||
@ -343,7 +343,7 @@ int *flagp;
|
||||
}
|
||||
|
||||
/* Make a closing node, and hook it on the end. */
|
||||
ender = regnode((paren) ? CLOSE+parno : END);
|
||||
ender = regnode((paren) ? CLOSE+parno : END);
|
||||
regtail(ret, ender);
|
||||
|
||||
/* Hook the tails of the branches to the closing node. */
|
||||
@ -573,7 +573,7 @@ int *flagp;
|
||||
* On entry, the char at regparse[-1] is going to go
|
||||
* into the string, no matter what it is. (It could be
|
||||
* following a \ if we are entered from the '\' case.)
|
||||
*
|
||||
*
|
||||
* Basic idea is to pick up a good char in ch and
|
||||
* examine the next char. If it's *+? then we twiddle.
|
||||
* If it's \ then we frozzle. If it's other magic char
|
||||
@ -628,7 +628,7 @@ int *flagp;
|
||||
default:
|
||||
/* Backup point is \, scan * point is after it. */
|
||||
regprev = regparse;
|
||||
regparse++;
|
||||
regparse++;
|
||||
continue; /* NOT break; */
|
||||
}
|
||||
}
|
||||
@ -951,7 +951,7 @@ char *prog;
|
||||
if (*opnd != *reginput)
|
||||
return(0);
|
||||
len = strlen(opnd);
|
||||
if (len > 1 && strncmp(opnd, reginput,
|
||||
if (len > 1 && strncmp(opnd, reginput,
|
||||
(size_t)len) != 0)
|
||||
return(0);
|
||||
reginput += len;
|
||||
@ -1179,7 +1179,7 @@ regexp *r;
|
||||
next = regnext(s);
|
||||
if (next == NULL) /* Next ptr. */
|
||||
printf("(0)");
|
||||
else
|
||||
else
|
||||
printf("(%d)", (s-r->program)+(next-s));
|
||||
s += 3;
|
||||
if (op == ANYOF || op == ANYBUT || op == EXACTLY) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
.\" $NetBSD: crypt.3,v 1.6 1998/06/01 20:24:46 kleink Exp $
|
||||
.\" $NetBSD: crypt.3,v 1.7 1999/07/02 15:18:37 simonb Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1989, 1991, 1993
|
||||
.\" The Regents of the University of California. All rights reserved.
|
||||
@ -79,7 +79,7 @@ underscore (``_'') followed by 4 bytes of iteration count and 4 bytes
|
||||
of salt.
|
||||
Both the iteration
|
||||
.Fa count
|
||||
and the
|
||||
and the
|
||||
.Fa salt
|
||||
are encoded with 6 bits per character, least significant bits first.
|
||||
The values 0 to 63 are encoded by the characters ``./0-9A-Za-z'',
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile,v 1.16 1999/03/04 11:45:22 itohy Exp $
|
||||
# $NetBSD: Makefile,v 1.17 1999/07/02 15:21:23 simonb Exp $
|
||||
# @(#)Makefile 8.1 (Berkeley) 6/4/93
|
||||
|
||||
LIB= edit
|
||||
@ -27,11 +27,11 @@ INCSDIR=/usr/include
|
||||
LINKS=${INCSDIR}/readline.h ${INCSDIR}/history.h
|
||||
|
||||
CLEANFILES+=common.h editline.c emacs.h fcns.c fcns.h help.c help.h vi.h
|
||||
CPPFLAGS+=-I. -I${.CURDIR}
|
||||
CPPFLAGS+=-I. -I${.CURDIR}
|
||||
CPPFLAGS+=#-DDEBUG_TTY -DDEBUG_KEY -DDEBUG_READ -DDEBUG -DDEBUG_REFRESH
|
||||
CPPFLAGS+=#-DDEBUG_PASTE
|
||||
|
||||
AHDR=vi.h emacs.h common.h
|
||||
AHDR=vi.h emacs.h common.h
|
||||
ASRC=${.CURDIR}/vi.c ${.CURDIR}/emacs.c ${.CURDIR}/common.c
|
||||
|
||||
vi.h: vi.c makelist
|
||||
@ -49,7 +49,7 @@ fcns.h: ${AHDR} makelist
|
||||
fcns.c: ${AHDR} fcns.h makelist
|
||||
sh ${.CURDIR}/makelist -fc ${AHDR} > ${.TARGET}
|
||||
|
||||
help.c: ${ASRC} makelist
|
||||
help.c: ${ASRC} makelist
|
||||
sh ${.CURDIR}/makelist -bc ${ASRC} > ${.TARGET}
|
||||
|
||||
help.h: ${ASRC} makelist
|
||||
@ -59,8 +59,8 @@ editline.c: ${OSRCS}
|
||||
sh ${.CURDIR}/makelist -e ${.ALLSRC:T} > ${.TARGET}
|
||||
|
||||
test.o: ${.CURDIR}/TEST/test.c
|
||||
|
||||
test: libedit.a test.o
|
||||
|
||||
test: libedit.a test.o
|
||||
${CC} ${LDFLAGS} ${.ALLSRC} -o ${.TARGET} libedit.a ${LDADD} -ltermcap
|
||||
|
||||
# minimal dependency to make "make depend" optional
|
||||
|
@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1992, 1993\n\
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)test.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: test.c,v 1.6 1998/05/20 01:38:53 christos Exp $");
|
||||
__RCSID("$NetBSD: test.c,v 1.7 1999/07/02 15:21:28 simonb Exp $");
|
||||
#endif
|
||||
#endif /* not lint && not SCCSID */
|
||||
|
||||
@ -96,7 +96,7 @@ complete(el, ch)
|
||||
EditLine *el;
|
||||
int ch;
|
||||
{
|
||||
DIR *dd = opendir(".");
|
||||
DIR *dd = opendir(".");
|
||||
struct dirent *dp;
|
||||
const char* ptr;
|
||||
const LineInfo *lf = el_line(el);
|
||||
@ -191,7 +191,7 @@ main(argc, argv)
|
||||
* Append to the right event in case the user
|
||||
* moved around in history.
|
||||
*/
|
||||
if (history(hist, &ev, H_SET, lastevent) == -1)
|
||||
if (history(hist, &ev, H_SET, lastevent) == -1)
|
||||
err(1, "%d: %s\n", lastevent, ev.str);
|
||||
history(hist, &ev, H_ADD , buf);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: chared.c,v 1.6 1999/02/05 20:53:49 christos Exp $ */
|
||||
/* $NetBSD: chared.c,v 1.7 1999/07/02 15:21:23 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -41,11 +41,11 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)chared.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: chared.c,v 1.6 1999/02/05 20:53:49 christos Exp $");
|
||||
__RCSID("$NetBSD: chared.c,v 1.7 1999/07/02 15:21:23 simonb Exp $");
|
||||
#endif
|
||||
#endif /* not lint && not SCCSID */
|
||||
|
||||
/*
|
||||
/*
|
||||
* chared.c: Character editor utilities
|
||||
*/
|
||||
#include "sys.h"
|
||||
@ -75,7 +75,7 @@ cv_undo(el, action, size, ptr)
|
||||
}
|
||||
|
||||
|
||||
/* c_insert():
|
||||
/* c_insert():
|
||||
* Insert num characters
|
||||
*/
|
||||
protected void
|
||||
@ -88,7 +88,7 @@ c_insert(el, num)
|
||||
if (el->el_line.lastchar + num >= el->el_line.limit)
|
||||
return; /* can't go past end of buffer */
|
||||
|
||||
if (el->el_line.cursor < el->el_line.lastchar) {
|
||||
if (el->el_line.cursor < el->el_line.lastchar) {
|
||||
/* if I must move chars */
|
||||
for (cp = el->el_line.lastchar; cp >= el->el_line.cursor; cp--)
|
||||
cp[num] = *cp;
|
||||
@ -101,7 +101,7 @@ c_insert(el, num)
|
||||
* Delete num characters after the cursor
|
||||
*/
|
||||
protected void
|
||||
c_delafter(el, num)
|
||||
c_delafter(el, num)
|
||||
EditLine *el;
|
||||
int num;
|
||||
{
|
||||
@ -109,10 +109,10 @@ c_delafter(el, num)
|
||||
if (el->el_line.cursor + num > el->el_line.lastchar)
|
||||
num = el->el_line.lastchar - el->el_line.cursor;
|
||||
|
||||
if (num > 0) {
|
||||
if (num > 0) {
|
||||
char *cp;
|
||||
|
||||
if (el->el_map.current != el->el_map.emacs)
|
||||
if (el->el_map.current != el->el_map.emacs)
|
||||
cv_undo(el, INSERT, (size_t)num, el->el_line.cursor);
|
||||
|
||||
for (cp = el->el_line.cursor; cp <= el->el_line.lastchar; cp++)
|
||||
@ -133,12 +133,12 @@ c_delbefore(el, num)
|
||||
{
|
||||
|
||||
if (el->el_line.cursor - num < el->el_line.buffer)
|
||||
num = el->el_line.cursor - el->el_line.buffer;
|
||||
num = el->el_line.cursor - el->el_line.buffer;
|
||||
|
||||
if (num > 0) {
|
||||
if (num > 0) {
|
||||
char *cp;
|
||||
|
||||
if (el->el_map.current != el->el_map.emacs)
|
||||
if (el->el_map.current != el->el_map.emacs)
|
||||
cv_undo(el, INSERT, (size_t)num, el->el_line.cursor - num);
|
||||
|
||||
for (cp = el->el_line.cursor - num; cp <= el->el_line.lastchar; cp++)
|
||||
@ -153,7 +153,7 @@ c_delbefore(el, num)
|
||||
* Return if p is part of a word according to emacs
|
||||
*/
|
||||
protected int
|
||||
ce__isword(p)
|
||||
ce__isword(p)
|
||||
int p;
|
||||
{
|
||||
return isalpha(p) || isdigit(p) || strchr("*?_-.[]~=", p) != NULL;
|
||||
@ -164,7 +164,7 @@ ce__isword(p)
|
||||
* Return if p is part of a word according to vi
|
||||
*/
|
||||
protected int
|
||||
cv__isword(p)
|
||||
cv__isword(p)
|
||||
int p;
|
||||
{
|
||||
return !isspace(p);
|
||||
@ -175,7 +175,7 @@ cv__isword(p)
|
||||
* Find the previous word
|
||||
*/
|
||||
protected char *
|
||||
c__prev_word(p, low, n, wtest)
|
||||
c__prev_word(p, low, n, wtest)
|
||||
char *p, *low;
|
||||
int n;
|
||||
int (*wtest) __P((int));
|
||||
@ -183,9 +183,9 @@ c__prev_word(p, low, n, wtest)
|
||||
p--;
|
||||
|
||||
while (n--) {
|
||||
while ((p >= low) && !(*wtest)((unsigned char) *p))
|
||||
while ((p >= low) && !(*wtest)((unsigned char) *p))
|
||||
p--;
|
||||
while ((p >= low) && (*wtest)((unsigned char) *p))
|
||||
while ((p >= low) && (*wtest)((unsigned char) *p))
|
||||
p--;
|
||||
}
|
||||
|
||||
@ -208,9 +208,9 @@ c__next_word(p, high, n, wtest)
|
||||
int (*wtest) __P((int));
|
||||
{
|
||||
while (n--) {
|
||||
while ((p < high) && !(*wtest)((unsigned char) *p))
|
||||
while ((p < high) && !(*wtest)((unsigned char) *p))
|
||||
p++;
|
||||
while ((p < high) && (*wtest)((unsigned char) *p))
|
||||
while ((p < high) && (*wtest)((unsigned char) *p))
|
||||
p++;
|
||||
}
|
||||
if (p > high)
|
||||
@ -233,14 +233,14 @@ cv_next_word(el, p, high, n, wtest)
|
||||
|
||||
while (n--) {
|
||||
test = (*wtest)((unsigned char) *p);
|
||||
while ((p < high) && (*wtest)((unsigned char) *p) == test)
|
||||
while ((p < high) && (*wtest)((unsigned char) *p) == test)
|
||||
p++;
|
||||
/*
|
||||
* vi historically deletes with cw only the word preserving the
|
||||
* trailing whitespace! This is not what 'w' does..
|
||||
*/
|
||||
if (el->el_chared.c_vcmd.action != (DELETE|INSERT))
|
||||
while ((p < high) && isspace((unsigned char) *p))
|
||||
if (el->el_chared.c_vcmd.action != (DELETE|INSERT))
|
||||
while ((p < high) && isspace((unsigned char) *p))
|
||||
p++;
|
||||
}
|
||||
|
||||
@ -270,14 +270,14 @@ cv_prev_word(el, p, low, n, wtest)
|
||||
* vi historically deletes with cb only the word preserving the
|
||||
* leading whitespace! This is not what 'b' does..
|
||||
*/
|
||||
if (el->el_chared.c_vcmd.action != (DELETE|INSERT))
|
||||
while ((p > low) && isspace((unsigned char) *p))
|
||||
if (el->el_chared.c_vcmd.action != (DELETE|INSERT))
|
||||
while ((p > low) && isspace((unsigned char) *p))
|
||||
p--;
|
||||
test = (*wtest)((unsigned char) *p);
|
||||
while ((p >= low) && (*wtest)((unsigned char) *p) == test)
|
||||
while ((p >= low) && (*wtest)((unsigned char) *p) == test)
|
||||
p--;
|
||||
p++;
|
||||
while (isspace((unsigned char) *p))
|
||||
while (isspace((unsigned char) *p))
|
||||
p++;
|
||||
}
|
||||
|
||||
@ -327,7 +327,7 @@ c__number(p, num, dval)
|
||||
* Finish vi delete action
|
||||
*/
|
||||
protected void
|
||||
cv_delfini(el)
|
||||
cv_delfini(el)
|
||||
EditLine *el;
|
||||
{
|
||||
int size;
|
||||
@ -339,13 +339,13 @@ cv_delfini(el)
|
||||
oaction = el->el_chared.c_vcmd.action;
|
||||
el->el_chared.c_vcmd.action = NOP;
|
||||
|
||||
if (el->el_chared.c_vcmd.pos == 0)
|
||||
if (el->el_chared.c_vcmd.pos == 0)
|
||||
return;
|
||||
|
||||
|
||||
if (el->el_line.cursor > el->el_chared.c_vcmd.pos) {
|
||||
size = (int) (el->el_line.cursor - el->el_chared.c_vcmd.pos);
|
||||
c_delbefore(el, size);
|
||||
c_delbefore(el, size);
|
||||
el->el_line.cursor = el->el_chared.c_vcmd.pos;
|
||||
re_refresh_cursor(el);
|
||||
}
|
||||
@ -370,7 +370,7 @@ cv_delfini(el)
|
||||
abort();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
el->el_chared.c_undo.ptr = el->el_line.cursor;
|
||||
el->el_chared.c_undo.dsize = size;
|
||||
@ -391,7 +391,7 @@ ce__endword(p, high, n)
|
||||
while (n--) {
|
||||
while ((p < high) && isspace((unsigned char) *p))
|
||||
p++;
|
||||
while ((p < high) && !isspace((unsigned char) *p))
|
||||
while ((p < high) && !isspace((unsigned char) *p))
|
||||
p++;
|
||||
}
|
||||
|
||||
@ -412,14 +412,14 @@ cv__endword(p, high, n)
|
||||
p++;
|
||||
|
||||
while (n--) {
|
||||
while ((p < high) && isspace((unsigned char) *p))
|
||||
while ((p < high) && isspace((unsigned char) *p))
|
||||
p++;
|
||||
|
||||
if (isalnum((unsigned char) *p))
|
||||
while ((p < high) && isalnum((unsigned char) *p))
|
||||
while ((p < high) && isalnum((unsigned char) *p))
|
||||
p++;
|
||||
else
|
||||
while ((p < high) && !(isspace((unsigned char) *p) ||
|
||||
while ((p < high) && !(isspace((unsigned char) *p) ||
|
||||
isalnum((unsigned char) *p)))
|
||||
p++;
|
||||
}
|
||||
@ -466,7 +466,7 @@ ch_init(el)
|
||||
|
||||
el->el_chared.c_macro.nline = NULL;
|
||||
el->el_chared.c_macro.level = -1;
|
||||
el->el_chared.c_macro.macro = (char **) el_malloc(EL_MAXMACRO *
|
||||
el->el_chared.c_macro.macro = (char **) el_malloc(EL_MAXMACRO *
|
||||
sizeof(char *));
|
||||
return 0;
|
||||
}
|
||||
@ -559,7 +559,7 @@ el_deletestr(el, n)
|
||||
if (n <= 0)
|
||||
return;
|
||||
|
||||
if (el->el_line.cursor < &el->el_line.buffer[n])
|
||||
if (el->el_line.cursor < &el->el_line.buffer[n])
|
||||
return;
|
||||
|
||||
c_delbefore(el, n); /* delete before dot */
|
||||
@ -638,7 +638,7 @@ c_hpos(el)
|
||||
if (el->el_line.cursor == el->el_line.buffer)
|
||||
return 0;
|
||||
else {
|
||||
for (ptr = el->el_line.cursor - 1;
|
||||
for (ptr = el->el_line.cursor - 1;
|
||||
ptr >= el->el_line.buffer && *ptr != '\n';
|
||||
ptr--)
|
||||
continue;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: chared.h,v 1.3 1998/12/12 20:08:21 christos Exp $ */
|
||||
/* $NetBSD: chared.h,v 1.4 1999/07/02 15:21:23 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -56,7 +56,7 @@
|
||||
* like real vi: i.e. the transition from command<->insert modes moves
|
||||
* the cursor.
|
||||
*
|
||||
* On the other hand we really don't want to move the cursor, because
|
||||
* On the other hand we really don't want to move the cursor, because
|
||||
* all the editing commands don't include the character under the cursor.
|
||||
* Probably the best fix is to make all the editing commands aware of
|
||||
* this fact.
|
||||
@ -70,7 +70,7 @@ typedef struct c_macro_t {
|
||||
char *nline;
|
||||
} c_macro_t;
|
||||
|
||||
/*
|
||||
/*
|
||||
* Undo information for both vi and emacs
|
||||
*/
|
||||
typedef struct c_undo_t {
|
||||
@ -141,7 +141,7 @@ protected void cv_delfini __P((EditLine *));
|
||||
protected char *cv__endword __P((char *, char *, int));
|
||||
protected int ce__isword __P((int));
|
||||
protected void cv_undo __P((EditLine *, int, size_t, char *));
|
||||
protected char *cv_next_word __P((EditLine*, char *, char *, int,
|
||||
protected char *cv_next_word __P((EditLine*, char *, char *, int,
|
||||
int (*)(int)));
|
||||
protected char *cv_prev_word __P((EditLine*, char *, char *, int,
|
||||
int (*)(int)));
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: common.c,v 1.7 1998/12/12 20:08:21 christos Exp $ */
|
||||
/* $NetBSD: common.c,v 1.8 1999/07/02 15:21:23 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -41,7 +41,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)common.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: common.c,v 1.7 1998/12/12 20:08:21 christos Exp $");
|
||||
__RCSID("$NetBSD: common.c,v 1.8 1999/07/02 15:21:23 simonb Exp $");
|
||||
#endif
|
||||
#endif /* not lint && not SCCSID */
|
||||
|
||||
@ -51,7 +51,7 @@ __RCSID("$NetBSD: common.c,v 1.7 1998/12/12 20:08:21 christos Exp $");
|
||||
#include "sys.h"
|
||||
#include "el.h"
|
||||
|
||||
/* ed_end_of_file():
|
||||
/* ed_end_of_file():
|
||||
* Indicate end of file
|
||||
* [^D]
|
||||
*/
|
||||
@ -67,7 +67,7 @@ ed_end_of_file(el, c)
|
||||
}
|
||||
|
||||
|
||||
/* ed_insert():
|
||||
/* ed_insert():
|
||||
* Add character to the line
|
||||
* Insert a character [bound to all insert keys]
|
||||
*/
|
||||
@ -81,16 +81,16 @@ ed_insert(el, c)
|
||||
if (c == '\0')
|
||||
return CC_ERROR;
|
||||
|
||||
if (el->el_line.lastchar + el->el_state.argument >=
|
||||
if (el->el_line.lastchar + el->el_state.argument >=
|
||||
el->el_line.limit)
|
||||
return CC_ERROR; /* end of buffer space */
|
||||
|
||||
if (el->el_state.argument == 1) {
|
||||
if (el->el_state.inputmode != MODE_INSERT) {
|
||||
el->el_chared.c_undo.buf[el->el_chared.c_undo.isize++] =
|
||||
el->el_chared.c_undo.buf[el->el_chared.c_undo.isize++] =
|
||||
*el->el_line.cursor;
|
||||
el->el_chared.c_undo.buf[el->el_chared.c_undo.isize] = '\0';
|
||||
c_delafter(el, 1);
|
||||
c_delafter(el, 1);
|
||||
}
|
||||
|
||||
c_insert(el, 1);
|
||||
@ -102,12 +102,12 @@ ed_insert(el, c)
|
||||
else {
|
||||
if (el->el_state.inputmode != MODE_INSERT) {
|
||||
|
||||
for(i = 0;i < el->el_state.argument; i++)
|
||||
el->el_chared.c_undo.buf[el->el_chared.c_undo.isize++] =
|
||||
for(i = 0;i < el->el_state.argument; i++)
|
||||
el->el_chared.c_undo.buf[el->el_chared.c_undo.isize++] =
|
||||
el->el_line.cursor[i];
|
||||
|
||||
el->el_chared.c_undo.buf[el->el_chared.c_undo.isize] = '\0';
|
||||
c_delafter(el, el->el_state.argument);
|
||||
c_delafter(el, el->el_state.argument);
|
||||
}
|
||||
|
||||
c_insert(el, el->el_state.argument);
|
||||
@ -124,7 +124,7 @@ ed_insert(el, c)
|
||||
}
|
||||
|
||||
|
||||
/* ed_delete_prev_word():
|
||||
/* ed_delete_prev_word():
|
||||
* Delete from beginning of current word to cursor
|
||||
* [M-^?] [^W]
|
||||
*/
|
||||
@ -139,7 +139,7 @@ ed_delete_prev_word(el, c)
|
||||
if (el->el_line.cursor == el->el_line.buffer)
|
||||
return CC_ERROR;
|
||||
|
||||
cp = c__prev_word(el->el_line.cursor, el->el_line.buffer,
|
||||
cp = c__prev_word(el->el_line.cursor, el->el_line.buffer,
|
||||
el->el_state.argument, ce__isword);
|
||||
|
||||
for (p = cp, kp = el->el_chared.c_kill.buf; p < el->el_line.cursor; p++)
|
||||
@ -154,7 +154,7 @@ ed_delete_prev_word(el, c)
|
||||
}
|
||||
|
||||
|
||||
/* ed_delete_next_char():
|
||||
/* ed_delete_next_char():
|
||||
* Delete character under cursor
|
||||
* [^D] [x]
|
||||
*/
|
||||
@ -167,13 +167,13 @@ ed_delete_next_char(el, c)
|
||||
#ifdef notdef /* XXX */
|
||||
#define EL el->el_line
|
||||
(void) fprintf(el->el_errlfile,
|
||||
"\nD(b: %x(%s) c: %x(%s) last: %x(%s) limit: %x(%s)\n",
|
||||
"\nD(b: %x(%s) c: %x(%s) last: %x(%s) limit: %x(%s)\n",
|
||||
EL.buffer, EL.buffer, EL.cursor, EL.cursor, EL.lastchar,
|
||||
EL.lastchar, EL.limit, EL.limit);
|
||||
#endif
|
||||
if (el->el_line.cursor == el->el_line.lastchar) {/* if I'm at the end */
|
||||
if (el->el_map.type == MAP_VI) {
|
||||
if (el->el_line.cursor == el->el_line.buffer) {
|
||||
if (el->el_line.cursor == el->el_line.buffer) {
|
||||
/* if I'm also at the beginning */
|
||||
#ifdef KSHVI
|
||||
return CC_ERROR;
|
||||
@ -205,7 +205,7 @@ ed_delete_next_char(el, c)
|
||||
}
|
||||
|
||||
|
||||
/* ed_kill_line():
|
||||
/* ed_kill_line():
|
||||
* Cut to the end of line
|
||||
* [^K] [^K]
|
||||
*/
|
||||
@ -227,7 +227,7 @@ ed_kill_line(el, c)
|
||||
}
|
||||
|
||||
|
||||
/* ed_move_to_end():
|
||||
/* ed_move_to_end():
|
||||
* Move cursor to the end of line
|
||||
* [^E] [^E]
|
||||
*/
|
||||
@ -251,7 +251,7 @@ ed_move_to_end(el, c)
|
||||
}
|
||||
|
||||
|
||||
/* ed_move_to_beg():
|
||||
/* ed_move_to_beg():
|
||||
* Move cursor to the beginning of line
|
||||
* [^A] [^A]
|
||||
*/
|
||||
@ -265,7 +265,7 @@ ed_move_to_beg(el, c)
|
||||
|
||||
if (el->el_map.type == MAP_VI) {
|
||||
/* We want FIRST non space character */
|
||||
while (isspace((unsigned char) *el->el_line.cursor))
|
||||
while (isspace((unsigned char) *el->el_line.cursor))
|
||||
el->el_line.cursor++;
|
||||
if (el->el_chared.c_vcmd.action & DELETE) {
|
||||
cv_delfini(el);
|
||||
@ -277,7 +277,7 @@ ed_move_to_beg(el, c)
|
||||
}
|
||||
|
||||
|
||||
/* ed_transpose_chars():
|
||||
/* ed_transpose_chars():
|
||||
* Exchange the character to the left of the cursor with the one under it
|
||||
* [^T] [^T]
|
||||
*/
|
||||
@ -289,7 +289,7 @@ ed_transpose_chars(el, c)
|
||||
if (el->el_line.cursor < el->el_line.lastchar) {
|
||||
if (el->el_line.lastchar <= &el->el_line.buffer[1])
|
||||
return CC_ERROR;
|
||||
else
|
||||
else
|
||||
el->el_line.cursor++;
|
||||
}
|
||||
if (el->el_line.cursor > &el->el_line.buffer[1]) {
|
||||
@ -299,12 +299,12 @@ ed_transpose_chars(el, c)
|
||||
el->el_line.cursor[-1] = c;
|
||||
return CC_REFRESH;
|
||||
}
|
||||
else
|
||||
else
|
||||
return CC_ERROR;
|
||||
}
|
||||
|
||||
|
||||
/* ed_next_char():
|
||||
/* ed_next_char():
|
||||
* Move to the right one character
|
||||
* [^F] [^F]
|
||||
*/
|
||||
@ -331,7 +331,7 @@ ed_next_char(el, c)
|
||||
}
|
||||
|
||||
|
||||
/* ed_prev_word():
|
||||
/* ed_prev_word():
|
||||
* Move to the beginning of the current word
|
||||
* [M-b] [b]
|
||||
*/
|
||||
@ -344,8 +344,8 @@ ed_prev_word(el, c)
|
||||
if (el->el_line.cursor == el->el_line.buffer)
|
||||
return CC_ERROR;
|
||||
|
||||
el->el_line.cursor = c__prev_word(el->el_line.cursor, el->el_line.buffer,
|
||||
el->el_state.argument,
|
||||
el->el_line.cursor = c__prev_word(el->el_line.cursor, el->el_line.buffer,
|
||||
el->el_state.argument,
|
||||
ce__isword);
|
||||
|
||||
if (el->el_map.type == MAP_VI)
|
||||
@ -358,7 +358,7 @@ ed_prev_word(el, c)
|
||||
}
|
||||
|
||||
|
||||
/* ed_prev_char():
|
||||
/* ed_prev_char():
|
||||
* Move to the left one character
|
||||
* [^B] [^B]
|
||||
*/
|
||||
@ -381,12 +381,12 @@ ed_prev_char(el, c)
|
||||
|
||||
return CC_CURSOR;
|
||||
}
|
||||
else
|
||||
else
|
||||
return CC_ERROR;
|
||||
}
|
||||
|
||||
|
||||
/* ed_quoted_insert():
|
||||
/* ed_quoted_insert():
|
||||
* Add the next character typed verbatim
|
||||
* [^V] [^V]
|
||||
*/
|
||||
@ -409,7 +409,7 @@ ed_quoted_insert(el, c)
|
||||
}
|
||||
|
||||
|
||||
/* ed_digit():
|
||||
/* ed_digit():
|
||||
* Adds to argument or enters a digit
|
||||
*/
|
||||
protected el_action_t
|
||||
@ -420,14 +420,14 @@ ed_digit(el, c)
|
||||
if (!isdigit(c))
|
||||
return CC_ERROR;
|
||||
|
||||
if (el->el_state.doingarg) {
|
||||
if (el->el_state.doingarg) {
|
||||
/* if doing an arg, add this in... */
|
||||
if (el->el_state.lastcmd == EM_UNIVERSAL_ARGUMENT)
|
||||
if (el->el_state.lastcmd == EM_UNIVERSAL_ARGUMENT)
|
||||
el->el_state.argument = c - '0';
|
||||
else {
|
||||
if (el->el_state.argument > 1000000)
|
||||
return CC_ERROR;
|
||||
el->el_state.argument =
|
||||
el->el_state.argument =
|
||||
(el->el_state.argument * 10) + (c - '0');
|
||||
}
|
||||
return CC_ARGHACK;
|
||||
@ -437,10 +437,10 @@ ed_digit(el, c)
|
||||
return CC_ERROR;
|
||||
|
||||
if (el->el_state.inputmode != MODE_INSERT) {
|
||||
el->el_chared.c_undo.buf[el->el_chared.c_undo.isize++] =
|
||||
el->el_chared.c_undo.buf[el->el_chared.c_undo.isize++] =
|
||||
*el->el_line.cursor;
|
||||
el->el_chared.c_undo.buf[el->el_chared.c_undo.isize] = '\0';
|
||||
c_delafter(el, 1);
|
||||
c_delafter(el, 1);
|
||||
}
|
||||
c_insert(el, 1);
|
||||
*el->el_line.cursor++ = c;
|
||||
@ -451,7 +451,7 @@ ed_digit(el, c)
|
||||
}
|
||||
|
||||
|
||||
/* ed_argument_digit():
|
||||
/* ed_argument_digit():
|
||||
* Digit that starts argument
|
||||
* For ESC-n
|
||||
*/
|
||||
@ -476,7 +476,7 @@ ed_argument_digit(el, c)
|
||||
}
|
||||
|
||||
|
||||
/* ed_unassigned():
|
||||
/* ed_unassigned():
|
||||
* Indicates unbound character
|
||||
* Bound to keys that are not assigned
|
||||
*/
|
||||
@ -496,7 +496,7 @@ ed_unassigned(el, c)
|
||||
** TTY key handling.
|
||||
**/
|
||||
|
||||
/* ed_tty_sigint():
|
||||
/* ed_tty_sigint():
|
||||
* Tty interrupt character
|
||||
* [^C]
|
||||
*/
|
||||
@ -505,12 +505,12 @@ protected el_action_t
|
||||
ed_tty_sigint(el, c)
|
||||
EditLine *el;
|
||||
int c;
|
||||
{
|
||||
{
|
||||
return CC_NORM;
|
||||
}
|
||||
|
||||
|
||||
/* ed_tty_dsusp():
|
||||
/* ed_tty_dsusp():
|
||||
* Tty delayed suspend character
|
||||
* [^Y]
|
||||
*/
|
||||
@ -524,7 +524,7 @@ ed_tty_dsusp(el, c)
|
||||
}
|
||||
|
||||
|
||||
/* ed_tty_flush_output():
|
||||
/* ed_tty_flush_output():
|
||||
* Tty flush output characters
|
||||
* [^O]
|
||||
*/
|
||||
@ -538,7 +538,7 @@ ed_tty_flush_output(el, c)
|
||||
}
|
||||
|
||||
|
||||
/* ed_tty_sigquit():
|
||||
/* ed_tty_sigquit():
|
||||
* Tty quit character
|
||||
* [^\]
|
||||
*/
|
||||
@ -552,7 +552,7 @@ ed_tty_sigquit(el, c)
|
||||
}
|
||||
|
||||
|
||||
/* ed_tty_sigtstp():
|
||||
/* ed_tty_sigtstp():
|
||||
* Tty suspend character
|
||||
* [^Z]
|
||||
*/
|
||||
@ -566,7 +566,7 @@ ed_tty_sigtstp(el, c)
|
||||
}
|
||||
|
||||
|
||||
/* ed_tty_stop_output():
|
||||
/* ed_tty_stop_output():
|
||||
* Tty disallow output characters
|
||||
* [^S]
|
||||
*/
|
||||
@ -580,7 +580,7 @@ ed_tty_stop_output(el, c)
|
||||
}
|
||||
|
||||
|
||||
/* ed_tty_start_output():
|
||||
/* ed_tty_start_output():
|
||||
* Tty allow output characters
|
||||
* [^Q]
|
||||
*/
|
||||
@ -594,7 +594,7 @@ ed_tty_start_output(el, c)
|
||||
}
|
||||
|
||||
|
||||
/* ed_newline():
|
||||
/* ed_newline():
|
||||
* Execute command
|
||||
* [^J]
|
||||
*/
|
||||
@ -613,7 +613,7 @@ ed_newline(el, c)
|
||||
}
|
||||
|
||||
|
||||
/* ed_delete_prev_char():
|
||||
/* ed_delete_prev_char():
|
||||
* Delete the character to the left of the cursor
|
||||
* [^?]
|
||||
*/
|
||||
@ -623,10 +623,10 @@ ed_delete_prev_char(el, c)
|
||||
EditLine *el;
|
||||
int c;
|
||||
{
|
||||
if (el->el_line.cursor <= el->el_line.buffer)
|
||||
if (el->el_line.cursor <= el->el_line.buffer)
|
||||
return CC_ERROR;
|
||||
|
||||
c_delbefore(el, el->el_state.argument);
|
||||
c_delbefore(el, el->el_state.argument);
|
||||
el->el_line.cursor -= el->el_state.argument;
|
||||
if (el->el_line.cursor < el->el_line.buffer)
|
||||
el->el_line.cursor = el->el_line.buffer;
|
||||
@ -634,7 +634,7 @@ ed_delete_prev_char(el, c)
|
||||
}
|
||||
|
||||
|
||||
/* ed_clear_screen():
|
||||
/* ed_clear_screen():
|
||||
* Clear screen leaving current line at the top
|
||||
* [^L]
|
||||
*/
|
||||
@ -650,7 +650,7 @@ ed_clear_screen(el, c)
|
||||
}
|
||||
|
||||
|
||||
/* ed_redisplay():
|
||||
/* ed_redisplay():
|
||||
* Redisplay everything
|
||||
* ^R
|
||||
*/
|
||||
@ -664,7 +664,7 @@ ed_redisplay(el, c)
|
||||
}
|
||||
|
||||
|
||||
/* ed_start_over():
|
||||
/* ed_start_over():
|
||||
* Erase current line and start from scratch
|
||||
* [^G]
|
||||
*/
|
||||
@ -679,7 +679,7 @@ ed_start_over(el, c)
|
||||
}
|
||||
|
||||
|
||||
/* ed_sequence_lead_in():
|
||||
/* ed_sequence_lead_in():
|
||||
* First character in a bound sequence
|
||||
* Placeholder for external keys
|
||||
*/
|
||||
@ -693,7 +693,7 @@ ed_sequence_lead_in(el, c)
|
||||
}
|
||||
|
||||
|
||||
/* ed_prev_history():
|
||||
/* ed_prev_history():
|
||||
* Move to the previous history line
|
||||
* [^P] [k]
|
||||
*/
|
||||
@ -710,7 +710,7 @@ ed_prev_history(el, c)
|
||||
|
||||
if (el->el_history.eventno == 0) { /* save the current buffer away */
|
||||
(void) strncpy(el->el_history.buf, el->el_line.buffer, EL_BUFSIZ);
|
||||
el->el_history.last = el->el_history.buf +
|
||||
el->el_history.last = el->el_history.buf +
|
||||
(el->el_line.lastchar - el->el_line.buffer);
|
||||
}
|
||||
|
||||
@ -719,7 +719,7 @@ ed_prev_history(el, c)
|
||||
if (hist_get(el) == CC_ERROR) {
|
||||
beep = 1;
|
||||
/* el->el_history.eventno was fixed by first call */
|
||||
(void) hist_get(el);
|
||||
(void) hist_get(el);
|
||||
}
|
||||
|
||||
re_refresh(el);
|
||||
@ -730,7 +730,7 @@ ed_prev_history(el, c)
|
||||
}
|
||||
|
||||
|
||||
/* ed_next_history():
|
||||
/* ed_next_history():
|
||||
* Move to the next history line
|
||||
* [^N] [j]
|
||||
*/
|
||||
@ -754,7 +754,7 @@ ed_next_history(el, c)
|
||||
}
|
||||
|
||||
|
||||
/* ed_search_prev_history():
|
||||
/* ed_search_prev_history():
|
||||
* Search previous in history for a line matching the current
|
||||
* next search history [M-P] [K]
|
||||
*/
|
||||
@ -781,7 +781,7 @@ ed_search_prev_history(el, c)
|
||||
|
||||
if (el->el_history.eventno == 0) {
|
||||
(void) strncpy(el->el_history.buf, el->el_line.buffer, EL_BUFSIZ);
|
||||
el->el_history.last = el->el_history.buf +
|
||||
el->el_history.last = el->el_history.buf +
|
||||
(el->el_line.lastchar - el->el_line.buffer);
|
||||
}
|
||||
|
||||
@ -803,8 +803,8 @@ ed_search_prev_history(el, c)
|
||||
(void) fprintf(el->el_errfile, "Comparing with \"%s\"\n", hp);
|
||||
#endif
|
||||
if ((strncmp(hp, el->el_line.buffer, (size_t)
|
||||
(el->el_line.lastchar - el->el_line.buffer)) ||
|
||||
hp[el->el_line.lastchar-el->el_line.buffer]) &&
|
||||
(el->el_line.lastchar - el->el_line.buffer)) ||
|
||||
hp[el->el_line.lastchar-el->el_line.buffer]) &&
|
||||
c_hmatch(el, hp)) {
|
||||
found++;
|
||||
break;
|
||||
@ -815,7 +815,7 @@ ed_search_prev_history(el, c)
|
||||
|
||||
if (!found) {
|
||||
#ifdef SDEBUG
|
||||
(void) fprintf(el->el_errfile, "not found\n");
|
||||
(void) fprintf(el->el_errfile, "not found\n");
|
||||
#endif
|
||||
return CC_ERROR;
|
||||
}
|
||||
@ -826,7 +826,7 @@ ed_search_prev_history(el, c)
|
||||
}
|
||||
|
||||
|
||||
/* ed_search_next_history():
|
||||
/* ed_search_next_history():
|
||||
* Search next in history for a line matching the current
|
||||
* [M-N] [J]
|
||||
*/
|
||||
@ -861,8 +861,8 @@ ed_search_next_history(el, c)
|
||||
(void) fprintf(el->el_errfile, "Comparing with \"%s\"\n", hp);
|
||||
#endif
|
||||
if ((strncmp(hp, el->el_line.buffer, (size_t)
|
||||
(el->el_line.lastchar - el->el_line.buffer)) ||
|
||||
hp[el->el_line.lastchar-el->el_line.buffer]) &&
|
||||
(el->el_line.lastchar - el->el_line.buffer)) ||
|
||||
hp[el->el_line.lastchar-el->el_line.buffer]) &&
|
||||
c_hmatch(el, hp))
|
||||
found = h;
|
||||
hp = HIST_NEXT(el);
|
||||
@ -871,7 +871,7 @@ ed_search_next_history(el, c)
|
||||
if (!found) { /* is it the current history number? */
|
||||
if (!c_hmatch(el, el->el_history.buf)) {
|
||||
#ifdef SDEBUG
|
||||
(void) fprintf(el->el_errfile, "not found\n");
|
||||
(void) fprintf(el->el_errfile, "not found\n");
|
||||
#endif
|
||||
return CC_ERROR;
|
||||
}
|
||||
@ -895,7 +895,7 @@ ed_prev_line(el, c)
|
||||
{
|
||||
char *ptr;
|
||||
int nchars = c_hpos(el);
|
||||
|
||||
|
||||
/*
|
||||
* Move to the line requested
|
||||
*/
|
||||
@ -914,15 +914,15 @@ ed_prev_line(el, c)
|
||||
*/
|
||||
for (ptr--; ptr >= el->el_line.buffer && *ptr != '\n'; ptr--)
|
||||
continue;
|
||||
|
||||
|
||||
/*
|
||||
* Move to the character requested
|
||||
*/
|
||||
for (ptr++;
|
||||
nchars-- > 0 && ptr < el->el_line.lastchar && *ptr != '\n';
|
||||
for (ptr++;
|
||||
nchars-- > 0 && ptr < el->el_line.lastchar && *ptr != '\n';
|
||||
ptr++)
|
||||
continue;
|
||||
|
||||
|
||||
el->el_line.cursor = ptr;
|
||||
return CC_CURSOR;
|
||||
}
|
||||
@ -955,16 +955,16 @@ ed_next_line(el, c)
|
||||
* Move to the character requested
|
||||
*/
|
||||
for (ptr++;
|
||||
nchars-- > 0 && ptr < el->el_line.lastchar && *ptr != '\n';
|
||||
nchars-- > 0 && ptr < el->el_line.lastchar && *ptr != '\n';
|
||||
ptr++)
|
||||
continue;
|
||||
|
||||
|
||||
el->el_line.cursor = ptr;
|
||||
return CC_CURSOR;
|
||||
}
|
||||
|
||||
|
||||
/* ed_command():
|
||||
/* ed_command():
|
||||
* Editline extended command
|
||||
* [M-X] [:]
|
||||
*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
.\" $NetBSD: editline.3,v 1.16 1999/03/22 19:45:15 garbled Exp $
|
||||
.\" $NetBSD: editline.3,v 1.17 1999/07/02 15:21:23 simonb Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
|
||||
.\" All rights reserved.
|
||||
@ -24,7 +24,7 @@
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION OR CONTRIBUTORS
|
||||
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION 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
|
||||
@ -249,7 +249,7 @@ Otherwise, the current signal handlers will be used.
|
||||
Perform the
|
||||
.Ic bind
|
||||
builtin command.
|
||||
Refer to
|
||||
Refer to
|
||||
.Xr editrc 5
|
||||
for more information.
|
||||
.It Dv EL_ECHOTC , Xo
|
||||
@ -260,7 +260,7 @@ for more information.
|
||||
Perform the
|
||||
.Ic echotc
|
||||
builtin command.
|
||||
Refer to
|
||||
Refer to
|
||||
.Xr editrc 5
|
||||
for more information.
|
||||
.It Dv EL_SETTC , Xo
|
||||
@ -271,7 +271,7 @@ for more information.
|
||||
Perform the
|
||||
.Ic settc
|
||||
builtin command.
|
||||
Refer to
|
||||
Refer to
|
||||
.Xr editrc 5
|
||||
for more information.
|
||||
.It Dv EL_SETTY , Xo
|
||||
@ -282,7 +282,7 @@ for more information.
|
||||
Perform the
|
||||
.Ic setty
|
||||
builtin command.
|
||||
Refer to
|
||||
Refer to
|
||||
.Xr editrc 5
|
||||
for more information.
|
||||
.It Dv EL_TELLTC , Xo
|
||||
@ -293,7 +293,7 @@ for more information.
|
||||
Perform the
|
||||
.Ic telltc
|
||||
builtin command.
|
||||
Refer to
|
||||
Refer to
|
||||
.Xr editrc 5
|
||||
for more information.
|
||||
.It Dv EL_ADDFN , Xo
|
||||
@ -397,7 +397,7 @@ Return non-zero if editing is enabled.
|
||||
.It Fn el_source
|
||||
Initialise
|
||||
.Nm
|
||||
by reading the contents of
|
||||
by reading the contents of
|
||||
.Fa file .
|
||||
.Fn el_parse
|
||||
is called for each line in
|
||||
@ -527,7 +527,7 @@ to the last new element of the history.
|
||||
.It Dv H_ENTER , Fa "const char *str"
|
||||
Add
|
||||
.Fa str
|
||||
as a new element to the history, and, if necessary,
|
||||
as a new element to the history, and, if necessary,
|
||||
removing the oldest entry to keep the list to the created size.
|
||||
.It Dv H_PREV_STR , Fa "const char *str"
|
||||
Return the closest previous event that starts with
|
||||
|
@ -1,4 +1,4 @@
|
||||
.\" $NetBSD: editrc.5,v 1.7 1999/03/22 19:45:15 garbled Exp $
|
||||
.\" $NetBSD: editrc.5,v 1.8 1999/07/02 15:21:23 simonb Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1997 The NetBSD Foundation, Inc.
|
||||
.\" All rights reserved.
|
||||
@ -24,7 +24,7 @@
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION OR CONTRIBUTORS
|
||||
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION 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
|
||||
@ -61,7 +61,7 @@ Refer to
|
||||
.Sx BUILTIN COMMANDS
|
||||
for more information.
|
||||
.Pp
|
||||
.Ar prog
|
||||
.Ar prog
|
||||
is the program name string that a program defines when it calls
|
||||
.Xr el_init 3
|
||||
to setup
|
||||
@ -117,11 +117,11 @@ Options include:
|
||||
.It Fl e
|
||||
Bind all keys to the standard GNU Emacs-like bindings.
|
||||
.It Fl v
|
||||
Bind all keys to the standard
|
||||
Bind all keys to the standard
|
||||
.Xr vi 1 -like
|
||||
bindings.
|
||||
.It Fl a
|
||||
List or change key bindings in the
|
||||
List or change key bindings in the
|
||||
.Xr vi 1
|
||||
mode alternate (command mode) key map.
|
||||
.It Fl k
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: el.c,v 1.12 1998/12/12 20:08:22 christos Exp $ */
|
||||
/* $NetBSD: el.c,v 1.13 1999/07/02 15:21:23 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -41,7 +41,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)el.c 8.2 (Berkeley) 1/3/94";
|
||||
#else
|
||||
__RCSID("$NetBSD: el.c,v 1.12 1998/12/12 20:08:22 christos Exp $");
|
||||
__RCSID("$NetBSD: el.c,v 1.13 1999/07/02 15:21:23 simonb Exp $");
|
||||
#endif
|
||||
#endif /* not lint && not SCCSID */
|
||||
|
||||
@ -127,7 +127,7 @@ el_end(el)
|
||||
|
||||
el_free((ptr_t) el->el_prog);
|
||||
el_free((ptr_t) el);
|
||||
} /* end el_end */
|
||||
} /* end el_end */
|
||||
|
||||
|
||||
/* el_reset():
|
||||
@ -165,7 +165,7 @@ el_set(va_alist)
|
||||
el = va_arg(va, EditLine *);
|
||||
op = va_arg(va, int);
|
||||
#endif
|
||||
|
||||
|
||||
if (el == NULL)
|
||||
return -1;
|
||||
switch (op) {
|
||||
@ -234,7 +234,7 @@ el_set(va_alist)
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case EL_ADDFN:
|
||||
{
|
||||
char *name = va_arg(va, char *);
|
||||
@ -351,7 +351,7 @@ el_get(el, op, ret)
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case EL_ADDFN:
|
||||
{
|
||||
char *name = va_arg(va, char *);
|
||||
@ -405,14 +405,14 @@ el_source(el, fname)
|
||||
if (fname == NULL) {
|
||||
fname = &elpath[1];
|
||||
if ((fp = fopen(fname, "r")) == NULL) {
|
||||
if ((ptr = getenv("HOME")) == NULL)
|
||||
if ((ptr = getenv("HOME")) == NULL)
|
||||
return -1;
|
||||
(void)snprintf(path, sizeof(path), "%s%s", ptr, elpath);
|
||||
fname = path;
|
||||
}
|
||||
}
|
||||
|
||||
if ((fp = fopen(fname, "r")) == NULL)
|
||||
if ((fp = fopen(fname, "r")) == NULL)
|
||||
return -1;
|
||||
|
||||
while ((ptr = fgetln(fp, &len)) != NULL) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: emacs.c,v 1.6 1998/05/20 01:01:28 christos Exp $ */
|
||||
/* $NetBSD: emacs.c,v 1.7 1999/07/02 15:21:23 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -41,11 +41,11 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)emacs.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: emacs.c,v 1.6 1998/05/20 01:01:28 christos Exp $");
|
||||
__RCSID("$NetBSD: emacs.c,v 1.7 1999/07/02 15:21:23 simonb Exp $");
|
||||
#endif
|
||||
#endif /* not lint && not SCCSID */
|
||||
|
||||
/*
|
||||
/*
|
||||
* emacs.c: Emacs functions
|
||||
*/
|
||||
#include "sys.h"
|
||||
@ -97,7 +97,7 @@ em_delete_next_word(el, c)
|
||||
if (el->el_line.cursor == el->el_line.lastchar)
|
||||
return CC_ERROR;
|
||||
|
||||
cp = c__next_word(el->el_line.cursor, el->el_line.lastchar,
|
||||
cp = c__next_word(el->el_line.cursor, el->el_line.lastchar,
|
||||
el->el_state.argument, ce__isword);
|
||||
|
||||
for (p = el->el_line.cursor, kp = el->el_chared.c_kill.buf; p < cp; p++)
|
||||
@ -127,8 +127,8 @@ em_yank(el, c)
|
||||
if (el->el_chared.c_kill.last == el->el_chared.c_kill.buf)
|
||||
return CC_ERROR;
|
||||
|
||||
if (el->el_line.lastchar +
|
||||
(el->el_chared.c_kill.last - el->el_chared.c_kill.buf) >=
|
||||
if (el->el_line.lastchar +
|
||||
(el->el_chared.c_kill.last - el->el_chared.c_kill.buf) >=
|
||||
el->el_line.limit)
|
||||
return CC_ERROR;
|
||||
|
||||
@ -136,13 +136,13 @@ em_yank(el, c)
|
||||
cp = el->el_line.cursor;
|
||||
|
||||
/* open the space, */
|
||||
c_insert(el, el->el_chared.c_kill.last - el->el_chared.c_kill.buf);
|
||||
c_insert(el, el->el_chared.c_kill.last - el->el_chared.c_kill.buf);
|
||||
/* copy the chars */
|
||||
for (kp = el->el_chared.c_kill.buf; kp < el->el_chared.c_kill.last; kp++)
|
||||
for (kp = el->el_chared.c_kill.buf; kp < el->el_chared.c_kill.last; kp++)
|
||||
*cp++ = *kp;
|
||||
|
||||
/* if an arg, cursor at beginning else cursor at end */
|
||||
if (el->el_state.argument == 1)
|
||||
if (el->el_state.argument == 1)
|
||||
el->el_line.cursor = cp;
|
||||
|
||||
return CC_REFRESH;
|
||||
@ -258,7 +258,7 @@ em_gosmacs_traspose(el, c)
|
||||
el->el_line.cursor[-1] = c;
|
||||
return CC_REFRESH;
|
||||
}
|
||||
else
|
||||
else
|
||||
return CC_ERROR;
|
||||
}
|
||||
|
||||
@ -276,11 +276,11 @@ em_next_word(el, c)
|
||||
if (el->el_line.cursor == el->el_line.lastchar)
|
||||
return CC_ERROR;
|
||||
|
||||
el->el_line.cursor = c__next_word(el->el_line.cursor, el->el_line.lastchar,
|
||||
el->el_line.cursor = c__next_word(el->el_line.cursor, el->el_line.lastchar,
|
||||
el->el_state.argument,
|
||||
ce__isword);
|
||||
|
||||
if (el->el_map.type == MAP_VI)
|
||||
if (el->el_map.type == MAP_VI)
|
||||
if (el->el_chared.c_vcmd.action & DELETE) {
|
||||
cv_delfini(el);
|
||||
return CC_REFRESH;
|
||||
@ -301,7 +301,7 @@ em_upper_case(el, c)
|
||||
{
|
||||
char *cp, *ep;
|
||||
|
||||
ep = c__next_word(el->el_line.cursor, el->el_line.lastchar,
|
||||
ep = c__next_word(el->el_line.cursor, el->el_line.lastchar,
|
||||
el->el_state.argument, ce__isword);
|
||||
|
||||
for (cp = el->el_line.cursor; cp < ep; cp++)
|
||||
@ -327,7 +327,7 @@ em_capitol_case(el, c)
|
||||
{
|
||||
char *cp, *ep;
|
||||
|
||||
ep = c__next_word(el->el_line.cursor, el->el_line.lastchar,
|
||||
ep = c__next_word(el->el_line.cursor, el->el_line.lastchar,
|
||||
el->el_state.argument, ce__isword);
|
||||
|
||||
for (cp = el->el_line.cursor; cp < ep; cp++) {
|
||||
@ -360,7 +360,7 @@ em_lower_case(el, c)
|
||||
{
|
||||
char *cp, *ep;
|
||||
|
||||
ep = c__next_word(el->el_line.cursor, el->el_line.lastchar,
|
||||
ep = c__next_word(el->el_line.cursor, el->el_line.lastchar,
|
||||
el->el_state.argument, ce__isword);
|
||||
|
||||
for (cp = el->el_line.cursor; cp < ep; cp++)
|
||||
@ -390,7 +390,7 @@ em_set_mark(el, c)
|
||||
|
||||
|
||||
/* em_exchange_mark():
|
||||
* Exchange the cursor and mark
|
||||
* Exchange the cursor and mark
|
||||
* [^X^X]
|
||||
*/
|
||||
protected el_action_t
|
||||
@ -434,7 +434,7 @@ em_meta_next(el, c)
|
||||
EditLine *el;
|
||||
int c;
|
||||
{
|
||||
el->el_state.metanext = 1;
|
||||
el->el_state.metanext = 1;
|
||||
return CC_ARGHACK;
|
||||
}
|
||||
|
||||
@ -448,7 +448,7 @@ em_toggle_overwrite(el, c)
|
||||
EditLine *el;
|
||||
int c;
|
||||
{
|
||||
el->el_state.inputmode =
|
||||
el->el_state.inputmode =
|
||||
(el->el_state.inputmode == MODE_INSERT) ? MODE_REPLACE : MODE_INSERT;
|
||||
return CC_NORM;
|
||||
}
|
||||
@ -470,8 +470,8 @@ em_copy_prev_word(el, c)
|
||||
|
||||
oldc = el->el_line.cursor;
|
||||
/* does a bounds check */
|
||||
cp = c__prev_word(el->el_line.cursor, el->el_line.buffer,
|
||||
el->el_state.argument, ce__isword);
|
||||
cp = c__prev_word(el->el_line.cursor, el->el_line.buffer,
|
||||
el->el_state.argument, ce__isword);
|
||||
|
||||
c_insert(el, oldc - cp);
|
||||
for (dp = oldc; cp < oldc && dp < el->el_line.lastchar; cp++)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: hist.c,v 1.4 1997/10/14 15:05:50 christos Exp $ */
|
||||
/* $NetBSD: hist.c,v 1.5 1999/07/02 15:21:25 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -41,7 +41,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)hist.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: hist.c,v 1.4 1997/10/14 15:05:50 christos Exp $");
|
||||
__RCSID("$NetBSD: hist.c,v 1.5 1999/07/02 15:21:25 simonb Exp $");
|
||||
#endif
|
||||
#endif /* not lint && not SCCSID */
|
||||
|
||||
@ -108,7 +108,7 @@ hist_get(el)
|
||||
|
||||
if (el->el_history.eventno == 0) { /* if really the current line */
|
||||
(void) strncpy(el->el_line.buffer, el->el_history.buf, EL_BUFSIZ);
|
||||
el->el_line.lastchar = el->el_line.buffer +
|
||||
el->el_line.lastchar = el->el_line.buffer +
|
||||
(el->el_history.last - el->el_history.buf);
|
||||
|
||||
#ifdef KSHVI
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: histedit.h,v 1.11 1998/12/20 17:52:01 kleink Exp $ */
|
||||
/* $NetBSD: histedit.h,v 1.12 1999/07/02 15:21:25 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -101,7 +101,7 @@ void el_beep __P((EditLine *));
|
||||
* High level function internals control
|
||||
* Parses argc, argv array and executes builtin editline commands
|
||||
*/
|
||||
int el_parse __P((EditLine *, int, char **));
|
||||
int el_parse __P((EditLine *, int, char **));
|
||||
|
||||
/*
|
||||
* Low level editline access functions
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: history.c,v 1.13 1999/03/06 00:17:25 mycroft Exp $ */
|
||||
/* $NetBSD: history.c,v 1.14 1999/07/02 15:21:25 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -41,7 +41,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)history.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: history.c,v 1.13 1999/03/06 00:17:25 mycroft Exp $");
|
||||
__RCSID("$NetBSD: history.c,v 1.14 1999/07/02 15:21:25 simonb Exp $");
|
||||
#endif
|
||||
#endif /* not lint && not SCCSID */
|
||||
|
||||
@ -77,7 +77,7 @@ struct history {
|
||||
history_gfun_t h_prev; /* Get the previous element */
|
||||
history_gfun_t h_curr; /* Get the current element */
|
||||
history_sfun_t h_set; /* Set the current element */
|
||||
history_vfun_t h_clear; /* Clear the history list */
|
||||
history_vfun_t h_clear; /* Clear the history list */
|
||||
history_efun_t h_enter; /* Add an element */
|
||||
history_efun_t h_add; /* Append to an element */
|
||||
};
|
||||
@ -124,7 +124,7 @@ typedef struct history_t {
|
||||
hentry_t *cursor; /* Current element in the list */
|
||||
int max; /* Maximum number of events */
|
||||
int cur; /* Current number of events */
|
||||
int eventid; /* For generation of unique event id */
|
||||
int eventid; /* For generation of unique event id */
|
||||
} history_t;
|
||||
|
||||
private int history_def_first __P((ptr_t, HistEvent *));
|
||||
@ -148,7 +148,7 @@ private void history_def_delete __P((history_t *, HistEvent *, hentry_t *));
|
||||
evp->num = code;\
|
||||
evp->str = he_strerror(code);\
|
||||
}
|
||||
|
||||
|
||||
/* error messages */
|
||||
static const char *const he_errlist[] = {
|
||||
"OK",
|
||||
@ -439,7 +439,7 @@ history_def_enter(p, ev, str)
|
||||
* Always keep at least one entry.
|
||||
* This way we don't have to check for the empty list.
|
||||
*/
|
||||
while (h->cur - 1 > h->max)
|
||||
while (h->cur - 1 > h->max)
|
||||
history_def_delete(h, ev, h->list.prev);
|
||||
|
||||
return 0;
|
||||
@ -562,7 +562,7 @@ history_getsize(h, ev)
|
||||
HistEvent *ev;
|
||||
{
|
||||
int retval=0;
|
||||
|
||||
|
||||
if (h->h_next != history_def_next) {
|
||||
he_seterrev(ev, _HE_NOT_ALLOWED);
|
||||
return -1;
|
||||
@ -647,7 +647,7 @@ history_load(h, fname)
|
||||
|
||||
if (strncmp(line, hist_cookie, sz) != 0)
|
||||
goto done;
|
||||
|
||||
|
||||
ptr = h_malloc(max_size = 1024);
|
||||
for (i = 0; (line = fgetln(fp, &sz)) != NULL; i++) {
|
||||
char c = line[sz];
|
||||
@ -808,7 +808,7 @@ history(va_alist)
|
||||
#ifdef __STDC__
|
||||
va_start(va, fun);
|
||||
#else
|
||||
History *h;
|
||||
History *h;
|
||||
HistEvent *ev;
|
||||
int fun;
|
||||
va_start(va);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: key.c,v 1.4 1998/12/12 20:08:22 christos Exp $ */
|
||||
/* $NetBSD: key.c,v 1.5 1999/07/02 15:21:25 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -41,7 +41,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)key.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: key.c,v 1.4 1998/12/12 20:08:22 christos Exp $");
|
||||
__RCSID("$NetBSD: key.c,v 1.5 1999/07/02 15:21:25 simonb Exp $");
|
||||
#endif
|
||||
#endif /* not lint && not SCCSID */
|
||||
|
||||
@ -49,10 +49,10 @@ __RCSID("$NetBSD: key.c,v 1.4 1998/12/12 20:08:22 christos Exp $");
|
||||
* key.c: This module contains the procedures for maintaining
|
||||
* the extended-key map.
|
||||
*
|
||||
* An extended-key (key) is a sequence of keystrokes introduced
|
||||
* with an sequence introducer and consisting of an arbitrary
|
||||
* number of characters. This module maintains a map (the el->el_key.map)
|
||||
* to convert these extended-key sequences into input strs
|
||||
* An extended-key (key) is a sequence of keystrokes introduced
|
||||
* with an sequence introducer and consisting of an arbitrary
|
||||
* number of characters. This module maintains a map (the el->el_key.map)
|
||||
* to convert these extended-key sequences into input strs
|
||||
* (XK_STR), editor functions (XK_CMD), or unix commands (XK_EXE).
|
||||
*
|
||||
* Warning:
|
||||
@ -72,8 +72,8 @@ __RCSID("$NetBSD: key.c,v 1.4 1998/12/12 20:08:22 christos Exp $");
|
||||
|
||||
#include "el.h"
|
||||
|
||||
/*
|
||||
* The Nodes of the el->el_key.map. The el->el_key.map is a linked list
|
||||
/*
|
||||
* The Nodes of the el->el_key.map. The el->el_key.map is a linked list
|
||||
* of these node elements
|
||||
*/
|
||||
struct key_node_t {
|
||||
@ -85,9 +85,9 @@ struct key_node_t {
|
||||
struct key_node_t *sibling; /* ptr to another key with same prefix */
|
||||
};
|
||||
|
||||
private int node_trav __P((EditLine *, key_node_t *, char *,
|
||||
private int node_trav __P((EditLine *, key_node_t *, char *,
|
||||
key_value_t *));
|
||||
private int node__try __P((key_node_t *, char *,
|
||||
private int node__try __P((key_node_t *, char *,
|
||||
key_value_t *, int));
|
||||
private key_node_t *node__get __P((int));
|
||||
private void node__put __P((key_node_t *));
|
||||
@ -111,7 +111,7 @@ key_init(el)
|
||||
el->el_key.map = NULL;
|
||||
key_reset(el);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* key_end():
|
||||
@ -125,7 +125,7 @@ key_end(el)
|
||||
el->el_key.buf = NULL;
|
||||
/* XXX: provide a function to clear the keys */
|
||||
el->el_key.map = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* key_map_cmd():
|
||||
@ -174,7 +174,7 @@ key_reset(el)
|
||||
* Looks up *ch in map and then reads characters until a
|
||||
* complete match is found or a mismatch occurs. Returns the
|
||||
* type of the match found (XK_STR, XK_CMD, or XK_EXE).
|
||||
* Returns NULL in val.str and XK_STR for no match.
|
||||
* Returns NULL in val.str and XK_STR for no match.
|
||||
* The last character read is returned in *ch.
|
||||
*/
|
||||
protected int
|
||||
@ -202,7 +202,7 @@ key_add(el, key, val, ntype)
|
||||
int ntype;
|
||||
{
|
||||
if (key[0] == '\0') {
|
||||
(void) fprintf(el->el_errfile,
|
||||
(void) fprintf(el->el_errfile,
|
||||
"key_add: Null extended-key not allowed.\n");
|
||||
return;
|
||||
}
|
||||
@ -218,7 +218,7 @@ key_add(el, key, val, ntype)
|
||||
el->el_key.map = node__get(key[0]); /* it is properly initialized */
|
||||
|
||||
/* Now recurse through el->el_key.map */
|
||||
(void) node__try(el->el_key.map, key, val, ntype);
|
||||
(void) node__try(el->el_key.map, key, val, ntype);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -233,9 +233,9 @@ key_clear(el, map, in)
|
||||
char *in;
|
||||
{
|
||||
if ((map[(unsigned char) *in] == ED_SEQUENCE_LEAD_IN) &&
|
||||
((map == el->el_map.key &&
|
||||
((map == el->el_map.key &&
|
||||
el->el_map.alt[(unsigned char) *in] != ED_SEQUENCE_LEAD_IN) ||
|
||||
(map == el->el_map.alt &&
|
||||
(map == el->el_map.alt &&
|
||||
el->el_map.key[(unsigned char) *in] != ED_SEQUENCE_LEAD_IN)))
|
||||
(void) key_delete(el, in);
|
||||
}
|
||||
@ -251,7 +251,7 @@ key_delete(el, key)
|
||||
char *key;
|
||||
{
|
||||
if (key[0] == '\0') {
|
||||
(void) fprintf(el->el_errfile,
|
||||
(void) fprintf(el->el_errfile,
|
||||
"key_delete: Null extended-key not allowed.\n");
|
||||
return -1;
|
||||
}
|
||||
@ -522,7 +522,7 @@ node_lookup(el, str, ptr, cnt)
|
||||
/* If match put this char into el->el_key.buf. Recurse */
|
||||
if (ptr->ch == *str) {
|
||||
/* match found */
|
||||
ncnt = key__decode_char(el->el_key.buf, cnt,
|
||||
ncnt = key__decode_char(el->el_key.buf, cnt,
|
||||
(unsigned char) ptr->ch);
|
||||
if (ptr->next != NULL)
|
||||
/* not yet at leaf */
|
||||
@ -564,7 +564,7 @@ node_enum(el, ptr, cnt)
|
||||
if (cnt >= KEY_BUFSIZ - 5) { /* buffer too small */
|
||||
el->el_key.buf[++cnt] = '"';
|
||||
el->el_key.buf[++cnt] = '\0';
|
||||
(void) fprintf(el->el_errfile,
|
||||
(void) fprintf(el->el_errfile,
|
||||
"Some extended keys too long for internal print buffer");
|
||||
(void) fprintf(el->el_errfile, " \"%s...\"\n", el->el_key.buf);
|
||||
return 0;
|
||||
@ -614,18 +614,18 @@ key_kprint(el, key, val, ntype)
|
||||
switch (ntype) {
|
||||
case XK_STR:
|
||||
case XK_EXE:
|
||||
(void) fprintf(el->el_errfile, fmt, key,
|
||||
key__decode_str(val->str, unparsbuf,
|
||||
(void) fprintf(el->el_errfile, fmt, key,
|
||||
key__decode_str(val->str, unparsbuf,
|
||||
ntype == XK_STR ? "\"\"" : "[]"));
|
||||
break;
|
||||
case XK_CMD:
|
||||
for (fp = el->el_map.help; fp->name; fp++)
|
||||
for (fp = el->el_map.help; fp->name; fp++)
|
||||
if (val->cmd == fp->func) {
|
||||
(void) fprintf(el->el_errfile, fmt, key, fp->name);
|
||||
break;
|
||||
}
|
||||
#ifdef DEBUG_KEY
|
||||
if (fp->name == NULL)
|
||||
if (fp->name == NULL)
|
||||
(void) fprintf(el->el_errfile, "BUG! Command not found.\n");
|
||||
#endif
|
||||
|
||||
@ -715,7 +715,7 @@ key__decode_str(str, buf, sep)
|
||||
*b++ = '\\';
|
||||
*b++ = *p;
|
||||
}
|
||||
else if (*p == ' ' || (isprint((unsigned char) *p) &&
|
||||
else if (*p == ' ' || (isprint((unsigned char) *p) &&
|
||||
!isspace((unsigned char) *p))) {
|
||||
*b++ = *p;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: key.h,v 1.2 1997/01/11 06:47:59 lukem Exp $ */
|
||||
/* $NetBSD: key.h,v 1.3 1999/07/02 15:21:25 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -67,7 +67,7 @@ protected void key_end __P((EditLine *));
|
||||
protected key_value_t * key_map_cmd __P((EditLine *, int));
|
||||
protected key_value_t * key_map_str __P((EditLine *, char *));
|
||||
protected void key_reset __P((EditLine *));
|
||||
protected int key_get __P((EditLine *, char *,
|
||||
protected int key_get __P((EditLine *, char *,
|
||||
key_value_t *));
|
||||
protected void key_add __P((EditLine *, char *, key_value_t *,
|
||||
int));
|
||||
@ -75,7 +75,7 @@ protected void key_clear __P((EditLine *, el_action_t *,
|
||||
char *));
|
||||
protected int key_delete __P((EditLine *, char *));
|
||||
protected void key_print __P((EditLine *, char *));
|
||||
protected void key_kprint __P((EditLine *, char *,
|
||||
protected void key_kprint __P((EditLine *, char *,
|
||||
key_value_t *, int));
|
||||
protected char *key__decode_str __P((char *, char *, char *));
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/bin/sh -
|
||||
# $NetBSD: makelist,v 1.3 1997/01/11 06:48:00 lukem Exp $
|
||||
# $NetBSD: makelist,v 1.4 1999/07/02 15:21:26 simonb Exp $
|
||||
#
|
||||
# Copyright (c) 1992, 1993
|
||||
# The Regents of the University of California. All rights reserved.
|
||||
@ -40,7 +40,7 @@
|
||||
# makelist.sh: Automatically generate header files...
|
||||
|
||||
AWK=/usr/bin/awk
|
||||
USAGE="Usage: $0 -h|-e|-fc|-fh|-bc|-bh <filenames>"
|
||||
USAGE="Usage: $0 -h|-e|-fc|-fh|-bc|-bh <filenames>"
|
||||
|
||||
if [ "x$1" = "x" ]
|
||||
then
|
||||
@ -96,9 +96,9 @@ case $FLAG in
|
||||
s = "-";
|
||||
fname = fname s;
|
||||
}
|
||||
|
||||
|
||||
printf(" { %-30.30s %-30.30s\n","\"" fname "\",", uname ",");
|
||||
ok = 1;
|
||||
ok = 1;
|
||||
}
|
||||
}
|
||||
/^ \*/ {
|
||||
@ -118,7 +118,7 @@ case $FLAG in
|
||||
}';;
|
||||
-bh)
|
||||
$AWK '
|
||||
BEGIN {
|
||||
BEGIN {
|
||||
printf("/* Automatically generated file, do not edit */\n");
|
||||
printf("#ifndef _h_help_c\n#define _h_help_c\n");
|
||||
printf("protected el_bindings_t *help__get\t__P((void));\n");
|
||||
@ -127,12 +127,12 @@ case $FLAG in
|
||||
-fh)
|
||||
cat $FILES | $AWK '/el_action_t/ { print $3 }' | \
|
||||
sort | tr '[a-z]' '[A-Z]' | $AWK '
|
||||
BEGIN {
|
||||
BEGIN {
|
||||
printf("/* Automatically generated file, do not edit */\n");
|
||||
printf("#ifndef _h_fcns_c\n#define _h_fcns_c\n");
|
||||
count = 0;
|
||||
count = 0;
|
||||
}
|
||||
{
|
||||
{
|
||||
printf("#define\t%-30.30s\t%3d\n", $1, count++);
|
||||
}
|
||||
END {
|
||||
@ -155,7 +155,7 @@ case $FLAG in
|
||||
{
|
||||
clen = 25 + 2;
|
||||
len += clen;
|
||||
if (len >= maxlen)
|
||||
if (len >= maxlen)
|
||||
needn = 1;
|
||||
if (needn) {
|
||||
printf("\n ");
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: map.c,v 1.8 1998/12/12 20:08:22 christos Exp $ */
|
||||
/* $NetBSD: map.c,v 1.9 1999/07/02 15:21:26 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -41,12 +41,12 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)map.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: map.c,v 1.8 1998/12/12 20:08:22 christos Exp $");
|
||||
__RCSID("$NetBSD: map.c,v 1.9 1999/07/02 15:21:26 simonb Exp $");
|
||||
#endif
|
||||
#endif /* not lint && not SCCSID */
|
||||
|
||||
/*
|
||||
* map.c: Editor function definitions
|
||||
* map.c: Editor function definitions
|
||||
*/
|
||||
#include "sys.h"
|
||||
#include <stdlib.h>
|
||||
@ -667,8 +667,8 @@ private el_action_t el_map_vi_command[] = {
|
||||
/* 41 */ ED_UNASSIGNED, /* ) */
|
||||
/* 42 */ ED_UNASSIGNED, /* * */
|
||||
/* 43 */ ED_NEXT_HISTORY, /* + */
|
||||
/* 44 */ VI_REPEAT_PREV_CHAR, /* , */
|
||||
/* 45 */ ED_PREV_HISTORY, /* - */
|
||||
/* 44 */ VI_REPEAT_PREV_CHAR, /* , */
|
||||
/* 45 */ ED_PREV_HISTORY, /* - */
|
||||
/* 46 */ ED_UNASSIGNED, /* . */
|
||||
/* 47 */ VI_SEARCH_PREV, /* / */
|
||||
/* 48 */ VI_ZERO, /* 0 */
|
||||
@ -889,7 +889,7 @@ protected int
|
||||
map_init(el)
|
||||
EditLine *el;
|
||||
{
|
||||
|
||||
|
||||
/*
|
||||
* Make sure those are correct before starting.
|
||||
*/
|
||||
@ -909,7 +909,7 @@ map_init(el)
|
||||
el->el_map.vii = el_map_vi_insert;
|
||||
el->el_map.help = (el_bindings_t *) el_malloc(sizeof(el_bindings_t) *
|
||||
EL_NUM_FCNS);
|
||||
(void) memcpy(el->el_map.help, help__get(),
|
||||
(void) memcpy(el->el_map.help, help__get(),
|
||||
sizeof(el_bindings_t) * EL_NUM_FCNS);
|
||||
el->el_map.func = (el_func_t *) el_malloc(sizeof(el_func_t) * EL_NUM_FCNS);
|
||||
memcpy(el->el_map.func, func__get(), sizeof(el_func_t) * EL_NUM_FCNS);
|
||||
@ -955,8 +955,8 @@ map_init_nls(el)
|
||||
int i;
|
||||
el_action_t *map = el->el_map.key;
|
||||
|
||||
for (i = 0200; i <= 0377; i++)
|
||||
if (isprint(i))
|
||||
for (i = 0200; i <= 0377; i++)
|
||||
if (isprint(i))
|
||||
map[i] = ED_INSERT;
|
||||
}
|
||||
|
||||
@ -984,12 +984,12 @@ map_init_meta(el)
|
||||
if (el->el_map.type == MAP_VI)
|
||||
map = alt;
|
||||
}
|
||||
else
|
||||
else
|
||||
map = alt;
|
||||
}
|
||||
buf[0] = (char) i;
|
||||
buf[2] = 0;
|
||||
for (i = 0200; i <= 0377; i++)
|
||||
for (i = 0200; i <= 0377; i++)
|
||||
switch (map[i]) {
|
||||
case ED_INSERT:
|
||||
case ED_UNASSIGNED:
|
||||
@ -1071,14 +1071,14 @@ map_init_emacs(el)
|
||||
buf[1] = CONTROL('X');
|
||||
buf[2] = 0;
|
||||
key_add(el, buf, key_map_cmd(el, EM_EXCHANGE_MARK), XK_CMD);
|
||||
|
||||
|
||||
tty_bind_char(el, 1);
|
||||
term_bind_arrow(el);
|
||||
}
|
||||
|
||||
|
||||
/* map_set_editor():
|
||||
* Set the editor
|
||||
* Set the editor
|
||||
*/
|
||||
protected int
|
||||
map_set_editor(el, editor)
|
||||
@ -1098,7 +1098,7 @@ map_set_editor(el, editor)
|
||||
|
||||
|
||||
/* map_get_editor():
|
||||
* Retrieve the editor
|
||||
* Retrieve the editor
|
||||
*/
|
||||
protected int
|
||||
map_get_editor(el, editor)
|
||||
@ -1136,12 +1136,12 @@ map_print_key(el, map, in)
|
||||
(void) key__decode_str(in, outbuf, "");
|
||||
for (bp = el->el_map.help; bp->name != NULL; bp++)
|
||||
if (bp->func == map[(unsigned char) *in]) {
|
||||
(void) fprintf(el->el_outfile,
|
||||
(void) fprintf(el->el_outfile,
|
||||
"%s\t->\t%s\n", outbuf, bp->name);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
key_print(el, in);
|
||||
}
|
||||
|
||||
@ -1174,13 +1174,13 @@ map_print_some_keys(el, map, first, last)
|
||||
if (bp->func == map[first]) {
|
||||
if (first == last) {
|
||||
(void) fprintf(el->el_outfile, "%-15s-> %s\n",
|
||||
key__decode_str(firstbuf, unparsbuf, STRQQ),
|
||||
key__decode_str(firstbuf, unparsbuf, STRQQ),
|
||||
bp->name);
|
||||
}
|
||||
else {
|
||||
(void) fprintf(el->el_outfile, "%-4s to %-7s-> %s\n",
|
||||
key__decode_str(firstbuf, unparsbuf, STRQQ),
|
||||
key__decode_str(lastbuf, extrabuf, STRQQ),
|
||||
key__decode_str(lastbuf, extrabuf, STRQQ),
|
||||
bp->name);
|
||||
}
|
||||
return;
|
||||
@ -1190,13 +1190,13 @@ map_print_some_keys(el, map, first, last)
|
||||
if (map == el->el_map.key) {
|
||||
(void) fprintf(el->el_outfile, "BUG!!! %s isn't bound to anything.\n",
|
||||
key__decode_str(firstbuf, unparsbuf, STRQQ));
|
||||
(void) fprintf(el->el_outfile, "el->el_map.key[%d] == %d\n",
|
||||
(void) fprintf(el->el_outfile, "el->el_map.key[%d] == %d\n",
|
||||
first, el->el_map.key[first]);
|
||||
}
|
||||
else {
|
||||
(void) fprintf(el->el_outfile, "BUG!!! %s isn't bound to anything.\n",
|
||||
key__decode_str(firstbuf, unparsbuf, STRQQ));
|
||||
(void) fprintf(el->el_outfile, "el->el_map.alt[%d] == %d\n",
|
||||
(void) fprintf(el->el_outfile, "el->el_map.alt[%d] == %d\n",
|
||||
first, el->el_map.alt[first]);
|
||||
}
|
||||
#endif
|
||||
@ -1298,8 +1298,8 @@ map_bind(el, argc, argv)
|
||||
return 0;
|
||||
|
||||
case 'l':
|
||||
for (bp = el->el_map.help; bp->name != NULL; bp++)
|
||||
(void) fprintf(el->el_outfile, "%s\n\t%s\n",
|
||||
for (bp = el->el_map.help; bp->name != NULL; bp++)
|
||||
(void) fprintf(el->el_outfile, "%s\n\t%s\n",
|
||||
bp->name, bp->description);
|
||||
return 0;
|
||||
default:
|
||||
@ -1328,11 +1328,11 @@ map_bind(el, argc, argv)
|
||||
(void) term_clear_arrow(el, in);
|
||||
return -1;
|
||||
}
|
||||
if (in[1])
|
||||
if (in[1])
|
||||
(void) key_delete(el, in);
|
||||
else if (map[(unsigned char) *in] == ED_SEQUENCE_LEAD_IN)
|
||||
else if (map[(unsigned char) *in] == ED_SEQUENCE_LEAD_IN)
|
||||
(void) key_delete(el, in);
|
||||
else
|
||||
else
|
||||
map[(unsigned char) *in] = ED_UNASSIGNED;
|
||||
return 0;
|
||||
}
|
||||
@ -1356,7 +1356,7 @@ map_bind(el, argc, argv)
|
||||
case XK_STR:
|
||||
case XK_EXE:
|
||||
if ((out = parse__string(outbuf, argv[argc])) == NULL) {
|
||||
(void) fprintf(el->el_errfile,
|
||||
(void) fprintf(el->el_errfile,
|
||||
"%s: Invalid \\ or ^ in outstring.\n", argv[0]);
|
||||
return -1;
|
||||
}
|
||||
@ -1369,7 +1369,7 @@ map_bind(el, argc, argv)
|
||||
|
||||
case XK_CMD:
|
||||
if ((cmd = parse_cmd(el, argv[argc])) == -1) {
|
||||
(void) fprintf(el->el_errfile,
|
||||
(void) fprintf(el->el_errfile,
|
||||
"%s: Invalid command `%s'.\n", argv[0], argv[argc]);
|
||||
return -1;
|
||||
}
|
||||
@ -1409,7 +1409,7 @@ map_addfunc(el, name, help, func)
|
||||
if (name == NULL || help == NULL || func == NULL)
|
||||
return -1;
|
||||
|
||||
el->el_map.func = (el_func_t *)
|
||||
el->el_map.func = (el_func_t *)
|
||||
el_realloc(el->el_map.func, nf * sizeof(el_func_t));
|
||||
el->el_map.help = (el_bindings_t *)
|
||||
el_realloc(el->el_map.help, nf * sizeof(el_bindings_t));
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: map.h,v 1.3 1998/07/29 02:26:01 lukem Exp $ */
|
||||
/* $NetBSD: map.h,v 1.4 1999/07/02 15:21:26 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -74,7 +74,7 @@ protected void map_init_vi __P((EditLine *));
|
||||
protected void map_init_emacs __P((EditLine *));
|
||||
protected int map_set_editor __P((EditLine *, char *));
|
||||
protected int map_get_editor __P((EditLine *, const char **));
|
||||
protected int map_addfunc __P((EditLine *, const char *,
|
||||
protected int map_addfunc __P((EditLine *, const char *,
|
||||
const char *, el_func_t));
|
||||
|
||||
#endif /* _h_el_map */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: parse.c,v 1.10 1999/02/05 20:38:01 christos Exp $ */
|
||||
/* $NetBSD: parse.c,v 1.11 1999/07/02 15:21:26 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -41,7 +41,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: parse.c,v 1.10 1999/02/05 20:38:01 christos Exp $");
|
||||
__RCSID("$NetBSD: parse.c,v 1.11 1999/07/02 15:21:26 simonb Exp $");
|
||||
#endif
|
||||
#endif /* not lint && not SCCSID */
|
||||
|
||||
@ -155,7 +155,7 @@ parse__escape(ptr)
|
||||
|
||||
p = *ptr;
|
||||
|
||||
if (p[1] == 0)
|
||||
if (p[1] == 0)
|
||||
return -1;
|
||||
|
||||
if (*p == '\\') {
|
||||
@ -204,7 +204,7 @@ parse__escape(ptr)
|
||||
}
|
||||
c = (c << 3) | (ch - '0');
|
||||
}
|
||||
if ((c & 0xffffff00) != 0)
|
||||
if ((c & 0xffffff00) != 0)
|
||||
return -1;
|
||||
--p;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: parse.h,v 1.2 1997/01/11 06:48:03 lukem Exp $ */
|
||||
/* $NetBSD: parse.h,v 1.3 1999/07/02 15:21:26 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -44,7 +44,7 @@
|
||||
#ifndef _h_el_parse
|
||||
#define _h_el_parse
|
||||
|
||||
protected int parse_line __P((EditLine *, const char *));
|
||||
protected int parse_line __P((EditLine *, const char *));
|
||||
protected int parse__escape __P((const char ** const));
|
||||
protected char * parse__string __P((char *, const char *));
|
||||
protected int parse_cmd __P((EditLine *, const char *));
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: prompt.c,v 1.4 1998/07/29 02:26:01 lukem Exp $ */
|
||||
/* $NetBSD: prompt.c,v 1.5 1999/07/02 15:21:26 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -41,7 +41,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)prompt.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: prompt.c,v 1.4 1998/07/29 02:26:01 lukem Exp $");
|
||||
__RCSID("$NetBSD: prompt.c,v 1.5 1999/07/02 15:21:26 simonb Exp $");
|
||||
#endif
|
||||
#endif /* not lint && not SCCSID */
|
||||
|
||||
@ -90,7 +90,7 @@ prompt_print(el)
|
||||
/* prompt_init():
|
||||
* Initialize the prompt stuff
|
||||
*/
|
||||
protected int
|
||||
protected int
|
||||
prompt_init(el)
|
||||
EditLine *el;
|
||||
{
|
||||
@ -105,7 +105,7 @@ prompt_init(el)
|
||||
* Clean up the prompt stuff
|
||||
*/
|
||||
protected void
|
||||
/*ARGSUSED*/
|
||||
/*ARGSUSED*/
|
||||
prompt_end(el)
|
||||
EditLine *el;
|
||||
{
|
||||
@ -115,7 +115,7 @@ prompt_end(el)
|
||||
/* prompt_set():
|
||||
* Install a prompt printing function
|
||||
*/
|
||||
protected int
|
||||
protected int
|
||||
prompt_set(el, prf)
|
||||
EditLine *el;
|
||||
el_pfunc_t prf;
|
||||
@ -133,7 +133,7 @@ prompt_set(el, prf)
|
||||
/* prompt_get():
|
||||
* Retrieve the prompt printing function
|
||||
*/
|
||||
protected int
|
||||
protected int
|
||||
prompt_get(el, prf)
|
||||
EditLine *el;
|
||||
el_pfunc_t *prf;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: read.c,v 1.11 1999/01/11 22:40:00 kleink Exp $ */
|
||||
/* $NetBSD: read.c,v 1.12 1999/07/02 15:21:26 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -41,7 +41,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)read.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: read.c,v 1.11 1999/01/11 22:40:00 kleink Exp $");
|
||||
__RCSID("$NetBSD: read.c,v 1.12 1999/07/02 15:21:26 simonb Exp $");
|
||||
#endif
|
||||
#endif /* not lint && not SCCSID */
|
||||
|
||||
@ -116,7 +116,7 @@ read__fixio(fd, e)
|
||||
|
||||
if (fcntl(fd, F_SETFL, e & ~O_NDELAY) == -1)
|
||||
return -1;
|
||||
else
|
||||
else
|
||||
e = 1;
|
||||
# endif /* F_SETFL && O_NDELAY */
|
||||
|
||||
@ -250,7 +250,7 @@ read_getcmd(el, cmdnum, ch)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (el->el_map.alt == NULL)
|
||||
if (el->el_map.alt == NULL)
|
||||
el->el_map.current = el->el_map.key;
|
||||
}
|
||||
*cmdnum = cmd;
|
||||
@ -297,9 +297,9 @@ el_getc(el, cp)
|
||||
if (!read_preread(el))
|
||||
break;
|
||||
}
|
||||
if (ma->level < 0)
|
||||
if (ma->level < 0)
|
||||
break;
|
||||
|
||||
|
||||
if (*ma->macro[ma->level] == 0) {
|
||||
ma->level--;
|
||||
continue;
|
||||
@ -396,7 +396,7 @@ el_gets(el, nread)
|
||||
|
||||
if (cmdnum >= el->el_map.nfunc) { /* BUG CHECK command */
|
||||
#ifdef DEBUG_EDIT
|
||||
(void) fprintf(el->el_errfile,
|
||||
(void) fprintf(el->el_errfile,
|
||||
"ERROR: illegal command from key 0%o\r\n", ch);
|
||||
#endif /* DEBUG_EDIT */
|
||||
continue; /* try again */
|
||||
@ -460,7 +460,7 @@ el_gets(el, nread)
|
||||
break;
|
||||
|
||||
case CC_NEWLINE: /* normal end of line */
|
||||
num = el->el_line.lastchar - el->el_line.buffer;
|
||||
num = el->el_line.lastchar - el->el_line.buffer;
|
||||
break;
|
||||
|
||||
case CC_FATAL: /* fatal error, reset to known state */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: readline.c,v 1.6 1999/06/12 18:58:05 christos Exp $ */
|
||||
/* $NetBSD: readline.c,v 1.7 1999/07/02 15:21:26 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997 The NetBSD Foundation, Inc.
|
||||
@ -38,7 +38,7 @@
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#if !defined(lint) && !defined(SCCSID)
|
||||
__RCSID("$NetBSD: readline.c,v 1.6 1999/06/12 18:58:05 christos Exp $");
|
||||
__RCSID("$NetBSD: readline.c,v 1.7 1999/07/02 15:21:26 simonb Exp $");
|
||||
#endif /* not lint && not SCCSID */
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -135,8 +135,8 @@ _move_history(op)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* READLINE compatibility stuff
|
||||
/*
|
||||
* READLINE compatibility stuff
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -513,7 +513,7 @@ _history_expand_command(command, cmdlen, result)
|
||||
with[len] = '\0';
|
||||
to = with;
|
||||
|
||||
tempcmd = _rl_compat_sub(line, from, to,
|
||||
tempcmd = _rl_compat_sub(line, from, to,
|
||||
(g_on) ? 1 : 0);
|
||||
free(line);
|
||||
line = tempcmd;
|
||||
@ -1393,7 +1393,7 @@ rl_complete(ignore, invoking_key)
|
||||
}
|
||||
|
||||
/*
|
||||
* misc other functions
|
||||
* misc other functions
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: refresh.c,v 1.7 1999/06/12 18:58:05 christos Exp $ */
|
||||
/* $NetBSD: refresh.c,v 1.8 1999/07/02 15:21:26 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -41,7 +41,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)refresh.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: refresh.c,v 1.7 1999/06/12 18:58:05 christos Exp $");
|
||||
__RCSID("$NetBSD: refresh.c,v 1.8 1999/07/02 15:21:26 simonb Exp $");
|
||||
#endif
|
||||
#endif /* not lint && not SCCSID */
|
||||
|
||||
@ -58,9 +58,9 @@ __RCSID("$NetBSD: refresh.c,v 1.7 1999/06/12 18:58:05 christos Exp $");
|
||||
|
||||
private void re_addc __P((EditLine *, int));
|
||||
private void re_update_line __P((EditLine *, char *, char *, int));
|
||||
private void re_insert __P((EditLine *, char *, int, int,
|
||||
private void re_insert __P((EditLine *, char *, int, int,
|
||||
char *, int));
|
||||
private void re_delete __P((EditLine *, char *, int, int,
|
||||
private void re_delete __P((EditLine *, char *, int, int,
|
||||
int));
|
||||
private void re_fastputc __P((EditLine *, int));
|
||||
|
||||
@ -68,7 +68,7 @@ private void re__strncopy __P((char *, char *, size_t));
|
||||
private void re__copy_and_pad __P((char *, char *, size_t));
|
||||
|
||||
#ifdef DEBUG_REFRESH
|
||||
private void re_printstr __P((EditLine *, char *, char *,
|
||||
private void re_printstr __P((EditLine *, char *, char *,
|
||||
char *));
|
||||
# define __F el->el_errfile
|
||||
# define ELRE_DEBUG(a, b, c) do \
|
||||
@ -90,7 +90,7 @@ re_printstr(el, str, f, t)
|
||||
while (f < t)
|
||||
ELRE_DEBUG(1,(__F, "%c", *f++ & 0177),);
|
||||
ELRE_DEBUG(1,(__F, "\"\r\n"),);
|
||||
}
|
||||
}
|
||||
#else
|
||||
# define ELRE_DEBUG(a, b, c)
|
||||
#endif
|
||||
@ -123,9 +123,9 @@ re_addc(el, c)
|
||||
}
|
||||
else if (iscntrl(c)) {
|
||||
re_putc(el, '^');
|
||||
if (c == '\177')
|
||||
if (c == '\177')
|
||||
re_putc(el, '?');
|
||||
else
|
||||
else
|
||||
/* uncontrolify it; works only for iso8859-1 like sets */
|
||||
re_putc(el, (c | 0100));
|
||||
}
|
||||
@ -151,11 +151,11 @@ re_putc(el, c)
|
||||
el->el_vdisplay[el->el_refresh.r_cursor.v][el->el_refresh.r_cursor.h] = c;
|
||||
el->el_refresh.r_cursor.h++; /* advance to next place */
|
||||
if (el->el_refresh.r_cursor.h >= el->el_term.t_size.h) {
|
||||
el->el_vdisplay[el->el_refresh.r_cursor.v][el->el_term.t_size.h] = '\0';
|
||||
el->el_vdisplay[el->el_refresh.r_cursor.v][el->el_term.t_size.h] = '\0';
|
||||
/* assure end of line */
|
||||
el->el_refresh.r_cursor.h = 0; /* reset it. */
|
||||
el->el_refresh.r_cursor.v++;
|
||||
ELRE_DEBUG(el->el_refresh.r_cursor.v >= el->el_term.t_size.v,
|
||||
ELRE_DEBUG(el->el_refresh.r_cursor.v >= el->el_term.t_size.v,
|
||||
(__F, "\r\nre_putc: overflow! r_cursor.v == %d > %d\r\n",
|
||||
el->el_refresh.r_cursor.v, el->el_term.t_size.v), abort());
|
||||
}
|
||||
@ -201,12 +201,12 @@ re_refresh(el)
|
||||
cur.v = el->el_refresh.r_cursor.v;
|
||||
}
|
||||
/* must be done BEFORE the NUL is written */
|
||||
el->el_refresh.r_newcv = el->el_refresh.r_cursor.v;
|
||||
el->el_refresh.r_newcv = el->el_refresh.r_cursor.v;
|
||||
re_putc(el, '\0'); /* put NUL on end */
|
||||
|
||||
ELRE_DEBUG(1,(__F,
|
||||
ELRE_DEBUG(1,(__F,
|
||||
"term.h=%d vcur.h=%d vcur.v=%d vdisplay[0]=\r\n:%80.80s:\r\n",
|
||||
el->el_term.t_size.h, el->el_refresh.r_cursor.h,
|
||||
el->el_term.t_size.h, el->el_refresh.r_cursor.h,
|
||||
el->el_refresh.r_cursor.v, el->el_vdisplay[0]),);
|
||||
|
||||
ELRE_DEBUG(1,(__F, "updating %d lines.\r\n", el->el_refresh.r_newcv),);
|
||||
@ -220,14 +220,14 @@ re_refresh(el)
|
||||
* cursor by writing the character that is at the end of the
|
||||
* screen line, it won't be a NUL or some old leftover stuff.
|
||||
*/
|
||||
re__copy_and_pad(el->el_display[i], el->el_vdisplay[i],
|
||||
re__copy_and_pad(el->el_display[i], el->el_vdisplay[i],
|
||||
(size_t)el->el_term.t_size.h);
|
||||
}
|
||||
ELRE_DEBUG(1,(__F,
|
||||
"\r\nel->el_refresh.r_cursor.v=%d,el->el_refresh.r_oldcv=%d i=%d\r\n",
|
||||
el->el_refresh.r_cursor.v, el->el_refresh.r_oldcv, i),);
|
||||
|
||||
if (el->el_refresh.r_oldcv > el->el_refresh.r_newcv)
|
||||
if (el->el_refresh.r_oldcv > el->el_refresh.r_newcv)
|
||||
for (; i <= el->el_refresh.r_oldcv; i++) {
|
||||
term_move_to_line(el, i);
|
||||
term_move_to_char(el, 0);
|
||||
@ -237,11 +237,11 @@ re_refresh(el)
|
||||
#endif /* DEBUG_REFRESH */
|
||||
*el->el_display[i] = '\0';
|
||||
}
|
||||
|
||||
|
||||
el->el_refresh.r_oldcv = el->el_refresh.r_newcv; /* set for next time */
|
||||
ELRE_DEBUG(1,(__F,
|
||||
ELRE_DEBUG(1,(__F,
|
||||
"\r\ncursor.h = %d, cursor.v = %d, cur.h = %d, cur.v = %d\r\n",
|
||||
el->el_refresh.r_cursor.h, el->el_refresh.r_cursor.v,
|
||||
el->el_refresh.r_cursor.h, el->el_refresh.r_cursor.v,
|
||||
cur.h, cur.v),);
|
||||
term_move_to_line(el, cur.v); /* go to where the cursor is */
|
||||
term_move_to_char(el, cur.h);
|
||||
@ -249,7 +249,7 @@ re_refresh(el)
|
||||
|
||||
|
||||
/* re_goto_bottom():
|
||||
* used to go to last used screen line
|
||||
* used to go to last used screen line
|
||||
*/
|
||||
protected void
|
||||
re_goto_bottom(el)
|
||||
@ -265,7 +265,7 @@ re_goto_bottom(el)
|
||||
|
||||
/* re_insert():
|
||||
* insert num characters of s into d (in front of the character)
|
||||
* at dat, maximum length of d is dlen
|
||||
* at dat, maximum length of d is dlen
|
||||
*/
|
||||
private void
|
||||
/*ARGSUSED*/
|
||||
@ -295,7 +295,7 @@ re_insert(el, d, dat, dlen, s, num)
|
||||
*b-- = *a--;
|
||||
d[dlen] = '\0'; /* just in case */
|
||||
}
|
||||
ELRE_DEBUG(1,(__F,
|
||||
ELRE_DEBUG(1,(__F,
|
||||
"re_insert() after insert: %d at %d max %d, d == \"%s\"\n",
|
||||
num, dat, dlen, d),);
|
||||
ELRE_DEBUG(1,(__F, "s == \"%s\"n", s),);
|
||||
@ -311,7 +311,7 @@ re_insert(el, d, dat, dlen, s, num)
|
||||
|
||||
|
||||
/* re_delete():
|
||||
* delete num characters d at dat, maximum length of d is dlen
|
||||
* delete num characters d at dat, maximum length of d is dlen
|
||||
*/
|
||||
private void
|
||||
/*ARGSUSED*/
|
||||
@ -406,7 +406,7 @@ re_update_line(el, old, new, i)
|
||||
*/
|
||||
while (*o)
|
||||
o++;
|
||||
/*
|
||||
/*
|
||||
* Remove any trailing blanks off of the end, being careful not to
|
||||
* back up past the beginning.
|
||||
*/
|
||||
@ -417,7 +417,7 @@ re_update_line(el, old, new, i)
|
||||
}
|
||||
oe = o;
|
||||
*oe = '\0';
|
||||
|
||||
|
||||
while (*n)
|
||||
n++;
|
||||
|
||||
@ -429,7 +429,7 @@ re_update_line(el, old, new, i)
|
||||
}
|
||||
ne = n;
|
||||
*ne = '\0';
|
||||
|
||||
|
||||
/*
|
||||
* if no diff, continue to next line of redraw
|
||||
*/
|
||||
@ -580,7 +580,7 @@ re_update_line(el, old, new, i)
|
||||
ofd - old, osb - old, ose - old, ols - old, oe - old),);
|
||||
ELRE_DEBUG(1,(__F, "nfd %d, nsb %d, nse %d, nls %d, ne %d\n",
|
||||
nfd - new, nsb - new, nse - new, nls - new, ne - new),);
|
||||
ELRE_DEBUG(1,(__F,
|
||||
ELRE_DEBUG(1,(__F,
|
||||
"xxx-xxx:\"00000000001111111111222222222233333333334\"\r\n"),);
|
||||
ELRE_DEBUG(1,(__F,
|
||||
"xxx-xxx:\"01234567890123456789012345678901234567890\"\r\n"),);
|
||||
@ -608,14 +608,14 @@ re_update_line(el, old, new, i)
|
||||
|
||||
/*
|
||||
* at this point we have something like this:
|
||||
*
|
||||
*
|
||||
* /old /ofd /osb /ose /ols /oe
|
||||
* v.....................v v..................v v........v
|
||||
* eddie> Oh, my fredded gruntle-buggy is to me, as foo var lurgid as
|
||||
* eddie> Oh, my fredded quiux buggy is to me, as gruntle-lurgid as
|
||||
* ^.....................^ ^..................^ ^........^
|
||||
* ^.....................^ ^..................^ ^........^
|
||||
* \new \nfd \nsb \nse \nls \ne
|
||||
*
|
||||
*
|
||||
* fx is the difference in length between the the chars between nfd and
|
||||
* nsb, and the chars between ofd and osb, and is thus the number of
|
||||
* characters to delete if < 0 (new is shorter than old, as above),
|
||||
@ -745,7 +745,7 @@ re_update_line(el, old, new, i)
|
||||
* Again a duplicate test.
|
||||
*/
|
||||
if (sx < 0) {
|
||||
ELRE_DEBUG(!EL_CAN_DELETE,
|
||||
ELRE_DEBUG(!EL_CAN_DELETE,
|
||||
(__F, "ERROR: cannot delete in second diff\n"),);
|
||||
term_deletechars(el, -sx);
|
||||
}
|
||||
@ -775,7 +775,7 @@ re_update_line(el, old, new, i)
|
||||
*/
|
||||
if (nsb != ne) {
|
||||
ELRE_DEBUG(1,(__F, "with stuff to keep at end\r\n"),);
|
||||
/*
|
||||
/*
|
||||
* We have to recalculate fx here because we set it
|
||||
* to zero above as a flag saying that we hadn't done
|
||||
* an early first insert.
|
||||
@ -879,7 +879,7 @@ re_refresh_cursor(el)
|
||||
th = el->el_term.t_size.h; /* optimize for speed */
|
||||
|
||||
/* do input buffer to el->el_line.cursor */
|
||||
for (cp = el->el_line.buffer; cp < el->el_line.cursor; cp++) {
|
||||
for (cp = el->el_line.buffer; cp < el->el_line.cursor; cp++) {
|
||||
c = *cp;
|
||||
h++; /* all chars at least this long */
|
||||
|
||||
@ -932,7 +932,7 @@ re_fastputc(el, c)
|
||||
{
|
||||
term__putc(c);
|
||||
el->el_display[el->el_cursor.v][el->el_cursor.h++] = c;
|
||||
if (el->el_cursor.h >= el->el_term.t_size.h) {
|
||||
if (el->el_cursor.h >= el->el_term.t_size.h) {
|
||||
/* if we must overflow */
|
||||
el->el_cursor.h = 0;
|
||||
el->el_cursor.v++;
|
||||
@ -945,7 +945,7 @@ re_fastputc(el, c)
|
||||
|
||||
/* re_fastaddc():
|
||||
* we added just one char, handle it fast.
|
||||
* Assumes that screen cursor == real cursor
|
||||
* Assumes that screen cursor == real cursor
|
||||
*/
|
||||
protected void
|
||||
re_fastaddc(el)
|
||||
@ -979,7 +979,7 @@ re_fastaddc(el)
|
||||
|
||||
|
||||
/* re_clear_display():
|
||||
* clear the screen buffers so that new new prompt starts fresh.
|
||||
* clear the screen buffers so that new new prompt starts fresh.
|
||||
*/
|
||||
protected void
|
||||
re_clear_display(el)
|
||||
@ -996,7 +996,7 @@ re_clear_display(el)
|
||||
|
||||
|
||||
/* re_clear_lines():
|
||||
* Make sure all lines are *really* blank
|
||||
* Make sure all lines are *really* blank
|
||||
*/
|
||||
protected void
|
||||
re_clear_lines(el)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: search.c,v 1.7 1999/02/05 20:53:50 christos Exp $ */
|
||||
/* $NetBSD: search.c,v 1.8 1999/07/02 15:21:27 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -41,7 +41,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)search.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: search.c,v 1.7 1999/02/05 20:53:50 christos Exp $");
|
||||
__RCSID("$NetBSD: search.c,v 1.8 1999/07/02 15:21:27 simonb Exp $");
|
||||
#endif
|
||||
#endif /* not lint && not SCCSID */
|
||||
|
||||
@ -95,7 +95,7 @@ search_end(el)
|
||||
/* regerror():
|
||||
* Handle regular expression errors
|
||||
*/
|
||||
public void
|
||||
public void
|
||||
/*ARGSUSED*/
|
||||
regerror(msg)
|
||||
const char *msg;
|
||||
@ -117,7 +117,7 @@ el_match(str, pat)
|
||||
#elif defined (REGEXP)
|
||||
regexp *rp;
|
||||
int rv;
|
||||
#else
|
||||
#else
|
||||
extern char *re_comp __P((const char *));
|
||||
extern int re_exec __P((const char *));
|
||||
#endif
|
||||
@ -162,25 +162,25 @@ c_hmatch(el, str)
|
||||
(void) fprintf(el->el_errfile, "match `%s' with `%s'\n",
|
||||
el->el_search.patbuf, str);
|
||||
#endif /* SDEBUG */
|
||||
|
||||
|
||||
return el_match(str, el->el_search.patbuf);
|
||||
}
|
||||
|
||||
|
||||
/* c_setpat():
|
||||
/* c_setpat():
|
||||
* Set the history seatch pattern
|
||||
*/
|
||||
protected void
|
||||
c_setpat(el)
|
||||
EditLine *el;
|
||||
{
|
||||
if (el->el_state.lastcmd != ED_SEARCH_PREV_HISTORY &&
|
||||
if (el->el_state.lastcmd != ED_SEARCH_PREV_HISTORY &&
|
||||
el->el_state.lastcmd != ED_SEARCH_NEXT_HISTORY) {
|
||||
el->el_search.patlen = EL_CURSOR(el) - el->el_line.buffer;
|
||||
if (el->el_search.patlen >= EL_BUFSIZ)
|
||||
if (el->el_search.patlen >= EL_BUFSIZ)
|
||||
el->el_search.patlen = EL_BUFSIZ -1;
|
||||
if (el->el_search.patlen != 0) {
|
||||
(void) strncpy(el->el_search.patbuf, el->el_line.buffer,
|
||||
(void) strncpy(el->el_search.patbuf, el->el_line.buffer,
|
||||
el->el_search.patlen);
|
||||
el->el_search.patbuf[el->el_search.patlen] = '\0';
|
||||
}
|
||||
@ -191,8 +191,8 @@ c_setpat(el)
|
||||
(void) fprintf(el->el_errfile, "\neventno = %d\n", el->el_history.eventno);
|
||||
(void) fprintf(el->el_errfile, "patlen = %d\n", el->el_search.patlen);
|
||||
(void) fprintf(el->el_errfile, "patbuf = \"%s\"\n", el->el_search.patbuf);
|
||||
(void) fprintf(el->el_errfile, "cursor %d lastchar %d\n",
|
||||
EL_CURSOR(el) - el->el_line.buffer,
|
||||
(void) fprintf(el->el_errfile, "cursor %d lastchar %d\n",
|
||||
EL_CURSOR(el) - el->el_line.buffer,
|
||||
el->el_line.lastchar - el->el_line.buffer);
|
||||
#endif
|
||||
}
|
||||
@ -219,7 +219,7 @@ ce_inc_search(el, dir)
|
||||
newdir = dir,
|
||||
done, redo;
|
||||
|
||||
if (el->el_line.lastchar + sizeof(STRfwd) / sizeof(char) + 2 +
|
||||
if (el->el_line.lastchar + sizeof(STRfwd) / sizeof(char) + 2 +
|
||||
el->el_search.patlen >= el->el_line.limit)
|
||||
return CC_ERROR;
|
||||
|
||||
@ -234,12 +234,12 @@ ce_inc_search(el, dir)
|
||||
}
|
||||
done = redo = 0;
|
||||
*el->el_line.lastchar++ = '\n';
|
||||
for (cp = newdir == ED_SEARCH_PREV_HISTORY ? STRbck : STRfwd;
|
||||
for (cp = newdir == ED_SEARCH_PREV_HISTORY ? STRbck : STRfwd;
|
||||
*cp; *el->el_line.lastchar++ = *cp++)
|
||||
continue;
|
||||
*el->el_line.lastchar++ = pchar;
|
||||
for (cp = &el->el_search.patbuf[1];
|
||||
cp < &el->el_search.patbuf[el->el_search.patlen];
|
||||
for (cp = &el->el_search.patbuf[1];
|
||||
cp < &el->el_search.patbuf[el->el_search.patlen];
|
||||
*el->el_line.lastchar++ = *cp++)
|
||||
continue;
|
||||
*el->el_line.lastchar = '\0';
|
||||
@ -274,7 +274,7 @@ ce_inc_search(el, dir)
|
||||
case ED_DELETE_PREV_CHAR:
|
||||
if (el->el_search.patlen > 1)
|
||||
done++;
|
||||
else
|
||||
else
|
||||
term_beep(el);
|
||||
break;
|
||||
|
||||
@ -290,15 +290,15 @@ ce_inc_search(el, dir)
|
||||
for (cp = &el->el_search.patbuf[1]; ; cp++)
|
||||
if (cp >= &el->el_search.patbuf[el->el_search.patlen]) {
|
||||
el->el_line.cursor += el->el_search.patlen - 1;
|
||||
cp = c__next_word(el->el_line.cursor,
|
||||
cp = c__next_word(el->el_line.cursor,
|
||||
el->el_line.lastchar, 1, ce__isword);
|
||||
while (el->el_line.cursor < cp &&
|
||||
while (el->el_line.cursor < cp &&
|
||||
*el->el_line.cursor != '\n') {
|
||||
if (el->el_search.patlen > EL_BUFSIZ - 3) {
|
||||
term_beep(el);
|
||||
break;
|
||||
}
|
||||
el->el_search.patbuf[el->el_search.patlen++] =
|
||||
el->el_search.patbuf[el->el_search.patlen++] =
|
||||
*el->el_line.cursor;
|
||||
*el->el_line.lastchar++ = *el->el_line.cursor++;
|
||||
}
|
||||
@ -311,10 +311,10 @@ ce_inc_search(el, dir)
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default: /* Terminate and execute cmd */
|
||||
endcmd[0] = ch;
|
||||
el_push(el, endcmd);
|
||||
el_push(el, endcmd);
|
||||
/*FALLTHROUGH*/
|
||||
|
||||
case 0033: /* ESC: Terminate */
|
||||
@ -325,7 +325,7 @@ ce_inc_search(el, dir)
|
||||
break;
|
||||
}
|
||||
|
||||
while (el->el_line.lastchar > el->el_line.buffer &&
|
||||
while (el->el_line.lastchar > el->el_line.buffer &&
|
||||
*el->el_line.lastchar != '\n')
|
||||
*el->el_line.lastchar-- = '\0';
|
||||
*el->el_line.lastchar = '\0';
|
||||
@ -333,7 +333,7 @@ ce_inc_search(el, dir)
|
||||
if (!done) {
|
||||
|
||||
/* Can't search if unmatched '[' */
|
||||
for (cp = &el->el_search.patbuf[el->el_search.patlen-1], ch = ']';
|
||||
for (cp = &el->el_search.patbuf[el->el_search.patlen-1], ch = ']';
|
||||
cp > el->el_search.patbuf; cp--)
|
||||
if (*cp == '[' || *cp == ']') {
|
||||
ch = *cp;
|
||||
@ -343,7 +343,7 @@ ce_inc_search(el, dir)
|
||||
if (el->el_search.patlen > 1 && ch != '[') {
|
||||
if (redo && newdir == dir) {
|
||||
if (pchar == '?') { /* wrap around */
|
||||
el->el_history.eventno =
|
||||
el->el_history.eventno =
|
||||
newdir == ED_SEARCH_PREV_HISTORY ? 0 : 0x7fffffff;
|
||||
if (hist_get(el) == CC_ERROR)
|
||||
/* el->el_history.eventno was fixed by first call */
|
||||
@ -351,7 +351,7 @@ ce_inc_search(el, dir)
|
||||
el->el_line.cursor = newdir == ED_SEARCH_PREV_HISTORY ?
|
||||
el->el_line.lastchar : el->el_line.buffer;
|
||||
} else
|
||||
el->el_line.cursor +=
|
||||
el->el_line.cursor +=
|
||||
newdir == ED_SEARCH_PREV_HISTORY ? -1 : 1;
|
||||
}
|
||||
#ifdef ANCHOR
|
||||
@ -359,19 +359,19 @@ ce_inc_search(el, dir)
|
||||
el->el_search.patbuf[el->el_search.patlen++] = '*';
|
||||
#endif
|
||||
el->el_search.patbuf[el->el_search.patlen] = '\0';
|
||||
if (el->el_line.cursor < el->el_line.buffer ||
|
||||
if (el->el_line.cursor < el->el_line.buffer ||
|
||||
el->el_line.cursor > el->el_line.lastchar ||
|
||||
(ret = ce_search_line(el, &el->el_search.patbuf[1],
|
||||
(ret = ce_search_line(el, &el->el_search.patbuf[1],
|
||||
newdir)) == CC_ERROR) {
|
||||
/* avoid c_setpat */
|
||||
el->el_state.lastcmd = (el_action_t) newdir;
|
||||
el->el_state.lastcmd = (el_action_t) newdir;
|
||||
ret = newdir == ED_SEARCH_PREV_HISTORY ?
|
||||
ed_search_prev_history(el, 0) :
|
||||
ed_search_prev_history(el, 0) :
|
||||
ed_search_next_history(el, 0);
|
||||
if (ret != CC_ERROR) {
|
||||
el->el_line.cursor = newdir == ED_SEARCH_PREV_HISTORY ?
|
||||
el->el_line.lastchar : el->el_line.buffer;
|
||||
(void) ce_search_line(el, &el->el_search.patbuf[1],
|
||||
(void) ce_search_line(el, &el->el_search.patbuf[1],
|
||||
newdir);
|
||||
}
|
||||
}
|
||||
@ -392,7 +392,7 @@ ce_inc_search(el, dir)
|
||||
|
||||
ret = ce_inc_search(el, newdir);
|
||||
|
||||
if (ret == CC_ERROR && pchar == '?' && oldpchar == ':')
|
||||
if (ret == CC_ERROR && pchar == '?' && oldpchar == ':')
|
||||
/* break abort of failed search at last non-failed */
|
||||
ret = CC_NORM;
|
||||
|
||||
@ -490,7 +490,7 @@ cv_search(el, dir)
|
||||
}
|
||||
el->el_state.lastcmd = (el_action_t) dir; /* avoid c_setpat */
|
||||
el->el_line.cursor = el->el_line.lastchar = el->el_line.buffer;
|
||||
if ((dir == ED_SEARCH_PREV_HISTORY ? ed_search_prev_history(el, 0) :
|
||||
if ((dir == ED_SEARCH_PREV_HISTORY ? ed_search_prev_history(el, 0) :
|
||||
ed_search_next_history(el, 0)) == CC_ERROR) {
|
||||
re_refresh(el);
|
||||
return CC_ERROR;
|
||||
@ -528,7 +528,7 @@ ce_search_line(el, pattern, dir)
|
||||
}
|
||||
return CC_ERROR;
|
||||
} else {
|
||||
for (cp = el->el_line.cursor; *cp != '\0' &&
|
||||
for (cp = el->el_line.cursor; *cp != '\0' &&
|
||||
cp < el->el_line.limit; cp++)
|
||||
if (el_match(cp, pattern)) {
|
||||
el->el_line.cursor = cp;
|
||||
@ -548,7 +548,7 @@ cv_repeat_srch(el, c)
|
||||
int c;
|
||||
{
|
||||
#ifdef SDEBUG
|
||||
(void) fprintf(el->el_errfile, "dir %d patlen %d patbuf %s\n",
|
||||
(void) fprintf(el->el_errfile, "dir %d patlen %d patbuf %s\n",
|
||||
c, el->el_search.patlen, el->el_search.patbuf);
|
||||
#endif
|
||||
|
||||
@ -578,9 +578,9 @@ cv_csearch_back(el, ch, count, tflag)
|
||||
|
||||
cp = el->el_line.cursor;
|
||||
while (count--) {
|
||||
if (*cp == ch)
|
||||
if (*cp == ch)
|
||||
cp--;
|
||||
while (cp > el->el_line.buffer && *cp != ch)
|
||||
while (cp > el->el_line.buffer && *cp != ch)
|
||||
cp--;
|
||||
}
|
||||
|
||||
@ -615,9 +615,9 @@ cv_csearch_fwd(el, ch, count, tflag)
|
||||
|
||||
cp = el->el_line.cursor;
|
||||
while (count--) {
|
||||
if(*cp == ch)
|
||||
if(*cp == ch)
|
||||
cp++;
|
||||
while (cp < el->el_line.lastchar && *cp != ch)
|
||||
while (cp < el->el_line.lastchar && *cp != ch)
|
||||
cp++;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: search.h,v 1.3 1998/12/12 20:08:23 christos Exp $ */
|
||||
/* $NetBSD: search.h,v 1.4 1999/07/02 15:21:27 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -41,8 +41,8 @@
|
||||
/*
|
||||
* el.search.h: Line and history searching utilities
|
||||
*/
|
||||
#ifndef _h_el_search
|
||||
#define _h_el_search
|
||||
#ifndef _h_el_search
|
||||
#define _h_el_search
|
||||
|
||||
#include "histedit.h"
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: sig.c,v 1.4 1997/07/06 18:25:35 christos Exp $ */
|
||||
/* $NetBSD: sig.c,v 1.5 1999/07/02 15:21:27 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -41,7 +41,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)sig.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: sig.c,v 1.4 1997/07/06 18:25:35 christos Exp $");
|
||||
__RCSID("$NetBSD: sig.c,v 1.5 1999/07/02 15:21:27 simonb Exp $");
|
||||
#endif
|
||||
#endif /* not lint && not SCCSID */
|
||||
|
||||
@ -98,7 +98,7 @@ sig_handler(signo)
|
||||
break;
|
||||
}
|
||||
|
||||
for (i = 0; sighdl[i] != -1; i++)
|
||||
for (i = 0; sighdl[i] != -1; i++)
|
||||
if (signo == sighdl[i])
|
||||
break;
|
||||
|
||||
@ -127,7 +127,7 @@ sig_init(el)
|
||||
#define SIGSIZE (sizeof(sighdl) / sizeof(sighdl[0]) * sizeof(sig_t))
|
||||
|
||||
el->el_signal = (sig_t *) el_malloc(SIGSIZE);
|
||||
for (i = 0; sighdl[i] != -1; i++)
|
||||
for (i = 0; sighdl[i] != -1; i++)
|
||||
el->el_signal[i] = SIG_ERR;
|
||||
|
||||
(void) sigprocmask(SIG_SETMASK, &oset, NULL);
|
||||
@ -191,7 +191,7 @@ sig_clr(el)
|
||||
#undef _DO
|
||||
(void) sigprocmask(SIG_BLOCK, &nset, &oset);
|
||||
|
||||
for (i = 0; sighdl[i] != -1; i++)
|
||||
for (i = 0; sighdl[i] != -1; i++)
|
||||
if (el->el_signal[i] != SIG_ERR)
|
||||
(void) signal(sighdl[i], el->el_signal[i]);
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: term.c,v 1.15 1998/12/12 20:08:23 christos Exp $ */
|
||||
/* $NetBSD: term.c,v 1.16 1999/07/02 15:21:27 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -41,7 +41,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)term.c 8.2 (Berkeley) 4/30/95";
|
||||
#else
|
||||
__RCSID("$NetBSD: term.c,v 1.15 1998/12/12 20:08:23 christos Exp $");
|
||||
__RCSID("$NetBSD: term.c,v 1.16 1999/07/02 15:21:27 simonb Exp $");
|
||||
#endif
|
||||
#endif /* not lint && not SCCSID */
|
||||
|
||||
@ -181,7 +181,7 @@ private struct termcapstr {
|
||||
{ "ho", "home cursor" },
|
||||
#define T_ic 13
|
||||
{ "ic", "insert character" },
|
||||
#define T_im 14
|
||||
#define T_im 14
|
||||
{ "im", "start insert mode" },
|
||||
#define T_ip 15
|
||||
{ "ip", "insert padding" },
|
||||
@ -256,7 +256,7 @@ private void term_rebuffer_display __P((EditLine *));
|
||||
private void term_free_display __P((EditLine *));
|
||||
private void term_alloc_display __P((EditLine *));
|
||||
private void term_alloc __P((EditLine *,
|
||||
struct termcapstr *, char *));
|
||||
struct termcapstr *, char *));
|
||||
private void term_init_arrow __P((EditLine *));
|
||||
private void term_reset_arrow __P((EditLine *));
|
||||
|
||||
@ -272,7 +272,7 @@ term_setflags(el)
|
||||
EditLine *el;
|
||||
{
|
||||
EL_FLAGS = 0;
|
||||
if (el->el_tty.t_tabs)
|
||||
if (el->el_tty.t_tabs)
|
||||
EL_FLAGS |= (Val(T_pt) && !Val(T_xt)) ? TERM_CAN_TAB : 0;
|
||||
|
||||
EL_FLAGS |= (Val(T_km) || Val(T_MT)) ? TERM_HAS_META : 0;
|
||||
@ -492,7 +492,7 @@ term_free_display(el)
|
||||
protected void
|
||||
term_move_to_line(el, where)
|
||||
EditLine *el;
|
||||
int where;
|
||||
int where;
|
||||
{
|
||||
int del, i;
|
||||
|
||||
@ -501,7 +501,7 @@ term_move_to_line(el, where)
|
||||
|
||||
if (where > el->el_term.t_size.v) {
|
||||
#ifdef DEBUG_SCREEN
|
||||
(void) fprintf(el->el_errfile,
|
||||
(void) fprintf(el->el_errfile,
|
||||
"term_move_to_line: where is ridiculous: %d\r\n", where);
|
||||
#endif /* DEBUG_SCREEN */
|
||||
return;
|
||||
@ -545,7 +545,7 @@ mc_again:
|
||||
|
||||
if (where > (el->el_term.t_size.h + 1)) {
|
||||
#ifdef DEBUG_SCREEN
|
||||
(void) fprintf(el->el_errfile,
|
||||
(void) fprintf(el->el_errfile,
|
||||
"term_move_to_char: where is riduculous: %d\r\n", where);
|
||||
#endif /* DEBUG_SCREEN */
|
||||
return;
|
||||
@ -570,7 +570,7 @@ mc_again:
|
||||
if (EL_CAN_TAB) { /* if I can do tabs, use them */
|
||||
if ((el->el_cursor.h & 0370) != (where & 0370)) {
|
||||
/* if not within tab stop */
|
||||
for (i = (el->el_cursor.h & 0370);
|
||||
for (i = (el->el_cursor.h & 0370);
|
||||
i < (where & 0370); i += 8)
|
||||
term__putc('\t'); /* then tab over */
|
||||
el->el_cursor.h = where & 0370;
|
||||
@ -579,8 +579,8 @@ mc_again:
|
||||
/* it's usually cheaper to just write the chars, so we do. */
|
||||
|
||||
/* NOTE THAT term_overwrite() WILL CHANGE el->el_cursor.h!!! */
|
||||
term_overwrite(el,
|
||||
&el->el_display[el->el_cursor.v][el->el_cursor.h],
|
||||
term_overwrite(el,
|
||||
&el->el_display[el->el_cursor.v][el->el_cursor.h],
|
||||
where - el->el_cursor.h);
|
||||
|
||||
}
|
||||
@ -652,7 +652,7 @@ term_deletechars(el, num)
|
||||
|
||||
if (num > el->el_term.t_size.h) {
|
||||
#ifdef DEBUG_SCREEN
|
||||
(void) fprintf(el->el_errfile,
|
||||
(void) fprintf(el->el_errfile,
|
||||
"term_deletechars: num is riduculous: %d\r\n", num);
|
||||
#endif /* DEBUG_SCREEN */
|
||||
return;
|
||||
@ -677,11 +677,11 @@ term_deletechars(el, num)
|
||||
|
||||
|
||||
/* term_insertwrite():
|
||||
* Puts terminal in insert character mode or inserts num
|
||||
* characters in the line
|
||||
* Puts terminal in insert character mode or inserts num
|
||||
* characters in the line
|
||||
*/
|
||||
protected void
|
||||
term_insertwrite(el, cp, num)
|
||||
term_insertwrite(el, cp, num)
|
||||
EditLine *el;
|
||||
char *cp;
|
||||
int num;
|
||||
@ -713,7 +713,7 @@ term_insertwrite(el, cp, num)
|
||||
(void) tputs(Str(T_im), 1, term__putc);
|
||||
|
||||
el->el_cursor.h += num;
|
||||
do
|
||||
do
|
||||
term__putc(*cp++);
|
||||
while (--num);
|
||||
|
||||
@ -740,10 +740,10 @@ term_insertwrite(el, cp, num)
|
||||
|
||||
|
||||
/* term_clear_EOL():
|
||||
* clear to end of line. There are num characters to clear
|
||||
* clear to end of line. There are num characters to clear
|
||||
*/
|
||||
protected void
|
||||
term_clear_EOL(el, num)
|
||||
term_clear_EOL(el, num)
|
||||
EditLine *el;
|
||||
int num;
|
||||
{
|
||||
@ -760,7 +760,7 @@ term_clear_EOL(el, num)
|
||||
|
||||
|
||||
/* term_clear_screen():
|
||||
* Clear the screen
|
||||
* Clear the screen
|
||||
*/
|
||||
protected void
|
||||
term_clear_screen(el)
|
||||
@ -847,10 +847,10 @@ term_set(el, term)
|
||||
i = tgetent(el->el_term.t_cap, term);
|
||||
|
||||
if (i <= 0) {
|
||||
if (i == -1)
|
||||
if (i == -1)
|
||||
(void) fprintf(el->el_errfile, "Cannot read termcap database;\n");
|
||||
else if (i == 0)
|
||||
(void) fprintf(el->el_errfile,
|
||||
else if (i == 0)
|
||||
(void) fprintf(el->el_errfile,
|
||||
"No entry for terminal type \"%s\";\n", term);
|
||||
(void) fprintf(el->el_errfile, "using dumb terminal settings.\n");
|
||||
Val(T_co) = 80; /* do a dumb terminal */
|
||||
@ -893,7 +893,7 @@ term_set(el, term)
|
||||
|
||||
/* term_get_size():
|
||||
* Return the new window size in lines and cols, and
|
||||
* true if the size was changed.
|
||||
* true if the size was changed.
|
||||
*/
|
||||
protected int
|
||||
term_get_size(el, lins, cols)
|
||||
@ -985,7 +985,7 @@ term_init_arrow(el)
|
||||
* Reset arrow key bindings
|
||||
*/
|
||||
private void
|
||||
term_reset_arrow(el)
|
||||
term_reset_arrow(el)
|
||||
EditLine *el;
|
||||
{
|
||||
fkey_t *arrow = el->el_term.t_fkey;
|
||||
@ -1109,8 +1109,8 @@ term_bind_arrow(el)
|
||||
/*
|
||||
* Assign the arrow keys only if:
|
||||
*
|
||||
* 1. They are multi-character arrow keys and the user
|
||||
* has not re-assigned the leading character, or
|
||||
* 1. They are multi-character arrow keys and the user
|
||||
* has not re-assigned the leading character, or
|
||||
* has re-assigned the leading character to be
|
||||
* ED_SEQUENCE_LEAD_IN
|
||||
* 2. They are single arrow keys pointing to an unassigned key.
|
||||
@ -1118,7 +1118,7 @@ term_bind_arrow(el)
|
||||
if (arrow[i].type == XK_NOD)
|
||||
key_clear(el, map, p);
|
||||
else {
|
||||
if (p[1] && (dmap[j] == map[j] ||
|
||||
if (p[1] && (dmap[j] == map[j] ||
|
||||
map[j] == ED_SEQUENCE_LEAD_IN)) {
|
||||
key_add(el, p, &arrow[i].fun, arrow[i].type);
|
||||
map[j] = ED_SEQUENCE_LEAD_IN;
|
||||
@ -1175,21 +1175,21 @@ term_telltc(el, argc, argv)
|
||||
(void) fprintf(el->el_outfile, "\tfollowing characteristics:\n\n");
|
||||
(void) fprintf(el->el_outfile, "\tIt has %d columns and %d lines\n",
|
||||
Val(T_co), Val(T_li));
|
||||
(void) fprintf(el->el_outfile,
|
||||
(void) fprintf(el->el_outfile,
|
||||
"\tIt has %s meta key\n", EL_HAS_META ? "a" : "no");
|
||||
(void) fprintf(el->el_outfile,
|
||||
(void) fprintf(el->el_outfile,
|
||||
"\tIt can%suse tabs\n", EL_CAN_TAB ? " " : "not ");
|
||||
#ifdef notyet
|
||||
(void) fprintf(el->el_outfile, "\tIt %s automatic margins\n",
|
||||
(void) fprintf(el->el_outfile, "\tIt %s automatic margins\n",
|
||||
(T_Margin&MARGIN_AUTO)? "has": "does not have");
|
||||
if (T_Margin & MARGIN_AUTO)
|
||||
(void) fprintf(el->el_outfile, "\tIt %s magic margins\n",
|
||||
(void) fprintf(el->el_outfile, "\tIt %s magic margins\n",
|
||||
(T_Margin&MARGIN_MAGIC)?"has":"does not have");
|
||||
#endif
|
||||
|
||||
for (t = tstr, ts = el->el_term.t_str; t->name != NULL; t++, ts++)
|
||||
(void) fprintf(el->el_outfile, "\t%25s (%s) == %s\n", t->long_name,
|
||||
t->name, *ts && **ts ?
|
||||
(void) fprintf(el->el_outfile, "\t%25s (%s) == %s\n", t->long_name,
|
||||
t->name, *ts && **ts ?
|
||||
key__decode_str(*ts, upbuf, "") : "(empty)");
|
||||
(void) fputc('\n', el->el_outfile);
|
||||
return 0;
|
||||
@ -1237,7 +1237,7 @@ term_settc(el, argc, argv)
|
||||
break;
|
||||
|
||||
if (tv->name != NULL) {
|
||||
if (tv == &tval[T_pt] || tv == &tval[T_km]
|
||||
if (tv == &tval[T_pt] || tv == &tval[T_km]
|
||||
#ifdef notyet
|
||||
|| tv == &tval[T_am] || tv == &tval[T_xn]
|
||||
#endif
|
||||
@ -1317,12 +1317,12 @@ term_echotc(el, argc, argv)
|
||||
}
|
||||
#ifdef notyet
|
||||
else if (strcmp(*argv, "xn") == 0) {
|
||||
(void) fprintf(el->el_outfile, fmts, T_Margin & MARGIN_MAGIC ?
|
||||
(void) fprintf(el->el_outfile, fmts, T_Margin & MARGIN_MAGIC ?
|
||||
"yes" : "no");
|
||||
return 0;
|
||||
}
|
||||
else if (strcmp(*argv, "am") == 0) {
|
||||
(void) fprintf(el->el_outfile, fmts, T_Margin & MARGIN_AUTO ?
|
||||
(void) fprintf(el->el_outfile, fmts, T_Margin & MARGIN_AUTO ?
|
||||
"yes" : "no");
|
||||
return 0;
|
||||
}
|
||||
@ -1351,7 +1351,7 @@ term_echotc(el, argc, argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* Try to use our local definition first
|
||||
*/
|
||||
scap = NULL;
|
||||
@ -1364,7 +1364,7 @@ term_echotc(el, argc, argv)
|
||||
scap = tgetstr(*argv, &area);
|
||||
if (!scap || scap[0] == '\0') {
|
||||
if (!silent)
|
||||
(void) fprintf(el->el_errfile,
|
||||
(void) fprintf(el->el_errfile,
|
||||
"echotc: Termcap parameter `%s' not found.\n", *argv);
|
||||
return -1;
|
||||
}
|
||||
@ -1395,7 +1395,7 @@ term_echotc(el, argc, argv)
|
||||
* hpux has lot's of them...
|
||||
*/
|
||||
if (verbose)
|
||||
(void) fprintf(el->el_errfile,
|
||||
(void) fprintf(el->el_errfile,
|
||||
"echotc: Warning: unknown termcap %% `%c'.\n", *cap);
|
||||
/* This is bad, but I won't complain */
|
||||
break;
|
||||
@ -1406,7 +1406,7 @@ term_echotc(el, argc, argv)
|
||||
argv++;
|
||||
if (*argv && *argv[0]) {
|
||||
if (!silent)
|
||||
(void) fprintf(el->el_errfile,
|
||||
(void) fprintf(el->el_errfile,
|
||||
"echotc: Warning: Extra argument `%s'.\n", *argv);
|
||||
return -1;
|
||||
}
|
||||
@ -1416,7 +1416,7 @@ term_echotc(el, argc, argv)
|
||||
argv++;
|
||||
if (!*argv || *argv[0] == '\0') {
|
||||
if (!silent)
|
||||
(void) fprintf(el->el_errfile,
|
||||
(void) fprintf(el->el_errfile,
|
||||
"echotc: Warning: Missing argument.\n");
|
||||
return -1;
|
||||
}
|
||||
@ -1425,7 +1425,7 @@ term_echotc(el, argc, argv)
|
||||
argv++;
|
||||
if (*argv && *argv[0]) {
|
||||
if (!silent)
|
||||
(void) fprintf(el->el_errfile,
|
||||
(void) fprintf(el->el_errfile,
|
||||
"echotc: Warning: Extra argument `%s'.\n", *argv);
|
||||
return -1;
|
||||
}
|
||||
@ -1434,15 +1434,15 @@ term_echotc(el, argc, argv)
|
||||
default:
|
||||
/* This is wrong, but I will ignore it... */
|
||||
if (verbose)
|
||||
(void) fprintf(el->el_errfile,
|
||||
"echotc: Warning: Too many required arguments (%d).\n",
|
||||
(void) fprintf(el->el_errfile,
|
||||
"echotc: Warning: Too many required arguments (%d).\n",
|
||||
arg_need);
|
||||
/*FALLTHROUGH*/
|
||||
case 2:
|
||||
argv++;
|
||||
if (!*argv || *argv[0] == '\0') {
|
||||
if (!silent)
|
||||
(void) fprintf(el->el_errfile,
|
||||
(void) fprintf(el->el_errfile,
|
||||
"echotc: Warning: Missing argument.\n");
|
||||
return -1;
|
||||
}
|
||||
@ -1450,7 +1450,7 @@ term_echotc(el, argc, argv)
|
||||
argv++;
|
||||
if (!*argv || *argv[0] == '\0') {
|
||||
if (!silent)
|
||||
(void) fprintf(el->el_errfile,
|
||||
(void) fprintf(el->el_errfile,
|
||||
"echotc: Warning: Missing argument.\n");
|
||||
return -1;
|
||||
}
|
||||
@ -1458,7 +1458,7 @@ term_echotc(el, argc, argv)
|
||||
argv++;
|
||||
if (*argv && *argv[0]) {
|
||||
if (!silent)
|
||||
(void) fprintf(el->el_errfile,
|
||||
(void) fprintf(el->el_errfile,
|
||||
"echotc: Warning: Extra argument `%s'.\n", *argv);
|
||||
return -1;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: term.h,v 1.6 1998/05/20 01:04:17 christos Exp $ */
|
||||
/* $NetBSD: term.h,v 1.7 1999/07/02 15:21:27 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -94,7 +94,7 @@ protected int term_init __P((EditLine *));
|
||||
protected void term_bind_arrow __P((EditLine *));
|
||||
protected void term_print_arrow __P((EditLine *, char *));
|
||||
protected int term_clear_arrow __P((EditLine *, char *));
|
||||
protected int term_set_arrow __P((EditLine *, char *,
|
||||
protected int term_set_arrow __P((EditLine *, char *,
|
||||
key_value_t *, int));
|
||||
protected void term_end __P((EditLine *));
|
||||
protected int term_set __P((EditLine *, char *));
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: tokenizer.c,v 1.4 1998/12/12 20:08:23 christos Exp $ */
|
||||
/* $NetBSD: tokenizer.c,v 1.5 1999/07/02 15:21:27 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -41,7 +41,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)tokenizer.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: tokenizer.c,v 1.4 1998/12/12 20:08:23 christos Exp $");
|
||||
__RCSID("$NetBSD: tokenizer.c,v 1.5 1999/07/02 15:21:27 simonb Exp $");
|
||||
#endif
|
||||
#endif /* not lint && not SCCSID */
|
||||
|
||||
@ -162,7 +162,7 @@ tok_end(tok)
|
||||
* 3: Quoted return
|
||||
* 2: Unmatched double quote
|
||||
* 1: Unmatched single quote
|
||||
* 0: Ok
|
||||
* 0: Ok
|
||||
*/
|
||||
public int
|
||||
tok_line(tok, line, argc, argv)
|
||||
@ -232,7 +232,7 @@ tok_line(tok, line, argc, argv)
|
||||
*tok->wptr++ = *ptr;
|
||||
break;
|
||||
|
||||
default:
|
||||
default:
|
||||
return(-1);
|
||||
}
|
||||
break;
|
||||
@ -249,7 +249,7 @@ tok_line(tok, line, argc, argv)
|
||||
tok->quote = Q_doubleone;/* Quote next character */
|
||||
break;
|
||||
|
||||
case Q_one:
|
||||
case Q_one:
|
||||
*tok->wptr++ = *ptr;
|
||||
tok->quote = Q_none; /* Quote this, restore state */
|
||||
break;
|
||||
@ -281,7 +281,7 @@ tok_line(tok, line, argc, argv)
|
||||
case Q_double:
|
||||
*tok->wptr++ = *ptr; /* Add the return */
|
||||
break;
|
||||
|
||||
|
||||
case Q_doubleone:
|
||||
tok->flags |= TOK_EAT;
|
||||
tok->quote = Q_double; /* Back to double, eat the '\n' */
|
||||
@ -384,7 +384,7 @@ tok_line(tok, line, argc, argv)
|
||||
|
||||
if (tok->argc >= tok->amax - 4) {
|
||||
tok->amax += AINCR;
|
||||
tok->argv = (char **) tok_realloc(tok->argv,
|
||||
tok->argv = (char **) tok_realloc(tok->argv,
|
||||
tok->amax * sizeof(char*));
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: tokenizer.h,v 1.2 1997/01/11 06:48:16 lukem Exp $ */
|
||||
/* $NetBSD: tokenizer.h,v 1.3 1999/07/02 15:21:27 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -49,7 +49,7 @@ typedef struct tokenizer Tokenizer;
|
||||
Tokenizer *tok_init __P((const char *));
|
||||
void tok_reset __P((Tokenizer *));
|
||||
void tok_end __P((Tokenizer *));
|
||||
int tok_line __P((Tokenizer *, const char *,
|
||||
int tok_line __P((Tokenizer *, const char *,
|
||||
int *, char ***));
|
||||
|
||||
#endif /* _h_tokenizer */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: tty.c,v 1.10 1999/02/07 14:34:05 christos Exp $ */
|
||||
/* $NetBSD: tty.c,v 1.11 1999/07/02 15:21:27 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -41,11 +41,11 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)tty.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: tty.c,v 1.10 1999/02/07 14:34:05 christos Exp $");
|
||||
__RCSID("$NetBSD: tty.c,v 1.11 1999/07/02 15:21:27 simonb Exp $");
|
||||
#endif
|
||||
#endif /* not lint && not SCCSID */
|
||||
|
||||
/*
|
||||
/*
|
||||
* tty.c: tty interface stuff
|
||||
*/
|
||||
#include "sys.h"
|
||||
@ -64,7 +64,7 @@ typedef struct ttymap_t {
|
||||
} ttymap_t;
|
||||
|
||||
|
||||
private ttyperm_t ttyperm = {
|
||||
private ttyperm_t ttyperm = {
|
||||
{
|
||||
{ "iflag:", ICRNL, (INLCR|IGNCR) },
|
||||
{ "oflag:", (OPOST|ONLCR), ONLRET },
|
||||
@ -94,8 +94,8 @@ private ttyperm_t ttyperm = {
|
||||
|
||||
private ttychar_t ttychar = {
|
||||
{
|
||||
CINTR, CQUIT, CERASE, CKILL,
|
||||
CEOF, CEOL, CEOL2, CSWTCH,
|
||||
CINTR, CQUIT, CERASE, CKILL,
|
||||
CEOF, CEOL, CEOL2, CSWTCH,
|
||||
CDSWTCH, CERASE2, CSTART, CSTOP,
|
||||
CWERASE, CSUSP, CDSUSP, CREPRINT,
|
||||
CDISCARD, CLNEXT, CSTATUS, CPAGE,
|
||||
@ -103,15 +103,15 @@ private ttychar_t ttychar = {
|
||||
CTIME
|
||||
},
|
||||
{
|
||||
CINTR, CQUIT, CERASE, CKILL,
|
||||
_POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE,
|
||||
_POSIX_VDISABLE, CERASE2, CSTART, CSTOP,
|
||||
_POSIX_VDISABLE, CSUSP, _POSIX_VDISABLE, _POSIX_VDISABLE,
|
||||
CDISCARD, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE,
|
||||
CINTR, CQUIT, CERASE, CKILL,
|
||||
_POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE,
|
||||
_POSIX_VDISABLE, CERASE2, CSTART, CSTOP,
|
||||
_POSIX_VDISABLE, CSUSP, _POSIX_VDISABLE, _POSIX_VDISABLE,
|
||||
CDISCARD, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE,
|
||||
_POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, 1,
|
||||
0
|
||||
},
|
||||
{
|
||||
{
|
||||
0, 0, 0, 0,
|
||||
0, 0, 0, 0,
|
||||
0, 0, 0, 0,
|
||||
@ -124,38 +124,38 @@ private ttychar_t ttychar = {
|
||||
|
||||
private ttymap_t tty_map[] = {
|
||||
#ifdef VERASE
|
||||
{ C_ERASE, VERASE,
|
||||
{ C_ERASE, VERASE,
|
||||
{ ED_DELETE_PREV_CHAR, VI_DELETE_PREV_CHAR, ED_PREV_CHAR } },
|
||||
#endif /* VERASE */
|
||||
#ifdef VERASE2
|
||||
{ C_ERASE2, VERASE2,
|
||||
{ C_ERASE2, VERASE2,
|
||||
{ ED_DELETE_PREV_CHAR, VI_DELETE_PREV_CHAR, ED_PREV_CHAR } },
|
||||
#endif /* VERASE2 */
|
||||
#ifdef VKILL
|
||||
{ C_KILL, VKILL,
|
||||
{ C_KILL, VKILL,
|
||||
{ EM_KILL_LINE, VI_KILL_LINE_PREV, ED_UNASSIGNED } },
|
||||
#endif /* VKILL */
|
||||
#ifdef VKILL2
|
||||
{ C_KILL2, VKILL2,
|
||||
{ C_KILL2, VKILL2,
|
||||
{ EM_KILL_LINE, VI_KILL_LINE_PREV, ED_UNASSIGNED } },
|
||||
#endif /* VKILL2 */
|
||||
#ifdef VEOF
|
||||
{ C_EOF, VEOF,
|
||||
{ C_EOF, VEOF,
|
||||
{ EM_DELETE_OR_LIST, VI_LIST_OR_EOF, ED_UNASSIGNED } },
|
||||
#endif /* VEOF */
|
||||
#ifdef VWERASE
|
||||
{ C_WERASE, VWERASE,
|
||||
{ C_WERASE, VWERASE,
|
||||
{ ED_DELETE_PREV_WORD, ED_DELETE_PREV_WORD, ED_PREV_WORD } },
|
||||
#endif /* VWERASE */
|
||||
#ifdef VREPRINT
|
||||
{ C_REPRINT, VREPRINT,
|
||||
{ C_REPRINT, VREPRINT,
|
||||
{ ED_REDISPLAY, ED_INSERT, ED_REDISPLAY } },
|
||||
#endif /* VREPRINT */
|
||||
#ifdef VLNEXT
|
||||
{ C_LNEXT, VLNEXT,
|
||||
{ C_LNEXT, VLNEXT,
|
||||
{ ED_QUOTED_INSERT, ED_QUOTED_INSERT, ED_UNASSIGNED } },
|
||||
#endif /* VLNEXT */
|
||||
{ -1, -1,
|
||||
{ -1, -1,
|
||||
{ ED_UNASSIGNED, ED_UNASSIGNED, ED_UNASSIGNED } }
|
||||
};
|
||||
|
||||
@ -369,7 +369,7 @@ private ttymodes_t ttymodes[] = {
|
||||
{ "extproc",EXTPROC, MD_LIN },
|
||||
# endif /* EXTPROC */
|
||||
|
||||
# if defined(VINTR)
|
||||
# if defined(VINTR)
|
||||
{ "intr", C_SH(C_INTR), MD_CHAR },
|
||||
# endif /* VINTR */
|
||||
# if defined(VQUIT)
|
||||
@ -432,7 +432,7 @@ private ttymodes_t ttymodes[] = {
|
||||
# if defined(VPGOFF)
|
||||
{ "pgoff", C_SH(C_PGOFF), MD_CHAR },
|
||||
# endif /* VPGOFF */
|
||||
# if defined(VKILL2)
|
||||
# if defined(VKILL2)
|
||||
{ "kill2", C_SH(C_KILL2), MD_CHAR },
|
||||
# endif /* VKILL2 */
|
||||
# if defined(VBRK)
|
||||
@ -450,7 +450,7 @@ private ttymodes_t ttymodes[] = {
|
||||
|
||||
|
||||
#define tty_getty(el, td) tcgetattr((el)->el_infd, (td))
|
||||
#define tty_setty(el, td) tcsetattr((el)->el_infd, TCSADRAIN, (td))
|
||||
#define tty_setty(el, td) tcsetattr((el)->el_infd, TCSADRAIN, (td))
|
||||
|
||||
#define tty__gettabs(td) ((((td)->c_oflag & TAB3) == TAB3) ? 0 : 1)
|
||||
#define tty__geteightbit(td) (((td)->c_cflag & CSIZE) == CS8)
|
||||
@ -467,14 +467,14 @@ private int tty_setup __P((EditLine *));
|
||||
/* tty_setup():
|
||||
* Get the tty parameters and initialize the editing state
|
||||
*/
|
||||
private int
|
||||
private int
|
||||
tty_setup(el)
|
||||
EditLine *el;
|
||||
{
|
||||
int rst = 1;
|
||||
if (tty_getty(el, &el->el_tty.t_ed) == -1) {
|
||||
#ifdef DEBUG_TTY
|
||||
(void) fprintf(el->el_errfile,
|
||||
(void) fprintf(el->el_errfile,
|
||||
"tty_setup: tty_getty: %s\n", strerror(errno));
|
||||
#endif /* DEBUG_TTY */
|
||||
return(-1);
|
||||
@ -518,7 +518,7 @@ tty_setup(el)
|
||||
tty__setchar(&el->el_tty.t_ex, el->el_tty.t_c[EX_IO]);
|
||||
if (tty_setty(el, &el->el_tty.t_ex) == -1) {
|
||||
#ifdef DEBUG_TTY
|
||||
(void) fprintf(el->el_errfile, "tty_setup: tty_setty: %s\n",
|
||||
(void) fprintf(el->el_errfile, "tty_setup: tty_setty: %s\n",
|
||||
strerror(errno));
|
||||
#endif /* DEBUG_TTY */
|
||||
return(-1);
|
||||
@ -590,7 +590,7 @@ private void
|
||||
tty__getchar(td, s)
|
||||
struct termios *td;
|
||||
unsigned char *s;
|
||||
{
|
||||
{
|
||||
# ifdef VINTR
|
||||
s[C_INTR] = td->c_cc[VINTR];
|
||||
# endif /* VINTR */
|
||||
@ -673,7 +673,7 @@ private void
|
||||
tty__setchar(td, s)
|
||||
struct termios *td;
|
||||
unsigned char *s;
|
||||
{
|
||||
{
|
||||
# ifdef VINTR
|
||||
td->c_cc[VINTR] = s[C_INTR];
|
||||
# endif /* VINTR */
|
||||
@ -820,7 +820,7 @@ tty_rawmode(el)
|
||||
el->el_tty.t_eight = tty__geteightbit(&el->el_tty.t_ts);
|
||||
el->el_tty.t_speed = tty__getspeed(&el->el_tty.t_ts);
|
||||
|
||||
if (tty__getspeed(&el->el_tty.t_ex) != el->el_tty.t_speed ||
|
||||
if (tty__getspeed(&el->el_tty.t_ex) != el->el_tty.t_speed ||
|
||||
tty__getspeed(&el->el_tty.t_ed) != el->el_tty.t_speed) {
|
||||
(void) cfsetispeed(&el->el_tty.t_ex, el->el_tty.t_speed);
|
||||
(void) cfsetospeed(&el->el_tty.t_ex, el->el_tty.t_speed);
|
||||
@ -829,7 +829,7 @@ tty_rawmode(el)
|
||||
}
|
||||
|
||||
if (tty__cooked_mode(&el->el_tty.t_ts)) {
|
||||
if (el->el_tty.t_ts.c_cflag != el->el_tty.t_ex.c_cflag) {
|
||||
if (el->el_tty.t_ts.c_cflag != el->el_tty.t_ex.c_cflag) {
|
||||
el->el_tty.t_ex.c_cflag = el->el_tty.t_ts.c_cflag;
|
||||
el->el_tty.t_ex.c_cflag &= ~el->el_tty.t_t[EX_IO][MD_CTL].t_clrmask;
|
||||
el->el_tty.t_ex.c_cflag |= el->el_tty.t_t[EX_IO][MD_CTL].t_setmask;
|
||||
@ -872,9 +872,9 @@ tty_rawmode(el)
|
||||
el->el_tty.t_ed.c_oflag |= el->el_tty.t_t[ED_IO][MD_OUT].t_setmask;
|
||||
}
|
||||
|
||||
if (tty__gettabs(&el->el_tty.t_ex) == 0)
|
||||
if (tty__gettabs(&el->el_tty.t_ex) == 0)
|
||||
el->el_tty.t_tabs = 0;
|
||||
else
|
||||
else
|
||||
el->el_tty.t_tabs = EL_CAN_TAB ? 1 : 0;
|
||||
|
||||
{
|
||||
@ -889,7 +889,7 @@ tty_rawmode(el)
|
||||
for (i = 0; i < C_NCC; i++)
|
||||
if (el->el_tty.t_c[TS_IO][i] != el->el_tty.t_c[EX_IO][i])
|
||||
break;
|
||||
|
||||
|
||||
if (i != C_NCC) {
|
||||
/*
|
||||
* Propagate changes only to the unprotected chars
|
||||
@ -919,7 +919,7 @@ tty_rawmode(el)
|
||||
|
||||
if (tty_setty(el, &el->el_tty.t_ed) == -1) {
|
||||
#ifdef DEBUG_TTY
|
||||
(void) fprintf(el->el_errfile, "tty_rawmode: tty_setty: %s\n",
|
||||
(void) fprintf(el->el_errfile, "tty_rawmode: tty_setty: %s\n",
|
||||
strerror(errno));
|
||||
#endif /* DEBUG_TTY */
|
||||
return -1;
|
||||
@ -941,7 +941,7 @@ tty_cookedmode(el)
|
||||
|
||||
if (tty_setty(el, &el->el_tty.t_ex) == -1) {
|
||||
#ifdef DEBUG_TTY
|
||||
(void) fprintf(el->el_errfile, "tty_cookedmode: tty_setty: %s\n",
|
||||
(void) fprintf(el->el_errfile, "tty_cookedmode: tty_setty: %s\n",
|
||||
strerror(errno));
|
||||
#endif /* DEBUG_TTY */
|
||||
return -1;
|
||||
@ -977,7 +977,7 @@ tty_quotemode(el)
|
||||
|
||||
if (tty_setty(el, &el->el_tty.t_qu) == -1) {
|
||||
#ifdef DEBUG_TTY
|
||||
(void) fprintf(el->el_errfile, "QuoteModeOn: tty_setty: %s\n",
|
||||
(void) fprintf(el->el_errfile, "QuoteModeOn: tty_setty: %s\n",
|
||||
strerror(errno));
|
||||
#endif /* DEBUG_TTY */
|
||||
return -1;
|
||||
@ -998,7 +998,7 @@ tty_noquotemode(el)
|
||||
return 0;
|
||||
if (tty_setty(el, &el->el_tty.t_ed) == -1) {
|
||||
#ifdef DEBUG_TTY
|
||||
(void) fprintf(el->el_errfile, "QuoteModeOff: tty_setty: %s\n",
|
||||
(void) fprintf(el->el_errfile, "QuoteModeOff: tty_setty: %s\n",
|
||||
strerror(errno));
|
||||
#endif /* DEBUG_TTY */
|
||||
return -1;
|
||||
@ -1028,7 +1028,7 @@ tty_stty(el, argc, argv)
|
||||
return -1;
|
||||
name = *argv++;
|
||||
|
||||
while (argv && *argv && argv[0][0] == '-' && argv[0][2] == '\0')
|
||||
while (argv && *argv && argv[0][0] == '-' && argv[0][2] == '\0')
|
||||
switch (argv[0][1]) {
|
||||
case 'a':
|
||||
aflag++;
|
||||
@ -1057,7 +1057,7 @@ tty_stty(el, argc, argv)
|
||||
int len = 0, st = 0, cu;
|
||||
for (m = ttymodes; m->m_name; m++) {
|
||||
if (m->m_type != i) {
|
||||
(void) fprintf(el->el_outfile, "%s%s", i != -1 ? "\n" : "",
|
||||
(void) fprintf(el->el_outfile, "%s%s", i != -1 ? "\n" : "",
|
||||
el->el_tty.t_t[z][m->m_type].t_name);
|
||||
i = m->m_type;
|
||||
st = len = strlen(el->el_tty.t_t[z][m->m_type].t_name);
|
||||
@ -1074,7 +1074,7 @@ tty_stty(el, argc, argv)
|
||||
(void) fprintf(el->el_outfile, "\n%*s", st, "");
|
||||
len = st + cu;
|
||||
}
|
||||
else
|
||||
else
|
||||
len += cu;
|
||||
|
||||
if (x != '\0')
|
||||
@ -1140,7 +1140,7 @@ tty_printchar(el, s)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < C_NCC; i++) {
|
||||
for (m = el->el_tty.t_t; m->m_name; m++)
|
||||
for (m = el->el_tty.t_t; m->m_name; m++)
|
||||
if (m->m_type == MD_CHAR && C_SH(i) == m->m_value)
|
||||
break;
|
||||
if (m->m_name)
|
||||
@ -1148,6 +1148,6 @@ tty_printchar(el, s)
|
||||
if (i % 5 == 0)
|
||||
(void) fprintf(el->el_errfile, "\n");
|
||||
}
|
||||
(void) fprintf(el->el_errfile, "\n");
|
||||
(void) fprintf(el->el_errfile, "\n");
|
||||
}
|
||||
#endif /* notyet */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: tty.h,v 1.5 1998/05/20 01:04:56 christos Exp $ */
|
||||
/* $NetBSD: tty.h,v 1.6 1999/07/02 15:21:27 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -48,7 +48,7 @@
|
||||
#include <termios.h>
|
||||
|
||||
/* Define our own since everyone gets it wrong! */
|
||||
#define CONTROL(A) ((A) & 037)
|
||||
#define CONTROL(A) ((A) & 037)
|
||||
|
||||
/*
|
||||
* Aix compatible names
|
||||
@ -451,7 +451,7 @@
|
||||
#define MD_CHAR 4
|
||||
#define MD_NN 5
|
||||
|
||||
typedef struct {
|
||||
typedef struct {
|
||||
char *t_name;
|
||||
u_int t_setmask;
|
||||
u_int t_clrmask;
|
||||
|
132
lib/libedit/vi.c
132
lib/libedit/vi.c
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: vi.c,v 1.6 1999/02/05 20:53:50 christos Exp $ */
|
||||
/* $NetBSD: vi.c,v 1.7 1999/07/02 15:21:28 simonb Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -41,7 +41,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)vi.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: vi.c,v 1.6 1999/02/05 20:53:50 christos Exp $");
|
||||
__RCSID("$NetBSD: vi.c,v 1.7 1999/07/02 15:21:28 simonb Exp $");
|
||||
#endif
|
||||
#endif /* not lint && not SCCSID */
|
||||
|
||||
@ -67,7 +67,7 @@ cv_action(el, c)
|
||||
if (el->el_chared.c_vcmd.action & DELETE) {
|
||||
el->el_chared.c_vcmd.action = NOP;
|
||||
el->el_chared.c_vcmd.pos = 0;
|
||||
|
||||
|
||||
el->el_chared.c_undo.isize = 0;
|
||||
el->el_chared.c_undo.dsize = 0;
|
||||
kp = el->el_chared.c_undo.buf;
|
||||
@ -75,14 +75,14 @@ cv_action(el, c)
|
||||
*kp++ = *cp;
|
||||
el->el_chared.c_undo.dsize++;
|
||||
}
|
||||
|
||||
|
||||
el->el_chared.c_undo.action = INSERT;
|
||||
el->el_chared.c_undo.ptr = el->el_line.buffer;
|
||||
el->el_line.lastchar = el->el_line.buffer;
|
||||
el->el_line.cursor = el->el_line.buffer;
|
||||
if (c & INSERT)
|
||||
el->el_map.current = el->el_map.key;
|
||||
|
||||
|
||||
return CC_REFRESH;
|
||||
}
|
||||
|
||||
@ -119,7 +119,7 @@ cv_paste(el, c)
|
||||
char *ptr;
|
||||
c_undo_t *un = &el->el_chared.c_undo;
|
||||
#ifdef DEBUG_PASTE
|
||||
(void) fprintf(el->el_errfile, "Paste: %x \"%s\" +%d -%d\n",
|
||||
(void) fprintf(el->el_errfile, "Paste: %x \"%s\" +%d -%d\n",
|
||||
un->action, un->buf, un->isize, un->dsize);
|
||||
#endif
|
||||
if (un->isize == 0)
|
||||
@ -128,7 +128,7 @@ cv_paste(el, c)
|
||||
if (!c && el->el_line.cursor < el->el_line.lastchar)
|
||||
el->el_line.cursor++;
|
||||
ptr = el->el_line.cursor;
|
||||
|
||||
|
||||
c_insert(el, (int)un->isize);
|
||||
if (el->el_line.cursor + un->isize > el->el_line.lastchar)
|
||||
return CC_ERROR;
|
||||
@ -137,7 +137,7 @@ cv_paste(el, c)
|
||||
}
|
||||
|
||||
|
||||
/* vi_paste_next():
|
||||
/* vi_paste_next():
|
||||
* Vi paste previous deletion to the right of the cursor
|
||||
* [p]
|
||||
*/
|
||||
@ -151,7 +151,7 @@ vi_paste_next(el, c)
|
||||
}
|
||||
|
||||
|
||||
/* vi_paste_prev():
|
||||
/* vi_paste_prev():
|
||||
* Vi paste previous deletion to the left of the cursor
|
||||
* [P]
|
||||
*/
|
||||
@ -165,7 +165,7 @@ vi_paste_prev(el, c)
|
||||
}
|
||||
|
||||
|
||||
/* vi_prev_space_word():
|
||||
/* vi_prev_space_word():
|
||||
* Vi move to the previous space delimited word
|
||||
* [B]
|
||||
*/
|
||||
@ -178,10 +178,10 @@ vi_prev_space_word(el, c)
|
||||
if (el->el_line.cursor == el->el_line.buffer)
|
||||
return CC_ERROR;
|
||||
|
||||
el->el_line.cursor = cv_prev_word(el, el->el_line.cursor,
|
||||
el->el_line.buffer,
|
||||
el->el_state.argument,
|
||||
cv__isword);
|
||||
el->el_line.cursor = cv_prev_word(el, el->el_line.cursor,
|
||||
el->el_line.buffer,
|
||||
el->el_state.argument,
|
||||
cv__isword);
|
||||
|
||||
if (el->el_chared.c_vcmd.action & DELETE) {
|
||||
cv_delfini(el);
|
||||
@ -192,7 +192,7 @@ vi_prev_space_word(el, c)
|
||||
}
|
||||
|
||||
|
||||
/* vi_prev_word():
|
||||
/* vi_prev_word():
|
||||
* Vi move to the previous word
|
||||
* [B]
|
||||
*/
|
||||
@ -205,10 +205,10 @@ vi_prev_word(el, c)
|
||||
if (el->el_line.cursor == el->el_line.buffer)
|
||||
return CC_ERROR;
|
||||
|
||||
el->el_line.cursor = cv_prev_word(el, el->el_line.cursor,
|
||||
el->el_line.buffer,
|
||||
el->el_state.argument,
|
||||
ce__isword);
|
||||
el->el_line.cursor = cv_prev_word(el, el->el_line.cursor,
|
||||
el->el_line.buffer,
|
||||
el->el_state.argument,
|
||||
ce__isword);
|
||||
|
||||
if (el->el_chared.c_vcmd.action & DELETE) {
|
||||
cv_delfini(el);
|
||||
@ -219,7 +219,7 @@ vi_prev_word(el, c)
|
||||
}
|
||||
|
||||
|
||||
/* vi_next_space_word():
|
||||
/* vi_next_space_word():
|
||||
* Vi move to the next space delimited word
|
||||
* [W]
|
||||
*/
|
||||
@ -232,9 +232,9 @@ vi_next_space_word(el, c)
|
||||
if (el->el_line.cursor == el->el_line.lastchar)
|
||||
return CC_ERROR;
|
||||
|
||||
el->el_line.cursor = cv_next_word(el, el->el_line.cursor,
|
||||
el->el_line.lastchar,
|
||||
el->el_state.argument,
|
||||
el->el_line.cursor = cv_next_word(el, el->el_line.cursor,
|
||||
el->el_line.lastchar,
|
||||
el->el_state.argument,
|
||||
cv__isword);
|
||||
|
||||
if (el->el_map.type == MAP_VI)
|
||||
@ -246,7 +246,7 @@ vi_next_space_word(el, c)
|
||||
return CC_CURSOR;
|
||||
}
|
||||
|
||||
/* vi_next_word():
|
||||
/* vi_next_word():
|
||||
* Vi move to the next word
|
||||
* [w]
|
||||
*/
|
||||
@ -259,8 +259,8 @@ vi_next_word(el, c)
|
||||
if (el->el_line.cursor == el->el_line.lastchar)
|
||||
return CC_ERROR;
|
||||
|
||||
el->el_line.cursor = cv_next_word(el, el->el_line.cursor,
|
||||
el->el_line.lastchar,
|
||||
el->el_line.cursor = cv_next_word(el, el->el_line.cursor,
|
||||
el->el_line.lastchar,
|
||||
el->el_state.argument,
|
||||
ce__isword);
|
||||
|
||||
@ -275,7 +275,7 @@ vi_next_word(el, c)
|
||||
|
||||
|
||||
|
||||
/* vi_change_case():
|
||||
/* vi_change_case():
|
||||
* Vi change case of character under the cursor and advance one character
|
||||
* [~]
|
||||
*/
|
||||
@ -299,7 +299,7 @@ vi_change_case(el, c)
|
||||
}
|
||||
|
||||
|
||||
/* vi_change_meta():
|
||||
/* vi_change_meta():
|
||||
* Vi change prefix command
|
||||
* [c]
|
||||
*/
|
||||
@ -317,7 +317,7 @@ vi_change_meta(el, c)
|
||||
}
|
||||
|
||||
|
||||
/* vi_insert_at_bol():
|
||||
/* vi_insert_at_bol():
|
||||
* Vi enter insert mode at the beginning of line
|
||||
* [I]
|
||||
*/
|
||||
@ -338,7 +338,7 @@ vi_insert_at_bol(el, c)
|
||||
}
|
||||
|
||||
|
||||
/* vi_replace_char():
|
||||
/* vi_replace_char():
|
||||
* Vi replace character under the cursor with the next character typed
|
||||
* [r]
|
||||
*/
|
||||
@ -358,7 +358,7 @@ vi_replace_char(el, c)
|
||||
}
|
||||
|
||||
|
||||
/* vi_replace_mode():
|
||||
/* vi_replace_mode():
|
||||
* Vi enter replace mode
|
||||
* [R]
|
||||
*/
|
||||
@ -378,7 +378,7 @@ vi_replace_mode(el, c)
|
||||
}
|
||||
|
||||
|
||||
/* vi_substitute_char():
|
||||
/* vi_substitute_char():
|
||||
* Vi replace character under the cursor and enter insert mode
|
||||
* [r]
|
||||
*/
|
||||
@ -394,7 +394,7 @@ vi_substitute_char(el, c)
|
||||
}
|
||||
|
||||
|
||||
/* vi_substitute_line():
|
||||
/* vi_substitute_line():
|
||||
* Vi substitute entire line
|
||||
* [S]
|
||||
*/
|
||||
@ -410,7 +410,7 @@ vi_substitute_line(el, c)
|
||||
}
|
||||
|
||||
|
||||
/* vi_change_to_eol():
|
||||
/* vi_change_to_eol():
|
||||
* Vi change to end of line
|
||||
* [C]
|
||||
*/
|
||||
@ -447,7 +447,7 @@ vi_insert(el, c)
|
||||
|
||||
|
||||
/* vi_add():
|
||||
* Vi enter insert mode after the cursor
|
||||
* Vi enter insert mode after the cursor
|
||||
* [a]
|
||||
*/
|
||||
protected el_action_t
|
||||
@ -489,7 +489,7 @@ vi_add_at_eol(el, c)
|
||||
el->el_line.cursor = el->el_line.lastchar;
|
||||
|
||||
/* Mark where insertion begins */
|
||||
el->el_chared.c_vcmd.ins = el->el_line.lastchar;
|
||||
el->el_chared.c_vcmd.ins = el->el_line.lastchar;
|
||||
el->el_chared.c_undo.ptr = el->el_line.lastchar;
|
||||
el->el_chared.c_undo.action = DELETE;
|
||||
return CC_CURSOR;
|
||||
@ -497,7 +497,7 @@ vi_add_at_eol(el, c)
|
||||
|
||||
|
||||
/* vi_delete_meta():
|
||||
* Vi delete prefix command
|
||||
* Vi delete prefix command
|
||||
* [d]
|
||||
*/
|
||||
protected el_action_t
|
||||
@ -511,8 +511,8 @@ vi_delete_meta(el, c)
|
||||
|
||||
|
||||
/* vi_end_word():
|
||||
* Vi move to the end of the current space delimited word
|
||||
* [E]
|
||||
* Vi move to the end of the current space delimited word
|
||||
* [E]
|
||||
*/
|
||||
protected el_action_t
|
||||
/*ARGSUSED*/
|
||||
@ -523,7 +523,7 @@ vi_end_word(el, c)
|
||||
if (el->el_line.cursor == el->el_line.lastchar)
|
||||
return CC_ERROR;
|
||||
|
||||
el->el_line.cursor = cv__endword(el->el_line.cursor, el->el_line.lastchar,
|
||||
el->el_line.cursor = cv__endword(el->el_line.cursor, el->el_line.lastchar,
|
||||
el->el_state.argument);
|
||||
|
||||
if (el->el_chared.c_vcmd.action & DELETE) {
|
||||
@ -549,7 +549,7 @@ vi_to_end_word(el, c)
|
||||
if (el->el_line.cursor == el->el_line.lastchar)
|
||||
return CC_ERROR;
|
||||
|
||||
el->el_line.cursor = cv__endword(el->el_line.cursor, el->el_line.lastchar,
|
||||
el->el_line.cursor = cv__endword(el->el_line.cursor, el->el_line.lastchar,
|
||||
el->el_state.argument);
|
||||
|
||||
if (el->el_chared.c_vcmd.action & DELETE) {
|
||||
@ -578,12 +578,12 @@ vi_undo(el, c)
|
||||
c_undo_t *un = &el->el_chared.c_undo;
|
||||
|
||||
#ifdef DEBUG_UNDO
|
||||
(void) fprintf(el->el_errfile, "Undo: %x \"%s\" +%d -%d\n",
|
||||
(void) fprintf(el->el_errfile, "Undo: %x \"%s\" +%d -%d\n",
|
||||
un->action, un->buf, un->isize, un->dsize);
|
||||
#endif
|
||||
switch (un->action) {
|
||||
case DELETE:
|
||||
if (un->dsize == 0)
|
||||
if (un->dsize == 0)
|
||||
return CC_NORM;
|
||||
|
||||
(void) memcpy(un->buf, un->ptr, un->dsize);
|
||||
@ -592,7 +592,7 @@ vi_undo(el, c)
|
||||
|
||||
el->el_line.lastchar -= un->dsize;
|
||||
el->el_line.cursor = un->ptr;
|
||||
|
||||
|
||||
un->action = INSERT;
|
||||
un->isize = un->dsize;
|
||||
un->dsize = 0;
|
||||
@ -600,9 +600,9 @@ vi_undo(el, c)
|
||||
|
||||
case DELETE|INSERT:
|
||||
size = un->isize - un->dsize;
|
||||
if (size > 0)
|
||||
if (size > 0)
|
||||
i = un->dsize;
|
||||
else
|
||||
else
|
||||
i = un->isize;
|
||||
cp = un->ptr;
|
||||
kp = un->buf;
|
||||
@ -635,7 +635,7 @@ vi_undo(el, c)
|
||||
break;
|
||||
|
||||
case INSERT:
|
||||
if (un->isize == 0)
|
||||
if (un->isize == 0)
|
||||
return CC_NORM;
|
||||
|
||||
el->el_line.cursor = un->ptr;
|
||||
@ -647,11 +647,11 @@ vi_undo(el, c)
|
||||
break;
|
||||
|
||||
case CHANGE:
|
||||
if (un->isize == 0)
|
||||
if (un->isize == 0)
|
||||
return CC_NORM;
|
||||
|
||||
el->el_line.cursor = un->ptr;
|
||||
size = (int) (el->el_line.cursor - el->el_line.lastchar);
|
||||
size = (int) (el->el_line.cursor - el->el_line.lastchar);
|
||||
if (size < un->isize)
|
||||
size = un->isize;
|
||||
cp = un->ptr;
|
||||
@ -685,7 +685,7 @@ vi_command_mode(el, c)
|
||||
int size;
|
||||
/* [Esc] cancels pending action */
|
||||
el->el_chared.c_vcmd.ins = 0;
|
||||
el->el_chared.c_vcmd.action = NOP;
|
||||
el->el_chared.c_vcmd.action = NOP;
|
||||
el->el_chared.c_vcmd.pos = 0;
|
||||
|
||||
el->el_state.doingarg = 0;
|
||||
@ -708,7 +708,7 @@ vi_command_mode(el, c)
|
||||
}
|
||||
|
||||
/* vi_zero():
|
||||
* Vi move to the beginning of line
|
||||
* Vi move to the beginning of line
|
||||
* [0]
|
||||
*/
|
||||
protected el_action_t
|
||||
@ -719,7 +719,7 @@ vi_zero(el, c)
|
||||
if (el->el_state.doingarg) {
|
||||
if (el->el_state.argument > 1000000)
|
||||
return CC_ERROR;
|
||||
el->el_state.argument =
|
||||
el->el_state.argument =
|
||||
(el->el_state.argument * 10) + (c - '0');
|
||||
return CC_ARGHACK;
|
||||
}
|
||||
@ -735,23 +735,23 @@ vi_zero(el, c)
|
||||
|
||||
|
||||
/* vi_delete_prev_char():
|
||||
* Vi move to previous character (backspace)
|
||||
* Vi move to previous character (backspace)
|
||||
* [^H]
|
||||
*/
|
||||
*/
|
||||
protected el_action_t
|
||||
/*ARGSUSED*/
|
||||
vi_delete_prev_char(el, c)
|
||||
EditLine *el;
|
||||
int c;
|
||||
{
|
||||
if (el->el_chared.c_vcmd.ins == 0)
|
||||
if (el->el_chared.c_vcmd.ins == 0)
|
||||
return CC_ERROR;
|
||||
|
||||
if (el->el_chared.c_vcmd.ins >
|
||||
if (el->el_chared.c_vcmd.ins >
|
||||
el->el_line.cursor - el->el_state.argument)
|
||||
return CC_ERROR;
|
||||
|
||||
c_delbefore(el, el->el_state.argument);
|
||||
c_delbefore(el, el->el_state.argument);
|
||||
el->el_line.cursor -= el->el_state.argument;
|
||||
|
||||
return CC_REFRESH;
|
||||
@ -769,7 +769,7 @@ vi_list_or_eof(el, c)
|
||||
int c;
|
||||
{
|
||||
#ifdef notyet
|
||||
if (el->el_line.cursor == el->el_line.lastchar &&
|
||||
if (el->el_line.cursor == el->el_line.lastchar &&
|
||||
el->el_line.cursor == el->el_line.buffer) {
|
||||
#endif
|
||||
term_overwrite(el, STReof, 4); /* then do a EOF */
|
||||
@ -787,7 +787,7 @@ vi_list_or_eof(el, c)
|
||||
|
||||
|
||||
/* vi_kill_line_prev():
|
||||
* Vi cut from beginning of line to cursor
|
||||
* Vi cut from beginning of line to cursor
|
||||
* [^U]
|
||||
*/
|
||||
protected el_action_t
|
||||
@ -847,7 +847,7 @@ vi_repeat_search_next(el, c)
|
||||
EditLine *el;
|
||||
int c;
|
||||
{
|
||||
if (el->el_search.patlen == 0)
|
||||
if (el->el_search.patlen == 0)
|
||||
return CC_ERROR;
|
||||
else
|
||||
return cv_repeat_srch(el, el->el_search.patdir);
|
||||
@ -864,10 +864,10 @@ vi_repeat_search_prev(el, c)
|
||||
EditLine *el;
|
||||
int c;
|
||||
{
|
||||
if (el->el_search.patlen == 0)
|
||||
if (el->el_search.patlen == 0)
|
||||
return CC_ERROR;
|
||||
else
|
||||
return cv_repeat_srch(el,
|
||||
return cv_repeat_srch(el,
|
||||
el->el_search.patdir == ED_SEARCH_PREV_HISTORY ?
|
||||
ED_SEARCH_NEXT_HISTORY : ED_SEARCH_PREV_HISTORY);
|
||||
}
|
||||
@ -969,8 +969,8 @@ vi_repeat_next_char(el, c)
|
||||
if (el->el_search.chacha == 0)
|
||||
return CC_ERROR;
|
||||
|
||||
return el->el_search.chadir == CHAR_FWD ?
|
||||
cv_csearch_fwd(el, el->el_search.chacha, el->el_state.argument, 0) :
|
||||
return el->el_search.chadir == CHAR_FWD ?
|
||||
cv_csearch_fwd(el, el->el_search.chacha, el->el_state.argument, 0) :
|
||||
cv_csearch_back(el, el->el_search.chacha, el->el_state.argument, 0);
|
||||
}
|
||||
|
||||
@ -988,7 +988,7 @@ vi_repeat_prev_char(el, c)
|
||||
if (el->el_search.chacha == 0)
|
||||
return CC_ERROR;
|
||||
|
||||
return el->el_search.chadir == CHAR_BACK ?
|
||||
cv_csearch_fwd(el, el->el_search.chacha, el->el_state.argument, 0) :
|
||||
return el->el_search.chadir == CHAR_BACK ?
|
||||
cv_csearch_fwd(el, el->el_search.chacha, el->el_state.argument, 0) :
|
||||
cv_csearch_back(el, el->el_search.chacha, el->el_state.argument, 0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user