This commit was generated by cvs2svn to compensate for changes in r167465,

which included commits to RCS files with non-trunk default branches.
This commit is contained in:
Mark Peek 2007-03-11 22:33:41 +00:00
commit 4905cea5f2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=167466
446 changed files with 10760 additions and 12222 deletions

View File

@ -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 76. V6.14.00 - 20050325
75. Additional messages for the ja (Japanese) locale (NAKAMURA Takeshi) 75. Additional messages for the ja (Japanese) locale (NAKAMURA Takeshi)
74. V6.13.10 - 20050321 74. V6.13.10 - 20050321

View File

@ -1,5 +1,5 @@
XCOMM 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
XCOMM Imakefile for tcsh 6.12 XCOMM Imakefile for tcsh 6.12
XCOMM Marc Horowitz, MIT SIPB XCOMM Marc Horowitz, MIT SIPB

View File

@ -2,7 +2,7 @@
# #
# MAKEDIFFS.sh: Make context diffs for the csh sources # 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 XINUDIR=/usr/share/src/mtXinu/bin/csh
BSDDIR=/usr/share/src/mtXinu/BSD/bin/csh BSDDIR=/usr/share/src/mtXinu/BSD/bin/csh
TAHOEDIR=/usr/share/src/mtXinu/TAHOE/bin/csh TAHOEDIR=/usr/share/src/mtXinu/TAHOE/bin/csh

View File

@ -2,7 +2,7 @@
# #
# MAKESHAR.sh: Make a shar file for the sources # 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 AWK=/usr/bin/nawk # Must be nawk or gawk cause of 2D arrays
WC=/usr/ucb/wc WC=/usr/ucb/wc

View File

@ -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 # Makefile.in 4.3 6/11/83
# #
# C Shell with process control; VM/UNIX VAX Makefile # C Shell with process control; VM/UNIX VAX Makefile
@ -8,7 +8,7 @@
# things; Paul Placeway, CIS Dept., Ohio State University # things; Paul Placeway, CIS Dept., Ohio State University
# #
SHELL=/bin/sh SHELL=/bin/sh
VERSION=6.12 VERSION=@PACKAGE_VERSION@
BUILD=tcsh$(EXEEXT) BUILD=tcsh$(EXEEXT)
VPATH=@srcdir@ VPATH=@srcdir@
srcdir=@srcdir@ srcdir=@srcdir@
@ -231,7 +231,8 @@ LIBES= @LIBS@ ## This is set by autoconf.
# #
EXTRAFLAGS = @HESDEF@ $(AFSDEF) EXTRAFLAGS = @HESDEF@ $(AFSDEF)
EXTRALIBS = @HESLIB@ $(AFSLIB) EXTRALIBS = @HESLIB@ $(AFSLIB) @LIBICONV@
# The difficult choice of a c-compiler... # 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 \ WishList config_f.h eight-bit.me glob.3 patchlevel.h \
pathnames.h tcsh.man Ported src.desc Imakefile imake.config \ pathnames.h tcsh.man Ported src.desc Imakefile imake.config \
README.imake complete.tcsh vmsreadme.txt termcap.vms snames.h \ 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} VHSRCS=${PVSRCS} ${AVSRCS}
CONFSRCS=config/* CONFSRCS=config/*
ALLSRCS= ${SHSRCS} ${TWSRCS} ${EDSRCS} ${TCSRCS} ${VHSRCS} ALLSRCS= ${SHSRCS} ${TWSRCS} ${EDSRCS} ${TCSRCS} ${VHSRCS}
DISTSRCS= ${PSSRCS} ${TWSRCS} ${EDSRCS} ${TCSRCS} ${AVSRCS} DISTSRCS= ${PSSRCS} ${TWSRCS} ${EDSRCS} ${TCSRCS} ${AVSRCS} $(TESTFILES)
OBJS= ${SHOBJS} ${TWOBJS} ${EDOBJS} ${TCOBJS} 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} ${CC} -o gethost ${LDFLAGS} ${CFLAGS} ${CPPFLAGS} ${DFLAGS} $(srcdir)/gethost.c ${LIBES} ${EXTRALIBS}
tc.defs.c: gethost host.defs tc.defs.c: gethost host.defs
@rm -f $@ @rm -f $@.tmp
@echo "/* Do not edit this file, make creates it */" > $@ @echo "/* Do not edit this file, make creates it */" > $@.tmp
./gethost $(srcdir)/host.defs >> $@ ./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 tcsh.ps: tcsh.man
rm -f tcsh.ps rm -f tcsh.ps
-ptroff -t -man $(srcdir)/tcsh.man > tcsh.ps -ptroff -t -man $(srcdir)/tcsh.man > tcsh.ps
.c.${SUF}: .c.${SUF}:
${CC} ${CF} ${CFLAGS} ${CPPFLAGS} ${DFLAGS} ${EXTRAFLAGS} $< ${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 # _VMS_POSIX #module addition
#.c.${SUF}: #.c.${SUF}:
# @(echo '#module '`echo $< | sed -e 's/\./_/g'`; cat $<) > $*..c # @(echo '#module '`echo $< | sed -e 's/\./_/g'`; cat $<) > $*..c
@ -410,31 +424,53 @@ tcsh.ps: tcsh.man
## co $< ## co $<
ed.defns.h: ed.defns.c ed.defns.h: ed.defns.c
@rm -f $@ @rm -f $@.tmp
@echo '/* Do not edit this file, make creates it. */' > $@ @echo '/* Do not edit this file, make creates it. */' > $@.tmp
@echo '#ifndef _h_ed_defns' >> $@ @echo '#ifndef _h_ed_defns' >> $@.tmp
@echo '#define _h_ed_defns' >> $@ @echo '#define _h_ed_defns' >> $@.tmp
grep '[FV]_' $(srcdir)/ed.defns.c | grep '^#define' >> $@ grep '[FV]_' $(srcdir)/ed.defns.c | grep '^#define' >> $@.tmp
@echo '#endif /* _h_ed_defns */' >> $@ @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 sh.err.h: sh.err.c
@rm -f $@ @rm -f $@.tmp
@echo '/* Do not edit this file, make creates it. */' > $@ @echo '/* Do not edit this file, make creates it. */' > $@.tmp
@echo '#ifndef _h_sh_err' >> $@ @echo '#ifndef _h_sh_err' >> $@.tmp
@echo '#define _h_sh_err' >> $@ @echo '#define _h_sh_err' >> $@.tmp
grep 'ERR_' $(srcdir)/sh.err.c | grep '^#define' >> $@ grep 'ERR_' $(srcdir)/sh.err.c | grep '^#define' >> $@.tmp
@echo '#endif /* _h_sh_err */' >> $@ @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 tc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h
@rm -f $@ @rm -f $@.tmp
@echo '/* Do not edit this file, make creates it. */' > $@ @echo '/* Do not edit this file, make creates it. */' > $@.tmp
@echo '#ifndef _h_tc_const' >> $@ @echo '#ifndef _h_tc_const' >> $@.tmp
@echo '#define _h_tc_const' >> $@ @echo '#define _h_tc_const' >> $@.tmp
${CPP} $(CPPFLAGS) ${DFLAGS} ${EXTRAFLAGS} -D_h_tc_const\ ${CPP} $(CPPFLAGS) ${DFLAGS} ${EXTRAFLAGS} -D_h_tc_const\
$(srcdir)/tc.const.c | \ $(srcdir)/tc.const.c | \
sed -n -e 's/^\(Char STR[a-zA-Z0-9_]*\) *\[ *\].*/extern \1[];/p' | \ sed -n -e 's/^\(Char STR[a-zA-Z0-9_]*\) *\[ *\].*/extern \1[];/p' | \
sort >> $@ sort >> $@.tmp
@echo '#endif /* _h_tc_const */' >> $@ @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} csh.prof: ${OBJS} sh.prof.${SUF} mcrt0.${SUF}
rm -f csh.prof rm -f csh.prof
@ -489,12 +525,12 @@ install.man: tcsh.man
chmod 444 ${DESTMAN}/tcsh.${MANSECT} chmod 444 ${DESTMAN}/tcsh.${MANSECT}
install.cygwin: install install.man install.cygwin: install install.man
-mkdir -p ${DESTDIR}${prefix}/doc/tcsh -mkdir -p ${DESTDIR}${prefix}/share/doc/tcsh
cp ${srcdir}/FAQ ${srcdir}/Fixes ${DESTDIR}${prefix}/doc/tcsh cp ${srcdir}/FAQ ${srcdir}/Fixes ${DESTDIR}${prefix}/share/doc/tcsh
cp ${srcdir}/NewThings ${srcdir}/README ${DESTDIR}${prefix}/doc/tcsh cp ${srcdir}/NewThings ${srcdir}/README ${DESTDIR}${prefix}/share/doc/tcsh
cp ${srcdir}/WishList ${srcdir}/Y2K ${DESTDIR}${prefix}/doc/tcsh cp ${srcdir}/WishList ${srcdir}/Y2K ${DESTDIR}${prefix}/share/doc/tcsh
perl ${srcdir}/tcsh.man2html ${srcdir}/tcsh.man 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/profile.d
-mkdir -p ${DESTDIR}/etc/postinstall -mkdir -p ${DESTDIR}/etc/postinstall
cp -p ${srcdir}/cygwin/etc/csh.* ${DESTDIR}/etc cp -p ${srcdir}/cygwin/etc/csh.* ${DESTDIR}/etc
@ -515,7 +551,8 @@ install.cygwin: install install.man
clean: clean:
${RM} -f a.out strings x.c xs.c tcsh$(EXEEXT) tcsh.a _MAKE_LOG gethost ${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 ${RM} -f tcsh.*.m tcsh.*.cat
veryclean: clean veryclean: clean
@ -527,13 +564,15 @@ veryclean: clean
distclean: veryclean distclean: veryclean
cleandir: veryclean
tags: /tmp tags: /tmp
${CTAGS} sh*.c ${CTAGS} sh*.c
tar.Z: tar.Z:
rm -f tcsh-${VERSION}.tar.Z rm -f tcsh-${VERSION}.tar.Z
rm -rf tcsh-${VERSION} rm -rf tcsh-${VERSION}
-mkdir tcsh-${VERSION} tcsh-${VERSION}/config -mkdir tcsh-${VERSION} tcsh-${VERSION}/config tcsh-${VERSION}/tests
cp ${ALLSRCS} tcsh-${VERSION} cp ${ALLSRCS} tcsh-${VERSION}
cp ${CONFSRCS} tcsh-${VERSION}/config cp ${CONFSRCS} tcsh-${VERSION}/config
tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -) tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -)
@ -543,7 +582,7 @@ tar.Z:
tar.gz: tar.gz:
rm -f tcsh-${VERSION}.tar.gz rm -f tcsh-${VERSION}.tar.gz
rm -rf tcsh-${VERSION} rm -rf tcsh-${VERSION}
-mkdir tcsh-${VERSION} tcsh-${VERSION}/config -mkdir tcsh-${VERSION} tcsh-${VERSION}/config tcsh-${VERSION}/tests
cp ${ALLSRCS} tcsh-${VERSION} cp ${ALLSRCS} tcsh-${VERSION}
cp ${CONFSRCS} tcsh-${VERSION}/config cp ${CONFSRCS} tcsh-${VERSION}/config
tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -) tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -)
@ -553,7 +592,7 @@ tar.gz:
shar: shar:
rm -f tcsh-*.shar rm -f tcsh-*.shar
rm -rf tcsh-${VERSION} rm -rf tcsh-${VERSION}
-mkdir tcsh-${VERSION} tcsh-${VERSION}/config -mkdir tcsh-${VERSION} tcsh-${VERSION}/config tcsh-${VERSION}/tests
cp ${ALLSRCS} tcsh-${VERSION} cp ${ALLSRCS} tcsh-${VERSION}
cp ${CONFSRCS} tcsh-${VERSION}/config cp ${CONFSRCS} tcsh-${VERSION}/config
tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -) tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -)
@ -568,7 +607,7 @@ catalogs:
tcsh-${VERSION}.tar.Z: tcsh-${VERSION}.tar.Z:
rm -rf tcsh-${VERSION} rm -rf tcsh-${VERSION}
rm -f tcsh-${VERSION}.tar tcsh-${VERSION}.tar.Z DIFFS.[123] rm -f tcsh-${VERSION}.tar tcsh-${VERSION}.tar.Z DIFFS.[123]
-mkdir tcsh-${VERSION} -mkdir tcsh-${VERSION} tcsh-${VERSION}/tests
./MAKEDIFFS bsd ./MAKEDIFFS bsd
mv DIFFS.1 DIFFS.2 DIFFS.3 tcsh-${VERSION} mv DIFFS.1 DIFFS.2 DIFFS.3 tcsh-${VERSION}
cp ${DISTSRCS} tcsh-${VERSION} cp ${DISTSRCS} tcsh-${VERSION}
@ -621,6 +660,9 @@ $(srcdir)/stamp-h.in: $(srcdir)/configure.in
cd $(srcdir) && autoheader cd $(srcdir) && autoheader
@echo timestamp > $(srcdir)/stamp-h.in @echo timestamp > $(srcdir)/stamp-h.in
check: atconfig $(srcdir)/tests/testsuite
$(SHELL) $(srcdir)/tests/testsuite
# #
# Dependencies # Dependencies
# #

View File

@ -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 # Makefile.std 4.3 6/11/83
# #
# C Shell with process control; VM/UNIX VAX Makefile # C Shell with process control; VM/UNIX VAX Makefile

View File

@ -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 # Makefile.vms 4.3 6/11/83
# #
# C Shell with process control; VM/UNIX VAX Makefile # C Shell with process control; VM/UNIX VAX Makefile

View File

@ -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 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 name completion, listing, etc. and a bunch of small additions to the
shell itself. shell itself.
@ -19,12 +19,12 @@ names of the authors from the source code or documentation).
To install tcsh: To install tcsh:
0) Try running "configure". If that works, goto step 6. 0) Try running "./configure". If that doesn't work, goto step 1.
If you are using imake, try xmkmf and goto step 3. Run "./configure --help" to see possible options. After running
If imake does not work, copy Makefile.std to Makefile. configure, goto step 3.
1) Look at the Makefile and make sure that you are using the right 1) Otherwise copy Makefile.std to Makefile. Look at the Makefile and
compilation flags. make sure that you are using the right compilation flags.
2) Copy the appropriate for your machine and OS config file from the 2) Copy the appropriate for your machine and OS config file from the
config subdirectory into config.h. Consult the file "Ported" for 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 the supplied ones. If you get tcsh working on a new machine, I'd
appreciate a copy of the config file plus additional information appreciate a copy of the config file plus additional information
about the architecture/OS. If you are creating a new config file, 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, 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 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 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. 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. 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 4) Look at host.defs to make sure that you have the right defines to set
the environment variables "HOSTTYPE", "MACHTYPE", "OSTYPE" and the environment variables "HOSTTYPE", "MACHTYPE", "OSTYPE" and
"VENDOR" correctly. If you need to make changes, PLEASE SEND THEM "VENDOR" correctly. If you need to make changes, PLEASE SEND THEM
BACK TO ME. 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 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 man entry will be placed in when you do a "make install" and "make
install.man" respectively. If you decide to install tcsh somewhere install.man" respectively. If you decide to install tcsh somewhere
other than in /usr/local/bin/tcsh, you should #define _PATH_TCSHELL other than in /usr/local/bin/tcsh, you should #define _PATH_TCSHELL
"/your/installation/directory/tcsh" in pathnames.h. "/your/installation/directory/tcsh" in pathnames.h.
6) If you've changed any of the configuration variables you may need 6) make
to re-run configure.
7) make 7) Read the documentation while you are waiting. The file tcsh.man
8) 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 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 tcsh.man2html script (requires Perl) to generate an HTML version of
the manpage which you can read with Mosaic, lynx or other HTML browser. 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. The history command should give a time stamp on every entry.
Typing normal characters should echo each exactly once. Control-A Typing normal characters should echo each exactly once. Control-A
should put the cursor at the beginning of the input line, but after 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 passwd appears on the screen, you have lost /dev/tty. Otherwise
everything is fine. 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 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 install the documentation. Don't forget to look at complete.tcsh for
useful completions... useful completions...
11) Enjoy. 10) Enjoy.
12) PLEASE file any bug reports (and fixes), code for new features at: 12) PLEASE file any bug reports (and fixes), code for new features at:

View File

@ -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 # example file using the new completion code
# #
# Debian GNU/Linux # Debian GNU/Linux

View File

@ -10,10 +10,28 @@
/* Define to 1 if you have the <auth.h> header file. */ /* Define to 1 if you have the <auth.h> header file. */
#undef HAVE_AUTH_H #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 /* Define to 1 if you have the declaration of `gethostname', and to 0 if you
don't. */ don't. */
#undef HAVE_DECL_GETHOSTNAME #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'. /* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
*/ */
#undef HAVE_DIRENT_H #undef HAVE_DIRENT_H
@ -21,6 +39,9 @@
/* Define to 1 if you have the `dup2' function. */ /* Define to 1 if you have the `dup2' function. */
#undef HAVE_DUP2 #undef HAVE_DUP2
/* Define to 1 if you have the `getauthid' function. */
#undef HAVE_GETAUTHID
/* Define to 1 if you have the `getcwd' function. */ /* Define to 1 if you have the `getcwd' function. */
#undef HAVE_GETCWD #undef HAVE_GETCWD
@ -33,7 +54,7 @@
/* Define to 1 if you have the `getutent' function. */ /* Define to 1 if you have the `getutent' function. */
#undef HAVE_GETUTENT #undef HAVE_GETUTENT
/* Define to 1 if you have the iconv () interface */ /* Define if you have the iconv() function. */
#undef HAVE_ICONV #undef HAVE_ICONV
/* Define to 1 if you have the <inttypes.h> header file. */ /* 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'. */ /* Define to 1 if the system has the type `long long'. */
#undef HAVE_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. */ /* Define to 1 if you have the `memmove' function. */
#undef HAVE_MEMMOVE #undef HAVE_MEMMOVE
@ -78,6 +102,10 @@
/* Define to 1 if you have the <stdlib.h> header file. */ /* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H #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. */ /* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR #undef HAVE_STRERROR
@ -143,6 +171,12 @@
/* Define to 1 if you have the `wcwidth' function. */ /* Define to 1 if you have the `wcwidth' function. */
#undef HAVE_WCWIDTH #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. */ /* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT #undef PACKAGE_BUGREPORT
@ -158,12 +192,6 @@
/* Define to the version of this package. */ /* Define to the version of this package. */
#undef PACKAGE_VERSION #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. */ /* Define to 1 if the `setpgrp' function takes no argument. */
#undef SETPGRP_VOID #undef SETPGRP_VOID
@ -176,9 +204,6 @@
/* Define to 1 if you have the ANSI C header files. */ /* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS #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. */ /* Define to empty if `const' does not conform to ANSI C. */
#undef const #undef const
@ -194,6 +219,9 @@
/* Define to `int' if neither <sys/types.h> nor <sys/socket.h> define. */ /* Define to `int' if neither <sys/types.h> nor <sys/socket.h> define. */
#undef socklen_t #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. */ /* Define to `int' if <sys/types.h> doesn't define. */
#undef uid_t #undef uid_t

View File

@ -20,11 +20,6 @@
*/ */
#define POSIXJOBS #define POSIXJOBS
/*
* POSIXSIGS Use the POSIX signal facilities to emulate BSD signals.
*/
#undef POSIXSIGS
/* /*
* VFORK This machine has a vfork(). * VFORK This machine has a vfork().
* It used to be that for job control to work, this define * It used to be that for job control to work, this define
@ -46,17 +41,10 @@
*/ */
#define BSDJOBS #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) * BSDTIMES You have BSD-style process time stuff (like rusage)
* This may or may not be true. For example, Apple Unix * 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 #define BSDTIMES
@ -108,7 +96,6 @@
# define _PATH_TCSHELL "/usr/contrib/bin/tcsh" # define _PATH_TCSHELL "/usr/contrib/bin/tcsh"
# endif # endif
# undef NLS
# undef NLS_CATALOGS # undef NLS_CATALOGS
#elif defined(__APPLE__) #elif defined(__APPLE__)

View File

