aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Peek <mp@FreeBSD.org>2005-04-24 19:41:08 +0000
committerMark Peek <mp@FreeBSD.org>2005-04-24 19:41:08 +0000
commit23338178da74e9862b8abd49eef83ee891027a1e (patch)
tree6daeb0464a7bc8705c0246b7fd98e212b6beed09
parentb2d5d167edc56df47468e5836b8129dfd3d0369a (diff)
downloadsrc-23338178da74e9862b8abd49eef83ee891027a1e.tar.gz
src-23338178da74e9862b8abd49eef83ee891027a1e.zip
Import of tcsh-6.14.00
Notes
Notes: svn path=/vendor/tcsh/dist/; revision=145479
-rw-r--r--contrib/tcsh/Fixes90
-rw-r--r--contrib/tcsh/Imakefile6
-rw-r--r--contrib/tcsh/Makefile.in23
-rw-r--r--contrib/tcsh/Makefile.std10
-rw-r--r--contrib/tcsh/Makefile.vms10
-rw-r--r--contrib/tcsh/README13
-rw-r--r--contrib/tcsh/complete.tcsh161
-rw-r--r--contrib/tcsh/config.h.in206
-rw-r--r--contrib/tcsh/config/bsd4.437
-rw-r--r--contrib/tcsh/config_f.h45
-rwxr-xr-xcontrib/tcsh/configure4552
-rw-r--r--contrib/tcsh/configure.in123
-rw-r--r--contrib/tcsh/ed.chared.c591
-rw-r--r--contrib/tcsh/ed.decls.h249
-rw-r--r--contrib/tcsh/ed.defns.c38
-rw-r--r--contrib/tcsh/ed.h45
-rw-r--r--contrib/tcsh/ed.init.c14
-rw-r--r--contrib/tcsh/ed.inputl.c94
-rw-r--r--contrib/tcsh/ed.refresh.c615
-rw-r--r--contrib/tcsh/ed.screen.c208
-rw-r--r--contrib/tcsh/ed.term.c8
-rw-r--r--contrib/tcsh/ed.term.h4
-rw-r--r--contrib/tcsh/ed.xmap.c18
-rw-r--r--contrib/tcsh/gethost.c10
-rw-r--r--contrib/tcsh/glob.c168
-rw-r--r--contrib/tcsh/glob.h4
-rw-r--r--contrib/tcsh/host.defs41
-rwxr-xr-xcontrib/tcsh/install-sh496
-rw-r--r--contrib/tcsh/ma.setp.c94
-rw-r--r--contrib/tcsh/nls/C/set1123
-rw-r--r--contrib/tcsh/nls/ja/set165
-rw-r--r--contrib/tcsh/nls/ja/set3124
-rw-r--r--contrib/tcsh/nls/ja/set445
-rw-r--r--contrib/tcsh/nls/ja/set730
-rw-r--r--contrib/tcsh/patchlevel.h8
-rw-r--r--contrib/tcsh/sh.c183
-rw-r--r--contrib/tcsh/sh.char.h93
-rw-r--r--contrib/tcsh/sh.decls.h66
-rw-r--r--contrib/tcsh/sh.dir.c116
-rw-r--r--contrib/tcsh/sh.dol.c181
-rw-r--r--contrib/tcsh/sh.err.c16
-rw-r--r--contrib/tcsh/sh.exec.c83
-rw-r--r--contrib/tcsh/sh.exp.c164
-rw-r--r--contrib/tcsh/sh.file.c98
-rw-r--r--contrib/tcsh/sh.func.c324
-rw-r--r--contrib/tcsh/sh.glob.c234
-rw-r--r--contrib/tcsh/sh.h340
-rw-r--r--contrib/tcsh/sh.hist.c54
-rw-r--r--contrib/tcsh/sh.init.c11
-rw-r--r--contrib/tcsh/sh.lex.c323
-rw-r--r--contrib/tcsh/sh.misc.c133
-rw-r--r--contrib/tcsh/sh.parse.c64
-rw-r--r--contrib/tcsh/sh.print.c65
-rw-r--r--contrib/tcsh/sh.proc.c154
-rw-r--r--contrib/tcsh/sh.proc.h6
-rw-r--r--contrib/tcsh/sh.sem.c75
-rw-r--r--contrib/tcsh/sh.set.c177
-rw-r--r--contrib/tcsh/sh.time.c94
-rw-r--r--contrib/tcsh/sh.types.h192
-rw-r--r--contrib/tcsh/tc.alloc.c73
-rw-r--r--contrib/tcsh/tc.bind.c69
-rw-r--r--contrib/tcsh/tc.const.c23
-rw-r--r--contrib/tcsh/tc.decls.h70
-rw-r--r--contrib/tcsh/tc.disc.c8
-rw-r--r--contrib/tcsh/tc.func.c223
-rw-r--r--contrib/tcsh/tc.h4
-rw-r--r--contrib/tcsh/tc.nls.c304
-rw-r--r--contrib/tcsh/tc.nls.h99
-rw-r--r--contrib/tcsh/tc.os.c75
-rw-r--r--contrib/tcsh/tc.os.h206
-rw-r--r--contrib/tcsh/tc.printf.c51
-rw-r--r--contrib/tcsh/tc.prompt.c145
-rw-r--r--contrib/tcsh/tc.sched.c15
-rw-r--r--contrib/tcsh/tc.sig.c34
-rw-r--r--contrib/tcsh/tc.sig.h7
-rw-r--r--contrib/tcsh/tc.str.c196
-rw-r--r--contrib/tcsh/tc.vers.c8
-rw-r--r--contrib/tcsh/tc.wait.h8
-rw-r--r--contrib/tcsh/tc.who.c149
-rw-r--r--contrib/tcsh/tcsh.man90
-rw-r--r--contrib/tcsh/tcsh.man2html22
-rw-r--r--contrib/tcsh/tw.color.c57
-rw-r--r--contrib/tcsh/tw.comp.c39
-rw-r--r--contrib/tcsh/tw.decls.h8
-rw-r--r--contrib/tcsh/tw.h8
-rw-r--r--contrib/tcsh/tw.help.c23
-rw-r--r--contrib/tcsh/tw.init.c65
-rw-r--r--contrib/tcsh/tw.parse.c133
-rw-r--r--contrib/tcsh/tw.spell.c12
-rw-r--r--contrib/tcsh/vms.termcap.c17
90 files changed, 9586 insertions, 4169 deletions
diff --git a/contrib/tcsh/Fixes b/contrib/tcsh/Fixes
index 7b8bf3edb994..384c3295d259 100644
--- a/contrib/tcsh/Fixes
+++ b/contrib/tcsh/Fixes
@@ -1,3 +1,93 @@
+ 76. V6.14.00 - 20050325
+ 75. Additional messages for the ja (Japanese) locale (NAKAMURA Takeshi)
+ 74. V6.13.10 - 20050321
+ 73. Implement --help (Tom Warzeka)
+ 72. Clamp solaris autologout time
+ 71. Add support for "limit heapsize" (Martin Kraemer)
+ 70. Improved autoconf for utmp/utmpx (Miloslav Trmac)
+ 69. V6.13.09 - 20050303
+ 68. Autoconf additions (Miloslav Trmac and Jean-Luc Leger)
+ 67. Fix erroneous sign extension when printing huge numbers (Martin Kraemer)
+ 66. Handle delay in termcap entries (Martin Kraemer)
+ 65. EBCDIC and BS2000 fixes (Martin Kraemer)
+ 64. Avoid the SCCS percent-S-percent sequence differently (Kimmo Suominen)
+ 63. Mark position update fixes (Martin Kraemer)
+ 62. Define BSDLIMIT and BSDTIMES for Cygwin (Corinna Vinschen)
+ 61. Fix NLSFrom prototype (Martin Kraemer)
+ 60. V6.13.08 - 20050303
+ 59. Add test for socklen_t in autoconf
+ 58. Fix problems with NLSFrom prototype
+ 57. Deal with AIX's utmpx lossage
+ 56. V6.13.07 - 20050118
+ 55. constifications, XXX: duplicate prototype on setpgrp().
+ 54. iconv fixes (Miloslav Trmac)
+ 53. literal code cleanups (Miloslav Trmac)
+ 52. move intptr_t definition to sh.h and include both stdint.h and inttypes.h
+ 51. Fix dup2() issues, and introduce FSAFE as the highest file descriptor
+ to be left untouched. This is to avoid closing hesiod/nis etc file
+ descriptors behind their backs. I need to really fix file descriptor
+ handling one day.
+ 50. forward<->reverse char conversion verification (Miloslav Trmac)
+ 49. japanese locale additions (Yoshiyuki Sakakibara)
+ 48. wide character/utf 8 cleanups (Michael Schroeder)
+ 47. V6.13.06 - 20050105
+ 46. autoconf cleanup (Miloslav Trmac)
+ 45. Fix literal refresh code (Michael Schroeder)
+ 44. Fix history printing bug with WIDE_STRINGS
+ 43. V6.13.05 - 20041121
+ 42. deal with not having intptr_t
+ 41. get rid of bool.
+ 40. Protect HAVE_ICONV with NLS_CATALOGS
+ 39. Deal with wchar_t being unsigned.
+ 38. If we HAVEUTMPX redefine some utmp functions in terms of utmpx ones.
+ 37. V6.13.04 - 20041120
+ 36. Fix display problems with two-column characters when using WIDE_STRINGS.
+ (Miloslav Trmac)
+ 35. Change charset declarations for some of the translations.
+ (Miloslav Trmac)
+ 34. Set O_LARGEFILE properly (Miloslav Trmac)
+ 33. Use libc functions to access utmp data (Miloslav Trmac)
+ 32. t_pmatch() was not really case-insensitive when cs == 8
+ (Miloslav Trmac)
+ 31. Fix escaping of "control" bytes 0x80..0x9F when they are actually
+ parts of UTF-8 character representation. (Miloslav Trmac)
+ 30. V6.13.03 - 20041120
+ 29. More close_on_exec fixes (Miloslav Trmac)
+ 28. SUSE dspmbyte fixes (via Harald)
+ 27. Newline handling in command substitution controlled by csubstnonl
+ (Miloslav Trmac)
+ 26. Fix UNC prompt expansion (WIN32) (Yasuhiro Matsumoto)
+ 25. Fix incorrect xprintf() usage (Miloslav Trmac)
+ 24. Additional architectures support for $HOSTTYPE and $MACHTYPE
+ (Miloslav Trmac)
+ 23. Use nl_langinfo(CODESET) to determine $dspmbyte (Miloslav Trmac)
+ 22. Complete arguments that contant a # (Steven Grady)
+ 21. Set close-on-exec in subshells
+ 20. Compilation fixes (Miloslav Trmac)
+ 19. V6.13.02 - 20040804
+ 18. de-register, de-extern, de-shadow, and const poison.
+ 17. WIDE_STRINGS support (Miloslav Trmac)
+ 16. warning cleanups (Miloslav Trmac)
+ 15. nlsclose() arg passing, exp2 is now a gcc builtin (Mark Peek)
+ 14. iconv malloc portability fix.
+ 13. make automatic dspmbyte determination case insensitive
+ 12. V6.13.01 - 20040724
+ 11. bug fix in automatic dspmbyte setting (Miloslav Trmac)
+ 10. iconv patches (Miloslav Trmac)
+ 9. cygwin signal fixes; only init 32 signals, don't set bit flag on error;
+ breaks SIGHUP. (Corinna Vinschen)
+ 8. Make sure terminal size change takes effect immediately.
+ 7. Obey $printexitvalue for builtins.
+ 6. FreeBSD PR/66420: Allow history parsing to be special so that it
+ can handle inline # characters (Oliver Eikemeier)
+ 5. new termname builtin from (Andrew Stevenson)
+ 4. if ($var =~ *[^0-9]*) echo not numeric, fix (Andrew Stevenson)
+ 3. completion fix to avoid dup hosts from ssh_known_hosts
+ (Eric D. Hendrickson)
+ 2. vc++ 7.1 compilation fix (Steve Schockley)
+ 1. UTF-8 handling for both single and double width characters, but
+ no combining character support. (Michael Schroeder)
+
36. V6.13.00 - 20040519
35. V6.12.03 - 20040322
34. turn on kanji and dspmbyte by default; add check for utf8 locales,
diff --git a/contrib/tcsh/Imakefile b/contrib/tcsh/Imakefile
index 803ed04b3867..bc77ad9840ab 100644
--- a/contrib/tcsh/Imakefile
+++ b/contrib/tcsh/Imakefile
@@ -1,5 +1,5 @@
XCOMM
-XCOMM $Id: Imakefile,v 1.83 2003/02/08 20:03:25 christos Exp $
+XCOMM $Id: Imakefile,v 1.84 2004/12/25 21:15:05 christos Exp $
XCOMM
XCOMM Imakefile for tcsh 6.12
XCOMM Marc Horowitz, MIT SIPB
@@ -41,12 +41,12 @@ ones. Please send in your fixes and additions! */
# define ConfigH sysv4
# endif
-# ifdef LinuxArchitecture
+# if defined(LinuxArchitecture) || defined(GNUArchitecture)
# define ConfigH linux
# endif
# ifdef AlphaArchitecture
-# ifndef LinuxArchitecture
+# if !defined(LinuxArchitecture) && !defined(GNUArchitecture)
# define ConfigH decosf1
# endif
# if !HasGcc
diff --git a/contrib/tcsh/Makefile.in b/contrib/tcsh/Makefile.in
index 7be22bc6ffc9..da0875ff8207 100644
--- a/contrib/tcsh/Makefile.in
+++ b/contrib/tcsh/Makefile.in
@@ -1,4 +1,4 @@
-# $Id: Makefile.in,v 3.20 2003/03/12 19:14:50 christos Exp $
+# $Id: Makefile.in,v 3.27 2005/03/23 13:20:30 kim Exp $
# Makefile.in 4.3 6/11/83
#
# C Shell with process control; VM/UNIX VAX Makefile
@@ -247,7 +247,7 @@ CPP = @CPP@ # This is set by autoconf.
# The -B tells gcc to use /bin/ld. This is to avoid using the gnu ld, which
# on the suns does not know how to make dynamically linked binaries.
CC = @CC@ # This is set by autoconf.
-#CC= gcc -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Werror
+#CC= gcc -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Werror -Wmissing-declarations -Wredundant-decls -Wnested-externs -Wsign-compare -Wcast-qual -Wreturn-type -Wswitch -Wshadow -Wwrite-strings
#CC= gcc -Wall -pipe -B/bin/ # -ansi -pedantic
#CC= gcc -m486 -pipe -Wall # Generate code for Intel 486 (linux)
#CC= shlicc # BSDI2.1 w/ shared libraries
@@ -313,11 +313,11 @@ EDOBJS= ed.chared.${SUF} ed.refresh.${SUF} ed.screen.${SUF} ed.init.${SUF} \
ed.inputl.${SUF} ed.defns.${SUF} ed.xmap.${SUF} ed.term.${SUF}
TCSRCS= tc.alloc.c tc.bind.c tc.const.c tc.decls.h tc.disc.c \
- tc.func.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \
+ tc.func.c tc.nls.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \
tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h tc.vers.c tc.wait.h \
tc.who.c tc.h
TCOBJS= tc.alloc.${SUF} tc.bind.${SUF} tc.const.${SUF} tc.defs.${SUF} \
- tc.disc.${SUF} tc.func.${SUF} tc.os.${SUF} tc.printf.${SUF} \
+ tc.disc.${SUF} tc.func.${SUF} tc.nls.${SUF} tc.os.${SUF} tc.printf.${SUF} \
tc.prompt.${SUF} tc.sched.${SUF} tc.sig.${SUF} tc.str.${SUF} \
tc.vers.${SUF} tc.who.${SUF}
@@ -431,8 +431,8 @@ tc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h
@echo '#ifndef _h_tc_const' >> $@
@echo '#define _h_tc_const' >> $@
${CPP} $(CPPFLAGS) ${DFLAGS} ${EXTRAFLAGS} -D_h_tc_const\
- $(srcdir)/tc.const.c | grep 'Char STR' | \
- sed -e 's/Char \([a-zA-Z0-9_]*\) *\[ *\].*/extern Char \1[];/' | \
+ $(srcdir)/tc.const.c | \
+ sed -n -e 's/^\(Char STR[a-zA-Z0-9_]*\) *\[ *\].*/extern \1[];/p' | \
sort >> $@
@echo '#endif /* _h_tc_const */' >> $@
@@ -514,12 +514,15 @@ install.cygwin: install install.man
# chmod 444 ${DESTMAN}/tcsh.${MANSECT}.Z
clean:
- ${RM} -f a.out strings x.c xs.c tcsh$(EXEEXT) tcsh.a _MAKE_LOG core 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 tcsh.*.m tcsh.*.cat
veryclean: clean
- ${RM} -f config.h config.status config.cache config.log Makefile tcsh.ps
+ ${RM} -f Makefile config.h config_p.h
+ ${RM} -f config.status config.cache config.log tcsh.ps
+ ${RM} -f missing
+ ${RM} -rf autom4te.cache
${RM} -f *~ #*
distclean: veryclean
@@ -623,7 +626,7 @@ $(srcdir)/stamp-h.in: $(srcdir)/configure.in
#
config.h: config_f.h
-TCH=tc.h tc.const.h tc.decls.h tc.os.h tc.sig.h
+TCH=tc.h tc.const.h tc.decls.h tc.nls.h tc.os.h tc.sig.h
SHH=sh.h sh.types.h sh.char.h sh.err.h sh.dir.h sh.proc.h pathnames.h \
sh.decls.h ${TCH}
TWH=tw.h tw.decls.h
@@ -640,7 +643,7 @@ ${OBJS}: config.h ${SHH}
# TWH
TWINC=ed.chared.${SUF} ed.inputl.${SUF} sh.exec.${SUF} sh.func.${SUF} \
- sh.set.${SUF} tc.func.${SUF} tw.color.${SUF}
+ sh.set.${SUF} tc.func.${SUF} tc.nls.${SUF} tw.color.${SUF}
${TWOBJS} ${TWINC}: ${TWH}
# glob.h
diff --git a/contrib/tcsh/Makefile.std b/contrib/tcsh/Makefile.std
index c114383accf1..69219e3a31db 100644
--- a/contrib/tcsh/Makefile.std
+++ b/contrib/tcsh/Makefile.std
@@ -1,4 +1,4 @@
-# $Id: Makefile.std,v 1.95 2002/07/23 16:13:21 christos Exp $
+# $Id: Makefile.std,v 1.96 2004/12/25 21:15:05 christos Exp $
# Makefile.std 4.3 6/11/83
#
# C Shell with process control; VM/UNIX VAX Makefile
@@ -308,11 +308,11 @@ EDOBJS= ed.chared.${SUF} ed.refresh.${SUF} ed.screen.${SUF} ed.init.${SUF} \
ed.inputl.${SUF} ed.defns.${SUF} ed.xmap.${SUF} ed.term.${SUF}
TCSRCS= tc.alloc.c tc.bind.c tc.const.c tc.decls.h tc.disc.c \
- tc.func.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \
+ tc.func.c tc.nls.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \
tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h tc.vers.c tc.wait.h \
tc.who.c tc.h
TCOBJS= tc.alloc.${SUF} tc.bind.${SUF} tc.const.${SUF} tc.defs.${SUF} \
- tc.disc.${SUF} tc.func.${SUF} tc.os.${SUF} tc.printf.${SUF} \
+ tc.disc.${SUF} tc.func.${SUF} tc.nls.${SUF} tc.os.${SUF} tc.printf.${SUF} \
tc.prompt.${SUF} tc.sched.${SUF} tc.sig.${SUF} tc.str.${SUF} \
tc.vers.${SUF} tc.who.${SUF}
@@ -597,7 +597,7 @@ $(srcdir)/stamp-h.in: $(srcdir)/configure.in
#
config.h: config_f.h
-TCH=tc.h tc.const.h tc.decls.h tc.os.h tc.sig.h
+TCH=tc.h tc.const.h tc.decls.h tc.nls.h tc.os.h tc.sig.h
SHH=sh.h sh.types.h sh.char.h sh.err.h sh.dir.h sh.proc.h pathnames.h \
sh.decls.h ${TCH}
TWH=tw.h tw.decls.h
@@ -614,7 +614,7 @@ ${OBJS}: config.h ${SHH}
# TWH
TWINC=ed.chared.${SUF} ed.inputl.${SUF} sh.exec.${SUF} sh.func.${SUF} \
- sh.set.${SUF} tc.func.${SUF} tw.color.${SUF}
+ sh.set.${SUF} tc.func.${SUF} tc.nls.${SUF} tw.color.${SUF}
${TWOBJS} ${TWINC}: ${TWH}
# glob.h
diff --git a/contrib/tcsh/Makefile.vms b/contrib/tcsh/Makefile.vms
index 07c8d4a7c818..75d2c95cdbd6 100644
--- a/contrib/tcsh/Makefile.vms
+++ b/contrib/tcsh/Makefile.vms
@@ -1,4 +1,4 @@
-# $Id: Makefile.vms,v 1.37 2002/07/23 16:13:21 christos Exp $
+# $Id: Makefile.vms,v 1.38 2004/12/25 21:15:05 christos Exp $
# Makefile.vms 4.3 6/11/83
#
# C Shell with process control; VM/UNIX VAX Makefile
@@ -286,11 +286,11 @@ EDOBJS= ed.chared.${SUF} ed.refresh.${SUF} ed.screen.${SUF} ed.init.${SUF} \
ed.inputl.${SUF} ed.defns.${SUF} ed.xmap.${SUF} ed.term.${SUF}
TCSRCS= tc.alloc.c tc.bind.c tc.const.c tc.decls.h tc.disc.c \
- tc.func.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \
+ tc.func.c tc.os.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \
tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h tc.vers.c tc.wait.h \
tc.who.c tc.h
TCOBJS= tc.alloc.${SUF} tc.bind.${SUF} tc.const.${SUF} tc.defs.${SUF} \
- tc.disc.${SUF} tc.func.${SUF} tc.os.${SUF} tc.printf.${SUF} \
+ tc.disc.${SUF} tc.func.${SUF} tc.os.${SUF} tc.os.${SUF} tc.printf.${SUF} \
tc.prompt.${SUF} tc.sched.${SUF} tc.sig.${SUF} tc.str.${SUF} \
tc.vers.${SUF} tc.who.${SUF}
@@ -563,7 +563,7 @@ ftp: tcsh-${VERSION}.tar.Z tcsh.tahoe-${VERSION}.tar.Z
#
config.h: config_f.h
-TCH=tc.h tc.const.h tc.decls.h tc.os.h tc.sig.h
+TCH=tc.h tc.const.h tc.decls.h tc.nls.h tc.os.h tc.sig.h
SHH=sh.h sh.types.h sh.char.h sh.err.h sh.dir.h sh.proc.h pathnames.h \
sh.decls.h ${TCH}
TWH=tw.h tw.decls.h
@@ -580,7 +580,7 @@ ${OBJS}: config.h ${SHH}
# TWH
TWINC=ed.chared.${SUF} ed.inputl.${SUF} sh.exec.${SUF} sh.func.${SUF} \
- sh.set.${SUF} tc.func.${SUF}
+ sh.set.${SUF} tc.func.${SUF} tc.nls.${SUF}
${TWOBJS} ${TWINC}: ${TWH}
# glob.h
diff --git a/contrib/tcsh/README b/contrib/tcsh/README
index 2987991ee907..3852b666517f 100644
--- a/contrib/tcsh/README
+++ b/contrib/tcsh/README
@@ -1,4 +1,4 @@
-This is tcsh version 6.12. Tcsh is a version of the Berkeley
+This is tcsh version 6.14. Tcsh is a version of the Berkeley
C-Shell, with the addition of: a command line editor, command and file
name completion, listing, etc. and a bunch of small additions to the
shell itself.
@@ -86,15 +86,18 @@ To install tcsh:
passwd appears on the screen, you have lost /dev/tty. Otherwise
everything is fine.
-10) Once satisfied that tcsh is working correctly, complete the installation
+10) Once satisfied that tcsh is working correctly, complete the installation
by typing "make install" to install the binary, and "make install.man" to
install the documentation. Don't forget to look at complete.tcsh for
useful completions...
11) Enjoy.
-12) PLEASE send any bug reports (and fixes), code for new features,
- comments, questions, etc. (even flames) to:
+12) PLEASE file any bug reports (and fixes), code for new features at:
+
+ http://bugs.gw.com/
+
+ Comments, questions, etc. (even flames) are welcome via email to:
The tcsh bugs mailing list
tcsh-bugs@mx.gw.com
@@ -107,7 +110,7 @@ On sysv versions < 3.0 (not hpux) Doug Gwyn's public domain directory
manipulation library has to be installed. This library is available
for anonymous ftp from prep.ai.mit.edu:/pub/gnu/dirent.tar.Z
If the network is not installed, then there is a gethostname()
-routine is tc.os.c, enabled by defining NEEDgethostname
+routine is tc.os.c
***************************************************************************
diff --git a/contrib/tcsh/complete.tcsh b/contrib/tcsh/complete.tcsh
index d79bcd03379c..35d7a79415e2 100644
--- a/contrib/tcsh/complete.tcsh
+++ b/contrib/tcsh/complete.tcsh
@@ -1,11 +1,11 @@
#
-# $Id: complete.tcsh,v 1.43 2004/02/22 15:57:15 christos Exp $
+# $Id: complete.tcsh,v 1.46 2005/03/21 21:26:08 kim Exp $
# example file using the new completion code
#
# Debian GNU/Linux
# /usr/share/doc/tcsh/examples/complete.gz
#
-# This file may be read from user's ~/.cshrc or ~/.tcsh file by
+# This file may be read from user's ~/.cshrc or ~/.tcshrc file by
# decompressing it into the home directory as ~/.complete and
# then adding the line "source ~/.complete" and maybe defining
# some of the shell variables described below.
@@ -49,6 +49,7 @@ if ($?_complete) then
endif
if ( -r $HOME/.ssh/known_hosts ) then
set f=`cat $HOME/.ssh/known_hosts | cut -f 1 -d \ ` >& /dev/null
+ set f=`cat $HOME/.ssh/known_hosts | cut -f 1 -d \ | sed -e 's/,/ /g'` >& /dev/null
set hosts=($hosts $f)
endif
unset f
@@ -94,11 +95,11 @@ if ($?_complete) then
complete unalias n/*/a/
complete xdvi n/*/f:*.dvi/ # Only files that match *.dvi
complete dvips n/*/f:*.dvi/
-if ($?traditional_complete) then
- complete tex n/*/f:*.tex/ # Only files that match *.tex
-else
- complete tex n/*/f:*.{tex,texi}/ # Files that match *.tex and *.texi
-endif
+ if ($?traditional_complete) then
+ complete tex n/*/f:*.tex/ # Only files that match *.tex
+ else
+ complete tex n/*/f:*.{tex,texi}/ # Files that match *.tex and *.texi
+ endif
complete latex n/*/f:*.{tex,ltx}/
complete su c/--/"(login fast preserve-environment command shell \
help version)"/ c/-/"(f l m p c s -)"/ \
@@ -178,20 +179,20 @@ endif
complete -co* p/0/"(compress)"/ # make compress completion
# not ambiguous
-if ($?traditional_complete) then
- complete zcat n/*/f:*.Z/
-else
- # "zcat" may be linked to "compress" or "gzip"
- if (-X zcat) then
- zcat --version >& /dev/null
- if ($status != 0) then
- complete zcat n/*/f:*.Z/
- else
- complete zcat c/--/"(force help license quiet version)"/ \
+ if ($?traditional_complete) then
+ complete zcat n/*/f:*.Z/
+ else
+ # "zcat" may be linked to "compress" or "gzip"
+ if (-X zcat) then
+ zcat --version >& /dev/null
+ if ($status != 0) then
+ complete zcat n/*/f:*.Z/
+ else
+ complete zcat c/--/"(force help license quiet version)"/ \
c/-/"(f h L q V -)"/ n/*/f:*.{gz,Z,z,zip}/
- endif
+ endif
+ endif
endif
-endif
complete finger c/*@/\$hosts/ n/*/u/@
complete ping p/1/\$hosts/
@@ -246,8 +247,9 @@ endif
# these from E. Jay Berkenbilt <ejb@ERA.COM>
# = isn't always followed by a filename or a path anymore - jgotts
-if ($?traditional_complete) then
- complete ./configure 'c/--*=/f/' 'c/--{cache-file,prefix,exec-prefix,\
+ if ($?traditional_complete) then
+ complete ./configure \
+ 'c/--*=/f/' 'c/--{cache-file,prefix,exec-prefix,\
bindir,sbindir,libexecdir,datadir,\
sysconfdir,sharedstatedir,localstatedir,\
libdir,includedir,oldincludedir,infodir,\
@@ -257,7 +259,7 @@ if ($?traditional_complete) then
sharedstatedir localstatedir libdir \
includedir oldincludedir infodir mandir \
srcdir)//'
-else
+ else
complete ./configure \
'c@--{prefix,exec-prefix,bindir,sbindir,libexecdir,datadir,sysconfdir,sharedstatedir,localstatedir,infodir,mandir,srcdir,x-includes,x-libraries}=*@x:<directory e.g. /usr/local>'@ \
'c/--cachefile=*/x:<filename>/' \
@@ -269,7 +271,7 @@ else
mandir= srcdir= x-includes= x-libraries= cachefile= \
enable- disable- with- \
help no-create quiet silent version verbose )//'
-endif
+ endif
complete gs 'c/-sDEVICE=/(x11 cdjmono cdj550 epson eps9high epsonc \
dfaxhigh dfaxlow laserjet ljet4 sparc pbm \
pbmraw pgm pgmraw ppm ppmraw bit)/' \
@@ -476,8 +478,16 @@ endif
token-table verbose version yacc)/' \
'c/-/(b d h k l n o p t v y V)/' 'n/-b/f/' 'n/-o/f/' \
'n/-p/f/'
- complete bunzip2 'p/*/f:*.bz2/'
- complete bzip2 'n/-9/f:^*.bz2/' 'n/-d/f:*.bz2/'
+ complete bzcat c/--/"(help test quiet verbose license version)"/ \
+ c/-/"(h t L V -)"/ n/*/f:*.{bz2,tbz}/
+ complete bunzip2 c/--/"(help keep force test stdout quiet verbose \
+ license version)"/ c/-/"(h k f t c q v L V -)"/ \
+ n/*/f:*.{bz2,tbz}/
+ complete bzip2 c/--/"(help decompress compress keep force test \
+ stdout quiet verbose license version small)"/ \
+ c/-/"(h d z k f t c q v L V s 1 2 3 4 5 6 7 8 9 -)"/ \
+ n/{-d,--decompress}/f:*.{bz2,tbz}/ \
+ N/{-d,--decompress}/f:*.{bz2,tbz}/ n/*/f:^*.{bz2,tbz}/
complete c++ 'p/*/f:*.{c++,cxx,c,cc,C,cpp}/'
complete co 'p@1@`\ls -1a RCS | sed -e "s/\(.*\),v/\1/"`@'
complete crontab 'n/-u/u/'
@@ -591,14 +601,16 @@ endif
n@*@'`cat ${HOME}/.muttrc-alias | awk '"'"'{print $2 }'"'"\`@
complete ndc 'n/*/(status dumpdb reload stats trace notrace \
querylog start stop restart )/'
- if ($?traditional_complete) then
- complete nm 'c/--/(debug-syms defined-only demangle dynamic \
+ if ($?traditional_complete) then
+ complete nm \
+ 'c/--/(debug-syms defined-only demangle dynamic \
extern-only format= help line-numbers no-demangle \
no-sort numeric-sort portability print-armap \
print-file-name reverse-sort size-sort undefined-only \
version)/' 'p/*/f:^*.{h,C,c,cc}/'
- else
- complete nm 'c/--radix=/x:<radix: _o_ctal _d_ecimal he_x_adecimal>/' \
+ else
+ complete nm \
+ 'c/--radix=/x:<radix: _o_ctal _d_ecimal he_x_adecimal>/' \
'c/--target=/x:<bfdname>/' \
'c/--format=/(bsd sysv posix)/n/' \
'c/--/(debugsyms extern-only demangle dynamic print-armap \
@@ -607,7 +619,7 @@ endif
format= defined-only\ line-numbers no-demangle version \
help)//' \
'n/*/f:^*.{h,c,cc,s,S}/'
- endif
+ endif
complete nmap 'n@-e@`ifconfig -l`@' 'p/*/$hostnames/'
complete perldoc 'n@*@`\ls -1 /usr/libdata/perl/5.*/pod | sed s%\\.pod.\*\$%%`@'
complete postfix 'n/*/(start stop reload abort flush check)/'
@@ -719,10 +731,10 @@ endif
endif
endif
- if ($?traditional_complete) then
- # use of $MANPATH from Dan Nicolaescu <dann@ics.uci.edu>
- # use of 'find' adapted from Lubomir Host <host8@kepler.fmph.uniba.sk>
- complete man \
+ if ($?traditional_complete) then
+ # use of $MANPATH from Dan Nicolaescu <dann@ics.uci.edu>
+ # use of 'find' adapted from Lubomir Host <host8@kepler.fmph.uniba.sk>
+ complete man \
'n@1@`set q = "$MANPATH:as%:%/man1 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.1.\*\$%%`@'\
'n@2@`set q = "$MANPATH:as%:%/man2 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.2.\*\$%%`@'\
'n@3@`set q = "$MANPATH:as%:%/man3 %" ; \ls -1 $q |& sed -e s%^.\*:.\*\$%% -e s%\\.3.\*\$%%`@'\
@@ -742,8 +754,8 @@ endif
'n@-[sS]@`\ls -1 $MANPATH:as%:% % |& sed -n s%^man%%p | sort -u`@'\
'n@*@`find $MANPATH:as%:% % \( -type f -o -type l \) -printf "%f " |& sed -e "s%find: .*: No such file or directory%%" -e "s%\([^\.]\+\)\.\([^ ]*\) %\1 %g"`@'
#n@*@c@ # old way -- commands only
- else
- complete man n@1@'`\ls -1 /usr/man/man1 | sed s%\\.1.\*\$%%`'@ \
+ else
+ complete man n@1@'`\ls -1 /usr/man/man1 | sed s%\\.1.\*\$%%`'@ \
n@2@'`\ls -1 /usr/man/man2 | sed s%\\.2.\*\$%%`'@ \
n@3@'`\ls -1 /usr/man/man3 | sed s%\\.3.\*\$%%`'@ \
n@4@'`\ls -1 /usr/man/man4 | sed s%\\.4.\*\$%%`'@ \
@@ -759,7 +771,7 @@ n@local@'`[ -r /usr/man/manl ] && \ls -1 /usr/man/manl | sed s%\\.l.\*\$%%`'@ \
n@public@'`[ -r /usr/man/manp ]&& \ls -1 /usr/man/manp | sed s%\\.p.\*\$%%`'@ \
c/-/"(- f k P s t)"/ n/-f/c/ n/-k/x:'<keyword>'/ n/-P/d/ \
N@-P@'`\ls -1 $:-1/man? | sed s%\\..\*\$%%`'@ n/*/c/
- endif
+ endif
complete ps c/-t/x:'<tty>'/ c/-/"(a c C e g k l S t u v w x)"/ \
n/-k/x:'<kernel>'/ N/-k/x:'<core_file>'/ n/*/x:'<PID>'/
@@ -1000,9 +1012,11 @@ n@public@'`[ -r /usr/man/manp ]&& \ls -1 /usr/man/manp | sed s%\\.p.\*\$%%`'@ \
T v V w W X z Z 0 1 2 3 4 5 6 7 -)"/ \
C@/dev@f@ \
n/-c*f/x:'<new_tar_file, device_file, or "-">'/ \
+ n/{-[Adrtux]j*f,--file}/f:*.{tar.bz2,tbz}/ \
n/{-[Adrtux]z*f,--file}/f:*.{tar.gz,tgz}/ \
n/{-[Adrtux]Z*f,--file}/f:*.{tar.Z,taz}/ \
n/{-[Adrtux]*f,--file}/f:*.tar/ \
+ N/{-xj*f,--file}/'`tar -tjf $:-1`'/ \
N/{-xz*f,--file}/'`tar -tzf $:-1`'/ \
N/{-xZ*f,--file}/'`tar -tZf $:-1`'/ \
N/{-x*f,--file}/'`tar -tf $:-1`'/ \
@@ -1015,28 +1029,23 @@ n@public@'`[ -r /usr/man/manp ]&& \ls -1 /usr/man/manp | sed s%\\.p.\*\$%%`'@ \
N/{-C,--directory}/'`\ls $:-1`'/ \
n/-[0-7]/"(l m h)"/
- # SVR4 filesystems
- complete mount c/-/"(a F m o O p r v V)"/ n/-p/n/ n/-v/n/ \
- n/-o/x:'<FSType_options>'/ \
- n@-F@'`\ls -1 /usr/lib/fs`'@ \
- n@*@'`grep -v "^#" /etc/vfstab | tr -s " " " " | cut -f 3`'@
- complete umount c/-/"(a o V)"/ n/-o/x:'<FSType_options>'/ \
- n/*/'`mount | cut -d " " -f 1`'/
- complete mountall c/-/"(F l r)"/ n@-F@'`\ls -1 /usr/lib/fs`'@
- complete umountall c/-/"(F h k l r s)"/ n@-F@'`\ls -1 /usr/lib/fs`'@ \
- n/-h/'`df -k | cut -s -d ":" -f 1 | sort -u`'/
- # BSD 4.3 filesystems
- #complete mount c/-/"(a r t v)"/ n/-t/"(4.2 nfs)"/ \
- # n@*@'`grep -v "^#" /etc/fstab | tr -s " " " " | cut -f 2`'@
- #complete umount c/-/"(a h t v)"/ n/-t/"(4.2 nfs)"/ \
- # n/-h/'`df | cut -s -d ":" -f 1 | sort -u`'/ \
- # n/*/'`mount | cut -d " " -f 3`'/
- # BSD 4.2 filesystems
- #complete mount c/-/"(a r t v)"/ n/-t/"(ufs nfs)"/ \
- # n@*@'`cut -d ":" -f 2 /etc/fstab`'@
- #complete umount c/-/"(a h t v)"/ n/-t/"(ufs nfs)"/ \
- # n/-h/'`df | cut -s -d ":" -f 1 | sort -u`'/ \
- # n/*/'`mount | cut -d " " -f 3`'/
+ # Linux filesystems
+ complete mount c/-/"(a f F h l n o r s t U v V w)"/ n/-[hV]/n/ \
+ n/-o/x:'<options>'/ n/-t/x:'<vfstype>'/ \
+ n/-L/x:'<label>'/ n/-U/x:'<uuid>'/ \
+ n@*@'`grep -v "^#" /etc/fstab | tr -s " " " " | cut -f 2`'@
+ complete umount c/-/"(a h n r t v V)"/ n/-t/x:'<vfstype>'/ \
+ n/*/'`mount | cut -d " " -f 3`'/
+ # Solaris filesystems
+ #complete mount c/-/"(a F m o O p r v V)"/ n/-p/n/ n/-v/n/ \
+ # n/-o/x:'<FSType_options>'/ \
+ # n@-F@'`\ls -1 /usr/lib/fs`'@ \
+ # n@*@'`grep -v "^#" /etc/vfstab | tr -s " " " " | cut -f 3`'@
+ #complete umount c/-/"(a o V)"/ n/-o/x:'<FSType_options>'/ \
+ # n/*/'`mount | cut -d " " -f 1`'/
+ #complete mountall c/-/"(F l r)"/ n@-F@'`\ls -1 /usr/lib/fs`'@
+ #complete umountall c/-/"(F h k l r s)"/ n@-F@'`\ls -1 /usr/lib/fs`'@ \
+ # n/-h/'`df -k | cut -s -d ":" -f 1 | sort -u`'/
# these deal with NIS (formerly YP); if it's not running you don't need 'em
if (-X domainname) then
@@ -1097,19 +1106,19 @@ n@public@'`[ -r /usr/man/manp ]&& \ls -1 /usr/man/manp | sed s%\\.p.\*\$%%`'@ \
endif
- if (! $?traditional_complete) then
- uncomplete vi
- uncomplete vim
- complete {vi,vim,gvim,nvi,elvis} n/*/f:^*.{o,a,so,sa,aux,dvi,log,fig,bbl,blg,bst,idx,ilg,ind,toc}/
- complete {ispell,spell,spellword} 'n@-d@`ls /usr/lib/ispell/*.aff | sed -e "s/\.aff//" `@' 'n/*/f:^*.{o,a,so,sa,aux,dvi,log,fig,bbl,blg,bst,idx,ilg,ind,toc}/'
- complete elm 'n/-[Ai]/f/' 'c@=@F:$HOME/Mail/@' 'n/-s/x:\<subject\>/'
- complete ncftp 'n@*@`sed -e '1,2d' $HOME/.ncftp/bookmarks | cut -f 1,2 -d "," | tr "," "\012" | sort | uniq ` '@
- complete bibtex 'n@*@`ls *.aux | sed -e "s/\.aux//"`'@
- complete dvi2tty n/*/f:*.dvi/ # Only files that match *.dvi
+ if (! $?traditional_complete) then
+ uncomplete vi
+ uncomplete vim
+ complete {vi,vim,gvim,nvi,elvis} n/*/f:^*.{o,a,so,sa,aux,dvi,log,fig,bbl,blg,bst,idx,ilg,ind,toc}/
+ complete {ispell,spell,spellword} 'n@-d@`ls /usr/lib/ispell/*.aff | sed -e "s/\.aff//" `@' 'n/*/f:^*.{o,a,so,sa,aux,dvi,log,fig,bbl,blg,bst,idx,ilg,ind,toc}/'
+ complete elm 'n/-[Ai]/f/' 'c@=@F:$HOME/Mail/@' 'n/-s/x:\<subject\>/'
+ complete ncftp 'n@*@`sed -e '1,2d' $HOME/.ncftp/bookmarks | cut -f 1,2 -d "," | tr "," "\012" | sort | uniq ` '@
+ complete bibtex 'n@*@`ls *.aux | sed -e "s/\.aux//"`'@
+ complete dvi2tty n/*/f:*.dvi/ # Only files that match *.dvi
uncomplete gv
uncomplete ghostview
- complete {gv,ghostview} 'n/*/f:*.{ps,eps,epsi}/'
- complete enscript \
+ complete {gv,ghostview} 'n/*/f:*.{ps,eps,epsi}/'
+ complete enscript \
'c/--/(columns= pages= header= no-header truncate-lines \
line-numbers setpagedevice= escapes font= \
header-font= fancy-header no-job-header \
@@ -1124,9 +1133,10 @@ n@public@'`[ -r /usr/man/manp ]&& \ls -1 /usr/man/manp | sed s%\\.p.\*\$%%`'@ \
printer-options= ul-angle= ul-font= ul-gray= \
ul-position= ul-style= \
)/'
- endif
+ endif
-complete dpkg 'c/--{admindir,instdir,root}=/d/' \
+ complete dpkg \
+ 'c/--{admindir,instdir,root}=/d/' \
'c/--debug=/n/' \
'c/--{admindir,debug,instdir,root}/(=)//' \
'c/--/(admindir= debug= instdir= root= \
@@ -1152,12 +1162,13 @@ complete dpkg 'c/--{admindir,instdir,root}=/d/' \
)//' \
'n/{-l}/`dpkg -l|awk \{print\ \$2\}`/' \
'n/*/f:*.deb'/
-complete dpkg-deb 'c/--{build}=/d/' \
+ complete dpkg-deb 'c/--{build}=/d/' \
'c/--/(build contents info field control extract \
vextract fsys-tarfile help version \
license)//' \
'n/*/f:*.deb/'
-complete apt-get 'c/--/(build config-file diff-only download-only \
+ complete apt-get \
+ 'c/--/(build config-file diff-only download-only \
fix-broken fix-missing force-yes help ignore-hold no-download \
no-upgrade option print-uris purge reinstall quiet simulate \
show-upgraded target-release tar-only version yes )/' \
@@ -1167,7 +1178,7 @@ complete apt-get 'c/--/(build config-file diff-only download-only \
'n/{install}/`apt-cache pkgnames | sort`/' \
'C/*/(update upgrade dselect-upgrade source \
build-dep check clean autoclean install remove)/'
-complete apt-cache \
+ complete apt-cache \
'c/--/(all-versions config-file generate full help important \
names-only option pkg-cache quiet recurse src-cache version )/' \
'c/-/(c= h i o= p= q s= v)/' \
diff --git a/contrib/tcsh/config.h.in b/contrib/tcsh/config.h.in
index 61025bcef7b5..2b402257494a 100644
--- a/contrib/tcsh/config.h.in
+++ b/contrib/tcsh/config.h.in
@@ -1 +1,205 @@
-/* config.h.in. Generated automatically from configure.in by autoheader. */
+/* config.h.in. Generated from configure.in by autoheader. */
+
+/* Define to the type of elements in the array set by `getgroups'. Usually
+ this is either `int' or `gid_t'. */
+#undef GETGROUPS_T
+
+/* Define to 1 if the `getpgrp' function requires zero arguments. */
+#undef GETPGRP_VOID
+
+/* Define to 1 if you have the <auth.h> header file. */
+#undef HAVE_AUTH_H
+
+/* Define to 1 if you have the declaration of `gethostname', and to 0 if you
+ don't. */
+#undef HAVE_DECL_GETHOSTNAME
+
+/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_DIRENT_H
+
+/* Define to 1 if you have the `dup2' function. */
+#undef HAVE_DUP2
+
+/* Define to 1 if you have the `getcwd' function. */
+#undef HAVE_GETCWD
+
+/* Define to 1 if you have the `gethostname' function. */
+#undef HAVE_GETHOSTNAME
+
+/* Define to 1 if you have the `getpwent' function. */
+#undef HAVE_GETPWENT
+
+/* Define to 1 if you have the `getutent' function. */
+#undef HAVE_GETUTENT
+
+/* Define to 1 if you have the iconv () interface */
+#undef HAVE_ICONV
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if the system has the type `long long'. */
+#undef HAVE_LONG_LONG
+
+/* Define to 1 if you have the `memmove' function. */
+#undef HAVE_MEMMOVE
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the `memset' function. */
+#undef HAVE_MEMSET
+
+/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
+#undef HAVE_NDIR_H
+
+/* Define to 1 if you have the `nice' function. */
+#undef HAVE_NICE
+
+/* Define to 1 if you have the `nl_langinfo' function. */
+#undef HAVE_NL_LANGINFO
+
+/* Define to 1 if you have the `sbrk' function. */
+#undef HAVE_SBRK
+
+/* Define to 1 if you have the `setpgid' function. */
+#undef HAVE_SETPGID
+
+/* Define to 1 if you have the `setpriority' function. */
+#undef HAVE_SETPRIORITY
+
+/* Define to 1 if you have the <shadow.h> header file. */
+#undef HAVE_SHADOW_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the `strerror' function. */
+#undef HAVE_STRERROR
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the `strstr' function. */
+#undef HAVE_STRSTR
+
+/* Define to 1 if `d_ino' is member of `struct dirent'. */
+#undef HAVE_STRUCT_DIRENT_D_INO
+
+/* Define to 1 if `ss_family' is member of `struct sockaddr_storage'. */
+#undef HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY
+
+/* Define to 1 if `ut_host' is member of `struct utmp'. */
+#undef HAVE_STRUCT_UTMP_UT_HOST
+
+/* Define to 1 if `ut_tv' is member of `struct utmp'. */
+#undef HAVE_STRUCT_UTMP_UT_TV
+
+/* Define to 1 if `ut_user' is member of `struct utmp'. */
+#undef HAVE_STRUCT_UTMP_UT_USER
+
+/* Define to 1 if `ut_xtime' is member of `struct utmp'. */
+#undef HAVE_STRUCT_UTMP_UT_XTIME
+
+/* Define to 1 if you have the `sysconf' function. */
+#undef HAVE_SYSCONF
+
+/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_SYS_DIR_H
+
+/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_SYS_NDIR_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the <utmpx.h> header file. */
+#undef HAVE_UTMPX_H
+
+/* Define to 1 if you have the <utmp.h> header file. */
+#undef HAVE_UTMP_H
+
+/* Define to 1 if you have the <wchar.h> header file. */
+#undef HAVE_WCHAR_H
+
+/* Define to 1 if you have the <wctype.h> header file. */
+#undef HAVE_WCTYPE_H
+
+/* Define to 1 if you have the `wcwidth' function. */
+#undef HAVE_WCWIDTH
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if the C compiler supports function prototypes. */
+#undef PROTOTYPES
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#undef RETSIGTYPE
+
+/* Define to 1 if the `setpgrp' function takes no argument. */
+#undef SETPGRP_VOID
+
+/* The size of a `wchar_t', as computed by sizeof. */
+#undef SIZEOF_WCHAR_T
+
+/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
+#undef STAT_MACROS_BROKEN
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define like PROTOTYPES; this can be used by system headers. */
+#undef __PROTOTYPES
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef gid_t
+
+/* Define to `int' if <sys/types.h> does not define. */
+#undef mode_t
+
+/* Define to `unsigned' if <sys/types.h> does not define. */
+#undef size_t
+
+/* Define to `int' if neither <sys/types.h> nor <sys/socket.h> define. */
+#undef socklen_t
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef uid_t
+
+/* Define to empty if the keyword `volatile' does not work. Warning: valid
+ code using `volatile' can become incorrect without. Disable with care. */
+#undef volatile
+
+#include "config_p.h"
+#include "config_f.h"
diff --git a/contrib/tcsh/config/bsd4.4 b/contrib/tcsh/config/bsd4.4
index b99531e2ac70..5f028dea2ca3 100644
--- a/contrib/tcsh/config/bsd4.4
+++ b/contrib/tcsh/config/bsd4.4
@@ -66,12 +66,6 @@
#define BSDLIMIT
/*
- * BSDNICE Your system uses setpriority() instead of nice, to
- * change a processes scheduling priority
- */
-#define BSDNICE
-
-/*
* TERMIO You have struct termio instead of struct sgttyb.
* This is usually the case for SYSV systems, where
* BSD uses sgttyb. POSIX systems should define this
@@ -94,44 +88,13 @@
*/
#undef YPBUGS
-/*
- * SIGVOID Define this if your signal handlers return void. On older
- * systems, signal returns int, but on newer ones, it returns void.
- */
-#define SIGVOID
-
-/*
- * HAVEDUP2 Define this if your system supports dup2().
- */
-#define HAVEDUP2
-
-/*
- * UTHOST Does the utmp file have a host field?
- */
-#define UTHOST
-
-/*
- * DIRENT Your system has <dirent.h> instead of <sys/dir.h>
- */
-#define DIRENT
/****************** local defines *********************/
-/****************** configurable hacks ****************/
-
-/* have been moved to config_f.h */
-#include "config_f.h"
#if defined(__FreeBSD__)
#define NLS_BUGS
#define BSD_STYLE_COLORLS
#endif
-#if defined(__NetBSD__)
-#include <sys/param.h>
-#if __NetBSD_Version__ >= 106030000 /* NetBSD 1.6C */
-#define HAVEUTMPX
-#endif
-#endif
-
#if defined(__bsdi__)
/*
* _PATH_TCSHELL if you've change the installation location (vix)
diff --git a/contrib/tcsh/config_f.h b/contrib/tcsh/config_f.h
index d28ca90e1459..2f3f4035c7c4 100644
--- a/contrib/tcsh/config_f.h
+++ b/contrib/tcsh/config_f.h
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/config_f.h,v 3.26 2004/03/21 16:48:14 christos Exp $ */
+/* $Header: /src/pub/tcsh/config_f.h,v 3.32 2005/03/04 13:46:04 christos Exp $ */
/*
* config_f.h -- configure various defines for tcsh
*
@@ -39,7 +39,7 @@
#define _h_config_f
/*
- * SHORT_STRINGS Use 16 bit characters instead of 8 bit chars
+ * SHORT_STRINGS Use at least 16 bit characters instead of 8 bit chars
* This fixes up quoting problems and eases implementation
* of nls...
*
@@ -47,6 +47,14 @@
#define SHORT_STRINGS
/*
+ * WIDE_STRINGS Represent strings using wide characters
+ * Allows proper function in multibyte encodings like UTF-8
+ */
+#if defined (SHORT_STRINGS) && SIZEOF_WCHAR_T >= 4 && !defined (WINNT_NATIVE) && !defined(_OSD_POSIX)
+# define WIDE_STRINGS
+#endif
+
+/*
* NLS: Use Native Language System
* Routines like setlocale() are needed
* if you don't have <locale.h>, you don't want
@@ -110,7 +118,7 @@
/*
* KANJI Ignore meta-next, and the ISO character set. Should
- * be used with SHORT_STRINGS
+ * be used with SHORT_STRINGS (or WIDE_STRINGS)
*
*/
#define KANJI
@@ -120,7 +128,9 @@
* only output, when "dspmbyte" is set. Should be used with
* KANJI
*/
-#define DSPMBYTE
+#if defined (SHORT_STRINGS) && !defined (WIDE_STRINGS)
+# define DSPMBYTE
+#endif
/*
* MBYTEDEBUG when "dspmbyte" is changed, set multi-byte checktable to
@@ -191,4 +201,31 @@
# define RCSID(id) /* Nothing */
#endif /* !lint && !SABER */
+/* Consistency checks */
+#ifdef WIDE_STRINGS
+# if SIZEOF_WCHAR_T < 4
+ #error "wchar_t must be at least 4 bytes for WIDE_STRINGS"
+# endif
+
+# ifdef WINNT_NATIVE
+ #error "WIDE_STRINGS cannot be used together with WINNT_NATIVE"
+# endif
+
+# ifndef SHORT_STRINGS
+ #error "SHORT_STRINGS must be defined if WIDE_STRINGS is defined"
+# endif
+
+# ifndef NLS
+ #error "NLS must be defined if WIDE_STRINGS is defined"
+# endif
+
+# ifdef DSPMBYTE
+ #error "DSPMBYTE must not be defined if WIDE_STRINGS is defined"
+# endif
+#endif
+
+#if !defined (SHORT_STRINGS) && defined (DSPMBYTE)
+ #error "SHORT_STRINGS must be defined if DSPMBYTE is defined"
+#endif
+
#endif /* _h_config_f */
diff --git a/contrib/tcsh/configure b/contrib/tcsh/configure
index a3b9fbfb64e3..c3e2ca1362dc 100755
--- a/contrib/tcsh/configure
+++ b/contrib/tcsh/configure
@@ -1,9 +1,8 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.57.
+# Generated by GNU Autoconf 2.59.
#
-# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
-# Free Software Foundation, Inc.
+# Copyright (C) 2003 Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
## --------------------- ##
@@ -20,9 +19,10 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
set -o posix
fi
+DUALCASE=1; export DUALCASE # for MKS sh
# Support unset when possible.
-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
as_unset=unset
else
as_unset=false
@@ -41,7 +41,7 @@ for as_var in \
LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
LC_TELEPHONE LC_TIME
do
- if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
eval $as_var=C; export $as_var
else
$as_unset $as_var
@@ -218,16 +218,17 @@ rm -f conf$$ conf$$.exe conf$$.file
if mkdir -p . 2>/dev/null; then
as_mkdir_p=:
else
+ test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
as_executable_p="test -f"
# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
# Sed expression to map a string onto a valid variable name.
-as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
# IFS
@@ -271,6 +272,43 @@ PACKAGE_STRING=
PACKAGE_BUGREPORT=
ac_unique_file="tc.vers.c"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#else
+# if HAVE_STDINT_H
+# include <stdint.h>
+# endif
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP DFLAGS HESDEF HESLIB LIBOBJS LTLIBOBJS'
ac_subst_files=''
@@ -630,7 +668,7 @@ done
# Be sure to have absolute paths.
for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
- localstatedir libdir includedir oldincludedir infodir mandir
+ localstatedir libdir includedir oldincludedir infodir mandir
do
eval ac_val=$`echo $ac_var`
case $ac_val in
@@ -670,10 +708,10 @@ if test -z "$srcdir"; then
# Try the directory containing this script, then its parent.
ac_confdir=`(dirname "$0") 2>/dev/null ||
$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$0" : 'X\(//\)[^/]' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$0" : 'X\(//\)[^/]' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
echo X"$0" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
/^X\(\/\/\)[^/].*/{ s//\1/; q; }
@@ -765,9 +803,9 @@ _ACEOF
cat <<_ACEOF
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
+ [$ac_default_prefix]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [PREFIX]
+ [PREFIX]
By default, \`make install' will install all the files in
\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
@@ -853,12 +891,45 @@ case $srcdir in
ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
ac_top_srcdir=$ac_top_builddir$srcdir ;;
esac
-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
-# absolute.
-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
cd $ac_dir
# Check for guested configure; otherwise get Cygnus style configure.
@@ -869,7 +940,7 @@ ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
echo
$SHELL $ac_srcdir/configure --help=recursive
elif test -f $ac_srcdir/configure.ac ||
- test -f $ac_srcdir/configure.in; then
+ test -f $ac_srcdir/configure.in; then
echo
$ac_configure --help
else
@@ -883,8 +954,7 @@ test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
-Free Software Foundation, Inc.
+Copyright (C) 2003 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
@@ -896,7 +966,7 @@ This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by $as_me, which was
-generated by GNU Autoconf 2.57. Invocation command line was
+generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@@ -973,19 +1043,19 @@ do
2)
ac_configure_args1="$ac_configure_args1 '$ac_arg'"
if test $ac_must_keep_next = true; then
- ac_must_keep_next=false # Got value, back to normal.
+ ac_must_keep_next=false # Got value, back to normal.
else
- case $ac_arg in
- *=* | --config-cache | -C | -disable-* | --disable-* \
- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
- | -with-* | --with-* | -without-* | --without-* | --x)
- case "$ac_configure_args0 " in
- "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
- esac
- ;;
- -* ) ac_must_keep_next=true ;;
- esac
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
fi
ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
# Get rid of the leading space.
@@ -1019,12 +1089,12 @@ _ASBOX
case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
*ac_space=\ *)
sed -n \
- "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
;;
*)
sed -n \
- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
;;
esac;
}
@@ -1053,7 +1123,7 @@ _ASBOX
for ac_var in $ac_subst_files
do
eval ac_val=$`echo $ac_var`
- echo "$ac_var='"'"'$ac_val'"'"'"
+ echo "$ac_var='"'"'$ac_val'"'"'"
done | sort
echo
fi
@@ -1072,7 +1142,7 @@ _ASBOX
echo "$as_me: caught signal $ac_signal"
echo "$as_me: exit $exit_status"
} >&5
- rm -f core core.* *.core &&
+ rm -f core *.core &&
rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
exit $exit_status
' 0
@@ -1152,7 +1222,7 @@ fi
# value.
ac_cache_corrupted=false
for ac_var in `(set) 2>&1 |
- sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+ sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
eval ac_old_set=\$ac_cv_env_${ac_var}_set
eval ac_new_set=\$ac_env_${ac_var}_set
eval ac_old_val="\$ac_cv_env_${ac_var}_value"
@@ -1169,13 +1239,13 @@ echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
,);;
*)
if test "x$ac_old_val" != "x$ac_new_val"; then
- { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+ { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
+ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
echo "$as_me: former value: $ac_old_val" >&2;}
- { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
+ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
echo "$as_me: current value: $ac_new_val" >&2;}
- ac_cache_corrupted=:
+ ac_cache_corrupted=:
fi;;
esac
# Pass precious variables to config.status.
@@ -1224,6 +1294,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ ac_config_headers="$ac_config_headers config.h"
+
+
ac_aux_dir=
for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
if test -f $ac_dir/install-sh; then
@@ -1371,7 +1444,7 @@ case "${host}" in
;;
## Linux
- *-*-linux* )
+ *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu)
tcsh_config_file=linux
;;
@@ -1491,7 +1564,7 @@ case "${host}" in
;;
## Siemens BS2000 Mainframe
- bs2000-siemens-posix)
+ bs2000-siemens-*)
tcsh_config_file=bs2000
;;
@@ -1505,7 +1578,7 @@ case "${host}" in
tcsh_config_file=cray
;;
- ## Cygnus GNU Win32
+ ## Red Hat Cygwin
*-cygwin)
tcsh_config_file=cygwin32
;;
@@ -1533,8 +1606,9 @@ Check tcsh's \`Ported' file for manual configuration instructions." >&2;}
esac
echo "Tcsh will use configuration file \`$tcsh_config_file'."
+cp ${srcdir}/config/${tcsh_config_file} config_p.h
+
- ac_config_headers="$ac_config_headers config.h:config/${tcsh_config_file}:config.h.in"
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
@@ -1872,7 +1946,6 @@ ac_compiler=`set X $ac_compile; echo $2`
(exit $ac_status); }
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -1892,8 +1965,8 @@ ac_clean_files="$ac_clean_files a.out a.exe b.out"
# Try to create an executable without -o first, disregard a.out.
# It will help us diagnose broken compilers, and finding out an intuition
# of exeext.
-echo "$as_me:$LINENO: checking for C compiler default output" >&5
-echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
(eval $ac_link_default) 2>&5
@@ -1913,23 +1986,23 @@ do
test -f "$ac_file" || continue
case $ac_file in
*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
- ;;
+ ;;
conftest.$ac_ext )
- # This is the source file.
- ;;
+ # This is the source file.
+ ;;
[ab].out )
- # We found the default executable, but exeext='' is most
- # certainly right.
- break;;
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
*.* )
- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- # FIXME: I believe we export ac_cv_exeext for Libtool,
- # but it would be cool to find out if it's true. Does anybody
- # maintain Libtool? --akim.
- export ac_cv_exeext
- break;;
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ # FIXME: I believe we export ac_cv_exeext for Libtool,
+ # but it would be cool to find out if it's true. Does anybody
+ # maintain Libtool? --akim.
+ export ac_cv_exeext
+ break;;
* )
- break;;
+ break;;
esac
done
else
@@ -2003,8 +2076,8 @@ for ac_file in conftest.exe conftest conftest.*; do
case $ac_file in
*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
*.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- export ac_cv_exeext
- break;;
+ export ac_cv_exeext
+ break;;
* ) break;;
esac
done
@@ -2029,7 +2102,6 @@ if test "${ac_cv_objext+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -2080,7 +2152,6 @@ if test "${ac_cv_c_compiler_gnu+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -2100,11 +2171,21 @@ main ()
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+ (eval $ac_compile) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2117,7 +2198,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_compiler_gnu=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cv_c_compiler_gnu=$ac_compiler_gnu
fi
@@ -2133,7 +2214,6 @@ if test "${ac_cv_prog_cc_g+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -2150,11 +2230,21 @@ main ()
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+ (eval $ac_compile) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2167,7 +2257,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_prog_cc_g=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
@@ -2194,7 +2284,6 @@ else
ac_cv_prog_cc_stdc=no
ac_save_CC=$CC
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -2222,6 +2311,16 @@ static char *f (char * (*g) (char **, int), char **p, ...)
va_end (v);
return s;
}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std1 is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std1. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
int test (int i, double x);
struct s1 {int (*f) (int a);};
struct s2 {int (*f) (double a);};
@@ -2248,11 +2347,21 @@ do
CC="$ac_save_CC $ac_arg"
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+ (eval $ac_compile) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2265,7 +2374,7 @@ else
sed 's/^/| /' conftest.$ac_ext >&5
fi
-rm -f conftest.$ac_objext
+rm -f conftest.err conftest.$ac_objext
done
rm -f conftest.$ac_ext conftest.$ac_objext
CC=$ac_save_CC
@@ -2293,19 +2402,28 @@ cat >conftest.$ac_ext <<_ACEOF
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+ (eval $ac_compile) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
for ac_declaration in \
- ''\
- '#include <stdlib.h>' \
+ '' \
'extern "C" void std::exit (int) throw (); using std::exit;' \
'extern "C" void std::exit (int); using std::exit;' \
'extern "C" void exit (int) throw ();' \
@@ -2313,14 +2431,13 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
'void exit (int);'
do
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <stdlib.h>
$ac_declaration
+#include <stdlib.h>
int
main ()
{
@@ -2331,11 +2448,21 @@ exit (42);
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+ (eval $ac_compile) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2348,9 +2475,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
continue
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -2367,11 +2493,21 @@ exit (42);
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+ (eval $ac_compile) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2383,7 +2519,7 @@ else
sed 's/^/| /' conftest.$ac_ext >&5
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
rm -f conftest*
if test -n "$ac_declaration"; then
@@ -2397,7 +2533,7 @@ else
sed 's/^/| /' conftest.$ac_ext >&5
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -2432,7 +2568,6 @@ do
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -2443,7 +2578,7 @@ cat >>conftest.$ac_ext <<_ACEOF
#else
# include <assert.h>
#endif
- Syntax error
+ Syntax error
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
@@ -2455,6 +2590,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
else
ac_cpp_err=
fi
@@ -2475,7 +2611,6 @@ rm -f conftest.err conftest.$ac_ext
# OK, works on sane cases. Now check whether non-existent headers
# can be detected and how.
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -2493,6 +2628,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
else
ac_cpp_err=
fi
@@ -2539,7 +2675,6 @@ do
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -2550,7 +2685,7 @@ cat >>conftest.$ac_ext <<_ACEOF
#else
# include <assert.h>
#endif
- Syntax error
+ Syntax error
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
@@ -2562,6 +2697,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
else
ac_cpp_err=
fi
@@ -2582,7 +2718,6 @@ rm -f conftest.err conftest.$ac_ext
# OK, works on sane cases. Now check whether non-existent headers
# can be detected and how.
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -2600,6 +2735,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
else
ac_cpp_err=
fi
@@ -2663,7 +2799,6 @@ if test "${ac_cv_prog_gcc_traditional+set}" = set; then
else
ac_pattern="Autoconf.*'x'"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -2683,7 +2818,6 @@ rm -f conftest*
if test $ac_cv_prog_gcc_traditional = no; then
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -2708,18 +2842,11 @@ echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
fi
-if test $ac_cv_c_compiler_gnu = no ; then
+if test "x$GCC" != xyes ; then
DFLAGS="$DFLAGS $NON_GNU_DFLAGS"
CFLAGS="$CFLAGS $NON_GNU_CFLAGS"
fi
-case "${host}" in
- ## Cygnus GNU Win32
- *-cygwin)
- CFLAGS="$CFLAGS -mno-win32"
- ;;
-esac
-
echo "$as_me:$LINENO: checking for library containing crypt" >&5
echo $ECHO_N "checking for library containing crypt... $ECHO_C" >&6
if test "${ac_cv_search_crypt+set}" = set; then
@@ -2728,7 +2855,6 @@ else
ac_func_search_save_LIBS=$LIBS
ac_cv_search_crypt=no
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -2752,11 +2878,21 @@ crypt ();
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
+ (eval $ac_link) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2768,12 +2904,12 @@ else
sed 's/^/| /' conftest.$ac_ext >&5
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
if test "$ac_cv_search_crypt" = no; then
for ac_lib in crypt; do
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -2797,11 +2933,21 @@ crypt ();
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
+ (eval $ac_link) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2814,7 +2960,8 @@ else
sed 's/^/| /' conftest.$ac_ext >&5
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
done
fi
LIBS=$ac_func_search_save_LIBS
@@ -2826,6 +2973,132 @@ if test "$ac_cv_search_crypt" != no; then
fi
+echo "$as_me:$LINENO: checking for library containing getspnam" >&5
+echo $ECHO_N "checking for library containing getspnam... $ECHO_C" >&6
+if test "${ac_cv_search_getspnam+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+ac_cv_search_getspnam=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char getspnam ();
+int
+main ()
+{
+getspnam ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_getspnam="none required"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test "$ac_cv_search_getspnam" = no; then
+ for ac_lib in sec; do
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char getspnam ();
+int
+main ()
+{
+getspnam ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_getspnam="-l$ac_lib"
+break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ done
+fi
+LIBS=$ac_func_search_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_search_getspnam" >&5
+echo "${ECHO_T}$ac_cv_search_getspnam" >&6
+if test "$ac_cv_search_getspnam" != no; then
+ test "$ac_cv_search_getspnam" = "none required" || LIBS="$ac_cv_search_getspnam $LIBS"
+
+fi
+
echo "$as_me:$LINENO: checking for library containing tgetent" >&5
echo $ECHO_N "checking for library containing tgetent... $ECHO_C" >&6
if test "${ac_cv_search_tgetent+set}" = set; then
@@ -2834,7 +3107,6 @@ else
ac_func_search_save_LIBS=$LIBS
ac_cv_search_tgetent=no
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -2858,11 +3130,21 @@ tgetent ();
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
+ (eval $ac_link) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2874,12 +3156,12 @@ else
sed 's/^/| /' conftest.$ac_ext >&5
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
if test "$ac_cv_search_tgetent" = no; then
- for ac_lib in termlib curses termcap; do
+ for ac_lib in termlib termcap curses ncurses; do
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -2903,11 +3185,21 @@ tgetent ();
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
+ (eval $ac_link) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2920,7 +3212,8 @@ else
sed 's/^/| /' conftest.$ac_ext >&5
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
done
fi
LIBS=$ac_func_search_save_LIBS
@@ -2940,7 +3233,6 @@ else
ac_func_search_save_LIBS=$LIBS
ac_cv_search_gethostbyname=no
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -2964,11 +3256,21 @@ gethostbyname ();
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
+ (eval $ac_link) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2980,12 +3282,12 @@ else
sed 's/^/| /' conftest.$ac_ext >&5
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
if test "$ac_cv_search_gethostbyname" = no; then
for ac_lib in nsl; do
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -3009,11 +3311,21 @@ gethostbyname ();
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
+ (eval $ac_link) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -3026,7 +3338,8 @@ else
sed 's/^/| /' conftest.$ac_ext >&5
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
done
fi
LIBS=$ac_func_search_save_LIBS
@@ -3046,7 +3359,6 @@ else
ac_func_search_save_LIBS=$LIBS
ac_cv_search_connect=no
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -3070,11 +3382,21 @@ connect ();
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
+ (eval $ac_link) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -3086,12 +3408,12 @@ else
sed 's/^/| /' conftest.$ac_ext >&5
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
if test "$ac_cv_search_connect" = no; then
for ac_lib in socket; do
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -3115,11 +3437,21 @@ connect ();
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
+ (eval $ac_link) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -3132,7 +3464,8 @@ else
sed 's/^/| /' conftest.$ac_ext >&5
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
done
fi
LIBS=$ac_func_search_save_LIBS
@@ -3144,57 +3477,3704 @@ if test "$ac_cv_search_connect" != no; then
fi
+echo "$as_me:$LINENO: checking for library containing iconv" >&5
+echo $ECHO_N "checking for library containing iconv... $ECHO_C" >&6
+if test "${ac_cv_search_iconv+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+ac_cv_search_iconv=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char iconv ();
+int
+main ()
+{
+iconv ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_iconv="none required"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test "$ac_cv_search_iconv" = no; then
+ for ac_lib in iconv; do
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char iconv ();
+int
+main ()
+{
+iconv ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_iconv="-l$ac_lib"
+break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ done
+fi
+LIBS=$ac_func_search_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_search_iconv" >&5
+echo "${ECHO_T}$ac_cv_search_iconv" >&6
+if test "$ac_cv_search_iconv" != no; then
+ test "$ac_cv_search_iconv" = "none required" || LIBS="$ac_cv_search_iconv $LIBS"
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ICONV 1
+_ACEOF
+
+fi
+
+
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_header_stdc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdc=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then
+ :
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ exit(2);
+ exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+
+for ac_header in auth.h inttypes.h shadow.h stdint.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists. ##
+## ------------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+for ac_header in utmpx.h utmp.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists. ##
+## ------------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in wchar.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists. ##
+## ------------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ echo "$as_me:$LINENO: checking for wchar_t" >&5
+echo $ECHO_N "checking for wchar_t... $ECHO_C" >&6
+if test "${ac_cv_type_wchar_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdio.h>
+#include <wchar.h>
+
+int
+main ()
+{
+if ((wchar_t *) 0)
+ return 0;
+if (sizeof (wchar_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_wchar_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_wchar_t=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_wchar_t" >&5
+echo "${ECHO_T}$ac_cv_type_wchar_t" >&6
+
+echo "$as_me:$LINENO: checking size of wchar_t" >&5
+echo $ECHO_N "checking size of wchar_t... $ECHO_C" >&6
+if test "${ac_cv_sizeof_wchar_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$ac_cv_type_wchar_t" = yes; then
+ # The cast to unsigned long works around a bug in the HP C Compiler
+ # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+ # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+ # This bug is HP SR number 8606223364.
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdio.h>
+#include <wchar.h>
+
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (wchar_t))) >= 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_lo=0 ac_mid=0
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdio.h>
+#include <wchar.h>
+
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (wchar_t))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_hi=$ac_mid; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo=`expr $ac_mid + 1`
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdio.h>
+#include <wchar.h>
+
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (wchar_t))) < 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_hi=-1 ac_mid=-1
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdio.h>
+#include <wchar.h>
+
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (wchar_t))) >= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_lo=$ac_mid; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_hi=`expr '(' $ac_mid ')' - 1`
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo= ac_hi=
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+ ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdio.h>
+#include <wchar.h>
+
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (wchar_t))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_hi=$ac_mid
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_wchar_t=$ac_lo;;
+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t), 77
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (wchar_t), 77
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; } ;;
+esac
+else
+ if test "$cross_compiling" = yes; then
+ { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdio.h>
+#include <wchar.h>
+
+long longval () { return (long) (sizeof (wchar_t)); }
+unsigned long ulongval () { return (long) (sizeof (wchar_t)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+ exit (1);
+ if (((long) (sizeof (wchar_t))) < 0)
+ {
+ long i = longval ();
+ if (i != ((long) (sizeof (wchar_t))))
+ exit (1);
+ fprintf (f, "%ld\n", i);
+ }
+ else
+ {
+ unsigned long i = ulongval ();
+ if (i != ((long) (sizeof (wchar_t))))
+ exit (1);
+ fprintf (f, "%lu\n", i);
+ }
+ exit (ferror (f) || fclose (f) != 0);
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_sizeof_wchar_t=`cat conftest.val`
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t), 77
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (wchar_t), 77
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+rm -f conftest.val
+else
+ ac_cv_sizeof_wchar_t=0
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_sizeof_wchar_t" >&5
+echo "${ECHO_T}$ac_cv_sizeof_wchar_t" >&6
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_WCHAR_T $ac_cv_sizeof_wchar_t
+_ACEOF
+
+
+
+for ac_header in wctype.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists. ##
+## ------------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+fi
+
+done
+
+
+
+
+
+
+ac_header_dirent=no
+for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
+ as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5
+echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <$ac_hdr>
+
+int
+main ()
+{
+if ((DIR *) 0)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
+_ACEOF
+
+ac_header_dirent=$ac_hdr; break
+fi
+
+done
+# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
+if test $ac_header_dirent = dirent.h; then
+ echo "$as_me:$LINENO: checking for library containing opendir" >&5
+echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6
+if test "${ac_cv_search_opendir+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+ac_cv_search_opendir=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char opendir ();
+int
+main ()
+{
+opendir ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_opendir="none required"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test "$ac_cv_search_opendir" = no; then
+ for ac_lib in dir; do
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char opendir ();
+int
+main ()
+{
+opendir ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_opendir="-l$ac_lib"
+break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ done
+fi
+LIBS=$ac_func_search_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
+echo "${ECHO_T}$ac_cv_search_opendir" >&6
+if test "$ac_cv_search_opendir" != no; then
+ test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS"
+
+fi
+
+else
+ echo "$as_me:$LINENO: checking for library containing opendir" >&5
+echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6
+if test "${ac_cv_search_opendir+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+ac_cv_search_opendir=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char opendir ();
+int
+main ()
+{
+opendir ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_opendir="none required"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test "$ac_cv_search_opendir" = no; then
+ for ac_lib in x; do
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char opendir ();
+int
+main ()
+{
+opendir ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_opendir="-l$ac_lib"
+break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ done
+fi
+LIBS=$ac_func_search_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
+echo "${ECHO_T}$ac_cv_search_opendir" >&6
+if test "$ac_cv_search_opendir" != no; then
+ test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS"
+
+fi
+fi
-echo "$as_me:$LINENO: checking ss_family in sockaddr_storage" >&5
-echo $ECHO_N "checking ss_family in sockaddr_storage... $ECHO_C" >&6
-if test "${ac_cv_ss_family+set}" = set; then
+echo "$as_me:$LINENO: checking whether stat file-mode macros are broken" >&5
+echo $ECHO_N "checking whether stat file-mode macros are broken... $ECHO_C" >&6
+if test "${ac_cv_header_stat_broken+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/types.h>
+#include <sys/stat.h>
+
+#if defined(S_ISBLK) && defined(S_IFDIR)
+# if S_ISBLK (S_IFDIR)
+You lose.
+# endif
+#endif
+
+#if defined(S_ISBLK) && defined(S_IFCHR)
+# if S_ISBLK (S_IFCHR)
+You lose.
+# endif
+#endif
+
+#if defined(S_ISLNK) && defined(S_IFREG)
+# if S_ISLNK (S_IFREG)
+You lose.
+# endif
+#endif
+
+#if defined(S_ISSOCK) && defined(S_IFREG)
+# if S_ISSOCK (S_IFREG)
+You lose.
+# endif
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "You lose" >/dev/null 2>&1; then
+ ac_cv_header_stat_broken=yes
+else
+ ac_cv_header_stat_broken=no
+fi
+rm -f conftest*
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stat_broken" >&5
+echo "${ECHO_T}$ac_cv_header_stat_broken" >&6
+if test $ac_cv_header_stat_broken = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STAT_MACROS_BROKEN 1
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_header_stdc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdc=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then
+ :
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ exit(2);
+ exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+
+echo "$as_me:$LINENO: checking for long long" >&5
+echo $ECHO_N "checking for long long... $ECHO_C" >&6
+if test "${ac_cv_type_long_long+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if ((long long *) 0)
+ return 0;
+if (sizeof (long long))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_long_long=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_long_long=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5
+echo "${ECHO_T}$ac_cv_type_long_long" >&6
+if test $ac_cv_type_long_long = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_LONG_LONG 1
+_ACEOF
+
+
+fi
+
+echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5
+echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6
+if test "${ac_cv_type_uid_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "uid_t" >/dev/null 2>&1; then
+ ac_cv_type_uid_t=yes
+else
+ ac_cv_type_uid_t=no
+fi
+rm -f conftest*
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5
+echo "${ECHO_T}$ac_cv_type_uid_t" >&6
+if test $ac_cv_type_uid_t = no; then
+
+cat >>confdefs.h <<\_ACEOF
+#define uid_t int
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define gid_t int
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking type of array argument to getgroups" >&5
+echo $ECHO_N "checking type of array argument to getgroups... $ECHO_C" >&6
+if test "${ac_cv_type_getgroups+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ ac_cv_type_getgroups=cross
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Thanks to Mike Rendell for this test. */
+#include <sys/types.h>
+#define NGID 256
+#undef MAX
+#define MAX(x, y) ((x) > (y) ? (x) : (y))
+
+int
+main ()
+{
+ gid_t gidset[NGID];
+ int i, n;
+ union { gid_t gval; long lval; } val;
+
+ val.lval = -1;
+ for (i = 0; i < NGID; i++)
+ gidset[i] = val.gval;
+ n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
+ gidset);
+ /* Exit non-zero if getgroups seems to require an array of ints. This
+ happens when gid_t is short but getgroups modifies an array of ints. */
+ exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_getgroups=gid_t
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_type_getgroups=int
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+if test $ac_cv_type_getgroups = cross; then
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <unistd.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "getgroups.*int.*gid_t" >/dev/null 2>&1; then
+ ac_cv_type_getgroups=gid_t
+else
+ ac_cv_type_getgroups=int
+fi
+rm -f conftest*
+
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_getgroups" >&5
+echo "${ECHO_T}$ac_cv_type_getgroups" >&6
+
+cat >>confdefs.h <<_ACEOF
+#define GETGROUPS_T $ac_cv_type_getgroups
+_ACEOF
+
+
+echo "$as_me:$LINENO: checking for mode_t" >&5
+echo $ECHO_N "checking for mode_t... $ECHO_C" >&6
+if test "${ac_cv_type_mode_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if ((mode_t *) 0)
+ return 0;
+if (sizeof (mode_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_mode_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_mode_t=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5
+echo "${ECHO_T}$ac_cv_type_mode_t" >&6
+if test $ac_cv_type_mode_t = yes; then
+ :
+else
+
+cat >>confdefs.h <<_ACEOF
+#define mode_t int
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking return type of signal handlers" >&5
+echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
+if test "${ac_cv_type_signal+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <signal.h>
+#ifdef signal
+# undef signal
+#endif
+#ifdef __cplusplus
+extern "C" void (*signal (int, void (*)(int)))(int);
+#else
+void (*signal ()) ();
+#endif
+
+int
+main ()
+{
+int i;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_signal=void
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_signal=int
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
+echo "${ECHO_T}$ac_cv_type_signal" >&6
+
+cat >>confdefs.h <<_ACEOF
+#define RETSIGTYPE $ac_cv_type_signal
+_ACEOF
+
+
+echo "$as_me:$LINENO: checking for size_t" >&5
+echo $ECHO_N "checking for size_t... $ECHO_C" >&6
+if test "${ac_cv_type_size_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if ((size_t *) 0)
+ return 0;
+if (sizeof (size_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_size_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_size_t=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
+echo "${ECHO_T}$ac_cv_type_size_t" >&6
+if test $ac_cv_type_size_t = yes; then
+ :
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5
+echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6
+if test "${ac_cv_type_uid_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "uid_t" >/dev/null 2>&1; then
+ ac_cv_type_uid_t=yes
+else
+ ac_cv_type_uid_t=no
+fi
+rm -f conftest*
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5
+echo "${ECHO_T}$ac_cv_type_uid_t" >&6
+if test $ac_cv_type_uid_t = no; then
+
+cat >>confdefs.h <<\_ACEOF
+#define uid_t int
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define gid_t int
+_ACEOF
+
+fi
+
+
+
+
+echo "$as_me:$LINENO: checking for socklen_t" >&5
+echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6
+if test "${ac_cv_type_socklen_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+#include <sys/types.h>
#include <sys/socket.h>
+
+
int
main ()
{
-struct sockaddr_storage ss; ss.ss_family;
+if ((socklen_t *) 0)
+ return 0;
+if (sizeof (socklen_t))
+ return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_socklen_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_socklen_t=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5
+echo "${ECHO_T}$ac_cv_type_socklen_t" >&6
+if test $ac_cv_type_socklen_t = yes; then
+ :
+else
+
+cat >>confdefs.h <<\_ACEOF
+#define socklen_t int
+_ACEOF
+
+fi
+
+
+
+
+echo "$as_me:$LINENO: checking for struct dirent.d_ino" >&5
+echo $ECHO_N "checking for struct dirent.d_ino... $ECHO_C" >&6
+if test "${ac_cv_member_struct_dirent_d_ino+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef HAVE_DIRENT_H
+# include <dirent.h>
+#else
+# ifdef HAVE_NDIR_H
+# include <ndir.h>
+# else
+# include <sys/dir.h>
+# endif
+# define dirent direct
+#endif
+
+int
+main ()
+{
+static struct dirent ac_aggr;
+if (ac_aggr.d_ino)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_member_struct_dirent_d_ino=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef HAVE_DIRENT_H
+# include <dirent.h>
+#else
+# ifdef HAVE_NDIR_H
+# include <ndir.h>
+# else
+# include <sys/dir.h>
+# endif
+# define dirent direct
+#endif
+
+int
+main ()
+{
+static struct dirent ac_aggr;
+if (sizeof ac_aggr.d_ino)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_cv_ss_family=yes
+ ac_cv_member_struct_dirent_d_ino=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_cv_ss_family=no
+ac_cv_member_struct_dirent_d_ino=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-if test "$ac_cv_ss_family" = no; then
- DFLAGS="$DFLAGS -DNO_SS_FAMILY"
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
+echo "$as_me:$LINENO: result: $ac_cv_member_struct_dirent_d_ino" >&5
+echo "${ECHO_T}$ac_cv_member_struct_dirent_d_ino" >&6
+if test $ac_cv_member_struct_dirent_d_ino = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_DIRENT_D_INO 1
+_ACEOF
+
+
+fi
+
+echo "$as_me:$LINENO: checking for struct utmp.ut_host" >&5
+echo $ECHO_N "checking for struct utmp.ut_host... $ECHO_C" >&6
+if test "${ac_cv_member_struct_utmp_ut_host+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef HAVE_UTMPX_H
+#include <utmpx.h>
+#define utmp utmpx
+#elif defined HAVE_UTMP_H
+#include <utmp.h>
+#endif
+
+int
+main ()
+{
+static struct utmp ac_aggr;
+if (ac_aggr.ut_host)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_member_struct_utmp_ut_host=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef HAVE_UTMPX_H
+#include <utmpx.h>
+#define utmp utmpx
+#elif defined HAVE_UTMP_H
+#include <utmp.h>
+#endif
+
+int
+main ()
+{
+static struct utmp ac_aggr;
+if (sizeof ac_aggr.ut_host)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_member_struct_utmp_ut_host=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_member_struct_utmp_ut_host=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:$LINENO: result: $ac_cv_ss_family" >&5
-echo "${ECHO_T}$ac_cv_ss_family" >&6
+echo "$as_me:$LINENO: result: $ac_cv_member_struct_utmp_ut_host" >&5
+echo "${ECHO_T}$ac_cv_member_struct_utmp_ut_host" >&6
+if test $ac_cv_member_struct_utmp_ut_host = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_UTMP_UT_HOST 1
+_ACEOF
+
+
+fi
+echo "$as_me:$LINENO: checking for struct utmp.ut_user" >&5
+echo $ECHO_N "checking for struct utmp.ut_user... $ECHO_C" >&6
+if test "${ac_cv_member_struct_utmp_ut_user+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef HAVE_UTMPX_H
+#include <utmpx.h>
+#define utmp utmpx
+#elif defined HAVE_UTMP_H
+#include <utmp.h>
+#endif
+
+int
+main ()
+{
+static struct utmp ac_aggr;
+if (ac_aggr.ut_user)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_member_struct_utmp_ut_user=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef HAVE_UTMPX_H
+#include <utmpx.h>
+#define utmp utmpx
+#elif defined HAVE_UTMP_H
+#include <utmp.h>
+#endif
+
+int
+main ()
+{
+static struct utmp ac_aggr;
+if (sizeof ac_aggr.ut_user)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_member_struct_utmp_ut_user=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_member_struct_utmp_ut_user=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_member_struct_utmp_ut_user" >&5
+echo "${ECHO_T}$ac_cv_member_struct_utmp_ut_user" >&6
+if test $ac_cv_member_struct_utmp_ut_user = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_UTMP_UT_USER 1
+_ACEOF
+
+
+fi
+echo "$as_me:$LINENO: checking for struct utmp.ut_tv" >&5
+echo $ECHO_N "checking for struct utmp.ut_tv... $ECHO_C" >&6
+if test "${ac_cv_member_struct_utmp_ut_tv+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef HAVE_UTMPX_H
+#include <utmpx.h>
+#define utmp utmpx
+#elif defined HAVE_UTMP_H
+#include <utmp.h>
+#endif
+
+int
+main ()
+{
+static struct utmp ac_aggr;
+if (ac_aggr.ut_tv)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_member_struct_utmp_ut_tv=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef HAVE_UTMPX_H
+#include <utmpx.h>
+#define utmp utmpx
+#elif defined HAVE_UTMP_H
+#include <utmp.h>
+#endif
+
+int
+main ()
+{
+static struct utmp ac_aggr;
+if (sizeof ac_aggr.ut_tv)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_member_struct_utmp_ut_tv=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_member_struct_utmp_ut_tv=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_member_struct_utmp_ut_tv" >&5
+echo "${ECHO_T}$ac_cv_member_struct_utmp_ut_tv" >&6
+if test $ac_cv_member_struct_utmp_ut_tv = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_UTMP_UT_TV 1
+_ACEOF
+
+
+fi
+echo "$as_me:$LINENO: checking for struct utmp.ut_xtime" >&5
+echo $ECHO_N "checking for struct utmp.ut_xtime... $ECHO_C" >&6
+if test "${ac_cv_member_struct_utmp_ut_xtime+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef HAVE_UTMPX_H
+#include <utmpx.h>
+#define utmp utmpx
+#elif defined HAVE_UTMP_H
+#include <utmp.h>
+#endif
+
+int
+main ()
+{
+static struct utmp ac_aggr;
+if (ac_aggr.ut_xtime)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_member_struct_utmp_ut_xtime=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef HAVE_UTMPX_H
+#include <utmpx.h>
+#define utmp utmpx
+#elif defined HAVE_UTMP_H
+#include <utmp.h>
+#endif
+
+int
+main ()
+{
+static struct utmp ac_aggr;
+if (sizeof ac_aggr.ut_xtime)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_member_struct_utmp_ut_xtime=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_member_struct_utmp_ut_xtime=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_member_struct_utmp_ut_xtime" >&5
+echo "${ECHO_T}$ac_cv_member_struct_utmp_ut_xtime" >&6
+if test $ac_cv_member_struct_utmp_ut_xtime = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_UTMP_UT_XTIME 1
+_ACEOF
+
+
+fi
+
+echo "$as_me:$LINENO: checking for struct sockaddr_storage.ss_family" >&5
+echo $ECHO_N "checking for struct sockaddr_storage.ss_family... $ECHO_C" >&6
+if test "${ac_cv_member_struct_sockaddr_storage_ss_family+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <sys/socket.h>
+
+int
+main ()
+{
+static struct sockaddr_storage ac_aggr;
+if (ac_aggr.ss_family)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_member_struct_sockaddr_storage_ss_family=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <sys/socket.h>
+
+int
+main ()
+{
+static struct sockaddr_storage ac_aggr;
+if (sizeof ac_aggr.ss_family)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_member_struct_sockaddr_storage_ss_family=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_member_struct_sockaddr_storage_ss_family=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_member_struct_sockaddr_storage_ss_family" >&5
+echo "${ECHO_T}$ac_cv_member_struct_sockaddr_storage_ss_family" >&6
+if test $ac_cv_member_struct_sockaddr_storage_ss_family = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1
+_ACEOF
+
+
+fi
+
+
+echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
+echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
+if test "${ac_cv_c_const+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+/* FIXME: Include the comments suggested by Paul. */
+#ifndef __cplusplus
+ /* Ultrix mips cc rejects this. */
+ typedef int charset[2];
+ const charset x;
+ /* SunOS 4.1.1 cc rejects this. */
+ char const *const *ccp;
+ char **p;
+ /* NEC SVR4.0.2 mips cc rejects this. */
+ struct point {int x, y;};
+ static struct point const zero = {0,0};
+ /* AIX XL C 1.02.0.0 rejects this.
+ It does not let you subtract one const X* pointer from another in
+ an arm of an if-expression whose if-part is not a constant
+ expression */
+ const char *g = "string";
+ ccp = &g + (g ? g-g : 0);
+ /* HPUX 7.0 cc rejects these. */
+ ++ccp;
+ p = (char**) ccp;
+ ccp = (char const *const *) p;
+ { /* SCO 3.2v4 cc rejects this. */
+ char *t;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 0;
+ }
+ { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+ int x[] = {25, 17};
+ const int *foo = &x[0];
+ ++foo;
+ }
+ { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+ typedef const int *iptr;
+ iptr p = 0;
+ ++p;
+ }
+ { /* AIX XL C 1.02.0.0 rejects this saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; };
+ struct s *b; b->j = 5;
+ }
+ { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+ }
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_c_const=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_c_const=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
+echo "${ECHO_T}$ac_cv_c_const" >&6
+if test $ac_cv_c_const = no; then
+
+cat >>confdefs.h <<\_ACEOF
+#define const
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for function prototypes" >&5
+echo $ECHO_N "checking for function prototypes... $ECHO_C" >&6
+if test "$ac_cv_prog_cc_stdc" != no; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+cat >>confdefs.h <<\_ACEOF
+#define PROTOTYPES 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define __PROTOTYPES 1
+_ACEOF
+
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+echo "$as_me:$LINENO: checking for working volatile" >&5
+echo $ECHO_N "checking for working volatile... $ECHO_C" >&6
+if test "${ac_cv_c_volatile+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+volatile int x;
+int * volatile y;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_c_volatile=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_c_volatile=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_volatile" >&5
+echo "${ECHO_T}$ac_cv_c_volatile" >&6
+if test $ac_cv_c_volatile = no; then
+
+cat >>confdefs.h <<\_ACEOF
+#define volatile
+_ACEOF
+
+fi
+
+
+echo "$as_me:$LINENO: checking whether gethostname is declared" >&5
+echo $ECHO_N "checking whether gethostname is declared... $ECHO_C" >&6
+if test "${ac_cv_have_decl_gethostname+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+#ifndef gethostname
+ char *p = (char *) gethostname;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_have_decl_gethostname=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_have_decl_gethostname=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_gethostname" >&5
+echo "${ECHO_T}$ac_cv_have_decl_gethostname" >&6
+if test $ac_cv_have_decl_gethostname = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETHOSTNAME 1
+_ACEOF
+
+
+else
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETHOSTNAME 0
+_ACEOF
+
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_func in dup2 getcwd gethostname getpwent getutent memmove memset nice nl_langinfo sbrk setpgid setpriority strerror strstr sysconf wcwidth
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+echo "$as_me:$LINENO: checking whether getpgrp requires zero arguments" >&5
+echo $ECHO_N "checking whether getpgrp requires zero arguments... $ECHO_C" >&6
+if test "${ac_cv_func_getpgrp_void+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # Use it with a single arg.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+getpgrp (0);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_getpgrp_void=no
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_getpgrp_void=yes
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_getpgrp_void" >&5
+echo "${ECHO_T}$ac_cv_func_getpgrp_void" >&6
+if test $ac_cv_func_getpgrp_void = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define GETPGRP_VOID 1
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking whether setpgrp takes no argument" >&5
+echo $ECHO_N "checking whether setpgrp takes no argument... $ECHO_C" >&6
+if test "${ac_cv_func_setpgrp_void+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ { { echo "$as_me:$LINENO: error: cannot check setpgrp when cross compiling" >&5
+echo "$as_me: error: cannot check setpgrp when cross compiling" >&2;}
+ { (exit 1); exit 1; }; }
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+int
+main ()
+{
+/* If this system has a BSD-style setpgrp which takes arguments,
+ setpgrp(1, 1) will fail with ESRCH and return -1, in that case
+ exit successfully. */
+ exit (setpgrp (1,1) == -1 ? 0 : 1);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_setpgrp_void=no
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_func_setpgrp_void=yes
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_setpgrp_void" >&5
+echo "${ECHO_T}$ac_cv_func_setpgrp_void" >&6
+if test $ac_cv_func_setpgrp_void = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define SETPGRP_VOID 1
+_ACEOF
+
+fi
+
+
@@ -3214,21 +7194,28 @@ if test "${ac_cv_func_res_send+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+/* Define res_send to an innocuous variant, in case <limits.h> declares res_send.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define res_send innocuous_res_send
+
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char res_send (); below.
Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
<limits.h> exists even on freestanding compilers. */
+
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
+
+#undef res_send
+
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
@@ -3259,11 +7246,21 @@ return f != res_send;
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
+ (eval $ac_link) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -3276,7 +7273,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_func_res_send=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_res_send" >&5
echo "${ECHO_T}$ac_cv_func_res_send" >&6
@@ -3291,7 +7289,6 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lresolv $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -3315,11 +7312,21 @@ res_send ();
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
+ (eval $ac_link) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -3332,7 +7339,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_resolv_res_send=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_res_send" >&5
@@ -3352,9 +7360,8 @@ fi
-
-
ac_config_files="$ac_config_files Makefile"
+
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
@@ -3383,13 +7390,13 @@ _ACEOF
# `set' does not quote correctly, so add quotes (double-quote
# substitution turns \\\\ into \\, and sed turns \\ into \).
sed -n \
- "s/'/'\\\\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
;;
*)
# `set' quotes correctly as required by POSIX, so do not add quotes.
sed -n \
- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
;;
esac;
} |
@@ -3419,13 +7426,13 @@ test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
# trailing colons and then remove the whole line if VPATH becomes empty
# (actually we leave an empty line to preserve line numbers).
if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=/{
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
s/:*\$(srcdir):*/:/;
s/:*\${srcdir}:*/:/;
s/:*@srcdir@:*/:/;
-s/^\([^=]*=[ ]*\):*/\1/;
+s/^\([^=]*=[ ]*\):*/\1/;
s/:*$//;
-s/^[^=]*=[ ]*$//;
+s/^[^=]*=[ ]*$//;
}'
fi
@@ -3436,7 +7443,7 @@ ac_ltlibobjs=
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
# 1. Remove the extension, and $U if already installed.
ac_i=`echo "$ac_i" |
- sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+ sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
# 2. Add them.
ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
@@ -3480,9 +7487,10 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
set -o posix
fi
+DUALCASE=1; export DUALCASE # for MKS sh
# Support unset when possible.
-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
as_unset=unset
else
as_unset=false
@@ -3501,7 +7509,7 @@ for as_var in \
LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
LC_TELEPHONE LC_TIME
do
- if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
eval $as_var=C; export $as_var
else
$as_unset $as_var
@@ -3680,16 +7688,17 @@ rm -f conf$$ conf$$.exe conf$$.file
if mkdir -p . 2>/dev/null; then
as_mkdir_p=:
else
+ test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
as_executable_p="test -f"
# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
# Sed expression to map a string onto a valid variable name.
-as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
# IFS
@@ -3716,7 +7725,7 @@ _ASBOX
cat >&5 <<_CSEOF
This file was extended by $as_me, which was
-generated by GNU Autoconf 2.57. Invocation command line was
+generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -3760,9 +7769,9 @@ Usage: $0 [OPTIONS] [FILE]...
-d, --debug don't remove temporary files
--recheck update $as_me by reconfiguring in the same conditions
--file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
+ instantiate the configuration file FILE
--header=FILE[:TEMPLATE]
- instantiate the configuration header FILE
+ instantiate the configuration header FILE
Configuration files:
$config_files
@@ -3776,11 +7785,10 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
config.status
-configured by $0, generated by GNU Autoconf 2.57,
+configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
+Copyright (C) 2003 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
srcdir=$srcdir
@@ -3879,7 +7887,7 @@ do
case "$ac_config_target" in
# Handling of arguments.
"Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
- "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config/${tcsh_config_file}:config.h.in" ;;
+ "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
*) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
{ (exit 1); exit 1; }; };;
@@ -4015,9 +8023,9 @@ _ACEOF
(echo ':t
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+ ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
else
- ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+ ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
fi
ac_sed_frag=`expr $ac_sed_frag + 1`
ac_beg=$ac_end
@@ -4035,21 +8043,21 @@ for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
# Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
case $ac_file in
- | *:- | *:-:* ) # input from stdin
- cat >$tmp/stdin
- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
*:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
* ) ac_file_in=$ac_file.in ;;
esac
# Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
ac_dir=`(dirname "$ac_file") 2>/dev/null ||
$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
echo X"$ac_file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
/^X\(\/\/\)[^/].*/{ s//\1/; q; }
@@ -4065,10 +8073,10 @@ echo X"$ac_file" |
as_dirs="$as_dir $as_dirs"
as_dir=`(dirname "$as_dir") 2>/dev/null ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
echo X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
/^X\(\/\/\)[^/].*/{ s//\1/; q; }
@@ -4106,12 +8114,45 @@ case $srcdir in
ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
ac_top_srcdir=$ac_top_builddir$srcdir ;;
esac
-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
-# absolute.
-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
@@ -4129,7 +8170,7 @@ echo "$as_me: creating $ac_file" >&6;}
configure_input="$ac_file. "
fi
configure_input=$configure_input"Generated from `echo $ac_file_in |
- sed 's,.*/,,'` by configure."
+ sed 's,.*/,,'` by configure."
# First look for the input files in the build tree, otherwise in the
# src tree.
@@ -4138,24 +8179,24 @@ echo "$as_me: creating $ac_file" >&6;}
case $f in
-) echo $tmp/stdin ;;
[\\/$]*)
- # Absolute (can't be DOS-style, as IFS=:)
- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
- echo $f;;
+ echo "$f";;
*) # Relative
- if test -f "$f"; then
- # Build tree
- echo $f
- elif test -f "$srcdir/$f"; then
- # Source tree
- echo $srcdir/$f
- else
- # /dev/null tree
- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+ if test -f "$f"; then
+ # Build tree
+ echo "$f"
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo "$srcdir/$f"
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
- fi;;
+ fi;;
esac
done` || { (exit 1); exit 1; }
_ACEOF
@@ -4196,12 +8237,12 @@ cat >>$CONFIG_STATUS <<\_ACEOF
# NAME is the cpp macro being defined and VALUE is the value it is being given.
#
# ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
-ac_dB='[ ].*$,\1#\2'
+ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+ac_dB='[ ].*$,\1#\2'
ac_dC=' '
ac_dD=',;t'
# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
ac_uB='$,\1#\2define\3'
ac_uC=' '
ac_uD=',;t'
@@ -4210,11 +8251,11 @@ for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
# Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
case $ac_file in
- | *:- | *:-:* ) # input from stdin
- cat >$tmp/stdin
- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
*:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
* ) ac_file_in=$ac_file.in ;;
esac
@@ -4228,28 +8269,29 @@ echo "$as_me: creating $ac_file" >&6;}
case $f in
-) echo $tmp/stdin ;;
[\\/$]*)
- # Absolute (can't be DOS-style, as IFS=:)
- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
- echo $f;;
+ # Do quote $f, to prevent DOS paths from being IFS'd.
+ echo "$f";;
*) # Relative
- if test -f "$f"; then
- # Build tree
- echo $f
- elif test -f "$srcdir/$f"; then
- # Source tree
- echo $srcdir/$f
- else
- # /dev/null tree
- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+ if test -f "$f"; then
+ # Build tree
+ echo "$f"
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo "$srcdir/$f"
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
- fi;;
+ fi;;
esac
done` || { (exit 1); exit 1; }
# Remove the trailing spaces.
- sed 's/[ ]*$//' $ac_file_inputs >$tmp/in
+ sed 's/[ ]*$//' $ac_file_inputs >$tmp/in
_ACEOF
@@ -4272,9 +8314,9 @@ s/[\\&,]/\\&/g
s,[\\$`],\\&,g
t clear
: clear
-s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
+s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
t end
-s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
+s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
: end
_ACEOF
# If some macros were called several times there might be several times
@@ -4288,13 +8330,13 @@ rm -f confdef2sed.sed
# example, in the case of _POSIX_SOURCE, which is predefined and required
# on some systems where configure will not decide to define it.
cat >>conftest.undefs <<\_ACEOF
-s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
+s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
_ACEOF
# Break up conftest.defines because some shells have a limit on the size
# of here documents, and old seds have small limits too (100 cmds).
echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
-echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
+echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
echo ' :' >>$CONFIG_STATUS
rm -f conftest.tail
@@ -4303,7 +8345,7 @@ do
# Write a limited-size here document to $tmp/defines.sed.
echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
# Speed up: don't consider the non `#define' lines.
- echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS
+ echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS
# Work around the forget-to-reset-the-flag bug.
echo 't clr' >>$CONFIG_STATUS
echo ': clr' >>$CONFIG_STATUS
@@ -4330,7 +8372,7 @@ do
# Write a limited-size here document to $tmp/undefs.sed.
echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
# Speed up: don't consider the non `#undef'
- echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS
+ echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS
# Work around the forget-to-reset-the-flag bug.
echo 't clr' >>$CONFIG_STATUS
echo ': clr' >>$CONFIG_STATUS
@@ -4364,10 +8406,10 @@ echo "$as_me: $ac_file is unchanged" >&6;}
else
ac_dir=`(dirname "$ac_file") 2>/dev/null ||
$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
echo X"$ac_file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
/^X\(\/\/\)[^/].*/{ s//\1/; q; }
@@ -4383,10 +8425,10 @@ echo X"$ac_file" |
as_dirs="$as_dir $as_dirs"
as_dir=`(dirname "$as_dir") 2>/dev/null ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
echo X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
/^X\(\/\/\)[^/].*/{ s//\1/; q; }
diff --git a/contrib/tcsh/configure.in b/contrib/tcsh/configure.in
index 254b652811e7..bc5e39852519 100644
--- a/contrib/tcsh/configure.in
+++ b/contrib/tcsh/configure.in
@@ -8,13 +8,13 @@ dnl
dnl Written by Kaveh Ghazi (ghazi@caip.rutgers.edu) 5/11/96.
dnl
-AC_PREREQ(2.13)dnl Minimum Autoconf version required.
-AC_INIT(tc.vers.c)
+AC_PREREQ([2.59])dnl Minimum Autoconf version required.
+AC_INIT
+AC_CONFIG_SRCDIR([tc.vers.c])
+AC_CONFIG_HEADERS([config.h])
AC_CANONICAL_HOST
-dnl We don't use AC_VALIDATE_CACHED_SYSTEM_TUPLE here because we only
-dnl care about the HOST value, not the HOST/BUILD/TARGET triplet.
AC_MSG_CHECKING([cached host tuple])
if { test x"${ac_cv_host_system_type+set}" = x"set" &&
test x"$ac_cv_host_system_type" != x"$host"; }; then
@@ -78,7 +78,7 @@ case "${host}" in
;;
## Linux
- *-*-linux* )
+ *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu)
tcsh_config_file=linux
;;
@@ -198,7 +198,7 @@ case "${host}" in
;;
## Siemens BS2000 Mainframe
- bs2000-siemens-posix)
+ bs2000-siemens-*)
tcsh_config_file=bs2000
;;
@@ -212,7 +212,7 @@ case "${host}" in
tcsh_config_file=cray
;;
- ## Cygnus GNU Win32
+ ## Red Hat Cygwin
*-cygwin)
tcsh_config_file=cygwin32
;;
@@ -230,8 +230,8 @@ case "${host}" in
* )
changequote([, ])dnl
AC_MSG_ERROR([Tcsh can't guess the configuration file name
-for \`${host}' systems.
-Check tcsh's \`Ported' file for manual configuration instructions.])
+for `${host}' systems.
+Check tcsh's `Ported' file for manual configuration instructions.])
changequote(, )dnl
;;
@@ -239,32 +239,101 @@ esac
echo "Tcsh will use configuration file \`$tcsh_config_file'."
changequote([, ])dnl
+cp ${srcdir}/config/${tcsh_config_file} config_p.h
+AH_BOTTOM(
+[#include "config_p.h"
+#include "config_f.h"])
-AC_CONFIG_HEADER(config.h:config/${tcsh_config_file}:config.h.in)
+dnl Checks for programs
AC_PROG_CC
AC_PROG_CPP
AC_PROG_GCC_TRADITIONAL
-if test $ac_cv_prog_gcc = no ; then
+if test "x$GCC" != xyes ; then
DFLAGS="$DFLAGS $NON_GNU_DFLAGS"
CFLAGS="$CFLAGS $NON_GNU_CFLAGS"
fi
-case "${host}" in
- ## Cygnus GNU Win32
- *-cygwin)
- CFLAGS="$CFLAGS -mno-win32"
- ;;
-esac
-
+dnl Checks for libraries
AC_SEARCH_LIBS(crypt, crypt)
-AC_SEARCH_LIBS(tgetent, termlib curses termcap)
+AC_SEARCH_LIBS(getspnam, sec)
+AC_SEARCH_LIBS(tgetent, termlib termcap curses ncurses)
AC_SEARCH_LIBS(gethostbyname, nsl)
AC_SEARCH_LIBS(connect, socket)
+AC_SEARCH_LIBS([iconv], [iconv], [AC_DEFINE([HAVE_ICONV], [1],
+ [Define to 1 if you have the iconv () interface])])
+
+dnl Checks for header files
+AC_CHECK_HEADERS([auth.h inttypes.h shadow.h stdint.h])
+AC_CHECK_HEADERS([utmpx.h utmp.h])
+AC_CHECK_HEADERS([wchar.h],
+ [AC_CHECK_SIZEOF([wchar_t], [], [dnl
+#include <stdio.h>
+#include <wchar.h>])
+ AC_CHECK_HEADERS([wctype.h])])
+AC_HEADER_DIRENT
+AC_HEADER_STAT
+AC_HEADER_STDC
+
+dnl Checks for types
+AC_CHECK_TYPES([long long])
+AC_TYPE_GETGROUPS
+AC_TYPE_MODE_T
+AC_TYPE_SIGNAL
+AC_TYPE_SIZE_T
+AC_TYPE_UID_T
+
+AC_DEFUN([AC_TYPE_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.]),
+[
+#include <sys/types.h>
+#include <sys/socket.h>
+])
+])
+AC_TYPE_SOCKLEN_T
+
+
+dnl Checks for structures
+AC_CHECK_MEMBERS([struct dirent.d_ino], , ,
+[#ifdef HAVE_DIRENT_H
+# include <dirent.h>
+#else
+# ifdef HAVE_NDIR_H
+# include <ndir.h>
+# else
+# include <sys/dir.h>
+# endif
+# define dirent direct
+#endif])
+AC_CHECK_MEMBERS([struct utmp.ut_host, struct utmp.ut_user, struct utmp.ut_tv,
+ struct utmp.ut_xtime], , ,
+[#ifdef HAVE_UTMPX_H
+#include <utmpx.h>
+#define utmp utmpx
+#elif defined HAVE_UTMP_H
+#include <utmp.h>
+#endif])
+AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family], , ,
+[#include <sys/types.h>
+#include <sys/socket.h>])
+
+dnl Checks for compiler characteristics
+AC_C_CONST
+AC_C_PROTOTYPES
+AC_C_VOLATILE
+
+dnl checks for library functions
+AC_CHECK_DECLS([gethostname])
+AC_CHECK_FUNCS([dup2 getcwd gethostname getpwent getutent memmove memset] dnl
+ [nice nl_langinfo sbrk setpgid setpriority strerror strstr sysconf] dnl
+ [wcwidth])
+AC_FUNC_GETPGRP
+AC_FUNC_SETPGRP
dnl This is not good enough; we need sockaddr_storage too.
dnl See whether we can use IPv6 related functions
-dnl AC_DEFUN(IPv6_CHECK_FUNC, [
+dnl AC_DEFUN([IPv6_CHECK_FUNC], [
dnl changequote(, )dnl
dnl ac_tr_lib=HAVE_`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
dnl -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
@@ -308,15 +377,6 @@ dnl ifelse([$3], , :, [$3])
dnl fi])
dnl IPv6_CHECK_FUNC(getnameinfo, DFLAGS="$DFLAGS -DINET6")
-AC_CACHE_CHECK([ss_family in sockaddr_storage], ac_cv_ss_family,
-[AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/socket.h>], [struct sockaddr_storage ss; ss.ss_family;],
- ac_cv_ss_family=yes, ac_cv_ss_family=no)]
-if test "$ac_cv_ss_family" = no; then
- DFLAGS="$DFLAGS -DNO_SS_FAMILY"
-fi
-)
-
AC_SUBST(DFLAGS)
AC_ARG_WITH(hesiod,
@@ -335,6 +395,5 @@ fi
AC_SUBST(HESDEF)
AC_SUBST(HESLIB)
-AC_EXEEXT
-
-AC_OUTPUT(Makefile)
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/contrib/tcsh/ed.chared.c b/contrib/tcsh/ed.chared.c
index ced9c8beff26..2585d9403304 100644
--- a/contrib/tcsh/ed.chared.c
+++ b/contrib/tcsh/ed.chared.c
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/ed.chared.c,v 3.71 2002/03/08 17:36:45 christos Exp $ */
+/* $Header: /src/pub/tcsh/ed.chared.c,v 3.83 2005/03/03 16:21:08 kim Exp $ */
/*
* ed.chared.c: Character editing functions.
*/
@@ -72,7 +72,7 @@
#include "sh.h"
-RCSID("$Id: ed.chared.c,v 3.71 2002/03/08 17:36:45 christos Exp $")
+RCSID("$Id: ed.chared.c,v 3.83 2005/03/03 16:21:08 kim Exp $")
#include "ed.h"
#include "tw.h"
@@ -116,7 +116,7 @@ static void c_alternativ_key_map __P((int));
void c_insert __P((int));
void c_delafter __P((int));
void c_delbefore __P((int));
-static int c_to_class __P((int));
+static int c_to_class __P((Char));
static Char *c_prev_word __P((Char *, Char *, int));
static Char *c_next_word __P((Char *, Char *, int));
static Char *c_number __P((Char *, int *, int));
@@ -138,17 +138,11 @@ static CCRETVAL c_get_histline __P((void));
static CCRETVAL c_search_line __P((Char *, int));
static CCRETVAL v_repeat_srch __P((int));
static CCRETVAL e_inc_search __P((int));
+static CCRETVAL e_insert_str __P((Char *));
static CCRETVAL v_search __P((int));
-static CCRETVAL v_csearch_fwd __P((int, int, int));
+static CCRETVAL v_csearch_fwd __P((Char, int, int));
static CCRETVAL v_action __P((int));
-static CCRETVAL v_csearch_back __P((int, int, int));
-
-#if defined(DSPMBYTE)
-static void e_charfwd_mbyte __P((int));
-static void e_charback_mbyte __P((int));
-static int extdel;
-static int extins = 0;
-#endif
+static CCRETVAL v_csearch_back __P((Char, int, int));
static void
c_alternativ_key_map(state)
@@ -180,6 +174,8 @@ c_insert(num)
if (Cursor < LastChar) { /* if I must move chars */
for (cp = LastChar; cp >= Cursor; cp--)
cp[num] = *cp;
+ if (Mark && Mark > Cursor)
+ Mark += num;
}
LastChar += num;
}
@@ -190,27 +186,11 @@ c_delafter(num)
{
Char *cp, *kp = NULL;
-#if defined(DSPMBYTE)
- Char *wkcp;
-
- extdel = 0;
-#endif
-
if (num > LastChar - Cursor)
num = (int) (LastChar - Cursor); /* bounds check */
if (num > 0) { /* if I can delete anything */
-#if defined(DSPMBYTE)
- /* check for code of deleted character */
- if (_enable_mbdisp) {
- for (wkcp = Cursor ; wkcp < Cursor + num; wkcp++) {
- if (extdel == 0)
- extdel = Ismbyte1(*wkcp); /* check to 1st. byte */
- else
- extdel = 0; /* if 2nd. byte, force set to 0 */
- }
- }
-#endif
+ num = NLSExtend(Cursor, LastChar - Cursor, num);
if (VImode) {
kp = UndoBuf; /* Set Up for VI undo command */
UndoAction = TCSHOP_INSERT;
@@ -222,23 +202,11 @@ c_delafter(num)
}
}
else
- for (cp = Cursor; cp <= LastChar; cp++)
+ for (cp = Cursor; cp + num <= LastChar; cp++)
*cp = cp[num];
LastChar -= num;
-#if defined(DSPMBYTE)
- if (_enable_mbdisp && extdel && Ismbyte2(*Cursor)) {
- if( VImode ) {
- UndoSize++;
- *kp++ = *Cursor; /* Save deleted chars into undobuf */
- }
- for (cp = Cursor; cp <= LastChar; cp++)
- *cp = cp[1];
- LastChar--;
- e_redisp( 1 );
- }
- else
- extdel = 0;
-#endif
+ if (Mark && Mark > Cursor)
+ Mark -= num;
}
#ifdef notdef
else {
@@ -257,21 +225,11 @@ c_delbefore(num) /* delete before dot, with bounds checking */
{
Char *cp, *kp = NULL;
-#if defined(DSPMBYTE)
- Char *nowcur, *wkcp;
- Char delc;
-
- extdel = 0;
-#endif
-
if (num > Cursor - InputBuf)
num = (int) (Cursor - InputBuf); /* bounds check */
if (num > 0) { /* if I can delete anything */
-#if defined(DSPMBYTE)
- nowcur = Cursor - num;
- delc = *nowcur;
-#endif
+ num = NLSExtend(Cursor, Cursor - InputBuf, -num);
if (VImode) {
kp = UndoBuf; /* Set Up for VI undo command */
UndoAction = TCSHOP_INSERT;
@@ -283,32 +241,12 @@ c_delbefore(num) /* delete before dot, with bounds checking */
}
}
else
- for (cp = Cursor - num; cp <= LastChar; cp++)
+ for (cp = Cursor - num; cp + num <= LastChar; cp++)
*cp = cp[num];
LastChar -= num;
-#if defined(DSPMBYTE)
- if (_enable_mbdisp) {
- for (wkcp = InputBuf; wkcp < nowcur; wkcp++) {
- if(extdel == 0)
- extdel = Ismbyte1(*wkcp); /* check to 1st. byte */
- else
- extdel = 0; /* if 2nd. byte, force set to 0 */
- }
- if (extdel && Ismbyte2(delc)) {
- if( VImode ) {
- UndoSize++;
- UndoPtr--;
- *kp++ = *(nowcur-1);
- /* Save deleted chars into undobuf */
- }
- for (cp = nowcur - 1; cp <= LastChar; cp++)
- *cp = cp[1];
- LastChar--;
- }
- }
- else
- extdel = 0;
-#endif
+ Cursor -= num;
+ if (Mark && Mark > Cursor)
+ Mark -= num;
}
}
@@ -362,7 +300,7 @@ c_preword(p, low, n, delim)
*/
static int
c_to_class(ch)
-int ch;
+Char ch;
{
if (Isspace(ch))
return C_CLASS_WHITE;
@@ -540,8 +478,8 @@ c_expand(p)
struct Hist *h = Histlist.Hnext;
struct wordent *l;
int i, from, to, dval;
- bool all_dig;
- bool been_once = 0;
+ int all_dig;
+ int been_once = 0;
Char *op = p;
Char buf[INBUFSIZE];
Char *bend = buf;
@@ -843,13 +781,6 @@ c_delfini() /* Finish up delete action */
if (Cursor > ActionPos) {
Size = (int) (Cursor-ActionPos);
c_delbefore(Size);
- Cursor = ActionPos;
-#if defined(DSPMBYTE)
- if (_enable_mbdisp && extdel) {
- Cursor--;
- e_redisp(1);
- }
-#endif
RefCursor();
}
else if (Cursor < ActionPos) {
@@ -869,7 +800,7 @@ c_endword(p, high, n, delim)
Char *p, *high, *delim;
int n;
{
- int inquote = 0;
+ Char inquote = 0;
p++;
while (n--) {
@@ -1073,7 +1004,7 @@ c_get_histline()
if (LastChar < InputBuf)
LastChar = InputBuf;
}
-
+
#ifdef KSHVI
if (VImode)
Cursor = InputBuf;
@@ -1153,7 +1084,8 @@ e_inc_search(dir)
if (GetNextChar(&ch) != 1)
return(e_send_eof(0));
- switch (CurrentKeyMap[(unsigned char) ch]) {
+ switch (ch > NT_NUM_KEYS
+ ? F_INSERT : CurrentKeyMap[(unsigned char) ch]) {
case F_INSERT:
case F_DIGIT:
case F_MAGIC_SPACE:
@@ -1435,7 +1367,7 @@ v_search(dir)
/*ARGSUSED*/
CCRETVAL
v_cmd_mode(c)
- int c;
+ Char c;
{
USE(c);
InsertPos = 0;
@@ -1464,7 +1396,7 @@ v_cmd_mode(c)
/*ARGSUSED*/
CCRETVAL
e_unassigned(c)
- int c;
+ Char c;
{ /* bound to keys that arn't really assigned */
USE(c);
SoundBeep();
@@ -1472,22 +1404,34 @@ e_unassigned(c)
return(CC_NORM);
}
+static CCRETVAL
+e_insert_str(c)
+ Char *c;
+{
+ int i, n;
+
+ n = Strlen(c);
+ if (LastChar + Argument * n >= InputLim)
+ return(CC_ERROR); /* end of buffer space */
+ if (inputmode != MODE_INSERT) {
+ c_delafter(Argument * NLSChars(c));
+ }
+ c_insert(Argument * n);
+ while (Argument--) {
+ for (i = 0; i < n; i++)
+ *Cursor++ = c[i];
+ }
+ Refresh();
+ return(CC_NORM);
+}
+
CCRETVAL
e_insert(c)
- int c;
+ Char c;
{
- int i;
-#if defined(DSPMBYTE)
- CCRETVAL ret;
- static Char savec;
- static int exterr = 0;
-#endif
#ifndef SHORT_STRINGS
c &= ASCII; /* no meta chars ever */
#endif
-#if defined(DSPMBYTE)
- ret = (CCRETVAL) CC_NORM;
-#endif
if (!c)
return(CC_ERROR); /* no NULs in the input ever!! */
@@ -1495,15 +1439,30 @@ e_insert(c)
if (LastChar + Argument >= InputLim)
return(CC_ERROR); /* end of buffer space */
+ if (!NLSFinished(Cursor, 0, c)) {
+ Char buf[MB_LEN_MAX + 1];
+ int f;
+ size_t i = 1;
+ buf[0] = c;
+ do {
+ if (GetNextChar(&c) != 1)
+ break;
+ f = NLSFinished(buf, i, (eChar)c);
+ if (f == -1) {
+ UngetNextChar(c);
+ break;
+ }
+ buf[i++] = c;
+ } while (!f && i < MB_CUR_MAX);
+ if (i > 1) {
+ buf[i] = 0;
+ return e_insert_str(buf);
+ }
+ c = buf[0];
+ }
+
if (Argument == 1) { /* How was this optimized ???? */
-#if defined(DSPMBYTE)
- if(_enable_mbdisp && extins && exterr && Ismbyte2(c)) {
- extins = 0;
- exterr = 0;
- return(CC_ERROR);
- }
-#endif
if (inputmode != MODE_INSERT) {
UndoBuf[UndoSize++] = *Cursor;
UndoBuf[UndoSize] = '\0';
@@ -1511,52 +1470,15 @@ e_insert(c)
}
c_insert(1);
-
-#if defined(DSPMBYTE)
- /* 1st. byte is store to special buffer, and replace space */
- if(_enable_mbdisp && extins == 0 && Ismbyte1(c)) {
- extins++;
- savec = (Char) c;
- *Cursor++ = (Char) ' ';
- }
- else if (_enable_mbdisp && extins && Ismbyte2(c)) {
- *(Cursor-1) = savec;
- *Cursor++ = (Char) c;
- extins = 0;
- e_redisp(1);
- Refresh();
- ret = CC_REFRESH;
- }
- else
- *Cursor++ = (Char) c;
- DoingArg = 0; /* just in case */
- if (ret != CC_REFRESH)
- RefPlusOne(); /* fast refresh for one char. */
-#else
*Cursor++ = (Char) c;
DoingArg = 0; /* just in case */
- RefPlusOne(); /* fast refresh for one char. */
-#endif
+ RefPlusOne(1); /* fast refresh for one char. */
}
else {
-#if defined(DSPMBYTE)
- /* Cannot use ESC-(number) for multi-byte */
- if (_enable_mbdisp && extins == 0 && Ismbyte1(c)) {
- extins++;
- exterr++;
- return(CC_ERROR);
- }
- else if (_enable_mbdisp && extins && exterr && Ismbyte2(c))
- {
- extins = 0;
- exterr = 0;
- return(CC_ERROR);
- }
-#endif
if (inputmode != MODE_INSERT) {
-
- for(i=0;i<Argument;i++)
- UndoBuf[UndoSize++] = *(Cursor+i);
+ int i;
+ for(i = 0; i < Argument; i++)
+ UndoBuf[UndoSize++] = *(Cursor + i);
UndoBuf[UndoSize] = '\0';
c_delafter(Argument); /* Do NOT use the saving ONE */
@@ -1572,11 +1494,7 @@ e_insert(c)
if (inputmode == MODE_REPLACE_1)
(void) v_cmd_mode(0);
-#if defined(DSPMBYTE)
- return(ret);
-#else
return(CC_NORM);
-#endif
}
int
@@ -1604,22 +1522,12 @@ DeleteBack(n) /* delete the n characters before . */
return;
if (Cursor >= &InputBuf[n]) {
c_delbefore(n); /* delete before dot */
- if (n > Cursor - InputBuf)
- Cursor = InputBuf; /* bounds check */
- else
- Cursor -= n;
-#if defined(DSPMBYTE)
- if(_enable_mbdisp && extdel && Cursor > InputBuf) {
- Cursor--;
- e_redisp(1);
- }
-#endif
}
}
CCRETVAL
e_digit(c) /* gray magic here */
- int c;
+ Char c;
{
if (!Isdigit(c))
return(CC_ERROR); /* no NULs in the input ever!! */
@@ -1646,14 +1554,14 @@ e_digit(c) /* gray magic here */
c_insert(1);
*Cursor++ = (Char) c;
DoingArg = 0; /* just in case */
- RefPlusOne(); /* fast refresh for one char. */
+ RefPlusOne(1); /* fast refresh for one char. */
}
return(CC_NORM);
}
CCRETVAL
e_argdigit(c) /* for ESC-n */
- int c;
+ Char c;
{
c &= ASCII;
@@ -1674,7 +1582,7 @@ e_argdigit(c) /* for ESC-n */
CCRETVAL
v_zero(c) /* command mode 0 for vi */
- int c;
+ Char c;
{
if (DoingArg) { /* if doing an arg, add this in... */
if (Argument > 1000000)
@@ -1696,7 +1604,7 @@ v_zero(c) /* command mode 0 for vi */
/*ARGSUSED*/
CCRETVAL
e_newline(c)
- int c;
+ Char c;
{ /* always ignore argument */
USE(c);
/* PastBottom(); NOW done in ed.inputl.c */
@@ -1710,7 +1618,7 @@ e_newline(c)
/*ARGSUSED*/
CCRETVAL
e_send_eof(c)
- int c;
+ Char c;
{ /* for when ^D is ONLY send-eof */
USE(c);
PastBottom();
@@ -1721,7 +1629,7 @@ e_send_eof(c)
/*ARGSUSED*/
CCRETVAL
e_complete(c)
- int c;
+ Char c;
{
USE(c);
*LastChar = '\0'; /* just in case */
@@ -1731,7 +1639,7 @@ e_complete(c)
/*ARGSUSED*/
CCRETVAL
e_complete_back(c)
- int c;
+ Char c;
{
USE(c);
*LastChar = '\0'; /* just in case */
@@ -1741,7 +1649,7 @@ e_complete_back(c)
/*ARGSUSED*/
CCRETVAL
e_complete_fwd(c)
- int c;
+ Char c;
{
USE(c);
*LastChar = '\0'; /* just in case */
@@ -1751,7 +1659,7 @@ e_complete_fwd(c)
/*ARGSUSED*/
CCRETVAL
e_complete_all(c)
- int c;
+ Char c;
{
USE(c);
*LastChar = '\0'; /* just in case */
@@ -1761,7 +1669,7 @@ e_complete_all(c)
/*ARGSUSED*/
CCRETVAL
v_cm_complete(c)
- int c;
+ Char c;
{
USE(c);
if (Cursor < LastChar)
@@ -1773,7 +1681,7 @@ v_cm_complete(c)
/*ARGSUSED*/
CCRETVAL
e_toggle_hist(c)
- int c;
+ Char c;
{
struct Hist *hp;
int h;
@@ -1830,7 +1738,7 @@ e_toggle_hist(c)
/*ARGSUSED*/
CCRETVAL
e_up_hist(c)
- int c;
+ Char c;
{
Char beep = 0;
@@ -1860,7 +1768,7 @@ e_up_hist(c)
/*ARGSUSED*/
CCRETVAL
e_down_hist(c)
- int c;
+ Char c;
{
USE(c);
UndoAction = TCSHOP_NOP;
@@ -1917,11 +1825,11 @@ c_hsetpat()
/*ARGSUSED*/
CCRETVAL
e_up_search_hist(c)
- int c;
+ Char c;
{
struct Hist *hp;
int h;
- bool found = 0;
+ int found = 0;
USE(c);
ActionFlag = TCSHOP_NOP;
@@ -1986,11 +1894,11 @@ e_up_search_hist(c)
/*ARGSUSED*/
CCRETVAL
e_down_search_hist(c)
- int c;
+ Char c;
{
struct Hist *hp;
int h;
- bool found = 0;
+ int found = 0;
USE(c);
ActionFlag = TCSHOP_NOP;
@@ -2040,7 +1948,7 @@ e_down_search_hist(c)
/*ARGSUSED*/
CCRETVAL
e_helpme(c)
- int c;
+ Char c;
{
USE(c);
PastBottom();
@@ -2051,7 +1959,7 @@ e_helpme(c)
/*ARGSUSED*/
CCRETVAL
e_correct(c)
- int c;
+ Char c;
{
USE(c);
*LastChar = '\0'; /* just in case */
@@ -2061,7 +1969,7 @@ e_correct(c)
/*ARGSUSED*/
CCRETVAL
e_correctl(c)
- int c;
+ Char c;
{
USE(c);
*LastChar = '\0'; /* just in case */
@@ -2071,10 +1979,9 @@ e_correctl(c)
/*ARGSUSED*/
CCRETVAL
e_run_fg_editor(c)
- int c;
+ Char c;
{
struct process *pp;
- extern bool tellwhat;
USE(c);
if ((pp = find_stop_ed()) != NULL) {
@@ -2103,7 +2010,7 @@ e_run_fg_editor(c)
/*ARGSUSED*/
CCRETVAL
e_list_choices(c)
- int c;
+ Char c;
{
USE(c);
PastBottom();
@@ -2114,7 +2021,7 @@ e_list_choices(c)
/*ARGSUSED*/
CCRETVAL
e_list_all(c)
- int c;
+ Char c;
{
USE(c);
PastBottom();
@@ -2125,7 +2032,7 @@ e_list_all(c)
/*ARGSUSED*/
CCRETVAL
e_list_glob(c)
- int c;
+ Char c;
{
USE(c);
PastBottom();
@@ -2136,7 +2043,7 @@ e_list_glob(c)
/*ARGSUSED*/
CCRETVAL
e_expand_glob(c)
- int c;
+ Char c;
{
USE(c);
*LastChar = '\0'; /* just in case */
@@ -2146,7 +2053,7 @@ e_expand_glob(c)
/*ARGSUSED*/
CCRETVAL
e_normalize_path(c)
- int c;
+ Char c;
{
USE(c);
*LastChar = '\0'; /* just in case */
@@ -2156,7 +2063,7 @@ e_normalize_path(c)
/*ARGSUSED*/
CCRETVAL
e_normalize_command(c)
- int c;
+ Char c;
{
USE(c);
*LastChar = '\0'; /* just in case */
@@ -2166,7 +2073,7 @@ e_normalize_command(c)
/*ARGSUSED*/
CCRETVAL
e_expand_vars(c)
- int c;
+ Char c;
{
USE(c);
*LastChar = '\0'; /* just in case */
@@ -2176,7 +2083,7 @@ e_expand_vars(c)
/*ARGSUSED*/
CCRETVAL
e_which(c)
- int c;
+ Char c;
{ /* do a fast command line which(1) */
USE(c);
PastBottom();
@@ -2187,7 +2094,7 @@ e_which(c)
/*ARGSUSED*/
CCRETVAL
e_last_item(c)
- int c;
+ Char c;
{ /* insert the last element of the prev. cmd */
Char *cp;
struct Hist *hp;
@@ -2227,12 +2134,12 @@ e_last_item(c)
/*ARGSUSED*/
CCRETVAL
e_dabbrev_expand(c)
- int c;
+ Char c;
{ /* expand to preceding word matching prefix */
Char *cp, *ncp, *bp;
struct Hist *hp;
int arg = 0, len = 0, i; /* len = 0 to shut up gcc -Wall */
- bool found = 0;
+ int found = 0;
Char hbuf[INBUFSIZE];
static int oldevent, hist, word;
static Char *start, *oldcursor;
@@ -2312,7 +2219,7 @@ e_dabbrev_expand(c)
/*ARGSUSED*/
CCRETVAL
e_yank_kill(c)
- int c;
+ Char c;
{ /* almost like GnuEmacs */
int len;
Char *kp, *cp;
@@ -2344,7 +2251,7 @@ e_yank_kill(c)
/*ARGSUSED*/
CCRETVAL
e_yank_pop(c)
- int c;
+ Char c;
{ /* almost like GnuEmacs */
int m_bef_c, del_len, ins_len;
Char *kp, *cp;
@@ -2382,7 +2289,6 @@ e_yank_pop(c)
if (m_bef_c) {
c_delbefore(del_len);
- Cursor = Mark;
} else {
c_delafter(del_len);
}
@@ -2405,7 +2311,7 @@ e_yank_pop(c)
/*ARGSUSED*/
CCRETVAL
v_delprev(c) /* Backspace key in insert mode */
- int c;
+ Char c;
{
int rc;
@@ -2415,13 +2321,6 @@ v_delprev(c) /* Backspace key in insert mode */
if (InsertPos != 0) {
if (Argument <= Cursor - InsertPos) {
c_delbefore(Argument); /* delete before */
- Cursor -= Argument;
-#if defined(DSPMBYTE)
- if (_enable_mbdisp && extdel) {
- Cursor--;
- e_redisp(c);
- }
-#endif
rc = CC_REFRESH;
}
}
@@ -2431,21 +2330,11 @@ v_delprev(c) /* Backspace key in insert mode */
/*ARGSUSED*/
CCRETVAL
e_delprev(c)
- int c;
+ Char c;
{
USE(c);
if (Cursor > InputBuf) {
c_delbefore(Argument); /* delete before dot */
- if (Argument > Cursor - InputBuf)
- Cursor = InputBuf; /* bounds check */
- else
- Cursor -= Argument;
-#if defined(DSPMBYTE)
- if (_enable_mbdisp && extdel && Cursor > InputBuf) {
- Cursor--;
- e_redisp(c);
- }
-#endif
return(CC_REFRESH);
}
else {
@@ -2456,7 +2345,7 @@ e_delprev(c)
/*ARGSUSED*/
CCRETVAL
e_delwordprev(c)
- int c;
+ Char c;
{
Char *cp;
@@ -2470,9 +2359,6 @@ e_delwordprev(c)
c_push_kill(cp, Cursor); /* save the text */
c_delbefore((int)(Cursor - cp)); /* delete before dot */
- Cursor = cp;
- if (Cursor < InputBuf)
- Cursor = InputBuf; /* bounds check */
return(CC_REFRESH);
}
@@ -2507,7 +2393,7 @@ e_delwordprev(c)
/*ARGSUSED*/
CCRETVAL
e_delnext(c)
- int c;
+ Char c;
{
USE(c);
if (Cursor == LastChar) {/* if I'm at the end */
@@ -2531,7 +2417,7 @@ e_delnext(c)
/*ARGSUSED*/
CCRETVAL
e_delnext_eof(c)
- int c;
+ Char c;
{
USE(c);
if (Cursor == LastChar) {/* if I'm at the end */
@@ -2561,7 +2447,7 @@ e_delnext_eof(c)
/*ARGSUSED*/
CCRETVAL
e_delnext_list(c)
- int c;
+ Char c;
{
USE(c);
if (Cursor == LastChar) { /* if I'm at the end */
@@ -2580,7 +2466,7 @@ e_delnext_list(c)
/*ARGSUSED*/
CCRETVAL
e_delnext_list_eof(c)
- int c;
+ Char c;
{
USE(c);
if (Cursor == LastChar) { /* if I'm at the end */
@@ -2606,7 +2492,7 @@ e_delnext_list_eof(c)
/*ARGSUSED*/
CCRETVAL
e_list_eof(c)
- int c;
+ Char c;
{
CCRETVAL rv;
@@ -2627,7 +2513,7 @@ e_list_eof(c)
/*ARGSUSED*/
CCRETVAL
e_delwordnext(c)
- int c;
+ Char c;
{
Char *cp;
@@ -2649,7 +2535,7 @@ e_delwordnext(c)
/*ARGSUSED*/
CCRETVAL
e_toend(c)
- int c;
+ Char c;
{
USE(c);
Cursor = LastChar;
@@ -2665,7 +2551,7 @@ e_toend(c)
/*ARGSUSED*/
CCRETVAL
e_tobeg(c)
- int c;
+ Char c;
{
USE(c);
Cursor = InputBuf;
@@ -2686,11 +2572,11 @@ e_tobeg(c)
/*ARGSUSED*/
CCRETVAL
e_killend(c)
- int c;
+ Char c;
{
USE(c);
c_push_kill(Cursor, LastChar); /* copy it */
- LastChar = Cursor; /* zap! -- delete to end */
+ Mark = LastChar = Cursor; /* zap! -- delete to end */
return(CC_REFRESH);
}
@@ -2698,31 +2584,31 @@ e_killend(c)
/*ARGSUSED*/
CCRETVAL
e_killbeg(c)
- int c;
+ Char c;
{
USE(c);
c_push_kill(InputBuf, Cursor); /* copy it */
c_delbefore((int)(Cursor - InputBuf));
- Cursor = InputBuf; /* zap! */
+ if (Mark && Mark > Cursor)
+ Mark -= Cursor-InputBuf;
return(CC_REFRESH);
}
/*ARGSUSED*/
CCRETVAL
e_killall(c)
- int c;
+ Char c;
{
USE(c);
c_push_kill(InputBuf, LastChar); /* copy it */
- LastChar = InputBuf; /* zap! -- delete all of it */
- Cursor = InputBuf;
+ Cursor = Mark = LastChar = InputBuf; /* zap! -- delete all of it */
return(CC_REFRESH);
}
/*ARGSUSED*/
CCRETVAL
e_killregion(c)
- int c;
+ Char c;
{
USE(c);
if (!Mark)
@@ -2736,7 +2622,6 @@ e_killregion(c)
else { /* mark is before cursor */
c_push_kill(Mark, Cursor); /* copy it */
c_delbefore((int)(Cursor - Mark));
- Cursor = Mark;
}
return(CC_REFRESH);
}
@@ -2744,7 +2629,7 @@ e_killregion(c)
/*ARGSUSED*/
CCRETVAL
e_copyregion(c)
- int c;
+ Char c;
{
USE(c);
if (!Mark)
@@ -2762,7 +2647,7 @@ e_copyregion(c)
/*ARGSUSED*/
CCRETVAL
e_charswitch(cc)
- int cc;
+ Char cc;
{
Char c;
@@ -2785,7 +2670,7 @@ e_charswitch(cc)
/*ARGSUSED*/
CCRETVAL
e_gcharswitch(cc)
- int cc;
+ Char cc;
{ /* gosmacs style ^T */
Char c;
@@ -2801,46 +2686,19 @@ e_gcharswitch(cc)
}
}
-#if defined(DSPMBYTE) /* BY TAGA Nayuta VERY THANKS */
-/*ARGSUSED*/
-static void
-e_charback_mbyte(argument)
- int argument;
-{
- if (!_enable_mbdisp) {
- if (Argument > Cursor - InputBuf)
- Cursor = InputBuf;
- else
- Cursor -= Argument;
- }
- else {
- while (0 < argument && Cursor > InputBuf) {
- if (Cursor - 1 != InputBuf &&
- Ismbyte1(*(Cursor - 2)) && Ismbyte2(*(Cursor - 1))) {
- Cursor--;
- }
- Cursor--;
- argument--;
- }
- }
-}
-#endif
-
/*ARGSUSED*/
CCRETVAL
e_charback(c)
- int c;
+ Char c;
{
+ int num;
USE(c);
if (Cursor > InputBuf) {
-#if defined(DSPMBYTE) /* BY TAGA Nayuta VERY THANKS */
- e_charback_mbyte(Argument);
-#else
- if (Argument > Cursor - InputBuf)
+ num = NLSExtend(Cursor, Cursor - InputBuf, -Argument);
+ if (num > Cursor - InputBuf)
Cursor = InputBuf;
else
- Cursor -= Argument;
-#endif
+ Cursor -= num;
if (VImode)
if (ActionFlag & TCSHOP_DELETE) {
@@ -2859,7 +2717,7 @@ e_charback(c)
/*ARGSUSED*/
CCRETVAL
v_wordback(c)
- int c;
+ Char c;
{
USE(c);
if (Cursor == InputBuf)
@@ -2880,7 +2738,7 @@ v_wordback(c)
/*ARGSUSED*/
CCRETVAL
e_wordback(c)
- int c;
+ Char c;
{
USE(c);
if (Cursor == InputBuf)
@@ -2899,38 +2757,16 @@ e_wordback(c)
return(CC_NORM);
}
-#if defined(DSPMBYTE) /* BY TAGA Nayuta VERY THANKS */
-/*ARGSUSED*/
-static void
-e_charfwd_mbyte(argument)
- int argument;
-{
- if (!_enable_mbdisp)
- Cursor += argument;
- else
- while (0 < argument && Cursor < LastChar) {
- if (Cursor + 1 != LastChar &&
- Ismbyte1(*Cursor) && Ismbyte2(*(Cursor + 1))) {
- Cursor++;
- }
- Cursor++;
- argument--;
- }
-}
-#endif
-
/*ARGSUSED*/
CCRETVAL
e_charfwd(c)
- int c;
+ Char c;
{
+ int num;
USE(c);
if (Cursor < LastChar) {
-#if defined(DSPMBYTE) /* BY TAGA Nayuta VERY THANKS */
- e_charfwd_mbyte(Argument);
-#else
- Cursor += Argument;
-#endif
+ num = NLSExtend(Cursor, LastChar - Cursor, Argument);
+ Cursor += num;
if (Cursor > LastChar)
Cursor = LastChar;
@@ -2951,7 +2787,7 @@ e_charfwd(c)
/*ARGSUSED*/
CCRETVAL
e_wordfwd(c)
- int c;
+ Char c;
{
USE(c);
if (Cursor == LastChar)
@@ -2973,7 +2809,7 @@ e_wordfwd(c)
/*ARGSUSED*/
CCRETVAL
v_wordfwd(c)
- int c;
+ Char c;
{
USE(c);
if (Cursor == LastChar)
@@ -2995,7 +2831,7 @@ v_wordfwd(c)
/*ARGSUSED*/
CCRETVAL
v_wordbegnext(c)
- int c;
+ Char c;
{
USE(c);
if (Cursor == LastChar)
@@ -3044,7 +2880,8 @@ v_repeat_srch(c)
static CCRETVAL
v_csearch_back(ch, count, tflag)
- int ch, count, tflag;
+ Char ch;
+ int count, tflag;
{
Char *cp;
@@ -3076,7 +2913,8 @@ v_csearch_back(ch, count, tflag)
static CCRETVAL
v_csearch_fwd(ch, count, tflag)
- int ch, count, tflag;
+ Char ch;
+ int count, tflag;
{
Char *cp;
@@ -3172,7 +3010,7 @@ c_get_word(begin, end)
/*ARGSUSED*/
CCRETVAL
e_uppercase(c)
- int c;
+ Char c;
{
Char *cp, *end;
@@ -3193,7 +3031,7 @@ e_uppercase(c)
/*ARGSUSED*/
CCRETVAL
e_capitolcase(c)
- int c;
+ Char c;
{
Char *cp, *end;
@@ -3222,7 +3060,7 @@ e_capitolcase(c)
/*ARGSUSED*/
CCRETVAL
e_lowercase(c)
- int c;
+ Char c;
{
Char *cp, *end;
@@ -3243,7 +3081,7 @@ e_lowercase(c)
/*ARGSUSED*/
CCRETVAL
e_set_mark(c)
- int c;
+ Char c;
{
USE(c);
Mark = Cursor;
@@ -3253,7 +3091,7 @@ e_set_mark(c)
/*ARGSUSED*/
CCRETVAL
e_exchange_mark(c)
- int c;
+ Char c;
{
Char *cp;
@@ -3268,7 +3106,7 @@ e_exchange_mark(c)
/*ARGSUSED*/
CCRETVAL
e_argfour(c)
- int c;
+ Char c;
{ /* multiply current argument by 4 */
USE(c);
if (Argument > 1000000)
@@ -3281,7 +3119,7 @@ e_argfour(c)
/*ARGSUSED*/
CCRETVAL
e_quote(c)
- int c;
+ Char c;
{
Char ch;
int num;
@@ -3299,7 +3137,7 @@ e_quote(c)
/*ARGSUSED*/
CCRETVAL
e_metanext(c)
- int c;
+ Char c;
{
USE(c);
MetaNext = 1;
@@ -3310,7 +3148,7 @@ e_metanext(c)
/*ARGSUSED*/
CCRETVAL
e_extendnext(c)
- int c;
+ Char c;
{
CurrentKeyMap = CcAltMap;
return(CC_ARGHACK); /* preserve argument */
@@ -3321,7 +3159,7 @@ e_extendnext(c)
/*ARGSUSED*/
CCRETVAL
v_insbeg(c)
- int c;
+ Char c;
{ /* move to beginning of line and start vi
* insert mode */
USE(c);
@@ -3339,7 +3177,7 @@ v_insbeg(c)
/*ARGSUSED*/
CCRETVAL
v_replone(c)
- int c;
+ Char c;
{ /* vi mode overwrite one character */
USE(c);
c_alternativ_key_map(0);
@@ -3353,7 +3191,7 @@ v_replone(c)
/*ARGSUSED*/
CCRETVAL
v_replmode(c)
- int c;
+ Char c;
{ /* vi mode start overwriting */
USE(c);
c_alternativ_key_map(0);
@@ -3367,7 +3205,7 @@ v_replmode(c)
/*ARGSUSED*/
CCRETVAL
v_substchar(c)
- int c;
+ Char c;
{ /* vi mode substitute for one char */
USE(c);
c_delafter(Argument);
@@ -3378,7 +3216,7 @@ v_substchar(c)
/*ARGSUSED*/
CCRETVAL
v_substline(c)
- int c;
+ Char c;
{ /* vi mode replace whole line */
USE(c);
(void) e_killall(0);
@@ -3389,7 +3227,7 @@ v_substline(c)
/*ARGSUSED*/
CCRETVAL
v_chgtoend(c)
- int c;
+ Char c;
{ /* vi mode change to end of line */
USE(c);
(void) e_killend(0);
@@ -3400,7 +3238,7 @@ v_chgtoend(c)
/*ARGSUSED*/
CCRETVAL
v_insert(c)
- int c;
+ Char c;
{ /* vi mode start inserting */
USE(c);
c_alternativ_key_map(0);
@@ -3415,7 +3253,7 @@ v_insert(c)
/*ARGSUSED*/
CCRETVAL
v_add(c)
- int c;
+ Char c;
{ /* vi mode start adding */
USE(c);
c_alternativ_key_map(0);
@@ -3437,7 +3275,7 @@ v_add(c)
/*ARGSUSED*/
CCRETVAL
v_addend(c)
- int c;
+ Char c;
{ /* vi mode to add at end of line */
USE(c);
c_alternativ_key_map(0);
@@ -3454,9 +3292,9 @@ v_addend(c)
/*ARGSUSED*/
CCRETVAL
v_change_case(cc)
- int cc;
+ Char cc;
{
- char c;
+ Char c;
USE(cc);
if (Cursor < LastChar) {
@@ -3471,7 +3309,7 @@ v_change_case(cc)
*Cursor++ = Toupper(c);
else
Cursor++;
- RefPlusOne(); /* fast refresh for one char */
+ RefPlusOne(1); /* fast refresh for one char */
return(CC_NORM);
}
return(CC_ERROR);
@@ -3480,10 +3318,9 @@ v_change_case(cc)
/*ARGSUSED*/
CCRETVAL
e_expand(c)
- int c;
+ Char c;
{
Char *p;
- extern bool justpr;
USE(c);
for (p = InputBuf; Isspace(*p); p++)
@@ -3499,7 +3336,7 @@ e_expand(c)
/*ARGSUSED*/
CCRETVAL
e_startover(c)
- int c;
+ Char c;
{ /* erase all of current line, start again */
USE(c);
ResetInLine(0); /* reset the input pointers */
@@ -3509,7 +3346,7 @@ e_startover(c)
/*ARGSUSED*/
CCRETVAL
e_redisp(c)
- int c;
+ Char c;
{
USE(c);
ClearLines();
@@ -3520,7 +3357,7 @@ e_redisp(c)
/*ARGSUSED*/
CCRETVAL
e_cleardisp(c)
- int c;
+ Char c;
{
USE(c);
ClearScreen(); /* clear the whole real screen */
@@ -3531,7 +3368,7 @@ e_cleardisp(c)
/*ARGSUSED*/
CCRETVAL
e_tty_int(c)
- int c;
+ Char c;
{
USE(c);
#if defined(_MINIX) || defined(WINNT_NATIVE)
@@ -3554,18 +3391,20 @@ e_tty_int(c)
/*ARGSUSED*/
CCRETVAL
e_stuff_char(c)
- int c;
+ Char c;
{
#ifdef TIOCSTI
- extern int Tty_raw_mode;
int was_raw = Tty_raw_mode;
- char ch = (char) c;
+ char buf[MB_LEN_MAX];
+ size_t i, len;
if (was_raw)
(void) Cookedmode();
(void) write(SHIN, "\n", 1);
- (void) ioctl(SHIN, TIOCSTI, (ioctl_t) &ch);
+ len = one_wctomb(buf, c & CHAR);
+ for (i = 0; i < len; i++)
+ (void) ioctl(SHIN, TIOCSTI, (ioctl_t) &buf[i]);
if (was_raw)
(void) Rawmode();
@@ -3578,7 +3417,7 @@ e_stuff_char(c)
/*ARGSUSED*/
CCRETVAL
e_insovr(c)
- int c;
+ Char c;
{
USE(c);
inputmode = (inputmode == MODE_INSERT ? MODE_REPLACE : MODE_INSERT);
@@ -3588,7 +3427,7 @@ e_insovr(c)
/*ARGSUSED*/
CCRETVAL
e_tty_dsusp(c)
- int c;
+ Char c;
{
USE(c);
/* do no editing */
@@ -3598,7 +3437,7 @@ e_tty_dsusp(c)
/*ARGSUSED*/
CCRETVAL
e_tty_flusho(c)
- int c;
+ Char c;
{
USE(c);
/* do no editing */
@@ -3608,7 +3447,7 @@ e_tty_flusho(c)
/*ARGSUSED*/
CCRETVAL
e_tty_quit(c)
- int c;
+ Char c;
{
USE(c);
/* do no editing */
@@ -3618,7 +3457,7 @@ e_tty_quit(c)
/*ARGSUSED*/
CCRETVAL
e_tty_tsusp(c)
- int c;
+ Char c;
{
USE(c);
/* do no editing */
@@ -3628,7 +3467,7 @@ e_tty_tsusp(c)
/*ARGSUSED*/
CCRETVAL
e_tty_stopo(c)
- int c;
+ Char c;
{
USE(c);
/* do no editing */
@@ -3638,7 +3477,7 @@ e_tty_stopo(c)
/*ARGSUSED*/
CCRETVAL
e_expand_history(c)
- int c;
+ Char c;
{
USE(c);
*LastChar = '\0'; /* just in case */
@@ -3649,7 +3488,7 @@ e_expand_history(c)
/*ARGSUSED*/
CCRETVAL
e_magic_space(c)
- int c;
+ Char c;
{
USE(c);
*LastChar = '\0'; /* just in case */
@@ -3660,7 +3499,7 @@ e_magic_space(c)
/*ARGSUSED*/
CCRETVAL
e_inc_fwd(c)
- int c;
+ Char c;
{
USE(c);
patlen = 0;
@@ -3671,7 +3510,7 @@ e_inc_fwd(c)
/*ARGSUSED*/
CCRETVAL
e_inc_back(c)
- int c;
+ Char c;
{
USE(c);
patlen = 0;
@@ -3681,7 +3520,7 @@ e_inc_back(c)
/*ARGSUSED*/
CCRETVAL
e_copyprev(c)
- int c;
+ Char c;
{
Char *cp, *oldc, *dp;
@@ -3706,7 +3545,7 @@ e_copyprev(c)
/*ARGSUSED*/
CCRETVAL
e_tty_starto(c)
- int c;
+ Char c;
{
USE(c);
/* do no editing */
@@ -3716,7 +3555,7 @@ e_tty_starto(c)
/*ARGSUSED*/
CCRETVAL
e_load_average(c)
- int c;
+ Char c;
{
USE(c);
PastBottom();
@@ -3734,7 +3573,7 @@ e_load_average(c)
/*ARGSUSED*/
CCRETVAL
v_chgmeta(c)
- int c;
+ Char c;
{
USE(c);
/*
@@ -3747,7 +3586,7 @@ v_chgmeta(c)
/*ARGSUSED*/
CCRETVAL
v_delmeta(c)
- int c;
+ Char c;
{
USE(c);
return(v_action(TCSHOP_DELETE));
@@ -3757,7 +3596,7 @@ v_delmeta(c)
/*ARGSUSED*/
CCRETVAL
v_endword(c)
- int c;
+ Char c;
{
USE(c);
if (Cursor == LastChar)
@@ -3780,7 +3619,7 @@ v_endword(c)
/*ARGSUSED*/
CCRETVAL
v_eword(c)
- int c;
+ Char c;
{
USE(c);
if (Cursor == LastChar)
@@ -3802,7 +3641,7 @@ v_eword(c)
/*ARGSUSED*/
CCRETVAL
v_char_fwd(c)
- int c;
+ Char c;
{
Char ch;
@@ -3820,7 +3659,7 @@ v_char_fwd(c)
/*ARGSUSED*/
CCRETVAL
v_char_back(c)
- int c;
+ Char c;
{
Char ch;
@@ -3837,7 +3676,7 @@ v_char_back(c)
/*ARGSUSED*/
CCRETVAL
v_charto_fwd(c)
- int c;
+ Char c;
{
Char ch;
@@ -3852,7 +3691,7 @@ v_charto_fwd(c)
/*ARGSUSED*/
CCRETVAL
v_charto_back(c)
- int c;
+ Char c;
{
Char ch;
@@ -3866,7 +3705,7 @@ v_charto_back(c)
/*ARGSUSED*/
CCRETVAL
v_rchar_fwd(c)
- int c;
+ Char c;
{
USE(c);
if (srch_char == 0)
@@ -3879,7 +3718,7 @@ v_rchar_fwd(c)
/*ARGSUSED*/
CCRETVAL
v_rchar_back(c)
- int c;
+ Char c;
{
USE(c);
if (srch_char == 0)
@@ -3892,7 +3731,7 @@ v_rchar_back(c)
/*ARGSUSED*/
CCRETVAL
v_undo(c)
- int c;
+ Char c;
{
int loop;
Char *kp, *cp;
@@ -3955,7 +3794,7 @@ v_undo(c)
/*ARGSUSED*/
CCRETVAL
v_ush_meta(c)
- int c;
+ Char c;
{
USE(c);
return v_search(F_UP_SEARCH_HIST);
@@ -3964,7 +3803,7 @@ v_ush_meta(c)
/*ARGSUSED*/
CCRETVAL
v_dsh_meta(c)
- int c;
+ Char c;
{
USE(c);
return v_search(F_DOWN_SEARCH_HIST);
@@ -3973,7 +3812,7 @@ v_dsh_meta(c)
/*ARGSUSED*/
CCRETVAL
v_rsrch_fwd(c)
- int c;
+ Char c;
{
USE(c);
if (patlen == 0) return(CC_ERROR);
@@ -3983,7 +3822,7 @@ v_rsrch_fwd(c)
/*ARGSUSED*/
CCRETVAL
v_rsrch_back(c)
- int c;
+ Char c;
{
USE(c);
if (patlen == 0) return(CC_ERROR);
@@ -3997,7 +3836,7 @@ v_rsrch_back(c)
*/
CCRETVAL
e_copy_to_clipboard(c)
- int c;
+ Char c;
{
USE(c);
return CC_ERROR;
@@ -4005,7 +3844,7 @@ e_copy_to_clipboard(c)
CCRETVAL
e_paste_from_clipboard(c)
- int c;
+ Char c;
{
USE(c);
return (CC_ERROR);
@@ -4013,28 +3852,28 @@ e_paste_from_clipboard(c)
CCRETVAL
e_dosify_next(c)
- int c;
+ Char c;
{
USE(c);
return (CC_ERROR);
}
CCRETVAL
e_dosify_prev(c)
- int c;
+ Char c;
{
USE(c);
return (CC_ERROR);
}
CCRETVAL
e_page_up(c)
- int c;
+ Char c;
{
USE(c);
return (CC_ERROR);
}
CCRETVAL
e_page_down(c)
- int c;
+ Char c;
{
USE(c);
return (CC_ERROR);
diff --git a/contrib/tcsh/ed.decls.h b/contrib/tcsh/ed.decls.h
index 435b10695a27..2fac59a9a58f 100644
--- a/contrib/tcsh/ed.decls.h
+++ b/contrib/tcsh/ed.decls.h
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/ed.decls.h,v 3.31 2002/03/08 17:36:45 christos Exp $ */
+/* $Header: /src/pub/tcsh/ed.decls.h,v 3.39 2005/01/18 20:24:50 christos Exp $ */
/*
* ed.decls.h: Editor external definitions
*/
@@ -45,7 +45,7 @@ extern void SetKillRing __P((int));
*/
#ifdef SIG_WINDOW
extern void check_window_size __P((int));
-extern sigret_t window_change __P((int));
+extern RETSIGTYPE window_change __P((int));
#endif /* SIG_WINDOW */
extern int ed_Setup __P((int));
extern void ed_Init __P((void));
@@ -78,7 +78,7 @@ extern void tty_setdisc __P((int, int));
* ed.screen.c
*/
extern void terminit __P((void));
-extern void SetAttributes __P((int));
+extern void SetAttributes __P((Char));
extern void so_write __P((Char *, int));
extern void ClearScreen __P((void));
extern void MoveToLine __P((int));
@@ -86,7 +86,7 @@ extern void MoveToChar __P((int));
extern void ClearEOL __P((int));
extern void Insert_write __P((Char *, int));
extern void DeleteChars __P((int));
-extern void TellTC __P((char *));
+extern void TellTC __P((void));
extern void SetTC __P((char *, char *));
extern void EchoTC __P((Char **));
extern int SetArrowKeys __P((CStr *, XmapVal *, int));
@@ -117,133 +117,134 @@ extern void ed_InitMaps __P((void));
extern void ed_InitEmacsMaps __P((void));
extern void ed_InitVIMaps __P((void));
-extern CCRETVAL e_unassigned __P((int));
-extern CCRETVAL e_insert __P((int));
-extern CCRETVAL e_newline __P((int));
-extern CCRETVAL e_delprev __P((int));
-extern CCRETVAL e_delnext __P((int));
+extern CCRETVAL e_unassigned __P((Char));
+extern CCRETVAL e_insert __P((Char));
+extern CCRETVAL e_newline __P((Char));
+extern CCRETVAL e_delprev __P((Char));
+extern CCRETVAL e_delnext __P((Char));
/* added by mtk@ari.ncl.omron.co.jp (920818) */
-extern CCRETVAL e_delnext_eof __P((int));
-extern CCRETVAL e_delnext_list __P((int));
-extern CCRETVAL e_delnext_list_eof __P((int)); /* for ^D */
-extern CCRETVAL e_toend __P((int));
-extern CCRETVAL e_tobeg __P((int));
-extern CCRETVAL e_charback __P((int));
-extern CCRETVAL e_charfwd __P((int));
-extern CCRETVAL e_quote __P((int));
-extern CCRETVAL e_startover __P((int));
-extern CCRETVAL e_redisp __P((int));
-extern CCRETVAL e_wordback __P((int));
-extern CCRETVAL e_wordfwd __P((int));
-extern CCRETVAL v_wordbegnext __P((int));
-extern CCRETVAL e_uppercase __P((int));
-extern CCRETVAL e_lowercase __P((int));
-extern CCRETVAL e_capitolcase __P((int));
-extern CCRETVAL e_cleardisp __P((int));
-extern CCRETVAL e_complete __P((int));
-extern CCRETVAL e_correct __P((int));
-extern CCRETVAL e_correctl __P((int));
-extern CCRETVAL e_up_hist __P((int));
-extern CCRETVAL e_down_hist __P((int));
-extern CCRETVAL e_up_search_hist __P((int));
-extern CCRETVAL e_down_search_hist __P((int));
-extern CCRETVAL e_helpme __P((int));
-extern CCRETVAL e_list_choices __P((int));
-extern CCRETVAL e_delwordprev __P((int));
-extern CCRETVAL e_delwordnext __P((int));
-extern CCRETVAL e_digit __P((int));
-extern CCRETVAL e_argdigit __P((int));
-extern CCRETVAL v_zero __P((int));
-extern CCRETVAL e_killend __P((int));
-extern CCRETVAL e_killbeg __P((int));
-extern CCRETVAL e_metanext __P((int));
+extern CCRETVAL e_delnext_eof __P((Char));
+extern CCRETVAL e_delnext_list __P((Char));
+extern CCRETVAL e_delnext_list_eof __P((Char)); /* for ^D */
+extern CCRETVAL e_toend __P((Char));
+extern CCRETVAL e_tobeg __P((Char));
+extern CCRETVAL e_charback __P((Char));
+extern CCRETVAL e_charfwd __P((Char));
+extern CCRETVAL e_quote __P((Char));
+extern CCRETVAL e_startover __P((Char));
+extern CCRETVAL e_redisp __P((Char));
+extern CCRETVAL e_wordback __P((Char));
+extern CCRETVAL e_wordfwd __P((Char));
+extern CCRETVAL v_wordbegnext __P((Char));
+extern CCRETVAL e_uppercase __P((Char));
+extern CCRETVAL e_lowercase __P((Char));
+extern CCRETVAL e_capitolcase __P((Char));
+extern CCRETVAL e_cleardisp __P((Char));
+extern CCRETVAL e_complete __P((Char));
+extern CCRETVAL e_correct __P((Char));
+extern CCRETVAL e_correctl __P((Char));
+extern CCRETVAL e_up_hist __P((Char));
+extern CCRETVAL e_down_hist __P((Char));
+extern CCRETVAL e_up_search_hist __P((Char));
+extern CCRETVAL e_down_search_hist __P((Char));
+extern CCRETVAL e_helpme __P((Char));
+extern CCRETVAL e_list_choices __P((Char));
+extern CCRETVAL e_delwordprev __P((Char));
+extern CCRETVAL e_delwordnext __P((Char));
+extern CCRETVAL e_digit __P((Char));
+extern CCRETVAL e_argdigit __P((Char));
+extern CCRETVAL v_zero __P((Char));
+extern CCRETVAL e_killend __P((Char));
+extern CCRETVAL e_killbeg __P((Char));
+extern CCRETVAL e_metanext __P((Char));
#ifdef notdef
-extern CCRETVAL e_extendnext __P((int));
+extern CCRETVAL e_extendnext __P((Char));
#endif
-extern CCRETVAL e_send_eof __P((int));
-extern CCRETVAL e_charswitch __P((int));
-extern CCRETVAL e_gcharswitch __P((int));
-extern CCRETVAL e_which __P((int));
-extern CCRETVAL e_yank_kill __P((int));
-extern CCRETVAL e_tty_dsusp __P((int));
-extern CCRETVAL e_tty_flusho __P((int));
-extern CCRETVAL e_tty_quit __P((int));
-extern CCRETVAL e_tty_tsusp __P((int));
-extern CCRETVAL e_tty_stopo __P((int));
-extern CCRETVAL e_tty_starto __P((int));
-extern CCRETVAL e_argfour __P((int));
-extern CCRETVAL e_set_mark __P((int));
-extern CCRETVAL e_exchange_mark __P((int));
-extern CCRETVAL e_last_item __P((int));
-extern CCRETVAL v_cmd_mode __P((int));
-extern CCRETVAL v_insert __P((int));
-extern CCRETVAL v_replmode __P((int));
-extern CCRETVAL v_replone __P((int));
-extern CCRETVAL v_substline __P((int));
-extern CCRETVAL v_substchar __P((int));
-extern CCRETVAL v_add __P((int));
-extern CCRETVAL v_addend __P((int));
-extern CCRETVAL v_insbeg __P((int));
-extern CCRETVAL v_chgtoend __P((int));
-extern CCRETVAL e_killregion __P((int));
-extern CCRETVAL e_killall __P((int));
-extern CCRETVAL e_copyregion __P((int));
-extern CCRETVAL e_tty_int __P((int));
-extern CCRETVAL e_run_fg_editor __P((int));
-extern CCRETVAL e_list_eof __P((int));
-extern CCRETVAL e_expand_history __P((int));
-extern CCRETVAL e_magic_space __P((int));
-extern CCRETVAL e_list_glob __P((int));
-extern CCRETVAL e_expand_glob __P((int));
-extern CCRETVAL e_insovr __P((int));
-extern CCRETVAL v_cm_complete __P((int));
-extern CCRETVAL e_copyprev __P((int));
-extern CCRETVAL v_change_case __P((int));
-extern CCRETVAL e_expand __P((int));
-extern CCRETVAL e_expand_vars __P((int));
-extern CCRETVAL e_toggle_hist __P((int));
-extern CCRETVAL e_load_average __P((int));
-extern CCRETVAL v_delprev __P((int));
-extern CCRETVAL v_delmeta __P((int));
-extern CCRETVAL v_wordfwd __P((int));
-extern CCRETVAL v_wordback __P((int));
-extern CCRETVAL v_endword __P((int));
-extern CCRETVAL v_eword __P((int));
-extern CCRETVAL v_undo __P((int));
-extern CCRETVAL v_ush_meta __P((int));
-extern CCRETVAL v_dsh_meta __P((int));
-extern CCRETVAL v_rsrch_fwd __P((int));
-extern CCRETVAL v_rsrch_back __P((int));
-extern CCRETVAL v_char_fwd __P((int));
-extern CCRETVAL v_char_back __P((int));
-extern CCRETVAL v_chgmeta __P((int));
-extern CCRETVAL e_inc_fwd __P((int));
-extern CCRETVAL e_inc_back __P((int));
-extern CCRETVAL v_rchar_fwd __P((int));
-extern CCRETVAL v_rchar_back __P((int));
-extern CCRETVAL v_charto_fwd __P((int));
-extern CCRETVAL v_charto_back __P((int));
-extern CCRETVAL e_normalize_path __P((int));
-extern CCRETVAL e_normalize_command __P((int));
-extern CCRETVAL e_stuff_char __P((int));
-extern CCRETVAL e_list_all __P((int));
-extern CCRETVAL e_complete_all __P((int));
-extern CCRETVAL e_complete_fwd __P((int));
-extern CCRETVAL e_complete_back __P((int));
-extern CCRETVAL e_dabbrev_expand __P((int));
-extern CCRETVAL e_copy_to_clipboard __P((int));
-extern CCRETVAL e_paste_from_clipboard __P((int));
-extern CCRETVAL e_dosify_next __P((int));
-extern CCRETVAL e_dosify_prev __P((int));
-extern CCRETVAL e_page_up __P((int));
-extern CCRETVAL e_page_down __P((int));
-extern CCRETVAL e_yank_pop __P((int));
+extern CCRETVAL e_send_eof __P((Char));
+extern CCRETVAL e_charswitch __P((Char));
+extern CCRETVAL e_gcharswitch __P((Char));
+extern CCRETVAL e_which __P((Char));
+extern CCRETVAL e_yank_kill __P((Char));
+extern CCRETVAL e_tty_dsusp __P((Char));
+extern CCRETVAL e_tty_flusho __P((Char));
+extern CCRETVAL e_tty_quit __P((Char));
+extern CCRETVAL e_tty_tsusp __P((Char));
+extern CCRETVAL e_tty_stopo __P((Char));
+extern CCRETVAL e_tty_starto __P((Char));
+extern CCRETVAL e_argfour __P((Char));
+extern CCRETVAL e_set_mark __P((Char));
+extern CCRETVAL e_exchange_mark __P((Char));
+extern CCRETVAL e_last_item __P((Char));
+extern CCRETVAL v_cmd_mode __P((Char));
+extern CCRETVAL v_insert __P((Char));
+extern CCRETVAL v_replmode __P((Char));
+extern CCRETVAL v_replone __P((Char));
+extern CCRETVAL v_substline __P((Char));
+extern CCRETVAL v_substchar __P((Char));
+extern CCRETVAL v_add __P((Char));
+extern CCRETVAL v_addend __P((Char));
+extern CCRETVAL v_insbeg __P((Char));
+extern CCRETVAL v_chgtoend __P((Char));
+extern CCRETVAL e_killregion __P((Char));
+extern CCRETVAL e_killall __P((Char));
+extern CCRETVAL e_copyregion __P((Char));
+extern CCRETVAL e_tty_int __P((Char));
+extern CCRETVAL e_run_fg_editor __P((Char));
+extern CCRETVAL e_list_eof __P((Char));
+extern CCRETVAL e_expand_history __P((Char));
+extern CCRETVAL e_magic_space __P((Char));
+extern CCRETVAL e_list_glob __P((Char));
+extern CCRETVAL e_expand_glob __P((Char));
+extern CCRETVAL e_insovr __P((Char));
+extern CCRETVAL v_cm_complete __P((Char));
+extern CCRETVAL e_copyprev __P((Char));
+extern CCRETVAL v_change_case __P((Char));
+extern CCRETVAL e_expand __P((Char));
+extern CCRETVAL e_expand_vars __P((Char));
+extern CCRETVAL e_toggle_hist __P((Char));
+extern CCRETVAL e_load_average __P((Char));
+extern CCRETVAL v_delprev __P((Char));
+extern CCRETVAL v_delmeta __P((Char));
+extern CCRETVAL v_wordfwd __P((Char));
+extern CCRETVAL v_wordback __P((Char));
+extern CCRETVAL v_endword __P((Char));
+extern CCRETVAL v_eword __P((Char));
+extern CCRETVAL v_undo __P((Char));
+extern CCRETVAL v_ush_meta __P((Char));
+extern CCRETVAL v_dsh_meta __P((Char));
+extern CCRETVAL v_rsrch_fwd __P((Char));
+extern CCRETVAL v_rsrch_back __P((Char));
+extern CCRETVAL v_char_fwd __P((Char));
+extern CCRETVAL v_char_back __P((Char));
+extern CCRETVAL v_chgmeta __P((Char));
+extern CCRETVAL e_inc_fwd __P((Char));
+extern CCRETVAL e_inc_back __P((Char));
+extern CCRETVAL v_rchar_fwd __P((Char));
+extern CCRETVAL v_rchar_back __P((Char));
+extern CCRETVAL v_charto_fwd __P((Char));
+extern CCRETVAL v_charto_back __P((Char));
+extern CCRETVAL e_normalize_path __P((Char));
+extern CCRETVAL e_normalize_command __P((Char));
+extern CCRETVAL e_stuff_char __P((Char));
+extern CCRETVAL e_list_all __P((Char));
+extern CCRETVAL e_complete_all __P((Char));
+extern CCRETVAL e_complete_fwd __P((Char));
+extern CCRETVAL e_complete_back __P((Char));
+extern CCRETVAL e_dabbrev_expand __P((Char));
+extern CCRETVAL e_copy_to_clipboard __P((Char));
+extern CCRETVAL e_paste_from_clipboard __P((Char));
+extern CCRETVAL e_dosify_next __P((Char));
+extern CCRETVAL e_dosify_prev __P((Char));
+extern CCRETVAL e_page_up __P((Char));
+extern CCRETVAL e_page_down __P((Char));
+extern CCRETVAL e_yank_pop __P((Char));
/*
* ed.inputl.c
*/
extern int Inputl __P((void));
extern int GetNextChar __P((Char *));
+extern void UngetNextChar __P((Char));
extern void PushMacro __P((Char *));
/*
@@ -253,7 +254,7 @@ extern void ClearLines __P((void));
extern void ClearDisp __P((void));
extern void Refresh __P((void));
extern void RefCursor __P((void));
-extern void RefPlusOne __P((void));
+extern void RefPlusOne __P((int));
extern void PastBottom __P((void));
/*
@@ -268,7 +269,7 @@ extern void ResetXmap __P((void));
extern int DeleteXkey __P((CStr *));
extern void PrintXkey __P((CStr *));
extern int printOne __P((CStr *, XmapVal *, int));
-extern int parseescape __P((const Char **));
+extern eChar parseescape __P((const Char **));
extern unsigned char *unparsestring __P((CStr *, unsigned char *, Char *));
#endif /* _h_ed_decls */
diff --git a/contrib/tcsh/ed.defns.c b/contrib/tcsh/ed.defns.c
index f286c40ca8d9..ea2dbcd1c873 100644
--- a/contrib/tcsh/ed.defns.c
+++ b/contrib/tcsh/ed.defns.c
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/ed.defns.c,v 3.39 2002/03/08 17:36:45 christos Exp $ */
+/* $Header: /src/pub/tcsh/ed.defns.c,v 3.42 2005/03/03 16:49:15 kim Exp $ */
/*
* ed.defns.c: Editor function definitions and initialization
*/
@@ -32,7 +32,7 @@
*/
#include "sh.h"
-RCSID("$Id: ed.defns.c,v 3.39 2002/03/08 17:36:45 christos Exp $")
+RCSID("$Id: ed.defns.c,v 3.42 2005/03/03 16:49:15 kim Exp $")
#include "ed.h"
@@ -1812,22 +1812,22 @@ CheckMaps()
#endif
-bool MapsAreInited = 0;
-bool NLSMapsAreInited = 0;
-bool NoNLSRebind;
+int MapsAreInited = 0;
+int NLSMapsAreInited = 0;
+int NoNLSRebind;
void
ed_InitNLSMaps()
{
- register int i;
+ int i;
if (AsciiOnly)
return;
if (NoNLSRebind)
return;
for (i = 0200; i <= 0377; i++) {
- if (Isprint(i)) {
- CcKeyMap[i] = F_INSERT;
+ if (Isprint(CTL_ESC(i))) {
+ CcKeyMap[CTL_ESC(i)] = F_INSERT;
}
}
NLSMapsAreInited = 1;
@@ -1842,13 +1842,13 @@ ed_InitMetaBindings()
KEYCMD *map;
map = CcKeyMap;
- for (i = 0; i <= 0377 && CcKeyMap[i] != F_METANEXT; i++)
+ for (i = 0; i <= 0377 && CcKeyMap[CTL_ESC(i)] != F_METANEXT; i++)
continue;
if (i > 0377) {
- for (i = 0; i <= 0377 && CcAltMap[i] != F_METANEXT; i++)
+ for (i = 0; i <= 0377 && CcAltMap[CTL_ESC(i)] != F_METANEXT; i++)
continue;
if (i > 0377) {
- i = CTL_ESC('\033');
+ i = '\033';
if (VImode)
map = CcAltMap;
}
@@ -1856,18 +1856,14 @@ ed_InitMetaBindings()
map = CcAltMap;
}
}
- buf[0] = (Char) i;
+ buf[0] = (Char)CTL_ESC(i);
buf[2] = 0;
cstr.buf = buf;
cstr.len = 2;
for (i = 0200; i <= 0377; i++) {
- if (map[i] != F_INSERT && map[i] != F_UNASSIGNED && map[i] != F_XKEY) {
-#ifdef IS_ASCII
- buf[1] = i & ASCII;
-#else
- buf[1] = _toebcdic[_toascii[i] & ASCII];
-#endif
- AddXkey(&cstr, XmapCmd((int) map[i]), XK_CMD);
+ if (map[CTL_ESC(i)] != F_INSERT && map[CTL_ESC(i)] != F_UNASSIGNED && map[CTL_ESC(i)] != F_XKEY) {
+ buf[1] = CTL_ESC(i & ASCII);
+ AddXkey(&cstr, XmapCmd((int) map[CTL_ESC(i)]), XK_CMD);
}
}
map[buf[0]] = F_XKEY;
@@ -1876,7 +1872,7 @@ ed_InitMetaBindings()
void
ed_InitVIMaps()
{
- register int i;
+ int i;
VImode = 1;
ResetXmap();
@@ -1948,7 +1944,7 @@ ed_InitMaps()
{
KEYCMD temp[NT_NUM_KEYS];
static KEYCMD *const list[3] = { CcEmacsMap, CcViMap, CcViCmdMap };
- register int i, table;
+ int i, table;
for (table=0; table<3; ++table)
{
diff --git a/contrib/tcsh/ed.h b/contrib/tcsh/ed.h
index ddc80ba79fd0..fba6299c85e7 100644
--- a/contrib/tcsh/ed.h
+++ b/contrib/tcsh/ed.h
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/ed.h,v 3.33 2002/07/06 22:28:13 christos Exp $ */
+/* $Header: /src/pub/tcsh/ed.h,v 3.44 2005/03/05 03:20:15 christos Exp $ */
/*
* ed.h: Editor declarations and globals
*/
@@ -54,12 +54,12 @@
#define KEYCMD unsigned char /* size needed to index into CcFuncTbl */
/* Must be unsigned */
-typedef CCRETVAL(*PFCmd) __P((int)); /* pointer to function returning CCRETVAL */
+typedef CCRETVAL(*PFCmd) __P((Char)); /* pointer to function returning CCRETVAL */
struct KeyFuncs { /* for the "bind" shell command */
- char *name; /* function name for bind command */
+ const char *name; /* function name for bind command */
int func; /* function numeric value */
- char *desc; /* description of function */
+ const char *desc; /* description of function */
};
extern PFCmd CcFuncTbl[]; /* table of available commands */
@@ -149,21 +149,28 @@ EXTERN int HistWhich; /* Hist_num is saved in this */
EXTERN char Expand; /* true if we are expanding a line */
extern Char HistLit; /* true if history lines are shown literal */
EXTERN Char CurrentHistLit; /* Literal status of current show history line */
+extern int Tty_raw_mode;
/*
* These are truly extern
*/
extern int MacroLvl;
+extern Char *litptr; /* Entries start at offsets divisible by LIT_FACTOR */
+#define LIT_FACTOR 4
+extern int didsetty;
EXTERN Char *KeyMacro[MAXMACROLEVELS];
+/* CHAR_DBWIDTH in Display and Vdisplay means the non-first column of a character
+ that is wider than one "regular" position. The cursor should never point
+ in the middle of a multiple-column character. */
EXTERN Char **Display; /* display buffer seed vector */
EXTERN int CursorV, /* real cursor vertical (line) */
CursorH, /* real cursor horisontal (column) */
TermV, /* number of real screen lines
* (sizeof(DisplayBuf) / width */
TermH; /* screen width */
-EXTERN Char **Vdisplay; /* new buffer */
+EXTERN Char **Vdisplay; /* new buffer */
/* Variables that describe terminal ability */
EXTERN int T_Lines, T_Cols; /* Rows and Cols of the terminal */
@@ -207,13 +214,35 @@ EXTERN Char T_HasMeta; /* true if we have a meta key */
# define M_NN 3
#endif /* TERMIO */
typedef struct {
- char *t_name;
- int t_setmask;
- int t_clrmask;
+ const char *t_name;
+ unsigned int t_setmask;
+ unsigned int t_clrmask;
} ttyperm_t[NN_IO][M_NN];
extern ttyperm_t ttylist;
#include "ed.term.h"
#include "ed.decls.h"
+#ifndef POSIX
+/*
+ * We don't prototype these, cause some systems have them wrong!
+ */
+extern int tgetent __P(());
+extern char *tgetstr __P(());
+extern int tgetflag __P(());
+extern int tgetnum __P(());
+extern char *tgoto __P(());
+# define PUTPURE putpure
+# define PUTRAW putraw
+#else
+extern int tgetent __P((char *, const char *));
+extern char *tgetstr __P((const char *, char **));
+extern int tgetflag __P((const char *));
+extern int tgetnum __P((const char *));
+extern char *tgoto __P((const char *, int, int));
+extern void tputs __P((const char *, int, void (*)(int)));
+# define PUTPURE ((void (*)__P((int))) putpure)
+# define PUTRAW ((void (*)__P((int))) putraw)
+#endif
+
#endif /* _h_ed */
diff --git a/contrib/tcsh/ed.init.c b/contrib/tcsh/ed.init.c
index b293c19d9122..192241a8e10c 100644
--- a/contrib/tcsh/ed.init.c
+++ b/contrib/tcsh/ed.init.c
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/ed.init.c,v 3.48 2002/07/06 22:28:13 christos Exp $ */
+/* $Header: /src/pub/tcsh/ed.init.c,v 3.52 2005/01/18 20:24:50 christos Exp $ */
/*
* ed.init.c: Editor initializations
*/
@@ -32,7 +32,7 @@
*/
#include "sh.h"
-RCSID("$Id: ed.init.c,v 3.48 2002/07/06 22:28:13 christos Exp $")
+RCSID("$Id: ed.init.c,v 3.52 2005/01/18 20:24:50 christos Exp $")
#include "ed.h"
#include "tc.h"
@@ -50,12 +50,11 @@ static unsigned char vdisable; /* The value of _POSIX_VDISABLE from
int Tty_eight_bit = -1; /* does the tty handle eight bits */
-extern bool GotTermCaps;
+extern int GotTermCaps;
static ttydata_t extty, edtty, tstty;
#define qutty tstty
-extern int insource;
#define SHTTY (insource ? OLDSTD : SHIN)
#define uc unsigned char
@@ -127,9 +126,10 @@ check_window_size(force)
#else /* BSDSIGS */
(void) sigrelse(SIG_WINDOW);
#endif /* BSDSIGS */
+ windowchg = 0;
}
-sigret_t
+RETSIGTYPE
/*ARGSUSED*/
window_change(snum)
int snum;
@@ -141,9 +141,6 @@ int snum;
sigset(snum, window_change);
#endif /* UNRELSIGS */
windowchg = 1;
-#ifndef SIGVOID
- return (snum);
-#endif
}
#endif /* SIG_WINDOW */
@@ -512,7 +509,6 @@ Rawmode()
# endif /* TERMIO || POSIX */
{
- extern int didsetty;
int i;
tty_getchar(&tstty, ttychars[TS_IO]);
diff --git a/contrib/tcsh/ed.inputl.c b/contrib/tcsh/ed.inputl.c
index 68da69dd23b2..fb87f8b02dd8 100644
--- a/contrib/tcsh/ed.inputl.c
+++ b/contrib/tcsh/ed.inputl.c
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/ed.inputl.c,v 3.51 2002/06/25 19:02:11 christos Exp $ */
+/* $Header: /src/pub/tcsh/ed.inputl.c,v 3.57 2004/12/25 21:15:06 christos Exp $ */
/*
* ed.inputl.c: Input line handling.
*/
@@ -32,7 +32,7 @@
*/
#include "sh.h"
-RCSID("$Id: ed.inputl.c,v 3.51 2002/06/25 19:02:11 christos Exp $")
+RCSID("$Id: ed.inputl.c,v 3.57 2004/12/25 21:15:06 christos Exp $")
#include "ed.h"
#include "ed.defns.h" /* for the function names */
@@ -42,9 +42,7 @@ RCSID("$Id: ed.inputl.c,v 3.51 2002/06/25 19:02:11 christos Exp $")
/* ed.inputl -- routines to get a single line from the input. */
-extern bool tellwhat;
-extern bool MapsAreInited;
-extern bool Tty_raw_mode;
+extern int MapsAreInited;
/* mismatched first character */
static Char mismatch[] =
@@ -57,7 +55,7 @@ static int CompleteLine __P((void));
static void RunCommand __P((Char *));
static void doeval1 __P((Char **));
-static bool rotate = 0;
+static int rotate = 0;
static int
@@ -81,7 +79,6 @@ Inputl()
{
CCRETVAL retval;
KEYCMD cmdnum = 0;
- extern KEYCMD NumFuns;
unsigned char tch; /* the place where read() goes */
Char ch;
int num; /* how many chars we have read at NL */
@@ -649,7 +646,7 @@ RunCommand(str)
static int
GetNextCommand(cmdnum, ch)
KEYCMD *cmdnum;
- register Char *ch;
+ Char *ch;
{
KEYCMD cmd = 0;
int num;
@@ -662,6 +659,8 @@ GetNextCommand(cmdnum, ch)
if (
#ifdef DSPMBYTE
_enable_mbdisp &&
+#else
+ MB_LEN_MAX == 1 &&
#endif
!adrof(STRnokanji) && (*ch & META)) {
MetaNext = 0;
@@ -680,7 +679,11 @@ GetNextCommand(cmdnum, ch)
if (*ch < NT_NUM_KEYS)
cmd = CurrentKeyMap[*ch];
else
+#ifdef WINNT_NATIVE
cmd = CurrentKeyMap[(unsigned char) *ch];
+#else
+ cmd = F_INSERT;
+#endif
if (cmd == F_XKEY) {
XmapVal val;
CStr cstr;
@@ -708,14 +711,30 @@ GetNextCommand(cmdnum, ch)
return OKCMD;
}
+static Char ungetchar;
+static int haveungetchar;
+
+void
+UngetNextChar(Char cp)
+{
+ ungetchar = cp;
+ haveungetchar = 1;
+}
+
int
GetNextChar(cp)
- register Char *cp;
+ Char *cp;
{
- register int num_read;
+ int num_read;
int tried = 0;
- unsigned char tcp;
+ char cbuf[MB_LEN_MAX];
+ size_t cbp;
+ if (haveungetchar) {
+ haveungetchar = 0;
+ *cp = ungetchar;
+ return 1;
+ }
for (;;) {
if (MacroLvl < 0) {
if (!Load_input_line())
@@ -738,32 +757,45 @@ GetNextChar(cp)
#ifdef WINNT_NATIVE
__nt_want_vcode = 1;
#endif /* WINNT_NATIVE */
- while ((num_read = read(SHIN, (char *) &tcp, 1)) == -1) {
- if (errno == EINTR)
- continue;
- if (!tried && fixio(SHIN, errno) != -1)
- tried = 1;
- else {
-#ifdef convex
- /* need to print error message in case the file is migrated */
- if (errno != EINTR)
- stderror(ERR_SYSTEM, progname, strerror(errno));
-#endif /* convex */
-#ifdef WINNT_NATIVE
- __nt_want_vcode = 0;
-#endif /* WINNT_NATIVE */
- *cp = '\0';
- return -1;
+#ifdef SIG_WINDOW
+ if (windowchg)
+ (void) check_window_size(0); /* for window systems */
+#endif /* SIG_WINDOW */
+ cbp = 0;
+ for (;;) {
+ while ((num_read = read(SHIN, cbuf + cbp, 1)) == -1) {
+ if (errno == EINTR)
+ continue;
+ if (!tried && fixio(SHIN, errno) != -1)
+ tried = 1;
+ else {
+# ifdef convex
+ /* need to print error message in case the file is migrated */
+ if (errno != EINTR)
+ stderror(ERR_SYSTEM, progname, strerror(errno));
+# endif /* convex */
+# ifdef WINNT_NATIVE
+ __nt_want_vcode = 0;
+# endif /* WINNT_NATIVE */
+ *cp = '\0'; /* Loses possible partial character */
+ return -1;
+ }
}
+ cbp++;
+ if (normal_mbtowc(cp, cbuf, cbp) == -1) {
+ reset_mbtowc();
+ if (cbp < MB_LEN_MAX)
+ continue; /* Maybe a partial character */
+ /* And drop the following bytes, if any */
+ *cp = (unsigned char)*cbuf | INVALID_BYTE;
+ }
+ break;
}
#ifdef WINNT_NATIVE
+ /* This is the part that doesn't work with WIDE_STRINGS */
if (__nt_want_vcode == 2)
*cp = __nt_vcode;
- else
- *cp = tcp;
__nt_want_vcode = 0;
-#else
- *cp = tcp;
#endif /* WINNT_NATIVE */
return num_read;
}
diff --git a/contrib/tcsh/ed.refresh.c b/contrib/tcsh/ed.refresh.c
index 74028dbeba39..46e7622aaa8b 100644
--- a/contrib/tcsh/ed.refresh.c
+++ b/contrib/tcsh/ed.refresh.c
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/ed.refresh.c,v 3.30 2003/02/08 20:03:25 christos Exp $ */
+/* $Header: /src/pub/tcsh/ed.refresh.c,v 3.39 2005/02/15 21:09:02 christos Exp $ */
/*
* ed.refresh.c: Lower level screen refreshing functions
*/
@@ -32,7 +32,7 @@
*/
#include "sh.h"
-RCSID("$Id: ed.refresh.c,v 3.30 2003/02/08 20:03:25 christos Exp $")
+RCSID("$Id: ed.refresh.c,v 3.39 2005/02/15 21:09:02 christos Exp $")
#include "ed.h"
/* #define DEBUG_UPDATE */
@@ -41,12 +41,13 @@ RCSID("$Id: ed.refresh.c,v 3.30 2003/02/08 20:03:25 christos Exp $")
/* refresh.c -- refresh the current set of lines on the screen */
-Char *litptr[256];
+Char *litptr;
static int vcursor_h, vcursor_v;
static int rprompt_h, rprompt_v;
-static void Draw __P((int));
-static void Vdraw __P((int));
+static int MakeLiteral __P((Char *, int, Char));
+static int Draw __P((Char *, int));
+static void Vdraw __P((Char, int));
static void RefreshPromptpart __P((Char *));
static void update_line __P((Char *, Char *, int));
static void str_insert __P((Char *, int, int, Char *, int));
@@ -57,26 +58,27 @@ static
#else
extern
#endif
- void PutPlusOne __P((int));
+ void PutPlusOne __P((Char, int));
static void cpy_pad_spaces __P((Char *, Char *, int));
-#if defined(DSPMBYTE)
-static Char *update_line_fix_mbyte_point __P((Char *, Char *, int));
-#endif
#if defined(DEBUG_UPDATE) || defined(DEBUG_REFRESH) || defined(DEBUG_LITERAL)
static void dprintf __P((char *, ...));
#ifdef DEBUG_UPDATE
-static void dprintstr __P((char *, Char *, Char *));
+static void dprintstr __P((char *, const Char *, const Char *));
static void
dprintstr(str, f, t)
char *str;
-Char *f, *t;
+const Char *f, *t;
{
dprintf("%s:\"", str);
- while (f < t)
- dprintf("%c", *f++ & ASCII);
+ while (f < t) {
+ if (*f & ~ASCII)
+ dprintf("[%x]", *f++);
+ else
+ dprintf("%c", *f++ & ASCII);
+ }
dprintf("\"\r\n");
-}
+}
#endif /* DEBUG_UPDATE */
/* dprintf():
@@ -85,7 +87,7 @@ Char *f, *t;
* debugging cause you'll mangle up the file descriptors!
*/
static void
-#ifdef FUNCPROTO
+#ifdef PROTOTYPES
dprintf(char *fmt, ...)
#else
dprintf(va_list)
@@ -98,7 +100,7 @@ dprintf(va_list)
if ((dtty = getenv("DEBUGTTY"))) {
int o;
va_list va;
-#ifdef FUNCPROTO
+#ifdef PROTOTYPES
va_start(va, fmt);
#else
char *fmt;
@@ -119,101 +121,174 @@ dprintf(va_list)
}
#endif /* DEBUG_UPDATE || DEBUG_REFRESH || DEBUG_LITERAL */
-static void
-Draw(c) /* draw c, expand tabs, ctl chars */
- register int c;
-{
- register Char ch = c & CHAR;
-
- if (Isprint(ch)) {
- Vdraw(c);
- return;
- }
- /* from wolman%crltrx.DEC@decwrl.dec.com (Alec Wolman) */
- if (ch == '\n') { /* expand the newline */
- /*
- * Don't force a newline if Vdraw does it (i.e. we're at end of line)
- * - or we will get two newlines and possibly garbage in between
- */
- int oldv = vcursor_v;
+static int litlen = 0, litalloc = 0;
- Vdraw('\0'); /* assure end of line */
- if (oldv == vcursor_v) {
- vcursor_h = 0; /* reset cursor pos */
- vcursor_v++;
+static int MakeLiteral(str, len, addlit)
+ Char *str;
+ int len;
+ Char addlit;
+{
+ int i, addlitlen = 0;
+ Char *addlitptr = 0;
+ if (addlit) {
+ if ((addlit & LITERAL) != 0) {
+ addlitptr = litptr + (addlit & ~LITERAL) * LIT_FACTOR;
+ addlitlen = Strlen(addlitptr);
+ } else {
+ addlitptr = &addlit;
+ addlitlen = 1;
}
- return;
+ for (i = 0; i < litlen; i += LIT_FACTOR)
+ if (!Strncmp(addlitptr, litptr + i, addlitlen) && !Strncmp(str, litptr + i + addlitlen, len) && litptr[i + addlitlen + len] == 0)
+ return (i / LIT_FACTOR) | LITERAL;
+ } else {
+ addlitlen = 0;
+ for (i = 0; i < litlen; i += LIT_FACTOR)
+ if (!Strncmp(str, litptr + i, len) && litptr[i + len] == 0)
+ return (i / LIT_FACTOR) | LITERAL;
}
- if (ch == '\t') { /* expand the tab */
- for (;;) {
- Vdraw(' ');
- if ((vcursor_h & 07) == 0)
- break; /* go until tab stop */
- }
+ if (litlen + addlitlen + len + 1 + (LIT_FACTOR - 1) > litalloc) {
+ Char *newlitptr;
+ int add = 256;
+ while (len + addlitlen + 1 + (LIT_FACTOR - 1) > add)
+ add *= 2;
+ if (litptr)
+ newlitptr = (Char *)xrealloc(litptr, (litalloc + add) * sizeof(Char));
+ else
+ newlitptr = (Char *)xmalloc((litalloc + add) * sizeof(Char));
+ if (!newlitptr)
+ return '?';
+ litptr = newlitptr;
+ litalloc += add;
+ if (addlitptr && addlitptr != &addlit)
+ addlitptr = litptr + (addlit & ~LITERAL) * LIT_FACTOR;
}
- else if (Iscntrl(ch)) {
+ i = litlen / LIT_FACTOR;
+ if (i >= LITERAL || i == CHAR_DBWIDTH)
+ return '?';
+ if (addlitptr) {
+ Strncpy(litptr + litlen, addlitptr, addlitlen);
+ litlen += addlitlen;
+ }
+ Strncpy(litptr + litlen, str, len);
+ litlen += len;
+ do
+ litptr[litlen++] = 0;
+ while (litlen % LIT_FACTOR);
+ return i | LITERAL;
+}
+
+static int
+Draw(cp, nocomb) /* draw char at cp, expand tabs, ctl chars */
+ Char *cp;
+ int nocomb;
+{
+ int l, w, i, lv, lh;
+ Char ch, attr;
+ NLSChar c;
+
+ attr = *cp & ~CHAR;
+ l = NLSFrom(cp, NLSZEROT, &c);
+ w = NLSClassify(c, nocomb);
+ switch (w) {
+ case NLSCLASS_NL:
+ Vdraw('\0', 0); /* assure end of line */
+ vcursor_h = 0; /* reset cursor pos */
+ vcursor_v++;
+ break;
+ case NLSCLASS_TAB:
+ do {
+ Vdraw(' ', 1);
+ } while ((vcursor_h & 07) != 0);
+ break;
+ case NLSCLASS_CTRL:
+ Vdraw('^' | attr, 1);
+ if (c == CTL_ESC('\177')) {
+ Vdraw('?' | attr, 1);
+ } else {
#ifdef IS_ASCII
- Vdraw('^');
- if (ch == CTL_ESC('\177')) {
- Vdraw('?');
- }
- else {
- /* uncontrolify it; works only for iso8859-1 like sets */
- Vdraw((c | 0100));
+ /* uncontrolify it; works only for iso8859-1 like sets */
+ Vdraw(c | 0100 | attr, 1);
#else
- if (ch == CTL_ESC('\177')) {
- Vdraw('^');
- Vdraw('?');
- }
- else {
- if (Isupper(_toebcdic[_toascii[c]|0100])
- || strchr("@[\\]^_", _toebcdic[_toascii[c]|0100]) != NULL)
- {
- Vdraw('^');
- Vdraw(_toebcdic[_toascii[c]|0100]);
+ Vdraw(_toebcdic[_toascii[c]|0100] | attr, 1);
+#endif
}
- else
- {
- Vdraw('\\');
- Vdraw(((c >> 6) & 7) + '0');
- Vdraw(((c >> 3) & 7) + '0');
- Vdraw((c & 7) + '0');
+ break;
+ case NLSCLASS_ILLEGAL:
+ ch = *cp & CHAR;
+ Vdraw('\\' | attr, 1);
+ Vdraw((((ch >> 6) & 7) + '0') | attr, 1);
+ Vdraw((((ch >> 3) & 7) + '0') | attr, 1);
+ Vdraw(((ch & 7) + '0') | attr, 1);
+ break;
+ case NLSCLASS_ILLEGAL2:
+ case NLSCLASS_ILLEGAL3:
+ case NLSCLASS_ILLEGAL4:
+ Vdraw('\\' | attr, 1);
+ Vdraw('U' | attr, 1);
+ Vdraw('+' | attr, 1);
+ for (i = 8 * NLSCLASS_ILLEGAL_SIZE(w) - 4; i >= 0; i -= 4)
+ Vdraw("0123456789ABCDEF"[(c >> i) & 15] | attr, 1);
+ break;
+ case 0:
+ lv = vcursor_v;
+ lh = vcursor_h;
+ for (;;) {
+ lh--;
+ if (lh < 0) {
+ lv--;
+ if (lv < 0)
+ break;
+ lh = Strlen(Vdisplay[lv]) - 1;
+ }
+ if (Vdisplay[lv][lh] != CHAR_DBWIDTH)
+ break;
}
-#endif
- }
- }
-#ifdef KANJI
- else if (
-#ifdef DSPMBYTE
- _enable_mbdisp &&
-#endif
- !adrof(STRnokanji)) {
- Vdraw(c);
- return;
- }
-#endif
- else {
- Vdraw('\\');
- Vdraw(((c >> 6) & 7) + '0');
- Vdraw(((c >> 3) & 7) + '0');
- Vdraw((c & 7) + '0');
+ if (lv < 0) {
+ int l2 = l;
+ for (; l2-- > 0; cp++) {
+ ch = *cp & CHAR;
+ Vdraw('\\' | attr, 1);
+ Vdraw((((ch >> 6) & 7) + '0') | attr, 1);
+ Vdraw((((ch >> 3) & 7) + '0') | attr, 1);
+ Vdraw(((ch & 7) + '0') | attr, 1);
+ }
+ return l;
+ }
+ Vdisplay[lv][lh] = MakeLiteral(cp, l, Vdisplay[lv][lh]);
+ break;
+ default:
+ if (l > 1)
+ Vdraw(MakeLiteral(cp, l, 0), w);
+ else
+ Vdraw(*cp, w);
+ break;
}
+ return l;
}
static void
-Vdraw(c) /* draw char c onto V lines */
- register int c;
+Vdraw(c, width) /* draw char c onto V lines */
+ Char c;
+ int width;
{
#ifdef DEBUG_REFRESH
# ifdef SHORT_STRINGS
- dprintf("Vdrawing %6.6o '%c'\r\n", c, c & ASCII);
+ dprintf("Vdrawing %6.6o '%c' %d\r\n", (unsigned)c, (int)(c & ASCII), width);
# else
- dprintf("Vdrawing %3.3o '%c'\r\n", c, c);
+ dprintf("Vdrawing %3.3o '%c' %d\r\n", (unsigned)c, (int)c, width);
# endif /* SHORT_STRNGS */
#endif /* DEBUG_REFRESH */
+ /* Hopefully this is what all the terminals do with multi-column characters
+ that "span line breaks". */
+ while (vcursor_h + width > TermH)
+ Vdraw(' ', 1);
Vdisplay[vcursor_v][vcursor_h] = (Char) c;
- vcursor_h++; /* advance to next place */
+ if (width)
+ vcursor_h++; /* advance to next place */
+ while (--width > 0)
+ Vdisplay[vcursor_v][vcursor_h++] = CHAR_DBWIDTH;
if (vcursor_h >= TermH) {
Vdisplay[vcursor_v][TermH] = '\0'; /* assure end of line */
vcursor_h = 0; /* reset it. */
@@ -236,27 +311,21 @@ static void
RefreshPromptpart(buf)
Char *buf;
{
- register Char *cp;
- static unsigned int litnum = 0;
- if (buf == NULL)
- {
- litnum = 0;
- return;
- }
+ Char *cp;
+ NLSChar c;
+ int l, w;
- for (cp = buf; *cp; cp++) {
+ for (cp = buf; *cp; ) {
if (*cp & LITERAL) {
- if (litnum < (sizeof(litptr) / sizeof(litptr[0]))) {
- litptr[litnum] = cp;
-#ifdef DEBUG_LITERAL
- dprintf("litnum = %d, litptr = %x:\r\n",
- litnum, litptr[litnum]);
-#endif /* DEBUG_LITERAL */
- }
+ Char *litstart = cp;
while (*cp & LITERAL)
cp++;
- if (*cp)
- Vdraw((int) (litnum++ | LITERAL));
+ if (*cp) {
+ l = NLSFrom(cp, NLSZEROT, &c);
+ w = NLSWidth(c);
+ Vdraw(MakeLiteral(litstart, cp + l - litstart, 0), w);
+ cp += l;
+ }
else {
/*
* XXX: This is a bug, we lose the last literal, if it is not
@@ -266,7 +335,7 @@ RefreshPromptpart(buf)
}
}
else
- Draw(*cp);
+ cp += Draw(cp, cp == buf);
}
}
@@ -285,8 +354,8 @@ int OldvcV = 0;
void
Refresh()
{
- register int cur_line;
- register Char *cp;
+ int cur_line;
+ Char *cp;
int cur_h, cur_v = 0, new_vcv;
int rhdiff;
Char oldgetting;
@@ -301,7 +370,6 @@ Refresh()
/* reset the Vdraw cursor, temporarily draw rprompt to calculate its size */
vcursor_h = 0;
vcursor_v = 0;
- RefreshPromptpart(NULL);
RefreshPromptpart(RPromptBuf);
rprompt_h = vcursor_h;
rprompt_v = vcursor_v;
@@ -309,17 +377,17 @@ Refresh()
/* reset the Vdraw cursor, draw prompt */
vcursor_h = 0;
vcursor_v = 0;
- RefreshPromptpart(NULL);
RefreshPromptpart(PromptBuf);
cur_h = -1; /* set flag in case I'm not set */
/* draw the current input buffer */
- for (cp = InputBuf; (cp < LastChar); cp++) {
- if (cp == Cursor) {
+ for (cp = InputBuf; (cp < LastChar); ) {
+ if (cp >= Cursor && cur_h == -1) {
cur_h = vcursor_h; /* save for later */
cur_v = vcursor_v;
+ Cursor = cp;
}
- Draw(*cp);
+ cp += Draw(cp, cp == InputBuf);
}
if (cur_h == -1) { /* if I haven't been set yet, I'm at the end */
@@ -335,7 +403,7 @@ Refresh()
* character gap to the input buffer.
*/
while (--rhdiff > 0) /* pad out with spaces */
- Draw(' ');
+ Vdraw(' ', 1);
RefreshPromptpart(RPromptBuf);
}
else {
@@ -344,9 +412,9 @@ Refresh()
}
new_vcv = vcursor_v; /* must be done BEFORE the NUL is written */
- Vdraw('\0'); /* put NUL on end */
+ Vdraw('\0', 1); /* put NUL on end */
-#ifdef DEBUG_REFRESH
+#if defined (DEBUG_REFRESH)
dprintf("TermH=%d, vcur_h=%d, vcur_v=%d, Vdisplay[0]=\r\n:%80.80s:\r\n",
TermH, vcursor_h, vcursor_v, short2str(Vdisplay[0]));
#endif /* DEBUG_REFRESH */
@@ -368,10 +436,6 @@ Refresh()
* screen line, it won't be a NUL or some old leftover stuff.
*/
cpy_pad_spaces(Display[cur_line], Vdisplay[cur_line], TermH);
-#ifdef notdef
- (void) Strncpy(Display[cur_line], Vdisplay[cur_line], (size_t) TermH);
- Display[cur_line][TermH] = '\0'; /* just in case */
-#endif
}
#ifdef DEBUG_REFRESH
dprintf("\r\nvcursor_v = %d, OldvcV = %d, cur_line = %d\r\n",
@@ -421,12 +485,12 @@ PastBottom()
maximum length of d is dlen */
static void
str_insert(d, dat, dlen, s, num)
- register Char *d;
- register int dat, dlen;
- register Char *s;
- register int num;
+ Char *d;
+ int dat, dlen;
+ Char *s;
+ int num;
{
- register Char *a, *b;
+ Char *a, *b;
if (num <= 0)
return;
@@ -467,10 +531,10 @@ str_insert(d, dat, dlen, s, num)
/* delete num characters d at dat, maximum length of d is dlen */
static void
str_delete(d, dat, dlen, num)
- register Char *d;
- register int dat, dlen, num;
+ Char *d;
+ int dat, dlen, num;
{
- register Char *a, *b;
+ Char *a, *b;
if (num <= 0)
return;
@@ -500,35 +564,14 @@ str_delete(d, dat, dlen, num)
static void
str_cp(a, b, n)
- register Char *a, *b;
- register int n;
+ Char *a, *b;
+ int n;
{
while (n-- && *b)
*a++ = *b++;
}
-#if defined(DSPMBYTE) /* BY TAGA Nayuta VERY THANKS */
-static Char *
-update_line_fix_mbyte_point(start, target, d)
- Char *start, *target;
- int d;
-{
- if (_enable_mbdisp) {
- while (*start) {
- if (target == start)
- break;
- if (target < start)
- return target + d;
- if (Ismbyte1(*start) && Ismbyte2(*(start + 1)))
- start++;
- start++;
- }
- }
- return target;
-}
-#endif
-
/* ****************************************************************
update_line() is based on finding the middle difference of each line
on the screen; vis:
@@ -555,16 +598,16 @@ new: eddie> Oh, my little buggy says to me, as lurgid as
static void /* could be changed to make it smarter */
update_line(old, new, cur_line)
- register Char *old, *new;
+ Char *old, *new;
int cur_line;
{
- register Char *o, *n, *p, c;
- Char *ofd, *ols, *oe, *nfd, *nls, *ne;
- Char *osb, *ose, *nsb, *nse;
+ Char *o, *n, *p, c;
+ Char *ofd, *ols, *oe, *nfd, *nls, *ne;
+ Char *osb, *ose, *nsb, *nse;
int fx, sx;
/*
- * find first diff
+ * find first diff (won't be CHAR_DBWIDTH in either line)
*/
for (o = old, n = new; *o && (*o == *n); o++, n++)
continue;
@@ -615,8 +658,16 @@ update_line(old, new, cur_line)
*/
while ((o > ofd) && (n > nfd) && (*--o == *--n))
continue;
- ols = ++o;
- nls = ++n;
+ if (*o != *n) {
+ o++;
+ n++;
+ }
+ while (*o == CHAR_DBWIDTH) {
+ o++;
+ n++;
+ }
+ ols = o;
+ nls = n;
/*
* find same begining and same end
@@ -785,17 +836,6 @@ update_line(old, new, cur_line)
*/
MoveToLine(cur_line);
-#if defined(DSPMBYTE) /* BY TAGA Nayuta VERY THANKS */
- ofd = update_line_fix_mbyte_point(old, ofd, -1);
- osb = update_line_fix_mbyte_point(old, osb, 1);
- ose = update_line_fix_mbyte_point(old, ose, -1);
- ols = update_line_fix_mbyte_point(old, ols, 1);
- nfd = update_line_fix_mbyte_point(new, nfd, -1);
- nsb = update_line_fix_mbyte_point(new, nsb, 1);
- nse = update_line_fix_mbyte_point(new, nse, -1);
- nls = update_line_fix_mbyte_point(new, nls, 1);
-#endif
-
/*
* at this point we have something like this:
*
@@ -1094,10 +1134,10 @@ update_line(old, new, cur_line)
static void
cpy_pad_spaces(dst, src, width)
- register Char *dst, *src;
- register int width;
+ Char *dst, *src;
+ int width;
{
- register int i;
+ int i;
for (i = 0; i < width; i++) {
if (*src == (Char) 0)
@@ -1115,87 +1155,81 @@ cpy_pad_spaces(dst, src, width)
void
RefCursor()
{ /* only move to new cursor pos */
- register Char *cp, c;
- register int h, th, v;
+ Char *cp;
+ NLSChar c;
+ int l, w, h, th, v;
/* first we must find where the cursor is... */
h = 0;
v = 0;
th = TermH; /* optimize for speed */
- for (cp = PromptBuf; *cp; cp++) { /* do prompt */
- if (*cp & LITERAL)
+ for (cp = PromptBuf; *cp; ) { /* do prompt */
+ if (*cp & LITERAL) {
+ cp++;
continue;
- c = *cp & CHAR; /* extra speed plus strip the inverse */
- h++; /* all chars at least this long */
-
- /* from wolman%crltrx.DEC@decwrl.dec.com (Alec Wolman) */
- /* lets handle newline as part of the prompt */
-
- if (c == '\n') {
- h = 0;
- v++;
}
- else {
- if (c == '\t') { /* if a tab, to next tab stop */
- while (h & 07) {
- h++;
- }
- }
- else if (Iscntrl(c)) { /* if control char */
- h++;
- if (h > th) { /* if overflow, compensate */
- h = 1;
- v++;
- }
- }
- else if (!Isprint(c)) {
- h += 3;
- if (h > th) { /* if overflow, compensate */
- h = h - th;
- v++;
- }
- }
+ l = NLSFrom(cp, NLSZEROT, &c);
+ w = NLSClassify(c, cp == PromptBuf);
+ cp += l;
+ switch(w) {
+ case NLSCLASS_NL:
+ h = 0;
+ v++;
+ break;
+ case NLSCLASS_TAB:
+ while (++h & 07)
+ ;
+ break;
+ case NLSCLASS_CTRL:
+ h += 2;
+ break;
+ case NLSCLASS_ILLEGAL:
+ h += 4;
+ break;
+ case NLSCLASS_ILLEGAL2:
+ case NLSCLASS_ILLEGAL3:
+ case NLSCLASS_ILLEGAL4:
+ h += 3 + 2 * NLSCLASS_ILLEGAL_SIZE(w);
+ break;
+ default:
+ h += w;
}
-
if (h >= th) { /* check, extra long tabs picked up here also */
- h = 0;
+ h -= th;
v++;
}
}
- for (cp = InputBuf; cp < Cursor; cp++) { /* do input buffer to Cursor */
- c = *cp & CHAR; /* extra speed plus strip the inverse */
- h++; /* all chars at least this long */
-
- if (c == '\n') { /* handle newline in data part too */
- h = 0;
- v++;
- }
- else {
- if (c == '\t') { /* if a tab, to next tab stop */
- while (h & 07) {
- h++;
- }
- }
- else if (Iscntrl(c)) { /* if control char */
- h++;
- if (h > th) { /* if overflow, compensate */
- h = 1;
- v++;
- }
- }
- else if (!Isprint(c)) {
- h += 3;
- if (h > th) { /* if overflow, compensate */
- h = h - th;
- v++;
- }
- }
+ for (cp = InputBuf; cp < Cursor;) { /* do input buffer to Cursor */
+ l = NLSFrom(cp, Cursor - cp, &c);
+ w = NLSClassify(c, cp == InputBuf);
+ cp += l;
+ switch(w) {
+ case NLSCLASS_NL:
+ h = 0;
+ v++;
+ break;
+ case NLSCLASS_TAB:
+ while (++h & 07)
+ ;
+ break;
+ case NLSCLASS_CTRL:
+ h += 2;
+ break;
+ case NLSCLASS_ILLEGAL:
+ h += 4;
+ break;
+ case NLSCLASS_ILLEGAL2:
+ case NLSCLASS_ILLEGAL3:
+ case NLSCLASS_ILLEGAL4:
+ h += 3 + 2 * NLSCLASS_ILLEGAL_SIZE(w);
+ break;
+ default:
+ h += w;
}
-
if (h >= th) { /* check, extra long tabs picked up here also */
- h = 0;
+ h -= th;
v++;
}
}
@@ -1208,11 +1242,22 @@ RefCursor()
#ifndef WINTT_NATIVE
static void
-PutPlusOne(c)
- int c;
+PutPlusOne(c, width)
+ Char c;
+ int width;
{
- (void) putraw(c);
+ while (width > 1 && CursorH + width > TermH)
+ PutPlusOne(' ', 1);
+ if ((c & LITERAL) != 0) {
+ Char *d;
+ for (d = litptr + (c & ~LITERAL) * LIT_FACTOR; *d; d++)
+ (void) putwraw(*d);
+ } else {
+ (void) putwraw(c);
+ }
Display[CursorV][CursorH++] = (Char) c;
+ while (--width > 0)
+ Display[CursorV][CursorH++] = CHAR_DBWIDTH;
if (CursorH >= TermH) { /* if we must overflow */
CursorH = 0;
CursorV++;
@@ -1232,62 +1277,53 @@ PutPlusOne(c)
#endif
void
-RefPlusOne()
+RefPlusOne(int l)
{ /* we added just one char, handle it fast.
* assumes that screen cursor == real cursor */
- register Char c, mc;
-
- c = Cursor[-1] & CHAR; /* the char we just added */
+ Char *cp;
+ int w;
+ NLSChar c;
- if (c == '\t' || Cursor != LastChar) {
+ if (Cursor != LastChar) {
Refresh(); /* too hard to handle */
return;
}
-
if (rprompt_h != 0 && (TermH - CursorH - rprompt_h < 3)) {
Refresh(); /* clear out rprompt if less than one char gap*/
return;
- } /* else (only do at end of line, no TAB) */
-
- if (Iscntrl(c)) { /* if control char, do caret */
+ }
+ cp = Cursor - l;
+ NLSFrom(cp, (size_t)l, &c);
+ w = NLSClassify(c, cp == InputBuf);
+ switch(w) {
+ case NLSCLASS_CTRL:
+ PutPlusOne('^', 1);
+ if (c == CTL_ESC('\177')) {
+ PutPlusOne('?', 1);
+ break;
+ }
#ifdef IS_ASCII
- mc = (c == '\177') ? '?' : (c | 0100);
- PutPlusOne('^');
- PutPlusOne(mc);
+ /* uncontrolify it; works only for iso8859-1 like sets */
+ PutPlusOne((c | 0100), 1);
#else
- if (_toascii[c] == '\177' || Isupper(_toebcdic[_toascii[c]|0100])
- || strchr("@[\\]^_", _toebcdic[_toascii[c]|0100]) != NULL)
- {
- mc = (_toascii[c] == '\177') ? '?' : _toebcdic[_toascii[c]|0100];
- PutPlusOne('^');
- PutPlusOne(mc);
- }
- else
- {
- PutPlusOne('\\');
- PutPlusOne(((c >> 6) & 7) + '0');
- PutPlusOne(((c >> 3) & 7) + '0');
- PutPlusOne((c & 7) + '0');
- }
+ PutPlusOne(_toebcdic[_toascii[c]|0100], 1);
#endif
- }
- else if (Isprint(c)) { /* normal char */
- PutPlusOne(c);
- }
-#ifdef KANJI
- else if (
-#ifdef DSPMBYTE
- _enable_mbdisp &&
-#endif
- !adrof(STRnokanji)) {
- PutPlusOne(c);
- }
-#endif
- else {
- PutPlusOne('\\');
- PutPlusOne(((c >> 6) & 7) + '0');
- PutPlusOne(((c >> 3) & 7) + '0');
- PutPlusOne((c & 7) + '0');
+ break;
+ case NLSCLASS_ILLEGAL:
+ PutPlusOne('\\', 1);
+ PutPlusOne(((c >> 6) & 7) + '0', 1);
+ PutPlusOne(((c >> 3) & 7) + '0', 1);
+ PutPlusOne((c & 7) + '0', 1);
+ break;
+ case 1:
+ if (l > 1)
+ PutPlusOne(MakeLiteral(cp, l, 0), 1);
+ else
+ PutPlusOne(*cp, 1);
+ break;
+ default:
+ Refresh(); /* too hard to handle */
+ return;
}
flush();
}
@@ -1297,19 +1333,20 @@ RefPlusOne()
void
ClearDisp()
{
- register int i;
+ int i;
CursorV = 0; /* clear the display buffer */
CursorH = 0;
for (i = 0; i < TermV; i++)
(void) memset(Display[i], 0, TermH * sizeof(Display[0][0]));
OldvcV = 0;
+ litlen = 0;
}
void
ClearLines()
{ /* Make sure all lines are *really* blank */
- register int i;
+ int i;
if (T_CanCEOL) {
/*
diff --git a/contrib/tcsh/ed.screen.c b/contrib/tcsh/ed.screen.c
index 933ded32579e..9dd7e7175470 100644
--- a/contrib/tcsh/ed.screen.c
+++ b/contrib/tcsh/ed.screen.c
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/ed.screen.c,v 3.50 2003/02/08 20:03:25 christos Exp $ */
+/* $Header: /src/pub/tcsh/ed.screen.c,v 3.63 2005/01/18 20:43:30 christos Exp $ */
/*
* ed.screen.c: Editor/termcap-curses interface
*/
@@ -32,35 +32,12 @@
*/
#include "sh.h"
-RCSID("$Id: ed.screen.c,v 3.50 2003/02/08 20:03:25 christos Exp $")
+RCSID("$Id: ed.screen.c,v 3.63 2005/01/18 20:43:30 christos Exp $")
#include "ed.h"
#include "tc.h"
#include "ed.defns.h"
-#ifndef POSIX
-/*
- * We don't prototype these, cause some systems have them wrong!
- */
-extern int tgetent __P(());
-extern char *tgetstr __P(());
-extern int tgetflag __P(());
-extern int tgetnum __P(());
-extern char *tgoto __P(());
-# define PUTPURE putpure
-# define PUTRAW putraw
-#else
-extern int tgetent __P((char *, char *));
-extern char *tgetstr __P((char *, char **));
-extern int tgetflag __P((char *));
-extern int tgetnum __P((char *));
-extern char *tgoto __P((char *, int, int));
-extern void tputs __P((char *, int, void (*)(int)));
-# define PUTPURE ((void (*)__P((int))) putpure)
-# define PUTRAW ((void (*)__P((int))) putraw)
-#endif
-
-
/* #define DEBUG_LITERAL */
/*
@@ -77,8 +54,8 @@ extern void tputs __P((char *, int, void (*)(int)));
#define Val(a) tval[a].val
static struct {
- char *b_name;
- int b_rate;
+ const char *b_name;
+ speed_t b_rate;
} baud_rate[] = {
#ifdef B0
@@ -187,8 +164,8 @@ static struct {
#define T_at7 37
#define T_str 38
static struct termcapstr {
- char *name;
- char *long_name;
+ const char *name;
+ const char *long_name;
char *str;
} tstr[T_str + 1];
@@ -201,8 +178,8 @@ static struct termcapstr {
#define T_xn 5
#define T_val 6
static struct termcapval {
- char *name;
- char *long_name;
+ const char *name;
+ const char *long_name;
int val;
} tval[T_val + 1];
@@ -372,7 +349,7 @@ terminit()
* No Wrap no -- yes yes
*/
-static bool 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 TCalloc __P((struct termcapstr *, char *));
@@ -445,33 +422,36 @@ TCalloc(t, cap)
/*ARGSUSED*/
void
-TellTC(what)
- char *what;
+TellTC()
{
struct termcapstr *t;
+ char *s;
- USE(what);
xprintf(CGETS(7, 1, "\n\tTcsh thinks your terminal has the\n"));
xprintf(CGETS(7, 2, "\tfollowing characteristics:\n\n"));
xprintf(CGETS(7, 3, "\tIt has %d columns and %d lines\n"),
Val(T_co), Val(T_li));
- xprintf(CGETS(7, 4, "\tIt has %s meta key\n"), T_HasMeta ?
- CGETS(7, 5, "a") : CGETS(7, 6, "no"));
- xprintf(CGETS(7, 7, "\tIt can%s use tabs\n"), T_Tabs ?
- "" : CGETS(7, 8, " not"));
- xprintf(CGETS(7, 9, "\tIt %s automatic margins\n"),
- (T_Margin&MARGIN_AUTO)?
- CGETS(7, 10, "has"):
- CGETS(7, 11, "does not have"));
- if (T_Margin & MARGIN_AUTO)
- xprintf(CGETS(7, 12, "\tIt %s magic margins\n"),
- (T_Margin & MARGIN_MAGIC) ?
- CGETS(7, 10, "has"):
- CGETS(7, 11, "does not have"));
-
- for (t = tstr; t->name != NULL; t++)
- xprintf("\t%36s (%s) == %s\n", t->long_name, t->name,
- t->str && *t->str ? t->str : CGETS(7, 13, "(empty)"));
+ s = strsave(T_HasMeta ? CGETS(7, 5, "a") : CGETS(7, 6, "no"));
+ xprintf(CGETS(7, 4, "\tIt has %s meta key\n"), s);
+ xfree(s);
+ s = strsave(T_Tabs ? "" : CGETS(7, 8, " not"));
+ xprintf(CGETS(7, 7, "\tIt can%s use tabs\n"), s);
+ xfree(s);
+ s = strsave((T_Margin&MARGIN_AUTO) ?
+ CGETS(7, 10, "has") : CGETS(7, 11, "does not have"));
+ xprintf(CGETS(7, 9, "\tIt %s automatic margins\n"), s);
+ xfree(s);
+ if (T_Margin & MARGIN_AUTO) {
+ s = strsave((T_Margin & MARGIN_MAGIC) ?
+ CGETS(7, 10, "has") : CGETS(7, 11, "does not have"));
+ xprintf(CGETS(7, 12, "\tIt %s magic margins\n"), s);
+ xfree(s);
+ }
+ for (t = tstr; t->name != NULL; t++) {
+ s = strsave(t->str && *t->str ? t->str : CGETS(7, 13, "(empty)"));
+ xprintf("\t%36s (%s) == %s\n", t->long_name, t->name, s);
+ xfree(s);
+ }
xputchar('\n');
}
@@ -479,9 +459,9 @@ TellTC(what)
static void
ReBufferDisplay()
{
- register int i;
- Char **b;
- Char **bufp;
+ int i;
+ Char **b;
+ Char **bufp;
b = Display;
Display = NULL;
@@ -499,14 +479,14 @@ ReBufferDisplay()
}
TermH = Val(T_co);
TermV = (INBUFSIZE * 4) / TermH + 1;
- b = (Char **) xmalloc((size_t) (sizeof(Char *) * (TermV + 1)));
+ b = (Char **) xmalloc((size_t) (sizeof(*b) * (TermV + 1)));
for (i = 0; i < TermV; i++)
- b[i] = (Char *) xmalloc((size_t) (sizeof(Char) * (TermH + 1)));
+ b[i] = (Char *) xmalloc((size_t) (sizeof(*b[i]) * (TermH + 1)));
b[TermV] = NULL;
Display = b;
- b = (Char **) xmalloc((size_t) (sizeof(Char *) * (TermV + 1)));
+ b = (Char **) xmalloc((size_t) (sizeof(*b) * (TermV + 1)));
for (i = 0; i < TermV; i++)
- b[i] = (Char *) xmalloc((size_t) (sizeof(Char) * (TermH + 1)));
+ b[i] = (Char *) xmalloc((size_t) (sizeof(*b[i]) * (TermH + 1)));
b[TermV] = NULL;
Vdisplay = b;
}
@@ -595,7 +575,7 @@ EchoTC(v)
int arg_need, arg_cols, arg_rows;
int verbose = 0, silent = 0;
char *area;
- static char *fmts = "%s\n", *fmtd = "%d\n";
+ static const char *fmts = "%s\n", *fmtd = "%d\n";
struct termcapstr *t;
char buf[TC_BUFSIZE];
@@ -798,7 +778,7 @@ EchoTC(v)
}
}
-bool GotTermCaps = 0;
+int GotTermCaps = 0;
static struct {
Char *name;
@@ -807,17 +787,17 @@ static struct {
int type;
} arrow[] = {
#define A_K_DN 0
- { STRdown, T_kd },
+ { STRdown, T_kd, { 0 }, 0 },
#define A_K_UP 1
- { STRup, T_ku },
+ { STRup, T_ku, { 0 }, 0 },
#define A_K_LT 2
- { STRleft, T_kl },
+ { STRleft, T_kl, { 0 }, 0 },
#define A_K_RT 3
- { STRright, T_kr },
+ { STRright, T_kr, { 0 }, 0 },
#define A_K_HO 4
- { STRhome, T_kh },
+ { STRhome, T_kh, { 0 }, 0 },
#define A_K_EN 5
- { STRend, T_at7}
+ { STRend, T_at7, { 0 }, 0}
};
#define A_K_NKEYS 6
@@ -1021,7 +1001,7 @@ static Char cur_atr = 0; /* current attributes */
void
SetAttributes(atr)
- int atr;
+ Char atr;
{
atr &= ATTRIBUTES;
if (atr != cur_atr) {
@@ -1115,9 +1095,14 @@ MoveToLine(where) /* move to line <where> (first line == 0) */
if (del > 0) {
while (del > 0) {
if ((T_Margin & MARGIN_AUTO) && Display[CursorV][0] != '\0') {
+ size_t h;
+
+ for (h = TermH - 1; h > 0 && Display[CursorV][h] == CHAR_DBWIDTH;
+ h--)
+ ;
/* move without newline */
- MoveToChar(TermH - 1);
- so_write(&Display[CursorV][CursorH], 1); /* updates CursorH/V*/
+ MoveToChar(h);
+ so_write(&Display[CursorV][CursorH], TermH - CursorH); /* updates CursorH/V*/
del--;
}
else {
@@ -1182,16 +1167,13 @@ mc_again:
(void) tputs(tgoto(Str(T_RI), del, del), del, PUTPURE);
else {
/* if I can do tabs, use them */
- if (T_Tabs
-#ifdef DSPMBYTE
- && !_enable_mbdisp
-#endif /* DSPMBYTE */
- ) {
- if ((CursorH & 0370) != (where & 0370)) {
+ if (T_Tabs) {
+ if ((CursorH & 0370) != (where & ~0x7)
+ && Display[CursorV][where & ~0x7] != CHAR_DBWIDTH) {
/* if not within tab stop */
- for (i = (CursorH & 0370); i < (where & 0370); i += 8)
+ for (i = (CursorH & 0370); i < (where & ~0x7); i += 8)
(void) putraw('\t'); /* then tab over */
- CursorH = where & 0370;
+ CursorH = where & ~0x7;
/* Note: considering that we often want to go to
TermH - 1 for the wrapping, it would be nice to
optimize this case by tabbing to the last column
@@ -1226,8 +1208,8 @@ mc_again:
void
so_write(cp, n)
- register Char *cp;
- register int n;
+ Char *cp;
+ int n;
{
if (n <= 0)
return; /* catch bugs */
@@ -1241,21 +1223,19 @@ so_write(cp, n)
}
do {
- if (*cp & LITERAL) {
- extern Char *litptr[];
- Char *d;
-
+ if (*cp != CHAR_DBWIDTH) {
+ if (*cp & LITERAL) {
+ Char *d;
#ifdef DEBUG_LITERAL
- xprintf("so: litnum %d, litptr %x\r\n",
- *cp & CHAR, litptr[*cp & CHAR]);
+ xprintf("so: litnum %d\r\n", (int)(*cp & ~LITERAL));
#endif /* DEBUG_LITERAL */
- for (d = litptr[*cp++ & CHAR]; *d & LITERAL; d++)
- (void) putraw(*d & CHAR);
- (void) putraw(*d);
-
+ for (d = litptr + (*cp & ~LITERAL) * LIT_FACTOR; *d; d++)
+ (void) putwraw(*d);
+ }
+ else
+ (void) putwraw(*cp);
}
- else
- (void) putraw(*cp++);
+ cp++;
CursorH++;
} while (--n);
@@ -1266,11 +1246,15 @@ so_write(cp, n)
if (T_Margin & MARGIN_MAGIC) {
/* force the wrap to avoid the "magic" situation */
Char c;
- if ((c = Display[CursorV][CursorH]) != '\0')
+ if ((c = Display[CursorV][CursorH]) != '\0') {
so_write(&c, 1);
- else
+ while(Display[CursorV][CursorH] == CHAR_DBWIDTH)
+ CursorH++;
+ }
+ else {
(void) putraw(' ');
- CursorH = 1;
+ CursorH = 1;
+ }
}
}
else /* no wrap, but cursor stays on screen */
@@ -1321,8 +1305,8 @@ DeleteChars(num) /* deletes <num> characters */
void
Insert_write(cp, num) /* Puts terminal in insert character mode, */
- register Char *cp;
- register int num; /* or inserts num characters in the line */
+ Char *cp;
+ int num; /* or inserts num characters in the line */
{
if (num <= 0)
return;
@@ -1352,10 +1336,7 @@ Insert_write(cp, num) /* Puts terminal in insert character mode, */
if (GoodStr(T_im) && GoodStr(T_ei)) { /* if I have insert mode */
(void) tputs(Str(T_im), 1, PUTPURE);
- CursorH += num;
- do
- (void) putraw(*cp++);
- while (--num);
+ so_write(cp, num); /* this updates CursorH/V */
if (GoodStr(T_ip)) /* have to make num chars insert */
(void) tputs(Str(T_ip), 1, PUTPURE);
@@ -1368,9 +1349,7 @@ Insert_write(cp, num) /* Puts terminal in insert character mode, */
if (GoodStr(T_ic)) /* have to make num chars insert */
(void) tputs(Str(T_ic), 1, PUTPURE); /* insert a char */
- (void) putraw(*cp++);
-
- CursorH++;
+ so_write(cp++, 1); /* this updates CursorH/V */
if (GoodStr(T_ip)) /* have to make num chars insert */
(void) tputs(Str(T_ip), 1, PUTPURE);/* pad the inserted char */
@@ -1383,7 +1362,7 @@ void
ClearEOL(num) /* clear to end of line. There are num */
int num; /* characters to clear */
{
- register int i;
+ int i;
if (num <= 0)
return;
@@ -1442,8 +1421,8 @@ ClearToBottom()
void
GetTermCaps()
{ /* read in the needed terminal capabilites */
- register int i;
- char *ptr;
+ int i;
+ const char *ptr;
char buf[TC_BUFSIZE];
static char bp[TC_BUFSIZE];
char *area;
@@ -1657,7 +1636,6 @@ ChangeSize(lins, cols)
if ((tptr = getenv("TERMCAP")) != NULL) {
/* Leave 64 characters slop in case we enlarge the termcap string */
Char termcap[1024+64], backup[1024+64], *ptr;
- int i;
ptr = str2short(tptr);
(void) Strncpy(termcap, ptr, 1024);
@@ -1672,11 +1650,11 @@ ChangeSize(lins, cols)
(void) Strcpy(backup, termcap);
}
else {
- i = (int) (ptr - termcap + Strlen(buf));
- (void) Strncpy(backup, termcap, (size_t) i);
- backup[i] = '\0';
+ size_t len = (ptr - termcap) + Strlen(buf);
+ (void) Strncpy(backup, termcap, len);
+ backup[len] = '\0';
(void) Itoa(Val(T_co), buf, 0, 0);
- (void) Strcat(backup + i, buf);
+ (void) Strcat(backup + len, buf);
ptr = Strchr(ptr, ':');
(void) Strcat(backup, ptr);
}
@@ -1690,9 +1668,9 @@ ChangeSize(lins, cols)
(void) Strcpy(termcap, backup);
}
else {
- i = (int) (ptr - backup + Strlen(buf));
- (void) Strncpy(termcap, backup, (size_t) i);
- termcap[i] = '\0';
+ size_t len = (ptr - backup) + Strlen(buf);
+ (void) Strncpy(termcap, backup, len);
+ termcap[len] = '\0';
(void) Itoa(Val(T_li), buf, 0, 0);
(void) Strcat(termcap, buf);
ptr = Strchr(ptr, ':');
diff --git a/contrib/tcsh/ed.term.c b/contrib/tcsh/ed.term.c
index ebda35fe3dfe..ae1169b284fd 100644
--- a/contrib/tcsh/ed.term.c
+++ b/contrib/tcsh/ed.term.c
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/ed.term.c,v 1.29 2003/05/26 07:11:06 christos Exp $ */
+/* $Header: /src/pub/tcsh/ed.term.c,v 1.31 2004/11/23 02:10:48 christos Exp $ */
/*
* ed.term.c: Low level terminal interface
*/
@@ -33,7 +33,7 @@
#include "sh.h"
#ifndef WINNT_NATIVE
-RCSID("$Id: ed.term.c,v 1.29 2003/05/26 07:11:06 christos Exp $")
+RCSID("$Id: ed.term.c,v 1.31 2004/11/23 02:10:48 christos Exp $")
#include "ed.h"
@@ -85,7 +85,7 @@ ttyperm_t ttylist = {
};
static struct tcshmodes {
- char *m_name;
+ const char *m_name;
#ifdef SOLARIS2
unsigned long m_value;
#else /* !SOLARIS2 */
@@ -1092,7 +1092,7 @@ tty_setdisc(fd, dis)
int fd;
int dis;
{
- static bool edit_discipline = 0;
+ static int edit_discipline = 0;
static union txname tx_disc;
extern char strPOSIX[];
diff --git a/contrib/tcsh/ed.term.h b/contrib/tcsh/ed.term.h
index f868213af6f1..564b10b36d9a 100644
--- a/contrib/tcsh/ed.term.h
+++ b/contrib/tcsh/ed.term.h
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/ed.term.h,v 1.16 2002/07/06 22:28:13 christos Exp $ */
+/* $Header: /src/pub/tcsh/ed.term.h,v 1.17 2004/12/25 21:15:06 christos Exp $ */
/*
* ed.term.h: Local terminal header
*/
@@ -453,7 +453,7 @@
* Also for RH6.2 on the alpha, defined TIOCGLTC, but does not have
* struct ltchars
*/
-#if (defined(hpux) && defined(VSUSP) && defined(VDSUSP) && defined(VWERASE) && defined(VLNEXT)) || defined(__linux__)
+#if (defined(hpux) && defined(VSUSP) && defined(VDSUSP) && defined(VWERASE) && defined(VLNEXT)) || defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)
# undef TIOCGLTC /* not really needed */
# undef TIOCSLTC
#endif
diff --git a/contrib/tcsh/ed.xmap.c b/contrib/tcsh/ed.xmap.c
index 47365d7d8d45..5d01ed6e818f 100644
--- a/contrib/tcsh/ed.xmap.c
+++ b/contrib/tcsh/ed.xmap.c
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/ed.xmap.c,v 3.25 2002/03/08 17:36:45 christos Exp $ */
+/* $Header: /src/pub/tcsh/ed.xmap.c,v 3.28 2005/01/05 18:06:43 christos Exp $ */
/*
* ed.xmap.c: This module contains the procedures for maintaining
* the extended-key map.
@@ -88,7 +88,7 @@
*/
#include "sh.h"
-RCSID("$Id: ed.xmap.c,v 3.25 2002/03/08 17:36:45 christos Exp $")
+RCSID("$Id: ed.xmap.c,v 3.28 2005/01/05 18:06:43 christos Exp $")
#include "ed.h"
#include "ed.defns.h"
@@ -592,7 +592,7 @@ printOne(key, val, ntype)
{
struct KeyFuncs *fp;
unsigned char unparsbuf[200];
- static char *fmt = "%s\n";
+ static const char *fmt = "%s\n";
xprintf("%-15S-> ", key->buf);
if (val != NULL)
@@ -675,7 +675,7 @@ unparsech(cnt, ch)
return cnt;
}
-int
+eChar
parseescape(ptr)
const Char **ptr;
{
@@ -686,7 +686,7 @@ parseescape(ptr)
if ((p[1] & CHAR) == 0) {
xprintf(CGETS(9, 8, "Something must follow: %c\n"), *p);
- return -1;
+ return CHAR_ERR;
}
if ((*p & CHAR) == '\\') {
p++;
@@ -727,7 +727,8 @@ parseescape(ptr)
case '6':
case '7':
{
- register int cnt, val, ch;
+ int cnt, val;
+ Char ch;
for (cnt = 0, val = 0; cnt < 3; cnt++) {
ch = *p++ & CHAR;
@@ -822,9 +823,8 @@ unparsestring(str, buf, sep)
*b++ = '\\';
*b++ = (unsigned char) p;
}
- else if (p == ' ' || (Isprint(p) && !Isspace(p))) {
- *b++ = (unsigned char) p;
- }
+ else if (p == ' ' || (Isprint(p) && !Isspace(p)))
+ b += one_wctomb((char *)b, p & CHAR);
else {
*b++ = '\\';
*b++ = ((p >> 6) & 7) + '0';
diff --git a/contrib/tcsh/gethost.c b/contrib/tcsh/gethost.c
index 012a9fe28577..91527753abad 100644
--- a/contrib/tcsh/gethost.c
+++ b/contrib/tcsh/gethost.c
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/gethost.c,v 1.9 2002/12/04 12:30:55 christos Exp $ */
+/* $Header: /src/pub/tcsh/gethost.c,v 1.10 2005/01/05 16:06:13 christos Exp $ */
/*
* gethost.c: Create version file from prototype
*/
@@ -32,7 +32,7 @@
*/
#include "sh.h"
-RCSID("$Id: gethost.c,v 1.9 2002/12/04 12:30:55 christos Exp $")
+RCSID("$Id: gethost.c,v 1.10 2005/01/05 16:06:13 christos Exp $")
#ifdef SCO
# define perror __perror
@@ -50,12 +50,6 @@ RCSID("$Id: gethost.c,v 1.9 2002/12/04 12:30:55 christos Exp $")
#include <ctype.h>
-/* Some people don't bother to declare these */
-#if defined(SUNOS4) || defined(ibm032)
-extern int fprintf();
-extern int fclose();
-#endif /* SUNOS4 || ibm032 */
-
#define ISSPACE(p) (isspace((unsigned char) (p)) && (p) != '\n')
/*
diff --git a/contrib/tcsh/glob.c b/contrib/tcsh/glob.c
index 8e107c9d789a..b56e22015330 100644
--- a/contrib/tcsh/glob.c
+++ b/contrib/tcsh/glob.c
@@ -51,20 +51,14 @@ static char sccsid[] = "@(#)glob.c 5.12 (Berkeley) 6/24/91";
* Number of matches in the current invocation of glob.
*/
-#ifdef notdef
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <dirent.h>
-#include <ctype.h>
-typedef void * ptr_t;
-#endif
#ifdef WINNT_NATIVE
#pragma warning(disable:4244)
#endif /* WINNT_NATIVE */
#define Char __Char
#include "sh.h"
+#include "glob.h"
+
#undef Char
#undef QUOTE
#undef TILDE
@@ -73,8 +67,6 @@ typedef void * ptr_t;
#undef ismeta
#undef Strchr
-#include "glob.h"
-
#ifndef S_ISDIR
#define S_ISDIR(a) (((a) & S_IFMT) == S_IFDIR)
#endif
@@ -147,9 +139,31 @@ static void qprintf __P((Char *));
int
globcharcoll(c1, c2, cs)
- int c1, c2, cs;
+ NLSChar c1, c2;
+ int cs;
{
#if defined(NLS) && defined(LC_COLLATE) && !defined(NOSTRCOLL)
+# if defined(SHORT_STRINGS)
+ wchar_t s1[2], s2[2];
+
+ if (c1 == c2)
+ return (0);
+ if (cs) {
+ c1 = towlower(c1);
+ c2 = towlower(c2);
+ } else {
+ /* This should not be here, but I'll rather leave it in than engage in
+ a LC_COLLATE flamewar about a shell I don't use... */
+ if (iswlower(c1) && iswupper(c2))
+ return (1);
+ if (iswupper(c1) && iswlower(c2))
+ return (-1);
+ }
+ s1[0] = c1;
+ s2[0] = c2;
+ s1[1] = s2[1] = '\0';
+ return wcscoll(s1, s2);
+# else /* not SHORT_STRINGS */
char s1[2], s2[2];
if (c1 == c2)
@@ -164,11 +178,14 @@ globcharcoll(c1, c2, cs)
} else {
if (islower(c1) && isupper(c2))
return (1);
+ if (isupper(c1) && islower(c2))
+ return (-1);
}
s1[0] = c1;
s2[0] = c2;
s1[1] = s2[1] = '\0';
return strcoll(s1, s2);
+# endif
#else
return (c1 - c2);
#endif
@@ -183,10 +200,10 @@ globcharcoll(c1, c2, cs)
static DIR *
Opendir(str)
- register Char *str;
+ Char *str;
{
char buf[GLOBBUFLEN];
- register char *dc = buf;
+ char *dc = buf;
#if defined(hpux) || defined(__hpux)
struct stat st;
#endif
@@ -208,11 +225,11 @@ Opendir(str)
#ifdef S_IFLNK
static int
Lstat(fn, sb)
- register Char *fn;
+ Char *fn;
struct stat *sb;
{
char buf[GLOBBUFLEN];
- register char *dc = buf;
+ char *dc = buf;
while ((*dc++ = *fn++) != '\0')
continue;
@@ -235,11 +252,11 @@ Lstat(fn, sb)
static int
Stat(fn, sb)
- register Char *fn;
+ Char *fn;
struct stat *sb;
{
char buf[GLOBBUFLEN];
- register char *dc = buf;
+ char *dc = buf;
while ((*dc++ = *fn++) != '\0')
continue;
@@ -319,10 +336,15 @@ glob(pattern, flags, errfunc, pglob)
Char *bufnext, *bufend, *compilebuf, m_not;
const unsigned char *compilepat, *patnext;
int c, not;
- Char patbuf[GLOBBUFLEN + 1], *qpatnext;
+ Char *qpatnext;
+#ifdef WIDE_STRINGS
+ Char patbuf[GLOBBUFLEN + MB_LEN_MAX + 1];
+#else
+ Char patbuf[GLOBBUFLEN + 1];
+#endif
int no_match;
- patnext = (unsigned char *) pattern;
+ patnext = (const unsigned char *) pattern;
if (!(flags & GLOB_APPEND)) {
pglob->gl_pathc = 0;
pglob->gl_pathv = NULL;
@@ -354,15 +376,19 @@ glob(pattern, flags, errfunc, pglob)
if (flags & GLOB_QUOTE) {
/* Protect the quoted characters */
- while (bufnext < bufend && (c = *patnext++) != EOS)
-#ifdef DSPMBYTE
- if (Ismbyte1(c) && *patnext != EOS)
- {
- *bufnext++ = (Char) c;
- *bufnext++ = (Char) *patnext++;
- }
- else
-#endif /* DSPMBYTE */
+ while (bufnext < bufend && (c = *patnext++) != EOS) {
+#ifdef WIDE_STRINGS
+ int len;
+
+ len = mblen((const char *)(patnext - 1), MB_LEN_MAX);
+ if (len == -1)
+ mblen(NULL, 0);
+ if (len > 1) {
+ *bufnext++ = (Char) c;
+ while (--len != 0)
+ *bufnext++ = (Char) (*patnext++ | M_PROTECT);
+ } else
+#endif /* WIDE_STRINGS */
if (c == QUOTE) {
if ((c = *patnext++) == EOS) {
c = QUOTE;
@@ -372,6 +398,7 @@ glob(pattern, flags, errfunc, pglob)
}
else
*bufnext++ = (Char) c;
+ }
}
else
while (bufnext < bufend && (c = *patnext++) != EOS)
@@ -382,14 +409,6 @@ glob(pattern, flags, errfunc, pglob)
qpatnext = patbuf;
/* we don't need to check for buffer overflow any more */
while ((c = *qpatnext++) != EOS) {
-#ifdef DSPMBYTE
- if (Ismbyte1(c) && *qpatnext != EOS)
- {
- *bufnext++ = CHAR(c);
- *bufnext++ = CHAR(*qpatnext++);
- }
- else
-#endif /* DSPMBYTE */
switch (c) {
case LBRACKET:
c = *qpatnext;
@@ -593,8 +612,8 @@ glob3(pathbuf, pathend, pattern, restpattern, pglob, no_match)
/* search directory for matching names */
while ((dp = readdir(dirp)) != NULL) {
- register unsigned char *sc;
- register Char *dc;
+ unsigned char *sc;
+ Char *dc;
/* initial DOT must be matched literally */
if (dp->d_name[0] == DOT && *pattern != DOT)
@@ -635,8 +654,8 @@ globextend(path, pglob)
Char *path;
glob_t *pglob;
{
- register char **pathv;
- register int i;
+ char **pathv;
+ int i;
unsigned int newsize;
char *copy;
Char *p;
@@ -659,8 +678,8 @@ globextend(path, pglob)
for (p = path; *p++;)
continue;
if ((copy = (char *) xmalloc((size_t) (p - path))) != NULL) {
- register char *dc = copy;
- register Char *sc = path;
+ char *dc = copy;
+ Char *sc = path;
while ((*dc++ = *sc++) != '\0')
continue;
@@ -671,55 +690,88 @@ globextend(path, pglob)
}
+static size_t
+One_mbtowc(NLSChar *pwc, const Char *s, size_t n)
+{
+#ifdef WIDE_STRINGS
+ char buf[MB_LEN_MAX], *p;
+
+ if (n > MB_LEN_MAX)
+ n = MB_LEN_MAX;
+ p = buf;
+ while (p < buf + n && (*p++ = CHAR(*s++)) != 0)
+ ;
+ return one_mbtowc(pwc, buf, n);
+#else
+ return NLSFrom(s, n, pwc);
+#endif
+}
+
/*
* pattern matching function for filenames. Each occurrence of the *
* pattern causes a recursion level.
*/
static int
match(name, pat, patend, m_not)
- register Char *name, *pat, *patend;
+ Char *name, *pat, *patend;
int m_not;
{
int ok, negate_range;
Char c, k;
while (pat < patend) {
- c = *pat++;
+ size_t lwk;
+ NLSChar wc, wk;
+
+ USE(k);
+ c = *pat; /* Only for M_MASK bits */
+ pat += One_mbtowc(&wc, pat, MB_LEN_MAX);
+ lwk = One_mbtowc(&wk, name, MB_LEN_MAX);
switch (c & M_MASK) {
case M_ALL:
if (pat == patend)
return (1);
- do
+ for (;;) {
if (match(name, pat, patend, m_not))
return (1);
- while (*name++ != EOS);
+ if (*name == EOS)
+ break;
+ name += lwk;
+ lwk = One_mbtowc(&wk, name, MB_LEN_MAX);
+ }
return (0);
case M_ONE:
- if (*name++ == EOS)
+ if (*name == EOS)
return (0);
+ name += lwk;
break;
case M_SET:
ok = 0;
- if ((k = *name++) == EOS)
+ if (*name == EOS)
return (0);
+ name += lwk;
if ((negate_range = ((*pat & M_MASK) == m_not)) != 0)
++pat;
- while (((c = *pat++) & M_MASK) != M_END) {
+ while ((*pat & M_MASK) != M_END) {
+ pat += One_mbtowc(&wc, pat, MB_LEN_MAX);
if ((*pat & M_MASK) == M_RNG) {
- if (globcharcoll(CHAR(c), CHAR(k), 0) <= 0 &&
- globcharcoll(CHAR(k), CHAR(pat[1]), 0) <= 0)
+ NLSChar wc2;
+
+ pat++;
+ pat += One_mbtowc(&wc2, pat, MB_LEN_MAX);
+ if (globcharcoll(wc, wk, 0) <= 0 &&
+ globcharcoll(wk, wc2, 0) <= 0)
ok = 1;
- pat += 2;
- }
- else if (c == k)
+ } else if (wc == wk)
ok = 1;
}
+ pat += One_mbtowc(&wc, pat, MB_LEN_MAX);
if (ok == negate_range)
return (0);
break;
default:
- k = *name++;
- if (samecase(k) != samecase(c))
+ name += lwk;
+ if (samecase(wk) != samecase(wc))
return (0);
break;
}
@@ -732,8 +784,8 @@ void
globfree(pglob)
glob_t *pglob;
{
- register int i;
- register char **pp;
+ int i;
+ char **pp;
if (pglob->gl_pathv != NULL) {
pp = pglob->gl_pathv + pglob->gl_offs;
diff --git a/contrib/tcsh/glob.h b/contrib/tcsh/glob.h
index 382ff130d628..bb5bd3d78aac 100644
--- a/contrib/tcsh/glob.h
+++ b/contrib/tcsh/glob.h
@@ -84,8 +84,10 @@ typedef struct {
#define GLOB_ABEND GLOB_ABORTED /* source compatibility */
/* #endif */
+#include "tc.nls.h"
+
int glob __P((const char *, int, int (*)(const char *, int), glob_t *));
void globfree __P((glob_t *));
-int globcharcoll __P((int, int, int));
+int globcharcoll __P((NLSChar, NLSChar, int));
#endif /* !_GLOB_H_ */
diff --git a/contrib/tcsh/host.defs b/contrib/tcsh/host.defs
index 17a9ae1a6404..f56a9559b7d1 100644
--- a/contrib/tcsh/host.defs
+++ b/contrib/tcsh/host.defs
@@ -1,5 +1,5 @@
newcode :
-/* $Header: /src/pub/tcsh/host.defs,v 1.36 2003/02/08 20:03:25 christos Exp $ */
+/* $Header: /src/pub/tcsh/host.defs,v 1.40 2005/03/03 16:49:15 kim Exp $ */
/*
* host.defs: Hosttype/Machtype etc.
*/
@@ -33,7 +33,7 @@ newcode :
*/
#include "sh.h"
-RCSID("$Id: host.defs,v 1.36 2003/02/08 20:03:25 christos Exp $")
+RCSID("$Id: host.defs,v 1.40 2005/03/03 16:49:15 kim Exp $")
endcode :
@@ -174,10 +174,10 @@ newcode :
void
getmachine()
{
- char *hosttype;
- char *ostype;
- char *vendor;
- char *machtype;
+ const char *hosttype;
+ const char *ostype;
+ const char *vendor;
+ const char *machtype;
endcode :
@@ -435,14 +435,24 @@ machtype: defined(M_i386) : "i386"
enddef :
-newdef : defined(linux)
+newdef : defined(linux) || defined(__GNU__) || defined(__GLIBC__)
comment : Linus Torvalds's linux
vendor : defined(M_intel) : "intel"
+hosttype: defined(__ia64__) : "ia64-linux"
+hosttype: defined(__powerpc64__) : "powerpc64-linux"
+hosttype: defined(__s390x__) : "s390x-linux"
+hosttype: defined(__s390__) : "s390-linux"
+hosttype: defined(__x86_64__) : "x86_64-linux"
hosttype: defined(M_i586) : "i586-linux"
hosttype: defined(M_i486) : "i486-linux"
hosttype: defined(M_i386) : "i386-linux"
ostype : !defined(PPC) : "linux"
ostype : defined(PPC) : "mklinux"
+machtype: defined(__ia64__) : "ia64"
+machtype: defined(__powerpc64__) : "powerpc64"
+machtype: defined(__s390x__) : "s390x"
+machtype: defined(__s390__) : "s390"
+machtype: defined(__x86_64__) : "x86_64"
machtype: defined(M_i586) : "i586"
machtype: defined(M_i486) : "i486"
machtype: defined(M_i386) : "i386"
@@ -996,9 +1006,9 @@ machtype: : "clipper"
enddef :
-newdef : defined(SNI) || defined(sinix)
-comment : Siemens Nixdorf Informationssysteme SINIX
-vendor : : "sni"
+newdef : (defined(SNI) || defined(sinix)) && !defined(_OSD_POSIX)
+comment : Fujitsu Siemens Computers (former "Siemens Nixdorf Informationssysteme"): SINIX aka. ReliantUNIX, a SVR4 derivative
+vendor : : "fsc"
hosttype: defined(M_intel) : "wx200i"
hosttype: defined(MIPSEB) : "rm400"
ostype : defined(sinix) : "sinix"
@@ -1011,10 +1021,13 @@ machtype: : "mips"
enddef :
newdef : defined(_OSD_POSIX)
-comment : Siemens Nixdorf Informationssysteme BS2000 POSIX (mainframe, EBCDIC)
-vendor : : "sni"
-hosttype: defined(M_intel) : "bs2000"
-ostype : : "posix"
+comment : Fujitsu Siemens Computers (former "Siemens Nixdorf Informationssysteme"): BS2000 POSIX (mainframe, EBCDIC)
+vendor : : "fsc"
+hosttype: : "bs2000"
+ostype : : "osdposix"
+machtype: #machine(7500) : "s390"
+machtype: #machine(mips) : "mips"
+machtype: #machine(sparc) : "sparc"
machtype: : "bs2000"
enddef :
diff --git a/contrib/tcsh/install-sh b/contrib/tcsh/install-sh
index e9de23842dcd..6ebe46de6cf4 100755
--- a/contrib/tcsh/install-sh
+++ b/contrib/tcsh/install-sh
@@ -1,19 +1,38 @@
#!/bin/sh
-#
# install - install a program, script, or datafile
-# This comes from X11R5 (mit/util/scripts/install.sh).
+
+scriptversion=2004-12-17.09
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
#
-# Copyright 1991 by the Massachusetts Institute of Technology
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-# Permission to use, copy, modify, distribute, and sell this software and its
-# documentation for any purpose is hereby granted without fee, provided that
-# the above copyright notice appear in all copies and that both that
-# copyright notice and this permission notice appear in supporting
-# documentation, and that the name of M.I.T. not be used in advertising or
-# publicity pertaining to distribution of the software without specific,
-# written prior permission. M.I.T. makes no representations about the
-# suitability of this software for any purpose. It is provided "as is"
-# without express or implied warranty.
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
@@ -23,13 +42,11 @@
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
-
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
-
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
@@ -41,211 +58,266 @@ stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
-transformbasename=""
-transform_arg=""
-instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
-chowncmd=""
-chgrpcmd=""
-stripcmd=""
+chowncmd=
+chgrpcmd=
+stripcmd=
rmcmd="$rmprog -f"
mvcmd="$mvprog"
-src=""
-dst=""
-dir_arg=""
-
-while [ x"$1" != x ]; do
- case $1 in
- -c) instcmd="$cpprog"
- shift
- continue;;
-
- -d) dir_arg=true
- shift
- continue;;
-
- -m) chmodcmd="$chmodprog $2"
- shift
- shift
- continue;;
-
- -o) chowncmd="$chownprog $2"
- shift
- shift
- continue;;
-
- -g) chgrpcmd="$chgrpprog $2"
- shift
- shift
- continue;;
-
- -s) stripcmd="$stripprog"
- shift
- continue;;
-
- -t=*) transformarg=`echo $1 | sed 's/-t=//'`
- shift
- continue;;
-
- -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
- shift
- continue;;
-
- *) if [ x"$src" = x ]
- then
- src=$1
- else
- # this colon is to work around a 386BSD /bin/sh bug
- :
- dst=$1
- fi
- shift
- continue;;
- esac
-done
-
-if [ x"$src" = x ]
-then
- echo "install: no input file specified"
- exit 1
-else
- true
-fi
-
-if [ x"$dir_arg" != x ]; then
- dst=$src
- src=""
-
- if [ -d $dst ]; then
- instcmd=:
- chmodcmd=""
- else
- instcmd=mkdir
- fi
-else
-
-# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
-# might cause directories to be created, which would be especially bad
-# if $src (and thus $dsttmp) contains '*'.
-
- if [ -f $src -o -d $src ]
- then
- true
- else
- echo "install: $src does not exist"
- exit 1
- fi
-
- if [ x"$dst" = x ]
- then
- echo "install: no destination specified"
- exit 1
- else
- true
- fi
-
-# If destination is a directory, append the input filename; if your system
-# does not like double slashes in filenames, you may need to add some logic
-
- if [ -d $dst ]
- then
- dst="$dst"/`basename $src`
- else
- true
- fi
-fi
-
-## this sed command emulates the dirname command
-dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
-
-# Make sure that the destination directory exists.
-# this part is taken from Noah Friedman's mkinstalldirs script
-
-# Skip lots of stat calls in the usual case.
-if [ ! -d "$dstdir" ]; then
-defaultIFS='
-'
-IFS="${IFS-${defaultIFS}}"
-
-oIFS="${IFS}"
-# Some sh's can't handle IFS=/ for some reason.
-IFS='%'
-set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
-IFS="${oIFS}"
-
-pathcomp=''
-
-while [ $# -ne 0 ] ; do
- pathcomp="${pathcomp}${1}"
+src=
+dst=
+dir_arg=
+dstarg=
+no_target_directory=
+
+usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+ or: $0 [OPTION]... SRCFILES... DIRECTORY
+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+ or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+-c (ignored)
+-d create directories instead of installing files.
+-g GROUP $chgrpprog installed files to GROUP.
+-m MODE $chmodprog installed files to MODE.
+-o USER $chownprog installed files to USER.
+-s $stripprog installed files.
+-t DIRECTORY install into DIRECTORY.
+-T report an error if DSTFILE is a directory.
+--help display this help and exit.
+--version display version info and exit.
+
+Environment variables override the default commands:
+ CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
+"
+
+while test -n "$1"; do
+ case $1 in
+ -c) shift
+ continue;;
+
+ -d) dir_arg=true
+ shift
+ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift
+ shift
+ continue;;
+
+ --help) echo "$usage"; exit 0;;
+
+ -m) chmodcmd="$chmodprog $2"
+ shift
+ shift
+ continue;;
+
+ -o) chowncmd="$chownprog $2"
+ shift
+ shift
+ continue;;
+
+ -s) stripcmd=$stripprog
+ shift
+ continue;;
+
+ -t) dstarg=$2
shift
+ shift
+ continue;;
- if [ ! -d "${pathcomp}" ] ;
- then
- $mkdirprog "${pathcomp}"
- else
- true
- fi
-
- pathcomp="${pathcomp}/"
+ -T) no_target_directory=true
+ shift
+ continue;;
+
+ --version) echo "$0 $scriptversion"; exit 0;;
+
+ *) # When -d is used, all remaining arguments are directories to create.
+ # When -t is used, the destination is already specified.
+ test -n "$dir_arg$dstarg" && break
+ # Otherwise, the last argument is the destination. Remove it from $@.
+ for arg
+ do
+ if test -n "$dstarg"; then
+ # $@ is not empty: it contains at least $arg.
+ set fnord "$@" "$dstarg"
+ shift # fnord
+ fi
+ shift # arg
+ dstarg=$arg
+ done
+ break;;
+ esac
done
-fi
-
-if [ x"$dir_arg" != x ]
-then
- $doit $instcmd $dst &&
-
- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
-else
-
-# If we're going to rename the final executable, determine the name now.
-
- if [ x"$transformarg" = x ]
- then
- dstfile=`basename $dst`
- else
- dstfile=`basename $dst $transformbasename |
- sed $transformarg`$transformbasename
- fi
-
-# don't allow the sed command to completely eliminate the filename
-
- if [ x"$dstfile" = x ]
- then
- dstfile=`basename $dst`
- else
- true
- fi
-
-# Make a temp file name in the proper directory.
-
- dsttmp=$dstdir/#inst.$$#
-# Move or copy the file name to the temp name
-
- $doit $instcmd $src $dsttmp &&
-
- trap "rm -f ${dsttmp}" 0 &&
-
-# and set any options; do chmod last to preserve setuid bits
-
-# If any of these fail, we abort the whole thing. If we want to
-# ignore errors from any of these, just make sure not to ignore
-# errors from the above "$doit $instcmd $src $dsttmp" command.
-
- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
-
-# Now rename the file to the real destination.
-
- $doit $rmcmd -f $dstdir/$dstfile &&
- $doit $mvcmd $dsttmp $dstdir/$dstfile
+if test -z "$1"; then
+ if test -z "$dir_arg"; then
+ echo "$0: no input file specified." >&2
+ exit 1
+ fi
+ # It's OK to call `install-sh -d' without argument.
+ # This can happen when creating conditional directories.
+ exit 0
+fi
-fi &&
+for src
+do
+ # Protect names starting with `-'.
+ case $src in
+ -*) src=./$src ;;
+ esac
+
+ if test -n "$dir_arg"; then
+ dst=$src
+ src=
+
+ if test -d "$dst"; then
+ mkdircmd=:
+ chmodcmd=
+ else
+ mkdircmd=$mkdirprog
+ fi
+ else
+ # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+ # might cause directories to be created, which would be especially bad
+ # if $src (and thus $dsttmp) contains '*'.
+ if test ! -f "$src" && test ! -d "$src"; then
+ echo "$0: $src does not exist." >&2
+ exit 1
+ fi
+
+ if test -z "$dstarg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+
+ dst=$dstarg
+ # Protect names starting with `-'.
+ case $dst in
+ -*) dst=./$dst ;;
+ esac
+ # If destination is a directory, append the input filename; won't work
+ # if double slashes aren't ignored.
+ if test -d "$dst"; then
+ if test -n "$no_target_directory"; then
+ echo "$0: $dstarg: Is a directory" >&2
+ exit 1
+ fi
+ dst=$dst/`basename "$src"`
+ fi
+ fi
+
+ # This sed command emulates the dirname command.
+ dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
+
+ # Make sure that the destination directory exists.
+
+ # Skip lots of stat calls in the usual case.
+ if test ! -d "$dstdir"; then
+ defaultIFS='
+ '
+ IFS="${IFS-$defaultIFS}"
+
+ oIFS=$IFS
+ # Some sh's can't handle IFS=/ for some reason.
+ IFS='%'
+ set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
+ shift
+ IFS=$oIFS
+
+ pathcomp=
+
+ while test $# -ne 0 ; do
+ pathcomp=$pathcomp$1
+ shift
+ if test ! -d "$pathcomp"; then
+ $mkdirprog "$pathcomp"
+ # mkdir can fail with a `File exist' error in case several
+ # install-sh are creating the directory concurrently. This
+ # is OK.
+ test -d "$pathcomp" || exit
+ fi
+ pathcomp=$pathcomp/
+ done
+ fi
+
+ if test -n "$dir_arg"; then
+ $doit $mkdircmd "$dst" \
+ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
+ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
+ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
+ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
+
+ else
+ dstfile=`basename "$dst"`
+
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=$dstdir/_inst.$$_
+ rmtmp=$dstdir/_rm.$$_
+
+ # Trap to clean up those temp files at exit.
+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+ trap '(exit $?); exit' 1 2 13 15
+
+ # Copy the file name to the temp name.
+ $doit $cpprog "$src" "$dsttmp" &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+ # If any of these fail, we abort the whole thing. If we want to
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $cpprog $src $dsttmp" command.
+ #
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
+ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
+ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
+ && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
+
+ # Now rename the file to the real destination.
+ { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
+ || {
+ # The rename failed, perhaps because mv can't rename something else
+ # to itself, or perhaps because mv is so ancient that it does not
+ # support -f.
+
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ if test -f "$dstdir/$dstfile"; then
+ $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
+ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
+ || {
+ echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
+ (exit 1); exit 1
+ }
+ else
+ :
+ fi
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
+ }
+ }
+ fi || { (exit 1); exit 1; }
+done
-exit 0
+# The final little trick to "correctly" pass the exit status to the exit trap.
+{
+ (exit 0); exit 0
+}
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/contrib/tcsh/ma.setp.c b/contrib/tcsh/ma.setp.c
index 9d489c65a230..e55c41f66d80 100644
--- a/contrib/tcsh/ma.setp.c
+++ b/contrib/tcsh/ma.setp.c
@@ -82,7 +82,7 @@
**********************************************************************
*/
#include "sh.h"
-RCSID("$Id: ma.setp.c,v 1.13 2003/05/26 07:11:06 christos Exp $")
+RCSID("$Id: ma.setp.c,v 1.14 2004/08/04 17:12:28 christos Exp $")
#ifdef MACH
@@ -153,11 +153,11 @@ static int locate __P((struct pelem *, char *));
int
setpath(paths, cmds, localsyspath, dosuffix, printerrors)
-register char **paths, **cmds, *localsyspath;
+char **paths, **cmds, *localsyspath;
int dosuffix, printerrors;
{
- register char *cmd, *cmd1, *cmd2;
- register int ncmd;
+ char *cmd, *cmd1, *cmd2;
+ int ncmd;
sflag = dosuffix;
eflag = printerrors;
@@ -231,11 +231,11 @@ int dosuffix, printerrors;
static int
initpaths(paths)
-register char **paths;
+char **paths;
{
- register char *path, *val, *p, *q;
- register int i, done;
- register struct pelem *pe, *pathend;
+ char *path, *val, *p, *q;
+ int i, done;
+ struct pelem *pe, *pathend;
freepaths();
for (npaths = 0; path = paths[npaths]; npaths++) {
@@ -284,11 +284,11 @@ register char **paths;
static void
savepaths(paths)
-register char **paths;
+char **paths;
{
- register char *p, *q;
- register int npath, i, len;
- register struct pelem *pe;
+ char *p, *q;
+ int npath, i, len;
+ struct pelem *pe;
for (npath = 0, pe = pathhead; pe; npath++, pe = pe->pnext) {
len = strlen(pe->pname) + 1;
@@ -314,9 +314,9 @@ register char **paths;
static void
freepaths()
{
- register char *p;
- register int i;
- register struct pelem *pe;
+ char *p;
+ int i;
+ struct pelem *pe;
if (npaths == 0 || pathhead == NULL)
return;
@@ -348,9 +348,9 @@ static void
rcmd(localsyspath) /* reset path with localsyspath */
char *localsyspath;
{
- register int n, done;
- register char *new, *p;
- register struct pelem *pe;
+ int n, done;
+ char *new, *p;
+ struct pelem *pe;
char newbuf[MAXPATHLEN+1];
for (pe = pathhead; pe; pe = pe->pnext) {
@@ -392,9 +392,9 @@ static void
icmd(path, localsyspath) /* insert path before localsyspath */
char *path, *localsyspath;
{
- register int n;
- register char *new;
- register struct pelem *pe;
+ int n;
+ char *new;
+ struct pelem *pe;
char newbuf[MAXPATHLEN+1];
for (pe = pathhead; pe; pe = pe->pnext) {
@@ -417,8 +417,8 @@ static void
iacmd(inpath, path) /* insert path after inpath */
char *inpath, *path;
{
- register int n;
- register struct pelem *pe;
+ int n;
+ struct pelem *pe;
for (pe = pathhead; pe; pe = pe->pnext) {
n = locate(pe, inpath);
@@ -434,8 +434,8 @@ static void
ibcmd(inpath, path) /* insert path before inpath */
char *inpath, *path;
{
- register int n;
- register struct pelem *pe;
+ int n;
+ struct pelem *pe;
for (pe = pathhead; pe; pe = pe->pnext) {
n = locate(pe, inpath);
@@ -452,7 +452,7 @@ incmd(path, n) /* insert path at position n */
char *path;
int n;
{
- register struct pelem *pe;
+ struct pelem *pe;
for (pe = pathhead; pe; pe = pe->pnext)
insert(pe, n, path);
@@ -460,12 +460,12 @@ int n;
static void
insert(pe, loc, key)
-register struct pelem *pe;
-register int loc;
-register char *key;
+struct pelem *pe;
+int loc;
+char *key;
{
- register int i;
- register char *new;
+ int i;
+ char *new;
char newbuf[2000];
if (sflag) { /* add suffix */
@@ -491,8 +491,8 @@ static void
dcmd(path) /* delete path */
char *path;
{
- register int n;
- register struct pelem *pe;
+ int n;
+ struct pelem *pe;
for (pe = pathhead; pe; pe = pe->pnext) {
n = locate(pe, path);
@@ -508,7 +508,7 @@ static void
dncmd(n) /* delete at position n */
int n;
{
- register struct pelem *pe;
+ struct pelem *pe;
for (pe = pathhead; pe; pe = pe->pnext) {
if (n < pe->pdirs)
@@ -522,10 +522,10 @@ int n;
static void
delete(pe, n)
-register struct pelem *pe;
+struct pelem *pe;
int n;
{
- register int d;
+ int d;
xfree((ptr_t) (pe->pdir[n]));
for (d = n; d < pe->pdirs - 1; d++)
@@ -541,8 +541,8 @@ static void
ccmd(inpath, path) /* change inpath to path */
char *inpath, *path;
{
- register int n;
- register struct pelem *pe;
+ int n;
+ struct pelem *pe;
for (pe = pathhead; pe; pe = pe->pnext) {
n = locate(pe, inpath);
@@ -559,7 +559,7 @@ cncmd(path, n) /* change at position n to path */
char *path;
int n;
{
- register struct pelem *pe;
+ struct pelem *pe;
for (pe = pathhead; pe; pe = pe->pnext) {
if (n < pe->pdirs)
@@ -573,11 +573,11 @@ int n;
static void
change(pe, loc, key)
-register struct pelem *pe;
-register int loc;
-register char *key;
+struct pelem *pe;
+int loc;
+char *key;
{
- register char *new;
+ char *new;
char newbuf[MAXPATHLEN+1];
if (sflag) { /* append suffix */
@@ -597,11 +597,11 @@ register char *key;
static int
locate(pe, key)
-register struct pelem *pe;
-register char *key;
+struct pelem *pe;
+char *key;
{
- register int i;
- register char *realkey;
+ int i;
+ char *realkey;
char keybuf[MAXPATHLEN+1];
if (sflag) {
diff --git a/contrib/tcsh/nls/C/set11 b/contrib/tcsh/nls/C/set11
index 312a9c952b2b..069ed41d73fe 100644
--- a/contrib/tcsh/nls/C/set11
+++ b/contrib/tcsh/nls/C/set11
@@ -1,4 +1,4 @@
-$ $Id: set11,v 1.2 1995/03/19 18:07:15 christos Exp $
+$ $Id: set11,v 1.3 2005/03/21 21:26:37 kim Exp $
$ sh.c
$set 11
1 Warning: no access to tty (%s).\n
@@ -8,3 +8,24 @@ $set 11
5 You have %smail.\n
6 new
7 You have %smail in %s.\n
+8 -b file batch mode, read and execute commands from `file' \n\
+-c command run `command' from next argument \n\
+-d load directory stack from `~/.cshdirs' \n\
+-Dname[=value] define environment variable `name' to `value' (DomainOS only) \n\
+-e exit on any error \n\
+-f start faster by ignoring the start-up file \n\
+-F use fork() instead of vfork() when spawning (ConvexOS only) \n\
+-i interactive, even when input is not from a terminal \n\
+-l act as a login shell, must be the only option specified \n\
+-m load the start-up file, whether or not owned by effective user \n\
+-n file no execute mode, just check syntax of the following `file' \n\
+-q accept SIGQUIT for running under a debugger \n\
+-s read commands from standard input \n\
+-t read one line from standard input \n\
+-v echo commands after history substitution \n\
+-V like -v but including commands read from the start-up file \n\
+-x echo commands immediately before execution \n\
+-X like -x but including commands read from the start-up file \n\
+--help print this message and exit \n\
+--version print the version shell variable and exit \n\
+\nSee the tcsh(1) manual page for detailed information.\n
diff --git a/contrib/tcsh/nls/ja/set1 b/contrib/tcsh/nls/ja/set1
index b999e0706aef..0be6a77dda99 100644
--- a/contrib/tcsh/nls/ja/set1
+++ b/contrib/tcsh/nls/ja/set1
@@ -1,32 +1,33 @@
-$ $Id: set1,v 1.3 1999/05/11 13:08:29 christos Exp $
+$ $Id: set1,v 1.4 2004/12/25 22:24:58 christos Exp $
$ Error messages
$set 1
1 文法が間違っています
-3 文章が長すぎます
+2 %s は割り当てられていません
+3 文字列が長すぎます
4 $< の行が長すぎます
5 $0 用のファイルがありません
6 [] 修飾子が不完全です
7 $ 展開は ] の前に終わる必要があります
8 $ 内の : 修飾子が間違っています (%c)
9 配列の添え字が間違っています
-10 不適切に生成された番号です
+10 番号が正しい書式になっていません
11 文字列はもうありません
-12 ファイル名が間違っています
+12 ファイル名が間違っているかファイルが存在しません
13 globの内部エラーです
14 コマンドが見つかりません
-15 アーギュメントが不足しています
-16 アーギュメントが多過ぎます
+15 引数が不足しています
+16 引数が多過ぎます
17 危険なエイリアス定義です
-18 ifがありません
+18 if文の中に条件がありません
19 間違ったthenです
20 文字列が括弧内にありません
21 %s が見つかりません
22 間違ったmaskです
23 そのようなlimit値はありません
-24 アーギュメントが長すぎます
+24 引数が長すぎます
25 オプション単位が不明か間違っています
-26 変数を定義していません
-27 ディレクトリースタックの番号指定が深過ぎます
+26 定義されていない変数です
+27 ディレクトリースタックの指定が深過ぎます
28 シグナル番号が間違っています
29 シグナルの名前が間違っています "kill -l"で見る事が出来ます
30 変数名は英字で始める必要があります
@@ -37,7 +38,7 @@ $set 1
35 ホームディレクトリーがありません
36 ホームディレクトリーに変更できません
37 不正なヌルコマンドです
-38 式が間違っている割当があります
+38 代入式が欠けている箇所があります
39 定義されていない演算子です
40 曖昧です
41 %sと言うファイルはすでに存在します
@@ -50,8 +51,8 @@ $set 1
48 while/foreachの中ではありません
49 プロセスを生成できません
50 照合パターンに合いません
-51 間違った %c です
-52 %c が一致しません
+51 %c が欠けている箇所があります
+52 %c が対応しません
53 メモリが不足しています
54 パイプを作れません
55 %s: %s
@@ -61,7 +62,7 @@ $set 1
59 カレントのjobはありません
60 前のjobはありません
61 ジョブがパターンに一致しません
-62 Forkの深さが %dを超えました; おそらくループです
+62 Forkの深さが %dを超えました; おそらく``のネストが深すぎる為です。
63 このsubshellではジョブコントロールは使用できません
64 sync失敗: プロセス %d が見つかりません
65 %s中断したjobが残っています
@@ -74,23 +75,23 @@ $set 1
72 ログインシェルではありません
73 0で割り算しました
74 0で割り算しました(余り計算)
-75 間違ったオプション単位: "%s"の意味は?
+75 間違ったオプション単位です: "%s"ではありませんか?
76 ログインシェルなので中断できません
77 %sというユーザーは存在しません
-78 $home変数が設定されていません
-79 形式: history [-%s] [# number of events]
-80 $, ! もしくは < は $# もしくは $? と一緒には使用できません
+78 変数$homeが設定されていません
+79 形式: history [-%s] [イベント番号]
+80 $、 ! もしくは < は $# もしくは $? と一緒には使用できません
81 変数名に改行が入っています
82 * は $# もしくは $? と一緒には使用できません
-83 $?<digit> もしくは $#<digit> は使用できません
+83 $?<数字> もしくは $#<数字> は使用できません
84 変数名が不正です
85 変数インデックスに改行が入っています
-86 拡張バッファーオーバーフロー
+86 展開用バッファーオーバーフロー
87 変数構文?
-88 間違った ! 形式です
+88 間違った ! の書式です
89 前の置換はありません
90 不正な置換です
-91 左サイドがありません
+91 直前の左サイドがありません
92 右サイドが長過ぎます
93 間違った ! 修飾子です: %c
94 修飾子の失敗です
@@ -101,15 +102,15 @@ $set 1
99 ")"が多すぎます
100 "("が多すぎます
101 ( の場所が間違っています
-102 リダイレクト向けの名前が間違っています
-103 曖昧なリダイレクト出力です
-104 () に対して << は使えません
-105 曖昧なリダイレクト入力です
+102 リダイレクト先の名前が欠けています
+103 曖昧な出力リダイレクトです
+104 () の中で << は使えません
+105 曖昧な入力リダイレクトです
106 () の場所が間違っています
-107 エイリアスの無限ループが発生しました
+107 エイリアスがループしています
108 変数"$watch"が設定されていません
-109 スケジュールにイベントは設定されていません
-110 形式: sched -<item#>.\nUsage: sched [+]hh:mm <command>
+109 スケジュールされたイベントはありません
+110 形式: sched -<項目番号>.\n形式: sched [+]hh:mm <コマンド>
111 スケジュールされたイベントはありません
112 実行できるコマンドはありません
113 不正なイベント開始時間です
@@ -118,8 +119,8 @@ $set 1
116 形式: settc %s [yes|no]
117 知らないcapability `%s'
118 知らないtermcapパラメタ `%%%c'
-119 `%s' 向けのアーギュメントが多過ぎます (%d)
-120 `%s' は %d アーギュメントが必要です
+119 `%s' に対する引数が多過ぎます (%d)
+120 `%s' には %d 引数が必要です
121 形式: echotc [-v|-s] [<capability> [<args>]]
122 %s: %s. 間違ったアーキテクチャです
123 !# ヒストリーのループ
@@ -136,4 +137,4 @@ $set 1
134 形式: unlimit [-fh] [limits]
135 $%S は読取専用です
136 jobが見つかりません
-137 不明のcolorls設定です `%c%c'
+137 不明のcolorls変数です `%c%c'
diff --git a/contrib/tcsh/nls/ja/set3 b/contrib/tcsh/nls/ja/set3
new file mode 100644
index 000000000000..0db172640b71
--- /dev/null
+++ b/contrib/tcsh/nls/ja/set3
@@ -0,0 +1,124 @@
+$ $Id: set3,v 1.4 2001/04/26 19:07:48 kim Exp $
+$ Editor function descriptions
+$set 3
+1 1文字戻る
+2 カーソル位置の文字を削除
+3 現在のワードの先頭からカーソルまでを削除 - カットバッファーに保存
+4 行頭からカーソルまでを削除 - カットバッファーに保存
+5 現在のワードの先頭に移動
+6 行頭に移動
+7 カーソル位置からワードの末尾までをキャピタライズ
+8 カーソル位置の大文字小文字を変換し、1文字移動(vi)
+9 行末までを変更(vi)
+10 画面クリアして現在行を画面の最上行に
+11 現在のワードを補完
+12 Tab forward through files
+13 Tab backward through files
+14 プログラム可能な補完を使わない現在のワードの補完
+15 現在のワードのカーソル位置までをコピー
+16 マーク位置からカーソルまでの領域をカットバッファーにコピー
+17 Expand to preceding word for which this is a prefix
+18 カーソル位置の文字を削除
+19 カーソル位置の文字を削除。空行ではend of fileを示す
+20 カーソル位置の文字を削除。行末では補完候補一覧
+21 カーソル位置の文字を削除。end of fileをsignalもしくは補完候補一覧
+22 カーソル位置から現在のワードの末尾までを削除。カットバッファーに保存。
+23 Adds to argument if started or enters digit
+24 Digit that starts argument
+25 次の履歴行に移動
+26 カーソル位置から現在のワードの末尾までを小文字にする
+27 ファイル終端を表示
+28 行末にカーソルを移動
+29 カーソルとマークを入れ替える
+30 ファイル名のワイルドカードを展開
+31 履歴エスケイプを展開
+32 行中の履歴エスケイプを展開
+33 変数を展開
+34 1文字進む
+35 現在のワード末まで移動
+36 カーソルの前の2文字を入れ替える
+37 現在行と同じように始まるものを履歴中から後ろ向きに検索
+38 現在行と同じように始まるものを履歴中から前向きに検索
+39 前のコマンドの最後の項目を挿入
+40 順方向インクリメンタル検索
+41 逆方向インクリメンタル検索
+42 1行クリア
+43 行末まで削除してカットバッファーに保存
+44 マーク位置からカーソルまでの領域を削除してカットバッファーに保存
+45 1行全体を削除してカットバッファーに保存
+46 補完候補の一覧
+47 プログラム可能な補完を使用しない補完候補の一覧
+48 ワイルドカードに合致するファイル名の一覧
+49 補完候補の一覧。空行の場合はend of fileを示す。
+50 平均負荷と現在のプロセスの状態を表示
+51 履歴エスケイプを展開して空白を挿入
+52 コマンド実行
+53 パス名を展開(.や..で始まるものを除く)
+54 コマンドを実際のパス名や別名に展開
+55 挿入モードから上書きモードへの切り替えもしくはその逆
+56 次に打つ文字の8bitめを立てる
+57 次に打つ文字を行にそのまま加える
+58 すべてを再描画
+59 停止していたエディターを再起動
+60 現在のコマンドのヘルプを探す
+61 この文字は行に加えられる
+62 この文字は文字シーケンスの先頭
+63 カーソル位置をマークする
+64 現在のワードの綴りを訂正
+65 1行全体の綴りを訂正C
+66 文字をcockedモードでttyに送る
+67 Toggle between literal and lexical current history line
+68 カーソルの左の文字を1つ小さいものにする
+69 カーソルの前の2つの文字を入れ替える
+70 delayed suspend文字を試す
+71 flush output文字を試す
+72 interrupt文字を試す
+73 quit文字を試す
+74 suspend文字を試す
+75 allow output文字を試す
+76 disallow文字を試す
+77 割り当てられていない文字を表示
+78 Emacs universal argument (argument times 4)
+79 1つ前の履歴行に移動
+80 カーソル位置から現在のワードの末尾までを大文字にする
+81 次のワードの先頭へ移動(vi)
+82 カーソルの後ろへ挿入モードへ移行(vi)
+83 カーソル位置に挿入モードへ移行(vi)
+84 カーソル位置の大文字小文字を変換し、1文字進む(vi)
+85 Vi change prefix command
+86 行末までを変更(vi)
+87 コマンドモードへ移行 (キー割り当て変更)(vi)
+88 コマンドモードでの現在のワードの補完(vi)
+89 前の文字に移動(バックスペイス)(vi)
+90 Vi delete prefix command
+91 現在のワード間の空白の末尾に移動(vi)
+92 現在のワードの末尾に移動(vi)
+93 逆方向の指定された文字に移動(vi)
+94 順方法の指定された文字に移動(vi)
+95 逆方向の指定された文字の直前まで移動(vi)
+96 順方向の指定された文字の直前まで移動(vi)
+97 viの挿入モードに移行
+98 行頭でviの挿入モードに移行
+99 現在の1文字検索を同じ方向に繰り返す(vi)
+100 現在の1文字検索を反対方向に繰り返す(vi)
+101 現在の検索を同じ方向に繰り返す(vi)
+102 現在の検索を反対方向に繰り返す(vi)
+103 位置の1文字を次に打つ1文字と置換(vi)
+104 置換モードreplace mode(vi)
+105 逆方向履歴検索(vi)
+106 順方向履歴検索(vi)
+107 カーソル位置の文字を置換して挿入モードに移行(vi)
+108 1行全置換(vi)
+109 前のワードへ移動(vi)
+110 次のワードへ移行(vi)
+111 直前の変更を取り消す(vi)
+112 行の先頭へ移動(vi)
+113 Perform which of current command
+114 カットバッファーの内容をカーソル位置に貼り付ける
+115 Replace just-yanked text with yank from earlier kill
+116 (WIN32のみ) カットバッファーの内容をシステムのクリップボードにコピー
+117 (WIN32のみ) クリップボードの内容をカーソル位置に貼り付け
+118 (WIN32のみ) 次のワード中の'/'をすべて'\\\\'に変換
+119 (WIN32のみ) 前のワード中の'/'をすべて'\\\\'に変換
+120 (WIN32のみ) Page visible console window up
+121 (WIN32のみ) Page visible console window down
diff --git a/contrib/tcsh/nls/ja/set4 b/contrib/tcsh/nls/ja/set4
new file mode 100644
index 000000000000..9c29143bbc88
--- /dev/null
+++ b/contrib/tcsh/nls/ja/set4
@@ -0,0 +1,45 @@
+$ $Id: set4,v 1.2 1995/03/19 18:07:15 christos Exp $
+$ Termcap strings
+$set 4
+1 新規空行追加
+2 可聴性ベル
+3 最下行までクリア
+4 行末までクリア
+5 カーソル水平移動
+6 画面クリア
+7 1文字削除
+8 1行削除
+9 削除モード開始
+10 削除モード終了
+11 挿入モード終了
+12 cursor from status line
+13 カーソルをホーム位置へ
+14 文字挿入
+15 挿入モード開始
+16 パディング挿入
+17 カーソル下移動
+18 カーソル左移動
+19 カーソル右移動
+20 カーソル上移動
+21 ボールド開始
+22 属性終了
+23 分割禁止空白
+24 強調終了
+25 強調開始
+26 カーソルをステイタス行へ
+27 カーソルを1つ上へ
+28 下線開始
+29 下線終了
+30 視覚的ベル
+31 複数文字削除
+32 カーソル下移動(multiple)
+33 複数文字挿入
+34 カーソルj左移動(multiple)
+35 カーソル右移動(multiple)
+36 カーソル上移動(multiple)
+37 自動マージン可能
+38 物理タブ使用可能
+39 行数
+40 桁数
+41 メタキーあり
+42 右マージンを無視した改行
diff --git a/contrib/tcsh/nls/ja/set7 b/contrib/tcsh/nls/ja/set7
new file mode 100644
index 000000000000..3c01263a74ff
--- /dev/null
+++ b/contrib/tcsh/nls/ja/set7
@@ -0,0 +1,30 @@
+$ $Id: set7,v 1.1 2005/03/23 01:25:47 kim Exp $
+$ ed.screen.c
+$set 7
+1 \n\tTcsh の推測では、あなたの端末は\n
+2 \t以下の特性を持っています:\n\n
+3 \t%d 桁 %d 行\n
+4 \tmeta キーを%s\n
+5 持っています
+6 持っていません
+7 \ttab を使う%s\n
+8 ことができません
+9 \t自動マージンを%s\n
+10 持っています
+11 持っていません
+12 \tマジックマージンを%s\n
+13 (未定義)
+14 ある
+15 ない
+16 エラー: 削除できません\r\n
+17 DeleteChars: ありえない数値です: %d\r\n
+18 エラー: 挿入できません\r\n
+19 StartInsert: ありえない数値です: %d\r\n
+20 %s: /etc/termcap を開くことができません.\n
+21 %s: ターミナルタイプ "%s" は登録されていません\n
+22 %s: ダム端末の設定を使います\n
+23 %s: 警告: あなたの端末は move up できません.\n
+24 長い行のため編集がおかしくなっています.\n
+25 行末まで消去するための機能がありません.\n
+26 文字削除の機能がありません.\n
+27 文字挿入の機能がありません.\n
diff --git a/contrib/tcsh/patchlevel.h b/contrib/tcsh/patchlevel.h
index b48ecd0ec887..d25322c1fd50 100644
--- a/contrib/tcsh/patchlevel.h
+++ b/contrib/tcsh/patchlevel.h
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/patchlevel.h,v 3.139 2004/05/19 17:13:20 kim Exp $ */
+/* $Header: /src/pub/tcsh/patchlevel.h,v 3.151 2005/03/25 17:36:08 kim Exp $ */
/*
* patchlevel.h: Our life story.
*/
@@ -7,8 +7,8 @@
#define ORIGIN "Astron"
#define REV 6
-#define VERS 13
-#define PATCHLEVEL 00
-#define DATE "2004-05-19"
+#define VERS 14
+#define PATCHLEVEL 0
+#define DATE "2005-03-25"
#endif /* _h_patchlevel */
diff --git a/contrib/tcsh/sh.c b/contrib/tcsh/sh.c
index efeb39d1b6c4..178b9728a878 100644
--- a/contrib/tcsh/sh.c
+++ b/contrib/tcsh/sh.c
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/sh.c,v 3.109 2004/02/21 20:34:24 christos Exp $ */
+/* $Header: /src/pub/tcsh/sh.c,v 3.123 2005/03/21 21:26:36 kim Exp $ */
/*
* sh.c: Main shell routines
*/
@@ -39,15 +39,14 @@ char copyright[] =
All rights reserved.\n";
#endif /* not lint */
-RCSID("$Id: sh.c,v 3.109 2004/02/21 20:34:24 christos Exp $")
+RCSID("$Id: sh.c,v 3.123 2005/03/21 21:26:36 kim Exp $")
#include "tc.h"
#include "ed.h"
#include "tw.h"
-extern bool MapsAreInited;
-extern bool NLSMapsAreInited;
-extern bool NoNLSRebind;
+extern int MapsAreInited;
+extern int NLSMapsAreInited;
/*
* C Shell
@@ -94,7 +93,7 @@ int do_logout = 0;
#endif /* TESLA */
-bool use_fork = 0; /* use fork() instead of vfork()? */
+int use_fork = 0; /* use fork() instead of vfork()? */
/*
* Magic pointer values. Used to specify other invalid conditions aside
@@ -105,20 +104,20 @@ Char *INVPTR = &INVCHAR;
Char **INVPPTR = &INVPTR;
static int nofile = 0;
-static bool reenter = 0;
-static bool nverbose = 0;
-static bool nexececho = 0;
-static bool quitit = 0;
-static bool rdirs = 0;
-bool fast = 0;
-static bool batch = 0;
-static bool mflag = 0;
-static bool prompt = 1;
-static int enterhist = 0;
-bool tellwhat = 0;
+static int reenter = 0;
+static int nverbose = 0;
+static int nexececho = 0;
+static int quitit = 0;
+static int rdirs = 0;
+int fast = 0;
+static int batch = 0;
+static int mflag = 0;
+static int prompt = 1;
+int enterhist = 0;
+int tellwhat = 0;
time_t t_period;
Char *ffile = NULL;
-bool dolzero = 0;
+int dolzero = 0;
int insource = 0;
int exitset = 0;
static time_t chktim; /* Time mail last checked */
@@ -145,10 +144,10 @@ struct saved_state {
Char *alvecp;
Char **alvec;
int onelflg;
- bool enterhist;
+ int enterhist;
Char **argv;
Char HIST;
- bool cantell;
+ int cantell;
struct Bin B;
/* These keep signal state and setjump state */
#ifdef BSDSIGS
@@ -160,12 +159,12 @@ struct saved_state {
static int srccat __P((Char *, Char *));
#ifndef WINNT_NATIVE
-static int srcfile __P((char *, bool, int, Char **));
+static int srcfile __P((const char *, int, int, Char **));
#else
-int srcfile __P((char *, bool, int, Char **));
+int srcfile __P((const char *, int, int, Char **));
#endif /*WINNT_NATIVE*/
-static sigret_t phup __P((int));
-static void srcunit __P((int, bool, int, Char **));
+static RETSIGTYPE phup __P((int));
+static void srcunit __P((int, int, int, Char **));
static void mailchk __P((void));
#ifndef _PATH_DEFPATH
static Char **defaultpath __P((void));
@@ -182,13 +181,13 @@ main(argc, argv)
int argc;
char **argv;
{
- register Char *cp;
+ Char *cp;
#ifdef AUTOLOGOUT
- register Char *cp2;
+ Char *cp2;
#endif
- register char *tcp, *ttyn;
- register int f;
- register char **tempv;
+ char *tcp, *ttyn;
+ int f;
+ char **tempv;
int osetintr;
signalfun_t oparintr;
@@ -212,10 +211,9 @@ main(argc, argv)
nlsinit();
#ifdef MALLOC_TRACE
- mal_setstatsfile(fdopen(dup2(open("/tmp/tcsh.trace",
- O_WRONLY|O_CREAT|O_LARGEFILE, 0666), 25),
- "w"));
- mal_trace(1);
+ mal_setstatsfile(fdopen(dmove(open("/tmp/tcsh.trace",
+ O_WRONLY|O_CREAT|O_LARGEFILE, 0666), 25), "w"));
+ mal_trace(1);
#endif /* MALLOC_TRACE */
#if !(defined(BSDTIMES) || defined(_SEQUENT_)) && defined(POSIX)
@@ -364,7 +362,7 @@ main(argc, argv)
for (k = 0200; k <= 0377 && !Isprint(k); k++)
continue;
- AsciiOnly = k > 0377;
+ AsciiOnly = MB_CUR_MAX == 1 && k > 0377;
}
#else
AsciiOnly = getenv("LANG") == NULL && getenv("LC_CTYPE") == NULL;
@@ -676,6 +674,11 @@ main(argc, argv)
set(STRaddsuffix, Strsave(STRNULL), VAR_READWRITE);
/*
+ * Compatibility with tcsh >= 6.12 by default
+ */
+ set(STRcsubstnonl, Strsave(STRNULL), VAR_READWRITE);
+
+ /*
* Random default kill ring size
*/
set(STRkillring, SAVE("30"), VAR_READWRITE);
@@ -801,6 +804,11 @@ main(argc, argv)
xprintf("%S\n", varval(STRversion));
xexit(0);
}
+ if (argc > 1 && strcmp(argv[1], "--help") == 0) {
+ xprintf("%S\n\n", varval(STRversion));
+ xprintf(CGETS(11, 8, HELP_STRING));
+ xexit(0);
+ }
/*
* Process the arguments.
*
@@ -856,7 +864,7 @@ main(argc, argv)
* ensure that you don't make * nonportable csh scripts.
*/
{
- register int count;
+ int count;
cp = arginp + Strlen(arginp);
count = 0;
@@ -877,7 +885,7 @@ main(argc, argv)
#ifdef apollo
case 'D': /* -D Define environment variable */
{
- register Char *dp;
+ Char *dp;
cp = str2short(tcp);
if (dp = Strchr(cp, '=')) {
@@ -1391,9 +1399,9 @@ void
importpath(cp)
Char *cp;
{
- register int i = 0;
- register Char *dp;
- register Char **pv;
+ int i = 0;
+ Char *dp;
+ Char **pv;
int c;
for (dp = cp; *dp; dp++)
@@ -1438,7 +1446,7 @@ srccat(cp, dp)
if (cp[0] == '/' && cp[1] == '\0')
return srcfile(short2str(dp), (mflag ? 0 : 1), 0, NULL);
else {
- register Char *ep;
+ Char *ep;
char *ptr;
int rv;
@@ -1468,12 +1476,12 @@ static int
int
#endif /*WINNT_NATIVE*/
srcfile(f, onlyown, flag, av)
- char *f;
- bool onlyown;
+ const char *f;
+ int onlyown;
int flag;
Char **av;
{
- register int unit;
+ int unit;
if ((unit = open(f, O_RDONLY|O_LARGEFILE)) == -1)
return 0;
@@ -1516,12 +1524,21 @@ st_save(st, unit, hflg, al, av)
st->OLDSTD = st->SHOUT = st->SHDIAG = -1;/* test later to restore these */
if (didfds) {
struct stat s1, s2;
- if (NEED_SAVE_FD(0,OLDSTD))
- st->OLDSTD = OLDSTD, OLDSTD = dmove(0, -1);
- if (NEED_SAVE_FD(1,SHOUT))
- st->SHOUT = SHOUT, SHOUT = dmove(1, -1);
- if (NEED_SAVE_FD(2,SHDIAG))
- st->SHDIAG = SHDIAG, SHDIAG = dmove(2, -1);
+ if (NEED_SAVE_FD(0,OLDSTD)) {
+ st->OLDSTD = OLDSTD;
+ OLDSTD = dmove(0, -1);
+ (void)close_on_exec(OLDSTD, 1);
+ }
+ if (NEED_SAVE_FD(1,SHOUT)) {
+ st->SHOUT = SHOUT;
+ SHOUT = dmove(1, -1);
+ (void)close_on_exec(SHOUT, 1);
+ }
+ if (NEED_SAVE_FD(2,SHDIAG)) {
+ st->SHDIAG = SHDIAG;
+ SHDIAG = dmove(2, -1);
+ (void)close_on_exec(SHDIAG, 1);
+ }
donefds();
}
@@ -1596,9 +1613,9 @@ st_restore(st, av)
/* Reset input arena */
{
- register int i;
- register Char** nfbuf = fbuf;
- register int nfblocks = fblocks;
+ int i;
+ Char** nfbuf = fbuf;
+ int nfblocks = fblocks;
fblocks = 0;
fbuf = NULL;
@@ -1644,8 +1661,8 @@ st_restore(st, av)
*/
static void
srcunit(unit, onlyown, hflg, av)
- register int unit;
- bool onlyown;
+ int unit;
+ int onlyown;
int hflg;
Char **av;
{
@@ -1731,6 +1748,7 @@ goodbye(v, c)
Char **v;
struct command *c;
{
+ USE(v);
USE(c);
record();
@@ -1777,7 +1795,7 @@ exitstat()
/*
* in the event of a HUP we want to save the history
*/
-static sigret_t
+static RETSIGTYPE
phup(snum)
int snum;
{
@@ -1846,9 +1864,6 @@ int snum;
#endif /* POSIXJOBS */
xexit(snum);
-#ifndef SIGVOID
- return (snum);
-#endif
}
static Char *jobargv[2] = {STRjobs, 0};
@@ -1862,29 +1877,24 @@ static Char *jobargv[2] = {STRjobs, 0};
*/
int just_signaled; /* bugfix by Michael Bloom (mg@ttidca.TTI.COM) */
-#ifdef SIGVOID
-/*ARGSUSED*/
-#endif
-sigret_t
+RETSIGTYPE
pintr(snum)
int snum;
{
+ USE(snum);
#ifdef UNRELSIGS
if (snum)
(void) sigset(snum, pintr);
#endif /* UNRELSIGS */
just_signaled = 1;
pintr1(1);
-#ifndef SIGVOID
- return (snum);
-#endif
}
void
pintr1(wantnl)
- bool wantnl;
+ int wantnl;
{
- register Char **v;
+ Char **v;
#ifdef BSDSIGS
sigmask_t omask;
#endif
@@ -1907,15 +1917,11 @@ pintr1(wantnl)
}
/* MH - handle interrupted completions specially */
{
- extern int InsideCompletion;
-
if (InsideCompletion)
stderror(ERR_SILENT);
}
/* JV - Make sure we shut off inputl */
{
- extern Char GettingInput;
-
(void) Cookedmode();
GettingInput = 0;
}
@@ -1927,9 +1933,9 @@ pintr1(wantnl)
(void) sigrelse(SIGCHLD);
#endif
drainoline();
-#if !defined(_VMS_POSIX) && !defined(WINNT_NATIVE)
+#ifdef HAVE_GETPWENT
(void) endpwent();
-#endif /* !_VMS_POSIX && !WINNT_NATIVE */
+#endif
/*
* If we have an active "onintr" then we search for the label. Note that if
@@ -1982,9 +1988,8 @@ pintr1(wantnl)
static struct command *savet = NULL;
void
process(catch)
- bool catch;
+ int catch;
{
- extern char Expand;
jmp_buf_t osetexit;
/* PWP: This might get nuked my longjmp so don't make it a register var */
struct command *t = savet;
@@ -2181,7 +2186,6 @@ process(catch)
freesyn(savet), savet = NULL;
#ifdef SIG_WINDOW
if (windowchg || (catch && intty && !whyles && !tellwhat)) {
- windowchg = 0;
(void) check_window_size(0); /* for window systems */
}
#endif /* SIG_WINDOW */
@@ -2194,12 +2198,11 @@ process(catch)
/*ARGSUSED*/
void
dosource(t, c)
- register Char **t;
+ Char **t;
struct command *c;
{
- register Char *f;
- bool hflg = 0;
- extern int bequiet;
+ Char *f;
+ int hflg = 0;
char buf[BUFSIZE];
USE(c);
@@ -2253,12 +2256,12 @@ dosource(t, c)
static void
mailchk()
{
- register struct varent *v;
- register Char **vp;
+ struct varent *v;
+ Char **vp;
time_t t;
int intvl, cnt;
struct stat stb;
- bool new;
+ int new;
v = adrof(STRmail);
if (v == NULL || v->vec == NULL)
@@ -2328,16 +2331,18 @@ mailchk()
mailcount, filename);
}
else {
+ char *type;
+
if (stb.st_size == 0 || stb.st_atime > stb.st_mtime ||
(stb.st_atime <= chktim && stb.st_mtime <= chktim) ||
(loginsh && !new))
continue;
+ type = strsave(new ? CGETS(11, 6, "new ") : "");
if (cnt == 1)
- xprintf(CGETS(11, 5, "You have %smail.\n"),
- new ? CGETS(11, 6, "new ") : "");
+ xprintf(CGETS(11, 5, "You have %smail.\n"), type);
else
- xprintf(CGETS(11, 7, "You have %smail in %s.\n"),
- new ? CGETS(11, 6, "new ") : "", filename);
+ xprintf(CGETS(11, 7, "You have %smail in %s.\n"), type, filename);
+ xfree(type);
}
}
chktim = t;
@@ -2387,7 +2392,7 @@ initdesc()
{
#ifdef NLS_BUGS
#ifdef NLS_CATALOGS
- (void)catclose(catd);
+ nlsclose();
#endif /* NLS_CATALOGS */
#endif /* NLS_BUGS */
@@ -2462,7 +2467,7 @@ xexit(i)
* because messages will stop working on the parent too.
*/
if (child == 0)
- (void) catclose(catd);
+ nlsclose();
#endif /* NLS_CATALOGS */
#ifdef WINNT_NATIVE
nt_cleanup();
diff --git a/contrib/tcsh/sh.char.h b/contrib/tcsh/sh.char.h
index c6f19e89300c..a4b20b1cd1b3 100644
--- a/contrib/tcsh/sh.char.h
+++ b/contrib/tcsh/sh.char.h
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/sh.char.h,v 3.20 2002/07/01 20:50:21 christos Exp $ */
+/* $Header: /src/pub/tcsh/sh.char.h,v 3.26 2005/03/03 16:49:15 kim Exp $ */
/*
* sh.char.h: Table for spotting special characters quickly
* Makes for very obscure but efficient coding.
@@ -37,6 +37,13 @@
# include <appkit/NXCType.h>
#else
# include <ctype.h>
+# ifdef SHORT_STRINGS
+# ifdef HAVE_WCTYPE_H
+# include <wctype.h>
+# else
+# include <wchar.h>
+# endif
+# endif
#endif
typedef unsigned char tcshuc;
@@ -45,7 +52,6 @@ typedef unsigned char tcshuc;
#endif /* _MINIX */
extern unsigned short _cmap[];
#if defined(DSPMBYTE)
-extern unsigned short _mbmap[];
# define CHECK_MBYTEVAR STRdspmbyte
#endif
extern unsigned short _cmap_c[];
@@ -75,31 +81,26 @@ extern tcshuc _cmap_lower[], _cmap_upper[];
#define _ESC 0x0040 /* \ */
#define _DOL 0x0080 /* $ */
#define _DIG 0x0100 /* 0-9 */
-#define _LET 0x0200 /* a-z, A-Z, _ */
-#define _UP 0x0400 /* A-Z */
-#define _DOW 0x0800 /* a-z */
+#define _LET 0x0200 /* a-z, A-Z, _, or locale-specific */
+#define _UP 0x0400 /* A-Z, or locale-specific */
+#define _DOW 0x0800 /* a-z, or locale-specific */
#define _XD 0x1000 /* 0-9, a-f, A-F */
#define _CMD 0x2000 /* lex end of command chars, ;&(|` */
#define _CTR 0x4000 /* control */
#define _PUN 0x8000 /* punctuation */
-#if defined(SHORT_STRINGS) && defined(KANJI)
+#ifdef IS_ASCII
# define ASC(ch) ch
# define CTL_ESC(ch) ch
-# define cmap(c, bits) \
- ((((c) & QUOTE) || ((c & 0x80) && adrof(STRnokanji))) ? \
- 0 : (_cmap[(tcshuc)(c)] & (bits)))
-#else /* SHORT_STRINGS && KANJI */
-# ifdef IS_ASCII
-# define ASC(ch) ch
-# define CTL_ESC(ch) ch
-# define cmap(c, bits) \
- (((c) & QUOTE) ? 0 : (_cmap[(tcshuc)(c)] & (bits)))
-# else /* IS_ASCII */
+#else
+# ifdef _OSD_POSIX
/* "BS2000 OSD" is a POSIX on a main frame using a EBCDIC char set */
+# include <ascii_ebcdic.h>
+# else
/* "OS/390 USS" is a POSIX on a main frame using an IBM1047 char set */
-extern unsigned short _toascii[256];
-extern unsigned short _toebcdic[256];
+# endif
+ extern unsigned short _toascii[256];
+ extern unsigned short _toebcdic[256];
/* mainly for comparisons if (ASC(ch)=='\177')... */
# define ASC(ch) _toascii[(tcshuc)ch]
@@ -108,27 +109,55 @@ extern unsigned short _toebcdic[256];
* for C-Escapes ('\b'), the compiler already does it.
*/
# define CTL_ESC(ch) _toebcdic[(tcshuc)ch]
+#endif /*IS_ASCII*/
+#ifdef WIDE_STRINGS
+# define cmap(c, bits) \
+ (((c) & QUOTE) || (c) >= 0x0080 ? 0 : (_cmap[(tcshuc)ASC(c)] & (bits)))
+#elif defined(SHORT_STRINGS) && defined(KANJI)
# define cmap(c, bits) \
- (((c) & QUOTE) ? 0 : (_cmap[_toascii[(tcshuc)(c)]] & (bits)))
-# endif /* IS_ASCII */
+ ((((c) & QUOTE) || ((ASC(c) & 0x80) && adrof(STRnokanji))) ? \
+ 0 : (_cmap[(tcshuc)ASC(c)] & (bits)))
+#else /* SHORT_STRINGS && KANJI */
+# define cmap(c, bits) \
+ (((c) & QUOTE) ? 0 : (_cmap[(tcshuc)ASC(c)] & (bits)))
#endif /* SHORT_STRINGS && KANJI */
#define isglob(c) cmap(c, _GLOB)
#define isspc(c) cmap(c, _SP)
#define ismeta(c) cmap(c, _META)
#define iscmdmeta(c) cmap(c, _CMD)
-#define letter(c) (((Char)(c) & QUOTE) ? 0 : \
+#ifdef WIDE_STRINGS
+#define letter(c) (((c) & QUOTE) ? 0 : \
+ (iswalpha((tcshuc) (c)) || (c) == '_'))
+#define alnum(c) (((c) & QUOTE) ? 0 : \
+ (iswalnum((tcshuc) (c)) || (c) == '_'))
+#else
+#define letter(c) (((Char)(c) & QUOTE) ? 0 : \
(isalpha((tcshuc) (c)) || (c) == '_'))
-#define alnum(c) (((Char)(c) & QUOTE) ? 0 : \
+#define alnum(c) (((Char)(c) & QUOTE) ? 0 : \
(isalnum((tcshuc) (c)) || (c) == '_'))
+#endif
#if defined(DSPMBYTE)
# define IsmbyteU(c) (Ismbyte1((Char)(c))||(Ismbyte2((Char)(c))&&((c)&0200)))
#endif
#ifdef NLS
-# ifdef NeXT
+# ifdef WIDE_STRINGS
+# define Isspace(c) (((c) & QUOTE) ? 0 : iswspace(c))
+# define Isdigit(c) (((c) & QUOTE) ? 0 : iswdigit(c))
+# define Isalpha(c) (((c) & QUOTE) ? 0 : iswalpha(c))
+# define Islower(c) (((c) & QUOTE) ? 0 : iswlower(c))
+# define Isupper(c) (((c) & QUOTE) ? 0 : iswupper(c))
+# define Tolower(c) (((c) & QUOTE) ? 0 : (wchar_t)towlower(c))
+# define Toupper(c) (((c) & QUOTE) ? 0 : (wchar_t)towupper(c))
+# define Isxdigit(c) (((c) & QUOTE) ? 0 : iswxdigit(c))
+# define Isalnum(c) (((c) & QUOTE) ? 0 : iswalnum(c))
+# define Iscntrl(c) (((c) & QUOTE) ? 0 : iswcntrl(c))
+# define Isprint(c) (((c) & QUOTE) ? 0 : iswprint(c))
+# define Ispunct(c) (((c) & QUOTE) ? 0 : iswpunct(c))
+# elif defined (NeXT)
# define Isspace(c) (((Char)(c) & QUOTE) ? 0 : NXIsSpace((unsigned) (c)))
# define Isdigit(c) (((Char)(c) & QUOTE) ? 0 : NXIsDigit((unsigned) (c)))
# define Isalpha(c) (((Char)(c) & QUOTE) ? 0 : NXIsAlpha((unsigned) (c)))
@@ -218,14 +247,8 @@ extern unsigned short _toebcdic[256];
# define Isalpha(c) (cmap(c,_LET) && !(((c) & META) && AsciiOnly))
# define Islower(c) (cmap(c,_DOW) && !(((c) & META) && AsciiOnly))
# define Isupper(c) (cmap(c, _UP) && !(((c) & META) && AsciiOnly))
-# ifdef IS_ASCII
-# define Tolower(c) (_cmap_lower[(tcshuc)(c)])
-# define Toupper(c) (_cmap_upper[(tcshuc)(c)])
-# else
-/* "BS2000 OSD" is a POSIX on a main frame using a EBCDIC char set */
-# define Tolower(c) (_cmap_lower[_toascii[(tcshuc)(c)]])
-# define Toupper(c) (_cmap_upper[_toascii[(tcshuc)(c)]])
-# endif
+# define Tolower(c) (_cmap_lower[ASC(c)])
+# define Toupper(c) (_cmap_upper[ASC(c)])
# define Isxdigit(c) cmap(c, _XD)
# define Isalnum(c) (cmap(c, _DIG|_LET) && !(((Char)(c) & META) && AsciiOnly))
#if defined(DSPMBYTE)
@@ -241,6 +264,14 @@ extern unsigned short _toebcdic[256];
#endif /* !NLS */
+#if defined (SHORT_STRINGS) && defined (NLS)
+# define Iswcntrl(c) (((c) & QUOTE) ? 0 : iswcntrl(c))
+# define Iswprint(c) (((c) & QUOTE) ? 0 : iswprint(c))
+#else
+# define Iswcntrl(c) Iscntrl(c)
+# define Iswprint(c) Isprint(c)
+#endif
+
#if defined(DSPMBYTE)
# define Ismbyte1(c) ((_mbmap[(c) & 0377] & _MB1) ? 1 : 0)
# define Ismbyte2(c) ((_mbmap[(c) & 0377] & _MB2) ? 1 : 0)
diff --git a/contrib/tcsh/sh.decls.h b/contrib/tcsh/sh.decls.h
index 5be81078f038..b2dec327ef40 100644
--- a/contrib/tcsh/sh.decls.h
+++ b/contrib/tcsh/sh.decls.h
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/sh.decls.h,v 3.39 2004/03/21 16:48:14 christos Exp $ */
+/* $Header: /src/pub/tcsh/sh.decls.h,v 3.46 2005/03/03 17:04:01 kim Exp $ */
/*
* sh.decls.h External declarations from sh*.c
*/
@@ -42,9 +42,9 @@ extern void exitstat __P((void));
extern void goodbye __P((Char **, struct command *));
extern void importpath __P((Char *));
extern void initdesc __P((void));
-extern sigret_t pintr __P((int));
-extern void pintr1 __P((bool));
-extern void process __P((bool));
+extern RETSIGTYPE pintr __P((int));
+extern void pintr1 __P((int));
+extern void process __P((int));
extern void untty __P((void));
#ifdef PROF
extern void done __P((int));
@@ -87,13 +87,13 @@ extern void stderror __P((unsigned int, ...));
/*
* sh.exec.c
*/
-extern void doexec __P((struct command *, bool));
+extern void doexec __P((struct command *, int));
extern void dohash __P((Char **, struct command *));
extern void dounhash __P((Char **, struct command *));
extern void execash __P((Char **, struct command *));
extern void hashstat __P((Char **, struct command *));
extern void xechoit __P((Char **));
-extern int executable __P((Char *, Char *, bool));
+extern int executable __P((Char *, Char *, int));
extern int tellmewhat __P((struct wordent *, Char *));
extern void dowhere __P((Char **, struct command *));
extern int find_cmd __P((Char *, int));
@@ -101,9 +101,9 @@ extern int find_cmd __P((Char *, int));
/*
* sh.exp.c
*/
-extern Char *filetest __P((Char *, Char ***, bool));
+extern Char *filetest __P((Char *, Char ***, int));
extern int expr __P((Char ***));
-extern int exp0 __P((Char ***, bool));
+extern int exp0 __P((Char ***, int));
/*
* sh.file.c
@@ -115,7 +115,7 @@ extern int tenex __P((Char *, int));
/*
* sh.func.c
*/
-extern void tsetenv __P((Char *, Char *));
+extern void tsetenv __P((const Char *, const Char *));
extern void Unsetenv __P((Char *));
extern void doalias __P((Char **, struct command *));
extern void dobreak __P((Char **, struct command *));
@@ -165,31 +165,40 @@ extern void reexecute __P((struct command *));
* sh.glob.c
*/
extern Char *globequal __P((Char *, Char *));
-extern Char **dobackp __P((Char *, bool));
+extern Char **dobackp __P((Char *, int));
extern void Gcat __P((Char *, Char *));
extern Char *globone __P((Char *, int));
extern int Gmatch __P((Char *, Char *));
extern int Gnmatch __P((Char *, Char *, Char **));
extern void ginit __P((void));
extern Char **globall __P((Char **));
-extern void rscan __P((Char **, void (*)(int)));
+extern void rscan __P((Char **, void (*)(Char)));
extern void tglob __P((Char **));
extern void trim __P((Char **));
#if defined(FILEC) && defined(TIOCSTI)
extern int sortscmp __P((Char **, Char **));
#endif
+
+#ifndef WINNT_NATIVE
+#ifdef NLS_CATALOGS
+#ifdef HAVE_ICONV
+extern char *iconv_catgets __P((nl_catd, int, int, const char *));
+#endif
+#endif
+#endif
extern void nlsinit __P((void));
+extern void nlsclose __P((void));
extern int t_pmatch __P((Char *, Char *, Char **, int));
/*
* sh.hist.c
*/
extern void dohist __P((Char **, struct command *));
-extern struct Hist *enthist __P((int, struct wordent *, bool, bool));
-extern void savehist __P((struct wordent *, bool));
+extern struct Hist *enthist __P((int, struct wordent *, int, int));
+extern void savehist __P((struct wordent *, int));
extern void fmthist __P((int, ptr_t, char *, size_t));
extern void rechist __P((Char *, int));
-extern void loadhist __P((Char *, bool));
+extern void loadhist __P((Char *, int));
/*
* sh.init.c
@@ -205,19 +214,19 @@ extern void btell __P((struct Ain *));
extern void btoeof __P((void));
extern void copylex __P((struct wordent *,
struct wordent *));
-extern Char *domod __P((Char *, int));
+extern Char *domod __P((Char *, Char));
extern void freelex __P((struct wordent *));
extern int lex __P((struct wordent *));
extern void prlex __P((struct wordent *));
-extern int readc __P((bool));
+extern eChar readc __P((int));
extern void settell __P((void));
-extern void unreadc __P((int));
+extern void unreadc __P((Char));
/*
* sh.misc.c
*/
-extern int any __P((char *, int));
+extern int any __P((const char *, Char));
extern Char **blkcpy __P((Char **, Char **));
extern void blkfree __P((Char **));
extern int blklen __P((Char **));
@@ -235,7 +244,7 @@ extern void donefds __P((void));
extern Char lastchr __P((Char *));
extern void lshift __P((Char **, int));
extern int number __P((Char *));
-extern int prefix __P((Char *, Char *));
+extern int prefix __P((const Char *, const Char *));
extern Char **saveblk __P((Char **));
extern void setzero __P((char *, int));
extern Char *strip __P((Char *));
@@ -247,7 +256,7 @@ extern void udvar __P((Char *));
extern char *strstr __P((const char *, const char *));
#endif /* !POSIX */
#ifndef SHORT_STRINGS
-extern char *strspl __P((char *, char *));
+extern char *strspl __P((const char *, const char *));
extern char *strend __P((char *));
#endif /* SHORT_STRINGS */
@@ -265,7 +274,7 @@ extern struct command *syntax __P((struct wordent *,
extern void drainoline __P((void));
extern void flush __P((void));
#ifdef BSDTIMES
-extern void pcsecs __P((long));
+extern void pcsecs __P((unsigned long));
#else /* !BSDTIMES */
# ifdef POSIX
extern void pcsecs __P((clock_t));
@@ -274,11 +283,18 @@ extern void pcsecs __P((time_t));
# endif /* !POSIX */
#endif /* BSDTIMES */
#ifdef BSDLIMIT
-extern void psecs __P((long));
+extern void psecs __P((unsigned long));
#endif /* BSDLIMIT */
extern int putpure __P((int));
extern int putraw __P((int));
extern void xputchar __P((int));
+#ifdef WIDE_STRINGS
+extern void putwraw __P((Char));
+extern void xputwchar __P((Char));
+#else
+# define putwraw(C) putraw(C)
+# define xputwchar(C) xputchar(C)
+#endif
/*
@@ -294,8 +310,8 @@ extern void donotify __P((Char **, struct command *));
extern void dostop __P((Char **, struct command *));
extern void dowait __P((Char **, struct command *));
extern void palloc __P((int, struct command *));
-extern void panystop __P((bool));
-extern sigret_t pchild __P((int));
+extern void panystop __P((int));
+extern RETSIGTYPE pchild __P((int));
extern void pendjob __P((void));
extern int pfork __P((struct command *, int));
extern void pgetty __P((int, int));
@@ -311,7 +327,7 @@ extern struct process *pfind __P((Char *));
* sh.sem.c
*/
extern void execute __P((struct command *, int, int *,
- int *, bool));
+ int *, int));
extern void mypipe __P((int *));
/*
diff --git a/contrib/tcsh/sh.dir.c b/contrib/tcsh/sh.dir.c
index 13bac43dc7cb..fdd85b797dac 100644
--- a/contrib/tcsh/sh.dir.c
+++ b/contrib/tcsh/sh.dir.c
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/sh.dir.c,v 3.63 2004/05/10 19:12:37 christos Exp $ */
+/* $Header: /src/pub/tcsh/sh.dir.c,v 3.66 2005/03/03 16:40:53 kim Exp $ */
/*
* sh.dir.c: Directory manipulation functions
*/
@@ -31,8 +31,9 @@
* SUCH DAMAGE.
*/
#include "sh.h"
+#include "ed.h"
-RCSID("$Id: sh.dir.c,v 3.63 2004/05/10 19:12:37 christos Exp $")
+RCSID("$Id: sh.dir.c,v 3.66 2005/03/03 16:40:53 kim Exp $")
/*
* C Shell - directory management
@@ -46,7 +47,8 @@ static Char *dgoto __P((Char *));
static void dnewcwd __P((struct directory *, int));
static void dset __P((Char *));
static void dextract __P((struct directory *));
-static int skipargs __P((Char ***, char *, char *));
+static int skipargs __P((Char ***, const char *,
+ const char *));
static void dgetstack __P((void));
static struct directory dhead INIT_ZERO_STRUCT; /* "head" of loop */
@@ -68,9 +70,9 @@ void
dinit(hp)
Char *hp;
{
- register char *tcp;
- register Char *cp;
- register struct directory *dp;
+ char *tcp;
+ Char *cp;
+ struct directory *dp;
char path[MAXPATHLEN];
/* Don't believe the login shell home, because it may be a symlink */
@@ -162,8 +164,8 @@ Char *dp;
static int
skipargs(v, dstr, str)
Char ***v;
- char *dstr;
- char *str;
+ const char *dstr;
+ const char *str;
{
Char **n = *v, *s;
@@ -235,10 +237,9 @@ static void
printdirs(dflag)
int dflag;
{
- register struct directory *dp;
+ struct directory *dp;
Char *s, *user;
int idx, len, cur;
- extern int T_Cols;
dp = dcwd;
idx = 0;
@@ -264,7 +265,7 @@ printdirs(dflag)
}
if (user)
xprintf("~%S", user);
- xprintf("\045S%c", s, (dflag & DIR_VERT) ? '\n' : ' ');
+ xprintf("%-S%c", s, (dflag & DIR_VERT) ? '\n' : ' ');
} while ((dp = dp->di_prev) != dcwd);
if (!(dflag & DIR_VERT))
xputchar('\n');
@@ -276,7 +277,7 @@ dtildepr(dir)
{
Char* user;
if ((user = getusername(&dir)) != NULL)
- xprintf("~\045S%S", user, dir);
+ xprintf("~%-S%S", user, dir);
else
xprintf("%S", dir);
}
@@ -306,9 +307,9 @@ dtilde()
* Otherwise, a copy is made and sent back.
*/
Char *
-dnormalize(cp, exp)
+dnormalize(cp, expnd)
Char *cp;
- int exp;
+ int expnd;
{
/* return true if dp is of the form "../xxx" or "/../xxx" */
@@ -316,12 +317,12 @@ dnormalize(cp, exp)
#define IS_DOT(sp, p) (ISDOT(p) && ((p) == (sp) || *((p) - 1) == '/'))
#ifdef S_IFLNK
- if (exp) {
+ if (expnd) {
int dotdot = 0;
Char *dp, *cwd, *start = cp, buf[MAXPATHLEN];
struct stat sb;
# ifdef apollo
- bool slashslash;
+ int slashslash;
# endif /* apollo */
/*
@@ -450,8 +451,8 @@ dochngd(v, c)
Char **v;
struct command *c;
{
- register Char *cp;
- register struct directory *dp;
+ Char *cp;
+ struct directory *dp;
int dflag = skipargs(&v, "plvn", "[-|<dir>]");
USE(c);
@@ -504,7 +505,7 @@ dgoto(cp)
if (!ABSOLUTEP(cp))
{
- register Char *p, *q;
+ Char *p, *q;
int cwdlen;
for (p = dcwd->di_name; *p++;)
@@ -547,9 +548,9 @@ dgoto(cp)
*/
static Char *
dfollow(cp)
- register Char *cp;
+ Char *cp;
{
- register Char *dp;
+ Char *dp;
struct varent *c;
char ebuf[MAXPATHLEN];
int serrno;
@@ -593,7 +594,7 @@ dfollow(cp)
if (cp[0] != '/' && !prefix(STRdotsl, cp) && !prefix(STRdotdotsl, cp)
&& (c = adrof(STRcdpath)) && c->vec != NULL) {
Char **cdp;
- register Char *p;
+ Char *p;
Char buf[MAXPATHLEN];
for (cdp = c->vec; *cdp; cdp++) {
@@ -652,8 +653,8 @@ dopushd(v, c)
Char **v;
struct command *c;
{
- register struct directory *dp;
- register Char *cp;
+ struct directory *dp;
+ Char *cp;
int dflag = skipargs(&v, "plvn", " [-|<dir>|+<n>]");
USE(c);
@@ -711,7 +712,7 @@ dopushd(v, c)
dextract(dp);
}
else {
- register Char *ccp;
+ Char *ccp;
if ((ccp = dfollow(cp)) == NULL)
return;
@@ -731,11 +732,11 @@ dopushd(v, c)
*/
static struct directory *
dfind(cp)
- register Char *cp;
+ Char *cp;
{
- register struct directory *dp;
- register int i;
- register Char *ep;
+ struct directory *dp;
+ int i;
+ Char *ep;
if (*cp++ != '+')
return (0);
@@ -766,7 +767,7 @@ dopopd(v, c)
struct command *c;
{
Char *cp;
- register struct directory *dp, *p = NULL;
+ struct directory *dp, *p = NULL;
int dflag = skipargs(&v, "plvn", " [-|+<n>]");
USE(c);
@@ -808,7 +809,7 @@ dopopd(v, c)
*/
void
dfree(dp)
- register struct directory *dp;
+ struct directory *dp;
{
if (dp->di_count != 0) {
@@ -827,18 +828,18 @@ dfree(dp)
*/
Char *
dcanon(cp, p)
- register Char *cp, *p;
+ Char *cp, *p;
{
- register Char *sp;
- register Char *p1, *p2; /* general purpose */
- bool slash;
+ Char *sp;
+ Char *p1, *p2; /* general purpose */
+ int slash;
#ifdef apollo
- bool slashslash;
+ int slashslash;
#endif /* apollo */
size_t clen;
#ifdef S_IFLNK /* if we have symlinks */
- Char link[MAXPATHLEN];
+ Char mlink[MAXPATHLEN];
char tlink[MAXPATHLEN];
int cc;
Char *newcp;
@@ -935,9 +936,9 @@ dcanon(cp, p)
(cc = readlink(short2str(cp), tlink,
sizeof(tlink) - 1)) >= 0) {
tlink[cc] = '\0';
- (void) Strncpy(link, str2short(tlink),
- sizeof(link) / sizeof(Char));
- link[sizeof(link) / sizeof(Char) - 1] = '\0';
+ (void) Strncpy(mlink, str2short(tlink),
+ sizeof(mlink) / sizeof(Char));
+ mlink[sizeof(mlink) / sizeof(Char) - 1] = '\0';
if (slash)
*p = '/';
@@ -950,7 +951,7 @@ dcanon(cp, p)
*/
for (p1 = p; *p1++;)
continue;
- if (*link != '/') {
+ if (*mlink != '/') {
/*
* Relative path, expand it between the "yyy/" and the
* "/..". First, back sp up to the character past "yyy/".
@@ -960,7 +961,7 @@ dcanon(cp, p)
sp++;
*sp = 0;
/*
- * New length is "yyy/" + link + "/.." and rest
+ * New length is "yyy/" + mlink + "/.." and rest
*/
p1 = newcp = (Char *) xmalloc((size_t)
(((sp - cp) + cc + (p1 - p)) *
@@ -970,7 +971,7 @@ dcanon(cp, p)
*/
for (p2 = cp; (*p1++ = *p2++) != '\0';)
continue;
- for (p1--, p2 = link; (*p1++ = *p2++) != '\0';)
+ for (p1--, p2 = mlink; (*p1++ = *p2++) != '\0';)
continue;
for (p1--, p2 = p; (*p1++ = *p2++) != '\0';)
continue;
@@ -981,14 +982,14 @@ dcanon(cp, p)
}
else {
/*
- * New length is link + "/.." and rest
+ * New length is mlink + "/.." and rest
*/
p1 = newcp = (Char *) xmalloc((size_t)
((cc + (p1 - p)) * sizeof(Char)));
/*
* Copy new path into newcp
*/
- for (p2 = link; (*p1++ = *p2++) != '\0';)
+ for (p2 = mlink; (*p1++ = *p2++) != '\0';)
continue;
for (p1--, p2 = p; (*p1++ = *p2++) != '\0';)
continue;
@@ -1026,9 +1027,9 @@ dcanon(cp, p)
(cc = readlink(short2str(cp), tlink,
sizeof(tlink) - 1)) >= 0) {
tlink[cc] = '\0';
- (void) Strncpy(link, str2short(tlink),
- sizeof(link) / sizeof(Char));
- link[sizeof(link) / sizeof(Char) - 1] = '\0';
+ (void) Strncpy(mlink, str2short(tlink),
+ sizeof(mlink) / sizeof(Char));
+ mlink[sizeof(mlink) / sizeof(Char) - 1] = '\0';
/*
* restore the '/'.
@@ -1046,7 +1047,7 @@ dcanon(cp, p)
*/
for (p1 = p; *p1++;)
continue;
- if (*link != '/') {
+ if (*mlink != '/') {
/*
* Relative path, expand it between the "yyy/" and the
* remainder. First, back sp up to the character past
@@ -1057,7 +1058,7 @@ dcanon(cp, p)
sp++;
*sp = 0;
/*
- * New length is "yyy/" + link + "/.." and rest
+ * New length is "yyy/" + mlink + "/.." and rest
*/
p1 = newcp = (Char *) xmalloc((size_t)
(((sp - cp) + cc + (p1 - p))
@@ -1067,7 +1068,7 @@ dcanon(cp, p)
*/
for (p2 = cp; (*p1++ = *p2++) != '\0';)
continue;
- for (p1--, p2 = link; (*p1++ = *p2++) != '\0';)
+ for (p1--, p2 = mlink; (*p1++ = *p2++) != '\0';)
continue;
for (p1--, p2 = p; (*p1++ = *p2++) != '\0';)
continue;
@@ -1078,14 +1079,14 @@ dcanon(cp, p)
}
else {
/*
- * New length is link + the rest
+ * New length is mlink + the rest
*/
p1 = newcp = (Char *) xmalloc((size_t)
((cc + (p1 - p)) * sizeof(Char)));
/*
* Copy new path into newcp
*/
- for (p2 = link; (*p1++ = *p2++) != '\0';)
+ for (p2 = mlink; (*p1++ = *p2++) != '\0';)
continue;
for (p1--, p2 = p; (*p1++ = *p2++) != '\0';)
continue;
@@ -1099,7 +1100,7 @@ dcanon(cp, p)
#ifdef apollo
slashslash = (cp[0] == '/' && cp[1] == '/');
#endif /* apollo */
- continue; /* canonicalize the link */
+ continue; /* canonicalize the mlink */
}
#endif /* S_IFLNK */
if (slash)
@@ -1136,8 +1137,8 @@ dcanon(cp, p)
/*
* Start comparing dev & ino backwards
*/
- p2 = Strncpy(link, cp, sizeof(link) / sizeof(Char));
- link[sizeof(link) / sizeof(Char) - 1] = '\0';
+ p2 = Strncpy(mlink, cp, sizeof(mlink) / sizeof(Char));
+ mlink[sizeof(mlink) / sizeof(Char) - 1] = '\0';
found = 0;
while (*p2 && stat(short2str(p2), &statbuf) != -1) {
if (DEV_DEV_COMPARE(statbuf.st_dev, home_dev) &&
@@ -1184,7 +1185,7 @@ dcanon(cp, p)
*/
static void
dnewcwd(dp, dflag)
- register struct directory *dp;
+ struct directory *dp;
int dflag;
{
int print;
@@ -1353,7 +1354,6 @@ recdirs(fname, def)
{
int fp, ftmp, oldidfds;
int cdflag = 0;
- extern struct directory *dcwd;
struct directory *dp;
unsigned int num;
Char *snum;
diff --git a/contrib/tcsh/sh.dol.c b/contrib/tcsh/sh.dol.c
index 13b5f00777a7..f5ee7eb08691 100644
--- a/contrib/tcsh/sh.dol.c
+++ b/contrib/tcsh/sh.dol.c
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/sh.dol.c,v 3.52 2003/03/12 19:14:51 christos Exp $ */
+/* $Header: /src/pub/tcsh/sh.dol.c,v 3.55 2004/12/25 21:15:06 christos Exp $ */
/*
* sh.dol.c: Variable substitutions
*/
@@ -32,7 +32,7 @@
*/
#include "sh.h"
-RCSID("$Id: sh.dol.c,v 3.52 2003/03/12 19:14:51 christos Exp $")
+RCSID("$Id: sh.dol.c,v 3.55 2004/12/25 21:15:06 christos Exp $")
/*
* C shell
@@ -47,10 +47,11 @@ RCSID("$Id: sh.dol.c,v 3.52 2003/03/12 19:14:51 christos Exp $")
* some QUOTEing may have occurred already, so we dont "trim()" here.
*/
-static int Dpeekc, Dpeekrd; /* Peeks for DgetC and Dreadc */
+static Char Dpeekc; /* Peek for DgetC */
+static eChar Dpeekrd; /* Peek for Dreadc */
static Char *Dcp, **Dvp; /* Input vector for Dreadc */
-#define DEOF -1
+#define DEOF CHAR_ERR
#define unDgetC(c) Dpeekc = c
@@ -82,13 +83,13 @@ static void Dfix2 __P((Char **));
static Char *Dpack __P((Char *, Char *));
static int Dword __P((void));
static void dolerror __P((Char *));
-static int DgetC __P((int));
+static eChar DgetC __P((int));
static void Dgetdol __P((void));
static void fixDolMod __P((void));
static void setDolp __P((Char *));
-static void unDredc __P((int));
-static int Dredc __P((void));
-static void Dtestq __P((int));
+static void unDredc __P((eChar));
+static eChar Dredc __P((void));
+static void Dtestq __P((Char));
/*
* Fix up the $ expansions and quotations in the
@@ -96,21 +97,16 @@ static void Dtestq __P((int));
*/
void
Dfix(t)
- register struct command *t;
+ struct command *t;
{
- register Char **pp;
- register Char *p;
+ Char **pp;
+ Char *p;
if (noexec)
return;
/* Note that t_dcom isn't trimmed thus !...:q's aren't lost */
for (pp = t->t_dcom; (p = *pp++) != NULL;) {
for (; *p; p++) {
-#ifdef DSPMBYTE
- if (Ismbyte1(*p) && *(p + 1))
- p ++;
- else
-#endif /* DSPMBYTE */
if (cmap(*p, _DOL | QUOTES)) { /* $, \, ', ", ` */
Dfix2(t->t_dcom); /* found one */
blkfree(t->t_dcom);
@@ -127,7 +123,7 @@ Dfix(t)
*/
Char *
Dfix1(cp)
- register Char *cp;
+ Char *cp;
{
Char *Dv[2];
@@ -170,30 +166,11 @@ static Char *
Dpack(wbuf, wp)
Char *wbuf, *wp;
{
- register int c;
- register int i = MAXWLEN - (int) (wp - wbuf);
-#if defined(DSPMBYTE)
- int mbytepos = 1;
-#endif /* DSPMBYTE */
+ eChar c;
+ int i = MAXWLEN - (int) (wp - wbuf);
for (;;) {
c = DgetC(DODOL);
-#if defined(DSPMBYTE)
- if (mbytepos == 1 && Ismbyte1(c)) {
- /* An MB1 byte that may be followed by a MB2 byte */
- mbytepos = 2;
- }
- else {
- /* check if MB1 byte followed by an MB2 byte */
- if (mbytepos == 2 && Ismbyte2(c)) {
- /* MB1 + MB2 make the character */
- mbytepos = 1; /* reset */
- goto mbyteskip;
- }
- mbytepos = 1; /* reset */
- /* wasn't followed, so the two bytes make two characters */
- }
-#endif /* DSPMBYTE */
if (c == '\\') {
c = DgetC(0);
if (c == DEOF) {
@@ -221,9 +198,6 @@ Dpack(wbuf, wp)
Gcat(STRNULL, wbuf);
return (NULL);
}
-#if defined(DSPMBYTE)
-mbyteskip:
-#endif /* DSPMBYTE */
if (--i <= 0)
stderror(ERR_WTOOLONG);
*wp++ = (Char) c;
@@ -239,12 +213,12 @@ mbyteskip:
static int
Dword()
{
- register int c, c1;
+ eChar c, c1;
Char wbuf[BUFSIZE];
- register Char *wp = wbuf;
- register int i = MAXWLEN;
- register bool dolflg;
- bool sofar = 0, done = 0;
+ Char *wp = wbuf;
+ int i = MAXWLEN;
+ int dolflg;
+ int sofar = 0, done = 0;
while (!done) {
done = 1;
@@ -285,7 +259,7 @@ Dword()
if (c == c1)
break;
if (c == '\n' || c == DEOF)
- stderror(ERR_UNMATCHED, c1);
+ stderror(ERR_UNMATCHED, (int)c1);
if ((c & (QUOTE | TRIM)) == ('\n' | QUOTE)) {
if ((wp[-1] & TRIM) == '\\')
--wp;
@@ -383,11 +357,11 @@ Dword()
* Any QUOTES character which is returned from a $ expansion is
* QUOTEd so that it will not be recognized above.
*/
-static int
+static eChar
DgetC(flag)
- register int flag;
+ int flag;
{
- register int c;
+ Char c;
top:
if ((c = Dpeekc) != 0) {
@@ -447,13 +421,12 @@ dolerror(s)
static void
Dgetdol()
{
- register Char *np;
- register struct varent *vp = NULL;
+ Char *np;
+ struct varent *vp = NULL;
Char name[4 * MAXVARLEN + 1];
- int c, sc;
+ eChar c, sc;
int subscr = 0, lwb = 1, upb = 0;
- bool dimen = 0, bitset = 0, length = 0;
- char tnp;
+ int dimen = 0, bitset = 0, length = 0;
Char wbuf[BUFSIZE];
static Char *dolbang = NULL;
@@ -492,7 +465,9 @@ Dgetdol()
#ifdef COHERENT
/* Coherent compiler doesn't allow case-labels that are not
constant-expressions */
-#ifdef SHORT_STRINGS
+#ifdef WIDE_STRINGS
+ case 0x4000003C: /* Does Coherent have 32-bit int at all? */
+#elif defined (SHORT_STRINGS)
case 0100074:
#else /* !SHORT_STRINGS */
case 0274:
@@ -507,17 +482,45 @@ Dgetdol()
if (length)
stderror(ERR_NOTALLOWED, "$%<");
{
+ char cbuf[MB_LEN_MAX];
+ size_t cbp = 0;
+
#ifdef BSDSIGS
sigmask_t omask = sigsetmask(sigblock(0) & ~sigmask(SIGINT));
#else /* !BSDSIGS */
(void) sigrelse(SIGINT);
#endif /* BSDSIGS */
- for (np = wbuf; force_read(OLDSTD, &tnp, 1) == 1; np++) {
- *np = (unsigned char) tnp;
+ np = wbuf;
+ while (force_read(OLDSTD, cbuf + cbp++, 1) == 1) {
+ int len;
+
+ len = normal_mbtowc(np, cbuf, cbp);
+ if (len == -1) {
+ reset_mbtowc();
+ if (cbp < MB_LEN_MAX)
+ continue; /* Maybe a partial character */
+ *np = (unsigned char)*cbuf | INVALID_BYTE;
+ }
+ if (len <= 0)
+ len = 1;
+ if (cbp != (size_t)len)
+ memmove(cbuf, cbuf + len, cbp - len);
+ cbp -= len;
if (np >= &wbuf[BUFSIZE - 1])
stderror(ERR_LTOOLONG);
- if (tnp == '\n')
+ if (*np == '\n')
break;
+ np++;
+ }
+ while (cbp != 0) {
+ *np = (unsigned char)*cbuf;
+ if (np >= &wbuf[BUFSIZE - 1])
+ stderror(ERR_LTOOLONG);
+ if (*np == '\n')
+ break;
+ np++;
+ cbp--;
+ memmove(cbuf, cbuf + 1, cbp);
}
*np = 0;
#ifdef BSDSIGS
@@ -592,7 +595,7 @@ Dgetdol()
stderror(ERR_DOLZERO);
if (length) {
Char *cp;
- length = Strlen(ffile);
+ length = NLSChars(ffile);
cp = putn(length);
addla(cp);
xfree((ptr_t) cp);
@@ -692,7 +695,7 @@ Dgetdol()
else if (*np != '-')
stderror(ERR_MISSING, '-');
else {
- register int i = upb;
+ int i = upb;
np++;
if (Isdigit(*np)) {
@@ -750,7 +753,7 @@ Dgetdol()
int i;
Char *cp;
for (i = lwb - 1, length = 0; i < upb; i++)
- length += Strlen(vp->vec[i]);
+ length += NLSChars(vp->vec[i]);
#ifdef notdef
/* We don't want that, since we can always compute it by adding $#xxx */
length += i - 1; /* Add the number of spaces in */
@@ -776,7 +779,7 @@ eatbrac:
static void
fixDolMod()
{
- register int c;
+ eChar c;
c = DgetC(0);
if (c == ':') {
@@ -802,7 +805,7 @@ fixDolMod()
if (c == 's') { /* [eichin:19910926.0755EST] */
int delimcnt = 2;
- int delim = DgetC(0);
+ eChar delim = DgetC(0);
dolmod[dolnmod++] = (Char) c;
dolmod[dolnmod++] = (Char) delim;
@@ -811,7 +814,7 @@ fixDolMod()
seterror(ERR_BADSUBST);
break;
}
- while ((c = DgetC(0)) != (-1)) {
+ while ((c = DgetC(0)) != DEOF) {
dolmod[dolnmod++] = (Char) c;
if(c == delim) delimcnt--;
if(!delimcnt) break;
@@ -823,7 +826,7 @@ fixDolMod()
continue;
}
if (!any("luhtrqxes", c))
- stderror(ERR_BADMOD, c);
+ stderror(ERR_BADMOD, (int)c);
#ifndef COMPAT
dolmod[dolnmod++] = (Char) c;
#else
@@ -843,9 +846,9 @@ fixDolMod()
static void
setDolp(cp)
- register Char *cp;
+ Char *cp;
{
- register Char *dp;
+ Char *dp;
#ifndef COMPAT
int i;
#endif /* COMPAT */
@@ -855,6 +858,12 @@ setDolp(cp)
#else
if (dolnmod == 0 || dolmcnt == 0) {
#endif /* COMPAT */
+ for (dp = cp; *dp; dp++) {
+ if (NLSSize(dp, -1) != 1) {
+ addla(cp);
+ return;
+ }
+ }
dolp = cp;
return;
}
@@ -865,7 +874,7 @@ setDolp(cp)
for (i = 0; i < dolnmod; i++) {
/* handle s// [eichin:19910926.0510EST] */
if(dolmod[i] == 's') {
- int delim;
+ Char delim;
Char *lhsub, *rhsub, *np;
size_t lhlen = 0, rhlen = 0;
int didmod = 0;
@@ -968,16 +977,16 @@ setDolp(cp)
static void
unDredc(c)
- int c;
+ eChar c;
{
Dpeekrd = c;
}
-static int
+static eChar
Dredc()
{
- register int c;
+ Char c;
if ((c = Dpeekrd) != 0) {
Dpeekrd = 0;
@@ -995,7 +1004,7 @@ Dredc()
static void
Dtestq(c)
- register int c;
+ Char c;
{
if (cmap(c, QUOTES))
@@ -1011,13 +1020,13 @@ void
heredoc(term)
Char *term;
{
- int c;
+ eChar c;
Char *Dv[2];
- Char obuf[BUFSIZE], lbuf[BUFSIZE], mbuf[BUFSIZE];
+ Char obuf[BUFSIZE + 1], lbuf[BUFSIZE], mbuf[BUFSIZE];
int ocnt, lcnt, mcnt;
- register Char *lbp, *obp, *mbp;
+ Char *lbp, *obp, *mbp;
Char **vp;
- bool quoted;
+ int quoted;
char *tmp;
#ifndef WINNT_NATIVE
struct timeval tv;
@@ -1062,6 +1071,7 @@ again:
quoted = gflag;
ocnt = BUFSIZE;
obp = obuf;
+ obuf[BUFSIZE] = 0;
inheredoc = 1;
#ifdef WINNT_NATIVE
__dup_stdin = 1;
@@ -1080,7 +1090,7 @@ again:
lcnt = BUFSIZE - 4;
for (;;) {
c = readc(1); /* 1 -> Want EOF returns */
- if (c < 0 || c == '\n')
+ if (c == CHAR_ERR || c == '\n')
break;
if ((c &= TRIM) != 0) {
*lbp++ = (Char) c;
@@ -1095,8 +1105,10 @@ again:
/*
* Check for EOF or compare to terminator -- before expansion
*/
- if (c < 0 || eq(lbuf, term)) {
- (void) write(0, short2str(obuf), (size_t) (BUFSIZE - ocnt));
+ if (c == CHAR_ERR || eq(lbuf, term)) {
+ *obp = 0;
+ tmp = short2str(obuf);
+ (void) write(0, tmp, strlen (tmp));
(void) lseek(0, (off_t) 0, L_SET);
inheredoc = 0;
return;
@@ -1111,7 +1123,8 @@ again:
for (lbp = lbuf; (c = *lbp++) != 0;) {
*obp++ = (Char) c;
if (--ocnt == 0) {
- (void) write(0, short2str(obuf), BUFSIZE);
+ tmp = short2str(obuf);
+ (void) write(0, tmp, strlen (tmp));
obp = obuf;
ocnt = BUFSIZE;
}
@@ -1175,14 +1188,16 @@ again:
for (mbp = *vp; *mbp; mbp++) {
*obp++ = *mbp & TRIM;
if (--ocnt == 0) {
- (void) write(0, short2str(obuf), BUFSIZE);
+ tmp = short2str(obuf);
+ (void) write(0, tmp, strlen (tmp));
obp = obuf;
ocnt = BUFSIZE;
}
}
*obp++ = '\n';
if (--ocnt == 0) {
- (void) write(0, short2str(obuf), BUFSIZE);
+ tmp = short2str(obuf);
+ (void) write(0, tmp, strlen (tmp));
obp = obuf;
ocnt = BUFSIZE;
}
diff --git a/contrib/tcsh/sh.err.c b/contrib/tcsh/sh.err.c
index 8bca9fee354d..d111f30b7591 100644
--- a/contrib/tcsh/sh.err.c
+++ b/contrib/tcsh/sh.err.c
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/sh.err.c,v 3.36 2002/03/08 17:36:46 christos Exp $ */
+/* $Header: /src/pub/tcsh/sh.err.c,v 3.39 2005/01/18 20:43:30 christos Exp $ */
/*
* sh.err.c: Error printing routines.
*/
@@ -33,7 +33,7 @@
#define _h_sh_err /* Don't redefine the errors */
#include "sh.h"
-RCSID("$Id: sh.err.c,v 3.36 2002/03/08 17:36:46 christos Exp $")
+RCSID("$Id: sh.err.c,v 3.39 2005/01/18 20:43:30 christos Exp $")
/*
* C Shell
@@ -188,7 +188,7 @@ char *seterr = NULL; /* Holds last error if there was one */
#define ERR_BADCOLORVAR 134
#define NO_ERRORS 135
-static char *elst[NO_ERRORS] INIT_ZERO_STRUCT;
+static const char *elst[NO_ERRORS] INIT_ZERO_STRUCT;
/*
* Init the elst depending on the locale
@@ -371,7 +371,7 @@ errinit()
*/
void
/*VARARGS1*/
-#ifdef FUNCPROTO
+#ifdef PROTOTYPES
seterror(unsigned int id, ...)
#else
seterror(va_alist)
@@ -382,7 +382,7 @@ seterror(va_alist)
if (seterr == 0) {
va_list va;
char berr[BUFSIZE];
-#ifdef FUNCPROTO
+#ifdef PROTOTYPES
va_start(va, id);
#else
unsigned int id;
@@ -419,7 +419,7 @@ seterror(va_alist)
*/
void
/*VARARGS*/
-#ifdef FUNCPROTO
+#ifdef PROTOTYPES
stderror(unsigned int id, ...)
#else
stderror(va_alist)
@@ -427,11 +427,11 @@ stderror(va_alist)
#endif
{
va_list va;
- register Char **v;
+ Char **v;
int flags;
int vareturn;
-#ifdef FUNCPROTO
+#ifdef PROTOTYPES
va_start(va, id);
#else
unsigned int id;
diff --git a/contrib/tcsh/sh.exec.c b/contrib/tcsh/sh.exec.c
index ec6f89ec0ef3..913c95c6d243 100644
--- a/contrib/tcsh/sh.exec.c
+++ b/contrib/tcsh/sh.exec.c
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/sh.exec.c,v 3.58 2003/03/12 19:14:51 christos Exp $ */
+/* $Header: /src/pub/tcsh/sh.exec.c,v 3.63 2004/11/23 02:10:48 christos Exp $ */
/*
* sh.exec.c: Search, find, and execute a command!
*/
@@ -32,7 +32,7 @@
*/
#include "sh.h"
-RCSID("$Id: sh.exec.c,v 3.58 2003/03/12 19:14:51 christos Exp $")
+RCSID("$Id: sh.exec.c,v 3.63 2004/11/23 02:10:48 christos Exp $")
#include "tc.h"
#include "tw.h"
@@ -93,9 +93,9 @@ static int hashdebug = 0;
# define hash(a, b) (((a) * HSHMUL + (b)) % (hashlength))
# define widthof(t) (sizeof(t) * BITS_PER_BYTE)
# define tbit(f, i, t) (((t *) xhash)[(f)] & \
- (1L << (i & (widthof(t) - 1))))
+ (1UL << (i & (widthof(t) - 1))))
# define tbis(f, i, t) (((t *) xhash)[(f)] |= \
- (1L << (i & (widthof(t) - 1))))
+ (1UL << (i & (widthof(t) - 1))))
# define cbit(f, i) tbit(f, i, unsigned char)
# define cbis(f, i) tbis(f, i, unsigned char)
# define sbit(f, i) tbit(f, i, unsigned short)
@@ -148,12 +148,12 @@ static int iscommand __P((Char *));
void
doexec(t, do_glob)
- register struct command *t;
- bool do_glob;
+ struct command *t;
+ int do_glob;
{
Char *dp, **pv, **av, *sav;
struct varent *v;
- bool slash;
+ int slash;
int hashval, i;
Char *blk[2];
@@ -385,11 +385,11 @@ pexerr()
static void
texec(sf, st)
Char *sf;
- register Char **st;
+ Char **st;
{
- register char **t;
- register char *f;
- register struct varent *v;
+ char **t;
+ char *f;
+ struct varent *v;
Char **vp;
Char *lastsh[2];
char pref[2];
@@ -444,7 +444,8 @@ texec(sf, st)
setmode(fd, O_TEXT);
#endif
if ((nread = read(fd, (char *) pref, 2)) == 2) {
- if (!Isprint(pref[0]) && (pref[0] != '\n' && pref[0] != '\t')) {
+ if (!isprint((unsigned char)pref[0]) &&
+ (pref[0] != '\n' && pref[0] != '\t')) {
(void) close(fd);
/*
* We *know* what ENOEXEC means.
@@ -554,7 +555,7 @@ texec(sf, st)
void
execash(t, kp)
Char **t;
- register struct command *kp;
+ struct command *kp;
{
int saveIN, saveOUT, saveDIAG, saveSTD;
int oSHIN;
@@ -592,10 +593,10 @@ execash(t, kp)
oSHDIAG = SHDIAG;
oOLDSTD = OLDSTD;
- saveIN = dcopy(SHIN, -1);
- saveOUT = dcopy(SHOUT, -1);
- saveDIAG = dcopy(SHDIAG, -1);
- saveSTD = dcopy(OLDSTD, -1);
+ (void)close_on_exec (saveIN = dcopy(SHIN, -1), 1);
+ (void)close_on_exec (saveOUT = dcopy(SHOUT, -1), 1);
+ (void)close_on_exec (saveDIAG = dcopy(SHDIAG, -1), 1);
+ (void)close_on_exec (saveSTD = dcopy(OLDSTD, -1), 1);
lshift(kp->t_dcom, 1);
@@ -609,9 +610,9 @@ execash(t, kp)
#else /* !cray */
if ((my_reenter = setexit()) == 0) {
#endif /* cray */
- SHIN = dcopy(0, -1);
- SHOUT = dcopy(1, -1);
- SHDIAG = dcopy(2, -1);
+ (void)close_on_exec (SHIN = dcopy(0, -1), 1);
+ (void)close_on_exec (SHOUT = dcopy(1, -1), 1);
+ (void)close_on_exec (SHDIAG = dcopy(2, -1), 1);
#ifndef CLOSE_ON_EXEC
didcch = 0;
#endif /* CLOSE_ON_EXEC */
@@ -639,10 +640,10 @@ execash(t, kp)
(void) close(SHOUT);
(void) close(SHDIAG);
(void) close(OLDSTD);
- SHIN = dmove(saveIN, oSHIN);
- SHOUT = dmove(saveOUT, oSHOUT);
- SHDIAG = dmove(saveDIAG, oSHDIAG);
- OLDSTD = dmove(saveSTD, oOLDSTD);
+ (void)close_on_exec(SHIN = dmove(saveIN, oSHIN), 1);
+ (void)close_on_exec(SHOUT = dmove(saveOUT, oSHOUT), 1);
+ (void)close_on_exec(SHDIAG = dmove(saveDIAG, oSHDIAG), 1);
+ (void)close_on_exec(OLDSTD = dmove(saveSTD, oOLDSTD), 1);
resexit(osetexit);
if (my_reenter)
@@ -675,7 +676,7 @@ dohash(vv, c)
struct stat stb;
#endif
DIR *dirp;
- register struct dirent *dp;
+ struct dirent *dp;
int i = 0;
struct varent *v = adrof(STRpath);
Char **pv;
@@ -839,9 +840,9 @@ hashstat(v, c)
*/
int
hashname(cp)
- register Char *cp;
+ Char *cp;
{
- register unsigned long h;
+ unsigned long h;
for (h = 0; *cp; cp++)
h = hash(h, *cp);
@@ -852,11 +853,11 @@ static int
iscommand(name)
Char *name;
{
- register Char **pv;
- register Char *sav;
- register struct varent *v;
- register bool slash = any(short2str(name), '/');
- register int hashval, i;
+ Char **pv;
+ Char *sav;
+ struct varent *v;
+ int slash = any(short2str(name), '/');
+ int hashval, i;
v = adrof(STRpath);
if (v == NULL || v->vec == NULL || v->vec[0] == NULL || slash)
@@ -917,7 +918,7 @@ cont:
int
executable(dir, name, dir_ok)
Char *dir, *name;
- bool dir_ok;
+ int dir_ok;
{
struct stat stbuf;
Char path[MAXPATHLEN + 1];
@@ -947,10 +948,10 @@ tellmewhat(lexp, str)
struct wordent *lexp;
Char *str;
{
- register int i;
- register struct biltins *bptr;
- register struct wordent *sp = lexp->next;
- bool aliased = 0, found;
+ int i;
+ struct biltins *bptr;
+ struct wordent *sp = lexp->next;
+ int aliased = 0, found;
Char *s0, *s1, *s2, *cmd;
Char qc;
@@ -1023,9 +1024,9 @@ tellmewhat(lexp, str)
sp->word = cmd = globone(sp->word, G_IGNORE);
if ((i = iscommand(sp->word)) != 0) {
- register Char **pv;
- register struct varent *v;
- bool slash = any(short2str(sp->word), '/');
+ Char **pv;
+ struct varent *v;
+ int slash = any(short2str(sp->word), '/');
v = adrof(STRpath);
if (v == NULL || v->vec == NULL || v->vec[0] == NULL || slash)
@@ -1083,7 +1084,7 @@ tellmewhat(lexp, str)
/*ARGSUSED*/
void
dowhere(v, c)
- register Char **v;
+ Char **v;
struct command *c;
{
int found = 1;
diff --git a/contrib/tcsh/sh.exp.c b/contrib/tcsh/sh.exp.c
index f6f557eeacef..12ee56fb55bf 100644
--- a/contrib/tcsh/sh.exp.c
+++ b/contrib/tcsh/sh.exp.c
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/sh.exp.c,v 3.40 2002/03/08 17:36:46 christos Exp $ */
+/* $Header: /src/pub/tcsh/sh.exp.c,v 3.45 2005/01/18 20:24:50 christos Exp $ */
/*
* sh.exp.c: Expression evaluations
*/
@@ -32,7 +32,7 @@
*/
#include "sh.h"
-RCSID("$Id: sh.exp.c,v 3.40 2002/03/08 17:36:46 christos Exp $")
+RCSID("$Id: sh.exp.c,v 3.45 2005/01/18 20:24:50 christos Exp $")
#include "tw.h"
@@ -58,16 +58,16 @@ RCSID("$Id: sh.exp.c,v 3.40 2002/03/08 17:36:46 christos Exp $")
#define NOTEQMATCH 8
static int sh_access __P((Char *, int));
-static int exp1 __P((Char ***, bool));
-static int exp2 __P((Char ***, bool));
-static int exp2a __P((Char ***, bool));
-static int exp2b __P((Char ***, bool));
-static int exp2c __P((Char ***, bool));
-static Char *exp3 __P((Char ***, bool));
-static Char *exp3a __P((Char ***, bool));
-static Char *exp4 __P((Char ***, bool));
-static Char *exp5 __P((Char ***, bool));
-static Char *exp6 __P((Char ***, bool));
+static int exp1 __P((Char ***, int));
+static int exp2x __P((Char ***, int));
+static int exp2a __P((Char ***, int));
+static int exp2b __P((Char ***, int));
+static int exp2c __P((Char ***, int));
+static Char *exp3 __P((Char ***, int));
+static Char *exp3a __P((Char ***, int));
+static Char *exp4 __P((Char ***, int));
+static Char *exp5 __P((Char ***, int));
+static Char *exp6 __P((Char ***, int));
static void evalav __P((Char **));
static int isa __P((Char *, int));
static int egetn __P((Char *));
@@ -147,23 +147,9 @@ sh_access(fname, mode)
# ifdef NGROUPS_MAX
else {
-# if defined(__386BSD__) || defined(BSD4_4)
- /*
- * These two decided that setgroup() should take an array of int's
- * and they define _SC_NGROUPS_MAX without having sysconf
- */
-# undef _SC_NGROUPS_MAX
-# if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__bsdi__)
-# define GID_T gid_t
-# else
-# define GID_T int
-# endif
-# else
-# define GID_T gid_t
-# endif /* __386BSD__ || BSD4_4 */
/* you can be in several groups */
long n;
- GID_T *groups;
+ GETGROUPS_T *groups;
/*
* Try these things to find a positive maximum groups value:
@@ -172,15 +158,15 @@ sh_access(fname, mode)
* 3) getgroups(0, unused)
* Then allocate and scan the groups array if one of these worked.
*/
-# ifdef _SC_NGROUPS_MAX
+# if defined (HAVE_SYSCONF) && defined (_SC_NGROUPS_MAX)
if ((n = sysconf(_SC_NGROUPS_MAX)) == -1)
# endif /* _SC_NGROUPS_MAX */
n = NGROUPS_MAX;
if (n <= 0)
- n = getgroups(0, (GID_T *) NULL);
+ n = getgroups(0, (GETGROUPS_T *) NULL);
if (n > 0) {
- groups = (GID_T *) xmalloc((size_t) (n * sizeof(GID_T)));
+ groups = xmalloc((size_t) (n * sizeof(*groups)));
n = getgroups((int) n, groups);
while (--n >= 0)
if (groups[n] == statb.st_gid) {
@@ -200,23 +186,23 @@ sh_access(fname, mode)
int
expr(vp)
- register Char ***vp;
+ Char ***vp;
{
return (exp0(vp, 0));
}
int
exp0(vp, ignore)
- register Char ***vp;
- bool ignore;
+ Char ***vp;
+ int ignore;
{
- register int p1 = exp1(vp, ignore);
+ int p1 = exp1(vp, ignore);
#ifdef EDEBUG
etraci("exp0 p1", p1, vp);
#endif /* EDEBUG */
if (**vp && eq(**vp, STRor2)) {
- register int p2;
+ int p2;
(*vp)++;
p2 = exp0(vp, (ignore & TEXP_IGNORE) || p1);
@@ -230,16 +216,16 @@ exp0(vp, ignore)
static int
exp1(vp, ignore)
- register Char ***vp;
- bool ignore;
+ Char ***vp;
+ int ignore;
{
- register int p1 = exp2(vp, ignore);
+ int p1 = exp2x(vp, ignore);
#ifdef EDEBUG
etraci("exp1 p1", p1, vp);
#endif /* EDEBUG */
if (**vp && eq(**vp, STRand2)) {
- register int p2;
+ int p2;
(*vp)++;
p2 = exp1(vp, (ignore & TEXP_IGNORE) || !p1);
@@ -252,20 +238,20 @@ exp1(vp, ignore)
}
static int
-exp2(vp, ignore)
- register Char ***vp;
- bool ignore;
+exp2x(vp, ignore)
+ Char ***vp;
+ int ignore;
{
- register int p1 = exp2a(vp, ignore);
+ int p1 = exp2a(vp, ignore);
#ifdef EDEBUG
etraci("exp3 p1", p1, vp);
#endif /* EDEBUG */
if (**vp && eq(**vp, STRor)) {
- register int p2;
+ int p2;
(*vp)++;
- p2 = exp2(vp, ignore);
+ p2 = exp2x(vp, ignore);
#ifdef EDEBUG
etraci("exp3 p2", p2, vp);
#endif /* EDEBUG */
@@ -276,16 +262,16 @@ exp2(vp, ignore)
static int
exp2a(vp, ignore)
- register Char ***vp;
- bool ignore;
+ Char ***vp;
+ int ignore;
{
- register int p1 = exp2b(vp, ignore);
+ int p1 = exp2b(vp, ignore);
#ifdef EDEBUG
etraci("exp2a p1", p1, vp);
#endif /* EDEBUG */
if (**vp && eq(**vp, STRcaret)) {
- register int p2;
+ int p2;
(*vp)++;
p2 = exp2a(vp, ignore);
@@ -299,16 +285,16 @@ exp2a(vp, ignore)
static int
exp2b(vp, ignore)
- register Char ***vp;
- bool ignore;
+ Char ***vp;
+ int ignore;
{
- register int p1 = exp2c(vp, ignore);
+ int p1 = exp2c(vp, ignore);
#ifdef EDEBUG
etraci("exp2b p1", p1, vp);
#endif /* EDEBUG */
if (**vp && eq(**vp, STRand)) {
- register int p2;
+ int p2;
(*vp)++;
p2 = exp2b(vp, ignore);
@@ -322,12 +308,12 @@ exp2b(vp, ignore)
static int
exp2c(vp, ignore)
- register Char ***vp;
- bool ignore;
+ Char ***vp;
+ int ignore;
{
- register Char *p1 = exp3(vp, ignore);
- register Char *p2;
- register int i;
+ Char *p1 = exp3(vp, ignore);
+ Char *p2;
+ int i;
#ifdef EDEBUG
etracc("exp2c p1", p1, vp);
@@ -370,11 +356,11 @@ exp2c(vp, ignore)
static Char *
exp3(vp, ignore)
- register Char ***vp;
- bool ignore;
+ Char ***vp;
+ int ignore;
{
- register Char *p1, *p2;
- register int i;
+ Char *p1, *p2;
+ int i;
p1 = exp3a(vp, ignore);
#ifdef EDEBUG
@@ -416,11 +402,11 @@ exp3(vp, ignore)
static Char *
exp3a(vp, ignore)
- register Char ***vp;
- bool ignore;
+ Char ***vp;
+ int ignore;
{
- register Char *p1, *p2, *op;
- register int i;
+ Char *p1, *p2, *op;
+ int i;
p1 = exp4(vp, ignore);
#ifdef EDEBUG
@@ -446,18 +432,18 @@ exp3a(vp, ignore)
static Char *
exp4(vp, ignore)
- register Char ***vp;
- bool ignore;
+ Char ***vp;
+ int ignore;
{
- register Char *p1, *p2;
- register int i = 0;
+ Char *p1, *p2;
+ int i = 0;
p1 = exp5(vp, ignore);
#ifdef EDEBUG
etracc("exp4 p1", p1, vp);
#endif /* EDEBUG */
if (isa(**vp, ADDOP)) {
- register Char *op = *(*vp)++;
+ Char *op = *(*vp)++;
p2 = exp4(vp, ignore);
#ifdef EDEBUG
@@ -483,11 +469,11 @@ exp4(vp, ignore)
static Char *
exp5(vp, ignore)
- register Char ***vp;
- bool ignore;
+ Char ***vp;
+ int ignore;
{
- register Char *p1, *p2;
- register int i = 0;
+ Char *p1, *p2;
+ int i = 0;
p1 = exp6(vp, ignore);
#ifdef EDEBUG
@@ -495,7 +481,7 @@ exp5(vp, ignore)
#endif /* EDEBUG */
if (isa(**vp, MULOP)) {
- register Char *op = *(*vp)++;
+ Char *op = *(*vp)++;
if ((ignore & TEXP_NOGLOB) != 0)
/*
* We are just trying to get the right side of
@@ -537,11 +523,11 @@ exp5(vp, ignore)
static Char *
exp6(vp, ignore)
- register Char ***vp;
- bool ignore;
+ Char ***vp;
+ int ignore;
{
int ccode, i = 0;
- register Char *cp;
+ Char *cp;
if (**vp == 0)
stderror(ERR_NAME | ERR_EXPRESSION);
@@ -577,7 +563,7 @@ exp6(vp, ignore)
return (putn(ccode));
}
if (eq(**vp, STRLbrace)) {
- register Char **v;
+ Char **v;
struct command faket;
Char *fakecom[2];
@@ -635,7 +621,7 @@ exp6(vp, ignore)
Char *
filetest(cp, vp, ignore)
Char *cp, ***vp;
- bool ignore;
+ int ignore;
{
#ifdef convex
struct cvxstat stb, *st = NULL;
@@ -658,7 +644,7 @@ filetest(cp, vp, ignore)
int i = 0;
unsigned pmask = 0xffff;
- bool altout = 0;
+ int altout = 0;
Char *ft = cp, *dp, *ep, *strdev, *strino, *strF, *str, valtest = '\0',
*errval = STR0;
char *string, string0[8];
@@ -990,18 +976,18 @@ filetest(cp, vp, ignore)
static void
evalav(v)
- register Char **v;
+ Char **v;
{
struct wordent paraml1;
- register struct wordent *hp = &paraml1;
+ struct wordent *hp = &paraml1;
struct command *t;
- register struct wordent *wdp = hp;
+ struct wordent *wdp = hp;
set(STRstatus, Strsave(STR0), VAR_READWRITE);
hp->prev = hp->next = hp;
hp->word = STRNULL;
while (*v) {
- register struct wordent *new =
+ struct wordent *new =
(struct wordent *) xcalloc(1, sizeof *wdp);
new->prev = wdp;
@@ -1021,8 +1007,8 @@ evalav(v)
static int
isa(cp, what)
- register Char *cp;
- register int what;
+ Char *cp;
+ int what;
{
if (cp == 0)
return ((what & RESTOP) != 0);
@@ -1072,7 +1058,7 @@ isa(cp, what)
static int
egetn(cp)
- register Char *cp;
+ Char *cp;
{
if (*cp && *cp != '-' && !Isdigit(*cp))
stderror(ERR_NAME | ERR_EXPRESSION);
diff --git a/contrib/tcsh/sh.file.c b/contrib/tcsh/sh.file.c
index 16ac4274a72c..24121978f7b1 100644
--- a/contrib/tcsh/sh.file.c
+++ b/contrib/tcsh/sh.file.c
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/sh.file.c,v 3.23 2003/02/08 20:03:26 christos Exp $ */
+/* $Header: /src/pub/tcsh/sh.file.c,v 3.28 2005/01/05 16:06:13 christos Exp $ */
/*
* sh.file.c: File completion for csh. This file is not used in tcsh.
*/
@@ -33,7 +33,7 @@
#include "sh.h"
#include "ed.h"
-RCSID("$Id: sh.file.c,v 3.23 2003/02/08 20:03:26 christos Exp $")
+RCSID("$Id: sh.file.c,v 3.28 2005/01/05 16:06:13 christos Exp $")
#if defined(FILEC) && defined(TIOCSTI)
@@ -64,8 +64,8 @@ static void back_to_col_1 __P((void));
static void pushback __P((Char *));
static void catn __P((Char *, Char *, int));
static void copyn __P((Char *, Char *, int));
-static Char filetype __P((Char *, Char *));
-static void print_by_column __P((Char *, Char *[], int));
+static int filetype __P((Char *, Char *));
+static void print_by_column __P((Char *, Char *[], size_t));
static Char *tilde __P((Char *, Char *));
static void retype __P((void));
static void beep __P((void));
@@ -75,7 +75,7 @@ static Char *getitem __P((DIR *, int));
static void free_items __P((Char **, size_t));
static int tsearch __P((Char *, COMMAND, int));
static int compare __P((const ptr_t, const ptr_t));
-static int recognize __P((Char *, Char *, int, int));
+static int recognize __P((Char *, Char *, int, size_t));
static int is_prefix __P((Char *, Char *));
static int is_suffix __P((Char *, Char *));
static int ignored __P((Char *));
@@ -86,7 +86,7 @@ static int ignored __P((Char *));
* completion by default. Filec controls completion, nobeep controls
* ringing the terminal bell on incomplete expansions.
*/
-bool filec = 0;
+int filec = 0;
static void
setup_tty(on)
@@ -226,7 +226,6 @@ pushback(string)
Char *string;
{
Char *p;
- char c;
#ifdef TERMIO
# ifdef POSIX
struct termios tty, tty_normal;
@@ -257,8 +256,14 @@ pushback(string)
(void) ioctl(SHOUT, TCSETAW, (ioctl_t) &tty);
# endif /* POSIX */
- for (p = string; (c = *p) != '\0'; p++)
- (void) ioctl(SHOUT, TIOCSTI, (ioctl_t) & c);
+ for (p = string; *p != '\0'; p++) {
+ char buf[MB_LEN_MAX];
+ size_t i, len;
+
+ len = one_wctomb(buf, *p & CHAR);
+ for (i = 0; i < len; i++)
+ (void) ioctl(SHOUT, TIOCSTI, (ioctl_t) &buf[i]);
+ }
# ifdef POSIX
(void) tcsetattr(SHOUT, TCSANOW, &tty_normal);
# else
@@ -315,7 +320,7 @@ copyn(des, src, count)
*des = '\0';
}
-static Char
+static int
filetype(dir, file)
Char *dir, *file;
{
@@ -354,9 +359,10 @@ static struct winsize win;
static void
print_by_column(dir, items, count)
Char *dir, *items[];
- int count;
+ size_t count;
{
- int i, rows, r, c, maxwidth = 0, columns;
+ size_t i;
+ int rows, r, c, maxwidth = 0, columns;
if (ioctl(SHOUT, TIOCGWINSZ, (ioctl_t) & win) < 0 || win.ws_col == 0)
win.ws_col = 80;
@@ -516,11 +522,7 @@ extract_dir_and_name(path, dir, name)
copyn(dir, path, p - path);
}
}
-/* atp vmsposix - I need to remove all the setpwent
- * getpwent endpwent stuff. VMS_POSIX has getpwnam getpwuid
- * and getlogin. This needs fixing. (There is no access to
- * pw->passwd in VMS - a secure system benefit :-| )
- */
+
static Char *
getitem(dir_fd, looking_for_lognames)
DIR *dir_fd;
@@ -530,7 +532,7 @@ getitem(dir_fd, looking_for_lognames)
struct dirent *dirp;
if (looking_for_lognames) {
-#ifdef _VMS_POSIX
+#ifndef HAVE_GETPWENT
return (NULL);
#else
if ((pw = getpwent()) == NULL)
@@ -581,19 +583,19 @@ tsearch(word, command, max_word_length)
COMMAND command;
{
DIR *dir_fd;
- int numitems = 0, ignoring = TRUE, nignored = 0;
+ int ignoring = TRUE, nignored = 0;
int name_length, looking_for_lognames;
Char tilded_dir[MAXPATHLEN + 1], dir[MAXPATHLEN + 1];
Char name[MAXNAMLEN + 1], extended_name[MAXNAMLEN + 1];
Char *item;
Char **items = NULL;
- size_t maxitems = 0;
+ size_t numitems = 0, maxitems = 0;
looking_for_lognames = (*word == '~') && (Strchr(word, '/') == NULL);
if (looking_for_lognames) {
-#ifndef _VMS_POSIX
+#ifdef HAVE_GETPWENT
(void) setpwent();
-#endif /*atp vmsposix */
+#endif
copyn(name, &word[1], MAXNAMLEN); /* name sans ~ */
dir_fd = NULL;
}
@@ -641,20 +643,20 @@ again: /* search for matches */
if (ignoring && numitems == 0 && nignored > 0) {
ignoring = FALSE;
nignored = 0;
- if (looking_for_lognames)
-#ifndef _VMS_POSIX
+ if (looking_for_lognames) {
+#ifdef HAVE_GETPWENT
(void) setpwent();
#endif /* atp vmsposix */
- else
+ } else
rewinddir(dir_fd);
goto again;
}
- if (looking_for_lognames)
-#ifndef _VMS_POSIX
+ if (looking_for_lognames) {
+#ifndef HAVE_GETPWENT
(void) endpwent();
-#endif /*atp vmsposix */
- else
+#endif
+ } else
(void) closedir(dir_fd);
if (numitems == 0)
return (0);
@@ -669,7 +671,7 @@ again: /* search for matches */
return (numitems);
}
else { /* LIST */
- qsort((ptr_t) items, (size_t) numitems, sizeof(items[0]),
+ qsort((ptr_t) items, numitems, sizeof(items[0]),
(int (*) __P((const void *, const void *))) compare);
print_by_column(looking_for_lognames ? NULL : tilded_dir,
items, numitems);
@@ -684,13 +686,26 @@ static int
compare(p, q)
const ptr_t p, q;
{
-#if defined(NLS) && !defined(NOSTRCOLL)
- errno = 0; /* strcoll sets errno, another brain-damage */
-
- return (strcoll(*(char **) p, *(char **) q));
+#ifdef WIDE_STRINGS
+ errno = 0;
+
+ return (wcscoll(*(Char **) p, *(Char **) q));
#else
- return (strcmp(*(char **) p, *(char **) q));
-#endif /* NLS && !NOSTRCOLL */
+ char *p1, *q1;
+ int res;
+
+ p1 = strsave(short2str(*(Char **) p));
+ q1 = strsave(short2str(*(Char **) q));
+# if defined(NLS) && !defined(NOSTRCOLL)
+ errno = 0; /* strcoll sets errno, another brain-damage */
+ res = strcoll(p1, q1);
+# else
+ res = strcmp(p1, q1);
+# endif /* NLS && !NOSTRCOLL */
+ xfree (p1);
+ xfree (q1);
+ return res;
+#endif /* not WIDE_STRINGS */
}
/*
@@ -704,7 +719,8 @@ compare(p, q)
static int
recognize(extended_name, item, name_length, numitems)
Char *extended_name, *item;
- int name_length, numitems;
+ int name_length;
+ size_t numitems;
{
if (numitems == 1) /* 1st match */
copyn(extended_name, item, MAXNAMLEN);
@@ -763,21 +779,21 @@ tenex(inputline, inputline_size)
int inputline_size;
{
int numitems, num_read;
- char tinputline[BUFSIZE];
+ char tinputline[BUFSIZE + 1];
setup_tty(ON);
while ((num_read = read(SHIN, tinputline, BUFSIZE)) > 0) {
- int i;
static Char delims[] = {' ', '\'', '"', '\t', ';', '&', '<',
'>', '(', ')', '|', '^', '%', '\0'};
Char *str_end, *word_start, last_Char, should_retype;
int space_left;
COMMAND command;
- for (i = 0; i < num_read; i++)
- inputline[i] = (unsigned char) tinputline[i];
+ tinputline[num_read] = 0;
+ Strcpy(inputline, str2short(tinputline));
+ num_read = Strlen(inputline);
last_Char = inputline[num_read - 1] & ASCII;
if (last_Char == '\n' || num_read == inputline_size)
diff --git a/contrib/tcsh/sh.func.c b/contrib/tcsh/sh.func.c
index f064ec8ea8b0..b77dccac7207 100644
--- a/contrib/tcsh/sh.func.c
+++ b/contrib/tcsh/sh.func.c
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/sh.func.c,v 3.111 2004/05/13 15:23:39 christos Exp $ */
+/* $Header: /src/pub/tcsh/sh.func.c,v 3.126 2005/03/20 06:35:48 christos Exp $ */
/*
* sh.func.c: csh builtin functions
*/
@@ -32,7 +32,7 @@
*/
#include "sh.h"
-RCSID("$Id: sh.func.c,v 3.111 2004/05/13 15:23:39 christos Exp $")
+RCSID("$Id: sh.func.c,v 3.126 2005/03/20 06:35:48 christos Exp $")
#include "ed.h"
#include "tw.h"
@@ -41,36 +41,42 @@ RCSID("$Id: sh.func.c,v 3.111 2004/05/13 15:23:39 christos Exp $")
#include "nt.const.h"
#endif /* WINNT_NATIVE */
+#ifdef NLS_CATALOGS
+#ifdef HAVE_ICONV
+#include <langinfo.h>
+static iconv_t catgets_iconv; /* Or (iconv_t)-1 */
+#endif
+#endif
+
/*
* C shell
*/
extern int just_signaled;
extern char **environ;
-extern bool MapsAreInited;
-extern bool NLSMapsAreInited;
-extern bool NoNLSRebind;
-extern bool GotTermCaps;
+extern int MapsAreInited;
+extern int NLSMapsAreInited;
+extern int GotTermCaps;
static int zlast = -1;
static void islogin __P((void));
static void preread __P((void));
static void doagain __P((void));
-static char *isrchx __P((int));
+static const char *isrchx __P((int));
static void search __P((int, int, Char *));
static int getword __P((Char *));
static void toend __P((void));
static void xecho __P((int, Char **));
-static bool islocale_var __P((Char *));
+static int islocale_var __P((Char *));
static void wpfree __P((struct whyle *));
struct biltins *
isbfunc(t)
struct command *t;
{
- register Char *cp = t->t_dcom[0];
- register struct biltins *bp, *bp1, *bp2;
+ Char *cp = t->t_dcom[0];
+ struct biltins *bp, *bp1, *bp2;
static struct biltins label = {"", dozip, 0, 0};
static struct biltins foregnd = {"%job", dofg1, 0, 0};
static struct biltins backgnd = {"%job &", dobg1, 0, 0};
@@ -131,8 +137,8 @@ isbfunc(t)
void
func(t, bp)
- register struct command *t;
- register struct biltins *bp;
+ struct command *t;
+ struct biltins *bp;
{
int i;
@@ -152,8 +158,8 @@ doonintr(v, c)
Char **v;
struct command *c;
{
- register Char *cp;
- register Char *vv = v[1];
+ Char *cp;
+ Char *vv = v[1];
USE(c);
if (parintr == SIG_IGN)
@@ -250,6 +256,7 @@ dofiletest(v, c)
{
Char **fileptr, *ftest, *res;
+ USE(c);
if (*(ftest = *++v) != '-')
stderror(ERR_NAME | ERR_FILEINQ);
++v;
@@ -288,11 +295,11 @@ prvars()
/*ARGSUSED*/
void
doalias(v, c)
- register Char **v;
+ Char **v;
struct command *c;
{
- register struct varent *vp;
- register Char *p;
+ struct varent *vp;
+ Char *p;
USE(c);
v++;
@@ -400,8 +407,8 @@ doif(v, kp)
Char **v;
struct command *kp;
{
- register int i;
- register Char **vv;
+ int i;
+ Char **vv;
v++;
i = expr(&v);
@@ -437,7 +444,7 @@ doif(v, kp)
*/
void
reexecute(kp)
- register struct command *kp;
+ struct command *kp;
{
kp->t_dflg &= F_SAVE;
kp->t_dflg |= F_REPEAT;
@@ -477,7 +484,7 @@ void
gotolab(lab)
Char *lab;
{
- register struct whyle *wp;
+ struct whyle *wp;
/*
* While we still can, locate any unknown ends of existing loops. This
* obscure code is the WORST result of the fact that we don't really parse.
@@ -501,10 +508,10 @@ gotolab(lab)
/*ARGSUSED*/
void
doswitch(v, c)
- register Char **v;
+ Char **v;
struct command *c;
{
- register Char *cp, *lp;
+ Char *cp, *lp;
USE(c);
v++;
@@ -563,11 +570,11 @@ doexit(v, c)
/*ARGSUSED*/
void
doforeach(v, c)
- register Char **v;
+ Char **v;
struct command *c;
{
- register Char *cp, *sp;
- register struct whyle *nwp;
+ Char *cp, *sp;
+ struct whyle *nwp;
USE(c);
v++;
@@ -617,8 +624,8 @@ dowhile(v, c)
Char **v;
struct command *c;
{
- register int status;
- register bool again = whyles != 0 &&
+ int status;
+ int again = whyles != 0 &&
SEEKEQ(&whyles->w_start, &lineloc) &&
whyles->w_fename == 0;
@@ -635,7 +642,7 @@ dowhile(v, c)
if (*v)
stderror(ERR_NAME | ERR_EXPRESSION);
if (!again) {
- register struct whyle *nwp =
+ struct whyle *nwp =
(struct whyle *) xcalloc(1, sizeof(*nwp));
nwp->w_start = lineloc;
@@ -734,7 +741,7 @@ dorepeat(v, kp)
int i = 1;
#ifdef BSDSIGS
- register sigmask_t omask = 0;
+ sigmask_t omask = 0;
#endif /* BSDSIGS */
do {
@@ -808,11 +815,11 @@ srchx(cp)
return (-1);
}
-static char *
+static const char *
isrchx(n)
- register int n;
+ int n;
{
- register struct srch *sp, *sp2;
+ struct srch *sp, *sp2;
for (sp = srchn, sp2 = srchn + nsrchn; sp < sp2; sp++)
if (sp->s_value == n)
@@ -827,12 +834,12 @@ static Char *Sgoal;
static void
search(type, level, goal)
int type;
- register int level;
+ int level;
Char *goal;
{
Char wordbuf[BUFSIZE];
- register Char *aword = wordbuf;
- register Char *cp;
+ Char *aword = wordbuf;
+ Char *cp;
struct whyle *wp;
int wlevel = 0;
@@ -941,10 +948,10 @@ search(type, level, goal)
static int
getword(wp)
- register Char *wp;
+ Char *wp;
{
int found = 0, first;
- int c, d;
+ eChar c, d;
c = readc(1);
d = 0;
@@ -954,8 +961,8 @@ getword(wp)
if (c == '#')
do
c = readc(1);
- while (c >= 0 && c != '\n');
- if (c < 0)
+ while (c != CHAR_ERR && c != '\n');
+ if (c == CHAR_ERR)
goto past;
if (c == '\n') {
if (wp)
@@ -975,7 +982,7 @@ getword(wp)
else if (d == c)
d = 0;
}
- if (c < 0)
+ if (c == CHAR_ERR)
goto past;
if (wp) {
*wp++ = (Char) c;
@@ -1078,7 +1085,7 @@ wfree()
#endif /* FDEBUG */
for (; whyles; whyles = nwp) {
- register struct whyle *wp = whyles;
+ struct whyle *wp = whyles;
nwp = wp->w_next;
#ifdef FDEBUG
@@ -1134,9 +1141,9 @@ doglob(v, c)
static void
xecho(sep, v)
int sep;
- register Char **v;
+ Char **v;
{
- register Char *cp;
+ Char *cp;
int nonl = 0;
#ifdef ECHO_STYLE
int echo_style = ECHO_STYLE;
@@ -1185,7 +1192,7 @@ xecho(sep, v)
nonl++, v++;
while ((cp = *v++) != 0) {
- register int c;
+ Char c;
while ((c = *cp++) != 0) {
if ((echo_style & SYSV_ECHO) != 0 && c == '\\') {
@@ -1242,7 +1249,7 @@ xecho(sep, v)
break;
}
}
- xputchar(c | QUOTE);
+ xputwchar(c | QUOTE);
}
if (*v)
@@ -1264,7 +1271,7 @@ done:
}
/* check whether an environment variable should invoke 'set_locale()' */
-static bool
+static int
islocale_var(var)
Char *var;
{
@@ -1272,7 +1279,7 @@ islocale_var(var)
STRLANG, STRLC_ALL, STRLC_CTYPE, STRLC_NUMERIC,
STRLC_TIME, STRLC_COLLATE, STRLC_MESSAGES, STRLC_MONETARY, 0
};
- register Char **v;
+ Char **v;
for (v = locale_vars; *v; ++v)
if (eq(var, *v))
@@ -1283,12 +1290,10 @@ islocale_var(var)
/*ARGSUSED*/
void
doprintenv(v, c)
- register Char **v;
+ Char **v;
struct command *c;
{
Char *e;
- extern bool output_raw;
- extern bool xlate_cr;
USE(c);
if (setintr)
@@ -1300,7 +1305,7 @@ doprintenv(v, c)
v++;
if (*v == 0) {
- register Char **ep;
+ Char **ep;
xlate_cr = 1;
for (ep = STR_environ; *ep; ep++)
@@ -1322,7 +1327,7 @@ doprintenv(v, c)
/*ARGSUSED*/
void
dosetenv(v, c)
- register Char **v;
+ Char **v;
struct command *c;
{
Char *vp, *lp;
@@ -1379,16 +1384,16 @@ dosetenv(v, c)
# ifdef LC_COLLATE
(void) setlocale(LC_COLLATE, "");
# endif
+# ifdef LC_CTYPE
+ (void) setlocale(LC_CTYPE, ""); /* for iscntrl */
+# endif /* LC_CTYPE */
# ifdef NLS_CATALOGS
# ifdef LC_MESSAGES
(void) setlocale(LC_MESSAGES, "");
# endif /* LC_MESSAGES */
- (void) catclose(catd);
+ nlsclose();
nlsinit();
# endif /* NLS_CATALOGS */
-# ifdef LC_CTYPE
- (void) setlocale(LC_CTYPE, ""); /* for iscntrl */
-# endif /* LC_CTYPE */
# ifdef SETLOCALEBUG
dont_free = 0;
# endif /* SETLOCALEBUG */
@@ -1398,7 +1403,7 @@ dosetenv(v, c)
tw_cmd_free(); /* since the collation sequence has changed */
for (k = 0200; k <= 0377 && !Isprint(k); k++)
continue;
- AsciiOnly = k > 0377;
+ AsciiOnly = MB_CUR_MAX == 1 && k > 0377;
#else /* !NLS */
AsciiOnly = 0;
#endif /* NLS */
@@ -1412,7 +1417,7 @@ dosetenv(v, c)
#ifdef NLS_CATALOGS
if (eq(vp, STRNLSPATH)) {
- (void) catclose(catd);
+ nlsclose();
nlsinit();
}
#endif
@@ -1510,7 +1515,7 @@ dosetenv(v, c)
/*ARGSUSED*/
void
dounsetenv(v, c)
- register Char **v;
+ Char **v;
struct command *c;
{
Char **ep, *p, *n;
@@ -1571,16 +1576,16 @@ dounsetenv(v, c)
# ifdef LC_COLLATE
(void) setlocale(LC_COLLATE, "");
# endif
+# ifdef LC_CTYPE
+ (void) setlocale(LC_CTYPE, ""); /* for iscntrl */
+# endif /* LC_CTYPE */
# ifdef NLS_CATALOGS
# ifdef LC_MESSAGES
(void) setlocale(LC_MESSAGES, "");
# endif /* LC_MESSAGES */
- (void) catclose(catd);
+ nlsclose();
nlsinit();
# endif /* NLS_CATALOGS */
-# ifdef LC_CTYPE
- (void) setlocale(LC_CTYPE, ""); /* for iscntrl */
-# endif /* LC_CTYPE */
# ifdef SETLOCALEBUG
dont_free = 0;
# endif /* SETLOCALEBUG */
@@ -1590,7 +1595,7 @@ dounsetenv(v, c)
tw_cmd_free();/* since the collation sequence has changed */
for (k = 0200; k <= 0377 && !Isprint(k); k++)
continue;
- AsciiOnly = k > 0377;
+ AsciiOnly = MB_CUR_MAX == 1 && k > 0377;
#else /* !NLS */
AsciiOnly = getenv("LANG") == NULL &&
getenv("LC_CTYPE") == NULL;
@@ -1613,7 +1618,7 @@ dounsetenv(v, c)
#endif /* COLOR_LS_F */
#ifdef NLS_CATALOGS
else if (eq(name, STRNLSPATH)) {
- (void) catclose(catd);
+ nlsclose();
nlsinit();
}
#endif
@@ -1627,7 +1632,7 @@ dounsetenv(v, c)
void
tsetenv(name, val)
- Char *name, *val;
+ const Char *name, *val;
{
#ifdef SETENV_IN_LIB
/*
@@ -1645,8 +1650,9 @@ tsetenv(name, val)
(void) strcpy(nameBuf, cname);
setenv(nameBuf, short2str(val), 1);
#else /* !SETENV_IN_LIB */
- register Char **ep = STR_environ;
- register Char *cp, *dp;
+ Char **ep = STR_environ;
+ const Char *ccp;
+ Char *cp, *dp;
Char *blk[2];
Char **oep = ep;
@@ -1655,13 +1661,13 @@ tsetenv(name, val)
#endif /* WINNT_NATIVE */
for (; *ep; ep++) {
#ifdef WINNT_NATIVE
- for (cp = name, dp = *ep; *cp && Tolower(*cp & TRIM) == Tolower(*dp);
- cp++, dp++)
+ for (ccp = name, dp = *ep; *ccp && Tolower(*ccp & TRIM) == Tolower(*dp);
+ ccp++, dp++)
#else
- for (cp = name, dp = *ep; *cp && (*cp & TRIM) == *dp; cp++, dp++)
+ for (ccp = name, dp = *ep; *ccp && (*ccp & TRIM) == *dp; ccp++, dp++)
#endif /* WINNT_NATIVE */
continue;
- if (*cp != 0 || *dp != '=')
+ if (*ccp != 0 || *dp != '=')
continue;
cp = Strspl(STRequal, val);
xfree((ptr_t) * ep);
@@ -1686,8 +1692,8 @@ void
Unsetenv(name)
Char *name;
{
- register Char **ep = STR_environ;
- register Char *cp, *dp;
+ Char **ep = STR_environ;
+ Char *cp, *dp;
Char **oep = ep;
#ifdef WINNT_NATIVE
@@ -1713,11 +1719,11 @@ Unsetenv(name)
/*ARGSUSED*/
void
doumask(v, c)
- register Char **v;
+ Char **v;
struct command *c;
{
- register Char *cp = v[1];
- register int i;
+ Char *cp = v[1];
+ int i;
USE(c);
if (cp == 0) {
@@ -1737,6 +1743,9 @@ doumask(v, c)
#ifndef HAVENOLIMIT
# ifndef BSDLIMIT
typedef long RLIM_TYPE;
+# ifdef _OSD_POSIX /* BS2000 */
+# include <ulimit.h>
+# endif
# ifndef RLIM_INFINITY
# if !defined(_MINIX) && !defined(__clipper__) && !defined(_CRAY)
extern RLIM_TYPE ulimit();
@@ -1752,7 +1761,7 @@ doumask(v, c)
# define toset(a) ((a) + 1)
# endif /* aiws */
# else /* BSDLIMIT */
-# if (defined(BSD4_4) || defined(__linux__) || (HPUXVERSION >= 1100)) && !defined(__386BSD__)
+# if (defined(BSD4_4) || defined(__linux__) || defined(__GNU__) || defined(__GLIBC__) || (HPUXVERSION >= 1100)) && !defined(__386BSD__)
typedef rlim_t RLIM_TYPE;
# else
# if defined(SOLARIS2) || (defined(sgi) && SYSVREL > 3)
@@ -1804,7 +1813,7 @@ doumask(v, c)
# endif
# endif /* SYSVREL > 3 && BSDLIMIT */
-# if defined(__linux__) && defined(RLIMIT_AS) && !defined(RLIMIT_VMEM)
+# if (defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)) && defined(RLIMIT_AS) && !defined(RLIMIT_VMEM)
# define RLIMIT_VMEM RLIMIT_AS
# endif
@@ -1850,6 +1859,10 @@ struct limits limits[] =
{ RLIMIT_VMEM, "vmemoryuse", 1024, "kbytes" },
# endif /* RLIMIT_VMEM */
+# if defined(RLIMIT_HEAP) /* found on BS2000/OSD systems */
+ { RLIMIT_HEAP, "heapsize", 1024, "kbytes" },
+# endif /* RLIMIT_HEAP */
+
# ifdef RLIMIT_NOFILE
{ RLIMIT_NOFILE, "descriptors", 1, "" },
# endif /* RLIMIT_NOFILE */
@@ -1879,7 +1892,7 @@ struct limits limits[] =
static struct limits *findlim __P((Char *));
static RLIM_TYPE getval __P((struct limits *, Char **));
-static void limtail __P((Char *, char*));
+static void limtail __P((Char *, const char *));
static void plim __P((struct limits *, int));
static int setlim __P((struct limits *, int, RLIM_TYPE));
@@ -1907,7 +1920,7 @@ static struct limits *
findlim(cp)
Char *cp;
{
- register struct limits *lp, *res;
+ struct limits *lp, *res;
res = (struct limits *) NULL;
for (lp = limits; lp->limconst >= 0; lp++)
@@ -1926,11 +1939,11 @@ findlim(cp)
/*ARGSUSED*/
void
dolimit(v, c)
- register Char **v;
+ Char **v;
struct command *c;
{
- register struct limits *lp;
- register RLIM_TYPE limit;
+ struct limits *lp;
+ RLIM_TYPE limit;
int hard = 0;
USE(c);
@@ -1956,13 +1969,10 @@ dolimit(v, c)
static RLIM_TYPE
getval(lp, v)
- register struct limits *lp;
+ struct limits *lp;
Char **v;
{
- register float f;
-#ifndef atof /* This can be a macro on linux */
- extern double atof __P((const char *));
-#endif /* atof */
+ float f;
Char *cp = *v++;
f = atof(short2str(cp));
@@ -2060,12 +2070,12 @@ badscal:
static void
limtail(cp, str)
Char *cp;
- char *str;
+ const char *str;
{
- char *sp;
+ const char *sp;
sp = str;
- while (*cp && *cp == *str)
+ while (*cp && *cp == (Char)*str)
cp++, str++;
if (*cp)
stderror(ERR_BADSCALE, sp);
@@ -2075,14 +2085,14 @@ limtail(cp, str)
/*ARGSUSED*/
static void
plim(lp, hard)
- register struct limits *lp;
+ struct limits *lp;
int hard;
{
# ifdef BSDLIMIT
struct rlimit rlim;
# endif /* BSDLIMIT */
RLIM_TYPE limit;
- int div = lp->limdiv;
+ int xdiv = lp->limdiv;
xprintf("%-13.13s", lp->limname);
@@ -2106,29 +2116,35 @@ plim(lp, hard)
if (limit >= (RLIM_INFINITY / 512))
limit = RLIM_INFINITY;
else
- div = (div == 1024 ? 2 : 1);
+ xdiv = (xdiv == 1024 ? 2 : 1);
}
# endif /* !BSDLIMIT || FILESIZE512 */
if (limit == RLIM_INFINITY)
xprintf("unlimited");
else
+# if defined(RLIMIT_CPU) && defined(_OSD_POSIX)
+ if (lp->limconst == RLIMIT_CPU &&
+ (unsigned long)limit >= 0x7ffffffdUL)
+ xprintf("unlimited");
+ else
+# endif
# ifdef RLIMIT_CPU
if (lp->limconst == RLIMIT_CPU)
psecs((long) limit);
else
# endif /* RLIMIT_CPU */
- xprintf("%ld %s", (long) (limit / div), lp->limscale);
+ xprintf("%ld %s", (long) (limit / xdiv), lp->limscale);
xputchar('\n');
}
/*ARGSUSED*/
void
dounlimit(v, c)
- register Char **v;
+ Char **v;
struct command *c;
{
- register struct limits *lp;
+ struct limits *lp;
int lerr = 0;
int hard = 0;
int force = 0;
@@ -2167,7 +2183,7 @@ dounlimit(v, c)
static int
setlim(lp, hard, limit)
- register struct limits *lp;
+ struct limits *lp;
int hard;
RLIM_TYPE limit;
{
@@ -2201,10 +2217,17 @@ setlim(lp, hard, limit)
# endif /* aiws */
if (ulimit(toset(lp->limconst), limit) < 0) {
# endif /* BSDLIMIT */
+ int err;
+ char *op, *type;
+
+ err = errno;
+ op = strsave(limit == RLIM_INFINITY ? CGETS(15, 2, "remove") :
+ CGETS(15, 3, "set"));
+ type = strsave(hard ? CGETS(15, 4, " hard") : "");
xprintf(CGETS(15, 1, "%s: %s: Can't %s%s limit (%s)\n"), bname,
- lp->limname, limit == RLIM_INFINITY ? CGETS(15, 2, "remove") :
- CGETS(15, 3, "set"), hard ? CGETS(14, 4, " hard") : "",
- strerror(errno));
+ lp->limname, op, type, strerror(err));
+ xfree(type);
+ xfree(op);
return (-1);
}
return (0);
@@ -2323,9 +2346,9 @@ doeval(v, c)
trim(gav);
}
- saveIN = dcopy(SHIN, -1);
- saveOUT = dcopy(SHOUT, -1);
- saveDIAG = dcopy(SHDIAG, -1);
+ (void)close_on_exec(saveIN = dcopy(SHIN, -1), 1);
+ (void)close_on_exec(saveOUT = dcopy(SHOUT, -1), 1);
+ (void)close_on_exec(saveDIAG = dcopy(SHDIAG, -1), 1);
getexit(osetexit);
@@ -2339,9 +2362,9 @@ doeval(v, c)
#endif /* cray */
evalvec = gav;
evalp = 0;
- SHIN = dcopy(0, -1);
- SHOUT = dcopy(1, -1);
- SHDIAG = dcopy(2, -1);
+ (void)close_on_exec(SHIN = dcopy(0, -1), 1);
+ (void)close_on_exec(SHOUT = dcopy(1, -1), 1);
+ (void)close_on_exec(SHDIAG = dcopy(2, -1), 1);
#ifndef CLOSE_ON_EXEC
didcch = 0;
#endif /* CLOSE_ON_EXEC */
@@ -2359,9 +2382,9 @@ doeval(v, c)
(void) close(SHIN);
(void) close(SHOUT);
(void) close(SHDIAG);
- SHIN = dmove(saveIN, oSHIN);
- SHOUT = dmove(saveOUT, oSHOUT);
- SHDIAG = dmove(saveDIAG, oSHDIAG);
+ (void)close_on_exec (SHIN = dmove(saveIN, oSHIN), 1);
+ (void)close_on_exec (SHOUT = dmove(saveOUT, oSHOUT), 1);
+ (void)close_on_exec (SHDIAG = dmove(saveDIAG, oSHDIAG), 1);
if (gv)
blkfree(gv);
@@ -2384,12 +2407,8 @@ struct command *c;
/* would use print_by_column() in tw.parse.c but that assumes
* we have an array of Char * to pass.. (sg)
*/
- extern int Tty_raw_mode;
- extern int TermH; /* from the editor routines */
- extern int lbuffed; /* from sh.print.c */
-
- register struct biltins *b;
- register int row, col, columns, rows;
+ struct biltins *b;
+ int row, col, columns, rows;
unsigned int w, maxwidth;
USE(c);
@@ -2435,6 +2454,56 @@ struct command *c;
flush();
}
+#ifdef NLS_CATALOGS
+#ifdef HAVE_ICONV
+char *
+iconv_catgets(ctd, set_id, msg_id, s)
+nl_catd ctd;
+int set_id, msg_id;
+const char *s;
+{
+ static char *buf = NULL;
+ static size_t buf_size = 0;
+
+ char *orig, *dest, *p;
+#ifdef __NetBSD__
+ const char *src;
+#else
+ char *src;
+#endif
+ size_t src_size, dest_size;
+
+ orig = catgets(ctd, set_id, msg_id, s);
+ if (catgets_iconv == (iconv_t)-1 || orig == s)
+ return orig;
+ src = orig;
+ src_size = strlen(src) + 1;
+ if (buf == NULL && (buf = xmalloc(buf_size = src_size + 32)) == NULL)
+ return orig;
+ dest = buf;
+ while (src_size != 0) {
+ dest_size = buf + buf_size - dest;
+ if (iconv(catgets_iconv, &src, &src_size, &dest, &dest_size)
+ == (size_t)-1) {
+ switch (errno) {
+ case E2BIG:
+ if ((p = xrealloc(buf, buf_size * 2)) == NULL)
+ return orig;
+ buf_size *= 2;
+ dest = p + (dest - buf);
+ buf = p;
+ break;
+
+ case EILSEQ: case EINVAL: default:
+ return orig;
+ }
+ }
+ }
+ return buf;
+}
+#endif
+#endif
+
void
nlsinit()
{
@@ -2445,6 +2514,11 @@ nlsinit()
xsnprintf((char *)catalog, sizeof(catalog), "tcsh.%s",
short2str(varval(STRcatalog)));
catd = catopen(catalog, MCLoadBySet);
+#ifdef HAVE_ICONV
+ /* catgets (), not CGETS, the charset name should be in ASCII anyway. */
+ catgets_iconv = iconv_open (nl_langinfo (CODESET),
+ catgets(catd, 255, 1, "ASCII"));
+#endif /* HAVE_ICONV */
#endif /* NLS_CATALOGS */
#ifdef WINNT_NATIVE
nls_dll_init();
@@ -2455,3 +2529,17 @@ nlsinit()
editinit(); /* init the editor messages */
terminit(); /* init the termcap messages */
}
+
+void
+nlsclose()
+{
+#ifdef NLS_CATALOGS
+#ifdef HAVE_ICONV
+ if (catgets_iconv != (iconv_t)-1) {
+ iconv_close(catgets_iconv);
+ catgets_iconv = (iconv_t)-1;
+ }
+#endif /* HAVE_ICONV */
+ catclose(catd);
+#endif /* NLS_CATALOGS */
+}
diff --git a/contrib/tcsh/sh.glob.c b/contrib/tcsh/sh.glob.c
index d5334e7a208a..2002ae6828d5 100644
--- a/contrib/tcsh/sh.glob.c
+++ b/contrib/tcsh/sh.glob.c
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/sh.glob.c,v 3.55 2004/03/21 16:48:14 christos Exp $ */
+/* $Header: /src/pub/tcsh/sh.glob.c,v 3.62 2004/12/25 21:15:07 christos Exp $ */
/*
* sh.glob.c: Regular expression expansion
*/
@@ -32,7 +32,7 @@
*/
#include "sh.h"
-RCSID("$Id: sh.glob.c,v 3.55 2004/03/21 16:48:14 christos Exp $")
+RCSID("$Id: sh.glob.c,v 3.62 2004/12/25 21:15:07 christos Exp $")
#include "tc.h"
#include "tw.h"
@@ -80,8 +80,8 @@ static Char **globexpand __P((Char **));
static int globbrace __P((Char *, Char *, Char ***));
static void expbrace __P((Char ***, Char ***, int));
static void pword __P((int));
-static void psave __P((int));
-static void backeval __P((Char *, bool));
+static void psave __P((Char));
+static void backeval __P((Char *, int));
static Char *
globtilde(nv, s)
@@ -186,19 +186,9 @@ globbrace(s, p, bl)
/* check for balanced braces */
for (i = 0, pe = ++p; *pe; pe++)
-#ifdef DSPMBYTE
- if (Ismbyte1(*pe) && *(pe + 1) != EOS)
- pe ++;
- else
-#endif /* DSPMBYTE */
if (*pe == LBRK) {
/* Ignore everything between [] */
for (++pe; *pe != RBRK && *pe != EOS; pe++)
-#ifdef DSPMBYTE
- if (Ismbyte1(*pe) && *(pe + 1) != EOS)
- pe ++;
- else
-#endif /* DSPMBYTE */
continue;
if (*pe == EOS) {
blkfree(nv);
@@ -219,19 +209,9 @@ globbrace(s, p, bl)
}
for (i = 0, pl = pm = p; pm <= pe; pm++)
-#ifdef DSPMBYTE
- if (Ismbyte1(*pm) && pm + 1 <= pe)
- pm ++;
- else
-#endif /* DSPMBYTE */
switch (*pm) {
case LBRK:
for (++pm; *pm != RBRK && *pm != EOS; pm++)
-#ifdef DSPMBYTE
- if (Ismbyte1(*pm) && *(pm + 1) != EOS)
- pm ++;
- else
-#endif /* DSPMBYTE */
continue;
if (*pm == EOS) {
*vl = NULL;
@@ -303,12 +283,6 @@ expbrace(nvp, elp, size)
Char **bl;
int len;
-#if defined (DSPMBYTE)
- if (b != s && Ismbyte2(*b) && Ismbyte1(*(b-1))) {
- /* The "{" is the 2nd byte of a MB character */
- continue;
- }
-#endif /* DSPMBYTE */
if ((len = globbrace(s, b, &bl)) < 0) {
xfree((ptr_t) nv);
stderror(ERR_MISSING, -len);
@@ -652,10 +626,10 @@ ginit()
void
rscan(t, f)
- register Char **t;
- void (*f) __P((int));
+ Char **t;
+ void (*f) __P((Char));
{
- register Char *p;
+ Char *p;
while ((p = *t++) != '\0')
while (*p)
@@ -664,9 +638,9 @@ rscan(t, f)
void
trim(t)
- register Char **t;
+ Char **t;
{
- register Char *p;
+ Char *p;
while ((p = *t++) != '\0')
while (*p)
@@ -675,9 +649,9 @@ trim(t)
void
tglob(t)
- register Char **t;
+ Char **t;
{
- register Char *p, *c;
+ Char *p, *c;
while ((p = *t++) != '\0') {
if (*p == '~' || *p == '=')
@@ -732,9 +706,9 @@ tglob(t)
Char **
dobackp(cp, literal)
Char *cp;
- bool literal;
+ int literal;
{
- register Char *lp, *rp;
+ Char *lp, *rp;
Char *ep, word[LONGBSIZE];
if (pargv) {
@@ -750,15 +724,7 @@ dobackp(cp, literal)
pargc = 0;
pnleft = LONGBSIZE - 4;
for (;;) {
-#if defined(DSPMBYTE)
- for (lp = cp;; lp++) { /* } */
- if (*lp == '`' &&
- (lp-1 < cp || !Ismbyte2(*lp) || !Ismbyte1(*(lp-1)))) {
- break;
- }
-#else /* DSPMBYTE */
for (lp = cp; *lp != '`'; lp++) {
-#endif /* DSPMBYTE */
if (*lp == 0) {
if (pargcp != pargs)
pword(LONGBSIZE);
@@ -786,12 +752,12 @@ dobackp(cp, literal)
static void
backeval(cp, literal)
Char *cp;
- bool literal;
+ int literal;
{
- register int icnt, c;
- register Char *ip;
+ int icnt;
+ Char c, *ip;
struct command faket;
- bool hadnl;
+ int hadnl;
int pvec[2], quoted;
Char *fakecom[2], ibuf[BUFSIZE];
char tibuf[BUFSIZE];
@@ -824,7 +790,8 @@ backeval(cp, literal)
*/
mypipe(pvec);
if (pfork(&faket, -1) == 0) {
- struct command *t;
+ jmp_buf_t osetexit;
+ struct command *volatile t;
(void) close(pvec[0]);
(void) dmove(pvec[1], 1);
@@ -841,7 +808,7 @@ backeval(cp, literal)
arginp = cp;
for (arginp = cp; *cp; cp++) {
*cp &= TRIM;
- if (*cp == '\n' || *cp == '\r')
+ if (is_set(STRcsubstnonl) && (*cp == '\n' || *cp == '\r'))
*cp = ' ';
}
@@ -853,26 +820,58 @@ backeval(cp, literal)
evalvec = NULL;
alvecp = NULL;
evalp = NULL;
- (void) lex(&paraml);
- if (seterr)
- stderror(ERR_OLD);
- alias(&paraml);
- t = syntax(paraml.next, &paraml, 0);
- if (seterr)
- stderror(ERR_OLD);
- if (t)
- t->t_dflg |= F_NOFORK;
+
+ t = NULL;
+ getexit(osetexit);
+ for (;;) {
+
+ if (paraml.next && paraml.next != &paraml)
+ freelex(&paraml);
+
+ paraml.next = paraml.prev = &paraml;
+ paraml.word = STRNULL;
+ (void) setexit();
+ justpr = 0;
+
+ /*
+ * For the sake of reset()
+ */
+ freelex(&paraml);
+ if (t)
+ freesyn(t), t = NULL;
+
+ if (haderr) {
+ /* unwind */
+ doneinp = 0;
+ resexit(osetexit);
+ reset();
+ }
+ if (seterr) {
+ xfree((ptr_t) seterr);
+ seterr = NULL;
+ }
+
+ (void) lex(&paraml);
+ if (seterr)
+ stderror(ERR_OLD);
+ alias(&paraml);
+ t = syntax(paraml.next, &paraml, 0);
+ if (seterr)
+ stderror(ERR_OLD);
#ifdef SIGTSTP
- (void) sigignore(SIGTSTP);
+ (void) sigignore(SIGTSTP);
#endif
#ifdef SIGTTIN
- (void) sigignore(SIGTTIN);
+ (void) sigignore(SIGTTIN);
#endif
#ifdef SIGTTOU
- (void) sigignore(SIGTTOU);
+ (void) sigignore(SIGTTOU);
#endif
- execute(t, -1, NULL, NULL, TRUE);
- exitstat();
+ execute(t, -1, NULL, NULL, TRUE);
+
+ freelex(&paraml);
+ freesyn(t), t = NULL;
+ }
}
xfree((ptr_t) cp);
(void) close(pvec[1]);
@@ -880,21 +879,47 @@ backeval(cp, literal)
ip = NULL;
do {
int cnt = 0;
+ char *tmp;
+ tmp = tibuf;
for (;;) {
- if (icnt == 0) {
- int i;
+ while (icnt == 0) {
+ int i, eof;
ip = ibuf;
do
- icnt = read(pvec[0], tibuf, BUFSIZE);
+ icnt = read(pvec[0], tmp, tibuf + BUFSIZE - tmp);
while (icnt == -1 && errno == EINTR);
+ eof = 0;
if (icnt <= 0) {
- c = -1;
- break;
+ if (tmp == tibuf)
+ goto eof;
+ icnt = 0;
+ eof = 1;
}
- for (i = 0; i < icnt; i++)
- ip[i] = (unsigned char) tibuf[i];
+ icnt += tmp - tibuf;
+ i = 0;
+ tmp = tibuf;
+ while (tmp < tibuf + icnt) {
+ int len;
+
+ len = normal_mbtowc(&ip[i], tmp, tibuf + icnt - tmp);
+ if (len == -1) {
+ reset_mbtowc();
+ if (!eof && (size_t)(tibuf + icnt - tmp) < MB_CUR_MAX) {
+ break; /* Maybe a partial character */
+ }
+ ip[i] = (unsigned char) *tmp | INVALID_BYTE; /* Error */
+ }
+ if (len <= 0)
+ len = 1;
+ i++;
+ tmp += len;
+ }
+ if (tmp != tibuf)
+ memmove (tibuf, tmp, tibuf + icnt - tmp);
+ tmp = tibuf + (tibuf + icnt - tmp);
+ icnt = i;
}
if (hadnl)
break;
@@ -925,10 +950,11 @@ backeval(cp, literal)
* If we didn't make empty words here when literal was set then we
* would lose blank lines.
*/
- if (c != -1 && (cnt || literal))
+ if (c != 0 && (cnt || literal))
pword(BUFSIZE);
hadnl = 0;
- } while (c >= 0);
+ } while (c > 0);
+ eof:
(void) close(pvec[0]);
pwait();
prestjob();
@@ -936,7 +962,7 @@ backeval(cp, literal)
static void
psave(c)
- int c;
+ Char c;
{
if (--pnleft <= 0)
stderror(ERR_WTOOLONG);
@@ -953,6 +979,7 @@ pword(bufsiz)
pargv = (Char **) xrealloc((ptr_t) pargv,
(size_t) (pargsiz * sizeof(Char *)));
}
+ NLSQuote(pargs);
pargv[pargc++] = Strsave(pargs);
pargv[pargc] = NULL;
pargcp = pargs;
@@ -987,12 +1014,12 @@ Gnmatch(string, pattern, endstr)
if (endstr == NULL)
/* Exact matches only */
for (p = blk; *p; p++)
- gres |= t_pmatch(string, *p, &tstring, 0) == 2 ? 1 : 0;
+ gres |= t_pmatch(string, *p, &tstring, 1) == 2 ? 1 : 0;
else {
/* partial matches */
int minc = 0x7fffffff;
for (p = blk; *p; p++)
- if (t_pmatch(string, *p, &tstring, 0) != 0) {
+ if (t_pmatch(string, *p, &tstring, 1) != 0) {
int t = (int) (tstring - string);
gres |= 1;
if (minc == -1 || minc > t)
@@ -1016,20 +1043,22 @@ t_pmatch(string, pattern, estr, cs)
Char *string, *pattern, **estr;
int cs;
{
- Char stringc, patternc;
+ NLSChar stringc, patternc, rangec;
int match, negate_range;
- Char rangec, *oestr, *pestr;
+ Char *oestr, *pestr, *nstring;
- for (;; ++string) {
- stringc = *string & TRIM;
+ for (nstring = string;; string = nstring) {
+ stringc = *nstring++;
+ TRIM_AND_EXTEND(nstring, stringc);
/*
* apollo compiler bug: switch (patternc = *pattern++) dies
*/
patternc = *pattern++;
+ TRIM_AND_EXTEND(pattern, patternc);
switch (patternc) {
- case 0:
+ case '\0':
*estr = string;
- return (stringc == 0 ? 2 : 1);
+ return (stringc == '\0' ? 2 : 1);
case '?':
if (stringc == 0)
return (0);
@@ -1044,7 +1073,7 @@ t_pmatch(string, pattern, estr, cs)
oestr = *estr;
pestr = NULL;
- do {
+ for (;;) {
switch(t_pmatch(string, pattern, estr, cs)) {
case 0:
break;
@@ -1057,8 +1086,11 @@ t_pmatch(string, pattern, estr, cs)
abort(); /* Cannot happen */
}
*estr = string;
+ stringc = *string++;
+ if (!stringc)
+ break;
+ TRIM_AND_EXTEND(string, stringc);
}
- while (*string++);
if (pestr) {
*estr = pestr;
@@ -1078,22 +1110,34 @@ t_pmatch(string, pattern, estr, cs)
break;
if (match)
continue;
- if (rangec == '-' && *(pattern-2) != '[' && *pattern != ']') {
- match = (globcharcoll(stringc, *pattern & TRIM, cs) <= 0 &&
- globcharcoll(*(pattern-2) & TRIM, stringc, cs) <= 0);
+ TRIM_AND_EXTEND(pattern, rangec);
+ if (*pattern == '-' && pattern[1] != ']') {
+ NLSChar rangec2;
pattern++;
+ rangec2 = *pattern++;
+ TRIM_AND_EXTEND(pattern, rangec2);
+ match = (globcharcoll(stringc, rangec2, 0) <= 0 &&
+ globcharcoll(rangec, stringc, 0) <= 0);
}
else
- match = (stringc == (rangec & TRIM));
+ match = (stringc == rangec);
}
- if (rangec == 0)
+ if (rangec == '\0')
stderror(ERR_NAME | ERR_MISSING, ']');
+ if ((!match) && (stringc == '\0'))
+ return (0);
if (match == negate_range)
return (0);
*estr = string;
break;
default:
- if ((patternc & TRIM) != stringc)
+ TRIM_AND_EXTEND(pattern, patternc);
+ if (cs ? patternc != stringc
+#if defined (NLS) && defined (SHORT_STRINGS)
+ : towlower(patternc) != towlower(stringc))
+#else
+ : Tolower(patternc) != Tolower(stringc))
+#endif
return (0);
*estr = string;
break;
@@ -1105,7 +1149,7 @@ void
Gcat(s1, s2)
Char *s1, *s2;
{
- register Char *p, *q;
+ Char *p, *q;
int n;
for (p = s1; *p++;)
@@ -1129,7 +1173,7 @@ Gcat(s1, s2)
#if defined(FILEC) && defined(TIOCSTI)
int
sortscmp(a, b)
- register Char **a, **b;
+ Char **a, **b;
{
if (!a) /* check for NULL */
return (b ? 1 : 0);
diff --git a/contrib/tcsh/sh.h b/contrib/tcsh/sh.h
index 12e4936d4bf3..92c2f9518ff4 100644
--- a/contrib/tcsh/sh.h
+++ b/contrib/tcsh/sh.h
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/sh.h,v 3.114 2004/02/21 20:34:25 christos Exp $ */
+/* $Header: /src/pub/tcsh/sh.h,v 3.133 2005/03/25 18:46:41 kim Exp $ */
/*
* sh.h: Catch it all globals and includes file!
*/
@@ -35,10 +35,22 @@
#include "config.h"
-#ifndef HAVE_QUAD
-#ifdef __GNUC__
-#define HAVE_QUAD 1
+#include <stddef.h>
+
+#ifdef HAVE_ICONV
+# include <iconv.h>
+#endif
+
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
#endif
+
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+
+#if !defined(HAVE_STDINT_H) && !defined(HAVE_INTTYPES_H) && !defined(WINNT_NATIVE)
+typedef unsigned long intptr_t;
#endif
#ifndef EXTERN
@@ -55,7 +67,7 @@
#endif /* IZERO */
#ifndef IZERO_STRUCT
# define IZERO_STRUCT
-# endif /* IZERO_STRUCT */
+#endif /* IZERO_STRUCT */
#ifndef WINNT_NATIVE
# define INIT_ZERO
@@ -78,33 +90,41 @@
#endif
#ifdef SHORT_STRINGS
+#include <wchar.h>
+# ifdef WIDE_STRINGS
+typedef wchar_t Char;
+typedef unsigned long uChar;
+typedef wint_t eChar; /* Can contain any Char value or CHAR_ERR */
+#define CHAR_ERR WEOF /* Pretty please, use bit 31... */
+#define normal_mbtowc(PWC, S, N) rt_mbtowc(PWC, S, N)
+#define reset_mbtowc() mbtowc(NULL, NULL, 0)
+# else
typedef short Char;
typedef unsigned short uChar;
+typedef int eChar;
+#define CHAR_ERR (-1)
+#define normal_mbtowc(PWC, S, N) ((void)(N), *(PWC) = (unsigned char)*(S), 1)
+#define reset_mbtowc() ((void)0)
+# endif
# define SAVE(a) (Strsave(str2short(a)))
#else
typedef char Char;
typedef unsigned char uChar;
+typedef int eChar;
+#define CHAR_ERR (-1)
+#define normal_mbtowc(PWC, S, N) ((void)(N), *(PWC) = (unsigned char)*(S), 1)
+#define reset_mbtowc() ((void)0)
# define SAVE(a) (strsave(a))
#endif
+#if SIZEOF_WCHAR_T >= 4
+typedef wchar_t NLSChar;
+#else
+/* Assumes sizeof (int) >= 4, unlike some parts of tcsh */
+typedef int NLSChar;
+#endif
/* Elide unused argument warnings */
#define USE(a) (void) (a)
-/*
- * If your compiler complains, then you can either
- * throw it away and get gcc or, use the following define
- * and get rid of the typedef.
- * [The 4.2/3BSD vax compiler does not like that]
- * Both MULTIFLOW and PCC compilers exhbit this bug. -- sterling@netcom.com
- */
-#ifdef SIGVOID
-# if (defined(vax) || defined(uts) || defined(MULTIFLOW) || defined(PCC)) && !defined(__GNUC__)
-# define sigret_t void
-# else /* !((vax || uts || MULTIFLOW || PCC) && !__GNUC__) */
-typedef void sigret_t;
-# endif /* (vax || uts || MULTIFLOW || PCC) && !__GNUC__ */
-#else /* !SIGVOID */
-typedef int sigret_t;
-#endif /* SIGVOID */
/*
* Return true if the path is absolute
@@ -164,6 +184,7 @@ typedef int sigret_t;
* 0, 1, and 2 so that it is easy to set up these standards for invoked
* commands.
*/
+#define FSAFE 5 /* We keep the first 5 descriptors untouched */
#define FSHTTY 15 /* /dev/tty when manip pgrps */
#define FSHIN 16 /* Preferred desc for shell input */
#define FSHOUT 17 /* ... shell output */
@@ -269,28 +290,17 @@ typedef int sigret_t;
#endif /* sonyrisc */
#if defined(POSIX) && !defined(WINNT_NATIVE)
-/*
- * We should be using setpgid and setpgid
- * by now, but in some systems we use the
- * old routines...
- */
-# if !defined(__APPLE__)
-# define getpgrp __getpgrp
-# define setpgrp __setpgrp
-# endif
# include <unistd.h>
-# undef getpgrp
-# undef setpgrp
/*
* the gcc+protoize version of <stdlib.h>
* redefines malloc(), so we define the following
* to avoid it.
*/
-# if defined(SYSMALLOC) || defined(linux) || defined(sgi) || defined(_OSD_POSIX)
+# if defined(SYSMALLOC) || defined(linux) || defined(__GNU__) || defined(__GLIBC__) || defined(sgi) || defined(_OSD_POSIX)
# define NO_FIX_MALLOC
# include <stdlib.h>
-# else /* linux */
+# else /* glibc */
# define _GNU_STDLIB_H
# define malloc __malloc
# define free __free
@@ -301,11 +311,11 @@ typedef int sigret_t;
# undef free
# undef calloc
# undef realloc
-# endif /* linux || sgi */
+# endif /* glibc || sgi */
# include <limits.h>
#endif /* POSIX && !WINNT_NATIVE */
-#if SYSVREL > 0 || defined(_IBMR2) || defined(_MINIX) || defined(linux)
+#if SYSVREL > 0 || defined(_IBMR2) || defined(_MINIX) || defined(linux) || defined(__GNU__) || defined(__GLIBC__)
# if !defined(pyr) && !defined(stellar)
# include <time.h>
# ifdef _MINIX
@@ -347,7 +357,7 @@ typedef int sigret_t;
#include <setjmp.h>
-#if __STDC__ || defined(FUNCPROTO)
+#if defined(PROTOTYPES)
# include <stdarg.h>
#else
#ifdef _MINIX
@@ -357,16 +367,19 @@ typedef int sigret_t;
#endif /* _MINIX */
#endif
-#ifdef DIRENT
+#ifdef HAVE_DIRENT_H
# include <dirent.h>
#else
-# ifdef hp9000s500
+# ifdef HAVE_NDIR_H
# include <ndir.h>
# else
# include <sys/dir.h>
# endif
# define dirent direct
-#endif /* DIRENT */
+#endif /* HAVE_DIRENT_H */
+#ifndef HAVE_STRUCT_DIRENT_D_INO
+# define d_ino d_fileno
+#endif
#if defined(hpux) || defined(sgi) || defined(OREO) || defined(COHERENT)
# include <stdio.h> /* So the fgetpwent() prototypes work */
#endif /* hpux || sgi || OREO || COHERENT */
@@ -374,12 +387,12 @@ typedef int sigret_t;
#include <pwd.h>
#include <grp.h>
#endif /* WINNT_NATIVE */
-#ifdef PW_SHADOW
+#ifdef HAVE_SHADOW_H
# include <shadow.h>
-#endif /* PW_SHADOW */
-#ifdef PW_AUTH
+#endif /* HAVE_SHADOW_H */
+#ifdef HAVE_AUTH_H
# include <auth.h>
-#endif /* PW_AUTH */
+#endif /* HAVE_AUTH_H */
#if defined(BSD) && !defined(POSIX)
# include <strings.h>
# define strchr(a, b) index(a, b)
@@ -404,7 +417,7 @@ typedef int sigret_t;
# include <netinet/in.h>
# include <arpa/inet.h>
# include <sys/socket.h>
-# if (defined(_SS_SIZE) || defined(_SS_MAXSIZE)) && !defined(NO_SS_FAMILY)
+# if (defined(_SS_SIZE) || defined(_SS_MAXSIZE)) && defined(HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY)
# if !defined(__APPLE__) /* Damnit, where is getnameinfo() folks? */
# if !defined(sgi)
# define INET6
@@ -420,19 +433,10 @@ typedef int sigret_t;
*/
#undef __P
#ifndef __P
-# if __STDC__ || defined(FUNCPROTO)
-# ifndef FUNCPROTO
-# define FUNCPROTO
-# endif
+# if defined(PROTOTYPES)
# define __P(a) a
# else
# define __P(a) ()
-# if !defined(__STDC__)
-# define const
-# ifndef apollo
-# define volatile /* Apollo 'c' extensions need this */
-# endif /* apollo */
-# endif
# endif
#endif
@@ -456,8 +460,6 @@ typedef void pret_t;
# endif /* (vax || uts || MULTIFLOW || PCC) && !__GNUC__ */
#endif /* PURIFY */
-typedef int bool;
-
/*
* ASCII vs. EBCDIC
*/
@@ -469,20 +471,17 @@ typedef int bool;
#include "sh.types.h"
+#ifndef __NetBSD__ /* XXX */
#ifndef WINNT_NATIVE
-# ifndef POSIX
+# ifndef GETPGRP_VOID
extern pid_t getpgrp __P((int));
-# else /* POSIX */
-# if (defined(BSD) && !defined(BSD4_4)) || defined(SUNOS4) || defined(IRIS4D) || defined(DGUX)
-extern pid_t getpgrp __P((int));
-# else /* !(BSD || SUNOS4 || IRIS4D || DGUX) */
+# else
extern pid_t getpgrp __P((void));
-# endif /* BSD || SUNOS4 || IRISD || DGUX */
-# endif /* POSIX */
-extern pid_t setpgrp __P((pid_t, pid_t));
+# endif
#endif /* !WINNT_NATIVE */
+#endif
-typedef sigret_t (*signalfun_t) __P((int));
+typedef RETSIGTYPE (*signalfun_t) __P((int));
#ifndef lint
typedef ptr_t memalign_t;
@@ -575,40 +574,43 @@ extern void DebugFree __P((ptr_t, char *, int));
/*
* Global flags
*/
-EXTERN bool chkstop IZERO; /* Warned of stopped jobs... allow exit */
+EXTERN int chkstop IZERO; /* Warned of stopped jobs... allow exit */
#if (defined(FIOCLEX) && defined(FIONCLEX)) || defined(F_SETFD)
# define CLOSE_ON_EXEC
#else
-EXTERN bool didcch IZERO; /* Have closed unused fd's for child */
+EXTERN int didcch IZERO; /* Have closed unused fd's for child */
#endif /* (FIOCLEX && FIONCLEX) || F_SETFD */
-EXTERN bool didfds IZERO; /* Have setup i/o fd's for child */
-EXTERN bool doneinp IZERO; /* EOF indicator after reset from readc */
-EXTERN bool exiterr IZERO; /* Exit if error or non-zero exit status */
-EXTERN bool child IZERO; /* Child shell ... errors cause exit */
-EXTERN bool haderr IZERO; /* Reset was because of an error */
-EXTERN bool intty IZERO; /* Input is a tty */
-EXTERN bool intact IZERO; /* We are interactive... therefore prompt */
-EXTERN bool justpr IZERO; /* Just print because of :p hist mod */
-EXTERN bool loginsh IZERO; /* We are a loginsh -> .login/.logout */
-EXTERN bool neednote IZERO; /* Need to pnotify() */
-EXTERN bool noexec IZERO; /* Don't execute, just syntax check */
-EXTERN bool pjobs IZERO; /* want to print jobs if interrupted */
-EXTERN bool setintr IZERO; /* Set interrupts on/off -> Wait intr... */
-EXTERN bool timflg IZERO; /* Time the next waited for command */
-EXTERN bool havhash IZERO; /* path hashing is available */
-EXTERN bool editing IZERO; /* doing filename expansion and line editing */
-EXTERN bool noediting IZERO; /* initial $term defaulted to noedit */
-EXTERN bool bslash_quote IZERO;/* PWP: tcsh-style quoting? (in sh.c) */
-EXTERN bool isoutatty IZERO; /* is SHOUT a tty */
-EXTERN bool isdiagatty IZERO;/* is SHDIAG a tty */
-EXTERN bool is1atty IZERO; /* is file descriptor 1 a tty (didfds mode) */
-EXTERN bool is2atty IZERO; /* is file descriptor 2 a tty (didfds mode) */
-EXTERN bool arun IZERO; /* Currently running multi-line-aliases */
+EXTERN int didfds IZERO; /* Have setup i/o fd's for child */
+EXTERN int doneinp IZERO; /* EOF indicator after reset from readc */
+EXTERN int exiterr IZERO; /* Exit if error or non-zero exit status */
+EXTERN int child IZERO; /* Child shell ... errors cause exit */
+EXTERN int haderr IZERO; /* Reset was because of an error */
+EXTERN int intty IZERO; /* Input is a tty */
+EXTERN int intact IZERO; /* We are interactive... therefore prompt */
+EXTERN int justpr IZERO; /* Just print because of :p hist mod */
+EXTERN int loginsh IZERO; /* We are a loginsh -> .login/.logout */
+EXTERN int neednote IZERO; /* Need to pnotify() */
+EXTERN int noexec IZERO; /* Don't execute, just syntax check */
+EXTERN int pjobs IZERO; /* want to print jobs if interrupted */
+EXTERN int setintr IZERO; /* Set interrupts on/off -> Wait intr... */
+EXTERN int timflg IZERO; /* Time the next waited for command */
+EXTERN int havhash IZERO; /* path hashing is available */
+EXTERN int editing IZERO; /* doing filename expansion and line editing */
+EXTERN int noediting IZERO; /* initial $term defaulted to noedit */
+EXTERN int bslash_quote IZERO;/* PWP: tcsh-style quoting? (in sh.c) */
+EXTERN int isoutatty IZERO; /* is SHOUT a tty */
+EXTERN int isdiagatty IZERO;/* is SHDIAG a tty */
+EXTERN int is1atty IZERO; /* is file descriptor 1 a tty (didfds mode) */
+EXTERN int is2atty IZERO; /* is file descriptor 2 a tty (didfds mode) */
+EXTERN int arun IZERO; /* Currently running multi-line-aliases */
EXTERN int implicit_cd IZERO;/* implicit cd enabled?(1=enabled,2=verbose) */
-EXTERN bool inheredoc IZERO; /* Currently parsing a heredoc */
-EXTERN bool windowchg IZERO; /* We received a window change event */
+EXTERN int inheredoc IZERO; /* Currently parsing a heredoc */
+EXTERN int windowchg IZERO; /* We received a window change event */
+#if defined(KANJI) && defined(SHORT_STRINGS) && defined(DSPMBYTE)
+EXTERN int dspmbyte_ls;
+#endif
/*
* Global i/o info
@@ -616,10 +618,10 @@ EXTERN bool windowchg IZERO; /* We received a window change event */
EXTERN Char *arginp IZERO; /* Argument input for sh -c and internal `xx` */
EXTERN int onelflg IZERO; /* 2 -> need line for -t, 1 -> exit on read */
extern Char *ffile; /* Name of shell file for $0 */
-extern bool dolzero; /* if $?0 should return true... */
+extern int dolzero; /* if $?0 should return true... */
extern char *seterr; /* Error message from scanner/parser */
-#if !defined(BSD4_4) && !defined(__linux__)
+#ifndef errno
extern int errno; /* Error from C library routines */
#endif
extern int exitset;
@@ -660,9 +662,9 @@ EXTERN int backpid; /* pid of the last background job */
* uid_t and gid_t are not defined in all the systems so I would have to
* make special cases for them. In the future...
*/
-EXTERN int uid, euid, /* Invokers real and effective */
- gid, egid; /* User and group ids */
-EXTERN int opgrp, /* Initial pgrp and tty pgrp */
+EXTERN uid_t uid, euid; /* Invokers real and effective */
+EXTERN gid_t gid, egid; /* User and group ids */
+EXTERN pid_t opgrp, /* Initial pgrp and tty pgrp */
shpgrp, /* Pgrp of shell */
tpgrp; /* Terminal process group */
/* If tpgrp is -1, leave tty alone! */
@@ -757,14 +759,26 @@ extern signalfun_t parterm; /* Parents terminate catch */
*/
#define META 0200
#define ASCII 0177
-#ifdef SHORT_STRINGS
+#ifdef WIDE_STRINGS /* Implies SHORT_STRINGS */
+/* 31st char bit used for 'ing (not 32nd, we want all values nonnegative) */
+# define QUOTE 0x40000000
+# define TRIM 0x3FFFFFFF /* Mask to strip quote bit */
+# define UNDER 0x20000000 /* Underline flag */
+# define BOLD 0x10000000 /* Bold flag */
+# define STANDOUT 0x08000000 /* Standout flag */
+# define LITERAL 0x04000000 /* Literal character flag */
+# define ATTRIBUTES 0x3C000000 /* The bits used for attributes */
+# define INVALID_BYTE 0x00200000 /* Invalid character on input */
+# define CHAR 0x003FFFFF /* Mask to mask out the character */
+#elif defined (SHORT_STRINGS)
# define QUOTE ((Char) 0100000)/* 16nth char bit used for 'ing */
-# define TRIM 0077777 /* Mask to strip quote bit */
+# define TRIM 0073777 /* Mask to strip quote/lit bit */
# define UNDER 0040000 /* Underline flag */
# define BOLD 0020000 /* Bold flag */
# define STANDOUT 0010000 /* Standout flag */
# define LITERAL 0004000 /* Literal character flag */
# define ATTRIBUTES 0074000 /* The bits used for attributes */
+# define INVALID_BYTE 0
# define CHAR 0000377 /* Mask to mask out the character */
#else
# define QUOTE ((Char) 0200) /* Eighth char bit used for 'ing */
@@ -774,8 +788,10 @@ extern signalfun_t parterm; /* Parents terminate catch */
# define STANDOUT META /* Standout flag */
# define LITERAL 0000000 /* Literal character flag */
# define ATTRIBUTES 0200 /* The bits used for attributes */
+# define INVALID_BYTE 0
# define CHAR 0000177 /* Mask to mask out the character */
#endif
+#define CHAR_DBWIDTH (LITERAL|(LITERAL-1))
EXTERN int AsciiOnly; /* If set only 7 bits expected in characters */
@@ -787,11 +803,15 @@ EXTERN int AsciiOnly; /* If set only 7 bits expected in characters */
* in the buffer.
*/
EXTERN struct Bin {
- off_t Bfseekp; /* Seek pointer */
+ off_t Bfseekp; /* Seek pointer, generally != lseek() value */
off_t Bfbobp; /* Seekp of beginning of buffers */
off_t Bfeobp; /* Seekp of end of buffers */
int Bfblocks; /* Number of buffer blocks */
Char **Bfbuf; /* The array of buffer blocks */
+#ifdef WIDE_STRINGS
+ /* Number of bytes in each character if (cantell) */
+ unsigned char Bfclens[BUFSIZE + 1];
+#endif
} B;
/*
@@ -822,6 +842,7 @@ extern int aret; /* Type of last char returned */
#define feobp B.Bfeobp
#define fblocks B.Bfblocks
#define fbuf B.Bfbuf
+#define fclens B.Bfclens
/*
* The shell finds commands in loops by reseeking the input
@@ -830,7 +851,7 @@ extern int aret; /* Type of last char returned */
*/
EXTERN struct Ain lineloc;
-EXTERN bool cantell; /* Is current source tellable ? */
+EXTERN int cantell; /* Is current source tellable ? */
/*
* Input lines are parsed into doubly linked circular
@@ -962,7 +983,7 @@ typedef void (*bfunc_t) __P((Char **, struct command *));
#endif /* hpux && __STDC__ && !__GNUC__ */
extern struct biltins {
- char *bname;
+ const char *bname;
bfunc_t bfunct;
int minargs, maxargs;
} bfunc[];
@@ -971,11 +992,12 @@ extern int nbfunc;
extern struct biltins nt_bfunc[];
extern int nt_nbfunc;
#endif /* WINNT_NATIVE*/
+extern int bequiet;
extern struct srch {
- char *s_name;
- int s_value;
-} srchn[];
+ const char *s_name;
+ int s_value;
+} srchn[];
extern int nsrchn;
/*
@@ -1031,7 +1053,7 @@ EXTERN Char **alvec IZERO_STRUCT,
*/
EXTERN int gflag; /* After tglob -> is globbing needed? */
-#define MAXVARLEN 30 /* Maximum number of char in a variable name */
+#define MAXVARLEN 256 /* Maximum number of char in a variable name */
#ifdef __CYGWIN__
# undef MAXPATHLEN
@@ -1050,10 +1072,10 @@ EXTERN int gflag; /* After tglob -> is globbing needed? */
* resource limits
*/
extern struct limits {
- int limconst;
- char *limname;
- int limdiv;
- char *limscale;
+ int limconst;
+ const char *limname;
+ int limdiv;
+ const char *limscale;
} limits[];
#endif /* !HAVENOLIMIT */
@@ -1104,8 +1126,12 @@ EXTERN Char PRCHROOT; /* Prompt symbol for root */
* For operating systems with single case filenames (OS/2)
*/
#ifdef CASE_INSENSITIVE
-# define samecase(x) (isupper((unsigned char)(x)) ? \
- tolower((unsigned char)(x)) : (x))
+# ifdef WIDE_STRINGS
+# define samecase(x) (towlower(x))
+# else
+# define samecase(x) (isupper((unsigned char)(x)) ? \
+ tolower((unsigned char)(x)) : (x))
+# endif
#else
# define samecase(x) (x)
#endif /* CASE_INSENSITIVE */
@@ -1135,6 +1161,17 @@ EXTERN Char PRCHROOT; /* Prompt symbol for root */
#define short2blk(a) saveblk(a)
#define short2str(a) strip(a)
#else
+#ifdef WIDE_STRINGS
+#define Strchr(a, b) wcschr(a, b)
+#define Strrchr(a, b) wcsrchr(a, b)
+#define Strcat(a, b) wcscat(a, b)
+#define Strncat(a, b, c) wcsncat(a, b, c)
+#define Strcpy(a, b) wcscpy(a, b)
+#define Strncpy(a, b, c) wcsncpy(a, b, c)
+#define Strlen(a) wcslen(a)
+#define Strcmp(a, b) wcscmp(a, b)
+#define Strncmp(a, b, c) wcsncmp(a, b, c)
+#else
#define Strchr(a, b) s_strchr(a, b)
#define Strrchr(a, b) s_strrchr(a, b)
#define Strcat(a, b) s_strcat(a, b)
@@ -1144,6 +1181,7 @@ EXTERN Char PRCHROOT; /* Prompt symbol for root */
#define Strlen(a) s_strlen(a)
#define Strcmp(a, b) s_strcmp(a, b)
#define Strncmp(a, b, c) s_strncmp(a, b, c)
+#endif
#define Strcasecmp(a, b) s_strcasecmp(a, b)
#define Strspl(a, b) s_strspl(a, b)
@@ -1155,7 +1193,7 @@ EXTERN Char PRCHROOT; /* Prompt symbol for root */
/*
* setname is a macro to save space (see sh.err.c)
*/
-EXTERN char *bname;
+EXTERN const char *bname;
#define setname(a) (bname = (a))
@@ -1170,9 +1208,9 @@ EXTERN Char **evalvec;
EXTERN Char *evalp;
extern struct mesg {
- char *iname; /* name from /usr/include */
- char *pname; /* print name */
-} mesg[];
+ const char *iname; /* name from /usr/include */
+ const char *pname; /* print name */
+} mesg[];
/* word_chars is set by default to WORD_CHARS but can be overridden by
the worchars variable--if unset, reverts to WORD_CHARS */
@@ -1196,27 +1234,26 @@ extern Char **INVPPTR;
extern char *progname;
extern int tcsh;
+extern int xlate_cr;
+extern int output_raw;
+extern int lbuffed;
+extern time_t Htime;
+extern int numeof;
+extern int insource;
+extern char linbuf[];
+extern char *linp;
+extern int nsig;
+#ifdef VFORK
+extern int use_fork;
+#endif
+extern int tellwhat;
+extern int NoNLSRebind;
#include "tc.h"
-#include "sh.decls.h"
-
-/*
- * To print system call errors...
- */
-#ifdef BSD4_4
-# include <errno.h>
-#else
-# ifndef linux
-# ifdef NEEDstrerror
-extern char *sys_errlist[];
-# endif
-extern int errno, sys_nerr;
-# endif /* !linux */
-#endif
#ifndef WINNT_NATIVE
# ifdef NLS_CATALOGS
-# ifdef linux
+# if defined(linux) || defined(__GNU__) || defined(__GLIBC__)
# include <locale.h>
# ifdef notdef
# include <localeinfo.h> /* Has this changed ? */
@@ -1245,7 +1282,11 @@ extern int errno, sys_nerr;
# define MCLoadBySet 0
# endif
EXTERN nl_catd catd;
-# define CGETS(b, c, d) catgets(catd, b, c, d)
+# ifdef HAVE_ICONV
+# define CGETS(b, c, d) iconv_catgets(catd, b, c, d)
+# else
+# define CGETS(b, c, d) catgets(catd, b, c, d)
+# endif
# define CSAVS(b, c, d) strsave(CGETS(b, c, d))
# else
# define CGETS(b, c, d) d
@@ -1257,9 +1298,10 @@ EXTERN nl_catd catd;
#endif /* WINNT_NATIVE */
#if defined(FILEC)
-extern bool filec;
+extern int filec;
#endif /* FILEC */
+#include "sh.decls.h"
/*
* Since on some machines characters are unsigned, and the signed
* keyword is not universally implemented, we treat all characters
@@ -1267,4 +1309,32 @@ extern bool filec;
*/
#define SIGN_EXTEND_CHAR(a) (((a) & 0x80) ? ((a) | ~0x7f) : (a))
+/*
+ * explanation for use by the "--help" option
+ */
+#define HELP_STRING "\
+-b file batch mode, read and execute commands from `file' \n\
+-c command run `command' from next argument \n\
+-d load directory stack from `~/.cshdirs' \n\
+-Dname[=value] define environment variable `name' to `value' (DomainOS only) \n\
+-e exit on any error \n\
+-f start faster by ignoring the start-up file \n\
+-F use fork() instead of vfork() when spawning (ConvexOS only) \n\
+-i interactive, even when input is not from a terminal \n\
+-l act as a login shell, must be the only option specified \n\
+-m load the start-up file, whether or not owned by effective user \n\
+-n file no execute mode, just check syntax of the following `file' \n\
+-q accept SIGQUIT for running under a debugger \n\
+-s read commands from standard input \n\
+-t read one line from standard input \n\
+-v echo commands after history substitution \n\
+-V like -v but including commands read from the start-up file \n\
+-x echo commands immediately before execution \n\
+-X like -x but including commands read from the start-up file \n\
+--help print this message and exit \n\
+--version print the version shell variable and exit \n\
+\nSee the tcsh(1) manual page for detailed information.\n"
+
+#include "tc.nls.h"
+
#endif /* _h_sh */
diff --git a/contrib/tcsh/sh.hist.c b/contrib/tcsh/sh.hist.c
index 96d37ba46cba..a108747aa612 100644
--- a/contrib/tcsh/sh.hist.c
+++ b/contrib/tcsh/sh.hist.c
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/sh.hist.c,v 3.29 2002/06/25 19:02:11 christos Exp $ */
+/* $Header: /src/pub/tcsh/sh.hist.c,v 3.33 2004/12/25 21:15:07 christos Exp $ */
/*
* sh.hist.c: Shell history expansions and substitutions
*/
@@ -32,15 +32,15 @@
*/
#include "sh.h"
-RCSID("$Id: sh.hist.c,v 3.29 2002/06/25 19:02:11 christos Exp $")
+RCSID("$Id: sh.hist.c,v 3.33 2004/12/25 21:15:07 christos Exp $")
#include "tc.h"
-extern bool histvalid;
+extern int histvalid;
extern Char histline[];
Char HistLit = 0;
-static bool heq __P((struct wordent *, struct wordent *));
+static int heq __P((struct wordent *, struct wordent *));
static void hfree __P((struct Hist *));
static void dohist1 __P((struct Hist *, int *, int));
static void phist __P((struct Hist *, int));
@@ -60,10 +60,10 @@ static void phist __P((struct Hist *, int));
void
savehist(sp, mflg)
struct wordent *sp;
- bool mflg;
+ int mflg;
{
- register struct Hist *hp, *np;
- register int histlen = 0;
+ struct Hist *hp, *np;
+ int histlen = 0;
Char *cp;
/* throw away null lines */
@@ -71,7 +71,7 @@ savehist(sp, mflg)
return;
cp = varval(STRhistory);
if (*cp) {
- register Char *p = cp;
+ Char *p = cp;
while (*p) {
if (!Isdigit(*p)) {
@@ -90,7 +90,7 @@ savehist(sp, mflg)
hp = np;
}
-static bool
+static int
heq(a0, b0)
struct wordent *a0, *b0;
{
@@ -112,14 +112,13 @@ heq(a0, b0)
struct Hist *
enthist(event, lp, docopy, mflg)
int event;
- register struct wordent *lp;
- bool docopy;
- bool mflg;
+ struct wordent *lp;
+ int docopy;
+ int mflg;
{
- extern time_t Htime;
struct Hist *p = NULL, *pp = &Histlist;
int n, r;
- register struct Hist *np;
+ struct Hist *np;
Char *dp;
if ((dp = varval(STRhistdup)) != STRNULL) {
@@ -210,7 +209,7 @@ enthist(event, lp, docopy, mflg)
static void
hfree(hp)
- register struct Hist *hp;
+ struct Hist *hp;
{
freelex(&hp->Hlex);
@@ -296,7 +295,7 @@ dohist1(hp, np, hflg)
struct Hist *hp;
int *np, hflg;
{
- bool print = (*np) > 0;
+ int print = (*np) > 0;
for (; hp != 0; hp = hp->Hnext) {
(*np)--;
@@ -313,10 +312,9 @@ dohist1(hp, np, hflg)
static void
phist(hp, hflg)
- register struct Hist *hp;
+ struct Hist *hp;
int hflg;
{
- extern bool output_raw;
if (hflg & HIST_ONLY) {
/*
* Control characters have to be written as is (output_raw).
@@ -349,7 +347,7 @@ phist(hp, hflg)
tprintf(FMT_HISTORY, buf, cp, INBUFSIZE, NULL, hp->Htime, (ptr_t) hp);
for (cp = buf; *cp;)
- xputchar(*cp++);
+ xputwchar(*cp++);
}
}
@@ -373,8 +371,20 @@ fmthist(fmt, ptr, buf, bufsiz)
Char ibuf[INBUFSIZE], *ip;
char *p;
(void) sprlex(ibuf, sizeof(ibuf) / sizeof(Char), &hp->Hlex);
- for (p = buf, ip = ibuf; (*p++ = (CHAR & *ip++)) != '\0'; )
- continue;
+ p = buf;
+ ip = ibuf;
+ do {
+ char xbuf[MB_LEN_MAX];
+ size_t len;
+
+ len = one_wctomb(xbuf, CHAR & *ip);
+ if ((size_t)((p - buf) + len) >= bufsiz)
+ break;
+ memcpy(p, xbuf, len);
+ p += len;
+ } while ((CHAR & *ip++) != 0);
+ if (p <= buf + bufsiz - 1)
+ *p = '\0';
}
break;
default:
@@ -457,7 +467,7 @@ rechist(fname, ref)
void
loadhist(fname, mflg)
Char *fname;
- bool mflg;
+ int mflg;
{
static Char *loadhist_cmd[] = {STRsource, NULL, NULL, NULL};
loadhist_cmd[1] = mflg ? STRmm : STRmh;
diff --git a/contrib/tcsh/sh.init.c b/contrib/tcsh/sh.init.c
index f8e57efccb97..0612cd997b14 100644
--- a/contrib/tcsh/sh.init.c
+++ b/contrib/tcsh/sh.init.c
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/sh.init.c,v 3.51 2004/02/21 20:34:25 christos Exp $ */
+/* $Header: /src/pub/tcsh/sh.init.c,v 3.55 2005/01/18 20:43:31 christos Exp $ */
/*
* sh.init.c: Function and signal tables
*/
@@ -32,7 +32,7 @@
*/
#include "sh.h"
-RCSID("$Id: sh.init.c,v 3.51 2004/02/21 20:34:25 christos Exp $")
+RCSID("$Id: sh.init.c,v 3.55 2005/01/18 20:43:31 christos Exp $")
#include "ed.h"
#include "tw.h"
@@ -155,6 +155,9 @@ struct biltins bfunc[] = {
{ "suspend", dosuspend, 0, 0 },
{ "switch", doswitch, 1, INF },
{ "telltc", dotelltc, 0, INF },
+#ifndef WINNT_NATIVE
+ { "termname", dotermname, 0, 1 },
+#endif
{ "time", dotime, 0, INF },
#if defined(_CX_UX)
{ "ucb", doucb, 0, INF },
@@ -217,7 +220,7 @@ int nsrchn = sizeof srchn / sizeof *srchn;
*/
/* We define NUMSIG to avoid changing NSIG or MAXSIG */
-#ifdef POSIX
+#if defined(POSIX) && !defined(__CYGWIN__)
# define NUMSIG 65
#else /* !POSIX */
# define NUMSIG 33
@@ -225,7 +228,7 @@ int nsrchn = sizeof srchn / sizeof *srchn;
int nsig = NUMSIG - 1; /* This should be the number of real signals */
/* not counting signal 0 */
-struct mesg mesg[NUMSIG]; /* Arrays start at [0] so we initialize from */
+struct mesg mesg[NUMSIG]; /* Arrays start at [0] so we initialize from */
/* 0 to 32 or 64, the max real signal number */
void
diff --git a/contrib/tcsh/sh.lex.c b/contrib/tcsh/sh.lex.c
index e6c7e2df7d08..e18728fa92c7 100644
--- a/contrib/tcsh/sh.lex.c
+++ b/contrib/tcsh/sh.lex.c
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/sh.lex.c,v 3.57 2003/08/04 16:19:13 christos Exp $ */
+/* $Header: /src/pub/tcsh/sh.lex.c,v 3.62 2004/12/25 21:15:07 christos Exp $ */
/*
* sh.lex.c: Lexical analysis into tokens
*/
@@ -32,9 +32,11 @@
*/
#include "sh.h"
-RCSID("$Id: sh.lex.c,v 3.57 2003/08/04 16:19:13 christos Exp $")
+RCSID("$Id: sh.lex.c,v 3.62 2004/12/25 21:15:07 christos Exp $")
#include "ed.h"
+
+#include <assert.h>
/* #define DEBUG_INP */
/* #define DEBUG_SEEK */
@@ -47,21 +49,22 @@ RCSID("$Id: sh.lex.c,v 3.57 2003/08/04 16:19:13 christos Exp $")
* There is some involved processing here, because of the complications
* of input buffering, and especially because of history substitution.
*/
-static Char *word __P((void));
-static int getC1 __P((int));
+static Char *word __P((int));
+static eChar getC1 __P((int));
static void getdol __P((void));
-static void getexcl __P((int));
-static struct Hist *findev __P((Char *, bool));
+static void getexcl __P((Char));
+static struct Hist *findev __P((Char *, int));
static void setexclp __P((Char *));
-static int bgetc __P((void));
+static eChar bgetc __P((void));
static void balloc __P((int));
static void bfree __P((void));
-static struct wordent *gethent __P((int));
+static struct wordent *gethent __P((Char));
static int matchs __P((Char *, Char *));
static int getsel __P((int *, int *, int));
static struct wordent *getsub __P((struct wordent *));
-static Char *subword __P((Char *, int, bool *));
-static struct wordent *dosub __P((int, struct wordent *, bool));
+static Char *subword __P((Char *, Char, int *));
+static struct wordent *dosub __P((Char, struct wordent *, int));
+static ssize_t wide_read __P((int, Char *, size_t, int));
/*
* Peekc is a peek character for getC, peekread for readc.
@@ -111,7 +114,7 @@ static Char labuf[BUFSIZE];
* when called by the alias routine to determine whether to keep the
* argument list.
*/
-static bool hadhist = 0;
+static int hadhist = 0;
/*
* Avoid alias expansion recursion via \!#
@@ -121,12 +124,12 @@ int hleft;
Char histline[BUFSIZE + 2]; /* last line input */
/* The +2 is to fool hp's optimizer */
-bool histvalid = 0; /* is histline valid */
+int histvalid = 0; /* is histline valid */
static Char *histlinep = NULL; /* current pointer into histline */
static Char getCtmp;
-#define getC(f) (((getCtmp = peekc) != '\0') ? (peekc = 0, getCtmp) : getC1(f))
+#define getC(f) (((getCtmp = peekc) != '\0') ? (peekc = 0, (eChar)getCtmp) : getC1(f))
#define ungetC(c) peekc = (Char) c
#define ungetD(c) peekd = (Char) c
@@ -137,6 +140,11 @@ time_t Htime = (time_t)0;
static time_t a2time_t __P((Char *));
/*
+ * special parsing rules apply for source -h
+ */
+extern int enterhist;
+
+/*
* for history event processing
* in the command 'echo !?foo?:1 !$' we want the !$ to expand from the line
* 'foo' was found instead of the last command
@@ -148,7 +156,8 @@ lex(hp)
struct wordent *hp;
{
struct wordent *wdp;
- int c;
+ eChar c;
+ int parsehtime = enterhist;
uselastevent = 1;
@@ -163,7 +172,7 @@ lex(hp)
do
c = readc(0);
while (c == ' ' || c == '\t');
- if (c == HISTSUB && intty)
+ if (c == (eChar)HISTSUB && intty)
/* ^lef^rit from tty is short !:s^lef^rit */
getexcl(c);
else
@@ -183,7 +192,8 @@ lex(hp)
wdp->next = new;
hp->prev = new;
wdp = new;
- wdp->word = word();
+ wdp->word = word(parsehtime);
+ parsehtime = 0;
} while (wdp->word[0] != '\n');
if (histlinep < histline + BUFSIZE) {
*histlinep = '\0';
@@ -199,8 +209,8 @@ lex(hp)
}
static time_t
-a2time_t(word)
- Char *word;
+a2time_t(wordx)
+ Char *wordx;
{
/* Attempt to distinguish timestamps from other possible entries.
* Format: "+NNNNNNNNNN" (10 digits, left padded with ascii '0') */
@@ -209,7 +219,7 @@ a2time_t(word)
Char *s;
int ct;
- if (!word || *(s = word) != '+')
+ if (!wordx || *(s = wordx) != '+')
return (time_t)0;
for (++s, ret = 0, ct = 0; *s; ++s, ++ct)
@@ -282,18 +292,16 @@ freelex(vp)
}
static Char *
-word()
+word(parsehtime)
+ int parsehtime;
{
- Char c, c1;
- Char *wp;
+ eChar c, c1;
+ Char *wp, *unfinished = 0;
Char wbuf[BUFSIZE];
Char hbuf[12];
int h;
- bool dolflg;
+ int dolflg;
int i;
-#if defined(DSPMBYTE)
- int mbytepos = 1;
-#endif /* DSPMBYTE */
wp = wbuf;
i = BUFSIZE - 4;
@@ -315,18 +323,20 @@ loop:
goto ret;
case '#':
- if (intty)
+ if (intty || (enterhist && !parsehtime))
break;
c = 0;
h = 0;
do {
c1 = c;
c = getC(0);
- if (h < 12)
+ if (h < 11 && parsehtime)
hbuf[h++] = c;
} while (c != '\n');
- hbuf[11] = '\0';
- Htime = a2time_t(hbuf);
+ if (parsehtime) {
+ hbuf[11] = '\0';
+ Htime = a2time_t(hbuf);
+ }
if (c1 == '\\')
goto loop;
/*FALLTHROUGH*/
@@ -345,7 +355,7 @@ loop:
onelflg = 2;
goto loop;
}
- if (c != HIST)
+ if (c != (eChar)HIST)
*wp++ = '\\', --i;
c |= QUOTE;
default:
@@ -354,13 +364,6 @@ loop:
c1 = 0;
dolflg = DOALL;
for (;;) {
-#if defined(DSPMBYTE)
- if (mbytepos == 2)
- mbytepos = 1;
- else if (mbytepos == 1 && Ismbyte1(c) && 2 <= i)
- mbytepos = 2;
- else
-#endif /* DSPMBYTE */
if (c1) {
if (c == c1) {
c1 = 0;
@@ -375,7 +378,7 @@ loop:
*
* Actually, all I really want to be able to say is 'foo\'bar' --> foo'bar
*/
- if (c == HIST)
+ if (c == (eChar)HIST)
c |= QUOTE;
else {
if (bslash_quote &&
@@ -408,7 +411,7 @@ loop:
onelflg = 2;
break;
}
- if (c != HIST)
+ if (c != (eChar)HIST)
*wp++ = '\\', --i;
c |= QUOTE;
}
@@ -416,7 +419,7 @@ loop:
c1 = c;
dolflg = c == '"' ? DOALL : DOEXCL;
}
- else if (c != '#' || !intty) {
+ else if (c != '#' || (!intty && !enterhist)) {
ungetC(c);
break;
}
@@ -424,6 +427,17 @@ loop:
if (--i > 0) {
*wp++ = c;
c = getC(dolflg);
+ if (!unfinished)
+ unfinished = wp - 1;
+ switch (NLSFinished(unfinished, wp - unfinished, c)) {
+ case 1:
+ case 0:
+ c |= QUOTE;
+ break;
+ default:
+ unfinished = 0;
+ break;
+ }
}
else {
seterror(ERR_WTOOLONG);
@@ -436,11 +450,11 @@ ret:
return (Strsave(wbuf));
}
-static int
+static eChar
getC1(flag)
int flag;
{
- Char c;
+ eChar c;
for (;;) {
if ((c = peekc) != 0) {
@@ -487,7 +501,7 @@ getC1(flag)
getdol();
continue;
}
- if (c == HIST && (flag & DOEXCL)) {
+ if (c == (eChar)HIST && (flag & DOEXCL)) {
getexcl(0);
continue;
}
@@ -501,9 +515,9 @@ getdol()
{
Char *np, *ep;
Char name[4 * MAXVARLEN + 1];
- int c;
- int sc;
- bool special = 0, toolong;
+ eChar c;
+ eChar sc;
+ int special = 0, toolong;
np = name, *np++ = '$';
c = sc = getC(DOEXCL);
@@ -664,7 +678,7 @@ getdol()
/* scan s// [eichin:19910926.0512EST] */
if (c == 's') {
int delimcnt = 2;
- int delim = getC(0);
+ eChar delim = getC(0);
*np++ = (Char) delim;
if (!delim || letter(delim)
@@ -672,7 +686,7 @@ getdol()
seterror(ERR_BADSUBST);
break;
}
- while ((c = getC(0)) != (-1)) {
+ while ((c = getC(0)) != CHAR_ERR) {
*np++ = (Char) c;
if(c == delim) delimcnt--;
if(!delimcnt) break;
@@ -729,6 +743,7 @@ addla(cp)
if (lap)
(void) Strcpy(buf, lap);
(void) Strcpy(labuf, cp);
+ NLSQuote(labuf);
if (lap)
(void) Strcat(labuf, buf);
lap = labuf;
@@ -741,11 +756,11 @@ static int quesarg;
static void
getexcl(sc)
- int sc;
+ Char sc;
{
struct wordent *hp, *ip;
int left, right, dol;
- int c;
+ eChar c;
if (sc == 0) {
sc = getC(0);
@@ -827,10 +842,10 @@ getsub(en)
struct wordent *en;
{
Char *cp;
- int delim;
- int c;
- int sc;
- bool global;
+ eChar delim;
+ eChar c;
+ eChar sc;
+ int global;
Char orhsb[sizeof(rhsb) / sizeof(Char)];
#ifndef COMPAT
@@ -953,7 +968,7 @@ getsub(en)
default:
if (c == '\n')
unreadc(c);
- seterror(ERR_BADBANGMOD, c);
+ seterror(ERR_BADBANGMOD, (int)c);
return (en);
}
(void) Strcpy(slhs, lhsb);
@@ -980,12 +995,12 @@ getsub(en)
#define HIST_PURGE -50000000
static struct wordent *
dosub(sc, en, global)
- int sc;
+ Char sc;
struct wordent *en;
- bool global;
+ int global;
{
struct wordent lexi;
- bool didsub = 0, didone = 0;
+ int didsub = 0, didone = 0;
struct wordent *hp = &lexi;
struct wordent *wdp;
int i = exclc;
@@ -1041,8 +1056,8 @@ dosub(sc, en, global)
static Char *
subword(cp, type, adid)
Char *cp;
- int type;
- bool *adid;
+ Char type;
+ int *adid;
{
Char wbuf[BUFSIZE];
Char *wp, *mp, *np;
@@ -1117,7 +1132,7 @@ subword(cp, type, adid)
Char *
domod(cp, type)
Char *cp;
- int type;
+ Char type;
{
Char *wp, *xp;
int c;
@@ -1133,22 +1148,12 @@ domod(cp, type)
return (wp);
case 'l':
- wp = Strsave(cp);
- for (cp = wp; *cp; cp++)
- if (Isupper(*cp)) {
- *cp = Tolower(*cp);
- return wp;
- }
- return wp;
+ wp = NLSChangeCase(cp, 1);
+ return wp ? wp : Strsave(cp);
case 'u':
- wp = Strsave(cp);
- for (cp = wp; *cp; cp++)
- if (Islower(*cp)) {
- *cp = Toupper(*cp);
- return wp;
- }
- return wp;
+ wp = NLSChangeCase(cp, 0);
+ return wp ? wp : Strsave(cp);
case 'h':
case 't':
@@ -1195,9 +1200,9 @@ getsel(al, ar, dol)
int *al, *ar;
int dol;
{
- int c = getC(0);
+ eChar c = getC(0);
int i;
- bool first = *al < 0;
+ int first = *al < 0;
switch (c) {
@@ -1278,16 +1283,16 @@ getsel(al, ar, dol)
static struct wordent *
gethent(sc)
- int sc;
+ Char sc;
{
struct Hist *hp;
Char *np;
- int c;
+ eChar c;
int event;
- bool back = 0;
+ int back = 0;
- c = sc == HISTSUB ? HIST : getC(0);
- if (c == HIST) {
+ c = sc == HISTSUB ? (eChar)HIST : getC(0);
+ if (c == (eChar)HIST) {
if (alhistp)
return (alhistp);
event = eventno;
@@ -1405,7 +1410,7 @@ gethent(sc)
static struct Hist *
findev(cp, anyarg)
Char *cp;
- bool anyarg;
+ int anyarg;
{
struct Hist *hp;
@@ -1465,18 +1470,17 @@ setexclp(cp)
void
unreadc(c)
- int c;
+ Char c;
{
peekread = (Char) c;
}
-int
+eChar
readc(wanteof)
- bool wanteof;
+ int wanteof;
{
- int c;
+ eChar c;
static int sincereal; /* Number of real EOFs we've seen */
- extern int numeof;
#ifdef DEBUG_INP
xprintf("readc\n");
@@ -1542,7 +1546,7 @@ top:
do {
if (arginp == INVPTR || onelflg == 1) {
if (wanteof)
- return (-1);
+ return CHAR_ERR;
exitstat();
}
if (arginp) {
@@ -1556,7 +1560,7 @@ top:
reread:
#endif /* BSDJOBS */
c = bgetc();
- if (c < 0) {
+ if (c == CHAR_ERR) {
#ifndef WINNT_NATIVE
# ifndef POSIX
# ifdef TERMIO
@@ -1569,7 +1573,7 @@ reread:
# endif /* POSIX */
#endif /* !WINNT_NATIVE */
if (wanteof)
- return (-1);
+ return CHAR_ERR;
/* was isatty but raw with ignoreeof yields problems */
#ifndef WINNT_NATIVE
# ifndef POSIX
@@ -1680,12 +1684,68 @@ balloc(buf)
}
}
-static int
+static ssize_t
+wide_read(fildes, buf, nchars, use_fclens)
+ int fildes;
+ Char *buf;
+ size_t nchars;
+ int use_fclens;
+{
+ char cbuf[BUFSIZE + 1];
+ ssize_t res, r;
+ size_t partial;
+
+ assert (nchars <= sizeof(cbuf)/sizeof(*cbuf));
+ USE(use_fclens);
+ res = 0;
+ partial = 0;
+ do {
+ size_t i;
+
+ do
+ r = read(fildes, cbuf + partial,
+ nchars > partial ? nchars - partial : 1);
+ while (partial != 0 && r < 0 && errno == EINTR);
+ if (partial == 0 && r <= 0)
+ break;
+ partial += r;
+ i = 0;
+ while (i < partial) {
+ int len;
+
+ len = normal_mbtowc(buf + res, cbuf + i, partial - i);
+ if (len == -1) {
+ reset_mbtowc();
+ if (partial < MB_LEN_MAX && r > 0)
+ /* Maybe a partial character and there is still a chance
+ to read more */
+ break;
+ buf[res] = (unsigned char)cbuf[i] | INVALID_BYTE;
+ }
+ if (len <= 0)
+ len = 1;
+#ifdef WIDE_STRINGS
+ if (use_fclens)
+ fclens[res] = len;
+#endif
+ i += len;
+ res++;
+ nchars--;
+ }
+ if (i != partial)
+ memmove(cbuf, cbuf + i, partial - i);
+ partial -= i;
+ } while (partial != 0);
+ /* Throwing away possible partial multibyte characters on error */
+ return res != 0 ? res : r;
+}
+
+static eChar
bgetc()
{
+ Char ch;
int c, off, buf;
int numleft = 0, roomleft;
- char tbuf[BUFSIZE + 1];
if (cantell) {
if (fseekp < fbobp || fseekp > feobp) {
@@ -1693,32 +1753,28 @@ bgetc()
(void) lseek(SHIN, fseekp, L_SET);
}
if (fseekp == feobp) {
- int i;
-
fbobp = feobp;
do
- c = read(SHIN, tbuf, BUFSIZE);
+ c = wide_read(SHIN, fbuf[0], BUFSIZE, 1);
while (c < 0 && errno == EINTR);
#ifdef convex
if (c < 0)
stderror(ERR_SYSTEM, progname, strerror(errno));
#endif /* convex */
if (c <= 0)
- return (-1);
- for (i = 0; i < c; i++)
- fbuf[0][i] = (unsigned char) tbuf[i];
+ return CHAR_ERR;
feobp += c;
}
#ifndef WINNT_NATIVE
- c = fbuf[0][fseekp - fbobp];
+ ch = fbuf[0][fseekp - fbobp];
fseekp++;
#else
do {
- c = fbuf[0][fseekp - fbobp];
+ ch = fbuf[0][fseekp - fbobp];
fseekp++;
- } while(c == '\r');
+ } while(ch == '\r');
#endif /* !WINNT_NATIVE */
- return (c);
+ return (ch);
}
while (fseekp >= feobp) {
@@ -1752,29 +1808,27 @@ bgetc()
buf = (int) feobp / BUFSIZE;
balloc(buf);
roomleft = BUFSIZE - off;
- c = read(SHIN, tbuf, (size_t) roomleft);
- if (c > 0) {
- int i;
- Char *ptr = fbuf[buf] + off;
-
- for (i = 0; i < c; i++)
- ptr[i] = (unsigned char) tbuf[i];
+ c = wide_read(SHIN, fbuf[buf] + off, (size_t) roomleft, 0);
+ if (c > 0)
feobp += c;
- }
}
if (c == 0 || (c < 0 && fixio(SHIN, errno) == -1))
- return (-1);
+ return CHAR_ERR;
}
+#ifdef SIG_WINDOW
+ if (windowchg)
+ (void) check_window_size(0); /* for window systems */
+#endif /* SIG_WINDOW */
#ifndef WINNT_NATIVE
- c = fbuf[(int) fseekp / BUFSIZE][(int) fseekp % BUFSIZE];
+ ch = fbuf[(int) fseekp / BUFSIZE][(int) fseekp % BUFSIZE];
fseekp++;
#else
do {
- c = fbuf[(int) fseekp / BUFSIZE][(int) fseekp % BUFSIZE];
+ ch = fbuf[(int) fseekp / BUFSIZE][(int) fseekp % BUFSIZE];
fseekp++;
- } while(c == '\r');
+ } while(ch == '\r');
#endif /* !WINNT_NATIVE */
- return (c);
+ return (ch);
}
static void
@@ -1821,6 +1875,28 @@ bseek(l)
xprintf(CGETS(16, 6, "seek to file %x\n"), fseekp);
#endif
fseekp = l->f_seek;
+#ifdef WIDE_STRINGS
+ if (cantell) {
+ if (fseekp >= fbobp) {
+ size_t i;
+ off_t o;
+
+ o = fbobp;
+ for (i = 0; i < feobp - fbobp; i++) {
+ if (fseekp == o) {
+ fseekp = fbobp + i;
+ return;
+ }
+ o += fclens[i];
+ }
+ if (fseekp == o) {
+ fseekp = feobp;
+ return;
+ }
+ }
+ fbobp = feobp = fseekp + 1; /* To force lseek() */
+ }
+#endif
return;
default:
xprintf(CGETS(16, 7, "Bad seek type %d\n"), aret);
@@ -1849,8 +1925,17 @@ struct Ain *l;
#endif
return;
case TCSH_F_SEEK:
- /*SUPPRESS 112*/
- l->f_seek = fseekp;
+#ifdef WIDE_STRINGS
+ if (cantell && fseekp >= fbobp && fseekp < feobp) {
+ size_t i;
+
+ l->f_seek = fbobp;
+ for (i = 0; i < fseekp - fbobp; i++)
+ l->f_seek += fclens[i];
+ } else
+#endif
+ /*SUPPRESS 112*/
+ l->f_seek = fseekp;
l->a_seek = NULL;
#ifdef DEBUG_SEEK
xprintf(CGETS(16, 10, "tell file %x\n"), fseekp);
diff --git a/contrib/tcsh/sh.misc.c b/contrib/tcsh/sh.misc.c
index 8b1cc51cead8..ae9f04d65d6f 100644
--- a/contrib/tcsh/sh.misc.c
+++ b/contrib/tcsh/sh.misc.c
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/sh.misc.c,v 3.26 2003/03/12 19:14:51 christos Exp $ */
+/* $Header: /src/pub/tcsh/sh.misc.c,v 3.34 2005/01/18 20:24:50 christos Exp $ */
/*
* sh.misc.c: Miscelaneous functions
*/
@@ -32,7 +32,7 @@
*/
#include "sh.h"
-RCSID("$Id: sh.misc.c,v 3.26 2003/03/12 19:14:51 christos Exp $")
+RCSID("$Id: sh.misc.c,v 3.34 2005/01/18 20:24:50 christos Exp $")
static int renum __P((int, int));
static Char **blkend __P((Char **));
@@ -44,13 +44,13 @@ static Char **blkcat __P((Char **, Char **));
int
any(s, c)
- register char *s;
- register int c;
+ const char *s;
+ Char c;
{
if (!s)
return (0); /* Check for nil pointer */
while (*s)
- if (*s++ == c)
+ if ((Char)*s++ == c)
return (1);
return (0);
}
@@ -68,25 +68,24 @@ setzero(cp, i)
char *
strsave(s)
- register const char *s;
+ const char *s;
{
- char *n;
- register char *p;
+ char *n, *r;
+ const char *p;
if (s == NULL)
- s = (const char *) "";
- for (p = (char *) s; *p++ != '\0';)
+ s = "";
+ for (p = s; *p++ != '\0';)
continue;
- n = p = (char *) xmalloc((size_t)
- ((((const char *) p) - s) * sizeof(char)));
- while ((*p++ = *s++) != '\0')
+ r = n = (char *) xmalloc((size_t)((((const char *) p) - s) * sizeof(char)));
+ while ((*n++ = *s++) != '\0')
continue;
- return (n);
+ return (r);
}
static Char **
blkend(up)
- register Char **up;
+ Char **up;
{
while (*up)
@@ -97,7 +96,7 @@ blkend(up)
void
blkpr(av)
- register Char **av;
+ Char **av;
{
for (; *av; av++) {
@@ -109,7 +108,7 @@ blkpr(av)
void
blkexpand(av, str)
- register Char **av;
+ Char **av;
Char *str;
{
*str = '\0';
@@ -122,9 +121,9 @@ blkexpand(av, str)
int
blklen(av)
- register Char **av;
+ Char **av;
{
- register int i = 0;
+ int i = 0;
while (*av++)
i++;
@@ -134,9 +133,9 @@ blklen(av)
Char **
blkcpy(oav, bv)
Char **oav;
- register Char **bv;
+ Char **bv;
{
- register Char **av = oav;
+ Char **av = oav;
while ((*av++ = *bv++) != NULL)
continue;
@@ -156,7 +155,7 @@ void
blkfree(av0)
Char **av0;
{
- register Char **av = av0;
+ Char **av = av0;
if (!av0)
return;
@@ -167,9 +166,9 @@ blkfree(av0)
Char **
saveblk(v)
- register Char **v;
+ Char **v;
{
- register Char **newv =
+ Char **newv =
(Char **) xcalloc((size_t) (blklen(v) + 1), sizeof(Char **));
Char **onewv = newv;
@@ -178,14 +177,14 @@ saveblk(v)
return (onewv);
}
-#if !defined(SHORT_STRINGS) && !defined(POSIX)
+#ifndef HAVE_STRSTR
char *
strstr(s, t)
- register const char *s, *t;
+ const char *s, *t;
{
do {
- register const char *ss = s;
- register const char *tt = t;
+ const char *ss = s;
+ const char *tt = t;
do
if (*tt == '\0')
@@ -194,30 +193,25 @@ strstr(s, t)
} while (*s++ != '\0');
return (NULL);
}
-
-#endif /* !SHORT_STRINGS && !POSIX */
+#endif /* !HAVE_STRSTR */
#ifndef SHORT_STRINGS
char *
strspl(cp, dp)
- char *cp, *dp;
+ const char *cp, *dp;
{
char *ep;
- register char *p, *q;
+ size_t cl, dl;
if (!cp)
cp = "";
if (!dp)
dp = "";
- for (p = cp; *p++ != '\0';)
- continue;
- for (q = dp; *q++ != '\0';)
- continue;
- ep = (char *) xmalloc((size_t) (((p - cp) + (q - dp) - 1) * sizeof(char)));
- for (p = ep, q = cp; (*p++ = *q++) != '\0';)
- continue;
- for (p--, q = dp; (*p++ = *q++) != '\0';)
- continue;
+ cl = strlen(cp);
+ dl = strlen(dp);
+ ep = (char *) xmalloc((cl + dl + 1) * sizeof(char));
+ memcpy(ep, cp, cl);
+ memcpy(ep + cl, dp, dl + 1);
return (ep);
}
@@ -225,9 +219,9 @@ strspl(cp, dp)
Char **
blkspl(up, vp)
- register Char **up, **vp;
+ Char **up, **vp;
{
- register Char **wp =
+ Char **wp =
(Char **) xcalloc((size_t) (blklen(up) + blklen(vp) + 1),
sizeof(Char **));
@@ -237,7 +231,7 @@ blkspl(up, vp)
Char
lastchr(cp)
- register Char *cp;
+ Char *cp;
{
if (!cp)
@@ -256,11 +250,11 @@ lastchr(cp)
void
closem()
{
- register int f;
+ int f;
#ifdef NLS_BUGS
#ifdef NLS_CATALOGS
- (void)catclose(catd);
+ nlsclose();
#endif /* NLS_CATALOGS */
#endif /* NLS_BUGS */
#ifdef YPBUGS
@@ -298,7 +292,7 @@ closem()
void
closech()
{
- register int f;
+ int f;
if (didcch)
return;
@@ -326,12 +320,9 @@ donefds()
#ifdef NISPLUS
{
int fd = open(_PATH_DEVNULL, O_RDONLY|O_LARGEFILE);
- (void) dup2(fd, 1);
- (void) dup2(fd, 2);
- if (fd != 0) {
- (void) dup2(fd, 0);
- (void) close(fd);
- }
+ (void)dcopy(fd, 1);
+ (void)dcopy(fd, 2);
+ (void)dmove(fd, 0);
}
#endif /*NISPLUS*/
}
@@ -339,16 +330,16 @@ donefds()
/*
* Move descriptor i to j.
* If j is -1 then we just want to get i to a safe place,
- * i.e. to a unit > 2. This also happens in dcopy.
+ * i.e. to a unit > FSAFE. This also happens in dcopy.
*/
int
dmove(i, j)
- register int i, j;
+ int i, j;
{
if (i == j || i < 0)
return (i);
-#ifdef HAVEDUP2
+#ifdef HAVE_DUP2
if (j >= 0) {
(void) dup2(i, j);
if (j != i)
@@ -364,13 +355,13 @@ dmove(i, j)
int
dcopy(i, j)
- register int i, j;
+ int i, j;
{
- if (i == j || i < 0 || (j < 0 && i > 2))
+ if (i == j || i < 0 || (j < 0 && i > FSAFE))
return (i);
if (j >= 0) {
-#ifdef HAVEDUP2
+#ifdef HAVE_DUP2
(void) dup2(i, j);
return (j);
#else
@@ -382,13 +373,13 @@ dcopy(i, j)
static int
renum(i, j)
- register int i, j;
+ int i, j;
{
- register int k = dup(i);
+ int k = dup(i);
if (k < 0)
return (-1);
- if (j == -1 && k > 2)
+ if (j == -1 && k > FSAFE)
return (k);
if (k != j) {
j = renum(k, j);
@@ -405,10 +396,10 @@ renum(i, j)
*/
void
lshift(v, c)
- register Char **v;
- register int c;
+ Char **v;
+ int c;
{
- register Char **u;
+ Char **u;
for (u = v; *u && --c >= 0; u++)
xfree((ptr_t) *u);
@@ -434,9 +425,9 @@ number(cp)
Char **
copyblk(v)
- register Char **v;
+ Char **v;
{
- register Char **nv =
+ Char **nv =
(Char **) xcalloc((size_t) (blklen(v) + 1), sizeof(Char **));
return (blkcpy(nv, v));
@@ -445,7 +436,7 @@ copyblk(v)
#ifndef SHORT_STRINGS
char *
strend(cp)
- register char *cp;
+ char *cp;
{
if (!cp)
return (cp);
@@ -460,7 +451,7 @@ Char *
strip(cp)
Char *cp;
{
- register Char *dp = cp;
+ Char *dp = cp;
if (!cp)
return (cp);
@@ -473,7 +464,7 @@ Char *
quote(cp)
Char *cp;
{
- register Char *dp = cp;
+ Char *dp = cp;
if (!cp)
return (cp);
@@ -508,7 +499,7 @@ udvar(name)
int
prefix(sub, str)
- register Char *sub, *str;
+ const Char *sub, *str;
{
for (;;) {
diff --git a/contrib/tcsh/sh.parse.c b/contrib/tcsh/sh.parse.c
index b1a76d829e79..74f82a18ca1a 100644
--- a/contrib/tcsh/sh.parse.c
+++ b/contrib/tcsh/sh.parse.c
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/sh.parse.c,v 3.11 2002/03/08 17:36:46 christos Exp $ */
+/* $Header: /src/pub/tcsh/sh.parse.c,v 3.13 2004/11/23 02:10:49 christos Exp $ */
/*
* sh.parse.c: Interpret a list of tokens
*/
@@ -32,7 +32,7 @@
*/
#include "sh.h"
-RCSID("$Id: sh.parse.c,v 3.11 2002/03/08 17:36:46 christos Exp $")
+RCSID("$Id: sh.parse.c,v 3.13 2004/11/23 02:10:49 christos Exp $")
/*
* C shell
@@ -60,7 +60,7 @@ static int aleft;
extern int hleft;
void
alias(lexp)
- register struct wordent *lexp;
+ struct wordent *lexp;
{
jmp_buf_t osetexit;
@@ -80,7 +80,7 @@ alias(lexp)
static void
asyntax(p1, p2)
- register struct wordent *p1, *p2;
+ struct wordent *p1, *p2;
{
while (p1 != p2)
if (any(";&\n", p1->word[0]))
@@ -94,10 +94,10 @@ asyntax(p1, p2)
static void
asyn0(p1, p2)
struct wordent *p1;
- register struct wordent *p2;
+ struct wordent *p2;
{
- register struct wordent *p;
- register int l = 0;
+ struct wordent *p;
+ int l = 0;
for (p = p1; p != p2; p = p->next)
switch (p->word[0]) {
@@ -137,11 +137,11 @@ asyn0(p1, p2)
static void
asyn3(p1, p2)
struct wordent *p1;
- register struct wordent *p2;
+ struct wordent *p2;
{
- register struct varent *ap;
+ struct varent *ap;
struct wordent alout;
- register bool redid;
+ int redid;
if (p1 == p2)
return;
@@ -187,9 +187,9 @@ asyn3(p1, p2)
static struct wordent *
freenod(p1, p2)
- register struct wordent *p1, *p2;
+ struct wordent *p1, *p2;
{
- register struct wordent *retp = p1->prev;
+ struct wordent *retp = p1->prev;
while (p1 != p2) {
xfree((ptr_t) p1->word);
@@ -213,7 +213,7 @@ freenod(p1, p2)
*/
struct command *
syntax(p1, p2, flags)
- register struct wordent *p1, *p2;
+ struct wordent *p1, *p2;
int flags;
{
@@ -235,8 +235,8 @@ syn0(p1, p2, flags)
struct wordent *p1, *p2;
int flags;
{
- register struct wordent *p;
- register struct command *t, *t1;
+ struct wordent *p;
+ struct command *t, *t1;
int l;
l = 0;
@@ -305,8 +305,8 @@ syn1(p1, p2, flags)
struct wordent *p1, *p2;
int flags;
{
- register struct wordent *p;
- register struct command *t;
+ struct wordent *p;
+ struct command *t;
int l;
l = 0;
@@ -349,9 +349,9 @@ syn1a(p1, p2, flags)
struct wordent *p1, *p2;
int flags;
{
- register struct wordent *p;
- register struct command *t;
- register int l = 0;
+ struct wordent *p;
+ struct command *t;
+ int l = 0;
for (p = p1; p != p2; p = p->next)
switch (p->word[0]) {
@@ -393,9 +393,9 @@ syn1b(p1, p2, flags)
struct wordent *p1, *p2;
int flags;
{
- register struct wordent *p;
- register struct command *t;
- register int l = 0;
+ struct wordent *p;
+ struct command *t;
+ int l = 0;
for (p = p1; p != p2; p = p->next)
switch (p->word[0]) {
@@ -436,9 +436,9 @@ syn2(p1, p2, flags)
struct wordent *p1, *p2;
int flags;
{
- register struct wordent *p, *pn;
- register struct command *t;
- register int l = 0;
+ struct wordent *p, *pn;
+ struct command *t;
+ int l = 0;
int f;
for (p = p1; p != p2; p = p->next)
@@ -490,13 +490,13 @@ syn3(p1, p2, flags)
struct wordent *p1, *p2;
int flags;
{
- register struct wordent *p;
+ struct wordent *p;
struct wordent *lp, *rp;
- register struct command *t;
- register int l;
+ struct command *t;
+ int l;
Char **av;
int n, c;
- bool specp = 0;
+ int specp = 0;
if (p1 != p2) {
p = p1;
@@ -668,9 +668,9 @@ again:
void
freesyn(t)
- register struct command *t;
+ struct command *t;
{
- register Char **v;
+ Char **v;
if (t == 0)
return;
diff --git a/contrib/tcsh/sh.print.c b/contrib/tcsh/sh.print.c
index 263252da45ef..d7bde3aacf38 100644
--- a/contrib/tcsh/sh.print.c
+++ b/contrib/tcsh/sh.print.c
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/sh.print.c,v 3.21 2002/03/08 17:36:46 christos Exp $ */
+/* $Header: /src/pub/tcsh/sh.print.c,v 3.28 2005/03/03 17:19:35 kim Exp $ */
/*
* sh.print.c: Primitive Output routines.
*/
@@ -32,17 +32,15 @@
*/
#include "sh.h"
-RCSID("$Id: sh.print.c,v 3.21 2002/03/08 17:36:46 christos Exp $")
+RCSID("$Id: sh.print.c,v 3.28 2005/03/03 17:19:35 kim Exp $")
#include "ed.h"
extern int Tty_eight_bit;
-extern int Tty_raw_mode;
-extern Char GettingInput;
int lbuffed = 1; /* true if line buffered */
-static void p2dig __P((int));
+static void p2dig __P((unsigned int));
/*
* C Shell
@@ -51,9 +49,9 @@ static void p2dig __P((int));
#if defined(BSDLIMIT) || defined(RLIMIT_CPU)
void
psecs(l)
- long l;
+ unsigned long l;
{
- register int i;
+ int i;
i = (int) (l / 3600);
if (i) {
@@ -75,7 +73,7 @@ minsec:
void
pcsecs(l) /* PWP: print mm:ss.dd, l is in sec*100 */
#ifdef BSDTIMES
- long l;
+ unsigned long l;
#else /* BSDTIMES */
# ifndef POSIX
time_t l;
@@ -84,7 +82,7 @@ pcsecs(l) /* PWP: print mm:ss.dd, l is in sec*100 */
# endif /* POSIX */
#endif /* BSDTIMES */
{
- register int i;
+ int i;
i = (int) (l / 360000);
if (i) {
@@ -105,35 +103,60 @@ minsec:
static void
p2dig(i)
- register int i;
+ unsigned int i;
{
- xprintf("%d%d", i / 10, i % 10);
+ xprintf("%u%u", i / 10, i % 10);
}
char linbuf[2048]; /* was 128 */
char *linp = linbuf;
-bool output_raw = 0; /* PWP */
-bool xlate_cr = 0; /* HE */
+int output_raw = 0; /* PWP */
+int xlate_cr = 0; /* HE */
+
+#ifdef WIDE_STRINGS
+void
+putwraw(Char c)
+{
+ char buf[MB_LEN_MAX];
+ size_t i, len;
+
+ len = one_wctomb(buf, c & CHAR);
+ for (i = 0; i < len; i++)
+ putraw((unsigned char)buf[i] | (c & ~CHAR));
+}
+
+void
+xputwchar(Char c)
+{
+ char buf[MB_LEN_MAX];
+ size_t i, len;
+
+ len = one_wctomb(buf, c & CHAR);
+ for (i = 0; i < len; i++)
+ xputchar((unsigned char)buf[i] | (c & ~CHAR));
+}
+#endif
void
xputchar(c)
- register int c;
+ int c;
{
int atr = 0;
atr |= c & ATTRIBUTES & TRIM;
c &= CHAR | QUOTE;
if (!output_raw && (c & QUOTE) == 0) {
- if (Iscntrl(c)) {
+ if (iscntrl(c) && (c < 0x80 || MB_CUR_MAX == 1)) {
#ifdef COLORCAT
- if (c != '\t' && c != '\n' && !(adrof(STRcolorcat) && c=='\033') && (xlate_cr || c != '\r')) {
+ if (c != '\t' && c != '\n' && !(adrof(STRcolorcat) && c=='\033') && (xlate_cr || c != '\r'))
#else
- if (c != '\t' && c != '\n' && (xlate_cr || c != '\r')) {
+ if (c != '\t' && c != '\n' && (xlate_cr || c != '\r'))
#endif
+ {
xputchar('^' | atr);
#ifdef IS_ASCII
- if (c == ASCII)
+ if (c == 0177)
c = '?';
else
c |= 0100;
@@ -146,7 +169,7 @@ xputchar(c)
}
}
- else if (!Isprint(c)) {
+ else if (!isprint(c) && (c < 0x80 || MB_CUR_MAX == 1)) {
xputchar('\\' | atr);
xputchar((((c >> 6) & 7) + '0') | atr);
xputchar((((c >> 3) & 7) + '0') | atr);
@@ -167,7 +190,7 @@ xputchar(c)
int
putraw(c)
- register int c;
+ int c;
{
if (haderr ? (didfds ? is2atty : isdiagatty) :
(didfds ? is1atty : isoutatty)) {
@@ -183,7 +206,7 @@ putraw(c)
int
putpure(c)
- register int c;
+ int c;
{
c &= CHAR;
diff --git a/contrib/tcsh/sh.proc.c b/contrib/tcsh/sh.proc.c
index b91a6dc7e4e6..62b75af62c38 100644
--- a/contrib/tcsh/sh.proc.c
+++ b/contrib/tcsh/sh.proc.c
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/sh.proc.c,v 3.81 2003/11/09 03:02:46 christos Exp $ */
+/* $Header: /src/pub/tcsh/sh.proc.c,v 3.90 2005/03/03 19:57:07 kim Exp $ */
/*
* sh.proc.c: Job manipulations
*/
@@ -32,7 +32,7 @@
*/
#include "sh.h"
-RCSID("$Id: sh.proc.c,v 3.81 2003/11/09 03:02:46 christos Exp $")
+RCSID("$Id: sh.proc.c,v 3.90 2005/03/03 19:57:07 kim Exp $")
#include "ed.h"
#include "tc.h"
@@ -47,9 +47,9 @@ RCSID("$Id: sh.proc.c,v 3.81 2003/11/09 03:02:46 christos Exp $")
# define HZ 16
#endif /* aiws */
-#if defined(_BSD) || (defined(IRIS4D) && __STDC__) || defined(__lucid) || defined(linux)
+#if defined(_BSD) || (defined(IRIS4D) && __STDC__) || defined(__lucid) || defined(linux) || defined(__GNU__) || defined(__GLIBC__)
# define BSDWAIT
-#endif /* _BSD || (IRIS4D && __STDC__) || __lucid || linux */
+#endif /* _BSD || (IRIS4D && __STDC__) || __lucid || glibc */
#ifndef WTERMSIG
# define WTERMSIG(w) (((union wait *) &(w))->w_termsig)
# ifndef BSDWAIT
@@ -91,23 +91,7 @@ static struct cvxrusage zru = {{0L, 0L}, {0L, 0L}, 0L, 0L, 0L, 0L,
{0L, 0L}, 0LL, 0LL, 0LL, 0LL, 0L, 0L, 0L,
0LL, 0LL, {0L, 0L, 0L, 0L, 0L}};
# else
-# if defined(SUNOS4) || defined(hp9000) || (defined(__alpha) && defined(__osf__))
-static struct rusage zru = {{0L, 0L}, {0L, 0L}, 0L, 0L, 0L, 0L,
- 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L};
-
-# else /* !SUNOS4 && !hp9000 && !(__alpha && __osf__) */
-# ifdef masscomp
-/*
- * Initialization of this structure under RTU 4.1A & RTU 5.0 is problematic
- * because the first two elements are unions of a time_t and a struct timeval.
- * So we'll just have to trust the loader to do the "right thing", DAS DEC-90.
- */
static struct rusage zru;
-# else /* masscomp */
-static struct rusage zru = {{0L, 0L}, {0L, 0L}, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0};
-# endif /* masscomp */
-# endif /* SUNOS4 || hp9000 || (__alpha && __osf__) */
# endif /* convex */
#else /* !BSDTIMES */
# ifdef _SEQUENT_
@@ -146,17 +130,14 @@ static void setttypgrp __P((int));
* childs status. Top level routines (like pwait) must be sure
* to mask interrupts when playing with the proclist data structures!
*/
-sigret_t
+RETSIGTYPE
/*ARGSUSED*/
pchild(snum)
int snum;
{
- register struct process *pp;
- register struct process *fp;
- register int pid;
-#if defined(BSDJOBS) || (!defined(BSDTIMES) && (defined(ODT) || defined(aiws) || defined(uts)))
- extern int insource;
-#endif /* BSDJOBS || (!BSDTIMES && (ODT || aiws || uts)) */
+ struct process *pp;
+ struct process *fp;
+ int pid;
#ifdef BSDWAIT
union wait w;
#else /* !BSDWAIT */
@@ -173,7 +154,6 @@ int snum;
# else /* !_SEQUENT_ */
struct tms proctimes;
- USE(snum);
if (!timesdone) {
timesdone++;
(void) times(&shtimes);
@@ -181,6 +161,7 @@ int snum;
# endif /* !_SEQUENT_ */
#endif /* !BSDTIMES */
+ USE(snum);
#ifdef JOBDEBUG
xprintf("pchild()\n");
#endif /* JOBDEBUG */
@@ -216,7 +197,7 @@ loop:
(setintr && (intty || insource) ? WNOHANG | WUNTRACED : WNOHANG), &ru);
# else
/* both a wait3 and rusage */
-# if !defined(BSDWAIT) || defined(NeXT) || defined(MACH) || defined(linux) || (defined(IRIS4D) && (__STDC__ || defined(FUNCPROTO)) && SYSVREL <= 3) || defined(__lucid) || defined(__osf__)
+# if !defined(BSDWAIT) || defined(NeXT) || defined(MACH) || defined(linux) || defined(__GNU__) || defined(__GLIBC__) || (defined(IRIS4D) && (__STDC__ || defined(PROTOTYPES)) && SYSVREL <= 3) || defined(__lucid) || defined(__osf__)
pid = wait3(&w,
(setintr && (intty || insource) ? WNOHANG | WUNTRACED : WNOHANG), &ru);
# else /* BSDWAIT */
@@ -307,11 +288,7 @@ loop:
goto loop;
}
pnoprocesses = pid == -1;
-#ifndef SIGVOID
- return (0);
-#else /* !SIGVOID */
- return;
-#endif /* !SIGVOID */
+ goto end;
}
for (pp = proclist.p_next; pp != NULL; pp = pp->p_next)
if (pid == pp->p_procid)
@@ -445,8 +422,6 @@ found:
if ((jobflags & PSTOPPED) == 0)
pflush(pp);
{
- extern Char GettingInput;
-
if (GettingInput) {
errno = 0;
(void) Rawmode();
@@ -472,12 +447,14 @@ found:
#if defined(BSDJOBS) || defined(HAVEwait3)
goto loop;
#endif /* BSDJOBS || HAVEwait3 */
+ end:
+ ;
}
void
pnote()
{
- register struct process *pp;
+ struct process *pp;
int flags;
#ifdef BSDSIGS
sigmask_t omask;
@@ -524,7 +501,7 @@ pfree(pp)
void
pwait()
{
- register struct process *fp, *pp;
+ struct process *fp, *pp;
#ifdef BSDSIGS
sigmask_t omask;
#endif /* BSDSIGS */
@@ -562,9 +539,9 @@ pwait()
*/
void
pjwait(pp)
- register struct process *pp;
+ struct process *pp;
{
- register struct process *fp;
+ struct process *fp;
int jobflags, reason;
#ifdef BSDSIGS
sigmask_t omask;
@@ -689,7 +666,7 @@ dowait(v, c)
Char **v;
struct command *c;
{
- register struct process *pp;
+ struct process *pp;
#ifdef BSDSIGS
sigmask_t omask;
#endif /* BSDSIGS */
@@ -730,7 +707,7 @@ loop:
static void
pflushall()
{
- register struct process *pp;
+ struct process *pp;
for (pp = proclist.p_next; pp != NULL; pp = pp->p_next)
if (pp->p_procid)
@@ -744,10 +721,10 @@ pflushall()
*/
static void
pflush(pp)
- register struct process *pp;
+ struct process *pp;
{
- register struct process *np;
- register int idx;
+ struct process *np;
+ int idx;
if (pp->p_procid == 0) {
xprintf(CGETS(17, 3, "BUG: process flushed twice"));
@@ -778,7 +755,7 @@ pflush(pp)
*/
static void
pclrcurr(pp)
- register struct process *pp;
+ struct process *pp;
{
if (pp == pcurrent) {
if (pprevious != NULL) {
@@ -804,7 +781,7 @@ static Char *cmdp;
*/
Char *
unparse(t)
- register struct command *t;
+ struct command *t;
{
cmdp = command;
cmdlen = 0;
@@ -821,9 +798,9 @@ unparse(t)
void
palloc(pid, t)
int pid;
- register struct command *t;
+ struct command *t;
{
- register struct process *pp;
+ struct process *pp;
int i;
pp = (struct process *) xcalloc(1, (size_t) sizeof(struct process));
@@ -908,7 +885,7 @@ palloc(pid, t)
static void
padd(t)
- register struct command *t;
+ struct command *t;
{
Char **argp;
@@ -974,7 +951,7 @@ static void
pads(cp)
Char *cp;
{
- register int i;
+ int i;
/*
* Avoid the Quoted Space alias hack! Reported by:
@@ -1028,7 +1005,7 @@ prestjob()
void
pendjob()
{
- register struct process *pp, *tp;
+ struct process *pp, *tp;
if (pcurrjob && (pcurrjob->p_flags & (PFOREGND | PSTOPPED)) == 0) {
pp = pcurrjob;
@@ -1058,14 +1035,13 @@ pendjob()
static int
pprint(pp, flag)
- register struct process *pp;
- bool flag;
+ struct process *pp;
+ int flag;
{
int status, reason;
struct process *tp;
- extern char *linp, linbuf[];
int jobflags, pstatus, pcond;
- char *format;
+ const char *format;
#ifdef BACKPIPE
struct process *pipehead = NULL, *pipetail = NULL, *pmarker = NULL;
@@ -1175,12 +1151,14 @@ pprint(pp, flag)
&& reason != SIGINT
&& (reason != SIGPIPE
|| (pp->p_flags & PPOU) == 0))) {
- char *ptr;
+ const char *ptr;
char buf[1024];
- if ((ptr = mesg[pp->p_reason & ASCII].pname) == NULL)
- xsnprintf(ptr = buf, sizeof(buf), "%s %d",
+ if ((ptr = mesg[pp->p_reason & ASCII].pname) == NULL) {
+ xsnprintf(buf, sizeof(buf), "%s %d",
CGETS(17, 5, "Signal"), pp->p_reason & ASCII);
+ ptr = buf;
+ }
xprintf(format, ptr);
}
else
@@ -1302,13 +1280,13 @@ prcomd:
static void
ptprint(tp)
- register struct process *tp;
+ struct process *tp;
{
#ifdef BSDTIMES
struct timeval tetime, diff;
static struct timeval ztime;
struct sysrusage ru;
- register struct process *pp = tp;
+ struct process *pp = tp;
ru = zru;
tetime = ztime;
@@ -1324,7 +1302,7 @@ ptprint(tp)
timeval_t tetime, diff;
static timeval_t ztime;
struct process_stats ru;
- register struct process *pp = tp;
+ struct process *pp = tp;
ru = zru;
tetime = ztime;
@@ -1352,7 +1330,7 @@ ptprint(tp)
# endif /* POSIX */
struct tms zts, rts;
- register struct process *pp = tp;
+ struct process *pp = tp;
u_time = zu_time;
s_time = zs_time;
@@ -1386,8 +1364,8 @@ dojobs(v, c)
Char **v;
struct command *c;
{
- register struct process *pp;
- register int flag = NUMBER | NAME | REASON;
+ struct process *pp;
+ int flag = NUMBER | NAME | REASON;
int i;
USE(c);
@@ -1417,7 +1395,7 @@ dofg(v, c)
Char **v;
struct command *c;
{
- register struct process *pp;
+ struct process *pp;
USE(c);
okpcntl();
@@ -1448,7 +1426,7 @@ dofg1(v, c)
Char **v;
struct command *c;
{
- register struct process *pp;
+ struct process *pp;
USE(c);
okpcntl();
@@ -1476,7 +1454,7 @@ dobg(v, c)
Char **v;
struct command *c;
{
- register struct process *pp;
+ struct process *pp;
USE(c);
okpcntl();
@@ -1499,7 +1477,7 @@ dobg1(v, c)
Char **v;
struct command *c;
{
- register struct process *pp;
+ struct process *pp;
USE(c);
pp = pfind(v[0]);
@@ -1533,11 +1511,9 @@ dokill(v, c)
Char **v;
struct command *c;
{
- register int signum, len = 0;
- register char *name;
+ int signum, len = 0;
+ const char *name;
Char *sigptr;
- extern int T_Cols;
- extern int nsig;
USE(c);
v++;
@@ -1592,7 +1568,7 @@ pkill(v, signum)
Char **v;
int signum;
{
- register struct process *pp, *np;
+ struct process *pp, *np;
int jobflags = 0, err1 = 0;
pid_t pid;
#ifdef BSDSIGS
@@ -1717,11 +1693,11 @@ cont:
*/
int
pstart(pp, foregnd)
- register struct process *pp;
+ struct process *pp;
int foregnd;
{
int rv = 0;
- register struct process *np;
+ struct process *np;
#ifdef BSDSIGS
sigmask_t omask;
#endif /* BSDSIGS */
@@ -1792,9 +1768,9 @@ pstart(pp, foregnd)
void
panystop(neednl)
- bool neednl;
+ int neednl;
{
- register struct process *pp;
+ struct process *pp;
chkstop = 2;
for (pp = proclist.p_next; pp; pp = pp->p_next)
@@ -1806,7 +1782,7 @@ struct process *
pfind(cp)
Char *cp;
{
- register struct process *pp, *np;
+ struct process *pp, *np;
if (cp == 0 || cp[1] == 0 || eq(cp, STRcent2) || eq(cp, STRcentplus)) {
if (pcurrent == NULL)
@@ -1830,7 +1806,7 @@ pfind(cp)
for (pp = proclist.p_next; pp; pp = pp->p_next)
if (pp->p_procid == pp->p_jobid) {
if (cp[1] == '?') {
- register Char *dp;
+ Char *dp;
for (dp = pp->p_command; *dp; dp++) {
if (*dp != cp[2])
@@ -1859,10 +1835,10 @@ pfind(cp)
*/
static struct process *
pgetcurr(pp)
- register struct process *pp;
+ struct process *pp;
{
- register struct process *np;
- register struct process *xp = NULL;
+ struct process *np;
+ struct process *xp = NULL;
for (np = proclist.p_next; np; np = np->p_next)
if (np != pcurrent && np != pp && np->p_procid &&
@@ -1884,7 +1860,7 @@ donotify(v, c)
Char **v;
struct command *c;
{
- register struct process *pp;
+ struct process *pp;
USE(c);
pp = pfind(*++v);
@@ -1908,8 +1884,8 @@ pfork(t, wanttty)
struct command *t; /* command we are forking for */
int wanttty;
{
- register int pid;
- bool ignint = 0;
+ int pid;
+ int ignint = 0;
int pgrp;
#ifdef BSDSIGS
sigmask_t omask = 0;
@@ -2016,12 +1992,12 @@ pfork(t, wanttty)
(void) signal(SIGHUP, SIG_IGN);
if (t->t_dflg & F_NICE) {
int nval = SIGN_EXTEND_CHAR(t->t_nice);
-#ifdef BSDNICE
+#ifdef HAVE_SETPRIORITY
if (setpriority(PRIO_PROCESS, 0, nval) == -1 && errno)
stderror(ERR_SYSTEM, "setpriority", strerror(errno));
-#else /* !BSDNICE */
+#else /* !HAVE_SETPRIORITY */
(void) nice(nval);
-#endif /* !BSDNICE */
+#endif /* !HAVE_SETPRIORITY */
}
#ifdef F_VER
if (t->t_dflg & F_VER) {
diff --git a/contrib/tcsh/sh.proc.h b/contrib/tcsh/sh.proc.h
index c526b2ef4121..863db94052c0 100644
--- a/contrib/tcsh/sh.proc.h
+++ b/contrib/tcsh/sh.proc.h
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/sh.proc.h,v 3.10 2002/03/08 17:36:46 christos Exp $ */
+/* $Header: /src/pub/tcsh/sh.proc.h,v 3.11 2004/11/23 02:10:49 christos Exp $ */
/*
* sh.proc.h: Process data structures and variables
*/
@@ -116,7 +116,7 @@ struct process {
#define AREASON 0200
EXTERN struct process proclist IZERO_STRUCT;/* list head of all processes */
-EXTERN bool pnoprocesses IZERO; /* pchild found nothing to wait for */
+EXTERN int pnoprocesses IZERO; /* pchild found nothing to wait for */
EXTERN struct process *pholdjob IZERO; /* one level stack of current jobs */
@@ -127,7 +127,7 @@ EXTERN struct process *pprevious IZERO; /* previous job in table */
EXTERN int pmaxindex IZERO; /* current maximum job index */
#ifndef BSDTIMES
-EXTERN bool timesdone; /* shtimes buffer full ? */
+EXTERN int timesdone; /* shtimes buffer full ? */
#endif /* BSDTIMES */
#endif /* _h_sh_proc */
diff --git a/contrib/tcsh/sh.sem.c b/contrib/tcsh/sh.sem.c
index a7839af5a768..97d10e088fc7 100644
--- a/contrib/tcsh/sh.sem.c
+++ b/contrib/tcsh/sh.sem.c
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/sh.sem.c,v 3.60 2004/02/23 15:04:36 christos Exp $ */
+/* $Header: /src/pub/tcsh/sh.sem.c,v 3.69 2005/01/18 20:24:51 christos Exp $ */
/*
* sh.sem.c: I/O redirections and job forking. A touchy issue!
* Most stuff with builtins is incorrect
@@ -33,7 +33,7 @@
*/
#include "sh.h"
-RCSID("$Id: sh.sem.c,v 3.60 2004/02/23 15:04:36 christos Exp $")
+RCSID("$Id: sh.sem.c,v 3.69 2005/01/18 20:24:51 christos Exp $")
#include "tc.h"
#include "tw.h"
@@ -50,13 +50,13 @@ RCSID("$Id: sh.sem.c,v 3.60 2004/02/23 15:04:36 christos Exp $")
#endif /* CLOSE_ON_EXEC */
#if defined(__sparc__) || defined(sparc)
-# if !defined(MACH) && SYSVREL == 0 && !defined(Lynx) && !defined(BSD4_4) && !defined(linux)
+# if !defined(MACH) && SYSVREL == 0 && !defined(Lynx) && !defined(BSD4_4) && !defined(linux) && !defined(__GNU__) && !defined(__GLIBC__)
# include <vfork.h>
-# endif /* !MACH && SYSVREL == 0 && !Lynx && !BSD4_4 && !linux */
+# endif /* !MACH && SYSVREL == 0 && !Lynx && !BSD4_4 && !glibc */
#endif /* __sparc__ || sparc */
#ifdef VFORK
-static sigret_t vffree __P((int));
+static RETSIGTYPE vffree __P((int));
#endif
static Char *splicepipe __P((struct command *, Char *));
static void doio __P((struct command *, int *, int *));
@@ -85,16 +85,12 @@ static void chkclob __P((char *));
/*VARARGS 1*/
void
execute(t, wanttty, pipein, pipeout, do_glob)
- register struct command *t;
+ struct command *t;
int wanttty;
int *pipein, *pipeout;
- bool do_glob;
+ int do_glob;
{
-#ifdef VFORK
- extern bool use_fork; /* use fork() instead of vfork()? */
-#endif
-
- bool forked = 0;
+ int forked = 0;
struct biltins *bifunc;
int pid = 0;
int pv[2];
@@ -522,7 +518,7 @@ execute(t, wanttty, pipein, pipeout, do_glob)
else { /* child */
/* this is from pfork() */
int pgrp;
- bool ignint = 0;
+ int ignint = 0;
if (nosigchld) {
# ifdef BSDSIGS
(void) sigsetmask(csigmask);
@@ -579,13 +575,13 @@ execute(t, wanttty, pipein, pipeout, do_glob)
(void) signal(SIGHUP, SIG_DFL);
if (t->t_dflg & F_NICE) {
int nval = SIGN_EXTEND_CHAR(t->t_nice);
-# ifdef BSDNICE
+# ifdef HAVE_SETPRIORITY
if (setpriority(PRIO_PROCESS, 0, nval) == -1 && errno)
stderror(ERR_SYSTEM, "setpriority",
strerror(errno));
-# else /* !BSDNICE */
+# else /* !HAVE_SETPRIORITY */
(void) nice(nval);
-# endif /* BSDNICE */
+# endif /* HAVE_SETPRIORITY */
}
# ifdef F_VER
if (t->t_dflg & F_VER) {
@@ -654,6 +650,13 @@ execute(t, wanttty, pipein, pipeout, do_glob)
func(t, bifunc);
if (forked)
exitstat();
+ else {
+ if (adrof(STRprintexitvalue)) {
+ int rv = getn(varval(STRstatus));
+ if (rv != 0)
+ xprintf(CGETS(17, 2, "Exit %d\n"), rv);
+ }
+ }
break;
}
if (t->t_dtyp != NODE_PAREN) {
@@ -663,15 +666,19 @@ execute(t, wanttty, pipein, pipeout, do_glob)
/*
* For () commands must put new 0,1,2 in FSH* and recurse
*/
- OLDSTD = dcopy(0, FOLDSTD);
- SHOUT = dcopy(1, FSHOUT);
+ (void)close_on_exec(OLDSTD = dcopy(0, FOLDSTD), 1);
+ (void)close_on_exec(SHOUT = dcopy(1, FSHOUT), 1);
isoutatty = isatty(SHOUT);
- SHDIAG = dcopy(2, FSHDIAG);
+ (void)close_on_exec(SHDIAG = dcopy(2, FSHDIAG), 1);
isdiagatty = isatty(SHDIAG);
(void) close(SHIN);
SHIN = -1;
#ifndef CLOSE_ON_EXEC
didcch = 0;
+#else
+ (void) close_on_exec(FSHOUT, 1);
+ (void) close_on_exec(FSHDIAG, 1);
+ (void) close_on_exec(FOLDSTD, 1);
#endif /* !CLOSE_ON_EXEC */
didfds = 0;
wanttty = -1;
@@ -747,12 +754,12 @@ execute(t, wanttty, pipein, pipeout, do_glob)
}
#ifdef VFORK
-static sigret_t
+static RETSIGTYPE
/*ARGSUSED*/
vffree(snum)
int snum;
{
- register Char **v;
+ Char **v;
USE(snum);
if ((v = gargv) != 0) {
@@ -766,10 +773,6 @@ int snum;
}
_exit(1);
-#ifndef SIGVOID
- /*NOTREACHED*/
- return(0);
-#endif /* SIGVOID */
}
#endif /* VFORK */
@@ -790,7 +793,7 @@ int snum;
*/
static Char *
splicepipe(t, cp)
- register struct command *t;
+ struct command *t;
Char *cp; /* word after < or > */
{
Char *blk[2];
@@ -836,12 +839,12 @@ splicepipe(t, cp)
*/
static void
doio(t, pipein, pipeout)
- register struct command *t;
+ struct command *t;
int *pipein, *pipeout;
{
- register int fd;
- register Char *cp;
- register unsigned long flags = t->t_dflg;
+ int fd;
+ Char *cp;
+ unsigned long flags = t->t_dflg;
if (didfds || (flags & F_REPEAT))
return;
@@ -863,7 +866,7 @@ doio(t, pipein, pipeout)
stderror(ERR_SYSTEM, tmp, strerror(errno));
/* allow input files larger than 2Gb */
#ifndef WINNT_NATIVE
- (void) fcntl(fd, O_LARGEFILE, 0);
+ (void) fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_LARGEFILE);
#endif /*!WINNT_NATIVE*/
(void) dmove(fd, 0);
}
@@ -923,7 +926,7 @@ doio(t, pipein, pipeout)
stderror(ERR_SYSTEM, tmp, strerror(errno));
/* allow input files larger than 2Gb */
#ifndef WINNT_NATIVE
- (void) fcntl(fd, O_LARGEFILE, 0);
+ (void) fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_LARGEFILE);
#endif /*!WINNT_NATIVE*/
}
(void) dmove(fd, 1);
@@ -960,13 +963,13 @@ doio(t, pipein, pipeout)
void
mypipe(pv)
- register int *pv;
+ int *pv;
{
if (pipe(pv) < 0)
goto oops;
- pv[0] = dmove(pv[0], -1);
- pv[1] = dmove(pv[1], -1);
+ (void)close_on_exec(pv[0] = dmove(pv[0], -1), 1);
+ (void)close_on_exec(pv[1] = dmove(pv[1], -1), 1);
if (pv[0] >= 0 && pv[1] >= 0)
return;
oops:
@@ -975,7 +978,7 @@ oops:
static void
chkclob(cp)
- register char *cp;
+ char *cp;
{
struct stat stb;
diff --git a/contrib/tcsh/sh.set.c b/contrib/tcsh/sh.set.c
index afb92f43b8ed..568024fc00fd 100644
--- a/contrib/tcsh/sh.set.c
+++ b/contrib/tcsh/sh.set.c
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/sh.set.c,v 3.48 2004/03/21 16:48:14 christos Exp $ */
+/* $Header: /src/pub/tcsh/sh.set.c,v 3.61 2005/03/03 16:57:02 kim Exp $ */
/*
* sh.set.c: Setting and Clearing of variables
*/
@@ -32,13 +32,16 @@
*/
#include "sh.h"
-RCSID("$Id: sh.set.c,v 3.48 2004/03/21 16:48:14 christos Exp $")
+RCSID("$Id: sh.set.c,v 3.61 2005/03/03 16:57:02 kim Exp $")
#include "ed.h"
#include "tw.h"
-extern Char HistLit;
-extern bool GotTermCaps;
+#ifdef HAVE_NL_LANGINFO
+#include <langinfo.h>
+#endif
+
+extern int GotTermCaps;
int numeof = 0;
static void update_vars __P((Char *));
@@ -66,13 +69,13 @@ update_vars(vp)
dohash(NULL, NULL);
}
else if (eq(vp, STRhistchars)) {
- register Char *pn = varval(vp);
+ Char *pn = varval(vp);
HIST = *pn++;
HISTSUB = *pn;
}
else if (eq(vp, STRpromptchars)) {
- register Char *pn = varval(vp);
+ Char *pn = varval(vp);
PRCH = *pn++;
PRCHROOT = *pn;
@@ -94,7 +97,7 @@ update_vars(vp)
loginsh = 1;
}
else if (eq(vp, STRsymlinks)) {
- register Char *pn = varval(vp);
+ Char *pn = varval(vp);
if (eq(pn, STRignore))
symlinks = SYM_IGNORE;
@@ -192,7 +195,7 @@ update_vars(vp)
#endif
#ifdef NLS_CATALOGS
else if (eq(vp, STRcatalog)) {
- (void) catclose(catd);
+ nlsclose();
nlsinit();
}
#if defined(FILEC) && defined(TIOCSTI)
@@ -206,18 +209,18 @@ update_vars(vp)
/*ARGSUSED*/
void
doset(v, c)
- register Char **v;
+ Char **v;
struct command *c;
{
- register Char *p;
+ Char *p;
Char *vp, op;
Char **vecp;
- bool hadsub;
+ int hadsub;
int subscr;
int flags = VAR_READWRITE;
- bool first_match = 0;
- bool last_match = 0;
- bool changed = 0;
+ int first_match = 0;
+ int last_match = 0;
+ int changed = 0;
USE(c);
v++;
@@ -276,7 +279,7 @@ doset(v, c)
if (op && op != '=')
stderror(ERR_NAME | ERR_SYNTAX);
if (eq(p, STRLparen)) {
- register Char **e = v;
+ Char **e = v;
if (hadsub)
stderror(ERR_NAME | ERR_SYNTAX);
@@ -309,8 +312,8 @@ doset(v, c)
static Char *
getinx(cp, ip)
- register Char *cp;
- register int *ip;
+ Char *cp;
+ int *ip;
{
*ip = 0;
*cp++ = 0;
@@ -327,7 +330,7 @@ asx(vp, subscr, p)
int subscr;
Char *p;
{
- register struct varent *v = getvx(vp, subscr);
+ struct varent *v = getvx(vp, subscr);
if (v->v_flags & VAR_READONLY)
stderror(ERR_READONLY|ERR_NAME, v->v_name);
@@ -340,7 +343,7 @@ getvx(vp, subscr)
Char *vp;
int subscr;
{
- register struct varent *v = adrof(vp);
+ struct varent *v = adrof(vp);
if (v == 0)
udvar(vp);
@@ -355,9 +358,9 @@ dolet(v, dummy)
Char **v;
struct command *dummy;
{
- register Char *p;
+ Char *p;
Char *vp, c, op;
- bool hadsub;
+ int hadsub;
int subscr;
USE(dummy);
@@ -443,7 +446,7 @@ static Char *
xset(cp, vp)
Char *cp, ***vp;
{
- register Char *dp;
+ Char *dp;
if (*cp) {
dp = Strsave(cp);
@@ -461,9 +464,9 @@ operate(op, vp, p)
{
Char opr[2];
Char *vec[5];
- register Char **v = vec;
+ Char **v = vec;
Char **vecp = v;