mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-04 12:52:15 +00:00
Import of tcsh-6.15.00
This commit is contained in:
parent
547e75d625
commit
45e5710bbb
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/vendor/tcsh/dist/; revision=167465
@ -1,3 +1,102 @@
|
||||
74. V6.15.00 - 20070303
|
||||
73. fix extension eating windows code (christos)
|
||||
72. fix loop in %R history expansion (christos)
|
||||
71. sched +X source file disables interrupts (Mike Sullivan)
|
||||
70. One off copying macro buffers (Jean-Luc Leger)
|
||||
69. Avoid infinite loops in :ga modifiers when the LHS is a substring of the
|
||||
RHS.
|
||||
68. Automatically disable WIDE_STRINGS with --disable-nls (Miloslav Trmac)
|
||||
67. V6.14.07 - 20060825
|
||||
66. rename set to setv to avoid clashes (christos)
|
||||
65. Eliminate sighold/sigrelse (christos)
|
||||
64. Compilation cleanups. (Martin Kraemer)
|
||||
63. Don't rebuild needlessly when generated files are unchanged
|
||||
(Martin Kraemer)
|
||||
62. Fix confusion between Char and eChar (Martin Kraemer)
|
||||
61. V6.14.06 - 20060824
|
||||
60. set PROGRAM_ENVIRONMENT for OSD_POSIX (Martin Kraemer)
|
||||
59. EBCDIC patch (Martin Kraemer)
|
||||
58. Remove globbing support in history rearches (Ryan Barrett)
|
||||
57. Highlighting patch (Ryan Barrett)
|
||||
56. Mark-Cursor exchange emacs editing fix (Martin Kraemer)
|
||||
55. V6.14.05 - 20060304
|
||||
54. don't limit termcap strings to 1K (Alan Ferrency)
|
||||
53. protect against null path.
|
||||
52. Be more conservative in wide_read PR#29
|
||||
51. remove HAVE_STRCOLL; not needed anymore (Miloslav Trmac)
|
||||
50. remove imake support and make nls configurable by configure
|
||||
(Miloslav Trmac)
|
||||
49. V6.14.04 - 20060214
|
||||
48. Fixes build failure with !SHORT_STRINGS (Miloslav Trmac)
|
||||
47. Fixes constness warnings with !SHORT_STRINGS: short2str is "strip()",
|
||||
which modifies its argument. Rather than verify this is safe in all
|
||||
callers, I have added caching_strip() to mirror the behavior of other
|
||||
modes. (Miloslav Trmac)
|
||||
46. Fixes some constness warnings with SHORT_STRINGS; this is orthogonal
|
||||
to both build errors with SHORT_STRINGS in 6.14.03, and
|
||||
short_strings.patch. (Miloslav Trmac)
|
||||
45. config-catalogs.patch: Autodetect catalog support (#14). (Miloslav Trmac)
|
||||
44. auth.patch: Handle false positives in getauthid() detection,
|
||||
IIRC on FreeBSD. (Miloslav Trmac)
|
||||
43. crypt.patch: Autodetect whether <crypt.h> is available. (Miloslav Trmac)
|
||||
42. sigint.patch: Block SIGINT while waiting on children.
|
||||
This is necessary, but I'll still have to look on the older
|
||||
releases to find out why it was not necessary before
|
||||
("before" = 6.13 on Linux). (Miloslav Trmac)
|
||||
41. config-package.patch: Readd package version to configure.in,
|
||||
the testsuite uses it.
|
||||
(TODO: a better integration with package.h) (Miloslav Trmac)
|
||||
40. item_len.patch: Truncate item.len when truncating the string,
|
||||
just to be sure. (Miloslav Trmac)
|
||||
39. va_list.patch: Add missing va_end(). (Miloslav Trmac)
|
||||
38. Use va_copy in xvasprintf(); emulate va_copy as suggested in
|
||||
Autoconf manual if it is not available. (Miloslav Trmac)
|
||||
37. declarations.patch: Replace some #ifdef nests by autodetecting
|
||||
whether the guarded declaration is necessary.
|
||||
I'm only guessing this is the intent of the #ifdefs, though.
|
||||
Declare environ unconditionally, it is a bit hard to detect
|
||||
and the declaration is correct for Linux, anyway. (Miloslav Trmac)
|
||||
36. warning.patch: Fix a const warning.
|
||||
35. More color-ls variables (Jean-Luc Leger)
|
||||
34. V6.14.03 - 20060212
|
||||
33. Signal related changes (Miloslav Trmac)
|
||||
32. Misc cast cleanups and code clarification (Miloslav Trmac)
|
||||
31. Use dynamically allocated buffers everywhere (Miloslav Trmac)
|
||||
30. Fix reading of invalid byte sequences (Miloslav Trmac)
|
||||
29. read should only increment count when it succeeds (Miloslav Trmac)
|
||||
28. testsuiteadditions (Miloslav Trmac)
|
||||
27. -n fixes (Miloslav Trmac)
|
||||
26. signness warnings (Miloslav Trmac)
|
||||
25. Prevent infinite recursion in catclose (Gerhard Niklasch)
|
||||
24. Add Dragonfly (Joerg Sonnenberger)
|
||||
23. Check for wcwidth returning a negative number (TOMITA Yoshinori)
|
||||
22. recognize "li" and "co" in echotc (Martin Kraemer) [PR/7]
|
||||
21. Don't use T_Cols for wrapping purposes; use TermH consistently
|
||||
(Martin Kraemer) [PR/8]
|
||||
20. Don't display duplicate utmp records (Miloslav Trmac) [PR/17]
|
||||
19. Clarify hashing and -f sections of man page (Volker Quetschke) [PR/20]
|
||||
18. Dave Yearke: configure did not recognize solaris 10 [PR/18]
|
||||
17. CYGWIN: Don't lowercase commands and allow foo.exe on command line.
|
||||
(Corinna Vinschen) [PR/19]
|
||||
16. CYGWIN: cd /foo && cd .. ends up erroneously in // for systems that
|
||||
HAVE_SLASHSLASH [PR/21]
|
||||
15. %j was broken (Peter Kruse)
|
||||
14. Extend // handling in pathnames from being apollo specific to also
|
||||
cygwin (Corinna Vinschen)
|
||||
13. Fix uppercase/lowercase transformations (Jean-Luc Leger)
|
||||
12. Fix symlink expansion (revert from 6.10.00) (Jean-Luc Leger and Christos)
|
||||
11. Fix literal sequence in prompt (Miloslav Trmac)
|
||||
10. V6.14.02 - 20050412
|
||||
9. Prototype fixes (Miloslav Trmac and Jean-Luc Leger)
|
||||
8. V6.14.01 - 20050411
|
||||
7. Make =- refer to $owd (H.Merijn Brand)
|
||||
6. Use prototypes (almost) everywhere (Miloslav Trmac) (issue #5)
|
||||
5. Fix doc path in Cygwin installation (Corinna Vinschen)
|
||||
4. Fix column size calculation (Martin Kraemer)
|
||||
3. Implement newline-and-hold and newline-and-down-history (Per Hedeland)
|
||||
2. Messages fixes for the ja (Japanese) locale (NAKAMURA Takeshi) (issue #4)
|
||||
1. Enable charset conversion in nls (Miloslav Trmac) (issue #3)
|
||||
|
||||
76. V6.14.00 - 20050325
|
||||
75. Additional messages for the ja (Japanese) locale (NAKAMURA Takeshi)
|
||||
74. V6.13.10 - 20050321
|
||||
|
@ -1,5 +1,5 @@
|
||||
XCOMM
|
||||
XCOMM $Id: Imakefile,v 1.84 2004/12/25 21:15:05 christos Exp $
|
||||
XCOMM $tcsh: Imakefile,v 1.85 2006/03/02 18:46:44 christos Exp $
|
||||
XCOMM
|
||||
XCOMM Imakefile for tcsh 6.12
|
||||
XCOMM Marc Horowitz, MIT SIPB
|
||||
|
@ -2,7 +2,7 @@
|
||||
#
|
||||
# MAKEDIFFS.sh: Make context diffs for the csh sources
|
||||
#
|
||||
# $Id: MAKEDIFFS,v 3.0 1991/07/04 21:57:47 christos Exp $
|
||||
# $tcsh: MAKEDIFFS,v 3.1 2006/03/02 18:46:44 christos Exp $
|
||||
XINUDIR=/usr/share/src/mtXinu/bin/csh
|
||||
BSDDIR=/usr/share/src/mtXinu/BSD/bin/csh
|
||||
TAHOEDIR=/usr/share/src/mtXinu/TAHOE/bin/csh
|
||||
|
@ -2,7 +2,7 @@
|
||||
#
|
||||
# MAKESHAR.sh: Make a shar file for the sources
|
||||
#
|
||||
# $Id: MAKESHAR,v 3.1 1992/05/09 04:03:53 christos Exp $
|
||||
# $tcsh: MAKESHAR,v 3.2 2006/03/02 18:46:44 christos Exp $
|
||||
|
||||
AWK=/usr/bin/nawk # Must be nawk or gawk cause of 2D arrays
|
||||
WC=/usr/ucb/wc
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $Id: Makefile.in,v 3.27 2005/03/23 13:20:30 kim Exp $
|
||||
# $tcsh: Makefile.in,v 3.36 2006/08/24 20:56:31 christos Exp $
|
||||
# Makefile.in 4.3 6/11/83
|
||||
#
|
||||
# C Shell with process control; VM/UNIX VAX Makefile
|
||||
@ -8,7 +8,7 @@
|
||||
# things; Paul Placeway, CIS Dept., Ohio State University
|
||||
#
|
||||
SHELL=/bin/sh
|
||||
VERSION=6.12
|
||||
VERSION=@PACKAGE_VERSION@
|
||||
BUILD=tcsh$(EXEEXT)
|
||||
VPATH=@srcdir@
|
||||
srcdir=@srcdir@
|
||||
@ -231,7 +231,8 @@ LIBES= @LIBS@ ## This is set by autoconf.
|
||||
#
|
||||
|
||||
EXTRAFLAGS = @HESDEF@ $(AFSDEF)
|
||||
EXTRALIBS = @HESLIB@ $(AFSLIB)
|
||||
EXTRALIBS = @HESLIB@ $(AFSLIB) @LIBICONV@
|
||||
|
||||
|
||||
|
||||
# The difficult choice of a c-compiler...
|
||||
@ -326,14 +327,19 @@ AVSRCS= Fixes MAKEDIFFS MAKESHAR NewThings README FAQ \
|
||||
WishList config_f.h eight-bit.me glob.3 patchlevel.h \
|
||||
pathnames.h tcsh.man Ported src.desc Imakefile imake.config \
|
||||
README.imake complete.tcsh vmsreadme.txt termcap.vms snames.h \
|
||||
host.defs gethost.c tcsh.man2html configure.in configure config.h.in
|
||||
host.defs gethost.c tcsh.man2html configure.in configure config.h.in \
|
||||
tests/testsuite.at
|
||||
TESTFILES= tests/aliases.at tests/arguments.at tests/commands.at \
|
||||
tests/expr.at tests/lexical.at tests/mb-eucjp.at tests/mb-utf8.at \
|
||||
tests/noexec.at tests/syntax.at tests/subst.at tests/variables.at \
|
||||
tests/sh.dol.at
|
||||
|
||||
VHSRCS=${PVSRCS} ${AVSRCS}
|
||||
|
||||
CONFSRCS=config/*
|
||||
|
||||
ALLSRCS= ${SHSRCS} ${TWSRCS} ${EDSRCS} ${TCSRCS} ${VHSRCS}
|
||||
DISTSRCS= ${PSSRCS} ${TWSRCS} ${EDSRCS} ${TCSRCS} ${AVSRCS}
|
||||
DISTSRCS= ${PSSRCS} ${TWSRCS} ${EDSRCS} ${TCSRCS} ${AVSRCS} $(TESTFILES)
|
||||
|
||||
|
||||
OBJS= ${SHOBJS} ${TWOBJS} ${EDOBJS} ${TCOBJS}
|
||||
@ -362,18 +368,26 @@ gethost: gethost.c sh.err.h tc.const.h sh.h
|
||||
${CC} -o gethost ${LDFLAGS} ${CFLAGS} ${CPPFLAGS} ${DFLAGS} $(srcdir)/gethost.c ${LIBES} ${EXTRALIBS}
|
||||
|
||||
tc.defs.c: gethost host.defs
|
||||
@rm -f $@
|
||||
@echo "/* Do not edit this file, make creates it */" > $@
|
||||
./gethost $(srcdir)/host.defs >> $@
|
||||
@rm -f $@.tmp
|
||||
@echo "/* Do not edit this file, make creates it */" > $@.tmp
|
||||
./gethost $(srcdir)/host.defs >> $@.tmp
|
||||
@if [ -f $@ ] && cmp -s $@.tmp $@; then echo $@ unchanged.; rm -f $@.tmp; else mv -f $@.tmp $@; echo $@ recreated.; fi
|
||||
|
||||
tcsh.ps: tcsh.man
|
||||
rm -f tcsh.ps
|
||||
-ptroff -t -man $(srcdir)/tcsh.man > tcsh.ps
|
||||
|
||||
|
||||
.c.${SUF}:
|
||||
${CC} ${CF} ${CFLAGS} ${CPPFLAGS} ${DFLAGS} ${EXTRAFLAGS} $<
|
||||
|
||||
.SUFFIXES: .s .i
|
||||
|
||||
.c.i:
|
||||
${CC} -E ${CFLAGS} ${CPPFLAGS} ${DFLAGS} ${EXTRAFLAGS} $< | cat -s > $@
|
||||
|
||||
.c.s:
|
||||
${CC} -S ${CFLAGS} ${CPPFLAGS} ${DFLAGS} ${EXTRAFLAGS} $<
|
||||
|
||||
# _VMS_POSIX #module addition
|
||||
#.c.${SUF}:
|
||||
# @(echo '#module '`echo $< | sed -e 's/\./_/g'`; cat $<) > $*..c
|
||||
@ -410,31 +424,53 @@ tcsh.ps: tcsh.man
|
||||
## co $<
|
||||
|
||||
ed.defns.h: ed.defns.c
|
||||
@rm -f $@
|
||||
@echo '/* Do not edit this file, make creates it. */' > $@
|
||||
@echo '#ifndef _h_ed_defns' >> $@
|
||||
@echo '#define _h_ed_defns' >> $@
|
||||
grep '[FV]_' $(srcdir)/ed.defns.c | grep '^#define' >> $@
|
||||
@echo '#endif /* _h_ed_defns */' >> $@
|
||||
@rm -f $@.tmp
|
||||
@echo '/* Do not edit this file, make creates it. */' > $@.tmp
|
||||
@echo '#ifndef _h_ed_defns' >> $@.tmp
|
||||
@echo '#define _h_ed_defns' >> $@.tmp
|
||||
grep '[FV]_' $(srcdir)/ed.defns.c | grep '^#define' >> $@.tmp
|
||||
@echo '#endif /* _h_ed_defns */' >> $@.tmp
|
||||
@if [ -f $@ ] && cmp -s $@.tmp $@; then echo $@ unchanged.; rm -f $@.tmp; else mv -f $@.tmp $@; echo $@ recreated.; fi
|
||||
|
||||
sh.err.h: sh.err.c
|
||||
@rm -f $@
|
||||
@echo '/* Do not edit this file, make creates it. */' > $@
|
||||
@echo '#ifndef _h_sh_err' >> $@
|
||||
@echo '#define _h_sh_err' >> $@
|
||||
grep 'ERR_' $(srcdir)/sh.err.c | grep '^#define' >> $@
|
||||
@echo '#endif /* _h_sh_err */' >> $@
|
||||
@rm -f $@.tmp
|
||||
@echo '/* Do not edit this file, make creates it. */' > $@.tmp
|
||||
@echo '#ifndef _h_sh_err' >> $@.tmp
|
||||
@echo '#define _h_sh_err' >> $@.tmp
|
||||
grep 'ERR_' $(srcdir)/sh.err.c | grep '^#define' >> $@.tmp
|
||||
@echo '#endif /* _h_sh_err */' >> $@.tmp
|
||||
@if [ -f $@ ] && cmp -s $@.tmp $@; then echo $@ unchanged.; rm -f $@.tmp; else mv -f $@.tmp $@; echo $@ recreated.; fi
|
||||
|
||||
tc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h
|
||||
@rm -f $@
|
||||
@echo '/* Do not edit this file, make creates it. */' > $@
|
||||
@echo '#ifndef _h_tc_const' >> $@
|
||||
@echo '#define _h_tc_const' >> $@
|
||||
@rm -f $@.tmp
|
||||
@echo '/* Do not edit this file, make creates it. */' > $@.tmp
|
||||
@echo '#ifndef _h_tc_const' >> $@.tmp
|
||||
@echo '#define _h_tc_const' >> $@.tmp
|
||||
${CPP} $(CPPFLAGS) ${DFLAGS} ${EXTRAFLAGS} -D_h_tc_const\
|
||||
$(srcdir)/tc.const.c | \
|
||||
sed -n -e 's/^\(Char STR[a-zA-Z0-9_]*\) *\[ *\].*/extern \1[];/p' | \
|
||||
sort >> $@
|
||||
@echo '#endif /* _h_tc_const */' >> $@
|
||||
sort >> $@.tmp
|
||||
@echo '#endif /* _h_tc_const */' >> $@.tmp
|
||||
@if [ -f $@ ] && cmp -s $@.tmp $@; then echo $@ unchanged.; rm -f $@.tmp; else mv -f $@.tmp $@; echo $@ recreated.; fi
|
||||
|
||||
$(srcdir)/tests/package.m4: $(srcdir)/configure.in
|
||||
{ \
|
||||
echo '# Signature of the current package.'; \
|
||||
echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \
|
||||
echo 'm4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \
|
||||
echo 'm4_define([AT_PACKAGE_VERSION], [@PACKAGE_VERSION@])'; \
|
||||
echo 'm4_define([AT_PACKAGE_STRING], [@PACKAGE_STRING@])'; \
|
||||
echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \
|
||||
} >$(srcdir)/tests/package.m4
|
||||
|
||||
$(srcdir)/tests/testsuite: tests/package.m4 tests/testsuite.at $(TESTFILES)
|
||||
autom4te --language=autotest -I $(srcdir)/tests \
|
||||
$(srcdir)/tests/testsuite.at -o $@.tmp
|
||||
mv $@.tmp $@
|
||||
|
||||
atconfig: config.status
|
||||
$(SHELL) ./config.status ./atconfig
|
||||
|
||||
|
||||
csh.prof: ${OBJS} sh.prof.${SUF} mcrt0.${SUF}
|
||||
rm -f csh.prof
|
||||
@ -489,12 +525,12 @@ install.man: tcsh.man
|
||||
chmod 444 ${DESTMAN}/tcsh.${MANSECT}
|
||||
|
||||
install.cygwin: install install.man
|
||||
-mkdir -p ${DESTDIR}${prefix}/doc/tcsh
|
||||
cp ${srcdir}/FAQ ${srcdir}/Fixes ${DESTDIR}${prefix}/doc/tcsh
|
||||
cp ${srcdir}/NewThings ${srcdir}/README ${DESTDIR}${prefix}/doc/tcsh
|
||||
cp ${srcdir}/WishList ${srcdir}/Y2K ${DESTDIR}${prefix}/doc/tcsh
|
||||
-mkdir -p ${DESTDIR}${prefix}/share/doc/tcsh
|
||||
cp ${srcdir}/FAQ ${srcdir}/Fixes ${DESTDIR}${prefix}/share/doc/tcsh
|
||||
cp ${srcdir}/NewThings ${srcdir}/README ${DESTDIR}${prefix}/share/doc/tcsh
|
||||
cp ${srcdir}/WishList ${srcdir}/Y2K ${DESTDIR}${prefix}/share/doc/tcsh
|
||||
perl ${srcdir}/tcsh.man2html ${srcdir}/tcsh.man
|
||||
cp -rp tcsh.html ${DESTDIR}${prefix}/doc/tcsh
|
||||
cp -rp tcsh.html ${DESTDIR}${prefix}/share/doc/tcsh
|
||||
-mkdir -p ${DESTDIR}/etc/profile.d
|
||||
-mkdir -p ${DESTDIR}/etc/postinstall
|
||||
cp -p ${srcdir}/cygwin/etc/csh.* ${DESTDIR}/etc
|
||||
@ -515,7 +551,8 @@ install.cygwin: install install.man
|
||||
|
||||
clean:
|
||||
${RM} -f a.out strings x.c xs.c tcsh$(EXEEXT) tcsh.a _MAKE_LOG gethost
|
||||
${RM} -f *.${SUF} sh.prof.c ed.defns.h tc.const.h sh.err.h tc.defs.c
|
||||
${RM} -f *.${SUF} *.i *.s
|
||||
${RM} -f sh.prof.c ed.defns.h tc.const.h sh.err.h tc.defs.c
|
||||
${RM} -f tcsh.*.m tcsh.*.cat
|
||||
|
||||
veryclean: clean
|
||||
@ -527,13 +564,15 @@ veryclean: clean
|
||||
|
||||
distclean: veryclean
|
||||
|
||||
cleandir: veryclean
|
||||
|
||||
tags: /tmp
|
||||
${CTAGS} sh*.c
|
||||
|
||||
tar.Z:
|
||||
rm -f tcsh-${VERSION}.tar.Z
|
||||
rm -rf tcsh-${VERSION}
|
||||
-mkdir tcsh-${VERSION} tcsh-${VERSION}/config
|
||||
-mkdir tcsh-${VERSION} tcsh-${VERSION}/config tcsh-${VERSION}/tests
|
||||
cp ${ALLSRCS} tcsh-${VERSION}
|
||||
cp ${CONFSRCS} tcsh-${VERSION}/config
|
||||
tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -)
|
||||
@ -543,7 +582,7 @@ tar.Z:
|
||||
tar.gz:
|
||||
rm -f tcsh-${VERSION}.tar.gz
|
||||
rm -rf tcsh-${VERSION}
|
||||
-mkdir tcsh-${VERSION} tcsh-${VERSION}/config
|
||||
-mkdir tcsh-${VERSION} tcsh-${VERSION}/config tcsh-${VERSION}/tests
|
||||
cp ${ALLSRCS} tcsh-${VERSION}
|
||||
cp ${CONFSRCS} tcsh-${VERSION}/config
|
||||
tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -)
|
||||
@ -553,7 +592,7 @@ tar.gz:
|
||||
shar:
|
||||
rm -f tcsh-*.shar
|
||||
rm -rf tcsh-${VERSION}
|
||||
-mkdir tcsh-${VERSION} tcsh-${VERSION}/config
|
||||
-mkdir tcsh-${VERSION} tcsh-${VERSION}/config tcsh-${VERSION}/tests
|
||||
cp ${ALLSRCS} tcsh-${VERSION}
|
||||
cp ${CONFSRCS} tcsh-${VERSION}/config
|
||||
tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -)
|
||||
@ -568,7 +607,7 @@ catalogs:
|
||||
tcsh-${VERSION}.tar.Z:
|
||||
rm -rf tcsh-${VERSION}
|
||||
rm -f tcsh-${VERSION}.tar tcsh-${VERSION}.tar.Z DIFFS.[123]
|
||||
-mkdir tcsh-${VERSION}
|
||||
-mkdir tcsh-${VERSION} tcsh-${VERSION}/tests
|
||||
./MAKEDIFFS bsd
|
||||
mv DIFFS.1 DIFFS.2 DIFFS.3 tcsh-${VERSION}
|
||||
cp ${DISTSRCS} tcsh-${VERSION}
|
||||
@ -621,6 +660,9 @@ $(srcdir)/stamp-h.in: $(srcdir)/configure.in
|
||||
cd $(srcdir) && autoheader
|
||||
@echo timestamp > $(srcdir)/stamp-h.in
|
||||
|
||||
check: atconfig $(srcdir)/tests/testsuite
|
||||
$(SHELL) $(srcdir)/tests/testsuite
|
||||
|
||||
#
|
||||
# Dependencies
|
||||
#
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $Id: Makefile.std,v 1.96 2004/12/25 21:15:05 christos Exp $
|
||||
# $tcsh: Makefile.std,v 1.97 2006/03/02 18:46:44 christos Exp $
|
||||
# Makefile.std 4.3 6/11/83
|
||||
#
|
||||
# C Shell with process control; VM/UNIX VAX Makefile
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $Id: Makefile.vms,v 1.38 2004/12/25 21:15:05 christos Exp $
|
||||
# $tcsh: Makefile.vms,v 1.39 2006/03/02 18:46:44 christos Exp $
|
||||
# Makefile.vms 4.3 6/11/83
|
||||
#
|
||||
# C Shell with process control; VM/UNIX VAX Makefile
|
||||
|
@ -1,4 +1,4 @@
|
||||
This is tcsh version 6.14. Tcsh is a version of the Berkeley
|
||||
This is tcsh version 6.15. Tcsh is a version of the Berkeley
|
||||
C-Shell, with the addition of: a command line editor, command and file
|
||||
name completion, listing, etc. and a bunch of small additions to the
|
||||
shell itself.
|
||||
@ -19,12 +19,12 @@ names of the authors from the source code or documentation).
|
||||
|
||||
To install tcsh:
|
||||
|
||||
0) Try running "configure". If that works, goto step 6.
|
||||
If you are using imake, try xmkmf and goto step 3.
|
||||
If imake does not work, copy Makefile.std to Makefile.
|
||||
0) Try running "./configure". If that doesn't work, goto step 1.
|
||||
Run "./configure --help" to see possible options. After running
|
||||
configure, goto step 3.
|
||||
|
||||
1) Look at the Makefile and make sure that you are using the right
|
||||
compilation flags.
|
||||
1) Otherwise copy Makefile.std to Makefile. Look at the Makefile and
|
||||
make sure that you are using the right compilation flags.
|
||||
|
||||
2) Copy the appropriate for your machine and OS config file from the
|
||||
config subdirectory into config.h. Consult the file "Ported" for
|
||||
@ -34,7 +34,7 @@ To install tcsh:
|
||||
the supplied ones. If you get tcsh working on a new machine, I'd
|
||||
appreciate a copy of the config file plus additional information
|
||||
about the architecture/OS. If you are creating a new config file,
|
||||
look very hard at BSDJOBS, BSDSIGS, and BSDTIMES if you are running
|
||||
look very hard at BSDJOBS and BSDTIMES if you are running
|
||||
a non-BSD machine. For vanila SysV, these would all be #undef-ed,
|
||||
but others may vary (such as A/UX or HPUX). On a pyramid, compile
|
||||
in the UCB universe even if you are running under the ATT universe
|
||||
@ -42,33 +42,27 @@ To install tcsh:
|
||||
|
||||
3) Look at config_f.h, and enable or disable any features you want.
|
||||
It is configured the way I like it, but you may disagree.
|
||||
If you do not have NLS, then locale.h will not be found. Undefine it
|
||||
and things should work ok. On the other hand, if you have NLS you
|
||||
might as well use it...
|
||||
|
||||
4) Look at host.defs to make sure that you have the right defines to set
|
||||
the environment variables "HOSTTYPE", "MACHTYPE", "OSTYPE" and
|
||||
"VENDOR" correctly. If you need to make changes, PLEASE SEND THEM
|
||||
BACK TO ME.
|
||||
|
||||
5) You may want to adjust the TCSH_BINDIR and TCSH_MANDIR entries in
|
||||
5) You may want to adjust the DESTBIN and DESTMAN entries in
|
||||
the Makefile. These are the directories that tcsh, and the tcsh.1
|
||||
man entry will be placed in when you do a "make install" and "make
|
||||
install.man" respectively. If you decide to install tcsh somewhere
|
||||
other than in /usr/local/bin/tcsh, you should #define _PATH_TCSHELL
|
||||
"/your/installation/directory/tcsh" in pathnames.h.
|
||||
|
||||
6) If you've changed any of the configuration variables you may need
|
||||
to re-run configure.
|
||||
6) make
|
||||
|
||||
7) make
|
||||
|
||||
8) Read the documentation while you are waiting. The file tcsh.man
|
||||
7) Read the documentation while you are waiting. The file tcsh.man
|
||||
is in standard [nt]roff -man format. If you like, you can run the
|
||||
tcsh.man2html script (requires Perl) to generate an HTML version of
|
||||
the manpage which you can read with Mosaic, lynx or other HTML browser.
|
||||
|
||||
9) Test tcsh by typing ./tcsh to see that it has compiled correctly.
|
||||
8) Test tcsh by typing ./tcsh to see that it has compiled correctly.
|
||||
The history command should give a time stamp on every entry.
|
||||
Typing normal characters should echo each exactly once. Control-A
|
||||
should put the cursor at the beginning of the input line, but after
|
||||
@ -86,12 +80,12 @@ To install tcsh:
|
||||
passwd appears on the screen, you have lost /dev/tty. Otherwise
|
||||
everything is fine.
|
||||
|
||||
10) Once satisfied that tcsh is working correctly, complete the installation
|
||||
9) Once satisfied that tcsh is working correctly, complete the installation
|
||||
by typing "make install" to install the binary, and "make install.man" to
|
||||
install the documentation. Don't forget to look at complete.tcsh for
|
||||
useful completions...
|
||||
|
||||
11) Enjoy.
|
||||
10) Enjoy.
|
||||
|
||||
12) PLEASE file any bug reports (and fixes), code for new features at:
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# $Id: complete.tcsh,v 1.46 2005/03/21 21:26:08 kim Exp $
|
||||
# $tcsh: complete.tcsh,v 1.47 2006/03/02 18:46:44 christos Exp $
|
||||
# example file using the new completion code
|
||||
#
|
||||
# Debian GNU/Linux
|
||||
|
@ -10,10 +10,28 @@
|
||||
/* Define to 1 if you have the <auth.h> header file. */
|
||||
#undef HAVE_AUTH_H
|
||||
|
||||
/* Define to 1 if you have the `catgets' function. */
|
||||
#undef HAVE_CATGETS
|
||||
|
||||
/* Define to 1 if you have the <crypt.h> header file. */
|
||||
#undef HAVE_CRYPT_H
|
||||
|
||||
/* Define to 1 if you have the declaration of `crypt', and to 0 if you don't.
|
||||
*/
|
||||
#undef HAVE_DECL_CRYPT
|
||||
|
||||
/* Define to 1 if you have the declaration of `environ', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_ENVIRON
|
||||
|
||||
/* Define to 1 if you have the declaration of `gethostname', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_GETHOSTNAME
|
||||
|
||||
/* Define to 1 if you have the declaration of `getpgrp', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_GETPGRP
|
||||
|
||||
/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
|
||||
*/
|
||||
#undef HAVE_DIRENT_H
|
||||
@ -21,6 +39,9 @@
|
||||
/* Define to 1 if you have the `dup2' function. */
|
||||
#undef HAVE_DUP2
|
||||
|
||||
/* Define to 1 if you have the `getauthid' function. */
|
||||
#undef HAVE_GETAUTHID
|
||||
|
||||
/* Define to 1 if you have the `getcwd' function. */
|
||||
#undef HAVE_GETCWD
|
||||
|
||||
@ -33,7 +54,7 @@
|
||||
/* Define to 1 if you have the `getutent' function. */
|
||||
#undef HAVE_GETUTENT
|
||||
|
||||
/* Define to 1 if you have the iconv () interface */
|
||||
/* Define if you have the iconv() function. */
|
||||
#undef HAVE_ICONV
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
@ -42,6 +63,9 @@
|
||||
/* Define to 1 if the system has the type `long long'. */
|
||||
#undef HAVE_LONG_LONG
|
||||
|
||||
/* Define to 1 if mbrtowc and mbstate_t are properly declared. */
|
||||
#undef HAVE_MBRTOWC
|
||||
|
||||
/* Define to 1 if you have the `memmove' function. */
|
||||
#undef HAVE_MEMMOVE
|
||||
|
||||
@ -78,6 +102,10 @@
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if you have the `strcoll' function and it is properly defined.
|
||||
*/
|
||||
#undef HAVE_STRCOLL
|
||||
|
||||
/* Define to 1 if you have the `strerror' function. */
|
||||
#undef HAVE_STRERROR
|
||||
|
||||
@ -143,6 +171,12 @@
|
||||
/* Define to 1 if you have the `wcwidth' function. */
|
||||
#undef HAVE_WCWIDTH
|
||||
|
||||
/* Define as const if the declaration of iconv() needs const. */
|
||||
#undef ICONV_CONST
|
||||
|
||||
/* Support NLS. */
|
||||
#undef NLS
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
@ -158,12 +192,6 @@
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* Define to 1 if the C compiler supports function prototypes. */
|
||||
#undef PROTOTYPES
|
||||
|
||||
/* Define as the return type of signal handlers (`int' or `void'). */
|
||||
#undef RETSIGTYPE
|
||||
|
||||
/* Define to 1 if the `setpgrp' function takes no argument. */
|
||||
#undef SETPGRP_VOID
|
||||
|
||||
@ -176,9 +204,6 @@
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define like PROTOTYPES; this can be used by system headers. */
|
||||
#undef __PROTOTYPES
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
#undef const
|
||||
|
||||
@ -194,6 +219,9 @@
|
||||
/* Define to `int' if neither <sys/types.h> nor <sys/socket.h> define. */
|
||||
#undef socklen_t
|
||||
|
||||
/* Define to `int' not defined in <sys/types.h>. */
|
||||
#undef ssize_t
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef uid_t
|
||||
|
||||
|
@ -20,11 +20,6 @@
|
||||
*/
|
||||
#define POSIXJOBS
|
||||
|
||||
/*
|
||||
* POSIXSIGS Use the POSIX signal facilities to emulate BSD signals.
|
||||
*/
|
||||
#undef POSIXSIGS
|
||||
|
||||
/*
|
||||
* VFORK This machine has a vfork().
|
||||
* It used to be that for job control to work, this define
|
||||
@ -46,17 +41,10 @@
|
||||
*/
|
||||
#define BSDJOBS
|
||||
|
||||
/*
|
||||
* BSDSIGS You have 4.2-style signals, rather than USG style.
|
||||
* Note: POSIX systems should not define this unless they
|
||||
* have sigvec() and friends (ie: 4.3BSD-RENO, HP-UX).
|
||||
*/
|
||||
#define BSDSIGS
|
||||
|
||||
/*
|
||||
* BSDTIMES You have BSD-style process time stuff (like rusage)
|
||||
* This may or may not be true. For example, Apple Unix
|
||||
* (OREO) has BSDJOBS and BSDSIGS but not BSDTIMES.
|
||||
* (OREO) has BSDJOBS but not BSDTIMES.
|
||||
*/
|
||||
#define BSDTIMES
|
||||
|
||||
@ -108,7 +96,6 @@
|
||||
# define _PATH_TCSHELL "/usr/contrib/bin/tcsh"
|
||||
# endif
|
||||
|
||||
# undef NLS
|
||||
# undef NLS_CATALOGS
|
||||
|
||||
#elif defined(__APPLE__)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Header: /src/pub/tcsh/config_f.h,v 3.32 2005/03/04 13:46:04 christos Exp $ */
|
||||
/* $Header: /p/tcsh/cvsroot/tcsh/config_f.h,v 3.40 2006/08/28 14:53:04 mitr Exp $ */
|
||||
/*
|
||||
* config_f.h -- configure various defines for tcsh
|
||||
*
|
||||
@ -50,18 +50,10 @@
|
||||
* WIDE_STRINGS Represent strings using wide characters
|
||||
* Allows proper function in multibyte encodings like UTF-8
|
||||
*/
|
||||
#if defined (SHORT_STRINGS) && SIZEOF_WCHAR_T >= 4 && !defined (WINNT_NATIVE) && !defined(_OSD_POSIX)
|
||||
#if defined (SHORT_STRINGS) && defined (NLS) && SIZEOF_WCHAR_T >= 4 && defined (HAVE_MBRTOWC) && !defined (WINNT_NATIVE) && !defined(_OSD_POSIX)
|
||||
# define WIDE_STRINGS
|
||||
#endif
|
||||
|
||||
/*
|
||||
* NLS: Use Native Language System
|
||||
* Routines like setlocale() are needed
|
||||
* if you don't have <locale.h>, you don't want
|
||||
* to define this.
|
||||
*/
|
||||
#define NLS
|
||||
|
||||
/*
|
||||
* NLS_CATALOGS:Use Native Language System catalogs for
|
||||
* international messages.
|
||||
@ -69,7 +61,9 @@
|
||||
* if you don't have <nl_types.h>, you don't want
|
||||
* to define this.
|
||||
*/
|
||||
#undef NLS_CATALOGS
|
||||
#if defined (NLS) && defined (HAVE_CATGETS)
|
||||
# define NLS_CATALOGS
|
||||
#endif
|
||||
|
||||
/*
|
||||
* LOGINFIRST Source ~/.login before ~/.cshrc
|
||||
@ -149,7 +143,7 @@
|
||||
* This can be much slower and no memory statistics will be
|
||||
* provided.
|
||||
*/
|
||||
#if defined(__MACHTEN__) || defined(PURIFY) || defined(MALLOC_TRACE) || defined(_OSD_POSIX) || defined(__MVS__)
|
||||
#if defined(__MACHTEN__) || defined(PURIFY) || defined(MALLOC_TRACE) || defined(_OSD_POSIX) || defined(__MVS__) || defined (__linux__)
|
||||
# define SYSMALLOC
|
||||
#else
|
||||
# undef SYSMALLOC
|
||||
|
1831
contrib/tcsh/configure
vendored
1831
contrib/tcsh/configure
vendored
File diff suppressed because it is too large
Load Diff
@ -9,9 +9,10 @@ dnl Written by Kaveh Ghazi (ghazi@caip.rutgers.edu) 5/11/96.
|
||||
dnl
|
||||
|
||||
AC_PREREQ([2.59])dnl Minimum Autoconf version required.
|
||||
AC_INIT
|
||||
AC_INIT([tcsh], [6.15.00], [http://bugs.gw.com/])
|
||||
AC_CONFIG_SRCDIR([tc.vers.c])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
AC_CONFIG_TESTDIR([.], [.])
|
||||
|
||||
AC_CANONICAL_HOST
|
||||
|
||||
@ -120,6 +121,11 @@ case "${host}" in
|
||||
tcsh_config_file=bsd4.4
|
||||
;;
|
||||
|
||||
## DragonFly systems
|
||||
*-*-dragonfly*)
|
||||
tcsh_config_file=bsd4.4
|
||||
;;
|
||||
|
||||
## Silicon Graphics machines
|
||||
*-sgi-iri* )
|
||||
tcsh_config_file=irix
|
||||
@ -150,16 +156,16 @@ case "${host}" in
|
||||
*-sun-sunos4.1.[3456]* )
|
||||
tcsh_config_file=sunos413
|
||||
;;
|
||||
*-*-solaris2.[01]* ) # Should handle sparc or x86
|
||||
*-*-solaris2.[01] ) # Should handle sparc or x86
|
||||
tcsh_config_file=sol2
|
||||
;;
|
||||
*-sun-solaris2.2* ) # Sparc only release
|
||||
*-sun-solaris2.2 ) # Sparc only release
|
||||
tcsh_config_file=sol22
|
||||
;;
|
||||
*-sun-solaris2.3* ) # Sparc only release
|
||||
*-sun-solaris2.3 ) # Sparc only release
|
||||
tcsh_config_file=sol23
|
||||
;;
|
||||
*-*-solaris2.[45]* ) # Should handle sparc, x86 and powerpc
|
||||
*-*-solaris2.[45] ) # Should handle sparc, x86 and powerpc
|
||||
tcsh_config_file=sol24
|
||||
;;
|
||||
*-*-solaris2.* ) # Should handle sparc, x86 and powerpc
|
||||
@ -260,12 +266,10 @@ AC_SEARCH_LIBS(getspnam, sec)
|
||||
AC_SEARCH_LIBS(tgetent, termlib termcap curses ncurses)
|
||||
AC_SEARCH_LIBS(gethostbyname, nsl)
|
||||
AC_SEARCH_LIBS(connect, socket)
|
||||
AC_SEARCH_LIBS([iconv], [iconv], [AC_DEFINE([HAVE_ICONV], [1],
|
||||
[Define to 1 if you have the iconv () interface])])
|
||||
AM_ICONV
|
||||
|
||||
dnl Checks for header files
|
||||
AC_CHECK_HEADERS([auth.h inttypes.h shadow.h stdint.h])
|
||||
AC_CHECK_HEADERS([utmpx.h utmp.h])
|
||||
AC_CHECK_HEADERS([auth.h crypt.h inttypes.h shadow.h stdint.h utmp.h utmpx.h])
|
||||
AC_CHECK_HEADERS([wchar.h],
|
||||
[AC_CHECK_SIZEOF([wchar_t], [], [dnl
|
||||
#include <stdio.h>
|
||||
@ -279,10 +283,18 @@ dnl Checks for types
|
||||
AC_CHECK_TYPES([long long])
|
||||
AC_TYPE_GETGROUPS
|
||||
AC_TYPE_MODE_T
|
||||
AC_TYPE_SIGNAL
|
||||
AC_TYPE_SIZE_T
|
||||
AC_TYPE_UID_T
|
||||
|
||||
AC_DEFUN([AC_TYPE_SSIZE_T], [
|
||||
AC_CHECK_TYPE(ssize_t,,
|
||||
AC_DEFINE(ssize_t, int, [Define to `int' not defined in <sys/types.h>.]),
|
||||
[
|
||||
#include <sys/types.h>
|
||||
])
|
||||
])
|
||||
AC_TYPE_SSIZE_T
|
||||
|
||||
AC_DEFUN([AC_TYPE_SOCKLEN_T], [
|
||||
AC_CHECK_TYPE(socklen_t,,
|
||||
AC_DEFINE(socklen_t, int, [Define to `int' if neither <sys/types.h> nor <sys/socket.h> define.]),
|
||||
@ -308,7 +320,8 @@ AC_CHECK_MEMBERS([struct dirent.d_ino], , ,
|
||||
#endif])
|
||||
AC_CHECK_MEMBERS([struct utmp.ut_host, struct utmp.ut_user, struct utmp.ut_tv,
|
||||
struct utmp.ut_xtime], , ,
|
||||
[#ifdef HAVE_UTMPX_H
|
||||
[#include <sys/types.h>
|
||||
#ifdef HAVE_UTMPX_H
|
||||
#include <utmpx.h>
|
||||
#define utmp utmpx
|
||||
#elif defined HAVE_UTMP_H
|
||||
@ -320,16 +333,24 @@ AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family], , ,
|
||||
|
||||
dnl Checks for compiler characteristics
|
||||
AC_C_CONST
|
||||
AC_C_PROTOTYPES
|
||||
AC_C_VOLATILE
|
||||
|
||||
dnl checks for library functions
|
||||
AC_CHECK_DECLS([gethostname])
|
||||
AC_CHECK_FUNCS([dup2 getcwd gethostname getpwent getutent memmove memset] dnl
|
||||
[nice nl_langinfo sbrk setpgid setpriority strerror strstr sysconf] dnl
|
||||
[wcwidth])
|
||||
AC_CHECK_DECLS([crypt, environ, gethostname, getpgrp], , ,
|
||||
[#include "config_p.h"
|
||||
AC_INCLUDES_DEFAULT([])
|
||||
#ifdef HAVE_CRYPT_H
|
||||
#include <crypt.h>
|
||||
#endif
|
||||
])
|
||||
AC_CHECK_FUNC([setlocale], [have_setlocale=yes], [have_setlocale=no])
|
||||
AC_CHECK_FUNCS([catgets dup2 getauthid getcwd gethostname getpwent] dnl
|
||||
[getutent memmove memset nice nl_langinfo sbrk setpgid setpriority] dnl
|
||||
[strerror strstr sysconf wcwidth])
|
||||
AC_FUNC_GETPGRP
|
||||
AC_FUNC_MBRTOWC
|
||||
AC_FUNC_SETPGRP
|
||||
AC_FUNC_STRCOLL
|
||||
|
||||
dnl This is not good enough; we need sockaddr_storage too.
|
||||
dnl See whether we can use IPv6 related functions
|
||||
@ -379,6 +400,15 @@ dnl IPv6_CHECK_FUNC(getnameinfo, DFLAGS="$DFLAGS -DINET6")
|
||||
|
||||
AC_SUBST(DFLAGS)
|
||||
|
||||
dnl Checks for system services
|
||||
if test "$have_setlocale" != no; then
|
||||
AC_ARG_ENABLE([nls], AS_HELP_STRING([--disable-nls], [Disable NLS support]),
|
||||
[], [enable_nls=yes])
|
||||
if test "x$enable_nls" != xno; then
|
||||
AC_DEFINE([NLS], [1], [Support NLS.])
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_ARG_WITH(hesiod,
|
||||
[ --with-hesiod=PREFIX Use Hesiod lookup for ~ expansion],
|
||||
[hesiod="$withval"], [hesiod=no])
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
/* $Header: /src/pub/tcsh/ed.decls.h,v 3.39 2005/01/18 20:24:50 christos Exp $ */
|
||||
/* $Header: /p/tcsh/cvsroot/tcsh/ed.decls.h,v 3.44 2006/08/23 15:03:13 christos Exp $ */
|
||||
/*
|
||||
* ed.decls.h: Editor external definitions
|
||||
*/
|
||||
@ -36,240 +36,245 @@
|
||||
/*
|
||||
* ed.chared.c
|
||||
*/
|
||||
extern int InsertStr __P((Char *));
|
||||
extern void DeleteBack __P((int));
|
||||
extern void SetKillRing __P((int));
|
||||
extern int InsertStr (Char *);
|
||||
extern void DeleteBack (int);
|
||||
extern void SetKillRing (int);
|
||||
extern CCRETVAL GetHistLine (void);
|
||||
|
||||
/*
|
||||
* ed.init.c
|
||||
*/
|
||||
#ifdef SIG_WINDOW
|
||||
extern void check_window_size __P((int));
|
||||
extern RETSIGTYPE window_change __P((int));
|
||||
extern void check_window_size (int);
|
||||
extern void window_change (int);
|
||||
#endif /* SIG_WINDOW */
|
||||
extern int ed_Setup __P((int));
|
||||
extern void ed_Init __P((void));
|
||||
extern int Cookedmode __P((void));
|
||||
extern int Rawmode __P((void));
|
||||
extern void ed_set_tty_eight_bit __P((void));
|
||||
extern int ed_Setup (int);
|
||||
extern void ed_Init (void);
|
||||
extern int Cookedmode (void);
|
||||
extern int Rawmode (void);
|
||||
extern void ed_set_tty_eight_bit (void);
|
||||
|
||||
extern void QuoteModeOn __P((void));
|
||||
extern void QuoteModeOff __P((void));
|
||||
extern void ResetInLine __P((int));
|
||||
extern int Load_input_line __P((void));
|
||||
extern void QuoteModeOn (void);
|
||||
extern void QuoteModeOff (void);
|
||||
extern void ResetInLine (int);
|
||||
extern int Load_input_line (void);
|
||||
|
||||
/*
|
||||
* ed.term.c:
|
||||
*/
|
||||
extern void dosetty __P((Char **, struct command *));
|
||||
extern int tty_getty __P((int, ttydata_t *));
|
||||
extern int tty_setty __P((int, ttydata_t *));
|
||||
extern void tty_getchar __P((ttydata_t *, unsigned char *));
|
||||
extern void tty_setchar __P((ttydata_t *, unsigned char *));
|
||||
extern speed_t tty_getspeed __P((ttydata_t *));
|
||||
extern int tty_gettabs __P((ttydata_t *));
|
||||
extern int tty_geteightbit __P((ttydata_t *));
|
||||
extern int tty_cooked_mode __P((ttydata_t *));
|
||||
extern void dosetty (Char **, struct command *);
|
||||
extern int tty_getty (int, ttydata_t *);
|
||||
extern int tty_setty (int, ttydata_t *);
|
||||
extern void tty_getchar (ttydata_t *, unsigned char *);
|
||||
extern void tty_setchar (ttydata_t *, unsigned char *);
|
||||
extern speed_t tty_getspeed (ttydata_t *);
|
||||
extern int tty_gettabs (ttydata_t *);
|
||||
extern int tty_geteightbit (ttydata_t *);
|
||||
extern int tty_cooked_mode (ttydata_t *);
|
||||
#ifdef _IBMR2
|
||||
extern void tty_setdisc __P((int, int));
|
||||
extern void tty_setdisc (int, int);
|
||||
#endif /* _IBMR2 */
|
||||
|
||||
/*
|
||||
* ed.screen.c
|
||||
*/
|
||||
extern void terminit __P((void));
|
||||
extern void SetAttributes __P((Char));
|
||||
extern void so_write __P((Char *, int));
|
||||
extern void ClearScreen __P((void));
|
||||
extern void MoveToLine __P((int));
|
||||
extern void MoveToChar __P((int));
|
||||
extern void ClearEOL __P((int));
|
||||
extern void Insert_write __P((Char *, int));
|
||||
extern void DeleteChars __P((int));
|
||||
extern void TellTC __P((void));
|
||||
extern void SetTC __P((char *, char *));
|
||||
extern void EchoTC __P((Char **));
|
||||
extern int SetArrowKeys __P((CStr *, XmapVal *, int));
|
||||
extern int IsArrowKey __P((Char *));
|
||||
extern void ResetArrowKeys __P((void));
|
||||
extern void DefaultArrowKeys __P((void));
|
||||
extern int ClearArrowKeys __P((CStr *));
|
||||
extern void PrintArrowKeys __P((CStr *));
|
||||
extern void BindArrowKeys __P((void));
|
||||
extern void SoundBeep __P((void));
|
||||
extern int CanWeTab __P((void));
|
||||
extern void ChangeSize __P((int, int));
|
||||
extern void terminit (void);
|
||||
extern void SetAttributes (Char);
|
||||
extern void so_write (Char *, int);
|
||||
extern void ClearScreen (void);
|
||||
extern void MoveToLine (int);
|
||||
extern void MoveToChar (int);
|
||||
extern void ClearEOL (int);
|
||||
extern void Insert_write (Char *, int);
|
||||
extern void DeleteChars (int);
|
||||
extern void TellTC (void);
|
||||
extern void SetTC (char *, char *);
|
||||
extern void EchoTC (Char **);
|
||||
extern int SetArrowKeys (const CStr *, XmapVal *, int);
|
||||
extern int IsArrowKey (Char *);
|
||||
extern void ResetArrowKeys (void);
|
||||
extern void DefaultArrowKeys (void);
|
||||
extern int ClearArrowKeys (const CStr *);
|
||||
extern void PrintArrowKeys (const CStr *);
|
||||
extern void BindArrowKeys (void);
|
||||
extern void SoundBeep (void);
|
||||
extern int CanWeTab (void);
|
||||
extern void ChangeSize (int, int);
|
||||
#ifdef SIG_WINDOW
|
||||
extern int GetSize __P((int *, int *));
|
||||
extern int GetSize (int *, int *);
|
||||
#endif /* SIG_WINDOW */
|
||||
extern void ClearToBottom __P((void));
|
||||
extern void GetTermCaps __P((void));
|
||||
extern void ClearToBottom (void);
|
||||
extern void GetTermCaps (void);
|
||||
extern void StartHighlight (void);
|
||||
extern void StopHighlight (void);
|
||||
|
||||
/*
|
||||
* ed.defns.c
|
||||
*/
|
||||
extern void editinit __P((void));
|
||||
extern void ed_InitNLSMaps __P((void));
|
||||
extern void editinit (void);
|
||||
extern void ed_InitNLSMaps (void);
|
||||
#ifdef DEBUG_EDIT
|
||||
extern void CheckMaps __P((void));
|
||||
extern void CheckMaps (void);
|
||||
#endif
|
||||
extern void ed_InitMaps __P((void));
|
||||
extern void ed_InitEmacsMaps __P((void));
|
||||
extern void ed_InitVIMaps __P((void));
|
||||
extern void ed_InitMaps (void);
|
||||
extern void ed_InitEmacsMaps (void);
|
||||
extern void ed_InitVIMaps (void);
|
||||
|
||||
extern CCRETVAL e_unassigned __P((Char));
|
||||
extern CCRETVAL e_insert __P((Char));
|
||||
extern CCRETVAL e_newline __P((Char));
|
||||
extern CCRETVAL e_delprev __P((Char));
|
||||
extern CCRETVAL e_delnext __P((Char));
|
||||
extern CCRETVAL e_unassigned (Char);
|
||||
extern CCRETVAL e_insert (Char);
|
||||
extern CCRETVAL e_newline (Char);
|
||||
extern CCRETVAL e_delprev (Char);
|
||||
extern CCRETVAL e_delnext (Char);
|
||||
/* added by mtk@ari.ncl.omron.co.jp (920818) */
|
||||
extern CCRETVAL e_delnext_eof __P((Char));
|
||||
extern CCRETVAL e_delnext_list __P((Char));
|
||||
extern CCRETVAL e_delnext_list_eof __P((Char)); /* for ^D */
|
||||
extern CCRETVAL e_toend __P((Char));
|
||||
extern CCRETVAL e_tobeg __P((Char));
|
||||
extern CCRETVAL e_charback __P((Char));
|
||||
extern CCRETVAL e_charfwd __P((Char));
|
||||
extern CCRETVAL e_quote __P((Char));
|
||||
extern CCRETVAL e_startover __P((Char));
|
||||
extern CCRETVAL e_redisp __P((Char));
|
||||
extern CCRETVAL e_wordback __P((Char));
|
||||
extern CCRETVAL e_wordfwd __P((Char));
|
||||
extern CCRETVAL v_wordbegnext __P((Char));
|
||||
extern CCRETVAL e_uppercase __P((Char));
|
||||
extern CCRETVAL e_lowercase __P((Char));
|
||||
extern CCRETVAL e_capitolcase __P((Char));
|
||||
extern CCRETVAL e_cleardisp __P((Char));
|
||||
extern CCRETVAL e_complete __P((Char));
|
||||
extern CCRETVAL e_correct __P((Char));
|
||||
extern CCRETVAL e_correctl __P((Char));
|
||||
extern CCRETVAL e_up_hist __P((Char));
|
||||
extern CCRETVAL e_down_hist __P((Char));
|
||||
extern CCRETVAL e_up_search_hist __P((Char));
|
||||
extern CCRETVAL e_down_search_hist __P((Char));
|
||||
extern CCRETVAL e_helpme __P((Char));
|
||||
extern CCRETVAL e_list_choices __P((Char));
|
||||
extern CCRETVAL e_delwordprev __P((Char));
|
||||
extern CCRETVAL e_delwordnext __P((Char));
|
||||
extern CCRETVAL e_digit __P((Char));
|
||||
extern CCRETVAL e_argdigit __P((Char));
|
||||
extern CCRETVAL v_zero __P((Char));
|
||||
extern CCRETVAL e_killend __P((Char));
|
||||
extern CCRETVAL e_killbeg __P((Char));
|
||||
extern CCRETVAL e_metanext __P((Char));
|
||||
extern CCRETVAL e_delnext_eof (Char);
|
||||
extern CCRETVAL e_delnext_list (Char);
|
||||
extern CCRETVAL e_delnext_list_eof (Char); /* for ^D */
|
||||
extern CCRETVAL e_toend (Char);
|
||||
extern CCRETVAL e_tobeg (Char);
|
||||
extern CCRETVAL e_charback (Char);
|
||||
extern CCRETVAL e_charfwd (Char);
|
||||
extern CCRETVAL e_quote (Char);
|
||||
extern CCRETVAL e_startover (Char);
|
||||
extern CCRETVAL e_redisp (Char);
|
||||
extern CCRETVAL e_wordback (Char);
|
||||
extern CCRETVAL e_wordfwd (Char);
|
||||
extern CCRETVAL v_wordbegnext (Char);
|
||||
extern CCRETVAL e_uppercase (Char);
|
||||
extern CCRETVAL e_lowercase (Char);
|
||||
extern CCRETVAL e_capitolcase (Char);
|
||||
extern CCRETVAL e_cleardisp (Char);
|
||||
extern CCRETVAL e_complete (Char);
|
||||
extern CCRETVAL e_correct (Char);
|
||||
extern CCRETVAL e_correctl (Char);
|
||||
extern CCRETVAL e_up_hist (Char);
|
||||
extern CCRETVAL e_down_hist (Char);
|
||||
extern CCRETVAL e_up_search_hist (Char);
|
||||
extern CCRETVAL e_down_search_hist (Char);
|
||||
extern CCRETVAL e_helpme (Char);
|
||||
extern CCRETVAL e_list_choices (Char);
|
||||
extern CCRETVAL e_delwordprev (Char);
|
||||
extern CCRETVAL e_delwordnext (Char);
|
||||
extern CCRETVAL e_digit (Char);
|
||||
extern CCRETVAL e_argdigit (Char);
|
||||
extern CCRETVAL v_zero (Char);
|
||||
extern CCRETVAL e_killend (Char);
|
||||
extern CCRETVAL e_killbeg (Char);
|
||||
extern CCRETVAL e_metanext (Char);
|
||||
#ifdef notdef
|
||||
extern CCRETVAL e_extendnext __P((Char));
|
||||
extern CCRETVAL e_extendnext (Char);
|
||||
#endif
|
||||
extern CCRETVAL e_send_eof __P((Char));
|
||||
extern CCRETVAL e_charswitch __P((Char));
|
||||
extern CCRETVAL e_gcharswitch __P((Char));
|
||||
extern CCRETVAL e_which __P((Char));
|
||||
extern CCRETVAL e_yank_kill __P((Char));
|
||||
extern CCRETVAL e_tty_dsusp __P((Char));
|
||||
extern CCRETVAL e_tty_flusho __P((Char));
|
||||
extern CCRETVAL e_tty_quit __P((Char));
|
||||
extern CCRETVAL e_tty_tsusp __P((Char));
|
||||
extern CCRETVAL e_tty_stopo __P((Char));
|
||||
extern CCRETVAL e_tty_starto __P((Char));
|
||||
extern CCRETVAL e_argfour __P((Char));
|
||||
extern CCRETVAL e_set_mark __P((Char));
|
||||
extern CCRETVAL e_exchange_mark __P((Char));
|
||||
extern CCRETVAL e_last_item __P((Char));
|
||||
extern CCRETVAL v_cmd_mode __P((Char));
|
||||
extern CCRETVAL v_insert __P((Char));
|
||||
extern CCRETVAL v_replmode __P((Char));
|
||||
extern CCRETVAL v_replone __P((Char));
|
||||
extern CCRETVAL v_substline __P((Char));
|
||||
extern CCRETVAL v_substchar __P((Char));
|
||||
extern CCRETVAL v_add __P((Char));
|
||||
extern CCRETVAL v_addend __P((Char));
|
||||
extern CCRETVAL v_insbeg __P((Char));
|
||||
extern CCRETVAL v_chgtoend __P((Char));
|
||||
extern CCRETVAL e_killregion __P((Char));
|
||||
extern CCRETVAL e_killall __P((Char));
|
||||
extern CCRETVAL e_copyregion __P((Char));
|
||||
extern CCRETVAL e_tty_int __P((Char));
|
||||
extern CCRETVAL e_run_fg_editor __P((Char));
|
||||
extern CCRETVAL e_list_eof __P((Char));
|
||||
extern CCRETVAL e_expand_history __P((Char));
|
||||
extern CCRETVAL e_magic_space __P((Char));
|
||||
extern CCRETVAL e_list_glob __P((Char));
|
||||
extern CCRETVAL e_expand_glob __P((Char));
|
||||
extern CCRETVAL e_insovr __P((Char));
|
||||
extern CCRETVAL v_cm_complete __P((Char));
|
||||
extern CCRETVAL e_copyprev __P((Char));
|
||||
extern CCRETVAL v_change_case __P((Char));
|
||||
extern CCRETVAL e_expand __P((Char));
|
||||
extern CCRETVAL e_expand_vars __P((Char));
|
||||
extern CCRETVAL e_toggle_hist __P((Char));
|
||||
extern CCRETVAL e_load_average __P((Char));
|
||||
extern CCRETVAL v_delprev __P((Char));
|
||||
extern CCRETVAL v_delmeta __P((Char));
|
||||
extern CCRETVAL v_wordfwd __P((Char));
|
||||
extern CCRETVAL v_wordback __P((Char));
|
||||
extern CCRETVAL v_endword __P((Char));
|
||||
extern CCRETVAL v_eword __P((Char));
|
||||
extern CCRETVAL v_undo __P((Char));
|
||||
extern CCRETVAL v_ush_meta __P((Char));
|
||||
extern CCRETVAL v_dsh_meta __P((Char));
|
||||
extern CCRETVAL v_rsrch_fwd __P((Char));
|
||||
extern CCRETVAL v_rsrch_back __P((Char));
|
||||
extern CCRETVAL v_char_fwd __P((Char));
|
||||
extern CCRETVAL v_char_back __P((Char));
|
||||
extern CCRETVAL v_chgmeta __P((Char));
|
||||
extern CCRETVAL e_inc_fwd __P((Char));
|
||||
extern CCRETVAL e_inc_back __P((Char));
|
||||
extern CCRETVAL v_rchar_fwd __P((Char));
|
||||
extern CCRETVAL v_rchar_back __P((Char));
|
||||
extern CCRETVAL v_charto_fwd __P((Char));
|
||||
extern CCRETVAL v_charto_back __P((Char));
|
||||
extern CCRETVAL e_normalize_path __P((Char));
|
||||
extern CCRETVAL e_normalize_command __P((Char));
|
||||
extern CCRETVAL e_stuff_char __P((Char));
|
||||
extern CCRETVAL e_list_all __P((Char));
|
||||
extern CCRETVAL e_complete_all __P((Char));
|
||||
extern CCRETVAL e_complete_fwd __P((Char));
|
||||
extern CCRETVAL e_complete_back __P((Char));
|
||||
extern CCRETVAL e_dabbrev_expand __P((Char));
|
||||
extern CCRETVAL e_copy_to_clipboard __P((Char));
|
||||
extern CCRETVAL e_paste_from_clipboard __P((Char));
|
||||
extern CCRETVAL e_dosify_next __P((Char));
|
||||
extern CCRETVAL e_dosify_prev __P((Char));
|
||||
extern CCRETVAL e_page_up __P((Char));
|
||||
extern CCRETVAL e_page_down __P((Char));
|
||||
extern CCRETVAL e_yank_pop __P((Char));
|
||||
extern CCRETVAL e_send_eof (Char);
|
||||
extern CCRETVAL e_charswitch (Char);
|
||||
extern CCRETVAL e_gcharswitch (Char);
|
||||
extern CCRETVAL e_which (Char);
|
||||
extern CCRETVAL e_yank_kill (Char);
|
||||
extern CCRETVAL e_tty_dsusp (Char);
|
||||
extern CCRETVAL e_tty_flusho (Char);
|
||||
extern CCRETVAL e_tty_quit (Char);
|
||||
extern CCRETVAL e_tty_tsusp (Char);
|
||||
extern CCRETVAL e_tty_stopo (Char);
|
||||
extern CCRETVAL e_tty_starto (Char);
|
||||
extern CCRETVAL e_argfour (Char);
|
||||
extern CCRETVAL e_set_mark (Char);
|
||||
extern CCRETVAL e_exchange_mark (Char);
|
||||
extern CCRETVAL e_last_item (Char);
|
||||
extern CCRETVAL v_cmd_mode (Char);
|
||||
extern CCRETVAL v_insert (Char);
|
||||
extern CCRETVAL v_replmode (Char);
|
||||
extern CCRETVAL v_replone (Char);
|
||||
extern CCRETVAL v_substline (Char);
|
||||
extern CCRETVAL v_substchar (Char);
|
||||
extern CCRETVAL v_add (Char);
|
||||
extern CCRETVAL v_addend (Char);
|
||||
extern CCRETVAL v_insbeg (Char);
|
||||
extern CCRETVAL v_chgtoend (Char);
|
||||
extern CCRETVAL e_killregion (Char);
|
||||
extern CCRETVAL e_killall (Char);
|
||||
extern CCRETVAL e_copyregion (Char);
|
||||
extern CCRETVAL e_tty_int (Char);
|
||||
extern CCRETVAL e_run_fg_editor (Char);
|
||||
extern CCRETVAL e_list_eof (Char);
|
||||
extern CCRETVAL e_expand_history (Char);
|
||||
extern CCRETVAL e_magic_space (Char);
|
||||
extern CCRETVAL e_list_glob (Char);
|
||||
extern CCRETVAL e_expand_glob (Char);
|
||||
extern CCRETVAL e_insovr (Char);
|
||||
extern CCRETVAL v_cm_complete (Char);
|
||||
extern CCRETVAL e_copyprev (Char);
|
||||
extern CCRETVAL v_change_case (Char);
|
||||
extern CCRETVAL e_expand (Char);
|
||||
extern CCRETVAL e_expand_vars (Char);
|
||||
extern CCRETVAL e_toggle_hist (Char);
|
||||
extern CCRETVAL e_load_average (Char);
|
||||
extern CCRETVAL v_delprev (Char);
|
||||
extern CCRETVAL v_delmeta (Char);
|
||||
extern CCRETVAL v_wordfwd (Char);
|
||||
extern CCRETVAL v_wordback (Char);
|
||||
extern CCRETVAL v_endword (Char);
|
||||
extern CCRETVAL v_eword (Char);
|
||||
extern CCRETVAL v_undo (Char);
|
||||
extern CCRETVAL v_ush_meta (Char);
|
||||
extern CCRETVAL v_dsh_meta (Char);
|
||||
extern CCRETVAL v_rsrch_fwd (Char);
|
||||
extern CCRETVAL v_rsrch_back (Char);
|
||||
extern CCRETVAL v_char_fwd (Char);
|
||||
extern CCRETVAL v_char_back (Char);
|
||||
extern CCRETVAL v_chgmeta (Char);
|
||||
extern CCRETVAL e_inc_fwd (Char);
|
||||
extern CCRETVAL e_inc_back (Char);
|
||||
extern CCRETVAL v_rchar_fwd (Char);
|
||||
extern CCRETVAL v_rchar_back (Char);
|
||||
extern CCRETVAL v_charto_fwd (Char);
|
||||
extern CCRETVAL v_charto_back (Char);
|
||||
extern CCRETVAL e_normalize_path (Char);
|
||||
extern CCRETVAL e_normalize_command (Char);
|
||||
extern CCRETVAL e_stuff_char (Char);
|
||||
extern CCRETVAL e_list_all (Char);
|
||||
extern CCRETVAL e_complete_all (Char);
|
||||
extern CCRETVAL e_complete_fwd (Char);
|
||||
extern CCRETVAL e_complete_back (Char);
|
||||
extern CCRETVAL e_dabbrev_expand (Char);
|
||||
extern CCRETVAL e_copy_to_clipboard (Char);
|
||||
extern CCRETVAL e_paste_from_clipboard (Char);
|
||||
extern CCRETVAL e_dosify_next (Char);
|
||||
extern CCRETVAL e_dosify_prev (Char);
|
||||
extern CCRETVAL e_page_up (Char);
|
||||
extern CCRETVAL e_page_down (Char);
|
||||
extern CCRETVAL e_yank_pop (Char);
|
||||
extern CCRETVAL e_newline_hold (Char);
|
||||
extern CCRETVAL e_newline_down_hist (Char);
|
||||
|
||||
/*
|
||||
* ed.inputl.c
|
||||
*/
|
||||
extern int Inputl __P((void));
|
||||
extern int GetNextChar __P((Char *));
|
||||
extern void UngetNextChar __P((Char));
|
||||
extern void PushMacro __P((Char *));
|
||||
extern int Inputl (void);
|
||||
extern int GetNextChar (Char *);
|
||||
extern void UngetNextChar (Char);
|
||||
extern void PushMacro (Char *);
|
||||
|
||||
/*
|
||||
* ed.refresh.c
|
||||
*/
|
||||
extern void ClearLines __P((void));
|
||||
extern void ClearDisp __P((void));
|
||||
extern void Refresh __P((void));
|
||||
extern void RefCursor __P((void));
|
||||
extern void RefPlusOne __P((int));
|
||||
extern void PastBottom __P((void));
|
||||
extern void ClearLines (void);
|
||||
extern void ClearDisp (void);
|
||||
extern void Refresh (void);
|
||||
extern void RefCursor (void);
|
||||
extern void RefPlusOne (int);
|
||||
extern void PastBottom (void);
|
||||
|
||||
/*
|
||||
* ed.xmap.c
|
||||
*/
|
||||
extern XmapVal *XmapStr __P((CStr *));
|
||||
extern XmapVal *XmapCmd __P((int));
|
||||
extern void AddXkey __P((CStr *, XmapVal *, int));
|
||||
extern void ClearXkey __P((KEYCMD *, CStr *));
|
||||
extern int GetXkey __P((CStr *, XmapVal *));
|
||||
extern void ResetXmap __P((void));
|
||||
extern int DeleteXkey __P((CStr *));
|
||||
extern void PrintXkey __P((CStr *));
|
||||
extern int printOne __P((CStr *, XmapVal *, int));
|
||||
extern eChar parseescape __P((const Char **));
|
||||
extern unsigned char *unparsestring __P((CStr *, unsigned char *, Char *));
|
||||
extern XmapVal *XmapStr (CStr *);
|
||||
extern XmapVal *XmapCmd (int);
|
||||
extern void AddXkey (const CStr *, XmapVal *, int);
|
||||
extern void ClearXkey (KEYCMD *, const CStr *);
|
||||
extern int GetXkey (CStr *, XmapVal *);
|
||||
extern void ResetXmap (void);
|
||||
extern int DeleteXkey (const CStr *);
|
||||
extern void PrintXkey (const CStr *);
|
||||
extern void printOne (const Char *, const XmapVal *, int);
|
||||
extern eChar parseescape (const Char **);
|
||||
extern unsigned char *unparsestring (const CStr *, const Char *);
|
||||
|
||||
#endif /* _h_ed_decls */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Header: /src/pub/tcsh/ed.defns.c,v 3.42 2005/03/03 16:49:15 kim Exp $ */
|
||||
/* $Header: /p/tcsh/cvsroot/tcsh/ed.defns.c,v 3.46 2006/03/02 18:46:44 christos Exp $ */
|
||||
/*
|
||||
* ed.defns.c: Editor function definitions and initialization
|
||||
*/
|
||||
@ -32,11 +32,11 @@
|
||||
*/
|
||||
#include "sh.h"
|
||||
|
||||
RCSID("$Id: ed.defns.c,v 3.42 2005/03/03 16:49:15 kim Exp $")
|
||||
RCSID("$tcsh: ed.defns.c,v 3.46 2006/03/02 18:46:44 christos Exp $")
|
||||
|
||||
#include "ed.h"
|
||||
|
||||
static void ed_InitMetaBindings __P((void));
|
||||
static void ed_InitMetaBindings (void);
|
||||
|
||||
PFCmd CcFuncTbl[] = { /* table of available commands */
|
||||
e_unassigned,
|
||||
@ -279,8 +279,12 @@ PFCmd CcFuncTbl[] = { /* table of available commands */
|
||||
#define F_PAGE_DOWN 118
|
||||
e_yank_pop,
|
||||
#define F_YANK_POP 119
|
||||
e_newline_hold,
|
||||
#define F_NEWLINE_HOLD 120
|
||||
e_newline_down_hist,
|
||||
#define F_NEWLINE_DOWN_HIST 121
|
||||
0 /* DUMMY VALUE */
|
||||
#define F_NUM_FNS 120
|
||||
#define F_NUM_FNS 122
|
||||
|
||||
};
|
||||
|
||||
@ -493,7 +497,7 @@ KEYCMD CcEmacsMap[] = {
|
||||
F_UNASSIGNED, /* M-> */
|
||||
F_WHICH, /* M-? */
|
||||
F_UNASSIGNED, /* M-@ */
|
||||
F_UNASSIGNED, /* M-A */
|
||||
F_NEWLINE_HOLD, /* M-A */
|
||||
F_WORDBACK, /* M-B */
|
||||
F_CASECAPITAL, /* M-C */
|
||||
F_DELWORDNEXT, /* M-D */
|
||||
@ -525,7 +529,7 @@ KEYCMD CcEmacsMap[] = {
|
||||
F_UNASSIGNED, /* M-^ */
|
||||
F_LAST_ITEM, /* M-_ */
|
||||
F_UNASSIGNED, /* M-` */
|
||||
F_UNASSIGNED, /* M-a */
|
||||
F_NEWLINE_HOLD, /* M-a */
|
||||
F_WORDBACK, /* M-b */
|
||||
F_CASECAPITAL, /* M-c */
|
||||
F_DELWORDNEXT, /* M-d */
|
||||
@ -1120,7 +1124,7 @@ KEYCMD CcViCmdMap[] = {
|
||||
|
||||
|
||||
void
|
||||
editinit()
|
||||
editinit(void)
|
||||
{
|
||||
struct KeyFuncs *f;
|
||||
|
||||
@ -1128,7 +1132,7 @@ editinit()
|
||||
int i;
|
||||
|
||||
for (i = 0; i < F_NUM_FUNCNAMES; i++)
|
||||
xfree((ptr_t) FuncNames[i].desc);
|
||||
xfree((ptr_t)(intptr_t)FuncNames[i].desc);
|
||||
#endif
|
||||
|
||||
f = FuncNames;
|
||||
@ -1407,6 +1411,16 @@ editinit()
|
||||
f->func = F_NEWLINE;
|
||||
f->desc = CSAVS(3, 52, "Execute command");
|
||||
|
||||
f++;
|
||||
f->name = "newline-and-hold";
|
||||
f->func = F_NEWLINE_HOLD;
|
||||
f->desc = CSAVS(3, 122, "Execute command and keep current line");
|
||||
|
||||
f++;
|
||||
f->name = "newline-and-down-history";
|
||||
f->func = F_NEWLINE_DOWN_HIST;
|
||||
f->desc = CSAVS(3, 123, "Execute command and move to next history line");
|
||||
|
||||
f++;
|
||||
f->name = "normalize-path";
|
||||
f->func = F_PATH_NORM;
|
||||
@ -1785,7 +1799,7 @@ editinit()
|
||||
|
||||
#ifdef DEBUG_EDIT
|
||||
void
|
||||
CheckMaps()
|
||||
CheckMaps(void)
|
||||
{ /* check the size of the key maps */
|
||||
int c1 = (NT_NUM_KEYS * sizeof(KEYCMD));
|
||||
|
||||
@ -1817,7 +1831,7 @@ int NLSMapsAreInited = 0;
|
||||
int NoNLSRebind;
|
||||
|
||||
void
|
||||
ed_InitNLSMaps()
|
||||
ed_InitNLSMaps(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -1834,7 +1848,7 @@ ed_InitNLSMaps()
|
||||
}
|
||||
|
||||
static void
|
||||
ed_InitMetaBindings()
|
||||
ed_InitMetaBindings(void)
|
||||
{
|
||||
Char buf[3];
|
||||
int i;
|
||||
@ -1870,7 +1884,7 @@ ed_InitMetaBindings()
|
||||
}
|
||||
|
||||
void
|
||||
ed_InitVIMaps()
|
||||
ed_InitVIMaps(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -1887,7 +1901,7 @@ ed_InitVIMaps()
|
||||
}
|
||||
|
||||
void
|
||||
ed_InitEmacsMaps()
|
||||
ed_InitEmacsMaps(void)
|
||||
{
|
||||
int i;
|
||||
Char buf[3];
|
||||
@ -1930,7 +1944,7 @@ ed_InitEmacsMaps()
|
||||
}
|
||||
|
||||
void
|
||||
ed_InitMaps()
|
||||
ed_InitMaps(void)
|
||||
{
|
||||
if (MapsAreInited)
|
||||
return;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Header: /src/pub/tcsh/ed.h,v 3.44 2005/03/05 03:20:15 christos Exp $ */
|
||||
/* $Header: /p/tcsh/cvsroot/tcsh/ed.h,v 3.49 2006/08/23 15:03:13 christos Exp $ */
|
||||
/*
|
||||
* ed.h: Editor declarations and globals
|
||||
*/
|
||||
@ -37,7 +37,6 @@
|
||||
# define EXTERN extern
|
||||
#endif
|
||||
|
||||
#define TABSIZE 8 /* usually 8 spaces/tab */
|
||||
#define MAXMACROLEVELS 10 /* max number of nested kbd macros */
|
||||
|
||||
#ifndef WINNT_NATIVE
|
||||
@ -54,7 +53,7 @@
|
||||
#define KEYCMD unsigned char /* size needed to index into CcFuncTbl */
|
||||
/* Must be unsigned */
|
||||
|
||||
typedef CCRETVAL(*PFCmd) __P((Char)); /* pointer to function returning CCRETVAL */
|
||||
typedef CCRETVAL(*PFCmd) (Char); /* pointer to function returning CCRETVAL */
|
||||
|
||||
struct KeyFuncs { /* for the "bind" shell command */
|
||||
const char *name; /* function name for bind command */
|
||||
@ -100,7 +99,7 @@ typedef struct {
|
||||
int len;
|
||||
} CStr;
|
||||
|
||||
typedef union Xmapval { /* value passed to the Xkey routines */
|
||||
typedef union { /* value passed to the Xkey routines */
|
||||
KEYCMD cmd;
|
||||
CStr str;
|
||||
} XmapVal;
|
||||
@ -118,13 +117,14 @@ EXTERN KEYCMD *CurrentKeyMap; /* current command key map */
|
||||
EXTERN int inputmode; /* insert, replace, replace1 mode */
|
||||
EXTERN Char GettingInput; /* true if getting an input line (mostly) */
|
||||
EXTERN Char NeedsRedraw; /* for editor and twenex error messages */
|
||||
EXTERN Char InputBuf[INBUFSIZE]; /* the real input data */
|
||||
EXTERN Char InputBuf[INBUFSIZE]; /* the real input data *//*FIXBUF*/
|
||||
EXTERN Char *LastChar, *Cursor; /* point to the next open space */
|
||||
EXTERN Char *InputLim; /* limit of size of InputBuf */
|
||||
EXTERN Char MetaNext; /* flags for ^V and ^[ functions */
|
||||
EXTERN Char AltKeyMap; /* Using alternative command map (for vi mode) */
|
||||
EXTERN Char VImode; /* true if running in vi mode (PWP 6-27-88) */
|
||||
EXTERN Char *Mark; /* the emacs "mark" (dot is Cursor) */
|
||||
EXTERN char MarkIsSet; /* true if the mark has been set explicitly */
|
||||
EXTERN Char DoingArg; /* true if we have an argument */
|
||||
EXTERN int Argument; /* "universal" argument value */
|
||||
EXTERN KEYCMD LastCmd; /* previous command executed */
|
||||
@ -134,18 +134,20 @@ EXTERN int KillRingLen; /* current length of kill ring */
|
||||
EXTERN int KillPos; /* points to next kill */
|
||||
EXTERN int YankPos; /* points to next yank */
|
||||
|
||||
EXTERN Char UndoBuf[INBUFSIZE];
|
||||
EXTERN Char UndoBuf[INBUFSIZE];/*FIXBUF*/
|
||||
EXTERN Char *UndoPtr;
|
||||
EXTERN int UndoSize;
|
||||
EXTERN int UndoAction;
|
||||
|
||||
EXTERN Char HistBuf[INBUFSIZE]; /* history buffer */
|
||||
EXTERN Char *LastHist; /* points to end of history buffer */
|
||||
EXTERN struct Strbuf HistBuf; /* = Strbuf_INIT; history buffer */
|
||||
EXTERN int Hist_num; /* what point up the history we are at now. */
|
||||
EXTERN Char WhichBuf[INBUFSIZE]; /* buffer for which command */
|
||||
EXTERN Char *LastWhich; /* points to end of which buffer */
|
||||
EXTERN Char *CursWhich; /* points to the cursor point in which buf */
|
||||
EXTERN int HistWhich; /* Hist_num is saved in this */
|
||||
/* buffer for which command and others */
|
||||
EXTERN struct Strbuf SavedBuf; /* = Strbuf_INIT; */
|
||||
EXTERN size_t LastSaved; /* points to end of saved buffer */
|
||||
EXTERN size_t CursSaved; /* points to the cursor point in saved buf */
|
||||
EXTERN int HistSaved; /* Hist_num is saved in this */
|
||||
EXTERN char RestoreSaved; /* true if SavedBuf should be restored */
|
||||
EXTERN int IncMatchLen; /* current match length during incremental search */
|
||||
EXTERN char Expand; /* true if we are expanding a line */
|
||||
extern Char HistLit; /* true if history lines are shown literal */
|
||||
EXTERN Char CurrentHistLit; /* Literal status of current show history line */
|
||||
@ -176,14 +178,14 @@ EXTERN Char **Vdisplay; /* new buffer */
|
||||
EXTERN int T_Lines, T_Cols; /* Rows and Cols of the terminal */
|
||||
EXTERN Char T_CanIns; /* true if I can insert characters */
|
||||
EXTERN Char T_CanDel; /* dito for delete characters */
|
||||
EXTERN Char T_Tabs; /* true if tty interface is passing tabs */
|
||||
EXTERN Char T_Margin;
|
||||
EXTERN char T_Tabs; /* true if tty interface is passing tabs */
|
||||
EXTERN char T_Margin;
|
||||
#define MARGIN_AUTO 1 /* term has auto margins */
|
||||
#define MARGIN_MAGIC 2 /* concept glitch */
|
||||
EXTERN speed_t T_Speed; /* Tty input Baud rate */
|
||||
EXTERN Char T_CanCEOL; /* true if we can clear to end of line */
|
||||
EXTERN Char T_CanUP; /* true if this term can do reverse linefeen */
|
||||
EXTERN Char T_HasMeta; /* true if we have a meta key */
|
||||
EXTERN char T_HasMeta; /* true if we have a meta key */
|
||||
|
||||
/* note the extra characters in the Strchr() call in this macro */
|
||||
#define isword(c) (Isalpha(c)||Isdigit(c)||Strchr(word_chars,c))
|
||||
@ -227,22 +229,22 @@ extern ttyperm_t ttylist;
|
||||
/*
|
||||
* We don't prototype these, cause some systems have them wrong!
|
||||
*/
|
||||
extern int tgetent __P(());
|
||||
extern char *tgetstr __P(());
|
||||
extern int tgetflag __P(());
|
||||
extern int tgetnum __P(());
|
||||
extern char *tgoto __P(());
|
||||
extern int tgetent ();
|
||||
extern char *tgetstr ();
|
||||
extern int tgetflag ();
|
||||
extern int tgetnum ();
|
||||
extern char *tgoto ();
|
||||
# define PUTPURE putpure
|
||||
# define PUTRAW putraw
|
||||
#else
|
||||
extern int tgetent __P((char *, const char *));
|
||||
extern char *tgetstr __P((const char *, char **));
|
||||
extern int tgetflag __P((const char *));
|
||||
extern int tgetnum __P((const char *));
|
||||
extern char *tgoto __P((const char *, int, int));
|
||||
extern void tputs __P((const char *, int, void (*)(int)));
|
||||
# define PUTPURE ((void (*)__P((int))) putpure)
|
||||
# define PUTRAW ((void (*)__P((int))) putraw)
|
||||
extern int tgetent (char *, const char *);
|
||||
extern char *tgetstr (const char *, char **);
|
||||
extern int tgetflag (const char *);
|
||||
extern int tgetnum (const char *);
|
||||
extern char *tgoto (const char *, int, int);
|
||||
extern void tputs (const char *, int, void (*)(int));
|
||||
# define PUTPURE ((void (*)(int)) putpure)
|
||||
# define PUTRAW ((void (*)(int)) putraw)
|
||||
#endif
|
||||
|
||||
#endif /* _h_ed */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Header: /src/pub/tcsh/ed.init.c,v 3.52 2005/01/18 20:24:50 christos Exp $ */
|
||||
/* $Header: /p/tcsh/cvsroot/tcsh/ed.init.c,v 3.60 2006/08/24 20:56:31 christos Exp $ */
|
||||
/*
|
||||
* ed.init.c: Editor initializations
|
||||
*/
|
||||
@ -32,7 +32,7 @@
|
||||
*/
|
||||
#include "sh.h"
|
||||
|
||||
RCSID("$Id: ed.init.c,v 3.52 2005/01/18 20:24:50 christos Exp $")
|
||||
RCSID("$tcsh: ed.init.c,v 3.60 2006/08/24 20:56:31 christos Exp $")
|
||||
|
||||
#include "ed.h"
|
||||
#include "tc.h"
|
||||
@ -90,20 +90,13 @@ static unsigned char ttychars[NN_IO][C_NCC] = {
|
||||
|
||||
#ifdef SIG_WINDOW
|
||||
void
|
||||
check_window_size(force)
|
||||
int force;
|
||||
check_window_size(int force)
|
||||
{
|
||||
#ifdef BSDSIGS
|
||||
sigmask_t omask;
|
||||
#endif /* BSDSIGS */
|
||||
int lins, cols;
|
||||
|
||||
/* don't want to confuse things here */
|
||||
#ifdef BSDSIGS
|
||||
omask = sigblock(sigmask(SIG_WINDOW)) & ~sigmask(SIG_WINDOW);
|
||||
#else /* BSDSIGS */
|
||||
(void) sighold(SIG_WINDOW);
|
||||
#endif /* BSDSIGS */
|
||||
pintr_disabled++;
|
||||
cleanup_push(&pintr_disabled, disabled_cleanup);
|
||||
/*
|
||||
* From: bret@shark.agps.lanl.gov (Bret Thaeler) Avoid sunview bug, where a
|
||||
* partially hidden window gets a SIG_WINDOW every time the text is
|
||||
@ -121,32 +114,22 @@ check_window_size(force)
|
||||
else
|
||||
ChangeSize(lins, cols);
|
||||
}
|
||||
#ifdef BSDSIGS
|
||||
(void) sigsetmask(omask); /* can change it again */
|
||||
#else /* BSDSIGS */
|
||||
(void) sigrelse(SIG_WINDOW);
|
||||
#endif /* BSDSIGS */
|
||||
windowchg = 0;
|
||||
cleanup_until(&pintr_disabled); /* can change it again */
|
||||
}
|
||||
|
||||
RETSIGTYPE
|
||||
void
|
||||
/*ARGSUSED*/
|
||||
window_change(snum)
|
||||
int snum;
|
||||
window_change(int snum)
|
||||
{
|
||||
USE(snum);
|
||||
#ifdef UNRELSIGS
|
||||
/* If we were called as a signal handler, restore it. */
|
||||
if (snum > 0)
|
||||
sigset(snum, window_change);
|
||||
#endif /* UNRELSIGS */
|
||||
windowchg = 1;
|
||||
}
|
||||
|
||||
#endif /* SIG_WINDOW */
|
||||
|
||||
void
|
||||
ed_set_tty_eight_bit()
|
||||
ed_set_tty_eight_bit(void)
|
||||
{
|
||||
if (tty_getty(SHTTY, &extty) == -1) {
|
||||
#ifdef DEBUG_TTY
|
||||
@ -159,8 +142,7 @@ ed_set_tty_eight_bit()
|
||||
|
||||
|
||||
int
|
||||
ed_Setup(rst)
|
||||
int rst;
|
||||
ed_Setup(int rst)
|
||||
{
|
||||
static int havesetup = 0;
|
||||
struct varent *imode;
|
||||
@ -279,8 +261,14 @@ ed_Setup(rst)
|
||||
tty_setchar(&extty, ttychars[EX_IO]);
|
||||
|
||||
# ifdef SIG_WINDOW
|
||||
(void) sigset(SIG_WINDOW, window_change); /* for window systems */
|
||||
# endif
|
||||
{
|
||||
sigset_t set;
|
||||
(void)signal(SIG_WINDOW, window_change); /* for window systems */
|
||||
sigemptyset(&set);
|
||||
sigaddset(&set, SIG_WINDOW);
|
||||
(void)sigprocmask(SIG_UNBLOCK, &set, NULL);
|
||||
}
|
||||
# endif
|
||||
#else /* WINNT_NATIVE */
|
||||
# ifdef DEBUG
|
||||
if (rst)
|
||||
@ -292,7 +280,7 @@ ed_Setup(rst)
|
||||
}
|
||||
|
||||
void
|
||||
ed_Init()
|
||||
ed_Init(void)
|
||||
{
|
||||
ResetInLine(1); /* reset the input pointers */
|
||||
GettingInput = 0; /* just in case */
|
||||
@ -308,8 +296,7 @@ ed_Init()
|
||||
{ /* no kill ring - why? */
|
||||
int i;
|
||||
for (i = 0; i < KillRingMax; i++) {
|
||||
if (KillRing[i].buf != NULL)
|
||||
xfree((ptr_t) KillRing[i].buf);
|
||||
xfree(KillRing[i].buf);
|
||||
KillRing[i].buf = NULL;
|
||||
KillRing[i].len = 0;
|
||||
}
|
||||
@ -376,7 +363,7 @@ ed_Init()
|
||||
* Check and re-init the line. set the terminal into 1 char at a time mode.
|
||||
*/
|
||||
int
|
||||
Rawmode()
|
||||
Rawmode(void)
|
||||
{
|
||||
if (Tty_raw_mode)
|
||||
return (0);
|
||||
@ -561,12 +548,13 @@ Rawmode()
|
||||
}
|
||||
|
||||
int
|
||||
Cookedmode()
|
||||
Cookedmode(void)
|
||||
{ /* set tty in normal setup */
|
||||
#ifdef WINNT_NATIVE
|
||||
do_nt_cooked_mode();
|
||||
#else
|
||||
signalfun_t orig_intr;
|
||||
sigset_t set, oset;
|
||||
int res;
|
||||
|
||||
# ifdef _IBMR2
|
||||
tty_setdisc(SHTTY, EX_IO);
|
||||
@ -576,45 +564,18 @@ Cookedmode()
|
||||
return (0);
|
||||
|
||||
/* hold this for reseting tty */
|
||||
# ifdef BSDSIGS
|
||||
orig_intr = (signalfun_t) signal(SIGINT, SIG_IGN);
|
||||
# else
|
||||
# ifdef SIG_HOLD
|
||||
/*
|
||||
* sigset doesn't return the previous handler if the signal is held,
|
||||
* it will return SIG_HOLD instead. So instead of restoring the
|
||||
* the signal we would end up installing a blocked SIGINT with a
|
||||
* SIG_IGN signal handler. This is what happened when Cookedmode
|
||||
* was called from sched_run, disabling interrupt for the rest
|
||||
* of your session.
|
||||
*
|
||||
* This is what we do:
|
||||
* - if the signal is blocked, keep it that way
|
||||
* - else set it to SIG_IGN
|
||||
*
|
||||
* Casper Dik (casper@fwi.uva.nl)
|
||||
*/
|
||||
orig_intr = (signalfun_t) sigset(SIGINT, SIG_HOLD);
|
||||
if (orig_intr != SIG_HOLD)
|
||||
(void) sigset(SIGINT, SIG_IGN); /* returns SIG_HOLD */
|
||||
# else /* !SIG_HOLD */
|
||||
/*
|
||||
* No SIG_HOLD; probably no reliable signals as well.
|
||||
*/
|
||||
orig_intr = (signalfun_t) sigset(SIGINT, SIG_IGN);
|
||||
# endif /* SIG_HOLD */
|
||||
# endif /* BSDSIGS */
|
||||
if (tty_setty(SHTTY, &extty) == -1) {
|
||||
sigemptyset(&set);
|
||||
sigaddset(&set, SIGINT);
|
||||
(void)sigprocmask(SIG_BLOCK, &set, &oset);
|
||||
cleanup_push(&oset, sigprocmask_cleanup);
|
||||
res = tty_setty(SHTTY, &extty);
|
||||
cleanup_until(&oset);
|
||||
if (res == -1) {
|
||||
# ifdef DEBUG_TTY
|
||||
xprintf("Cookedmode: tty_setty: %s\n", strerror(errno));
|
||||
# endif /* DEBUG_TTY */
|
||||
return -1;
|
||||
}
|
||||
# ifdef BSDSIGS
|
||||
(void) signal(SIGINT, orig_intr); /* take these again */
|
||||
# else
|
||||
(void) sigset(SIGINT, orig_intr); /* take these again */
|
||||
# endif /* BSDSIGS */
|
||||
#endif /* WINNT_NATIVE */
|
||||
|
||||
Tty_raw_mode = 0;
|
||||
@ -622,13 +583,13 @@ Cookedmode()
|
||||
}
|
||||
|
||||
void
|
||||
ResetInLine(macro)
|
||||
int macro;
|
||||
ResetInLine(int macro)
|
||||
{
|
||||
Cursor = InputBuf; /* reset cursor */
|
||||
LastChar = InputBuf;
|
||||
InputLim = &InputBuf[INBUFSIZE - 2];
|
||||
InputLim = &InputBuf[INBUFSIZE - 2];/*FIXBUF*/
|
||||
Mark = InputBuf;
|
||||
MarkIsSet = 0;
|
||||
MetaNext = 0;
|
||||
CurrentKeyMap = CcKeyMap;
|
||||
AltKeyMap = 0;
|
||||
@ -636,14 +597,15 @@ ResetInLine(macro)
|
||||
DoingArg = 0;
|
||||
Argument = 1;
|
||||
LastCmd = F_UNASSIGNED; /* previous command executed */
|
||||
IncMatchLen = 0;
|
||||
if (macro)
|
||||
MacroLvl = -1; /* no currently active macros */
|
||||
}
|
||||
|
||||
static Char *Input_Line = NULL;
|
||||
int
|
||||
Load_input_line()
|
||||
Load_input_line(void)
|
||||
{
|
||||
static Char *Input_Line = NULL;
|
||||
#ifdef SUNOS4
|
||||
long chrs = 0;
|
||||
#else /* !SUNOS4 */
|
||||
@ -655,7 +617,7 @@ Load_input_line()
|
||||
#endif /* SUNOS4 */
|
||||
|
||||
if (Input_Line)
|
||||
xfree((ptr_t) Input_Line);
|
||||
xfree(Input_Line);
|
||||
Input_Line = NULL;
|
||||
|
||||
if (Tty_raw_mode)
|
||||
@ -664,9 +626,9 @@ Load_input_line()
|
||||
#if defined(FIONREAD) && !defined(OREO)
|
||||
(void) ioctl(SHIN, FIONREAD, (ioctl_t) &chrs);
|
||||
if (chrs > 0) {
|
||||
char buf[BUFSIZE];
|
||||
char buf[BUFSIZE];
|
||||
|
||||
chrs = read(SHIN, buf, (size_t) min(chrs, BUFSIZE - 1));
|
||||
chrs = xread(SHIN, buf, min(chrs, BUFSIZE - 1));
|
||||
if (chrs > 0) {
|
||||
buf[chrs] = '\0';
|
||||
Input_Line = Strsave(str2short(buf));
|
||||
@ -692,7 +654,7 @@ Load_input_line()
|
||||
* (via Hans J Albertsson (thanks))
|
||||
*/
|
||||
void
|
||||
QuoteModeOn()
|
||||
QuoteModeOn(void)
|
||||
{
|
||||
if (MacroLvl >= 0)
|
||||
return;
|
||||
@ -731,7 +693,7 @@ QuoteModeOn()
|
||||
}
|
||||
|
||||
void
|
||||
QuoteModeOff()
|
||||
QuoteModeOff(void)
|
||||
{
|
||||
if (!Tty_quote_mode)
|
||||
return;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Header: /src/pub/tcsh/ed.inputl.c,v 3.57 2004/12/25 21:15:06 christos Exp $ */
|
||||
/* $Header: /p/tcsh/cvsroot/tcsh/ed.inputl.c,v 3.66 2006/11/29 22:32:24 christos Exp $ */
|
||||
/*
|
||||
* ed.inputl.c: Input line handling.
|
||||
*/
|
||||
@ -32,13 +32,13 @@
|
||||
*/
|
||||
#include "sh.h"
|
||||
|
||||
RCSID("$Id: ed.inputl.c,v 3.57 2004/12/25 21:15:06 christos Exp $")
|
||||
RCSID("$tcsh: ed.inputl.c,v 3.66 2006/11/29 22:32:24 christos Exp $")
|
||||
|
||||
#include "ed.h"
|
||||
#include "ed.defns.h" /* for the function names */
|
||||
#include "tw.h" /* for twenex stuff */
|
||||
|
||||
#define OKCMD (INBUFSIZE+INBUFSIZE)
|
||||
#define OKCMD INT_MAX
|
||||
|
||||
/* ed.inputl -- routines to get a single line from the input. */
|
||||
|
||||
@ -48,18 +48,18 @@ extern int MapsAreInited;
|
||||
static Char mismatch[] =
|
||||
{'!', '^' , '\\', '-', '%', '\0', '"', '\'', '`', '\0' };
|
||||
|
||||
static int Repair __P((void));
|
||||
static int GetNextCommand __P((KEYCMD *, Char *));
|
||||
static int SpellLine __P((int));
|
||||
static int CompleteLine __P((void));
|
||||
static void RunCommand __P((Char *));
|
||||
static void doeval1 __P((Char **));
|
||||
static int Repair (void);
|
||||
static int GetNextCommand (KEYCMD *, Char *);
|
||||
static int SpellLine (int);
|
||||
static int CompleteLine (void);
|
||||
static void RunCommand (Char *);
|
||||
static void doeval1 (Char **);
|
||||
|
||||
static int rotate = 0;
|
||||
|
||||
|
||||
static int
|
||||
Repair()
|
||||
Repair(void)
|
||||
{
|
||||
if (NeedsRedraw) {
|
||||
ClearLines();
|
||||
@ -75,7 +75,7 @@ Repair()
|
||||
|
||||
/* CCRETVAL */
|
||||
int
|
||||
Inputl()
|
||||
Inputl(void)
|
||||
{
|
||||
CCRETVAL retval;
|
||||
KEYCMD cmdnum = 0;
|
||||
@ -88,7 +88,6 @@ Inputl()
|
||||
struct varent *matchbeep = adrof(STRmatchbeep);
|
||||
struct varent *imode = adrof(STRinputmode);
|
||||
Char *SaveChar, *CorrChar;
|
||||
Char Origin[INBUFSIZE], Change[INBUFSIZE];
|
||||
int matchval; /* from tenematch() */
|
||||
COMMAND fn;
|
||||
int curlen = 0;
|
||||
@ -132,13 +131,20 @@ Inputl()
|
||||
|
||||
GettingInput = 1;
|
||||
NeedsRedraw = 0;
|
||||
tellwhat = 0;
|
||||
|
||||
if (tellwhat) {
|
||||
copyn(InputBuf, WhichBuf, INBUFSIZE);
|
||||
LastChar = InputBuf + (LastWhich - WhichBuf);
|
||||
Cursor = InputBuf + (CursWhich - WhichBuf);
|
||||
tellwhat = 0;
|
||||
Hist_num = HistWhich;
|
||||
if (RestoreSaved) {
|
||||
copyn(InputBuf, SavedBuf.s, INBUFSIZE);/*FIXBUF*/
|
||||
LastChar = InputBuf + LastSaved;
|
||||
Cursor = InputBuf + CursSaved;
|
||||
Hist_num = HistSaved;
|
||||
HistSaved = 0;
|
||||
RestoreSaved = 0;
|
||||
}
|
||||
if (HistSaved) {
|
||||
Hist_num = HistSaved;
|
||||
GetHistLine();
|
||||
HistSaved = 0;
|
||||
}
|
||||
if (Expand) {
|
||||
(void) e_up_hist(0);
|
||||
@ -156,7 +162,7 @@ Inputl()
|
||||
xprintf("Cursor > InputLim\r\n");
|
||||
if (LastChar > InputLim)
|
||||
xprintf("LastChar > InputLim\r\n");
|
||||
if (InputLim != &InputBuf[INBUFSIZE - 2])
|
||||
if (InputLim != &InputBuf[INBUFSIZE - 2])/*FIXBUF*/
|
||||
xprintf("InputLim != &InputBuf[INBUFSIZE-2]\r\n");
|
||||
if ((!DoingArg) && (Argument != 1))
|
||||
xprintf("(!DoingArg) && (Argument != 1)\r\n");
|
||||
@ -209,12 +215,7 @@ Inputl()
|
||||
|
||||
case CC_WHICH: /* tell what this command does */
|
||||
tellwhat = 1;
|
||||
copyn(WhichBuf, InputBuf, INBUFSIZE);
|
||||
LastWhich = WhichBuf + (LastChar - InputBuf);
|
||||
CursWhich = WhichBuf + (Cursor - InputBuf);
|
||||
*LastChar++ = '\n'; /* for the benifit of CSH */
|
||||
HistWhich = Hist_num;
|
||||
Hist_num = 0; /* for the history commands */
|
||||
num = (int) (LastChar - InputBuf); /* number characters read */
|
||||
break;
|
||||
|
||||
@ -224,36 +225,45 @@ Inputl()
|
||||
matchval = 1;
|
||||
if (crct && crct->vec != NULL && (!Strcmp(*(crct->vec), STRcmd) ||
|
||||
!Strcmp(*(crct->vec), STRall))) {
|
||||
Char *Origin;
|
||||
|
||||
PastBottom();
|
||||
copyn(Origin, InputBuf, INBUFSIZE);
|
||||
Origin = Strsave(InputBuf);
|
||||
cleanup_push(Origin, xfree);
|
||||
SaveChar = LastChar;
|
||||
if (SpellLine(!Strcmp(*(crct->vec), STRcmd)) == 1) {
|
||||
Char *Change;
|
||||
|
||||
PastBottom();
|
||||
copyn(Change, InputBuf, INBUFSIZE);
|
||||
Change = Strsave(InputBuf);
|
||||
cleanup_push(Change, xfree);
|
||||
*Strchr(Change, '\n') = '\0';
|
||||
CorrChar = LastChar; /* Save the corrected end */
|
||||
LastChar = InputBuf; /* Null the current line */
|
||||
SoundBeep();
|
||||
printprompt(2, short2str(Change));
|
||||
cleanup_until(Change);
|
||||
Refresh();
|
||||
if (read(SHIN, (char *) &tch, 1) < 0)
|
||||
if (xread(SHIN, &tch, 1) < 0) {
|
||||
#ifdef convex
|
||||
/*
|
||||
* need to print error message in case file
|
||||
* is migrated
|
||||
*/
|
||||
if (errno && errno != EINTR)
|
||||
if (errno)
|
||||
stderror(ERR_SYSTEM, progname, strerror(errno));
|
||||
#else
|
||||
cleanup_until(Origin);
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
ch = tch;
|
||||
if (ch == 'y' || ch == ' ') {
|
||||
LastChar = CorrChar; /* Restore the corrected end */
|
||||
xprintf(CGETS(6, 2, "yes\n"));
|
||||
}
|
||||
else {
|
||||
copyn(InputBuf, Origin, INBUFSIZE);
|
||||
Strcpy(InputBuf, Origin);
|
||||
LastChar = SaveChar;
|
||||
if (ch == 'e') {
|
||||
xprintf(CGETS(6, 3, "edit\n"));
|
||||
@ -263,6 +273,7 @@ Inputl()
|
||||
ClearLines();
|
||||
ClearDisp();
|
||||
Refresh();
|
||||
cleanup_until(Origin);
|
||||
break;
|
||||
}
|
||||
else if (ch == 'a') {
|
||||
@ -271,12 +282,14 @@ Inputl()
|
||||
Cursor = LastChar;
|
||||
printprompt(0, NULL);
|
||||
Refresh();
|
||||
cleanup_until(Origin);
|
||||
break;
|
||||
}
|
||||
xprintf(CGETS(6, 5, "no\n"));
|
||||
}
|
||||
flush();
|
||||
}
|
||||
cleanup_until(Origin);
|
||||
} else if (crct && crct->vec != NULL &&
|
||||
!Strcmp(*(crct->vec), STRcomplete)) {
|
||||
if (LastChar > InputBuf && LastChar[-1] == '\n') {
|
||||
@ -427,6 +440,14 @@ Inputl()
|
||||
if (autol && autol->vec != NULL &&
|
||||
(Strcmp(*(autol->vec), STRambiguous) != 0 ||
|
||||
expnum == Cursor - InputBuf)) {
|
||||
if (adrof(STRhighlight) && MarkIsSet) {
|
||||
/* clear highlighting before showing completions */
|
||||
MarkIsSet = 0;
|
||||
ClearLines();
|
||||
ClearDisp();
|
||||
Refresh();
|
||||
MarkIsSet = 1;
|
||||
}
|
||||
PastBottom();
|
||||
fn = (retval == CC_COMPLETE_ALL) ? LIST_ALL : LIST;
|
||||
(void) tenematch(InputBuf, Cursor-InputBuf, fn);
|
||||
@ -526,6 +547,11 @@ Inputl()
|
||||
|
||||
case CC_ERROR:
|
||||
default: /* functions we don't know about */
|
||||
if (adrof(STRhighlight)) {
|
||||
ClearLines();
|
||||
ClearDisp();
|
||||
Refresh();
|
||||
}
|
||||
DoingArg = 0;
|
||||
Argument = 1;
|
||||
SoundBeep();
|
||||
@ -542,8 +568,7 @@ Inputl()
|
||||
}
|
||||
|
||||
void
|
||||
PushMacro(str)
|
||||
Char *str;
|
||||
PushMacro(Char *str)
|
||||
{
|
||||
if (str != NULL && MacroLvl + 1 < MAXMACROLEVELS) {
|
||||
MacroLvl++;
|
||||
@ -555,72 +580,60 @@ PushMacro(str)
|
||||
}
|
||||
}
|
||||
|
||||
struct eval1_state
|
||||
{
|
||||
Char **evalvec, *evalp;
|
||||
};
|
||||
|
||||
static void
|
||||
eval1_cleanup(void *xstate)
|
||||
{
|
||||
struct eval1_state *state;
|
||||
|
||||
state = xstate;
|
||||
evalvec = state->evalvec;
|
||||
evalp = state->evalp;
|
||||
doneinp = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Like eval, only using the current file descriptors
|
||||
*/
|
||||
static Char **gv = NULL, **gav = NULL;
|
||||
|
||||
static void
|
||||
doeval1(v)
|
||||
Char **v;
|
||||
doeval1(Char **v)
|
||||
{
|
||||
Char **oevalvec;
|
||||
Char *oevalp;
|
||||
int my_reenter;
|
||||
Char **savegv;
|
||||
jmp_buf_t osetexit;
|
||||
struct eval1_state state;
|
||||
Char **gv;
|
||||
int gflag;
|
||||
|
||||
oevalvec = evalvec;
|
||||
oevalp = evalp;
|
||||
savegv = gv;
|
||||
gav = v;
|
||||
|
||||
|
||||
gflag = 0, tglob(gav);
|
||||
gflag = tglob(v);
|
||||
if (gflag) {
|
||||
gv = gav = globall(gav);
|
||||
gargv = 0;
|
||||
if (gav == 0)
|
||||
gv = v = globall(v, gflag);
|
||||
if (v == 0)
|
||||
stderror(ERR_NOMATCH);
|
||||
gav = copyblk(gav);
|
||||
v = copyblk(v);
|
||||
}
|
||||
else {
|
||||
gv = NULL;
|
||||
gav = copyblk(gav);
|
||||
trim(gav);
|
||||
v = copyblk(v);
|
||||
trim(v);
|
||||
}
|
||||
|
||||
getexit(osetexit);
|
||||
|
||||
/* PWP: setjmp/longjmp bugfix for optimizing compilers */
|
||||
#ifdef cray
|
||||
my_reenter = 1; /* assume non-zero return val */
|
||||
if (setexit() == 0) {
|
||||
my_reenter = 0; /* Oh well, we were wrong */
|
||||
#else /* !cray */
|
||||
if ((my_reenter = setexit()) == 0) {
|
||||
#endif /* cray */
|
||||
evalvec = gav;
|
||||
evalp = 0;
|
||||
process(0);
|
||||
}
|
||||
|
||||
evalvec = oevalvec;
|
||||
evalp = oevalp;
|
||||
doneinp = 0;
|
||||
|
||||
if (gv)
|
||||
blkfree(gv);
|
||||
cleanup_push(gv, blk_cleanup);
|
||||
|
||||
gv = savegv;
|
||||
resexit(osetexit);
|
||||
if (my_reenter)
|
||||
stderror(ERR_SILENT);
|
||||
state.evalvec = evalvec;
|
||||
state.evalp = evalp;
|
||||
evalvec = v;
|
||||
evalp = 0;
|
||||
cleanup_push(&state, eval1_cleanup);
|
||||
process(0);
|
||||
cleanup_until(&state);
|
||||
if (gv)
|
||||
cleanup_until(gv);
|
||||
}
|
||||
|
||||
static void
|
||||
RunCommand(str)
|
||||
Char *str;
|
||||
RunCommand(Char *str)
|
||||
{
|
||||
Char *cmd[2];
|
||||
|
||||
@ -633,7 +646,7 @@ RunCommand(str)
|
||||
GettingInput = 0;
|
||||
|
||||
doeval1(cmd);
|
||||
|
||||
|
||||
(void) Rawmode();
|
||||
GettingInput = 1;
|
||||
|
||||
@ -644,9 +657,7 @@ RunCommand(str)
|
||||
}
|
||||
|
||||
static int
|
||||
GetNextCommand(cmdnum, ch)
|
||||
KEYCMD *cmdnum;
|
||||
Char *ch;
|
||||
GetNextCommand(KEYCMD *cmdnum, Char *ch)
|
||||
{
|
||||
KEYCMD cmd = 0;
|
||||
int num;
|
||||
@ -688,7 +699,7 @@ GetNextCommand(cmdnum, ch)
|
||||
XmapVal val;
|
||||
CStr cstr;
|
||||
cstr.buf = ch;
|
||||
cstr.len = Strlen(ch);
|
||||
cstr.len = 1;
|
||||
switch (GetXkey(&cstr, &val)) {
|
||||
case XK_CMD:
|
||||
cmd = val.cmd;
|
||||
@ -722,8 +733,7 @@ UngetNextChar(Char cp)
|
||||
}
|
||||
|
||||
int
|
||||
GetNextChar(cp)
|
||||
Char *cp;
|
||||
GetNextChar(Char *cp)
|
||||
{
|
||||
int num_read;
|
||||
int tried = 0;
|
||||
@ -763,16 +773,13 @@ GetNextChar(cp)
|
||||
#endif /* SIG_WINDOW */
|
||||
cbp = 0;
|
||||
for (;;) {
|
||||
while ((num_read = read(SHIN, cbuf + cbp, 1)) == -1) {
|
||||
if (errno == EINTR)
|
||||
continue;
|
||||
while ((num_read = xread(SHIN, cbuf + cbp, 1)) == -1) {
|
||||
if (!tried && fixio(SHIN, errno) != -1)
|
||||
tried = 1;
|
||||
else {
|
||||
# ifdef convex
|
||||
/* need to print error message in case the file is migrated */
|
||||
if (errno != EINTR)
|
||||
stderror(ERR_SYSTEM, progname, strerror(errno));
|
||||
stderror(ERR_SYSTEM, progname, strerror(errno));
|
||||
# endif /* convex */
|
||||
# ifdef WINNT_NATIVE
|
||||
__nt_want_vcode = 0;
|
||||
@ -781,13 +788,17 @@ GetNextChar(cp)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
cbp++;
|
||||
if (normal_mbtowc(cp, cbuf, cbp) == -1) {
|
||||
reset_mbtowc();
|
||||
if (cbp < MB_LEN_MAX)
|
||||
continue; /* Maybe a partial character */
|
||||
/* And drop the following bytes, if any */
|
||||
*cp = (unsigned char)*cbuf | INVALID_BYTE;
|
||||
if (AsciiOnly) {
|
||||
*cp = (unsigned char)*cbuf;
|
||||
} else {
|
||||
cbp++;
|
||||
if (normal_mbtowc(cp, cbuf, cbp) == -1) {
|
||||
reset_mbtowc();
|
||||
if (cbp < MB_CUR_MAX)
|
||||
continue; /* Maybe a partial character */
|
||||
/* And drop the following bytes, if any */
|
||||
*cp = (unsigned char)*cbuf | INVALID_BYTE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -810,8 +821,7 @@ GetNextChar(cp)
|
||||
* 1: Something was corrected
|
||||
*/
|
||||
static int
|
||||
SpellLine(cmdonly)
|
||||
int cmdonly;
|
||||
SpellLine(int cmdonly)
|
||||
{
|
||||
int endflag, matchval;
|
||||
Char *argptr, *OldCursor, *OldLastChar;
|
||||
@ -893,7 +903,7 @@ SpellLine(cmdonly)
|
||||
* 2: Several commands matched
|
||||
*/
|
||||
static int
|
||||
CompleteLine()
|
||||
CompleteLine(void)
|
||||
{
|
||||
int endflag, tmatch;
|
||||
Char *argptr, *OldCursor, *OldLastChar;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Header: /src/pub/tcsh/ed.refresh.c,v 3.39 2005/02/15 21:09:02 christos Exp $ */
|
||||
/* $Header: /p/tcsh/cvsroot/tcsh/ed.refresh.c,v 3.46 2006/08/23 15:03:14 christos Exp $ */
|
||||
/*
|
||||
* ed.refresh.c: Lower level screen refreshing functions
|
||||
*/
|
||||
@ -32,7 +32,7 @@
|
||||
*/
|
||||
#include "sh.h"
|
||||
|
||||
RCSID("$Id: ed.refresh.c,v 3.39 2005/02/15 21:09:02 christos Exp $")
|
||||
RCSID("$tcsh: ed.refresh.c,v 3.46 2006/08/23 15:03:14 christos Exp $")
|
||||
|
||||
#include "ed.h"
|
||||
/* #define DEBUG_UPDATE */
|
||||
@ -45,37 +45,35 @@ Char *litptr;
|
||||
static int vcursor_h, vcursor_v;
|
||||
static int rprompt_h, rprompt_v;
|
||||
|
||||
static int MakeLiteral __P((Char *, int, Char));
|
||||
static int Draw __P((Char *, int));
|
||||
static void Vdraw __P((Char, int));
|
||||
static void RefreshPromptpart __P((Char *));
|
||||
static void update_line __P((Char *, Char *, int));
|
||||
static void str_insert __P((Char *, int, int, Char *, int));
|
||||
static void str_delete __P((Char *, int, int, int));
|
||||
static void str_cp __P((Char *, Char *, int));
|
||||
static int MakeLiteral (Char *, int, Char);
|
||||
static int Draw (Char *, int);
|
||||
static void Vdraw (Char, int);
|
||||
static void RefreshPromptpart (Char *);
|
||||
static void update_line (Char *, Char *, int);
|
||||
static void str_insert (Char *, int, int, Char *, int);
|
||||
static void str_delete (Char *, int, int, int);
|
||||
static void str_cp (Char *, Char *, int);
|
||||
#ifndef WINNT_NATIVE
|
||||
static
|
||||
#else
|
||||
extern
|
||||
#endif
|
||||
void PutPlusOne __P((Char, int));
|
||||
static void cpy_pad_spaces __P((Char *, Char *, int));
|
||||
void PutPlusOne (Char, int);
|
||||
static void cpy_pad_spaces (Char *, Char *, int);
|
||||
#if defined(DEBUG_UPDATE) || defined(DEBUG_REFRESH) || defined(DEBUG_LITERAL)
|
||||
static void dprintf __P((char *, ...));
|
||||
static void dprintf (char *, ...);
|
||||
#ifdef DEBUG_UPDATE
|
||||
static void dprintstr __P((char *, const Char *, const Char *));
|
||||
static void dprintstr (char *, const Char *, const Char *);
|
||||
|
||||
static void
|
||||
dprintstr(str, f, t)
|
||||
char *str;
|
||||
const Char *f, *t;
|
||||
dprintstr(char *str, const Char *f, const Char *t)
|
||||
{
|
||||
dprintf("%s:\"", str);
|
||||
while (f < t) {
|
||||
if (*f & ~ASCII)
|
||||
if (ASC(*f) & ~ASCII)
|
||||
dprintf("[%x]", *f++);
|
||||
else
|
||||
dprintf("%c", *f++ & ASCII);
|
||||
dprintf("%c", CTL_ESC(ASCII & ASC(*f++)));
|
||||
}
|
||||
dprintf("\"\r\n");
|
||||
}
|
||||
@ -87,12 +85,7 @@ const Char *f, *t;
|
||||
* debugging cause you'll mangle up the file descriptors!
|
||||
*/
|
||||
static void
|
||||
#ifdef PROTOTYPES
|
||||
dprintf(char *fmt, ...)
|
||||
#else
|
||||
dprintf(va_list)
|
||||
va_dcl
|
||||
#endif /* __STDC__ */
|
||||
{
|
||||
static int fd = -1;
|
||||
char *dtty;
|
||||
@ -100,16 +93,10 @@ dprintf(va_list)
|
||||
if ((dtty = getenv("DEBUGTTY"))) {
|
||||
int o;
|
||||
va_list va;
|
||||
#ifdef PROTOTYPES
|
||||
va_start(va, fmt);
|
||||
#else
|
||||
char *fmt;
|
||||
va_start(va);
|
||||
fmt = va_arg(va, char *);
|
||||
#endif /* __STDC__ */
|
||||
|
||||
if (fd == -1)
|
||||
fd = open(dtty, O_RDWR);
|
||||
fd = xopen(dtty, O_RDWR);
|
||||
o = SHOUT;
|
||||
flush();
|
||||
SHOUT = fd;
|
||||
@ -123,10 +110,7 @@ dprintf(va_list)
|
||||
|
||||
static int litlen = 0, litalloc = 0;
|
||||
|
||||
static int MakeLiteral(str, len, addlit)
|
||||
Char *str;
|
||||
int len;
|
||||
Char addlit;
|
||||
static int MakeLiteral(Char *str, int len, Char addlit)
|
||||
{
|
||||
int i, addlitlen = 0;
|
||||
Char *addlitptr = 0;
|
||||
@ -152,10 +136,7 @@ static int MakeLiteral(str, len, addlit)
|
||||
int add = 256;
|
||||
while (len + addlitlen + 1 + (LIT_FACTOR - 1) > add)
|
||||
add *= 2;
|
||||
if (litptr)
|
||||
newlitptr = (Char *)xrealloc(litptr, (litalloc + add) * sizeof(Char));
|
||||
else
|
||||
newlitptr = (Char *)xmalloc((litalloc + add) * sizeof(Char));
|
||||
newlitptr = xrealloc(litptr, (litalloc + add) * sizeof(Char));
|
||||
if (!newlitptr)
|
||||
return '?';
|
||||
litptr = newlitptr;
|
||||
@ -179,16 +160,13 @@ static int MakeLiteral(str, len, addlit)
|
||||
}
|
||||
|
||||
static int
|
||||
Draw(cp, nocomb) /* draw char at cp, expand tabs, ctl chars */
|
||||
Char *cp;
|
||||
int nocomb;
|
||||
Draw(Char *cp, int nocomb) /* draw char at cp, expand tabs, ctl chars */
|
||||
{
|
||||
int l, w, i, lv, lh;
|
||||
Char ch, attr;
|
||||
NLSChar c;
|
||||
int w, i, lv, lh;
|
||||
Char c, attr;
|
||||
|
||||
attr = *cp & ~CHAR;
|
||||
l = NLSFrom(cp, NLSZEROT, &c);
|
||||
c = *cp & CHAR;
|
||||
w = NLSClassify(c, nocomb);
|
||||
switch (w) {
|
||||
case NLSCLASS_NL:
|
||||
@ -215,11 +193,10 @@ Draw(cp, nocomb) /* draw char at cp, expand tabs, ctl chars */
|
||||
}
|
||||
break;
|
||||
case NLSCLASS_ILLEGAL:
|
||||
ch = *cp & CHAR;
|
||||
Vdraw('\\' | attr, 1);
|
||||
Vdraw((((ch >> 6) & 7) + '0') | attr, 1);
|
||||
Vdraw((((ch >> 3) & 7) + '0') | attr, 1);
|
||||
Vdraw(((ch & 7) + '0') | attr, 1);
|
||||
Vdraw((((c >> 6) & 7) + '0') | attr, 1);
|
||||
Vdraw((((c >> 3) & 7) + '0') | attr, 1);
|
||||
Vdraw(((c & 7) + '0') | attr, 1);
|
||||
break;
|
||||
case NLSCLASS_ILLEGAL2:
|
||||
case NLSCLASS_ILLEGAL3:
|
||||
@ -245,32 +222,23 @@ Draw(cp, nocomb) /* draw char at cp, expand tabs, ctl chars */
|
||||
break;
|
||||
}
|
||||
if (lv < 0) {
|
||||
int l2 = l;
|
||||
for (; l2-- > 0; cp++) {
|
||||
ch = *cp & CHAR;
|
||||
Vdraw('\\' | attr, 1);
|
||||
Vdraw((((ch >> 6) & 7) + '0') | attr, 1);
|
||||
Vdraw((((ch >> 3) & 7) + '0') | attr, 1);
|
||||
Vdraw(((ch & 7) + '0') | attr, 1);
|
||||
}
|
||||
return l;
|
||||
Vdraw('\\' | attr, 1);
|
||||
Vdraw((((c >> 6) & 7) + '0') | attr, 1);
|
||||
Vdraw((((c >> 3) & 7) + '0') | attr, 1);
|
||||
Vdraw(((c & 7) + '0') | attr, 1);
|
||||
break;
|
||||
}
|
||||
Vdisplay[lv][lh] = MakeLiteral(cp, l, Vdisplay[lv][lh]);
|
||||
Vdisplay[lv][lh] = MakeLiteral(cp, 1, Vdisplay[lv][lh]);
|
||||
break;
|
||||
default:
|
||||
if (l > 1)
|
||||
Vdraw(MakeLiteral(cp, l, 0), w);
|
||||
else
|
||||
Vdraw(*cp, w);
|
||||
Vdraw(*cp, w);
|
||||
break;
|
||||
}
|
||||
return l;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
Vdraw(c, width) /* draw char c onto V lines */
|
||||
Char c;
|
||||
int width;
|
||||
Vdraw(Char c, int width) /* draw char c onto V lines */
|
||||
{
|
||||
#ifdef DEBUG_REFRESH
|
||||
# ifdef SHORT_STRINGS
|
||||
@ -284,7 +252,7 @@ Vdraw(c, width) /* draw char c onto V lines */
|
||||
that "span line breaks". */
|
||||
while (vcursor_h + width > TermH)
|
||||
Vdraw(' ', 1);
|
||||
Vdisplay[vcursor_v][vcursor_h] = (Char) c;
|
||||
Vdisplay[vcursor_v][vcursor_h] = c;
|
||||
if (width)
|
||||
vcursor_h++; /* advance to next place */
|
||||
while (--width > 0)
|
||||
@ -308,23 +276,22 @@ Vdraw(c, width) /* draw char c onto V lines */
|
||||
* draws a prompt element, expanding literals (we know it's ASCIZ)
|
||||
*/
|
||||
static void
|
||||
RefreshPromptpart(buf)
|
||||
Char *buf;
|
||||
RefreshPromptpart(Char *buf)
|
||||
{
|
||||
Char *cp;
|
||||
NLSChar c;
|
||||
int l, w;
|
||||
int w;
|
||||
|
||||
if (buf == NULL)
|
||||
return;
|
||||
for (cp = buf; *cp; ) {
|
||||
if (*cp & LITERAL) {
|
||||
Char *litstart = cp;
|
||||
while (*cp & LITERAL)
|
||||
cp++;
|
||||
if (*cp) {
|
||||
l = NLSFrom(cp, NLSZEROT, &c);
|
||||
w = NLSWidth(c);
|
||||
Vdraw(MakeLiteral(litstart, cp + l - litstart, 0), w);
|
||||
cp += l;
|
||||
w = NLSWidth(*cp & CHAR);
|
||||
Vdraw(MakeLiteral(litstart, cp + 1 - litstart, 0), w);
|
||||
cp++;
|
||||
}
|
||||
else {
|
||||
/*
|
||||
@ -352,7 +319,7 @@ static
|
||||
int OldvcV = 0;
|
||||
|
||||
void
|
||||
Refresh()
|
||||
Refresh(void)
|
||||
{
|
||||
int cur_line;
|
||||
Char *cp;
|
||||
@ -361,7 +328,7 @@ Refresh()
|
||||
Char oldgetting;
|
||||
|
||||
#ifdef DEBUG_REFRESH
|
||||
dprintf("PromptBuf = :%s:\r\n", short2str(PromptBuf));
|
||||
dprintf("Prompt = :%s:\r\n", short2str(Prompt));
|
||||
dprintf("InputBuf = :%s:\r\n", short2str(InputBuf));
|
||||
#endif /* DEBUG_REFRESH */
|
||||
oldgetting = GettingInput;
|
||||
@ -370,14 +337,14 @@ Refresh()
|
||||
/* reset the Vdraw cursor, temporarily draw rprompt to calculate its size */
|
||||
vcursor_h = 0;
|
||||
vcursor_v = 0;
|
||||
RefreshPromptpart(RPromptBuf);
|
||||
RefreshPromptpart(RPrompt);
|
||||
rprompt_h = vcursor_h;
|
||||
rprompt_v = vcursor_v;
|
||||
|
||||
/* reset the Vdraw cursor, draw prompt */
|
||||
vcursor_h = 0;
|
||||
vcursor_v = 0;
|
||||
RefreshPromptpart(PromptBuf);
|
||||
RefreshPromptpart(Prompt);
|
||||
cur_h = -1; /* set flag in case I'm not set */
|
||||
|
||||
/* draw the current input buffer */
|
||||
@ -404,7 +371,7 @@ Refresh()
|
||||
*/
|
||||
while (--rhdiff > 0) /* pad out with spaces */
|
||||
Vdraw(' ', 1);
|
||||
RefreshPromptpart(RPromptBuf);
|
||||
RefreshPromptpart(RPrompt);
|
||||
}
|
||||
else {
|
||||
rprompt_h = 0; /* flag "not using rprompt" */
|
||||
@ -463,7 +430,7 @@ Refresh()
|
||||
}
|
||||
|
||||
#ifdef notdef
|
||||
GotoBottom()
|
||||
GotoBottom(void)
|
||||
{ /* used to go to last used screen line */
|
||||
MoveToLine(OldvcV);
|
||||
}
|
||||
@ -471,7 +438,7 @@ GotoBottom()
|
||||
#endif
|
||||
|
||||
void
|
||||
PastBottom()
|
||||
PastBottom(void)
|
||||
{ /* used to go to last used screen line */
|
||||
MoveToLine(OldvcV);
|
||||
(void) putraw('\r');
|
||||
@ -484,11 +451,7 @@ PastBottom()
|
||||
/* insert num characters of s into d (in front of the character) at dat,
|
||||
maximum length of d is dlen */
|
||||
static void
|
||||
str_insert(d, dat, dlen, s, num)
|
||||
Char *d;
|
||||
int dat, dlen;
|
||||
Char *s;
|
||||
int num;
|
||||
str_insert(Char *d, int dat, int dlen, Char *s, int num)
|
||||
{
|
||||
Char *a, *b;
|
||||
|
||||
@ -530,9 +493,7 @@ str_insert(d, dat, dlen, s, num)
|
||||
|
||||
/* delete num characters d at dat, maximum length of d is dlen */
|
||||
static void
|
||||
str_delete(d, dat, dlen, num)
|
||||
Char *d;
|
||||
int dat, dlen, num;
|
||||
str_delete(Char *d, int dat, int dlen, int num)
|
||||
{
|
||||
Char *a, *b;
|
||||
|
||||
@ -563,9 +524,7 @@ str_delete(d, dat, dlen, num)
|
||||
}
|
||||
|
||||
static void
|
||||
str_cp(a, b, n)
|
||||
Char *a, *b;
|
||||
int n;
|
||||
str_cp(Char *a, Char *b, int n)
|
||||
{
|
||||
while (n-- && *b)
|
||||
*a++ = *b++;
|
||||
@ -597,9 +556,7 @@ new: eddie> Oh, my little buggy says to me, as lurgid as
|
||||
#define MIN_END_KEEP 4
|
||||
|
||||
static void /* could be changed to make it smarter */
|
||||
update_line(old, new, cur_line)
|
||||
Char *old, *new;
|
||||
int cur_line;
|
||||
update_line(Char *old, Char *new, int cur_line)
|
||||
{
|
||||
Char *o, *n, *p, c;
|
||||
Char *ofd, *ols, *oe, *nfd, *nls, *ne;
|
||||
@ -617,29 +574,32 @@ update_line(old, new, cur_line)
|
||||
/*
|
||||
* Find the end of both old and new
|
||||
*/
|
||||
while (*o)
|
||||
o++;
|
||||
o = Strend(o);
|
||||
|
||||
/*
|
||||
* Remove any trailing blanks off of the end, being careful not to
|
||||
* back up past the beginning.
|
||||
*/
|
||||
if (!(adrof(STRhighlight) && MarkIsSet)) {
|
||||
while (ofd < o) {
|
||||
if (o[-1] != ' ')
|
||||
break;
|
||||
o--;
|
||||
}
|
||||
}
|
||||
oe = o;
|
||||
*oe = (Char) 0;
|
||||
|
||||
while (*n)
|
||||
n++;
|
||||
|
||||
n = Strend(n);
|
||||
|
||||
/* remove blanks from end of new */
|
||||
if (!(adrof(STRhighlight) && MarkIsSet)) {
|
||||
while (nfd < n) {
|
||||
if (n[-1] != ' ')
|
||||
break;
|
||||
n--;
|
||||
}
|
||||
}
|
||||
ne = n;
|
||||
*ne = (Char) 0;
|
||||
|
||||
@ -1133,9 +1093,7 @@ update_line(old, new, cur_line)
|
||||
|
||||
|
||||
static void
|
||||
cpy_pad_spaces(dst, src, width)
|
||||
Char *dst, *src;
|
||||
int width;
|
||||
cpy_pad_spaces(Char *dst, Char *src, int width)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -1153,25 +1111,23 @@ cpy_pad_spaces(dst, src, width)
|
||||
}
|
||||
|
||||
void
|
||||
RefCursor()
|
||||
RefCursor(void)
|
||||
{ /* only move to new cursor pos */
|
||||
Char *cp;
|
||||
NLSChar c;
|
||||
int l, w, h, th, v;
|
||||
int w, h, th, v;
|
||||
|
||||
/* first we must find where the cursor is... */
|
||||
h = 0;
|
||||
v = 0;
|
||||
th = TermH; /* optimize for speed */
|
||||
|
||||
for (cp = PromptBuf; *cp; ) { /* do prompt */
|
||||
for (cp = Prompt; cp != NULL && *cp; ) { /* do prompt */
|
||||
if (*cp & LITERAL) {
|
||||
cp++;
|
||||
continue;
|
||||
}
|
||||
l = NLSFrom(cp, NLSZEROT, &c);
|
||||
w = NLSClassify(c, cp == PromptBuf);
|
||||
cp += l;
|
||||
w = NLSClassify(*cp & CHAR, cp == Prompt);
|
||||
cp++;
|
||||
switch(w) {
|
||||
case NLSCLASS_NL:
|
||||
h = 0;
|
||||
@ -1202,9 +1158,8 @@ RefCursor()
|
||||
}
|
||||
|
||||
for (cp = InputBuf; cp < Cursor;) { /* do input buffer to Cursor */
|
||||
l = NLSFrom(cp, Cursor - cp, &c);
|
||||
w = NLSClassify(c, cp == InputBuf);
|
||||
cp += l;
|
||||
w = NLSClassify(*cp & CHAR, cp == InputBuf);
|
||||
cp++;
|
||||
switch(w) {
|
||||
case NLSCLASS_NL:
|
||||
h = 0;
|
||||
@ -1237,14 +1192,17 @@ RefCursor()
|
||||
/* now go there */
|
||||
MoveToLine(v);
|
||||
MoveToChar(h);
|
||||
if (adrof(STRhighlight) && MarkIsSet) {
|
||||
ClearLines();
|
||||
ClearDisp();
|
||||
Refresh();
|
||||
}
|
||||
flush();
|
||||
}
|
||||
|
||||
#ifndef WINTT_NATIVE
|
||||
static void
|
||||
PutPlusOne(c, width)
|
||||
Char c;
|
||||
int width;
|
||||
PutPlusOne(Char c, int width)
|
||||
{
|
||||
while (width > 1 && CursorH + width > TermH)
|
||||
PutPlusOne(' ', 1);
|
||||
@ -1280,9 +1238,8 @@ void
|
||||
RefPlusOne(int l)
|
||||
{ /* we added just one char, handle it fast.
|
||||
* assumes that screen cursor == real cursor */
|
||||
Char *cp;
|
||||
Char *cp, c;
|
||||
int w;
|
||||
NLSChar c;
|
||||
|
||||
if (Cursor != LastChar) {
|
||||
Refresh(); /* too hard to handle */
|
||||
@ -1293,7 +1250,7 @@ RefPlusOne(int l)
|
||||
return;
|
||||
}
|
||||
cp = Cursor - l;
|
||||
NLSFrom(cp, (size_t)l, &c);
|
||||
c = *cp & CHAR;
|
||||
w = NLSClassify(c, cp == InputBuf);
|
||||
switch(w) {
|
||||
case NLSCLASS_CTRL:
|
||||
@ -1316,10 +1273,14 @@ RefPlusOne(int l)
|
||||
PutPlusOne((c & 7) + '0', 1);
|
||||
break;
|
||||
case 1:
|
||||
if (adrof(STRhighlight) && MarkIsSet)
|
||||
StartHighlight();
|
||||
if (l > 1)
|
||||
PutPlusOne(MakeLiteral(cp, l, 0), 1);
|
||||
else
|
||||
PutPlusOne(*cp, 1);
|
||||
if (adrof(STRhighlight) && MarkIsSet)
|
||||
StopHighlight();
|
||||
break;
|
||||
default:
|
||||
Refresh(); /* too hard to handle */
|
||||
@ -1331,7 +1292,7 @@ RefPlusOne(int l)
|
||||
/* clear the screen buffers so that new new prompt starts fresh. */
|
||||
|
||||
void
|
||||
ClearDisp()
|
||||
ClearDisp(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -1344,7 +1305,7 @@ ClearDisp()
|
||||
}
|
||||
|
||||
void
|
||||
ClearLines()
|
||||
ClearLines(void)
|
||||
{ /* Make sure all lines are *really* blank */
|
||||
int i;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Header: /src/pub/tcsh/ed.screen.c,v 3.63 2005/01/18 20:43:30 christos Exp $ */
|
||||
/* $Header: /p/tcsh/cvsroot/tcsh/ed.screen.c,v 3.75 2006/08/24 20:56:31 christos Exp $ */
|
||||
/*
|
||||
* ed.screen.c: Editor/termcap-curses interface
|
||||
*/
|
||||
@ -32,7 +32,7 @@
|
||||
*/
|
||||
#include "sh.h"
|
||||
|
||||
RCSID("$Id: ed.screen.c,v 3.63 2005/01/18 20:43:30 christos Exp $")
|
||||
RCSID("$tcsh: ed.screen.c,v 3.75 2006/08/24 20:56:31 christos Exp $")
|
||||
|
||||
#include "ed.h"
|
||||
#include "tc.h"
|
||||
@ -53,7 +53,7 @@ RCSID("$Id: ed.screen.c,v 3.63 2005/01/18 20:43:30 christos Exp $")
|
||||
#define Str(a) tstr[a].str
|
||||
#define Val(a) tval[a].val
|
||||
|
||||
static struct {
|
||||
static const struct {
|
||||
const char *b_name;
|
||||
speed_t b_rate;
|
||||
} baud_rate[] = {
|
||||
@ -124,45 +124,47 @@ static struct {
|
||||
{ NULL, 0 }
|
||||
};
|
||||
|
||||
#define T_al 0
|
||||
#define T_bl 1
|
||||
#define T_cd 2
|
||||
#define T_ce 3
|
||||
#define T_ch 4
|
||||
#define T_cl 5
|
||||
#define T_dc 6
|
||||
#define T_dl 7
|
||||
#define T_dm 8
|
||||
#define T_ed 9
|
||||
#define T_ei 10
|
||||
#define T_fs 11
|
||||
#define T_ho 12
|
||||
#define T_ic 13
|
||||
#define T_im 14
|
||||
#define T_ip 15
|
||||
#define T_kd 16
|
||||
#define T_kl 17
|
||||
#define T_kr 18
|
||||
#define T_ku 19
|
||||
#define T_md 20
|
||||
#define T_me 21
|
||||
#define T_nd 22
|
||||
#define T_se 23
|
||||
#define T_so 24
|
||||
#define T_ts 25
|
||||
#define T_up 26
|
||||
#define T_us 27
|
||||
#define T_ue 28
|
||||
#define T_vb 29
|
||||
#define T_DC 30
|
||||
#define T_DO 31
|
||||
#define T_IC 32
|
||||
#define T_LE 33
|
||||
#define T_RI 34
|
||||
#define T_UP 35
|
||||
#define T_kh 36
|
||||
#define T_at7 37
|
||||
#define T_str 38
|
||||
#define T_at7 0
|
||||
#define T_al 1
|
||||
#define T_bl 2
|
||||
#define T_cd 3
|
||||
#define T_ce 4
|
||||
#define T_ch 5
|
||||
#define T_cl 6
|
||||
#define T_dc 7
|
||||
#define T_dl 8
|
||||
#define T_dm 9
|
||||
#define T_ed 10
|
||||
#define T_ei 11
|
||||
#define T_fs 12
|
||||
#define T_ho 13
|
||||
#define T_ic 14
|
||||
#define T_im 15
|
||||
#define T_ip 16
|
||||
#define T_kd 17
|
||||
#define T_kh 18
|
||||
#define T_kl 19
|
||||
#define T_kr 20
|
||||
#define T_ku 21
|
||||
#define T_md 22
|
||||
#define T_me 23
|
||||
#define T_mr 24
|
||||
#define T_nd 25
|
||||
#define T_se 26
|
||||
#define T_so 27
|
||||
#define T_ts 28
|
||||
#define T_up 29
|
||||
#define T_us 30
|
||||
#define T_ue 31
|
||||
#define T_vb 32
|
||||
#define T_DC 33
|
||||
#define T_DO 34
|
||||
#define T_IC 35
|
||||
#define T_LE 36
|
||||
#define T_RI 37
|
||||
#define T_UP 38
|
||||
#define T_str 39
|
||||
|
||||
static struct termcapstr {
|
||||
const char *name;
|
||||
const char *long_name;
|
||||
@ -184,16 +186,16 @@ static struct termcapval {
|
||||
} tval[T_val + 1];
|
||||
|
||||
void
|
||||
terminit()
|
||||
terminit(void)
|
||||
{
|
||||
#ifdef NLS_CATALOGS
|
||||
int i;
|
||||
|
||||
for (i = 0; i < T_str + 1; i++)
|
||||
xfree((ptr_t) tstr[i].long_name);
|
||||
xfree((ptr_t)(intptr_t)tstr[i].long_name);
|
||||
|
||||
for (i = 0; i < T_val + 1; i++)
|
||||
xfree((ptr_t) tval[i].long_name);
|
||||
xfree((ptr_t)(intptr_t)tval[i].long_name);
|
||||
#endif
|
||||
|
||||
tstr[T_al].name = "al";
|
||||
@ -305,10 +307,13 @@ terminit()
|
||||
tstr[T_UP].long_name = CSAVS(4, 36, "cursor up multiple");
|
||||
|
||||
tstr[T_kh].name = "kh";
|
||||
tstr[T_kh].long_name = CSAVS(4, 37, "send cursor home");
|
||||
tstr[T_kh].long_name = CSAVS(4, 43, "send cursor home");
|
||||
|
||||
tstr[T_at7].name = "@7";
|
||||
tstr[T_at7].long_name = CSAVS(4, 38, "send cursor end");
|
||||
tstr[T_at7].long_name = CSAVS(4, 44, "send cursor end");
|
||||
|
||||
tstr[T_mr].name = "mr";
|
||||
tstr[T_mr].long_name = CSAVS(4, 45, "begin reverse video");
|
||||
|
||||
tstr[T_str].name = NULL;
|
||||
tstr[T_str].long_name = NULL;
|
||||
@ -351,149 +356,93 @@ terminit()
|
||||
|
||||
static int me_all = 0; /* does two or more of the attributes use me */
|
||||
|
||||
static void ReBufferDisplay __P((void));
|
||||
static void TCalloc __P((struct termcapstr *, char *));
|
||||
static void ReBufferDisplay (void);
|
||||
static void TCset (struct termcapstr *, const char *);
|
||||
|
||||
|
||||
static void
|
||||
TCalloc(t, cap)
|
||||
struct termcapstr *t;
|
||||
char *cap;
|
||||
TCset(struct termcapstr *t, const char *cap)
|
||||
{
|
||||
static char termcap_alloc[TC_BUFSIZE];
|
||||
char termbuf[TC_BUFSIZE];
|
||||
struct termcapstr *ts;
|
||||
static int tloc = 0;
|
||||
int tlen, clen;
|
||||
|
||||
if (cap == NULL || *cap == '\0') {
|
||||
xfree(t->str);
|
||||
t->str = NULL;
|
||||
return;
|
||||
} else {
|
||||
size_t size;
|
||||
|
||||
size = strlen(cap) + 1;
|
||||
t->str = xrealloc(t->str, size);
|
||||
memcpy(t->str, cap, size);
|
||||
}
|
||||
else
|
||||
clen = strlen(cap);
|
||||
|
||||
if (t->str == NULL)
|
||||
tlen = 0;
|
||||
else
|
||||
tlen = strlen(t->str);
|
||||
|
||||
/*
|
||||
* New string is shorter; no need to allocate space
|
||||
*/
|
||||
if (clen <= tlen) {
|
||||
(void) strcpy(t->str, cap);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* New string is longer; see if we have enough space to append
|
||||
*/
|
||||
if (tloc + 3 < TC_BUFSIZE) {
|
||||
(void) strcpy(t->str = &termcap_alloc[tloc], cap);
|
||||
tloc += clen + 1; /* one for \0 */
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Compact our buffer; no need to check compaction, cause we know it
|
||||
* fits...
|
||||
*/
|
||||
tlen = 0;
|
||||
for (ts = tstr; ts->name != NULL; ts++)
|
||||
if (t != ts && ts->str != NULL && ts->str[0] != '\0') {
|
||||
char *ptr;
|
||||
|
||||
for (ptr = ts->str; *ptr != '\0'; termbuf[tlen++] = *ptr++)
|
||||
continue;
|
||||
termbuf[tlen++] = '\0';
|
||||
}
|
||||
(void) memmove((ptr_t) termcap_alloc, (ptr_t) termbuf, (size_t) TC_BUFSIZE);
|
||||
tloc = tlen;
|
||||
if (tloc + 3 >= TC_BUFSIZE) {
|
||||
stderror(ERR_NAME | ERR_TCNOSTR);
|
||||
return;
|
||||
}
|
||||
(void) strcpy(t->str = &termcap_alloc[tloc], cap);
|
||||
tloc += clen + 1; /* one for \0 */
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
TellTC()
|
||||
TellTC(void)
|
||||
{
|
||||
struct termcapstr *t;
|
||||
char *s;
|
||||
char *first, *s;
|
||||
|
||||
xprintf(CGETS(7, 1, "\n\tTcsh thinks your terminal has the\n"));
|
||||
xprintf(CGETS(7, 2, "\tfollowing characteristics:\n\n"));
|
||||
xprintf(CGETS(7, 3, "\tIt has %d columns and %d lines\n"),
|
||||
Val(T_co), Val(T_li));
|
||||
s = strsave(T_HasMeta ? CGETS(7, 5, "a") : CGETS(7, 6, "no"));
|
||||
cleanup_push(s, xfree);
|
||||
first = s;
|
||||
xprintf(CGETS(7, 4, "\tIt has %s meta key\n"), s);
|
||||
xfree(s);
|
||||
s = strsave(T_Tabs ? "" : CGETS(7, 8, " not"));
|
||||
cleanup_push(s, xfree);
|
||||
xprintf(CGETS(7, 7, "\tIt can%s use tabs\n"), s);
|
||||
xfree(s);
|
||||
s = strsave((T_Margin&MARGIN_AUTO) ?
|
||||
CGETS(7, 10, "has") : CGETS(7, 11, "does not have"));
|
||||
cleanup_push(s, xfree);
|
||||
xprintf(CGETS(7, 9, "\tIt %s automatic margins\n"), s);
|
||||
xfree(s);
|
||||
if (T_Margin & MARGIN_AUTO) {
|
||||
s = strsave((T_Margin & MARGIN_MAGIC) ?
|
||||
CGETS(7, 10, "has") : CGETS(7, 11, "does not have"));
|
||||
cleanup_push(s, xfree);
|
||||
xprintf(CGETS(7, 12, "\tIt %s magic margins\n"), s);
|
||||
xfree(s);
|
||||
}
|
||||
for (t = tstr; t->name != NULL; t++) {
|
||||
s = strsave(t->str && *t->str ? t->str : CGETS(7, 13, "(empty)"));
|
||||
cleanup_push(s, xfree);
|
||||
xprintf("\t%36s (%s) == %s\n", t->long_name, t->name, s);
|
||||
xfree(s);
|
||||
cleanup_until(s);
|
||||
}
|
||||
xputchar('\n');
|
||||
cleanup_until(first);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
ReBufferDisplay()
|
||||
ReBufferDisplay(void)
|
||||
{
|
||||
int i;
|
||||
Char **b;
|
||||
Char **bufp;
|
||||
|
||||
b = Display;
|
||||
Display = NULL;
|
||||
if (b != NULL) {
|
||||
for (bufp = b; *bufp != NULL; bufp++)
|
||||
xfree((ptr_t) * bufp);
|
||||
xfree((ptr_t) b);
|
||||
}
|
||||
blkfree(b);
|
||||
b = Vdisplay;
|
||||
Vdisplay = NULL;
|
||||
if (b != NULL) {
|
||||
for (bufp = b; *bufp != NULL; bufp++)
|
||||
xfree((ptr_t) * bufp);
|
||||
xfree((ptr_t) b);
|
||||
}
|
||||
blkfree(b);
|
||||
TermH = Val(T_co);
|
||||
TermV = (INBUFSIZE * 4) / TermH + 1;
|
||||
b = (Char **) xmalloc((size_t) (sizeof(*b) * (TermV + 1)));
|
||||
TermV = (INBUFSIZE * 4) / TermH + 1;/*FIXBUF*/
|
||||
b = xmalloc(sizeof(*b) * (TermV + 1));
|
||||
for (i = 0; i < TermV; i++)
|
||||
b[i] = (Char *) xmalloc((size_t) (sizeof(*b[i]) * (TermH + 1)));
|
||||
b[i] = xmalloc(sizeof(*b[i]) * (TermH + 1));
|
||||
b[TermV] = NULL;
|
||||
Display = b;
|
||||
b = (Char **) xmalloc((size_t) (sizeof(*b) * (TermV + 1)));
|
||||
b = xmalloc(sizeof(*b) * (TermV + 1));
|
||||
for (i = 0; i < TermV; i++)
|
||||
b[i] = (Char *) xmalloc((size_t) (sizeof(*b[i]) * (TermH + 1)));
|
||||
b[i] = xmalloc(sizeof(*b[i]) * (TermH + 1));
|
||||
b[TermV] = NULL;
|
||||
Vdisplay = b;
|
||||
}
|
||||
|
||||
void
|
||||
SetTC(what, how)
|
||||
char *what, *how;
|
||||
SetTC(char *what, char *how)
|
||||
{
|
||||
struct termcapstr *ts;
|
||||
struct termcapval *tv;
|
||||
@ -506,7 +455,7 @@ SetTC(what, how)
|
||||
if (strcmp(ts->name, what) == 0)
|
||||
break;
|
||||
if (ts->name != NULL) {
|
||||
TCalloc(ts, how);
|
||||
TCset(ts, how);
|
||||
/*
|
||||
* Reset variables
|
||||
*/
|
||||
@ -542,10 +491,10 @@ SetTC(what, how)
|
||||
stderror(ERR_SETTCUS, tv->name);
|
||||
return;
|
||||
}
|
||||
T_Tabs = (Char) Val(T_pt);
|
||||
T_HasMeta = (Char) Val(T_km);
|
||||
T_Margin = (Char) Val(T_am) ? MARGIN_AUTO : 0;
|
||||
T_Margin |= (Char) Val(T_xn) ? MARGIN_MAGIC : 0;
|
||||
T_Tabs = Val(T_pt);
|
||||
T_HasMeta = Val(T_km);
|
||||
T_Margin = Val(T_am) ? MARGIN_AUTO : 0;
|
||||
T_Margin |= Val(T_xn) ? MARGIN_MAGIC : 0;
|
||||
if (tv == &tval[T_am] || tv == &tval[T_xn])
|
||||
ChangeSize(Val(T_li), Val(T_co));
|
||||
return;
|
||||
@ -568,33 +517,27 @@ SetTC(what, how)
|
||||
* Print the termcap string out with variable substitution
|
||||
*/
|
||||
void
|
||||
EchoTC(v)
|
||||
Char **v;
|
||||
EchoTC(Char **v)
|
||||
{
|
||||
char *cap, *scap, cv[BUFSIZE];
|
||||
char *cap, *scap, *cv;
|
||||
int arg_need, arg_cols, arg_rows;
|
||||
int verbose = 0, silent = 0;
|
||||
char *area;
|
||||
static const char *fmts = "%s\n", *fmtd = "%d\n";
|
||||
static const char fmts[] = "%s\n", fmtd[] = "%d\n";
|
||||
struct termcapstr *t;
|
||||
char buf[TC_BUFSIZE];
|
||||
Char **globbed;
|
||||
|
||||
area = buf;
|
||||
|
||||
setname("echotc");
|
||||
|
||||
tglob(v);
|
||||
if (gflag) {
|
||||
v = globall(v);
|
||||
if (v == 0)
|
||||
stderror(ERR_NAME | ERR_NOMATCH);
|
||||
}
|
||||
else
|
||||
v = gargv = saveblk(v);
|
||||
trim(v);
|
||||
v = glob_all_or_error(v);
|
||||
globbed = v;
|
||||
cleanup_push(globbed, blk_cleanup);
|
||||
|
||||
if (!*v || *v[0] == '\0')
|
||||
return;
|
||||
goto end;
|
||||
if (v[0][0] == '-') {
|
||||
switch (v[0][1]) {
|
||||
case 'v':
|
||||
@ -610,31 +553,28 @@ EchoTC(v)
|
||||
v++;
|
||||
}
|
||||
if (!*v || *v[0] == '\0')
|
||||
return;
|
||||
(void) strcpy(cv, short2str(*v));
|
||||
goto end;
|
||||
cv = strsave(short2str(*v));
|
||||
cleanup_push(cv, xfree);
|
||||
if (strcmp(cv, "tabs") == 0) {
|
||||
xprintf(fmts, T_Tabs ? CGETS(7, 14, "yes") :
|
||||
CGETS(7, 15, "no"));
|
||||
flush();
|
||||
return;
|
||||
goto end_flush;
|
||||
}
|
||||
else if (strcmp(cv, "meta") == 0) {
|
||||
xprintf(fmts, Val(T_km) ? CGETS(7, 14, "yes") :
|
||||
CGETS(7, 15, "no"));
|
||||
flush();
|
||||
return;
|
||||
goto end_flush;
|
||||
}
|
||||
else if (strcmp(cv, "xn") == 0) {
|
||||
xprintf(fmts, T_Margin & MARGIN_MAGIC ? CGETS(7, 14, "yes") :
|
||||
CGETS(7, 15, "no"));
|
||||
flush();
|
||||
return;
|
||||
goto end_flush;
|
||||
}
|
||||
else if (strcmp(cv, "am") == 0) {
|
||||
xprintf(fmts, T_Margin & MARGIN_AUTO ? CGETS(7, 14, "yes") :
|
||||
CGETS(7, 15, "no"));
|
||||
flush();
|
||||
return;
|
||||
goto end_flush;
|
||||
}
|
||||
else if (strcmp(cv, "baud") == 0) {
|
||||
int i;
|
||||
@ -642,22 +582,19 @@ EchoTC(v)
|
||||
for (i = 0; baud_rate[i].b_name != NULL; i++)
|
||||
if (T_Speed == baud_rate[i].b_rate) {
|
||||
xprintf(fmts, baud_rate[i].b_name);
|
||||
flush();
|
||||
return;
|
||||
goto end_flush;
|
||||
}
|
||||
xprintf(fmtd, 0);
|
||||
flush();
|
||||
return;
|
||||
goto end_flush;
|
||||
}
|
||||
else if (strcmp(cv, "rows") == 0 || strcmp(cv, "lines") == 0) {
|
||||
else if (strcmp(cv, "rows") == 0 || strcmp(cv, "lines") == 0 ||
|
||||
strcmp(cv, "li") == 0) {
|
||||
xprintf(fmtd, Val(T_li));
|
||||
flush();
|
||||
return;
|
||||
goto end_flush;
|
||||
}
|
||||
else if (strcmp(cv, "cols") == 0) {
|
||||
else if (strcmp(cv, "cols") == 0 || strcmp(cv, "co") == 0) {
|
||||
xprintf(fmtd, Val(T_co));
|
||||
flush();
|
||||
return;
|
||||
goto end_flush;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -674,10 +611,10 @@ EchoTC(v)
|
||||
if (!scap || scap[0] == '\0') {
|
||||
if (tgetflag(cv)) {
|
||||
xprintf(CGETS(7, 14, "yes\n"));
|
||||
return;
|
||||
goto end;
|
||||
}
|
||||
if (silent)
|
||||
return;
|
||||
goto end;
|
||||
else
|
||||
stderror(ERR_NAME | ERR_TCCAP, cv);
|
||||
}
|
||||
@ -718,7 +655,7 @@ EchoTC(v)
|
||||
v++;
|
||||
if (*v && *v[0]) {
|
||||
if (silent)
|
||||
return;
|
||||
goto end;
|
||||
else
|
||||
stderror(ERR_NAME | ERR_TCARGS, cv, arg_need);
|
||||
}
|
||||
@ -733,7 +670,7 @@ EchoTC(v)
|
||||
v++;
|
||||
if (*v && *v[0]) {
|
||||
if (silent)
|
||||
return;
|
||||
goto end;
|
||||
else
|
||||
stderror(ERR_NAME | ERR_TCARGS, cv, arg_need);
|
||||
}
|
||||
@ -748,7 +685,7 @@ EchoTC(v)
|
||||
v++;
|
||||
if (!*v || *v[0] == '\0') {
|
||||
if (silent)
|
||||
return;
|
||||
goto end;
|
||||
else
|
||||
stderror(ERR_NAME | ERR_TCNARGS, cv, 2);
|
||||
}
|
||||
@ -756,7 +693,7 @@ EchoTC(v)
|
||||
v++;
|
||||
if (!*v || *v[0] == '\0') {
|
||||
if (silent)
|
||||
return;
|
||||
goto end;
|
||||
else
|
||||
stderror(ERR_NAME | ERR_TCNARGS, cv, 2);
|
||||
}
|
||||
@ -764,18 +701,17 @@ EchoTC(v)
|
||||
v++;
|
||||
if (*v && *v[0]) {
|
||||
if (silent)
|
||||
return;
|
||||
goto end;
|
||||
else
|
||||
stderror(ERR_NAME | ERR_TCARGS, cv, arg_need);
|
||||
}
|
||||
(void) tputs(tgoto(scap, arg_cols, arg_rows), arg_rows, PUTRAW);
|
||||
break;
|
||||
}
|
||||
end_flush:
|
||||
flush();
|
||||
if (gargv) {
|
||||
blkfree(gargv);
|
||||
gargv = 0;
|
||||
}
|
||||
end:
|
||||
cleanup_until(globbed);
|
||||
}
|
||||
|
||||
int GotTermCaps = 0;
|
||||
@ -802,7 +738,7 @@ static struct {
|
||||
#define A_K_NKEYS 6
|
||||
|
||||
void
|
||||
ResetArrowKeys()
|
||||
ResetArrowKeys(void)
|
||||
{
|
||||
arrow[A_K_DN].fun.cmd = F_DOWN_HIST;
|
||||
arrow[A_K_DN].type = XK_CMD;
|
||||
@ -824,7 +760,7 @@ ResetArrowKeys()
|
||||
}
|
||||
|
||||
void
|
||||
DefaultArrowKeys()
|
||||
DefaultArrowKeys(void)
|
||||
{
|
||||
static Char strA[] = {033, '[', 'A', '\0'};
|
||||
static Char strB[] = {033, '[', 'B', '\0'};
|
||||
@ -892,10 +828,7 @@ DefaultArrowKeys()
|
||||
|
||||
|
||||
int
|
||||
SetArrowKeys(name, fun, type)
|
||||
CStr *name;
|
||||
XmapVal *fun;
|
||||
int type;
|
||||
SetArrowKeys(const CStr *name, XmapVal *fun, int type)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < A_K_NKEYS; i++)
|
||||
@ -908,8 +841,7 @@ SetArrowKeys(name, fun, type)
|
||||
}
|
||||
|
||||
int
|
||||
IsArrowKey(name)
|
||||
Char *name;
|
||||
IsArrowKey(Char *name)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < A_K_NKEYS; i++)
|
||||
@ -919,8 +851,7 @@ IsArrowKey(name)
|
||||
}
|
||||
|
||||
int
|
||||
ClearArrowKeys(name)
|
||||
CStr *name;
|
||||
ClearArrowKeys(const CStr *name)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < A_K_NKEYS; i++)
|
||||
@ -932,24 +863,19 @@ ClearArrowKeys(name)
|
||||
}
|
||||
|
||||
void
|
||||
PrintArrowKeys(name)
|
||||
CStr *name;
|
||||
PrintArrowKeys(const CStr *name)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < A_K_NKEYS; i++)
|
||||
if (name->len == 0 || Strcmp(name->buf, arrow[i].name) == 0)
|
||||
if (arrow[i].type != XK_NOD) {
|
||||
CStr cs;
|
||||
cs.buf = arrow[i].name;
|
||||
cs.len = Strlen(cs.buf);
|
||||
(void) printOne(&cs, &arrow[i].fun, arrow[i].type);
|
||||
}
|
||||
if (arrow[i].type != XK_NOD)
|
||||
printOne(arrow[i].name, &arrow[i].fun, arrow[i].type);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BindArrowKeys()
|
||||
BindArrowKeys(void)
|
||||
{
|
||||
KEYCMD *map, *dmap;
|
||||
int i, j;
|
||||
@ -1000,8 +926,7 @@ BindArrowKeys()
|
||||
static Char cur_atr = 0; /* current attributes */
|
||||
|
||||
void
|
||||
SetAttributes(atr)
|
||||
Char atr;
|
||||
SetAttributes(Char atr)
|
||||
{
|
||||
atr &= ATTRIBUTES;
|
||||
if (atr != cur_atr) {
|
||||
@ -1066,16 +991,32 @@ SetAttributes(atr)
|
||||
}
|
||||
}
|
||||
|
||||
int highlighting = 0;
|
||||
|
||||
void
|
||||
StartHighlight()
|
||||
{
|
||||
(void) tputs(Str(T_mr), 1, PUTPURE);
|
||||
highlighting = 1;
|
||||
}
|
||||
|
||||
void
|
||||
StopHighlight()
|
||||
{
|
||||
(void) tputs(Str(T_me), 1, PUTPURE);
|
||||
highlighting = 0;
|
||||
}
|
||||
|
||||
/* PWP 6-27-88 -- if the tty driver thinks that we can tab, we ask termcap */
|
||||
int
|
||||
CanWeTab()
|
||||
CanWeTab(void)
|
||||
{
|
||||
return (Val(T_pt));
|
||||
}
|
||||
|
||||
/* move to line <where> (first line == 0) as efficiently as possible; */
|
||||
void
|
||||
MoveToLine(where) /* move to line <where> (first line == 0) */
|
||||
int where; /* as efficiently as possible; */
|
||||
MoveToLine(int where)
|
||||
{
|
||||
int del;
|
||||
|
||||
@ -1132,8 +1073,7 @@ MoveToLine(where) /* move to line <where> (first line == 0) */
|
||||
}
|
||||
|
||||
void
|
||||
MoveToChar(where) /* move to character position (where) */
|
||||
int where;
|
||||
MoveToChar(int where) /* move to character position (where) */
|
||||
{ /* as efficiently as possible */
|
||||
int del;
|
||||
|
||||
@ -1207,10 +1147,10 @@ MoveToChar(where) /* move to character position (where) */
|
||||
}
|
||||
|
||||
void
|
||||
so_write(cp, n)
|
||||
Char *cp;
|
||||
int n;
|
||||
so_write(Char *cp, int n)
|
||||
{
|
||||
int cur_pos, prompt_len = 0, region_start = 0, region_end = 0;
|
||||
|
||||
if (n <= 0)
|
||||
return; /* catch bugs */
|
||||
|
||||
@ -1222,7 +1162,37 @@ so_write(cp, n)
|
||||
return;
|
||||
}
|
||||
|
||||
if (adrof(STRhighlight)) {
|
||||
/* find length of prompt */
|
||||
Char *promptc;
|
||||
for (promptc = Prompt; *promptc; promptc++);
|
||||
prompt_len = promptc - Prompt;
|
||||
|
||||
/* find region start and end points */
|
||||
if (IncMatchLen) {
|
||||
region_start = (Cursor - InputBuf) + prompt_len;
|
||||
region_end = region_start + IncMatchLen;
|
||||
} else if (MarkIsSet) {
|
||||
region_start = (min(Cursor, Mark) - InputBuf) + prompt_len;
|
||||
region_end = (max(Cursor, Mark) - InputBuf) + prompt_len;
|
||||
}
|
||||
}
|
||||
|
||||
do {
|
||||
if (adrof(STRhighlight)) {
|
||||
cur_pos = CursorV * TermH + CursorH;
|
||||
if (!highlighting &&
|
||||
cur_pos >= region_start && cur_pos < region_end)
|
||||
StartHighlight();
|
||||
else if (highlighting && cur_pos >= region_end)
|
||||
StopHighlight();
|
||||
|
||||
/* don't highlight over the cursor. the highlighting's reverse
|
||||
* video would cancel it out. :P */
|
||||
if (highlighting && cur_pos == (Cursor - InputBuf) + prompt_len)
|
||||
StopHighlight();
|
||||
}
|
||||
|
||||
if (*cp != CHAR_DBWIDTH) {
|
||||
if (*cp & LITERAL) {
|
||||
Char *d;
|
||||
@ -1239,15 +1209,18 @@ so_write(cp, n)
|
||||
CursorH++;
|
||||
} while (--n);
|
||||
|
||||
if (adrof(STRhighlight) && highlighting)
|
||||
StopHighlight();
|
||||
|
||||
if (CursorH >= TermH) { /* wrap? */
|
||||
if (T_Margin & MARGIN_AUTO) { /* yes */
|
||||
CursorH = 0;
|
||||
CursorV++;
|
||||
if (T_Margin & MARGIN_MAGIC) {
|
||||
/* force the wrap to avoid the "magic" situation */
|
||||
Char c;
|
||||
if ((c = Display[CursorV][CursorH]) != '\0') {
|
||||
so_write(&c, 1);
|
||||
Char xc;
|
||||
if ((xc = Display[CursorV][CursorH]) != '\0') {
|
||||
so_write(&xc, 1);
|
||||
while(Display[CursorV][CursorH] == CHAR_DBWIDTH)
|
||||
CursorH++;
|
||||
}
|
||||
@ -1264,8 +1237,7 @@ so_write(cp, n)
|
||||
|
||||
|
||||
void
|
||||
DeleteChars(num) /* deletes <num> characters */
|
||||
int num;
|
||||
DeleteChars(int num) /* deletes <num> characters */
|
||||
{
|
||||
if (num <= 0)
|
||||
return;
|
||||
@ -1303,10 +1275,10 @@ DeleteChars(num) /* deletes <num> characters */
|
||||
(void) tputs(Str(T_ed), 1, PUTPURE);
|
||||
}
|
||||
|
||||
/* Puts terminal in insert character mode, or inserts num characters in the
|
||||
line */
|
||||
void
|
||||
Insert_write(cp, num) /* Puts terminal in insert character mode, */
|
||||
Char *cp;
|
||||
int num; /* or inserts num characters in the line */
|
||||
Insert_write(Char *cp, int num)
|
||||
{
|
||||
if (num <= 0)
|
||||
return;
|
||||
@ -1358,9 +1330,9 @@ Insert_write(cp, num) /* Puts terminal in insert character mode, */
|
||||
|
||||
}
|
||||
|
||||
/* clear to end of line. There are num characters to clear */
|
||||
void
|
||||
ClearEOL(num) /* clear to end of line. There are num */
|
||||
int num; /* characters to clear */
|
||||
ClearEOL(int num)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -1377,7 +1349,7 @@ ClearEOL(num) /* clear to end of line. There are num */
|
||||
}
|
||||
|
||||
void
|
||||
ClearScreen()
|
||||
ClearScreen(void)
|
||||
{ /* clear the whole screen and home */
|
||||
if (GoodStr(T_cl))
|
||||
/* send the clear screen code */
|
||||
@ -1394,7 +1366,7 @@ ClearScreen()
|
||||
}
|
||||
|
||||
void
|
||||
SoundBeep()
|
||||
SoundBeep(void)
|
||||
{ /* produce a sound */
|
||||
beep_cmd ();
|
||||
if (adrof(STRnobeep))
|
||||
@ -1410,7 +1382,7 @@ SoundBeep()
|
||||
}
|
||||
|
||||
void
|
||||
ClearToBottom()
|
||||
ClearToBottom(void)
|
||||
{ /* clear to the bottom of the screen */
|
||||
if (GoodStr(T_cd))
|
||||
(void) tputs(Str(T_cd), Val(T_li), PUTPURE);
|
||||
@ -1419,7 +1391,7 @@ ClearToBottom()
|
||||
}
|
||||
|
||||
void
|
||||
GetTermCaps()
|
||||
GetTermCaps(void)
|
||||
{ /* read in the needed terminal capabilites */
|
||||
int i;
|
||||
const char *ptr;
|
||||
@ -1430,17 +1402,14 @@ GetTermCaps()
|
||||
|
||||
|
||||
#ifdef SIG_WINDOW
|
||||
# ifdef BSDSIGS
|
||||
sigmask_t omask;
|
||||
# endif /* BSDSIGS */
|
||||
sigset_t oset, set;
|
||||
int lins, cols;
|
||||
|
||||
/* don't want to confuse things here */
|
||||
# ifdef BSDSIGS
|
||||
omask = sigblock(sigmask(SIG_WINDOW)) & ~sigmask(SIG_WINDOW);
|
||||
# else /* BSDSIGS */
|
||||
(void) sighold(SIG_WINDOW);
|
||||
# endif /* BSDSIGS */
|
||||
sigemptyset(&set);
|
||||
sigaddset(&set, SIG_WINDOW);
|
||||
(void)sigprocmask(SIG_BLOCK, &set, &oset);
|
||||
cleanup_push(&oset, sigprocmask_cleanup);
|
||||
#endif /* SIG_WINDOW */
|
||||
area = buf;
|
||||
|
||||
@ -1480,7 +1449,7 @@ GetTermCaps()
|
||||
Val(T_co) = 80; /* do a dumb terminal */
|
||||
Val(T_pt) = Val(T_km) = Val(T_li) = 0;
|
||||
for (t = tstr; t->name != NULL; t++)
|
||||
TCalloc(t, NULL);
|
||||
TCset(t, NULL);
|
||||
}
|
||||
else {
|
||||
/* Can we tab */
|
||||
@ -1492,7 +1461,7 @@ GetTermCaps()
|
||||
Val(T_co) = tgetnum("co");
|
||||
Val(T_li) = tgetnum("li");
|
||||
for (t = tstr; t->name != NULL; t++)
|
||||
TCalloc(t, tgetstr(t->name, &area));
|
||||
TCset(t, tgetstr(t->name, &area));
|
||||
}
|
||||
if (Val(T_co) < 2)
|
||||
Val(T_co) = 80; /* just in case */
|
||||
@ -1502,10 +1471,10 @@ GetTermCaps()
|
||||
T_Cols = (Char) Val(T_co);
|
||||
T_Lines = (Char) Val(T_li);
|
||||
if (T_Tabs)
|
||||
T_Tabs = (Char) Val(T_pt);
|
||||
T_HasMeta = (Char) Val(T_km);
|
||||
T_Margin = (Char) Val(T_am) ? MARGIN_AUTO : 0;
|
||||
T_Margin |= (Char) Val(T_xn) ? MARGIN_MAGIC : 0;
|
||||
T_Tabs = Val(T_pt);
|
||||
T_HasMeta = Val(T_km);
|
||||
T_Margin = Val(T_am) ? MARGIN_AUTO : 0;
|
||||
T_Margin |= Val(T_xn) ? MARGIN_MAGIC : 0;
|
||||
T_CanCEOL = GoodStr(T_ce);
|
||||
T_CanDel = GoodStr(T_dc) || GoodStr(T_DC);
|
||||
T_CanIns = GoodStr(T_im) || GoodStr(T_ic) || GoodStr(T_IC);
|
||||
@ -1538,11 +1507,7 @@ GetTermCaps()
|
||||
(void) GetSize(&lins, &cols); /* get the correct window size */
|
||||
ChangeSize(lins, cols);
|
||||
|
||||
# ifdef BSDSIGS
|
||||
(void) sigsetmask(omask); /* can change it again */
|
||||
# else /* BSDSIGS */
|
||||
(void) sigrelse(SIG_WINDOW);
|
||||
# endif /* BSDSIGS */
|
||||
cleanup_until(&oset); /* can change it again */
|
||||
#else /* SIG_WINDOW */
|
||||
ChangeSize(Val(T_li), Val(T_co));
|
||||
#endif /* SIG_WINDOW */
|
||||
@ -1557,8 +1522,7 @@ GetTermCaps()
|
||||
* is not a tty, but it will work in most cases.
|
||||
*/
|
||||
int
|
||||
GetSize(lins, cols)
|
||||
int *lins, *cols;
|
||||
GetSize(int *lins, int *cols)
|
||||
{
|
||||
*cols = Val(T_co);
|
||||
*lins = Val(T_li);
|
||||
@ -1596,11 +1560,10 @@ GetSize(lins, cols)
|
||||
return (Val(T_co) != *cols || Val(T_li) != *lins);
|
||||
}
|
||||
|
||||
#endif /* SIGWINDOW */
|
||||
#endif /* SIG_WINDOW */
|
||||
|
||||
void
|
||||
ChangeSize(lins, cols)
|
||||
int lins, cols;
|
||||
ChangeSize(int lins, int cols)
|
||||
{
|
||||
/*
|
||||
* Just in case
|
||||
@ -1620,26 +1583,31 @@ ChangeSize(lins, cols)
|
||||
* our only chance to get the window size right.
|
||||
*/
|
||||
if (Val(T_co) == cols && Val(T_li) == lins) {
|
||||
Char buf[10];
|
||||
Char *p;
|
||||
char *tptr;
|
||||
|
||||
if (getenv("COLUMNS")) {
|
||||
(void) Itoa(Val(T_co), buf, 0, 0);
|
||||
tsetenv(STRCOLUMNS, buf);
|
||||
p = Itoa(Val(T_co), 0, 0);
|
||||
cleanup_push(p, xfree);
|
||||
tsetenv(STRCOLUMNS, p);
|
||||
cleanup_until(p);
|
||||
}
|
||||
|
||||
if (getenv("LINES")) {
|
||||
(void) Itoa(Val(T_li), buf, 0, 0);
|
||||
tsetenv(STRLINES, buf);
|
||||
p = Itoa(Val(T_li), 0, 0);
|
||||
cleanup_push(p, xfree);
|
||||
tsetenv(STRLINES, p);
|
||||
cleanup_until(p);
|
||||
}
|
||||
|
||||
if ((tptr = getenv("TERMCAP")) != NULL) {
|
||||
/* Leave 64 characters slop in case we enlarge the termcap string */
|
||||
Char termcap[1024+64], backup[1024+64], *ptr;
|
||||
Char termcap[TC_BUFSIZE+64], backup[TC_BUFSIZE+64], *ptr;
|
||||
Char buf[4];
|
||||
|
||||
ptr = str2short(tptr);
|
||||
(void) Strncpy(termcap, ptr, 1024);
|
||||
termcap[1023] = '\0';
|
||||
(void) Strncpy(termcap, ptr, TC_BUFSIZE);
|
||||
termcap[TC_BUFSIZE-1] = '\0';
|
||||
|
||||
/* update termcap string; first do columns */
|
||||
buf[0] = 'c';
|
||||
@ -1653,8 +1621,9 @@ ChangeSize(lins, cols)
|
||||
size_t len = (ptr - termcap) + Strlen(buf);
|
||||
(void) Strncpy(backup, termcap, len);
|
||||
backup[len] = '\0';
|
||||
(void) Itoa(Val(T_co), buf, 0, 0);
|
||||
(void) Strcat(backup + len, buf);
|
||||
p = Itoa(Val(T_co), 0, 0);
|
||||
(void) Strcat(backup + len, p);
|
||||
xfree(p);
|
||||
ptr = Strchr(ptr, ':');
|
||||
(void) Strcat(backup, ptr);
|
||||
}
|
||||
@ -1671,16 +1640,17 @@ ChangeSize(lins, cols)
|
||||
size_t len = (ptr - backup) + Strlen(buf);
|
||||
(void) Strncpy(termcap, backup, len);
|
||||
termcap[len] = '\0';
|
||||
(void) Itoa(Val(T_li), buf, 0, 0);
|
||||
(void) Strcat(termcap, buf);
|
||||
p = Itoa(Val(T_li), 0, 0);
|
||||
(void) Strcat(termcap, p);
|
||||
xfree(p);
|
||||
ptr = Strchr(ptr, ':');
|
||||
(void) Strcat(termcap, ptr);
|
||||
}
|
||||
/*
|
||||
* Chop the termcap string at 1024 characters to avoid core-dumps
|
||||
* in the termcap routines
|
||||
* Chop the termcap string at TC_BUFSIZE-1 characters to avoid
|
||||
* core-dumps in the termcap routines
|
||||
*/
|
||||
termcap[1023] = '\0';
|
||||
termcap[TC_BUFSIZE - 1] = '\0';
|
||||
tsetenv(STRTERMCAP, termcap);
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Header: /src/pub/tcsh/ed.term.c,v 1.31 2004/11/23 02:10:48 christos Exp $ */
|
||||
/* $Header: /p/tcsh/cvsroot/tcsh/ed.term.c,v 1.36 2006/03/02 18:46:44 christos Exp $ */
|
||||
/*
|
||||
* ed.term.c: Low level terminal interface
|
||||
*/
|
||||
@ -33,7 +33,7 @@
|
||||
#include "sh.h"
|
||||
#ifndef WINNT_NATIVE
|
||||
|
||||
RCSID("$Id: ed.term.c,v 1.31 2004/11/23 02:10:48 christos Exp $")
|
||||
RCSID("$tcsh: ed.term.c,v 1.36 2006/03/02 18:46:44 christos Exp $")
|
||||
|
||||
#include "ed.h"
|
||||
|
||||
@ -84,7 +84,7 @@ ttyperm_t ttylist = {
|
||||
}
|
||||
};
|
||||
|
||||
static struct tcshmodes {
|
||||
static const struct tcshmodes {
|
||||
const char *m_name;
|
||||
#ifdef SOLARIS2
|
||||
unsigned long m_value;
|
||||
@ -568,33 +568,35 @@ static struct tcshmodes {
|
||||
#endif
|
||||
|
||||
/* Retry a system call */
|
||||
static int count;
|
||||
#define RETRY(x) \
|
||||
for (count = 0;; count++) \
|
||||
if ((x) == -1) { \
|
||||
if (OKERROR(errno) || KLUDGE) \
|
||||
continue; \
|
||||
else \
|
||||
return -1; \
|
||||
} \
|
||||
else \
|
||||
break \
|
||||
#define RETRY(x) \
|
||||
do { \
|
||||
int count; \
|
||||
\
|
||||
for (count = 0;; count++) \
|
||||
if ((x) == -1) { \
|
||||
if (OKERROR(errno) || KLUDGE) \
|
||||
continue; \
|
||||
else \
|
||||
return -1; \
|
||||
} \
|
||||
else \
|
||||
break; \
|
||||
} while (0)
|
||||
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
dosetty(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
dosetty(Char **v, struct command *t)
|
||||
{
|
||||
struct tcshmodes *m;
|
||||
char x, *d;
|
||||
const struct tcshmodes *m;
|
||||
char x, *d, *cmdname;
|
||||
int aflag = 0;
|
||||
Char *s;
|
||||
int z = EX_IO;
|
||||
char cmdname[BUFSIZE];
|
||||
|
||||
USE(t);
|
||||
setname(strcpy(cmdname, short2str(*v++)));
|
||||
cmdname = strsave(short2str(*v++));
|
||||
cleanup_push(cmdname, xfree);
|
||||
setname(cmdname);
|
||||
|
||||
while (v && *v && v[0][0] == '-' && v[0][2] == '\0')
|
||||
switch (v[0][1]) {
|
||||
@ -615,7 +617,7 @@ dosetty(v, t)
|
||||
z = QU_IO;
|
||||
break;
|
||||
default:
|
||||
stderror(ERR_NAME | ERR_SYSTEM, short2str(v[0]),
|
||||
stderror(ERR_NAME | ERR_SYSTEM, short2str(v[0]),
|
||||
CGETS(8, 1, "Unknown switch"));
|
||||
break;
|
||||
}
|
||||
@ -626,7 +628,7 @@ dosetty(v, t)
|
||||
int len = 0, st = 0, cu;
|
||||
for (m = modelist; m->m_name; m++) {
|
||||
if (m->m_type != i) {
|
||||
xprintf("%s%s", i != -1 ? "\n" : "",
|
||||
xprintf("%s%s", i != -1 ? "\n" : "",
|
||||
ttylist[z][m->m_type].t_name);
|
||||
i = m->m_type;
|
||||
st = len = strlen(ttylist[z][m->m_type].t_name);
|
||||
@ -637,7 +639,7 @@ dosetty(v, t)
|
||||
|
||||
if (x != '\0' || aflag) {
|
||||
cu = strlen(m->m_name) + (x != '\0') + 1;
|
||||
if (len + cu >= T_Cols) {
|
||||
if (len + cu >= TermH) {
|
||||
xprintf("\n%*s", st, "");
|
||||
len = st + cu;
|
||||
}
|
||||
@ -650,6 +652,7 @@ dosetty(v, t)
|
||||
}
|
||||
}
|
||||
xputchar('\n');
|
||||
cleanup_until(cmdname);
|
||||
return;
|
||||
}
|
||||
while (v && (s = *v++)) {
|
||||
@ -684,12 +687,11 @@ dosetty(v, t)
|
||||
break;
|
||||
}
|
||||
}
|
||||
cleanup_until(cmdname);
|
||||
} /* end dosetty */
|
||||
|
||||
int
|
||||
tty_getty(fd, td)
|
||||
int fd;
|
||||
ttydata_t *td;
|
||||
tty_getty(int fd, ttydata_t *td)
|
||||
{
|
||||
#ifdef POSIX
|
||||
RETRY(tcgetattr(fd, &td->d_t));
|
||||
@ -720,12 +722,10 @@ tty_getty(fd, td)
|
||||
}
|
||||
|
||||
int
|
||||
tty_setty(fd, td)
|
||||
int fd;
|
||||
ttydata_t *td;
|
||||
tty_setty(int fd, ttydata_t *td)
|
||||
{
|
||||
#ifdef POSIX
|
||||
RETRY(tcsetattr(fd, TCSADRAIN, &td->d_t));
|
||||
RETRY(xtcsetattr(fd, TCSADRAIN, &td->d_t));
|
||||
#else
|
||||
# ifdef TERMIO
|
||||
RETRY(ioctl(fd, TCSETAW, (ioctl_t) &td->d_t));
|
||||
@ -753,9 +753,7 @@ tty_setty(fd, td)
|
||||
}
|
||||
|
||||
void
|
||||
tty_getchar(td, s)
|
||||
ttydata_t *td;
|
||||
unsigned char *s;
|
||||
tty_getchar(ttydata_t *td, unsigned char *s)
|
||||
{
|
||||
#ifdef TIOCGLTC
|
||||
{
|
||||
@ -891,9 +889,7 @@ tty_getchar(td, s)
|
||||
|
||||
|
||||
void
|
||||
tty_setchar(td, s)
|
||||
ttydata_t *td;
|
||||
unsigned char *s;
|
||||
tty_setchar(ttydata_t *td, unsigned char *s)
|
||||
{
|
||||
#ifdef TIOCGLTC
|
||||
{
|
||||
@ -1030,8 +1026,7 @@ tty_setchar(td, s)
|
||||
} /* tty_setchar */
|
||||
|
||||
speed_t
|
||||
tty_getspeed(td)
|
||||
ttydata_t *td;
|
||||
tty_getspeed(ttydata_t *td)
|
||||
{
|
||||
speed_t spd;
|
||||
|
||||
@ -1054,8 +1049,7 @@ tty_getspeed(td)
|
||||
} /* end tty_getspeed */
|
||||
|
||||
int
|
||||
tty_gettabs(td)
|
||||
ttydata_t *td;
|
||||
tty_gettabs(ttydata_t *td)
|
||||
{
|
||||
#if defined(POSIX) || defined(TERMIO)
|
||||
return ((td->d_t.c_oflag & TAB3) == TAB3) ? 0 : 1;
|
||||
@ -1065,8 +1059,7 @@ tty_gettabs(td)
|
||||
} /* end tty_gettabs */
|
||||
|
||||
int
|
||||
tty_geteightbit(td)
|
||||
ttydata_t *td;
|
||||
tty_geteightbit(ttydata_t *td)
|
||||
{
|
||||
#if defined(POSIX) || defined(TERMIO)
|
||||
return (td->d_t.c_cflag & CSIZE) == CS8;
|
||||
@ -1076,8 +1069,7 @@ tty_geteightbit(td)
|
||||
} /* end tty_geteightbit */
|
||||
|
||||
int
|
||||
tty_cooked_mode(td)
|
||||
ttydata_t *td;
|
||||
tty_cooked_mode(ttydata_t *td)
|
||||
{
|
||||
#if defined(POSIX) || defined(TERMIO)
|
||||
return (td->d_t.c_lflag & ICANON);
|
||||
@ -1088,9 +1080,7 @@ tty_cooked_mode(td)
|
||||
|
||||
#ifdef _IBMR2
|
||||
void
|
||||
tty_setdisc(fd, dis)
|
||||
int fd;
|
||||
int dis;
|
||||
tty_setdisc(int fd, int dis)
|
||||
{
|
||||
static int edit_discipline = 0;
|
||||
static union txname tx_disc;
|
||||
@ -1124,8 +1114,7 @@ tty_setdisc(fd, dis)
|
||||
|
||||
#ifdef DEBUG_TTY
|
||||
static void
|
||||
tty_printchar(s)
|
||||
unsigned char *s;
|
||||
tty_printchar(unsigned char *s)
|
||||
{
|
||||
struct tcshmodes *m;
|
||||
int i;
|
||||
@ -1144,8 +1133,7 @@ tty_printchar(s)
|
||||
#endif /* DEBUG_TTY */
|
||||
#else /* WINNT_NATIVE */
|
||||
int
|
||||
tty_cooked_mode(td)
|
||||
void *td;
|
||||
tty_cooked_mode(void *td)
|
||||
{
|
||||
return do_nt_check_cooked_mode();
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Header: /src/pub/tcsh/ed.term.h,v 1.17 2004/12/25 21:15:06 christos Exp $ */
|
||||
/* $Header: /p/tcsh/cvsroot/tcsh/ed.term.h,v 1.17 2004/12/25 21:15:06 christos Exp $ */
|
||||
/*
|
||||
* ed.term.h: Local terminal header
|
||||
*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Header: /src/pub/tcsh/ed.xmap.c,v 3.28 2005/01/05 18:06:43 christos Exp $ */
|
||||
/* $Header: /p/tcsh/cvsroot/tcsh/ed.xmap.c,v 3.36 2006/11/29 22:30:09 christos Exp $ */
|
||||
/*
|
||||
* ed.xmap.c: This module contains the procedures for maintaining
|
||||
* the extended-key map.
|
||||
@ -88,7 +88,7 @@
|
||||
*/
|
||||
#include "sh.h"
|
||||
|
||||
RCSID("$Id: ed.xmap.c,v 3.28 2005/01/05 18:06:43 christos Exp $")
|
||||
RCSID("$tcsh: ed.xmap.c,v 3.36 2006/11/29 22:30:09 christos Exp $")
|
||||
|
||||
#include "ed.h"
|
||||
#include "ed.defns.h"
|
||||
@ -112,24 +112,22 @@ typedef struct Xmapnode {
|
||||
} XmapNode;
|
||||
|
||||
static XmapNode *Xmap = NULL; /* the current Xmap */
|
||||
#define MAXXKEY 100 /* max length of a Xkey for print putposes */
|
||||
static Char printbuf[MAXXKEY]; /* buffer for printing */
|
||||
|
||||
|
||||
/* Some declarations of procedures */
|
||||
static int TraverseMap __P((XmapNode *, CStr *, XmapVal *));
|
||||
static int TryNode __P((XmapNode *, CStr *, XmapVal *, int));
|
||||
static XmapNode *GetFreeNode __P((CStr *));
|
||||
static void PutFreeNode __P((XmapNode *));
|
||||
static int TryDeleteNode __P((XmapNode **, CStr *));
|
||||
static int Lookup __P((CStr *, XmapNode *, int));
|
||||
static int Enumerate __P((XmapNode *, int));
|
||||
static int unparsech __P((int, Char *));
|
||||
static int TraverseMap (XmapNode *, CStr *, XmapVal *);
|
||||
static int TryNode (XmapNode *, CStr *, XmapVal *, int);
|
||||
static XmapNode *GetFreeNode (CStr *);
|
||||
static void PutFreeNode (XmapNode *);
|
||||
static int TryDeleteNode (XmapNode **, CStr *);
|
||||
static int Lookup (struct Strbuf *, const CStr *,
|
||||
const XmapNode *);
|
||||
static void Enumerate (struct Strbuf *, const XmapNode *);
|
||||
static void unparsech (struct Strbuf *, Char);
|
||||
|
||||
|
||||
XmapVal *
|
||||
XmapCmd(cmd)
|
||||
int cmd;
|
||||
XmapCmd(int cmd)
|
||||
{
|
||||
static XmapVal xm;
|
||||
xm.cmd = (KEYCMD) cmd;
|
||||
@ -137,8 +135,7 @@ XmapCmd(cmd)
|
||||
}
|
||||
|
||||
XmapVal *
|
||||
XmapStr(str)
|
||||
CStr *str;
|
||||
XmapStr(CStr *str)
|
||||
{
|
||||
static XmapVal xm;
|
||||
xm.str.len = str->len;
|
||||
@ -151,7 +148,7 @@ XmapStr(str)
|
||||
* initializes Xmap with arrow keys
|
||||
*/
|
||||
void
|
||||
ResetXmap()
|
||||
ResetXmap(void)
|
||||
{
|
||||
PutFreeNode(Xmap);
|
||||
Xmap = NULL;
|
||||
@ -165,9 +162,7 @@ ResetXmap()
|
||||
* Calls the recursive function with entry point Xmap
|
||||
*/
|
||||
int
|
||||
GetXkey(ch, val)
|
||||
CStr *ch;
|
||||
XmapVal *val;
|
||||
GetXkey(CStr *ch, XmapVal *val)
|
||||
{
|
||||
return (TraverseMap(Xmap, ch, val));
|
||||
}
|
||||
@ -177,10 +172,7 @@ GetXkey(ch, val)
|
||||
* found. May read in more characters.
|
||||
*/
|
||||
static int
|
||||
TraverseMap(ptr, ch, val)
|
||||
XmapNode *ptr;
|
||||
CStr *ch;
|
||||
XmapVal *val;
|
||||
TraverseMap(XmapNode *ptr, CStr *ch, XmapVal *val)
|
||||
{
|
||||
Char tch;
|
||||
|
||||
@ -218,10 +210,7 @@ TraverseMap(ptr, ch, val)
|
||||
}
|
||||
|
||||
void
|
||||
AddXkey(Xkey, val, ntype)
|
||||
CStr *Xkey;
|
||||
XmapVal *val;
|
||||
int ntype;
|
||||
AddXkey(const CStr *Xkey, XmapVal *val, int ntype)
|
||||
{
|
||||
CStr cs;
|
||||
cs.buf = Xkey->buf;
|
||||
@ -246,11 +235,7 @@ AddXkey(Xkey, val, ntype)
|
||||
}
|
||||
|
||||
static int
|
||||
TryNode(ptr, str, val, ntype)
|
||||
XmapNode *ptr;
|
||||
CStr *str;
|
||||
XmapVal *val;
|
||||
int ntype;
|
||||
TryNode(XmapNode *ptr, CStr *str, XmapVal *val, int ntype)
|
||||
{
|
||||
/*
|
||||
* Find a node that matches *string or allocate a new one
|
||||
@ -269,6 +254,8 @@ TryNode(ptr, str, val, ntype)
|
||||
str->buf++;
|
||||
str->len--;
|
||||
if (str->len == 0) {
|
||||
size_t len;
|
||||
|
||||
/* we're there */
|
||||
if (ptr->next != NULL) {
|
||||
PutFreeNode(ptr->next); /* lose longer Xkeys with this prefix */
|
||||
@ -278,8 +265,7 @@ TryNode(ptr, str, val, ntype)
|
||||
switch (ptr->type) {
|
||||
case XK_STR:
|
||||
case XK_EXE:
|
||||
if (ptr->val.str.buf != NULL)
|
||||
xfree((ptr_t) ptr->val.str.buf);
|
||||
xfree(ptr->val.str.buf);
|
||||
ptr->val.str.len = 0;
|
||||
break;
|
||||
case XK_NOD:
|
||||
@ -296,11 +282,10 @@ TryNode(ptr, str, val, ntype)
|
||||
break;
|
||||
case XK_STR:
|
||||
case XK_EXE:
|
||||
ptr->val.str.len = (val->str.len + 1) * sizeof(Char);
|
||||
ptr->val.str.buf = (Char *) xmalloc((size_t) ptr->val.str.len);
|
||||
(void) memmove((ptr_t) ptr->val.str.buf, (ptr_t) val->str.buf,
|
||||
(size_t) ptr->val.str.len);
|
||||
ptr->val.str.len = val->str.len;
|
||||
len = (val->str.len + 1) * sizeof(*ptr->val.str.buf);
|
||||
ptr->val.str.buf = xmalloc(len);
|
||||
(void) memcpy(ptr->val.str.buf, val->str.buf, len);
|
||||
break;
|
||||
default:
|
||||
abort();
|
||||
@ -317,9 +302,7 @@ TryNode(ptr, str, val, ntype)
|
||||
}
|
||||
|
||||
void
|
||||
ClearXkey(map, in)
|
||||
KEYCMD *map;
|
||||
CStr *in;
|
||||
ClearXkey(KEYCMD *map, const CStr *in)
|
||||
{
|
||||
unsigned char c = (unsigned char) *(in->buf);
|
||||
if ((map[c] == F_XKEY) &&
|
||||
@ -329,10 +312,12 @@ ClearXkey(map, in)
|
||||
}
|
||||
|
||||
int
|
||||
DeleteXkey(Xkey)
|
||||
CStr *Xkey;
|
||||
DeleteXkey(const CStr *Xkey)
|
||||
{
|
||||
if (Xkey->len == 0) {
|
||||
CStr s;
|
||||
|
||||
s = *Xkey;
|
||||
if (s.len == 0) {
|
||||
xprintf(CGETS(9, 3, "DeleteXkey: Null extended-key not allowed.\n"));
|
||||
return (-1);
|
||||
}
|
||||
@ -340,17 +325,15 @@ DeleteXkey(Xkey)
|
||||
if (Xmap == NULL)
|
||||
return (0);
|
||||
|
||||
(void) TryDeleteNode(&Xmap, Xkey);
|
||||
(void) TryDeleteNode(&Xmap, &s);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* Destroys str */
|
||||
static int
|
||||
TryDeleteNode(inptr, str)
|
||||
XmapNode **inptr;
|
||||
CStr *str;
|
||||
TryDeleteNode(XmapNode **inptr, CStr *str)
|
||||
{
|
||||
XmapNode *ptr;
|
||||
XmapNode *prev_ptr = NULL;
|
||||
|
||||
ptr = *inptr;
|
||||
/*
|
||||
@ -364,7 +347,7 @@ TryDeleteNode(inptr, str)
|
||||
break;
|
||||
if (xm->sibling == NULL)
|
||||
return (0);
|
||||
prev_ptr = xm;
|
||||
inptr = &xm->sibling;
|
||||
ptr = xm->sibling;
|
||||
}
|
||||
|
||||
@ -373,10 +356,7 @@ TryDeleteNode(inptr, str)
|
||||
|
||||
if (str->len == 0) {
|
||||
/* we're there */
|
||||
if (prev_ptr == NULL)
|
||||
*inptr = ptr->sibling;
|
||||
else
|
||||
prev_ptr->sibling = ptr->sibling;
|
||||
*inptr = ptr->sibling;
|
||||
ptr->sibling = NULL;
|
||||
PutFreeNode(ptr);
|
||||
return (1);
|
||||
@ -384,10 +364,7 @@ TryDeleteNode(inptr, str)
|
||||
else if (ptr->next != NULL && TryDeleteNode(&ptr->next, str) == 1) {
|
||||
if (ptr->next != NULL)
|
||||
return (0);
|
||||
if (prev_ptr == NULL)
|
||||
*inptr = ptr->sibling;
|
||||
else
|
||||
prev_ptr->sibling = ptr->sibling;
|
||||
*inptr = ptr->sibling;
|
||||
ptr->sibling = NULL;
|
||||
PutFreeNode(ptr);
|
||||
return (1);
|
||||
@ -401,8 +378,7 @@ TryDeleteNode(inptr, str)
|
||||
* Puts a tree of nodes onto free list using free(3).
|
||||
*/
|
||||
static void
|
||||
PutFreeNode(ptr)
|
||||
XmapNode *ptr;
|
||||
PutFreeNode(XmapNode *ptr)
|
||||
{
|
||||
if (ptr == NULL)
|
||||
return;
|
||||
@ -420,14 +396,13 @@ PutFreeNode(ptr)
|
||||
break;
|
||||
case XK_EXE:
|
||||
case XK_STR:
|
||||
if (ptr->val.str.buf != NULL)
|
||||
xfree((ptr_t) ptr->val.str.buf);
|
||||
xfree(ptr->val.str.buf);
|
||||
break;
|
||||
default:
|
||||
abort();
|
||||
break;
|
||||
}
|
||||
xfree((ptr_t) ptr);
|
||||
xfree(ptr);
|
||||
}
|
||||
|
||||
|
||||
@ -435,12 +410,11 @@ PutFreeNode(ptr)
|
||||
* Returns pointer to an XmapNode for ch.
|
||||
*/
|
||||
static XmapNode *
|
||||
GetFreeNode(ch)
|
||||
CStr *ch;
|
||||
GetFreeNode(CStr *ch)
|
||||
{
|
||||
XmapNode *ptr;
|
||||
|
||||
ptr = (XmapNode *) xmalloc((size_t) sizeof(XmapNode));
|
||||
ptr = xmalloc(sizeof(XmapNode));
|
||||
ptr->ch = ch->buf[0];
|
||||
ptr->type = XK_NOD;
|
||||
ptr->val.str.buf = NULL;
|
||||
@ -456,9 +430,9 @@ GetFreeNode(ch)
|
||||
* Print entire Xmap if null
|
||||
*/
|
||||
void
|
||||
PrintXkey(key)
|
||||
CStr *key;
|
||||
PrintXkey(const CStr *key)
|
||||
{
|
||||
struct Strbuf buf = Strbuf_INIT;
|
||||
CStr cs;
|
||||
|
||||
if (key) {
|
||||
@ -473,11 +447,12 @@ PrintXkey(key)
|
||||
if (Xmap == NULL && cs.len == 0)
|
||||
return;
|
||||
|
||||
printbuf[0] = '"';
|
||||
if (Lookup(&cs, Xmap, 1) <= -1)
|
||||
Strbuf_append1(&buf, '"');
|
||||
cleanup_push(&buf, Strbuf_cleanup);
|
||||
if (Lookup(&buf, &cs, Xmap) <= -1)
|
||||
/* key is not bound */
|
||||
xprintf(CGETS(9, 4, "Unbound extended key \"%S\"\n"), cs.buf);
|
||||
return;
|
||||
cleanup_until(&buf);
|
||||
}
|
||||
|
||||
/* Lookup():
|
||||
@ -485,42 +460,34 @@ PrintXkey(key)
|
||||
* Print if last node
|
||||
*/
|
||||
static int
|
||||
Lookup(str, ptr, cnt)
|
||||
CStr *str;
|
||||
XmapNode *ptr;
|
||||
int cnt;
|
||||
Lookup(struct Strbuf *buf, const CStr *str, const XmapNode *ptr)
|
||||
{
|
||||
int ncnt;
|
||||
|
||||
if (ptr == NULL)
|
||||
return (-1); /* cannot have null ptr */
|
||||
|
||||
if (str->len == 0) {
|
||||
/* no more chars in string. Enumerate from here. */
|
||||
(void) Enumerate(ptr, cnt);
|
||||
Enumerate(buf, ptr);
|
||||
return (0);
|
||||
}
|
||||
else {
|
||||
/* If match put this char into printbuf. Recurse */
|
||||
/* If match put this char into buf. Recurse */
|
||||
if (ptr->ch == *(str->buf)) {
|
||||
/* match found */
|
||||
ncnt = unparsech(cnt, &ptr->ch);
|
||||
unparsech(buf, ptr->ch);
|
||||
if (ptr->next != NULL) {
|
||||
/* not yet at leaf */
|
||||
CStr tstr;
|
||||
tstr.buf = str->buf + 1;
|
||||
tstr.len = str->len - 1;
|
||||
return (Lookup(&tstr, ptr->next, ncnt + 1));
|
||||
return (Lookup(buf, &tstr, ptr->next));
|
||||
}
|
||||
else {
|
||||
/* next node is null so key should be complete */
|
||||
if (str->len == 1) {
|
||||
CStr pb;
|
||||
printbuf[ncnt + 1] = '"';
|
||||
printbuf[ncnt + 2] = '\0';
|
||||
pb.buf = printbuf;
|
||||
pb.len = ncnt + 2;
|
||||
(void) printOne(&pb, &ptr->val, ptr->type);
|
||||
Strbuf_append1(buf, '"');
|
||||
Strbuf_terminate(buf);
|
||||
printOne(buf->s, &ptr->val, ptr->type);
|
||||
return (0);
|
||||
}
|
||||
else
|
||||
@ -530,53 +497,41 @@ Lookup(str, ptr, cnt)
|
||||
else {
|
||||
/* no match found try sibling */
|
||||
if (ptr->sibling)
|
||||
return (Lookup(str, ptr->sibling, cnt));
|
||||
return (Lookup(buf, str, ptr->sibling));
|
||||
else
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
Enumerate(ptr, cnt)
|
||||
XmapNode *ptr;
|
||||
int cnt;
|
||||
static void
|
||||
Enumerate(struct Strbuf *buf, const XmapNode *ptr)
|
||||
{
|
||||
int ncnt;
|
||||
|
||||
if (cnt >= MAXXKEY - 5) { /* buffer too small */
|
||||
printbuf[++cnt] = '"';
|
||||
printbuf[++cnt] = '\0';
|
||||
xprintf(CGETS(9, 5,
|
||||
"Some extended keys too long for internal print buffer"));
|
||||
xprintf(" \"%S...\"\n", printbuf);
|
||||
return (0);
|
||||
}
|
||||
size_t old_len;
|
||||
|
||||
if (ptr == NULL) {
|
||||
#ifdef DEBUG_EDIT
|
||||
xprintf(CGETS(9, 6, "Enumerate: BUG!! Null ptr passed\n!"));
|
||||
#endif
|
||||
return (-1);
|
||||
return;
|
||||
}
|
||||
|
||||
ncnt = unparsech(cnt, &ptr->ch); /* put this char at end of string */
|
||||
old_len = buf->len;
|
||||
unparsech(buf, ptr->ch); /* put this char at end of string */
|
||||
if (ptr->next == NULL) {
|
||||
CStr pb;
|
||||
/* print this Xkey and function */
|
||||
printbuf[++ncnt] = '"';
|
||||
printbuf[++ncnt] = '\0';
|
||||
pb.buf = printbuf;
|
||||
pb.len = ncnt;
|
||||
(void) printOne(&pb, &ptr->val, ptr->type);
|
||||
Strbuf_append1(buf, '"');
|
||||
Strbuf_terminate(buf);
|
||||
printOne(buf->s, &ptr->val, ptr->type);
|
||||
}
|
||||
else
|
||||
(void) Enumerate(ptr->next, ncnt + 1);
|
||||
Enumerate(buf, ptr->next);
|
||||
|
||||
/* go to sibling if there is one */
|
||||
if (ptr->sibling)
|
||||
(void) Enumerate(ptr->sibling, cnt);
|
||||
return (0);
|
||||
if (ptr->sibling) {
|
||||
buf->len = old_len;
|
||||
Enumerate(buf, ptr->sibling);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -584,24 +539,25 @@ Enumerate(ptr, cnt)
|
||||
* Print the specified key and its associated
|
||||
* function specified by val
|
||||
*/
|
||||
int
|
||||
printOne(key, val, ntype)
|
||||
CStr *key;
|
||||
XmapVal *val;
|
||||
int ntype;
|
||||
void
|
||||
printOne(const Char *key, const XmapVal *val, int ntype)
|
||||
{
|
||||
struct KeyFuncs *fp;
|
||||
unsigned char unparsbuf[200];
|
||||
static const char *fmt = "%s\n";
|
||||
|
||||
xprintf("%-15S-> ", key->buf);
|
||||
xprintf("%-15S-> ", key);
|
||||
if (val != NULL)
|
||||
switch (ntype) {
|
||||
case XK_STR:
|
||||
case XK_EXE:
|
||||
xprintf(fmt, unparsestring(&val->str, unparsbuf,
|
||||
ntype == XK_STR ? STRQQ : STRBB));
|
||||
case XK_EXE: {
|
||||
unsigned char *p;
|
||||
|
||||
p = unparsestring(&val->str, ntype == XK_STR ? STRQQ : STRBB);
|
||||
cleanup_push(p, xfree);
|
||||
xprintf(fmt, p);
|
||||
cleanup_until(p);
|
||||
break;
|
||||
}
|
||||
case XK_CMD:
|
||||
for (fp = FuncNames; fp->name; fp++)
|
||||
if (val->cmd == fp->func)
|
||||
@ -612,72 +568,46 @@ printOne(key, val, ntype)
|
||||
break;
|
||||
}
|
||||
else
|
||||
xprintf(fmt, key, CGETS(9, 7, "no input"));
|
||||
return (0);
|
||||
xprintf(fmt, CGETS(9, 7, "no input"));
|
||||
}
|
||||
|
||||
static int
|
||||
unparsech(cnt, ch)
|
||||
int cnt;
|
||||
Char *ch;
|
||||
static void
|
||||
unparsech(struct Strbuf *buf, Char ch)
|
||||
{
|
||||
if (ch == 0) {
|
||||
printbuf[cnt++] = '^';
|
||||
printbuf[cnt] = '@';
|
||||
return cnt;
|
||||
Strbuf_append1(buf, '^');
|
||||
Strbuf_append1(buf, '@');
|
||||
}
|
||||
|
||||
if (Iscntrl(*ch)) {
|
||||
else if (Iscntrl(ch)) {
|
||||
Strbuf_append1(buf, '^');
|
||||
if (ch == CTL_ESC('\177'))
|
||||
Strbuf_append1(buf, '?');
|
||||
else
|
||||
#ifdef IS_ASCII
|
||||
printbuf[cnt++] = '^';
|
||||
if (*ch == CTL_ESC('\177'))
|
||||
printbuf[cnt] = '?';
|
||||
else
|
||||
printbuf[cnt] = *ch | 0100;
|
||||
Strbuf_append1(buf, ch | 0100);
|
||||
#else
|
||||
if (*ch == CTL_ESC('\177'))
|
||||
{
|
||||
printbuf[cnt++] = '^';
|
||||
printbuf[cnt] = '?';
|
||||
}
|
||||
else if (Isupper(_toebcdic[_toascii[*ch]|0100])
|
||||
|| strchr("@[\\]^_", _toebcdic[_toascii[*ch]|0100]) != NULL)
|
||||
{
|
||||
printbuf[cnt++] = '^';
|
||||
printbuf[cnt] = _toebcdic[_toascii[*ch]|0100];
|
||||
}
|
||||
else
|
||||
{
|
||||
printbuf[cnt++] = '\\';
|
||||
printbuf[cnt++] = ((*ch >> 6) & 7) + '0';
|
||||
printbuf[cnt++] = ((*ch >> 3) & 7) + '0';
|
||||
printbuf[cnt] = (*ch & 7) + '0';
|
||||
}
|
||||
Strbuf_append1(buf, _toebcdic[_toascii[ch]|0100]);
|
||||
#endif
|
||||
}
|
||||
else if (*ch == '^') {
|
||||
printbuf[cnt++] = '\\';
|
||||
printbuf[cnt] = '^';
|
||||
}
|
||||
else if (*ch == '\\') {
|
||||
printbuf[cnt++] = '\\';
|
||||
printbuf[cnt] = '\\';
|
||||
}
|
||||
else if (*ch == ' ' || (Isprint(*ch) && !Isspace(*ch))) {
|
||||
printbuf[cnt] = *ch;
|
||||
else if (ch == '^') {
|
||||
Strbuf_append1(buf, '\\');
|
||||
Strbuf_append1(buf, '^');
|
||||
} else if (ch == '\\') {
|
||||
Strbuf_append1(buf, '\\');
|
||||
Strbuf_append1(buf, '\\');
|
||||
} else if (ch == ' ' || (Isprint(ch) && !Isspace(ch))) {
|
||||
Strbuf_append1(buf, ch);
|
||||
}
|
||||
else {
|
||||
printbuf[cnt++] = '\\';
|
||||
printbuf[cnt++] = ((*ch >> 6) & 7) + '0';
|
||||
printbuf[cnt++] = ((*ch >> 3) & 7) + '0';
|
||||
printbuf[cnt] = (*ch & 7) + '0';
|
||||
Strbuf_append1(buf, '\\');
|
||||
Strbuf_append1(buf, ((ch >> 6) & 7) + '0');
|
||||
Strbuf_append1(buf, ((ch >> 3) & 7) + '0');
|
||||
Strbuf_append1(buf, (ch & 7) + '0');
|
||||
}
|
||||
return cnt;
|
||||
}
|
||||
|
||||
eChar
|
||||
parseescape(ptr)
|
||||
const Char **ptr;
|
||||
parseescape(const Char **ptr)
|
||||
{
|
||||
const Char *p;
|
||||
Char c;
|
||||
@ -685,7 +615,7 @@ parseescape(ptr)
|
||||
p = *ptr;
|
||||
|
||||
if ((p[1] & CHAR) == 0) {
|
||||
xprintf(CGETS(9, 8, "Something must follow: %c\n"), *p);
|
||||
xprintf(CGETS(9, 8, "Something must follow: %c\n"), (char)*p);
|
||||
return CHAR_ERR;
|
||||
}
|
||||
if ((*p & CHAR) == '\\') {
|
||||
@ -738,7 +668,7 @@ parseescape(ptr)
|
||||
}
|
||||
val = (val << 3) | (ch - '0');
|
||||
}
|
||||
if ((val & 0xffffff00) != 0) {
|
||||
if ((val & ~0xff) != 0) {
|
||||
xprintf(CGETS(9, 9,
|
||||
"Octal constant does not fit in a char.\n"));
|
||||
return 0;
|
||||
@ -777,15 +707,14 @@ parseescape(ptr)
|
||||
|
||||
|
||||
unsigned char *
|
||||
unparsestring(str, buf, sep)
|
||||
CStr *str;
|
||||
unsigned char *buf;
|
||||
Char *sep;
|
||||
unparsestring(const CStr *str, const Char *sep)
|
||||
{
|
||||
unsigned char *b;
|
||||
unsigned char *buf, *b;
|
||||
Char p;
|
||||
int l;
|
||||
|
||||
/* Worst-case is "\uuu" or result of wctomb() for each char from str */
|
||||
buf = xmalloc((str->len + 1) * max(4, MB_LEN_MAX));
|
||||
b = buf;
|
||||
if (sep[0])
|
||||
#ifndef WINNT_NATIVE
|
||||
@ -797,26 +726,14 @@ unparsestring(str, buf, sep)
|
||||
for (l = 0; l < str->len; l++) {
|
||||
p = str->buf[l];
|
||||
if (Iscntrl(p)) {
|
||||
#ifdef IS_ASCII
|
||||
*b++ = '^';
|
||||
if (p == CTL_ESC('\177'))
|
||||
*b++ = '?';
|
||||
else
|
||||
#ifdef IS_ASCII
|
||||
*b++ = (unsigned char) (p | 0100);
|
||||
#else
|
||||
if (_toascii[p] == '\177' || Isupper(_toebcdic[_toascii[p]|0100])
|
||||
|| strchr("@[\\]^_", _toebcdic[_toascii[p]|0100]) != NULL)
|
||||
{
|
||||
*b++ = '^';
|
||||
*b++ = (_toascii[p] == '\177') ? '?' : _toebcdic[_toascii[p]|0100];
|
||||
}
|
||||
else
|
||||
{
|
||||
*b++ = '\\';
|
||||
*b++ = ((p >> 6) & 7) + '0';
|
||||
*b++ = ((p >> 3) & 7) + '0';
|
||||
*b++ = (p & 7) + '0';
|
||||
}
|
||||
*b++ = _toebcdic[_toascii[p]|0100];
|
||||
#endif
|
||||
}
|
||||
else if (p == '^' || p == '\\') {
|
||||
|
@ -1,4 +1,4 @@
|
||||
.\" $Id: eight-bit.me,v 3.1 1991/09/12 09:25:57 christos Exp $
|
||||
.\" $tcsh: eight-bit.me,v 3.2 2006/03/02 18:46:44 christos Exp $
|
||||
How to use 8 bit characters
|
||||
by
|
||||
Johan Widen
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Header: /src/pub/tcsh/gethost.c,v 1.10 2005/01/05 16:06:13 christos Exp $ */
|
||||
/* $Header: /p/tcsh/cvsroot/tcsh/gethost.c,v 1.12 2006/03/02 18:46:44 christos Exp $ */
|
||||
/*
|
||||
* gethost.c: Create version file from prototype
|
||||
*/
|
||||
@ -32,7 +32,7 @@
|
||||
*/
|
||||
#include "sh.h"
|
||||
|
||||
RCSID("$Id: gethost.c,v 1.10 2005/01/05 16:06:13 christos Exp $")
|
||||
RCSID("$tcsh: gethost.c,v 1.12 2006/03/02 18:46:44 christos Exp $")
|
||||
|
||||
#ifdef SCO
|
||||
# define perror __perror
|
||||
@ -89,17 +89,16 @@ static const char *keyword[] =
|
||||
#define S_CODE 2
|
||||
#define S_KEYWORD 3
|
||||
|
||||
static int findtoken __P((char *));
|
||||
static char *gettoken __P((char **, char *));
|
||||
static int findtoken (char *);
|
||||
static char *gettoken (char **, char *);
|
||||
|
||||
int main __P((int, char *[]));
|
||||
int main (int, char *[]);
|
||||
|
||||
/* findtoken():
|
||||
* Return the token number of the given token
|
||||
*/
|
||||
static int
|
||||
findtoken(ptr)
|
||||
char *ptr;
|
||||
findtoken(char *ptr)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -118,9 +117,7 @@ findtoken(ptr)
|
||||
* Get : delimited token and remove leading/trailing blanks/newlines
|
||||
*/
|
||||
static char *
|
||||
gettoken(pptr, token)
|
||||
char **pptr;
|
||||
char *token;
|
||||
gettoken(char **pptr, char *token)
|
||||
{
|
||||
char *ptr = *pptr;
|
||||
char *tok = token;
|
||||
@ -147,9 +144,7 @@ gettoken(pptr, token)
|
||||
|
||||
|
||||
int
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
char line[INBUFSIZE];
|
||||
char *pname;
|
||||
|
@ -63,7 +63,6 @@ static char sccsid[] = "@(#)glob.c 5.12 (Berkeley) 6/24/91";
|
||||
#undef QUOTE
|
||||
#undef TILDE
|
||||
#undef META
|
||||
#undef CHAR
|
||||
#undef ismeta
|
||||
#undef Strchr
|
||||
|
||||
@ -81,23 +80,22 @@ static char sccsid[] = "@(#)glob.c 5.12 (Berkeley) 6/24/91";
|
||||
|
||||
typedef unsigned short Char;
|
||||
|
||||
static int glob1 __P((Char *, glob_t *, int));
|
||||
static int glob2 __P((Char *, Char *, Char *, glob_t *, int));
|
||||
static int glob3 __P((Char *, Char *, Char *, Char *,
|
||||
glob_t *, int));
|
||||
static int globextend __P((Char *, glob_t *));
|
||||
static int match __P((Char *, Char *, Char *, int));
|
||||
#ifndef __clipper__
|
||||
static int compare __P((const ptr_t, const ptr_t));
|
||||
#endif
|
||||
static DIR *Opendir __P((Char *));
|
||||
static int glob1 (Char *, glob_t *, int);
|
||||
static int glob2 (struct strbuf *, const Char *, glob_t *, int);
|
||||
static int glob3 (struct strbuf *, const Char *, const Char *,
|
||||
glob_t *, int);
|
||||
static void globextend (const char *, glob_t *);
|
||||
static int match (const char *, const Char *, const Char *,
|
||||
int);
|
||||
static int compare (const void *, const void *);
|
||||
static DIR *Opendir (const char *);
|
||||
#ifdef S_IFLNK
|
||||
static int Lstat __P((Char *, struct stat *));
|
||||
static int Lstat (const char *, struct stat *);
|
||||
#endif
|
||||
static int Stat __P((Char *, struct stat *sb));
|
||||
static Char *Strchr __P((Char *, int));
|
||||
static int Stat (const char *, struct stat *sb);
|
||||
static Char *Strchr (Char *, int);
|
||||
#ifdef DEBUG
|
||||
static void qprintf __P((Char *));
|
||||
static void qprintf (const Char *);
|
||||
#endif
|
||||
|
||||
#define DOLLAR '$'
|
||||
@ -120,7 +118,7 @@ static void qprintf __P((Char *));
|
||||
#define M_MASK 0xffff
|
||||
#define M_ASCII 0x00ff
|
||||
|
||||
#define CHAR(c) ((c)&M_ASCII)
|
||||
#define LCHAR(c) ((c)&M_ASCII)
|
||||
#define META(c) ((c)|M_META)
|
||||
#define M_ALL META('*')
|
||||
#define M_END META(']')
|
||||
@ -131,19 +129,11 @@ static void qprintf __P((Char *));
|
||||
#define M_SET META('[')
|
||||
#define ismeta(c) (((c)&M_META) != 0)
|
||||
|
||||
#ifndef BUFSIZE
|
||||
#define GLOBBUFLEN MAXPATHLEN
|
||||
#else
|
||||
#define GLOBBUFLEN BUFSIZE
|
||||
#endif
|
||||
|
||||
int
|
||||
globcharcoll(c1, c2, cs)
|
||||
NLSChar c1, c2;
|
||||
int cs;
|
||||
globcharcoll(__Char c1, __Char c2, int cs)
|
||||
{
|
||||
#if defined(NLS) && defined(LC_COLLATE) && !defined(NOSTRCOLL)
|
||||
# if defined(SHORT_STRINGS)
|
||||
#if defined(NLS) && defined(LC_COLLATE) && defined(HAVE_STRCOLL)
|
||||
# if defined(WIDE_STRINGS)
|
||||
wchar_t s1[2], s2[2];
|
||||
|
||||
if (c1 == c2)
|
||||
@ -163,7 +153,7 @@ globcharcoll(c1, c2, cs)
|
||||
s2[0] = c2;
|
||||
s1[1] = s2[1] = '\0';
|
||||
return wcscoll(s1, s2);
|
||||
# else /* not SHORT_STRINGS */
|
||||
# else /* not WIDE_STRINGS */
|
||||
char s1[2], s2[2];
|
||||
|
||||
if (c1 == c2)
|
||||
@ -199,85 +189,56 @@ globcharcoll(c1, c2, cs)
|
||||
*/
|
||||
|
||||
static DIR *
|
||||
Opendir(str)
|
||||
Char *str;
|
||||
Opendir(const char *str)
|
||||
{
|
||||
char buf[GLOBBUFLEN];
|
||||
char *dc = buf;
|
||||
#if defined(hpux) || defined(__hpux)
|
||||
struct stat st;
|
||||
#endif
|
||||
|
||||
if (!*str)
|
||||
return (opendir("."));
|
||||
while ((*dc++ = *str++) != '\0')
|
||||
continue;
|
||||
#if defined(hpux) || defined(__hpux)
|
||||
/*
|
||||
* Opendir on some device files hangs, so avoid it
|
||||
*/
|
||||
if (stat(buf, &st) == -1 || !S_ISDIR(st.st_mode))
|
||||
if (stat(str, &st) == -1 || !S_ISDIR(st.st_mode))
|
||||
return NULL;
|
||||
#endif
|
||||
return (opendir(buf));
|
||||
return opendir(str);
|
||||
}
|
||||
|
||||
#ifdef S_IFLNK
|
||||
static int
|
||||
Lstat(fn, sb)
|
||||
Char *fn;
|
||||
struct stat *sb;
|
||||
Lstat(const char *fn, struct stat *sb)
|
||||
{
|
||||
char buf[GLOBBUFLEN];
|
||||
char *dc = buf;
|
||||
int st;
|
||||
|
||||
while ((*dc++ = *fn++) != '\0')
|
||||
continue;
|
||||
st = lstat(fn, sb);
|
||||
# ifdef NAMEI_BUG
|
||||
{
|
||||
int st;
|
||||
|
||||
st = lstat(buf, sb);
|
||||
if (*buf)
|
||||
dc--;
|
||||
return (*--dc == '/' && !S_ISDIR(sb->st_mode) ? -1 : st);
|
||||
}
|
||||
# else
|
||||
return (lstat(buf, sb));
|
||||
if (*fn != 0 && strend(fn)[-1] == '/' && !S_ISDIR(sb->st_mode))
|
||||
st = -1;
|
||||
# endif /* NAMEI_BUG */
|
||||
return st;
|
||||
}
|
||||
#else
|
||||
#define Lstat Stat
|
||||
#endif /* S_IFLNK */
|
||||
|
||||
static int
|
||||
Stat(fn, sb)
|
||||
Char *fn;
|
||||
struct stat *sb;
|
||||
Stat(const char *fn, struct stat *sb)
|
||||
{
|
||||
char buf[GLOBBUFLEN];
|
||||
char *dc = buf;
|
||||
int st;
|
||||
|
||||
while ((*dc++ = *fn++) != '\0')
|
||||
continue;
|
||||
st = stat(fn, sb);
|
||||
#ifdef NAMEI_BUG
|
||||
{
|
||||
int st;
|
||||
|
||||
st = stat(buf, sb);
|
||||
if (*buf)
|
||||
dc--;
|
||||
return (*--dc == '/' && !S_ISDIR(sb->st_mode) ? -1 : st);
|
||||
}
|
||||
#else
|
||||
return (stat(buf, sb));
|
||||
if (*fn != 0 && strend(fn)[-1] == '/' && !S_ISDIR(sb->st_mode))
|
||||
st = -1;
|
||||
#endif /* NAMEI_BUG */
|
||||
return st;
|
||||
}
|
||||
|
||||
static Char *
|
||||
Strchr(str, ch)
|
||||
Char *str;
|
||||
int ch;
|
||||
Strchr(Char *str, int ch)
|
||||
{
|
||||
do
|
||||
if (*str == ch)
|
||||
@ -288,10 +249,9 @@ Strchr(str, ch)
|
||||
|
||||
#ifdef DEBUG
|
||||
static void
|
||||
qprintf(s)
|
||||
Char *s;
|
||||
qprintf(const Char *s)
|
||||
{
|
||||
Char *p;
|
||||
const Char *p;
|
||||
|
||||
for (p = s; *p; p++)
|
||||
printf("%c", *p & 0xff);
|
||||
@ -306,16 +266,13 @@ Char *s;
|
||||
#endif /* DEBUG */
|
||||
|
||||
static int
|
||||
compare(p, q)
|
||||
const ptr_t p, q;
|
||||
compare(const void *p, const void *q)
|
||||
{
|
||||
#if defined(NLS) && !defined(NOSTRCOLL)
|
||||
errno = 0; /* strcoll sets errno, another brain-damage */
|
||||
|
||||
return (strcoll(*(char **) p, *(char **) q));
|
||||
#if defined(NLS) && defined(HAVE_STRCOLL)
|
||||
return (strcoll(*(char *const *) p, *(char *const *) q));
|
||||
#else
|
||||
return (strcmp(*(char **) p, *(char **) q));
|
||||
#endif /* NLS && !NOSTRCOLL */
|
||||
return (strcmp(*(char *const *) p, *(char *const *) q));
|
||||
#endif /* NLS && HAVE_STRCOLL */
|
||||
}
|
||||
|
||||
/*
|
||||
@ -326,22 +283,14 @@ compare(p, q)
|
||||
* to find no matches.
|
||||
*/
|
||||
int
|
||||
glob(pattern, flags, errfunc, pglob)
|
||||
const char *pattern;
|
||||
int flags;
|
||||
int (*errfunc) __P((const char *, int));
|
||||
glob_t *pglob;
|
||||
glob(const char *pattern, int flags, int (*errfunc) (const char *, int),
|
||||
glob_t *pglob)
|
||||
{
|
||||
int err, oldpathc;
|
||||
Char *bufnext, *bufend, *compilebuf, m_not;
|
||||
const unsigned char *compilepat, *patnext;
|
||||
Char *bufnext, m_not;
|
||||
const unsigned char *patnext;
|
||||
int c, not;
|
||||
Char *qpatnext;
|
||||
#ifdef WIDE_STRINGS
|
||||
Char patbuf[GLOBBUFLEN + MB_LEN_MAX + 1];
|
||||
#else
|
||||
Char patbuf[GLOBBUFLEN + 1];
|
||||
#endif
|
||||
Char *qpatnext, *patbuf;
|
||||
int no_match;
|
||||
|
||||
patnext = (const unsigned char *) pattern;
|
||||
@ -365,10 +314,8 @@ glob(pattern, flags, errfunc, pglob)
|
||||
m_not = M_NOT;
|
||||
}
|
||||
|
||||
patbuf = xmalloc((strlen(pattern) + 1) * sizeof(*patbuf));
|
||||
bufnext = patbuf;
|
||||
bufend = bufnext + GLOBBUFLEN;
|
||||
compilebuf = bufnext;
|
||||
compilepat = patnext;
|
||||
|
||||
no_match = *patnext == not;
|
||||
if (no_match)
|
||||
@ -376,7 +323,7 @@ glob(pattern, flags, errfunc, pglob)
|
||||
|
||||
if (flags & GLOB_QUOTE) {
|
||||
/* Protect the quoted characters */
|
||||
while (bufnext < bufend && (c = *patnext++) != EOS) {
|
||||
while ((c = *patnext++) != EOS) {
|
||||
#ifdef WIDE_STRINGS
|
||||
int len;
|
||||
|
||||
@ -400,14 +347,13 @@ glob(pattern, flags, errfunc, pglob)
|
||||
*bufnext++ = (Char) c;
|
||||
}
|
||||
}
|
||||
else
|
||||
while (bufnext < bufend && (c = *patnext++) != EOS)
|
||||
else
|
||||
while ((c = *patnext++) != EOS)
|
||||
*bufnext++ = (Char) c;
|
||||
*bufnext = EOS;
|
||||
|
||||
bufnext = patbuf;
|
||||
qpatnext = patbuf;
|
||||
/* we don't need to check for buffer overflow any more */
|
||||
while ((c = *qpatnext++) != EOS) {
|
||||
switch (c) {
|
||||
case LBRACKET:
|
||||
@ -427,11 +373,11 @@ glob(pattern, flags, errfunc, pglob)
|
||||
*bufnext++ = m_not;
|
||||
c = *qpatnext++;
|
||||
do {
|
||||
*bufnext++ = CHAR(c);
|
||||
*bufnext++ = LCHAR(c);
|
||||
if (*qpatnext == RANGE &&
|
||||
(c = qpatnext[1]) != RBRACKET) {
|
||||
*bufnext++ = M_RNG;
|
||||
*bufnext++ = CHAR(c);
|
||||
*bufnext++ = LCHAR(c);
|
||||
qpatnext += 2;
|
||||
}
|
||||
} while ((c = *qpatnext++) != RBRACKET);
|
||||
@ -450,7 +396,7 @@ glob(pattern, flags, errfunc, pglob)
|
||||
*bufnext++ = M_ALL;
|
||||
break;
|
||||
default:
|
||||
*bufnext++ = CHAR(c);
|
||||
*bufnext++ = LCHAR(c);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -459,8 +405,10 @@ glob(pattern, flags, errfunc, pglob)
|
||||
qprintf(patbuf);
|
||||
#endif
|
||||
|
||||
if ((err = glob1(patbuf, pglob, no_match)) != 0)
|
||||
if ((err = glob1(patbuf, pglob, no_match)) != 0) {
|
||||
xfree(patbuf);
|
||||
return (err);
|
||||
}
|
||||
|
||||
/*
|
||||
* If there was no match we are going to append the pattern
|
||||
@ -471,50 +419,51 @@ glob(pattern, flags, errfunc, pglob)
|
||||
if (pglob->gl_pathc == oldpathc &&
|
||||
((flags & GLOB_NOCHECK) ||
|
||||
((flags & GLOB_NOMAGIC) && !(pglob->gl_flags & GLOB_MAGCHAR)))) {
|
||||
if (!(flags & GLOB_QUOTE)) {
|
||||
Char *dp = compilebuf;
|
||||
const unsigned char *sp = compilepat;
|
||||
|
||||
while ((*dp++ = *sp++) != '\0')
|
||||
continue;
|
||||
}
|
||||
if (!(flags & GLOB_QUOTE))
|
||||
globextend(pattern, pglob);
|
||||
else {
|
||||
/*
|
||||
* copy pattern, interpreting quotes; this is slightly different
|
||||
* than the interpretation of quotes above -- which should prevail?
|
||||
*/
|
||||
while (*compilepat != EOS) {
|
||||
if (*compilepat == QUOTE) {
|
||||
if (*++compilepat == EOS)
|
||||
--compilepat;
|
||||
char *copy, *dest;
|
||||
const char *src;
|
||||
|
||||
/* copy pattern, interpreting quotes */
|
||||
copy = xmalloc(strlen(pattern) + 1);
|
||||
dest = copy;
|
||||
src = pattern;
|
||||
while (*src != EOS) {
|
||||
if (*src == QUOTE) {
|
||||
if (*++src == EOS)
|
||||
--src;
|
||||
}
|
||||
*compilebuf++ = (unsigned char) *compilepat++;
|
||||
*dest++ = *src++;
|
||||
}
|
||||
*compilebuf = EOS;
|
||||
*dest = EOS;
|
||||
globextend(copy, pglob);
|
||||
xfree(copy);
|
||||
}
|
||||
return (globextend(patbuf, pglob));
|
||||
xfree(patbuf);
|
||||
return 0;
|
||||
}
|
||||
else if (!(flags & GLOB_NOSORT) && (pglob->gl_pathc != oldpathc))
|
||||
qsort((char *) (pglob->gl_pathv + pglob->gl_offs + oldpathc),
|
||||
pglob->gl_pathc - oldpathc, sizeof(char *),
|
||||
(int (*) __P((const void *, const void *))) compare);
|
||||
qsort(pglob->gl_pathv + pglob->gl_offs + oldpathc,
|
||||
pglob->gl_pathc - oldpathc, sizeof(char *), compare);
|
||||
xfree(patbuf);
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
glob1(pattern, pglob, no_match)
|
||||
Char *pattern;
|
||||
glob_t *pglob;
|
||||
int no_match;
|
||||
glob1(Char *pattern, glob_t *pglob, int no_match)
|
||||
{
|
||||
Char pathbuf[GLOBBUFLEN + 1];
|
||||
struct strbuf pathbuf = strbuf_INIT;
|
||||
int err;
|
||||
|
||||
/*
|
||||
* a null pathname is invalid -- POSIX 1003.1 sect. 2.4.
|
||||
*/
|
||||
if (*pattern == EOS)
|
||||
return (0);
|
||||
return (glob2(pathbuf, pathbuf, pattern, pglob, no_match));
|
||||
err = glob2(&pathbuf, pattern, pglob, no_match);
|
||||
xfree(pathbuf.s);
|
||||
return err;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -523,14 +472,12 @@ glob1(pattern, pglob, no_match)
|
||||
* more meta characters.
|
||||
*/
|
||||
static int
|
||||
glob2(pathbuf, pathend, pattern, pglob, no_match)
|
||||
Char *pathbuf, *pathend, *pattern;
|
||||
glob_t *pglob;
|
||||
int no_match;
|
||||
glob2(struct strbuf *pathbuf, const Char *pattern, glob_t *pglob, int no_match)
|
||||
{
|
||||
struct stat sbuf;
|
||||
int anymeta;
|
||||
Char *p, *q;
|
||||
const Char *p;
|
||||
size_t orig_len;
|
||||
|
||||
/*
|
||||
* loop over pattern segments until end of pattern or until segment with
|
||||
@ -539,69 +486,67 @@ glob2(pathbuf, pathend, pattern, pglob, no_match)
|
||||
anymeta = 0;
|
||||
for (;;) {
|
||||
if (*pattern == EOS) { /* end of pattern? */
|
||||
*pathend = EOS;
|
||||
strbuf_terminate(pathbuf);
|
||||
|
||||
if (Lstat(pathbuf, &sbuf))
|
||||
if (Lstat(pathbuf->s, &sbuf))
|
||||
return (0);
|
||||
|
||||
if (((pglob->gl_flags & GLOB_MARK) &&
|
||||
pathend[-1] != SEP) &&
|
||||
pathbuf->s[pathbuf->len - 1] != SEP) &&
|
||||
(S_ISDIR(sbuf.st_mode)
|
||||
#ifdef S_IFLNK
|
||||
|| (S_ISLNK(sbuf.st_mode) &&
|
||||
(Stat(pathbuf, &sbuf) == 0) &&
|
||||
(Stat(pathbuf->s, &sbuf) == 0) &&
|
||||
S_ISDIR(sbuf.st_mode))
|
||||
#endif
|
||||
)) {
|
||||
*pathend++ = SEP;
|
||||
*pathend = EOS;
|
||||
strbuf_append1(pathbuf, SEP);
|
||||
strbuf_terminate(pathbuf);
|
||||
}
|
||||
++pglob->gl_matchc;
|
||||
return (globextend(pathbuf, pglob));
|
||||
globextend(pathbuf->s, pglob);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* find end of next segment, copy tentatively to pathend */
|
||||
q = pathend;
|
||||
/* find end of next segment, tentatively copy to pathbuf */
|
||||
p = pattern;
|
||||
orig_len = pathbuf->len;
|
||||
while (*p != EOS && *p != SEP) {
|
||||
if (ismeta(*p))
|
||||
anymeta = 1;
|
||||
*q++ = *p++;
|
||||
strbuf_append1(pathbuf, *p++);
|
||||
}
|
||||
|
||||
if (!anymeta) { /* no expansion, do next segment */
|
||||
pathend = q;
|
||||
pattern = p;
|
||||
while (*pattern == SEP)
|
||||
*pathend++ = *pattern++;
|
||||
strbuf_append1(pathbuf, *pattern++);
|
||||
}
|
||||
else { /* need expansion, recurse */
|
||||
pathbuf->len = orig_len;
|
||||
return (glob3(pathbuf, pattern, p, pglob, no_match));
|
||||
}
|
||||
else /* need expansion, recurse */
|
||||
return (glob3(pathbuf, pathend, pattern, p, pglob, no_match));
|
||||
}
|
||||
/* NOTREACHED */
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
glob3(pathbuf, pathend, pattern, restpattern, pglob, no_match)
|
||||
Char *pathbuf, *pathend, *pattern, *restpattern;
|
||||
glob_t *pglob;
|
||||
int no_match;
|
||||
glob3(struct strbuf *pathbuf, const Char *pattern, const Char *restpattern,
|
||||
glob_t *pglob, int no_match)
|
||||
{
|
||||
DIR *dirp;
|
||||
struct dirent *dp;
|
||||
int err;
|
||||
Char m_not = (pglob->gl_flags & GLOB_ALTNOT) ? M_ALTNOT : M_NOT;
|
||||
char cpathbuf[GLOBBUFLEN], *ptr;;
|
||||
size_t orig_len;
|
||||
|
||||
*pathend = EOS;
|
||||
strbuf_terminate(pathbuf);
|
||||
errno = 0;
|
||||
|
||||
if (!(dirp = Opendir(pathbuf))) {
|
||||
if (!(dirp = Opendir(pathbuf->s))) {
|
||||
/* todo: don't call for ENOENT or ENOTDIR? */
|
||||
for (ptr = cpathbuf; (*ptr++ = (char) *pathbuf++) != EOS;)
|
||||
continue;
|
||||
if ((pglob->gl_errfunc && (*pglob->gl_errfunc) (cpathbuf, errno)) ||
|
||||
if ((pglob->gl_errfunc && (*pglob->gl_errfunc) (pathbuf->s, errno)) ||
|
||||
(pglob->gl_flags & GLOB_ERR))
|
||||
return (GLOB_ABEND);
|
||||
else
|
||||
@ -610,27 +555,24 @@ glob3(pathbuf, pathend, pattern, restpattern, pglob, no_match)
|
||||
|
||||
err = 0;
|
||||
|
||||
orig_len = pathbuf->len;
|
||||
/* search directory for matching names */
|
||||
while ((dp = readdir(dirp)) != NULL) {
|
||||
unsigned char *sc;
|
||||
Char *dc;
|
||||
|
||||
/* initial DOT must be matched literally */
|
||||
if (dp->d_name[0] == DOT && *pattern != DOT)
|
||||
continue;
|
||||
for (sc = (unsigned char *) dp->d_name, dc = pathend;
|
||||
(*dc++ = *sc++) != '\0';)
|
||||
pathbuf->len = orig_len;
|
||||
strbuf_append(pathbuf, dp->d_name);
|
||||
strbuf_terminate(pathbuf);
|
||||
if (match(pathbuf->s + orig_len, pattern, restpattern, (int) m_not)
|
||||
== no_match)
|
||||
continue;
|
||||
if (match(pathend, pattern, restpattern, (int) m_not) == no_match) {
|
||||
*pathend = EOS;
|
||||
continue;
|
||||
}
|
||||
err = glob2(pathbuf, --dc, restpattern, pglob, no_match);
|
||||
err = glob2(pathbuf, restpattern, pglob, no_match);
|
||||
if (err)
|
||||
break;
|
||||
}
|
||||
/* todo: check error from readdir? */
|
||||
(void) closedir(dirp);
|
||||
closedir(dirp);
|
||||
return (err);
|
||||
}
|
||||
|
||||
@ -649,23 +591,15 @@ glob3(pathbuf, pathend, pattern, restpattern, pglob, no_match)
|
||||
* Either gl_pathc is zero and gl_pathv is NULL; or gl_pathc > 0 and
|
||||
* gl_pathv points to (gl_offs + gl_pathc + 1) items.
|
||||
*/
|
||||
static int
|
||||
globextend(path, pglob)
|
||||
Char *path;
|
||||
glob_t *pglob;
|
||||
static void
|
||||
globextend(const char *path, glob_t *pglob)
|
||||
{
|
||||
char **pathv;
|
||||
int i;
|
||||
unsigned int newsize;
|
||||
char *copy;
|
||||
Char *p;
|
||||
size_t newsize;
|
||||
|
||||
newsize = sizeof(*pathv) * (2 + pglob->gl_pathc + pglob->gl_offs);
|
||||
pathv = (char **) (pglob->gl_pathv ?
|
||||
xrealloc((ptr_t) pglob->gl_pathv, (size_t) newsize) :
|
||||
xmalloc((size_t) newsize));
|
||||
if (pathv == NULL)
|
||||
return (GLOB_NOSPACE);
|
||||
pathv = xrealloc(pglob->gl_pathv, newsize);
|
||||
|
||||
if (pglob->gl_pathv == NULL && pglob->gl_offs > 0) {
|
||||
/* first time around -- clear initial gl_offs items */
|
||||
@ -675,23 +609,12 @@ globextend(path, pglob)
|
||||
}
|
||||
pglob->gl_pathv = pathv;
|
||||
|
||||
for (p = path; *p++;)
|
||||
continue;
|
||||
if ((copy = (char *) xmalloc((size_t) (p - path))) != NULL) {
|
||||
char *dc = copy;
|
||||
Char *sc = path;
|
||||
|
||||
while ((*dc++ = *sc++) != '\0')
|
||||
continue;
|
||||
pathv[pglob->gl_offs + pglob->gl_pathc++] = copy;
|
||||
}
|
||||
pathv[pglob->gl_offs + pglob->gl_pathc++] = strsave(path);
|
||||
pathv[pglob->gl_offs + pglob->gl_pathc] = NULL;
|
||||
return ((copy == NULL) ? GLOB_NOSPACE : 0);
|
||||
}
|
||||
|
||||
|
||||
static size_t
|
||||
One_mbtowc(NLSChar *pwc, const Char *s, size_t n)
|
||||
One_Char_mbtowc(__Char *pwc, const Char *s, size_t n)
|
||||
{
|
||||
#ifdef WIDE_STRINGS
|
||||
char buf[MB_LEN_MAX], *p;
|
||||
@ -699,11 +622,12 @@ One_mbtowc(NLSChar *pwc, const Char *s, size_t n)
|
||||
if (n > MB_LEN_MAX)
|
||||
n = MB_LEN_MAX;
|
||||
p = buf;
|
||||
while (p < buf + n && (*p++ = CHAR(*s++)) != 0)
|
||||
while (p < buf + n && (*p++ = LCHAR(*s++)) != 0)
|
||||
;
|
||||
return one_mbtowc(pwc, buf, n);
|
||||
#else
|
||||
return NLSFrom(s, n, pwc);
|
||||
*pwc = *s & CHAR;
|
||||
return 1;
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -712,21 +636,18 @@ One_mbtowc(NLSChar *pwc, const Char *s, size_t n)
|
||||
* pattern causes a recursion level.
|
||||
*/
|
||||
static int
|
||||
match(name, pat, patend, m_not)
|
||||
Char *name, *pat, *patend;
|
||||
int m_not;
|
||||
match(const char *name, const Char *pat, const Char *patend, int m_not)
|
||||
{
|
||||
int ok, negate_range;
|
||||
Char c, k;
|
||||
Char c;
|
||||
|
||||
while (pat < patend) {
|
||||
size_t lwk;
|
||||
NLSChar wc, wk;
|
||||
__Char wc, wk;
|
||||
|
||||
USE(k);
|
||||
c = *pat; /* Only for M_MASK bits */
|
||||
pat += One_mbtowc(&wc, pat, MB_LEN_MAX);
|
||||
lwk = One_mbtowc(&wk, name, MB_LEN_MAX);
|
||||
pat += One_Char_mbtowc(&wc, pat, MB_LEN_MAX);
|
||||
lwk = one_mbtowc(&wk, name, MB_LEN_MAX);
|
||||
switch (c & M_MASK) {
|
||||
case M_ALL:
|
||||
if (pat == patend)
|
||||
@ -737,7 +658,7 @@ match(name, pat, patend, m_not)
|
||||
if (*name == EOS)
|
||||
break;
|
||||
name += lwk;
|
||||
lwk = One_mbtowc(&wk, name, MB_LEN_MAX);
|
||||
lwk = one_mbtowc(&wk, name, MB_LEN_MAX);
|
||||
}
|
||||
return (0);
|
||||
case M_ONE:
|
||||
@ -753,19 +674,19 @@ match(name, pat, patend, m_not)
|
||||
if ((negate_range = ((*pat & M_MASK) == m_not)) != 0)
|
||||
++pat;
|
||||
while ((*pat & M_MASK) != M_END) {
|
||||
pat += One_mbtowc(&wc, pat, MB_LEN_MAX);
|
||||
pat += One_Char_mbtowc(&wc, pat, MB_LEN_MAX);
|
||||
if ((*pat & M_MASK) == M_RNG) {
|
||||
NLSChar wc2;
|
||||
|
||||
__Char wc2;
|
||||
|
||||
pat++;
|
||||
pat += One_mbtowc(&wc2, pat, MB_LEN_MAX);
|
||||
pat += One_Char_mbtowc(&wc2, pat, MB_LEN_MAX);
|
||||
if (globcharcoll(wc, wk, 0) <= 0 &&
|
||||
globcharcoll(wk, wc2, 0) <= 0)
|
||||
ok = 1;
|
||||
} else if (wc == wk)
|
||||
ok = 1;
|
||||
}
|
||||
pat += One_mbtowc(&wc, pat, MB_LEN_MAX);
|
||||
pat += One_Char_mbtowc(&wc, pat, MB_LEN_MAX);
|
||||
if (ok == negate_range)
|
||||
return (0);
|
||||
break;
|
||||
@ -781,8 +702,7 @@ match(name, pat, patend, m_not)
|
||||
|
||||
/* free allocated data belonging to a glob_t structure */
|
||||
void
|
||||
globfree(pglob)
|
||||
glob_t *pglob;
|
||||
globfree(glob_t *pglob)
|
||||
{
|
||||
int i;
|
||||
char **pp;
|
||||
@ -791,7 +711,7 @@ globfree(pglob)
|
||||
pp = pglob->gl_pathv + pglob->gl_offs;
|
||||
for (i = pglob->gl_pathc; i--; ++pp)
|
||||
if (*pp)
|
||||
xfree((ptr_t) *pp), *pp = NULL;
|
||||
xfree((ptr_t) pglob->gl_pathv), pglob->gl_pathv = NULL;
|
||||
xfree(*pp), *pp = NULL;
|
||||
xfree(pglob->gl_pathv), pglob->gl_pathv = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -44,18 +44,18 @@ typedef struct {
|
||||
int gl_flags; /* Copy of flags parameter to glob. */
|
||||
char **gl_pathv; /* List of paths matching pattern. */
|
||||
/* Copy of errfunc parameter to glob. */
|
||||
int (*gl_errfunc) __P((const char *, int));
|
||||
int (*gl_errfunc) (const char *, int);
|
||||
|
||||
/*
|
||||
* Alternate filesystem access methods for glob; replacement
|
||||
* versions of closedir(3), readdir(3), opendir(3), stat(2)
|
||||
* and lstat(2).
|
||||
*/
|
||||
void (*gl_closedir) __P((void *));
|
||||
struct dirent *(*gl_readdir) __P((void *));
|
||||
void *(*gl_opendir) __P((const char *));
|
||||
int (*gl_lstat) __P((const char *, struct stat *));
|
||||
int (*gl_stat) __P((const char *, struct stat *));
|
||||
void (*gl_closedir) (void *);
|
||||
struct dirent *(*gl_readdir) (void *);
|
||||
void *(*gl_opendir) (const char *);
|
||||
int (*gl_lstat) (const char *, struct stat *);
|
||||
int (*gl_stat) (const char *, struct stat *);
|
||||
} glob_t;
|
||||
|
||||
#define GLOB_APPEND 0x0001 /* Append to output from previous call. */
|
||||
@ -84,10 +84,8 @@ typedef struct {
|
||||
#define GLOB_ABEND GLOB_ABORTED /* source compatibility */
|
||||
/* #endif */
|
||||
|
||||
#include "tc.nls.h"
|
||||
|
||||
int glob __P((const char *, int, int (*)(const char *, int), glob_t *));
|
||||
void globfree __P((glob_t *));
|
||||
int globcharcoll __P((NLSChar, NLSChar, int));
|
||||
int glob (const char *, int, int (*)(const char *, int), glob_t *);
|
||||
void globfree (glob_t *);
|
||||
int globcharcoll (Char, Char, int);
|
||||
|
||||
#endif /* !_GLOB_H_ */
|
||||
|
@ -1,5 +1,5 @@
|
||||
newcode :
|
||||
/* $Header: /src/pub/tcsh/host.defs,v 1.40 2005/03/03 16:49:15 kim Exp $ */
|
||||
/* $Header: /p/tcsh/cvsroot/tcsh/host.defs,v 1.43 2006/03/02 18:46:44 christos Exp $ */
|
||||
/*
|
||||
* host.defs: Hosttype/Machtype etc.
|
||||
*/
|
||||
@ -33,7 +33,7 @@ newcode :
|
||||
*/
|
||||
#include "sh.h"
|
||||
|
||||
RCSID("$Id: host.defs,v 1.40 2005/03/03 16:49:15 kim Exp $")
|
||||
RCSID("$tcsh: host.defs,v 1.43 2006/03/02 18:46:44 christos Exp $")
|
||||
|
||||
endcode :
|
||||
|
||||
@ -49,8 +49,7 @@ macro : M_intel : (defined(M_i386) || defined(M_i486) || defined(M_i586))
|
||||
newdef : defined(ns32000)
|
||||
newcode :
|
||||
static char *
|
||||
isamultimax(flag)
|
||||
int flag;
|
||||
isamultimax(int flag)
|
||||
{
|
||||
if (access("/Umax.image", F_OK) == 0)
|
||||
return "multimax";
|
||||
@ -73,7 +72,7 @@ newcode :
|
||||
|
||||
/* From: hpa@hook.eecs.nwu.edu (H. Peter Anvin) */
|
||||
static char *
|
||||
getcray()
|
||||
getcray(void)
|
||||
{
|
||||
# ifdef MC_GET_SYSTEM /* If we have target() */
|
||||
struct target data;
|
||||
@ -115,7 +114,7 @@ newcode :
|
||||
|
||||
/* From: fox@convex.com (David DeSimone) */
|
||||
static char *
|
||||
getconvex()
|
||||
getconvex(void)
|
||||
{
|
||||
struct system_information sysinfo;
|
||||
static char result[8];
|
||||
@ -172,7 +171,7 @@ enddef :
|
||||
|
||||
newcode :
|
||||
void
|
||||
getmachine()
|
||||
getmachine(void)
|
||||
{
|
||||
const char *hosttype;
|
||||
const char *ostype;
|
||||
@ -446,8 +445,7 @@ hosttype: defined(__x86_64__) : "x86_64-linux"
|
||||
hosttype: defined(M_i586) : "i586-linux"
|
||||
hosttype: defined(M_i486) : "i486-linux"
|
||||
hosttype: defined(M_i386) : "i386-linux"
|
||||
ostype : !defined(PPC) : "linux"
|
||||
ostype : defined(PPC) : "mklinux"
|
||||
ostype : : "linux"
|
||||
machtype: defined(__ia64__) : "ia64"
|
||||
machtype: defined(__powerpc64__) : "powerpc64"
|
||||
machtype: defined(__s390x__) : "s390x"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: imake.config,v 1.4 1995/03/05 03:18:09 christos Exp $
|
||||
* $tcsh: imake.config,v 1.5 2006/03/02 18:46:44 christos Exp $
|
||||
*
|
||||
* config.Imakefile for for tcsh 6.00
|
||||
* Marc Horowitz, MIT SIPB
|
||||
|
@ -82,7 +82,7 @@
|
||||
**********************************************************************
|
||||
*/
|
||||
#include "sh.h"
|
||||
RCSID("$Id: ma.setp.c,v 1.14 2004/08/04 17:12:28 christos Exp $")
|
||||
RCSID("$tcsh: ma.setp.c,v 1.18 2006/03/02 18:46:44 christos Exp $")
|
||||
|
||||
#ifdef MACH
|
||||
|
||||
@ -132,29 +132,28 @@ static int eflag;
|
||||
return(-1); \
|
||||
}
|
||||
|
||||
static int initpaths __P((char **));
|
||||
static void savepaths __P((char **));
|
||||
static void freepaths __P((void));
|
||||
static void rcmd __P((char *));
|
||||
static void icmd __P((char *, char *));
|
||||
static void iacmd __P((char *, char *));
|
||||
static void ibcmd __P((char *, char *));
|
||||
static void incmd __P((char *, int));
|
||||
static void insert __P((struct pelem *, int, char *));
|
||||
static void dcmd __P((char *));
|
||||
static void dncmd __P((int));
|
||||
static void delete __P((struct pelem *, int));
|
||||
static void ccmd __P((char *, char *));
|
||||
static void cncmd __P((char *, int));
|
||||
static void change __P((struct pelem *, int, char *));
|
||||
static int locate __P((struct pelem *, char *));
|
||||
static int initpaths (char **);
|
||||
static void savepaths (char **);
|
||||
static void freepaths (void);
|
||||
static void rcmd (char *);
|
||||
static void icmd (char *, char *);
|
||||
static void iacmd (char *, char *);
|
||||
static void ibcmd (char *, char *);
|
||||
static void incmd (char *, int);
|
||||
static void insert (struct pelem *, int, char *);
|
||||
static void dcmd (char *);
|
||||
static void dncmd (int);
|
||||
static void delete (struct pelem *, int);
|
||||
static void ccmd (char *, char *);
|
||||
static void cncmd (char *, int);
|
||||
static void change (struct pelem *, int, char *);
|
||||
static int locate (struct pelem *, char *);
|
||||
|
||||
|
||||
|
||||
int
|
||||
setpath(paths, cmds, localsyspath, dosuffix, printerrors)
|
||||
char **paths, **cmds, *localsyspath;
|
||||
int dosuffix, printerrors;
|
||||
setpath(char **paths, char **cmds, char *localsyspath, int dosuffix,
|
||||
int printerrors)
|
||||
{
|
||||
char *cmd, *cmd1, *cmd2;
|
||||
int ncmd;
|
||||
@ -230,8 +229,7 @@ int dosuffix, printerrors;
|
||||
}
|
||||
|
||||
static int
|
||||
initpaths(paths)
|
||||
char **paths;
|
||||
initpaths(char **paths)
|
||||
{
|
||||
char *path, *val, *p, *q;
|
||||
int i, done;
|
||||
@ -248,8 +246,8 @@ char **paths;
|
||||
return(-1);
|
||||
}
|
||||
*val++ = '\0';
|
||||
pe = (struct pelem *)xmalloc((unsigned)(sizeof(struct pelem)));
|
||||
setzero((char *) pe, sizeof(struct pelem));
|
||||
pe = xmalloc(sizeof(struct pelem));
|
||||
setzero(pe, sizeof(struct pelem));
|
||||
if (pathhead == NULL)
|
||||
pathhead = pathend = pe;
|
||||
else {
|
||||
@ -283,8 +281,7 @@ char **paths;
|
||||
}
|
||||
|
||||
static void
|
||||
savepaths(paths)
|
||||
char **paths;
|
||||
savepaths(char **paths)
|
||||
{
|
||||
char *p, *q;
|
||||
int npath, i, len;
|
||||
@ -312,7 +309,7 @@ char **paths;
|
||||
}
|
||||
|
||||
static void
|
||||
freepaths()
|
||||
freepaths(void)
|
||||
{
|
||||
char *p;
|
||||
int i;
|
||||
@ -345,13 +342,12 @@ freepaths()
|
||||
***********************************************/
|
||||
|
||||
static void
|
||||
rcmd(localsyspath) /* reset path with localsyspath */
|
||||
char *localsyspath;
|
||||
rcmd(char *localsyspath) /* reset path with localsyspath */
|
||||
{
|
||||
int n, done;
|
||||
char *new, *p;
|
||||
struct pelem *pe;
|
||||
char newbuf[MAXPATHLEN+1];
|
||||
char newbuf[MAXPATHLEN+1];/*FIXBUF*/
|
||||
|
||||
for (pe = pathhead; pe; pe = pe->pnext) {
|
||||
new = newbuf;
|
||||
@ -389,13 +385,12 @@ char *localsyspath;
|
||||
***********************************************/
|
||||
|
||||
static void
|
||||
icmd(path, localsyspath) /* insert path before localsyspath */
|
||||
char *path, *localsyspath;
|
||||
icmd(char *path, char *localsyspath) /* insert path before localsyspath */
|
||||
{
|
||||
int n;
|
||||
char *new;
|
||||
struct pelem *pe;
|
||||
char newbuf[MAXPATHLEN+1];
|
||||
char newbuf[MAXPATHLEN+1];/*FIXBUF*/
|
||||
|
||||
for (pe = pathhead; pe; pe = pe->pnext) {
|
||||
if (sflag)
|
||||
@ -414,8 +409,7 @@ char *path, *localsyspath;
|
||||
}
|
||||
|
||||
static void
|
||||
iacmd(inpath, path) /* insert path after inpath */
|
||||
char *inpath, *path;
|
||||
iacmd(char *inpath, char *path) /* insert path after inpath */
|
||||
{
|
||||
int n;
|
||||
struct pelem *pe;
|
||||
@ -431,8 +425,7 @@ char *inpath, *path;
|
||||
}
|
||||
|
||||
static void
|
||||
ibcmd(inpath, path) /* insert path before inpath */
|
||||
char *inpath, *path;
|
||||
ibcmd(char *inpath, char *path) /* insert path before inpath */
|
||||
{
|
||||
int n;
|
||||
struct pelem *pe;
|
||||
@ -448,9 +441,7 @@ char *inpath, *path;
|
||||
}
|
||||
|
||||
static void
|
||||
incmd(path, n) /* insert path at position n */
|
||||
char *path;
|
||||
int n;
|
||||
incmd(char *path, int n) /* insert path at position n */
|
||||
{
|
||||
struct pelem *pe;
|
||||
|
||||
@ -459,14 +450,11 @@ int n;
|
||||
}
|
||||
|
||||
static void
|
||||
insert(pe, loc, key)
|
||||
struct pelem *pe;
|
||||
int loc;
|
||||
char *key;
|
||||
insert(struct pelem *pe, int loc, char *key)
|
||||
{
|
||||
int i;
|
||||
char *new;
|
||||
char newbuf[2000];
|
||||
char newbuf[2000];/*FIXBUF*/
|
||||
|
||||
if (sflag) { /* add suffix */
|
||||
new = newbuf;
|
||||
@ -488,8 +476,7 @@ char *key;
|
||||
***********************************************/
|
||||
|
||||
static void
|
||||
dcmd(path) /* delete path */
|
||||
char *path;
|
||||
dcmd(char *path) /* delete path */
|
||||
{
|
||||
int n;
|
||||
struct pelem *pe;
|
||||
@ -505,8 +492,7 @@ char *path;
|
||||
}
|
||||
|
||||
static void
|
||||
dncmd(n) /* delete at position n */
|
||||
int n;
|
||||
dncmd(int n) /* delete at position n */
|
||||
{
|
||||
struct pelem *pe;
|
||||
|
||||
@ -521,9 +507,7 @@ int n;
|
||||
}
|
||||
|
||||
static void
|
||||
delete(pe, n)
|
||||
struct pelem *pe;
|
||||
int n;
|
||||
delete(struct pelem *pe, int n)
|
||||
{
|
||||
int d;
|
||||
|
||||
@ -538,8 +522,7 @@ int n;
|
||||
***********************************************/
|
||||
|
||||
static void
|
||||
ccmd(inpath, path) /* change inpath to path */
|
||||
char *inpath, *path;
|
||||
ccmd(char *inpath, char *path) /* change inpath to path */
|
||||
{
|
||||
int n;
|
||||
struct pelem *pe;
|
||||
@ -555,9 +538,7 @@ char *inpath, *path;
|
||||
}
|
||||
|
||||
static void
|
||||
cncmd(path, n) /* change at position n to path */
|
||||
char *path;
|
||||
int n;
|
||||
cncmd(char *path, int n) /* change at position n to path */
|
||||
{
|
||||
struct pelem *pe;
|
||||
|
||||
@ -572,13 +553,10 @@ int n;
|
||||
}
|
||||
|
||||
static void
|
||||
change(pe, loc, key)
|
||||
struct pelem *pe;
|
||||
int loc;
|
||||
char *key;
|
||||
change(struct pelem *pe, int loc, char *key)
|
||||
{
|
||||
char *new;
|
||||
char newbuf[MAXPATHLEN+1];
|
||||
char newbuf[MAXPATHLEN+1];/*FIXBUF*/
|
||||
|
||||
if (sflag) { /* append suffix */
|
||||
new = newbuf;
|
||||
@ -596,13 +574,11 @@ char *key;
|
||||
***************************************/
|
||||
|
||||
static int
|
||||
locate(pe, key)
|
||||
struct pelem *pe;
|
||||
char *key;
|
||||
locate(struct pelem *pe, char *key)
|
||||
{
|
||||
int i;
|
||||
char *realkey;
|
||||
char keybuf[MAXPATHLEN+1];
|
||||
char keybuf[MAXPATHLEN+1];/*FIXBUF*/
|
||||
|
||||
if (sflag) {
|
||||
realkey = keybuf;
|
||||
|
@ -1,10 +1,10 @@
|
||||
/* $Header: /src/pub/tcsh/mi.termios.c,v 1.4 2000/07/04 19:38:14 christos Exp $ */
|
||||
/* $Header: /p/tcsh/cvsroot/tcsh/mi.termios.c,v 1.5 2006/03/02 18:46:44 christos Exp $ */
|
||||
/* termios.c - fake termios interface using sgtty interface
|
||||
* by Magnus Doell and Bruce Evans.
|
||||
*
|
||||
*/
|
||||
#include "sh.h"
|
||||
RCSID("$Id: mi.termios.c,v 1.4 2000/07/04 19:38:14 christos Exp $")
|
||||
RCSID("$tcsh: mi.termios.c,v 1.5 2006/03/02 18:46:44 christos Exp $")
|
||||
|
||||
#if defined(_MINIX) && !defined(_MINIX_VMD)
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Header: /src/pub/tcsh/mi.varargs.h,v 1.2 1996/04/26 19:18:39 christos Exp $ */
|
||||
/* $Header: /p/tcsh/cvsroot/tcsh/mi.varargs.h,v 1.2 1996/04/26 19:18:39 christos Exp $ */
|
||||
/*
|
||||
* mi.varargs.h: Correct varargs for minix
|
||||
*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set1,v 1.5 1998/06/27 12:27:55 christos Exp $
|
||||
$ $tcsh: set1,v 1.6 2006/03/02 18:46:45 christos Exp $
|
||||
$ Error messages
|
||||
$set 1
|
||||
1 Syntax Error
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set10,v 1.2 1995/03/19 18:07:15 christos Exp $
|
||||
$ $tcsh: set10,v 1.3 2006/03/02 18:46:45 christos Exp $
|
||||
$ ma.setp.c
|
||||
$set 10
|
||||
1 setpath: invalid command '%s'.\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set11,v 1.3 2005/03/21 21:26:37 kim Exp $
|
||||
$ $tcsh: set11,v 1.4 2006/03/02 18:46:45 christos Exp $
|
||||
$ sh.c
|
||||
$set 11
|
||||
1 Warning: no access to tty (%s).\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set12,v 1.3 1996/04/26 20:31:52 christos Exp $
|
||||
$ $tcsh: set12,v 1.4 2006/03/02 18:46:45 christos Exp $
|
||||
$ sh.dir.c
|
||||
$set 12
|
||||
1 %s: Trying to start from "%s"\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set13,v 1.2 1995/03/19 18:07:15 christos Exp $
|
||||
$ $tcsh: set13,v 1.3 2006/03/02 18:46:45 christos Exp $
|
||||
$ sh.exec.c
|
||||
$set 13
|
||||
1 hash=%-4d dir=%-2d prog=%s\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set14,v 1.3 1998/11/24 18:18:06 christos Exp $
|
||||
$ $tcsh: set14,v 1.4 2006/03/02 18:46:45 christos Exp $
|
||||
$ sh.file.c
|
||||
$set 14
|
||||
1 \nYikes!! Too many %s!!\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set15,v 1.3 1996/10/19 17:52:32 christos Exp $
|
||||
$ $tcsh: set15,v 1.4 2006/03/02 18:46:45 christos Exp $
|
||||
$ sh.func.c
|
||||
$set 15
|
||||
1 %s: %s: Can't %s%s limit\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set16,v 1.3 1996/04/26 20:31:55 christos Exp $
|
||||
$ $tcsh: set16,v 1.4 2006/03/02 18:46:45 christos Exp $
|
||||
$ sh.lex.c
|
||||
$set 16
|
||||
1 Reset tty pgrp from %d to %d\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set17,v 1.5 2003/02/08 20:03:26 christos Exp $
|
||||
$ $tcsh: set17,v 1.6 2006/03/02 18:46:45 christos Exp $
|
||||
$ sh.proc.c
|
||||
$set 17
|
||||
1 BUG: waiting for background job!\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set18,v 1.2 1995/03/19 18:07:15 christos Exp $
|
||||
$ $tcsh: set18,v 1.3 2006/03/02 18:46:45 christos Exp $
|
||||
$ sh.set.c
|
||||
$set 18
|
||||
1 Warning: ridiculously long PATH truncated\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set19,v 1.3 1996/04/26 20:31:58 christos Exp $
|
||||
$ $tcsh: set19,v 1.4 2006/03/02 18:46:45 christos Exp $
|
||||
$ tc.alloc.c
|
||||
$set 19
|
||||
1 nbytes=%d: Out of memory\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set2,v 1.4 1998/10/25 15:12:38 christos Exp $
|
||||
$ $tcsh: set2,v 1.5 2006/03/02 18:46:45 christos Exp $
|
||||
$ Signal names
|
||||
$set 2
|
||||
1 Null signal
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set20,v 1.2 1995/03/19 18:07:15 christos Exp $
|
||||
$ $tcsh: set20,v 1.3 2006/03/02 18:46:45 christos Exp $
|
||||
$ tc.bind.c
|
||||
$set 20
|
||||
1 Invalid key name `%S'\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set21,v 1.2 1995/03/19 18:07:15 christos Exp $
|
||||
$ $tcsh: set21,v 1.3 2006/03/02 18:46:45 christos Exp $
|
||||
$ tc.disc.c
|
||||
$set 21
|
||||
1 Couldn't get local chars.\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set22,v 1.2 1995/03/19 18:07:15 christos Exp $
|
||||
$ $tcsh: set22,v 1.3 2006/03/02 18:46:45 christos Exp $
|
||||
$ tc.func.c
|
||||
$set 22
|
||||
1 %S: \t aliased to
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set23,v 1.3 1996/04/26 20:32:00 christos Exp $
|
||||
$ $tcsh: set23,v 1.4 2006/03/02 18:46:45 christos Exp $
|
||||
$ tc.os.c
|
||||
$set 23
|
||||
1 Bad cpu/site name
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set24,v 1.2 1995/03/19 18:07:15 christos Exp $
|
||||
$ $tcsh: set24,v 1.3 2006/03/02 18:46:45 christos Exp $
|
||||
$ tc.sched.c
|
||||
$set 24
|
||||
1 kludge
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set25,v 1.2 1995/03/19 18:07:15 christos Exp $
|
||||
$ $tcsh: set25,v 1.3 2006/03/02 18:46:45 christos Exp $
|
||||
$ tc.sig.c
|
||||
$set 25
|
||||
1 our wait %d\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set26,v 1.2 1995/03/19 18:07:15 christos Exp $
|
||||
$ $tcsh: set26,v 1.3 2006/03/02 18:46:45 christos Exp $
|
||||
$ tc.who.c
|
||||
$set 26
|
||||
1 cannot stat %s. Please "unset watch".\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set27,v 1.2 1995/03/19 18:07:15 christos Exp $
|
||||
$ $tcsh: set27,v 1.3 2006/03/02 18:46:45 christos Exp $
|
||||
$ tw.comp.c
|
||||
$set 27
|
||||
1 command
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set29,v 1.2 1995/03/19 18:07:15 christos Exp $
|
||||
$ $tcsh: set29,v 1.3 2006/03/02 18:46:45 christos Exp $
|
||||
$ tw.help.c
|
||||
$set 29
|
||||
1 No help file for %S\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set3,v 1.4 2001/04/26 19:07:48 kim Exp $
|
||||
$ $tcsh: set3,v 1.6 2006/03/02 18:46:45 christos Exp $
|
||||
$ Editor function descriptions
|
||||
$set 3
|
||||
1 Move back a character
|
||||
@ -122,3 +122,5 @@ $set 3
|
||||
119 (WIN32 only) Convert each '/' in previous word to '\\\\'
|
||||
120 (WIN32 only) Page visible console window up
|
||||
121 (WIN32 only) Page visible console window down
|
||||
122 Execute command and keep current line
|
||||
123 Execute command and move to next history line
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set30,v 1.4 1996/10/19 17:52:34 christos Exp $
|
||||
$ $tcsh: set30,v 1.5 2006/03/02 18:46:45 christos Exp $
|
||||
$ tw.parse.c
|
||||
$set 30
|
||||
1 starting_a_command %d\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set31,v 1.2 1995/03/19 18:07:15 christos Exp $
|
||||
$ $tcsh: set31,v 1.3 2006/03/02 18:46:45 christos Exp $
|
||||
$ vms.termcap.c
|
||||
$set 31
|
||||
1 Can't open TERMCAP: [%s]\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set4,v 1.2 1995/03/19 18:07:15 christos Exp $
|
||||
$ $tcsh: set4,v 1.3 2006/03/02 18:46:45 christos Exp $
|
||||
$ Termcap strings
|
||||
$set 4
|
||||
1 add new blank line
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set5,v 1.2 1995/03/19 18:07:15 christos Exp $
|
||||
$ $tcsh: set5,v 1.3 2006/03/02 18:46:45 christos Exp $
|
||||
$ ed.chared.c
|
||||
$set 5
|
||||
1 Load average unavailable\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set6,v 1.2 1995/03/19 18:07:15 christos Exp $
|
||||
$ $tcsh: set6,v 1.3 2006/03/02 18:46:45 christos Exp $
|
||||
$ ed.inputl.c
|
||||
$set 6
|
||||
1 ERROR: illegal command from key 0%o\r\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set7,v 1.3 1996/04/26 20:32:04 christos Exp $
|
||||
$ $tcsh: set7,v 1.4 2006/03/02 18:46:45 christos Exp $
|
||||
$ ed.screen.c
|
||||
$set 7
|
||||
1 \n\tTcsh thinks your terminal has the\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set8,v 1.2 1995/03/19 18:07:15 christos Exp $
|
||||
$ $tcsh: set8,v 1.3 2006/03/02 18:46:45 christos Exp $
|
||||
$ ed.term.c
|
||||
$set 8
|
||||
1 Unknown switch
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set9,v 1.2 1995/03/19 18:07:15 christos Exp $
|
||||
$ $tcsh: set9,v 1.3 2006/03/02 18:46:45 christos Exp $
|
||||
$ ed.xmap.c
|
||||
$set 9
|
||||
1 AddXkey: Null extended-key not allowed.\n
|
||||
|
@ -1,8 +1,9 @@
|
||||
# $tcsh: Makefile,v 1.14 2006/03/02 18:46:45 christos Exp $
|
||||
|
||||
SUBDIRS= C et finnish french german greek italian ja pl russian \
|
||||
spanish ukrainian
|
||||
#GENCAT= gencat --new
|
||||
#CHARSET= charset
|
||||
CHARSET= charset
|
||||
GENCAT= gencat
|
||||
|
||||
catalogs:
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set1,v 1.2 2001/01/11 13:25:24 christos Exp $
|
||||
$ $tcsh: set1,v 1.3 2006/03/02 18:46:45 christos Exp $
|
||||
$ Error messages
|
||||
$set 1
|
||||
1 Süntaksi viga
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set10,v 1.1 2001/01/04 18:46:02 christos Exp $
|
||||
$ $tcsh: set10,v 1.2 2006/03/02 18:46:45 christos Exp $
|
||||
$ ma.setp.c
|
||||
$set 10
|
||||
1 setpath: vigane käsk '%s'.\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set11,v 1.1 2001/01/04 18:46:02 christos Exp $
|
||||
$ $tcsh: set11,v 1.2 2006/03/02 18:46:45 christos Exp $
|
||||
$ sh.c
|
||||
$set 11
|
||||
1 Hoiatus: tty (%s) pole kättesaadav.\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set12,v 1.1 2001/01/04 18:46:02 christos Exp $
|
||||
$ $tcsh: set12,v 1.2 2006/03/02 18:46:45 christos Exp $
|
||||
$ sh.dir.c
|
||||
$set 12
|
||||
1 %s: Proovin startida kataloogist "%s"\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set13,v 1.1 2001/01/04 18:46:02 christos Exp $
|
||||
$ $tcsh: set13,v 1.2 2006/03/02 18:46:45 christos Exp $
|
||||
$ sh.exec.c
|
||||
$set 13
|
||||
1 hash=%-4d dir=%-2d prog=%s\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set14,v 1.1 2001/01/04 18:46:03 christos Exp $
|
||||
$ $tcsh: set14,v 1.2 2006/03/02 18:46:45 christos Exp $
|
||||
$ sh.file.c
|
||||
$set 14
|
||||
1 \nÄhh!! Liiga palju %s!!\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set15,v 1.1 2001/01/04 18:46:03 christos Exp $
|
||||
$ $tcsh: set15,v 1.2 2006/03/02 18:46:45 christos Exp $
|
||||
$ sh.func.c
|
||||
$set 15
|
||||
1 %s: %s: Ei õnnestu %s%s piirangut\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set16,v 1.1 2001/01/04 18:46:03 christos Exp $
|
||||
$ $tcsh: set16,v 1.2 2006/03/02 18:46:45 christos Exp $
|
||||
$ sh.lex.c
|
||||
$set 16
|
||||
1 Seadsin tty pgrp numbrilt %d numbrile %d\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set17,v 1.2 2003/02/08 20:03:26 christos Exp $
|
||||
$ $tcsh: set17,v 1.3 2006/03/02 18:46:45 christos Exp $
|
||||
$ sh.proc.c
|
||||
$set 17
|
||||
1 BUG: ootan taustatöö järel!\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set18,v 1.1 2001/01/04 18:46:03 christos Exp $
|
||||
$ $tcsh: set18,v 1.2 2006/03/02 18:46:45 christos Exp $
|
||||
$ sh.set.c
|
||||
$set 18
|
||||
1 Hoiatus: nõmedalt pikk PATH sai lühendatud\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set19,v 1.1 2001/01/04 18:46:03 christos Exp $
|
||||
$ $tcsh: set19,v 1.2 2006/03/02 18:46:45 christos Exp $
|
||||
$ tc.alloc.c
|
||||
$set 19
|
||||
1 nbytes=%d: Mälu on otsas\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set2,v 1.1 2001/01/04 18:46:03 christos Exp $
|
||||
$ $tcsh: set2,v 1.2 2006/03/02 18:46:45 christos Exp $
|
||||
$ Signal names
|
||||
$set 2
|
||||
1 Null signaal
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set20,v 1.1 2001/01/04 18:46:03 christos Exp $
|
||||
$ $tcsh: set20,v 1.2 2006/03/02 18:46:45 christos Exp $
|
||||
$ tc.bind.c
|
||||
$set 20
|
||||
1 Vigane klahvi nimi `%S'\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set21,v 1.1 2001/01/04 18:46:03 christos Exp $
|
||||
$ $tcsh: set21,v 1.2 2006/03/02 18:46:45 christos Exp $
|
||||
$ tc.disc.c
|
||||
$set 21
|
||||
1 Lokaalseid sümboleid ei őnnestu lugeda.\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set22,v 1.1 2001/01/04 18:46:04 christos Exp $
|
||||
$ $tcsh: set22,v 1.2 2006/03/02 18:46:45 christos Exp $
|
||||
$ tc.func.c
|
||||
$set 22
|
||||
1 %S: \t on tegelikult
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set23,v 1.1 2001/01/04 18:46:04 christos Exp $
|
||||
$ $tcsh: set23,v 1.2 2006/03/02 18:46:45 christos Exp $
|
||||
$ tc.os.c
|
||||
$set 23
|
||||
1 Vigane cpu/saidi nimi
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set24,v 1.1 2001/01/04 18:46:04 christos Exp $
|
||||
$ $tcsh: set24,v 1.2 2006/03/02 18:46:45 christos Exp $
|
||||
$ tc.sched.c
|
||||
$set 24
|
||||
1 Häkk!
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set25,v 1.1 2001/01/04 18:46:04 christos Exp $
|
||||
$ $tcsh: set25,v 1.2 2006/03/02 18:46:45 christos Exp $
|
||||
$ tc.sig.c
|
||||
$set 25
|
||||
1 our wait %d\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set26,v 1.1 2001/01/04 18:46:04 christos Exp $
|
||||
$ $tcsh: set26,v 1.2 2006/03/02 18:46:45 christos Exp $
|
||||
$ tc.who.c
|
||||
$set 26
|
||||
1 Ei saa lugeda %s atribuute. Anna käsk "unset watch".\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set27,v 1.1 2001/01/04 18:46:04 christos Exp $
|
||||
$ $tcsh: set27,v 1.2 2006/03/02 18:46:45 christos Exp $
|
||||
$ tw.comp.c
|
||||
$set 27
|
||||
1 käsk
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set29,v 1.1 2001/01/04 18:46:04 christos Exp $
|
||||
$ $tcsh: set29,v 1.2 2006/03/02 18:46:45 christos Exp $
|
||||
$ tw.help.c
|
||||
$set 29
|
||||
1 %S'ile pole abiteksti\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set3,v 1.2 2001/04/26 19:07:48 kim Exp $
|
||||
$ $tcsh: set3,v 1.3 2006/03/02 18:46:45 christos Exp $
|
||||
$ Editor function descriptions
|
||||
$set 3
|
||||
1 Liigu sümbol tagasi
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set30,v 1.1 2001/01/04 18:46:04 christos Exp $
|
||||
$ $tcsh: set30,v 1.2 2006/03/02 18:46:45 christos Exp $
|
||||
$ tw.parse.c
|
||||
$set 30
|
||||
1 starting_a_command %d\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set31,v 1.1 2001/01/04 18:46:04 christos Exp $
|
||||
$ $tcsh: set31,v 1.2 2006/03/02 18:46:45 christos Exp $
|
||||
$ vms.termcap.c
|
||||
$set 31
|
||||
1 TERMCAP ei saa avada: [%s]\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set4,v 1.1 2001/01/04 18:46:04 christos Exp $
|
||||
$ $tcsh: set4,v 1.2 2006/03/02 18:46:45 christos Exp $
|
||||
$ Termcap strings
|
||||
$set 4
|
||||
1 lisa uus tühi rida
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set5,v 1.1 2001/01/04 18:46:05 christos Exp $
|
||||
$ $tcsh: set5,v 1.2 2006/03/02 18:46:45 christos Exp $
|
||||
$ ed.chared.c
|
||||
$set 5
|
||||
1 Tööjärjekorra koormuse info puudub\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set6,v 1.1 2001/01/04 18:46:05 christos Exp $
|
||||
$ $tcsh: set6,v 1.2 2006/03/02 18:46:45 christos Exp $
|
||||
$ ed.inputl.c
|
||||
$set 6
|
||||
1 VIGA: vigane käsk klahvilt 0%o\r\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set7,v 1.1 2001/01/04 18:46:05 christos Exp $
|
||||
$ $tcsh: set7,v 1.2 2006/03/02 18:46:45 christos Exp $
|
||||
$ ed.screen.c
|
||||
$set 7
|
||||
1 \n\tTcsh arvab, et teie terminal omab\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set8,v 1.1 2001/01/04 18:46:05 christos Exp $
|
||||
$ $tcsh: set8,v 1.2 2006/03/02 18:46:45 christos Exp $
|
||||
$ ed.term.c
|
||||
$set 8
|
||||
1 Tundmatu võti
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set9,v 1.1 2001/01/04 18:46:05 christos Exp $
|
||||
$ $tcsh: set9,v 1.2 2006/03/02 18:46:45 christos Exp $
|
||||
$ ed.xmap.c
|
||||
$set 9
|
||||
1 AddXkey: Null pikkusega laiend-klahv ei ole lubatud.\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set1,v 1.2 2001/09/03 02:13:26 kim Exp $
|
||||
$ $tcsh: set1,v 1.3 2006/03/02 18:46:46 christos Exp $
|
||||
$ Error messages
|
||||
$set 1
|
||||
1 Kielioppivirhe
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set10,v 1.1 2000/01/14 22:57:31 christos Exp $
|
||||
$ $tcsh: set10,v 1.2 2006/03/02 18:46:46 christos Exp $
|
||||
$ ma.setp.c
|
||||
$set 10
|
||||
1 setpath: Virheellinen komento '%s'.\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set11,v 1.1 2000/01/14 22:57:32 christos Exp $
|
||||
$ $tcsh: set11,v 1.2 2006/03/02 18:46:46 christos Exp $
|
||||
$ sh.c
|
||||
$set 11
|
||||
1 Varoitus: ei yhteyttä päätteeseen (%s).\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set12,v 1.1 2000/01/14 22:57:32 christos Exp $
|
||||
$ $tcsh: set12,v 1.2 2006/03/02 18:46:46 christos Exp $
|
||||
$ sh.dir.c
|
||||
$set 12
|
||||
1 %s: Yritetään käynnistää hakemistosta "%s"\n
|
||||
|
@ -1,4 +1,4 @@
|
||||
$ $Id: set13,v 1.1 2000/01/14 22:57:32 christos Exp $
|
||||
$ $tcsh: set13,v 1.2 2006/03/02 18:46:46 christos Exp $
|
||||
$ sh.exec.c
|
||||
$set 13
|
||||
1 hash=%-4d dir=%-2d prog=%s\n
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user