@ -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 * config_f.h -- configure various defines for tcsh
* *
@ -50,18 +50,10 @@
* WIDE_STRINGS Represent strings using wide characters * WIDE_STRINGS Represent strings using wide characters
* Allows proper function in multibyte encodings like UTF-8 * 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 # define WIDE_STRINGS
#endif #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 * NLS_CATALOGS:Use Native Language System catalogs for
* international messages. * international messages.
@ -69,7 +61,9 @@
* if you don't have <nl_types.h>, you don't want * if you don't have <nl_types.h>, you don't want
* to define this. * to define this.
*/ */
#undef NLS_CATALOGS #if defined (NLS) && defined (HAVE_CATGETS)
# define NLS_CATALOGS
#endif
/* /*
* LOGINFIRST Source ~/.login before ~/.cshrc * LOGINFIRST Source ~/.login before ~/.cshrc
@ -149,7 +143,7 @@
* This can be much slower and no memory statistics will be * This can be much slower and no memory statistics will be
* provided. * 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 # define SYSMALLOC
#else #else
# undef SYSMALLOC # undef SYSMALLOC

1831
contrib/tcsh/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -9,9 +9,10 @@ dnl Written by Kaveh Ghazi (ghazi@caip.rutgers.edu) 5/11/96.
dnl dnl
AC_PREREQ([2.59])dnl Minimum Autoconf version required. 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_SRCDIR([tc.vers.c])
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
AC_CONFIG_TESTDIR([.], [.])
AC_CANONICAL_HOST AC_CANONICAL_HOST
@ -120,6 +121,11 @@ case "${host}" in
tcsh_config_file=bsd4.4 tcsh_config_file=bsd4.4
;; ;;
## DragonFly systems
*-*-dragonfly*)
tcsh_config_file=bsd4.4
;;
## Silicon Graphics machines ## Silicon Graphics machines
*-sgi-iri* ) *-sgi-iri* )
tcsh_config_file=irix tcsh_config_file=irix
@ -150,16 +156,16 @@ case "${host}" in
*-sun-sunos4.1.[3456]* ) *-sun-sunos4.1.[3456]* )
tcsh_config_file=sunos413 tcsh_config_file=sunos413
;; ;;
*-*-solaris2.[01]* ) # Should handle sparc or x86 *-*-solaris2.[01] ) # Should handle sparc or x86
tcsh_config_file=sol2 tcsh_config_file=sol2
;; ;;
*-sun-solaris2.2* ) # Sparc only release *-sun-solaris2.2 ) # Sparc only release
tcsh_config_file=sol22 tcsh_config_file=sol22
;; ;;
*-sun-solaris2.3* ) # Sparc only release *-sun-solaris2.3 ) # Sparc only release
tcsh_config_file=sol23 tcsh_config_file=sol23
;; ;;
*-*-solaris2.[45]* ) # Should handle sparc, x86 and powerpc *-*-solaris2.[45] ) # Should handle sparc, x86 and powerpc
tcsh_config_file=sol24 tcsh_config_file=sol24
;; ;;
*-*-solaris2.* ) # Should handle sparc, x86 and powerpc *-*-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(tgetent, termlib termcap curses ncurses)
AC_SEARCH_LIBS(gethostbyname, nsl) AC_SEARCH_LIBS(gethostbyname, nsl)
AC_SEARCH_LIBS(connect, socket) AC_SEARCH_LIBS(connect, socket)
AC_SEARCH_LIBS([iconv], [iconv], [AC_DEFINE([HAVE_ICONV], [1], AM_ICONV
[Define to 1 if you have the iconv () interface])])
dnl Checks for header files dnl Checks for header files
AC_CHECK_HEADERS([auth.h inttypes.h shadow.h stdint.h]) AC_CHECK_HEADERS([auth.h crypt.h inttypes.h shadow.h stdint.h utmp.h utmpx.h])
AC_CHECK_HEADERS([utmpx.h utmp.h])
AC_CHECK_HEADERS([wchar.h], AC_CHECK_HEADERS([wchar.h],
[AC_CHECK_SIZEOF([wchar_t], [], [dnl [AC_CHECK_SIZEOF([wchar_t], [], [dnl
#include <stdio.h> #include <stdio.h>
@ -279,10 +283,18 @@ dnl Checks for types
AC_CHECK_TYPES([long long]) AC_CHECK_TYPES([long long])
AC_TYPE_GETGROUPS AC_TYPE_GETGROUPS
AC_TYPE_MODE_T AC_TYPE_MODE_T
AC_TYPE_SIGNAL
AC_TYPE_SIZE_T AC_TYPE_SIZE_T
AC_TYPE_UID_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_DEFUN([AC_TYPE_SOCKLEN_T], [
AC_CHECK_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.]), 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]) #endif])
AC_CHECK_MEMBERS([struct utmp.ut_host, struct utmp.ut_user, struct utmp.ut_tv, AC_CHECK_MEMBERS([struct utmp.ut_host, struct utmp.ut_user, struct utmp.ut_tv,
struct utmp.ut_xtime], , , struct utmp.ut_xtime], , ,
[#ifdef HAVE_UTMPX_H [#include <sys/types.h>
#ifdef HAVE_UTMPX_H
#include <utmpx.h> #include <utmpx.h>
#define utmp utmpx #define utmp utmpx
#elif defined HAVE_UTMP_H #elif defined HAVE_UTMP_H
@ -320,16 +333,24 @@ AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family], , ,
dnl Checks for compiler characteristics dnl Checks for compiler characteristics
AC_C_CONST AC_C_CONST
AC_C_PROTOTYPES
AC_C_VOLATILE AC_C_VOLATILE
dnl checks for library functions dnl checks for library functions
AC_CHECK_DECLS([gethostname]) AC_CHECK_DECLS([crypt, environ, gethostname, getpgrp], , ,
AC_CHECK_FUNCS([dup2 getcwd gethostname getpwent getutent memmove memset] dnl [#include "config_p.h"
[nice nl_langinfo sbrk setpgid setpriority strerror strstr sysconf] dnl AC_INCLUDES_DEFAULT([])
[wcwidth]) #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_GETPGRP
AC_FUNC_MBRTOWC
AC_FUNC_SETPGRP AC_FUNC_SETPGRP
AC_FUNC_STRCOLL
dnl This is not good enough; we need sockaddr_storage too. dnl This is not good enough; we need sockaddr_storage too.
dnl See whether we can use IPv6 related functions dnl See whether we can use IPv6 related functions
@ -379,6 +400,15 @@ dnl IPv6_CHECK_FUNC(getnameinfo, DFLAGS="$DFLAGS -DINET6")
AC_SUBST(DFLAGS) 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, AC_ARG_WITH(hesiod,
[ --with-hesiod=PREFIX Use Hesiod lookup for ~ expansion], [ --with-hesiod=PREFIX Use Hesiod lookup for ~ expansion],
[hesiod="$withval"], [hesiod=no]) [hesiod="$withval"], [hesiod=no])

File diff suppressed because it is too large Load Diff

View File

@ -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 * ed.decls.h: Editor external definitions
*/ */
@ -36,240 +36,245 @@
/* /*
* ed.chared.c * ed.chared.c
*/ */
extern int InsertStr __P((Char *)); extern int InsertStr (Char *);
extern void DeleteBack __P((int)); extern void DeleteBack (int);
extern void SetKillRing __P((int)); extern void SetKillRing (int);
extern CCRETVAL GetHistLine (void);
/* /*
* ed.init.c * ed.init.c
*/ */
#ifdef SIG_WINDOW #ifdef SIG_WINDOW
extern void check_window_size __P((int)); extern void check_window_size (int);
extern RETSIGTYPE window_change __P((int)); extern void window_change (int);
#endif /* SIG_WINDOW */ #endif /* SIG_WINDOW */
extern int ed_Setup __P((int)); extern int ed_Setup (int);
extern void ed_Init __P((void)); extern void ed_Init (void);
extern int Cookedmode __P((void)); extern int Cookedmode (void);
extern int Rawmode __P((void)); extern int Rawmode (void);
extern void ed_set_tty_eight_bit __P((void)); extern void ed_set_tty_eight_bit (void);
extern void QuoteModeOn __P((void)); extern void QuoteModeOn (void);
extern void QuoteModeOff __P((void)); extern void QuoteModeOff (void);
extern void ResetInLine __P((int)); extern void ResetInLine (int);
extern int Load_input_line __P((void)); extern int Load_input_line (void);
/* /*
* ed.term.c: * ed.term.c:
*/ */
extern void dosetty __P((Char **, struct command *)); extern void dosetty (Char **, struct command *);
extern int tty_getty __P((int, ttydata_t *)); extern int tty_getty (int, ttydata_t *);
extern int tty_setty __P((int, ttydata_t *)); extern int tty_setty (int, ttydata_t *);
extern void tty_getchar __P((ttydata_t *, unsigned char *)); extern void tty_getchar (ttydata_t *, unsigned char *);
extern void tty_setchar __P((ttydata_t *, unsigned char *)); extern void tty_setchar (ttydata_t *, unsigned char *);
extern speed_t tty_getspeed __P((ttydata_t *)); extern speed_t tty_getspeed (ttydata_t *);
extern int tty_gettabs __P((ttydata_t *)); extern int tty_gettabs (ttydata_t *);
extern int tty_geteightbit __P((ttydata_t *)); extern int tty_geteightbit (ttydata_t *);
extern int tty_cooked_mode __P((ttydata_t *)); extern int tty_cooked_mode (ttydata_t *);
#ifdef _IBMR2 #ifdef _IBMR2
extern void tty_setdisc __P((int, int)); extern void tty_setdisc (int, int);
#endif /* _IBMR2 */ #endif /* _IBMR2 */
/* /*
* ed.screen.c * ed.screen.c
*/ */
extern void terminit __P((void)); extern void terminit (void);
extern void SetAttributes __P((Char)); extern void SetAttributes (Char);
extern void so_write __P((Char *, int)); extern void so_write (Char *, int);
extern void ClearScreen __P((void)); extern void ClearScreen (void);
extern void MoveToLine __P((int)); extern void MoveToLine (int);
extern void MoveToChar __P((int)); extern void MoveToChar (int);
extern void ClearEOL __P((int)); extern void ClearEOL (int);
extern void Insert_write __P((Char *, int)); extern void Insert_write (Char *, int);
extern void DeleteChars __P((int)); extern void DeleteChars (int);
extern void TellTC __P((void)); extern void TellTC (void);
extern void SetTC __P((char *, char *)); extern void SetTC (char *, char *);
extern void EchoTC __P((Char **)); extern void EchoTC (Char **);
extern int SetArrowKeys __P((CStr *, XmapVal *, int)); extern int SetArrowKeys (const CStr *, XmapVal *, int);
extern int IsArrowKey __P((Char *)); extern int IsArrowKey (Char *);
extern void ResetArrowKeys __P((void)); extern void ResetArrowKeys (void);
extern void DefaultArrowKeys __P((void)); extern void DefaultArrowKeys (void);
extern int ClearArrowKeys __P((CStr *)); extern int ClearArrowKeys (const CStr *);
extern void PrintArrowKeys __P((CStr *)); extern void PrintArrowKeys (const CStr *);
extern void BindArrowKeys __P((void)); extern void BindArrowKeys (void);
extern void SoundBeep __P((void)); extern void SoundBeep (void);
extern int CanWeTab __P((void)); extern int CanWeTab (void);
extern void ChangeSize __P((int, int)); extern void ChangeSize (int, int);
#ifdef SIG_WINDOW #ifdef SIG_WINDOW
extern int GetSize __P((int *, int *)); extern int GetSize (int *, int *);
#endif /* SIG_WINDOW */ #endif /* SIG_WINDOW */
extern void ClearToBottom __P((void)); extern void ClearToBottom (void);
extern void GetTermCaps __P((void)); extern void GetTermCaps (void);
extern void StartHighlight (void);
extern void StopHighlight (void);
/* /*
* ed.defns.c * ed.defns.c
*/ */
extern void editinit __P((void)); extern void editinit (void);
extern void ed_InitNLSMaps __P((void)); extern void ed_InitNLSMaps (void);
#ifdef DEBUG_EDIT #ifdef DEBUG_EDIT
extern void CheckMaps __P((void)); extern void CheckMaps (void);
#endif #endif
extern void ed_InitMaps __P((void)); extern void ed_InitMaps (void);
extern void ed_InitEmacsMaps __P((void)); extern void ed_InitEmacsMaps (void);
extern void ed_InitVIMaps __P((void)); extern void ed_InitVIMaps (void);
extern CCRETVAL e_unassigned __P((Char)); extern CCRETVAL e_unassigned (Char);
extern CCRETVAL e_insert __P((Char)); extern CCRETVAL e_insert (Char);
extern CCRETVAL e_newline __P((Char)); extern CCRETVAL e_newline (Char);
extern CCRETVAL e_delprev __P((Char)); extern CCRETVAL e_delprev (Char);
extern CCRETVAL e_delnext __P((Char)); extern CCRETVAL e_delnext (Char);
/* added by mtk@ari.ncl.omron.co.jp (920818) */ /* added by mtk@ari.ncl.omron.co.jp (920818) */
extern CCRETVAL e_delnext_eof __P((Char)); extern CCRETVAL e_delnext_eof (Char);
extern CCRETVAL e_delnext_list __P((Char)); extern CCRETVAL e_delnext_list (Char);
extern CCRETVAL e_delnext_list_eof __P((Char)); /* for ^D */ extern CCRETVAL e_delnext_list_eof (Char); /* for ^D */
extern CCRETVAL e_toend __P((Char)); extern CCRETVAL e_toend (Char);
extern CCRETVAL e_tobeg __P((Char)); extern CCRETVAL e_tobeg (Char);
extern CCRETVAL e_charback __P((Char)); extern CCRETVAL e_charback (Char);
extern CCRETVAL e_charfwd __P((Char)); extern CCRETVAL e_charfwd (Char);
extern CCRETVAL e_quote __P((Char)); extern CCRETVAL e_quote (Char);
extern CCRETVAL e_startover __P((Char)); extern CCRETVAL e_startover (Char);
extern CCRETVAL e_redisp __P((Char)); extern CCRETVAL e_redisp (Char);
extern CCRETVAL e_wordback __P((Char)); extern CCRETVAL e_wordback (Char);
extern CCRETVAL e_wordfwd __P((Char)); extern CCRETVAL e_wordfwd (Char);
extern CCRETVAL v_wordbegnext __P((Char)); extern CCRETVAL v_wordbegnext (Char);
extern CCRETVAL e_uppercase __P((Char)); extern CCRETVAL e_uppercase (Char);
extern CCRETVAL e_lowercase __P((Char)); extern CCRETVAL e_lowercase (Char);
extern CCRETVAL e_capitolcase __P((Char)); extern CCRETVAL e_capitolcase (Char);
extern CCRETVAL e_cleardisp __P((Char)); extern CCRETVAL e_cleardisp (Char);
extern CCRETVAL e_complete __P((Char)); extern CCRETVAL e_complete (Char);
extern CCRETVAL e_correct __P((Char)); extern CCRETVAL e_correct (Char);
extern CCRETVAL e_correctl __P((Char)); extern CCRETVAL e_correctl (Char);
extern CCRETVAL e_up_hist __P((Char)); extern CCRETVAL e_up_hist (Char);
extern CCRETVAL e_down_hist __P((Char)); extern CCRETVAL e_down_hist (Char);
extern CCRETVAL e_up_search_hist __P((Char)); extern CCRETVAL e_up_search_hist (Char);
extern CCRETVAL e_down_search_hist __P((Char)); extern CCRETVAL e_down_search_hist (Char);
extern CCRETVAL e_helpme __P((Char)); extern CCRETVAL e_helpme (Char);
extern CCRETVAL e_list_choices __P((Char)); extern CCRETVAL e_list_choices (Char);
extern CCRETVAL e_delwordprev __P((Char)); extern CCRETVAL e_delwordprev (Char);
extern CCRETVAL e_delwordnext __P((Char)); extern CCRETVAL e_delwordnext (Char);
extern CCRETVAL e_digit __P((Char)); extern CCRETVAL e_digit (Char);
extern CCRETVAL e_argdigit __P((Char)); extern CCRETVAL e_argdigit (Char);
extern CCRETVAL v_zero __P((Char)); extern CCRETVAL v_zero (Char);
extern CCRETVAL e_killend __P((Char)); extern CCRETVAL e_killend (Char);
extern CCRETVAL e_killbeg __P((Char)); extern CCRETVAL e_killbeg (Char);
extern CCRETVAL e_metanext __P((Char)); extern CCRETVAL e_metanext (Char);
#ifdef notdef #ifdef notdef
extern CCRETVAL e_extendnext __P((Char)); extern CCRETVAL e_extendnext (Char);
#endif #endif
extern CCRETVAL e_send_eof __P((Char)); extern CCRETVAL e_send_eof (Char);
extern CCRETVAL e_charswitch __P((Char)); extern CCRETVAL e_charswitch (Char);
extern CCRETVAL e_gcharswitch __P((Char)); extern CCRETVAL e_gcharswitch (Char);
extern CCRETVAL e_which __P((Char)); extern CCRETVAL e_which (Char);
extern CCRETVAL e_yank_kill __P((Char)); extern CCRETVAL e_yank_kill (Char);
extern CCRETVAL e_tty_dsusp __P((Char)); extern CCRETVAL e_tty_dsusp (Char);
extern CCRETVAL e_tty_flusho __P((Char)); extern CCRETVAL e_tty_flusho (Char);
extern CCRETVAL e_tty_quit __P((Char)); extern CCRETVAL e_tty_quit (Char);
extern CCRETVAL e_tty_tsusp __P((Char)); extern CCRETVAL e_tty_tsusp (Char);
extern CCRETVAL e_tty_stopo __P((Char)); extern CCRETVAL e_tty_stopo (Char);
extern CCRETVAL e_tty_starto __P((Char)); extern CCRETVAL e_tty_starto (Char);
extern CCRETVAL e_argfour __P((Char)); extern CCRETVAL e_argfour (Char);
extern CCRETVAL e_set_mark __P((Char)); extern CCRETVAL e_set_mark (Char);
extern CCRETVAL e_exchange_mark __P((Char)); extern CCRETVAL e_exchange_mark (Char);
extern CCRETVAL e_last_item __P((Char)); extern CCRETVAL e_last_item (Char);
extern CCRETVAL v_cmd_mode __P((Char)); extern CCRETVAL v_cmd_mode (Char);
extern CCRETVAL v_insert __P((Char)); extern CCRETVAL v_insert (Char);
extern CCRETVAL v_replmode __P((Char)); extern CCRETVAL v_replmode (Char);
extern CCRETVAL v_replone __P((Char)); extern CCRETVAL v_replone (Char);
extern CCRETVAL v_substline __P((Char)); extern CCRETVAL v_substline (Char);
extern CCRETVAL v_substchar __P((Char)); extern CCRETVAL v_substchar (Char);
extern CCRETVAL v_add __P((Char)); extern CCRETVAL v_add (Char);
extern CCRETVAL v_addend __P((Char)); extern CCRETVAL v_addend (Char);
extern CCRETVAL v_insbeg __P((Char)); extern CCRETVAL v_insbeg (Char);
extern CCRETVAL v_chgtoend __P((Char)); extern CCRETVAL v_chgtoend (Char);
extern CCRETVAL e_killregion __P((Char)); extern CCRETVAL e_killregion (Char);
extern CCRETVAL e_killall __P((Char)); extern CCRETVAL e_killall (Char);
extern CCRETVAL e_copyregion __P((Char)); extern CCRETVAL e_copyregion (Char);
extern CCRETVAL e_tty_int __P((Char)); extern CCRETVAL e_tty_int (Char);
extern CCRETVAL e_run_fg_editor __P((Char)); extern CCRETVAL e_run_fg_editor (Char);
extern CCRETVAL e_list_eof __P((Char)); extern CCRETVAL e_list_eof (Char);
extern CCRETVAL e_expand_history __P((Char)); extern CCRETVAL e_expand_history (Char);
extern CCRETVAL e_magic_space __P((Char)); extern CCRETVAL e_magic_space (Char);
extern CCRETVAL e_list_glob __P((Char)); extern CCRETVAL e_list_glob (Char);
extern CCRETVAL e_expand_glob __P((Char)); extern CCRETVAL e_expand_glob (Char);
extern CCRETVAL e_insovr __P((Char)); extern CCRETVAL e_insovr (Char);
extern CCRETVAL v_cm_complete __P((Char)); extern CCRETVAL v_cm_complete (Char);
extern CCRETVAL e_copyprev __P((Char)); extern CCRETVAL e_copyprev (Char);
extern CCRETVAL v_change_case __P((Char)); extern CCRETVAL v_change_case (Char);
extern CCRETVAL e_expand __P((Char)); extern CCRETVAL e_expand (Char);
extern CCRETVAL e_expand_vars __P((Char)); extern CCRETVAL e_expand_vars (Char);
extern CCRETVAL e_toggle_hist __P((Char)); extern CCRETVAL e_toggle_hist (Char);
extern CCRETVAL e_load_average __P((Char)); extern CCRETVAL e_load_average (Char);
extern CCRETVAL v_delprev __P((Char)); extern CCRETVAL v_delprev (Char);
extern CCRETVAL v_delmeta __P((Char)); extern CCRETVAL v_delmeta (Char);
extern CCRETVAL v_wordfwd __P((Char)); extern CCRETVAL v_wordfwd (Char);
extern CCRETVAL v_wordback __P((Char)); extern CCRETVAL v_wordback (Char);
extern CCRETVAL v_endword __P((Char)); extern CCRETVAL v_endword (Char);
extern CCRETVAL v_eword __P((Char)); extern CCRETVAL v_eword (Char);
extern CCRETVAL v_undo __P((Char)); extern CCRETVAL v_undo (Char);
extern CCRETVAL v_ush_meta __P((Char)); extern CCRETVAL v_ush_meta (Char);
extern CCRETVAL v_dsh_meta __P((Char)); extern CCRETVAL v_dsh_meta (Char);
extern CCRETVAL v_rsrch_fwd __P((Char)); extern CCRETVAL v_rsrch_fwd (Char);
extern CCRETVAL v_rsrch_back __P((Char)); extern CCRETVAL v_rsrch_back (Char);
extern CCRETVAL v_char_fwd __P((Char)); extern CCRETVAL v_char_fwd (Char);
extern CCRETVAL v_char_back __P((Char)); extern CCRETVAL v_char_back (Char);
extern CCRETVAL v_chgmeta __P((Char)); extern CCRETVAL v_chgmeta (Char);
extern CCRETVAL e_inc_fwd __P((Char)); extern CCRETVAL e_inc_fwd (Char);
extern CCRETVAL e_inc_back __P((Char)); extern CCRETVAL e_inc_back (Char);
extern CCRETVAL v_rchar_fwd __P((Char)); extern CCRETVAL v_rchar_fwd (Char);
extern CCRETVAL v_rchar_back __P((Char)); extern CCRETVAL v_rchar_back (Char);
extern CCRETVAL v_charto_fwd __P((Char)); extern CCRETVAL v_charto_fwd (Char);
extern CCRETVAL v_charto_back __P((Char)); extern CCRETVAL v_charto_back (Char);
extern CCRETVAL e_normalize_path __P((Char)); extern CCRETVAL e_normalize_path (Char);
extern CCRETVAL e_normalize_command __P((Char)); extern CCRETVAL e_normalize_command (Char);
extern CCRETVAL e_stuff_char __P((Char)); extern CCRETVAL e_stuff_char (Char);
extern CCRETVAL e_list_all __P((Char)); extern CCRETVAL e_list_all (Char);
extern CCRETVAL e_complete_all __P((Char)); extern CCRETVAL e_complete_all (Char);
extern CCRETVAL e_complete_fwd __P((Char)); extern CCRETVAL e_complete_fwd (Char);
extern CCRETVAL e_complete_back __P((Char)); extern CCRETVAL e_complete_back (Char);
extern CCRETVAL e_dabbrev_expand __P((Char)); extern CCRETVAL e_dabbrev_expand (Char);
extern CCRETVAL e_copy_to_clipboard __P((Char)); extern CCRETVAL e_copy_to_clipboard (Char);
extern CCRETVAL e_paste_from_clipboard __P((Char)); extern CCRETVAL e_paste_from_clipboard (Char);
extern CCRETVAL e_dosify_next __P((Char)); extern CCRETVAL e_dosify_next (Char);
extern CCRETVAL e_dosify_prev __P((Char)); extern CCRETVAL e_dosify_prev (Char);
extern CCRETVAL e_page_up __P((Char)); extern CCRETVAL e_page_up (Char);
extern CCRETVAL e_page_down __P((Char)); extern CCRETVAL e_page_down (Char);
extern CCRETVAL e_yank_pop __P((Char)); extern CCRETVAL e_yank_pop (Char);
extern CCRETVAL e_newline_hold (Char);
extern CCRETVAL e_newline_down_hist (Char);
/* /*
* ed.inputl.c * ed.inputl.c
*/ */
extern int Inputl __P((void)); extern int Inputl (void);
extern int GetNextChar __P((Char *)); extern int GetNextChar (Char *);
extern void UngetNextChar __P((Char)); extern void UngetNextChar (Char);
extern void PushMacro __P((Char *)); extern void PushMacro (Char *);
/* /*
* ed.refresh.c * ed.refresh.c
*/ */
extern void ClearLines __P((void)); extern void ClearLines (void);
extern void ClearDisp __P((void)); extern void ClearDisp (void);
extern void Refresh __P((void)); extern void Refresh (void);
extern void RefCursor __P((void)); extern void RefCursor (void);
extern void RefPlusOne __P((int)); extern void RefPlusOne (int);
extern void PastBottom __P((void)); extern void PastBottom (void);
/* /*
* ed.xmap.c * ed.xmap.c
*/ */
extern XmapVal *XmapStr __P((CStr *)); extern XmapVal *XmapStr (CStr *);
extern XmapVal *XmapCmd __P((int)); extern XmapVal *XmapCmd (int);
extern void AddXkey __P((CStr *, XmapVal *, int)); extern void AddXkey (const CStr *, XmapVal *, int);
extern void ClearXkey __P((KEYCMD *, CStr *)); extern void ClearXkey (KEYCMD *, const CStr *);
extern int GetXkey __P((CStr *, XmapVal *)); extern int GetXkey (CStr *, XmapVal *);
extern void ResetXmap __P((void)); extern void ResetXmap (void);
extern int DeleteXkey __P((CStr *)); extern int DeleteXkey (const CStr *);
extern void PrintXkey __P((CStr *)); extern void PrintXkey (const CStr *);
extern int printOne __P((CStr *, XmapVal *, int)); extern void printOne (const Char *, const XmapVal *, int);
extern eChar parseescape __P((const Char **)); extern eChar parseescape (const Char **);
extern unsigned char *unparsestring __P((CStr *, unsigned char *, Char *)); extern unsigned char *unparsestring (const CStr *, const Char *);
#endif /* _h_ed_decls */ #endif /* _h_ed_decls */

View File

@ -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 * ed.defns.c: Editor function definitions and initialization
*/ */
@ -32,11 +32,11 @@
*/ */
#include "sh.h" #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" #include "ed.h"
static void ed_InitMetaBindings __P((void)); static void ed_InitMetaBindings (void);
PFCmd CcFuncTbl[] = { /* table of available commands */ PFCmd CcFuncTbl[] = { /* table of available commands */
e_unassigned, e_unassigned,
@ -279,8 +279,12 @@ PFCmd CcFuncTbl[] = { /* table of available commands */
#define F_PAGE_DOWN 118 #define F_PAGE_DOWN 118
e_yank_pop, e_yank_pop,
#define F_YANK_POP 119 #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 */ 0 /* DUMMY VALUE */
#define F_NUM_FNS 120 #define F_NUM_FNS 122
}; };
@ -493,7 +497,7 @@ KEYCMD CcEmacsMap[] = {
F_UNASSIGNED, /* M-> */ F_UNASSIGNED, /* M-> */
F_WHICH, /* M-? */ F_WHICH, /* M-? */
F_UNASSIGNED, /* M-@ */ F_UNASSIGNED, /* M-@ */
F_UNASSIGNED, /* M-A */ F_NEWLINE_HOLD, /* M-A */
F_WORDBACK, /* M-B */ F_WORDBACK, /* M-B */
F_CASECAPITAL, /* M-C */ F_CASECAPITAL, /* M-C */
F_DELWORDNEXT, /* M-D */ F_DELWORDNEXT, /* M-D */
@ -525,7 +529,7 @@ KEYCMD CcEmacsMap[] = {
F_UNASSIGNED, /* M-^ */ F_UNASSIGNED, /* M-^ */
F_LAST_ITEM, /* M-_ */ F_LAST_ITEM, /* M-_ */
F_UNASSIGNED, /* M-` */ F_UNASSIGNED, /* M-` */
F_UNASSIGNED, /* M-a */ F_NEWLINE_HOLD, /* M-a */
F_WORDBACK, /* M-b */ F_WORDBACK, /* M-b */
F_CASECAPITAL, /* M-c */ F_CASECAPITAL, /* M-c */
F_DELWORDNEXT, /* M-d */ F_DELWORDNEXT, /* M-d */
@ -1120,7 +1124,7 @@ KEYCMD CcViCmdMap[] = {
void void
editinit() editinit(void)
{ {
struct KeyFuncs *f; struct KeyFuncs *f;
@ -1128,7 +1132,7 @@ editinit()
int i; int i;
for (i = 0; i < F_NUM_FUNCNAMES; i++) for (i = 0; i < F_NUM_FUNCNAMES; i++)
xfree((ptr_t) FuncNames[i].desc); xfree((ptr_t)(intptr_t)FuncNames[i].desc);
#endif #endif
f = FuncNames; f = FuncNames;
@ -1407,6 +1411,16 @@ editinit()
f->func = F_NEWLINE; f->func = F_NEWLINE;
f->desc = CSAVS(3, 52, "Execute command"); 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++;
f->name = "normalize-path"; f->name = "normalize-path";
f->func = F_PATH_NORM; f->func = F_PATH_NORM;
@ -1785,7 +1799,7 @@ editinit()
#ifdef DEBUG_EDIT #ifdef DEBUG_EDIT
void void
CheckMaps() CheckMaps(void)
{ /* check the size of the key maps */ { /* check the size of the key maps */
int c1 = (NT_NUM_KEYS * sizeof(KEYCMD)); int c1 = (NT_NUM_KEYS * sizeof(KEYCMD));
@ -1817,7 +1831,7 @@ int NLSMapsAreInited = 0;
int NoNLSRebind; int NoNLSRebind;
void void
ed_InitNLSMaps() ed_InitNLSMaps(void)
{ {
int i; int i;
@ -1834,7 +1848,7 @@ ed_InitNLSMaps()
} }
static void static void
ed_InitMetaBindings() ed_InitMetaBindings(void)
{ {
Char buf[3]; Char buf[3];
int i; int i;
@ -1870,7 +1884,7 @@ ed_InitMetaBindings()
} }
void void
ed_InitVIMaps() ed_InitVIMaps(void)
{ {
int i; int i;
@ -1887,7 +1901,7 @@ ed_InitVIMaps()
} }
void void
ed_InitEmacsMaps() ed_InitEmacsMaps(void)
{ {
int i; int i;
Char buf[3]; Char buf[3];
@ -1930,7 +1944,7 @@ ed_InitEmacsMaps()
} }
void void
ed_InitMaps() ed_InitMaps(void)
{ {
if (MapsAreInited) if (MapsAreInited)
return; return;

View File

@ -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 * ed.h: Editor declarations and globals
*/ */
@ -37,7 +37,6 @@
# define EXTERN extern # define EXTERN extern
#endif #endif
#define TABSIZE 8 /* usually 8 spaces/tab */
#define MAXMACROLEVELS 10 /* max number of nested kbd macros */ #define MAXMACROLEVELS 10 /* max number of nested kbd macros */
#ifndef WINNT_NATIVE #ifndef WINNT_NATIVE
@ -54,7 +53,7 @@
#define KEYCMD unsigned char /* size needed to index into CcFuncTbl */ #define KEYCMD unsigned char /* size needed to index into CcFuncTbl */
/* Must be unsigned */ /* 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 */ struct KeyFuncs { /* for the "bind" shell command */
const char *name; /* function name for bind command */ const char *name; /* function name for bind command */
@ -100,7 +99,7 @@ typedef struct {
int len; int len;
} CStr; } CStr;
typedef union Xmapval { /* value passed to the Xkey routines */ typedef union { /* value passed to the Xkey routines */
KEYCMD cmd; KEYCMD cmd;
CStr str; CStr str;
} XmapVal; } XmapVal;
@ -118,13 +117,14 @@ EXTERN KEYCMD *CurrentKeyMap; /* current command key map */
EXTERN int inputmode; /* insert, replace, replace1 mode */ EXTERN int inputmode; /* insert, replace, replace1 mode */
EXTERN Char GettingInput; /* true if getting an input line (mostly) */ EXTERN Char GettingInput; /* true if getting an input line (mostly) */
EXTERN Char NeedsRedraw; /* for editor and twenex error messages */ 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 *LastChar, *Cursor; /* point to the next open space */
EXTERN Char *InputLim; /* limit of size of InputBuf */ EXTERN Char *InputLim; /* limit of size of InputBuf */
EXTERN Char MetaNext; /* flags for ^V and ^[ functions */ EXTERN Char MetaNext; /* flags for ^V and ^[ functions */
EXTERN Char AltKeyMap; /* Using alternative command map (for vi mode) */ 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 VImode; /* true if running in vi mode (PWP 6-27-88) */
EXTERN Char *Mark; /* the emacs "mark" (dot is Cursor) */ 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 Char DoingArg; /* true if we have an argument */
EXTERN int Argument; /* "universal" argument value */ EXTERN int Argument; /* "universal" argument value */
EXTERN KEYCMD LastCmd; /* previous command executed */ 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 KillPos; /* points to next kill */
EXTERN int YankPos; /* points to next yank */ EXTERN int YankPos; /* points to next yank */
EXTERN Char UndoBuf[INBUFSIZE]; EXTERN Char UndoBuf[INBUFSIZE];/*FIXBUF*/
EXTERN Char *UndoPtr; EXTERN Char *UndoPtr;
EXTERN int UndoSize; EXTERN int UndoSize;
EXTERN int UndoAction; EXTERN int UndoAction;
EXTERN Char HistBuf[INBUFSIZE]; /* history buffer */ EXTERN struct Strbuf HistBuf; /* = Strbuf_INIT; history buffer */
EXTERN Char *LastHist; /* points to end of history buffer */
EXTERN int Hist_num; /* what point up the history we are at now. */ EXTERN int Hist_num; /* what point up the history we are at now. */
EXTERN Char WhichBuf[INBUFSIZE]; /* buffer for which command */ /* buffer for which command and others */
EXTERN Char *LastWhich; /* points to end of which buffer */ EXTERN struct Strbuf SavedBuf; /* = Strbuf_INIT; */
EXTERN Char *CursWhich; /* points to the cursor point in which buf */ EXTERN size_t LastSaved; /* points to end of saved buffer */
EXTERN int HistWhich; /* Hist_num is saved in this */ 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 Expand; /* true if we are expanding a line */
extern Char HistLit; /* true if history lines are shown literal */ extern Char HistLit; /* true if history lines are shown literal */
EXTERN Char CurrentHistLit; /* Literal status of current show history line */ 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 int T_Lines, T_Cols; /* Rows and Cols of the terminal */
EXTERN Char T_CanIns; /* true if I can insert characters */ EXTERN Char T_CanIns; /* true if I can insert characters */
EXTERN Char T_CanDel; /* dito for delete characters */ EXTERN Char T_CanDel; /* dito for delete characters */
EXTERN Char T_Tabs; /* true if tty interface is passing tabs */ EXTERN char T_Tabs; /* true if tty interface is passing tabs */
EXTERN Char T_Margin; EXTERN char T_Margin;
#define MARGIN_AUTO 1 /* term has auto margins */ #define MARGIN_AUTO 1 /* term has auto margins */
#define MARGIN_MAGIC 2 /* concept glitch */ #define MARGIN_MAGIC 2 /* concept glitch */
EXTERN speed_t T_Speed; /* Tty input Baud rate */ 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_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_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 */ /* note the extra characters in the Strchr() call in this macro */
#define isword(c) (Isalpha(c)||Isdigit(c)||Strchr(word_chars,c)) #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! * We don't prototype these, cause some systems have them wrong!
*/ */
extern int tgetent __P(()); extern int tgetent ();
extern char *tgetstr __P(()); extern char *tgetstr ();
extern int tgetflag __P(()); extern int tgetflag ();
extern int tgetnum __P(()); extern int tgetnum ();
extern char *tgoto __P(()); extern char *tgoto ();
# define PUTPURE putpure # define PUTPURE putpure
# define PUTRAW putraw # define PUTRAW putraw
#else #else
extern int tgetent __P((char *, const char *)); extern int tgetent (char *, const char *);
extern char *tgetstr __P((const char *, char **)); extern char *tgetstr (const char *, char **);
extern int tgetflag __P((const char *)); extern int tgetflag (const char *);
extern int tgetnum __P((const char *)); extern int tgetnum (const char *);
extern char *tgoto __P((const char *, int, int)); extern char *tgoto (const char *, int, int);
extern void tputs __P((const char *, int, void (*)(int))); extern void tputs (const char *, int, void (*)(int));
# define PUTPURE ((void (*)__P((int))) putpure) # define PUTPURE ((void (*)(int)) putpure)
# define PUTRAW ((void (*)__P((int))) putraw) # define PUTRAW ((void (*)(int)) putraw)
#endif #endif
#endif /* _h_ed */ #endif /* _h_ed */

View File

@ -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 * ed.init.c: Editor initializations
*/ */
@ -32,7 +32,7 @@
*/ */
#include "sh.h" #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 "ed.h"
#include "tc.h" #include "tc.h"
@ -90,20 +90,13 @@ static unsigned char ttychars[NN_IO][C_NCC] = {
#ifdef SIG_WINDOW #ifdef SIG_WINDOW
void void
check_window_size(force) check_window_size(int force)
int force;
{ {
#ifdef BSDSIGS
sigmask_t omask;
#endif /* BSDSIGS */
int lins, cols; int lins, cols;
/* don't want to confuse things here */ /* don't want to confuse things here */
#ifdef BSDSIGS pintr_disabled++;
omask = sigblock(sigmask(SIG_WINDOW)) & ~sigmask(SIG_WINDOW); cleanup_push(&pintr_disabled, disabled_cleanup);
#else /* BSDSIGS */
(void) sighold(SIG_WINDOW);
#endif /* BSDSIGS */
/* /*
* From: bret@shark.agps.lanl.gov (Bret Thaeler) Avoid sunview bug, where a * 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 * partially hidden window gets a SIG_WINDOW every time the text is
@ -121,32 +114,22 @@ check_window_size(force)
else else
ChangeSize(lins, cols); ChangeSize(lins, cols);
} }
#ifdef BSDSIGS
(void) sigsetmask(omask); /* can change it again */
#else /* BSDSIGS */
(void) sigrelse(SIG_WINDOW);
#endif /* BSDSIGS */
windowchg = 0; windowchg = 0;
cleanup_until(&pintr_disabled); /* can change it again */
} }
RETSIGTYPE void
/*ARGSUSED*/ /*ARGSUSED*/
window_change(snum) window_change(int snum)
int snum;
{ {
USE(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; windowchg = 1;
} }
#endif /* SIG_WINDOW */ #endif /* SIG_WINDOW */
void void
ed_set_tty_eight_bit() ed_set_tty_eight_bit(void)
{ {
if (tty_getty(SHTTY, &extty) == -1) { if (tty_getty(SHTTY, &extty) == -1) {
#ifdef DEBUG_TTY #ifdef DEBUG_TTY
@ -159,8 +142,7 @@ ed_set_tty_eight_bit()
int int
ed_Setup(rst) ed_Setup(int rst)
int rst;
{ {
static int havesetup = 0; static int havesetup = 0;
struct varent *imode; struct varent *imode;
@ -279,8 +261,14 @@ ed_Setup(rst)
tty_setchar(&extty, ttychars[EX_IO]); tty_setchar(&extty, ttychars[EX_IO]);
# ifdef SIG_WINDOW # 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 */ #else /* WINNT_NATIVE */
# ifdef DEBUG # ifdef DEBUG
if (rst) if (rst)
@ -292,7 +280,7 @@ ed_Setup(rst)
} }
void void
ed_Init() ed_Init(void)
{ {
ResetInLine(1); /* reset the input pointers */ ResetInLine(1); /* reset the input pointers */
GettingInput = 0; /* just in case */ GettingInput = 0; /* just in case */
@ -308,8 +296,7 @@ ed_Init()
{ /* no kill ring - why? */ { /* no kill ring - why? */
int i; int i;
for (i = 0; i < KillRingMax; i++) { for (i = 0; i < KillRingMax; i++) {
if (KillRing[i].buf != NULL) xfree(KillRing[i].buf);
xfree((ptr_t) KillRing[i].buf);
KillRing[i].buf = NULL; KillRing[i].buf = NULL;
KillRing[i].len = 0; 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. * Check and re-init the line. set the terminal into 1 char at a time mode.
*/ */
int int
Rawmode() Rawmode(void)
{ {
if (Tty_raw_mode) if (Tty_raw_mode)
return (0); return (0);
@ -561,12 +548,13 @@ Rawmode()
} }
int int
Cookedmode() Cookedmode(void)
{ /* set tty in normal setup */ { /* set tty in normal setup */
#ifdef WINNT_NATIVE #ifdef WINNT_NATIVE
do_nt_cooked_mode(); do_nt_cooked_mode();
#else #else
signalfun_t orig_intr; sigset_t set, oset;
int res;
# ifdef _IBMR2 # ifdef _IBMR2
tty_setdisc(SHTTY, EX_IO); tty_setdisc(SHTTY, EX_IO);
@ -576,45 +564,18 @@ Cookedmode()
return (0); return (0);
/* hold this for reseting tty */ /* hold this for reseting tty */
# ifdef BSDSIGS sigemptyset(&set);
orig_intr = (signalfun_t) signal(SIGINT, SIG_IGN); sigaddset(&set, SIGINT);
# else (void)sigprocmask(SIG_BLOCK, &set, &oset);
# ifdef SIG_HOLD cleanup_push(&oset, sigprocmask_cleanup);
/* res = tty_setty(SHTTY, &extty);
* sigset doesn't return the previous handler if the signal is held, cleanup_until(&oset);
* it will return SIG_HOLD instead. So instead of restoring the if (res == -1) {
* 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) {
# ifdef DEBUG_TTY # ifdef DEBUG_TTY
xprintf("Cookedmode: tty_setty: %s\n", strerror(errno)); xprintf("Cookedmode: tty_setty: %s\n", strerror(errno));
# endif /* DEBUG_TTY */ # endif /* DEBUG_TTY */
return -1; 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 */ #endif /* WINNT_NATIVE */
Tty_raw_mode = 0; Tty_raw_mode = 0;
@ -622,13 +583,13 @@ Cookedmode()
} }
void void
ResetInLine(macro) ResetInLine(int macro)
int macro;
{ {
Cursor = InputBuf; /* reset cursor */ Cursor = InputBuf; /* reset cursor */
LastChar = InputBuf; LastChar = InputBuf;
InputLim = &InputBuf[INBUFSIZE - 2]; InputLim = &InputBuf[INBUFSIZE - 2];/*FIXBUF*/
Mark = InputBuf; Mark = InputBuf;
MarkIsSet = 0;
MetaNext = 0; MetaNext = 0;
CurrentKeyMap = CcKeyMap; CurrentKeyMap = CcKeyMap;
AltKeyMap = 0; AltKeyMap = 0;
@ -636,14 +597,15 @@ ResetInLine(macro)
DoingArg = 0; DoingArg = 0;
Argument = 1; Argument = 1;
LastCmd = F_UNASSIGNED; /* previous command executed */ LastCmd = F_UNASSIGNED; /* previous command executed */
IncMatchLen = 0;
if (macro) if (macro)
MacroLvl = -1; /* no currently active macros */ MacroLvl = -1; /* no currently active macros */
} }
static Char *Input_Line = NULL;
int int
Load_input_line() Load_input_line(void)
{ {
static Char *Input_Line = NULL;
#ifdef SUNOS4 #ifdef SUNOS4
long chrs = 0; long chrs = 0;
#else /* !SUNOS4 */ #else /* !SUNOS4 */
@ -655,7 +617,7 @@ Load_input_line()
#endif /* SUNOS4 */ #endif /* SUNOS4 */
if (Input_Line) if (Input_Line)
xfree((ptr_t) Input_Line); xfree(Input_Line);
Input_Line = NULL; Input_Line = NULL;
if (Tty_raw_mode) if (Tty_raw_mode)
@ -664,9 +626,9 @@ Load_input_line()
#if defined(FIONREAD) && !defined(OREO) #if defined(FIONREAD) && !defined(OREO)
(void) ioctl(SHIN, FIONREAD, (ioctl_t) &chrs); (void) ioctl(SHIN, FIONREAD, (ioctl_t) &chrs);
if (chrs > 0) { 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) { if (chrs > 0) {
buf[chrs] = '\0'; buf[chrs] = '\0';
Input_Line = Strsave(str2short(buf)); Input_Line = Strsave(str2short(buf));
@ -692,7 +654,7 @@ Load_input_line()
* (via Hans J Albertsson (thanks)) * (via Hans J Albertsson (thanks))
*/ */
void void
QuoteModeOn() QuoteModeOn(void)
{ {
if (MacroLvl >= 0) if (MacroLvl >= 0)
return; return;
@ -731,7 +693,7 @@ QuoteModeOn()
} }
void void
QuoteModeOff() QuoteModeOff(void)
{ {
if (!Tty_quote_mode) if (!Tty_quote_mode)
return; return;

View File

@ -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. * ed.inputl.c: Input line handling.
*/ */
@ -32,13 +32,13 @@
*/ */
#include "sh.h" #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.h"
#include "ed.defns.h" /* for the function names */ #include "ed.defns.h" /* for the function names */
#include "tw.h" /* for twenex stuff */ #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. */ /* ed.inputl -- routines to get a single line from the input. */
@ -48,18 +48,18 @@ extern int MapsAreInited;
static Char mismatch[] = static Char mismatch[] =
{'!', '^' , '\\', '-', '%', '\0', '"', '\'', '`', '\0' }; {'!', '^' , '\\', '-', '%', '\0', '"', '\'', '`', '\0' };
static int Repair __P((void)); static int Repair (void);
static int GetNextCommand __P((KEYCMD *, Char *)); static int GetNextCommand (KEYCMD *, Char *);
static int SpellLine __P((int)); static int SpellLine (int);
static int CompleteLine __P((void)); static int CompleteLine (void);
static void RunCommand __P((Char *)); static void RunCommand (Char *);
static void doeval1 __P((Char **)); static void doeval1 (Char **);
static int rotate = 0; static int rotate = 0;
static int static int
Repair() Repair(void)
{ {
if (NeedsRedraw) { if (NeedsRedraw) {
ClearLines(); ClearLines();
@ -75,7 +75,7 @@ Repair()
/* CCRETVAL */ /* CCRETVAL */
int int
Inputl() Inputl(void)
{ {
CCRETVAL retval; CCRETVAL retval;
KEYCMD cmdnum = 0; KEYCMD cmdnum = 0;
@ -88,7 +88,6 @@ Inputl()
struct varent *matchbeep = adrof(STRmatchbeep); struct varent *matchbeep = adrof(STRmatchbeep);
struct varent *imode = adrof(STRinputmode); struct varent *imode = adrof(STRinputmode);
Char *SaveChar, *CorrChar; Char *SaveChar, *CorrChar;
Char Origin[INBUFSIZE], Change[INBUFSIZE];
int matchval; /* from tenematch() */ int matchval; /* from tenematch() */
COMMAND fn; COMMAND fn;
int curlen = 0; int curlen = 0;
@ -132,13 +131,20 @@ Inputl()
GettingInput = 1; GettingInput = 1;
NeedsRedraw = 0; NeedsRedraw = 0;
tellwhat = 0;
if (tellwhat) { if (RestoreSaved) {
copyn(InputBuf, WhichBuf, INBUFSIZE); copyn(InputBuf, SavedBuf.s, INBUFSIZE);/*FIXBUF*/
LastChar = InputBuf + (LastWhich - WhichBuf); LastChar = InputBuf + LastSaved;
Cursor = InputBuf + (CursWhich - WhichBuf); Cursor = InputBuf + CursSaved;
tellwhat = 0; Hist_num = HistSaved;
Hist_num = HistWhich; HistSaved = 0;
RestoreSaved = 0;
}
if (HistSaved) {
Hist_num = HistSaved;
GetHistLine();
HistSaved = 0;
} }
if (Expand) { if (Expand) {
(void) e_up_hist(0); (void) e_up_hist(0);
@ -156,7 +162,7 @@ Inputl()
xprintf("Cursor > InputLim\r\n"); xprintf("Cursor > InputLim\r\n");
if (LastChar > InputLim) if (LastChar > InputLim)
xprintf("LastChar > InputLim\r\n"); xprintf("LastChar > InputLim\r\n");
if (InputLim != &InputBuf[INBUFSIZE - 2]) if (InputLim != &InputBuf[INBUFSIZE - 2])/*FIXBUF*/
xprintf("InputLim != &InputBuf[INBUFSIZE-2]\r\n"); xprintf("InputLim != &InputBuf[INBUFSIZE-2]\r\n");
if ((!DoingArg) && (Argument != 1)) if ((!DoingArg) && (Argument != 1))
xprintf("(!DoingArg) && (Argument != 1)\r\n"); xprintf("(!DoingArg) && (Argument != 1)\r\n");
@ -209,12 +215,7 @@ Inputl()
case CC_WHICH: /* tell what this command does */ case CC_WHICH: /* tell what this command does */
tellwhat = 1; tellwhat = 1;
copyn(WhichBuf, InputBuf, INBUFSIZE);
LastWhich = WhichBuf + (LastChar - InputBuf);
CursWhich = WhichBuf + (Cursor - InputBuf);
*LastChar++ = '\n'; /* for the benifit of CSH */ *LastChar++ = '\n'; /* for the benifit of CSH */
HistWhich = Hist_num;
Hist_num = 0; /* for the history commands */
num = (int) (LastChar - InputBuf); /* number characters read */ num = (int) (LastChar - InputBuf); /* number characters read */
break; break;
@ -224,36 +225,45 @@ Inputl()
matchval = 1; matchval = 1;
if (crct && crct->vec != NULL && (!Strcmp(*(crct->vec), STRcmd) || if (crct && crct->vec != NULL && (!Strcmp(*(crct->vec), STRcmd) ||
!Strcmp(*(crct->vec), STRall))) { !Strcmp(*(crct->vec), STRall))) {
Char *Origin;
PastBottom(); PastBottom();
copyn(Origin, InputBuf, INBUFSIZE); Origin = Strsave(InputBuf);
cleanup_push(Origin, xfree);
SaveChar = LastChar; SaveChar = LastChar;
if (SpellLine(!Strcmp(*(crct->vec), STRcmd)) == 1) { if (SpellLine(!Strcmp(*(crct->vec), STRcmd)) == 1) {
Char *Change;
PastBottom(); PastBottom();
copyn(Change, InputBuf, INBUFSIZE); Change = Strsave(InputBuf);
cleanup_push(Change, xfree);
*Strchr(Change, '\n') = '\0'; *Strchr(Change, '\n') = '\0';
CorrChar = LastChar; /* Save the corrected end */ CorrChar = LastChar; /* Save the corrected end */
LastChar = InputBuf; /* Null the current line */ LastChar = InputBuf; /* Null the current line */
SoundBeep(); SoundBeep();
printprompt(2, short2str(Change)); printprompt(2, short2str(Change));
cleanup_until(Change);
Refresh(); Refresh();
if (read(SHIN, (char *) &tch, 1) < 0) if (xread(SHIN, &tch, 1) < 0) {
#ifdef convex #ifdef convex
/* /*
* need to print error message in case file * need to print error message in case file
* is migrated * is migrated
*/ */
if (errno && errno != EINTR) if (errno)
stderror(ERR_SYSTEM, progname, strerror(errno)); stderror(ERR_SYSTEM, progname, strerror(errno));
#else #else
cleanup_until(Origin);
break; break;
#endif #endif
}
ch = tch; ch = tch;
if (ch == 'y' || ch == ' ') { if (ch == 'y' || ch == ' ') {
LastChar = CorrChar; /* Restore the corrected end */ LastChar = CorrChar; /* Restore the corrected end */
xprintf(CGETS(6, 2, "yes\n")); xprintf(CGETS(6, 2, "yes\n"));
} }
else { else {
copyn(InputBuf, Origin, INBUFSIZE); Strcpy(InputBuf, Origin);
LastChar = SaveChar; LastChar = SaveChar;
if (ch == 'e') { if (ch == 'e') {
xprintf(CGETS(6, 3, "edit\n")); xprintf(CGETS(6, 3, "edit\n"));
@ -263,6 +273,7 @@ Inputl()
ClearLines(); ClearLines();
ClearDisp(); ClearDisp();
Refresh(); Refresh();
cleanup_until(Origin);
break; break;
} }
else if (ch == 'a') { else if (ch == 'a') {
@ -271,12 +282,14 @@ Inputl()
Cursor = LastChar; Cursor = LastChar;
printprompt(0, NULL); printprompt(0, NULL);
Refresh(); Refresh();
cleanup_until(Origin);
break; break;
} }
xprintf(CGETS(6, 5, "no\n")); xprintf(CGETS(6, 5, "no\n"));
} }
flush(); flush();
} }
cleanup_until(Origin);
} else if (crct && crct->vec != NULL && } else if (crct && crct->vec != NULL &&
!Strcmp(*(crct->vec), STRcomplete)) { !Strcmp(*(crct->vec), STRcomplete)) {
if (LastChar > InputBuf && LastChar[-1] == '\n') { if (LastChar > InputBuf && LastChar[-1] == '\n') {
@ -427,6 +440,14 @@ Inputl()
if (autol && autol->vec != NULL && if (autol && autol->vec != NULL &&
(Strcmp(*(autol->vec), STRambiguous) != 0 || (Strcmp(*(autol->vec), STRambiguous) != 0 ||
expnum == Cursor - InputBuf)) { expnum == Cursor - InputBuf)) {
if (adrof(STRhighlight) && MarkIsSet) {
/* clear highlighting before showing completions */
MarkIsSet = 0;
ClearLines();
ClearDisp();
Refresh();
MarkIsSet = 1;
}
PastBottom(); PastBottom();
fn = (retval == CC_COMPLETE_ALL) ? LIST_ALL : LIST; fn = (retval == CC_COMPLETE_ALL) ? LIST_ALL : LIST;
(void) tenematch(InputBuf, Cursor-InputBuf, fn); (void) tenematch(InputBuf, Cursor-InputBuf, fn);
@ -526,6 +547,11 @@ Inputl()
case CC_ERROR: case CC_ERROR:
default: /* functions we don't know about */ default: /* functions we don't know about */
if (adrof(STRhighlight)) {
ClearLines();
ClearDisp();
Refresh();
}
DoingArg = 0; DoingArg = 0;
Argument = 1; Argument = 1;
SoundBeep(); SoundBeep();
@ -542,8 +568,7 @@ Inputl()
} }
void void
PushMacro(str) PushMacro(Char *str)
Char *str;
{ {
if (str != NULL && MacroLvl + 1 < MAXMACROLEVELS) { if (str != NULL && MacroLvl + 1 < MAXMACROLEVELS) {
MacroLvl++; 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 * Like eval, only using the current file descriptors
*/ */
static Char **gv = NULL, **gav = NULL;
static void static void
doeval1(v) doeval1(Char **v)
Char **v;
{ {
Char **oevalvec; struct eval1_state state;
Char *oevalp; Char **gv;
int my_reenter; int gflag;
Char **savegv;
jmp_buf_t osetexit;
oevalvec = evalvec; gflag = tglob(v);
oevalp = evalp;
savegv = gv;
gav = v;
gflag = 0, tglob(gav);
if (gflag) { if (gflag) {
gv = gav = globall(gav); gv = v = globall(v, gflag);
gargv = 0; if (v == 0)
if (gav == 0)
stderror(ERR_NOMATCH); stderror(ERR_NOMATCH);
gav = copyblk(gav); v = copyblk(v);
} }
else { else {
gv = NULL; gv = NULL;
gav = copyblk(gav); v = copyblk(v);
trim(gav); 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) if (gv)
blkfree(gv); cleanup_push(gv, blk_cleanup);
gv = savegv; state.evalvec = evalvec;
resexit(osetexit); state.evalp = evalp;
if (my_reenter) evalvec = v;
stderror(ERR_SILENT); evalp = 0;
cleanup_push(&state, eval1_cleanup);
process(0);
cleanup_until(&state);
if (gv)
cleanup_until(gv);
} }
static void static void
RunCommand(str) RunCommand(Char *str)
Char *str;
{ {
Char *cmd[2]; Char *cmd[2];
@ -633,7 +646,7 @@ RunCommand(str)
GettingInput = 0; GettingInput = 0;
doeval1(cmd); doeval1(cmd);
(void) Rawmode(); (void) Rawmode();
GettingInput = 1; GettingInput = 1;
@ -644,9 +657,7 @@ RunCommand(str)
} }
static int static int
GetNextCommand(cmdnum, ch) GetNextCommand(KEYCMD *cmdnum, Char *ch)
KEYCMD *cmdnum;
Char *ch;
{ {
KEYCMD cmd = 0; KEYCMD cmd = 0;
int num; int num;
@ -688,7 +699,7 @@ GetNextCommand(cmdnum, ch)
XmapVal val; XmapVal val;
CStr cstr; CStr cstr;
cstr.buf = ch; cstr.buf = ch;
cstr.len = Strlen(ch); cstr.len = 1;
switch (GetXkey(&cstr, &val)) { switch (GetXkey(&cstr, &val)) {
case XK_CMD: case XK_CMD:
cmd = val.cmd; cmd = val.cmd;
@ -722,8 +733,7 @@ UngetNextChar(Char cp)
} }
int int
GetNextChar(cp) GetNextChar(Char *cp)
Char *cp;
{ {
int num_read; int num_read;
int tried = 0; int tried = 0;
@ -763,16 +773,13 @@ GetNextChar(cp)
#endif /* SIG_WINDOW */ #endif /* SIG_WINDOW */
cbp = 0; cbp = 0;
for (;;) { for (;;) {
while ((num_read = read(SHIN, cbuf + cbp, 1)) == -1) { while ((num_read = xread(SHIN, cbuf + cbp, 1)) == -1) {
if (errno == EINTR)
continue;
if (!tried && fixio(SHIN, errno) != -1) if (!tried && fixio(SHIN, errno) != -1)
tried = 1; tried = 1;
else { else {
# ifdef convex # ifdef convex
/* need to print error message in case the file is migrated */ /* 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 */ # endif /* convex */
# ifdef WINNT_NATIVE # ifdef WINNT_NATIVE
__nt_want_vcode = 0; __nt_want_vcode = 0;
@ -781,13 +788,17 @@ GetNextChar(cp)
return -1; return -1;
} }
} }
cbp++; if (AsciiOnly) {
if (normal_mbtowc(cp, cbuf, cbp) == -1) { *cp = (unsigned char)*cbuf;
reset_mbtowc(); } else {
if (cbp < MB_LEN_MAX) cbp++;
continue; /* Maybe a partial character */ if (normal_mbtowc(cp, cbuf, cbp) == -1) {
/* And drop the following bytes, if any */ reset_mbtowc();
*cp = (unsigned char)*cbuf | INVALID_BYTE; if (cbp < MB_CUR_MAX)
continue; /* Maybe a partial character */
/* And drop the following bytes, if any */
*cp = (unsigned char)*cbuf | INVALID_BYTE;
}
} }
break; break;
} }
@ -810,8 +821,7 @@ GetNextChar(cp)
* 1: Something was corrected * 1: Something was corrected
*/ */
static int static int
SpellLine(cmdonly) SpellLine(int cmdonly)
int cmdonly;
{ {
int endflag, matchval; int endflag, matchval;
Char *argptr, *OldCursor, *OldLastChar; Char *argptr, *OldCursor, *OldLastChar;
@ -893,7 +903,7 @@ SpellLine(cmdonly)
* 2: Several commands matched * 2: Several commands matched
*/ */
static int static int
CompleteLine() CompleteLine(void)
{ {
int endflag, tmatch; int endflag, tmatch;
Char *argptr, *OldCursor, *OldLastChar; Char *argptr, *OldCursor, *OldLastChar;

View File

@ -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 * ed.refresh.c: Lower level screen refreshing functions
*/ */
@ -32,7 +32,7 @@
*/ */
#include "sh.h" #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" #include "ed.h"
/* #define DEBUG_UPDATE */ /* #define DEBUG_UPDATE */
@ -45,37 +45,35 @@ Char *litptr;
static int vcursor_h, vcursor_v; static int vcursor_h, vcursor_v;
static int rprompt_h, rprompt_v; static int rprompt_h, rprompt_v;
static int MakeLiteral __P((Char *, int, Char)); static int MakeLiteral (Char *, int, Char);
static int Draw __P((Char *, int)); static int Draw (Char *, int);
static void Vdraw __P((Char, int)); static void Vdraw (Char, int);
static void RefreshPromptpart __P((Char *)); static void RefreshPromptpart (Char *);
static void update_line __P((Char *, Char *, int)); static void update_line (Char *, Char *, int);
static void str_insert __P((Char *, int, int, Char *, int)); static void str_insert (Char *, int, int, Char *, int);
static void str_delete __P((Char *, int, int, int)); static void str_delete (Char *, int, int, int);
static void str_cp __P((Char *, Char *, int)); static void str_cp (Char *, Char *, int);
#ifndef WINNT_NATIVE #ifndef WINNT_NATIVE
static static
#else #else
extern extern
#endif #endif
void PutPlusOne __P((Char, int)); void PutPlusOne (Char, int);
static void cpy_pad_spaces __P((Char *, Char *, int)); static void cpy_pad_spaces (Char *, Char *, int);
#if defined(DEBUG_UPDATE) || defined(DEBUG_REFRESH) || defined(DEBUG_LITERAL) #if defined(DEBUG_UPDATE) || defined(DEBUG_REFRESH) || defined(DEBUG_LITERAL)
static void dprintf __P((char *, ...)); static void dprintf (char *, ...);
#ifdef DEBUG_UPDATE #ifdef DEBUG_UPDATE
static void dprintstr __P((char *, const Char *, const Char *)); static void dprintstr (char *, const Char *, const Char *);
static void static void
dprintstr(str, f, t) dprintstr(char *str, const Char *f, const Char *t)
char *str;
const Char *f, *t;
{ {
dprintf("%s:\"", str); dprintf("%s:\"", str);
while (f < t) { while (f < t) {
if (*f & ~ASCII) if (ASC(*f) & ~ASCII)
dprintf("[%x]", *f++); dprintf("[%x]", *f++);
else else
dprintf("%c", *f++ & ASCII); dprintf("%c", CTL_ESC(ASCII & ASC(*f++)));
} }
dprintf("\"\r\n"); dprintf("\"\r\n");
} }
@ -87,12 +85,7 @@ const Char *f, *t;
* debugging cause you'll mangle up the file descriptors! * debugging cause you'll mangle up the file descriptors!
*/ */
static void static void
#ifdef PROTOTYPES
dprintf(char *fmt, ...) dprintf(char *fmt, ...)
#else
dprintf(va_list)
va_dcl
#endif /* __STDC__ */
{ {
static int fd = -1; static int fd = -1;
char *dtty; char *dtty;
@ -100,16 +93,10 @@ dprintf(va_list)
if ((dtty = getenv("DEBUGTTY"))) { if ((dtty = getenv("DEBUGTTY"))) {
int o; int o;
va_list va; va_list va;
#ifdef PROTOTYPES
va_start(va, fmt); va_start(va, fmt);
#else
char *fmt;
va_start(va);
fmt = va_arg(va, char *);
#endif /* __STDC__ */
if (fd == -1) if (fd == -1)
fd = open(dtty, O_RDWR); fd = xopen(dtty, O_RDWR);
o = SHOUT; o = SHOUT;
flush(); flush();
SHOUT = fd; SHOUT = fd;
@ -123,10 +110,7 @@ dprintf(va_list)
static int litlen = 0, litalloc = 0; static int litlen = 0, litalloc = 0;
static int MakeLiteral(str, len, addlit) static int MakeLiteral(Char *str, int len, Char addlit)
Char *str;
int len;
Char addlit;
{ {
int i, addlitlen = 0; int i, addlitlen = 0;
Char *addlitptr = 0; Char *addlitptr = 0;
@ -152,10 +136,7 @@ static int MakeLiteral(str, len, addlit)
int add = 256; int add = 256;
while (len + addlitlen + 1 + (LIT_FACTOR - 1) > add) while (len + addlitlen + 1 + (LIT_FACTOR - 1) > add)
add *= 2; add *= 2;
if (litptr) newlitptr = xrealloc(litptr, (litalloc + add) * sizeof(Char));
newlitptr = (Char *)xrealloc(litptr, (litalloc + add) * sizeof(Char));
else
newlitptr = (Char *)xmalloc((litalloc + add) * sizeof(Char));
if (!newlitptr) if (!newlitptr)
return '?'; return '?';
litptr = newlitptr; litptr = newlitptr;
@ -179,16 +160,13 @@ static int MakeLiteral(str, len, addlit)
} }
static int static int
Draw(cp, nocomb) /* draw char at cp, expand tabs, ctl chars */ Draw(Char *cp, int nocomb) /* draw char at cp, expand tabs, ctl chars */
Char *cp;
int nocomb;
{ {
int l, w, i, lv, lh; int w, i, lv, lh;
Char ch, attr; Char c, attr;
NLSChar c;
attr = *cp & ~CHAR; attr = *cp & ~CHAR;
l = NLSFrom(cp, NLSZEROT, &c); c = *cp & CHAR;
w = NLSClassify(c, nocomb); w = NLSClassify(c, nocomb);
switch (w) { switch (w) {
case NLSCLASS_NL: case NLSCLASS_NL:
@ -215,11 +193,10 @@ Draw(cp, nocomb) /* draw char at cp, expand tabs, ctl chars */
} }
break; break;
case NLSCLASS_ILLEGAL: case NLSCLASS_ILLEGAL:
ch = *cp & CHAR;
Vdraw('\\' | attr, 1); Vdraw('\\' | attr, 1);
Vdraw((((ch >> 6) & 7) + '0') | attr, 1); Vdraw((((c >> 6) & 7) + '0') | attr, 1);
Vdraw((((ch >> 3) & 7) + '0') | attr, 1); Vdraw((((c >> 3) & 7) + '0') | attr, 1);
Vdraw(((ch & 7) + '0') | attr, 1); Vdraw(((c & 7) + '0') | attr, 1);
break; break;
case NLSCLASS_ILLEGAL2: case NLSCLASS_ILLEGAL2:
case NLSCLASS_ILLEGAL3: case NLSCLASS_ILLEGAL3:
@ -245,32 +222,23 @@ Draw(cp, nocomb) /* draw char at cp, expand tabs, ctl chars */
break; break;
} }
if (lv < 0) { if (lv < 0) {
int l2 = l; Vdraw('\\' | attr, 1);
for (; l2-- > 0; cp++) { Vdraw((((c >> 6) & 7) + '0') | attr, 1);
ch = *cp & CHAR; Vdraw((((c >> 3) & 7) + '0') | attr, 1);
Vdraw('\\' | attr, 1); Vdraw(((c & 7) + '0') | attr, 1);
Vdraw((((ch >> 6) & 7) + '0') | attr, 1); break;
Vdraw((((ch >> 3) & 7) + '0') | attr, 1);
Vdraw(((ch & 7) + '0') | attr, 1);
}
return l;
} }
Vdisplay[lv][lh] = MakeLiteral(cp, l, Vdisplay[lv][lh]); Vdisplay[lv][lh] = MakeLiteral(cp, 1, Vdisplay[lv][lh]);
break; break;
default: default:
if (l > 1) Vdraw(*cp, w);
Vdraw(MakeLiteral(cp, l, 0), w);
else
Vdraw(*cp, w);
break; break;
} }
return l; return 1;
} }
static void static void
Vdraw(c, width) /* draw char c onto V lines */ Vdraw(Char c, int width) /* draw char c onto V lines */
Char c;
int width;
{ {
#ifdef DEBUG_REFRESH #ifdef DEBUG_REFRESH
# ifdef SHORT_STRINGS # ifdef SHORT_STRINGS
@ -284,7 +252,7 @@ Vdraw(c, width) /* draw char c onto V lines */
that "span line breaks". */ that "span line breaks". */
while (vcursor_h + width > TermH) while (vcursor_h + width > TermH)
Vdraw(' ', 1); Vdraw(' ', 1);
Vdisplay[vcursor_v][vcursor_h] = (Char) c; Vdisplay[vcursor_v][vcursor_h] = c;
if (width) if (width)
vcursor_h++; /* advance to next place */ vcursor_h++; /* advance to next place */
while (--width > 0) 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) * draws a prompt element, expanding literals (we know it's ASCIZ)
*/ */
static void static void
RefreshPromptpart(buf) RefreshPromptpart(Char *buf)
Char *buf;
{ {
Char *cp; Char *cp;
NLSChar c; int w;
int l, w;
if (buf == NULL)
return;
for (cp = buf; *cp; ) { for (cp = buf; *cp; ) {
if (*cp & LITERAL) { if (*cp & LITERAL) {
Char *litstart = cp; Char *litstart = cp;
while (*cp & LITERAL) while (*cp & LITERAL)
cp++; cp++;
if (*cp) { if (*cp) {
l = NLSFrom(cp, NLSZEROT, &c); w = NLSWidth(*cp & CHAR);
w = NLSWidth(c); Vdraw(MakeLiteral(litstart, cp + 1 - litstart, 0), w);
Vdraw(MakeLiteral(litstart, cp + l - litstart, 0), w); cp++;
cp += l;
} }
else { else {
/* /*
@ -352,7 +319,7 @@ static
int OldvcV = 0; int OldvcV = 0;
void void
Refresh() Refresh(void)
{ {
int cur_line; int cur_line;
Char *cp; Char *cp;
@ -361,7 +328,7 @@ Refresh()
Char oldgetting; Char oldgetting;
#ifdef DEBUG_REFRESH #ifdef DEBUG_REFRESH
dprintf("PromptBuf = :%s:\r\n", short2str(PromptBuf)); dprintf("Prompt = :%s:\r\n", short2str(Prompt));
dprintf("InputBuf = :%s:\r\n", short2str(InputBuf)); dprintf("InputBuf = :%s:\r\n", short2str(InputBuf));
#endif /* DEBUG_REFRESH */ #endif /* DEBUG_REFRESH */
oldgetting = GettingInput; oldgetting = GettingInput;
@ -370,14 +337,14 @@ Refresh()
/* reset the Vdraw cursor, temporarily draw rprompt to calculate its size */ /* reset the Vdraw cursor, temporarily draw rprompt to calculate its size */
vcursor_h = 0; vcursor_h = 0;
vcursor_v = 0; vcursor_v = 0;
RefreshPromptpart(RPromptBuf); RefreshPromptpart(RPrompt);
rprompt_h = vcursor_h; rprompt_h = vcursor_h;
rprompt_v = vcursor_v; rprompt_v = vcursor_v;
/* reset the Vdraw cursor, draw prompt */ /* reset the Vdraw cursor, draw prompt */
vcursor_h = 0; vcursor_h = 0;
vcursor_v = 0; vcursor_v = 0;
RefreshPromptpart(PromptBuf); RefreshPromptpart(Prompt);
cur_h = -1; /* set flag in case I'm not set */ cur_h = -1; /* set flag in case I'm not set */
/* draw the current input buffer */ /* draw the current input buffer */
@ -404,7 +371,7 @@ Refresh()
*/ */
while (--rhdiff > 0) /* pad out with spaces */ while (--rhdiff > 0) /* pad out with spaces */
Vdraw(' ', 1); Vdraw(' ', 1);
RefreshPromptpart(RPromptBuf); RefreshPromptpart(RPrompt);
} }
else { else {
rprompt_h = 0; /* flag "not using rprompt" */ rprompt_h = 0; /* flag "not using rprompt" */
@ -463,7 +430,7 @@ Refresh()
} }
#ifdef notdef #ifdef notdef
GotoBottom() GotoBottom(void)
{ /* used to go to last used screen line */ { /* used to go to last used screen line */
MoveToLine(OldvcV); MoveToLine(OldvcV);
} }
@ -471,7 +438,7 @@ GotoBottom()
#endif #endif
void void
PastBottom() PastBottom(void)
{ /* used to go to last used screen line */ { /* used to go to last used screen line */
MoveToLine(OldvcV); MoveToLine(OldvcV);
(void) putraw('\r'); (void) putraw('\r');
@ -484,11 +451,7 @@ PastBottom()
/* insert num characters of s into d (in front of the character) at dat, /* insert num characters of s into d (in front of the character) at dat,
maximum length of d is dlen */ maximum length of d is dlen */
static void static void
str_insert(d, dat, dlen, s, num) str_insert(Char *d, int dat, int dlen, Char *s, int num)
Char *d;
int dat, dlen;
Char *s;
int num;
{ {
Char *a, *b; 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 */ /* delete num characters d at dat, maximum length of d is dlen */
static void static void
str_delete(d, dat, dlen, num) str_delete(Char *d, int dat, int dlen, int num)
Char *d;
int dat, dlen, num;
{ {
Char *a, *b; Char *a, *b;
@ -563,9 +524,7 @@ str_delete(d, dat, dlen, num)
} }
static void static void
str_cp(a, b, n) str_cp(Char *a, Char *b, int n)
Char *a, *b;
int n;
{ {
while (n-- && *b) while (n-- && *b)
*a++ = *b++; *a++ = *b++;
@ -597,9 +556,7 @@ new: eddie> Oh, my little buggy says to me, as lurgid as
#define MIN_END_KEEP 4 #define MIN_END_KEEP 4
static void /* could be changed to make it smarter */ static void /* could be changed to make it smarter */
update_line(old, new, cur_line) update_line(Char *old, Char *new, int cur_line)
Char *old, *new;
int cur_line;
{ {
Char *o, *n, *p, c; Char *o, *n, *p, c;
Char *ofd, *ols, *oe, *nfd, *nls, *ne; 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 * Find the end of both old and new
*/ */
while (*o) o = Strend(o);
o++;
/* /*
* Remove any trailing blanks off of the end, being careful not to * Remove any trailing blanks off of the end, being careful not to
* back up past the beginning. * back up past the beginning.
*/ */
if (!(adrof(STRhighlight) && MarkIsSet)) {
while (ofd < o) { while (ofd < o) {
if (o[-1] != ' ') if (o[-1] != ' ')
break; break;
o--; o--;
} }
}
oe = o; oe = o;
*oe = (Char) 0; *oe = (Char) 0;
while (*n) n = Strend(n);
n++;
/* remove blanks from end of new */ /* remove blanks from end of new */
if (!(adrof(STRhighlight) && MarkIsSet)) {
while (nfd < n) { while (nfd < n) {
if (n[-1] != ' ') if (n[-1] != ' ')
break; break;
n--; n--;
} }
}
ne = n; ne = n;
*ne = (Char) 0; *ne = (Char) 0;
@ -1133,9 +1093,7 @@ update_line(old, new, cur_line)
static void static void
cpy_pad_spaces(dst, src, width) cpy_pad_spaces(Char *dst, Char *src, int width)
Char *dst, *src;
int width;
{ {
int i; int i;
@ -1153,25 +1111,23 @@ cpy_pad_spaces(dst, src, width)
} }
void void
RefCursor() RefCursor(void)
{ /* only move to new cursor pos */ { /* only move to new cursor pos */
Char *cp; Char *cp;
NLSChar c; int w, h, th, v;
int l, w, h, th, v;
/* first we must find where the cursor is... */ /* first we must find where the cursor is... */
h = 0; h = 0;
v = 0; v = 0;
th = TermH; /* optimize for speed */ th = TermH; /* optimize for speed */
for (cp = PromptBuf; *cp; ) { /* do prompt */ for (cp = Prompt; cp != NULL && *cp; ) { /* do prompt */
if (*cp & LITERAL) { if (*cp & LITERAL) {
cp++; cp++;
continue; continue;
} }
l = NLSFrom(cp, NLSZEROT, &c); w = NLSClassify(*cp & CHAR, cp == Prompt);
w = NLSClassify(c, cp == PromptBuf); cp++;
cp += l;
switch(w) { switch(w) {
case NLSCLASS_NL: case NLSCLASS_NL:
h = 0; h = 0;
@ -1202,9 +1158,8 @@ RefCursor()
} }
for (cp = InputBuf; cp < Cursor;) { /* do input buffer to Cursor */ for (cp = InputBuf; cp < Cursor;) { /* do input buffer to Cursor */
l = NLSFrom(cp, Cursor - cp, &c); w = NLSClassify(*cp & CHAR, cp == InputBuf);
w = NLSClassify(c, cp == InputBuf); cp++;
cp += l;
switch(w) { switch(w) {
case NLSCLASS_NL: case NLSCLASS_NL:
h = 0; h = 0;
@ -1237,14 +1192,17 @@ RefCursor()
/* now go there */ /* now go there */
MoveToLine(v); MoveToLine(v);
MoveToChar(h); MoveToChar(h);
if (adrof(STRhighlight) && MarkIsSet) {
ClearLines();
ClearDisp();
Refresh();
}
flush(); flush();
} }
#ifndef WINTT_NATIVE #ifndef WINTT_NATIVE
static void static void
PutPlusOne(c, width) PutPlusOne(Char c, int width)
Char c;
int width;
{ {
while (width > 1 && CursorH + width > TermH) while (width > 1 && CursorH + width > TermH)
PutPlusOne(' ', 1); PutPlusOne(' ', 1);
@ -1280,9 +1238,8 @@ void
RefPlusOne(int l) RefPlusOne(int l)
{ /* we added just one char, handle it fast. { /* we added just one char, handle it fast.
* assumes that screen cursor == real cursor */ * assumes that screen cursor == real cursor */
Char *cp; Char *cp, c;
int w; int w;
NLSChar c;
if (Cursor != LastChar) { if (Cursor != LastChar) {
Refresh(); /* too hard to handle */ Refresh(); /* too hard to handle */
@ -1293,7 +1250,7 @@ RefPlusOne(int l)
return; return;
} }
cp = Cursor - l; cp = Cursor - l;
NLSFrom(cp, (size_t)l, &c); c = *cp & CHAR;
w = NLSClassify(c, cp == InputBuf); w = NLSClassify(c, cp == InputBuf);
switch(w) { switch(w) {
case NLSCLASS_CTRL: case NLSCLASS_CTRL:
@ -1316,10 +1273,14 @@ RefPlusOne(int l)
PutPlusOne((c & 7) + '0', 1); PutPlusOne((c & 7) + '0', 1);
break; break;
case 1: case 1:
if (adrof(STRhighlight) && MarkIsSet)
StartHighlight();
if (l > 1) if (l > 1)
PutPlusOne(MakeLiteral(cp, l, 0), 1); PutPlusOne(MakeLiteral(cp, l, 0), 1);
else else
PutPlusOne(*cp, 1); PutPlusOne(*cp, 1);
if (adrof(STRhighlight) && MarkIsSet)
StopHighlight();
break; break;
default: default:
Refresh(); /* too hard to handle */ Refresh(); /* too hard to handle */
@ -1331,7 +1292,7 @@ RefPlusOne(int l)
/* clear the screen buffers so that new new prompt starts fresh. */ /* clear the screen buffers so that new new prompt starts fresh. */
void void
ClearDisp() ClearDisp(void)
{ {
int i; int i;
@ -1344,7 +1305,7 @@ ClearDisp()
} }
void void
ClearLines() ClearLines(void)
{ /* Make sure all lines are *really* blank */ { /* Make sure all lines are *really* blank */
int i; int i;

View File

@ -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 * ed.screen.c: Editor/termcap-curses interface
*/ */
@ -32,7 +32,7 @@
*/ */
#include "sh.h" #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 "ed.h"
#include "tc.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 Str(a) tstr[a].str
#define Val(a) tval[a].val #define Val(a) tval[a].val
static struct { static const struct {
const char *b_name; const char *b_name;
speed_t b_rate; speed_t b_rate;
} baud_rate[] = { } baud_rate[] = {
@ -124,45 +124,47 @@ static struct {
{ NULL, 0 } { NULL, 0 }
}; };
#define T_al 0 #define T_at7 0
#define T_bl 1 #define T_al 1
#define T_cd 2 #define T_bl 2
#define T_ce 3 #define T_cd 3
#define T_ch 4 #define T_ce 4
#define T_cl 5 #define T_ch 5
#define T_dc 6 #define T_cl 6
#define T_dl 7 #define T_dc 7
#define T_dm 8 #define T_dl 8
#define T_ed 9 #define T_dm 9
#define T_ei 10 #define T_ed 10
#define T_fs 11 #define T_ei 11
#define T_ho 12 #define T_fs 12
#define T_ic 13 #define T_ho 13
#define T_im 14 #define T_ic 14
#define T_ip 15 #define T_im 15
#define T_kd 16 #define T_ip 16
#define T_kl 17 #define T_kd 17
#define T_kr 18 #define T_kh 18
#define T_ku 19 #define T_kl 19
#define T_md 20 #define T_kr 20
#define T_me 21 #define T_ku 21
#define T_nd 22 #define T_md 22
#define T_se 23 #define T_me 23
#define T_so 24 #define T_mr 24
#define T_ts 25 #define T_nd 25
#define T_up 26 #define T_se 26
#define T_us 27 #define T_so 27
#define T_ue 28 #define T_ts 28
#define T_vb 29 #define T_up 29
#define T_DC 30 #define T_us 30
#define T_DO 31 #define T_ue 31
#define T_IC 32 #define T_vb 32
#define T_LE 33 #define T_DC 33
#define T_RI 34 #define T_DO 34
#define T_UP 35 #define T_IC 35
#define T_kh 36 #define T_LE 36
#define T_at7 37 #define T_RI 37
#define T_str 38 #define T_UP 38
#define T_str 39
static struct termcapstr { static struct termcapstr {
const char *name; const char *name;
const char *long_name; const char *long_name;
@ -184,16 +186,16 @@ static struct termcapval {
} tval[T_val + 1]; } tval[T_val + 1];
void void
terminit() terminit(void)
{ {
#ifdef NLS_CATALOGS #ifdef NLS_CATALOGS
int i; int i;
for (i = 0; i < T_str + 1; 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++) 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 #endif
tstr[T_al].name = "al"; tstr[T_al].name = "al";
@ -305,10 +307,13 @@ terminit()
tstr[T_UP].long_name = CSAVS(4, 36, "cursor up multiple"); tstr[T_UP].long_name = CSAVS(4, 36, "cursor up multiple");
tstr[T_kh].name = "kh"; 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].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].name = NULL;
tstr[T_str].long_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 int me_all = 0; /* does two or more of the attributes use me */
static void ReBufferDisplay __P((void)); static void ReBufferDisplay (void);
static void TCalloc __P((struct termcapstr *, char *)); static void TCset (struct termcapstr *, const char *);
static void static void
TCalloc(t, cap) TCset(struct termcapstr *t, const char *cap)
struct termcapstr *t;
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') { if (cap == NULL || *cap == '\0') {
xfree(t->str);
t->str = NULL; 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*/ /*ARGSUSED*/
void void
TellTC() TellTC(void)
{ {
struct termcapstr *t; struct termcapstr *t;
char *s; char *first, *s;
xprintf(CGETS(7, 1, "\n\tTcsh thinks your terminal has the\n")); xprintf(CGETS(7, 1, "\n\tTcsh thinks your terminal has the\n"));
xprintf(CGETS(7, 2, "\tfollowing characteristics:\n\n")); xprintf(CGETS(7, 2, "\tfollowing characteristics:\n\n"));
xprintf(CGETS(7, 3, "\tIt has %d columns and %d lines\n"), xprintf(CGETS(7, 3, "\tIt has %d columns and %d lines\n"),
Val(T_co), Val(T_li)); Val(T_co), Val(T_li));
s = strsave(T_HasMeta ? CGETS(7, 5, "a") : CGETS(7, 6, "no")); 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); xprintf(CGETS(7, 4, "\tIt has %s meta key\n"), s);
xfree(s);
s = strsave(T_Tabs ? "" : CGETS(7, 8, " not")); s = strsave(T_Tabs ? "" : CGETS(7, 8, " not"));
cleanup_push(s, xfree);
xprintf(CGETS(7, 7, "\tIt can%s use tabs\n"), s); xprintf(CGETS(7, 7, "\tIt can%s use tabs\n"), s);
xfree(s);
s = strsave((T_Margin&MARGIN_AUTO) ? s = strsave((T_Margin&MARGIN_AUTO) ?
CGETS(7, 10, "has") : CGETS(7, 11, "does not have")); CGETS(7, 10, "has") : CGETS(7, 11, "does not have"));
cleanup_push(s, xfree);
xprintf(CGETS(7, 9, "\tIt %s automatic margins\n"), s); xprintf(CGETS(7, 9, "\tIt %s automatic margins\n"), s);
xfree(s);
if (T_Margin & MARGIN_AUTO) { if (T_Margin & MARGIN_AUTO) {
s = strsave((T_Margin & MARGIN_MAGIC) ? s = strsave((T_Margin & MARGIN_MAGIC) ?
CGETS(7, 10, "has") : CGETS(7, 11, "does not have")); CGETS(7, 10, "has") : CGETS(7, 11, "does not have"));
cleanup_push(s, xfree);
xprintf(CGETS(7, 12, "\tIt %s magic margins\n"), s); xprintf(CGETS(7, 12, "\tIt %s magic margins\n"), s);
xfree(s);
} }
for (t = tstr; t->name != NULL; t++) { for (t = tstr; t->name != NULL; t++) {
s = strsave(t->str && *t->str ? t->str : CGETS(7, 13, "(empty)")); 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); xprintf("\t%36s (%s) == %s\n", t->long_name, t->name, s);
xfree(s); cleanup_until(s);
} }
xputchar('\n'); xputchar('\n');
cleanup_until(first);
} }
static void static void
ReBufferDisplay() ReBufferDisplay(void)
{ {
int i; int i;
Char **b; Char **b;
Char **bufp;
b = Display; b = Display;
Display = NULL; Display = NULL;
if (b != NULL) { blkfree(b);
for (bufp = b; *bufp != NULL; bufp++)
xfree((ptr_t) * bufp);
xfree((ptr_t) b);
}
b = Vdisplay; b = Vdisplay;
Vdisplay = NULL; Vdisplay = NULL;
if (b != NULL) { blkfree(b);
for (bufp = b; *bufp != NULL; bufp++)
xfree((ptr_t) * bufp);
xfree((ptr_t) b);
}
TermH = Val(T_co); TermH = Val(T_co);
TermV = (INBUFSIZE * 4) / TermH + 1; TermV = (INBUFSIZE * 4) / TermH + 1;/*FIXBUF*/
b = (Char **) xmalloc((size_t) (sizeof(*b) * (TermV + 1))); b = xmalloc(sizeof(*b) * (TermV + 1));
for (i = 0; i < TermV; i++) 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; b[TermV] = NULL;
Display = b; Display = b;
b = (Char **) xmalloc((size_t) (sizeof(*b) * (TermV + 1))); b = xmalloc(sizeof(*b) * (TermV + 1));
for (i = 0; i < TermV; i++) 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; b[TermV] = NULL;
Vdisplay = b; Vdisplay = b;
} }
void void
SetTC(what, how) SetTC(char *what, char *how)
char *what, *how;
{ {
struct termcapstr *ts; struct termcapstr *ts;
struct termcapval *tv; struct termcapval *tv;
@ -506,7 +455,7 @@ SetTC(what, how)
if (strcmp(ts->name, what) == 0) if (strcmp(ts->name, what) == 0)
break; break;
if (ts->name != NULL) { if (ts->name != NULL) {
TCalloc(ts, how); TCset(ts, how);
/* /*
* Reset variables * Reset variables
*/ */
@ -542,10 +491,10 @@ SetTC(what, how)
stderror(ERR_SETTCUS, tv->name); stderror(ERR_SETTCUS, tv->name);
return; return;
} }
T_Tabs = (Char) Val(T_pt); T_Tabs = Val(T_pt);
T_HasMeta = (Char) Val(T_km); T_HasMeta = Val(T_km);
T_Margin = (Char) Val(T_am) ? MARGIN_AUTO : 0; T_Margin = Val(T_am) ? MARGIN_AUTO : 0;
T_Margin |= (Char) Val(T_xn) ? MARGIN_MAGIC : 0; T_Margin |= Val(T_xn) ? MARGIN_MAGIC : 0;
if (tv == &tval[T_am] || tv == &tval[T_xn]) if (tv == &tval[T_am] || tv == &tval[T_xn])
ChangeSize(Val(T_li), Val(T_co)); ChangeSize(Val(T_li), Val(T_co));
return; return;
@ -568,33 +517,27 @@ SetTC(what, how)
* Print the termcap string out with variable substitution * Print the termcap string out with variable substitution
*/ */
void void
EchoTC(v) EchoTC(Char **v)
Char **v;
{ {
char *cap, *scap, cv[BUFSIZE]; char *cap, *scap, *cv;
int arg_need, arg_cols, arg_rows; int arg_need, arg_cols, arg_rows;
int verbose = 0, silent = 0; int verbose = 0, silent = 0;
char *area; char *area;
static const char *fmts = "%s\n", *fmtd = "%d\n"; static const char fmts[] = "%s\n", fmtd[] = "%d\n";
struct termcapstr *t; struct termcapstr *t;
char buf[TC_BUFSIZE]; char buf[TC_BUFSIZE];
Char **globbed;
area = buf; area = buf;
setname("echotc"); setname("echotc");
tglob(v); v = glob_all_or_error(v);
if (gflag) { globbed = v;
v = globall(v); cleanup_push(globbed, blk_cleanup);
if (v == 0)
stderror(ERR_NAME | ERR_NOMATCH);
}
else
v = gargv = saveblk(v);
trim(v);
if (!*v || *v[0] == '\0') if (!*v || *v[0] == '\0')
return; goto end;
if (v[0][0] == '-') { if (v[0][0] == '-') {
switch (v[0][1]) { switch (v[0][1]) {
case 'v': case 'v':
@ -610,31 +553,28 @@ EchoTC(v)
v++; v++;
} }
if (!*v || *v[0] == '\0') if (!*v || *v[0] == '\0')
return; goto end;
(void) strcpy(cv, short2str(*v)); cv = strsave(short2str(*v));
cleanup_push(cv, xfree);
if (strcmp(cv, "tabs") == 0) { if (strcmp(cv, "tabs") == 0) {
xprintf(fmts, T_Tabs ? CGETS(7, 14, "yes") : xprintf(fmts, T_Tabs ? CGETS(7, 14, "yes") :
CGETS(7, 15, "no")); CGETS(7, 15, "no"));
flush(); goto end_flush;
return;
} }
else if (strcmp(cv, "meta") == 0) { else if (strcmp(cv, "meta") == 0) {
xprintf(fmts, Val(T_km) ? CGETS(7, 14, "yes") : xprintf(fmts, Val(T_km) ? CGETS(7, 14, "yes") :
CGETS(7, 15, "no")); CGETS(7, 15, "no"));
flush(); goto end_flush;
return;
} }
else if (strcmp(cv, "xn") == 0) { else if (strcmp(cv, "xn") == 0) {
xprintf(fmts, T_Margin & MARGIN_MAGIC ? CGETS(7, 14, "yes") : xprintf(fmts, T_Margin & MARGIN_MAGIC ? CGETS(7, 14, "yes") :
CGETS(7, 15, "no")); CGETS(7, 15, "no"));
flush(); goto end_flush;
return;
} }
else if (strcmp(cv, "am") == 0) { else if (strcmp(cv, "am") == 0) {
xprintf(fmts, T_Margin & MARGIN_AUTO ? CGETS(7, 14, "yes") : xprintf(fmts, T_Margin & MARGIN_AUTO ? CGETS(7, 14, "yes") :
CGETS(7, 15, "no")); CGETS(7, 15, "no"));
flush(); goto end_flush;
return;
} }
else if (strcmp(cv, "baud") == 0) { else if (strcmp(cv, "baud") == 0) {
int i; int i;
@ -642,22 +582,19 @@ EchoTC(v)
for (i = 0; baud_rate[i].b_name != NULL; i++) for (i = 0; baud_rate[i].b_name != NULL; i++)
if (T_Speed == baud_rate[i].b_rate) { if (T_Speed == baud_rate[i].b_rate) {
xprintf(fmts, baud_rate[i].b_name); xprintf(fmts, baud_rate[i].b_name);
flush(); goto end_flush;
return;
} }
xprintf(fmtd, 0); xprintf(fmtd, 0);
flush(); goto end_flush;
return;
} }
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)); xprintf(fmtd, Val(T_li));
flush(); goto end_flush;
return;
} }
else if (strcmp(cv, "cols") == 0) { else if (strcmp(cv, "cols") == 0 || strcmp(cv, "co") == 0) {
xprintf(fmtd, Val(T_co)); xprintf(fmtd, Val(T_co));
flush(); goto end_flush;
return;
} }
/* /*
@ -674,10 +611,10 @@ EchoTC(v)
if (!scap || scap[0] == '\0') { if (!scap || scap[0] == '\0') {
if (tgetflag(cv)) { if (tgetflag(cv)) {
xprintf(CGETS(7, 14, "yes\n")); xprintf(CGETS(7, 14, "yes\n"));
return; goto end;
} }
if (silent) if (silent)
return; goto end;
else else
stderror(ERR_NAME | ERR_TCCAP, cv); stderror(ERR_NAME | ERR_TCCAP, cv);
} }
@ -718,7 +655,7 @@ EchoTC(v)
v++; v++;
if (*v && *v[0]) { if (*v && *v[0]) {
if (silent) if (silent)
return; goto end;
else else
stderror(ERR_NAME | ERR_TCARGS, cv, arg_need); stderror(ERR_NAME | ERR_TCARGS, cv, arg_need);
} }
@ -733,7 +670,7 @@ EchoTC(v)
v++; v++;
if (*v && *v[0]) { if (*v && *v[0]) {
if (silent) if (silent)
return; goto end;
else else
stderror(ERR_NAME | ERR_TCARGS, cv, arg_need); stderror(ERR_NAME | ERR_TCARGS, cv, arg_need);
} }
@ -748,7 +685,7 @@ EchoTC(v)
v++; v++;
if (!*v || *v[0] == '\0') { if (!*v || *v[0] == '\0') {
if (silent) if (silent)
return; goto end;
else else
stderror(ERR_NAME | ERR_TCNARGS, cv, 2); stderror(ERR_NAME | ERR_TCNARGS, cv, 2);
} }
@ -756,7 +693,7 @@ EchoTC(v)
v++; v++;
if (!*v || *v[0] == '\0') { if (!*v || *v[0] == '\0') {
if (silent) if (silent)
return; goto end;
else else
stderror(ERR_NAME | ERR_TCNARGS, cv, 2); stderror(ERR_NAME | ERR_TCNARGS, cv, 2);
} }
@ -764,18 +701,17 @@ EchoTC(v)
v++; v++;
if (*v && *v[0]) { if (*v && *v[0]) {
if (silent) if (silent)
return; goto end;
else else
stderror(ERR_NAME | ERR_TCARGS, cv, arg_need); stderror(ERR_NAME | ERR_TCARGS, cv, arg_need);
} }
(void) tputs(tgoto(scap, arg_cols, arg_rows), arg_rows, PUTRAW); (void) tputs(tgoto(scap, arg_cols, arg_rows), arg_rows, PUTRAW);
break; break;
} }
end_flush:
flush(); flush();
if (gargv) { end:
blkfree(gargv); cleanup_until(globbed);
gargv = 0;
}
} }
int GotTermCaps = 0; int GotTermCaps = 0;
@ -802,7 +738,7 @@ static struct {
#define A_K_NKEYS 6 #define A_K_NKEYS 6
void void
ResetArrowKeys() ResetArrowKeys(void)
{ {
arrow[A_K_DN].fun.cmd = F_DOWN_HIST; arrow[A_K_DN].fun.cmd = F_DOWN_HIST;
arrow[A_K_DN].type = XK_CMD; arrow[A_K_DN].type = XK_CMD;
@ -824,7 +760,7 @@ ResetArrowKeys()
} }
void void
DefaultArrowKeys() DefaultArrowKeys(void)
{ {
static Char strA[] = {033, '[', 'A', '\0'}; static Char strA[] = {033, '[', 'A', '\0'};
static Char strB[] = {033, '[', 'B', '\0'}; static Char strB[] = {033, '[', 'B', '\0'};
@ -892,10 +828,7 @@ DefaultArrowKeys()
int int
SetArrowKeys(name, fun, type) SetArrowKeys(const CStr *name, XmapVal *fun, int type)
CStr *name;
XmapVal *fun;
int type;
{ {
int i; int i;
for (i = 0; i < A_K_NKEYS; i++) for (i = 0; i < A_K_NKEYS; i++)
@ -908,8 +841,7 @@ SetArrowKeys(name, fun, type)
} }
int int
IsArrowKey(name) IsArrowKey(Char *name)
Char *name;
{ {
int i; int i;
for (i = 0; i < A_K_NKEYS; i++) for (i = 0; i < A_K_NKEYS; i++)
@ -919,8 +851,7 @@ IsArrowKey(name)
} }
int int
ClearArrowKeys(name) ClearArrowKeys(const CStr *name)
CStr *name;
{ {
int i; int i;
for (i = 0; i < A_K_NKEYS; i++) for (i = 0; i < A_K_NKEYS; i++)
@ -932,24 +863,19 @@ ClearArrowKeys(name)
} }
void void
PrintArrowKeys(name) PrintArrowKeys(const CStr *name)
CStr *name;
{ {
int i; int i;
for (i = 0; i < A_K_NKEYS; i++) for (i = 0; i < A_K_NKEYS; i++)
if (name->len == 0 || Strcmp(name->buf, arrow[i].name) == 0) if (name->len == 0 || Strcmp(name->buf, arrow[i].name) == 0)
if (arrow[i].type != XK_NOD) { if (arrow[i].type != XK_NOD)
CStr cs; printOne(arrow[i].name, &arrow[i].fun, arrow[i].type);
cs.buf = arrow[i].name;
cs.len = Strlen(cs.buf);
(void) printOne(&cs, &arrow[i].fun, arrow[i].type);
}
} }
void void
BindArrowKeys() BindArrowKeys(void)
{ {
KEYCMD *map, *dmap; KEYCMD *map, *dmap;
int i, j; int i, j;
@ -1000,8 +926,7 @@ BindArrowKeys()
static Char cur_atr = 0; /* current attributes */ static Char cur_atr = 0; /* current attributes */
void void
SetAttributes(atr) SetAttributes(Char atr)
Char atr;
{ {
atr &= ATTRIBUTES; atr &= ATTRIBUTES;
if (atr != cur_atr) { 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 */ /* PWP 6-27-88 -- if the tty driver thinks that we can tab, we ask termcap */
int int
CanWeTab() CanWeTab(void)
{ {
return (Val(T_pt)); return (Val(T_pt));
} }
/* move to line <where> (first line == 0) as efficiently as possible; */
void void
MoveToLine(where) /* move to line <where> (first line == 0) */ MoveToLine(int where)
int where; /* as efficiently as possible; */
{ {
int del; int del;
@ -1132,8 +1073,7 @@ MoveToLine(where) /* move to line <where> (first line == 0) */
} }
void void
MoveToChar(where) /* move to character position (where) */ MoveToChar(int where) /* move to character position (where) */
int where;
{ /* as efficiently as possible */ { /* as efficiently as possible */
int del; int del;
@ -1207,10 +1147,10 @@ MoveToChar(where) /* move to character position (where) */
} }
void void
so_write(cp, n) so_write(Char *cp, int n)
Char *cp;
int n;
{ {
int cur_pos, prompt_len = 0, region_start = 0, region_end = 0;
if (n <= 0) if (n <= 0)
return; /* catch bugs */ return; /* catch bugs */
@ -1222,7 +1162,37 @@ so_write(cp, n)
return; 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 { 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 != CHAR_DBWIDTH) {
if (*cp & LITERAL) { if (*cp & LITERAL) {
Char *d; Char *d;
@ -1239,15 +1209,18 @@ so_write(cp, n)
CursorH++; CursorH++;
} while (--n); } while (--n);
if (adrof(STRhighlight) && highlighting)
StopHighlight();
if (CursorH >= TermH) { /* wrap? */ if (CursorH >= TermH) { /* wrap? */
if (T_Margin & MARGIN_AUTO) { /* yes */ if (T_Margin & MARGIN_AUTO) { /* yes */
CursorH = 0; CursorH = 0;
CursorV++; CursorV++;
if (T_Margin & MARGIN_MAGIC) { if (T_Margin & MARGIN_MAGIC) {
/* force the wrap to avoid the "magic" situation */ /* force the wrap to avoid the "magic" situation */
Char c; Char xc;
if ((c = Display[CursorV][CursorH]) != '\0') { if ((xc = Display[CursorV][CursorH]) != '\0') {
so_write(&c, 1); so_write(&xc, 1);
while(Display[CursorV][CursorH] == CHAR_DBWIDTH) while(Display[CursorV][CursorH] == CHAR_DBWIDTH)
CursorH++; CursorH++;
} }
@ -1264,8 +1237,7 @@ so_write(cp, n)
void void
DeleteChars(num) /* deletes <num> characters */ DeleteChars(int num) /* deletes <num> characters */
int num;
{ {
if (num <= 0) if (num <= 0)
return; return;
@ -1303,10 +1275,10 @@ DeleteChars(num) /* deletes <num> characters */
(void) tputs(Str(T_ed), 1, PUTPURE); (void) tputs(Str(T_ed), 1, PUTPURE);
} }
/* Puts terminal in insert character mode, or inserts num characters in the
line */
void void
Insert_write(cp, num) /* Puts terminal in insert character mode, */ Insert_write(Char *cp, int num)
Char *cp;
int num; /* or inserts num characters in the line */
{ {
if (num <= 0) if (num <= 0)
return; 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 void
ClearEOL(num) /* clear to end of line. There are num */ ClearEOL(int num)
int num; /* characters to clear */
{ {
int i; int i;
@ -1377,7 +1349,7 @@ ClearEOL(num) /* clear to end of line. There are num */
} }
void void
ClearScreen() ClearScreen(void)
{ /* clear the whole screen and home */ { /* clear the whole screen and home */
if (GoodStr(T_cl)) if (GoodStr(T_cl))
/* send the clear screen code */ /* send the clear screen code */
@ -1394,7 +1366,7 @@ ClearScreen()
} }
void void
SoundBeep() SoundBeep(void)
{ /* produce a sound */ { /* produce a sound */
beep_cmd (); beep_cmd ();
if (adrof(STRnobeep)) if (adrof(STRnobeep))
@ -1410,7 +1382,7 @@ SoundBeep()
} }
void void
ClearToBottom() ClearToBottom(void)
{ /* clear to the bottom of the screen */ { /* clear to the bottom of the screen */
if (GoodStr(T_cd)) if (GoodStr(T_cd))
(void) tputs(Str(T_cd), Val(T_li), PUTPURE); (void) tputs(Str(T_cd), Val(T_li), PUTPURE);
@ -1419,7 +1391,7 @@ ClearToBottom()
} }
void void
GetTermCaps() GetTermCaps(void)
{ /* read in the needed terminal capabilites */ { /* read in the needed terminal capabilites */
int i; int i;
const char *ptr; const char *ptr;
@ -1430,17 +1402,14 @@ GetTermCaps()
#ifdef SIG_WINDOW #ifdef SIG_WINDOW
# ifdef BSDSIGS sigset_t oset, set;
sigmask_t omask;
# endif /* BSDSIGS */
int lins, cols; int lins, cols;
/* don't want to confuse things here */ /* don't want to confuse things here */
# ifdef BSDSIGS sigemptyset(&set);
omask = sigblock(sigmask(SIG_WINDOW)) & ~sigmask(SIG_WINDOW); sigaddset(&set, SIG_WINDOW);
# else /* BSDSIGS */ (void)sigprocmask(SIG_BLOCK, &set, &oset);
(void) sighold(SIG_WINDOW); cleanup_push(&oset, sigprocmask_cleanup);
# endif /* BSDSIGS */
#endif /* SIG_WINDOW */ #endif /* SIG_WINDOW */
area = buf; area = buf;
@ -1480,7 +1449,7 @@ GetTermCaps()
Val(T_co) = 80; /* do a dumb terminal */ Val(T_co) = 80; /* do a dumb terminal */
Val(T_pt) = Val(T_km) = Val(T_li) = 0; Val(T_pt) = Val(T_km) = Val(T_li) = 0;
for (t = tstr; t->name != NULL; t++) for (t = tstr; t->name != NULL; t++)
TCalloc(t, NULL); TCset(t, NULL);
} }
else { else {
/* Can we tab */ /* Can we tab */
@ -1492,7 +1461,7 @@ GetTermCaps()
Val(T_co) = tgetnum("co"); Val(T_co) = tgetnum("co");
Val(T_li) = tgetnum("li"); Val(T_li) = tgetnum("li");
for (t = tstr; t->name != NULL; t++) for (t = tstr; t->name != NULL; t++)
TCalloc(t, tgetstr(t->name, &area)); TCset(t, tgetstr(t->name, &area));
} }
if (Val(T_co) < 2) if (Val(T_co) < 2)
Val(T_co) = 80; /* just in case */ Val(T_co) = 80; /* just in case */
@ -1502,10 +1471,10 @@ GetTermCaps()
T_Cols = (Char) Val(T_co); T_Cols = (Char) Val(T_co);
T_Lines = (Char) Val(T_li); T_Lines = (Char) Val(T_li);
if (T_Tabs) if (T_Tabs)
T_Tabs = (Char) Val(T_pt); T_Tabs = Val(T_pt);
T_HasMeta = (Char) Val(T_km); T_HasMeta = Val(T_km);
T_Margin = (Char) Val(T_am) ? MARGIN_AUTO : 0; T_Margin = Val(T_am) ? MARGIN_AUTO : 0;
T_Margin |= (Char) Val(T_xn) ? MARGIN_MAGIC : 0; T_Margin |= Val(T_xn) ? MARGIN_MAGIC : 0;
T_CanCEOL = GoodStr(T_ce); T_CanCEOL = GoodStr(T_ce);
T_CanDel = GoodStr(T_dc) || GoodStr(T_DC); T_CanDel = GoodStr(T_dc) || GoodStr(T_DC);
T_CanIns = GoodStr(T_im) || GoodStr(T_ic) || GoodStr(T_IC); 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 */ (void) GetSize(&lins, &cols); /* get the correct window size */
ChangeSize(lins, cols); ChangeSize(lins, cols);
# ifdef BSDSIGS cleanup_until(&oset); /* can change it again */
(void) sigsetmask(omask); /* can change it again */
# else /* BSDSIGS */
(void) sigrelse(SIG_WINDOW);
# endif /* BSDSIGS */
#else /* SIG_WINDOW */ #else /* SIG_WINDOW */
ChangeSize(Val(T_li), Val(T_co)); ChangeSize(Val(T_li), Val(T_co));
#endif /* SIG_WINDOW */ #endif /* SIG_WINDOW */
@ -1557,8 +1522,7 @@ GetTermCaps()
* is not a tty, but it will work in most cases. * is not a tty, but it will work in most cases.
*/ */
int int
GetSize(lins, cols) GetSize(int *lins, int *cols)
int *lins, *cols;
{ {
*cols = Val(T_co); *cols = Val(T_co);
*lins = Val(T_li); *lins = Val(T_li);
@ -1596,11 +1560,10 @@ GetSize(lins, cols)
return (Val(T_co) != *cols || Val(T_li) != *lins); return (Val(T_co) != *cols || Val(T_li) != *lins);
} }
#endif /* SIGWINDOW */ #endif /* SIG_WINDOW */
void void
ChangeSize(lins, cols) ChangeSize(int lins, int cols)
int lins, cols;
{ {
/* /*
* Just in case * Just in case
@ -1620,26 +1583,31 @@ ChangeSize(lins, cols)
* our only chance to get the window size right. * our only chance to get the window size right.
*/ */
if (Val(T_co) == cols && Val(T_li) == lins) { if (Val(T_co) == cols && Val(T_li) == lins) {
Char buf[10]; Char *p;
char *tptr; char *tptr;
if (getenv("COLUMNS")) { if (getenv("COLUMNS")) {
(void) Itoa(Val(T_co), buf, 0, 0); p = Itoa(Val(T_co), 0, 0);
tsetenv(STRCOLUMNS, buf); cleanup_push(p, xfree);
tsetenv(STRCOLUMNS, p);
cleanup_until(p);
} }
if (getenv("LINES")) { if (getenv("LINES")) {
(void) Itoa(Val(T_li), buf, 0, 0); p = Itoa(Val(T_li), 0, 0);
tsetenv(STRLINES, buf); cleanup_push(p, xfree);
tsetenv(STRLINES, p);
cleanup_until(p);
} }
if ((tptr = getenv("TERMCAP")) != NULL) { if ((tptr = getenv("TERMCAP")) != NULL) {
/* Leave 64 characters slop in case we enlarge the termcap string */ /* 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); ptr = str2short(tptr);
(void) Strncpy(termcap, ptr, 1024); (void) Strncpy(termcap, ptr, TC_BUFSIZE);
termcap[1023] = '\0'; termcap[TC_BUFSIZE-1] = '\0';
/* update termcap string; first do columns */ /* update termcap string; first do columns */
buf[0] = 'c'; buf[0] = 'c';
@ -1653,8 +1621,9 @@ ChangeSize(lins, cols)
size_t len = (ptr - termcap) + Strlen(buf); size_t len = (ptr - termcap) + Strlen(buf);
(void) Strncpy(backup, termcap, len); (void) Strncpy(backup, termcap, len);
backup[len] = '\0'; backup[len] = '\0';
(void) Itoa(Val(T_co), buf, 0, 0); p = Itoa(Val(T_co), 0, 0);
(void) Strcat(backup + len, buf); (void) Strcat(backup + len, p);
xfree(p);
ptr = Strchr(ptr, ':'); ptr = Strchr(ptr, ':');
(void) Strcat(backup, ptr); (void) Strcat(backup, ptr);
} }
@ -1671,16 +1640,17 @@ ChangeSize(lins, cols)
size_t len = (ptr - backup) + Strlen(buf); size_t len = (ptr - backup) + Strlen(buf);
(void) Strncpy(termcap, backup, len); (void) Strncpy(termcap, backup, len);
termcap[len] = '\0'; termcap[len] = '\0';
(void) Itoa(Val(T_li), buf, 0, 0); p = Itoa(Val(T_li), 0, 0);
(void) Strcat(termcap, buf); (void) Strcat(termcap, p);
xfree(p);
ptr = Strchr(ptr, ':'); ptr = Strchr(ptr, ':');
(void) Strcat(termcap, ptr); (void) Strcat(termcap, ptr);
} }
/* /*
* Chop the termcap string at 1024 characters to avoid core-dumps * Chop the termcap string at TC_BUFSIZE-1 characters to avoid
* in the termcap routines * core-dumps in the termcap routines
*/ */
termcap[1023] = '\0'; termcap[TC_BUFSIZE - 1] = '\0';
tsetenv(STRTERMCAP, termcap); tsetenv(STRTERMCAP, termcap);
} }
} }

View File

@ -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 * ed.term.c: Low level terminal interface
*/ */
@ -33,7 +33,7 @@
#include "sh.h" #include "sh.h"
#ifndef WINNT_NATIVE #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" #include "ed.h"
@ -84,7 +84,7 @@ ttyperm_t ttylist = {
} }
}; };
static struct tcshmodes { static const struct tcshmodes {
const char *m_name; const char *m_name;
#ifdef SOLARIS2 #ifdef SOLARIS2
unsigned long m_value; unsigned long m_value;
@ -568,33 +568,35 @@ static struct tcshmodes {
#endif #endif
/* Retry a system call */ /* Retry a system call */
static int count; #define RETRY(x) \
#define RETRY(x) \ do { \
for (count = 0;; count++) \ int count; \
if ((x) == -1) { \ \
if (OKERROR(errno) || KLUDGE) \ for (count = 0;; count++) \
continue; \ if ((x) == -1) { \
else \ if (OKERROR(errno) || KLUDGE) \
return -1; \ continue; \
} \ else \
else \ return -1; \
break \ } \
else \
break; \
} while (0)
/*ARGSUSED*/ /*ARGSUSED*/
void void
dosetty(v, t) dosetty(Char **v, struct command *t)
Char **v;
struct command *t;
{ {
struct tcshmodes *m; const struct tcshmodes *m;
char x, *d; char x, *d, *cmdname;
int aflag = 0; int aflag = 0;
Char *s; Char *s;
int z = EX_IO; int z = EX_IO;
char cmdname[BUFSIZE];
USE(t); 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') while (v && *v && v[0][0] == '-' && v[0][2] == '\0')
switch (v[0][1]) { switch (v[0][1]) {
@ -615,7 +617,7 @@ dosetty(v, t)
z = QU_IO; z = QU_IO;
break; break;
default: default:
stderror(ERR_NAME | ERR_SYSTEM, short2str(v[0]), stderror(ERR_NAME | ERR_SYSTEM, short2str(v[0]),
CGETS(8, 1, "Unknown switch")); CGETS(8, 1, "Unknown switch"));
break; break;
} }
@ -626,7 +628,7 @@ dosetty(v, t)
int len = 0, st = 0, cu; int len = 0, st = 0, cu;
for (m = modelist; m->m_name; m++) { for (m = modelist; m->m_name; m++) {
if (m->m_type != i) { if (m->m_type != i) {
xprintf("%s%s", i != -1 ? "\n" : "", xprintf("%s%s", i != -1 ? "\n" : "",
ttylist[z][m->m_type].t_name); ttylist[z][m->m_type].t_name);
i = m->m_type; i = m->m_type;
st = len = strlen(ttylist[z][m->m_type].t_name); st = len = strlen(ttylist[z][m->m_type].t_name);
@ -637,7 +639,7 @@ dosetty(v, t)
if (x != '\0' || aflag) { if (x != '\0' || aflag) {
cu = strlen(m->m_name) + (x != '\0') + 1; cu = strlen(m->m_name) + (x != '\0') + 1;
if (len + cu >= T_Cols) { if (len + cu >= TermH) {
xprintf("\n%*s", st, ""); xprintf("\n%*s", st, "");
len = st + cu; len = st + cu;
} }
@ -650,6 +652,7 @@ dosetty(v, t)
} }
} }
xputchar('\n'); xputchar('\n');
cleanup_until(cmdname);
return; return;
} }
while (v && (s = *v++)) { while (v && (s = *v++)) {
@ -684,12 +687,11 @@ dosetty(v, t)
break; break;
} }
} }
cleanup_until(cmdname);
} /* end dosetty */ } /* end dosetty */
int int
tty_getty(fd, td) tty_getty(int fd, ttydata_t *td)
int fd;
ttydata_t *td;
{ {
#ifdef POSIX #ifdef POSIX
RETRY(tcgetattr(fd, &td->d_t)); RETRY(tcgetattr(fd, &td->d_t));
@ -720,12 +722,10 @@ tty_getty(fd, td)
} }
int int
tty_setty(fd, td) tty_setty(int fd, ttydata_t *td)
int fd;
ttydata_t *td;
{ {
#ifdef POSIX #ifdef POSIX
RETRY(tcsetattr(fd, TCSADRAIN, &td->d_t)); RETRY(xtcsetattr(fd, TCSADRAIN, &td->d_t));
#else #else
# ifdef TERMIO # ifdef TERMIO
RETRY(ioctl(fd, TCSETAW, (ioctl_t) &td->d_t)); RETRY(ioctl(fd, TCSETAW, (ioctl_t) &td->d_t));
@ -753,9 +753,7 @@ tty_setty(fd, td)
} }
void void
tty_getchar(td, s) tty_getchar(ttydata_t *td, unsigned char *s)
ttydata_t *td;
unsigned char *s;
{ {
#ifdef TIOCGLTC #ifdef TIOCGLTC
{ {
@ -891,9 +889,7 @@ tty_getchar(td, s)
void void
tty_setchar(td, s) tty_setchar(ttydata_t *td, unsigned char *s)
ttydata_t *td;
unsigned char *s;
{ {
#ifdef TIOCGLTC #ifdef TIOCGLTC
{ {
@ -1030,8 +1026,7 @@ tty_setchar(td, s)
} /* tty_setchar */ } /* tty_setchar */
speed_t speed_t
tty_getspeed(td) tty_getspeed(ttydata_t *td)
ttydata_t *td;
{ {
speed_t spd; speed_t spd;
@ -1054,8 +1049,7 @@ tty_getspeed(td)
} /* end tty_getspeed */ } /* end tty_getspeed */
int int
tty_gettabs(td) tty_gettabs(ttydata_t *td)
ttydata_t *td;
{ {
#if defined(POSIX) || defined(TERMIO) #if defined(POSIX) || defined(TERMIO)
return ((td->d_t.c_oflag & TAB3) == TAB3) ? 0 : 1; return ((td->d_t.c_oflag & TAB3) == TAB3) ? 0 : 1;
@ -1065,8 +1059,7 @@ tty_gettabs(td)
} /* end tty_gettabs */ } /* end tty_gettabs */
int int
tty_geteightbit(td) tty_geteightbit(ttydata_t *td)
ttydata_t *td;
{ {
#if defined(POSIX) || defined(TERMIO) #if defined(POSIX) || defined(TERMIO)
return (td->d_t.c_cflag & CSIZE) == CS8; return (td->d_t.c_cflag & CSIZE) == CS8;
@ -1076,8 +1069,7 @@ tty_geteightbit(td)
} /* end tty_geteightbit */ } /* end tty_geteightbit */
int int
tty_cooked_mode(td) tty_cooked_mode(ttydata_t *td)
ttydata_t *td;
{ {
#if defined(POSIX) || defined(TERMIO) #if defined(POSIX) || defined(TERMIO)
return (td->d_t.c_lflag & ICANON); return (td->d_t.c_lflag & ICANON);
@ -1088,9 +1080,7 @@ tty_cooked_mode(td)
#ifdef _IBMR2 #ifdef _IBMR2
void void
tty_setdisc(fd, dis) tty_setdisc(int fd, int dis)
int fd;
int dis;
{ {
static int edit_discipline = 0; static int edit_discipline = 0;
static union txname tx_disc; static union txname tx_disc;
@ -1124,8 +1114,7 @@ tty_setdisc(fd, dis)
#ifdef DEBUG_TTY #ifdef DEBUG_TTY
static void static void
tty_printchar(s) tty_printchar(unsigned char *s)
unsigned char *s;
{ {
struct tcshmodes *m; struct tcshmodes *m;
int i; int i;
@ -1144,8 +1133,7 @@ tty_printchar(s)
#endif /* DEBUG_TTY */ #endif /* DEBUG_TTY */
#else /* WINNT_NATIVE */ #else /* WINNT_NATIVE */
int int
tty_cooked_mode(td) tty_cooked_mode(void *td)
void *td;
{ {
return do_nt_check_cooked_mode(); return do_nt_check_cooked_mode();
} }

View File

@ -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 * ed.term.h: Local terminal header
*/ */

View File

@ -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 * ed.xmap.c: This module contains the procedures for maintaining
* the extended-key map. * the extended-key map.
@ -88,7 +88,7 @@
*/ */
#include "sh.h" #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.h"
#include "ed.defns.h" #include "ed.defns.h"
@ -112,24 +112,22 @@ typedef struct Xmapnode {
} XmapNode; } XmapNode;
static XmapNode *Xmap = NULL; /* the current Xmap */ 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 */ /* Some declarations of procedures */
static int TraverseMap __P((XmapNode *, CStr *, XmapVal *)); static int TraverseMap (XmapNode *, CStr *, XmapVal *);
static int TryNode __P((XmapNode *, CStr *, XmapVal *, int)); static int TryNode (XmapNode *, CStr *, XmapVal *, int);
static XmapNode *GetFreeNode __P((CStr *)); static XmapNode *GetFreeNode (CStr *);
static void PutFreeNode __P((XmapNode *)); static void PutFreeNode (XmapNode *);
static int TryDeleteNode __P((XmapNode **, CStr *)); static int TryDeleteNode (XmapNode **, CStr *);
static int Lookup __P((CStr *, XmapNode *, int)); static int Lookup (struct Strbuf *, const CStr *,
static int Enumerate __P((XmapNode *, int)); const XmapNode *);
static int unparsech __P((int, Char *)); static void Enumerate (struct Strbuf *, const XmapNode *);
static void unparsech (struct Strbuf *, Char);
XmapVal * XmapVal *
XmapCmd(cmd) XmapCmd(int cmd)
int cmd;
{ {
static XmapVal xm; static XmapVal xm;
xm.cmd = (KEYCMD) cmd; xm.cmd = (KEYCMD) cmd;
@ -137,8 +135,7 @@ XmapCmd(cmd)
} }
XmapVal * XmapVal *
XmapStr(str) XmapStr(CStr *str)
CStr *str;
{ {
static XmapVal xm; static XmapVal xm;
xm.str.len = str->len; xm.str.len = str->len;
@ -151,7 +148,7 @@ XmapStr(str)
* initializes Xmap with arrow keys * initializes Xmap with arrow keys
*/ */
void void
ResetXmap() ResetXmap(void)
{ {
PutFreeNode(Xmap); PutFreeNode(Xmap);
Xmap = NULL; Xmap = NULL;
@ -165,9 +162,7 @@ ResetXmap()
* Calls the recursive function with entry point Xmap * Calls the recursive function with entry point Xmap
*/ */
int int
GetXkey(ch, val) GetXkey(CStr *ch, XmapVal *val)
CStr *ch;
XmapVal *val;
{ {
return (TraverseMap(Xmap, ch, val)); return (TraverseMap(Xmap, ch, val));
} }
@ -177,10 +172,7 @@ GetXkey(ch, val)
* found. May read in more characters. * found. May read in more characters.
*/ */
static int static int
TraverseMap(ptr, ch, val) TraverseMap(XmapNode *ptr, CStr *ch, XmapVal *val)
XmapNode *ptr;
CStr *ch;
XmapVal *val;
{ {
Char tch; Char tch;
@ -218,10 +210,7 @@ TraverseMap(ptr, ch, val)
} }
void void
AddXkey(Xkey, val, ntype) AddXkey(const CStr *Xkey, XmapVal *val, int ntype)
CStr *Xkey;
XmapVal *val;
int ntype;
{ {
CStr cs; CStr cs;
cs.buf = Xkey->buf; cs.buf = Xkey->buf;
@ -246,11 +235,7 @@ AddXkey(Xkey, val, ntype)
} }
static int static int
TryNode(ptr, str, val, ntype) TryNode(XmapNode *ptr, CStr *str, XmapVal *val, int ntype)
XmapNode *ptr;
CStr *str;
XmapVal *val;
int ntype;
{ {
/* /*
* Find a node that matches *string or allocate a new one * Find a node that matches *string or allocate a new one
@ -269,6 +254,8 @@ TryNode(ptr, str, val, ntype)
str->buf++; str->buf++;
str->len--; str->len--;
if (str->len == 0) { if (str->len == 0) {
size_t len;
/* we're there */ /* we're there */
if (ptr->next != NULL) { if (ptr->next != NULL) {
PutFreeNode(ptr->next); /* lose longer Xkeys with this prefix */ PutFreeNode(ptr->next); /* lose longer Xkeys with this prefix */
@ -278,8 +265,7 @@ TryNode(ptr, str, val, ntype)
switch (ptr->type) { switch (ptr->type) {
case XK_STR: case XK_STR:
case XK_EXE: case XK_EXE:
if (ptr->val.str.buf != NULL) xfree(ptr->val.str.buf);
xfree((ptr_t) ptr->val.str.buf);
ptr->val.str.len = 0; ptr->val.str.len = 0;
break; break;
case XK_NOD: case XK_NOD:
@ -296,11 +282,10 @@ TryNode(ptr, str, val, ntype)
break; break;
case XK_STR: case XK_STR:
case XK_EXE: 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; 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; break;
default: default:
abort(); abort();
@ -317,9 +302,7 @@ TryNode(ptr, str, val, ntype)
} }
void void
ClearXkey(map, in) ClearXkey(KEYCMD *map, const CStr *in)
KEYCMD *map;
CStr *in;
{ {
unsigned char c = (unsigned char) *(in->buf); unsigned char c = (unsigned char) *(in->buf);
if ((map[c] == F_XKEY) && if ((map[c] == F_XKEY) &&
@ -329,10 +312,12 @@ ClearXkey(map, in)
} }
int int
DeleteXkey(Xkey) DeleteXkey(const CStr *Xkey)
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")); xprintf(CGETS(9, 3, "DeleteXkey: Null extended-key not allowed.\n"));
return (-1); return (-1);
} }
@ -340,17 +325,15 @@ DeleteXkey(Xkey)
if (Xmap == NULL) if (Xmap == NULL)
return (0); return (0);
(void) TryDeleteNode(&Xmap, Xkey); (void) TryDeleteNode(&Xmap, &s);
return (0); return (0);
} }
/* Destroys str */
static int static int
TryDeleteNode(inptr, str) TryDeleteNode(XmapNode **inptr, CStr *str)
XmapNode **inptr;
CStr *str;
{ {
XmapNode *ptr; XmapNode *ptr;
XmapNode *prev_ptr = NULL;
ptr = *inptr; ptr = *inptr;
/* /*
@ -364,7 +347,7 @@ TryDeleteNode(inptr, str)
break; break;
if (xm->sibling == NULL) if (xm->sibling == NULL)
return (0); return (0);
prev_ptr = xm; inptr = &xm->sibling;
ptr = xm->sibling; ptr = xm->sibling;
} }
@ -373,10 +356,7 @@ TryDeleteNode(inptr, str)
if (str->len == 0) { if (str->len == 0) {
/* we're there */ /* we're there */
if (prev_ptr == NULL) *inptr = ptr->sibling;
*inptr = ptr->sibling;
else
prev_ptr->sibling = ptr->sibling;
ptr->sibling = NULL; ptr->sibling = NULL;
PutFreeNode(ptr); PutFreeNode(ptr);
return (1); return (1);
@ -384,10 +364,7 @@ TryDeleteNode(inptr, str)
else if (ptr->next != NULL && TryDeleteNode(&ptr->next, str) == 1) { else if (ptr->next != NULL && TryDeleteNode(&ptr->next, str) == 1) {
if (ptr->next != NULL) if (ptr->next != NULL)
return (0); return (0);
if (prev_ptr == NULL) *inptr = ptr->sibling;
*inptr = ptr->sibling;
else
prev_ptr->sibling = ptr->sibling;
ptr->sibling = NULL; ptr->sibling = NULL;
PutFreeNode(ptr); PutFreeNode(ptr);
return (1); return (1);
@ -401,8 +378,7 @@ TryDeleteNode(inptr, str)
* Puts a tree of nodes onto free list using free(3). * Puts a tree of nodes onto free list using free(3).
*/ */
static void static void
PutFreeNode(ptr) PutFreeNode(XmapNode *ptr)
XmapNode *ptr;
{ {
if (ptr == NULL) if (ptr == NULL)
return; return;
@ -420,14 +396,13 @@ PutFreeNode(ptr)
break; break;
case XK_EXE: case XK_EXE:
case XK_STR: case XK_STR:
if (ptr->val.str.buf != NULL) xfree(ptr->val.str.buf);
xfree((ptr_t) ptr->val.str.buf);
break; break;
default: default:
abort(); abort();
break; break;
} }
xfree((ptr_t) ptr); xfree(ptr);
} }
@ -435,12 +410,11 @@ PutFreeNode(ptr)
* Returns pointer to an XmapNode for ch. * Returns pointer to an XmapNode for ch.
*/ */
static XmapNode * static XmapNode *
GetFreeNode(ch) GetFreeNode(CStr *ch)
CStr *ch;
{ {
XmapNode *ptr; XmapNode *ptr;
ptr = (XmapNode *) xmalloc((size_t) sizeof(XmapNode)); ptr = xmalloc(sizeof(XmapNode));
ptr->ch = ch->buf[0]; ptr->ch = ch->buf[0];
ptr->type = XK_NOD; ptr->type = XK_NOD;
ptr->val.str.buf = NULL; ptr->val.str.buf = NULL;
@ -456,9 +430,9 @@ GetFreeNode(ch)
* Print entire Xmap if null * Print entire Xmap if null
*/ */
void void
PrintXkey(key) PrintXkey(const CStr *key)
CStr *key;
{ {
struct Strbuf buf = Strbuf_INIT;
CStr cs; CStr cs;
if (key) { if (key) {
@ -473,11 +447,12 @@ PrintXkey(key)
if (Xmap == NULL && cs.len == 0) if (Xmap == NULL && cs.len == 0)
return; return;
printbuf[0] = '"'; Strbuf_append1(&buf, '"');
if (Lookup(&cs, Xmap, 1) <= -1) cleanup_push(&buf, Strbuf_cleanup);
if (Lookup(&buf, &cs, Xmap) <= -1)
/* key is not bound */ /* key is not bound */
xprintf(CGETS(9, 4, "Unbound extended key \"%S\"\n"), cs.buf); xprintf(CGETS(9, 4, "Unbound extended key \"%S\"\n"), cs.buf);
return; cleanup_until(&buf);
} }
/* Lookup(): /* Lookup():
@ -485,42 +460,34 @@ PrintXkey(key)
* Print if last node * Print if last node
*/ */
static int static int
Lookup(str, ptr, cnt) Lookup(struct Strbuf *buf, const CStr *str, const XmapNode *ptr)
CStr *str;
XmapNode *ptr;
int cnt;
{ {
int ncnt;
if (ptr == NULL) if (ptr == NULL)
return (-1); /* cannot have null ptr */ return (-1); /* cannot have null ptr */
if (str->len == 0) { if (str->len == 0) {
/* no more chars in string. Enumerate from here. */ /* no more chars in string. Enumerate from here. */
(void) Enumerate(ptr, cnt); Enumerate(buf, ptr);
return (0); return (0);
} }
else { else {
/* If match put this char into printbuf. Recurse */ /* If match put this char into buf. Recurse */
if (ptr->ch == *(str->buf)) { if (ptr->ch == *(str->buf)) {
/* match found */ /* match found */
ncnt = unparsech(cnt, &ptr->ch); unparsech(buf, ptr->ch);
if (ptr->next != NULL) { if (ptr->next != NULL) {
/* not yet at leaf */ /* not yet at leaf */
CStr tstr; CStr tstr;
tstr.buf = str->buf + 1; tstr.buf = str->buf + 1;
tstr.len = str->len - 1; tstr.len = str->len - 1;
return (Lookup(&tstr, ptr->next, ncnt + 1)); return (Lookup(buf, &tstr, ptr->next));
} }
else { else {
/* next node is null so key should be complete */ /* next node is null so key should be complete */
if (str->len == 1) { if (str->len == 1) {
CStr pb; Strbuf_append1(buf, '"');
printbuf[ncnt + 1] = '"'; Strbuf_terminate(buf);
printbuf[ncnt + 2] = '\0'; printOne(buf->s, &ptr->val, ptr->type);
pb.buf = printbuf;
pb.len = ncnt + 2;
(void) printOne(&pb, &ptr->val, ptr->type);
return (0); return (0);
} }
else else
@ -530,53 +497,41 @@ Lookup(str, ptr, cnt)
else { else {
/* no match found try sibling */ /* no match found try sibling */
if (ptr->sibling) if (ptr->sibling)
return (Lookup(str, ptr->sibling, cnt)); return (Lookup(buf, str, ptr->sibling));
else else
return (-1); return (-1);
} }
} }
} }
static int static void
Enumerate(ptr, cnt) Enumerate(struct Strbuf *buf, const XmapNode *ptr)
XmapNode *ptr;
int cnt;
{ {
int ncnt; size_t old_len;
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);
}
if (ptr == NULL) { if (ptr == NULL) {
#ifdef DEBUG_EDIT #ifdef DEBUG_EDIT
xprintf(CGETS(9, 6, "Enumerate: BUG!! Null ptr passed\n!")); xprintf(CGETS(9, 6, "Enumerate: BUG!! Null ptr passed\n!"));
#endif #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) { if (ptr->next == NULL) {
CStr pb;
/* print this Xkey and function */ /* print this Xkey and function */
printbuf[++ncnt] = '"'; Strbuf_append1(buf, '"');
printbuf[++ncnt] = '\0'; Strbuf_terminate(buf);
pb.buf = printbuf; printOne(buf->s, &ptr->val, ptr->type);
pb.len = ncnt;
(void) printOne(&pb, &ptr->val, ptr->type);
} }
else else
(void) Enumerate(ptr->next, ncnt + 1); Enumerate(buf, ptr->next);
/* go to sibling if there is one */ /* go to sibling if there is one */
if (ptr->sibling) if (ptr->sibling) {
(void) Enumerate(ptr->sibling, cnt); buf->len = old_len;
return (0); Enumerate(buf, ptr->sibling);
}
} }
@ -584,24 +539,25 @@ Enumerate(ptr, cnt)
* Print the specified key and its associated * Print the specified key and its associated
* function specified by val * function specified by val
*/ */
int void
printOne(key, val, ntype) printOne(const Char *key, const XmapVal *val, int ntype)
CStr *key;
XmapVal *val;
int ntype;
{ {
struct KeyFuncs *fp; struct KeyFuncs *fp;
unsigned char unparsbuf[200];
static const char *fmt = "%s\n"; static const char *fmt = "%s\n";
xprintf("%-15S-> ", key->buf); xprintf("%-15S-> ", key);
if (val != NULL) if (val != NULL)
switch (ntype) { switch (ntype) {
case XK_STR: case XK_STR:
case XK_EXE: case XK_EXE: {
xprintf(fmt, unparsestring(&val->str, unparsbuf, unsigned char *p;
ntype == XK_STR ? STRQQ : STRBB));
p = unparsestring(&val->str, ntype == XK_STR ? STRQQ : STRBB);
cleanup_push(p, xfree);
xprintf(fmt, p);
cleanup_until(p);
break; break;
}
case XK_CMD: case XK_CMD:
for (fp = FuncNames; fp->name; fp++) for (fp = FuncNames; fp->name; fp++)
if (val->cmd == fp->func) if (val->cmd == fp->func)
@ -612,72 +568,46 @@ printOne(key, val, ntype)
break; break;
} }
else else
xprintf(fmt, key, CGETS(9, 7, "no input")); xprintf(fmt, CGETS(9, 7, "no input"));
return (0);
} }
static int static void
unparsech(cnt, ch) unparsech(struct Strbuf *buf, Char ch)
int cnt;
Char *ch;
{ {
if (ch == 0) { if (ch == 0) {
printbuf[cnt++] = '^'; Strbuf_append1(buf, '^');
printbuf[cnt] = '@'; Strbuf_append1(buf, '@');
return cnt;
} }
else if (Iscntrl(ch)) {
if (Iscntrl(*ch)) { Strbuf_append1(buf, '^');
if (ch == CTL_ESC('\177'))
Strbuf_append1(buf, '?');
else
#ifdef IS_ASCII #ifdef IS_ASCII
printbuf[cnt++] = '^'; Strbuf_append1(buf, ch | 0100);
if (*ch == CTL_ESC('\177'))
printbuf[cnt] = '?';
else
printbuf[cnt] = *ch | 0100;
#else #else
if (*ch == CTL_ESC('\177')) Strbuf_append1(buf, _toebcdic[_toascii[ch]|0100]);
{
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';
}
#endif #endif
} }
else if (*ch == '^') { else if (ch == '^') {
printbuf[cnt++] = '\\'; Strbuf_append1(buf, '\\');
printbuf[cnt] = '^'; Strbuf_append1(buf, '^');
} } else if (ch == '\\') {
else if (*ch == '\\') { Strbuf_append1(buf, '\\');
printbuf[cnt++] = '\\'; Strbuf_append1(buf, '\\');
printbuf[cnt] = '\\'; } else if (ch == ' ' || (Isprint(ch) && !Isspace(ch))) {
} Strbuf_append1(buf, ch);
else if (*ch == ' ' || (Isprint(*ch) && !Isspace(*ch))) {
printbuf[cnt] = *ch;
} }
else { else {
printbuf[cnt++] = '\\'; Strbuf_append1(buf, '\\');
printbuf[cnt++] = ((*ch >> 6) & 7) + '0'; Strbuf_append1(buf, ((ch >> 6) & 7) + '0');
printbuf[cnt++] = ((*ch >> 3) & 7) + '0'; Strbuf_append1(buf, ((ch >> 3) & 7) + '0');
printbuf[cnt] = (*ch & 7) + '0'; Strbuf_append1(buf, (ch & 7) + '0');
} }
return cnt;
} }
eChar eChar
parseescape(ptr) parseescape(const Char **ptr)
const Char **ptr;
{ {
const Char *p; const Char *p;
Char c; Char c;
@ -685,7 +615,7 @@ parseescape(ptr)
p = *ptr; p = *ptr;
if ((p[1] & CHAR) == 0) { 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; return CHAR_ERR;
} }
if ((*p & CHAR) == '\\') { if ((*p & CHAR) == '\\') {
@ -738,7 +668,7 @@ parseescape(ptr)
} }
val = (val << 3) | (ch - '0'); val = (val << 3) | (ch - '0');
} }
if ((val & 0xffffff00) != 0) { if ((val & ~0xff) != 0) {
xprintf(CGETS(9, 9, xprintf(CGETS(9, 9,
"Octal constant does not fit in a char.\n")); "Octal constant does not fit in a char.\n"));
return 0; return 0;
@ -777,15 +707,14 @@ parseescape(ptr)
unsigned char * unsigned char *
unparsestring(str, buf, sep) unparsestring(const CStr *str, const Char *sep)
CStr *str;
unsigned char *buf;
Char *sep;
{ {
unsigned char *b; unsigned char *buf, *b;
Char p; Char p;
int l; 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; b = buf;
if (sep[0]) if (sep[0])
#ifndef WINNT_NATIVE #ifndef WINNT_NATIVE
@ -797,26 +726,14 @@ unparsestring(str, buf, sep)
for (l = 0; l < str->len; l++) { for (l = 0; l < str->len; l++) {
p = str->buf[l]; p = str->buf[l];
if (Iscntrl(p)) { if (Iscntrl(p)) {
#ifdef IS_ASCII
*b++ = '^'; *b++ = '^';
if (p == CTL_ESC('\177')) if (p == CTL_ESC('\177'))
*b++ = '?'; *b++ = '?';
else else
#ifdef IS_ASCII
*b++ = (unsigned char) (p | 0100); *b++ = (unsigned char) (p | 0100);
#else #else
if (_toascii[p] == '\177' || Isupper(_toebcdic[_toascii[p]|0100]) *b++ = _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';
}
#endif #endif
} }
else if (p == '^' || p == '\\') { else if (p == '^' || p == '\\') {

View File

@ -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 How to use 8 bit characters
by by
Johan Widen Johan Widen

View File

@ -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 * gethost.c: Create version file from prototype
*/ */
@ -32,7 +32,7 @@
*/ */
#include "sh.h" #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 #ifdef SCO
# define perror __perror # define perror __perror
@ -89,17 +89,16 @@ static const char *keyword[] =
#define S_CODE 2 #define S_CODE 2
#define S_KEYWORD 3 #define S_KEYWORD 3
static int findtoken __P((char *)); static int findtoken (char *);
static char *gettoken __P((char **, char *)); static char *gettoken (char **, char *);
int main __P((int, char *[])); int main (int, char *[]);
/* findtoken(): /* findtoken():
* Return the token number of the given token * Return the token number of the given token
*/ */
static int static int
findtoken(ptr) findtoken(char *ptr)
char *ptr;
{ {
int i; int i;
@ -118,9 +117,7 @@ findtoken(ptr)
* Get : delimited token and remove leading/trailing blanks/newlines * Get : delimited token and remove leading/trailing blanks/newlines
*/ */
static char * static char *
gettoken(pptr, token) gettoken(char **pptr, char *token)
char **pptr;
char *token;
{ {
char *ptr = *pptr; char *ptr = *pptr;
char *tok = token; char *tok = token;
@ -147,9 +144,7 @@ gettoken(pptr, token)
int int
main(argc, argv) main(int argc, char *argv[])
int argc;
char *argv[];
{ {
char line[INBUFSIZE]; char line[INBUFSIZE];
char *pname; char *pname;

View File

@ -63,7 +63,6 @@ static char sccsid[] = "@(#)glob.c 5.12 (Berkeley) 6/24/91";
#undef QUOTE #undef QUOTE
#undef TILDE #undef TILDE
#undef META #undef META
#undef CHAR
#undef ismeta #undef ismeta
#undef Strchr #undef Strchr
@ -81,23 +80,22 @@ static char sccsid[] = "@(#)glob.c 5.12 (Berkeley) 6/24/91";
typedef unsigned short Char; typedef unsigned short Char;
static int glob1 __P((Char *, glob_t *, int)); static int glob1 (Char *, glob_t *, int);
static int glob2 __P((Char *, Char *, Char *, glob_t *, int)); static int glob2 (struct strbuf *, const Char *, glob_t *, int);
static int glob3 __P((Char *, Char *, Char *, Char *, static int glob3 (struct strbuf *, const Char *, const Char *,
glob_t *, int)); glob_t *, int);
static int globextend __P((Char *, glob_t *)); static void globextend (const char *, glob_t *);
static int match __P((Char *, Char *, Char *, int)); static int match (const char *, const Char *, const Char *,
#ifndef __clipper__ int);
static int compare __P((const ptr_t, const ptr_t)); static int compare (const void *, const void *);
#endif static DIR *Opendir (const char *);
static DIR *Opendir __P((Char *));
#ifdef S_IFLNK #ifdef S_IFLNK
static int Lstat __P((Char *, struct stat *)); static int Lstat (const char *, struct stat *);
#endif #endif
static int Stat __P((Char *, struct stat *sb)); static int Stat (const char *, struct stat *sb);
static Char *Strchr __P((Char *, int)); static Char *Strchr (Char *, int);
#ifdef DEBUG #ifdef DEBUG
static void qprintf __P((Char *)); static void qprintf (const Char *);
#endif #endif
#define DOLLAR '$' #define DOLLAR '$'
@ -120,7 +118,7 @@ static void qprintf __P((Char *));
#define M_MASK 0xffff #define M_MASK 0xffff
#define M_ASCII 0x00ff #define M_ASCII 0x00ff
#define CHAR(c) ((c)&M_ASCII) #define LCHAR(c) ((c)&M_ASCII)
#define META(c) ((c)|M_META) #define META(c) ((c)|M_META)
#define M_ALL META('*') #define M_ALL META('*')
#define M_END META(']') #define M_END META(']')
@ -131,19 +129,11 @@ static void qprintf __P((Char *));
#define M_SET META('[') #define M_SET META('[')
#define ismeta(c) (((c)&M_META) != 0) #define ismeta(c) (((c)&M_META) != 0)
#ifndef BUFSIZE
#define GLOBBUFLEN MAXPATHLEN
#else
#define GLOBBUFLEN BUFSIZE
#endif
int int
globcharcoll(c1, c2, cs) globcharcoll(__Char c1, __Char c2, int cs)
NLSChar c1, c2;
int cs;
{ {
#if defined(NLS) && defined(LC_COLLATE) && !defined(NOSTRCOLL) #if defined(NLS) && defined(LC_COLLATE) && defined(HAVE_STRCOLL)
# if defined(SHORT_STRINGS) # if defined(WIDE_STRINGS)
wchar_t s1[2], s2[2]; wchar_t s1[2], s2[2];
if (c1 == c2) if (c1 == c2)
@ -163,7 +153,7 @@ globcharcoll(c1, c2, cs)
s2[0] = c2; s2[0] = c2;
s1[1] = s2[1] = '\0'; s1[1] = s2[1] = '\0';
return wcscoll(s1, s2); return wcscoll(s1, s2);
# else /* not SHORT_STRINGS */ # else /* not WIDE_STRINGS */
char s1[2], s2[2]; char s1[2], s2[2];
if (c1 == c2) if (c1 == c2)
@ -199,85 +189,56 @@ globcharcoll(c1, c2, cs)
*/ */
static DIR * static DIR *
Opendir(str) Opendir(const char *str)
Char *str;
{ {
char buf[GLOBBUFLEN];
char *dc = buf;
#if defined(hpux) || defined(__hpux) #if defined(hpux) || defined(__hpux)
struct stat st; struct stat st;
#endif #endif
if (!*str) if (!*str)
return (opendir(".")); return (opendir("."));
while ((*dc++ = *str++) != '\0')
continue;
#if defined(hpux) || defined(__hpux) #if defined(hpux) || defined(__hpux)
/* /*
* Opendir on some device files hangs, so avoid it * 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; return NULL;
#endif #endif
return (opendir(buf)); return opendir(str);
} }
#ifdef S_IFLNK #ifdef S_IFLNK
static int static int
Lstat(fn, sb) Lstat(const char *fn, struct stat *sb)
Char *fn;
struct stat *sb;
{ {
char buf[GLOBBUFLEN]; int st;
char *dc = buf;
while ((*dc++ = *fn++) != '\0') st = lstat(fn, sb);
continue;
# ifdef NAMEI_BUG # ifdef NAMEI_BUG
{ if (*fn != 0 && strend(fn)[-1] == '/' && !S_ISDIR(sb->st_mode))
int st; st = -1;
st = lstat(buf, sb);
if (*buf)
dc--;
return (*--dc == '/' && !S_ISDIR(sb->st_mode) ? -1 : st);
}
# else
return (lstat(buf, sb));
# endif /* NAMEI_BUG */ # endif /* NAMEI_BUG */
return st;
} }
#else #else
#define Lstat Stat #define Lstat Stat
#endif /* S_IFLNK */ #endif /* S_IFLNK */
static int static int
Stat(fn, sb) Stat(const char *fn, struct stat *sb)
Char *fn;
struct stat *sb;
{ {
char buf[GLOBBUFLEN]; int st;
char *dc = buf;
while ((*dc++ = *fn++) != '\0') st = stat(fn, sb);
continue;
#ifdef NAMEI_BUG #ifdef NAMEI_BUG
{ if (*fn != 0 && strend(fn)[-1] == '/' && !S_ISDIR(sb->st_mode))
int st; st = -1;
st = stat(buf, sb);
if (*buf)
dc--;
return (*--dc == '/' && !S_ISDIR(sb->st_mode) ? -1 : st);
}
#else
return (stat(buf, sb));
#endif /* NAMEI_BUG */ #endif /* NAMEI_BUG */
return st;
} }
static Char * static Char *
Strchr(str, ch) Strchr(Char *str, int ch)
Char *str;
int ch;
{ {
do do
if (*str == ch) if (*str == ch)
@ -288,10 +249,9 @@ Strchr(str, ch)
#ifdef DEBUG #ifdef DEBUG
static void static void
qprintf(s) qprintf(const Char *s)
Char *s;
{ {
Char *p; const Char *p;
for (p = s; *p; p++) for (p = s; *p; p++)
printf("%c", *p & 0xff); printf("%c", *p & 0xff);
@ -306,16 +266,13 @@ Char *s;
#endif /* DEBUG */ #endif /* DEBUG */
static int static int
compare(p, q) compare(const void *p, const void *q)
const ptr_t p, q;
{ {
#if defined(NLS) && !defined(NOSTRCOLL) #if defined(NLS) && defined(HAVE_STRCOLL)
errno = 0; /* strcoll sets errno, another brain-damage */ return (strcoll(*(char *const *) p, *(char *const *) q));
return (strcoll(*(char **) p, *(char **) q));
#else #else
return (strcmp(*(char **) p, *(char **) q)); return (strcmp(*(char *const *) p, *(char *const *) q));
#endif /* NLS && !NOSTRCOLL */ #endif /* NLS && HAVE_STRCOLL */
} }
/* /*
@ -326,22 +283,14 @@ compare(p, q)
* to find no matches. * to find no matches.
*/ */
int int
glob(pattern, flags, errfunc, pglob) glob(const char *pattern, int flags, int (*errfunc) (const char *, int),
const char *pattern; glob_t *pglob)
int flags;
int (*errfunc) __P((const char *, int));
glob_t *pglob;
{ {
int err, oldpathc; int err, oldpathc;
Char *bufnext, *bufend, *compilebuf, m_not; Char *bufnext, m_not;
const unsigned char *compilepat, *patnext; const unsigned char *patnext;
int c, not; int c, not;
Char *qpatnext; Char *qpatnext, *patbuf;
#ifdef WIDE_STRINGS
Char patbuf[GLOBBUFLEN + MB_LEN_MAX + 1];
#else
Char patbuf[GLOBBUFLEN + 1];
#endif
int no_match; int no_match;
patnext = (const unsigned char *) pattern; patnext = (const unsigned char *) pattern;
@ -365,10 +314,8 @@ glob(pattern, flags, errfunc, pglob)
m_not = M_NOT; m_not = M_NOT;
} }
patbuf = xmalloc((strlen(pattern) + 1) * sizeof(*patbuf));
bufnext = patbuf; bufnext = patbuf;
bufend = bufnext + GLOBBUFLEN;
compilebuf = bufnext;
compilepat = patnext;
no_match = *patnext == not; no_match = *patnext == not;
if (no_match) if (no_match)
@ -376,7 +323,7 @@ glob(pattern, flags, errfunc, pglob)
if (flags & GLOB_QUOTE) { if (flags & GLOB_QUOTE) {
/* Protect the quoted characters */ /* Protect the quoted characters */
while (bufnext < bufend && (c = *patnext++) != EOS) { while ((c = *patnext++) != EOS) {
#ifdef WIDE_STRINGS #ifdef WIDE_STRINGS
int len; int len;
@ -400,14 +347,13 @@ glob(pattern, flags, errfunc, pglob)
*bufnext++ = (Char) c; *bufnext++ = (Char) c;
} }
} }
else else
while (bufnext < bufend && (c = *patnext++) != EOS) while ((c = *patnext++) != EOS)
*bufnext++ = (Char) c; *bufnext++ = (Char) c;
*bufnext = EOS; *bufnext = EOS;
bufnext = patbuf; bufnext = patbuf;
qpatnext = patbuf; qpatnext = patbuf;
/* we don't need to check for buffer overflow any more */
while ((c = *qpatnext++) != EOS) { while ((c = *qpatnext++) != EOS) {
switch (c) { switch (c) {
case LBRACKET: case LBRACKET:
@ -427,11 +373,11 @@ glob(pattern, flags, errfunc, pglob)
*bufnext++ = m_not; *bufnext++ = m_not;
c = *qpatnext++; c = *qpatnext++;
do { do {
*bufnext++ = CHAR(c); *bufnext++ = LCHAR(c);
if (*qpatnext == RANGE && if (*qpatnext == RANGE &&
(c = qpatnext[1]) != RBRACKET) { (c = qpatnext[1]) != RBRACKET) {
*bufnext++ = M_RNG; *bufnext++ = M_RNG;
*bufnext++ = CHAR(c); *bufnext++ = LCHAR(c);
qpatnext += 2; qpatnext += 2;
} }
} while ((c = *qpatnext++) != RBRACKET); } while ((c = *qpatnext++) != RBRACKET);
@ -450,7 +396,7 @@ glob(pattern, flags, errfunc, pglob)
*bufnext++ = M_ALL; *bufnext++ = M_ALL;
break; break;
default: default:
*bufnext++ = CHAR(c); *bufnext++ = LCHAR(c);
break; break;
} }
} }
@ -459,8 +405,10 @@ glob(pattern, flags, errfunc, pglob)
qprintf(patbuf); qprintf(patbuf);
#endif #endif
if ((err = glob1(patbuf, pglob, no_match)) != 0) if ((err = glob1(patbuf, pglob, no_match)) != 0) {
xfree(patbuf);
return (err); return (err);
}
/* /*
* If there was no match we are going to append the pattern * 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 && if (pglob->gl_pathc == oldpathc &&
((flags & GLOB_NOCHECK) || ((flags & GLOB_NOCHECK) ||
((flags & GLOB_NOMAGIC) && !(pglob->gl_flags & GLOB_MAGCHAR)))) { ((flags & GLOB_NOMAGIC) && !(pglob->gl_flags & GLOB_MAGCHAR)))) {
if (!(flags & GLOB_QUOTE)) { if (!(flags & GLOB_QUOTE))
Char *dp = compilebuf; globextend(pattern, pglob);
const unsigned char *sp = compilepat;
while ((*dp++ = *sp++) != '\0')
continue;
}
else { else {
/* char *copy, *dest;
* copy pattern, interpreting quotes; this is slightly different const char *src;
* than the interpretation of quotes above -- which should prevail?
*/ /* copy pattern, interpreting quotes */
while (*compilepat != EOS) { copy = xmalloc(strlen(pattern) + 1);
if (*compilepat == QUOTE) { dest = copy;
if (*++compilepat == EOS) src = pattern;
--compilepat; 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)) else if (!(flags & GLOB_NOSORT) && (pglob->gl_pathc != oldpathc))
qsort((char *) (pglob->gl_pathv + pglob->gl_offs + oldpathc), qsort(pglob->gl_pathv + pglob->gl_offs + oldpathc,
pglob->gl_pathc - oldpathc, sizeof(char *), pglob->gl_pathc - oldpathc, sizeof(char *), compare);
(int (*) __P((const void *, const void *))) compare); xfree(patbuf);
return (0); return (0);
} }
static int static int
glob1(pattern, pglob, no_match) glob1(Char *pattern, glob_t *pglob, int no_match)
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. * a null pathname is invalid -- POSIX 1003.1 sect. 2.4.
*/ */
if (*pattern == EOS) if (*pattern == EOS)
return (0); 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. * more meta characters.
*/ */
static int static int
glob2(pathbuf, pathend, pattern, pglob, no_match) glob2(struct strbuf *pathbuf, const Char *pattern, glob_t *pglob, int no_match)
Char *pathbuf, *pathend, *pattern;
glob_t *pglob;
int no_match;
{ {
struct stat sbuf; struct stat sbuf;
int anymeta; int anymeta;
Char *p, *q; const Char *p;
size_t orig_len;
/* /*
* loop over pattern segments until end of pattern or until segment with * 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; anymeta = 0;
for (;;) { for (;;) {
if (*pattern == EOS) { /* end of pattern? */ if (*pattern == EOS) { /* end of pattern? */
*pathend = EOS; strbuf_terminate(pathbuf);
if (Lstat(pathbuf, &sbuf)) if (Lstat(pathbuf->s, &sbuf))
return (0); return (0);
if (((pglob->gl_flags & GLOB_MARK) && if (((pglob->gl_flags & GLOB_MARK) &&
pathend[-1] != SEP) && pathbuf->s[pathbuf->len - 1] != SEP) &&
(S_ISDIR(sbuf.st_mode) (S_ISDIR(sbuf.st_mode)
#ifdef S_IFLNK #ifdef S_IFLNK
|| (S_ISLNK(sbuf.st_mode) && || (S_ISLNK(sbuf.st_mode) &&
(Stat(pathbuf, &sbuf) == 0) && (Stat(pathbuf->s, &sbuf) == 0) &&
S_ISDIR(sbuf.st_mode)) S_ISDIR(sbuf.st_mode))
#endif #endif
)) { )) {
*pathend++ = SEP; strbuf_append1(pathbuf, SEP);
*pathend = EOS; strbuf_terminate(pathbuf);
} }
++pglob->gl_matchc; ++pglob->gl_matchc;
return (globextend(pathbuf, pglob)); globextend(pathbuf->s, pglob);
return 0;
} }
/* find end of next segment, copy tentatively to pathend */ /* find end of next segment, tentatively copy to pathbuf */
q = pathend;
p = pattern; p = pattern;
orig_len = pathbuf->len;
while (*p != EOS && *p != SEP) { while (*p != EOS && *p != SEP) {
if (ismeta(*p)) if (ismeta(*p))
anymeta = 1; anymeta = 1;
*q++ = *p++; strbuf_append1(pathbuf, *p++);
} }
if (!anymeta) { /* no expansion, do next segment */ if (!anymeta) { /* no expansion, do next segment */
pathend = q;
pattern = p; pattern = p;
while (*pattern == SEP) 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 */ /* NOTREACHED */
} }
static int static int
glob3(pathbuf, pathend, pattern, restpattern, pglob, no_match) glob3(struct strbuf *pathbuf, const Char *pattern, const Char *restpattern,
Char *pathbuf, *pathend, *pattern, *restpattern; glob_t *pglob, int no_match)
glob_t *pglob;
int no_match;
{ {
DIR *dirp; DIR *dirp;
struct dirent *dp; struct dirent *dp;
int err; int err;
Char m_not = (pglob->gl_flags & GLOB_ALTNOT) ? M_ALTNOT : M_NOT; 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; errno = 0;
if (!(dirp = Opendir(pathbuf))) { if (!(dirp = Opendir(pathbuf->s))) {
/* todo: don't call for ENOENT or ENOTDIR? */ /* todo: don't call for ENOENT or ENOTDIR? */
for (ptr = cpathbuf; (*ptr++ = (char) *pathbuf++) != EOS;) if ((pglob->gl_errfunc && (*pglob->gl_errfunc) (pathbuf->s, errno)) ||
continue;
if ((pglob->gl_errfunc && (*pglob->gl_errfunc) (cpathbuf, errno)) ||
(pglob->gl_flags & GLOB_ERR)) (pglob->gl_flags & GLOB_ERR))
return (GLOB_ABEND); return (GLOB_ABEND);
else else
@ -610,27 +555,24 @@ glob3(pathbuf, pathend, pattern, restpattern, pglob, no_match)
err = 0; err = 0;
orig_len = pathbuf->len;
/* search directory for matching names */ /* search directory for matching names */
while ((dp = readdir(dirp)) != NULL) { while ((dp = readdir(dirp)) != NULL) {
unsigned char *sc;
Char *dc;
/* initial DOT must be matched literally */ /* initial DOT must be matched literally */
if (dp->d_name[0] == DOT && *pattern != DOT) if (dp->d_name[0] == DOT && *pattern != DOT)
continue; continue;
for (sc = (unsigned char *) dp->d_name, dc = pathend; pathbuf->len = orig_len;
(*dc++ = *sc++) != '\0';) strbuf_append(pathbuf, dp->d_name);
strbuf_terminate(pathbuf);
if (match(pathbuf->s + orig_len, pattern, restpattern, (int) m_not)
== no_match)
continue; continue;
if (match(pathend, pattern, restpattern, (int) m_not) == no_match) { err = glob2(pathbuf, restpattern, pglob, no_match);
*pathend = EOS;
continue;
}
err = glob2(pathbuf, --dc, restpattern, pglob, no_match);
if (err) if (err)
break; break;
} }
/* todo: check error from readdir? */ /* todo: check error from readdir? */
(void) closedir(dirp); closedir(dirp);
return (err); 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 * 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. * gl_pathv points to (gl_offs + gl_pathc + 1) items.
*/ */
static int static void
globextend(path, pglob) globextend(const char *path, glob_t *pglob)
Char *path;
glob_t *pglob;
{ {
char **pathv; char **pathv;
int i; int i;
unsigned int newsize; size_t newsize;
char *copy;
Char *p;
newsize = sizeof(*pathv) * (2 + pglob->gl_pathc + pglob->gl_offs); newsize = sizeof(*pathv) * (2 + pglob->gl_pathc + pglob->gl_offs);
pathv = (char **) (pglob->gl_pathv ? pathv = xrealloc(pglob->gl_pathv, newsize);
xrealloc((ptr_t) pglob->gl_pathv, (size_t) newsize) :
xmalloc((size_t) newsize));
if (pathv == NULL)
return (GLOB_NOSPACE);
if (pglob->gl_pathv == NULL && pglob->gl_offs > 0) { if (pglob->gl_pathv == NULL && pglob->gl_offs > 0) {
/* first time around -- clear initial gl_offs items */ /* first time around -- clear initial gl_offs items */
@ -675,23 +609,12 @@ globextend(path, pglob)
} }
pglob->gl_pathv = pathv; pglob->gl_pathv = pathv;
for (p = path; *p++;) pathv[pglob->gl_offs + pglob->gl_pathc++] = strsave(path);
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] = NULL; pathv[pglob->gl_offs + pglob->gl_pathc] = NULL;
return ((copy == NULL) ? GLOB_NOSPACE : 0);
} }
static size_t 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 #ifdef WIDE_STRINGS
char buf[MB_LEN_MAX], *p; 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) if (n > MB_LEN_MAX)
n = MB_LEN_MAX; n = MB_LEN_MAX;
p = buf; p = buf;
while (p < buf + n && (*p++ = CHAR(*s++)) != 0) while (p < buf + n && (*p++ = LCHAR(*s++)) != 0)
; ;
return one_mbtowc(pwc, buf, n); return one_mbtowc(pwc, buf, n);
#else #else
return NLSFrom(s, n, pwc); *pwc = *s & CHAR;
return 1;
#endif #endif
} }
@ -712,21 +636,18 @@ One_mbtowc(NLSChar *pwc, const Char *s, size_t n)
* pattern causes a recursion level. * pattern causes a recursion level.
*/ */
static int static int
match(name, pat, patend, m_not) match(const char *name, const Char *pat, const Char *patend, int m_not)
Char *name, *pat, *patend;
int m_not;
{ {
int ok, negate_range; int ok, negate_range;
Char c, k; Char c;
while (pat < patend) { while (pat < patend) {
size_t lwk; size_t lwk;
NLSChar wc, wk; __Char wc, wk;
USE(k);
c = *pat; /* Only for M_MASK bits */ c = *pat; /* Only for M_MASK bits */
pat += One_mbtowc(&wc, pat, MB_LEN_MAX); pat += One_Char_mbtowc(&wc, pat, MB_LEN_MAX);
lwk = One_mbtowc(&wk, name, MB_LEN_MAX); lwk = one_mbtowc(&wk, name, MB_LEN_MAX);
switch (c & M_MASK) { switch (c & M_MASK) {
case M_ALL: case M_ALL:
if (pat == patend) if (pat == patend)
@ -737,7 +658,7 @@ match(name, pat, patend, m_not)
if (*name == EOS) if (*name == EOS)
break; break;
name += lwk; name += lwk;
lwk = One_mbtowc(&wk, name, MB_LEN_MAX); lwk = one_mbtowc(&wk, name, MB_LEN_MAX);
} }
return (0); return (0);
case M_ONE: case M_ONE:
@ -753,19 +674,19 @@ match(name, pat, patend, m_not)
if ((negate_range = ((*pat & M_MASK) == m_not)) != 0) if ((negate_range = ((*pat & M_MASK) == m_not)) != 0)
++pat; ++pat;
while ((*pat & M_MASK) != M_END) { 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) { if ((*pat & M_MASK) == M_RNG) {
NLSChar wc2; __Char wc2;
pat++; pat++;
pat += One_mbtowc(&wc2, pat, MB_LEN_MAX); pat += One_Char_mbtowc(&wc2, pat, MB_LEN_MAX);
if (globcharcoll(wc, wk, 0) <= 0 && if (globcharcoll(wc, wk, 0) <= 0 &&
globcharcoll(wk, wc2, 0) <= 0) globcharcoll(wk, wc2, 0) <= 0)
ok = 1; ok = 1;
} else if (wc == wk) } else if (wc == wk)
ok = 1; ok = 1;
} }
pat += One_mbtowc(&wc, pat, MB_LEN_MAX); pat += One_Char_mbtowc(&wc, pat, MB_LEN_MAX);
if (ok == negate_range) if (ok == negate_range)
return (0); return (0);
break; break;
@ -781,8 +702,7 @@ match(name, pat, patend, m_not)
/* free allocated data belonging to a glob_t structure */ /* free allocated data belonging to a glob_t structure */
void void
globfree(pglob) globfree(glob_t *pglob)
glob_t *pglob;
{ {
int i; int i;
char **pp; char **pp;
@ -791,7 +711,7 @@ globfree(pglob)
pp = pglob->gl_pathv + pglob->gl_offs; pp = pglob->gl_pathv + pglob->gl_offs;
for (i = pglob->gl_pathc; i--; ++pp) for (i = pglob->gl_pathc; i--; ++pp)
if (*pp) if (*pp)
xfree((ptr_t) *pp), *pp = NULL; xfree(*pp), *pp = NULL;
xfree((ptr_t) pglob->gl_pathv), pglob->gl_pathv = NULL; xfree(pglob->gl_pathv), pglob->gl_pathv = NULL;
} }
} }

View File

@ -44,18 +44,18 @@ typedef struct {
int gl_flags; /* Copy of flags parameter to glob. */ int gl_flags; /* Copy of flags parameter to glob. */
char **gl_pathv; /* List of paths matching pattern. */ char **gl_pathv; /* List of paths matching pattern. */
/* Copy of errfunc parameter to glob. */ /* 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 * Alternate filesystem access methods for glob; replacement
* versions of closedir(3), readdir(3), opendir(3), stat(2) * versions of closedir(3), readdir(3), opendir(3), stat(2)
* and lstat(2). * and lstat(2).
*/ */
void (*gl_closedir) __P((void *)); void (*gl_closedir) (void *);
struct dirent *(*gl_readdir) __P((void *)); struct dirent *(*gl_readdir) (void *);
void *(*gl_opendir) __P((const char *)); void *(*gl_opendir) (const char *);
int (*gl_lstat) __P((const char *, struct stat *)); int (*gl_lstat) (const char *, struct stat *);
int (*gl_stat) __P((const char *, struct stat *)); int (*gl_stat) (const char *, struct stat *);
} glob_t; } glob_t;
#define GLOB_APPEND 0x0001 /* Append to output from previous call. */ #define GLOB_APPEND 0x0001 /* Append to output from previous call. */
@ -84,10 +84,8 @@ typedef struct {
#define GLOB_ABEND GLOB_ABORTED /* source compatibility */ #define GLOB_ABEND GLOB_ABORTED /* source compatibility */
/* #endif */ /* #endif */
#include "tc.nls.h" int glob (const char *, int, int (*)(const char *, int), glob_t *);
void globfree (glob_t *);
int glob __P((const char *, int, int (*)(const char *, int), glob_t *)); int globcharcoll (Char, Char, int);
void globfree __P((glob_t *));
int globcharcoll __P((NLSChar, NLSChar, int));
#endif /* !_GLOB_H_ */ #endif /* !_GLOB_H_ */

View File

@ -1,5 +1,5 @@
newcode : 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. * host.defs: Hosttype/Machtype etc.
*/ */
@ -33,7 +33,7 @@ newcode :
*/ */
#include "sh.h" #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 : endcode :
@ -49,8 +49,7 @@ macro : M_intel : (defined(M_i386) || defined(M_i486) || defined(M_i586))
newdef : defined(ns32000) newdef : defined(ns32000)
newcode : newcode :
static char * static char *
isamultimax(flag) isamultimax(int flag)
int flag;
{ {
if (access("/Umax.image", F_OK) == 0) if (access("/Umax.image", F_OK) == 0)
return "multimax"; return "multimax";
@ -73,7 +72,7 @@ newcode :
/* From: hpa@hook.eecs.nwu.edu (H. Peter Anvin) */ /* From: hpa@hook.eecs.nwu.edu (H. Peter Anvin) */
static char * static char *
getcray() getcray(void)
{ {
# ifdef MC_GET_SYSTEM /* If we have target() */ # ifdef MC_GET_SYSTEM /* If we have target() */
struct target data; struct target data;
@ -115,7 +114,7 @@ newcode :
/* From: fox@convex.com (David DeSimone) */ /* From: fox@convex.com (David DeSimone) */
static char * static char *
getconvex() getconvex(void)
{ {
struct system_information sysinfo; struct system_information sysinfo;
static char result[8]; static char result[8];
@ -172,7 +171,7 @@ enddef :
newcode : newcode :
void void
getmachine() getmachine(void)
{ {
const char *hosttype; const char *hosttype;
const char *ostype; const char *ostype;
@ -446,8 +445,7 @@ hosttype: defined(__x86_64__) : "x86_64-linux"
hosttype: defined(M_i586) : "i586-linux" hosttype: defined(M_i586) : "i586-linux"
hosttype: defined(M_i486) : "i486-linux" hosttype: defined(M_i486) : "i486-linux"
hosttype: defined(M_i386) : "i386-linux" hosttype: defined(M_i386) : "i386-linux"
ostype : !defined(PPC) : "linux" ostype : : "linux"
ostype : defined(PPC) : "mklinux"
machtype: defined(__ia64__) : "ia64" machtype: defined(__ia64__) : "ia64"
machtype: defined(__powerpc64__) : "powerpc64" machtype: defined(__powerpc64__) : "powerpc64"
machtype: defined(__s390x__) : "s390x" machtype: defined(__s390x__) : "s390x"

View File

@ -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 * config.Imakefile for for tcsh 6.00
* Marc Horowitz, MIT SIPB * Marc Horowitz, MIT SIPB

View File

@ -82,7 +82,7 @@
********************************************************************** **********************************************************************
*/ */
#include "sh.h" #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 #ifdef MACH
@ -132,29 +132,28 @@ static int eflag;
return(-1); \ return(-1); \
} }
static int initpaths __P((char **)); static int initpaths (char **);
static void savepaths __P((char **)); static void savepaths (char **);
static void freepaths __P((void)); static void freepaths (void);
static void rcmd __P((char *)); static void rcmd (char *);
static void icmd __P((char *, char *)); static void icmd (char *, char *);
static void iacmd __P((char *, char *)); static void iacmd (char *, char *);
static void ibcmd __P((char *, char *)); static void ibcmd (char *, char *);
static void incmd __P((char *, int)); static void incmd (char *, int);
static void insert __P((struct pelem *, int, char *)); static void insert (struct pelem *, int, char *);
static void dcmd __P((char *)); static void dcmd (char *);
static void dncmd __P((int)); static void dncmd (int);
static void delete __P((struct pelem *, int)); static void delete (struct pelem *, int);
static void ccmd __P((char *, char *)); static void ccmd (char *, char *);
static void cncmd __P((char *, int)); static void cncmd (char *, int);
static void change __P((struct pelem *, int, char *)); static void change (struct pelem *, int, char *);
static int locate __P((struct pelem *, char *)); static int locate (struct pelem *, char *);
int int
setpath(paths, cmds, localsyspath, dosuffix, printerrors) setpath(char **paths, char **cmds, char *localsyspath, int dosuffix,
char **paths, **cmds, *localsyspath; int printerrors)
int dosuffix, printerrors;
{ {
char *cmd, *cmd1, *cmd2; char *cmd, *cmd1, *cmd2;
int ncmd; int ncmd;
@ -230,8 +229,7 @@ int dosuffix, printerrors;
} }
static int static int
initpaths(paths) initpaths(char **paths)
char **paths;
{ {
char *path, *val, *p, *q; char *path, *val, *p, *q;
int i, done; int i, done;
@ -248,8 +246,8 @@ char **paths;
return(-1); return(-1);
} }
*val++ = '\0'; *val++ = '\0';
pe = (struct pelem *)xmalloc((unsigned)(sizeof(struct pelem))); pe = xmalloc(sizeof(struct pelem));
setzero((char *) pe, sizeof(struct pelem)); setzero(pe, sizeof(struct pelem));
if (pathhead == NULL) if (pathhead == NULL)
pathhead = pathend = pe; pathhead = pathend = pe;
else { else {
@ -283,8 +281,7 @@ char **paths;
} }
static void static void
savepaths(paths) savepaths(char **paths)
char **paths;
{ {
char *p, *q; char *p, *q;
int npath, i, len; int npath, i, len;
@ -312,7 +309,7 @@ char **paths;
} }
static void static void
freepaths() freepaths(void)
{ {
char *p; char *p;
int i; int i;
@ -345,13 +342,12 @@ freepaths()
***********************************************/ ***********************************************/
static void static void
rcmd(localsyspath) /* reset path with localsyspath */ rcmd(char *localsyspath) /* reset path with localsyspath */
char *localsyspath;
{ {
int n, done; int n, done;
char *new, *p; char *new, *p;
struct pelem *pe; struct pelem *pe;
char newbuf[MAXPATHLEN+1]; char newbuf[MAXPATHLEN+1];/*FIXBUF*/
for (pe = pathhead; pe; pe = pe->pnext) { for (pe = pathhead; pe; pe = pe->pnext) {
new = newbuf; new = newbuf;
@ -389,13 +385,12 @@ char *localsyspath;
***********************************************/ ***********************************************/
static void static void
icmd(path, localsyspath) /* insert path before localsyspath */ icmd(char *path, char *localsyspath) /* insert path before localsyspath */
char *path, *localsyspath;
{ {
int n; int n;
char *new; char *new;
struct pelem *pe; struct pelem *pe;
char newbuf[MAXPATHLEN+1]; char newbuf[MAXPATHLEN+1];/*FIXBUF*/
for (pe = pathhead; pe; pe = pe->pnext) { for (pe = pathhead; pe; pe = pe->pnext) {
if (sflag) if (sflag)
@ -414,8 +409,7 @@ char *path, *localsyspath;
} }
static void static void
iacmd(inpath, path) /* insert path after inpath */ iacmd(char *inpath, char *path) /* insert path after inpath */
char *inpath, *path;
{ {
int n; int n;
struct pelem *pe; struct pelem *pe;
@ -431,8 +425,7 @@ char *inpath, *path;
} }
static void static void
ibcmd(inpath, path) /* insert path before inpath */ ibcmd(char *inpath, char *path) /* insert path before inpath */
char *inpath, *path;
{ {
int n; int n;
struct pelem *pe; struct pelem *pe;
@ -448,9 +441,7 @@ char *inpath, *path;
} }
static void static void
incmd(path, n) /* insert path at position n */ incmd(char *path, int n) /* insert path at position n */
char *path;
int n;
{ {
struct pelem *pe; struct pelem *pe;
@ -459,14 +450,11 @@ int n;
} }
static void static void
insert(pe, loc, key) insert(struct pelem *pe, int loc, char *key)
struct pelem *pe;
int loc;
char *key;
{ {
int i; int i;
char *new; char *new;
char newbuf[2000]; char newbuf[2000];/*FIXBUF*/
if (sflag) { /* add suffix */ if (sflag) { /* add suffix */
new = newbuf; new = newbuf;
@ -488,8 +476,7 @@ char *key;
***********************************************/ ***********************************************/
static void static void
dcmd(path) /* delete path */ dcmd(char *path) /* delete path */
char *path;
{ {
int n; int n;
struct pelem *pe; struct pelem *pe;
@ -505,8 +492,7 @@ char *path;
} }
static void static void
dncmd(n) /* delete at position n */ dncmd(int n) /* delete at position n */
int n;
{ {
struct pelem *pe; struct pelem *pe;
@ -521,9 +507,7 @@ int n;
} }
static void static void
delete(pe, n) delete(struct pelem *pe, int n)
struct pelem *pe;
int n;
{ {
int d; int d;
@ -538,8 +522,7 @@ int n;
***********************************************/ ***********************************************/
static void static void
ccmd(inpath, path) /* change inpath to path */ ccmd(char *inpath, char *path) /* change inpath to path */
char *inpath, *path;
{ {
int n; int n;
struct pelem *pe; struct pelem *pe;
@ -555,9 +538,7 @@ char *inpath, *path;
} }
static void static void
cncmd(path, n) /* change at position n to path */ cncmd(char *path, int n) /* change at position n to path */
char *path;
int n;
{ {
struct pelem *pe; struct pelem *pe;
@ -572,13 +553,10 @@ int n;
} }
static void static void
change(pe, loc, key) change(struct pelem *pe, int loc, char *key)
struct pelem *pe;
int loc;
char *key;
{ {
char *new; char *new;
char newbuf[MAXPATHLEN+1]; char newbuf[MAXPATHLEN+1];/*FIXBUF*/
if (sflag) { /* append suffix */ if (sflag) { /* append suffix */
new = newbuf; new = newbuf;
@ -596,13 +574,11 @@ char *key;
***************************************/ ***************************************/
static int static int
locate(pe, key) locate(struct pelem *pe, char *key)
struct pelem *pe;
char *key;
{ {
int i; int i;
char *realkey; char *realkey;
char keybuf[MAXPATHLEN+1]; char keybuf[MAXPATHLEN+1];/*FIXBUF*/
if (sflag) { if (sflag) {
realkey = keybuf; realkey = keybuf;

View File

@ -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 /* termios.c - fake termios interface using sgtty interface
* by Magnus Doell and Bruce Evans. * by Magnus Doell and Bruce Evans.
* *
*/ */
#include "sh.h" #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) #if defined(_MINIX) && !defined(_MINIX_VMD)

View File

@ -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 * mi.varargs.h: Correct varargs for minix
*/ */

View File

@ -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 $ Error messages
$set 1 $set 1
1 Syntax Error 1 Syntax Error

View File

@ -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 $ ma.setp.c
$set 10 $set 10
1 setpath: invalid command '%s'.\n 1 setpath: invalid command '%s'.\n

View File

@ -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 $ sh.c
$set 11 $set 11
1 Warning: no access to tty (%s).\n 1 Warning: no access to tty (%s).\n

View File

@ -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 $ sh.dir.c
$set 12 $set 12
1 %s: Trying to start from "%s"\n 1 %s: Trying to start from "%s"\n

View File

@ -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 $ sh.exec.c
$set 13 $set 13
1 hash=%-4d dir=%-2d prog=%s\n 1 hash=%-4d dir=%-2d prog=%s\n

View File

@ -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 $ sh.file.c
$set 14 $set 14
1 \nYikes!! Too many %s!!\n 1 \nYikes!! Too many %s!!\n

View File

@ -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 $ sh.func.c
$set 15 $set 15
1 %s: %s: Can't %s%s limit\n 1 %s: %s: Can't %s%s limit\n

View File

@ -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 $ sh.lex.c
$set 16 $set 16
1 Reset tty pgrp from %d to %d\n 1 Reset tty pgrp from %d to %d\n

View File

@ -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 $ sh.proc.c
$set 17 $set 17
1 BUG: waiting for background job!\n 1 BUG: waiting for background job!\n

View File

@ -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 $ sh.set.c
$set 18 $set 18
1 Warning: ridiculously long PATH truncated\n 1 Warning: ridiculously long PATH truncated\n

View File

@ -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 $ tc.alloc.c
$set 19 $set 19
1 nbytes=%d: Out of memory\n 1 nbytes=%d: Out of memory\n

View File

@ -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 $ Signal names
$set 2 $set 2
1 Null signal 1 Null signal

View File

@ -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 $ tc.bind.c
$set 20 $set 20
1 Invalid key name `%S'\n 1 Invalid key name `%S'\n

View File

@ -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 $ tc.disc.c
$set 21 $set 21
1 Couldn't get local chars.\n 1 Couldn't get local chars.\n

View File

@ -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 $ tc.func.c
$set 22 $set 22
1 %S: \t aliased to 1 %S: \t aliased to

View File

@ -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 $ tc.os.c
$set 23 $set 23
1 Bad cpu/site name 1 Bad cpu/site name

View File

@ -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 $ tc.sched.c
$set 24 $set 24
1 kludge 1 kludge

View File

@ -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 $ tc.sig.c
$set 25 $set 25
1 our wait %d\n 1 our wait %d\n

View File

@ -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 $ tc.who.c
$set 26 $set 26
1 cannot stat %s. Please "unset watch".\n 1 cannot stat %s. Please "unset watch".\n

View File

@ -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 $ tw.comp.c
$set 27 $set 27
1 command 1 command

View File

@ -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 $ tw.help.c
$set 29 $set 29
1 No help file for %S\n 1 No help file for %S\n

View File

@ -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 $ Editor function descriptions
$set 3 $set 3
1 Move back a character 1 Move back a character
@ -122,3 +122,5 @@ $set 3
119 (WIN32 only) Convert each '/' in previous word to '\\\\' 119 (WIN32 only) Convert each '/' in previous word to '\\\\'
120 (WIN32 only) Page visible console window up 120 (WIN32 only) Page visible console window up
121 (WIN32 only) Page visible console window down 121 (WIN32 only) Page visible console window down
122 Execute command and keep current line
123 Execute command and move to next history line

View File

@ -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 $ tw.parse.c
$set 30 $set 30
1 starting_a_command %d\n 1 starting_a_command %d\n

View File

@ -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 $ vms.termcap.c
$set 31 $set 31
1 Can't open TERMCAP: [%s]\n 1 Can't open TERMCAP: [%s]\n

View File

@ -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 $ Termcap strings
$set 4 $set 4
1 add new blank line 1 add new blank line

View File

@ -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 $ ed.chared.c
$set 5 $set 5
1 Load average unavailable\n 1 Load average unavailable\n

View File

@ -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 $ ed.inputl.c
$set 6 $set 6
1 ERROR: illegal command from key 0%o\r\n 1 ERROR: illegal command from key 0%o\r\n

View File

@ -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 $ ed.screen.c
$set 7 $set 7
1 \n\tTcsh thinks your terminal has the\n 1 \n\tTcsh thinks your terminal has the\n

View File

@ -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 $ ed.term.c
$set 8 $set 8
1 Unknown switch 1 Unknown switch

View File

@ -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 $ ed.xmap.c
$set 9 $set 9
1 AddXkey: Null extended-key not allowed.\n 1 AddXkey: Null extended-key not allowed.\n

View File

@ -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 \ SUBDIRS= C et finnish french german greek italian ja pl russian \
spanish ukrainian spanish ukrainian
#GENCAT= gencat --new #GENCAT= gencat --new
#CHARSET= charset CHARSET= charset
GENCAT= gencat GENCAT= gencat
catalogs: catalogs:

View File

@ -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 $ Error messages
$set 1 $set 1
1 Süntaksi viga 1 Süntaksi viga

View File

@ -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 $ ma.setp.c
$set 10 $set 10
1 setpath: vigane käsk '%s'.\n 1 setpath: vigane käsk '%s'.\n

View File

@ -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 $ sh.c
$set 11 $set 11
1 Hoiatus: tty (%s) pole kättesaadav.\n 1 Hoiatus: tty (%s) pole kättesaadav.\n

View File

@ -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 $ sh.dir.c
$set 12 $set 12
1 %s: Proovin startida kataloogist "%s"\n 1 %s: Proovin startida kataloogist "%s"\n

View File

@ -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 $ sh.exec.c
$set 13 $set 13
1 hash=%-4d dir=%-2d prog=%s\n 1 hash=%-4d dir=%-2d prog=%s\n

View File

@ -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 $ sh.file.c
$set 14 $set 14
1 \nÄhh!! Liiga palju %s!!\n 1 \nÄhh!! Liiga palju %s!!\n

View File

@ -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 $ sh.func.c
$set 15 $set 15
1 %s: %s: Ei õnnestu %s%s piirangut\n 1 %s: %s: Ei õnnestu %s%s piirangut\n

View File

@ -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 $ sh.lex.c
$set 16 $set 16
1 Seadsin tty pgrp numbrilt %d numbrile %d\n 1 Seadsin tty pgrp numbrilt %d numbrile %d\n

View File

@ -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 $ sh.proc.c
$set 17 $set 17
1 BUG: ootan taustatöö järel!\n 1 BUG: ootan taustatöö järel!\n

View File

@ -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 $ sh.set.c
$set 18 $set 18
1 Hoiatus: nõmedalt pikk PATH sai lühendatud\n 1 Hoiatus: nõmedalt pikk PATH sai lühendatud\n

View File

@ -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 $ tc.alloc.c
$set 19 $set 19
1 nbytes=%d: Mälu on otsas\n 1 nbytes=%d: Mälu on otsas\n

View File

@ -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 $ Signal names
$set 2 $set 2
1 Null signaal 1 Null signaal

View File

@ -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 $ tc.bind.c
$set 20 $set 20
1 Vigane klahvi nimi `%S'\n 1 Vigane klahvi nimi `%S'\n

View File

@ -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 $ tc.disc.c
$set 21 $set 21
1 Lokaalseid sümboleid ei őnnestu lugeda.\n 1 Lokaalseid sümboleid ei őnnestu lugeda.\n

View File

@ -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 $ tc.func.c
$set 22 $set 22
1 %S: \t on tegelikult 1 %S: \t on tegelikult

View File

@ -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 $ tc.os.c
$set 23 $set 23
1 Vigane cpu/saidi nimi 1 Vigane cpu/saidi nimi

View File

@ -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 $ tc.sched.c
$set 24 $set 24
1 Häkk! 1 Häkk!

View File

@ -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 $ tc.sig.c
$set 25 $set 25
1 our wait %d\n 1 our wait %d\n

View File

@ -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 $ tc.who.c
$set 26 $set 26
1 Ei saa lugeda %s atribuute. Anna käsk "unset watch".\n 1 Ei saa lugeda %s atribuute. Anna käsk "unset watch".\n

View File

@ -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 $ tw.comp.c
$set 27 $set 27
1 käsk 1 käsk

View File

@ -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 $ tw.help.c
$set 29 $set 29
1 %S'ile pole abiteksti\n 1 %S'ile pole abiteksti\n

View File

@ -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 $ Editor function descriptions
$set 3 $set 3
1 Liigu sümbol tagasi 1 Liigu sümbol tagasi

View File

@ -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 $ tw.parse.c
$set 30 $set 30
1 starting_a_command %d\n 1 starting_a_command %d\n

View File

@ -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 $ vms.termcap.c
$set 31 $set 31
1 TERMCAP ei saa avada: [%s]\n 1 TERMCAP ei saa avada: [%s]\n

View File

@ -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 $ Termcap strings
$set 4 $set 4
1 lisa uus tühi rida 1 lisa uus tühi rida

View File

@ -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 $ ed.chared.c
$set 5 $set 5
1 Tööjärjekorra koormuse info puudub\n 1 Tööjärjekorra koormuse info puudub\n

View File

@ -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 $ ed.inputl.c
$set 6 $set 6
1 VIGA: vigane käsk klahvilt 0%o\r\n 1 VIGA: vigane käsk klahvilt 0%o\r\n

View File

@ -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 $ ed.screen.c
$set 7 $set 7
1 \n\tTcsh arvab, et teie terminal omab\n 1 \n\tTcsh arvab, et teie terminal omab\n

View File

@ -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 $ ed.term.c
$set 8 $set 8
1 Tundmatu võti 1 Tundmatu võti

View File

@ -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 $ ed.xmap.c
$set 9 $set 9
1 AddXkey: Null pikkusega laiend-klahv ei ole lubatud.\n 1 AddXkey: Null pikkusega laiend-klahv ei ole lubatud.\n

View File

@ -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 $ Error messages
$set 1 $set 1
1 Kielioppivirhe 1 Kielioppivirhe

View File

@ -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 $ ma.setp.c
$set 10 $set 10
1 setpath: Virheellinen komento '%s'.\n 1 setpath: Virheellinen komento '%s'.\n

View File

@ -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 $ sh.c
$set 11 $set 11
1 Varoitus: ei yhteyttä päätteeseen (%s).\n 1 Varoitus: ei yhteyttä päätteeseen (%s).\n

View File

@ -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 $ sh.dir.c
$set 12 $set 12
1 %s: Yritetään käynnistää hakemistosta "%s"\n 1 %s: Yritetään käynnistää hakemistosta "%s"\n

View File

@ -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 $ sh.exec.c
$set 13 $set 13
1 hash=%-4d dir=%-2d prog=%s\n 1 hash=%-4d dir=%-2d prog=%s\n

Some files were not shown because too many files have changed in this diff Show More