summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr/src/Makefile.ast29
-rw-r--r--usr/src/Makefile.lint1
-rw-r--r--usr/src/cmd/Makefile7
-rw-r--r--usr/src/cmd/ast/Makefile6
-rw-r--r--usr/src/cmd/ast/msgcc/Makefile22
-rw-r--r--usr/src/cmd/ast/msgcc/msgcc.sh4
-rw-r--r--usr/src/cmd/ast/msgcc/msgcpp.c4
-rw-r--r--usr/src/cmd/ast/msgcc/msgcvt.c4
-rw-r--r--usr/src/cmd/ast/msgcc/msggen.c4
-rw-r--r--usr/src/cmd/ast/msgcc/msgget.c4
-rw-r--r--usr/src/cmd/file/magic3
-rw-r--r--usr/src/cmd/ksh/Makefile27
-rw-r--r--usr/src/cmd/ksh/Makefile.com48
-rw-r--r--usr/src/cmd/ksh/Makefile.testshell122
-rw-r--r--usr/src/cmd/ksh/amd64/Makefile17
-rw-r--r--usr/src/cmd/ksh/builtins/Makefile76
-rw-r--r--usr/src/cmd/ksh/builtins/alias.sh51
-rw-r--r--usr/src/cmd/ksh/i386/Makefile17
-rw-r--r--usr/src/cmd/ksh/sparc/Makefile17
-rw-r--r--usr/src/cmd/ksh/sparcv9/Makefile17
-rw-r--r--usr/src/cmd/nsadmin/ksh.kshrc59
-rw-r--r--usr/src/cmd/shcomp/Makefile91
-rw-r--r--usr/src/cmd/sleep/sleep.c112
-rw-r--r--usr/src/cmd/sum/sum.c149
-rw-r--r--usr/src/lib/Makefile6
-rw-r--r--usr/src/lib/Makefile.asthdr46
-rw-r--r--usr/src/lib/Makefile.astmsg16
-rw-r--r--usr/src/lib/libast/Makefile12
-rw-r--r--usr/src/lib/libast/Makefile.com44
-rw-r--r--usr/src/lib/libast/amd64/Makefile8
-rw-r--r--usr/src/lib/libast/amd64/include/ast/align.h6
-rw-r--r--usr/src/lib/libast/amd64/include/ast/ast.h6
-rw-r--r--usr/src/lib/libast/amd64/include/ast/ast_botch.h6
-rw-r--r--usr/src/lib/libast/amd64/include/ast/ast_ccode.h6
-rw-r--r--usr/src/lib/libast/amd64/include/ast/ast_common.h6
-rw-r--r--usr/src/lib/libast/amd64/include/ast/ast_dir.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/ast_dirent.h6
-rw-r--r--usr/src/lib/libast/amd64/include/ast/ast_fcntl.h6
-rw-r--r--usr/src/lib/libast/amd64/include/ast/ast_float.h9
-rw-r--r--usr/src/lib/libast/amd64/include/ast/ast_fs.h19
-rw-r--r--usr/src/lib/libast/amd64/include/ast/ast_getopt.h32
-rw-r--r--usr/src/lib/libast/amd64/include/ast/ast_iconv.h6
-rw-r--r--usr/src/lib/libast/amd64/include/ast/ast_lib.h6
-rw-r--r--usr/src/lib/libast/amd64/include/ast/ast_limits.h6
-rw-r--r--usr/src/lib/libast/amd64/include/ast/ast_map.h18
-rw-r--r--usr/src/lib/libast/amd64/include/ast/ast_mmap.h6
-rw-r--r--usr/src/lib/libast/amd64/include/ast/ast_mode.h6
-rw-r--r--usr/src/lib/libast/amd64/include/ast/ast_namval.h51
-rw-r--r--usr/src/lib/libast/amd64/include/ast/ast_ndbm.h30
-rw-r--r--usr/src/lib/libast/amd64/include/ast/ast_nl_types.h6
-rw-r--r--usr/src/lib/libast/amd64/include/ast/ast_param.h6
-rw-r--r--usr/src/lib/libast/amd64/include/ast/ast_standards.h6
-rw-r--r--usr/src/lib/libast/amd64/include/ast/ast_std.h22
-rw-r--r--usr/src/lib/libast/amd64/include/ast/ast_stdio.h22
-rw-r--r--usr/src/lib/libast/amd64/include/ast/ast_sys.h6
-rw-r--r--usr/src/lib/libast/amd64/include/ast/ast_time.h8
-rw-r--r--usr/src/lib/libast/amd64/include/ast/ast_tty.h6
-rw-r--r--usr/src/lib/libast/amd64/include/ast/ast_version.h2
-rw-r--r--usr/src/lib/libast/amd64/include/ast/ast_vfork.h6
-rw-r--r--usr/src/lib/libast/amd64/include/ast/ast_wait.h6
-rw-r--r--usr/src/lib/libast/amd64/include/ast/ast_wchar.h6
-rw-r--r--usr/src/lib/libast/amd64/include/ast/ast_windows.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/bytesex.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/ccode.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/cdt.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/debug.h42
-rw-r--r--usr/src/lib/libast/amd64/include/ast/dirent.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/dt.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/endian.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/error.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/find.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/fnmatch.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/fnv.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/fs3d.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/fts.h10
-rw-r--r--usr/src/lib/libast/amd64/include/ast/ftw.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/ftwalk.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/getopt.h9
-rw-r--r--usr/src/lib/libast/amd64/include/ast/glob.h8
-rw-r--r--usr/src/lib/libast/amd64/include/ast/hash.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/hashkey.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/hashpart.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/iconv.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/ip6.h28
-rw-r--r--usr/src/lib/libast/amd64/include/ast/lc.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/ls.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/magic.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/magicid.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/mc.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/mime.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/mnt.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/modecanon.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/modex.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/namval.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/nl_types.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/option.h5
-rw-r--r--usr/src/lib/libast/amd64/include/ast/preroot.h6
-rw-r--r--usr/src/lib/libast/amd64/include/ast/proc.h10
-rw-r--r--usr/src/lib/libast/amd64/include/ast/re_comp.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/recfmt.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/regexp.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/sfdisc.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/sfio.h9
-rw-r--r--usr/src/lib/libast/amd64/include/ast/sfio_s.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/sfio_t.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/shcmd.h103
-rw-r--r--usr/src/lib/libast/amd64/include/ast/sig.h6
-rw-r--r--usr/src/lib/libast/amd64/include/ast/stack.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/stak.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/stdio.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/stk.h5
-rw-r--r--usr/src/lib/libast/amd64/include/ast/swap.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/tar.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/times.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/tm.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/tmx.h6
-rw-r--r--usr/src/lib/libast/amd64/include/ast/tok.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/tv.h6
-rw-r--r--usr/src/lib/libast/amd64/include/ast/usage.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/vdb.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/vecargs.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/vmalloc.h6
-rw-r--r--usr/src/lib/libast/amd64/include/ast/wait.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/wchar.h4
-rw-r--r--usr/src/lib/libast/amd64/include/ast/wordexp.h4
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/align2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/botch2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/ccode2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/common2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/dirent2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/eaccess2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/errno2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/fcntl2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/float5
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/fs15
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/hack2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/iconv2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/isoc9911
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/lib2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/libpath2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/limits2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/map14
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/mmap2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/mode2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/ndbm9
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/nl_types2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/omitted2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/param2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/preroot2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/sfinit2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/sfio2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/sig2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/siglist125
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/signal30
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/standards2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/stdio18
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/sys2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/time4
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/tmlib7
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/tmx2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/tty2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/tv2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/tvlib3
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/types5
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/uwin2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/vfork2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/vmalloc2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/wait2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/FEATURE/wchar2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/align.h2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/ast_botch.h2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/ast_ccode.h2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/ast_common.h2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/ast_dirent.h2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/ast_fcntl.h2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/ast_float.h5
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/ast_fs.h15
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/ast_iconv.h2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/ast_lib.h2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/ast_limits.h2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/ast_map.h14
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/ast_mmap.h2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/ast_mode.h2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/ast_ndbm.h9
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/ast_nl_types.h2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/ast_param.h2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/ast_standards.h2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/ast_stdio.h18
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/ast_sys.h2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/ast_time.h4
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/ast_tty.h2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/ast_types.h5
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/ast_vfork.h2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/ast_wait.h2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/ast_wchar.h2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/conftab.c686
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/conftab.h80
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/lc.h4
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/lctab.c (renamed from usr/src/lib/libast/amd64/src/lib/libast/lctab.h)498
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/preroot.h2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/sig.h2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/tmx.h2
-rw-r--r--usr/src/lib/libast/amd64/src/lib/libast/tv.h2
-rw-r--r--usr/src/lib/libast/common/RELEASE99
-rw-r--r--usr/src/lib/libast/common/cdt/dtclose.c4
-rw-r--r--usr/src/lib/libast/common/cdt/dtdisc.c4
-rw-r--r--usr/src/lib/libast/common/cdt/dtextract.c4
-rw-r--r--usr/src/lib/libast/common/cdt/dtflatten.c4
-rw-r--r--usr/src/lib/libast/common/cdt/dthash.c4
-rw-r--r--usr/src/lib/libast/common/cdt/dthdr.h4
-rw-r--r--usr/src/lib/libast/common/cdt/dtlist.c4
-rw-r--r--usr/src/lib/libast/common/cdt/dtmethod.c4
-rw-r--r--usr/src/lib/libast/common/cdt/dtnew.c4
-rw-r--r--usr/src/lib/libast/common/cdt/dtopen.c4
-rw-r--r--usr/src/lib/libast/common/cdt/dtrenew.c4
-rw-r--r--usr/src/lib/libast/common/cdt/dtrestore.c4
-rw-r--r--usr/src/lib/libast/common/cdt/dtsize.c4
-rw-r--r--usr/src/lib/libast/common/cdt/dtstat.c4
-rw-r--r--usr/src/lib/libast/common/cdt/dtstrhash.c4
-rw-r--r--usr/src/lib/libast/common/cdt/dttree.c4
-rw-r--r--usr/src/lib/libast/common/cdt/dttreeset.c4
-rw-r--r--usr/src/lib/libast/common/cdt/dtview.c4
-rw-r--r--usr/src/lib/libast/common/cdt/dtwalk.c4
-rw-r--r--usr/src/lib/libast/common/comp/atexit.c4
-rw-r--r--usr/src/lib/libast/common/comp/basename.c4
-rw-r--r--usr/src/lib/libast/common/comp/catopen.c4
-rw-r--r--usr/src/lib/libast/common/comp/closelog.c4
-rw-r--r--usr/src/lib/libast/common/comp/conf.sh146
-rw-r--r--usr/src/lib/libast/common/comp/conf.tab42
-rw-r--r--usr/src/lib/libast/common/comp/creat64.c4
-rw-r--r--usr/src/lib/libast/common/comp/dirname.c4
-rw-r--r--usr/src/lib/libast/common/comp/dup2.c4
-rw-r--r--usr/src/lib/libast/common/comp/eaccess.c4
-rw-r--r--usr/src/lib/libast/common/comp/errno.c4
-rw-r--r--usr/src/lib/libast/common/comp/execlp.c4
-rw-r--r--usr/src/lib/libast/common/comp/execve.c4
-rw-r--r--usr/src/lib/libast/common/comp/execvp.c4
-rw-r--r--usr/src/lib/libast/common/comp/execvpe.c4
-rw-r--r--usr/src/lib/libast/common/comp/fcntl.c4
-rw-r--r--usr/src/lib/libast/common/comp/fmtmsglib.c4
-rw-r--r--usr/src/lib/libast/common/comp/fnmatch.c4
-rw-r--r--usr/src/lib/libast/common/comp/fnmatch.h4
-rw-r--r--usr/src/lib/libast/common/comp/frexp.c4
-rw-r--r--usr/src/lib/libast/common/comp/frexpl.c4
-rw-r--r--usr/src/lib/libast/common/comp/fsync.c4
-rw-r--r--usr/src/lib/libast/common/comp/ftw.c4
-rw-r--r--usr/src/lib/libast/common/comp/ftw.h4
-rw-r--r--usr/src/lib/libast/common/comp/getdate.c4
-rw-r--r--usr/src/lib/libast/common/comp/getgroups.c4
-rw-r--r--usr/src/lib/libast/common/comp/getlogin.c4
-rw-r--r--usr/src/lib/libast/common/comp/getopt.c4
-rw-r--r--usr/src/lib/libast/common/comp/getopt.h13
-rw-r--r--usr/src/lib/libast/common/comp/getoptl.c5
-rw-r--r--usr/src/lib/libast/common/comp/getpgrp.c4
-rw-r--r--usr/src/lib/libast/common/comp/getsubopt.c18
-rw-r--r--usr/src/lib/libast/common/comp/getwd.c4
-rw-r--r--usr/src/lib/libast/common/comp/gross.c4
-rw-r--r--usr/src/lib/libast/common/comp/hsearch.c4
-rw-r--r--usr/src/lib/libast/common/comp/iconv.c4
-rw-r--r--usr/src/lib/libast/common/comp/killpg.c4
-rw-r--r--usr/src/lib/libast/common/comp/libgen.h4
-rw-r--r--usr/src/lib/libast/common/comp/link.c4
-rw-r--r--usr/src/lib/libast/common/comp/localeconv.c4
-rw-r--r--usr/src/lib/libast/common/comp/lstat.c4
-rw-r--r--usr/src/lib/libast/common/comp/memccpy.c4
-rw-r--r--usr/src/lib/libast/common/comp/memchr.c4
-rw-r--r--usr/src/lib/libast/common/comp/memcmp.c4
-rw-r--r--usr/src/lib/libast/common/comp/memcpy.c4
-rw-r--r--usr/src/lib/libast/common/comp/memmove.c4
-rw-r--r--usr/src/lib/libast/common/comp/memset.c4
-rw-r--r--usr/src/lib/libast/common/comp/mkdir.c4
-rw-r--r--usr/src/lib/libast/common/comp/mkfifo.c4
-rw-r--r--usr/src/lib/libast/common/comp/mknod.c4
-rw-r--r--usr/src/lib/libast/common/comp/mktemp.c4
-rw-r--r--usr/src/lib/libast/common/comp/mktime.c4
-rw-r--r--usr/src/lib/libast/common/comp/mount.c4
-rw-r--r--usr/src/lib/libast/common/comp/nftw.c4
-rw-r--r--usr/src/lib/libast/common/comp/open.c4
-rw-r--r--usr/src/lib/libast/common/comp/openlog.c4
-rw-r--r--usr/src/lib/libast/common/comp/putenv.c4
-rw-r--r--usr/src/lib/libast/common/comp/re_comp.c4
-rw-r--r--usr/src/lib/libast/common/comp/re_comp.h4
-rw-r--r--usr/src/lib/libast/common/comp/readlink.c4
-rw-r--r--usr/src/lib/libast/common/comp/realpath.c8
-rw-r--r--usr/src/lib/libast/common/comp/regcmp.c4
-rw-r--r--usr/src/lib/libast/common/comp/regexp.c4
-rw-r--r--usr/src/lib/libast/common/comp/regexp.h4
-rw-r--r--usr/src/lib/libast/common/comp/remove.c4
-rw-r--r--usr/src/lib/libast/common/comp/rename.c6
-rw-r--r--usr/src/lib/libast/common/comp/resolvepath.c8
-rw-r--r--usr/src/lib/libast/common/comp/rmdir.c4
-rw-r--r--usr/src/lib/libast/common/comp/setenv.c4
-rw-r--r--usr/src/lib/libast/common/comp/setlocale.c186
-rw-r--r--usr/src/lib/libast/common/comp/setlogmask.c4
-rw-r--r--usr/src/lib/libast/common/comp/setpgid.c4
-rw-r--r--usr/src/lib/libast/common/comp/setsid.c4
-rw-r--r--usr/src/lib/libast/common/comp/sigunblock.c4
-rw-r--r--usr/src/lib/libast/common/comp/spawnveg.c12
-rw-r--r--usr/src/lib/libast/common/comp/statvfs.c4
-rw-r--r--usr/src/lib/libast/common/comp/strcasecmp.c4
-rw-r--r--usr/src/lib/libast/common/comp/strchr.c4
-rw-r--r--usr/src/lib/libast/common/comp/strftime.c4
-rw-r--r--usr/src/lib/libast/common/comp/strncasecmp.c4
-rw-r--r--usr/src/lib/libast/common/comp/strptime.c4
-rw-r--r--usr/src/lib/libast/common/comp/strrchr.c4
-rw-r--r--usr/src/lib/libast/common/comp/strstr.c4
-rw-r--r--usr/src/lib/libast/common/comp/strtod.c4
-rw-r--r--usr/src/lib/libast/common/comp/strtol.c4
-rw-r--r--usr/src/lib/libast/common/comp/strtold.c13
-rw-r--r--usr/src/lib/libast/common/comp/strtoll.c4
-rw-r--r--usr/src/lib/libast/common/comp/strtoul.c4
-rw-r--r--usr/src/lib/libast/common/comp/strtoull.c4
-rw-r--r--usr/src/lib/libast/common/comp/swab.c4
-rw-r--r--usr/src/lib/libast/common/comp/symlink.c4
-rw-r--r--usr/src/lib/libast/common/comp/syslog.c4
-rw-r--r--usr/src/lib/libast/common/comp/system.c6
-rw-r--r--usr/src/lib/libast/common/comp/tempnam.c4
-rw-r--r--usr/src/lib/libast/common/comp/tmpnam.c4
-rw-r--r--usr/src/lib/libast/common/comp/transition.c4
-rw-r--r--usr/src/lib/libast/common/comp/tsearch.c4
-rw-r--r--usr/src/lib/libast/common/comp/unlink.c4
-rw-r--r--usr/src/lib/libast/common/comp/unsetenv.c4
-rw-r--r--usr/src/lib/libast/common/comp/vfork.c4
-rw-r--r--usr/src/lib/libast/common/comp/waitpid.c4
-rw-r--r--usr/src/lib/libast/common/comp/wc.c4
-rw-r--r--usr/src/lib/libast/common/comp/wordexp.c4
-rw-r--r--usr/src/lib/libast/common/comp/wordexp.h4
-rw-r--r--usr/src/lib/libast/common/dir/dirlib.h4
-rw-r--r--usr/src/lib/libast/common/dir/getdents.c4
-rw-r--r--usr/src/lib/libast/common/dir/opendir.c4
-rw-r--r--usr/src/lib/libast/common/dir/readdir.c4
-rw-r--r--usr/src/lib/libast/common/dir/rewinddir.c4
-rw-r--r--usr/src/lib/libast/common/dir/seekdir.c4
-rw-r--r--usr/src/lib/libast/common/dir/telldir.c4
-rw-r--r--usr/src/lib/libast/common/disc/memfatal.c4
-rw-r--r--usr/src/lib/libast/common/disc/sfdcdio.c5
-rw-r--r--usr/src/lib/libast/common/disc/sfdcdos.c4
-rw-r--r--usr/src/lib/libast/common/disc/sfdcfilter.c4
-rw-r--r--usr/src/lib/libast/common/disc/sfdchdr.h4
-rw-r--r--usr/src/lib/libast/common/disc/sfdcmore.c4
-rw-r--r--usr/src/lib/libast/common/disc/sfdcprefix.c4
-rw-r--r--usr/src/lib/libast/common/disc/sfdcseekable.c4
-rw-r--r--usr/src/lib/libast/common/disc/sfdcslow.c4
-rw-r--r--usr/src/lib/libast/common/disc/sfdcsubstr.c4
-rw-r--r--usr/src/lib/libast/common/disc/sfdctee.c4
-rw-r--r--usr/src/lib/libast/common/disc/sfdcunion.c4
-rw-r--r--usr/src/lib/libast/common/disc/sfkeyprintf.c4
-rw-r--r--usr/src/lib/libast/common/disc/sfstrtmp.c4
-rw-r--r--usr/src/lib/libast/common/features/align.c4
-rw-r--r--usr/src/lib/libast/common/features/botch.c6
-rw-r--r--usr/src/lib/libast/common/features/fcntl.c4
-rw-r--r--usr/src/lib/libast/common/features/float11
-rw-r--r--usr/src/lib/libast/common/features/fs1
-rw-r--r--usr/src/lib/libast/common/features/isoc9913
-rw-r--r--usr/src/lib/libast/common/features/libpath.sh4
-rw-r--r--usr/src/lib/libast/common/features/limits.c4
-rw-r--r--usr/src/lib/libast/common/features/map.c16
-rw-r--r--usr/src/lib/libast/common/features/mode.c4
-rw-r--r--usr/src/lib/libast/common/features/ndbm29
-rw-r--r--usr/src/lib/libast/common/features/param.sh4
-rw-r--r--usr/src/lib/libast/common/features/preroot.sh4
-rw-r--r--usr/src/lib/libast/common/features/sfinit.c4
-rw-r--r--usr/src/lib/libast/common/features/sig.sh4
-rw-r--r--usr/src/lib/libast/common/features/siglist14
-rw-r--r--usr/src/lib/libast/common/features/signal.c135
-rw-r--r--usr/src/lib/libast/common/features/stdio17
-rw-r--r--usr/src/lib/libast/common/features/time2
-rw-r--r--usr/src/lib/libast/common/features/tvlib1
-rw-r--r--usr/src/lib/libast/common/hash/hashalloc.c4
-rw-r--r--usr/src/lib/libast/common/hash/hashdump.c4
-rw-r--r--usr/src/lib/libast/common/hash/hashfree.c4
-rw-r--r--usr/src/lib/libast/common/hash/hashlast.c4
-rw-r--r--usr/src/lib/libast/common/hash/hashlib.h4
-rw-r--r--usr/src/lib/libast/common/hash/hashlook.c7
-rw-r--r--usr/src/lib/libast/common/hash/hashscan.c4
-rw-r--r--usr/src/lib/libast/common/hash/hashsize.c4
-rw-r--r--usr/src/lib/libast/common/hash/hashview.c4
-rw-r--r--usr/src/lib/libast/common/hash/hashwalk.c4
-rw-r--r--usr/src/lib/libast/common/hash/memhash.c4
-rw-r--r--usr/src/lib/libast/common/hash/memsum.c4
-rw-r--r--usr/src/lib/libast/common/hash/strhash.c4
-rw-r--r--usr/src/lib/libast/common/hash/strkey.c4
-rw-r--r--usr/src/lib/libast/common/hash/strsum.c4
-rw-r--r--usr/src/lib/libast/common/include/ast.h6
-rw-r--r--usr/src/lib/libast/common/include/ast_dir.h4
-rw-r--r--usr/src/lib/libast/common/include/ast_getopt.h8
-rw-r--r--usr/src/lib/libast/common/include/ast_std.h22
-rw-r--r--usr/src/lib/libast/common/include/ast_version.h6
-rw-r--r--usr/src/lib/libast/common/include/ast_windows.h4
-rw-r--r--usr/src/lib/libast/common/include/ccode.h4
-rw-r--r--usr/src/lib/libast/common/include/cdt.h4
-rw-r--r--usr/src/lib/libast/common/include/cmdarg.h84
-rw-r--r--usr/src/lib/libast/common/include/debug.h42
-rw-r--r--usr/src/lib/libast/common/include/dt.h4
-rw-r--r--usr/src/lib/libast/common/include/error.h4
-rw-r--r--usr/src/lib/libast/common/include/find.h4
-rw-r--r--usr/src/lib/libast/common/include/fnv.h4
-rw-r--r--usr/src/lib/libast/common/include/fs3d.h4
-rw-r--r--usr/src/lib/libast/common/include/fts.h10
-rw-r--r--usr/src/lib/libast/common/include/ftwalk.h4
-rw-r--r--usr/src/lib/libast/common/include/glob.h8
-rw-r--r--usr/src/lib/libast/common/include/hash.h4
-rw-r--r--usr/src/lib/libast/common/include/hashkey.h4
-rw-r--r--usr/src/lib/libast/common/include/hashpart.h4
-rw-r--r--usr/src/lib/libast/common/include/ip6.h40
-rw-r--r--usr/src/lib/libast/common/include/ls.h4
-rw-r--r--usr/src/lib/libast/common/include/magic.h4
-rw-r--r--usr/src/lib/libast/common/include/magicid.h4
-rw-r--r--usr/src/lib/libast/common/include/mc.h4
-rw-r--r--usr/src/lib/libast/common/include/mime.h4
-rw-r--r--usr/src/lib/libast/common/include/mnt.h4
-rw-r--r--usr/src/lib/libast/common/include/modecanon.h4
-rw-r--r--usr/src/lib/libast/common/include/modex.h4
-rw-r--r--usr/src/lib/libast/common/include/namval.h4
-rw-r--r--usr/src/lib/libast/common/include/option.h5
-rw-r--r--usr/src/lib/libast/common/include/proc.h10
-rw-r--r--usr/src/lib/libast/common/include/recfmt.h4
-rw-r--r--usr/src/lib/libast/common/include/regex.h4
-rw-r--r--usr/src/lib/libast/common/include/sfdisc.h4
-rw-r--r--usr/src/lib/libast/common/include/sfio.h9
-rw-r--r--usr/src/lib/libast/common/include/sfio_s.h4
-rw-r--r--usr/src/lib/libast/common/include/sfio_t.h4
-rw-r--r--usr/src/lib/libast/common/include/shcmd.h92
-rw-r--r--usr/src/lib/libast/common/include/stack.h4
-rw-r--r--usr/src/lib/libast/common/include/stak.h4
-rw-r--r--usr/src/lib/libast/common/include/stk.h5
-rw-r--r--usr/src/lib/libast/common/include/swap.h4
-rw-r--r--usr/src/lib/libast/common/include/tar.h4
-rw-r--r--usr/src/lib/libast/common/include/times.h4
-rw-r--r--usr/src/lib/libast/common/include/tm.h4
-rw-r--r--usr/src/lib/libast/common/include/tok.h4
-rw-r--r--usr/src/lib/libast/common/include/usage.h4
-rw-r--r--usr/src/lib/libast/common/include/vdb.h4
-rw-r--r--usr/src/lib/libast/common/include/vecargs.h4
-rw-r--r--usr/src/lib/libast/common/include/vmalloc.h6
-rw-r--r--usr/src/lib/libast/common/include/wait.h4
-rw-r--r--usr/src/lib/libast/common/llib-last574
-rw-r--r--usr/src/lib/libast/common/man/sfio.328
-rw-r--r--usr/src/lib/libast/common/man/stk.35
-rw-r--r--usr/src/lib/libast/common/misc/astintercept.c53
-rw-r--r--usr/src/lib/libast/common/misc/cmdarg.c350
-rw-r--r--usr/src/lib/libast/common/misc/debug.c66
-rw-r--r--usr/src/lib/libast/common/misc/error.c6
-rw-r--r--usr/src/lib/libast/common/misc/errorf.c4
-rw-r--r--usr/src/lib/libast/common/misc/errormsg.c4
-rw-r--r--usr/src/lib/libast/common/misc/errorx.c6
-rw-r--r--usr/src/lib/libast/common/misc/fastfind.c4
-rw-r--r--usr/src/lib/libast/common/misc/findlib.h4
-rw-r--r--usr/src/lib/libast/common/misc/fmtrec.c4
-rw-r--r--usr/src/lib/libast/common/misc/fs3d.c22
-rw-r--r--usr/src/lib/libast/common/misc/fts.c61
-rw-r--r--usr/src/lib/libast/common/misc/ftwalk.c4
-rw-r--r--usr/src/lib/libast/common/misc/ftwflags.c4
-rw-r--r--usr/src/lib/libast/common/misc/getcwd.c4
-rw-r--r--usr/src/lib/libast/common/misc/getenv.c43
-rw-r--r--usr/src/lib/libast/common/misc/glob.c31
-rw-r--r--usr/src/lib/libast/common/misc/intercepts.h40
-rw-r--r--usr/src/lib/libast/common/misc/liberror.c4
-rw-r--r--usr/src/lib/libast/common/misc/libevent.c4
-rw-r--r--usr/src/lib/libast/common/misc/magic.c54
-rw-r--r--usr/src/lib/libast/common/misc/mime.c4
-rw-r--r--usr/src/lib/libast/common/misc/mimelib.h4
-rw-r--r--usr/src/lib/libast/common/misc/mimetype.c4
-rw-r--r--usr/src/lib/libast/common/misc/optctx.c70
-rw-r--r--usr/src/lib/libast/common/misc/optesc.c4
-rw-r--r--usr/src/lib/libast/common/misc/optget.c212
-rw-r--r--usr/src/lib/libast/common/misc/optjoin.c4
-rw-r--r--usr/src/lib/libast/common/misc/optlib.h11
-rw-r--r--usr/src/lib/libast/common/misc/procclose.c14
-rw-r--r--usr/src/lib/libast/common/misc/procfree.c4
-rw-r--r--usr/src/lib/libast/common/misc/proclib.h4
-rw-r--r--usr/src/lib/libast/common/misc/procopen.c64
-rw-r--r--usr/src/lib/libast/common/misc/procrun.c17
-rw-r--r--usr/src/lib/libast/common/misc/recfmt.c4
-rw-r--r--usr/src/lib/libast/common/misc/reclen.c4
-rw-r--r--usr/src/lib/libast/common/misc/recstr.c9
-rw-r--r--usr/src/lib/libast/common/misc/setenviron.c15
-rw-r--r--usr/src/lib/libast/common/misc/sigcrit.c4
-rw-r--r--usr/src/lib/libast/common/misc/sigdata.c4
-rw-r--r--usr/src/lib/libast/common/misc/signal.c20
-rw-r--r--usr/src/lib/libast/common/misc/stack.c4
-rw-r--r--usr/src/lib/libast/common/misc/state.c6
-rw-r--r--usr/src/lib/libast/common/misc/stk.c38
-rw-r--r--usr/src/lib/libast/common/misc/systrace.c4
-rw-r--r--usr/src/lib/libast/common/misc/translate.c4
-rw-r--r--usr/src/lib/libast/common/misc/univdata.c4
-rw-r--r--usr/src/lib/libast/common/misc/univlib.h4
-rw-r--r--usr/src/lib/libast/common/obsolete/spawn.c4
-rw-r--r--usr/src/lib/libast/common/path/pathaccess.c4
-rw-r--r--usr/src/lib/libast/common/path/pathbin.c4
-rw-r--r--usr/src/lib/libast/common/path/pathcanon.c13
-rw-r--r--usr/src/lib/libast/common/path/pathcat.c4
-rw-r--r--usr/src/lib/libast/common/path/pathcd.c4
-rw-r--r--usr/src/lib/libast/common/path/pathcheck.c4
-rw-r--r--usr/src/lib/libast/common/path/pathexists.c4
-rw-r--r--usr/src/lib/libast/common/path/pathfind.c4
-rw-r--r--usr/src/lib/libast/common/path/pathgetlink.c4
-rw-r--r--usr/src/lib/libast/common/path/pathkey.c4
-rw-r--r--usr/src/lib/libast/common/path/pathnative.c4
-rw-r--r--usr/src/lib/libast/common/path/pathpath.c4
-rw-r--r--usr/src/lib/libast/common/path/pathposix.c4
-rw-r--r--usr/src/lib/libast/common/path/pathprobe.c15
-rw-r--r--usr/src/lib/libast/common/path/pathrepl.c4
-rw-r--r--usr/src/lib/libast/common/path/pathsetlink.c4
-rw-r--r--usr/src/lib/libast/common/path/pathshell.c4
-rw-r--r--usr/src/lib/libast/common/path/pathstat.c4
-rw-r--r--usr/src/lib/libast/common/path/pathtemp.c4
-rw-r--r--usr/src/lib/libast/common/path/pathtmp.c4
-rw-r--r--usr/src/lib/libast/common/port/astconf.c86
-rw-r--r--usr/src/lib/libast/common/port/astcopy.c4
-rw-r--r--usr/src/lib/libast/common/port/astdynamic.c4
-rw-r--r--usr/src/lib/libast/common/port/astlicense.c4
-rw-r--r--usr/src/lib/libast/common/port/astmath.c14
-rw-r--r--usr/src/lib/libast/common/port/astquery.c4
-rw-r--r--usr/src/lib/libast/common/port/aststatic.c4
-rw-r--r--usr/src/lib/libast/common/port/astwinsize.c4
-rw-r--r--usr/src/lib/libast/common/port/iblocks.c4
-rw-r--r--usr/src/lib/libast/common/port/lc.c103
-rw-r--r--usr/src/lib/libast/common/port/lcgen.c38
-rw-r--r--usr/src/lib/libast/common/port/lclang.h62
-rw-r--r--usr/src/lib/libast/common/port/lclib.h22
-rw-r--r--usr/src/lib/libast/common/port/mc.c6
-rw-r--r--usr/src/lib/libast/common/port/mnt.c4
-rw-r--r--usr/src/lib/libast/common/port/touch.c4
-rw-r--r--usr/src/lib/libast/common/preroot/getpreroot.c4
-rw-r--r--usr/src/lib/libast/common/preroot/ispreroot.c4
-rw-r--r--usr/src/lib/libast/common/preroot/realopen.c4
-rw-r--r--usr/src/lib/libast/common/preroot/setpreroot.c4
-rw-r--r--usr/src/lib/libast/common/regex/regalloc.c4
-rw-r--r--usr/src/lib/libast/common/regex/regcache.c65
-rw-r--r--usr/src/lib/libast/common/regex/regclass.c4
-rw-r--r--usr/src/lib/libast/common/regex/regcoll.c23
-rw-r--r--usr/src/lib/libast/common/regex/regcomp.c277
-rw-r--r--usr/src/lib/libast/common/regex/regdecomp.c5
-rw-r--r--usr/src/lib/libast/common/regex/regerror.c6
-rw-r--r--usr/src/lib/libast/common/regex/regexec.c4
-rw-r--r--usr/src/lib/libast/common/regex/regfatal.c4
-rw-r--r--usr/src/lib/libast/common/regex/reginit.c14
-rw-r--r--usr/src/lib/libast/common/regex/reglib.h8
-rw-r--r--usr/src/lib/libast/common/regex/regnexec.c71
-rw-r--r--usr/src/lib/libast/common/regex/regrecord.c4
-rw-r--r--usr/src/lib/libast/common/regex/regrexec.c4
-rw-r--r--usr/src/lib/libast/common/regex/regstat.c4
-rw-r--r--usr/src/lib/libast/common/regex/regsub.c5
-rw-r--r--usr/src/lib/libast/common/regex/regsubcomp.c81
-rw-r--r--usr/src/lib/libast/common/regex/regsubexec.c14
-rw-r--r--usr/src/lib/libast/common/regex/ucs_names.h4
-rw-r--r--usr/src/lib/libast/common/sfio/_sfclrerr.c4
-rw-r--r--usr/src/lib/libast/common/sfio/_sfdlen.c4
-rw-r--r--usr/src/lib/libast/common/sfio/_sfeof.c4
-rw-r--r--usr/src/lib/libast/common/sfio/_sferror.c4
-rw-r--r--usr/src/lib/libast/common/sfio/_sffileno.c4
-rw-r--r--usr/src/lib/libast/common/sfio/_sfgetc.c4
-rw-r--r--usr/src/lib/libast/common/sfio/_sfgetl.c4
-rw-r--r--usr/src/lib/libast/common/sfio/_sfgetl2.c4
-rw-r--r--usr/src/lib/libast/common/sfio/_sfgetu.c4
-rw-r--r--usr/src/lib/libast/common/sfio/_sfgetu2.c4
-rw-r--r--usr/src/lib/libast/common/sfio/_sfllen.c4
-rw-r--r--usr/src/lib/libast/common/sfio/_sfopen.c13
-rw-r--r--usr/src/lib/libast/common/sfio/_sfputc.c4
-rw-r--r--usr/src/lib/libast/common/sfio/_sfputd.c7
-rw-r--r--usr/src/lib/libast/common/sfio/_sfputl.c11
-rw-r--r--usr/src/lib/libast/common/sfio/_sfputm.c11
-rw-r--r--usr/src/lib/libast/common/sfio/_sfputu.c11
-rw-r--r--usr/src/lib/libast/common/sfio/_sfslen.c4
-rw-r--r--usr/src/lib/libast/common/sfio/_sfstacked.c4
-rw-r--r--usr/src/lib/libast/common/sfio/_sfulen.c4
-rw-r--r--usr/src/lib/libast/common/sfio/_sfvalue.c4
-rw-r--r--usr/src/lib/libast/common/sfio/sfclose.c14
-rw-r--r--usr/src/lib/libast/common/sfio/sfclrlock.c11
-rw-r--r--usr/src/lib/libast/common/sfio/sfcvt.c211
-rw-r--r--usr/src/lib/libast/common/sfio/sfdisc.c32
-rw-r--r--usr/src/lib/libast/common/sfio/sfdlen.c4
-rw-r--r--usr/src/lib/libast/common/sfio/sfecvt.c6
-rw-r--r--usr/src/lib/libast/common/sfio/sfexcept.c7
-rw-r--r--usr/src/lib/libast/common/sfio/sfextern.c18
-rw-r--r--usr/src/lib/libast/common/sfio/sffcvt.c6
-rw-r--r--usr/src/lib/libast/common/sfio/sffilbuf.c7
-rw-r--r--usr/src/lib/libast/common/sfio/sfflsbuf.c19
-rw-r--r--usr/src/lib/libast/common/sfio/sfgetd.c7
-rw-r--r--usr/src/lib/libast/common/sfio/sfgetl.c15
-rw-r--r--usr/src/lib/libast/common/sfio/sfgetm.c11
-rw-r--r--usr/src/lib/libast/common/sfio/sfgetr.c30
-rw-r--r--usr/src/lib/libast/common/sfio/sfgetu.c15
-rw-r--r--usr/src/lib/libast/common/sfio/sfhdr.h70
-rw-r--r--usr/src/lib/libast/common/sfio/sfllen.c4
-rw-r--r--usr/src/lib/libast/common/sfio/sfmode.c11
-rw-r--r--usr/src/lib/libast/common/sfio/sfmove.c14
-rw-r--r--usr/src/lib/libast/common/sfio/sfmutex.c4
-rw-r--r--usr/src/lib/libast/common/sfio/sfnew.c6
-rw-r--r--usr/src/lib/libast/common/sfio/sfnotify.c6
-rw-r--r--usr/src/lib/libast/common/sfio/sfnputc.c15
-rw-r--r--usr/src/lib/libast/common/sfio/sfopen.c4
-rw-r--r--usr/src/lib/libast/common/sfio/sfpeek.c4
-rw-r--r--usr/src/lib/libast/common/sfio/sfpkrd.c9
-rw-r--r--usr/src/lib/libast/common/sfio/sfpoll.c4
-rw-r--r--usr/src/lib/libast/common/sfio/sfpool.c12
-rw-r--r--usr/src/lib/libast/common/sfio/sfpopen.c4
-rw-r--r--usr/src/lib/libast/common/sfio/sfprintf.c25
-rw-r--r--usr/src/lib/libast/common/sfio/sfprints.c4
-rw-r--r--usr/src/lib/libast/common/sfio/sfpurge.c11
-rw-r--r--usr/src/lib/libast/common/sfio/sfputd.c4
-rw-r--r--usr/src/lib/libast/common/sfio/sfputl.c4
-rw-r--r--usr/src/lib/libast/common/sfio/sfputm.c4
-rw-r--r--usr/src/lib/libast/common/sfio/sfputr.c13
-rw-r--r--usr/src/lib/libast/common/sfio/sfputu.c4
-rw-r--r--usr/src/lib/libast/common/sfio/sfraise.c7
-rw-r--r--usr/src/lib/libast/common/sfio/sfrd.c15
-rw-r--r--usr/src/lib/libast/common/sfio/sfread.c13
-rw-r--r--usr/src/lib/libast/common/sfio/sfreserve.c33
-rw-r--r--usr/src/lib/libast/common/sfio/sfresize.c8
-rw-r--r--usr/src/lib/libast/common/sfio/sfscanf.c4
-rw-r--r--usr/src/lib/libast/common/sfio/sfseek.c7
-rw-r--r--usr/src/lib/libast/common/sfio/sfset.c15
-rw-r--r--usr/src/lib/libast/common/sfio/sfsetbuf.c15
-rw-r--r--usr/src/lib/libast/common/sfio/sfsetfd.c21
-rw-r--r--usr/src/lib/libast/common/sfio/sfsize.c11
-rw-r--r--usr/src/lib/libast/common/sfio/sfsk.c13
-rw-r--r--usr/src/lib/libast/common/sfio/sfstack.c4
-rw-r--r--usr/src/lib/libast/common/sfio/sfstrtod.c4
-rw-r--r--usr/src/lib/libast/common/sfio/sfstrtof.h12
-rw-r--r--usr/src/lib/libast/common/sfio/sfswap.c4
-rw-r--r--usr/src/lib/libast/common/sfio/sfsync.c7
-rw-r--r--usr/src/lib/libast/common/sfio/sftable.c4
-rw-r--r--usr/src/lib/libast/common/sfio/sftell.c11
-rw-r--r--usr/src/lib/libast/common/sfio/sftmp.c14
-rw-r--r--usr/src/lib/libast/common/sfio/sfungetc.c21
-rw-r--r--usr/src/lib/libast/common/sfio/sfvprintf.c52
-rw-r--r--usr/src/lib/libast/common/sfio/sfvscanf.c10
-rw-r--r--usr/src/lib/libast/common/sfio/sfwr.c23
-rw-r--r--usr/src/lib/libast/common/sfio/sfwrite.c13
-rw-r--r--usr/src/lib/libast/common/sfio/vthread.h4
-rw-r--r--usr/src/lib/libast/common/std/bytesex.h4
-rw-r--r--usr/src/lib/libast/common/std/dirent.h4
-rw-r--r--usr/src/lib/libast/common/std/endian.h4
-rw-r--r--usr/src/lib/libast/common/std/iconv.h4
-rw-r--r--usr/src/lib/libast/common/std/nl_types.h4
-rw-r--r--usr/src/lib/libast/common/std/stdio.h4
-rw-r--r--usr/src/lib/libast/common/std/wchar.h4
-rw-r--r--usr/src/lib/libast/common/stdio/_doprnt.c4
-rw-r--r--usr/src/lib/libast/common/stdio/_doscan.c4
-rw-r--r--usr/src/lib/libast/common/stdio/_filbuf.c4
-rw-r--r--usr/src/lib/libast/common/stdio/_flsbuf.c4
-rw-r--r--usr/src/lib/libast/common/stdio/_stdfun.c4
-rw-r--r--usr/src/lib/libast/common/stdio/_stdopen.c4
-rw-r--r--usr/src/lib/libast/common/stdio/_stdprintf.c4
-rw-r--r--usr/src/lib/libast/common/stdio/_stdscanf.c4
-rw-r--r--usr/src/lib/libast/common/stdio/_stdsprnt.c4
-rw-r--r--usr/src/lib/libast/common/stdio/_stdvbuf.c4
-rw-r--r--usr/src/lib/libast/common/stdio/_stdvsnprnt.c4
-rw-r--r--usr/src/lib/libast/common/stdio/_stdvsprnt.c4
-rw-r--r--usr/src/lib/libast/common/stdio/_stdvsscn.c4
-rw-r--r--usr/src/lib/libast/common/stdio/asprintf.c4
-rw-r--r--usr/src/lib/libast/common/stdio/clearerr.c4
-rw-r--r--usr/src/lib/libast/common/stdio/fclose.c4
-rw-r--r--usr/src/lib/libast/common/stdio/fdopen.c4
-rw-r--r--usr/src/lib/libast/common/stdio/feof.c4
-rw-r--r--usr/src/lib/libast/common/stdio/ferror.c4
-rw-r--r--usr/src/lib/libast/common/stdio/fflush.c4
-rw-r--r--usr/src/lib/libast/common/stdio/fgetc.c4
-rw-r--r--usr/src/lib/libast/common/stdio/fgetpos.c4
-rw-r--r--usr/src/lib/libast/common/stdio/fgets.c4
-rw-r--r--usr/src/lib/libast/common/stdio/fgetwc.c4
-rw-r--r--usr/src/lib/libast/common/stdio/fgetws.c4
-rw-r--r--usr/src/lib/libast/common/stdio/fileno.c4
-rw-r--r--usr/src/lib/libast/common/stdio/flockfile.c (renamed from usr/src/lib/libast/amd64/include/ast/ast_types.h)20
-rw-r--r--usr/src/lib/libast/common/stdio/fopen.c4
-rw-r--r--usr/src/lib/libast/common/stdio/fprintf.c4
-rw-r--r--usr/src/lib/libast/common/stdio/fpurge.c4
-rw-r--r--usr/src/lib/libast/common/stdio/fputc.c4
-rw-r--r--usr/src/lib/libast/common/stdio/fputs.c4
-rw-r--r--usr/src/lib/libast/common/stdio/fputwc.c4
-rw-r--r--usr/src/lib/libast/common/stdio/fputws.c4
-rw-r--r--usr/src/lib/libast/common/stdio/fread.c6
-rw-r--r--usr/src/lib/libast/common/stdio/freopen.c4
-rw-r--r--usr/src/lib/libast/common/stdio/fscanf.c4
-rw-r--r--usr/src/lib/libast/common/stdio/fseek.c4
-rw-r--r--usr/src/lib/libast/common/stdio/fseeko.c4
-rw-r--r--usr/src/lib/libast/common/stdio/fsetpos.c4
-rw-r--r--usr/src/lib/libast/common/stdio/ftell.c4
-rw-r--r--usr/src/lib/libast/common/stdio/ftello.c4
-rw-r--r--usr/src/lib/libast/common/stdio/ftrylockfile.c (renamed from usr/src/lib/libast/i386/include/ast/ast_types.h)20
-rw-r--r--usr/src/lib/libast/common/stdio/funlockfile.c (renamed from usr/src/lib/libast/sparcv9/include/ast/ast_types.h)20
-rw-r--r--usr/src/lib/libast/common/stdio/fwide.c4
-rw-r--r--usr/src/lib/libast/common/stdio/fwprintf.c4
-rw-r--r--usr/src/lib/libast/common/stdio/fwrite.c6
-rw-r--r--usr/src/lib/libast/common/stdio/fwscanf.c4
-rw-r--r--usr/src/lib/libast/common/stdio/getc.c4
-rw-r--r--usr/src/lib/libast/common/stdio/getchar.c4
-rw-r--r--usr/src/lib/libast/common/stdio/getw.c4
-rw-r--r--usr/src/lib/libast/common/stdio/getwc.c4
-rw-r--r--usr/src/lib/libast/common/stdio/getwchar.c4
-rw-r--r--usr/src/lib/libast/common/stdio/pclose.c4
-rw-r--r--usr/src/lib/libast/common/stdio/popen.c4
-rw-r--r--usr/src/lib/libast/common/stdio/printf.c4
-rw-r--r--usr/src/lib/libast/common/stdio/putc.c4
-rw-r--r--usr/src/lib/libast/common/stdio/putchar.c4
-rw-r--r--usr/src/lib/libast/common/stdio/puts.c4
-rw-r--r--usr/src/lib/libast/common/stdio/putw.c4
-rw-r--r--usr/src/lib/libast/common/stdio/putwc.c4
-rw-r--r--usr/src/lib/libast/common/stdio/putwchar.c4
-rw-r--r--usr/src/lib/libast/common/stdio/rewind.c4
-rw-r--r--usr/src/lib/libast/common/stdio/scanf.c4
-rw-r--r--usr/src/lib/libast/common/stdio/setbuf.c4
-rw-r--r--usr/src/lib/libast/common/stdio/setbuffer.c4
-rw-r--r--usr/src/lib/libast/common/stdio/setlinebuf.c4
-rw-r--r--usr/src/lib/libast/common/stdio/setvbuf.c4
-rw-r--r--usr/src/lib/libast/common/stdio/snprintf.c4
-rw-r--r--usr/src/lib/libast/common/stdio/sprintf.c4
-rw-r--r--usr/src/lib/libast/common/stdio/sscanf.c4
-rw-r--r--usr/src/lib/libast/common/stdio/stdhdr.h4
-rw-r--r--usr/src/lib/libast/common/stdio/stdio_c99.c4
-rw-r--r--usr/src/lib/libast/common/stdio/stdio_gnu.c4
-rw-r--r--usr/src/lib/libast/common/stdio/swprintf.c4
-rw-r--r--usr/src/lib/libast/common/stdio/swscanf.c4
-rw-r--r--usr/src/lib/libast/common/stdio/tmpfile.c4
-rw-r--r--usr/src/lib/libast/common/stdio/ungetc.c4
-rw-r--r--usr/src/lib/libast/common/stdio/ungetwc.c4
-rw-r--r--usr/src/lib/libast/common/stdio/vasprintf.c4
-rw-r--r--usr/src/lib/libast/common/stdio/vfprintf.c4
-rw-r--r--usr/src/lib/libast/common/stdio/vfscanf.c4
-rw-r--r--usr/src/lib/libast/common/stdio/vfwprintf.c4
-rw-r--r--usr/src/lib/libast/common/stdio/vfwscanf.c4
-rw-r--r--usr/src/lib/libast/common/stdio/vprintf.c4
-rw-r--r--usr/src/lib/libast/common/stdio/vscanf.c4
-rw-r--r--usr/src/lib/libast/common/stdio/vsnprintf.c4
-rw-r--r--usr/src/lib/libast/common/stdio/vsprintf.c4
-rw-r--r--usr/src/lib/libast/common/stdio/vsscanf.c4
-rw-r--r--usr/src/lib/libast/common/stdio/vswprintf.c4
-rw-r--r--usr/src/lib/libast/common/stdio/vswscanf.c4
-rw-r--r--usr/src/lib/libast/common/stdio/vwprintf.c4
-rw-r--r--usr/src/lib/libast/common/stdio/vwscanf.c4
-rw-r--r--usr/src/lib/libast/common/stdio/wprintf.c4
-rw-r--r--usr/src/lib/libast/common/stdio/wscanf.c4
-rw-r--r--usr/src/lib/libast/common/string/base64.c4
-rw-r--r--usr/src/lib/libast/common/string/ccmap.c4
-rw-r--r--usr/src/lib/libast/common/string/ccmapid.c4
-rw-r--r--usr/src/lib/libast/common/string/ccnative.c4
-rw-r--r--usr/src/lib/libast/common/string/chresc.c4
-rw-r--r--usr/src/lib/libast/common/string/chrtoi.c4
-rw-r--r--usr/src/lib/libast/common/string/fmtbase.c4
-rw-r--r--usr/src/lib/libast/common/string/fmtbuf.c4
-rw-r--r--usr/src/lib/libast/common/string/fmtclock.c15
-rw-r--r--usr/src/lib/libast/common/string/fmtdev.c4
-rw-r--r--usr/src/lib/libast/common/string/fmtelapsed.c4
-rw-r--r--usr/src/lib/libast/common/string/fmterror.c4
-rw-r--r--usr/src/lib/libast/common/string/fmtesc.c4
-rw-r--r--usr/src/lib/libast/common/string/fmtfmt.c4
-rw-r--r--usr/src/lib/libast/common/string/fmtfs.c4
-rw-r--r--usr/src/lib/libast/common/string/fmtgid.c4
-rw-r--r--usr/src/lib/libast/common/string/fmtident.c4
-rw-r--r--usr/src/lib/libast/common/string/fmtip4.c4
-rw-r--r--usr/src/lib/libast/common/string/fmtip6.c170
-rw-r--r--usr/src/lib/libast/common/string/fmtls.c4
-rw-r--r--usr/src/lib/libast/common/string/fmtmatch.c4
-rw-r--r--usr/src/lib/libast/common/string/fmtmode.c4
-rw-r--r--usr/src/lib/libast/common/string/fmtnum.c4
-rw-r--r--usr/src/lib/libast/common/string/fmtperm.c4
-rw-r--r--usr/src/lib/libast/common/string/fmtre.c5
-rw-r--r--usr/src/lib/libast/common/string/fmtscale.c4
-rw-r--r--usr/src/lib/libast/common/string/fmtsignal.c4
-rw-r--r--usr/src/lib/libast/common/string/fmttime.c4
-rw-r--r--usr/src/lib/libast/common/string/fmttmx.c4
-rw-r--r--usr/src/lib/libast/common/string/fmttv.c4
-rw-r--r--usr/src/lib/libast/common/string/fmtuid.c4
-rw-r--r--usr/src/lib/libast/common/string/fmtversion.c4
-rw-r--r--usr/src/lib/libast/common/string/memdup.c4
-rw-r--r--usr/src/lib/libast/common/string/modedata.c4
-rw-r--r--usr/src/lib/libast/common/string/modei.c4
-rw-r--r--usr/src/lib/libast/common/string/modelib.h4
-rw-r--r--usr/src/lib/libast/common/string/modex.c4
-rw-r--r--usr/src/lib/libast/common/string/stracmp.c4
-rw-r--r--usr/src/lib/libast/common/string/strcopy.c4
-rw-r--r--usr/src/lib/libast/common/string/strdup.c4
-rw-r--r--usr/src/lib/libast/common/string/strelapsed.c14
-rw-r--r--usr/src/lib/libast/common/string/strerror.c4
-rw-r--r--usr/src/lib/libast/common/string/stresc.c4
-rw-r--r--usr/src/lib/libast/common/string/streval.c4
-rw-r--r--usr/src/lib/libast/common/string/strexpr.c4
-rw-r--r--usr/src/lib/libast/common/string/strgid.c4
-rw-r--r--usr/src/lib/libast/common/string/strlcat.c4
-rw-r--r--usr/src/lib/libast/common/string/strlcpy.c4
-rw-r--r--usr/src/lib/libast/common/string/strlook.c4
-rw-r--r--usr/src/lib/libast/common/string/strmatch.c8
-rw-r--r--usr/src/lib/libast/common/string/strmode.c4
-rw-r--r--usr/src/lib/libast/common/string/strnacmp.c4
-rw-r--r--usr/src/lib/libast/common/string/strncopy.c4
-rw-r--r--usr/src/lib/libast/common/string/strntod.c4
-rw-r--r--usr/src/lib/libast/common/string/strntol.c4
-rw-r--r--usr/src/lib/libast/common/string/strntold.c4
-rw-r--r--usr/src/lib/libast/common/string/strntoll.c4
-rw-r--r--usr/src/lib/libast/common/string/strnton.c (renamed from usr/src/lib/libast/sparc/include/ast/ast_types.h)20
-rw-r--r--usr/src/lib/libast/common/string/strntonll.c32
-rw-r--r--usr/src/lib/libast/common/string/strntoul.c4
-rw-r--r--usr/src/lib/libast/common/string/strntoull.c4
-rw-r--r--usr/src/lib/libast/common/string/stropt.c4
-rw-r--r--usr/src/lib/libast/common/string/strperm.c4
-rw-r--r--usr/src/lib/libast/common/string/strpsearch.c4
-rw-r--r--usr/src/lib/libast/common/string/strsearch.c4
-rw-r--r--usr/src/lib/libast/common/string/strsort.c4
-rw-r--r--usr/src/lib/libast/common/string/strtape.c4
-rw-r--r--usr/src/lib/libast/common/string/strtoi.h6
-rw-r--r--usr/src/lib/libast/common/string/strtoip4.c4
-rw-r--r--usr/src/lib/libast/common/string/strtoip6.c200
-rw-r--r--usr/src/lib/libast/common/string/strton.c4
-rw-r--r--usr/src/lib/libast/common/string/strtonll.c4
-rw-r--r--usr/src/lib/libast/common/string/struid.c4
-rw-r--r--usr/src/lib/libast/common/string/struniq.c4
-rw-r--r--usr/src/lib/libast/common/string/swapget.c4
-rw-r--r--usr/src/lib/libast/common/string/swapmem.c4
-rw-r--r--usr/src/lib/libast/common/string/swapop.c4
-rw-r--r--usr/src/lib/libast/common/string/swapput.c4
-rw-r--r--usr/src/lib/libast/common/string/tok.c4
-rw-r--r--usr/src/lib/libast/common/string/tokline.c4
-rw-r--r--usr/src/lib/libast/common/string/tokscan.c4
-rw-r--r--usr/src/lib/libast/common/tm/tmdata.c7
-rw-r--r--usr/src/lib/libast/common/tm/tmdate.c4
-rw-r--r--usr/src/lib/libast/common/tm/tmequiv.c4
-rw-r--r--usr/src/lib/libast/common/tm/tmfix.c4
-rw-r--r--usr/src/lib/libast/common/tm/tmfmt.c4
-rw-r--r--usr/src/lib/libast/common/tm/tmform.c4
-rw-r--r--usr/src/lib/libast/common/tm/tmgoff.c4
-rw-r--r--usr/src/lib/libast/common/tm/tminit.c4
-rw-r--r--usr/src/lib/libast/common/tm/tmleap.c4
-rw-r--r--usr/src/lib/libast/common/tm/tmlex.c4
-rw-r--r--usr/src/lib/libast/common/tm/tmlocale.c8
-rw-r--r--usr/src/lib/libast/common/tm/tmmake.c4
-rw-r--r--usr/src/lib/libast/common/tm/tmpoff.c4
-rw-r--r--usr/src/lib/libast/common/tm/tmscan.c4
-rw-r--r--usr/src/lib/libast/common/tm/tmsleep.c4
-rw-r--r--usr/src/lib/libast/common/tm/tmtime.c4
-rw-r--r--usr/src/lib/libast/common/tm/tmtype.c4
-rw-r--r--usr/src/lib/libast/common/tm/tmweek.c4
-rw-r--r--usr/src/lib/libast/common/tm/tmword.c4
-rw-r--r--usr/src/lib/libast/common/tm/tmxdate.c166
-rw-r--r--usr/src/lib/libast/common/tm/tmxfmt.c28
-rw-r--r--usr/src/lib/libast/common/tm/tmxgettime.c4
-rw-r--r--usr/src/lib/libast/common/tm/tmxleap.c4
-rw-r--r--usr/src/lib/libast/common/tm/tmxmake.c4
-rw-r--r--usr/src/lib/libast/common/tm/tmxscan.c7
-rw-r--r--usr/src/lib/libast/common/tm/tmxsettime.c4
-rw-r--r--usr/src/lib/libast/common/tm/tmxsleep.c4
-rw-r--r--usr/src/lib/libast/common/tm/tmxtime.c4
-rw-r--r--usr/src/lib/libast/common/tm/tmxtouch.c4
-rw-r--r--usr/src/lib/libast/common/tm/tmzone.c4
-rw-r--r--usr/src/lib/libast/common/tm/tvcmp.c4
-rw-r--r--usr/src/lib/libast/common/tm/tvgettime.c4
-rw-r--r--usr/src/lib/libast/common/tm/tvsettime.c4
-rw-r--r--usr/src/lib/libast/common/tm/tvsleep.c4
-rw-r--r--usr/src/lib/libast/common/tm/tvtouch.c67
-rw-r--r--usr/src/lib/libast/common/uwin/a64l.c4
-rw-r--r--usr/src/lib/libast/common/uwin/cbrt.c4
-rw-r--r--usr/src/lib/libast/common/uwin/err.c4
-rw-r--r--usr/src/lib/libast/common/uwin/getpass.c4
-rw-r--r--usr/src/lib/libast/common/uwin/rand48.c4
-rw-r--r--usr/src/lib/libast/common/uwin/rint.c4
-rw-r--r--usr/src/lib/libast/common/vec/vecargs.c4
-rw-r--r--usr/src/lib/libast/common/vec/vecfile.c4
-rw-r--r--usr/src/lib/libast/common/vec/vecfree.c4
-rw-r--r--usr/src/lib/libast/common/vec/vecload.c4
-rw-r--r--usr/src/lib/libast/common/vec/vecstring.c4
-rw-r--r--usr/src/lib/libast/common/vmalloc/malloc.c4
-rw-r--r--usr/src/lib/libast/common/vmalloc/vmbest.c113
-rw-r--r--usr/src/lib/libast/common/vmalloc/vmclear.c9
-rw-r--r--usr/src/lib/libast/common/vmalloc/vmclose.c4
-rw-r--r--usr/src/lib/libast/common/vmalloc/vmdcheap.c4
-rw-r--r--usr/src/lib/libast/common/vmalloc/vmdebug.c39
-rw-r--r--usr/src/lib/libast/common/vmalloc/vmdisc.c4
-rw-r--r--usr/src/lib/libast/common/vmalloc/vmexit.c4
-rw-r--r--usr/src/lib/libast/common/vmalloc/vmgetmem.c6
-rw-r--r--usr/src/lib/libast/common/vmalloc/vmhdr.h14
-rw-r--r--usr/src/lib/libast/common/vmalloc/vmlast.c37
-rw-r--r--usr/src/lib/libast/common/vmalloc/vmmopen.c4
-rw-r--r--usr/src/lib/libast/common/vmalloc/vmopen.c4
-rw-r--r--usr/src/lib/libast/common/vmalloc/vmpool.c37
-rw-r--r--usr/src/lib/libast/common/vmalloc/vmprivate.c6
-rw-r--r--usr/src/lib/libast/common/vmalloc/vmprofile.c31
-rw-r--r--usr/src/lib/libast/common/vmalloc/vmregion.c4
-rw-r--r--usr/src/lib/libast/common/vmalloc/vmsegment.c9
-rw-r--r--usr/src/lib/libast/common/vmalloc/vmset.c10
-rw-r--r--usr/src/lib/libast/common/vmalloc/vmstat.c17
-rw-r--r--usr/src/lib/libast/common/vmalloc/vmstrdup.c4
-rw-r--r--usr/src/lib/libast/common/vmalloc/vmtrace.c4
-rw-r--r--usr/src/lib/libast/common/vmalloc/vmwalk.c4
-rw-r--r--usr/src/lib/libast/i386/Makefile8
-rw-r--r--usr/src/lib/libast/i386/include/ast/align.h6
-rw-r--r--usr/src/lib/libast/i386/include/ast/ast.h6
-rw-r--r--usr/src/lib/libast/i386/include/ast/ast_botch.h6
-rw-r--r--usr/src/lib/libast/i386/include/ast/ast_ccode.h6
-rw-r--r--usr/src/lib/libast/i386/include/ast/ast_common.h6
-rw-r--r--usr/src/lib/libast/i386/include/ast/ast_dir.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/ast_dirent.h6
-rw-r--r--usr/src/lib/libast/i386/include/ast/ast_fcntl.h6
-rw-r--r--usr/src/lib/libast/i386/include/ast/ast_float.h9
-rw-r--r--usr/src/lib/libast/i386/include/ast/ast_fs.h19
-rw-r--r--usr/src/lib/libast/i386/include/ast/ast_getopt.h32
-rw-r--r--usr/src/lib/libast/i386/include/ast/ast_iconv.h6
-rw-r--r--usr/src/lib/libast/i386/include/ast/ast_lib.h6
-rw-r--r--usr/src/lib/libast/i386/include/ast/ast_limits.h6
-rw-r--r--usr/src/lib/libast/i386/include/ast/ast_map.h18
-rw-r--r--usr/src/lib/libast/i386/include/ast/ast_mmap.h6
-rw-r--r--usr/src/lib/libast/i386/include/ast/ast_mode.h6
-rw-r--r--usr/src/lib/libast/i386/include/ast/ast_namval.h51
-rw-r--r--usr/src/lib/libast/i386/include/ast/ast_ndbm.h30
-rw-r--r--usr/src/lib/libast/i386/include/ast/ast_nl_types.h6
-rw-r--r--usr/src/lib/libast/i386/include/ast/ast_param.h6
-rw-r--r--usr/src/lib/libast/i386/include/ast/ast_standards.h6
-rw-r--r--usr/src/lib/libast/i386/include/ast/ast_std.h22
-rw-r--r--usr/src/lib/libast/i386/include/ast/ast_stdio.h22
-rw-r--r--usr/src/lib/libast/i386/include/ast/ast_sys.h6
-rw-r--r--usr/src/lib/libast/i386/include/ast/ast_time.h8
-rw-r--r--usr/src/lib/libast/i386/include/ast/ast_tty.h6
-rw-r--r--usr/src/lib/libast/i386/include/ast/ast_version.h2
-rw-r--r--usr/src/lib/libast/i386/include/ast/ast_vfork.h6
-rw-r--r--usr/src/lib/libast/i386/include/ast/ast_wait.h6
-rw-r--r--usr/src/lib/libast/i386/include/ast/ast_wchar.h6
-rw-r--r--usr/src/lib/libast/i386/include/ast/ast_windows.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/bytesex.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/ccode.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/cdt.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/debug.h42
-rw-r--r--usr/src/lib/libast/i386/include/ast/dirent.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/dt.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/endian.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/error.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/find.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/fnmatch.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/fnv.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/fs3d.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/fts.h10
-rw-r--r--usr/src/lib/libast/i386/include/ast/ftw.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/ftwalk.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/getopt.h9
-rw-r--r--usr/src/lib/libast/i386/include/ast/glob.h8
-rw-r--r--usr/src/lib/libast/i386/include/ast/hash.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/hashkey.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/hashpart.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/iconv.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/ip6.h28
-rw-r--r--usr/src/lib/libast/i386/include/ast/lc.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/ls.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/magic.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/magicid.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/mc.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/mime.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/mnt.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/modecanon.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/modex.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/namval.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/nl_types.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/option.h5
-rw-r--r--usr/src/lib/libast/i386/include/ast/preroot.h6
-rw-r--r--usr/src/lib/libast/i386/include/ast/proc.h10
-rw-r--r--usr/src/lib/libast/i386/include/ast/re_comp.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/recfmt.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/regexp.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/sfdisc.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/sfio.h9
-rw-r--r--usr/src/lib/libast/i386/include/ast/sfio_s.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/sfio_t.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/shcmd.h103
-rw-r--r--usr/src/lib/libast/i386/include/ast/sig.h6
-rw-r--r--usr/src/lib/libast/i386/include/ast/stack.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/stak.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/stdio.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/stk.h5
-rw-r--r--usr/src/lib/libast/i386/include/ast/swap.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/tar.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/times.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/tm.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/tmx.h6
-rw-r--r--usr/src/lib/libast/i386/include/ast/tok.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/tv.h6
-rw-r--r--usr/src/lib/libast/i386/include/ast/usage.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/vdb.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/vecargs.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/vmalloc.h6
-rw-r--r--usr/src/lib/libast/i386/include/ast/wait.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/wchar.h4
-rw-r--r--usr/src/lib/libast/i386/include/ast/wordexp.h4
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/align2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/botch2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/ccode2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/common2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/dirent2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/eaccess2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/errno2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/fcntl2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/float5
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/fs15
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/hack2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/iconv2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/isoc9911
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/lib2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/libpath2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/limits2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/map14
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/mmap2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/mode2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/ndbm9
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/nl_types2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/omitted2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/param2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/preroot2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/sfinit2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/sfio2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/sig2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/siglist125
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/signal30
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/standards2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/stdio18
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/sys2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/time4
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/tmlib7
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/tmx2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/tty2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/tv2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/tvlib3
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/types5
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/uwin2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/vfork2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/vmalloc2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/wait2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/FEATURE/wchar2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/align.h2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/ast_botch.h2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/ast_ccode.h2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/ast_common.h2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/ast_dirent.h2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/ast_fcntl.h2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/ast_float.h5
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/ast_fs.h15
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/ast_iconv.h2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/ast_lib.h2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/ast_limits.h2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/ast_map.h14
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/ast_mmap.h2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/ast_mode.h2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/ast_ndbm.h9
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/ast_nl_types.h2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/ast_param.h2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/ast_standards.h2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/ast_stdio.h18
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/ast_sys.h2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/ast_time.h4
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/ast_tty.h2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/ast_types.h5
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/ast_vfork.h2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/ast_wait.h2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/ast_wchar.h2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/conftab.c686
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/conftab.h80
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/lc.h4
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/lctab.c (renamed from usr/src/lib/libast/i386/src/lib/libast/lctab.h)498
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/preroot.h2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/sig.h2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/tmx.h2
-rw-r--r--usr/src/lib/libast/i386/src/lib/libast/tv.h2
-rw-r--r--usr/src/lib/libast/mapfile-vers29
-rw-r--r--usr/src/lib/libast/sparc/Makefile9
-rw-r--r--usr/src/lib/libast/sparc/include/ast/align.h6
-rw-r--r--usr/src/lib/libast/sparc/include/ast/ast.h6
-rw-r--r--usr/src/lib/libast/sparc/include/ast/ast_botch.h6
-rw-r--r--usr/src/lib/libast/sparc/include/ast/ast_ccode.h6
-rw-r--r--usr/src/lib/libast/sparc/include/ast/ast_common.h6
-rw-r--r--usr/src/lib/libast/sparc/include/ast/ast_dir.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/ast_dirent.h6
-rw-r--r--usr/src/lib/libast/sparc/include/ast/ast_fcntl.h6
-rw-r--r--usr/src/lib/libast/sparc/include/ast/ast_float.h9
-rw-r--r--usr/src/lib/libast/sparc/include/ast/ast_fs.h19
-rw-r--r--usr/src/lib/libast/sparc/include/ast/ast_getopt.h32
-rw-r--r--usr/src/lib/libast/sparc/include/ast/ast_iconv.h6
-rw-r--r--usr/src/lib/libast/sparc/include/ast/ast_lib.h6
-rw-r--r--usr/src/lib/libast/sparc/include/ast/ast_limits.h6
-rw-r--r--usr/src/lib/libast/sparc/include/ast/ast_map.h18
-rw-r--r--usr/src/lib/libast/sparc/include/ast/ast_mmap.h7
-rw-r--r--usr/src/lib/libast/sparc/include/ast/ast_mode.h6
-rw-r--r--usr/src/lib/libast/sparc/include/ast/ast_namval.h51
-rw-r--r--usr/src/lib/libast/sparc/include/ast/ast_ndbm.h30
-rw-r--r--usr/src/lib/libast/sparc/include/ast/ast_nl_types.h6
-rw-r--r--usr/src/lib/libast/sparc/include/ast/ast_param.h6
-rw-r--r--usr/src/lib/libast/sparc/include/ast/ast_standards.h6
-rw-r--r--usr/src/lib/libast/sparc/include/ast/ast_std.h22
-rw-r--r--usr/src/lib/libast/sparc/include/ast/ast_stdio.h22
-rw-r--r--usr/src/lib/libast/sparc/include/ast/ast_sys.h6
-rw-r--r--usr/src/lib/libast/sparc/include/ast/ast_time.h8
-rw-r--r--usr/src/lib/libast/sparc/include/ast/ast_tty.h6
-rw-r--r--usr/src/lib/libast/sparc/include/ast/ast_version.h2
-rw-r--r--usr/src/lib/libast/sparc/include/ast/ast_vfork.h6
-rw-r--r--usr/src/lib/libast/sparc/include/ast/ast_wait.h6
-rw-r--r--usr/src/lib/libast/sparc/include/ast/ast_wchar.h6
-rw-r--r--usr/src/lib/libast/sparc/include/ast/ast_windows.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/bytesex.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/ccode.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/cdt.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/debug.h42
-rw-r--r--usr/src/lib/libast/sparc/include/ast/dirent.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/dt.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/endian.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/error.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/find.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/fnmatch.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/fnv.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/fs3d.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/fts.h10
-rw-r--r--usr/src/lib/libast/sparc/include/ast/ftw.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/ftwalk.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/getopt.h9
-rw-r--r--usr/src/lib/libast/sparc/include/ast/glob.h8
-rw-r--r--usr/src/lib/libast/sparc/include/ast/hash.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/hashkey.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/hashpart.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/iconv.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/ip6.h28
-rw-r--r--usr/src/lib/libast/sparc/include/ast/lc.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/ls.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/magic.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/magicid.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/mc.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/mime.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/mnt.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/modecanon.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/modex.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/namval.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/nl_types.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/option.h5
-rw-r--r--usr/src/lib/libast/sparc/include/ast/preroot.h6
-rw-r--r--usr/src/lib/libast/sparc/include/ast/proc.h10
-rw-r--r--usr/src/lib/libast/sparc/include/ast/re_comp.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/recfmt.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/regexp.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/sfdisc.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/sfio.h9
-rw-r--r--usr/src/lib/libast/sparc/include/ast/sfio_s.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/sfio_t.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/shcmd.h103
-rw-r--r--usr/src/lib/libast/sparc/include/ast/sig.h6
-rw-r--r--usr/src/lib/libast/sparc/include/ast/stack.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/stak.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/stdio.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/stk.h5
-rw-r--r--usr/src/lib/libast/sparc/include/ast/swap.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/tar.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/times.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/tm.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/tmx.h6
-rw-r--r--usr/src/lib/libast/sparc/include/ast/tok.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/tv.h6
-rw-r--r--usr/src/lib/libast/sparc/include/ast/usage.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/vdb.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/vecargs.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/vmalloc.h6
-rw-r--r--usr/src/lib/libast/sparc/include/ast/wait.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/wchar.h4
-rw-r--r--usr/src/lib/libast/sparc/include/ast/wordexp.h4
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/align2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/botch2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/ccode2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/common2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/dirent2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/eaccess2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/errno2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/fcntl2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/float5
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/fs15
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/hack2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/iconv2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/isoc9911
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/lib2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/libpath2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/limits2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/map14
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/mmap3
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/mode2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/ndbm9
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/nl_types2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/omitted2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/param2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/preroot2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/sfinit2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/sfio2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/sig2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/siglist125
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/signal30
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/standards2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/stdio18
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/sys2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/time4
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/tmlib7
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/tmx2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/tty2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/tv2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/tvlib3
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/types5
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/uwin2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/vfork2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/vmalloc2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/wait2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/FEATURE/wchar2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/align.h2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/ast_botch.h2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/ast_ccode.h2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/ast_common.h2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/ast_dirent.h2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/ast_fcntl.h2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/ast_float.h5
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/ast_fs.h15
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/ast_iconv.h2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/ast_lib.h2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/ast_limits.h2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/ast_map.h14
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/ast_mmap.h3
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/ast_mode.h2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/ast_ndbm.h9
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/ast_nl_types.h2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/ast_param.h2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/ast_standards.h2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/ast_stdio.h18
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/ast_sys.h2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/ast_time.h4
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/ast_tty.h2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/ast_types.h5
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/ast_vfork.h2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/ast_wait.h2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/ast_wchar.h2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/conftab.c686
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/conftab.h80
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/lc.h4
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/lctab.c (renamed from usr/src/lib/libast/sparc/src/lib/libast/lctab.h)498
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/preroot.h2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/sig.h2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/tmx.h2
-rw-r--r--usr/src/lib/libast/sparc/src/lib/libast/tv.h2
-rw-r--r--usr/src/lib/libast/sparcv9/Makefile9
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/align.h6
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/ast.h6
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/ast_botch.h6
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/ast_ccode.h6
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/ast_common.h6
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/ast_dir.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/ast_dirent.h6
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/ast_fcntl.h6
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/ast_float.h9
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/ast_fs.h19
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/ast_getopt.h32
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/ast_iconv.h6
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/ast_lib.h6
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/ast_limits.h6
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/ast_map.h18
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/ast_mmap.h6
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/ast_mode.h6
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/ast_namval.h51
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/ast_ndbm.h30
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/ast_nl_types.h6
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/ast_param.h6
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/ast_standards.h6
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/ast_std.h22
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/ast_stdio.h22
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/ast_sys.h6
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/ast_time.h8
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/ast_tty.h6
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/ast_version.h2
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/ast_vfork.h6
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/ast_wait.h6
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/ast_wchar.h6
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/ast_windows.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/bytesex.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/ccode.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/cdt.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/debug.h42
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/dirent.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/dt.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/endian.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/error.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/find.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/fnmatch.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/fnv.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/fs3d.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/fts.h10
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/ftw.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/ftwalk.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/getopt.h9
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/glob.h8
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/hash.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/hashkey.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/hashpart.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/iconv.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/ip6.h28
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/lc.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/ls.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/magic.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/magicid.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/mc.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/mime.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/mnt.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/modecanon.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/modex.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/namval.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/nl_types.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/option.h5
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/preroot.h6
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/proc.h10
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/re_comp.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/recfmt.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/regexp.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/sfdisc.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/sfio.h9
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/sfio_s.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/sfio_t.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/shcmd.h103
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/sig.h6
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/stack.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/stak.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/stdio.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/stk.h5
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/swap.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/tar.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/times.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/tm.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/tmx.h6
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/tok.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/tv.h6
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/usage.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/vdb.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/vecargs.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/vmalloc.h6
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/wait.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/wchar.h4
-rw-r--r--usr/src/lib/libast/sparcv9/include/ast/wordexp.h4
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/align2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/botch2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/ccode2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/common2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/dirent2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/eaccess2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/errno2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/fcntl2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/float5
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/fs15
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/hack2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/iconv2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/isoc9911
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/lib2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/libpath2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/limits2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/map14
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/mmap2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/mode2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/ndbm9
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/nl_types2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/omitted2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/param2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/preroot2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/sfinit2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/sfio2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/sig2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/siglist125
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/signal30
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/standards2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/stdio18
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/sys2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/time4
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/tmlib7
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/tmx2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/tty2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/tv2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/tvlib3
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/types5
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/uwin2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/vfork2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/vmalloc2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/wait2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/wchar2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/align.h2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/ast_botch.h2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/ast_ccode.h2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/ast_common.h2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/ast_dirent.h2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/ast_fcntl.h2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/ast_float.h5
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/ast_fs.h15
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/ast_iconv.h2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/ast_lib.h2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/ast_limits.h2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/ast_map.h14
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/ast_mmap.h2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/ast_mode.h2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/ast_ndbm.h9
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/ast_nl_types.h2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/ast_param.h2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/ast_standards.h2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/ast_stdio.h18
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/ast_sys.h2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/ast_time.h4
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/ast_tty.h2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/ast_types.h5
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/ast_vfork.h2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/ast_wait.h2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/ast_wchar.h2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/conftab.c686
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/conftab.h80
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/lc.h4
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/lctab.c (renamed from usr/src/lib/libast/sparcv9/src/lib/libast/lctab.h)498
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/preroot.h2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/sig.h2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/tmx.h2
-rw-r--r--usr/src/lib/libast/sparcv9/src/lib/libast/tv.h2
-rw-r--r--usr/src/lib/libcmd/Makefile8
-rw-r--r--usr/src/lib/libcmd/Makefile.com30
-rw-r--r--usr/src/lib/libcmd/amd64/include/ast/cmd.h45
-rw-r--r--usr/src/lib/libcmd/amd64/include/ast/cmdext.h5
-rw-r--r--usr/src/lib/libcmd/amd64/src/lib/libcmd/FEATURE/ids4
-rw-r--r--usr/src/lib/libcmd/amd64/src/lib/libcmd/FEATURE/sockets4
-rw-r--r--usr/src/lib/libcmd/amd64/src/lib/libcmd/FEATURE/symlink4
-rw-r--r--usr/src/lib/libcmd/amd64/src/lib/libcmd/FEATURE/utsname4
-rw-r--r--usr/src/lib/libcmd/common/RELEASE36
-rw-r--r--usr/src/lib/libcmd/common/basename.c4
-rw-r--r--usr/src/lib/libcmd/common/cat.c16
-rw-r--r--usr/src/lib/libcmd/common/chgrp.c184
-rw-r--r--usr/src/lib/libcmd/common/chmod.c17
-rw-r--r--usr/src/lib/libcmd/common/chown.c4
-rw-r--r--usr/src/lib/libcmd/common/cksum.c45
-rw-r--r--usr/src/lib/libcmd/common/cmd.h42
-rw-r--r--usr/src/lib/libcmd/common/cmdinit.c10
-rw-r--r--usr/src/lib/libcmd/common/cmp.c4
-rw-r--r--usr/src/lib/libcmd/common/comm.c4
-rw-r--r--usr/src/lib/libcmd/common/cp.c208
-rw-r--r--usr/src/lib/libcmd/common/cut.c21
-rw-r--r--usr/src/lib/libcmd/common/date.c19
-rw-r--r--usr/src/lib/libcmd/common/dirname.c4
-rw-r--r--usr/src/lib/libcmd/common/expr.c8
-rw-r--r--usr/src/lib/libcmd/common/fds.c290
-rw-r--r--usr/src/lib/libcmd/common/fmt.c4
-rw-r--r--usr/src/lib/libcmd/common/fold.c4
-rw-r--r--usr/src/lib/libcmd/common/getconf.c17
-rw-r--r--usr/src/lib/libcmd/common/head.c6
-rw-r--r--usr/src/lib/libcmd/common/id.c4
-rw-r--r--usr/src/lib/libcmd/common/join.c8
-rw-r--r--usr/src/lib/libcmd/common/llib-lcmd54
-rw-r--r--usr/src/lib/libcmd/common/ln.c4
-rw-r--r--usr/src/lib/libcmd/common/logname.c4
-rw-r--r--usr/src/lib/libcmd/common/md5sum.c4
-rw-r--r--usr/src/lib/libcmd/common/mkdir.c21
-rw-r--r--usr/src/lib/libcmd/common/mkfifo.c4
-rw-r--r--usr/src/lib/libcmd/common/mv.c4
-rw-r--r--usr/src/lib/libcmd/common/paste.c22
-rw-r--r--usr/src/lib/libcmd/common/pathchk.c8
-rw-r--r--usr/src/lib/libcmd/common/pids.c120
-rw-r--r--usr/src/lib/libcmd/common/readlink.c111
-rw-r--r--usr/src/lib/libcmd/common/rev.c56
-rw-r--r--usr/src/lib/libcmd/common/rev.h4
-rw-r--r--usr/src/lib/libcmd/common/revlib.c4
-rw-r--r--usr/src/lib/libcmd/common/rm.c27
-rw-r--r--usr/src/lib/libcmd/common/rmdir.c4
-rw-r--r--usr/src/lib/libcmd/common/shcmd.h80
-rw-r--r--usr/src/lib/libcmd/common/stty.c35
-rw-r--r--usr/src/lib/libcmd/common/sum.c4
-rw-r--r--usr/src/lib/libcmd/common/sync.c4
-rw-r--r--usr/src/lib/libcmd/common/tail.c5
-rw-r--r--usr/src/lib/libcmd/common/tee.c13
-rw-r--r--usr/src/lib/libcmd/common/tty.c17
-rw-r--r--usr/src/lib/libcmd/common/uname.c14
-rw-r--r--usr/src/lib/libcmd/common/uniq.c6
-rw-r--r--usr/src/lib/libcmd/common/wc.c4
-rw-r--r--usr/src/lib/libcmd/common/wc.h4
-rw-r--r--usr/src/lib/libcmd/common/wclib.c6
-rw-r--r--usr/src/lib/libcmd/i386/include/ast/cmd.h45
-rw-r--r--usr/src/lib/libcmd/i386/include/ast/cmdext.h5
-rw-r--r--usr/src/lib/libcmd/i386/src/lib/libcmd/FEATURE/ids4
-rw-r--r--usr/src/lib/libcmd/i386/src/lib/libcmd/FEATURE/sockets4
-rw-r--r--usr/src/lib/libcmd/i386/src/lib/libcmd/FEATURE/symlink4
-rw-r--r--usr/src/lib/libcmd/i386/src/lib/libcmd/FEATURE/utsname4
-rw-r--r--usr/src/lib/libcmd/mapfile-vers11
-rw-r--r--usr/src/lib/libcmd/sparc/include/ast/cmd.h45
-rw-r--r--usr/src/lib/libcmd/sparc/include/ast/cmdext.h5
-rw-r--r--usr/src/lib/libcmd/sparc/src/lib/libcmd/FEATURE/ids4
-rw-r--r--usr/src/lib/libcmd/sparc/src/lib/libcmd/FEATURE/sockets4
-rw-r--r--usr/src/lib/libcmd/sparc/src/lib/libcmd/FEATURE/symlink4
-rw-r--r--usr/src/lib/libcmd/sparc/src/lib/libcmd/FEATURE/utsname4
-rw-r--r--usr/src/lib/libcmd/sparcv9/include/ast/cmd.h45
-rw-r--r--usr/src/lib/libcmd/sparcv9/include/ast/cmdext.h5
-rw-r--r--usr/src/lib/libcmd/sparcv9/src/lib/libcmd/FEATURE/ids4
-rw-r--r--usr/src/lib/libcmd/sparcv9/src/lib/libcmd/FEATURE/sockets4
-rw-r--r--usr/src/lib/libcmd/sparcv9/src/lib/libcmd/FEATURE/symlink4
-rw-r--r--usr/src/lib/libcmd/sparcv9/src/lib/libcmd/FEATURE/utsname4
-rw-r--r--usr/src/lib/libdll/Makefile7
-rw-r--r--usr/src/lib/libdll/Makefile.com22
-rw-r--r--usr/src/lib/libdll/amd64/Makefile5
-rw-r--r--usr/src/lib/libdll/amd64/src/lib/libdll/FEATURE/dll4
-rw-r--r--usr/src/lib/libdll/amd64/src/lib/libdll/dlldefs.h4
-rw-r--r--usr/src/lib/libdll/common/RELEASE1
-rw-r--r--usr/src/lib/libdll/common/dlfcn.c4
-rw-r--r--usr/src/lib/libdll/common/dllfind.c4
-rw-r--r--usr/src/lib/libdll/common/dlllook.c4
-rw-r--r--usr/src/lib/libdll/common/dllnext.c4
-rw-r--r--usr/src/lib/libdll/common/dllplug.c4
-rw-r--r--usr/src/lib/libdll/common/dllscan.c17
-rw-r--r--usr/src/lib/libdll/common/llib-ldll15
-rw-r--r--usr/src/lib/libdll/i386/Makefile5
-rw-r--r--usr/src/lib/libdll/i386/src/lib/libdll/FEATURE/dll4
-rw-r--r--usr/src/lib/libdll/i386/src/lib/libdll/dlldefs.h4
-rw-r--r--usr/src/lib/libdll/mapfile-vers4
-rw-r--r--usr/src/lib/libdll/sparc/Makefile5
-rw-r--r--usr/src/lib/libdll/sparc/src/lib/libdll/FEATURE/dll4
-rw-r--r--usr/src/lib/libdll/sparc/src/lib/libdll/dlldefs.h4
-rw-r--r--usr/src/lib/libdll/sparcv9/Makefile5
-rw-r--r--usr/src/lib/libdll/sparcv9/src/lib/libdll/FEATURE/dll4
-rw-r--r--usr/src/lib/libdll/sparcv9/src/lib/libdll/dlldefs.h4
-rw-r--r--usr/src/lib/libpp/Makefile6
-rw-r--r--usr/src/lib/libpp/Makefile.com24
-rw-r--r--usr/src/lib/libpp/common/RELEASE8
-rw-r--r--usr/src/lib/libpp/common/gentab.sh4
-rw-r--r--usr/src/lib/libpp/common/llib-lpp25
-rw-r--r--usr/src/lib/libpp/common/pp.def3
-rw-r--r--usr/src/lib/libpp/common/pp.h6
-rw-r--r--usr/src/lib/libpp/common/ppargs.c13
-rw-r--r--usr/src/lib/libpp/common/ppbuiltin.c20
-rw-r--r--usr/src/lib/libpp/common/ppcall.c4
-rw-r--r--usr/src/lib/libpp/common/ppcomment.c4
-rw-r--r--usr/src/lib/libpp/common/ppcontext.c4
-rw-r--r--usr/src/lib/libpp/common/ppcontrol.c24
-rw-r--r--usr/src/lib/libpp/common/ppcpp.c4
-rw-r--r--usr/src/lib/libpp/common/ppdata.c6
-rw-r--r--usr/src/lib/libpp/common/pperror.c4
-rw-r--r--usr/src/lib/libpp/common/ppexpr.c4
-rw-r--r--usr/src/lib/libpp/common/ppfsm.c4
-rw-r--r--usr/src/lib/libpp/common/ppfsm.h4
-rw-r--r--usr/src/lib/libpp/common/ppincref.c4
-rw-r--r--usr/src/lib/libpp/common/ppinput.c4
-rw-r--r--usr/src/lib/libpp/common/ppkey.c4
-rw-r--r--usr/src/lib/libpp/common/ppkey.h4
-rw-r--r--usr/src/lib/libpp/common/pplex.c17
-rw-r--r--usr/src/lib/libpp/common/pplib.h4
-rw-r--r--usr/src/lib/libpp/common/ppline.c4
-rw-r--r--usr/src/lib/libpp/common/ppmacref.c4
-rw-r--r--usr/src/lib/libpp/common/ppmisc.c4
-rw-r--r--usr/src/lib/libpp/common/ppop.c6
-rw-r--r--usr/src/lib/libpp/common/pppragma.c4
-rw-r--r--usr/src/lib/libpp/common/ppprintf.c4
-rw-r--r--usr/src/lib/libpp/common/ppproto.c18
-rw-r--r--usr/src/lib/libpp/common/ppsearch.c45
-rw-r--r--usr/src/lib/libpp/common/ppsym.c4
-rw-r--r--usr/src/lib/libpp/common/pptrace.c4
-rw-r--r--usr/src/lib/libpp/i386/Makefile6
-rw-r--r--usr/src/lib/libpp/mapfile-vers4
-rw-r--r--usr/src/lib/libpp/sparc/Makefile5
-rw-r--r--usr/src/lib/libshell/Makefile7
-rw-r--r--usr/src/lib/libshell/Makefile.com38
-rw-r--r--usr/src/lib/libshell/Makefile.demo91
-rw-r--r--usr/src/lib/libshell/amd64/Makefile5
-rw-r--r--usr/src/lib/libshell/amd64/include/ast/history.h6
-rw-r--r--usr/src/lib/libshell/amd64/include/ast/nval.h61
-rw-r--r--usr/src/lib/libshell/amd64/include/ast/shell.h26
-rw-r--r--usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/acct9
-rw-r--r--usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/cmds9
-rw-r--r--usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/dynamic19
-rw-r--r--usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/execargs9
-rw-r--r--usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/externs11
-rw-r--r--usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/locale9
-rw-r--r--usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/math12
-rw-r--r--usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/options12
-rw-r--r--usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/poll9
-rw-r--r--usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/pstat9
-rw-r--r--usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/rlimits9
-rw-r--r--usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/setjmp9
-rw-r--r--usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/sigfeatures13
-rw-r--r--usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/time9
-rw-r--r--usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/ttys9
-rw-r--r--usr/src/lib/libshell/common/COMPATIBILITY5
-rw-r--r--usr/src/lib/libshell/common/DESIGN37
-rw-r--r--usr/src/lib/libshell/common/PROMO.mm2
-rw-r--r--usr/src/lib/libshell/common/README9
-rw-r--r--usr/src/lib/libshell/common/RELEASE441
-rw-r--r--usr/src/lib/libshell/common/TYPES182
-rw-r--r--usr/src/lib/libshell/common/bltins/alarm.c8
-rw-r--r--usr/src/lib/libshell/common/bltins/cd_pwd.c37
-rw-r--r--usr/src/lib/libshell/common/bltins/cflow.c8
-rw-r--r--usr/src/lib/libshell/common/bltins/enum.c283
-rw-r--r--usr/src/lib/libshell/common/bltins/getopts.c44
-rw-r--r--usr/src/lib/libshell/common/bltins/hist.c12
-rw-r--r--usr/src/lib/libshell/common/bltins/misc.c55
-rw-r--r--usr/src/lib/libshell/common/bltins/mkservice.c4
-rw-r--r--usr/src/lib/libshell/common/bltins/print.c182
-rw-r--r--usr/src/lib/libshell/common/bltins/read.c213
-rw-r--r--usr/src/lib/libshell/common/bltins/shiocmd_solaris.c116
-rw-r--r--usr/src/lib/libshell/common/bltins/shopen.c533
-rw-r--r--usr/src/lib/libshell/common/bltins/sleep.c37
-rw-r--r--usr/src/lib/libshell/common/bltins/test.c17
-rw-r--r--usr/src/lib/libshell/common/bltins/trap.c144
-rw-r--r--usr/src/lib/libshell/common/bltins/typeset.c450
-rw-r--r--usr/src/lib/libshell/common/bltins/ulimit.c17
-rw-r--r--usr/src/lib/libshell/common/bltins/umask.c6
-rw-r--r--usr/src/lib/libshell/common/bltins/whence.c135
-rw-r--r--usr/src/lib/libshell/common/data/aliases.c4
-rw-r--r--usr/src/lib/libshell/common/data/bash_pre_rc.sh56
-rw-r--r--usr/src/lib/libshell/common/data/builtins.c110
-rw-r--r--usr/src/lib/libshell/common/data/keywords.c4
-rw-r--r--usr/src/lib/libshell/common/data/lexstates.c11
-rw-r--r--usr/src/lib/libshell/common/data/limits.c4
-rw-r--r--usr/src/lib/libshell/common/data/math.tab3
-rw-r--r--usr/src/lib/libshell/common/data/msg.c10
-rw-r--r--usr/src/lib/libshell/common/data/options.c23
-rw-r--r--usr/src/lib/libshell/common/data/signals.c48
-rw-r--r--usr/src/lib/libshell/common/data/solaris_cmdlist.h46
-rw-r--r--usr/src/lib/libshell/common/data/strdata.c4
-rw-r--r--usr/src/lib/libshell/common/data/testops.c4
-rw-r--r--usr/src/lib/libshell/common/data/variables.c31
-rw-r--r--usr/src/lib/libshell/common/edit/completion.c34
-rw-r--r--usr/src/lib/libshell/common/edit/edit.c202
-rw-r--r--usr/src/lib/libshell/common/edit/emacs.c47
-rw-r--r--usr/src/lib/libshell/common/edit/hexpand.c4
-rw-r--r--usr/src/lib/libshell/common/edit/history.c135
-rw-r--r--usr/src/lib/libshell/common/edit/vi.c33
-rw-r--r--usr/src/lib/libshell/common/features/dynamic8
-rw-r--r--usr/src/lib/libshell/common/features/externs4
-rw-r--r--usr/src/lib/libshell/common/features/math.sh19
-rw-r--r--usr/src/lib/libshell/common/features/options3
-rw-r--r--usr/src/lib/libshell/common/features/poll14
-rw-r--r--usr/src/lib/libshell/common/features/sigfeatures4
-rw-r--r--usr/src/lib/libshell/common/fun/mandelbrotset1234
-rw-r--r--usr/src/lib/libshell/common/fun/rssread414
-rw-r--r--usr/src/lib/libshell/common/fun/termclock267
-rw-r--r--usr/src/lib/libshell/common/include/argnod.h24
-rw-r--r--usr/src/lib/libshell/common/include/builtins.h11
-rw-r--r--usr/src/lib/libshell/common/include/defs.h104
-rw-r--r--usr/src/lib/libshell/common/include/edit.h7
-rw-r--r--usr/src/lib/libshell/common/include/env.h4
-rw-r--r--usr/src/lib/libshell/common/include/fault.h13
-rw-r--r--usr/src/lib/libshell/common/include/fcin.h9
-rw-r--r--usr/src/lib/libshell/common/include/history.h6
-rw-r--r--usr/src/lib/libshell/common/include/io.h21
-rw-r--r--usr/src/lib/libshell/common/include/jobs.h28
-rw-r--r--usr/src/lib/libshell/common/include/lexstates.h5
-rw-r--r--usr/src/lib/libshell/common/include/name.h61
-rw-r--r--usr/src/lib/libshell/common/include/national.h4
-rw-r--r--usr/src/lib/libshell/common/include/nval.h61
-rw-r--r--usr/src/lib/libshell/common/include/path.h10
-rw-r--r--usr/src/lib/libshell/common/include/shell.h26
-rw-r--r--usr/src/lib/libshell/common/include/shlex.h31
-rw-r--r--usr/src/lib/libshell/common/include/shnodes.h45
-rw-r--r--usr/src/lib/libshell/common/include/shtable.h10
-rw-r--r--usr/src/lib/libshell/common/include/streval.h4
-rw-r--r--usr/src/lib/libshell/common/include/terminal.h4
-rw-r--r--usr/src/lib/libshell/common/include/test.h4
-rw-r--r--usr/src/lib/libshell/common/include/timeout.h4
-rw-r--r--usr/src/lib/libshell/common/include/ulimit.h4
-rw-r--r--usr/src/lib/libshell/common/include/variables.h48
-rw-r--r--usr/src/lib/libshell/common/include/version.h6
-rw-r--r--usr/src/lib/libshell/common/llib-lshell107
-rw-r--r--usr/src/lib/libshell/common/nval.378
-rw-r--r--usr/src/lib/libshell/common/scripts/crawlsrccomments.sh1203
-rw-r--r--usr/src/lib/libshell/common/scripts/filemutexdemo1.sh267
-rw-r--r--usr/src/lib/libshell/common/scripts/filetree1.sh229
-rw-r--r--usr/src/lib/libshell/common/scripts/gnaw.sh (renamed from usr/src/lib/libshell/common/fun/gnaw)430
-rw-r--r--usr/src/lib/libshell/common/scripts/mandelbrotset1.sh281
-rw-r--r--usr/src/lib/libshell/common/scripts/multifollow.sh148
-rw-r--r--usr/src/lib/libshell/common/scripts/primenumbers1.sh115
-rw-r--r--usr/src/lib/libshell/common/scripts/rssread.sh554
-rw-r--r--usr/src/lib/libshell/common/scripts/shcalc.sh151
-rw-r--r--usr/src/lib/libshell/common/scripts/shircbot.sh429
-rw-r--r--usr/src/lib/libshell/common/scripts/shlint.sh94
-rw-r--r--usr/src/lib/libshell/common/scripts/shman.sh388
-rw-r--r--usr/src/lib/libshell/common/scripts/shnote.sh414
-rw-r--r--usr/src/lib/libshell/common/scripts/shpiano.sh1386
-rw-r--r--usr/src/lib/libshell/common/scripts/shtinyurl.sh202
-rw-r--r--usr/src/lib/libshell/common/scripts/shtwitter.sh358
-rw-r--r--usr/src/lib/libshell/common/scripts/svcproptree1.sh172
-rw-r--r--usr/src/lib/libshell/common/scripts/termclock.sh312
-rw-r--r--usr/src/lib/libshell/common/scripts/test_net_sctp.sh65
-rw-r--r--usr/src/lib/libshell/common/scripts/xmldocumenttree1.sh356
-rw-r--r--usr/src/lib/libshell/common/sh.1511
-rw-r--r--usr/src/lib/libshell/common/sh/args.c227
-rw-r--r--usr/src/lib/libshell/common/sh/arith.c112
-rw-r--r--usr/src/lib/libshell/common/sh/array.c825
-rw-r--r--usr/src/lib/libshell/common/sh/bash.c40
-rw-r--r--usr/src/lib/libshell/common/sh/defs.c8
-rw-r--r--usr/src/lib/libshell/common/sh/deparse.c4
-rw-r--r--usr/src/lib/libshell/common/sh/env.c4
-rw-r--r--usr/src/lib/libshell/common/sh/expand.c20
-rw-r--r--usr/src/lib/libshell/common/sh/fault.c252
-rw-r--r--usr/src/lib/libshell/common/sh/fcin.c9
-rw-r--r--usr/src/lib/libshell/common/sh/init.c796
-rw-r--r--usr/src/lib/libshell/common/sh/io.c537
-rw-r--r--usr/src/lib/libshell/common/sh/jobs.c162
-rw-r--r--usr/src/lib/libshell/common/sh/lex.c1115
-rw-r--r--usr/src/lib/libshell/common/sh/macro.c836
-rw-r--r--usr/src/lib/libshell/common/sh/main.c62
-rw-r--r--usr/src/lib/libshell/common/sh/name.c1279
-rw-r--r--usr/src/lib/libshell/common/sh/nvdisc.c308
-rw-r--r--usr/src/lib/libshell/common/sh/nvtree.c694
-rw-r--r--usr/src/lib/libshell/common/sh/nvtype.c1533
-rw-r--r--usr/src/lib/libshell/common/sh/parse.c1046
-rw-r--r--usr/src/lib/libshell/common/sh/path.c170
-rw-r--r--usr/src/lib/libshell/common/sh/pmain.c23
-rw-r--r--usr/src/lib/libshell/common/sh/shcomp.c11
-rw-r--r--usr/src/lib/libshell/common/sh/streval.c6
-rw-r--r--usr/src/lib/libshell/common/sh/string.c28
-rw-r--r--usr/src/lib/libshell/common/sh/subshell.c328
-rw-r--r--usr/src/lib/libshell/common/sh/suid_exec.c4
-rw-r--r--usr/src/lib/libshell/common/sh/tdump.c6
-rw-r--r--usr/src/lib/libshell/common/sh/timers.c4
-rw-r--r--usr/src/lib/libshell/common/sh/trestore.c177
-rw-r--r--usr/src/lib/libshell/common/sh/waitevent.c4
-rw-r--r--usr/src/lib/libshell/common/sh/xec.c1524
-rw-r--r--usr/src/lib/libshell/common/shell.326
-rw-r--r--usr/src/lib/libshell/common/tests/alias.sh20
-rw-r--r--usr/src/lib/libshell/common/tests/append.sh12
-rw-r--r--usr/src/lib/libshell/common/tests/arith.sh52
-rw-r--r--usr/src/lib/libshell/common/tests/arrays.sh92
-rw-r--r--usr/src/lib/libshell/common/tests/arrays2.sh123
-rw-r--r--usr/src/lib/libshell/common/tests/attributes.sh75
-rw-r--r--usr/src/lib/libshell/common/tests/basic.sh102
-rw-r--r--usr/src/lib/libshell/common/tests/bracket.sh28
-rw-r--r--usr/src/lib/libshell/common/tests/builtins.sh120
-rw-r--r--usr/src/lib/libshell/common/tests/case.sh4
-rw-r--r--usr/src/lib/libshell/common/tests/comvar.sh235
-rw-r--r--usr/src/lib/libshell/common/tests/coprocess.sh110
-rw-r--r--usr/src/lib/libshell/common/tests/cubetype.sh210
-rw-r--r--usr/src/lib/libshell/common/tests/enum.sh67
-rw-r--r--usr/src/lib/libshell/common/tests/exit.sh5
-rw-r--r--usr/src/lib/libshell/common/tests/expand.sh6
-rw-r--r--usr/src/lib/libshell/common/tests/functions.sh331
-rw-r--r--usr/src/lib/libshell/common/tests/glob.sh304
-rw-r--r--usr/src/lib/libshell/common/tests/grep.sh4
-rw-r--r--usr/src/lib/libshell/common/tests/heredoc.sh20
-rw-r--r--usr/src/lib/libshell/common/tests/io.sh128
-rw-r--r--usr/src/lib/libshell/common/tests/locale.sh104
-rw-r--r--usr/src/lib/libshell/common/tests/nameref.sh75
-rw-r--r--usr/src/lib/libshell/common/tests/options.sh159
-rw-r--r--usr/src/lib/libshell/common/tests/path.sh84
-rw-r--r--usr/src/lib/libshell/common/tests/pointtype.sh145
-rw-r--r--usr/src/lib/libshell/common/tests/quoting.sh10
-rw-r--r--usr/src/lib/libshell/common/tests/quoting2.sh11
-rw-r--r--usr/src/lib/libshell/common/tests/recttype.sh69
-rw-r--r--usr/src/lib/libshell/common/tests/restricted.sh77
-rw-r--r--usr/src/lib/libshell/common/tests/return.sh10
-rw-r--r--usr/src/lib/libshell/common/tests/select.sh4
-rw-r--r--usr/src/lib/libshell/common/tests/shtests102
-rw-r--r--usr/src/lib/libshell/common/tests/sigchld.sh65
-rw-r--r--usr/src/lib/libshell/common/tests/signal.sh226
-rw-r--r--usr/src/lib/libshell/common/tests/statics.sh106
-rw-r--r--usr/src/lib/libshell/common/tests/subshell.sh223
-rw-r--r--usr/src/lib/libshell/common/tests/substring.sh82
-rw-r--r--usr/src/lib/libshell/common/tests/sun_solaris_builtin_sum.sh108
-rw-r--r--usr/src/lib/libshell/common/tests/sun_solaris_compoundvario.sh251
-rw-r--r--usr/src/lib/libshell/common/tests/sun_solaris_cr_6687139_command_substitution_exec_redirection_allocation_loop.sh212
-rw-r--r--usr/src/lib/libshell/common/tests/sun_solaris_cr_6713682_compound_var_bleeds_through_subshell.sh108
-rw-r--r--usr/src/lib/libshell/common/tests/sun_solaris_cr_6722134_background_CHLD_trap.sh119
-rw-r--r--usr/src/lib/libshell/common/tests/sun_solaris_cr_6753538_subshell_leaks_umask.sh97
-rw-r--r--usr/src/lib/libshell/common/tests/sun_solaris_cr_6754020_weird_square_bracket_expansion.sh78
-rw-r--r--usr/src/lib/libshell/common/tests/sun_solaris_cr_6763594_command_failure_execs_twice.sh95
-rw-r--r--usr/src/lib/libshell/common/tests/sun_solaris_cr_6766246_pattern_matching_bug.sh172
-rw-r--r--usr/src/lib/libshell/common/tests/sun_solaris_getconf.sh69
-rw-r--r--usr/src/lib/libshell/common/tests/sun_solaris_local_compound_nameref001.sh64
-rw-r--r--usr/src/lib/libshell/common/tests/sun_solaris_staticvariables.sh111
-rw-r--r--usr/src/lib/libshell/common/tests/sun_solaris_vartree001.sh191
-rw-r--r--usr/src/lib/libshell/common/tests/sun_solaris_vartree002.sh353
-rw-r--r--usr/src/lib/libshell/common/tests/sun_solaris_vartree003.sh198
-rw-r--r--usr/src/lib/libshell/common/tests/tilde.sh9
-rw-r--r--usr/src/lib/libshell/common/tests/timetype.sh80
-rw-r--r--usr/src/lib/libshell/common/tests/types.sh268
-rw-r--r--usr/src/lib/libshell/common/tests/variables.sh85
-rw-r--r--usr/src/lib/libshell/common/tests/vartree1.sh214
-rw-r--r--usr/src/lib/libshell/common/tests/vartree2.sh334
-rw-r--r--usr/src/lib/libshell/i386/Makefile5
-rw-r--r--usr/src/lib/libshell/i386/include/ast/history.h6
-rw-r--r--usr/src/lib/libshell/i386/include/ast/nval.h61
-rw-r--r--usr/src/lib/libshell/i386/include/ast/shell.h26
-rw-r--r--usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/acct9
-rw-r--r--usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/cmds9
-rw-r--r--usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/dynamic19
-rw-r--r--usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/execargs9
-rw-r--r--usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/externs11
-rw-r--r--usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/locale9
-rw-r--r--usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/math12
-rw-r--r--usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/options12
-rw-r--r--usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/poll9
-rw-r--r--usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/pstat9
-rw-r--r--usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/rlimits9
-rw-r--r--usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/setjmp9
-rw-r--r--usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/sigfeatures13
-rw-r--r--usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/time9
-rw-r--r--usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/ttys9
-rw-r--r--usr/src/lib/libshell/mapfile-vers14
-rw-r--r--usr/src/lib/libshell/misc/ERRATA.txt469
-rw-r--r--usr/src/lib/libshell/misc/buildksh93.ksh373
-rw-r--r--usr/src/lib/libshell/misc/buildksh93.readme41
-rw-r--r--usr/src/lib/libshell/misc/buildksh93.sh511
-rw-r--r--usr/src/lib/libshell/misc/filelist.txt6
-rw-r--r--usr/src/lib/libshell/sparc/Makefile9
-rw-r--r--usr/src/lib/libshell/sparc/include/ast/history.h6
-rw-r--r--usr/src/lib/libshell/sparc/include/ast/nval.h61
-rw-r--r--usr/src/lib/libshell/sparc/include/ast/shell.h26
-rw-r--r--usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/acct9
-rw-r--r--usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/cmds9
-rw-r--r--usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/dynamic19
-rw-r--r--usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/execargs9
-rw-r--r--usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/externs11
-rw-r--r--usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/locale9
-rw-r--r--usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/math12
-rw-r--r--usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/options9
-rw-r--r--usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/poll9
-rw-r--r--usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/pstat9
-rw-r--r--usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/rlimits9
-rw-r--r--usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/setjmp9
-rw-r--r--usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/sigfeatures13
-rw-r--r--usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/time9
-rw-r--r--usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/ttys9
-rw-r--r--usr/src/lib/libshell/sparcv9/Makefile9
-rw-r--r--usr/src/lib/libshell/sparcv9/include/ast/history.h6
-rw-r--r--usr/src/lib/libshell/sparcv9/include/ast/nval.h61
-rw-r--r--usr/src/lib/libshell/sparcv9/include/ast/shell.h26
-rw-r--r--usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/acct9
-rw-r--r--usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/cmds9
-rw-r--r--usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/dynamic19
-rw-r--r--usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/execargs9
-rw-r--r--usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/externs11
-rw-r--r--usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/locale9
-rw-r--r--usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/math12
-rw-r--r--usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/options9
-rw-r--r--usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/poll9
-rw-r--r--usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/pstat9
-rw-r--r--usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/rlimits9
-rw-r--r--usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/setjmp9
-rw-r--r--usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/sigfeatures13
-rw-r--r--usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/time9
-rw-r--r--usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/ttys9
-rw-r--r--usr/src/lib/libsum/Makefile64
-rw-r--r--usr/src/lib/libsum/Makefile.com92
-rw-r--r--usr/src/lib/libsum/THIRDPARTYLICENSE245
-rw-r--r--usr/src/lib/libsum/THIRDPARTYLICENSE.descrip1
-rw-r--r--usr/src/lib/libsum/amd64/Makefile (renamed from usr/src/cmd/sleep/Makefile)28
-rw-r--r--usr/src/lib/libsum/amd64/include/ast/sum.h74
-rw-r--r--usr/src/lib/libsum/amd64/src/lib/libsum/FEATURE/sum16
-rw-r--r--usr/src/lib/libsum/common/RELEASE14
-rw-r--r--usr/src/lib/libsum/common/features/sum4
-rw-r--r--usr/src/lib/libsum/common/llib-lsum32
-rw-r--r--usr/src/lib/libsum/common/sum-ast4.c120
-rw-r--r--usr/src/lib/libsum/common/sum-att.c60
-rw-r--r--usr/src/lib/libsum/common/sum-bsd.c48
-rw-r--r--usr/src/lib/libsum/common/sum-crc.c191
-rw-r--r--usr/src/lib/libsum/common/sum-lmd.c330
-rw-r--r--usr/src/lib/libsum/common/sum-md5.c374
-rw-r--r--usr/src/lib/libsum/common/sum-prng.c113
-rw-r--r--usr/src/lib/libsum/common/sum-sha1.c342
-rw-r--r--usr/src/lib/libsum/common/sum-sha2.c1248
-rw-r--r--usr/src/lib/libsum/common/sum.h65
-rw-r--r--usr/src/lib/libsum/common/sumlib.c349
-rw-r--r--usr/src/lib/libsum/i386/Makefile (renamed from usr/src/cmd/sum/Makefile)29
-rw-r--r--usr/src/lib/libsum/i386/include/ast/sum.h74
-rw-r--r--usr/src/lib/libsum/i386/src/lib/libsum/FEATURE/sum16
-rw-r--r--usr/src/lib/libsum/mapfile-vers39
-rw-r--r--usr/src/lib/libsum/sparc/Makefile29
-rw-r--r--usr/src/lib/libsum/sparc/include/ast/sum.h74
-rw-r--r--usr/src/lib/libsum/sparc/src/lib/libsum/FEATURE/sum16
-rw-r--r--usr/src/lib/libsum/sparcv9/Makefile30
-rw-r--r--usr/src/lib/libsum/sparcv9/include/ast/sum.h74
-rw-r--r--usr/src/lib/libsum/sparcv9/src/lib/libsum/FEATURE/sum16
-rw-r--r--usr/src/pkgdefs/SUNW0on/prototype_com1
-rw-r--r--usr/src/pkgdefs/SUNWcsl/Makefile5
-rw-r--r--usr/src/pkgdefs/SUNWcsl/prototype_com1
-rw-r--r--usr/src/pkgdefs/SUNWcsl/prototype_i3861
-rw-r--r--usr/src/pkgdefs/SUNWcsl/prototype_sparc1
-rw-r--r--usr/src/pkgdefs/SUNWcsu/prototype_com5
-rw-r--r--usr/src/pkgdefs/SUNWcsu/prototype_i3864
-rw-r--r--usr/src/pkgdefs/SUNWcsu/prototype_sparc1
-rw-r--r--usr/src/pkgdefs/SUNWesu/pkginfo.tmpl6
-rw-r--r--usr/src/pkgdefs/SUNWesu/prototype_com5
-rw-r--r--usr/src/pkgdefs/SUNWhea/prototype_com6
-rw-r--r--usr/src/pkgdefs/SUNWosdem/Makefile13
-rw-r--r--usr/src/pkgdefs/SUNWosdem/prototype_com75
-rw-r--r--usr/src/pkgdefs/etc/exception_list_i3866
-rw-r--r--usr/src/pkgdefs/etc/exception_list_sparc6
-rw-r--r--usr/src/tools/findunref/exception_list.open15
-rw-r--r--usr/src/tools/opensolaris/license-list1
-rw-r--r--usr/src/uts/common/Makefile.files2
-rw-r--r--usr/src/uts/common/Makefile.rules7
-rw-r--r--usr/src/uts/common/conf/param.c7
-rw-r--r--usr/src/uts/common/exec/shbin/shbin.c251
-rw-r--r--usr/src/uts/intel/Makefile.intel.shared2
-rw-r--r--usr/src/uts/intel/shbinexec/Makefile82
-rw-r--r--usr/src/uts/sparc/Makefile.sparc.shared2
-rw-r--r--usr/src/uts/sparc/shbinexec/Makefile82
1883 files changed, 44506 insertions, 16906 deletions
diff --git a/usr/src/Makefile.ast b/usr/src/Makefile.ast
index aaef8f8442..d82c027007 100644
--- a/usr/src/Makefile.ast
+++ b/usr/src/Makefile.ast
@@ -18,12 +18,11 @@
#
# CDDL HEADER END
#
+
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
# Override this top level flag so the compiler builds in its native
# C99 mode. This has been enabled to support the math stuff in the
@@ -34,8 +33,10 @@ C99MODE= $(C99_ENABLE) -D_XOPEN_SOURCE=600 -D__EXTENSIONS__=1
# ... about |#pragma prototyped| ...
CERRWARN += -erroff=E_UNRECOGNIZED_PRAGMA_IGNORED
-# common CPP flags for libshell consumers (ksh etc.)
+# common CPP flags for libshell consumers (ksh, shcomp etc.)
LIBSHELLCPPFLAGS = \
+ -I$(LIBSHELLBASE)/$(LIBSHELLMACH)/src/cmd/ksh93 \
+ -I$(LIBSHELLBASE)/common/include \
-I$(ROOT)/usr/include/ast \
-DKSHELL \
-DSHOPT_BRACEPAT \
@@ -52,16 +53,32 @@ LIBSHELLCPPFLAGS = \
-DSHOPT_OPTIMIZE \
-DSHOPT_PFSH \
-DSHOPT_RAWONLY \
+ -DSHOPT_STATS \
-DSHOPT_SUID_EXEC \
-DSHOPT_SYSRC \
+ -DSHOPT_TYPEDEF \
-DSHOPT_VSH \
-D_BLD_shell \
-D_PACKAGE_ast \
+ '-DERROR_CATALOG="libshell"' \
-DERROR_CONTEXT_T=Error_context_t \
'-DUSAGE_LICENSE=\
"[-author?David Korn <dgk@research.att.com>]"\
- "[-copyright?Copyright (c) 1982-2007 AT&T Knowledge Ventures]"\
+ "[-copyright?Copyright (c) 1982-2008 AT&T Intellectual Property]"\
"[-license?http://www.opensource.org/licenses/cpl1.0.txt]"\
"[--catalog?libshell]"'
-
+# Default CFLAGS/CFLAGS64 for AST sources
+# (-xstrconst makes string litereals read-only and -xcsi works
+# around compiler issues)
+ASTCFLAGS = \
+ $(CCVERBOSE) \
+ -_cc=-xcsi \
+ -xstrconst
+ASTCFLAGS64 = \
+ $(CCVERBOSE) \
+ -_cc=-xcsi \
+ -xstrconst
+
+# We need this for C99/VLA support
+DEBUGFORMAT=-xdebugformat=dwarf
diff --git a/usr/src/Makefile.lint b/usr/src/Makefile.lint
index 0b6a7705aa..635ce2f6d9 100644
--- a/usr/src/Makefile.lint
+++ b/usr/src/Makefile.lint
@@ -275,7 +275,6 @@ COMMON_SUBDIRS = \
cmd/strings \
cmd/su \
cmd/sulogin \
- cmd/sum \
cmd/svc \
cmd/swap \
cmd/sync \
diff --git a/usr/src/cmd/Makefile b/usr/src/cmd/Makefile
index ea47c68943..418fb94579 100644
--- a/usr/src/cmd/Makefile
+++ b/usr/src/cmd/Makefile
@@ -366,7 +366,7 @@ COMMON_SUBDIRS= \
setuname \
sgs \
sh \
- sleep \
+ shcomp \
smbios \
smbsrv \
smserverd \
@@ -386,7 +386,6 @@ COMMON_SUBDIRS= \
strings \
su \
sulogin \
- sum \
sunpc \
svc \
swap \
@@ -690,7 +689,7 @@ MSGSUBDIRS= \
sdpadm \
sgs \
sh \
- sleep \
+ shcomp \
sort \
split \
ssh \
@@ -699,7 +698,6 @@ MSGSUBDIRS= \
stmsboot \
strings \
su \
- sum \
svc \
swap \
syseventadm \
@@ -958,6 +956,7 @@ _dc: $(DCSUBDIRS)
# Dependencies
#
fs.d: fstyp
+ksh: shcomp isaexec
$(FIRST_SUBDIRS) $(BWOSDIRS) $(SUBDIRS) $(BSMSUBDIRS) $(MANIFEST_SUBDIRS): FRC
@if [ -f $@/Makefile ]; then \
diff --git a/usr/src/cmd/ast/Makefile b/usr/src/cmd/ast/Makefile
index c2259a2191..501bcfb4b5 100644
--- a/usr/src/cmd/ast/Makefile
+++ b/usr/src/cmd/ast/Makefile
@@ -19,13 +19,11 @@
# CDDL HEADER END
#
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
-SHELL=/usr/bin/ksh
+SHELL=/usr/bin/ksh93
include ../Makefile.cmd
diff --git a/usr/src/cmd/ast/msgcc/Makefile b/usr/src/cmd/ast/msgcc/Makefile
index b11651278a..88713d23dd 100644
--- a/usr/src/cmd/ast/msgcc/Makefile
+++ b/usr/src/cmd/ast/msgcc/Makefile
@@ -19,13 +19,11 @@
# CDDL HEADER END
#
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
-SHELL=/usr/bin/ksh
+SHELL=/usr/bin/ksh93
include ../../Makefile.cmd
@@ -40,26 +38,26 @@ CPPFLAGS = \
-I$(ROOT)/usr/include/ast \
-D_PACKAGE_ast \
'-DUSAGE_LICENSE=\
- "[-author?Glenn Fowler <gsf@research.att.com>]"\
- "[-copyright?Copyright (c) 2000-2007 AT&T Knowledge Ventures]"\
- "[-license?http://www.opensource.org/licenses/cpl1.0.txt]"\
- "[--catalog?msgcc]"'
+ "[-author?Glenn Fowler <gsf@research.att.com>]"\
+ "[-copyright?Copyright (c) 1986-2008 AT&T Intellectual Property]"\
+ "[-license?http://www.opensource.org/licenses/cpl1.0.txt]"\
+ "[--catalog?msgcc]"'
CFLAGS += \
- $(CCVERBOSE) \
- -xstrconst
+ $(ASTCFLAGS)
LDLIBS += -last
msgcpp := LDLIBS += -lpp
+# This target should use "shcomp" in the future
msgcc: msgcc.sh
rm -f msgcc ; \
- ( \
+ { \
print "#!/usr/bin/ksh93" ; \
print "export PATH=/usr/ast/bin:/usr/xpg6/bin:/usr/xpg4/bin:/usr/bin:\$${PATH}" ; \
print "builtin date" ; \
cat "msgcc.sh" ; \
- ) >msgcc ; \
+ } >msgcc ; \
chmod a+rx msgcc
ROOTCMDDIR=$(ROOT)/usr/ast/bin
diff --git a/usr/src/cmd/ast/msgcc/msgcc.sh b/usr/src/cmd/ast/msgcc/msgcc.sh
index aad98f7c1f..3ea55b8dd8 100644
--- a/usr/src/cmd/ast/msgcc/msgcc.sh
+++ b/usr/src/cmd/ast/msgcc/msgcc.sh
@@ -1,10 +1,10 @@
########################################################################
# #
# This software is part of the ast package #
-# Copyright (c) 2000-2007 AT&T Knowledge Ventures #
+# Copyright (c) 2000-2008 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
-# by AT&T Knowledge Ventures #
+# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# http://www.opensource.org/licenses/cpl1.0.txt #
diff --git a/usr/src/cmd/ast/msgcc/msgcpp.c b/usr/src/cmd/ast/msgcc/msgcpp.c
index 677065f6cf..a9bc934313 100644
--- a/usr/src/cmd/ast/msgcc/msgcpp.c
+++ b/usr/src/cmd/ast/msgcc/msgcpp.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 2000-2007 AT&T Knowledge Ventures *
+* Copyright (c) 2000-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/cmd/ast/msgcc/msgcvt.c b/usr/src/cmd/ast/msgcc/msgcvt.c
index 89dd3e848d..d7afe93c82 100644
--- a/usr/src/cmd/ast/msgcc/msgcvt.c
+++ b/usr/src/cmd/ast/msgcc/msgcvt.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 2000-2007 AT&T Knowledge Ventures *
+* Copyright (c) 2000-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/cmd/ast/msgcc/msggen.c b/usr/src/cmd/ast/msgcc/msggen.c
index 5c34d20c40..7961530dc7 100644
--- a/usr/src/cmd/ast/msgcc/msggen.c
+++ b/usr/src/cmd/ast/msgcc/msggen.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 2000-2007 AT&T Knowledge Ventures *
+* Copyright (c) 2000-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/cmd/ast/msgcc/msgget.c b/usr/src/cmd/ast/msgcc/msgget.c
index bd06c6d343..10a389bfeb 100644
--- a/usr/src/cmd/ast/msgcc/msgget.c
+++ b/usr/src/cmd/ast/msgcc/msgget.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 2000-2007 AT&T Knowledge Ventures *
+* Copyright (c) 2000-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/cmd/file/magic b/usr/src/cmd/file/magic
index c7d070562d..fc851dffd4 100644
--- a/usr/src/cmd/file/magic
+++ b/usr/src/cmd/file/magic
@@ -21,8 +21,6 @@
#
# CDDL HEADER END
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# This file contains the dictionary of file format identifiers (magic strings)
# used by file(1). The fields of this file are as follows:
#
@@ -523,6 +521,7 @@
0 string LZ DOS built-in
0 byte 0xe9 DOS executable (COM)
0 byte 0xeb DOS executable (COM)
+0 string \013\023\010\000 ksh compiled shell script executable
24 long 60012 ufsdump archive file
0 string TZif zoneinfo timezone data file
0 string BZh bzip2 compressed data
diff --git a/usr/src/cmd/ksh/Makefile b/usr/src/cmd/ksh/Makefile
index 2412f65264..ae658a020c 100644
--- a/usr/src/cmd/ksh/Makefile
+++ b/usr/src/cmd/ksh/Makefile
@@ -18,19 +18,18 @@
#
# CDDL HEADER END
#
+
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
-SHELL=/usr/bin/ksh
+SHELL=/usr/bin/ksh93
include ../../Makefile.ksh93switch
$(BINKSH_IS_KSH93)PROG= ksh
-$(BINKSH_IS_KSH93)USRKSH_ALIAS_LIST=ksh ksh93 rksh rksh93 pfksh
+$(BINKSH_IS_KSH93)USRKSH_ALIAS_LIST=ksh ksh93 rksh rksh93 pfksh pfksh93 pfrksh pfrksh93
$(BINKSH_ISNOT_KSH93)PROG= ksh93
$(BINKSH_ISNOT_KSH93)USRKSH_ALIAS_LIST=ksh93 rksh93
@@ -40,6 +39,8 @@ include ../Makefile.cmd
SUBDIRS= $(MACH)
$(BUILD64)SUBDIRS += $(MACH64)
+SUBDIRS += builtins
+
# Serialise the build to avoid that we run the test suite for 32bit
# and 64bit in parallel
.NO_PARALLEL: $(SUBDIRS)
@@ -59,17 +60,19 @@ all clean clobber lint testshell: $(SUBDIRS)
# (and "ksh" is just a frontend which calls directly into libshell,
# e.g. there are no l10n strings here)
$(PROG).po:
- $(RM) ksh.po ksh93.po
- touch $(PROG).po
+ $(RM) ksh.po ksh93.po ; \
+ $(TOUCH) $(PROG).po
install: $(ISAEXEC) $(SUBDIRS)
- $(RM) $(ROOTPROG)
- $(LN) $(ISAEXEC) $(ROOTPROG)
@(set -o xtrace ; \
+ builtin ln ; \
+ builtin rm ; \
+ rm -f $(ROOTPROG) ; \
+ ln $(ISAEXEC) $(ROOTPROG) ; \
for i in $(USRKSH_ALIAS_LIST) ; do \
- [[ "$$i" = "$(PROG)" ]] && continue ; \
- $(RM) "$(ROOTBIN)/$$i" ; \
- $(LN) "$(ROOTBIN)/$(PROG)" "$(ROOTBIN)/$$i" ; \
+ [[ "$$i" == "$(PROG)" ]] && continue ; \
+ rm -f "$(ROOTBIN)/$$i" ; \
+ ln "$(ROOTBIN)/$(PROG)" "$(ROOTBIN)/$$i" ; \
done \
)
diff --git a/usr/src/cmd/ksh/Makefile.com b/usr/src/cmd/ksh/Makefile.com
index 3094d06f89..1bfb543ba5 100644
--- a/usr/src/cmd/ksh/Makefile.com
+++ b/usr/src/cmd/ksh/Makefile.com
@@ -18,19 +18,18 @@
#
# CDDL HEADER END
#
+
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
-SHELL=/usr/bin/ksh
+SHELL=/usr/bin/ksh93
include ../../../Makefile.ksh93switch
$(BINKSH_IS_KSH93)PROG= ksh
-$(BINKSH_IS_KSH93)USRKSH_ALIAS_LIST=ksh ksh93 rksh rksh93 pfksh
+$(BINKSH_IS_KSH93)USRKSH_ALIAS_LIST=ksh ksh93 rksh rksh93 pfksh pfksh93 pfrksh pfrksh93
$(BINKSH_ISNOT_KSH93)PROG= ksh93
$(BINKSH_ISNOT_KSH93)USRKSH_ALIAS_LIST=ksh93 rksh93
@@ -38,13 +37,17 @@ $(BINKSH_ISNOT_KSH93)USRKSH_ALIAS_LIST=ksh93 rksh93
OBJECTS= \
pmain.o
-LIBSHELLSRC=../../../lib/libshell/common/sh
+LIBSHELLBASE=../../../lib/libshell
+LIBSHELLSRC=$(LIBSHELLBASE)/common/sh
SRCS= $(OBJECTS:%.o=$(LIBSHELLSRC)/%.c)
GROUP= bin
LDLIBS += -lshell
+# Set common AST build flags (e.g., needed to support the math stuff).
+include ../../../Makefile.ast
+
# 1. Make sure that the -D/-U defines in CFLAGS below are in sync
# with usr/src/lib/libshell/Makefile.com
# 2. We use "=" here since using $(CPPFLAGS.master) is very tricky in our
@@ -57,14 +60,12 @@ CPPFLAGS = \
$(LIBSHELLCPPFLAGS)
CFLAGS += \
- $(CCVERBOSE) \
- -xstrconst
+ $(ASTCFLAGS)
CFLAGS64 += \
- $(CCVERBOSE) \
- -xstrconst
+ $(ASTCFLAGS64)
-# Set common AST build flags (e.g., needed to support the math stuff).
-include ../../../Makefile.ast
+# Workaround for CR#6628728 ("|memcntl()| prototype not available for C99/XPG6")
+pmain.o := CERRWARN += -erroff=E_NO_IMPLICIT_DECL_ALLOWED
.KEEP_STATE:
@@ -98,6 +99,28 @@ CLOBBERFILES += \
ksh \
ksh93
+# Install rule for $(MACH)/Makefile (32bit)
+INSTALL.ksh.32bit=@ \
+ (print "$(POUND_SIGN) Installing 32bit $(PROG) aliases $(USRKSH_ALIAS_LIST)" ; \
+ set -o xtrace ; \
+ for i in $(USRKSH_ALIAS_LIST) ; do \
+ [[ "$$i" == "$(PROG)" ]] && continue ; \
+ $(RM) "$(ROOTBIN32)/$$i" ; \
+ $(LN) "$(ROOTBIN32)/$(PROG)" "$(ROOTBIN32)/$$i" ; \
+ done \
+ )
+
+# Install rule for $(MACH64)/Makefile (64bit)
+INSTALL.ksh.64bit=@ \
+ (print "$(POUND_SIGN) Installing 64bit $(PROG) aliases $(USRKSH_ALIAS_LIST)" ; \
+ set -o xtrace ; \
+ for i in $(USRKSH_ALIAS_LIST) ; do \
+ [[ "$$i" == "$(PROG)" ]] && continue ; \
+ $(RM) "$(ROOTBIN64)/$$i" ; \
+ $(LN) "$(ROOTBIN64)/$(PROG)" "$(ROOTBIN64)/$$i" ; \
+ done \
+ )
+
#
# ksh is not lint-clean yet; fake up a target. (You can use
# "make lintcheck" to actually run lint; please send all lint fixes
@@ -105,6 +128,5 @@ CLOBBERFILES += \
#
lint:
@ print "usr/src/cmd/ksh is not lint-clean: skipping"
- @ $(TRUE)
include ../Makefile.testshell
diff --git a/usr/src/cmd/ksh/Makefile.testshell b/usr/src/cmd/ksh/Makefile.testshell
index 6e9a264f0c..fdad066a57 100644
--- a/usr/src/cmd/ksh/Makefile.testshell
+++ b/usr/src/cmd/ksh/Makefile.testshell
@@ -18,15 +18,16 @@
#
# CDDL HEADER END
#
+
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
#
-# run the ksh93 minimum set of tests
+# Run the ksh93 minimum set of tests
+#
+
#
# Notes:
# - "builtins.sh" may fail in some locales like this:
@@ -43,21 +44,10 @@
# This may be simply a different sort order or a bug in the test suite.
# Currently under investigation.
#
-# - "io.sh" may fail due a subtle bug in ksh93 or the test suite which
-# only happens when ksh93 is NOT called "ksh"; to work around the
-# problem the test sequence currently uses $(SRC)/cmd/ksh/$(CMDTRANSMACH)/ksh
-# instead of $(SRC)/cmd/ksh/$(CMDTRANSMACH)/$(PROG) until we+upstream figure
-# out what exactly is going wrong in this case.
-# -- snip --
-# ./close0[2]: ./close1: cannot execute [Exec format error]
-# io.sh[81]: picked up file descriptor zero for opening script file
-# -- snip --
-#
# - These tests need a working system clock, otherwise they'll bite you.
#
-# - The test frontend in this Makefile should be rewritten in ksh93
-# instead of the current /usr/bin/ksh (=ksh88i). This would be far less
-# complicated.
+# - The current list of locales was mainly composed to cover various encodings
+# and all important markets based on suggestions by Sun's i18n team.
#
# - More locales should be tested here (via ON_KSH_TEST_LOCALES below).
# Locales like "ru_RU.KOI8-R","de_DE.UTF-8", "is_IS.ISO8859-1",
@@ -65,28 +55,28 @@
# that is getting little bit more compliciated because these locales use
# ',' as decimal delimter. The best solution may be to wait for ksh93
# being integrated into OS/Net and then change the test sequence to
-# use ksh93's associate/compound variables (this may require a flag
+# use ksh93's associative/compound variables (this may require a flag
# day... ;-( ).
-# The current list was mainly composed to cover various encodings and
-# all important markets based on suggestions by Sun's i18n team.
#
# - Due to the timing sensitivity of some of the tests, these tests should
# be run on a quiet system with no other activity.
#
-TESTSRC= $(LIBSHELLSRC)/../tests
+TESTSRC= $(LIBSHELLBASE)/common/tests
# ON_KSH_TEST_LOCALES can be overridden via
# $ export ON_KSH_TEST_LOCALES=<value> # before $ make install #
ON_KSH_TEST_LOCALES = \
C \
- en_US en_US.UTF-8 \
+ en_US.UTF-8 en_US en_US.ISO8859-15@euro \
he_IL.UTF-8 \
hi_IN.UTF-8 \
- ja_JP.PCK ja_JP.UTF-8 ja_JP.eucJP \
- ko_KR.EUC \
+ ja ja_JP.PCK ja_JP.UTF-8 ja_JP.eucJP \
+ ko_KR.UTF-8 ko_KR.EUC \
th_TH.TIS620 \
- zh_CN.EUC zh_CN.GBK zh_CN.GB18030 zh_CN.UTF-8 \
+ zh_CN.EUC zh_CN.GBK \
+ zh_CN.GB18030 zh_CN.GB18030@pinyin zh_CN.GB18030@radical zh_CN.GB18030@stroke \
+ zh_CN.UTF-8 zh_CN.UTF-8@pinyin zh_CN.UTF-8@radical zh_CN.UTF-8@stroke \
zh_HK.BIG5HK \
zh_TW.BIG5 zh_TW.EUC zh_TW.UTF-8
@@ -103,61 +93,71 @@ ON_KSH_TEST_IGNORE_TESTFAILURE=false
# test failures).
testshell: $(PROG)
@ \
+ builtin basename ; \
print '# NOTE: Make sure your binaries in ROOT match your kernel!' ; \
( \
set +o errexit ; \
- export PATH="$(SRC)/cmd/ksh/$(CMDTRANSMACH):/bin:/usr/bin" ; \
+ export PATH="$(SRC)/cmd/ksh/$(LIBSHELLMACH):/bin:/usr/bin" ; \
printf "# which ksh='%s', ksh93='%s'\n" \
"$$(which ksh)" "$$(which ksh93)" ; \
) ; \
- if [[ "$$(isalist | fgrep "$(CMDTRANSMACH)")" = "" ]] ; then \
+ if [[ "$$(isalist)" != ~(E)$(LIBSHELLMACH) ]] ; then \
printf \
"# ISA='%s' not available on this system, skipping tests...\n" \
- "$(CMDTRANSMACH)" ; \
+ "$(LIBSHELLMACH)" ; \
exit 0 ; \
fi ; \
- exec 2>&1 ; \
+ print "# Libraries used:" ; \
+ LD_LIBRARY_PATH_64="$(ROOTLIB64)/" \
+ LD_LIBRARY_PATH_32="$(ROOTLIB)/" \
+ LD_LIBRARY_PATH="$(ROOTLIB64)/:$(ROOTLIB)/" \
+ /usr/bin/ldd "$(SRC)/cmd/ksh/$(LIBSHELLMACH)/ksh" ; \
+ print "# Running tests:" ; \
+ redirect 2>&1 ; \
(supported_locales="$$(/usr/bin/locale -a)" ; \
for test_lang in $(ON_KSH_TEST_LOCALES) ; do \
- if [[ "$$(print "$${supported_locales}" | \
- egrep "^$${test_lang}\$$")" = "" ]] ; then \
+ if [[ "$$(egrep "^$${test_lang}\$$" <<< "$${supported_locales}")" == "" ]] ; then \
printf \
"# Locale '%s' not supported, skipping tests...\n" \
"$${test_lang}" ; \
continue ; \
fi ; \
(for test_item in $(ON_KSH_TEST_LIST) ; do \
- [[ "$${test_item}" = "$(TESTSRC)/builtins.sh" || \
- "$${test_item}" = "$(TESTSRC)/options.sh" ]] || \
+ [[ "$${test_item}" == "$(TESTSRC)/builtins.sh" || \
+ "$${test_item}" == "$(TESTSRC)/options.sh" ]] || \
$(ON_KSH_TEST_IGNORE_TESTFAILURE) && \
set +o errexit ; \
- printf \
- "## Running %s test: LANG='%s' script='%s'\n" \
- "$(CMDTRANSMACH)/ksh" \
- "$${test_lang}" \
- "$$(basename "$${test_item}")"; \
- ( \
- test_output="$$( ( \
- export \
- SHELL="$(SRC)/cmd/ksh/$(CMDTRANSMACH)/ksh" \
- LD_LIBRARY_PATH_64="$(ROOTLIB64)/" \
- LD_LIBRARY_PATH_32="$(ROOTLIB)/" ; \
- LD_LIBRARY_PATH="$(ROOTLIB64)/:$(ROOTLIB)/" ; \
- "$${SHELL}" "$(TESTSRC)/shtests" -t \
- LD_LIBRARY_PATH_64="$${LD_LIBRARY_PATH_64}" \
- LD_LIBRARY_PATH_32="$${LD_LIBRARY_PATH_32}" \
- LD_LIBRARY_PATH="$${LD_LIBRARY_PATH}" \
- SHELL="$${SHELL}" \
- LANG="$${test_lang}" \
- LC_ALL="$${test_lang}" \
- "$${test_item}" \
- ) 2>&1 | while read ; do \
- printf "#\t%s\n" "$${REPLY}" ; \
- done | tee /dev/stderr)" ; \
- [[ "$$(print "$${test_output}" | \
- egrep 'passed \[ .* tests 0 errors \]')" != "" ]] || \
- (print "##> test failed" ; exit 1) \
- ) ; \
- set -o errexit ; \
+ for mode in 'plain_script:-s' 'compiled_script:-c' ; do \
+ printf \
+ "## Running %s test: LANG='%s' script='%s', mode='%s'\n" \
+ "$(LIBSHELLMACH)/ksh" \
+ "$${test_lang}" \
+ "$$(basename "$${test_item}")" \
+ "$${mode%:*}"; \
+ ( \
+ test_output="$$( ( \
+ export \
+ SHELL="$(SRC)/cmd/ksh/$(LIBSHELLMACH)/ksh" \
+ LD_LIBRARY_PATH_64="$(ROOTLIB64)/" \
+ LD_LIBRARY_PATH_32="$(ROOTLIB)/" \
+ LD_LIBRARY_PATH="$(ROOTLIB64)/:$(ROOTLIB)/" ; \
+ "$${SHELL}" "$(TESTSRC)/shtests" -t "$${mode#*:}" \
+ LD_LIBRARY_PATH_64="$${LD_LIBRARY_PATH_64}" \
+ LD_LIBRARY_PATH_32="$${LD_LIBRARY_PATH_32}" \
+ LD_LIBRARY_PATH="$${LD_LIBRARY_PATH}" \
+ SHELL="$${SHELL}" \
+ LANG="$${test_lang}" \
+ LC_ALL="$${test_lang}" \
+ VMDEBUG=a \
+ SHCOMP="$(ROOTBIN)/shcomp" \
+ "$${test_item}" \
+ ) 2>&1 | while read ; do \
+ printf "#\t%s\n" "$${REPLY}" ; \
+ done | tee /dev/stderr)" ; \
+ [[ "$${test_output}" == ~(E)test.*passed\ \[\ [[:digit:]]*\ test.*\ 0\ errors\ \] ]] || \
+ (print "##--------> test failed" ; exit 1) \
+ ) ; \
+ done ; \
+ set -o errexit ; \
done) ; \
done)
diff --git a/usr/src/cmd/ksh/amd64/Makefile b/usr/src/cmd/ksh/amd64/Makefile
index 093e92da1e..c6a3da7fe7 100644
--- a/usr/src/cmd/ksh/amd64/Makefile
+++ b/usr/src/cmd/ksh/amd64/Makefile
@@ -18,15 +18,14 @@
#
# CDDL HEADER END
#
+
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
# Specify the MACH we currently use to build and test ksh
-CMDTRANSMACH= $(MACH64)
+LIBSHELLMACH= $(MACH64)
include ../../Makefile.cmd
include ../../Makefile.cmd.64
@@ -34,14 +33,6 @@ include ../../Makefile.cmd.64
include ../Makefile.com
install: all $(ROOTPROG64)
- @ \
- (print "# Installing 64bit $(PROG) aliases $(USRKSH_ALIAS_LIST)" ; \
- set -o xtrace ; \
- for i in $(USRKSH_ALIAS_LIST) ; do \
- [[ "$$i" = "$(PROG)" ]] && continue ; \
- $(RM) "$(ROOTBIN64)/$$i" ; \
- $(LN) "$(ROOTBIN64)/$(PROG)" "$(ROOTBIN64)/$$i" ; \
- done \
- )
+ $(INSTALL.ksh.64bit)
include ../../Makefile.targ
diff --git a/usr/src/cmd/ksh/builtins/Makefile b/usr/src/cmd/ksh/builtins/Makefile
new file mode 100644
index 0000000000..57584c04cc
--- /dev/null
+++ b/usr/src/cmd/ksh/builtins/Makefile
@@ -0,0 +1,76 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+SHELL=/usr/bin/ksh93
+
+PROG= alias
+ALIASPROG= \
+ bg \
+ cd \
+ command \
+ fc \
+ fg \
+ getopts \
+ hash \
+ jobs \
+ kill \
+ read \
+ rev \
+ sleep \
+ sum \
+ test \
+ type \
+ ulimit \
+ umask \
+ unalias \
+ wait
+
+include ../../Makefile.cmd
+
+ROOTALIASPROG= $(ALIASPROG:%=$(ROOTBIN)/%)
+
+FILEMODE= 555
+OWNER= root
+GROUP= bin
+
+.KEEP_STATE:
+
+all: $(PROG)
+
+$(ROOTBIN)/%: $(ROOTBIN)/alias
+ $(INS.link)
+
+# In the future we should replace the "cat" with a call to
+# "shcomp" to compile the script (for better performance).
+$(PROG): alias.sh
+ cat "alias.sh" >"$@"
+
+install: all $(ROOTALIASPROG)
+
+clean clobber:
+ rm -f $(PROG)
+
+lint:
diff --git a/usr/src/cmd/ksh/builtins/alias.sh b/usr/src/cmd/ksh/builtins/alias.sh
new file mode 100644
index 0000000000..e59558d3d0
--- /dev/null
+++ b/usr/src/cmd/ksh/builtins/alias.sh
@@ -0,0 +1,51 @@
+#!/usr/bin/ksh93
+
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+# Get name of builtin
+builtin basename
+typeset cmd="$(basename "$0")"
+
+# If the requested command is not an alias load it explicitly
+# to make sure it is not bound to a path (those built-ins which
+# are mapped via shell aliases point to commands which are
+# "special shell built-ins" which cannot be bound to a specific
+# PATH element) - otherwise we may execute the wrong command
+# if an executable with the same name sits in a PATH element
+# before /usr/bin (e.g. /usr/xpg4/bin/ls would be executed
+# before /usr/bin/ls if would look like
+# PATH=/usr/xpg4/bin:/usr/bin).
+if [[ "${cmd}" != ~(Elr)(alias|unalias|command) ]] && ! alias "${cmd}" >/dev/null 2>&1 ; then
+ builtin "${cmd}"
+fi
+
+# command is a keyword and needs to be handled separately
+if [[ "${cmd}" == "command" ]] ; then
+ command "$@"
+else
+ "${cmd}" "$@"
+fi
diff --git a/usr/src/cmd/ksh/i386/Makefile b/usr/src/cmd/ksh/i386/Makefile
index da5146beb6..5ce68f9ef3 100644
--- a/usr/src/cmd/ksh/i386/Makefile
+++ b/usr/src/cmd/ksh/i386/Makefile
@@ -18,29 +18,20 @@
#
# CDDL HEADER END
#
+
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
# Specify the MACH we currently use to build and test ksh
-CMDTRANSMACH= $(MACH)
+LIBSHELLMACH= $(MACH)
include ../../Makefile.cmd
include ../Makefile.com
install: all $(ROOTPROG32)
- @ \
- (print "# Installing 32bit $(PROG) aliases $(USRKSH_ALIAS_LIST)" ; \
- set -o xtrace ; \
- for i in $(USRKSH_ALIAS_LIST) ; do \
- [[ "$$i" = "$(PROG)" ]] && continue ; \
- $(RM) "$(ROOTBIN32)/$$i" ; \
- $(LN) "$(ROOTBIN32)/$(PROG)" "$(ROOTBIN32)/$$i" ; \
- done \
- )
+ $(INSTALL.ksh.32bit)
include ../../Makefile.targ
diff --git a/usr/src/cmd/ksh/sparc/Makefile b/usr/src/cmd/ksh/sparc/Makefile
index da5146beb6..5ce68f9ef3 100644
--- a/usr/src/cmd/ksh/sparc/Makefile
+++ b/usr/src/cmd/ksh/sparc/Makefile
@@ -18,29 +18,20 @@
#
# CDDL HEADER END
#
+
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
# Specify the MACH we currently use to build and test ksh
-CMDTRANSMACH= $(MACH)
+LIBSHELLMACH= $(MACH)
include ../../Makefile.cmd
include ../Makefile.com
install: all $(ROOTPROG32)
- @ \
- (print "# Installing 32bit $(PROG) aliases $(USRKSH_ALIAS_LIST)" ; \
- set -o xtrace ; \
- for i in $(USRKSH_ALIAS_LIST) ; do \
- [[ "$$i" = "$(PROG)" ]] && continue ; \
- $(RM) "$(ROOTBIN32)/$$i" ; \
- $(LN) "$(ROOTBIN32)/$(PROG)" "$(ROOTBIN32)/$$i" ; \
- done \
- )
+ $(INSTALL.ksh.32bit)
include ../../Makefile.targ
diff --git a/usr/src/cmd/ksh/sparcv9/Makefile b/usr/src/cmd/ksh/sparcv9/Makefile
index 093e92da1e..c6a3da7fe7 100644
--- a/usr/src/cmd/ksh/sparcv9/Makefile
+++ b/usr/src/cmd/ksh/sparcv9/Makefile
@@ -18,15 +18,14 @@
#
# CDDL HEADER END
#
+
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
# Specify the MACH we currently use to build and test ksh
-CMDTRANSMACH= $(MACH64)
+LIBSHELLMACH= $(MACH64)
include ../../Makefile.cmd
include ../../Makefile.cmd.64
@@ -34,14 +33,6 @@ include ../../Makefile.cmd.64
include ../Makefile.com
install: all $(ROOTPROG64)
- @ \
- (print "# Installing 64bit $(PROG) aliases $(USRKSH_ALIAS_LIST)" ; \
- set -o xtrace ; \
- for i in $(USRKSH_ALIAS_LIST) ; do \
- [[ "$$i" = "$(PROG)" ]] && continue ; \
- $(RM) "$(ROOTBIN64)/$$i" ; \
- $(LN) "$(ROOTBIN64)/$(PROG)" "$(ROOTBIN64)/$$i" ; \
- done \
- )
+ $(INSTALL.ksh.64bit)
include ../../Makefile.targ
diff --git a/usr/src/cmd/nsadmin/ksh.kshrc b/usr/src/cmd/nsadmin/ksh.kshrc
index 0622755de0..10da11dbfe 100644
--- a/usr/src/cmd/nsadmin/ksh.kshrc
+++ b/usr/src/cmd/nsadmin/ksh.kshrc
@@ -20,23 +20,60 @@
#
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
#
# This file is sourced by interactive ksh93 shells before ${HOME}/.kshrc
#
-# Enable "gmacs" editor mode if the user did not set an input mode yet
-# (for example via ${EDITOR}, ${VISUAL} or any "set -o" flag)
-if [[ "$(set +o)" != ~(E)--(gmacs|emacs|vi)( |$) ]] ; then
- set -o gmacs
+# Enable "gmacs"+"multiline" editor mode if the user did not set an
+# input mode yet (for example via ${EDITOR}, ${VISUAL} or any
+# "set -o" flag)
+if [[ "$(set +o)" != ~(Er)--(gmacs|emacs|vi)( .*|) ]] ; then
+ set -o gmacs
+ # enable multiline input mode
+ set -o multiline
fi
-
-# enable multiline input mode
-#set -o multiline
-
+# Set a default prompt (<username>@<hostname>:<path><"($|#) ">) if
+# then variable does not exist in the environment.
+#
+# Algorithm:
+# 1. Define "ellipsis", either Unicode #2026 for unicode locales
+# and "..." otherwise
+# ([[ "${LC_ALL}/${LANG}" = ~(Elr)(.*UTF-8/.*|/.*UTF-8) ]]
+# ensures that the pattern matches the leftmost sequence
+# containing *.UTF-8, allowing to match either LC_ALL or
+# LANG when LC_ALL is not set)
+# 2. If PWD is within HOME replace value of HOME with '~'
+# If the PWD is longer than 30 charatcers shorten it to 30 chars
+# print '#' for user "root" and '$' for normal users
+# Notes:
+# - printf "%*s\r%s" COLUMNS "") # is used at the beginning to
+# work around a bug in the "multiline" handling code which
+# causes the shell to override its own prompt when the edit
+# line overflows (this happens if the terminal cursor
+# position is not 0 when PS1 is printed).
+# - PS1 will initially be empty until either...
+# a) ... someone sets the variable
+# or
+# b) ... the prompt is displayed for the first time (default is
+# '$ ' for normal users and '# ' for user "root")
+# - The statement below will not work if someone sources /etc/ksh.kshrc
+# unless PS1 gets "unset" first.
+# - Make sure to use absolute paths (e.g. /usr/bin/hostname) to make
+# sure PS1 works in cases where PATH does not contain /usr/bin/
+if [[ "$(set)" != ~(E)PS1= && "${PS1}" == '' ]] ; then
+ PS1='$(printf "%*s\r%s" COLUMNS "")${LOGNAME}@$(/usr/bin/hostname):$(
+ ellip="$(
+ [[ "${LC_ALL}/${LANG}" == ~(Elr)(.*UTF-8/.*|/.*UTF-8) ]] &&
+ printf "\u[2026]\n" || print "..." )"
+ p="${PWD/~(El)${HOME}/\~}"
+ (( ${#p} > 30 )) &&
+ print -r -n -- "${ellip}${p:${#p}-30:30}" ||
+ print -r -n -- "${p}"
+ [[ "${LOGNAME}" == "root" ]] && print -n "# " || print -n "\$ "
+ )'
+fi
diff --git a/usr/src/cmd/shcomp/Makefile b/usr/src/cmd/shcomp/Makefile
new file mode 100644
index 0000000000..b39cb1d205
--- /dev/null
+++ b/usr/src/cmd/shcomp/Makefile
@@ -0,0 +1,91 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+SHELL=/usr/bin/ksh93
+
+include ../Makefile.cmd
+
+.KEEP_STATE:
+
+# Set common AST build flags (e.g., needed to support the math stuff).
+include ../../Makefile.ast
+
+OBJECTS= \
+ shcomp.o
+
+LIBSHELLMACH=$(MACH)
+LIBSHELLBASE=../../lib/libshell
+LIBSHELLSRC=$(LIBSHELLBASE)/common/sh
+
+SRCS= $(OBJECTS:%.o=$(LIBSHELLSRC)/%.c)
+
+GROUP= bin
+LDLIBS += -lshell -last
+
+# 1. Make sure that the -D/-U defines in CFLAGS below are in sync
+# with usr/src/lib/libshell/Makefile.com
+# 2. We use "=" here since using $(CPPFLAGS.master) is very tricky in our
+# case - it MUST come as the last element but future changes in -D options
+# may then cause silent breakage in the AST sources because the last -D
+# option specified overrides previous -D options so we prefer the current
+# way to explicitly list each single flag.
+CPPFLAGS = \
+ $(DTEXTDOM) $(DTS_ERRNO) \
+ $(LIBSHELLCPPFLAGS)
+
+CFLAGS += \
+ $(ASTCFLAGS)
+CFLAGS64 += \
+ $(ASTCFLAGS64)
+
+ROOTCMDDIR=$(ROOT)/usr/bin
+
+PROG= shcomp
+
+%.o: $(LIBSHELLSRC)/%.c
+ $(COMPILE.c) -c -o $@ $<
+ $(POST_PROCESS_O)
+
+all: $(PROG)
+
+# dummy file since AST/ksh/shcomp doesn't use *.po files
+# (and "shcomp" is just a frontend which calls directly into libshell,
+# e.g. there are no l10n strings here)
+$(PROG).po:
+ $(RM) $(PROG).po ; \
+ $(TOUCH) $(PROG).po
+
+
+install: all $(ROOTCMD)
+
+$(PROG): $(OBJECTS)
+ $(RM) shcomp
+ $(LINK.c) $(OBJECTS) -o $@ $(LDLIBS)
+ $(POST_PROCESS)
+
+clean lint:
+
+include ../Makefile.targ
diff --git a/usr/src/cmd/sleep/sleep.c b/usr/src/cmd/sleep/sleep.c
deleted file mode 100644
index b796227c3f..0000000000
--- a/usr/src/cmd/sleep/sleep.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
-
-
-#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.3 */
-/*
-** sleep -- suspend execution for an interval
-**
-** sleep time
-*/
-
-#include <stdio.h>
-#include <signal.h>
-#include <locale.h>
-#include <unistd.h>
-#include <limits.h>
-#include <stdlib.h>
-
-static void catch_sig(int sig);
-
-int
-main(int argc, char **argv)
-{
- unsigned long n;
- unsigned long leftover;
- int c;
- char *s;
-
- n = 0;
- (void) setlocale(LC_ALL, "");
-#if !defined(TEXT_DOMAIN) /* Should be defined by cc -D */
-#define TEXT_DOMAIN "SYS_TEST" /* Use this only if it weren't */
-#endif
- (void) textdomain(TEXT_DOMAIN);
- while ((c = getopt(argc, argv, "")) != -1)
- switch (c) {
- case '?':
- (void) fprintf(stderr, gettext("usage: sleep time\n"));
- (void) exit(2);
- }
- argc -= optind-1;
- argv += optind-1;
- if (argc < 2) {
- (void) fprintf(stderr, gettext("usage: sleep time\n"));
- (void) exit(2);
- }
-
- /*
- * XCU4: utility must terminate with zero exit status upon receiving
- * SIGALRM signal
- */
-
- signal(SIGALRM, catch_sig);
- s = argv[1];
- while (c = *s++) {
- if (c < '0' || c > '9') {
- (void) fprintf(stderr,
- gettext("sleep: bad character in argument\n"));
- (void) exit(2);
- }
- n = n*10 + c - '0';
- }
-
- /*
- * to fix - sleep fails silently when on "long sleep" BUG: 1164064.
- * logic is to repeatedly sleep for unslept remaining time after sleep
- * of USHRT_MAX seconds, via reset and repeat call to sleep()
- * library routine until there is none remaining time to sleep.
- *
- * The fix for 1164064 introduced bug 1263997 : This is a fix for
- * these problems.
- */
-
- leftover = 0;
- while (n != 0) {
- if (n >= USHRT_MAX) {
- leftover = n - USHRT_MAX;
- leftover += sleep(USHRT_MAX);
- }
- else {
- leftover = sleep(n);
- }
- n = leftover;
- }
- return (0);
-}
-
-static void
-catch_sig(int sig)
-{
-}
diff --git a/usr/src/cmd/sum/sum.c b/usr/src/cmd/sum/sum.c
deleted file mode 100644
index b4716d262b..0000000000
--- a/usr/src/cmd/sum/sum.c
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-/*
- * Sum bytes in file mod 2^16
- */
-
-
-#define TRUE 1
-#define FALSE 0
-#define WDMSK 0177777L
-#define BUFSIZE 512
-#include <locale.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <errno.h>
-#include <string.h>
-
-static void usage(void);
-
-struct part {
- short unsigned hi, lo;
-};
-
-int
-main(int argc, char **argv)
-{
- int ca;
- int i = 0;
- int alg = 0;
- char errflg = FALSE;
- int c;
- FILE *f;
- long long nbytes;
- unsigned int sum;
- unsigned int lsavhi;
- unsigned int lsavlo;
-
- union hilo { /* this only works right in case short is 1/2 of long */
- struct part hl;
- long lg;
- } tempa, suma;
-
- (void) setlocale(LC_ALL, "");
-#if !defined(TEXT_DOMAIN) /* Should be defined by cc -D */
-#define TEXT_DOMAIN "SYS_TEST" /* Use this only if it weren't */
-#endif
- (void) textdomain(TEXT_DOMAIN);
-
- while ((c = getopt(argc, argv, "r")) != EOF)
- switch (c) {
- case 'r':
- alg = 1;
- break;
- case '?':
- usage();
- }
-
- argc -= optind;
- argv = &argv[optind];
-
- do {
- if (i < argc) {
- if ((f = fopen(argv[i], "r")) == NULL) {
- (void) fprintf(stderr, "sum: %s ", argv[i]);
- perror("");
- errflg = TRUE;
- continue;
- }
- } else
- f = stdin;
- sum = 0;
- suma.lg = 0;
- nbytes = 0;
- if (alg == 1) {
- while ((c = getc(f)) != EOF) {
- nbytes++;
- if (sum & 01)
- sum = (sum >> 1) + 0x8000;
- else
- sum >>= 1;
- sum += c;
- sum &= 0xFFFF;
- }
- } else {
- while ((ca = getc(f)) != EOF) {
- nbytes++;
- suma.lg += ca & WDMSK;
- }
- }
- if (ferror(f)) {
- errflg = TRUE;
- (void) fprintf(stderr, gettext("sum: read error "
- "on '%s': %s\n"), (argc > 0) ? argv[i] : "-",
- strerror(errno));
- }
- if (alg == 1)
- (void) printf("%.5u %6lld", sum,
- (nbytes+BUFSIZE-1)/BUFSIZE);
- else {
- tempa.lg = (suma.hl.lo & WDMSK) + (suma.hl.hi & WDMSK);
- lsavhi = (unsigned)tempa.hl.hi;
- lsavlo = (unsigned)tempa.hl.lo;
- (void) printf("%u %lld", (unsigned)(lsavhi + lsavlo),
- (nbytes+BUFSIZE-1)/BUFSIZE);
- }
- if (argc > 0)
- (void) printf(" %s",
- (argv[i] == (char *)0) ? "" : argv[i]);
- (void) printf("\n");
- (void) fclose(f);
- } while (++i < argc);
- return (errflg);
-}
-
-static void
-usage(void)
-{
- (void) fprintf(stderr, gettext("usage: sum [-r] [file...]\n"));
- exit(2);
-}
diff --git a/usr/src/lib/Makefile b/usr/src/lib/Makefile
index 79dde3883a..153635bd2d 100644
--- a/usr/src/lib/Makefile
+++ b/usr/src/lib/Makefile
@@ -84,6 +84,7 @@ SUBDIRS += \
libdll \
libcmd \
libshell \
+ libsum \
librt \
libadm \
libctf \
@@ -328,6 +329,7 @@ MSGSUBDIRS= \
libslp \
libsmbfs \
libsmedia \
+ libsum \
libtsol \
libuutil \
libvscan \
@@ -428,6 +430,7 @@ HDRSUBDIRS= \
libsmedia \
libsqlite \
libstmf \
+ libsum \
libsysevent \
libtecla \
libtnf \
@@ -532,7 +535,7 @@ libast: libsocket
libadutils: libldap5 libidmap
nsswitch: libadutils
libbsm: libtsol
-libcmd: libast libsocket libnsl
+libcmd: libsum libast libsocket libnsl
libcmdutils: libavl
libcontract: libnvpair
libdevid: libdevinfo
@@ -567,6 +570,7 @@ libshell: libast libcmd libdll libsocket libsecdb
libsip: libmd5
libsmbfs: libsocket libnsl libkrb5
libsocket: libnsl
+libsum: libast
libldap5: libsasl libsocket libnsl libmd
libsldap: libldap5 libtsol libnsl libc libscf libresolv
libpool: libnvpair libexacct
diff --git a/usr/src/lib/Makefile.asthdr b/usr/src/lib/Makefile.asthdr
index defc22d4cc..4e69621e56 100644
--- a/usr/src/lib/Makefile.asthdr
+++ b/usr/src/lib/Makefile.asthdr
@@ -18,12 +18,11 @@
#
# CDDL HEADER END
#
+
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
# Note: libast headers are generated by the AST build system outside OS/Net
# (and then copied here) and depend on the architecture (e.g. "i386", "amd64",
@@ -52,34 +51,33 @@ $(INTEL_BLD)AST64BITCPPSYMBOL = __amd64
# "/usr/bin/diff -D <64bit>" (and for some exceptions a manual path) to
# generate an unified version of the include files (and add a boilerplate text
# which explains the interface stability status).
-# ToDo: Rewrite this in ksh93 to simplify the boilerplate generation
$(ROOTHDRDIR)/%: $(HDRDIR32)/% $(HDRDIR64)/%
@mkdir -p tmpastinclude ; \
- boilerplate="" \
- boilerplate="$${boilerplate}/*\n" \
- boilerplate="$${boilerplate} * BEGIN OpenSolaris section\n" \
- boilerplate="$${boilerplate} * This is an unstable interface; changes may be made\n" \
- boilerplate="$${boilerplate} * without notice.\n" \
- boilerplate="$${boilerplate} * END OpenSolaris section\n" \
- boilerplate="$${boilerplate} */\n" ; \
- if [[ "$(@F)" = "ast_limits.h" || \
- "$(@F)" = "ast_dirent.h" ]] ; then \
- print "# Building (concatenation) $(@F)" ; \
- ( \
+ typeset boilerplate="" ; \
+ boilerplate+="/*\n" \
+ boilerplate+=" * BEGIN OpenSolaris section\n" \
+ boilerplate+=" * This is an unstable interface; changes may be made\n" \
+ boilerplate+=" * without notice.\n" \
+ boilerplate+=" * END OpenSolaris section\n" \
+ boilerplate+=" */\n" ; \
+ if [[ "$(@F)" == "ast_limits.h" || \
+ "$(@F)" == "ast_dirent.h" ]] ; then \
+ printf "# Building (concatenation) %s\n" "$(@F)" ; \
+ { \
print -n "$${boilerplate}" ; \
- print '#ifndef $(AST64BITCPPSYMBOL)' ; \
- cat "$(HDRDIR32)/$(@F)" ; \
- print '#else /* $(AST64BITCPPSYMBOL) */' ; \
- cat "$(HDRDIR64)/$(@F)" ; \
- print '#endif /* $(AST64BITCPPSYMBOL) */' ; \
- ) >"tmpastinclude/$(@F)" ; \
+ printf '#ifndef %s\n' "$(AST64BITCPPSYMBOL)" ; \
+ cat "$(HDRDIR32)/$(@F)" ; \
+ printf '#else /* %s */\n' "$(AST64BITCPPSYMBOL)" ; \
+ cat "$(HDRDIR64)/$(@F)" ; \
+ printf '#endif /* %s */\n' "$(AST64BITCPPSYMBOL)" ; \
+ } >"tmpastinclude/$(@F)" ; \
else \
- print "# Building (diff) $(@F)" ; \
- ( \
+ printf "# Building (diff) %s\n" "$(@F)"; \
+ { \
set +o errexit ; \
print -n "$${boilerplate}" ; \
/usr/bin/diff -D $(AST64BITCPPSYMBOL) "$(HDRDIR32)/$(@F)" "$(HDRDIR64)/$(@F)" ; true ;\
- ) >"tmpastinclude/$(@F)" ; \
+ } >"tmpastinclude/$(@F)" ; \
fi
$(INS) -s -m $(FILEMODE) -f $(@D) "tmpastinclude/$(@F)"
diff --git a/usr/src/lib/Makefile.astmsg b/usr/src/lib/Makefile.astmsg
index 68eb5bf16f..096805e825 100644
--- a/usr/src/lib/Makefile.astmsg
+++ b/usr/src/lib/Makefile.astmsg
@@ -18,12 +18,11 @@
#
# CDDL HEADER END
#
+
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
#
# Temporarily control building AST l10n catalogs until all build
@@ -32,8 +31,8 @@
# Should we build AST l10n catalogs ?
# This can be overridden at build time via:
-# $ export ON_BUILD_AST_L10N_CATALOGS=1
-ON_BUILD_AST_L10N_CATALOGS=0
+# $ export ON_BUILD_AST_L10N_CATALOGS=0
+ON_BUILD_AST_L10N_CATALOGS=1
DO_BUILD_AST_CATALOGS_1= $(ON_BUILD_AST_L10N_CATALOGS:0=$(POUND_SIGN))
DONT_BUILD_AST_CATALOGS_1= $(ON_BUILD_AST_L10N_CATALOGS:1=$(POUND_SIGN))
@@ -47,12 +46,9 @@ DONT_BUILD_AST_CATALOGS= $(DONT_BUILD_AST_CATALOGS_1:0=)
MSGLIBNAME= $(LIBRARY:.a=)
ASTMSGCATALOG= $(ROOT)/usr/lib/locale/C/LC_MESSAGES/$(MSGLIBNAME)
-# We can't support LD_LIBRARY_PATH/ROOT hacks that attempt to run software
-# out of the proto area.
$(DO_BUILD_AST_CATALOGS)ASTMSGCC= \
- PATH="$(ROOT)/usr/ast/bin/:/bin:/usr/bin" \
- LD_LIBRARY_PATH="$(ROOT)/usr/lib/$(MACH64):$(ROOT)/usr/lib/" \
- "$(ROOT)/bin/ksh93" "$(ROOT)/usr/ast/bin/msgcc" >>msgcc.out 2>&1
+ PATH="/usr/ast/bin/:/bin:/usr/bin" \
+ /usr/bin/ksh93 /usr/ast/bin/msgcc >>msgcc.out 2>&1
ASTMSGS= $(OBJECTS:%.o=msgs/%.mso)
diff --git a/usr/src/lib/libast/Makefile b/usr/src/lib/libast/Makefile
index 65a4302008..2cd1e2bdf3 100644
--- a/usr/src/lib/libast/Makefile
+++ b/usr/src/lib/libast/Makefile
@@ -18,14 +18,13 @@
#
# CDDL HEADER END
#
+
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
-SHELL=/usr/bin/ksh
+SHELL=/usr/bin/ksh93
include ../Makefile.lib
@@ -62,6 +61,8 @@ HDRS= \
ast_map.h \
ast_mmap.h \
ast_mode.h \
+ ast_namval.h \
+ ast_ndbm.h \
ast_nl_types.h \
ast_param.h \
ast_standards.h \
@@ -70,7 +71,6 @@ HDRS= \
ast_sys.h \
ast_time.h \
ast_tty.h \
- ast_types.h \
ast_version.h \
ast_vfork.h \
ast_wait.h \
@@ -98,6 +98,7 @@ HDRS= \
hashkey.h \
hashpart.h \
iconv.h \
+ ip6.h \
lc.h \
ls.h \
magic.h \
@@ -121,6 +122,7 @@ HDRS= \
sfio_s.h \
sfio_t.h \
sfio.h \
+ shcmd.h \
sig.h \
stack.h \
stak.h \
diff --git a/usr/src/lib/libast/Makefile.com b/usr/src/lib/libast/Makefile.com
index 1f490de47c..2e6d4c457b 100644
--- a/usr/src/lib/libast/Makefile.com
+++ b/usr/src/lib/libast/Makefile.com
@@ -18,14 +18,13 @@
#
# CDDL HEADER END
#
+
#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
-SHELL=/usr/bin/ksh
+SHELL=/usr/bin/ksh93
LIBRARY= libast.a
VERS= .1
@@ -179,6 +178,9 @@ OBJECTS += \
common/hash/strhash.o \
common/hash/strkey.o \
common/hash/strsum.o \
+ common/misc/astintercept.o \
+ common/misc/debug.o \
+ common/misc/cmdarg.o \
common/misc/error.o \
common/misc/errorf.o \
common/misc/errormsg.o \
@@ -190,6 +192,7 @@ OBJECTS += \
common/misc/ftwalk.o \
common/misc/ftwflags.o \
common/misc/getcwd.o \
+ common/misc/getenv.o \
common/misc/glob.o \
common/misc/liberror.o \
common/misc/libevent.o \
@@ -199,6 +202,7 @@ OBJECTS += \
common/misc/optesc.o \
common/misc/optget.o \
common/misc/optjoin.o \
+ common/misc/optctx.o \
common/misc/procclose.o \
common/misc/procfree.o \
common/misc/procopen.o \
@@ -378,6 +382,7 @@ OBJECTS += \
common/stdio/fgetwc.o \
common/stdio/fgetws.o \
common/stdio/fileno.o \
+ common/stdio/flockfile.o \
common/stdio/fopen.o \
common/stdio/fprintf.o \
common/stdio/fpurge.o \
@@ -385,6 +390,7 @@ OBJECTS += \
common/stdio/fputs.o \
common/stdio/fputwc.o \
common/stdio/fputws.o \
+ common/stdio/funlockfile.o \
common/stdio/fread.o \
common/stdio/freopen.o \
common/stdio/fscanf.o \
@@ -393,6 +399,7 @@ OBJECTS += \
common/stdio/fsetpos.o \
common/stdio/ftell.o \
common/stdio/ftello.o \
+ common/stdio/ftrylockfile.o \
common/stdio/fwide.o \
common/stdio/fwprintf.o \
common/stdio/fwrite.o \
@@ -461,6 +468,7 @@ OBJECTS += \
common/string/fmtgid.o \
common/string/fmtident.o \
common/string/fmtip4.o \
+ common/string/fmtip6.o \
common/string/fmtls.o \
common/string/fmtmatch.o \
common/string/fmtmode.o \
@@ -498,7 +506,9 @@ OBJECTS += \
common/string/strntol.o \
common/string/strntold.o \
common/string/strntoll.o \
+ common/string/strnton.o \
common/string/strntoul.o \
+ common/string/strntonll.o \
common/string/strntoull.o \
common/string/stropt.o \
common/string/strperm.o \
@@ -507,6 +517,7 @@ OBJECTS += \
common/string/strsort.o \
common/string/strtape.o \
common/string/strtoip4.o \
+ common/string/strtoip6.o \
common/string/strton.o \
common/string/strtonll.o \
common/string/struid.o \
@@ -646,7 +657,7 @@ include ../../Makefile.lib
# automated code updates easier.
MAPFILES= ../mapfile-vers
-# Set common AST build flags (e.g., needed to support the math stuff).
+# Set common AST build flags (e.g. C99/XPG6, needed to support the math stuff)
include ../../../Makefile.ast
# special rule because sources live both ../common (normal)
@@ -655,7 +666,10 @@ SRCS= $(OBJECTS:%.o=../%.c)
LIBS = $(DYNLIB) $(LINTLIB)
-LDLIBS += -lsocket -lm -lc
+LDLIBS += \
+ -lsocket \
+ -lm \
+ -lc
$(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC)
@@ -690,35 +704,32 @@ CPPFLAGS = \
'-DCONF_LIBSUFFIX=".so"' \
'-DCONF_LIBPREFIX="lib"' \
-DERROR_CATALOG=\""libast"\" \
- -D__OBSOLETE__=20060101 \
+ -D__OBSOLETE__=20080101 \
-D_BLD_ast \
-D_PACKAGE_ast \
-D_BLD_DLL
CFLAGS += \
- $(CCVERBOSE) \
- -xstrconst
+ $(ASTCFLAGS)
CFLAGS64 += \
- $(CCVERBOSE) \
- -xstrconst
+ $(ASTCFLAGS64)
-pics/$(MACH)/src/lib/libast/conftab.o := CERRWARN += -erroff=E_C99_INTEGER_PROMOTION
pics/$(MACH)/src/lib/libast/conftab.o \
pics/$(MACH64)/src/lib/libast/conftab.o := CERRWARN += -erroff=E_INIT_DOES_NOT_FIT
+pics/common/comp/setlocale.o := CERRWARN += -erroff=E_INTEGER_OVERFLOW_DETECTED
+pics/common/comp/setlocale.o := CERRWARN += -erroff=E_INIT_DOES_NOT_FIT
pics/common/hash/hashlook.o := CERRWARN += -erroff=E_CONST_PROMOTED_UNSIGNED_LONG
pics/common/hash/memhash.o := CERRWARN += -erroff=E_CONST_PROMOTED_UNSIGNED_LONG
pics/common/hash/memsum.o := CERRWARN += -erroff=E_CONST_PROMOTED_UNSIGNED_LONG
pics/common/hash/strhash.o := CERRWARN += -erroff=E_CONST_PROMOTED_UNSIGNED_LONG
pics/common/hash/strsum.o := CERRWARN += -erroff=E_CONST_PROMOTED_UNSIGNED_LONG
-pics/common/path/pathkey.o := CERRWARN += -erroff=E_CONST_PROMOTED_UNSIGNED_LONG
-pics/common/comp/setlocale.o := CERRWARN += -erroff=E_INTEGER_OVERFLOW_DETECTED
-pics/common/comp/setlocale.o := CERRWARN += -erroff=E_INIT_DOES_NOT_FIT
-pics/common/misc/translate.o := CERRWARN += -erroff=E_INTEGER_OVERFLOW_DETECTED
pics/common/misc/recstr.o := CERRWARN += -erroff=E_INTEGER_OVERFLOW_DETECTED
+pics/common/misc/translate.o := CERRWARN += -erroff=E_INTEGER_OVERFLOW_DETECTED
+pics/common/path/pathkey.o := CERRWARN += -erroff=E_CONST_PROMOTED_UNSIGNED_LONG
+pics/common/port/astconf.o := CERRWARN += -erroff=E_CONST_OBJ_SHOULD_HAVE_INITIZR
pics/common/sfio/sfmove.o := CERRWARN += -erroff=E_NO_IMPLICIT_DECL_ALLOWED
pics/common/sfio/sfrd.o := CERRWARN += -erroff=E_NO_IMPLICIT_DECL_ALLOWED
pics/common/sfio/sfvscanf.o := CERRWARN += -erroff=E_END_OF_LOOP_CODE_NOT_REACHED
-pics/common/port/astconf.o := CERRWARN += -erroff=E_CONST_OBJ_SHOULD_HAVE_INITIZR
.KEEP_STATE:
@@ -731,6 +742,5 @@ all: mkpicdirs .WAIT $(LIBS)
#
lint:
@ print "usr/src/lib/libast is not lint-clean: skipping"
- @ $(TRUE)
include ../../Makefile.targ
diff --git a/usr/src/lib/libast/amd64/Makefile b/usr/src/lib/libast/amd64/Makefile
index f2819b166d..0419980509 100644
--- a/usr/src/lib/libast/amd64/Makefile
+++ b/usr/src/lib/libast/amd64/Makefile
@@ -18,12 +18,11 @@
#
# CDDL HEADER END
#
+
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
# Platform-specific config
# Note that "HOSTTYPE" matches the value used by AT&T upstream.
@@ -31,7 +30,8 @@ ASTPLATFORMCPPFLAGS = '-DHOSTTYPE="sol$(RELEASE_MINOR).i386"'
# platform-specific sources
OBJECTS = \
- amd64/src/lib/libast/conftab.o
+ amd64/src/lib/libast/conftab.o \
+ amd64/src/lib/libast/lctab.o
OBJDIRS = \
amd64/src/lib/libast
diff --git a/usr/src/lib/libast/amd64/include/ast/align.h b/usr/src/lib/libast/amd64/include/ast/align.h
index 2e9d6bdda8..c44968a29e 100644
--- a/usr/src/lib/libast/amd64/include/ast/align.h
+++ b/usr/src/lib/libast/amd64/include/ast/align.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/align.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/align.c by iffe version 2008-01-31 : : */
#ifndef _def_align_ast
#define _def_align_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/include/ast/ast.h b/usr/src/lib/libast/amd64/include/ast/ast.h
index ea1569f946..f5335ae8a2 100644
--- a/usr/src/lib/libast/amd64/include/ast/ast.h
+++ b/usr/src/lib/libast/amd64/include/ast/ast.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -333,7 +333,9 @@ extern __MANGLE__ double strntod __PROTO__((const char*, size_t, char**));
extern __MANGLE__ _ast_fltmax_t strntold __PROTO__((const char*, size_t, char**));
extern __MANGLE__ long strntol __PROTO__((const char*, size_t, char**, int));
extern __MANGLE__ intmax_t strntoll __PROTO__((const char*, size_t, char**, int));
+extern __MANGLE__ long strnton __PROTO__((const char*, size_t, char**, char*, int));
extern __MANGLE__ unsigned long strntoul __PROTO__((const char*, size_t, char**, int));
+extern __MANGLE__ intmax_t strntonll __PROTO__((const char*, size_t, char**, char*, int));
extern __MANGLE__ uintmax_t strntoull __PROTO__((const char*, size_t, char**, int));
extern __MANGLE__ int stropt __PROTO__((const char*, const __V_*, int, int(*)(__V_*, const __V_*, int, const char*), __V_*));
extern __MANGLE__ int strperm __PROTO__((const char*, char**, int));
diff --git a/usr/src/lib/libast/amd64/include/ast/ast_botch.h b/usr/src/lib/libast/amd64/include/ast/ast_botch.h
index 2c136acb13..3376769248 100644
--- a/usr/src/lib/libast/amd64/include/ast/ast_botch.h
+++ b/usr/src/lib/libast/amd64/include/ast/ast_botch.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/botch.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/botch.c by iffe version 2008-01-31 : : */
#ifndef _def_botch_ast
#define _def_botch_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/include/ast/ast_ccode.h b/usr/src/lib/libast/amd64/include/ast/ast_ccode.h
index 96a54d2381..d9d4a0e0ef 100644
--- a/usr/src/lib/libast/amd64/include/ast/ast_ccode.h
+++ b/usr/src/lib/libast/amd64/include/ast/ast_ccode.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/ccode by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/ccode by iffe version 2008-01-31 : : */
#ifndef _def_ccode_ast
#define _def_ccode_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/include/ast/ast_common.h b/usr/src/lib/libast/amd64/include/ast/ast_common.h
index 3354b1dd8d..aaeba13c81 100644
--- a/usr/src/lib/libast/amd64/include/ast/ast_common.h
+++ b/usr/src/lib/libast/amd64/include/ast/ast_common.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/common by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/common by iffe version 2008-01-31 : : */
#ifndef _AST_COMMON_H
#define _AST_COMMON_H 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/include/ast/ast_dir.h b/usr/src/lib/libast/amd64/include/ast/ast_dir.h
index 336b7f38a6..a402906410 100644
--- a/usr/src/lib/libast/amd64/include/ast/ast_dir.h
+++ b/usr/src/lib/libast/amd64/include/ast/ast_dir.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/ast_dirent.h b/usr/src/lib/libast/amd64/include/ast/ast_dirent.h
index 55c226bc01..b126d86393 100644
--- a/usr/src/lib/libast/amd64/include/ast/ast_dirent.h
+++ b/usr/src/lib/libast/amd64/include/ast/ast_dirent.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/dirent by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/dirent by iffe version 2008-01-31 : : */
#ifndef _def_dirent_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/amd64/include/ast/ast_fcntl.h b/usr/src/lib/libast/amd64/include/ast/ast_fcntl.h
index 271e6a1c0e..6cdbd58151 100644
--- a/usr/src/lib/libast/amd64/include/ast/ast_fcntl.h
+++ b/usr/src/lib/libast/amd64/include/ast/ast_fcntl.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/fcntl.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/fcntl.c by iffe version 2008-01-31 : : */
#ifndef _def_fcntl_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
diff --git a/usr/src/lib/libast/amd64/include/ast/ast_float.h b/usr/src/lib/libast/amd64/include/ast/ast_float.h
index 844f02c25a..80a62a3376 100644
--- a/usr/src/lib/libast/amd64/include/ast/ast_float.h
+++ b/usr/src/lib/libast/amd64/include/ast/ast_float.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/float by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/float by iffe version 2008-01-31 : : */
#ifndef _def_float_ast
#if !defined(__PROTO__)
@@ -89,13 +89,16 @@
#define _hdr_math 1 /* #include <math.h> ok */
#define _hdr_values 1 /* #include <values.h> ok */
#define _LIB_m 1 /* -lm is a library */
+#define _lib_fpclassify 1 /* fpclassify() in default lib(s) */
#define _lib_frexp 1 /* frexp() in default lib(s) */
#define _lib_frexpl 1 /* frexpl() in default lib(s) */
#define _lib_ldexp 1 /* ldexp() in default lib(s) */
#define _lib_ldexpl 1 /* ldexpl() in default lib(s) */
#define _lib_finite 1 /* finite() in default lib(s) */
+#define _lib_isinf 1 /* isinf() in default lib(s) */
#define _lib_isnan 1 /* isnan() in default lib(s) */
#define _lib_isnanl 1 /* isnanl() in default lib(s) */
+#define _lib_signbit 1 /* signbit() in default lib(s) */
#define _lib_copysign 1 /* copysign() in default lib(s) */
#define _lib_copysignl 1 /* copysignl() in default lib(s) */
#include <ast_common.h>
diff --git a/usr/src/lib/libast/amd64/include/ast/ast_fs.h b/usr/src/lib/libast/amd64/include/ast/ast_fs.h
index 344cf98089..a699e1dc11 100644
--- a/usr/src/lib/libast/amd64/include/ast/ast_fs.h
+++ b/usr/src/lib/libast/amd64/include/ast/ast_fs.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/fs by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/fs by iffe version 2008-01-31 : : */
#ifndef _def_fs_ast
#if !defined(__PROTO__)
@@ -89,20 +89,9 @@
#define _lib_mknod 1 /* mknod() in default lib(s) */
#define _lib_sync 1 /* sync() in default lib(s) */
#include <sys/stat.h>
+#include <sys/mkdev.h>
#define FS_default "ufs"
#if defined(__STDPP__directive) && defined(__STDPP__initial)
-__STDPP__directive pragma pp:initial
-#endif
-#ifndef major
-#define major(x) ( major_t ) ( ( ( ( unsigned ) ( ( x ) ) ) >> 8 ) & 0x7f )
-#endif
-#ifndef minor
-#define minor(x) ( minor_t ) ( ( ( x ) ) & 0xff )
-#endif
-#ifndef makedev
-#define makedev(x,y) ( unsigned short ) ( ( ( ( x ) ) << 8 ) | ( ( ( y ) ) & 0xff ) )
-#endif
-#if defined(__STDPP__directive) && defined(__STDPP__initial)
__STDPP__directive pragma pp:noinitial
#endif
#define _hdr_stdio 1 /* #include <stdio.h> ok */
diff --git a/usr/src/lib/libast/amd64/include/ast/ast_getopt.h b/usr/src/lib/libast/amd64/include/ast/ast_getopt.h
index 0de85c6172..060c18a246 100644
--- a/usr/src/lib/libast/amd64/include/ast/ast_getopt.h
+++ b/usr/src/lib/libast/amd64/include/ast/ast_getopt.h
@@ -1,39 +1,17 @@
/* : : generated by proto : : */
-/***********************************************************************
-* *
-* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
-* and is licensed under the *
-* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
-* *
-* A copy of the License is available at *
-* http://www.opensource.org/licenses/cpl1.0.txt *
-* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
-* *
-* Information and Software Systems Research *
-* AT&T Research *
-* Florham Park NJ *
-* *
-* Glenn Fowler <gsf@research.att.com> *
-* David Korn <dgk@research.att.com> *
-* Phong Vo <kpv@research.att.com> *
-* *
-***********************************************************************/
-
-/*
- * legacy standard getopt interface
- */
-#ifndef _AST_GETOPT_H
#if !defined(__PROTO__)
#include <prototyped.h>
#endif
#if !defined(__LINKAGE__)
#define __LINKAGE__ /* 2004-08-11 transition */
#endif
-
+#ifdef _AST_STD_I
+#undef _AST_GETOPT_H
+#define _AST_GETOPT_H -1
+#endif
+#ifndef _AST_GETOPT_H
#define _AST_GETOPT_H 1
extern __MANGLE__ int opterr;
diff --git a/usr/src/lib/libast/amd64/include/ast/ast_iconv.h b/usr/src/lib/libast/amd64/include/ast/ast_iconv.h
index 04a18320d1..87d224ef6a 100644
--- a/usr/src/lib/libast/amd64/include/ast/ast_iconv.h
+++ b/usr/src/lib/libast/amd64/include/ast/ast_iconv.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/iconv by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/iconv by iffe version 2008-01-31 : : */
#ifndef _def_iconv_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/amd64/include/ast/ast_lib.h b/usr/src/lib/libast/amd64/include/ast/ast_lib.h
index f493d01f09..5c57f0076e 100644
--- a/usr/src/lib/libast/amd64/include/ast/ast_lib.h
+++ b/usr/src/lib/libast/amd64/include/ast/ast_lib.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/lib by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/lib by iffe version 2008-01-31 : : */
#ifndef _def_lib_ast
#define _def_lib_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/include/ast/ast_limits.h b/usr/src/lib/libast/amd64/include/ast/ast_limits.h
index d833cba6d9..35291561a1 100644
--- a/usr/src/lib/libast/amd64/include/ast/ast_limits.h
+++ b/usr/src/lib/libast/amd64/include/ast/ast_limits.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/limits.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/limits.c by iffe version 2008-01-31 : : */
#ifndef _def_limits_ast
#define _def_limits_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/include/ast/ast_map.h b/usr/src/lib/libast/amd64/include/ast/ast_map.h
index 97f67eb4cd..967205e8c5 100644
--- a/usr/src/lib/libast/amd64/include/ast/ast_map.h
+++ b/usr/src/lib/libast/amd64/include/ast/ast_map.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/map.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/map.c by iffe version 2008-01-31 : : */
#ifndef _def_map_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
@@ -142,6 +142,14 @@ extern __MANGLE__ char* getcwd __PROTO__((char*, size_t));
#define getopt_long _ast_getopt_long
#undef getopt_long_only
#define getopt_long_only _ast_getopt_long_only
+#undef optopt
+#define optopt _ast_optopt
+#undef optarg
+#define optarg _ast_optarg
+#undef optind
+#define optind _ast_optind
+#undef opterr
+#define opterr _ast_opterr
#undef getwd
#define getwd _ast_getwd
extern __MANGLE__ char* getwd __PROTO__((char*));
@@ -167,6 +175,8 @@ extern __MANGLE__ char* mktemp __PROTO__((char*));
#define mktime _ast_mktime
#undef nftw
#define nftw _ast_nftw
+#undef optctx
+#define optctx _ast_optctx
#undef optesc
#define optesc _ast_optesc
#undef optget
@@ -295,7 +305,7 @@ extern __MANGLE__ char* realpath __PROTO__((const char*, char*));
extern __MANGLE__ int remove __PROTO__((const char*));
#undef resolvepath
#define resolvepath _ast_resolvepath
-extern __MANGLE__ char* resolvepath __PROTO__((const char*, char*, size_t));
+extern __MANGLE__ int resolvepath __PROTO__((const char*, char*, size_t));
#undef setenv
#define setenv _ast_setenv
extern __MANGLE__ int setenv __PROTO__((const char*, const char*, int));
diff --git a/usr/src/lib/libast/amd64/include/ast/ast_mmap.h b/usr/src/lib/libast/amd64/include/ast/ast_mmap.h
index b539e3007f..1ca3ca5df0 100644
--- a/usr/src/lib/libast/amd64/include/ast/ast_mmap.h
+++ b/usr/src/lib/libast/amd64/include/ast/ast_mmap.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/mmap by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/mmap by iffe version 2008-01-31 : : */
#ifndef _def_mmap_ast
#define _def_mmap_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/include/ast/ast_mode.h b/usr/src/lib/libast/amd64/include/ast/ast_mode.h
index be06d22a5b..1ed73f669a 100644
--- a/usr/src/lib/libast/amd64/include/ast/ast_mode.h
+++ b/usr/src/lib/libast/amd64/include/ast/ast_mode.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/mode.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/mode.c by iffe version 2008-01-31 : : */
#ifndef _def_mode_ast
#define _def_mode_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/include/ast/ast_namval.h b/usr/src/lib/libast/amd64/include/ast/ast_namval.h
new file mode 100644
index 0000000000..4c9b12f480
--- /dev/null
+++ b/usr/src/lib/libast/amd64/include/ast/ast_namval.h
@@ -0,0 +1,51 @@
+
+/* : : generated by proto : : */
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* David Korn <dgk@research.att.com> *
+* Phong Vo <kpv@research.att.com> *
+* *
+***********************************************************************/
+
+/*
+ * Glenn Fowler
+ * AT&T Research
+ *
+ * common name-value struct support
+ */
+
+#ifndef _NAMVAL_H
+#if !defined(__PROTO__)
+#include <prototyped.h>
+#endif
+#if !defined(__LINKAGE__)
+#define __LINKAGE__ /* 2004-08-11 transition */
+#endif
+
+#define _NAMVAL_H
+
+typedef struct
+{
+ char* name;
+ int value;
+#ifdef _NAMVAL_PRIVATE_
+ _NAMVAL_PRIVATE_
+#endif
+} Namval_t;
+
+#endif
diff --git a/usr/src/lib/libast/amd64/include/ast/ast_ndbm.h b/usr/src/lib/libast/amd64/include/ast/ast_ndbm.h
new file mode 100644
index 0000000000..506313a5eb
--- /dev/null
+++ b/usr/src/lib/libast/amd64/include/ast/ast_ndbm.h
@@ -0,0 +1,30 @@
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* David Korn <dgk@research.att.com> *
+* Phong Vo <kpv@research.att.com> *
+* *
+***********************************************************************/
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/ndbm by iffe version 2008-01-31 : : */
+#ifndef _def_ndbm_ast
+#define _def_ndbm_ast 1
+#define _sys_types 1 /* #include <sys/types.h> ok */
+#define _hdr_ndbm 1 /* #include <ndbm.h> ok */
+#include <ndbm.h>
+#define _use_ndbm 1
+
+#endif
diff --git a/usr/src/lib/libast/amd64/include/ast/ast_nl_types.h b/usr/src/lib/libast/amd64/include/ast/ast_nl_types.h
index c2bcc1de13..768df6db8c 100644
--- a/usr/src/lib/libast/amd64/include/ast/ast_nl_types.h
+++ b/usr/src/lib/libast/amd64/include/ast/ast_nl_types.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/nl_types by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/nl_types by iffe version 2008-01-31 : : */
#ifndef _def_nl_types_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/amd64/include/ast/ast_param.h b/usr/src/lib/libast/amd64/include/ast/ast_param.h
index d6eb9ac498..4a1a41fbc2 100644
--- a/usr/src/lib/libast/amd64/include/ast/ast_param.h
+++ b/usr/src/lib/libast/amd64/include/ast/ast_param.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/param.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/param.sh by iffe version 2008-01-31 : : */
#ifndef _def_param_ast
#define _def_param_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/include/ast/ast_standards.h b/usr/src/lib/libast/amd64/include/ast/ast_standards.h
index 5a33b1fa95..b094fe2cfc 100644
--- a/usr/src/lib/libast/amd64/include/ast/ast_standards.h
+++ b/usr/src/lib/libast/amd64/include/ast/ast_standards.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/standards by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/standards by iffe version 2008-01-31 : : */
#ifndef _def_standards_ast
#define _def_standards_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/include/ast/ast_std.h b/usr/src/lib/libast/amd64/include/ast/ast_std.h
index 68e7984670..4f3f3dd9da 100644
--- a/usr/src/lib/libast/amd64/include/ast/ast_std.h
+++ b/usr/src/lib/libast/amd64/include/ast/ast_std.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -117,16 +117,24 @@ struct lconv
#define __MANGLE__ __LINKAGE__ __EXPORT__
#endif
+#undef getenv
+#define getenv _ast_getenv
+
#undef localeconv
#define localeconv _ast_localeconv
#undef setlocale
#define setlocale _ast_setlocale
+#undef setenviron
+#define setenviron _ast_setenviron
+
#undef strerror
#define strerror _ast_strerror
+extern __MANGLE__ char* getenv __PROTO__((const char*));
extern __MANGLE__ struct lconv* localeconv __PROTO__((void));
+extern __MANGLE__ char* setenviron __PROTO__((const char*));
extern __MANGLE__ char* setlocale __PROTO__((int, const char*));
extern __MANGLE__ char* strerror __PROTO__((int));
@@ -335,6 +343,16 @@ extern __MANGLE__ int _ast_getpgrp __PROTO__((void));
#undef _AST_STD_I
+#if _AST_GETOPT_H < 0
+#undef _AST_GETOPT_H
+#include <ast_getopt.h>
+#endif
+
+#if _GETOPT_H < 0
+#undef _GETOPT_H
+#include <getopt.h>
+#endif
+
#if _REGEX_H < 0
#undef _REGEX_H
#include <regex.h>
diff --git a/usr/src/lib/libast/amd64/include/ast/ast_stdio.h b/usr/src/lib/libast/amd64/include/ast/ast_stdio.h
index 8ae1a4061b..c59c503048 100644
--- a/usr/src/lib/libast/amd64/include/ast/ast_stdio.h
+++ b/usr/src/lib/libast/amd64/include/ast/ast_stdio.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/stdio by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/stdio by iffe version 2008-01-31 : : */
#ifndef _SFSTDIO_H
#if !defined(__PROTO__)
@@ -199,7 +199,7 @@ extern __MANGLE__ int fprintf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fpurge __PROTO__((FILE*));
extern __MANGLE__ int fputc __PROTO__((int, FILE*));
extern __MANGLE__ int fputs __PROTO__((const char*, FILE*));
-extern __MANGLE__ ssize_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
extern __MANGLE__ FILE* freopen __PROTO__((const char*, const char*, FILE*));
extern __MANGLE__ int fscanf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fseek __PROTO__((FILE*, long, int));
@@ -207,7 +207,7 @@ extern __MANGLE__ int fseeko __PROTO__((FILE*, off_t, int));
extern __MANGLE__ int fsetpos __PROTO__((FILE*, const fpos_t*));
extern __MANGLE__ long ftell __PROTO__((FILE*));
extern __MANGLE__ off_t ftello __PROTO__((FILE*));
-extern __MANGLE__ ssize_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
extern __MANGLE__ int getc __PROTO__((FILE*));
extern __MANGLE__ int getchar __PROTO__((void));
extern __MANGLE__ char* gets __PROTO__((char*));
@@ -266,6 +266,10 @@ extern __MANGLE__ int getchar_unlocked __PROTO__((void));
extern __MANGLE__ int putc_unlocked __PROTO__((int, FILE*));
extern __MANGLE__ int putchar_unlocked __PROTO__((int));
+extern __MANGLE__ void flockfile __PROTO__((FILE*));
+extern __MANGLE__ int ftrylockfile __PROTO__((FILE*));
+extern __MANGLE__ void funlockfile __PROTO__((FILE*));
+
#ifdef _USE_GNU
extern __MANGLE__ int fcloseall __PROTO__((void));
@@ -345,6 +349,7 @@ extern __MANGLE__ ssize_t getline __PROTO__((char**, size_t*, FILE*));
#define vsprintf _ast_vsprintf
#define vsscanf _ast_vsscanf
#define fcloseall _ast_fcloseall
+#define _filbuf _ast__filbuf
#define fmemopen _ast_fmemopen
#define __getdelim _ast___getdelim
#define getdelim _ast_getdelim
@@ -364,6 +369,9 @@ extern __MANGLE__ ssize_t getline __PROTO__((char**, size_t*, FILE*));
#define getchar_unlocked _ast_getchar_unlocked
#define putc_unlocked _ast_putc_unlocked
#define putchar_unlocked _ast_putchar_unlocked
+#define flockfile _ast_flockfile
+#define ftrylockfile _ast_ftrylockfile
+#define funlockfile _ast_funlockfile
#if defined(__STDPP__directive) && defined(__STDPP__initial)
__STDPP__directive pragma pp:initial
@@ -423,7 +431,7 @@ extern __MANGLE__ int fprintf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fpurge __PROTO__((FILE*));
extern __MANGLE__ int fputc __PROTO__((int, FILE*));
extern __MANGLE__ int fputs __PROTO__((const char*, FILE*));
-extern __MANGLE__ ssize_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
extern __MANGLE__ FILE* freopen __PROTO__((const char*, const char*, FILE*));
extern __MANGLE__ int fscanf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fseek __PROTO__((FILE*, long, int));
@@ -431,7 +439,7 @@ extern __MANGLE__ int fseeko __PROTO__((FILE*, off_t, int));
extern __MANGLE__ int fsetpos __PROTO__((FILE*, const fpos_t*));
extern __MANGLE__ long ftell __PROTO__((FILE*));
extern __MANGLE__ off_t ftello __PROTO__((FILE*));
-extern __MANGLE__ ssize_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
extern __MANGLE__ int getc __PROTO__((FILE*));
extern __MANGLE__ int getchar __PROTO__((void));
extern __MANGLE__ char* gets __PROTO__((char*));
diff --git a/usr/src/lib/libast/amd64/include/ast/ast_sys.h b/usr/src/lib/libast/amd64/include/ast/ast_sys.h
index b2c4abc96b..aa5d8560e9 100644
--- a/usr/src/lib/libast/amd64/include/ast/ast_sys.h
+++ b/usr/src/lib/libast/amd64/include/ast/ast_sys.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/sys by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/sys by iffe version 2008-01-31 : : */
#ifndef _AST_SYS_H
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/amd64/include/ast/ast_time.h b/usr/src/lib/libast/amd64/include/ast/ast_time.h
index 9ee992b550..a387c8d5bb 100644
--- a/usr/src/lib/libast/amd64/include/ast/ast_time.h
+++ b/usr/src/lib/libast/amd64/include/ast/ast_time.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/time by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/time by iffe version 2008-01-31 : : */
#ifndef _def_time_ast
#if !defined(__PROTO__)
@@ -97,7 +97,7 @@
#include <sys/times.h>
-#ifndef CLOCKS_PER_SEC
+#if !defined(CLOCKS_PER_SEC) && defined(CLK_TCK)
#define CLOCKS_PER_SEC CLK_TCK
#endif
diff --git a/usr/src/lib/libast/amd64/include/ast/ast_tty.h b/usr/src/lib/libast/amd64/include/ast/ast_tty.h
index 3de9691447..95d479539e 100644
--- a/usr/src/lib/libast/amd64/include/ast/ast_tty.h
+++ b/usr/src/lib/libast/amd64/include/ast/ast_tty.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/tty by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/tty by iffe version 2008-01-31 : : */
#ifndef _def_tty_ast
#define _def_tty_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/include/ast/ast_version.h b/usr/src/lib/libast/amd64/include/ast/ast_version.h
index 0e586f9555..5882fbd2a5 100644
--- a/usr/src/lib/libast/amd64/include/ast/ast_version.h
+++ b/usr/src/lib/libast/amd64/include/ast/ast_version.h
@@ -7,4 +7,4 @@
#if !defined(__LINKAGE__)
#define __LINKAGE__ /* 2004-08-11 transition */
#endif
-#define _AST_VERSION 20061111L
+#define _AST_VERSION 20080910L
diff --git a/usr/src/lib/libast/amd64/include/ast/ast_vfork.h b/usr/src/lib/libast/amd64/include/ast/ast_vfork.h
index fbc689d24c..702def24ac 100644
--- a/usr/src/lib/libast/amd64/include/ast/ast_vfork.h
+++ b/usr/src/lib/libast/amd64/include/ast/ast_vfork.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/vfork by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/vfork by iffe version 2008-01-31 : : */
#ifndef _def_vfork_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/amd64/include/ast/ast_wait.h b/usr/src/lib/libast/amd64/include/ast/ast_wait.h
index 41bf68a551..ec119d710c 100644
--- a/usr/src/lib/libast/amd64/include/ast/ast_wait.h
+++ b/usr/src/lib/libast/amd64/include/ast/ast_wait.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/wait by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/wait by iffe version 2008-01-31 : : */
#ifndef _def_wait_ast
#define _def_wait_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/include/ast/ast_wchar.h b/usr/src/lib/libast/amd64/include/ast/ast_wchar.h
index c883c78ad1..5f1122019e 100644
--- a/usr/src/lib/libast/amd64/include/ast/ast_wchar.h
+++ b/usr/src/lib/libast/amd64/include/ast/ast_wchar.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/wchar by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/wchar by iffe version 2008-01-31 : : */
#ifndef _def_wchar_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/amd64/include/ast/ast_windows.h b/usr/src/lib/libast/amd64/include/ast/ast_windows.h
index 90e0260f59..b329b2d2f5 100644
--- a/usr/src/lib/libast/amd64/include/ast/ast_windows.h
+++ b/usr/src/lib/libast/amd64/include/ast/ast_windows.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/bytesex.h b/usr/src/lib/libast/amd64/include/ast/bytesex.h
index 2bf2022afb..95c43e160d 100644
--- a/usr/src/lib/libast/amd64/include/ast/bytesex.h
+++ b/usr/src/lib/libast/amd64/include/ast/bytesex.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/ccode.h b/usr/src/lib/libast/amd64/include/ast/ccode.h
index d26926ebc4..70c8d76471 100644
--- a/usr/src/lib/libast/amd64/include/ast/ccode.h
+++ b/usr/src/lib/libast/amd64/include/ast/ccode.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/cdt.h b/usr/src/lib/libast/amd64/include/ast/cdt.h
index f6274cef92..3dc5b7b7f8 100644
--- a/usr/src/lib/libast/amd64/include/ast/cdt.h
+++ b/usr/src/lib/libast/amd64/include/ast/cdt.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/debug.h b/usr/src/lib/libast/amd64/include/ast/debug.h
index ad7ecb7a54..565212e93b 100644
--- a/usr/src/lib/libast/amd64/include/ast/debug.h
+++ b/usr/src/lib/libast/amd64/include/ast/debug.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -40,14 +40,50 @@
#include <ast.h>
#include <error.h>
+#if !defined(DEBUG) && _BLD_DEBUG
+#define DEBUG _BLD_DEBUG
+#endif
+
#if DEBUG || _BLD_DEBUG
+
#define debug(x) x
#define message(x) do if (error_info.trace < 0) { error x; } while (0)
#define messagef(x) do if (error_info.trace < 0) { errorf x; } while (0)
+
+#define DEBUG_BEGTIME() debug_elapsed(1)
+#define DEBUG_GETTIME() debug_elapsed(0)
+#define DEBUG_ASSERT(p) ((p) ? 0 : (debug_fatal(__FILE__, __LINE__),0))
+#define DEBUG_COUNT(n) ((n) += 1)
+#define DEBUG_TALLY(c,n,v) ((c) ? ((n) += (v)) : (n))
+#define DEBUG_DECLARE(t,v) t v
+#define DEBUG_SET(n,v) ((n) = (v))
+#define DEBUG_PRINT(fd,s,v) do {char _b[1024];write(fd,_b,sfsprintf(_b,sizeof(_b),s,v));} while(0)
+#define DEBUG_WRITE(fd,d,n) write((fd),(d),(n))
+#define DEBUG_TEMP(temp) (temp) /* debugging stuff that should be removed */
+#define DEBUG_RETURN(x) (debug_fatal(__FILE__, __LINE__), (x))
+#define DEBUG_BREAK (debug_fatal(__FILE__, __LINE__))
+#define DEBUG_GOTO(label) do { debug_fatal(__FILE__, __LINE__); goto label; } while(0)
+
#else
+
#define debug(x)
#define message(x)
#define messagef(x)
+
+#define DEBUG_BEGTIME()
+#define DEBUG_GETTIME()
+#define DEBUG_ASSERT(p)
+#define DEBUG_COUNT(n)
+#define DEBUG_TALLY(c,n,v)
+#define DEBUG_DECLARE(t,v)
+#define DEBUG_SET(n,v)
+#define DEBUG_PRINT(fd,s,v)
+#define DEBUG_WRITE(fd,d,n)
+#define DEBUG_KPV(x)
+#define DEBUG_RETURN(x) return(x)
+#define DEBUG_BREAK break
+#define DEBUG_GOTO(label) goto label
+
#endif
#if _BLD_ast && defined(__EXPORT__)
@@ -55,6 +91,8 @@
#define __MANGLE__ __LINKAGE__ __EXPORT__
#endif
+extern __MANGLE__ double debug_elapsed __PROTO__((int));
+extern __MANGLE__ void debug_fatal __PROTO__((const char*, int));
extern __MANGLE__ void systrace __PROTO__((const char*));
#undef __MANGLE__
diff --git a/usr/src/lib/libast/amd64/include/ast/dirent.h b/usr/src/lib/libast/amd64/include/ast/dirent.h
index 32f33800b5..b94f22215f 100644
--- a/usr/src/lib/libast/amd64/include/ast/dirent.h
+++ b/usr/src/lib/libast/amd64/include/ast/dirent.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/dt.h b/usr/src/lib/libast/amd64/include/ast/dt.h
index 0b7c331577..12299246bb 100644
--- a/usr/src/lib/libast/amd64/include/ast/dt.h
+++ b/usr/src/lib/libast/amd64/include/ast/dt.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/endian.h b/usr/src/lib/libast/amd64/include/ast/endian.h
index 2299b5a3bc..12539254b6 100644
--- a/usr/src/lib/libast/amd64/include/ast/endian.h
+++ b/usr/src/lib/libast/amd64/include/ast/endian.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/error.h b/usr/src/lib/libast/amd64/include/ast/error.h
index d6d171a15e..1cb01835f7 100644
--- a/usr/src/lib/libast/amd64/include/ast/error.h
+++ b/usr/src/lib/libast/amd64/include/ast/error.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/find.h b/usr/src/lib/libast/amd64/include/ast/find.h
index 0caf2019cf..c094791a30 100644
--- a/usr/src/lib/libast/amd64/include/ast/find.h
+++ b/usr/src/lib/libast/amd64/include/ast/find.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/fnmatch.h b/usr/src/lib/libast/amd64/include/ast/fnmatch.h
index 83e2dd9943..56c7dd7dce 100644
--- a/usr/src/lib/libast/amd64/include/ast/fnmatch.h
+++ b/usr/src/lib/libast/amd64/include/ast/fnmatch.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/fnv.h b/usr/src/lib/libast/amd64/include/ast/fnv.h
index 6af5c1489c..badccc3071 100644
--- a/usr/src/lib/libast/amd64/include/ast/fnv.h
+++ b/usr/src/lib/libast/amd64/include/ast/fnv.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/fs3d.h b/usr/src/lib/libast/amd64/include/ast/fs3d.h
index a16099d7ae..a52478f85c 100644
--- a/usr/src/lib/libast/amd64/include/ast/fs3d.h
+++ b/usr/src/lib/libast/amd64/include/ast/fs3d.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/fts.h b/usr/src/lib/libast/amd64/include/ast/fts.h
index 081fe2a712..a8ce187391 100644
--- a/usr/src/lib/libast/amd64/include/ast/fts.h
+++ b/usr/src/lib/libast/amd64/include/ast/fts.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -127,6 +127,10 @@ struct Ftsent
#ifdef _FTSENT_PRIVATE_
_FTSENT_PRIVATE_
+#else
+ short _fts_pad_1; /* <ftwalk.h> compatibility */
+ struct stat _fts_pad_2; /* <ftwalk.h> compatibility */
+ FTS* fts; /* fts_open() handle */
#endif
};
@@ -134,6 +138,7 @@ struct Ftsent
struct Fts
{
int fts_errno; /* last errno */
+ __V_* fts_handle; /* user defined handle */
#ifdef _FTS_PRIVATE_
_FTS_PRIVATE_
@@ -149,6 +154,7 @@ struct Fts
extern __MANGLE__ FTSENT* fts_children __PROTO__((FTS*, int));
extern __MANGLE__ int fts_close __PROTO__((FTS*));
extern __MANGLE__ int fts_flags __PROTO__((void));
+extern __MANGLE__ int fts_local __PROTO__((FTSENT*));
extern __MANGLE__ int fts_notify __PROTO__((int(*)(FTS*, FTSENT*, __V_*), __V_*));
extern __MANGLE__ FTS* fts_open __PROTO__((char* const*, int, int(*)(FTSENT* const*, FTSENT* const*)));
extern __MANGLE__ FTSENT* fts_read __PROTO__((FTS*));
diff --git a/usr/src/lib/libast/amd64/include/ast/ftw.h b/usr/src/lib/libast/amd64/include/ast/ftw.h
index bd39851cbc..3d43cb2609 100644
--- a/usr/src/lib/libast/amd64/include/ast/ftw.h
+++ b/usr/src/lib/libast/amd64/include/ast/ftw.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/ftwalk.h b/usr/src/lib/libast/amd64/include/ast/ftwalk.h
index 1ee713a37a..7172b76565 100644
--- a/usr/src/lib/libast/amd64/include/ast/ftwalk.h
+++ b/usr/src/lib/libast/amd64/include/ast/ftwalk.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/getopt.h b/usr/src/lib/libast/amd64/include/ast/getopt.h
index 01348b6402..4ad28bbb01 100644
--- a/usr/src/lib/libast/amd64/include/ast/getopt.h
+++ b/usr/src/lib/libast/amd64/include/ast/getopt.h
@@ -7,12 +7,15 @@
#if !defined(__LINKAGE__)
#define __LINKAGE__ /* 2004-08-11 transition */
#endif
-#include <ast_getopt.h>
-
-#if !defined(_GETOPT_H) && !defined(_AST_STD_I)
+#ifdef _AST_STD_I
+#define _GETOPT_H -1
+#endif
+#ifndef _GETOPT_H
#define _GETOPT_H 1
+#include <ast_getopt.h>
+
#define no_argument 0
#define required_argument 1
#define optional_argument 2
diff --git a/usr/src/lib/libast/amd64/include/ast/glob.h b/usr/src/lib/libast/amd64/include/ast/glob.h
index e02733177d..62c420bb4f 100644
--- a/usr/src/lib/libast/amd64/include/ast/glob.h
+++ b/usr/src/lib/libast/amd64/include/ast/glob.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -77,8 +77,8 @@ struct _glob_
__V_* (*gl_diropen) __PROTO__((glob_t*, const char*));
char* (*gl_dirnext) __PROTO__((glob_t*, __V_*));
void (*gl_dirclose) __PROTO__((glob_t*, __V_*));
- int (*gl_type) __PROTO__((glob_t*, const char*));
- int (*gl_attr) __PROTO__((glob_t*, const char*));
+ int (*gl_type) __PROTO__((glob_t*, const char*, int));
+ int (*gl_attr) __PROTO__((glob_t*, const char*, int));
/* gnu extensions -- but how do you synthesize dirent and stat? */
diff --git a/usr/src/lib/libast/amd64/include/ast/hash.h b/usr/src/lib/libast/amd64/include/ast/hash.h
index 4050612983..3ad42981e3 100644
--- a/usr/src/lib/libast/amd64/include/ast/hash.h
+++ b/usr/src/lib/libast/amd64/include/ast/hash.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/hashkey.h b/usr/src/lib/libast/amd64/include/ast/hashkey.h
index 1ce051ff26..ac0557f6df 100644
--- a/usr/src/lib/libast/amd64/include/ast/hashkey.h
+++ b/usr/src/lib/libast/amd64/include/ast/hashkey.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/hashpart.h b/usr/src/lib/libast/amd64/include/ast/hashpart.h
index b2aa79649a..90f2be5c31 100644
--- a/usr/src/lib/libast/amd64/include/ast/hashpart.h
+++ b/usr/src/lib/libast/amd64/include/ast/hashpart.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/iconv.h b/usr/src/lib/libast/amd64/include/ast/iconv.h
index e63b3f0fcd..58bc8240d2 100644
--- a/usr/src/lib/libast/amd64/include/ast/iconv.h
+++ b/usr/src/lib/libast/amd64/include/ast/iconv.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/ip6.h b/usr/src/lib/libast/amd64/include/ast/ip6.h
new file mode 100644
index 0000000000..2712064a7e
--- /dev/null
+++ b/usr/src/lib/libast/amd64/include/ast/ip6.h
@@ -0,0 +1,28 @@
+
+/* : : generated by proto : : */
+
+#if !defined(__PROTO__)
+#include <prototyped.h>
+#endif
+#if !defined(__LINKAGE__)
+#define __LINKAGE__ /* 2004-08-11 transition */
+#endif
+#if !_IP6_H
+#define _IP6_H 1
+
+#define IP6ADDR 16
+#define IP6BITS IP6ADDR
+#define IP6PREFIX (IP6ADDR+1)
+
+#if _BLD_ast && defined(__EXPORT__)
+#undef __MANGLE__
+#define __MANGLE__ __LINKAGE__ __EXPORT__
+#endif
+
+extern __MANGLE__ char* fmtip6 __PROTO__((unsigned char*, int));
+extern __MANGLE__ int strtoip6 __PROTO__((const char*, char**, unsigned char*, unsigned char*));
+
+#undef __MANGLE__
+#define __MANGLE__ __LINKAGE__
+
+#endif
diff --git a/usr/src/lib/libast/amd64/include/ast/lc.h b/usr/src/lib/libast/amd64/include/ast/lc.h
index fdd804f36e..b225864bbc 100644
--- a/usr/src/lib/libast/amd64/include/ast/lc.h
+++ b/usr/src/lib/libast/amd64/include/ast/lc.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/ls.h b/usr/src/lib/libast/amd64/include/ast/ls.h
index cce1771b3f..b195c70e0c 100644
--- a/usr/src/lib/libast/amd64/include/ast/ls.h
+++ b/usr/src/lib/libast/amd64/include/ast/ls.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/magic.h b/usr/src/lib/libast/amd64/include/ast/magic.h
index f484f2b20d..cf3c0fdcb8 100644
--- a/usr/src/lib/libast/amd64/include/ast/magic.h
+++ b/usr/src/lib/libast/amd64/include/ast/magic.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/magicid.h b/usr/src/lib/libast/amd64/include/ast/magicid.h
index ceadff2653..66507d4d0b 100644
--- a/usr/src/lib/libast/amd64/include/ast/magicid.h
+++ b/usr/src/lib/libast/amd64/include/ast/magicid.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/mc.h b/usr/src/lib/libast/amd64/include/ast/mc.h
index 4b55665b3b..be15276038 100644
--- a/usr/src/lib/libast/amd64/include/ast/mc.h
+++ b/usr/src/lib/libast/amd64/include/ast/mc.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/mime.h b/usr/src/lib/libast/amd64/include/ast/mime.h
index b018b68c9a..c214a31130 100644
--- a/usr/src/lib/libast/amd64/include/ast/mime.h
+++ b/usr/src/lib/libast/amd64/include/ast/mime.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/mnt.h b/usr/src/lib/libast/amd64/include/ast/mnt.h
index d877416642..ddce19fc9d 100644
--- a/usr/src/lib/libast/amd64/include/ast/mnt.h
+++ b/usr/src/lib/libast/amd64/include/ast/mnt.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/modecanon.h b/usr/src/lib/libast/amd64/include/ast/modecanon.h
index ce107238e3..f207540d5b 100644
--- a/usr/src/lib/libast/amd64/include/ast/modecanon.h
+++ b/usr/src/lib/libast/amd64/include/ast/modecanon.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/modex.h b/usr/src/lib/libast/amd64/include/ast/modex.h
index 458ad18ac1..96971e347b 100644
--- a/usr/src/lib/libast/amd64/include/ast/modex.h
+++ b/usr/src/lib/libast/amd64/include/ast/modex.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/namval.h b/usr/src/lib/libast/amd64/include/ast/namval.h
index d746970d58..4c9b12f480 100644
--- a/usr/src/lib/libast/amd64/include/ast/namval.h
+++ b/usr/src/lib/libast/amd64/include/ast/namval.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/nl_types.h b/usr/src/lib/libast/amd64/include/ast/nl_types.h
index db7383c626..36c901d8ed 100644
--- a/usr/src/lib/libast/amd64/include/ast/nl_types.h
+++ b/usr/src/lib/libast/amd64/include/ast/nl_types.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/option.h b/usr/src/lib/libast/amd64/include/ast/option.h
index 7204047891..0cb1ca74c5 100644
--- a/usr/src/lib/libast/amd64/include/ast/option.h
+++ b/usr/src/lib/libast/amd64/include/ast/option.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -112,6 +112,7 @@ extern __MANGLE__ char* opthelp __PROTO__((const char*, const char*));
extern __MANGLE__ char* optusage __PROTO__((const char*));
extern __MANGLE__ int optstr __PROTO__((const char*, const char*));
extern __MANGLE__ int optesc __PROTO__((Sfio_t*, const char*, int));
+extern __MANGLE__ Opt_t* optctx __PROTO__((Opt_t*, Opt_t*));
#undef __MANGLE__
#define __MANGLE__ __LINKAGE__
diff --git a/usr/src/lib/libast/amd64/include/ast/preroot.h b/usr/src/lib/libast/amd64/include/ast/preroot.h
index c9dd06aed7..601862a6b5 100644
--- a/usr/src/lib/libast/amd64/include/ast/preroot.h
+++ b/usr/src/lib/libast/amd64/include/ast/preroot.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/preroot.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/preroot.sh by iffe version 2008-01-31 : : */
#ifndef _def_preroot_ast
#define _def_preroot_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/include/ast/proc.h b/usr/src/lib/libast/amd64/include/ast/proc.h
index 1196fc5b3f..2bfa576970 100644
--- a/usr/src/lib/libast/amd64/include/ast/proc.h
+++ b/usr/src/lib/libast/amd64/include/ast/proc.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -41,12 +41,14 @@
#define PROC_ARGMOD (1<<0) /* argv[-1],argv[0] can be modified */
#define PROC_BACKGROUND (1<<1) /* shell background (&) setup */
+#define PROC_CHECK (1<<17) /* check that command exists */
#define PROC_CLEANUP (1<<2) /* close parent redirect fds on error */
#define PROC_DAEMON (1<<3) /* daemon setup */
#define PROC_ENVCLEAR (1<<4) /* clear environment */
#define PROC_FOREGROUND (1<<14) /* system(3) setup */
#define PROC_GID (1<<5) /* setgid(getgid()) */
#define PROC_IGNORE (1<<6) /* ignore parent pipe errors */
+#define PROC_IGNOREPATH (1<<16) /* procrun() intercept to ignore path */
#define PROC_OVERLAY (1<<7) /* overlay current process if possible */
#define PROC_PARANOID (1<<8) /* restrict everything */
#define PROC_PRIVELEGED (1<<9) /* setuid(0), setgid(getegid()) */
@@ -104,8 +106,8 @@ _PROC_PRIVATE_
extern __MANGLE__ int procclose __PROTO__((Proc_t*));
extern __MANGLE__ int procfree __PROTO__((Proc_t*));
-extern __MANGLE__ Proc_t* procopen __PROTO__((const char*, char**, char**, long*, long));
-extern __MANGLE__ int procrun __PROTO__((const char*, char**));
+extern __MANGLE__ Proc_t* procopen __PROTO__((const char*, char**, char**, long*, int));
+extern __MANGLE__ int procrun __PROTO__((const char*, char**, int));
#undef __MANGLE__
#define __MANGLE__ __LINKAGE__
diff --git a/usr/src/lib/libast/amd64/include/ast/re_comp.h b/usr/src/lib/libast/amd64/include/ast/re_comp.h
index 5da565e880..381bc801fc 100644
--- a/usr/src/lib/libast/amd64/include/ast/re_comp.h
+++ b/usr/src/lib/libast/amd64/include/ast/re_comp.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/recfmt.h b/usr/src/lib/libast/amd64/include/ast/recfmt.h
index 1a66761ec2..133e37da41 100644
--- a/usr/src/lib/libast/amd64/include/ast/recfmt.h
+++ b/usr/src/lib/libast/amd64/include/ast/recfmt.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/regexp.h b/usr/src/lib/libast/amd64/include/ast/regexp.h
index b7f3ed6313..e1c6258b3e 100644
--- a/usr/src/lib/libast/amd64/include/ast/regexp.h
+++ b/usr/src/lib/libast/amd64/include/ast/regexp.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/sfdisc.h b/usr/src/lib/libast/amd64/include/ast/sfdisc.h
index 9e657f045b..5303d9a62e 100644
--- a/usr/src/lib/libast/amd64/include/ast/sfdisc.h
+++ b/usr/src/lib/libast/amd64/include/ast/sfdisc.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/sfio.h b/usr/src/lib/libast/amd64/include/ast/sfio.h
index 9feba3043e..11317dad65 100644
--- a/usr/src/lib/libast/amd64/include/ast/sfio.h
+++ b/usr/src/lib/libast/amd64/include/ast/sfio.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -22,7 +22,7 @@
#ifndef _SFIO_H
#define _SFIO_H 1
-#define SFIO_VERSION 20050202L
+#define SFIO_VERSION 20080717L
/* Public header file for the sfio library
**
@@ -181,6 +181,7 @@ struct _sffmt_s
/* for the notify function and discipline exception */
#define SF_NEW 0 /* new stream */
#define SF_SETFD (-1) /* about to set the file descriptor */
+#define SF_MTACCESS (-2) /* starting a multi-threaded stream */
#define SF_BUFSIZE 8192 /* default buffer size */
#define SF_UNBOUND (-1) /* unbounded buffer size */
@@ -240,7 +241,7 @@ extern int sfclrlock _ARG_((Sfio_t*));
extern Void_t* sfsetbuf _ARG_((Sfio_t*, Void_t*, size_t));
extern Sfdisc_t* sfdisc _ARG_((Sfio_t*,Sfdisc_t*));
extern int sfraise _ARG_((Sfio_t*, int, Void_t*));
-extern int sfnotify _ARG_((void(*)(Sfio_t*, int, int)));
+extern int sfnotify _ARG_((void(*)(Sfio_t*, int, void*)));
extern int sfset _ARG_((Sfio_t*, int, int));
extern int sfsetfd _ARG_((Sfio_t*, int));
extern Sfio_t* sfpool _ARG_((Sfio_t*, Sfio_t*, int));
diff --git a/usr/src/lib/libast/amd64/include/ast/sfio_s.h b/usr/src/lib/libast/amd64/include/ast/sfio_s.h
index 27936a16b1..19a23d4772 100644
--- a/usr/src/lib/libast/amd64/include/ast/sfio_s.h
+++ b/usr/src/lib/libast/amd64/include/ast/sfio_s.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/sfio_t.h b/usr/src/lib/libast/amd64/include/ast/sfio_t.h
index 36be6ecc94..c5251d3f34 100644
--- a/usr/src/lib/libast/amd64/include/ast/sfio_t.h
+++ b/usr/src/lib/libast/amd64/include/ast/sfio_t.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/shcmd.h b/usr/src/lib/libast/amd64/include/ast/shcmd.h
new file mode 100644
index 0000000000..14e282a3d0
--- /dev/null
+++ b/usr/src/lib/libast/amd64/include/ast/shcmd.h
@@ -0,0 +1,103 @@
+
+/* : : generated by proto : : */
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* David Korn <dgk@research.att.com> *
+* Phong Vo <kpv@research.att.com> *
+* *
+***********************************************************************/
+
+
+/*
+ * ksh builtin command api
+ */
+
+#ifndef _SHCMD_H
+#if !defined(__PROTO__)
+#include <prototyped.h>
+#endif
+#if !defined(__LINKAGE__)
+#define __LINKAGE__ /* 2004-08-11 transition */
+#endif
+
+#define _SHCMD_H 1
+
+#ifndef SH_VERSION
+# define Shell_t void
+#endif
+#ifndef NV_DEFAULT
+# define Namval_t void
+#endif
+#ifndef ERROR_NOTIFY
+# define ERROR_NOTIFY 1
+#endif
+
+typedef int (*Shbltin_f) __PROTO__((int, char**, __V_*));
+
+#undef Shbltin_t
+typedef struct Shbltin_s
+{
+ Shell_t *shp;
+ __V_ *ptr;
+ int version;
+ int (*shrun) __PROTO__((int, char**));
+ int (*shtrap) __PROTO__((const char*, int));
+ void (*shexit) __PROTO__((int));
+ Namval_t *(*shbltin) __PROTO__((const char*, Shbltin_f, __V_*));
+ unsigned char notify;
+ unsigned char sigset;
+ unsigned char nosfio;
+ Namval_t *bnode;
+ Namval_t *vnode;
+ char *data;
+ int flags;
+ char *(*shgetenv) __PROTO__((const char*));
+ char *(*shsetenv) __PROTO__((const char*));
+ int invariant;
+} Shbltin_t;
+
+#if defined(SH_VERSION) || defined(_SH_PRIVATE)
+# undef Shell_t
+# undef Namval_t
+#else
+# define sh_run(c, ac, av) ((c)?(*((Shbltin_t*)(c))->shrun)(ac,av):-1)
+# define sh_system(c,str) ((c)?(*((Shbltin_t*)(c))->shtrap)(str,0):system(str))
+# define sh_exit(c,n) ((c)?(*((Shbltin_t*)(c))->shexit)(n):exit(n))
+# define sh_checksig(c) ((c) && ((Shbltin_t*)(c))->sigset)
+# if defined(SFIO_VERSION) || defined(_AST_H)
+# define LIB_INIT(c)
+# else
+# define LIB_INIT(c) ((c) && (((Shbltin_t*)(c))->nosfio = 1))
+# endif
+# ifndef _CMD_H
+# define cmdinit(ac,av,c,cat,flg) do { if((ac)<=0) return(0); \
+ (((Shbltin_t*)(c))->notify = ((flg)&ERROR_NOTIFY)?1:0);} while(0)
+# endif
+#endif
+
+#if _BLD_ast && defined(__EXPORT__)
+#undef __MANGLE__
+#define __MANGLE__ __LINKAGE__ __EXPORT__
+#endif
+
+extern __MANGLE__ int astintercept __PROTO__((Shbltin_t*, int));
+
+#undef __MANGLE__
+#define __MANGLE__ __LINKAGE__
+
+#endif
diff --git a/usr/src/lib/libast/amd64/include/ast/sig.h b/usr/src/lib/libast/amd64/include/ast/sig.h
index c868352c39..7662fe0cde 100644
--- a/usr/src/lib/libast/amd64/include/ast/sig.h
+++ b/usr/src/lib/libast/amd64/include/ast/sig.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/sig.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/sig.sh by iffe version 2008-01-31 : : */
#ifndef _def_sig_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
diff --git a/usr/src/lib/libast/amd64/include/ast/stack.h b/usr/src/lib/libast/amd64/include/ast/stack.h
index ad32ebb8ab..5c55255f06 100644
--- a/usr/src/lib/libast/amd64/include/ast/stack.h
+++ b/usr/src/lib/libast/amd64/include/ast/stack.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/stak.h b/usr/src/lib/libast/amd64/include/ast/stak.h
index e0e707b0e5..321be20328 100644
--- a/usr/src/lib/libast/amd64/include/ast/stak.h
+++ b/usr/src/lib/libast/amd64/include/ast/stak.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/stdio.h b/usr/src/lib/libast/amd64/include/ast/stdio.h
index 7e137c5712..42d7ed8269 100644
--- a/usr/src/lib/libast/amd64/include/ast/stdio.h
+++ b/usr/src/lib/libast/amd64/include/ast/stdio.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/stk.h b/usr/src/lib/libast/amd64/include/ast/stk.h
index 24947d24f1..ef9a946ce0 100644
--- a/usr/src/lib/libast/amd64/include/ast/stk.h
+++ b/usr/src/lib/libast/amd64/include/ast/stk.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -84,6 +84,7 @@ extern __MANGLE__ char* stkcopy __PROTO__((Stk_t*,const char*));
extern __MANGLE__ char* stkset __PROTO__((Stk_t*, char*, unsigned));
extern __MANGLE__ char* _stkseek __PROTO__((Stk_t*, unsigned));
extern __MANGLE__ char* stkfreeze __PROTO__((Stk_t*, unsigned));
+extern __MANGLE__ int stkon __PROTO__((Stk_t*, char *));
#undef __MANGLE__
#define __MANGLE__ __LINKAGE__
diff --git a/usr/src/lib/libast/amd64/include/ast/swap.h b/usr/src/lib/libast/amd64/include/ast/swap.h
index d89248d12b..81e49db105 100644
--- a/usr/src/lib/libast/amd64/include/ast/swap.h
+++ b/usr/src/lib/libast/amd64/include/ast/swap.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/tar.h b/usr/src/lib/libast/amd64/include/ast/tar.h
index 910b6e8612..3a9a99b0ac 100644
--- a/usr/src/lib/libast/amd64/include/ast/tar.h
+++ b/usr/src/lib/libast/amd64/include/ast/tar.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/times.h b/usr/src/lib/libast/amd64/include/ast/times.h
index 25e81662be..1ed0f2135a 100644
--- a/usr/src/lib/libast/amd64/include/ast/times.h
+++ b/usr/src/lib/libast/amd64/include/ast/times.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/tm.h b/usr/src/lib/libast/amd64/include/ast/tm.h
index f790a9a66e..29c0d4f1fa 100644
--- a/usr/src/lib/libast/amd64/include/ast/tm.h
+++ b/usr/src/lib/libast/amd64/include/ast/tm.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/tmx.h b/usr/src/lib/libast/amd64/include/ast/tmx.h
index 239c2c69f8..df4e1f9972 100644
--- a/usr/src/lib/libast/amd64/include/ast/tmx.h
+++ b/usr/src/lib/libast/amd64/include/ast/tmx.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/tmx by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/tmx by iffe version 2008-01-31 : : */
#ifndef _TMX_H
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/amd64/include/ast/tok.h b/usr/src/lib/libast/amd64/include/ast/tok.h
index 3637489918..1d5112837c 100644
--- a/usr/src/lib/libast/amd64/include/ast/tok.h
+++ b/usr/src/lib/libast/amd64/include/ast/tok.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/tv.h b/usr/src/lib/libast/amd64/include/ast/tv.h
index 6e5dd9cb7c..9cb7a59e81 100644
--- a/usr/src/lib/libast/amd64/include/ast/tv.h
+++ b/usr/src/lib/libast/amd64/include/ast/tv.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/tv by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/tv by iffe version 2008-01-31 : : */
#ifndef _TV_H
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/amd64/include/ast/usage.h b/usr/src/lib/libast/amd64/include/ast/usage.h
index 81b59e1aca..d969a0e4c1 100644
--- a/usr/src/lib/libast/amd64/include/ast/usage.h
+++ b/usr/src/lib/libast/amd64/include/ast/usage.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/vdb.h b/usr/src/lib/libast/amd64/include/ast/vdb.h
index 63e310c724..ba47e14901 100644
--- a/usr/src/lib/libast/amd64/include/ast/vdb.h
+++ b/usr/src/lib/libast/amd64/include/ast/vdb.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/vecargs.h b/usr/src/lib/libast/amd64/include/ast/vecargs.h
index 4d329cd154..121e9d5010 100644
--- a/usr/src/lib/libast/amd64/include/ast/vecargs.h
+++ b/usr/src/lib/libast/amd64/include/ast/vecargs.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/vmalloc.h b/usr/src/lib/libast/amd64/include/ast/vmalloc.h
index f0a8114c6a..8cf3e9b974 100644
--- a/usr/src/lib/libast/amd64/include/ast/vmalloc.h
+++ b/usr/src/lib/libast/amd64/include/ast/vmalloc.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -27,7 +27,7 @@
** Written by Kiem-Phong Vo, kpv@research.att.com, 01/16/94.
*/
-#define VMALLOC_VERSION 20050928L
+#define VMALLOC_VERSION 20070911L
#if _PACKAGE_ast
#include <ast_std.h>
diff --git a/usr/src/lib/libast/amd64/include/ast/wait.h b/usr/src/lib/libast/amd64/include/ast/wait.h
index 6910081961..08160043fa 100644
--- a/usr/src/lib/libast/amd64/include/ast/wait.h
+++ b/usr/src/lib/libast/amd64/include/ast/wait.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/wchar.h b/usr/src/lib/libast/amd64/include/ast/wchar.h
index 557a403adc..7796480d09 100644
--- a/usr/src/lib/libast/amd64/include/ast/wchar.h
+++ b/usr/src/lib/libast/amd64/include/ast/wchar.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/wordexp.h b/usr/src/lib/libast/amd64/include/ast/wordexp.h
index b2e80d9f35..c3f97b37d9 100644
--- a/usr/src/lib/libast/amd64/include/ast/wordexp.h
+++ b/usr/src/lib/libast/amd64/include/ast/wordexp.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/align b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/align
index 2172421a7d..c1d2830f65 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/align
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/align
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/align.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/align.c by iffe version 2008-01-31 : : */
#ifndef _def_align_ast
#define _def_align_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/botch b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/botch
index d70906e8be..a4073c6203 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/botch
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/botch
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/botch.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/botch.c by iffe version 2008-01-31 : : */
#ifndef _def_botch_ast
#define _def_botch_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/ccode b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/ccode
index 0939e42778..037e0feb43 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/ccode
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/ccode
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/ccode by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/ccode by iffe version 2008-01-31 : : */
#ifndef _def_ccode_ast
#define _def_ccode_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/common b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/common
index 5bb0460efd..e7cf28dd9a 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/common
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/common
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/common by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/common by iffe version 2008-01-31 : : */
#ifndef _AST_COMMON_H
#define _AST_COMMON_H 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/dirent b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/dirent
index e6f040cfb6..2079091a68 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/dirent
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/dirent
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/dirent by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/dirent by iffe version 2008-01-31 : : */
#ifndef _def_dirent_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/eaccess b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/eaccess
index ffce8235f1..ed64f46818 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/eaccess
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/eaccess
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/eaccess by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/eaccess by iffe version 2008-01-31 : : */
#ifndef _def_eaccess_ast
#define _def_eaccess_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/errno b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/errno
index 714835a4ee..4d8ab0363d 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/errno
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/errno
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/errno by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/errno by iffe version 2008-01-31 : : */
#ifndef _def_errno_ast
#define _def_errno_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/fcntl b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/fcntl
index f59e2cdbd1..81a8f188ba 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/fcntl
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/fcntl
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/fcntl.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/fcntl.c by iffe version 2008-01-31 : : */
#ifndef _def_fcntl_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/float b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/float
index 40d069f246..bdc61b73fa 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/float
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/float
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/float by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/float by iffe version 2008-01-31 : : */
#ifndef _def_float_ast
#if !defined(__PROTO__)
@@ -68,13 +68,16 @@
#define _hdr_math 1 /* #include <math.h> ok */
#define _hdr_values 1 /* #include <values.h> ok */
#define _LIB_m 1 /* -lm is a library */
+#define _lib_fpclassify 1 /* fpclassify() in default lib(s) */
#define _lib_frexp 1 /* frexp() in default lib(s) */
#define _lib_frexpl 1 /* frexpl() in default lib(s) */
#define _lib_ldexp 1 /* ldexp() in default lib(s) */
#define _lib_ldexpl 1 /* ldexpl() in default lib(s) */
#define _lib_finite 1 /* finite() in default lib(s) */
+#define _lib_isinf 1 /* isinf() in default lib(s) */
#define _lib_isnan 1 /* isnan() in default lib(s) */
#define _lib_isnanl 1 /* isnanl() in default lib(s) */
+#define _lib_signbit 1 /* signbit() in default lib(s) */
#define _lib_copysign 1 /* copysign() in default lib(s) */
#define _lib_copysignl 1 /* copysignl() in default lib(s) */
#include <ast_common.h>
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/fs b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/fs
index eb8b57cea9..8560af4f28 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/fs
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/fs
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/fs by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/fs by iffe version 2008-01-31 : : */
#ifndef _def_fs_ast
#if !defined(__PROTO__)
@@ -68,20 +68,9 @@
#define _lib_mknod 1 /* mknod() in default lib(s) */
#define _lib_sync 1 /* sync() in default lib(s) */
#include <sys/stat.h>
+#include <sys/mkdev.h>
#define FS_default "ufs"
#if defined(__STDPP__directive) && defined(__STDPP__initial)
-__STDPP__directive pragma pp:initial
-#endif
-#ifndef major
-#define major(x) ( major_t ) ( ( ( ( unsigned ) ( ( x ) ) ) >> 8 ) & 0x7f )
-#endif
-#ifndef minor
-#define minor(x) ( minor_t ) ( ( ( x ) ) & 0xff )
-#endif
-#ifndef makedev
-#define makedev(x,y) ( unsigned short ) ( ( ( ( x ) ) << 8 ) | ( ( ( y ) ) & 0xff ) )
-#endif
-#if defined(__STDPP__directive) && defined(__STDPP__initial)
__STDPP__directive pragma pp:noinitial
#endif
#define _hdr_stdio 1 /* #include <stdio.h> ok */
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/hack b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/hack
index 31c11abc1d..e45d5db86d 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/hack
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/hack
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/hack by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/hack by iffe version 2008-01-31 : : */
#ifndef _def_hack_ast
#define _def_hack_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/iconv b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/iconv
index cc251f15d2..ccd176f5f4 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/iconv
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/iconv
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/iconv by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/iconv by iffe version 2008-01-31 : : */
#ifndef _def_iconv_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/isoc99 b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/isoc99
new file mode 100644
index 0000000000..a709b928f2
--- /dev/null
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/isoc99
@@ -0,0 +1,11 @@
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/isoc99 by iffe version 2008-01-31 : : */
+#ifndef _def_isoc99_ast
+#define _def_isoc99_ast 1
+#define _sys_types 1 /* #include <sys/types.h> ok */
+#define _LIB_m 1 /* -lm is a library */
+/* _ISOC99_SOURCE plays nice */
+#ifndef _ISOC99_SOURCE
+#define _ISOC99_SOURCE 1
+#endif
+
+#endif
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/lib b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/lib
index a2a479c2d7..67c80dc794 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/lib
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/lib
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/lib by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/lib by iffe version 2008-01-31 : : */
#ifndef _def_lib_ast
#define _def_lib_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/libpath b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/libpath
index d6dc322a20..b5a7c83021 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/libpath
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/libpath
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/libpath.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/libpath.sh by iffe version 2008-01-31 : : */
#ifndef _def_libpath_ast
#define _def_libpath_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/limits b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/limits
index 7dddc39475..f3cf6b6aed 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/limits
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/limits
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/limits.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/limits.c by iffe version 2008-01-31 : : */
#ifndef _def_limits_ast
#define _def_limits_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/map b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/map
index 55c2ef8707..39bce9c36e 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/map
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/map
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/map.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/map.c by iffe version 2008-01-31 : : */
#ifndef _def_map_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
@@ -121,6 +121,14 @@ extern __MANGLE__ char* getcwd __PROTO__((char*, size_t));
#define getopt_long _ast_getopt_long
#undef getopt_long_only
#define getopt_long_only _ast_getopt_long_only
+#undef optopt
+#define optopt _ast_optopt
+#undef optarg
+#define optarg _ast_optarg
+#undef optind
+#define optind _ast_optind
+#undef opterr
+#define opterr _ast_opterr
#undef getwd
#define getwd _ast_getwd
extern __MANGLE__ char* getwd __PROTO__((char*));
@@ -146,6 +154,8 @@ extern __MANGLE__ char* mktemp __PROTO__((char*));
#define mktime _ast_mktime
#undef nftw
#define nftw _ast_nftw
+#undef optctx
+#define optctx _ast_optctx
#undef optesc
#define optesc _ast_optesc
#undef optget
@@ -274,7 +284,7 @@ extern __MANGLE__ char* realpath __PROTO__((const char*, char*));
extern __MANGLE__ int remove __PROTO__((const char*));
#undef resolvepath
#define resolvepath _ast_resolvepath
-extern __MANGLE__ char* resolvepath __PROTO__((const char*, char*, size_t));
+extern __MANGLE__ int resolvepath __PROTO__((const char*, char*, size_t));
#undef setenv
#define setenv _ast_setenv
extern __MANGLE__ int setenv __PROTO__((const char*, const char*, int));
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/mmap b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/mmap
index 10483aee18..3b628c0067 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/mmap
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/mmap
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/mmap by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/mmap by iffe version 2008-01-31 : : */
#ifndef _def_mmap_ast
#define _def_mmap_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/mode b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/mode
index 5476393224..50d7ceb870 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/mode
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/mode
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/mode.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/mode.c by iffe version 2008-01-31 : : */
#ifndef _def_mode_ast
#define _def_mode_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/ndbm b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/ndbm
new file mode 100644
index 0000000000..89a006ffb0
--- /dev/null
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/ndbm
@@ -0,0 +1,9 @@
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/ndbm by iffe version 2008-01-31 : : */
+#ifndef _def_ndbm_ast
+#define _def_ndbm_ast 1
+#define _sys_types 1 /* #include <sys/types.h> ok */
+#define _hdr_ndbm 1 /* #include <ndbm.h> ok */
+#include <ndbm.h>
+#define _use_ndbm 1
+
+#endif
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/nl_types b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/nl_types
index 43c7bc9c4d..10de231889 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/nl_types
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/nl_types
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/nl_types by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/nl_types by iffe version 2008-01-31 : : */
#ifndef _def_nl_types_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/omitted b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/omitted
index a3539b4918..274dd04a02 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/omitted
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/omitted
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/omitted by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/omitted by iffe version 2008-01-31 : : */
#ifndef _def_omitted_ast
#define _def_omitted_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/param b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/param
index 4c28f392e5..67b88137e9 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/param
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/param
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/param.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/param.sh by iffe version 2008-01-31 : : */
#ifndef _def_param_ast
#define _def_param_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/preroot b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/preroot
index ec3ecd3cfe..13040e0062 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/preroot
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/preroot
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/preroot.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/preroot.sh by iffe version 2008-01-31 : : */
#ifndef _def_preroot_ast
#define _def_preroot_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/sfinit b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/sfinit
index 74fe82ba25..36037085b2 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/sfinit
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/sfinit
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/sfinit.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/sfinit.c by iffe version 2008-01-31 : : */
#ifndef _def_sfinit_ast
#define _def_sfinit_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/sfio b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/sfio
index f642b0f436..d3319eda1b 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/sfio
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/sfio
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/sfio by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/sfio by iffe version 2008-01-31 : : */
#ifndef _def_sfio_ast
#define _def_sfio_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/sig b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/sig
index 5edc503e1f..d48dfb6db0 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/sig
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/sig
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/sig.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/sig.sh by iffe version 2008-01-31 : : */
#ifndef _def_sig_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/siglist b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/siglist
new file mode 100644
index 0000000000..b8d27d53e5
--- /dev/null
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/siglist
@@ -0,0 +1,125 @@
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/siglist by iffe version 2008-01-31 : : */
+#ifndef _def_siglist_ast
+#define _def_siglist_ast 1
+#define _sys_types 1 /* #include <sys/types.h> ok */
+#define _hdr_string 1 /* #include <string.h> ok */
+#define _hdr_signal 1 /* #include <signal.h> ok */
+#define _lib_strsignal 1 /* strsignal() in default lib(s) */
+#if defined(SIGINT) && !defined(HAD_SIGINT)
+0,"INT",SIGINT,
+#endif
+#if defined(SIGQUIT) && !defined(HAD_SIGQUIT)
+0,"QUIT",SIGQUIT,
+#endif
+#if defined(SIGILL) && !defined(HAD_SIGILL)
+0,"ILL",SIGILL,
+#endif
+#if defined(SIGTRAP) && !defined(HAD_SIGTRAP)
+0,"TRAP",SIGTRAP,
+#endif
+#if defined(SIGIOT) && !defined(HAD_SIGIOT)
+0,"IOT",SIGIOT,
+#endif
+#if defined(SIGEMT) && !defined(HAD_SIGEMT)
+0,"EMT",SIGEMT,
+#endif
+#if defined(SIGFPE) && !defined(HAD_SIGFPE)
+0,"FPE",SIGFPE,
+#endif
+#if defined(SIGKILL) && !defined(HAD_SIGKILL)
+0,"KILL",SIGKILL,
+#endif
+#if defined(SIGBUS) && !defined(HAD_SIGBUS)
+0,"BUS",SIGBUS,
+#endif
+#if defined(SIGSEGV) && !defined(HAD_SIGSEGV)
+0,"SEGV",SIGSEGV,
+#endif
+#if defined(SIGSYS) && !defined(HAD_SIGSYS)
+0,"SYS",SIGSYS,
+#endif
+#if defined(SIGPIPE) && !defined(HAD_SIGPIPE)
+0,"PIPE",SIGPIPE,
+#endif
+#if defined(SIGALRM) && !defined(HAD_SIGALRM)
+0,"ALRM",SIGALRM,
+#endif
+#if defined(SIGTERM) && !defined(HAD_SIGTERM)
+0,"TERM",SIGTERM,
+#endif
+#if defined(SIGUSR1) && !defined(HAD_SIGUSR1)
+0,"USR1",SIGUSR1,
+#endif
+#if defined(SIGUSR2) && !defined(HAD_SIGUSR2)
+0,"USR2",SIGUSR2,
+#endif
+#if defined(SIGCHLD) && !defined(HAD_SIGCHLD)
+0,"CHLD",SIGCHLD,
+#endif
+#if defined(SIGPWR) && !defined(HAD_SIGPWR)
+0,"PWR",SIGPWR,
+#endif
+#if defined(SIGWINCH) && !defined(HAD_SIGWINCH)
+0,"WINCH",SIGWINCH,
+#endif
+#if defined(SIGURG) && !defined(HAD_SIGURG)
+0,"URG",SIGURG,
+#endif
+#if defined(SIGPOLL) && !defined(HAD_SIGPOLL)
+0,"POLL",SIGPOLL,
+#endif
+#if defined(SIGSTOP) && !defined(HAD_SIGSTOP)
+0,"STOP",SIGSTOP,
+#endif
+#if defined(SIGTSTP) && !defined(HAD_SIGTSTP)
+0,"TSTP",SIGTSTP,
+#endif
+#if defined(SIGCONT) && !defined(HAD_SIGCONT)
+0,"CONT",SIGCONT,
+#endif
+#if defined(SIGTTIN) && !defined(HAD_SIGTTIN)
+0,"TTIN",SIGTTIN,
+#endif
+#if defined(SIGTTOU) && !defined(HAD_SIGTTOU)
+0,"TTOU",SIGTTOU,
+#endif
+#if defined(SIGVTALRM) && !defined(HAD_SIGVTALRM)
+0,"VTALRM",SIGVTALRM,
+#endif
+#if defined(SIGPROF) && !defined(HAD_SIGPROF)
+0,"PROF",SIGPROF,
+#endif
+#if defined(SIGXCPU) && !defined(HAD_SIGXCPU)
+0,"XCPU",SIGXCPU,
+#endif
+#if defined(SIGXFSZ) && !defined(HAD_SIGXFSZ)
+0,"XFSZ",SIGXFSZ,
+#endif
+#if defined(SIGWAITING) && !defined(HAD_SIGWAITING)
+0,"WAITING",SIGWAITING,
+#endif
+#if defined(SIGLWP) && !defined(HAD_SIGLWP)
+0,"LWP",SIGLWP,
+#endif
+#if defined(SIGFREEZE) && !defined(HAD_SIGFREEZE)
+0,"FREEZE",SIGFREEZE,
+#endif
+#if defined(SIGTHAW) && !defined(HAD_SIGTHAW)
+0,"THAW",SIGTHAW,
+#endif
+#if defined(SIGCANCEL) && !defined(HAD_SIGCANCEL)
+0,"CANCEL",SIGCANCEL,
+#endif
+#if defined(SIGLOST) && !defined(HAD_SIGLOST)
+0,"LOST",SIGLOST,
+#endif
+#if defined(SIGXRES) && !defined(HAD_SIGXRES)
+0,"XRES",SIGXRES,
+#endif
+#if defined(SIGJVM1) && !defined(HAD_SIGJVM1)
+0,"JVM1",SIGJVM1,
+#endif
+#if defined(SIGJVM2) && !defined(HAD_SIGJVM2)
+0,"JVM2",SIGJVM2,
+#endif
+#endif
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/signal b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/signal
index e95c9f5270..5b8740cdad 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/signal
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/signal
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/signal.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/signal.c by iffe version 2008-01-31 : : */
#ifndef _def_signal_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
@@ -103,18 +103,18 @@ static const char* const sig_name[] =
"LWP",
"FREEZE",
"THAW",
- "36",
+ "CANCEL",
"LOST",
- "38",
- "39",
- "40",
+ "XRES",
+ "JVM1",
+ "JVM2",
"RTMIN",
- "RT1",
- "RT2",
- "RT3",
- "RT4",
- "RT5",
- "RT6",
+ "RTMIN+1",
+ "RTMIN+2",
+ "RTMIN+3",
+ "RTMAX-3",
+ "RTMAX-2",
+ "RTMAX-1",
"RTMAX",
0
};
@@ -157,11 +157,11 @@ static const char* const sig_text[] =
"Thread event",
"CPR freeze",
"CPR thaw",
- "Signal 36",
+ "Thread Cancellation",
"Resources lost",
- "Signal 38",
- "Signal 39",
- "Signal 40",
+ "Resource Control Exceeded",
+ "Reserved for JVM 1",
+ "Reserved for JVM 2",
"Realtime priority 0 (lo)",
"Realtime priority 1",
"Realtime priority 2",
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/standards b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/standards
index 8e8231de26..0078c458fb 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/standards
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/standards
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/standards by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/standards by iffe version 2008-01-31 : : */
#ifndef _def_standards_ast
#define _def_standards_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/stdio b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/stdio
index b17026ca22..9514d0aacb 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/stdio
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/stdio
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/stdio by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/stdio by iffe version 2008-01-31 : : */
#ifndef _SFSTDIO_H
#if !defined(__PROTO__)
@@ -178,7 +178,7 @@ extern __MANGLE__ int fprintf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fpurge __PROTO__((FILE*));
extern __MANGLE__ int fputc __PROTO__((int, FILE*));
extern __MANGLE__ int fputs __PROTO__((const char*, FILE*));
-extern __MANGLE__ ssize_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
extern __MANGLE__ FILE* freopen __PROTO__((const char*, const char*, FILE*));
extern __MANGLE__ int fscanf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fseek __PROTO__((FILE*, long, int));
@@ -186,7 +186,7 @@ extern __MANGLE__ int fseeko __PROTO__((FILE*, off_t, int));
extern __MANGLE__ int fsetpos __PROTO__((FILE*, const fpos_t*));
extern __MANGLE__ long ftell __PROTO__((FILE*));
extern __MANGLE__ off_t ftello __PROTO__((FILE*));
-extern __MANGLE__ ssize_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
extern __MANGLE__ int getc __PROTO__((FILE*));
extern __MANGLE__ int getchar __PROTO__((void));
extern __MANGLE__ char* gets __PROTO__((char*));
@@ -245,6 +245,10 @@ extern __MANGLE__ int getchar_unlocked __PROTO__((void));
extern __MANGLE__ int putc_unlocked __PROTO__((int, FILE*));
extern __MANGLE__ int putchar_unlocked __PROTO__((int));
+extern __MANGLE__ void flockfile __PROTO__((FILE*));
+extern __MANGLE__ int ftrylockfile __PROTO__((FILE*));
+extern __MANGLE__ void funlockfile __PROTO__((FILE*));
+
#ifdef _USE_GNU
extern __MANGLE__ int fcloseall __PROTO__((void));
@@ -324,6 +328,7 @@ extern __MANGLE__ ssize_t getline __PROTO__((char**, size_t*, FILE*));
#define vsprintf _ast_vsprintf
#define vsscanf _ast_vsscanf
#define fcloseall _ast_fcloseall
+#define _filbuf _ast__filbuf
#define fmemopen _ast_fmemopen
#define __getdelim _ast___getdelim
#define getdelim _ast_getdelim
@@ -343,6 +348,9 @@ extern __MANGLE__ ssize_t getline __PROTO__((char**, size_t*, FILE*));
#define getchar_unlocked _ast_getchar_unlocked
#define putc_unlocked _ast_putc_unlocked
#define putchar_unlocked _ast_putchar_unlocked
+#define flockfile _ast_flockfile
+#define ftrylockfile _ast_ftrylockfile
+#define funlockfile _ast_funlockfile
#if defined(__STDPP__directive) && defined(__STDPP__initial)
__STDPP__directive pragma pp:initial
@@ -402,7 +410,7 @@ extern __MANGLE__ int fprintf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fpurge __PROTO__((FILE*));
extern __MANGLE__ int fputc __PROTO__((int, FILE*));
extern __MANGLE__ int fputs __PROTO__((const char*, FILE*));
-extern __MANGLE__ ssize_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
extern __MANGLE__ FILE* freopen __PROTO__((const char*, const char*, FILE*));
extern __MANGLE__ int fscanf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fseek __PROTO__((FILE*, long, int));
@@ -410,7 +418,7 @@ extern __MANGLE__ int fseeko __PROTO__((FILE*, off_t, int));
extern __MANGLE__ int fsetpos __PROTO__((FILE*, const fpos_t*));
extern __MANGLE__ long ftell __PROTO__((FILE*));
extern __MANGLE__ off_t ftello __PROTO__((FILE*));
-extern __MANGLE__ ssize_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
extern __MANGLE__ int getc __PROTO__((FILE*));
extern __MANGLE__ int getchar __PROTO__((void));
extern __MANGLE__ char* gets __PROTO__((char*));
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/sys b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/sys
index f0a58dff12..3706d9b489 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/sys
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/sys
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/sys by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/sys by iffe version 2008-01-31 : : */
#ifndef _AST_SYS_H
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/time b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/time
index 6c57971e4b..635603a6d8 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/time
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/time
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/time by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/time by iffe version 2008-01-31 : : */
#ifndef _def_time_ast
#if !defined(__PROTO__)
@@ -76,7 +76,7 @@
#include <sys/times.h>
-#ifndef CLOCKS_PER_SEC
+#if !defined(CLOCKS_PER_SEC) && defined(CLK_TCK)
#define CLOCKS_PER_SEC CLK_TCK
#endif
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/tmlib b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/tmlib
index 7721ece7ff..794ab423e0 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/tmlib
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/tmlib
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/tmlib by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/tmlib by iffe version 2008-01-31 : : */
#ifndef _def_tmlib_ast
#if !defined(__PROTO__)
@@ -63,6 +63,9 @@
#define _def_tmlib_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define tmlocaltime(p) localtime(p)
+#define _tzset_environ 1 /* tzset() bypasses user getenv() */
+#define tmlocaltime(p) _tm_localtime(p)
+
+extern __MANGLE__ struct tm* _tm_localtime __PROTO__((const time_t*));
#endif
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/tmx b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/tmx
index 8034e1cd9e..9a5298b322 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/tmx
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/tmx
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/tmx by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/tmx by iffe version 2008-01-31 : : */
#ifndef _TMX_H
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/tty b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/tty
index 42f0c1df21..5978c7bb8c 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/tty
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/tty
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/tty by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/tty by iffe version 2008-01-31 : : */
#ifndef _def_tty_ast
#define _def_tty_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/tv b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/tv
index 6692382606..1daa582877 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/tv
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/tv
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/tv by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/tv by iffe version 2008-01-31 : : */
#ifndef _TV_H
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/tvlib b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/tvlib
index 30f4596208..ffe7ba4b9c 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/tvlib
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/tvlib
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/tvlib by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/tvlib by iffe version 2008-01-31 : : */
#ifndef _def_tvlib_ast
#define _def_tvlib_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
@@ -10,6 +10,7 @@
#define _lib_utimes 1 /* utimes() in default lib(s) */
#define _lib_nanosleep 1 /* nanosleep() in default lib(s) */
#define _lib_usleep 1 /* usleep() in default lib(s) */
+#define _sys_stat 1 /* #include <sys/stat.h> ok */
#define _sys_time 1 /* #include <sys/time.h> ok */
#define _lib_clock_gettime 1 /* execute{\ passed */
#define tmgettimeofday(p) gettimeofday(p,(struct timezone*)0)
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/types b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/types
deleted file mode 100644
index 343b5954a0..0000000000
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/types
+++ /dev/null
@@ -1,5 +0,0 @@
-/* : : generated by iffe version 2007-04-04 : : */
-#ifndef _def_types_ast
-#define _def_types_ast 1
-#define _sys_types 1 /* #include <sys/types.h> ok */
-#endif
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/uwin b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/uwin
index 40cf5bef90..53354f1751 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/uwin
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/uwin
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/uwin by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/uwin by iffe version 2008-01-31 : : */
#ifndef _def_uwin_ast
#define _def_uwin_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/vfork b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/vfork
index 901931c5ec..21f3adfa1b 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/vfork
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/vfork
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/vfork by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/vfork by iffe version 2008-01-31 : : */
#ifndef _def_vfork_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/vmalloc b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/vmalloc
index cbcde955d0..efe5591e34 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/vmalloc
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/vmalloc
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/vmalloc by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/vmalloc by iffe version 2008-01-31 : : */
#ifndef _def_vmalloc_ast
#define _def_vmalloc_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/wait b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/wait
index 96f7b01d8b..42895f7a40 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/wait
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/wait
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/wait by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/wait by iffe version 2008-01-31 : : */
#ifndef _def_wait_ast
#define _def_wait_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/wchar b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/wchar
index 6531edc5fd..998e051cc7 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/wchar
+++ b/usr/src/lib/libast/amd64/src/lib/libast/FEATURE/wchar
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/wchar by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/wchar by iffe version 2008-01-31 : : */
#ifndef _def_wchar_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/align.h b/usr/src/lib/libast/amd64/src/lib/libast/align.h
index 2172421a7d..c1d2830f65 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/align.h
+++ b/usr/src/lib/libast/amd64/src/lib/libast/align.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/align.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/align.c by iffe version 2008-01-31 : : */
#ifndef _def_align_ast
#define _def_align_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/ast_botch.h b/usr/src/lib/libast/amd64/src/lib/libast/ast_botch.h
index d70906e8be..a4073c6203 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/ast_botch.h
+++ b/usr/src/lib/libast/amd64/src/lib/libast/ast_botch.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/botch.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/botch.c by iffe version 2008-01-31 : : */
#ifndef _def_botch_ast
#define _def_botch_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/ast_ccode.h b/usr/src/lib/libast/amd64/src/lib/libast/ast_ccode.h
index 0939e42778..037e0feb43 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/ast_ccode.h
+++ b/usr/src/lib/libast/amd64/src/lib/libast/ast_ccode.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/ccode by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/ccode by iffe version 2008-01-31 : : */
#ifndef _def_ccode_ast
#define _def_ccode_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/ast_common.h b/usr/src/lib/libast/amd64/src/lib/libast/ast_common.h
index 371697b9ff..9049c4c0ad 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/ast_common.h
+++ b/usr/src/lib/libast/amd64/src/lib/libast/ast_common.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/common by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/common by iffe version 2008-01-31 : : */
#ifndef _AST_COMMON_H
#define _AST_COMMON_H 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/ast_dirent.h b/usr/src/lib/libast/amd64/src/lib/libast/ast_dirent.h
index e6f040cfb6..2079091a68 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/ast_dirent.h
+++ b/usr/src/lib/libast/amd64/src/lib/libast/ast_dirent.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/dirent by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/dirent by iffe version 2008-01-31 : : */
#ifndef _def_dirent_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/ast_fcntl.h b/usr/src/lib/libast/amd64/src/lib/libast/ast_fcntl.h
index f59e2cdbd1..81a8f188ba 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/ast_fcntl.h
+++ b/usr/src/lib/libast/amd64/src/lib/libast/ast_fcntl.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/fcntl.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/fcntl.c by iffe version 2008-01-31 : : */
#ifndef _def_fcntl_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/ast_float.h b/usr/src/lib/libast/amd64/src/lib/libast/ast_float.h
index 40d069f246..bdc61b73fa 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/ast_float.h
+++ b/usr/src/lib/libast/amd64/src/lib/libast/ast_float.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/float by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/float by iffe version 2008-01-31 : : */
#ifndef _def_float_ast
#if !defined(__PROTO__)
@@ -68,13 +68,16 @@
#define _hdr_math 1 /* #include <math.h> ok */
#define _hdr_values 1 /* #include <values.h> ok */
#define _LIB_m 1 /* -lm is a library */
+#define _lib_fpclassify 1 /* fpclassify() in default lib(s) */
#define _lib_frexp 1 /* frexp() in default lib(s) */
#define _lib_frexpl 1 /* frexpl() in default lib(s) */
#define _lib_ldexp 1 /* ldexp() in default lib(s) */
#define _lib_ldexpl 1 /* ldexpl() in default lib(s) */
#define _lib_finite 1 /* finite() in default lib(s) */
+#define _lib_isinf 1 /* isinf() in default lib(s) */
#define _lib_isnan 1 /* isnan() in default lib(s) */
#define _lib_isnanl 1 /* isnanl() in default lib(s) */
+#define _lib_signbit 1 /* signbit() in default lib(s) */
#define _lib_copysign 1 /* copysign() in default lib(s) */
#define _lib_copysignl 1 /* copysignl() in default lib(s) */
#include <ast_common.h>
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/ast_fs.h b/usr/src/lib/libast/amd64/src/lib/libast/ast_fs.h
index eb8b57cea9..8560af4f28 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/ast_fs.h
+++ b/usr/src/lib/libast/amd64/src/lib/libast/ast_fs.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/fs by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/fs by iffe version 2008-01-31 : : */
#ifndef _def_fs_ast
#if !defined(__PROTO__)
@@ -68,20 +68,9 @@
#define _lib_mknod 1 /* mknod() in default lib(s) */
#define _lib_sync 1 /* sync() in default lib(s) */
#include <sys/stat.h>
+#include <sys/mkdev.h>
#define FS_default "ufs"
#if defined(__STDPP__directive) && defined(__STDPP__initial)
-__STDPP__directive pragma pp:initial
-#endif
-#ifndef major
-#define major(x) ( major_t ) ( ( ( ( unsigned ) ( ( x ) ) ) >> 8 ) & 0x7f )
-#endif
-#ifndef minor
-#define minor(x) ( minor_t ) ( ( ( x ) ) & 0xff )
-#endif
-#ifndef makedev
-#define makedev(x,y) ( unsigned short ) ( ( ( ( x ) ) << 8 ) | ( ( ( y ) ) & 0xff ) )
-#endif
-#if defined(__STDPP__directive) && defined(__STDPP__initial)
__STDPP__directive pragma pp:noinitial
#endif
#define _hdr_stdio 1 /* #include <stdio.h> ok */
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/ast_iconv.h b/usr/src/lib/libast/amd64/src/lib/libast/ast_iconv.h
index cc251f15d2..ccd176f5f4 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/ast_iconv.h
+++ b/usr/src/lib/libast/amd64/src/lib/libast/ast_iconv.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/iconv by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/iconv by iffe version 2008-01-31 : : */
#ifndef _def_iconv_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/ast_lib.h b/usr/src/lib/libast/amd64/src/lib/libast/ast_lib.h
index a2a479c2d7..67c80dc794 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/ast_lib.h
+++ b/usr/src/lib/libast/amd64/src/lib/libast/ast_lib.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/lib by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/lib by iffe version 2008-01-31 : : */
#ifndef _def_lib_ast
#define _def_lib_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/ast_limits.h b/usr/src/lib/libast/amd64/src/lib/libast/ast_limits.h
index 7dddc39475..f3cf6b6aed 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/ast_limits.h
+++ b/usr/src/lib/libast/amd64/src/lib/libast/ast_limits.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/limits.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/limits.c by iffe version 2008-01-31 : : */
#ifndef _def_limits_ast
#define _def_limits_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/ast_map.h b/usr/src/lib/libast/amd64/src/lib/libast/ast_map.h
index 55c2ef8707..39bce9c36e 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/ast_map.h
+++ b/usr/src/lib/libast/amd64/src/lib/libast/ast_map.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/map.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/map.c by iffe version 2008-01-31 : : */
#ifndef _def_map_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
@@ -121,6 +121,14 @@ extern __MANGLE__ char* getcwd __PROTO__((char*, size_t));
#define getopt_long _ast_getopt_long
#undef getopt_long_only
#define getopt_long_only _ast_getopt_long_only
+#undef optopt
+#define optopt _ast_optopt
+#undef optarg
+#define optarg _ast_optarg
+#undef optind
+#define optind _ast_optind
+#undef opterr
+#define opterr _ast_opterr
#undef getwd
#define getwd _ast_getwd
extern __MANGLE__ char* getwd __PROTO__((char*));
@@ -146,6 +154,8 @@ extern __MANGLE__ char* mktemp __PROTO__((char*));
#define mktime _ast_mktime
#undef nftw
#define nftw _ast_nftw
+#undef optctx
+#define optctx _ast_optctx
#undef optesc
#define optesc _ast_optesc
#undef optget
@@ -274,7 +284,7 @@ extern __MANGLE__ char* realpath __PROTO__((const char*, char*));
extern __MANGLE__ int remove __PROTO__((const char*));
#undef resolvepath
#define resolvepath _ast_resolvepath
-extern __MANGLE__ char* resolvepath __PROTO__((const char*, char*, size_t));
+extern __MANGLE__ int resolvepath __PROTO__((const char*, char*, size_t));
#undef setenv
#define setenv _ast_setenv
extern __MANGLE__ int setenv __PROTO__((const char*, const char*, int));
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/ast_mmap.h b/usr/src/lib/libast/amd64/src/lib/libast/ast_mmap.h
index 10483aee18..3b628c0067 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/ast_mmap.h
+++ b/usr/src/lib/libast/amd64/src/lib/libast/ast_mmap.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/mmap by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/mmap by iffe version 2008-01-31 : : */
#ifndef _def_mmap_ast
#define _def_mmap_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/ast_mode.h b/usr/src/lib/libast/amd64/src/lib/libast/ast_mode.h
index 5476393224..50d7ceb870 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/ast_mode.h
+++ b/usr/src/lib/libast/amd64/src/lib/libast/ast_mode.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/mode.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/mode.c by iffe version 2008-01-31 : : */
#ifndef _def_mode_ast
#define _def_mode_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/ast_ndbm.h b/usr/src/lib/libast/amd64/src/lib/libast/ast_ndbm.h
new file mode 100644
index 0000000000..89a006ffb0
--- /dev/null
+++ b/usr/src/lib/libast/amd64/src/lib/libast/ast_ndbm.h
@@ -0,0 +1,9 @@
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/ndbm by iffe version 2008-01-31 : : */
+#ifndef _def_ndbm_ast
+#define _def_ndbm_ast 1
+#define _sys_types 1 /* #include <sys/types.h> ok */
+#define _hdr_ndbm 1 /* #include <ndbm.h> ok */
+#include <ndbm.h>
+#define _use_ndbm 1
+
+#endif
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/ast_nl_types.h b/usr/src/lib/libast/amd64/src/lib/libast/ast_nl_types.h
index 43c7bc9c4d..10de231889 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/ast_nl_types.h
+++ b/usr/src/lib/libast/amd64/src/lib/libast/ast_nl_types.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/nl_types by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/nl_types by iffe version 2008-01-31 : : */
#ifndef _def_nl_types_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/ast_param.h b/usr/src/lib/libast/amd64/src/lib/libast/ast_param.h
index 4c28f392e5..67b88137e9 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/ast_param.h
+++ b/usr/src/lib/libast/amd64/src/lib/libast/ast_param.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/param.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/param.sh by iffe version 2008-01-31 : : */
#ifndef _def_param_ast
#define _def_param_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/ast_standards.h b/usr/src/lib/libast/amd64/src/lib/libast/ast_standards.h
index 8e8231de26..0078c458fb 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/ast_standards.h
+++ b/usr/src/lib/libast/amd64/src/lib/libast/ast_standards.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/standards by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/standards by iffe version 2008-01-31 : : */
#ifndef _def_standards_ast
#define _def_standards_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/ast_stdio.h b/usr/src/lib/libast/amd64/src/lib/libast/ast_stdio.h
index b17026ca22..9514d0aacb 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/ast_stdio.h
+++ b/usr/src/lib/libast/amd64/src/lib/libast/ast_stdio.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/stdio by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/stdio by iffe version 2008-01-31 : : */
#ifndef _SFSTDIO_H
#if !defined(__PROTO__)
@@ -178,7 +178,7 @@ extern __MANGLE__ int fprintf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fpurge __PROTO__((FILE*));
extern __MANGLE__ int fputc __PROTO__((int, FILE*));
extern __MANGLE__ int fputs __PROTO__((const char*, FILE*));
-extern __MANGLE__ ssize_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
extern __MANGLE__ FILE* freopen __PROTO__((const char*, const char*, FILE*));
extern __MANGLE__ int fscanf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fseek __PROTO__((FILE*, long, int));
@@ -186,7 +186,7 @@ extern __MANGLE__ int fseeko __PROTO__((FILE*, off_t, int));
extern __MANGLE__ int fsetpos __PROTO__((FILE*, const fpos_t*));
extern __MANGLE__ long ftell __PROTO__((FILE*));
extern __MANGLE__ off_t ftello __PROTO__((FILE*));
-extern __MANGLE__ ssize_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
extern __MANGLE__ int getc __PROTO__((FILE*));
extern __MANGLE__ int getchar __PROTO__((void));
extern __MANGLE__ char* gets __PROTO__((char*));
@@ -245,6 +245,10 @@ extern __MANGLE__ int getchar_unlocked __PROTO__((void));
extern __MANGLE__ int putc_unlocked __PROTO__((int, FILE*));
extern __MANGLE__ int putchar_unlocked __PROTO__((int));
+extern __MANGLE__ void flockfile __PROTO__((FILE*));
+extern __MANGLE__ int ftrylockfile __PROTO__((FILE*));
+extern __MANGLE__ void funlockfile __PROTO__((FILE*));
+
#ifdef _USE_GNU
extern __MANGLE__ int fcloseall __PROTO__((void));
@@ -324,6 +328,7 @@ extern __MANGLE__ ssize_t getline __PROTO__((char**, size_t*, FILE*));
#define vsprintf _ast_vsprintf
#define vsscanf _ast_vsscanf
#define fcloseall _ast_fcloseall
+#define _filbuf _ast__filbuf
#define fmemopen _ast_fmemopen
#define __getdelim _ast___getdelim
#define getdelim _ast_getdelim
@@ -343,6 +348,9 @@ extern __MANGLE__ ssize_t getline __PROTO__((char**, size_t*, FILE*));
#define getchar_unlocked _ast_getchar_unlocked
#define putc_unlocked _ast_putc_unlocked
#define putchar_unlocked _ast_putchar_unlocked
+#define flockfile _ast_flockfile
+#define ftrylockfile _ast_ftrylockfile
+#define funlockfile _ast_funlockfile
#if defined(__STDPP__directive) && defined(__STDPP__initial)
__STDPP__directive pragma pp:initial
@@ -402,7 +410,7 @@ extern __MANGLE__ int fprintf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fpurge __PROTO__((FILE*));
extern __MANGLE__ int fputc __PROTO__((int, FILE*));
extern __MANGLE__ int fputs __PROTO__((const char*, FILE*));
-extern __MANGLE__ ssize_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
extern __MANGLE__ FILE* freopen __PROTO__((const char*, const char*, FILE*));
extern __MANGLE__ int fscanf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fseek __PROTO__((FILE*, long, int));
@@ -410,7 +418,7 @@ extern __MANGLE__ int fseeko __PROTO__((FILE*, off_t, int));
extern __MANGLE__ int fsetpos __PROTO__((FILE*, const fpos_t*));
extern __MANGLE__ long ftell __PROTO__((FILE*));
extern __MANGLE__ off_t ftello __PROTO__((FILE*));
-extern __MANGLE__ ssize_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
extern __MANGLE__ int getc __PROTO__((FILE*));
extern __MANGLE__ int getchar __PROTO__((void));
extern __MANGLE__ char* gets __PROTO__((char*));
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/ast_sys.h b/usr/src/lib/libast/amd64/src/lib/libast/ast_sys.h
index f0a58dff12..3706d9b489 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/ast_sys.h
+++ b/usr/src/lib/libast/amd64/src/lib/libast/ast_sys.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/sys by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/sys by iffe version 2008-01-31 : : */
#ifndef _AST_SYS_H
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/ast_time.h b/usr/src/lib/libast/amd64/src/lib/libast/ast_time.h
index 6c57971e4b..635603a6d8 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/ast_time.h
+++ b/usr/src/lib/libast/amd64/src/lib/libast/ast_time.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/time by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/time by iffe version 2008-01-31 : : */
#ifndef _def_time_ast
#if !defined(__PROTO__)
@@ -76,7 +76,7 @@
#include <sys/times.h>
-#ifndef CLOCKS_PER_SEC
+#if !defined(CLOCKS_PER_SEC) && defined(CLK_TCK)
#define CLOCKS_PER_SEC CLK_TCK
#endif
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/ast_tty.h b/usr/src/lib/libast/amd64/src/lib/libast/ast_tty.h
index 42f0c1df21..5978c7bb8c 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/ast_tty.h
+++ b/usr/src/lib/libast/amd64/src/lib/libast/ast_tty.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/tty by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/tty by iffe version 2008-01-31 : : */
#ifndef _def_tty_ast
#define _def_tty_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/ast_types.h b/usr/src/lib/libast/amd64/src/lib/libast/ast_types.h
deleted file mode 100644
index 343b5954a0..0000000000
--- a/usr/src/lib/libast/amd64/src/lib/libast/ast_types.h
+++ /dev/null
@@ -1,5 +0,0 @@
-/* : : generated by iffe version 2007-04-04 : : */
-#ifndef _def_types_ast
-#define _def_types_ast 1
-#define _sys_types 1 /* #include <sys/types.h> ok */
-#endif
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/ast_vfork.h b/usr/src/lib/libast/amd64/src/lib/libast/ast_vfork.h
index 901931c5ec..21f3adfa1b 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/ast_vfork.h
+++ b/usr/src/lib/libast/amd64/src/lib/libast/ast_vfork.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/vfork by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/vfork by iffe version 2008-01-31 : : */
#ifndef _def_vfork_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/ast_wait.h b/usr/src/lib/libast/amd64/src/lib/libast/ast_wait.h
index 96f7b01d8b..42895f7a40 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/ast_wait.h
+++ b/usr/src/lib/libast/amd64/src/lib/libast/ast_wait.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/wait by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/wait by iffe version 2008-01-31 : : */
#ifndef _def_wait_ast
#define _def_wait_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/ast_wchar.h b/usr/src/lib/libast/amd64/src/lib/libast/ast_wchar.h
index 6531edc5fd..998e051cc7 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/ast_wchar.h
+++ b/usr/src/lib/libast/amd64/src/lib/libast/ast_wchar.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/wchar by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/wchar by iffe version 2008-01-31 : : */
#ifndef _def_wchar_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/conftab.c b/usr/src/lib/libast/amd64/src/lib/libast/conftab.c
index b7c7769c7b..08c94bd358 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/conftab.c
+++ b/usr/src/lib/libast/amd64/src/lib/libast/conftab.c
@@ -1,63 +1,3 @@
-
-/* : : generated by proto : : */
-
-#if !defined(__PROTO__)
-# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
-# if defined(__cplusplus)
-# define __LINKAGE__ "C"
-# else
-# define __LINKAGE__
-# endif
-# define __STDARG__
-# define __PROTO__(x) x
-# define __OTORP__(x)
-# define __PARAM__(n,o) n
-# if !defined(__STDC__) && !defined(__cplusplus)
-# if !defined(c_plusplus)
-# define const
-# endif
-# define signed
-# define void int
-# define volatile
-# define __V_ char
-# else
-# define __V_ void
-# endif
-# else
-# define __PROTO__(x) ()
-# define __OTORP__(x) x
-# define __PARAM__(n,o) o
-# define __LINKAGE__
-# define __V_ char
-# define const
-# define signed
-# define void int
-# define volatile
-# endif
-# define __MANGLE__ __LINKAGE__
-# if defined(__cplusplus) || defined(c_plusplus)
-# define __VARARG__ ...
-# else
-# define __VARARG__
-# endif
-# if defined(__STDARG__)
-# define __VA_START__(p,a) va_start(p,a)
-# else
-# define __VA_START__(p,a) va_start(p)
-# endif
-# if !defined(__INLINE__)
-# if defined(__cplusplus)
-# define __INLINE__ extern __MANGLE__ inline
-# else
-# if defined(_WIN32) && !defined(__GNUC__)
-# define __INLINE__ __inline
-# endif
-# endif
-# endif
-#endif
-#if !defined(__LINKAGE__)
-#define __LINKAGE__ /* 2004-08-11 transition */
-#endif
#include "FEATURE/standards"
#include "FEATURE/common"
#include <sys/types.h>
@@ -70,7 +10,7 @@
#include "FEATURE/param"
#include "conftab.h"
-/* : : generated by conf from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/comp/conf.tab : : */
+/* : : generated by conf from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/comp/conf.tab : : */
/*
* prefix strings -- the first few are indexed by Conf_t.standard
@@ -105,111 +45,111 @@ int prefix_elements = (int)sizeof(prefix) / (int)sizeof(prefix[0]);
const Conf_t conf[] =
{
-{ "ABI_AIO_XFER_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "ABI_ASYNCHRONOUS_IO", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "ABI_ASYNC_IO", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "ADVISORY_INFO", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_ADVISORY_INFO },
-{ "AIO_LISTIO_MAX", { 0, 0 }, { _POSIX_AIO_LISTIO_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_AIO_LISTIO_MAX },
-{ "AIO_MAX", { 0, 0 }, { _POSIX_AIO_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_AIO_MAX },
-{ "AIO_PRIO_DELTA_MAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, _SC_AIO_PRIO_DELTA_MAX },
-{ "ALLOC_SIZE_MIN", { 0, 0 }, { 0, 0 }, CONF_LIMIT|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_ALLOC_SIZE_MIN },
-{ "ARCHITECTURE", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "ARG_MAX", { 0, 0 }, { _POSIX_ARG_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_ARG_MAX },
-{ "ASYNCHRONOUS_IO", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_ASYNCHRONOUS_IO },
-{ "ASYNC_IO", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_ASYNC_IO },
-{ "ATEXIT_MAX", { 0, 0 }, { 32, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_XOPEN, 1, CONF_sysconf, _SC_ATEXIT_MAX },
-{ "AUDIT", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "AVAIL_PROCESSORS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "AVPHYS_PAGES", { 0, 0 }, { 0, 0 }, 0, CONF_SUN, 1, CONF_sysconf, _SC_AVPHYS_PAGES },
-{ "BARRIERS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_BARRIERS },
-{ "BC_BASE_MAX", { 0, 0 }, { _POSIX2_BC_BASE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_BC_BASE_MAX },
-{ "BC_DIM_MAX", { 0, 0 }, { _POSIX2_BC_DIM_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_BC_DIM_MAX },
-{ "BC_SCALE_MAX", { 0, 0 }, { _POSIX2_BC_SCALE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_BC_SCALE_MAX },
-{ "BC_STRING_MAX", { 0, 0 }, { _POSIX2_BC_STRING_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_BC_STRING_MAX },
-{ "BUSTYPES", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "CHARCLASS_NAME_MAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "CHAR_BIT", { 8, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "CHAR_MAX", { 127, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "CHAR_MIN", { -128, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "CHAR_TERM", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_CHAR_TERM },
-{ "CHILD_MAX", { 0, 0 }, { _POSIX_CHILD_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_CHILD_MAX },
-{ "CHOWN_RESTRICTED", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_CHOWN_RESTRICTED },
-{ "CKPT", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "CLK_TCK", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_POSIX, 1, CONF_sysconf, _SC_CLK_TCK },
-{ "CLOCKRES_MIN", { 0, 0 }, { _POSIX_CLOCKRES_MIN, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_PREFIX_ONLY|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "CLOCKS_PER_SEC", { 1000000, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_LIMIT|CONF_LIMIT_DEF, CONF_POSIX, 1, CONF_nop, -1 },
-{ "CLOCK_SELECTION", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_CLOCK_SELECTION },
-{ "COLL_WEIGHTS_MAX", { 0, 0 }, { _POSIX2_COLL_WEIGHTS_MAX, 0 }, CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_COLL_WEIGHTS_MAX },
-{ "CPUTIME", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_CPUTIME },
-{ "CPU_KEYBITS1", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "CPU_VERSION", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "CRYPT", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_CRYPT },
-{ "C_BIND", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 2, CONF_sysconf, _SC_2_C_BIND },
-{ "C_DEV", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 2, CONF_sysconf, _SC_2_C_DEV },
-{ "C_VERSION", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 2, CONF_sysconf, _SC_2_C_VERSION },
-{ "DATAKEYS_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "DELAYTIMER_MAX", { 0, 0 }, { _POSIX_DELAYTIMER_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_DELAYTIMER_MAX },
-{ "ENH_I18N", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_ENH_I18N },
-{ "EQUIV_CLASS_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "EXEC_INTERPRETER_LENGTH", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "EXPR_NEST_MAX", { 0, 0 }, { _POSIX2_EXPR_NEST_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_EXPR_NEST_MAX },
-{ "FCHR_MAX", { 0, 0 }, { LONG_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
-{ "FILESIZEBITS", { 0, 0 }, { 0, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_FILESIZEBITS },
-{ "FILE_LOCKING", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "FORT_DEV", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_FORT_DEV },
-{ "FORT_RUN", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_FORT_RUN },
-{ "FSYNC", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_FSYNC },
-{ "GETGR_R_SIZE_MAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_sysconf, _SC_GETGR_R_SIZE_MAX },
-{ "GETPW_R_SIZE_MAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_sysconf, _SC_GETPW_R_SIZE_MAX },
-{ "HOSTID", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "HOSTNAME", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "HOST_NAME_MAX", { 0, 0 }, { _POSIX_HOST_NAME_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_HOST_NAME_MAX },
-{ "HW_PROVIDER", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "HW_SERIAL", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "ILP32_OFF32", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XBS5, 1, CONF_sysconf, -1 },
+{ "ABI_AIO_XFER_MAX", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "ABI_ASYNCHRONOUS_IO", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "ABI_ASYNC_IO", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "ADVISORY_INFO", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_ADVISORY_INFO },
+{ "AIO_LISTIO_MAX", { 0UL, 0 }, { _POSIX_AIO_LISTIO_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_AIO_LISTIO_MAX },
+{ "AIO_MAX", { 0UL, 0 }, { _POSIX_AIO_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_AIO_MAX },
+{ "AIO_PRIO_DELTA_MAX", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, _SC_AIO_PRIO_DELTA_MAX },
+{ "ALLOC_SIZE_MIN", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_ALLOC_SIZE_MIN },
+{ "ARCHITECTURE", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, SI_ARCHITECTURE },
+{ "ARG_MAX", { 0UL, 0 }, { _POSIX_ARG_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_ARG_MAX },
+{ "ASYNCHRONOUS_IO", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_ASYNCHRONOUS_IO },
+{ "ASYNC_IO", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_ASYNC_IO },
+{ "ATEXIT_MAX", { 0UL, 0 }, { 32UL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_XOPEN, 1, CONF_sysconf, _SC_ATEXIT_MAX },
+{ "AUDIT", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "AVAIL_PROCESSORS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "AVPHYS_PAGES", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SUN, 1, CONF_sysconf, _SC_AVPHYS_PAGES },
+{ "BARRIERS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_BARRIERS },
+{ "BC_BASE_MAX", { 0UL, 0 }, { _POSIX2_BC_BASE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_BC_BASE_MAX },
+{ "BC_DIM_MAX", { 0UL, 0 }, { _POSIX2_BC_DIM_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_BC_DIM_MAX },
+{ "BC_SCALE_MAX", { 0UL, 0 }, { _POSIX2_BC_SCALE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_BC_SCALE_MAX },
+{ "BC_STRING_MAX", { 0UL, 0 }, { _POSIX2_BC_STRING_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_BC_STRING_MAX },
+{ "BUSTYPES", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
+{ "CHARCLASS_NAME_MAX", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "CHAR_BIT", { 8UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "CHAR_MAX", { 127UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "CHAR_MIN", { -127L-1L, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "CHAR_TERM", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_CHAR_TERM },
+{ "CHILD_MAX", { 0UL, 0 }, { _POSIX_CHILD_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_CHILD_MAX },
+{ "CHOWN_RESTRICTED", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_CHOWN_RESTRICTED },
+{ "CKPT", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "CLK_TCK", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_POSIX, 1, CONF_sysconf, _SC_CLK_TCK },
+{ "CLOCKRES_MIN", { 0UL, 0 }, { _POSIX_CLOCKRES_MIN, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_PREFIX_ONLY|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "CLOCKS_PER_SEC", { 1000000UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_LIMIT|CONF_LIMIT_DEF, CONF_POSIX, 1, CONF_nop, -1 },
+{ "CLOCK_SELECTION", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_CLOCK_SELECTION },
+{ "COLL_WEIGHTS_MAX", { 0UL, 0 }, { _POSIX2_COLL_WEIGHTS_MAX, 0 }, CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_COLL_WEIGHTS_MAX },
+{ "CPUTIME", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_CPUTIME },
+{ "CPU_KEYBITS1", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "CPU_VERSION", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "CRYPT", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_CRYPT },
+{ "C_BIND", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 2, CONF_sysconf, _SC_2_C_BIND },
+{ "C_DEV", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 2, CONF_sysconf, _SC_2_C_DEV },
+{ "C_VERSION", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 2, CONF_sysconf, _SC_2_C_VERSION },
+{ "DATAKEYS_MAX", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "DELAYTIMER_MAX", { 0UL, 0 }, { _POSIX_DELAYTIMER_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_DELAYTIMER_MAX },
+{ "ENH_I18N", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_ENH_I18N },
+{ "EQUIV_CLASS_MAX", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "EXEC_INTERPRETER_LENGTH", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "EXPR_NEST_MAX", { 0UL, 0 }, { _POSIX2_EXPR_NEST_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_EXPR_NEST_MAX },
+{ "FCHR_MAX", { 0UL, 0 }, { LONG_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
+{ "FILESIZEBITS", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_FILESIZEBITS },
+{ "FILE_LOCKING", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "FORT_DEV", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_FORT_DEV },
+{ "FORT_RUN", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_FORT_RUN },
+{ "FSYNC", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_FSYNC },
+{ "GETGR_R_SIZE_MAX", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_C, 1, CONF_sysconf, _SC_GETGR_R_SIZE_MAX },
+{ "GETPW_R_SIZE_MAX", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_C, 1, CONF_sysconf, _SC_GETPW_R_SIZE_MAX },
+{ "HOSTID", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "HOSTNAME", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, SI_HOSTNAME },
+{ "HOST_NAME_MAX", { 0UL, 0 }, { _POSIX_HOST_NAME_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_HOST_NAME_MAX },
+{ "HW_PROVIDER", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, SI_HW_PROVIDER },
+{ "HW_SERIAL", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "ILP32_OFF32", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XBS5, 1, CONF_sysconf, -1 },
{ "ILP32_OFF32_CFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "ILP32_OFF32_LDFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "ILP32_OFF32_LIBS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "ILP32_OFF32_LINTFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
-{ "ILP32_OFFBIG", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XBS5, 1, CONF_sysconf, -1 },
+{ "ILP32_OFFBIG", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XBS5, 1, CONF_sysconf, -1 },
{ "ILP32_OFFBIG_CFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "ILP32_OFFBIG_LDFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "ILP32_OFFBIG_LIBS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "ILP32_OFFBIG_LINTFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
-{ "INITTAB_NAME", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "INT_MAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
-{ "INT_MIN", { -2147483648, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "IOV_MAX", { 0, 0 }, { _XOPEN_IOV_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_XOPEN, 1, CONF_sysconf, _SC_IOV_MAX },
-{ "IO_TYPE", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "IPV6", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_IPV6 },
-{ "IP_SECOPTS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "JOB_CONTROL", { 0, 0 }, { 1, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_JOB_CONTROL },
-{ "KERNEL_CLIST", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_CLIST_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_DISK", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_DISK_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_DMABUF", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_DMABUF_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_FILE", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_FILE_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_FLCKREC", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_FLCKREC_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_INODE", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_INODE_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_MOUNT", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_MOUNT_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_PINODE", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_PINODE_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_PROC", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_PROC_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_REGION", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_REGION_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_S5INODE", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_S5INODE_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_STAMP", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "KERN_POINTERS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "KERN_SIM", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "LEGACY", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, -1 },
+{ "INITTAB_NAME", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
+{ "INT_MAX", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
+{ "INT_MIN", { -2147483647L-1L, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "IOV_MAX", { 0UL, 0 }, { _XOPEN_IOV_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_XOPEN, 1, CONF_sysconf, _SC_IOV_MAX },
+{ "IO_TYPE", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "IPV6", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_IPV6 },
+{ "IP_SECOPTS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "JOB_CONTROL", { 0UL, 0 }, { 1UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_JOB_CONTROL },
+{ "KERNEL_CLIST", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_CLIST_MAX", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_DISK", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_DISK_MAX", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_DMABUF", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_DMABUF_MAX", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_FILE", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_FILE_MAX", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_FLCKREC", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_FLCKREC_MAX", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_INODE", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_INODE_MAX", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_MOUNT", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_MOUNT_MAX", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_PINODE", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_PINODE_MAX", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_PROC", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_PROC_MAX", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_REGION", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_REGION_MAX", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_S5INODE", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_S5INODE_MAX", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_STAMP", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
+{ "KERN_POINTERS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "KERN_SIM", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "LEGACY", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, -1 },
{ "LFS64_CFLAGS", { 0, 0 }, { 0, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING, CONF_POSIX, 1, CONF_confstr, _CS_LFS64_CFLAGS },
{ "LFS64_LDFLAGS", { 0, 0 }, { 0, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING, CONF_POSIX, 1, CONF_confstr, _CS_LFS64_LDFLAGS },
{ "LFS64_LIBS", { 0, 0 }, { 0, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING, CONF_POSIX, 1, CONF_confstr, _CS_LFS64_LIBS },
@@ -218,234 +158,234 @@ const Conf_t conf[] =
{ "LFS_LDFLAGS", { 0, 0 }, { 0, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING, CONF_POSIX, 1, CONF_confstr, _CS_LFS_LDFLAGS },
{ "LFS_LIBS", { 0, 0 }, { 0, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING, CONF_POSIX, 1, CONF_confstr, _CS_LFS_LIBS },
{ "LFS_LINTFLAGS", { 0, 0 }, { 0, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING, CONF_POSIX, 1, CONF_confstr, _CS_LFS_LINTFLAGS },
-{ "LINE_MAX", { 0, 0 }, { _POSIX2_LINE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_LINE_MAX },
-{ "LINK_MAX", { 0, 0 }, { _POSIX_LINK_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_LINK_MAX },
-{ "LLONG_MAX", { 9223372036854775807LL, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "LLONG_MIN", { (-9223372036854775807LL-1LL), 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "LOCALEDEF", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_LOCALEDEF },
-{ "LOGIN_NAME_MAX", { 0, 0 }, { _POSIX_LOGIN_NAME_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_LOGIN_NAME_MAX },
-{ "LOGNAME_MAX", { 0, 0 }, { 8, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, _SC_LOGNAME_MAX },
-{ "LONG_BIT", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "LONG_MAX", { 2147483647, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "LONG_MIN", { -2147483648, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "LP64_OFF64", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XBS5, 1, CONF_sysconf, -1 },
+{ "LINE_MAX", { 0UL, 0 }, { _POSIX2_LINE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_LINE_MAX },
+{ "LINK_MAX", { 0UL, 0 }, { _POSIX_LINK_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_LINK_MAX },
+{ "LLONG_MAX", { 9223372036854775807UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "LLONG_MIN", { -9223372036854775807L-1L, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "LOCALEDEF", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_LOCALEDEF },
+{ "LOGIN_NAME_MAX", { 0UL, 0 }, { _POSIX_LOGIN_NAME_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_LOGIN_NAME_MAX },
+{ "LOGNAME_MAX", { 0UL, 0 }, { 8UL, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, _SC_LOGNAME_MAX },
+{ "LONG_BIT", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "LONG_MAX", { 2147483647UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "LONG_MIN", { -2147483647L-1L, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "LP64_OFF64", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XBS5, 1, CONF_sysconf, -1 },
{ "LP64_OFF64_CFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "LP64_OFF64_LDFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "LP64_OFF64_LIBS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "LP64_OFF64_LINTFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
-{ "LPBIG_OFFBIG", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XBS5, 1, CONF_sysconf, -1 },
+{ "LPBIG_OFFBIG", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XBS5, 1, CONF_sysconf, -1 },
{ "LPBIG_OFFBIG_CFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "LPBIG_OFFBIG_LDFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "LPBIG_OFFBIG_LIBS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "LPBIG_OFFBIG_LINTFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
-{ "MACHINE", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "MAPPED_FILES", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MAPPED_FILES },
-{ "MAX_CANON", { 0, 0 }, { _POSIX_MAX_CANON, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_MAX_CANON },
-{ "MAX_INPUT", { 0, 0 }, { _POSIX_MAX_INPUT, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_MAX_INPUT },
-{ "MB_LEN_MAX", { 5, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "MCAS_OFFSET", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "MEMLOCK", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MEMLOCK },
-{ "MEMLOCK_RANGE", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MEMLOCK_RANGE },
-{ "MEMORY_PROTECTION", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MEMORY_PROTECTION },
-{ "MESSAGE_PASSING", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MESSAGE_PASSING },
-{ "MMAP_FIXED_ALIGNMENT", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "MONOTONIC_CLOCK", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MONOTONIC_CLOCK },
-{ "MQ_OPEN_MAX", { 0, 0 }, { _POSIX_MQ_OPEN_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_MQ_OPEN_MAX },
-{ "MQ_PRIO_MAX", { 0, 0 }, { _POSIX_MQ_PRIO_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_MQ_PRIO_MAX },
-{ "MSEM_LOCKID", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "MULTI_PROCESS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "NACLS_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SVID, 1, CONF_sysconf, -1 },
-{ "NAME_MAX", { 0, 0 }, { _POSIX_NAME_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_NAME_MAX },
-{ "NGROUPS_MAX", { 0, 0 }, { _POSIX_NGROUPS_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_NGROUPS_MAX },
-{ "NL_ARGMAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "NL_LANGMAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "NL_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "NL_MSGMAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "NL_NMAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "NL_SETMAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "NL_SPECMAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "NL_TEXTMAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "NO_TRUNC", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_NO_TRUNC },
-{ "NPROCESSORS_CONF", { 0, 0 }, { 0, 0 }, 0, CONF_SVID, 1, CONF_sysconf, _SC_NPROCESSORS_CONF },
-{ "NPROCESSORS_ONLN", { 0, 0 }, { 0, 0 }, 0, CONF_SVID, 1, CONF_sysconf, _SC_NPROCESSORS_ONLN },
-{ "NPROC_CONF", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "NPROC_ONLN", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "NSS_BUFLEN_GROUP", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "NSS_BUFLEN_PASSWD", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "NUM_PROCESSORS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "NZERO", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "OPEN_MAX", { 0, 0 }, { _POSIX_OPEN_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_OPEN_MAX },
-{ "OPEN_MAX_CEIL", { OPEN_MAX, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_AST, 1, CONF_nop, -1 },
-{ "OSREL_MAJ", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "OSREL_MIN", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "OSREL_PATCH", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "OS_BASE", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "OS_PROVIDER", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "OS_VERSION", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE, CONF_AES, 1, CONF_sysconf, -1 },
-{ "PAGESIZE", { 0, 0 }, { 4096, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_PAGESIZE },
-{ "PAGE_SIZE", { 0, 0 }, { 0, 0 }, CONF_MINMAX|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, _SC_PAGE_SIZE },
-{ "PASS_MAX", { 0, 0 }, { 8, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, _SC_PASS_MAX },
+{ "MACHINE", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, SI_MACHINE },
+{ "MAPPED_FILES", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MAPPED_FILES },
+{ "MAX_CANON", { 0UL, 0 }, { _POSIX_MAX_CANON, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_MAX_CANON },
+{ "MAX_INPUT", { 0UL, 0 }, { _POSIX_MAX_INPUT, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_MAX_INPUT },
+{ "MB_LEN_MAX", { 5UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "MCAS_OFFSET", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "MEMLOCK", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MEMLOCK },
+{ "MEMLOCK_RANGE", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MEMLOCK_RANGE },
+{ "MEMORY_PROTECTION", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MEMORY_PROTECTION },
+{ "MESSAGE_PASSING", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MESSAGE_PASSING },
+{ "MMAP_FIXED_ALIGNMENT", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "MONOTONIC_CLOCK", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MONOTONIC_CLOCK },
+{ "MQ_OPEN_MAX", { 0UL, 0 }, { _POSIX_MQ_OPEN_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_MQ_OPEN_MAX },
+{ "MQ_PRIO_MAX", { 0UL, 0 }, { _POSIX_MQ_PRIO_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_MQ_PRIO_MAX },
+{ "MSEM_LOCKID", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "MULTI_PROCESS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "NACLS_MAX", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SVID, 1, CONF_sysconf, -1 },
+{ "NAME_MAX", { 0UL, 0 }, { _POSIX_NAME_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_NAME_MAX },
+{ "NGROUPS_MAX", { 0UL, 0 }, { _POSIX_NGROUPS_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_NGROUPS_MAX },
+{ "NL_ARGMAX", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "NL_LANGMAX", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "NL_MAX", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "NL_MSGMAX", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "NL_NMAX", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "NL_SETMAX", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "NL_SPECMAX", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "NL_TEXTMAX", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "NO_TRUNC", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_NO_TRUNC },
+{ "NPROCESSORS_CONF", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SVID, 1, CONF_sysconf, _SC_NPROCESSORS_CONF },
+{ "NPROCESSORS_ONLN", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SVID, 1, CONF_sysconf, _SC_NPROCESSORS_ONLN },
+{ "NPROC_CONF", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "NPROC_ONLN", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "NSS_BUFLEN_GROUP", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "NSS_BUFLEN_PASSWD", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "NUM_PROCESSORS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "NZERO", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "OPEN_MAX", { 0UL, 0 }, { _POSIX_OPEN_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_OPEN_MAX },
+{ "OPEN_MAX_CEIL", { OPEN_MAX, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_AST, 1, CONF_nop, -1 },
+{ "OSREL_MAJ", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "OSREL_MIN", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "OSREL_PATCH", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "OS_BASE", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
+{ "OS_PROVIDER", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
+{ "OS_VERSION", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE, CONF_AES, 1, CONF_sysconf, -1 },
+{ "PAGESIZE", { 0UL, 0 }, { 4096UL, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_PAGESIZE },
+{ "PAGE_SIZE", { 0UL, 0 }, { 0UL, 0 }, CONF_MINMAX|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, _SC_PAGE_SIZE },
+{ "PASS_MAX", { 0UL, 0 }, { 8UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, _SC_PASS_MAX },
{ "PATH", { 0, 0 }, { 0, "/bin:/usr/bin" }, CONF_DEFER_CALL|CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_confstr, _CS_PATH },
-{ "PATH_MAX", { 0, 0 }, { _POSIX_PATH_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_PATH_MAX },
-{ "PBS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS },
-{ "PBS_ACCOUNTING", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_ACCOUNTING },
-{ "PBS_CHECKPOINT", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_CHECKPOINT },
-{ "PBS_LOCATE", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_LOCATE },
-{ "PBS_MESSAGE", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_MESSAGE },
-{ "PBS_TRACK", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_TRACK },
-{ "PHYS_PAGES", { 0, 0 }, { 0, 0 }, 0, CONF_SUN, 1, CONF_sysconf, _SC_PHYS_PAGES },
-{ "PID_MAX", { 0, 0 }, { 30000, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
-{ "PII", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PII_INTERNET", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PII_INTERNET_DGRAM", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PII_INTERNET_STREAM", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PII_OSI", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PII_OSI_CLTS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PII_OSI_COTS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PII_OSI_M", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PII_SOCKET", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PII_XTI", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PIPE_BUF", { 0, 0 }, { _POSIX_PIPE_BUF, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_PIPE_BUF },
-{ "POLL", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PRIORITIZED_IO", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_PRIORITIZED_IO },
-{ "PRIORITY_SCHEDULING", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_PRIORITY_SCHEDULING },
-{ "PRIO_IO", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_PRIO_IO },
-{ "PROC_RSRC_MGR", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "PTHREAD_DESTRUCTOR_ITERATIONS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "PTHREAD_KEYS_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "PTHREAD_STACK_MIN", { 4096, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_LIMIT|CONF_LIMIT_DEF, CONF_POSIX, 1, CONF_nop, -1 },
-{ "PTHREAD_THREADS_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "PTRDIFF_MAX", { 9223372036854775807LL, 0 }, { 65535, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_LIMIT_DEF|CONF_MINMAX_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "PTRDIFF_MIN", { (-9223372036854775807LL-1LL), 0 }, { -65535, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_LIMIT_DEF|CONF_MINMAX_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "RAW_SOCKETS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_RAW_SOCKETS },
-{ "READER_WRITER_LOCKS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_READER_WRITER_LOCKS },
-{ "REALTIME", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, -1 },
-{ "REALTIME_SIGNALS", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_REALTIME_SIGNALS },
-{ "REALTIME_THREADS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, -1 },
-{ "REC_INCR_XFER_SIZE", { 0, 0 }, { 0, 0 }, CONF_LIMIT|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_REC_INCR_XFER_SIZE },
-{ "REC_MAX_XFER_SIZE", { 0, 0 }, { 0, 0 }, CONF_LIMIT|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_REC_MAX_XFER_SIZE },
-{ "REC_MIN_XFER_SIZE", { 0, 0 }, { 0, 0 }, CONF_LIMIT|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_REC_MIN_XFER_SIZE },
-{ "REC_XFER_ALIGN", { 0, 0 }, { 0, 0 }, CONF_LIMIT|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_REC_XFER_ALIGN },
-{ "REENTRANT_FUNCTIONS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "REGEXP", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_REGEXP },
-{ "REGEX_VERSION", { 0, 0 }, { 20030916, 0 }, CONF_FEATURE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "RELEASE", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "RESOURCE_LIMITS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "RE_DUP_MAX", { 0, 0 }, { _POSIX2_RE_DUP_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_RE_DUP_MAX },
-{ "RTSIG_MAX", { 0, 0 }, { _POSIX_RTSIG_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_RTSIG_MAX },
-{ "SAVED_IDS", { 0, 0 }, { 1, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SAVED_IDS },
-{ "SCHAR_MAX", { 127, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "SCHAR_MIN", { -128, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "SECURITY_CLASS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "SELECT", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "SEMAPHORES", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SEMAPHORES },
-{ "SEM_NSEMS_MAX", { 0, 0 }, { _POSIX_SEM_NSEMS_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_SEM_NSEMS_MAX },
-{ "SEM_VALUE_MAX", { 0, 0 }, { _POSIX_SEM_VALUE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_SEM_VALUE_MAX },
+{ "PATH_MAX", { 0UL, 0 }, { _POSIX_PATH_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_PATH_MAX },
+{ "PBS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS },
+{ "PBS_ACCOUNTING", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_ACCOUNTING },
+{ "PBS_CHECKPOINT", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_CHECKPOINT },
+{ "PBS_LOCATE", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_LOCATE },
+{ "PBS_MESSAGE", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_MESSAGE },
+{ "PBS_TRACK", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_TRACK },
+{ "PHYS_PAGES", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SUN, 1, CONF_sysconf, _SC_PHYS_PAGES },
+{ "PID_MAX", { 0UL, 0 }, { 30000UL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
+{ "PII", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PII_INTERNET", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PII_INTERNET_DGRAM", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PII_INTERNET_STREAM", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PII_OSI", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PII_OSI_CLTS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PII_OSI_COTS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PII_OSI_M", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PII_SOCKET", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PII_XTI", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PIPE_BUF", { 0UL, 0 }, { _POSIX_PIPE_BUF, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_PIPE_BUF },
+{ "POLL", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PRIORITIZED_IO", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_PRIORITIZED_IO },
+{ "PRIORITY_SCHEDULING", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_PRIORITY_SCHEDULING },
+{ "PRIO_IO", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_PRIO_IO },
+{ "PROC_RSRC_MGR", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "PTHREAD_DESTRUCTOR_ITERATIONS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "PTHREAD_KEYS_MAX", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "PTHREAD_STACK_MIN", { 4096UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_LIMIT|CONF_LIMIT_DEF, CONF_POSIX, 1, CONF_nop, -1 },
+{ "PTHREAD_THREADS_MAX", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "PTRDIFF_MAX", { 9223372036854775807UL, 0 }, { 65535UL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_LIMIT_DEF|CONF_MINMAX_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "PTRDIFF_MIN", { -9223372036854775807L-1L, 0 }, { -65535L, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_LIMIT_DEF|CONF_MINMAX_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "RAW_SOCKETS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_RAW_SOCKETS },
+{ "READER_WRITER_LOCKS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_READER_WRITER_LOCKS },
+{ "REALTIME", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, -1 },
+{ "REALTIME_SIGNALS", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_REALTIME_SIGNALS },
+{ "REALTIME_THREADS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, -1 },
+{ "REC_INCR_XFER_SIZE", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_REC_INCR_XFER_SIZE },
+{ "REC_MAX_XFER_SIZE", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_REC_MAX_XFER_SIZE },
+{ "REC_MIN_XFER_SIZE", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_REC_MIN_XFER_SIZE },
+{ "REC_XFER_ALIGN", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_REC_XFER_ALIGN },
+{ "REENTRANT_FUNCTIONS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "REGEXP", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_REGEXP },
+{ "REGEX_VERSION", { 0UL, 0 }, { 20030916UL, 0 }, CONF_FEATURE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "RELEASE", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_AST, 1, CONF_nop, -1 },
+{ "RESOURCE_LIMITS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "RE_DUP_MAX", { 0UL, 0 }, { _POSIX2_RE_DUP_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_RE_DUP_MAX },
+{ "RTSIG_MAX", { 0UL, 0 }, { _POSIX_RTSIG_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_RTSIG_MAX },
+{ "SAVED_IDS", { 0UL, 0 }, { 1UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SAVED_IDS },
+{ "SCHAR_MAX", { 127UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "SCHAR_MIN", { -127L-1L, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "SECURITY_CLASS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "SELECT", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "SEMAPHORES", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SEMAPHORES },
+{ "SEM_NSEMS_MAX", { 0UL, 0 }, { _POSIX_SEM_NSEMS_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_SEM_NSEMS_MAX },
+{ "SEM_VALUE_MAX", { 0UL, 0 }, { _POSIX_SEM_VALUE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_SEM_VALUE_MAX },
{ "SH", { 0, 0 }, { 0, "/bin/sh" }, CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING|CONF_MINMAX_DEF, CONF_AST, 1, CONF_confstr, -1 },
-{ "SHARED_MEMORY_OBJECTS", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SHARED_MEMORY_OBJECTS },
-{ "SHELL", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SHELL },
-{ "SHM", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_SHM },
-{ "SHRT_MAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
-{ "SHRT_MIN", { -32768, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "SIGQUEUE_MAX", { 0, 0 }, { _POSIX_SIGQUEUE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_SIGQUEUE_MAX },
-{ "SIGRT_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SVID, 1, CONF_sysconf, _SC_SIGRT_MAX },
-{ "SIGRT_MIN", { 0, 0 }, { 0, 0 }, 0, CONF_SVID, 1, CONF_sysconf, _SC_SIGRT_MIN },
-{ "SIG_ATOMIC_MAX", { 2147483647, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "SIG_ATOMIC_MIN", { -2147483648, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "SIZE_MAX", { UINT_MAX, 0 }, { 65535, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_LIMIT_DEF|CONF_MINMAX_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "SLVM_MAXNODES", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "SOCK_MAXBUF", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "SOFTPOWER", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "SPAWN", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SPAWN },
-{ "SPIN_LOCKS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SPIN_LOCKS },
-{ "SPORADIC_SERVER", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SPORADIC_SERVER },
-{ "SRPC_DOMAIN", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "SHARED_MEMORY_OBJECTS", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SHARED_MEMORY_OBJECTS },
+{ "SHELL", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SHELL },
+{ "SHM", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_SHM },
+{ "SHRT_MAX", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
+{ "SHRT_MIN", { -32767L-1L, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "SIGQUEUE_MAX", { 0UL, 0 }, { _POSIX_SIGQUEUE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_SIGQUEUE_MAX },
+{ "SIGRT_MAX", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SVID, 1, CONF_sysconf, _SC_SIGRT_MAX },
+{ "SIGRT_MIN", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SVID, 1, CONF_sysconf, _SC_SIGRT_MIN },
+{ "SIG_ATOMIC_MAX", { 2147483647UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "SIG_ATOMIC_MIN", { -2147483647L-1L, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "SIZE_MAX", { UINT_MAX, 0 }, { 65535UL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_LIMIT_DEF|CONF_MINMAX_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "SLVM_MAXNODES", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "SOCK_MAXBUF", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "SOFTPOWER", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "SPAWN", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SPAWN },
+{ "SPIN_LOCKS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SPIN_LOCKS },
+{ "SPORADIC_SERVER", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SPORADIC_SERVER },
+{ "SRPC_DOMAIN", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
{ "SSIZE_MAX", { INT_MAX, 0 }, { _POSIX_SSIZE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_LIMIT_DEF|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_nop, -1 },
-{ "SS_REPL_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SS_REPL_MAX },
-{ "STD_BLK", { 0, 0 }, { 1024, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
-{ "STREAMS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_STREAMS },
-{ "STREAM_MAX", { 0, 0 }, { _POSIX_STREAM_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_STREAM_MAX },
-{ "SW_DEV", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_SW_DEV },
-{ "SYMLINKS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_pathconf, _PC_2_SYMLINKS },
-{ "SYMLINK_MAX", { 0, 0 }, { _POSIX_SYMLINK_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_SYMLINK_MAX },
-{ "SYMLOOP_MAX", { 0, 0 }, { _POSIX_SYMLOOP_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_SYMLOOP_MAX },
-{ "SYNCHRONIZED_IO", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SYNCHRONIZED_IO },
-{ "SYNC_IO", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_SYNC_IO },
-{ "SYSNAME", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "SYSPID_MAX", { 0, 0 }, { 2, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
-{ "THREADS", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREADS },
-{ "THREADS_PRIO_CEILING", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "THREADS_PRIO_INHERIT", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "THREAD_ATTR_STACKADDR", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_ATTR_STACKADDR },
-{ "THREAD_ATTR_STACKSIZE", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_ATTR_STACKSIZE },
-{ "THREAD_CPUTIME", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_CPUTIME },
-{ "THREAD_DESTRUCTOR_ITERATIONS", { 0, 0 }, { _POSIX_THREAD_DESTRUCTOR_ITERATIONS, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_PREFIX_ONLY|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_DESTRUCTOR_ITERATIONS },
-{ "THREAD_KEYS_MAX", { 0, 0 }, { _POSIX_THREAD_KEYS_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_PREFIX_ONLY|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_KEYS_MAX },
-{ "THREAD_PRIORITY_SCHEDULING", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_PRIORITY_SCHEDULING },
-{ "THREAD_PRIO_INHERIT", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_PRIO_INHERIT },
-{ "THREAD_PRIO_PROTECT", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_PRIO_PROTECT },
-{ "THREAD_PROCESS_SHARED", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_PROCESS_SHARED },
-{ "THREAD_SAFE_FUNCTIONS", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_SAFE_FUNCTIONS },
-{ "THREAD_SPORADIC_SERVER", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_SPORADIC_SERVER },
-{ "THREAD_STACK_MIN", { 0, 0 }, { 0, 0 }, CONF_LIMIT|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_STACK_MIN },
-{ "THREAD_THREADS_MAX", { 0, 0 }, { _POSIX_THREAD_THREADS_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_PREFIX_ONLY|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_THREADS_MAX },
-{ "TIMEOUTS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TIMEOUTS },
-{ "TIMERS", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TIMERS },
-{ "TIMER_MAX", { 0, 0 }, { _POSIX_TIMER_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_TIMER_MAX },
+{ "SS_REPL_MAX", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SS_REPL_MAX },
+{ "STD_BLK", { 0UL, 0 }, { 1024UL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
+{ "STREAMS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_STREAMS },
+{ "STREAM_MAX", { 0UL, 0 }, { _POSIX_STREAM_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_STREAM_MAX },
+{ "SW_DEV", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_SW_DEV },
+{ "SYMLINKS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_pathconf, _PC_2_SYMLINKS },
+{ "SYMLINK_MAX", { 0UL, 0 }, { _POSIX_SYMLINK_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_SYMLINK_MAX },
+{ "SYMLOOP_MAX", { 0UL, 0 }, { _POSIX_SYMLOOP_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_SYMLOOP_MAX },
+{ "SYNCHRONIZED_IO", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SYNCHRONIZED_IO },
+{ "SYNC_IO", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_SYNC_IO },
+{ "SYSNAME", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, SI_SYSNAME },
+{ "SYSPID_MAX", { 0UL, 0 }, { 2UL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
+{ "THREADS", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREADS },
+{ "THREADS_PRIO_CEILING", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "THREADS_PRIO_INHERIT", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "THREAD_ATTR_STACKADDR", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_ATTR_STACKADDR },
+{ "THREAD_ATTR_STACKSIZE", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_ATTR_STACKSIZE },
+{ "THREAD_CPUTIME", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_CPUTIME },
+{ "THREAD_DESTRUCTOR_ITERATIONS", { 0UL, 0 }, { _POSIX_THREAD_DESTRUCTOR_ITERATIONS, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_PREFIX_ONLY|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_DESTRUCTOR_ITERATIONS },
+{ "THREAD_KEYS_MAX", { 0UL, 0 }, { _POSIX_THREAD_KEYS_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_PREFIX_ONLY|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_KEYS_MAX },
+{ "THREAD_PRIORITY_SCHEDULING", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_PRIORITY_SCHEDULING },
+{ "THREAD_PRIO_INHERIT", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_PRIO_INHERIT },
+{ "THREAD_PRIO_PROTECT", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_PRIO_PROTECT },
+{ "THREAD_PROCESS_SHARED", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_PROCESS_SHARED },
+{ "THREAD_SAFE_FUNCTIONS", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_SAFE_FUNCTIONS },
+{ "THREAD_SPORADIC_SERVER", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_SPORADIC_SERVER },
+{ "THREAD_STACK_MIN", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_STACK_MIN },
+{ "THREAD_THREADS_MAX", { 0UL, 0 }, { _POSIX_THREAD_THREADS_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_PREFIX_ONLY|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_THREADS_MAX },
+{ "TIMEOUTS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TIMEOUTS },
+{ "TIMERS", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TIMERS },
+{ "TIMER_MAX", { 0UL, 0 }, { _POSIX_TIMER_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_TIMER_MAX },
{ "TMP", { 0, 0 }, { 0, "/tmp" }, CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING|CONF_MINMAX_DEF, CONF_AST, 1, CONF_confstr, -1 },
-{ "TMP_MAX", { 17576, 0 }, { 10000, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_LIMIT_DEF|CONF_MINMAX_DEF, CONF_C, 1, CONF_sysconf, -1 },
-{ "TRACE", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE },
-{ "TRACE_EVENT_FILTER", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_EVENT_FILTER },
-{ "TRACE_EVENT_NAME_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_EVENT_NAME_MAX },
-{ "TRACE_INHERIT", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_INHERIT },
-{ "TRACE_LOG", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_LOG },
-{ "TRACE_NAME_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_NAME_MAX },
-{ "TRACE_SYS_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_SYS_MAX },
-{ "TRACE_USER_EVENT_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_USER_EVENT_MAX },
-{ "TTY_NAME_MAX", { 0, 0 }, { _POSIX_TTY_NAME_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_TTY_NAME_MAX },
-{ "TYPED_MEMORY_OBJECTS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TYPED_MEMORY_OBJECTS },
-{ "TZNAME_MAX", { 0, 0 }, { _POSIX_TZNAME_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_TZNAME_MAX },
-{ "T_IOV_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_C, 1, CONF_sysconf, _SC_T_IOV_MAX },
-{ "UCHAR_MAX", { 255, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "UCHAR_MIN", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
-{ "UID_MAX", { 0, 0 }, { 60002, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
-{ "UINT_MAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
-{ "UIO_MAXIOV", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "ULLONG_MAX", { 18446744073709551615ULL, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "ULONG_MAX", { 4294967295, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "UNIX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_UNIX },
-{ "UPE", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_UPE },
-{ "USER_LIMIT", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "USHRT_MAX", { 65535, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "V6_ILP32_OFF32", { 0, 0 }, { 0, 0 }, CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_V6_ILP32_OFF32 },
-{ "V6_ILP32_OFFBIG", { 0, 0 }, { 0, 0 }, CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_V6_ILP32_OFFBIG },
-{ "V6_LP64_OFF64", { 0, 0 }, { 0, 0 }, CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_V6_LP64_OFF64 },
-{ "V6_LPBIG_OFFBIG", { 0, 0 }, { 0, 0 }, CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_V6_LPBIG_OFFBIG },
-{ "VDISABLE", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_VDISABLE },
+{ "TMP_MAX", { 17576UL, 0 }, { 10000UL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_LIMIT_DEF|CONF_MINMAX_DEF, CONF_C, 1, CONF_sysconf, -1 },
+{ "TRACE", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE },
+{ "TRACE_EVENT_FILTER", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_EVENT_FILTER },
+{ "TRACE_EVENT_NAME_MAX", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_EVENT_NAME_MAX },
+{ "TRACE_INHERIT", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_INHERIT },
+{ "TRACE_LOG", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_LOG },
+{ "TRACE_NAME_MAX", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_NAME_MAX },
+{ "TRACE_SYS_MAX", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_SYS_MAX },
+{ "TRACE_USER_EVENT_MAX", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_USER_EVENT_MAX },
+{ "TTY_NAME_MAX", { 0UL, 0 }, { _POSIX_TTY_NAME_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_TTY_NAME_MAX },
+{ "TYPED_MEMORY_OBJECTS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TYPED_MEMORY_OBJECTS },
+{ "TZNAME_MAX", { 0UL, 0 }, { _POSIX_TZNAME_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_TZNAME_MAX },
+{ "T_IOV_MAX", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_C, 1, CONF_sysconf, _SC_T_IOV_MAX },
+{ "UCHAR_MAX", { 255UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "UCHAR_MIN", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
+{ "UID_MAX", { 0UL, 0 }, { 60002UL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
+{ "UINT_MAX", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
+{ "UIO_MAXIOV", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "ULLONG_MAX", { 18446744073709551615UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "ULONG_MAX", { 4294967295UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "UNIX", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_UNIX },
+{ "UPE", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_UPE },
+{ "USER_LIMIT", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
+{ "USHRT_MAX", { 65535UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "V6_ILP32_OFF32", { 0UL, 0 }, { 0UL, 0 }, CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_V6_ILP32_OFF32 },
+{ "V6_ILP32_OFFBIG", { 0UL, 0 }, { 0UL, 0 }, CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_V6_ILP32_OFFBIG },
+{ "V6_LP64_OFF64", { 0UL, 0 }, { 0UL, 0 }, CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_V6_LP64_OFF64 },
+{ "V6_LPBIG_OFFBIG", { 0UL, 0 }, { 0UL, 0 }, CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_V6_LPBIG_OFFBIG },
+{ "VDISABLE", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_VDISABLE },
{ "VERSION", { 0, 0 }, { 0, 0 }, CONF_PREFIXED|CONF_STANDARD|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "VERSION", { 0, 0 }, { 200112, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "VERSION", { 0, 0 }, { 200112, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 2, CONF_sysconf, -1 },
-{ "VERSION", { 0, 0 }, { 600, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_VERSION },
-{ "VERSION", { 0, 0 }, { 0, 0 }, CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_XPG, 3, CONF_sysconf, -1 },
-{ "VERSION", { 0, 0 }, { 0, 0 }, CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_XPG, 4, CONF_sysconf, -1 },
-{ "VERSION", { 0, 0 }, { 0, 0 }, CONF_MINMAX|CONF_PREFIXED|CONF_STANDARD, CONF_AST, 1, CONF_nop, -1 },
-{ "VERSION", { 0, 0 }, { 0, 0 }, CONF_PREFIXED|CONF_STANDARD, CONF_GNU, 1, CONF_nop, -1 },
-{ "VERSION", { 0, 0 }, { 0, 0 }, CONF_PREFIXED|CONF_STANDARD, CONF_TRUSTEDBSD, 1, CONF_nop, -1 },
-{ "VERSION_88", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_LIMIT|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "VERSION_88", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
-{ "VERSION_90", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_LIMIT|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "VERSION_90", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
-{ "VERSION_93", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_LIMIT|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "VERSION_93", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
-{ "WCHAR_MAX", { 2147483647, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "WCHAR_MIN", { -2147483648, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "WINT_MAX", { 2147483647, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "WINT_MIN", { -2147483648, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "WORD_BIT", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "XCU_VERSION", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_XCU_VERSION },
-{ "XPG2", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "XPG3", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "XPG4", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "VERSION", { 0UL, 0 }, { 200112UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "VERSION", { 0UL, 0 }, { 200112UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 2, CONF_sysconf, -1 },
+{ "VERSION", { 0UL, 0 }, { 600UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_VERSION },
+{ "VERSION", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_XPG, 3, CONF_sysconf, -1 },
+{ "VERSION", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_XPG, 4, CONF_sysconf, -1 },
+{ "VERSION", { 0UL, 0 }, { 0UL, 0 }, CONF_MINMAX|CONF_PREFIXED|CONF_STANDARD, CONF_AST, 1, CONF_nop, -1 },
+{ "VERSION", { 0UL, 0 }, { 0UL, 0 }, CONF_PREFIXED|CONF_STANDARD, CONF_GNU, 1, CONF_nop, -1 },
+{ "VERSION", { 0UL, 0 }, { 0UL, 0 }, CONF_PREFIXED|CONF_STANDARD, CONF_TRUSTEDBSD, 1, CONF_nop, -1 },
+{ "VERSION_88", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_LIMIT|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "VERSION_88", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
+{ "VERSION_90", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_LIMIT|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "VERSION_90", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
+{ "VERSION_93", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_LIMIT|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "VERSION_93", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
+{ "WCHAR_MAX", { 2147483647UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "WCHAR_MIN", { -2147483647L-1L, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "WINT_MAX", { 2147483647UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "WINT_MIN", { -2147483647L-1L, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "WORD_BIT", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "XCU_VERSION", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_XCU_VERSION },
+{ "XPG2", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "XPG3", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "XPG4", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_nop, -1 },
};
int conf_elements = (int)sizeof(conf) / (int)sizeof(conf[0]);
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/conftab.h b/usr/src/lib/libast/amd64/src/lib/libast/conftab.h
index a84d5aa9ee..340530c26f 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/conftab.h
+++ b/usr/src/lib/libast/amd64/src/lib/libast/conftab.h
@@ -1,66 +1,4 @@
-
-/* : : generated by proto : : */
-
-
#ifndef _CONFTAB_H
-#if !defined(__PROTO__)
-# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
-# if defined(__cplusplus)
-# define __LINKAGE__ "C"
-# else
-# define __LINKAGE__
-# endif
-# define __STDARG__
-# define __PROTO__(x) x
-# define __OTORP__(x)
-# define __PARAM__(n,o) n
-# if !defined(__STDC__) && !defined(__cplusplus)
-# if !defined(c_plusplus)
-# define const
-# endif
-# define signed
-# define void int
-# define volatile
-# define __V_ char
-# else
-# define __V_ void
-# endif
-# else
-# define __PROTO__(x) ()
-# define __OTORP__(x) x
-# define __PARAM__(n,o) o
-# define __LINKAGE__
-# define __V_ char
-# define const
-# define signed
-# define void int
-# define volatile
-# endif
-# define __MANGLE__ __LINKAGE__
-# if defined(__cplusplus) || defined(c_plusplus)
-# define __VARARG__ ...
-# else
-# define __VARARG__
-# endif
-# if defined(__STDARG__)
-# define __VA_START__(p,a) va_start(p,a)
-# else
-# define __VA_START__(p,a) va_start(p)
-# endif
-# if !defined(__INLINE__)
-# if defined(__cplusplus)
-# define __INLINE__ extern __MANGLE__ inline
-# else
-# if defined(_WIN32) && !defined(__GNUC__)
-# define __INLINE__ __inline
-# endif
-# endif
-# endif
-#endif
-#if !defined(__LINKAGE__)
-#define __LINKAGE__ /* 2004-08-11 transition */
-#endif
-
#define _CONFTAB_H
#if !defined(SYS_NMLEN)
@@ -68,7 +6,11 @@
#endif
#include <sys/systeminfo.h>
-/* : : generated by conf from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/comp/conf.tab : : */
+/* : : generated by conf from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/comp/conf.tab : : */
+
+#if !defined(const) && !defined(__STDC__) && !defined(__cplusplus) && !defined(c_plusplus)
+#define const
+#endif
#define conf _ast_conf_data
#define conf_elements _ast_conf_ndata
@@ -117,8 +59,6 @@
struct Conf_s; typedef struct Conf_s Conf_t;
-typedef int (*Conf_f) __PROTO__((Conf_t*, intmax_t*, char**));
-
typedef struct Value_s
{
intmax_t number;
@@ -130,7 +70,7 @@ struct Conf_s
const char name[32];
Value_t limit;
Value_t minmax;
- short flags;
+ unsigned int flags;
short standard;
short section;
short call;
@@ -145,10 +85,10 @@ typedef struct Prefix_s
short call;
} Prefix_t;
-extern __MANGLE__ const Conf_t conf[];
-extern __MANGLE__ int conf_elements;
+extern const Conf_t conf[];
+extern int conf_elements;
-extern __MANGLE__ const Prefix_t prefix[];
-extern __MANGLE__ int prefix_elements;
+extern const Prefix_t prefix[];
+extern int prefix_elements;
#endif
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/lc.h b/usr/src/lib/libast/amd64/src/lib/libast/lc.h
index fdd804f36e..b225864bbc 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/lc.h
+++ b/usr/src/lib/libast/amd64/src/lib/libast/lc.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/lctab.h b/usr/src/lib/libast/amd64/src/lib/libast/lctab.c
index 6abbd72c65..4927e1fd3a 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/lctab.h
+++ b/usr/src/lib/libast/amd64/src/lib/libast/lctab.c
@@ -1,6 +1,10 @@
/* : : generated by ./lcgen : : */
-static Lc_attribute_t attribute_es[] =
+#include "lclib.h"
+#include "lclang.h"
+
+
+const Lc_attribute_t attribute_es[] =
{
{"traditional",LC_default,
#ifdef SUBLANG_SPANISH_TRADITIONAL
@@ -20,7 +24,7 @@ SUBLANG_SPANISH_MODERN,
},
};
-static const Lc_charset_t charset[] =
+const Lc_charset_t lc_charsets[] =
{
{"iso8859-1","latin1|west-europe","1252",},
{"iso8859-2","latin2|east-europe","1250",},
@@ -42,11 +46,11 @@ static const Lc_charset_t charset[] =
0
};
-static const Lc_language_t language[] =
+const Lc_language_t lc_languages[] =
{
-{"C","C","POSIX",&charset[0],LC_default,0,0,0,},
-{"debug","debug",0,&charset[0],LC_debug,0,0,0,},
-{"aa","afar",0,&charset[0],0,
+{"C","C","POSIX",&lc_charsets[0],LC_default,0,0,0,},
+{"debug","debug",0,&lc_charsets[0],LC_debug,0,0,0,},
+{"aa","afar",0,&lc_charsets[0],0,
#ifdef LANG_AFAR
LANG_AFAR,
#else
@@ -54,7 +58,7 @@ LANG_AFAR,
#endif
0,0,
},
-{"ab","abkhazian",0,&charset[0],0,
+{"ab","abkhazian",0,&lc_charsets[0],0,
#ifdef LANG_ABKHAZIAN
LANG_ABKHAZIAN,
#else
@@ -62,7 +66,7 @@ LANG_ABKHAZIAN,
#endif
0,0,
},
-{"af","afrikaans","afr",&charset[0],0,
+{"af","afrikaans","afr",&lc_charsets[0],0,
#ifdef LANG_AFRIKAANS
LANG_AFRIKAANS,
#else
@@ -70,7 +74,7 @@ LANG_AFRIKAANS,
#endif
0,0,
},
-{"am","amharic",0,&charset[0],0,
+{"am","amharic",0,&lc_charsets[0],0,
#ifdef LANG_AMHARIC
LANG_AMHARIC,
#else
@@ -78,7 +82,7 @@ LANG_AMHARIC,
#endif
0,0,
},
-{"ar","arabic","ara",&charset[5],0,
+{"ar","arabic","ara",&lc_charsets[5],0,
#ifdef LANG_ARABIC
LANG_ARABIC,
#else
@@ -86,7 +90,7 @@ LANG_ARABIC,
#endif
0,0,
},
-{"as","assamese",0,&charset[0],0,
+{"as","assamese",0,&lc_charsets[0],0,
#ifdef LANG_ASSAMESE
LANG_ASSAMESE,
#else
@@ -94,7 +98,7 @@ LANG_ASSAMESE,
#endif
0,0,
},
-{"ay","aymara",0,&charset[0],0,
+{"ay","aymara",0,&lc_charsets[0],0,
#ifdef LANG_AYMARA
LANG_AYMARA,
#else
@@ -102,7 +106,7 @@ LANG_AYMARA,
#endif
0,0,
},
-{"az","azerbaijani",0,&charset[0],0,
+{"az","azerbaijani",0,&lc_charsets[0],0,
#ifdef LANG_AZERBAIJANI
LANG_AZERBAIJANI,
#else
@@ -110,7 +114,7 @@ LANG_AZERBAIJANI,
#endif
0,0,
},
-{"ba","bashkir",0,&charset[0],0,
+{"ba","bashkir",0,&lc_charsets[0],0,
#ifdef LANG_BASHKIR
LANG_BASHKIR,
#else
@@ -118,7 +122,7 @@ LANG_BASHKIR,
#endif
0,0,
},
-{"be","belarusian","bel",&charset[0],0,
+{"be","belarusian","bel",&lc_charsets[0],0,
#ifdef LANG_BELARUSIAN
LANG_BELARUSIAN,
#else
@@ -126,7 +130,7 @@ LANG_BELARUSIAN,
#endif
0,0,
},
-{"bg","bulgarian","bul",&charset[4],0,
+{"bg","bulgarian","bul",&lc_charsets[4],0,
#ifdef LANG_BULGARIAN
LANG_BULGARIAN,
#else
@@ -134,7 +138,7 @@ LANG_BULGARIAN,
#endif
0,0,
},
-{"bh","bihari",0,&charset[0],0,
+{"bh","bihari",0,&lc_charsets[0],0,
#ifdef LANG_BIHARI
LANG_BIHARI,
#else
@@ -142,7 +146,7 @@ LANG_BIHARI,
#endif
0,0,
},
-{"bi","bislama",0,&charset[0],0,
+{"bi","bislama",0,&lc_charsets[0],0,
#ifdef LANG_BISLAMA
LANG_BISLAMA,
#else
@@ -150,7 +154,7 @@ LANG_BISLAMA,
#endif
0,0,
},
-{"bn","bengali-bangla",0,&charset[0],0,
+{"bn","bengali-bangla",0,&lc_charsets[0],0,
#ifdef LANG_BENGALI_BANGLA
LANG_BENGALI_BANGLA,
#else
@@ -158,7 +162,7 @@ LANG_BENGALI_BANGLA,
#endif
0,0,
},
-{"bo","tibetan",0,&charset[0],0,
+{"bo","tibetan",0,&lc_charsets[0],0,
#ifdef LANG_TIBETAN
LANG_TIBETAN,
#else
@@ -166,7 +170,7 @@ LANG_TIBETAN,
#endif
0,0,
},
-{"br","breton",0,&charset[0],0,
+{"br","breton",0,&lc_charsets[0],0,
#ifdef LANG_BRETON
LANG_BRETON,
#else
@@ -174,7 +178,7 @@ LANG_BRETON,
#endif
0,0,
},
-{"ca","catalan","cat",&charset[0],0,
+{"ca","catalan","cat",&lc_charsets[0],0,
#ifdef LANG_CATALAN
LANG_CATALAN,
#else
@@ -182,7 +186,7 @@ LANG_CATALAN,
#endif
0,0,
},
-{"co","corsican",0,&charset[0],0,
+{"co","corsican",0,&lc_charsets[0],0,
#ifdef LANG_CORSICAN
LANG_CORSICAN,
#else
@@ -190,7 +194,7 @@ LANG_CORSICAN,
#endif
0,0,
},
-{"cs","czech","ces|cze",&charset[1],0,
+{"cs","czech","ces|cze",&lc_charsets[1],0,
#ifdef LANG_CZECH
LANG_CZECH,
#else
@@ -198,7 +202,7 @@ LANG_CZECH,
#endif
0,0,
},
-{"cy","welsh",0,&charset[0],0,
+{"cy","welsh",0,&lc_charsets[0],0,
#ifdef LANG_WELSH
LANG_WELSH,
#else
@@ -206,7 +210,7 @@ LANG_WELSH,
#endif
0,0,
},
-{"da","danish","dan",&charset[0],0,
+{"da","danish","dan",&lc_charsets[0],0,
#ifdef LANG_DANISH
LANG_DANISH,
#else
@@ -214,7 +218,7 @@ LANG_DANISH,
#endif
0,0,
},
-{"de","german","deu|ger",&charset[0],0,
+{"de","german","deu|ger",&lc_charsets[0],0,
#ifdef LANG_GERMAN
LANG_GERMAN,
#else
@@ -222,7 +226,7 @@ LANG_GERMAN,
#endif
0,0,
},
-{"dz","bhutani",0,&charset[0],0,
+{"dz","bhutani",0,&lc_charsets[0],0,
#ifdef LANG_BHUTANI
LANG_BHUTANI,
#else
@@ -230,7 +234,7 @@ LANG_BHUTANI,
#endif
0,0,
},
-{"el","greek","ell|gre",&charset[6],0,
+{"el","greek","ell|gre",&lc_charsets[6],0,
#ifdef LANG_GREEK
LANG_GREEK,
#else
@@ -238,7 +242,7 @@ LANG_GREEK,
#endif
0,0,
},
-{"en","english","eng",&charset[0],0,
+{"en","english","eng",&lc_charsets[0],0,
#ifdef LANG_ENGLISH
LANG_ENGLISH,
#else
@@ -246,7 +250,7 @@ LANG_ENGLISH,
#endif
0,0,
},
-{"eo","esperanto",0,&charset[0],0,
+{"eo","esperanto",0,&lc_charsets[0],0,
#ifdef LANG_ESPERANTO
LANG_ESPERANTO,
#else
@@ -254,7 +258,7 @@ LANG_ESPERANTO,
#endif
0,0,
},
-{"es","spanish","spa",&charset[0],0,
+{"es","spanish","spa",&lc_charsets[0],0,
#ifdef LANG_SPANISH
LANG_SPANISH,
#else
@@ -262,7 +266,7 @@ LANG_SPANISH,
#endif
&attribute_es[0],&attribute_es[1],
},
-{"et","estonian","est",&charset[2],0,
+{"et","estonian","est",&lc_charsets[2],0,
#ifdef LANG_ESTONIAN
LANG_ESTONIAN,
#else
@@ -270,7 +274,7 @@ LANG_ESTONIAN,
#endif
0,0,
},
-{"eu","basque","eus|baq",&charset[0],0,
+{"eu","basque","eus|baq",&lc_charsets[0],0,
#ifdef LANG_BASQUE
LANG_BASQUE,
#else
@@ -278,7 +282,7 @@ LANG_BASQUE,
#endif
0,0,
},
-{"fa","persian",0,&charset[0],0,
+{"fa","persian",0,&lc_charsets[0],0,
#ifdef LANG_PERSIAN
LANG_PERSIAN,
#else
@@ -286,7 +290,7 @@ LANG_PERSIAN,
#endif
0,0,
},
-{"fi","finnish","fin",&charset[0],0,
+{"fi","finnish","fin",&lc_charsets[0],0,
#ifdef LANG_FINNISH
LANG_FINNISH,
#else
@@ -294,7 +298,7 @@ LANG_FINNISH,
#endif
0,0,
},
-{"fj","fiji",0,&charset[0],0,
+{"fj","fiji",0,&lc_charsets[0],0,
#ifdef LANG_FIJI
LANG_FIJI,
#else
@@ -302,7 +306,7 @@ LANG_FIJI,
#endif
0,0,
},
-{"fo","faeroese",0,&charset[0],0,
+{"fo","faeroese",0,&lc_charsets[0],0,
#ifdef LANG_FAEROESE
LANG_FAEROESE,
#else
@@ -310,7 +314,7 @@ LANG_FAEROESE,
#endif
0,0,
},
-{"fr","french","fra|fre",&charset[0],0,
+{"fr","french","fra|fre",&lc_charsets[0],0,
#ifdef LANG_FRENCH
LANG_FRENCH,
#else
@@ -318,7 +322,7 @@ LANG_FRENCH,
#endif
0,0,
},
-{"fy","frisian",0,&charset[0],0,
+{"fy","frisian",0,&lc_charsets[0],0,
#ifdef LANG_FRISIAN
LANG_FRISIAN,
#else
@@ -326,7 +330,7 @@ LANG_FRISIAN,
#endif
0,0,
},
-{"ga","irish",0,&charset[11],0,
+{"ga","irish",0,&lc_charsets[11],0,
#ifdef LANG_IRISH
LANG_IRISH,
#else
@@ -334,7 +338,7 @@ LANG_IRISH,
#endif
0,0,
},
-{"gd","scots-gaelic",0,&charset[11],0,
+{"gd","scots-gaelic",0,&lc_charsets[11],0,
#ifdef LANG_SCOTS_GAELIC
LANG_SCOTS_GAELIC,
#else
@@ -342,7 +346,7 @@ LANG_SCOTS_GAELIC,
#endif
0,0,
},
-{"gl","galician",0,&charset[0],0,
+{"gl","galician",0,&lc_charsets[0],0,
#ifdef LANG_GALICIAN
LANG_GALICIAN,
#else
@@ -350,7 +354,7 @@ LANG_GALICIAN,
#endif
0,0,
},
-{"gn","guarani",0,&charset[0],0,
+{"gn","guarani",0,&lc_charsets[0],0,
#ifdef LANG_GUARANI
LANG_GUARANI,
#else
@@ -358,7 +362,7 @@ LANG_GUARANI,
#endif
0,0,
},
-{"gu","gujarati",0,&charset[0],0,
+{"gu","gujarati",0,&lc_charsets[0],0,
#ifdef LANG_GUJARATI
LANG_GUJARATI,
#else
@@ -366,7 +370,7 @@ LANG_GUJARATI,
#endif
0,0,
},
-{"ha","hausa",0,&charset[0],0,
+{"ha","hausa",0,&lc_charsets[0],0,
#ifdef LANG_HAUSA
LANG_HAUSA,
#else
@@ -374,7 +378,7 @@ LANG_HAUSA,
#endif
0,0,
},
-{"he","hebrew","heb",&charset[7],0,
+{"he","hebrew","heb",&lc_charsets[7],0,
#ifdef LANG_HEBREW
LANG_HEBREW,
#else
@@ -382,7 +386,7 @@ LANG_HEBREW,
#endif
0,0,
},
-{"hi","hindi",0,&charset[0],0,
+{"hi","hindi",0,&lc_charsets[0],0,
#ifdef LANG_HINDI
LANG_HINDI,
#else
@@ -390,7 +394,7 @@ LANG_HINDI,
#endif
0,0,
},
-{"hr","croatian","hrv|scr",&charset[1],0,
+{"hr","croatian","hrv|scr",&lc_charsets[1],0,
#ifdef LANG_CROATIAN
LANG_CROATIAN,
#else
@@ -398,7 +402,7 @@ LANG_CROATIAN,
#endif
0,0,
},
-{"hu","hungarian","hun",&charset[1],0,
+{"hu","hungarian","hun",&lc_charsets[1],0,
#ifdef LANG_HUNGARIAN
LANG_HUNGARIAN,
#else
@@ -406,7 +410,7 @@ LANG_HUNGARIAN,
#endif
0,0,
},
-{"hy","armenian",0,&charset[0],0,
+{"hy","armenian",0,&lc_charsets[0],0,
#ifdef LANG_ARMENIAN
LANG_ARMENIAN,
#else
@@ -414,7 +418,7 @@ LANG_ARMENIAN,
#endif
0,0,
},
-{"ia","interlingua",0,&charset[0],0,
+{"ia","interlingua",0,&lc_charsets[0],0,
#ifdef LANG_INTERLINGUA
LANG_INTERLINGUA,
#else
@@ -422,7 +426,7 @@ LANG_INTERLINGUA,
#endif
0,0,
},
-{"id","indonesian","ind",&charset[0],0,
+{"id","indonesian","ind",&lc_charsets[0],0,
#ifdef LANG_INDONESIAN
LANG_INDONESIAN,
#else
@@ -430,7 +434,7 @@ LANG_INDONESIAN,
#endif
0,0,
},
-{"ie","interlingue",0,&charset[0],0,
+{"ie","interlingue",0,&lc_charsets[0],0,
#ifdef LANG_INTERLINGUE
LANG_INTERLINGUE,
#else
@@ -438,7 +442,7 @@ LANG_INTERLINGUE,
#endif
0,0,
},
-{"ik","inupiak",0,&charset[0],0,
+{"ik","inupiak",0,&lc_charsets[0],0,
#ifdef LANG_INUPIAK
LANG_INUPIAK,
#else
@@ -446,7 +450,7 @@ LANG_INUPIAK,
#endif
0,0,
},
-{"in","indonesian",0,&charset[0],0,
+{"in","indonesian",0,&lc_charsets[0],0,
#ifdef LANG_INDONESIAN
LANG_INDONESIAN,
#else
@@ -454,7 +458,7 @@ LANG_INDONESIAN,
#endif
0,0,
},
-{"is","icelandic","isl|ice",&charset[0],0,
+{"is","icelandic","isl|ice",&lc_charsets[0],0,
#ifdef LANG_ICELANDIC
LANG_ICELANDIC,
#else
@@ -462,7 +466,7 @@ LANG_ICELANDIC,
#endif
0,0,
},
-{"it","italian","ita",&charset[0],0,
+{"it","italian","ita",&lc_charsets[0],0,
#ifdef LANG_ITALIAN
LANG_ITALIAN,
#else
@@ -470,7 +474,7 @@ LANG_ITALIAN,
#endif
0,0,
},
-{"iw","hebrew",0,&charset[0],0,
+{"iw","hebrew",0,&lc_charsets[0],0,
#ifdef LANG_HEBREW
LANG_HEBREW,
#else
@@ -478,7 +482,7 @@ LANG_HEBREW,
#endif
0,0,
},
-{"ja","japanese","jpn",&charset[0],0,
+{"ja","japanese","jpn",&lc_charsets[0],0,
#ifdef LANG_JAPANESE
LANG_JAPANESE,
#else
@@ -486,7 +490,7 @@ LANG_JAPANESE,
#endif
0,0,
},
-{"ji","yiddish",0,&charset[0],0,
+{"ji","yiddish",0,&lc_charsets[0],0,
#ifdef LANG_YIDDISH
LANG_YIDDISH,
#else
@@ -494,7 +498,7 @@ LANG_YIDDISH,
#endif
0,0,
},
-{"jw","javanese",0,&charset[0],0,
+{"jw","javanese",0,&lc_charsets[0],0,
#ifdef LANG_JAVANESE
LANG_JAVANESE,
#else
@@ -502,7 +506,7 @@ LANG_JAVANESE,
#endif
0,0,
},
-{"ka","georgian",0,&charset[0],0,
+{"ka","georgian",0,&lc_charsets[0],0,
#ifdef LANG_GEORGIAN
LANG_GEORGIAN,
#else
@@ -510,7 +514,7 @@ LANG_GEORGIAN,
#endif
0,0,
},
-{"kk","kazakh","kaz",&charset[0],0,
+{"kk","kazakh","kaz",&lc_charsets[0],0,
#ifdef LANG_KAZAKH
LANG_KAZAKH,
#else
@@ -518,7 +522,7 @@ LANG_KAZAKH,
#endif
0,0,
},
-{"kl","greenlandic",0,&charset[0],0,
+{"kl","greenlandic",0,&lc_charsets[0],0,
#ifdef LANG_GREENLANDIC
LANG_GREENLANDIC,
#else
@@ -526,7 +530,7 @@ LANG_GREENLANDIC,
#endif
0,0,
},
-{"km","cambodian",0,&charset[0],0,
+{"km","cambodian",0,&lc_charsets[0],0,
#ifdef LANG_CAMBODIAN
LANG_CAMBODIAN,
#else
@@ -534,7 +538,7 @@ LANG_CAMBODIAN,
#endif
0,0,
},
-{"kn","kannada",0,&charset[0],0,
+{"kn","kannada",0,&lc_charsets[0],0,
#ifdef LANG_KANNADA
LANG_KANNADA,
#else
@@ -542,7 +546,7 @@ LANG_KANNADA,
#endif
0,0,
},
-{"ko","korean","kor",&charset[0],0,
+{"ko","korean","kor",&lc_charsets[0],0,
#ifdef LANG_KOREAN
LANG_KOREAN,
#else
@@ -550,7 +554,7 @@ LANG_KOREAN,
#endif
0,0,
},
-{"ks","kashmiri",0,&charset[0],0,
+{"ks","kashmiri",0,&lc_charsets[0],0,
#ifdef LANG_KASHMIRI
LANG_KASHMIRI,
#else
@@ -558,7 +562,7 @@ LANG_KASHMIRI,
#endif
0,0,
},
-{"ku","kurdish",0,&charset[0],0,
+{"ku","kurdish",0,&lc_charsets[0],0,
#ifdef LANG_KURDISH
LANG_KURDISH,
#else
@@ -566,7 +570,7 @@ LANG_KURDISH,
#endif
0,0,
},
-{"ky","kirghiz",0,&charset[0],0,
+{"ky","kirghiz",0,&lc_charsets[0],0,
#ifdef LANG_KIRGHIZ
LANG_KIRGHIZ,
#else
@@ -574,7 +578,7 @@ LANG_KIRGHIZ,
#endif
0,0,
},
-{"la","latin",0,&charset[0],0,
+{"la","latin",0,&lc_charsets[0],0,
#ifdef LANG_LATIN
LANG_LATIN,
#else
@@ -582,7 +586,7 @@ LANG_LATIN,
#endif
0,0,
},
-{"ln","lingala",0,&charset[0],0,
+{"ln","lingala",0,&lc_charsets[0],0,
#ifdef LANG_LINGALA
LANG_LINGALA,
#else
@@ -590,7 +594,7 @@ LANG_LINGALA,
#endif
0,0,
},
-{"lo","laothian",0,&charset[0],0,
+{"lo","laothian",0,&lc_charsets[0],0,
#ifdef LANG_LAOTHIAN
LANG_LAOTHIAN,
#else
@@ -598,7 +602,7 @@ LANG_LAOTHIAN,
#endif
0,0,
},
-{"lt","lithuanian","lit",&charset[10],0,
+{"lt","lithuanian","lit",&lc_charsets[10],0,
#ifdef LANG_LITHUANIAN
LANG_LITHUANIAN,
#else
@@ -606,7 +610,7 @@ LANG_LITHUANIAN,
#endif
0,0,
},
-{"lv","latvian","lav",&charset[10],0,
+{"lv","latvian","lav",&lc_charsets[10],0,
#ifdef LANG_LATVIAN
LANG_LATVIAN,
#else
@@ -614,7 +618,7 @@ LANG_LATVIAN,
#endif
0,0,
},
-{"mg","malagasy",0,&charset[0],0,
+{"mg","malagasy",0,&lc_charsets[0],0,
#ifdef LANG_MALAGASY
LANG_MALAGASY,
#else
@@ -622,7 +626,7 @@ LANG_MALAGASY,
#endif
0,0,
},
-{"mi","maori",0,&charset[0],0,
+{"mi","maori",0,&lc_charsets[0],0,
#ifdef LANG_MAORI
LANG_MAORI,
#else
@@ -630,7 +634,7 @@ LANG_MAORI,
#endif
0,0,
},
-{"mk","macedonian","mkd|mac",&charset[0],0,
+{"mk","macedonian","mkd|mac",&lc_charsets[0],0,
#ifdef LANG_MACEDONIAN
LANG_MACEDONIAN,
#else
@@ -638,7 +642,7 @@ LANG_MACEDONIAN,
#endif
0,0,
},
-{"ml","malayalam","mal",&charset[0],0,
+{"ml","malayalam","mal",&lc_charsets[0],0,
#ifdef LANG_MALAYALAM
LANG_MALAYALAM,
#else
@@ -646,7 +650,7 @@ LANG_MALAYALAM,
#endif
0,0,
},
-{"mn","mongolian",0,&charset[0],0,
+{"mn","mongolian",0,&lc_charsets[0],0,
#ifdef LANG_MONGOLIAN
LANG_MONGOLIAN,
#else
@@ -654,7 +658,7 @@ LANG_MONGOLIAN,
#endif
0,0,
},
-{"mo","moldavian",0,&charset[0],0,
+{"mo","moldavian",0,&lc_charsets[0],0,
#ifdef LANG_MOLDAVIAN
LANG_MOLDAVIAN,
#else
@@ -662,7 +666,7 @@ LANG_MOLDAVIAN,
#endif
0,0,
},
-{"mr","marathi",0,&charset[0],0,
+{"mr","marathi",0,&lc_charsets[0],0,
#ifdef LANG_MARATHI
LANG_MARATHI,
#else
@@ -670,7 +674,7 @@ LANG_MARATHI,
#endif
0,0,
},
-{"ms","malay","msa|may",&charset[0],0,
+{"ms","malay","msa|may",&lc_charsets[0],0,
#ifdef LANG_MALAY
LANG_MALAY,
#else
@@ -678,7 +682,7 @@ LANG_MALAY,
#endif
0,0,
},
-{"mt","maltese",0,&charset[0],0,
+{"mt","maltese",0,&lc_charsets[0],0,
#ifdef LANG_MALTESE
LANG_MALTESE,
#else
@@ -686,7 +690,7 @@ LANG_MALTESE,
#endif
0,0,
},
-{"my","burmese",0,&charset[0],0,
+{"my","burmese",0,&lc_charsets[0],0,
#ifdef LANG_BURMESE
LANG_BURMESE,
#else
@@ -694,7 +698,7 @@ LANG_BURMESE,
#endif
0,0,
},
-{"na","nauru",0,&charset[0],0,
+{"na","nauru",0,&lc_charsets[0],0,
#ifdef LANG_NAURU
LANG_NAURU,
#else
@@ -702,7 +706,7 @@ LANG_NAURU,
#endif
0,0,
},
-{"nb","norwegian-bokmal","nob",&charset[0],0,
+{"nb","norwegian-bokmal","nob",&lc_charsets[0],0,
#ifdef LANG_NORWEGIAN_BOKMAL
LANG_NORWEGIAN_BOKMAL,
#else
@@ -710,7 +714,7 @@ LANG_NORWEGIAN_BOKMAL,
#endif
0,0,
},
-{"ne","nepali",0,&charset[0],0,
+{"ne","nepali",0,&lc_charsets[0],0,
#ifdef LANG_NEPALI
LANG_NEPALI,
#else
@@ -718,7 +722,7 @@ LANG_NEPALI,
#endif
0,0,
},
-{"nl","dutch","nld|dut",&charset[0],0,
+{"nl","dutch","nld|dut",&lc_charsets[0],0,
#ifdef LANG_DUTCH
LANG_DUTCH,
#else
@@ -726,7 +730,7 @@ LANG_DUTCH,
#endif
0,0,
},
-{"nn","norwegian-nynorsk","nno|non",&charset[0],0,
+{"nn","norwegian-nynorsk","nno|non",&lc_charsets[0],0,
#ifdef LANG_NORWEGIAN_NYNORSK
LANG_NORWEGIAN_NYNORSK,
#else
@@ -734,7 +738,7 @@ LANG_NORWEGIAN_NYNORSK,
#endif
0,0,
},
-{"no","norwegian","nor",&charset[0],0,
+{"no","norwegian","nor",&lc_charsets[0],0,
#ifdef LANG_NORWEGIAN
LANG_NORWEGIAN,
#else
@@ -742,7 +746,7 @@ LANG_NORWEGIAN,
#endif
0,0,
},
-{"oc","occitan",0,&charset[0],0,
+{"oc","occitan",0,&lc_charsets[0],0,
#ifdef LANG_OCCITAN
LANG_OCCITAN,
#else
@@ -750,7 +754,7 @@ LANG_OCCITAN,
#endif
0,0,
},
-{"om","oromo",0,&charset[0],0,
+{"om","oromo",0,&lc_charsets[0],0,
#ifdef LANG_OROMO
LANG_OROMO,
#else
@@ -758,7 +762,7 @@ LANG_OROMO,
#endif
0,0,
},
-{"or","oriya",0,&charset[0],0,
+{"or","oriya",0,&lc_charsets[0],0,
#ifdef LANG_ORIYA
LANG_ORIYA,
#else
@@ -766,7 +770,7 @@ LANG_ORIYA,
#endif
0,0,
},
-{"pa","punjabi",0,&charset[0],0,
+{"pa","punjabi",0,&lc_charsets[0],0,
#ifdef LANG_PUNJABI
LANG_PUNJABI,
#else
@@ -774,7 +778,7 @@ LANG_PUNJABI,
#endif
0,0,
},
-{"pl","polish","pol",&charset[1],0,
+{"pl","polish","pol",&lc_charsets[1],0,
#ifdef LANG_POLISH
LANG_POLISH,
#else
@@ -782,7 +786,7 @@ LANG_POLISH,
#endif
0,0,
},
-{"ps","pushto",0,&charset[0],0,
+{"ps","pushto",0,&lc_charsets[0],0,
#ifdef LANG_PUSHTO
LANG_PUSHTO,
#else
@@ -790,7 +794,7 @@ LANG_PUSHTO,
#endif
0,0,
},
-{"pt","portuguese","por",&charset[0],0,
+{"pt","portuguese","por",&lc_charsets[0],0,
#ifdef LANG_PORTUGUESE
LANG_PORTUGUESE,
#else
@@ -798,7 +802,7 @@ LANG_PORTUGUESE,
#endif
0,0,
},
-{"qu","quechua",0,&charset[0],0,
+{"qu","quechua",0,&lc_charsets[0],0,
#ifdef LANG_QUECHUA
LANG_QUECHUA,
#else
@@ -806,7 +810,7 @@ LANG_QUECHUA,
#endif
0,0,
},
-{"rm","rhaeto-romance",0,&charset[0],0,
+{"rm","rhaeto-romance",0,&lc_charsets[0],0,
#ifdef LANG_RHAETO_ROMANCE
LANG_RHAETO_ROMANCE,
#else
@@ -814,7 +818,7 @@ LANG_RHAETO_ROMANCE,
#endif
0,0,
},
-{"rn","kirundi",0,&charset[0],0,
+{"rn","kirundi",0,&lc_charsets[0],0,
#ifdef LANG_KIRUNDI
LANG_KIRUNDI,
#else
@@ -822,7 +826,7 @@ LANG_KIRUNDI,
#endif
0,0,
},
-{"ro","romanian","ron|rum",&charset[1],0,
+{"ro","romanian","ron|rum",&lc_charsets[1],0,
#ifdef LANG_ROMANIAN
LANG_ROMANIAN,
#else
@@ -830,7 +834,7 @@ LANG_ROMANIAN,
#endif
0,0,
},
-{"ru","russian","rus",&charset[4],0,
+{"ru","russian","rus",&lc_charsets[4],0,
#ifdef LANG_RUSSIAN
LANG_RUSSIAN,
#else
@@ -838,7 +842,7 @@ LANG_RUSSIAN,
#endif
0,0,
},
-{"rw","kinyarwanda",0,&charset[0],0,
+{"rw","kinyarwanda",0,&lc_charsets[0],0,
#ifdef LANG_KINYARWANDA
LANG_KINYARWANDA,
#else
@@ -846,7 +850,7 @@ LANG_KINYARWANDA,
#endif
0,0,
},
-{"sa","sanskrit",0,&charset[0],0,
+{"sa","sanskrit",0,&lc_charsets[0],0,
#ifdef LANG_SANSKRIT
LANG_SANSKRIT,
#else
@@ -854,7 +858,7 @@ LANG_SANSKRIT,
#endif
0,0,
},
-{"sd","sindhi",0,&charset[0],0,
+{"sd","sindhi",0,&lc_charsets[0],0,
#ifdef LANG_SINDHI
LANG_SINDHI,
#else
@@ -862,7 +866,7 @@ LANG_SINDHI,
#endif
0,0,
},
-{"sg","sangro",0,&charset[0],0,
+{"sg","sangro",0,&lc_charsets[0],0,
#ifdef LANG_SANGRO
LANG_SANGRO,
#else
@@ -870,7 +874,7 @@ LANG_SANGRO,
#endif
0,0,
},
-{"sh","serbo-croatian",0,&charset[0],0,
+{"sh","serbo-croatian",0,&lc_charsets[0],0,
#ifdef LANG_SERBO_CROATIAN
LANG_SERBO_CROATIAN,
#else
@@ -878,7 +882,7 @@ LANG_SERBO_CROATIAN,
#endif
0,0,
},
-{"si","singhalese",0,&charset[0],0,
+{"si","singhalese",0,&lc_charsets[0],0,
#ifdef LANG_SINGHALESE
LANG_SINGHALESE,
#else
@@ -886,7 +890,7 @@ LANG_SINGHALESE,
#endif
0,0,
},
-{"sk","slovak","slk|slo",&charset[1],0,
+{"sk","slovak","slk|slo",&lc_charsets[1],0,
#ifdef LANG_SLOVAK
LANG_SLOVAK,
#else
@@ -894,7 +898,7 @@ LANG_SLOVAK,
#endif
0,0,
},
-{"sl","slovenian","slv",&charset[1],0,
+{"sl","slovenian","slv",&lc_charsets[1],0,
#ifdef LANG_SLOVENIAN
LANG_SLOVENIAN,
#else
@@ -902,7 +906,7 @@ LANG_SLOVENIAN,
#endif
0,0,
},
-{"sm","samoan",0,&charset[0],0,
+{"sm","samoan",0,&lc_charsets[0],0,
#ifdef LANG_SAMOAN
LANG_SAMOAN,
#else
@@ -910,7 +914,7 @@ LANG_SAMOAN,
#endif
0,0,
},
-{"sn","shona",0,&charset[0],0,
+{"sn","shona",0,&lc_charsets[0],0,
#ifdef LANG_SHONA
LANG_SHONA,
#else
@@ -918,7 +922,7 @@ LANG_SHONA,
#endif
0,0,
},
-{"so","somali",0,&charset[0],0,
+{"so","somali",0,&lc_charsets[0],0,
#ifdef LANG_SOMALI
LANG_SOMALI,
#else
@@ -926,7 +930,7 @@ LANG_SOMALI,
#endif
0,0,
},
-{"sq","albanian","sqi|alb",&charset[0],0,
+{"sq","albanian","sqi|alb",&lc_charsets[0],0,
#ifdef LANG_ALBANIAN
LANG_ALBANIAN,
#else
@@ -934,7 +938,7 @@ LANG_ALBANIAN,
#endif
0,0,
},
-{"sr","serbian","srp",&charset[1],0,
+{"sr","serbian","srp",&lc_charsets[1],0,
#ifdef LANG_SERBIAN
LANG_SERBIAN,
#else
@@ -942,7 +946,7 @@ LANG_SERBIAN,
#endif
0,0,
},
-{"ss","siswati",0,&charset[0],0,
+{"ss","siswati",0,&lc_charsets[0],0,
#ifdef LANG_SISWATI
LANG_SISWATI,
#else
@@ -950,7 +954,7 @@ LANG_SISWATI,
#endif
0,0,
},
-{"st","sesotho",0,&charset[0],0,
+{"st","sesotho",0,&lc_charsets[0],0,
#ifdef LANG_SESOTHO
LANG_SESOTHO,
#else
@@ -958,7 +962,7 @@ LANG_SESOTHO,
#endif
0,0,
},
-{"su","sudanese",0,&charset[0],0,
+{"su","sudanese",0,&lc_charsets[0],0,
#ifdef LANG_SUDANESE
LANG_SUDANESE,
#else
@@ -966,7 +970,7 @@ LANG_SUDANESE,
#endif
0,0,
},
-{"sv","swedish","swe",&charset[0],0,
+{"sv","swedish","swe",&lc_charsets[0],0,
#ifdef LANG_SWEDISH
LANG_SWEDISH,
#else
@@ -974,7 +978,7 @@ LANG_SWEDISH,
#endif
0,0,
},
-{"sw","swahili","swa",&charset[0],0,
+{"sw","swahili","swa",&lc_charsets[0],0,
#ifdef LANG_SWAHILI
LANG_SWAHILI,
#else
@@ -982,7 +986,7 @@ LANG_SWAHILI,
#endif
0,0,
},
-{"ta","tamil",0,&charset[0],0,
+{"ta","tamil",0,&lc_charsets[0],0,
#ifdef LANG_TAMIL
LANG_TAMIL,
#else
@@ -990,7 +994,7 @@ LANG_TAMIL,
#endif
0,0,
},
-{"te","telugu",0,&charset[0],0,
+{"te","telugu",0,&lc_charsets[0],0,
#ifdef LANG_TELUGU
LANG_TELUGU,
#else
@@ -998,7 +1002,7 @@ LANG_TELUGU,
#endif
0,0,
},
-{"tg","tajik",0,&charset[0],0,
+{"tg","tajik",0,&lc_charsets[0],0,
#ifdef LANG_TAJIK
LANG_TAJIK,
#else
@@ -1006,7 +1010,7 @@ LANG_TAJIK,
#endif
0,0,
},
-{"th","thai","tha",&charset[0],0,
+{"th","thai","tha",&lc_charsets[0],0,
#ifdef LANG_THAI
LANG_THAI,
#else
@@ -1014,7 +1018,7 @@ LANG_THAI,
#endif
0,0,
},
-{"ti","tigrinya",0,&charset[0],0,
+{"ti","tigrinya",0,&lc_charsets[0],0,
#ifdef LANG_TIGRINYA
LANG_TIGRINYA,
#else
@@ -1022,7 +1026,7 @@ LANG_TIGRINYA,
#endif
0,0,
},
-{"tk","turkmen",0,&charset[0],0,
+{"tk","turkmen",0,&lc_charsets[0],0,
#ifdef LANG_TURKMEN
LANG_TURKMEN,
#else
@@ -1030,7 +1034,7 @@ LANG_TURKMEN,
#endif
0,0,
},
-{"tl","tagalog",0,&charset[0],0,
+{"tl","tagalog",0,&lc_charsets[0],0,
#ifdef LANG_TAGALOG
LANG_TAGALOG,
#else
@@ -1038,7 +1042,7 @@ LANG_TAGALOG,
#endif
0,0,
},
-{"tn","setswana",0,&charset[0],0,
+{"tn","setswana",0,&lc_charsets[0],0,
#ifdef LANG_SETSWANA
LANG_SETSWANA,
#else
@@ -1046,7 +1050,7 @@ LANG_SETSWANA,
#endif
0,0,
},
-{"to","tonga",0,&charset[0],0,
+{"to","tonga",0,&lc_charsets[0],0,
#ifdef LANG_TONGA
LANG_TONGA,
#else
@@ -1054,7 +1058,7 @@ LANG_TONGA,
#endif
0,0,
},
-{"tr","turkish","tur",&charset[8],0,
+{"tr","turkish","tur",&lc_charsets[8],0,
#ifdef LANG_TURKISH
LANG_TURKISH,
#else
@@ -1062,7 +1066,7 @@ LANG_TURKISH,
#endif
0,0,
},
-{"ts","tsonga",0,&charset[0],0,
+{"ts","tsonga",0,&lc_charsets[0],0,
#ifdef LANG_TSONGA
LANG_TSONGA,
#else
@@ -1070,7 +1074,7 @@ LANG_TSONGA,
#endif
0,0,
},
-{"tt","tatar","tat",&charset[0],0,
+{"tt","tatar","tat",&lc_charsets[0],0,
#ifdef LANG_TATAR
LANG_TATAR,
#else
@@ -1078,7 +1082,7 @@ LANG_TATAR,
#endif
0,0,
},
-{"tw","chinese-traditional","cht",&charset[0],0,
+{"tw","chinese-traditional","cht",&lc_charsets[0],0,
#ifdef LANG_CHINESE_TRADITIONAL
LANG_CHINESE_TRADITIONAL,
#else
@@ -1086,7 +1090,7 @@ LANG_CHINESE_TRADITIONAL,
#endif
0,0,
},
-{"uk","ukrainian","ukr",&charset[4],0,
+{"uk","ukrainian","ukr",&lc_charsets[4],0,
#ifdef LANG_UKRAINIAN
LANG_UKRAINIAN,
#else
@@ -1094,7 +1098,7 @@ LANG_UKRAINIAN,
#endif
0,0,
},
-{"ur","urdu",0,&charset[0],0,
+{"ur","urdu",0,&lc_charsets[0],0,
#ifdef LANG_URDU
LANG_URDU,
#else
@@ -1102,7 +1106,7 @@ LANG_URDU,
#endif
0,0,
},
-{"uz","uzbek","uzb",&charset[0],0,
+{"uz","uzbek","uzb",&lc_charsets[0],0,
#ifdef LANG_UZBEK
LANG_UZBEK,
#else
@@ -1110,7 +1114,7 @@ LANG_UZBEK,
#endif
0,0,
},
-{"vi","vietnamese",0,&charset[0],0,
+{"vi","vietnamese",0,&lc_charsets[0],0,
#ifdef LANG_VIETNAMESE
LANG_VIETNAMESE,
#else
@@ -1118,7 +1122,7 @@ LANG_VIETNAMESE,
#endif
0,0,
},
-{"vo","volapuk",0,&charset[0],0,
+{"vo","volapuk",0,&lc_charsets[0],0,
#ifdef LANG_VOLAPUK
LANG_VOLAPUK,
#else
@@ -1126,7 +1130,7 @@ LANG_VOLAPUK,
#endif
0,0,
},
-{"wo","wolof",0,&charset[0],0,
+{"wo","wolof",0,&lc_charsets[0],0,
#ifdef LANG_WOLOF
LANG_WOLOF,
#else
@@ -1134,7 +1138,7 @@ LANG_WOLOF,
#endif
0,0,
},
-{"xh","xhosa",0,&charset[0],0,
+{"xh","xhosa",0,&lc_charsets[0],0,
#ifdef LANG_XHOSA
LANG_XHOSA,
#else
@@ -1142,7 +1146,7 @@ LANG_XHOSA,
#endif
0,0,
},
-{"yo","yoruba",0,&charset[0],0,
+{"yo","yoruba",0,&lc_charsets[0],0,
#ifdef LANG_YORUBA
LANG_YORUBA,
#else
@@ -1150,7 +1154,7 @@ LANG_YORUBA,
#endif
0,0,
},
-{"zh","chinese-simplified","zho|chi|chs",&charset[0],0,
+{"zh","chinese-simplified","zho|chi|chs",&lc_charsets[0],0,
#ifdef LANG_CHINESE_SIMPLIFIED
LANG_CHINESE_SIMPLIFIED,
#else
@@ -1158,7 +1162,7 @@ LANG_CHINESE_SIMPLIFIED,
#endif
0,0,
},
-{"zu","zulu",0,&charset[0],0,
+{"zu","zulu",0,&lc_charsets[0],0,
#ifdef LANG_ZULU
LANG_ZULU,
#else
@@ -1169,10 +1173,10 @@ LANG_ZULU,
0
};
-static const Lc_territory_t territory[] =
+const Lc_territory_t lc_territories[] =
{
-{"C","C",LC_default,0,&language[0],0,0,0,0,0,0,0,},
-{"debug","debug",LC_debug,0,&language[1],0,0,0,0,0,0,0,},
+{"C","C",LC_default,0,&lc_languages[0],0,0,0,0,0,0,0,},
+{"debug","debug",LC_debug,0,&lc_languages[1],0,0,0,0,0,0,0,},
{"al","albania",0,
#ifdef CTRY_ALBANIA
CTRY_ALBANIA,
@@ -1187,7 +1191,7 @@ CTRY_NETHERLANDS_ANTILLES,
#else
0,
#endif
-&language[86],0,0,0,
+&lc_languages[86],0,0,0,
#ifdef SUBLANG_DUTCH_NETHERLANDS_ANTILLES
SUBLANG_DUTCH_NETHERLANDS_ANTILLES,
#else
@@ -1201,7 +1205,7 @@ CTRY_ARGENTINA,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_ARGENTINA
SUBLANG_SPANISH_ARGENTINA,
#else
@@ -1215,7 +1219,7 @@ CTRY_AUSTRIA,
#else
0,
#endif
-&language[23],0,0,0,
+&lc_languages[23],0,0,0,
#ifdef SUBLANG_GERMAN_AUSTRIA
SUBLANG_GERMAN_AUSTRIA,
#else
@@ -1229,7 +1233,7 @@ CTRY_AUSTRALIA,
#else
0,
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_AUSTRALIA
SUBLANG_ENGLISH_AUSTRALIA,
#else
@@ -1251,7 +1255,7 @@ CTRY_BELGIUM,
#else
0,
#endif
-&language[86],&language[35],&language[23],0,
+&lc_languages[86],&lc_languages[35],&lc_languages[23],0,
#ifdef SUBLANG_DUTCH_BELGIUM
SUBLANG_DUTCH_BELGIUM,
#else
@@ -1277,7 +1281,7 @@ CTRY_BULGARIA,
#else
0,
#endif
-&language[12],0,0,0,
+&lc_languages[12],0,0,0,
#ifdef SUBLANG_BULGARIAN_BULGARIA
SUBLANG_BULGARIAN_BULGARIA,
#else
@@ -1291,7 +1295,7 @@ CTRY_BRUNEI_DARUSSALAM,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_BRUNEI_DARUSSALAM
SUBLANG_ARABIC_BRUNEI_DARUSSALAM,
#else
@@ -1305,7 +1309,7 @@ CTRY_BOLIVIA,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_BOLIVIA
SUBLANG_SPANISH_BOLIVIA,
#else
@@ -1319,7 +1323,7 @@ CTRY_BRAZIL,
#else
0,
#endif
-&language[95],0,0,0,
+&lc_languages[95],0,0,0,
#ifdef SUBLANG_PORTUGUESE_BRAZIL
SUBLANG_PORTUGUESE_BRAZIL,
#else
@@ -1333,7 +1337,7 @@ CTRY_BOTSWANA,
#else
0,
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_BOTSWANA
SUBLANG_ENGLISH_BOTSWANA,
#else
@@ -1347,7 +1351,7 @@ CTRY_BELARUS,
#else
0,
#endif
-&language[100],0,0,0,
+&lc_languages[100],0,0,0,
#ifdef SUBLANG_RUSSIAN_BELARUS
SUBLANG_RUSSIAN_BELARUS,
#else
@@ -1361,7 +1365,7 @@ CTRY_BELIZE,
#else
0,
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_BELIZE
SUBLANG_ENGLISH_BELIZE,
#else
@@ -1375,7 +1379,7 @@ CTRY_CANADA,
#else
0,
#endif
-&language[26],&language[35],0,0,
+&lc_languages[26],&lc_languages[35],0,0,
#ifdef SUBLANG_ENGLISH_CANADA
SUBLANG_ENGLISH_CANADA,
#else
@@ -1395,7 +1399,7 @@ CTRY_SWITZERLAND,
#else
0,
#endif
-&language[35],&language[23],&language[54],0,
+&lc_languages[35],&lc_languages[23],&lc_languages[54],0,
#ifdef SUBLANG_FRENCH_SWITZERLAND
SUBLANG_FRENCH_SWITZERLAND,
#else
@@ -1421,7 +1425,7 @@ CTRY_CHILE,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_CHILE
SUBLANG_SPANISH_CHILE,
#else
@@ -1435,7 +1439,7 @@ CTRY_CHINA,
#else
0,
#endif
-&language[140],0,0,0,
+&lc_languages[140],0,0,0,
#ifdef SUBLANG_CHINESE_SIMPLIFIED_CHINA
SUBLANG_CHINESE_SIMPLIFIED_CHINA,
#else
@@ -1449,7 +1453,7 @@ CTRY_COLOMBIA,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_COLOMBIA
SUBLANG_SPANISH_COLOMBIA,
#else
@@ -1463,7 +1467,7 @@ CTRY_COSTA_RICA,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_COSTA_RICA
SUBLANG_SPANISH_COSTA_RICA,
#else
@@ -1477,7 +1481,7 @@ CTRY_CZECH_REPUBLIC,
#else
0,
#endif
-&language[20],0,0,0,
+&lc_languages[20],0,0,0,
#ifdef SUBLANG_CZECH_CZECH_REPUBLIC
SUBLANG_CZECH_CZECH_REPUBLIC,
#else
@@ -1491,7 +1495,7 @@ CTRY_GERMANY,
#else
0,
#endif
-&language[23],0,0,0,
+&lc_languages[23],0,0,0,
#ifdef SUBLANG_GERMAN_GERMANY
SUBLANG_GERMAN_GERMANY,
#else
@@ -1505,7 +1509,7 @@ CTRY_DENMARK,
#else
0,
#endif
-&language[22],&language[26],0,0,
+&lc_languages[22],&lc_languages[26],0,0,
#ifdef SUBLANG_DANISH_DENMARK
SUBLANG_DANISH_DENMARK,
#else
@@ -1525,7 +1529,7 @@ CTRY_DOMINICAN_REPUBLIC,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_DOMINICAN_REPUBLIC
SUBLANG_SPANISH_DOMINICAN_REPUBLIC,
#else
@@ -1547,7 +1551,7 @@ CTRY_ECUADOR,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_ECUADOR
SUBLANG_SPANISH_ECUADOR,
#else
@@ -1561,7 +1565,7 @@ CTRY_ESTONIA,
#else
0,
#endif
-&language[29],0,0,0,
+&lc_languages[29],0,0,0,
#ifdef SUBLANG_ESTONIAN_ESTONIA
SUBLANG_ESTONIAN_ESTONIA,
#else
@@ -1575,7 +1579,7 @@ CTRY_EGYPT,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_EGYPT
SUBLANG_ARABIC_EGYPT,
#else
@@ -1589,7 +1593,7 @@ CTRY_SPAIN,
#else
0,
#endif
-&language[28],&language[18],&language[30],&language[39],
+&lc_languages[28],&lc_languages[18],&lc_languages[30],&lc_languages[39],
#ifdef SUBLANG_SPANISH_SPAIN
SUBLANG_SPANISH_SPAIN,
#else
@@ -1621,7 +1625,7 @@ CTRY_FINLAND,
#else
0,
#endif
-&language[117],0,0,0,
+&lc_languages[117],0,0,0,
#ifdef SUBLANG_SWEDISH_FINLAND
SUBLANG_SWEDISH_FINLAND,
#else
@@ -1635,7 +1639,7 @@ CTRY_FAROE_ISLANDS,
#else
0,
#endif
-&language[34],0,0,0,
+&lc_languages[34],0,0,0,
#ifdef SUBLANG_FAEROESE_FAROE_ISLANDS
SUBLANG_FAEROESE_FAROE_ISLANDS,
#else
@@ -1649,7 +1653,7 @@ CTRY_FRANCE,
#else
0,
#endif
-&language[35],0,0,0,
+&lc_languages[35],0,0,0,
#ifdef SUBLANG_FRENCH_FRANCE
SUBLANG_FRENCH_FRANCE,
#else
@@ -1671,7 +1675,7 @@ CTRY_ENGLAND,
#endif
#endif
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_UNITED_KINGDOM
SUBLANG_ENGLISH_UNITED_KINGDOM,
#else
@@ -1693,7 +1697,7 @@ CTRY_GREENLAND,
#else
0,
#endif
-&language[61],0,0,0,
+&lc_languages[61],0,0,0,
#ifdef SUBLANG_GREENLANDIC_GREENLAND
SUBLANG_GREENLANDIC_GREENLAND,
#else
@@ -1707,7 +1711,7 @@ CTRY_GREECE,
#else
0,
#endif
-&language[25],0,0,0,
+&lc_languages[25],0,0,0,
#ifdef SUBLANG_GREEK_GREECE
SUBLANG_GREEK_GREECE,
#else
@@ -1721,7 +1725,7 @@ CTRY_GUATEMALA,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_GUATEMALA
SUBLANG_SPANISH_GUATEMALA,
#else
@@ -1735,7 +1739,7 @@ CTRY_HONG_KONG,
#else
0,
#endif
-&language[140],0,0,0,
+&lc_languages[140],0,0,0,
#ifdef SUBLANG_CHINESE_SIMPLIFIED_HONG_KONG
SUBLANG_CHINESE_SIMPLIFIED_HONG_KONG,
#else
@@ -1749,7 +1753,7 @@ CTRY_HONDURAS,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_HONDURAS
SUBLANG_SPANISH_HONDURAS,
#else
@@ -1763,7 +1767,7 @@ CTRY_CROATIA,
#else
0,
#endif
-&language[45],0,0,0,
+&lc_languages[45],0,0,0,
#ifdef SUBLANG_CROATIAN_CROATIA
SUBLANG_CROATIAN_CROATIA,
#else
@@ -1777,7 +1781,7 @@ CTRY_HUNGARY,
#else
0,
#endif
-&language[46],0,0,0,
+&lc_languages[46],0,0,0,
#ifdef SUBLANG_HUNGARIAN_HUNGARY
SUBLANG_HUNGARIAN_HUNGARY,
#else
@@ -1791,7 +1795,7 @@ CTRY_INDONESIA,
#else
0,
#endif
-&language[49],0,0,0,
+&lc_languages[49],0,0,0,
#ifdef SUBLANG_INDONESIAN_INDONESIA
SUBLANG_INDONESIAN_INDONESIA,
#else
@@ -1805,7 +1809,7 @@ CTRY_IRELAND,
#else
0,
#endif
-&language[26],&language[37],0,0,
+&lc_languages[26],&lc_languages[37],0,0,
#ifdef SUBLANG_ENGLISH_IRELAND
SUBLANG_ENGLISH_IRELAND,
#else
@@ -1825,7 +1829,7 @@ CTRY_ISRAEL,
#else
0,
#endif
-&language[43],0,0,0,
+&lc_languages[43],0,0,0,
#ifdef SUBLANG_HEBREW_ISRAEL
SUBLANG_HEBREW_ISRAEL,
#else
@@ -1839,7 +1843,7 @@ CTRY_IRAQ,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_IRAQ
SUBLANG_ARABIC_IRAQ,
#else
@@ -1853,7 +1857,7 @@ CTRY_ICELAND,
#else
0,
#endif
-&language[53],0,0,0,
+&lc_languages[53],0,0,0,
#ifdef SUBLANG_ICELANDIC_ICELAND
SUBLANG_ICELANDIC_ICELAND,
#else
@@ -1867,7 +1871,7 @@ CTRY_ITALY,
#else
0,
#endif
-&language[54],0,0,0,
+&lc_languages[54],0,0,0,
#ifdef SUBLANG_ITALIAN_ITALY
SUBLANG_ITALIAN_ITALY,
#else
@@ -1881,7 +1885,7 @@ CTRY_JAMAICA,
#else
0,
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_JAMAICA
SUBLANG_ENGLISH_JAMAICA,
#else
@@ -1895,7 +1899,7 @@ CTRY_JORDAN,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_JORDAN
SUBLANG_ARABIC_JORDAN,
#else
@@ -1909,7 +1913,7 @@ CTRY_JAPAN,
#else
0,
#endif
-&language[56],0,0,0,
+&lc_languages[56],0,0,0,
#ifdef SUBLANG_JAPANESE_JAPAN
SUBLANG_JAPANESE_JAPAN,
#else
@@ -1931,7 +1935,7 @@ CTRY_SOUTH_KOREA,
#else
0,
#endif
-&language[64],0,0,0,
+&lc_languages[64],0,0,0,
#ifdef SUBLANG_KOREAN_SOUTH_KOREA
SUBLANG_KOREAN_SOUTH_KOREA,
#else
@@ -1945,7 +1949,7 @@ CTRY_KUWAIT,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_KUWAIT
SUBLANG_ARABIC_KUWAIT,
#else
@@ -1959,7 +1963,7 @@ CTRY_LEBANON,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_LEBANON
SUBLANG_ARABIC_LEBANON,
#else
@@ -1973,7 +1977,7 @@ CTRY_LIECHTENSTEIN,
#else
0,
#endif
-&language[23],&language[35],0,0,
+&lc_languages[23],&lc_languages[35],0,0,
#ifdef SUBLANG_GERMAN_LIECHTENSTEIN
SUBLANG_GERMAN_LIECHTENSTEIN,
#else
@@ -1993,7 +1997,7 @@ CTRY_LITHUANIA,
#else
0,
#endif
-&language[71],0,0,0,
+&lc_languages[71],0,0,0,
#ifdef SUBLANG_LITHUANIAN_LITHUANIA
SUBLANG_LITHUANIAN_LITHUANIA,
#else
@@ -2007,7 +2011,7 @@ CTRY_LUXEMBOURG,
#else
0,
#endif
-&language[23],&language[35],0,0,
+&lc_languages[23],&lc_languages[35],0,0,
#ifdef SUBLANG_GERMAN_LUXEMBOURG
SUBLANG_GERMAN_LUXEMBOURG,
#else
@@ -2027,7 +2031,7 @@ CTRY_LATVIA,
#else
0,
#endif
-&language[72],0,0,0,
+&lc_languages[72],0,0,0,
#ifdef SUBLANG_LATVIAN_LATVIA
SUBLANG_LATVIAN_LATVIA,
#else
@@ -2041,7 +2045,7 @@ CTRY_LIBYA,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_LIBYA
SUBLANG_ARABIC_LIBYA,
#else
@@ -2055,7 +2059,7 @@ CTRY_MOROCCO,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_MOROCCO
SUBLANG_ARABIC_MOROCCO,
#else
@@ -2069,7 +2073,7 @@ CTRY_MACEDONIA,
#else
0,
#endif
-&language[75],0,0,0,
+&lc_languages[75],0,0,0,
#ifdef SUBLANG_MACEDONIAN_MACEDONIA
SUBLANG_MACEDONIAN_MACEDONIA,
#else
@@ -2083,7 +2087,7 @@ CTRY_MACAU,
#else
0,
#endif
-&language[140],0,0,0,
+&lc_languages[140],0,0,0,
#ifdef SUBLANG_CHINESE_SIMPLIFIED_MACAU
SUBLANG_CHINESE_SIMPLIFIED_MACAU,
#else
@@ -2097,7 +2101,7 @@ CTRY_MEXICO,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_MEXICO
SUBLANG_SPANISH_MEXICO,
#else
@@ -2119,7 +2123,7 @@ CTRY_NICARAGUA,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_NICARAGUA
SUBLANG_SPANISH_NICARAGUA,
#else
@@ -2133,7 +2137,7 @@ CTRY_NETHERLANDS,
#else
0,
#endif
-&language[86],0,0,0,
+&lc_languages[86],0,0,0,
#ifdef SUBLANG_DUTCH_NETHERLANDS
SUBLANG_DUTCH_NETHERLANDS,
#else
@@ -2147,7 +2151,7 @@ CTRY_NORWAY,
#else
0,
#endif
-&language[84],&language[88],&language[87],0,
+&lc_languages[84],&lc_languages[88],&lc_languages[87],0,
#ifdef SUBLANG_NORWEGIAN_BOKMAL_NORWAY
SUBLANG_NORWEGIAN_BOKMAL_NORWAY,
#else
@@ -2173,7 +2177,7 @@ CTRY_NEW_ZEALAND,
#else
0,
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_NEW_ZEALAND
SUBLANG_ENGLISH_NEW_ZEALAND,
#else
@@ -2187,7 +2191,7 @@ CTRY_OMAN,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_OMAN
SUBLANG_ARABIC_OMAN,
#else
@@ -2201,7 +2205,7 @@ CTRY_PANAMA,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_PANAMA
SUBLANG_SPANISH_PANAMA,
#else
@@ -2215,7 +2219,7 @@ CTRY_PERU,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_PERU
SUBLANG_SPANISH_PERU,
#else
@@ -2229,7 +2233,7 @@ CTRY_POLAND,
#else
0,
#endif
-&language[93],0,0,0,
+&lc_languages[93],0,0,0,
#ifdef SUBLANG_POLISH_POLAND
SUBLANG_POLISH_POLAND,
#else
@@ -2243,7 +2247,7 @@ CTRY_PUERTO_RICO,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_PUERTO_RICO
SUBLANG_SPANISH_PUERTO_RICO,
#else
@@ -2257,7 +2261,7 @@ CTRY_PORTUGAL,
#else
0,
#endif
-&language[95],0,0,0,
+&lc_languages[95],0,0,0,
#ifdef SUBLANG_PORTUGUESE_PORTUGAL
SUBLANG_PORTUGUESE_PORTUGAL,
#else
@@ -2271,7 +2275,7 @@ CTRY_PARAGUAY,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_PARAGUAY
SUBLANG_SPANISH_PARAGUAY,
#else
@@ -2285,7 +2289,7 @@ CTRY_ROMANIA,
#else
0,
#endif
-&language[99],0,0,0,
+&lc_languages[99],0,0,0,
#ifdef SUBLANG_ROMANIAN_ROMANIA
SUBLANG_ROMANIAN_ROMANIA,
#else
@@ -2299,7 +2303,7 @@ CTRY_RUSSIA,
#else
0,
#endif
-&language[100],0,0,0,
+&lc_languages[100],0,0,0,
#ifdef SUBLANG_RUSSIAN_RUSSIA
SUBLANG_RUSSIAN_RUSSIA,
#else
@@ -2313,7 +2317,7 @@ CTRY_SAUDI_ARABIA,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_SAUDI_ARABIA
SUBLANG_ARABIC_SAUDI_ARABIA,
#else
@@ -2327,7 +2331,7 @@ CTRY_SWEDEN,
#else
0,
#endif
-&language[117],0,0,0,
+&lc_languages[117],0,0,0,
#ifdef SUBLANG_SWEDISH_SWEDEN
SUBLANG_SWEDISH_SWEDEN,
#else
@@ -2341,7 +2345,7 @@ CTRY_SINGAPORE,
#else
0,
#endif
-&language[140],0,0,0,
+&lc_languages[140],0,0,0,
#ifdef SUBLANG_CHINESE_SIMPLIFIED_SINGAPORE
SUBLANG_CHINESE_SIMPLIFIED_SINGAPORE,
#else
@@ -2355,7 +2359,7 @@ CTRY_SLOVENIA,
#else
0,
#endif
-&language[108],0,0,0,
+&lc_languages[108],0,0,0,
#ifdef SUBLANG_SLOVENIAN_SLOVENIA
SUBLANG_SLOVENIAN_SLOVENIA,
#else
@@ -2369,7 +2373,7 @@ CTRY_SLOVAKIA,
#else
0,
#endif
-&language[107],0,0,0,
+&lc_languages[107],0,0,0,
#ifdef SUBLANG_SLOVAK_SLOVAKIA
SUBLANG_SLOVAK_SLOVAKIA,
#else
@@ -2383,7 +2387,7 @@ CTRY_SERBIA,
#else
0,
#endif
-&language[113],0,0,0,
+&lc_languages[113],0,0,0,
#ifdef SUBLANG_SERBIAN_SERBIA
SUBLANG_SERBIAN_SERBIA,
#else
@@ -2397,7 +2401,7 @@ CTRY_EL_SALVADOR,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_EL_SALVADOR
SUBLANG_SPANISH_EL_SALVADOR,
#else
@@ -2411,7 +2415,7 @@ CTRY_SYRIA,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_SYRIA
SUBLANG_ARABIC_SYRIA,
#else
@@ -2425,7 +2429,7 @@ CTRY_THAILAND,
#else
0,
#endif
-&language[122],0,0,0,
+&lc_languages[122],0,0,0,
#ifdef SUBLANG_THAI_THAILAND
SUBLANG_THAI_THAILAND,
#else
@@ -2439,7 +2443,7 @@ CTRY_TUNISIA,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_TUNISIA
SUBLANG_ARABIC_TUNISIA,
#else
@@ -2453,7 +2457,7 @@ CTRY_TURKEY,
#else
0,
#endif
-&language[128],0,0,0,
+&lc_languages[128],0,0,0,
#ifdef SUBLANG_TURKISH_TURKEY
SUBLANG_TURKISH_TURKEY,
#else
@@ -2467,7 +2471,7 @@ CTRY_TRINIDAD_TOBAGO,
#else
0,
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_TRINIDAD_TOBAGO
SUBLANG_ENGLISH_TRINIDAD_TOBAGO,
#else
@@ -2481,7 +2485,7 @@ CTRY_TAIWAN,
#else
0,
#endif
-&language[131],0,0,0,
+&lc_languages[131],0,0,0,
#ifdef SUBLANG_CHINESE_TRADITIONAL_TAIWAN
SUBLANG_CHINESE_TRADITIONAL_TAIWAN,
#else
@@ -2495,7 +2499,7 @@ CTRY_UKRAINE,
#else
0,
#endif
-&language[132],&language[100],0,0,
+&lc_languages[132],&lc_languages[100],0,0,
#ifdef SUBLANG_UKRAINIAN_UKRAINE
SUBLANG_UKRAINIAN_UKRAINE,
#else
@@ -2515,7 +2519,7 @@ CTRY_UNITED_KINGDOM,
#else
0,
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_UNITED_KINGDOM
SUBLANG_ENGLISH_UNITED_KINGDOM,
#else
@@ -2533,7 +2537,7 @@ CTRY_USA,
0,
#endif
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_UNITED_STATES
SUBLANG_ENGLISH_UNITED_STATES,
#else
@@ -2551,7 +2555,7 @@ CTRY_URUGUAY,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_URUGUAY
SUBLANG_SPANISH_URUGUAY,
#else
@@ -2565,7 +2569,7 @@ CTRY_VENEZUELA,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_VENEZUELA
SUBLANG_SPANISH_VENEZUELA,
#else
@@ -2579,7 +2583,7 @@ CTRY_YUGOSLAVIA,
#else
0,
#endif
-&language[113],0,0,0,
+&lc_languages[113],0,0,0,
#ifdef SUBLANG_SERBIAN_YUGOSLAVIA
SUBLANG_SERBIAN_YUGOSLAVIA,
#else
@@ -2593,7 +2597,7 @@ CTRY_SOUTH_AFRICA,
#else
0,
#endif
-&language[4],0,0,0,
+&lc_languages[4],0,0,0,
#ifdef SUBLANG_AFRIKAANS_SOUTH_AFRICA
SUBLANG_AFRIKAANS_SOUTH_AFRICA,
#else
@@ -2607,7 +2611,7 @@ CTRY_ZIMBABWE,
#else
0,
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_ZIMBABWE
SUBLANG_ENGLISH_ZIMBABWE,
#else
@@ -2618,13 +2622,13 @@ SUBLANG_ENGLISH_ZIMBABWE,
0
};
-static const Lc_map_t map[] =
+const Lc_map_t lc_maps[] =
{
-{"enu",&language[26],&territory[93],&charset[0],0},
-{"enz",&language[26],&territory[68],&charset[0],0},
-{"esm",&language[28],&territory[63],&charset[0],0},
-{"esn",&language[28],&territory[30],&charset[0],&attribute_es[1]},
-{"esp",&language[28],&territory[30],&charset[0],&attribute_es[0]},
-{"usa",&language[26],&territory[93],&charset[0],0},
+{"enu",&lc_languages[26],&lc_territories[93],&lc_charsets[0],0},
+{"enz",&lc_languages[26],&lc_territories[68],&lc_charsets[0],0},
+{"esm",&lc_languages[28],&lc_territories[63],&lc_charsets[0],0},
+{"esn",&lc_languages[28],&lc_territories[30],&lc_charsets[0],&attribute_es[1]},
+{"esp",&lc_languages[28],&lc_territories[30],&lc_charsets[0],&attribute_es[0]},
+{"usa",&lc_languages[26],&lc_territories[93],&lc_charsets[0],0},
0
};
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/preroot.h b/usr/src/lib/libast/amd64/src/lib/libast/preroot.h
index ec3ecd3cfe..13040e0062 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/preroot.h
+++ b/usr/src/lib/libast/amd64/src/lib/libast/preroot.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/preroot.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/preroot.sh by iffe version 2008-01-31 : : */
#ifndef _def_preroot_ast
#define _def_preroot_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/sig.h b/usr/src/lib/libast/amd64/src/lib/libast/sig.h
index 5edc503e1f..d48dfb6db0 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/sig.h
+++ b/usr/src/lib/libast/amd64/src/lib/libast/sig.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/sig.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/sig.sh by iffe version 2008-01-31 : : */
#ifndef _def_sig_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/tmx.h b/usr/src/lib/libast/amd64/src/lib/libast/tmx.h
index 8034e1cd9e..9a5298b322 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/tmx.h
+++ b/usr/src/lib/libast/amd64/src/lib/libast/tmx.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/tmx by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/tmx by iffe version 2008-01-31 : : */
#ifndef _TMX_H
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/amd64/src/lib/libast/tv.h b/usr/src/lib/libast/amd64/src/lib/libast/tv.h
index 6692382606..1daa582877 100644
--- a/usr/src/lib/libast/amd64/src/lib/libast/tv.h
+++ b/usr/src/lib/libast/amd64/src/lib/libast/tv.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libast/features/tv by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libast/features/tv by iffe version 2008-01-31 : : */
#ifndef _TV_H
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/common/RELEASE b/usr/src/lib/libast/common/RELEASE
index c1e6d9c0de..75937141cc 100644
--- a/usr/src/lib/libast/common/RELEASE
+++ b/usr/src/lib/libast/common/RELEASE
@@ -1,3 +1,101 @@
+08-11-04 regex/regcomp.c: fix locale [!-...] and [^-...] re-initialization
+08-11-04 stdio: add flockfile.c ftrylockfile.c funlockfile.c
+08-10-24 port/astconf.c: handle multiple/trailing '/' in universe initialization
+08-09-10 misc/magic.c: handle old vcodex() indices
+08-09-10 sfio/sfvprintf.c: drop SF_WCWIDTH, use %Lc or %Ls instead
+08-09-05 Makefile: ibm.risc joins the :NOOPTIMIZE: crowd
+08-09-04 regex/regnexec.c: fix nested delimiter match beyond end of subject
+08-08-20 misc/fts.c: fix st_nlink stat() optimization logic
+08-08-19 sfio/sfpkrd.c: workaround macosx recv(PEEK) data consumption on non-socket
+08-08-19 strn?tol?d: handle long double with smaller exponent range than double
+08-08-18 sfio/sfcvt.c: eliminate excessive multiplies and integral overprecision
+08-08-11 tm/tmxfmt.c: handle %10N and %010N
+08-08-06 include/shcmd.h: add 'int invariant;' for builtin invarinat arg count
+08-08-05 features/ndbm: favor sleepycat ndbm compatibility
+08-07-21 include/glob.h,misc/glob.c: GLOB_STARSTAR only forces lstat on chdir
+08-07-17 sfio: sync with kpv
+08-07-17 misc/optget.c: call astwinsize() each time terminal width required
+08-07-16 sfio/sfvscanf.c: fix %% to skip leading space per posix
+08-07-16 vmalloc/vmbest.c: add VMCHECK=m, VM_mmap to favor mmap() alloc
+08-07-16 features/stdio,stdio/f(read|write).c: size_t return value!! ouch
+08-06-24 tm/tmxfmt.c: fix %z to handle tm_isdst -- doh
+08-06-24 misc/astintercept.c,misc/getenv.c: split from misc/setenviron.c
+08-06-17 misc/setenviron.c: add { astintercept() getenv() }
+08-06-09 tm/tmlocale.c: use _DATE_FMT if defined for TM_DEFAULT
+08-06-06 misc/optget.c: handle sub-component about details
+08-06-04 misc/optget.c: fix [-n?\n...\n] version parse
+08-06-04 include/debug.h,misc/debug.c: merge with kpvdebug.h
+08-06-02 features/ndbm: add to tame dbmlib.iffe replication
+08-06-01 comp/resolvepath.c,realpath.c: fix resolvepath() return value type
+08-05-22 tm/tmxdate.c: fix a few ordinal/last/this/next bugs
+08-05-18 string/fmtre.c: fix omitted stack var initialization bug
+08-05-14 regex/regcomp.c,regcoll.c: fix UTF-8 collation sequence logic
+08-05-11 tm/tmxfmt.c: :NOOPTIMIZE:, otherwise %Q/../../ fails
+08-05-01 tm/tmxdate.c: mon 1..12 => mon[13] -- doh
+08-04-30 misc/glob.c,reegex/regcomp.c: ~(R) => ~(O) to avoid pcre clash
+08-04-24 port/astconf.c: 'name = value' does assignment without system init
+08-04-15 port/astconf.c: SC#N treated like 'SC(N)'
+08-04-14 misc/optget.c: clean up nroff output
+08-04-01 port/astconf.c: add RELEASE => /proc/version fallback
+08-03-30 misc/optget.c: [-n]... to enable -number & +number options
+08-03-06 misc/optget.c: ---* and +++* are now operands
+08-03-06 misc/errorx.c: fix old error_info.translate workaround
+08-02-05 regex/regcomp.c: allow REG_SHELL {,n}... => {0,n}...
+08-02-27 misc/stk.c: top element during allocation relocated to top
+08-02-18 include/ip6.h,string/strtoip6.c,fmtip6.c: add ipv6 addr support
+08-02-14 regex/regsubexec.c: fix null match (tricky)
+08-02-14 regex/regsubcomp.c: fix SRE to match ksh
+08-02-11 comp/spawnveg.c: return proper errno on [v]fork() failure
+08-02-11 tm/tmxdate.c,tmdata.c: handle more ISO 8601:2000 forms
+08-02-02 regex/reglib.h: add REGMULTIREF to REG_COMP
+08-02-02 string/strmatch.c: fix str="" pat="" sub values
+08-01-31 comp/conf.sh,conf.tab: handle /bin/sh \ in read data, redir subshell
+08-01-18 misc/magic.tab: amd-x68, 64-bit => x86-64
+08-01-18 string/strnton.c,strntonll.c: add
+07-12-10 string/strelapsed.c: "0" is a valid elapsed time!
+07-12-02 sfio/sfreserve.c: preserve SF_SHARE sfrd() via sfreserve(f,0,0)
+07-11-21 comp/setlocale.c: add sjis_mbtowc() to work around [\~] translation
+07-11-15 features/signal.c: RT(1) .. RT(MAX-1) => RTMIN+1 .. RTMAX-1
+07-11-14 features/float: favor sscanf() due to gnu strto[l]d() nan bugs
+07-10-31 regex/regcomp.c: fix REX_COLL_CLASS node allocation size
+07-10-31 sfio/sfcvt.c: use signbit() if available
+07-10-31 features/isoc99: _ISOC99_SOURCE tests
+07-10-31 port/astmath.c: add -DN=8 for signbit()
+07-10-31 sfio/sfstrtod.h: don't forget about -0.0
+07-10-26 features/map.c: add { optopt optarg optind opterr }
+07-10-26 features/stdio: add _filbuf => _ast__filbuf
+07-10-26 comp/getsubopt.c: fix #undef that interfered with <ast_map.h>
+07-10-26 regex/regcomp.c: fix bug that missed ')' in ~(F)...
+07-10-12 port/astconf.c: fix CONF_ALLOC 16 bit overflow
+07-10-12 misc/fts.c: fix fts_close() to free the handle -- doh
+07-10-11 comp/setlocale.c: second and subsequent setlocale(*,"") reverts to previous
+07-10-11 path/pathprobe.c: add vfs ST_NOSUID check
+07-10-10 comp/conf.tab: add a few more xpg6 deferrals
+07-09-28 astsa: update to share with mainline src via _PACKAGE_astsa
+07-09-25 sfio/sfgetr.c: no limit on string stream line size
+07-09-25 sfio/sfextern.c: increase _Sfmaxr to 256*1024
+07-09-18 misc/procopen.c: tighten up SIGCHLD logic between parent/child
+07-09-18 misc/signal.c: unblock SIG_DFL after setting handler, sig<0 => don't unblock
+07-09-13 misc/fs3d.c: no $LD_PRELOAD => no 3d and avoids invalid mount(2) call
+07-09-11 vmalloc: vmstat(0,0)==1 => region in use, drop VM_primary|VM_secondary
+07-09-05 misc/recstr.c: handle [lL] gobbled by strtol() -- ouch
+07-08-17 path/pathprobe.c: handle '\r' in VERSION string
+07-07-17 regex/regcache.c: regcache(0,n,0) extends cache to size n (no shrinking)
+07-07-16 tm/tmdata.c: add 2005-12-31, drop 1999-12-31 (where did that come from?)
+07-05-21 tm/tmxfmt.c,tmxscan.c: %F => %L (TM_DEFAULT); %F => %Y-%m-%d
+07-05-15 sfio/sfvprintf.c: %h? and SFFMT_SHORT => raw bytes
+07-05-09 features/signal.c,features/siglist: use kill -l & strsignal()
+07-04-25 misc/optctx.c: add for opt_info switching
+07-04-24 misc/cmdarg.c,include/cmdarg.h: add CMD_CHECKED, CMD_SILENT
+07-04-24 misc/procopen.c,include/proc.h: add PROC_CHECK
+07-04-24 misc/procrun.c: add flags arg (current use PROC_ARGMOD)
+07-04-24 misc/cmdarg.c,include/cmdarg.h: move from src/cmd/tw
+07-04-20 port/(lclang.h|lc.c|mc.c|lclib.h|lcgen.c): separate lctab.c
+07-04-20 comp/conf.sh: defer to systems without 'grep -q' -- sigh
+07-04-20 comp/conf.sh: probe for LL integer constant initializer suffix
+07-04-20 include/syslog.h: <namval.h> => <ast_namval.h> for win32
+07-04-20 ast_namval.h: add as copy of include/namval.h for win32
+07-04-19 comp/conf.tab: fix SVID SI entries to probe SI_* (not _SI_*)
07-04-13 tm/tmxdate.c,tm/tmzone.c: handle [-+]0000 UTC zone offset
07-04-11 sfio/sfvprintf.c: add %F, propagate SFFMT_UPPER
07-04-11 sfio/sfcvt.c: handle SFFMT_UPPER => nan/inf vs. NAN/INF
@@ -5,6 +103,7 @@
07-03-28 misc/optget.c: fix l10n --?-
07-03-25 features/common: fix { ast_std.h ast_map.h stdint.h } logic
07-03-21 error.h: move from error_info to (*_error_data_)
+07-03-21 misc/error.c: add errorctx() for error_info switching
07-03-21 option.h: move from opt_info to (*_opt_data_)
07-03-19 regex/regdecomp.c: fix REX_ONECHAR escapes and add REX_KMP
07-03-11 tm/tmxscan.c,regex/regnexec.c: fix strict-alias transgressions
diff --git a/usr/src/lib/libast/common/cdt/dtclose.c b/usr/src/lib/libast/common/cdt/dtclose.c
index b3b17bbbeb..174f49e771 100644
--- a/usr/src/lib/libast/common/cdt/dtclose.c
+++ b/usr/src/lib/libast/common/cdt/dtclose.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/cdt/dtdisc.c b/usr/src/lib/libast/common/cdt/dtdisc.c
index d38fd77dc9..1d29cfde96 100644
--- a/usr/src/lib/libast/common/cdt/dtdisc.c
+++ b/usr/src/lib/libast/common/cdt/dtdisc.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/cdt/dtextract.c b/usr/src/lib/libast/common/cdt/dtextract.c
index 28d455740d..7e943d4432 100644
--- a/usr/src/lib/libast/common/cdt/dtextract.c
+++ b/usr/src/lib/libast/common/cdt/dtextract.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/cdt/dtflatten.c b/usr/src/lib/libast/common/cdt/dtflatten.c
index 86ca685dea..6224ee7bb4 100644
--- a/usr/src/lib/libast/common/cdt/dtflatten.c
+++ b/usr/src/lib/libast/common/cdt/dtflatten.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/cdt/dthash.c b/usr/src/lib/libast/common/cdt/dthash.c
index 62e1e1ba02..d9dcbdcdd0 100644
--- a/usr/src/lib/libast/common/cdt/dthash.c
+++ b/usr/src/lib/libast/common/cdt/dthash.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/cdt/dthdr.h b/usr/src/lib/libast/common/cdt/dthdr.h
index 3ee951e79f..1deff63b5c 100644
--- a/usr/src/lib/libast/common/cdt/dthdr.h
+++ b/usr/src/lib/libast/common/cdt/dthdr.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/cdt/dtlist.c b/usr/src/lib/libast/common/cdt/dtlist.c
index 7feef4e3a2..abdfd5ac87 100644
--- a/usr/src/lib/libast/common/cdt/dtlist.c
+++ b/usr/src/lib/libast/common/cdt/dtlist.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/cdt/dtmethod.c b/usr/src/lib/libast/common/cdt/dtmethod.c
index c77a134816..de1d575854 100644
--- a/usr/src/lib/libast/common/cdt/dtmethod.c
+++ b/usr/src/lib/libast/common/cdt/dtmethod.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/cdt/dtnew.c b/usr/src/lib/libast/common/cdt/dtnew.c
index 95de0412fa..7900e9dca9 100644
--- a/usr/src/lib/libast/common/cdt/dtnew.c
+++ b/usr/src/lib/libast/common/cdt/dtnew.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/cdt/dtopen.c b/usr/src/lib/libast/common/cdt/dtopen.c
index 2f1ba5b26c..5db01152ec 100644
--- a/usr/src/lib/libast/common/cdt/dtopen.c
+++ b/usr/src/lib/libast/common/cdt/dtopen.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/cdt/dtrenew.c b/usr/src/lib/libast/common/cdt/dtrenew.c
index 378c27480c..7d5fcf3b25 100644
--- a/usr/src/lib/libast/common/cdt/dtrenew.c
+++ b/usr/src/lib/libast/common/cdt/dtrenew.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/cdt/dtrestore.c b/usr/src/lib/libast/common/cdt/dtrestore.c
index 0b1becd0e1..a5fea8f443 100644
--- a/usr/src/lib/libast/common/cdt/dtrestore.c
+++ b/usr/src/lib/libast/common/cdt/dtrestore.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/cdt/dtsize.c b/usr/src/lib/libast/common/cdt/dtsize.c
index 71e6671fac..0e96feabf3 100644
--- a/usr/src/lib/libast/common/cdt/dtsize.c
+++ b/usr/src/lib/libast/common/cdt/dtsize.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/cdt/dtstat.c b/usr/src/lib/libast/common/cdt/dtstat.c
index ee1ffa04e7..42c2bc3692 100644
--- a/usr/src/lib/libast/common/cdt/dtstat.c
+++ b/usr/src/lib/libast/common/cdt/dtstat.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/cdt/dtstrhash.c b/usr/src/lib/libast/common/cdt/dtstrhash.c
index cf700f2081..6a6330bb0c 100644
--- a/usr/src/lib/libast/common/cdt/dtstrhash.c
+++ b/usr/src/lib/libast/common/cdt/dtstrhash.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/cdt/dttree.c b/usr/src/lib/libast/common/cdt/dttree.c
index 29b87016cc..413008b51c 100644
--- a/usr/src/lib/libast/common/cdt/dttree.c
+++ b/usr/src/lib/libast/common/cdt/dttree.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/cdt/dttreeset.c b/usr/src/lib/libast/common/cdt/dttreeset.c
index 7e0d237071..e3187b9e42 100644
--- a/usr/src/lib/libast/common/cdt/dttreeset.c
+++ b/usr/src/lib/libast/common/cdt/dttreeset.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/cdt/dtview.c b/usr/src/lib/libast/common/cdt/dtview.c
index 483f5f496f..5977d07170 100644
--- a/usr/src/lib/libast/common/cdt/dtview.c
+++ b/usr/src/lib/libast/common/cdt/dtview.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/cdt/dtwalk.c b/usr/src/lib/libast/common/cdt/dtwalk.c
index 654f2aa982..03a25f829a 100644
--- a/usr/src/lib/libast/common/cdt/dtwalk.c
+++ b/usr/src/lib/libast/common/cdt/dtwalk.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/atexit.c b/usr/src/lib/libast/common/comp/atexit.c
index f2de7ed290..e1ad5cba32 100644
--- a/usr/src/lib/libast/common/comp/atexit.c
+++ b/usr/src/lib/libast/common/comp/atexit.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/basename.c b/usr/src/lib/libast/common/comp/basename.c
index 43f4957604..50b6987765 100644
--- a/usr/src/lib/libast/common/comp/basename.c
+++ b/usr/src/lib/libast/common/comp/basename.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/catopen.c b/usr/src/lib/libast/common/comp/catopen.c
index 2ae5cbc27b..b95b53f0c5 100644
--- a/usr/src/lib/libast/common/comp/catopen.c
+++ b/usr/src/lib/libast/common/comp/catopen.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/closelog.c b/usr/src/lib/libast/common/comp/closelog.c
index 9a91d041bb..f9c97e5595 100644
--- a/usr/src/lib/libast/common/comp/closelog.c
+++ b/usr/src/lib/libast/common/comp/closelog.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/conf.sh b/usr/src/lib/libast/common/comp/conf.sh
index 483a4cee77..115faeb7fd 100644
--- a/usr/src/lib/libast/common/comp/conf.sh
+++ b/usr/src/lib/libast/common/comp/conf.sh
@@ -1,10 +1,10 @@
########################################################################
# #
# This software is part of the ast package #
-# Copyright (c) 1985-2007 AT&T Knowledge Ventures #
+# Copyright (c) 1985-2008 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
-# by AT&T Knowledge Ventures #
+# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# http://www.opensource.org/licenses/cpl1.0.txt #
@@ -21,7 +21,7 @@
########################################################################
: generate getconf and limits info
#
-# @(#)conf.sh (AT&T Research) 2007-04-02
+# @(#)conf.sh (AT&T Research) 2008-01-31
#
# this script generates these files from the table file in the first arg
# the remaining args are the C compiler name and flags
@@ -128,8 +128,33 @@ main()
}
!
if $cc -o $tmp.exe $tmp.c >/dev/null 2>&1 && ./$tmp.exe
-then LL='ll'
-else LL='l'
+then LL_format='ll'
+else LL_format='l'
+fi
+
+# determine the intmax_t constant suffix
+
+cat > $tmp.c <<!
+${head}
+int
+main()
+{
+#if _ast_intmax_long
+ return 1;
+#else
+ _ast_intmax_t s = 0x7fffffffffffffffLL;
+ unsigned _ast_intmax_t u = 0xffffffffffffffffLL;
+
+ return 0;
+#endif
+}
+!
+if $cc -o $tmp.exe $tmp.c >/dev/null 2>&1
+then if ./$tmp.exe
+ then LL_suffix='LL'
+ else LL_suffix='L'
+ fi
+else LL_suffix=''
fi
# set up the names and keys
@@ -200,7 +225,7 @@ case $append$extra in
;;
*" -$f- "*)
;;
- *) if iffe -n - hdr $f | grep -q _hdr_$f
+ *) if iffe -n - hdr $f | grep _hdr_$f >/dev/null
then hdr="$hdr $f"
headers=$headers$nl#include$sp'<'$1'>'
else hdr="$hdr -$f-"
@@ -769,11 +794,11 @@ unsigned int conf[] = {
sed 's/$/,/' $1
echo "};"
} > $tmp.c
- [[ -f $tmp.1.c ]] || cp $tmp.c $tmp.1.c
+ [ -f $tmp.1.c ] || cp $tmp.c $tmp.1.c
if $cc -c $tmp.c > $tmp.e 2>&1
then break
fi
- [[ -f $tmp.1.e ]] || cp $tmp.e $tmp.1.e
+ [ -f $tmp.1.e ] || cp $tmp.e $tmp.1.e
snl='\
'
sed "s/[^_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789][^_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789]*/${snl}/g" $tmp.e |
@@ -851,6 +876,7 @@ esac
name_max=1
export tmp name standard call cc
+exec > $tmp.t
for key in $keys
do eval name=\"'$'CONF_name_$key\"
case $name in
@@ -984,9 +1010,6 @@ do eval name=\"'$'CONF_name_$key\"
case $flags in
*W*) conf_flags="${conf_flags}|CONF_PREFIX_ONLY" ;;
esac
- case $shell in
- ksh) conf_flags=${conf_flags#0?} ;;
- esac
case $debug in
?*) case $standard in
????) sep=" " ;;
@@ -1058,10 +1081,10 @@ do eval name=\"'$'CONF_name_$key\"
;;
'') case $conf_name in
SIZE_*|U*|*_MAX)
- f="%${LL}u"
+ f="%${LL_format}u"
t="unsigned _ast_intmax_t"
;;
- *) f="%${LL}d"
+ *) f="%${LL_format}d"
t="_ast_intmax_t"
;;
esac
@@ -1294,9 +1317,86 @@ ${script}
conf_minmax=0x$conf_minmax
;;
esac
+ case $conf_limit in
+ ?*[-+]*|*['()']*)
+ ;;
+ *[lLuU])
+ case $LL_suffix in
+ ??) case $conf_limit in
+ *[!lL][lL]|*[!lL][lL][uU])
+ conf_limit=${conf_limit}L
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ -*[2468])
+ case $shell in
+ ksh) p=${conf_limit%?}
+ s=${conf_limit#$p}
+ ((s=s-1))
+ ;;
+ *) eval `echo '' $conf_limit | sed 's/ *\(.*\)\(.\) */p=\1 s=\2/'`
+ s=`expr $s - 1`
+ ;;
+ esac
+ conf_limit=${p}${s}${LL_suffix}-1${LL_suffix}
+ ;;
+ 0[xX]*[abcdefABCDEF])
+ conf_limit=${conf_limit}${LL_suffix}
+ ;;
+ -*[0123456789])
+ conf_limit=${conf_limit}${LL_suffix}
+ ;;
+ *[0123456789])
+ conf_limit=${conf_limit}U${LL_suffix}
+ ;;
+ esac
+ case $conf_minmax in
+ ?*[-+]*|*['()']*)
+ ;;
+ *[lLuU])
+ case $LL_suffix in
+ ??) case $conf_minmax in
+ *[!lL][lL]|*[!lL][lL][uU])
+ conf_minmax=${conf_minmax}L
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ -*[2468])
+ case $shell in
+ ksh) p=${conf_minmax%?}
+ s=${conf_minmax#$p}
+ ((s=s-1))
+ ;;
+ *) eval `echo '' $conf_minmax | sed 's/ *\(.*\)\(.\) */p=\1 s=\2/'`
+ s=`expr $s - 1`
+ ;;
+ esac
+ conf_minmax=${p}${s}${LL_suffix}-1${LL_suffix}
+ ;;
+ 0[xX]*[abcdefABCDEF])
+ conf_minmax=${conf_minmax}${LL_suffix}
+ ;;
+ -*[0123456789])
+ conf_minmax=${conf_minmax}${LL_suffix}
+ ;;
+ *[0123456789])
+ conf_minmax=${conf_minmax}U${LL_suffix}
+ ;;
+ esac
conf_limit="{ $conf_limit, 0 }" conf_minmax="{ $conf_minmax, 0 }"
;;
esac
+ case $conf_flags in
+ '0|'*) case $shell in
+ ksh) conf_flags=${conf_flags#0?} ;;
+ *) conf_flags=`echo "$conf_flags" | sed 's/^0.//'` ;;
+ esac
+ ;;
+ esac
echo "{ \"$conf_name\", $conf_limit, $conf_minmax, $conf_flags, $conf_standard, $conf_section, $conf_call, $conf_op },"
case $shell in
ksh) len=${#conf_name}
@@ -1310,7 +1410,8 @@ ${script}
fi
;;
esac
-done > $tmp.t
+done
+exec > /dev/null
case $debug in
-d6) exit ;;
esac
@@ -1327,14 +1428,16 @@ ksh) ((name_max=name_max+3)); ((name_max=name_max/4*4)) ;; # bsd /bin/sh !
esac
{
cat <<!
-#pragma prototyped
-
#ifndef _CONFTAB_H
#define _CONFTAB_H
$systeminfo
${generated}
+#if !defined(const) && !defined(__STDC__) && !defined(__cplusplus) && !defined(c_plusplus)
+#define const
+#endif
+
#define conf _ast_conf_data
#define conf_elements _ast_conf_ndata
@@ -1385,8 +1488,6 @@ cat <<!
struct Conf_s; typedef struct Conf_s Conf_t;
-typedef int (*Conf_f)(Conf_t*, intmax_t*, char**);
-
typedef struct Value_s
{
intmax_t number;
@@ -1398,7 +1499,7 @@ struct Conf_s
const char name[${name_max}];
Value_t limit;
Value_t minmax;
- short flags;
+ unsigned int flags;
short standard;
short section;
short call;
@@ -1421,8 +1522,7 @@ extern int prefix_elements;
#endif
!
-} > $tmp.1
-proto < $tmp.1 > $tmp.2
+} > $tmp.2
case $debug in
-d7) echo $command: $tmp.2 ${base}.h ;;
*) cmp -s $tmp.2 ${base}.h 2>/dev/null || mv $tmp.2 ${base}.h ;;
@@ -1433,7 +1533,6 @@ case $verbose in
esac
{
cat <<!
-#pragma prototyped
${head}
#include <sys/types.h>
#include <limits.h>
@@ -1480,8 +1579,7 @@ cat <<!
int conf_elements = (int)sizeof(conf) / (int)sizeof(conf[0]);
!
-} > $tmp.3
-proto < $tmp.3 > $tmp.4
+} > $tmp.4
case $debug in
-d7) echo $command: $tmp.4 ${base}.c ;;
*) cmp -s $tmp.4 ${base}.c 2>/dev/null || mv $tmp.4 ${base}.c ;;
diff --git a/usr/src/lib/libast/common/comp/conf.tab b/usr/src/lib/libast/common/comp/conf.tab
index 38858c9258..36200e6a11 100644
--- a/usr/src/lib/libast/common/comp/conf.tab
+++ b/usr/src/lib/libast/common/comp/conf.tab
@@ -1,7 +1,7 @@
#
# posix { getconf limits } macro table
#
-# @(#)conf.tab (AT&T Research) 2007-04-01
+# @(#)conf.tab (AT&T Research) 2008-01-31
#
# name standard section call flags [ header ... ] [ value ... ]
#
@@ -45,7 +45,7 @@ AIO_LISTIO_MAX POSIX SC 1 LMU 2
AIO_MAX POSIX SC 1 LMU 1
AIO_PRIO_DELTA_MAX POSIX SC 1 LMU
ALLOC_SIZE_MIN POSIX PC 1 LUVW
-ARCHITECTURE SVID SI 1 0
+ARCHITECTURE SVID SI 1 O
ARG_MAX POSIX SC 1 CDLMUX NCARGS 4096
ASYNCHRONOUS_IO POSIX SC 1 CDFUW
ASYNC_IO POSIX PC 1 FUW
@@ -58,7 +58,7 @@ BC_BASE_MAX POSIX SC 2 LMN 99
BC_DIM_MAX POSIX SC 2 LMN 2048
BC_SCALE_MAX POSIX SC 2 LMN 99
BC_STRING_MAX POSIX SC 2 LMN 1000
-BUSTYPES SVID SI 1 0
+BUSTYPES SVID SI 1 O
CHARCLASS_NAME_MAX XOPEN XX 1 L 14
CHAR_BIT C XX 1 L 8
CHAR_MAX C XX 1 L
@@ -98,8 +98,8 @@ CPUTIME POSIX SC 1 FUW
CPU_KEYBITS1 C QQ 1 L
CPU_VERSION C QQ 1 L
CRYPT XOPEN SC 1 FSUW
-C_BIND POSIX SC 2 FU
-C_DEV POSIX SC 2 FU
+C_BIND POSIX SC 2 CFU
+C_DEV POSIX SC 2 CFU
C_VERSION POSIX SC 2 CDFU
DATAKEYS_MAX C QQ 1 0
DELAYTIMER_MAX POSIX SC 1 LMU 32
@@ -110,15 +110,15 @@ EXPR_NEST_MAX POSIX SC 2 LMN 32
FCHR_MAX SVID SC 1 LMU LONG_MAX 2147483647
FILESIZEBITS POSIX PC 1 LMU (8*sizeof(off_t)) 32
FILE_LOCKING POSIX SC 1 FU
-FORT_DEV POSIX SC 2 FUW
-FORT_RUN POSIX SC 2 FUW
+FORT_DEV POSIX SC 2 CFUW
+FORT_RUN POSIX SC 2 CFUW
FSYNC POSIX SC 1 CDFUW _lib_fsync
GETGR_R_SIZE_MAX C QQ 1 L
GETPW_R_SIZE_MAX C QQ 1 L
HOSTID C QQ 1 L
-HOSTNAME SVID SI 1 0
+HOSTNAME SVID SI 1 O
HOST_NAME_MAX POSIX SC 1 LMU 255
-HW_PROVIDER SVID SI 1 0
+HW_PROVIDER SVID SI 1 O
HW_SERIAL C QQ 1 L
ILP32_OFF32 XBS5 SC 1 FU
ILP32_OFF32_CFLAGS XBS5 CS 1 FU
@@ -130,7 +130,7 @@ ILP32_OFFBIG_CFLAGS XBS5 CS 1 FU
ILP32_OFFBIG_LDFLAGS XBS5 CS 1 FU
ILP32_OFFBIG_LIBS XBS5 CS 1 FU
ILP32_OFFBIG_LINTFLAGS XBS5 CS 1 FU
-INITTAB_NAME SVID SI 1 0
+INITTAB_NAME SVID SI 1 O
INT_MAX C XX 1 L 32767
INT_MIN C XX 1 L -32767
IOV_MAX XOPEN SC 1 LMU 16
@@ -169,7 +169,7 @@ KERNEL_REGION SCO SC 1 0
KERNEL_REGION_MAX SCO SC 1 0
KERNEL_S5INODE SCO SC 1 0
KERNEL_S5INODE_MAX SCO SC 1 0
-KERNEL_STAMP SVID SI 1 0
+KERNEL_STAMP SVID SI 1 O
KERN_POINTERS C QQ 1 L
KERN_SIM C QQ 1 L
LEGACY XOPEN SC 1 FU
@@ -198,7 +198,7 @@ LINK_MAX POSIX PC 1 LMU MAXLINK SHRT_MAX 8
LLONG_MAX C XX 1 L
LLONG_MIN C XX 1 L
LOCALEDEF POSIX SC 1 FUW
-LOCALEDEF POSIX SC 2 FUW
+LOCALEDEF POSIX SC 2 CFUW
LOGIN_NAME_MAX POSIX SC 1 LMU
LOGNAME_MAX SVID SC 1 MU 8
LONG_BIT XOPEN XX 1 L (8*sizeof(long)) 32
@@ -214,7 +214,7 @@ LPBIG_OFFBIG_CFLAGS XBS5 CS 1 FU
LPBIG_OFFBIG_LDFLAGS XBS5 CS 1 FU
LPBIG_OFFBIG_LIBS XBS5 CS 1 FU
LPBIG_OFFBIG_LINTFLAGS XBS5 CS 1 FU
-MACHINE SVID SI 1 0
+MACHINE SVID SI 1 O
MAPPED_FILES POSIX SC 1 CDFUW _lib_mmap
MAX_CANON POSIX PC 1 LMU CANBSIZ 255
MAX_INPUT POSIX PC 1 LMU MAX_CANON 255
@@ -343,8 +343,8 @@ OPEN_MAX_CEIL AST XX 1 L OPEN_MAX
OSREL_MAJ C QQ 1 L
OSREL_MIN C QQ 1 L
OSREL_PATCH C QQ 1 L
-OS_BASE SVID SI 1 0
-OS_PROVIDER SVID SI 1 0
+OS_BASE SVID SI 1 O
+OS_PROVIDER SVID SI 1 O
OS_VERSION AES SC 1 FSU
PAGESIZE POSIX SC 1 MU PAGESIZE PAGE_SIZE 4096 cc{
int main()
@@ -426,7 +426,7 @@ REC_XFER_ALIGN POSIX PC 1 LVW
REENTRANT_FUNCTIONS POSIX SC 1 FU
REGEXP POSIX SC 1 FUW
REGEX_VERSION POSIX SC 1 F 20030916
-RELEASE C QQ 1 L
+RELEASE AST XX 1 L
RESOURCE_LIMITS POSIX SC 1 FU
RE_DUP_MAX POSIX SC 2 LMN 255
RTSIG_MAX POSIX SC 1 LMU 8
@@ -463,7 +463,7 @@ SH AST CS 1 MU sh{
esac
;;
esac
- echo "\"$d/$s\""
+ echo '"'$d/$s'"'
exit
fi
done
@@ -494,7 +494,7 @@ SSIZE_MAX POSIX XX 1 LMUX INT_MAX 32767
STD_BLK SVID SC 1 LMU 1024
STREAM_MAX POSIX SC 1 LMU OPEN_MAX 8
STREAMS XOPEN SC 1 FSUW
-SW_DEV POSIX SC 2 FUW
+SW_DEV POSIX SC 2 CFUW
SYMLINK_MAX POSIX PC 1 LMU 255 cc{
int main()
{
@@ -506,7 +506,7 @@ SYMLINKS POSIX PC 2 FUW
SYMLOOP_MAX POSIX SC 1 LMU 8
SYNCHRONIZED_IO POSIX SC 1 CDFUW
SYNC_IO POSIX PC 1 FUW
-SYSNAME SVID SI 1 0
+SYSNAME SVID SI 1 O
SYSPID_MAX SVID SC 1 LMU 2
THREADS POSIX SC 1 CDFUW
THREADS_PRIO_CEILING POSIX SC 1 FUW
@@ -549,8 +549,8 @@ UIO_MAXIOV C QQ 1 0
ULLONG_MAX C XX 1 L
ULONG_MAX C XX 1 L 4294967295
UNIX XOPEN SC 1 FSUW
-UPE POSIX SC 2 FUW
-USER_LIMIT SVID SI 1 0
+UPE POSIX SC 2 CFUW
+USER_LIMIT SVID SI 1 O
USHRT_MAX C XX 1 L 65535
V6_ILP32_OFF32 POSIX SC 1 W
V6_ILP32_OFFBIG POSIX SC 1 W
diff --git a/usr/src/lib/libast/common/comp/creat64.c b/usr/src/lib/libast/common/comp/creat64.c
index db3cb93c82..5a34f18cde 100644
--- a/usr/src/lib/libast/common/comp/creat64.c
+++ b/usr/src/lib/libast/common/comp/creat64.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/dirname.c b/usr/src/lib/libast/common/comp/dirname.c
index 311c431556..df97ae4485 100644
--- a/usr/src/lib/libast/common/comp/dirname.c
+++ b/usr/src/lib/libast/common/comp/dirname.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/dup2.c b/usr/src/lib/libast/common/comp/dup2.c
index 220bb2f72d..ad06e845c5 100644
--- a/usr/src/lib/libast/common/comp/dup2.c
+++ b/usr/src/lib/libast/common/comp/dup2.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/eaccess.c b/usr/src/lib/libast/common/comp/eaccess.c
index 3604fe835f..80abf8d033 100644
--- a/usr/src/lib/libast/common/comp/eaccess.c
+++ b/usr/src/lib/libast/common/comp/eaccess.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/errno.c b/usr/src/lib/libast/common/comp/errno.c
index e6acc4d0a6..650e3ae5eb 100644
--- a/usr/src/lib/libast/common/comp/errno.c
+++ b/usr/src/lib/libast/common/comp/errno.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/execlp.c b/usr/src/lib/libast/common/comp/execlp.c
index 6a3c0183fc..dee7e9efee 100644
--- a/usr/src/lib/libast/common/comp/execlp.c
+++ b/usr/src/lib/libast/common/comp/execlp.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/execve.c b/usr/src/lib/libast/common/comp/execve.c
index 057821298f..5aeed0a89b 100644
--- a/usr/src/lib/libast/common/comp/execve.c
+++ b/usr/src/lib/libast/common/comp/execve.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/execvp.c b/usr/src/lib/libast/common/comp/execvp.c
index f0467cdf0b..c4cd302fb7 100644
--- a/usr/src/lib/libast/common/comp/execvp.c
+++ b/usr/src/lib/libast/common/comp/execvp.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/execvpe.c b/usr/src/lib/libast/common/comp/execvpe.c
index 4c189c8059..7d5104f688 100644
--- a/usr/src/lib/libast/common/comp/execvpe.c
+++ b/usr/src/lib/libast/common/comp/execvpe.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/fcntl.c b/usr/src/lib/libast/common/comp/fcntl.c
index f1d1a42b70..ed8ca3b0e0 100644
--- a/usr/src/lib/libast/common/comp/fcntl.c
+++ b/usr/src/lib/libast/common/comp/fcntl.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/fmtmsglib.c b/usr/src/lib/libast/common/comp/fmtmsglib.c
index 6ae1fd1c83..ad42438a05 100644
--- a/usr/src/lib/libast/common/comp/fmtmsglib.c
+++ b/usr/src/lib/libast/common/comp/fmtmsglib.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/fnmatch.c b/usr/src/lib/libast/common/comp/fnmatch.c
index 71ffc9cd9b..ebee4f455f 100644
--- a/usr/src/lib/libast/common/comp/fnmatch.c
+++ b/usr/src/lib/libast/common/comp/fnmatch.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/fnmatch.h b/usr/src/lib/libast/common/comp/fnmatch.h
index d0e9500f22..a4d4296ab5 100644
--- a/usr/src/lib/libast/common/comp/fnmatch.h
+++ b/usr/src/lib/libast/common/comp/fnmatch.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/frexp.c b/usr/src/lib/libast/common/comp/frexp.c
index 27fee2d38a..eabb2d5702 100644
--- a/usr/src/lib/libast/common/comp/frexp.c
+++ b/usr/src/lib/libast/common/comp/frexp.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/frexpl.c b/usr/src/lib/libast/common/comp/frexpl.c
index 6555dfa03d..7b5c160d2a 100644
--- a/usr/src/lib/libast/common/comp/frexpl.c
+++ b/usr/src/lib/libast/common/comp/frexpl.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/fsync.c b/usr/src/lib/libast/common/comp/fsync.c
index 1d847de241..1917d180e1 100644
--- a/usr/src/lib/libast/common/comp/fsync.c
+++ b/usr/src/lib/libast/common/comp/fsync.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/ftw.c b/usr/src/lib/libast/common/comp/ftw.c
index 21831c9821..fde4482441 100644
--- a/usr/src/lib/libast/common/comp/ftw.c
+++ b/usr/src/lib/libast/common/comp/ftw.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/ftw.h b/usr/src/lib/libast/common/comp/ftw.h
index 2b312416fe..cb7105f67d 100644
--- a/usr/src/lib/libast/common/comp/ftw.h
+++ b/usr/src/lib/libast/common/comp/ftw.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/getdate.c b/usr/src/lib/libast/common/comp/getdate.c
index e1d64d09e7..710917b9a7 100644
--- a/usr/src/lib/libast/common/comp/getdate.c
+++ b/usr/src/lib/libast/common/comp/getdate.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/getgroups.c b/usr/src/lib/libast/common/comp/getgroups.c
index b909c37a96..39532ff303 100644
--- a/usr/src/lib/libast/common/comp/getgroups.c
+++ b/usr/src/lib/libast/common/comp/getgroups.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/getlogin.c b/usr/src/lib/libast/common/comp/getlogin.c
index b781e99895..0e5e7f05bd 100644
--- a/usr/src/lib/libast/common/comp/getlogin.c
+++ b/usr/src/lib/libast/common/comp/getlogin.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/getopt.c b/usr/src/lib/libast/common/comp/getopt.c
index 86e32d1bc1..37436d2d4b 100644
--- a/usr/src/lib/libast/common/comp/getopt.c
+++ b/usr/src/lib/libast/common/comp/getopt.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/getopt.h b/usr/src/lib/libast/common/comp/getopt.h
index e26806d288..bfb7ddcc63 100644
--- a/usr/src/lib/libast/common/comp/getopt.h
+++ b/usr/src/lib/libast/common/comp/getopt.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -24,12 +24,15 @@
* gnu getopt interface
*/
-#include <ast_getopt.h>
-
-#if !defined(_GETOPT_H) && !defined(_AST_STD_I)
+#ifdef _AST_STD_I
+#define _GETOPT_H -1
+#endif
+#ifndef _GETOPT_H
#define _GETOPT_H 1
+#include <ast_getopt.h>
+
#define no_argument 0
#define required_argument 1
#define optional_argument 2
diff --git a/usr/src/lib/libast/common/comp/getoptl.c b/usr/src/lib/libast/common/comp/getoptl.c
index 4aec979ffa..9135065e72 100644
--- a/usr/src/lib/libast/common/comp/getoptl.c
+++ b/usr/src/lib/libast/common/comp/getoptl.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -22,6 +22,7 @@
#pragma prototyped
#include <ast.h>
+#include <ast_getopt.h>
#undef _BLD_ast /* enable ast imports since we're user static */
diff --git a/usr/src/lib/libast/common/comp/getpgrp.c b/usr/src/lib/libast/common/comp/getpgrp.c
index fb361d8468..22eb3ee993 100644
--- a/usr/src/lib/libast/common/comp/getpgrp.c
+++ b/usr/src/lib/libast/common/comp/getpgrp.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/getsubopt.c b/usr/src/lib/libast/common/comp/getsubopt.c
index b0a04940ee..5c22480a03 100644
--- a/usr/src/lib/libast/common/comp/getsubopt.c
+++ b/usr/src/lib/libast/common/comp/getsubopt.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -24,30 +24,20 @@
* Xopen 4.2 compatibility
*/
-#include <ast_lib.h>
+#include <ast.h>
#undef _lib_getsubopt /* we can satisfy the api */
#if _lib_getsubopt
-#include <ast.h>
-
NoN(getsubopt)
#else
-#define getsubopt ______getsubopt
-
-#include <ast.h>
-
-#undef getsubopt
+#undef _BLD_ast /* enable ast imports since we're user static */
#include <error.h>
-#if defined(__EXPORT__)
-#define extern __EXPORT__
-#endif
-
extern int
getsubopt(register char** op, char* const* tp, char** vp)
{
diff --git a/usr/src/lib/libast/common/comp/getwd.c b/usr/src/lib/libast/common/comp/getwd.c
index 4e6bdc2899..a221c00b90 100644
--- a/usr/src/lib/libast/common/comp/getwd.c
+++ b/usr/src/lib/libast/common/comp/getwd.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/gross.c b/usr/src/lib/libast/common/comp/gross.c
index 58a11c3159..beccc9c2c5 100644
--- a/usr/src/lib/libast/common/comp/gross.c
+++ b/usr/src/lib/libast/common/comp/gross.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/hsearch.c b/usr/src/lib/libast/common/comp/hsearch.c
index 039dc3a007..ba8b7af1f2 100644
--- a/usr/src/lib/libast/common/comp/hsearch.c
+++ b/usr/src/lib/libast/common/comp/hsearch.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/iconv.c b/usr/src/lib/libast/common/comp/iconv.c
index 016831e660..24ecd0da8b 100644
--- a/usr/src/lib/libast/common/comp/iconv.c
+++ b/usr/src/lib/libast/common/comp/iconv.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/killpg.c b/usr/src/lib/libast/common/comp/killpg.c
index e3638bbcb8..56359a1c99 100644
--- a/usr/src/lib/libast/common/comp/killpg.c
+++ b/usr/src/lib/libast/common/comp/killpg.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/libgen.h b/usr/src/lib/libast/common/comp/libgen.h
index 2a908b129a..4c1fc07b1f 100644
--- a/usr/src/lib/libast/common/comp/libgen.h
+++ b/usr/src/lib/libast/common/comp/libgen.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/link.c b/usr/src/lib/libast/common/comp/link.c
index 5b4e66c41b..fead99e39e 100644
--- a/usr/src/lib/libast/common/comp/link.c
+++ b/usr/src/lib/libast/common/comp/link.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/localeconv.c b/usr/src/lib/libast/common/comp/localeconv.c
index 3516d7096e..28afa2e555 100644
--- a/usr/src/lib/libast/common/comp/localeconv.c
+++ b/usr/src/lib/libast/common/comp/localeconv.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/lstat.c b/usr/src/lib/libast/common/comp/lstat.c
index 32cd1d4ce4..99fd406e8d 100644
--- a/usr/src/lib/libast/common/comp/lstat.c
+++ b/usr/src/lib/libast/common/comp/lstat.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/memccpy.c b/usr/src/lib/libast/common/comp/memccpy.c
index 17967374b0..1f70b624a9 100644
--- a/usr/src/lib/libast/common/comp/memccpy.c
+++ b/usr/src/lib/libast/common/comp/memccpy.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/memchr.c b/usr/src/lib/libast/common/comp/memchr.c
index 2baf827ca2..51ced6c317 100644
--- a/usr/src/lib/libast/common/comp/memchr.c
+++ b/usr/src/lib/libast/common/comp/memchr.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/memcmp.c b/usr/src/lib/libast/common/comp/memcmp.c
index 89c713422b..9d6a5166b7 100644
--- a/usr/src/lib/libast/common/comp/memcmp.c
+++ b/usr/src/lib/libast/common/comp/memcmp.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/memcpy.c b/usr/src/lib/libast/common/comp/memcpy.c
index d4151e64bc..2738fcaaef 100644
--- a/usr/src/lib/libast/common/comp/memcpy.c
+++ b/usr/src/lib/libast/common/comp/memcpy.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/memmove.c b/usr/src/lib/libast/common/comp/memmove.c
index 3f1ec8f8d7..5100dadb42 100644
--- a/usr/src/lib/libast/common/comp/memmove.c
+++ b/usr/src/lib/libast/common/comp/memmove.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/memset.c b/usr/src/lib/libast/common/comp/memset.c
index 545295ad9d..db73f12591 100644
--- a/usr/src/lib/libast/common/comp/memset.c
+++ b/usr/src/lib/libast/common/comp/memset.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/mkdir.c b/usr/src/lib/libast/common/comp/mkdir.c
index 19c72f8aea..c75a1702cb 100644
--- a/usr/src/lib/libast/common/comp/mkdir.c
+++ b/usr/src/lib/libast/common/comp/mkdir.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/mkfifo.c b/usr/src/lib/libast/common/comp/mkfifo.c
index 005f162d8b..0d917954c5 100644
--- a/usr/src/lib/libast/common/comp/mkfifo.c
+++ b/usr/src/lib/libast/common/comp/mkfifo.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/mknod.c b/usr/src/lib/libast/common/comp/mknod.c
index 624e32fcde..9f5a67875e 100644
--- a/usr/src/lib/libast/common/comp/mknod.c
+++ b/usr/src/lib/libast/common/comp/mknod.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/mktemp.c b/usr/src/lib/libast/common/comp/mktemp.c
index 91ced5ba3e..73a5b811cb 100644
--- a/usr/src/lib/libast/common/comp/mktemp.c
+++ b/usr/src/lib/libast/common/comp/mktemp.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/mktime.c b/usr/src/lib/libast/common/comp/mktime.c
index d11b0869fa..8ebd366f39 100644
--- a/usr/src/lib/libast/common/comp/mktime.c
+++ b/usr/src/lib/libast/common/comp/mktime.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/mount.c b/usr/src/lib/libast/common/comp/mount.c
index f766bd71c8..3106302ea6 100644
--- a/usr/src/lib/libast/common/comp/mount.c
+++ b/usr/src/lib/libast/common/comp/mount.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/nftw.c b/usr/src/lib/libast/common/comp/nftw.c
index f0706f2f94..134acadf11 100644
--- a/usr/src/lib/libast/common/comp/nftw.c
+++ b/usr/src/lib/libast/common/comp/nftw.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/open.c b/usr/src/lib/libast/common/comp/open.c
index b9667d859b..aae54589fe 100644
--- a/usr/src/lib/libast/common/comp/open.c
+++ b/usr/src/lib/libast/common/comp/open.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/openlog.c b/usr/src/lib/libast/common/comp/openlog.c
index 2ccec4b018..8d2e22f562 100644
--- a/usr/src/lib/libast/common/comp/openlog.c
+++ b/usr/src/lib/libast/common/comp/openlog.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/putenv.c b/usr/src/lib/libast/common/comp/putenv.c
index 81e01b0f27..82fc7424fe 100644
--- a/usr/src/lib/libast/common/comp/putenv.c
+++ b/usr/src/lib/libast/common/comp/putenv.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/re_comp.c b/usr/src/lib/libast/common/comp/re_comp.c
index d2afd5fa84..086b185841 100644
--- a/usr/src/lib/libast/common/comp/re_comp.c
+++ b/usr/src/lib/libast/common/comp/re_comp.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/re_comp.h b/usr/src/lib/libast/common/comp/re_comp.h
index 661cedd2e9..4801721024 100644
--- a/usr/src/lib/libast/common/comp/re_comp.h
+++ b/usr/src/lib/libast/common/comp/re_comp.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/readlink.c b/usr/src/lib/libast/common/comp/readlink.c
index d2aad33df7..72192e6fc8 100644
--- a/usr/src/lib/libast/common/comp/readlink.c
+++ b/usr/src/lib/libast/common/comp/readlink.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/realpath.c b/usr/src/lib/libast/common/comp/realpath.c
index 8fcbc1d170..4688ca132a 100644
--- a/usr/src/lib/libast/common/comp/realpath.c
+++ b/usr/src/lib/libast/common/comp/realpath.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -35,7 +35,7 @@
#undef _def_map_ast
#include <ast_map.h>
-extern char* resolvepath(const char*, char*, size_t);
+extern int resolvepath(const char*, char*, size_t);
#if defined(__EXPORT__)
#define extern __EXPORT__
@@ -44,5 +44,5 @@ extern char* resolvepath(const char*, char*, size_t);
extern char*
realpath(const char* file, char* path)
{
- return resolvepath(file, path, PATH_MAX);
+ return resolvepath(file, path, PATH_MAX) > 0 ? path : (char*)0;
}
diff --git a/usr/src/lib/libast/common/comp/regcmp.c b/usr/src/lib/libast/common/comp/regcmp.c
index bba7a45697..8006fdae68 100644
--- a/usr/src/lib/libast/common/comp/regcmp.c
+++ b/usr/src/lib/libast/common/comp/regcmp.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/regexp.c b/usr/src/lib/libast/common/comp/regexp.c
index 10d67fa30d..fa26310361 100644
--- a/usr/src/lib/libast/common/comp/regexp.c
+++ b/usr/src/lib/libast/common/comp/regexp.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/regexp.h b/usr/src/lib/libast/common/comp/regexp.h
index ab00216b50..2217e987a4 100644
--- a/usr/src/lib/libast/common/comp/regexp.h
+++ b/usr/src/lib/libast/common/comp/regexp.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/remove.c b/usr/src/lib/libast/common/comp/remove.c
index c470e35806..af8a4e0422 100644
--- a/usr/src/lib/libast/common/comp/remove.c
+++ b/usr/src/lib/libast/common/comp/remove.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/rename.c b/usr/src/lib/libast/common/comp/rename.c
index 1c0955bbbf..5da4955b98 100644
--- a/usr/src/lib/libast/common/comp/rename.c
+++ b/usr/src/lib/libast/common/comp/rename.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -49,7 +49,7 @@ mvdir(const char* from, const char* to)
argv[1] = from;
argv[2] = to;
argv[3] = 0;
- if (!procrun(argv[0], argv))
+ if (!procrun(argv[0], argv, 0))
{
errno = oerrno;
return 0;
diff --git a/usr/src/lib/libast/common/comp/resolvepath.c b/usr/src/lib/libast/common/comp/resolvepath.c
index 2e9b09cb46..a3be273646 100644
--- a/usr/src/lib/libast/common/comp/resolvepath.c
+++ b/usr/src/lib/libast/common/comp/resolvepath.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -38,7 +38,7 @@
#define extern __EXPORT__
#endif
-extern char*
+extern int
resolvepath(const char* file, char* path, size_t size)
{
register char* s;
@@ -66,5 +66,5 @@ resolvepath(const char* file, char* path, size_t size)
*s++ = '/';
}
strcpy(s, file);
- return pathcanon(path, PATH_PHYSICAL|PATH_DOTDOT|PATH_EXISTS) ? path : (char*)0;
+ return pathcanon(path, PATH_PHYSICAL|PATH_DOTDOT|PATH_EXISTS) ? strlen(path) : -1;
}
diff --git a/usr/src/lib/libast/common/comp/rmdir.c b/usr/src/lib/libast/common/comp/rmdir.c
index 581c86a0c4..71b5154f48 100644
--- a/usr/src/lib/libast/common/comp/rmdir.c
+++ b/usr/src/lib/libast/common/comp/rmdir.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/setenv.c b/usr/src/lib/libast/common/comp/setenv.c
index 2de75c5a49..4d0031fd08 100644
--- a/usr/src/lib/libast/common/comp/setenv.c
+++ b/usr/src/lib/libast/common/comp/setenv.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/setlocale.c b/usr/src/lib/libast/common/comp/setlocale.c
index 3240e2b697..c212b9fc10 100644
--- a/usr/src/lib/libast/common/comp/setlocale.c
+++ b/usr/src/lib/libast/common/comp/setlocale.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -151,7 +151,7 @@ native_setlocale(int category, const char* locale)
return 0;
sys = uwin_setlocale(category, usr);
if (ast.locale.set & AST_LC_debug)
- sfprintf(sfstderr, "locale uwin %17s %-24s %-24s\n", categories[lcindex(category, 0)].name, usr, sys);
+ sfprintf(sfstderr, "locale uwin %17s %-24s %-24s\n", lc_categories[lcindex(category, 0)].name, usr, sys);
return sys;
}
@@ -370,9 +370,11 @@ debug_strxfrm(register char* t, register const char* s, size_t n)
register const char* q;
register const char* r;
register char* e;
+ char* o;
register size_t z;
register int w;
+ o = t;
z = 0;
if (e = t)
e += n;
@@ -449,9 +451,11 @@ debug_strxfrm(register char* t, register const char* s, size_t n)
s++;
z += DX;
}
+ if (!t)
+ return z;
if (t < e)
*t = 0;
- return z;
+ return t - o;
}
static int
@@ -503,6 +507,28 @@ set_collate(Lc_category_t* cp)
}
/*
+ * workaround the interesting sjis that translates unshifted 7 bit ascii!
+ */
+
+#if _hdr_wchar && _typ_mbstate_t && _lib_mbrtowc
+
+#define mb_state_zero ((mbstate_t*)&ast.pad[sizeof(ast.pad)-2*sizeof(mbstate_t)])
+#define mb_state ((mbstate_t*)&ast.pad[sizeof(ast.pad)-sizeof(mbstate_t)])
+
+static int
+sjis_mbtowc(register wchar_t* p, register const char* s, size_t n)
+{
+ if (n && p && s && (*s == '\\' || *s == '~') && !memcmp(mb_state, mb_state_zero, sizeof(mbstate_t)))
+ {
+ *p = *s;
+ return 1;
+ }
+ return mbrtowc(p, s, n, mb_state);
+}
+
+#endif
+
+/*
* called when LC_CTYPE initialized or changes
*/
@@ -530,6 +556,25 @@ set_ctype(Lc_category_t* cp)
if (!(ast.mb_width = wcwidth))
ast.mb_width = default_wcwidth;
ast.mb_conv = wctomb;
+#ifdef mb_state
+ {
+ /*
+ * check for sjis that translates unshifted 7 bit ascii!
+ */
+
+ char* s;
+ char buf[2];
+
+ mbinit();
+ buf[1] = 0;
+ *(s = buf) = '\\';
+ if (mbchar(s) != buf[0])
+ {
+ memcpy(mb_state, mb_state_zero, sizeof(mbstate_t));
+ ast.mb_towc = sjis_mbtowc;
+ }
+ }
+#endif
}
return 0;
}
@@ -558,7 +603,7 @@ set_numeric(Lc_category_t* cp)
dp = &default_numeric;
LCINFO(category)->data = (void*)dp;
if (ast.locale.set & (AST_LC_debug|AST_LC_setlocale))
- sfprintf(sfstderr, "locale info %17s decimal '%c' thousands '%c'\n", categories[category].name, dp->decimal, dp->thousand >= 0 ? dp->thousand : 'X');
+ sfprintf(sfstderr, "locale info %17s decimal '%c' thousands '%c'\n", lc_categories[category].name, dp->decimal, dp->thousand >= 0 ? dp->thousand : 'X');
}
return 0;
}
@@ -567,7 +612,7 @@ set_numeric(Lc_category_t* cp)
* this table is indexed by AST_LC_[A-Z]*
*/
-Lc_category_t categories[] =
+Lc_category_t lc_categories[] =
{
{ "LC_ALL", LC_ALL, AST_LC_ALL, 0 },
{ "LC_COLLATE", LC_COLLATE, AST_LC_COLLATE, set_collate },
@@ -645,11 +690,11 @@ single(int category, Lc_t* lc)
const char* sys;
int i;
- if (!lc && !(lc = categories[category].prev))
+ if (!lc && !(lc = lc_categories[category].prev))
lc = lcmake(NiL);
if (locales[category] != lc)
{
- if (categories[category].external == -categories[category].internal)
+ if (lc_categories[category].external == -lc_categories[category].internal)
{
sys = 0;
for (i = 1; i < AST_LC_COUNT; i++)
@@ -660,13 +705,13 @@ single(int category, Lc_t* lc)
}
}
else if (lc->flags & (LC_debug|LC_local))
- sys = setlocale(categories[category].external, lcmake(NiL)->name);
- else if (!(sys = setlocale(categories[category].external, lc->name)) &&
- (streq(lc->name, lc->code) || !(sys = setlocale(categories[category].external, lc->code))) &&
+ sys = setlocale(lc_categories[category].external, lcmake(NiL)->name);
+ else if (!(sys = setlocale(lc_categories[category].external, lc->name)) &&
+ (streq(lc->name, lc->code) || !(sys = setlocale(lc_categories[category].external, lc->code))) &&
!streq(lc->code, lc->language->code))
- sys = setlocale(categories[category].external, lc->language->code);
+ sys = setlocale(lc_categories[category].external, lc->language->code);
if (ast.locale.set & (AST_LC_debug|AST_LC_setlocale))
- sfprintf(sfstderr, "locale set %17s %-24s %-24s\n", categories[category].name, lc->name, sys);
+ sfprintf(sfstderr, "locale set %17s %-24s %-24s\n", lc_categories[category].name, lc->name, sys);
if (!sys)
{
/*
@@ -684,13 +729,13 @@ single(int category, Lc_t* lc)
}
if (!(lc->flags & LC_local))
return 0;
- if (categories[category].external != -categories[category].internal)
- setlocale(categories[category].external, lcmake(NiL)->name);
+ if (lc_categories[category].external != -lc_categories[category].internal)
+ setlocale(lc_categories[category].external, lcmake(NiL)->name);
}
locales[category] = lc;
- if (categories[category].setf && (*categories[category].setf)(&categories[category]))
+ if (lc_categories[category].setf && (*lc_categories[category].setf)(&lc_categories[category]))
{
- locales[category] = categories[category].prev;
+ locales[category] = lc_categories[category].prev;
return 0;
}
if (lc->flags & LC_default)
@@ -729,7 +774,7 @@ composite(register const char* s, int initialize)
for (i = 1; i < AST_LC_COUNT; i++)
{
s = w;
- t = categories[i].name;
+ t = lc_categories[i].name;
while (*t && *s++ == *t++);
if (!*t && *s++ == '=')
{
@@ -776,8 +821,8 @@ composite(register const char* s, int initialize)
}
stk[k++] = cat[i];
}
- else if (!categories[cat[i]].prev)
- categories[cat[i]].prev = p;
+ else if (!lc_categories[cat[i]].prev)
+ lc_categories[cat[i]].prev = p;
}
while (s[0] == '/' && s[1] && n < AST_LC_COUNT)
{
@@ -802,8 +847,8 @@ composite(register const char* s, int initialize)
return -1;
}
}
- else if (!categories[n].prev)
- categories[n].prev = p;
+ else if (!lc_categories[n].prev)
+ lc_categories[n].prev = p;
}
return n;
}
@@ -862,7 +907,7 @@ _ast_setlocale(int category, const char* locale)
if (cat[j] == k)
{
cat[j] = -1;
- sfprintf(sp, "%s=", categories[j].name);
+ sfprintf(sp, "%s=", lc_categories[j].name);
}
sfprintf(sp, "%s", locales[i]->name);
}
@@ -872,65 +917,66 @@ _ast_setlocale(int category, const char* locale)
}
if (!ast.locale.serial++)
stropt(getenv("LC_OPTIONS"), options, sizeof(*options), setopt, NiL);
- if (!*locale)
+ if (*locale)
+ p = lcmake(locale);
+ else if (!initialized)
{
- if (!initialized)
- {
- char* u;
- char tmp[256];
+ char* u;
+ char tmp[256];
- /*
- * initialize from the environment
- * precedence determined by X/Open
- */
+ /*
+ * initialize from the environment
+ * precedence determined by X/Open
+ */
- u = 0;
- if (!(a = getenv("LC_ALL")) || !*a)
- {
- for (i = 1; i < AST_LC_COUNT; i++)
- if ((s = getenv(categories[i].name)) && *s)
- {
- if (streq(s, local) && (u || (u = native_locale(locale, tmp, sizeof(tmp)))))
- s = u;
- categories[i].prev = lcmake(s);
- }
- a = getenv("LANG");
- }
- if (a)
- {
- if (streq(a, local) && (u || (u = native_locale(locale, tmp, sizeof(tmp)))))
- a = u;
- if (composite(a, 1))
- a = 0;
- }
- p = 0;
+ u = 0;
+ if (!(a = getenv("LC_ALL")) || !*a)
+ {
for (i = 1; i < AST_LC_COUNT; i++)
- {
- if (!categories[i].prev)
+ if ((s = getenv(lc_categories[i].name)) && *s)
{
- if (!p && !(p = lcmake(a)))
- break;
- categories[i].prev = p;
- }
- if (!single(i, categories[i].prev))
- {
- while (i--)
- single(i, NiL);
- return 0;
+ if (streq(s, local) && (u || (u = native_locale(locale, tmp, sizeof(tmp)))))
+ s = u;
+ lc_categories[i].prev = lcmake(s);
}
+ a = getenv("LANG");
+ }
+ if (a)
+ {
+ if (streq(a, local) && (u || (u = native_locale(locale, tmp, sizeof(tmp)))))
+ a = u;
+ if (composite(a, 1))
+ a = 0;
+ }
+ p = 0;
+ for (i = 1; i < AST_LC_COUNT; i++)
+ {
+ if (!lc_categories[i].prev)
+ {
+ if (!p && !(p = lcmake(a)))
+ break;
+ lc_categories[i].prev = p;
+ }
+ if (!single(i, lc_categories[i].prev))
+ {
+ while (i--)
+ single(i, NiL);
+ return 0;
}
- if (ast.locale.set & AST_LC_debug)
- for (i = 1; i < AST_LC_COUNT; i++)
- sfprintf(sfstderr, "locale env %17s %s\n", categories[i].name, locales[i]->name);
- initialized = 1;
}
+ if (ast.locale.set & AST_LC_debug)
+ for (i = 1; i < AST_LC_COUNT; i++)
+ sfprintf(sfstderr, "locale env %17s %s\n", lc_categories[i].name, locales[i]->name);
+ initialized = 1;
goto compose;
}
- else if (category != AST_LC_ALL)
- return single(category, lcmake(locale));
+ else if (!(p = lc_categories[category].prev))
+ p = lcmake("C");
+ if (category != AST_LC_ALL)
+ return single(category, p);
else if (!(i = composite(locale, 0)))
{
- if (!(p = lcmake(locale)))
+ if (!p)
return 0;
for (i = 1; i < AST_LC_COUNT; i++)
if (!single(i, p))
diff --git a/usr/src/lib/libast/common/comp/setlogmask.c b/usr/src/lib/libast/common/comp/setlogmask.c
index 35da3c3a7b..bd79000a77 100644
--- a/usr/src/lib/libast/common/comp/setlogmask.c
+++ b/usr/src/lib/libast/common/comp/setlogmask.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/setpgid.c b/usr/src/lib/libast/common/comp/setpgid.c
index 7a5a2341c7..d21372604e 100644
--- a/usr/src/lib/libast/common/comp/setpgid.c
+++ b/usr/src/lib/libast/common/comp/setpgid.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/setsid.c b/usr/src/lib/libast/common/comp/setsid.c
index 3fffd606ec..a7c0107891 100644
--- a/usr/src/lib/libast/common/comp/setsid.c
+++ b/usr/src/lib/libast/common/comp/setsid.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/sigunblock.c b/usr/src/lib/libast/common/comp/sigunblock.c
index 0163951d8a..f62d37f2fb 100644
--- a/usr/src/lib/libast/common/comp/sigunblock.c
+++ b/usr/src/lib/libast/common/comp/sigunblock.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/spawnveg.c b/usr/src/lib/libast/common/comp/spawnveg.c
index fd6768c6b9..e3d93a5959 100644
--- a/usr/src/lib/libast/common/comp/spawnveg.c
+++ b/usr/src/lib/libast/common/comp/spawnveg.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -198,7 +198,9 @@ spawnveg(const char* path, char* const argv[], char* const envv[], pid_t pgid)
pid = fork();
#endif
sigcritical(0);
- if (!pid)
+ if (pid == -1)
+ n = errno;
+ else if (!pid)
{
if (pgid < 0)
setsid();
@@ -230,10 +232,10 @@ spawnveg(const char* path, char* const argv[], char* const envv[], pid_t pgid)
n = m;
}
#else
- if (pid != -1 && err[0] != -1)
+ if (err[0] != -1)
{
close(err[1]);
- if (read(err[0], &m, sizeof(m)) == sizeof(m) && m)
+ if (pid != -1 && read(err[0], &m, sizeof(m)) == sizeof(m) && m)
{
while (waitpid(pid, NiL, 0) == -1 && errno == EINTR);
rid = pid = -1;
diff --git a/usr/src/lib/libast/common/comp/statvfs.c b/usr/src/lib/libast/common/comp/statvfs.c
index 3ba4c56c95..3a8c8b35dd 100644
--- a/usr/src/lib/libast/common/comp/statvfs.c
+++ b/usr/src/lib/libast/common/comp/statvfs.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/strcasecmp.c b/usr/src/lib/libast/common/comp/strcasecmp.c
index 42e170a055..9eb0a72880 100644
--- a/usr/src/lib/libast/common/comp/strcasecmp.c
+++ b/usr/src/lib/libast/common/comp/strcasecmp.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/strchr.c b/usr/src/lib/libast/common/comp/strchr.c
index aa09c3be5d..c4aaecae79 100644
--- a/usr/src/lib/libast/common/comp/strchr.c
+++ b/usr/src/lib/libast/common/comp/strchr.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/strftime.c b/usr/src/lib/libast/common/comp/strftime.c
index 737f93fe95..e7ce692756 100644
--- a/usr/src/lib/libast/common/comp/strftime.c
+++ b/usr/src/lib/libast/common/comp/strftime.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/strncasecmp.c b/usr/src/lib/libast/common/comp/strncasecmp.c
index a49159154e..0f4e4e8b3f 100644
--- a/usr/src/lib/libast/common/comp/strncasecmp.c
+++ b/usr/src/lib/libast/common/comp/strncasecmp.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/strptime.c b/usr/src/lib/libast/common/comp/strptime.c
index 14f9c5afe8..2c0d9d0a1c 100644
--- a/usr/src/lib/libast/common/comp/strptime.c
+++ b/usr/src/lib/libast/common/comp/strptime.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/strrchr.c b/usr/src/lib/libast/common/comp/strrchr.c
index 22aab17068..aa14262e02 100644
--- a/usr/src/lib/libast/common/comp/strrchr.c
+++ b/usr/src/lib/libast/common/comp/strrchr.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/strstr.c b/usr/src/lib/libast/common/comp/strstr.c
index ea4b78dc40..3a5c0a0203 100644
--- a/usr/src/lib/libast/common/comp/strstr.c
+++ b/usr/src/lib/libast/common/comp/strstr.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/strtod.c b/usr/src/lib/libast/common/comp/strtod.c
index 5c3af99fac..10ace03ed6 100644
--- a/usr/src/lib/libast/common/comp/strtod.c
+++ b/usr/src/lib/libast/common/comp/strtod.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/strtol.c b/usr/src/lib/libast/common/comp/strtol.c
index 428baf4cb7..e396298532 100644
--- a/usr/src/lib/libast/common/comp/strtol.c
+++ b/usr/src/lib/libast/common/comp/strtol.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/strtold.c b/usr/src/lib/libast/common/comp/strtold.c
index 3d14b6a810..954426dfb8 100644
--- a/usr/src/lib/libast/common/comp/strtold.c
+++ b/usr/src/lib/libast/common/comp/strtold.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -31,13 +31,20 @@
*/
#define _AST_STD_H 1
-#define strtold ______strtold
#include <ast_common.h>
+
+#if _ast_fltmax_double
+#define strtold ______strtold
+#endif
+
#include <ast_lib.h>
#include <ast_sys.h>
+#if _ast_fltmax_double
#undef strtold
+#endif
+
#undef _AST_STD_H
#include "sfstrtof.h"
diff --git a/usr/src/lib/libast/common/comp/strtoll.c b/usr/src/lib/libast/common/comp/strtoll.c
index fadcfc0033..4bcc902860 100644
--- a/usr/src/lib/libast/common/comp/strtoll.c
+++ b/usr/src/lib/libast/common/comp/strtoll.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/strtoul.c b/usr/src/lib/libast/common/comp/strtoul.c
index 68fede797d..3d1484bca3 100644
--- a/usr/src/lib/libast/common/comp/strtoul.c
+++ b/usr/src/lib/libast/common/comp/strtoul.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/strtoull.c b/usr/src/lib/libast/common/comp/strtoull.c
index 5860a07c69..eda6b831de 100644
--- a/usr/src/lib/libast/common/comp/strtoull.c
+++ b/usr/src/lib/libast/common/comp/strtoull.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/swab.c b/usr/src/lib/libast/common/comp/swab.c
index 9251572149..3eb4c89509 100644
--- a/usr/src/lib/libast/common/comp/swab.c
+++ b/usr/src/lib/libast/common/comp/swab.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/symlink.c b/usr/src/lib/libast/common/comp/symlink.c
index 0e27c426b8..46f479c56f 100644
--- a/usr/src/lib/libast/common/comp/symlink.c
+++ b/usr/src/lib/libast/common/comp/symlink.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/syslog.c b/usr/src/lib/libast/common/comp/syslog.c
index d210299e27..7d552c7708 100644
--- a/usr/src/lib/libast/common/comp/syslog.c
+++ b/usr/src/lib/libast/common/comp/syslog.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/system.c b/usr/src/lib/libast/common/comp/system.c
index c5424f9721..59adb526a3 100644
--- a/usr/src/lib/libast/common/comp/system.c
+++ b/usr/src/lib/libast/common/comp/system.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -51,5 +51,5 @@ system(const char* cmd)
sh[1] = "-c";
sh[2] = (char*)cmd;
sh[3] = 0;
- return procrun(NiL, sh);
+ return procrun(NiL, sh, 0);
}
diff --git a/usr/src/lib/libast/common/comp/tempnam.c b/usr/src/lib/libast/common/comp/tempnam.c
index a90aecec19..05273af113 100644
--- a/usr/src/lib/libast/common/comp/tempnam.c
+++ b/usr/src/lib/libast/common/comp/tempnam.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/tmpnam.c b/usr/src/lib/libast/common/comp/tmpnam.c
index 46940f4460..c10df67d52 100644
--- a/usr/src/lib/libast/common/comp/tmpnam.c
+++ b/usr/src/lib/libast/common/comp/tmpnam.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/transition.c b/usr/src/lib/libast/common/comp/transition.c
index 2d29d5a2dd..bb9dce1c89 100644
--- a/usr/src/lib/libast/common/comp/transition.c
+++ b/usr/src/lib/libast/common/comp/transition.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/tsearch.c b/usr/src/lib/libast/common/comp/tsearch.c
index bd2c050481..0882dddc8d 100644
--- a/usr/src/lib/libast/common/comp/tsearch.c
+++ b/usr/src/lib/libast/common/comp/tsearch.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/unlink.c b/usr/src/lib/libast/common/comp/unlink.c
index 59ea891a83..e2d073e01a 100644
--- a/usr/src/lib/libast/common/comp/unlink.c
+++ b/usr/src/lib/libast/common/comp/unlink.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/unsetenv.c b/usr/src/lib/libast/common/comp/unsetenv.c
index b5fee475d4..efd6b66a16 100644
--- a/usr/src/lib/libast/common/comp/unsetenv.c
+++ b/usr/src/lib/libast/common/comp/unsetenv.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/vfork.c b/usr/src/lib/libast/common/comp/vfork.c
index bbc6369ddc..eae503d715 100644
--- a/usr/src/lib/libast/common/comp/vfork.c
+++ b/usr/src/lib/libast/common/comp/vfork.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/waitpid.c b/usr/src/lib/libast/common/comp/waitpid.c
index 95b29abdab..d7cc7d175c 100644
--- a/usr/src/lib/libast/common/comp/waitpid.c
+++ b/usr/src/lib/libast/common/comp/waitpid.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/wc.c b/usr/src/lib/libast/common/comp/wc.c
index 0273b1a0b6..53b70f04f7 100644
--- a/usr/src/lib/libast/common/comp/wc.c
+++ b/usr/src/lib/libast/common/comp/wc.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/wordexp.c b/usr/src/lib/libast/common/comp/wordexp.c
index 475b8f132f..3922160469 100644
--- a/usr/src/lib/libast/common/comp/wordexp.c
+++ b/usr/src/lib/libast/common/comp/wordexp.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/comp/wordexp.h b/usr/src/lib/libast/common/comp/wordexp.h
index ac0f6b6f86..1b0a0cc74c 100644
--- a/usr/src/lib/libast/common/comp/wordexp.h
+++ b/usr/src/lib/libast/common/comp/wordexp.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/dir/dirlib.h b/usr/src/lib/libast/common/dir/dirlib.h
index 3e7afa4d80..d98d24d6e5 100644
--- a/usr/src/lib/libast/common/dir/dirlib.h
+++ b/usr/src/lib/libast/common/dir/dirlib.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/dir/getdents.c b/usr/src/lib/libast/common/dir/getdents.c
index 7a79f47d04..f2c82e2657 100644
--- a/usr/src/lib/libast/common/dir/getdents.c
+++ b/usr/src/lib/libast/common/dir/getdents.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/dir/opendir.c b/usr/src/lib/libast/common/dir/opendir.c
index e41a5cccea..c45e48f671 100644
--- a/usr/src/lib/libast/common/dir/opendir.c
+++ b/usr/src/lib/libast/common/dir/opendir.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/dir/readdir.c b/usr/src/lib/libast/common/dir/readdir.c
index 421c014c22..3dc095b01f 100644
--- a/usr/src/lib/libast/common/dir/readdir.c
+++ b/usr/src/lib/libast/common/dir/readdir.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/dir/rewinddir.c b/usr/src/lib/libast/common/dir/rewinddir.c
index 37a5090a64..6467b586a7 100644
--- a/usr/src/lib/libast/common/dir/rewinddir.c
+++ b/usr/src/lib/libast/common/dir/rewinddir.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/dir/seekdir.c b/usr/src/lib/libast/common/dir/seekdir.c
index 361c83a7b4..9d254ab585 100644
--- a/usr/src/lib/libast/common/dir/seekdir.c
+++ b/usr/src/lib/libast/common/dir/seekdir.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/dir/telldir.c b/usr/src/lib/libast/common/dir/telldir.c
index e9760130f3..d96314aba0 100644
--- a/usr/src/lib/libast/common/dir/telldir.c
+++ b/usr/src/lib/libast/common/dir/telldir.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/disc/memfatal.c b/usr/src/lib/libast/common/disc/memfatal.c
index 866ed70307..adba253257 100644
--- a/usr/src/lib/libast/common/disc/memfatal.c
+++ b/usr/src/lib/libast/common/disc/memfatal.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/disc/sfdcdio.c b/usr/src/lib/libast/common/disc/sfdcdio.c
index ed7720d229..806b35ef74 100644
--- a/usr/src/lib/libast/common/disc/sfdcdio.c
+++ b/usr/src/lib/libast/common/disc/sfdcdio.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -57,6 +57,7 @@ int type;
ssize_t rv;
done = 0; /* amount processed by direct IO */
+ rv = 0;
#ifdef F_DIOINFO
if((P2I(buf)%di->dio.d_mem) == 0 &&
diff --git a/usr/src/lib/libast/common/disc/sfdcdos.c b/usr/src/lib/libast/common/disc/sfdcdos.c
index e90efac7f8..e1e42bd624 100644
--- a/usr/src/lib/libast/common/disc/sfdcdos.c
+++ b/usr/src/lib/libast/common/disc/sfdcdos.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/disc/sfdcfilter.c b/usr/src/lib/libast/common/disc/sfdcfilter.c
index 5ecfe9d827..83f0e6e023 100644
--- a/usr/src/lib/libast/common/disc/sfdcfilter.c
+++ b/usr/src/lib/libast/common/disc/sfdcfilter.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/disc/sfdchdr.h b/usr/src/lib/libast/common/disc/sfdchdr.h
index 17a9e584c8..ed8ccbe62a 100644
--- a/usr/src/lib/libast/common/disc/sfdchdr.h
+++ b/usr/src/lib/libast/common/disc/sfdchdr.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/disc/sfdcmore.c b/usr/src/lib/libast/common/disc/sfdcmore.c
index bedcac96dd..6b79a10f2a 100644
--- a/usr/src/lib/libast/common/disc/sfdcmore.c
+++ b/usr/src/lib/libast/common/disc/sfdcmore.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/disc/sfdcprefix.c b/usr/src/lib/libast/common/disc/sfdcprefix.c
index 38d8045ba4..daab181964 100644
--- a/usr/src/lib/libast/common/disc/sfdcprefix.c
+++ b/usr/src/lib/libast/common/disc/sfdcprefix.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/disc/sfdcseekable.c b/usr/src/lib/libast/common/disc/sfdcseekable.c
index 265067177b..caaa94e34d 100644
--- a/usr/src/lib/libast/common/disc/sfdcseekable.c
+++ b/usr/src/lib/libast/common/disc/sfdcseekable.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/disc/sfdcslow.c b/usr/src/lib/libast/common/disc/sfdcslow.c
index c42f163cf4..5e96b890de 100644
--- a/usr/src/lib/libast/common/disc/sfdcslow.c
+++ b/usr/src/lib/libast/common/disc/sfdcslow.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/disc/sfdcsubstr.c b/usr/src/lib/libast/common/disc/sfdcsubstr.c
index 20a643836b..f166ed7201 100644
--- a/usr/src/lib/libast/common/disc/sfdcsubstr.c
+++ b/usr/src/lib/libast/common/disc/sfdcsubstr.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/disc/sfdctee.c b/usr/src/lib/libast/common/disc/sfdctee.c
index 4be44b3885..adccfbc377 100644
--- a/usr/src/lib/libast/common/disc/sfdctee.c
+++ b/usr/src/lib/libast/common/disc/sfdctee.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/disc/sfdcunion.c b/usr/src/lib/libast/common/disc/sfdcunion.c
index 00197c293f..6565fe0e6b 100644
--- a/usr/src/lib/libast/common/disc/sfdcunion.c
+++ b/usr/src/lib/libast/common/disc/sfdcunion.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/disc/sfkeyprintf.c b/usr/src/lib/libast/common/disc/sfkeyprintf.c
index a0cf5eb1b8..6abe2a0f11 100644
--- a/usr/src/lib/libast/common/disc/sfkeyprintf.c
+++ b/usr/src/lib/libast/common/disc/sfkeyprintf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/disc/sfstrtmp.c b/usr/src/lib/libast/common/disc/sfstrtmp.c
index d6f358f672..e970b8be76 100644
--- a/usr/src/lib/libast/common/disc/sfstrtmp.c
+++ b/usr/src/lib/libast/common/disc/sfstrtmp.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/features/align.c b/usr/src/lib/libast/common/features/align.c
index f8aebf70b0..9220ef1280 100644
--- a/usr/src/lib/libast/common/features/align.c
+++ b/usr/src/lib/libast/common/features/align.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/features/botch.c b/usr/src/lib/libast/common/features/botch.c
index 9107ba4d6a..490d70b35d 100644
--- a/usr/src/lib/libast/common/features/botch.c
+++ b/usr/src/lib/libast/common/features/botch.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -30,7 +30,7 @@
#include <sys/types.h>
#include "FEATURE/lib"
-#include "FEATURE/types"
+#include "FEATURE/sys"
#if _lib_getgroups
extern int getgroups(int, gid_t*);
diff --git a/usr/src/lib/libast/common/features/fcntl.c b/usr/src/lib/libast/common/features/fcntl.c
index a022e5c451..fa0f8c8ee0 100644
--- a/usr/src/lib/libast/common/features/fcntl.c
+++ b/usr/src/lib/libast/common/features/fcntl.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/features/float b/usr/src/lib/libast/common/features/float
index 3897d49e11..5125e5ddc2 100644
--- a/usr/src/lib/libast/common/features/float
+++ b/usr/src/lib/libast/common/features/float
@@ -1,6 +1,8 @@
set prototyped
+set nooptimize
+set stdio FEATURE/isoc99
hdr float,limits,math,values
-lib fpclassify,frexp,frexpl,ldexp,ldexpl,finite,finitel,isinf,isinfl,isnan,isnanl,signbit,copysign,copysignl <math.h> -lm
+lib fpclassify,frexp,frexpl,ldexp,ldexpl,finite,finitel,isinf,isinfl,isnan,isnanl,signbit,copysign,copysignl FEATURE/isoc99 math.h -lm
tst ast_no_um2fm note{ no unsigned intmax => floatmax cast }end nolink{
#include "FEATURE/common"
@@ -211,6 +213,7 @@ macro{
tst - note{ missing floating point limits }end output{
#include "FEATURE/common"
+ #include <stdio.h>
#if _hdr_float
#include <float.h>
#endif
@@ -863,6 +866,7 @@ tst - note{ missing floating point limits }end output{
tst - note{ double exponent bitfoolery }end output{
#include "FEATURE/common"
+ #include <stdio.h>
typedef union _dbl_exp_u
{
unsigned _ast_int4_t e[sizeof(double) / 4];
@@ -896,6 +900,7 @@ tst - note{ double exponent bitfoolery }end output{
tst - note{ long double exponent bitfoolery }end output{
#include "FEATURE/common"
+ #include <stdio.h>
typedef union _ast_fltmax_exp_u
{
unsigned _ast_int4_t e[sizeof(_ast_fltmax_t) / 4];
@@ -928,6 +933,7 @@ tst - note{ long double exponent bitfoolery }end output{
}end
tst - -DN=1 - -DN=2 note{ _ast_fltmax_t maximum integral type }end output{
+ #include <stdio.h>
int
main()
{
@@ -946,8 +952,9 @@ tst - -DN=1 - -DN=2 note{ _ast_fltmax_t maximum integral type }end output{
}
}end
-tst - -lm -DSTRTO=1 - -DSCAN=1 - -DDIV=1 - -DEXP=1 - -DADD=1 - -DMPY=1 note{ INF and NAN memory representations }end output{
+tst - -DSCAN=1 - -lm -DSTRTO=1 - -DDIV=1 - -DEXP=1 - -DADD=1 - -DMPY=1 note{ INF and NAN memory representations }end output{
#include "FEATURE/common"
+ #include <stdio.h>
#include <sys/types.h>
#include <signal.h>
#if _hdr_float
diff --git a/usr/src/lib/libast/common/features/fs b/usr/src/lib/libast/common/features/fs
index 470d20162e..b3d741e574 100644
--- a/usr/src/lib/libast/common/features/fs
+++ b/usr/src/lib/libast/common/features/fs
@@ -54,6 +54,7 @@ lcl xstat64 -D_LARGEFILE64_SOURCE link{
}end
header sys/stat.h
+header sys/mkdev.h
extern chmod int (const char*, mode_t)
extern fstat int (int, struct stat*)
diff --git a/usr/src/lib/libast/common/features/isoc99 b/usr/src/lib/libast/common/features/isoc99
new file mode 100644
index 0000000000..e85c9f52a7
--- /dev/null
+++ b/usr/src/lib/libast/common/features/isoc99
@@ -0,0 +1,13 @@
+if tst -D_ISOC99_SOURCE -lm note{ _ISOC99_SOURCE plays nice }end link{
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+ #include <math.h>
+ int main() { return signbit(-0.0); }
+ }end {
+ #ifndef _ISOC99_SOURCE
+ #define _ISOC99_SOURCE 1
+ #endif
+ }
+endif
diff --git a/usr/src/lib/libast/common/features/libpath.sh b/usr/src/lib/libast/common/features/libpath.sh
index 89c12b0fb4..22aaee01a6 100644
--- a/usr/src/lib/libast/common/features/libpath.sh
+++ b/usr/src/lib/libast/common/features/libpath.sh
@@ -1,10 +1,10 @@
########################################################################
# #
# This software is part of the ast package #
-# Copyright (c) 1985-2007 AT&T Knowledge Ventures #
+# Copyright (c) 1985-2008 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
-# by AT&T Knowledge Ventures #
+# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# http://www.opensource.org/licenses/cpl1.0.txt #
diff --git a/usr/src/lib/libast/common/features/limits.c b/usr/src/lib/libast/common/features/limits.c
index a95d92b853..57f41bea1b 100644
--- a/usr/src/lib/libast/common/features/limits.c
+++ b/usr/src/lib/libast/common/features/limits.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/features/map.c b/usr/src/lib/libast/common/features/map.c
index bad5d052c5..e647b62797 100644
--- a/usr/src/lib/libast/common/features/map.c
+++ b/usr/src/lib/libast/common/features/map.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -109,6 +109,14 @@ main()
printf("#define getopt_long _ast_getopt_long\n");
printf("#undef getopt_long_only\n");
printf("#define getopt_long_only _ast_getopt_long_only\n");
+ printf("#undef optopt\n");
+ printf("#define optopt _ast_optopt\n");
+ printf("#undef optarg\n");
+ printf("#define optarg _ast_optarg\n");
+ printf("#undef optind\n");
+ printf("#define optind _ast_optind\n");
+ printf("#undef opterr\n");
+ printf("#define opterr _ast_opterr\n");
#endif
printf("#undef getwd\n");
printf("#define getwd _ast_getwd\n");
@@ -135,6 +143,8 @@ main()
printf("#define mktime _ast_mktime\n");
printf("#undef nftw\n");
printf("#define nftw _ast_nftw\n");
+ printf("#undef optctx\n");
+ printf("#define optctx _ast_optctx\n");
printf("#undef optesc\n");
printf("#define optesc _ast_optesc\n");
printf("#undef optget\n");
@@ -263,7 +273,7 @@ main()
printf("extern int remove(const char*);\n");
printf("#undef resolvepath\n");
printf("#define resolvepath _ast_resolvepath\n");
- printf("extern char* resolvepath(const char*, char*, size_t);\n");
+ printf("extern int resolvepath(const char*, char*, size_t);\n");
printf("#undef setenv\n");
printf("#define setenv _ast_setenv\n");
printf("extern int setenv(const char*, const char*, int);\n");
diff --git a/usr/src/lib/libast/common/features/mode.c b/usr/src/lib/libast/common/features/mode.c
index c2b33b6951..79f42f620f 100644
--- a/usr/src/lib/libast/common/features/mode.c
+++ b/usr/src/lib/libast/common/features/mode.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/features/ndbm b/usr/src/lib/libast/common/features/ndbm
new file mode 100644
index 0000000000..d12d15ced9
--- /dev/null
+++ b/usr/src/lib/libast/common/features/ndbm
@@ -0,0 +1,29 @@
+if tst -ldb note{ sleepycat ndbm compatibility }end link{
+ #define DB_DBM_HSEARCH 1
+ #include <db.h>
+ int main()
+ {
+ DBM* dbm = 0;
+ dbm_close(dbm);
+ return 0;
+ }
+ }end {
+ #ifndef DB_DBM_HSEARCH
+ #define DB_DBM_HSEARCH 1
+ #include <db.h>
+ #endif
+ #define _use_ndbm 1
+ }
+elif hdr gdbm-ndbm {
+ #include <gdbm-ndbm.h>
+ #define _use_ndbm 1
+}
+elif hdr gdbm/ndbm {
+ #include <gdbm/ndbm.h>
+ #define _use_ndbm 1
+}
+elif hdr ndbm {
+ #include <ndbm.h>
+ #define _use_ndbm 1
+}
+endif
diff --git a/usr/src/lib/libast/common/features/param.sh b/usr/src/lib/libast/common/features/param.sh
index ea162202a7..6ac2dae5ee 100644
--- a/usr/src/lib/libast/common/features/param.sh
+++ b/usr/src/lib/libast/common/features/param.sh
@@ -1,10 +1,10 @@
########################################################################
# #
# This software is part of the ast package #
-# Copyright (c) 1985-2007 AT&T Knowledge Ventures #
+# Copyright (c) 1985-2008 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
-# by AT&T Knowledge Ventures #
+# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# http://www.opensource.org/licenses/cpl1.0.txt #
diff --git a/usr/src/lib/libast/common/features/preroot.sh b/usr/src/lib/libast/common/features/preroot.sh
index f997e2c93b..340ffd68d0 100644
--- a/usr/src/lib/libast/common/features/preroot.sh
+++ b/usr/src/lib/libast/common/features/preroot.sh
@@ -1,10 +1,10 @@
########################################################################
# #
# This software is part of the ast package #
-# Copyright (c) 1985-2007 AT&T Knowledge Ventures #
+# Copyright (c) 1985-2008 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
-# by AT&T Knowledge Ventures #
+# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# http://www.opensource.org/licenses/cpl1.0.txt #
diff --git a/usr/src/lib/libast/common/features/sfinit.c b/usr/src/lib/libast/common/features/sfinit.c
index f3feb5493b..82bb7a1f66 100644
--- a/usr/src/lib/libast/common/features/sfinit.c
+++ b/usr/src/lib/libast/common/features/sfinit.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/features/sig.sh b/usr/src/lib/libast/common/features/sig.sh
index d52aaa947d..ce00815fe1 100644
--- a/usr/src/lib/libast/common/features/sig.sh
+++ b/usr/src/lib/libast/common/features/sig.sh
@@ -1,10 +1,10 @@
########################################################################
# #
# This software is part of the ast package #
-# Copyright (c) 1985-2007 AT&T Knowledge Ventures #
+# Copyright (c) 1985-2008 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
-# by AT&T Knowledge Ventures #
+# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# http://www.opensource.org/licenses/cpl1.0.txt #
diff --git a/usr/src/lib/libast/common/features/siglist b/usr/src/lib/libast/common/features/siglist
new file mode 100644
index 0000000000..37d1bf0525
--- /dev/null
+++ b/usr/src/lib/libast/common/features/siglist
@@ -0,0 +1,14 @@
+lib strsignal string.h signal.h
+
+tst - run{
+ for sig in `/bin/kill -l 2>/dev/null`
+ do case $sig in
+ *[!A-Za-z0-9_]*|*MIN|*MAX)
+ ;;
+ *) echo "#if defined(SIG$sig) && !defined(HAD_SIG$sig)"
+ echo "0,\"$sig\",SIG$sig,"
+ echo "#endif"
+ ;;
+ esac
+ done
+}end
diff --git a/usr/src/lib/libast/common/features/signal.c b/usr/src/lib/libast/common/features/signal.c
index 60f60d2ee6..1bce5eeb2f 100644
--- a/usr/src/lib/libast/common/features/signal.c
+++ b/usr/src/lib/libast/common/features/signal.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -22,13 +22,19 @@
#pragma prototyped
/*
* Glenn Fowler
- * AT&T Bell Laboratories
+ * AT&T Research
*
* generate signal features
*/
+#include "FEATURE/standards"
+
+#define strsignal ______strsignal
+
#include <signal.h>
+#undef strsignal
+
struct _m_
{
char* text;
@@ -41,170 +47,226 @@ struct _m_
static struct _m_ map[] =
{
#ifdef SIGABRT
+#define HAD_SIGABRT 1
"Abort", "ABRT", SIGABRT,
#endif
#ifdef SIGAIO
+#define HAD_SIGAIO 1
"Asynchronous I/O", "AIO", SIGAIO,
#endif
#ifdef SIGALRM
+#define HAD_SIGALRM 1
"Alarm call", "ALRM", SIGALRM,
#endif
#ifdef SIGAPOLLO
+#define HAD_SIGAPOLLO 1
"Apollo", "APOLLO", SIGAPOLLO,
#endif
#ifdef SIGBUS
+#define HAD_SIGBUS 1
"Bus error", "BUS", SIGBUS,
#endif
#ifdef SIGCHLD
+#define HAD_SIGCHLD 1
"Child status change", "CHLD", SIGCHLD,
#endif
#ifdef SIGCLD
+#define HAD_SIGCLD 1
"Death of child", "CLD", SIGCLD,
#endif
#ifdef SIGCONT
+#define HAD_SIGCONT 1
"Stopped process continued", "CONT", SIGCONT,
#endif
#ifdef SIGDANGER
+#define HAD_SIGDANGER 1
"System crash soon", "DANGER", SIGDANGER,
#endif
#ifdef SIGDEBUG
+#define HAD_SIGDEBUG 1
"Debug trap", "DEBUG", SIGDEBUG,
#endif
#ifdef SIGDIL
+#define HAD_SIGDIL 1
"DIL trap", "DIL", SIGDIL,
#endif
#ifdef SIGEMT
+#define HAD_SIGEMT 1
"EMT trap", "EMT", SIGEMT,
#endif
#ifdef SIGERR
+#define HAD_SIGERR 1
"ERR trap", "ERR", SIGERR,
#endif
#ifdef SIGEXIT
+#define HAD_SIGEXIT 1
"Exit", "EXIT", SIGEXIT,
#endif
#ifdef SIGFPE
+#define HAD_SIGFPE 1
"Floating exception", "FPE", SIGFPE,
#endif
#ifdef SIGFREEZE
+#define HAD_SIGFREEZE 1
"CPR freeze", "FREEZE", SIGFREEZE,
#endif
#ifdef SIGHUP
+#define HAD_SIGHUP 1
"Hangup", "HUP", SIGHUP,
#endif
#ifdef SIGILL
+#define HAD_SIGILL 1
"Illegal instruction", "ILL", SIGILL,
#endif
#ifdef SIGINT
+#define HAD_SIGINT 1
"Interrupt", "INT", SIGINT,
#endif
#ifdef SIGIO
+#define HAD_SIGIO 1
"IO possible", "IO", SIGIO,
#endif
#ifdef SIGIOT
+#define HAD_SIGIOT 1
"IOT trap", "IOT", SIGIOT,
#endif
#ifdef SIGKILL
+#define HAD_SIGKILL 1
"Killed", "KILL", SIGKILL,
#endif
#ifdef SIGLAB
+#define HAD_SIGLAB 1
"Security label changed", "LAB", SIGLAB,
#endif
#ifdef SIGLOST
+#define HAD_SIGLOST 1
"Resources lost", "LOST", SIGLOST,
#endif
#ifdef SIGLWP
+#define HAD_SIGLWP 1
"Thread event", "LWP", SIGLWP,
#endif
#ifdef SIGMIGRATE
+#define HAD_SIGMIGRATE 1
"Migrate process", "MIGRATE", SIGMIGRATE,
#endif
#ifdef SIGPHONE
+#define HAD_SIGPHONE 1
"Phone status change", "PHONE", SIGPHONE,
#endif
#ifdef SIGPIPE
+#define HAD_SIGPIPE 1
"Broken pipe", "PIPE", SIGPIPE,
#endif
#ifdef SIGPOLL
+#define HAD_SIGPOLL 1
"Poll event", "POLL", SIGPOLL,
#endif
#ifdef SIGPROF
+#define HAD_SIGPROF 1
"Profile timer alarm", "PROF", SIGPROF,
#endif
#ifdef SIGPWR
+#define HAD_SIGPWR 1
"Power fail", "PWR", SIGPWR,
#endif
#ifdef SIGQUIT
+#define HAD_SIGQUIT 1
"Quit", "QUIT", SIGQUIT,
#endif
#ifdef SIGSEGV
+#define HAD_SIGSEGV 1
"Memory fault", "SEGV", SIGSEGV,
#endif
#ifdef SIGSOUND
+#define HAD_SIGSOUND 1
"Sound completed", "SOUND", SIGSOUND,
#endif
#ifdef SIGSSTOP
+#define HAD_SIGSSTOP 1
"Sendable stop", "SSTOP", SIGSSTOP,
#endif
#ifdef gould
+#define HAD_gould 1
"Stack overflow", "STKOV", 28,
#endif
#ifdef SIGSTOP
+#define HAD_SIGSTOP 1
"Stopped (signal)", "STOP", SIGSTOP,
#endif
#ifdef SIGSYS
+#define HAD_SIGSYS 1
"Bad system call", "SYS", SIGSYS,
#endif
#ifdef SIGTERM
+#define HAD_SIGTERM 1
"Terminated", "TERM", SIGTERM,
#endif
#ifdef SIGTHAW
+#define HAD_SIGTHAW 1
"CPR thaw", "THAW", SIGTHAW,
#endif
#ifdef SIGTINT
+#define HAD_SIGTINT 1
"Interrupt (terminal)", "TINT", SIGTINT,
#endif
#ifdef SIGTRAP
+#define HAD_SIGTRAP 1
"Trace trap", "TRAP", SIGTRAP,
#endif
#ifdef SIGTSTP
+#define HAD_SIGTSTP 1
"Stopped", "TSTP", SIGTSTP,
#endif
#ifdef SIGTTIN
+#define HAD_SIGTTIN 1
"Stopped (tty input)", "TTIN", SIGTTIN,
#endif
#ifdef SIGTTOU
+#define HAD_SIGTTOU 1
"Stopped (tty output)", "TTOU", SIGTTOU,
#endif
#ifdef SIGURG
+#define HAD_SIGURG 1
"Urgent IO", "URG", SIGURG,
#endif
#ifdef SIGUSR1
+#define HAD_SIGUSR1 1
"User signal 1", "USR1", SIGUSR1,
#endif
#ifdef SIGUSR2
+#define HAD_SIGUSR2 1
"User signal 2", "USR2", SIGUSR2,
#endif
#ifdef SIGVTALRM
+#define HAD_SIGVTALRM 1
"Virtual timer alarm", "VTALRM", SIGVTALRM,
#endif
#ifdef SIGWAITING
+#define HAD_SIGWAITING 1
"All threads blocked", "WAITING", SIGWAITING,
#endif
#ifdef SIGWINCH
+#define HAD_SIGWINCH 1
"Window change", "WINCH", SIGWINCH,
#endif
#ifdef SIGWIND
+#define HAD_SIGWIND 1
"Window change", "WIND", SIGWIND,
#endif
#ifdef SIGWINDOW
+#define HAD_SIGWINDOW 1
"Window change", "WINDOW", SIGWINDOW,
#endif
#ifdef SIGXCPU
+#define HAD_SIGXCPU 1
"CPU time limit", "XCPU", SIGXCPU,
#endif
#ifdef SIGXFSZ
+#define HAD_SIGXFSZ 1
"File size limit", "XFSZ", SIGXFSZ,
#endif
+#include "FEATURE/siglist"
0
};
@@ -214,7 +276,11 @@ static struct _m_ map[] =
#define RANGE_SIG (~(RANGE_MIN|RANGE_MAX|RANGE_RT))
-static int index[64];
+static int mapindex[1024];
+
+#if _lib_strsignal
+extern char* strsignal(int);
+#endif
int
main()
@@ -222,14 +288,19 @@ main()
register int i;
register int j;
register int k;
+ int m;
int n;
+#if _lib_strsignal
+ char* s;
+#endif
k = 0;
for (i = 0; map[i].name; i++)
- if ((j = map[i].value) > 0 && j < elementsof(index) && !index[j])
+ if ((j = map[i].value) > 0 && j < elementsof(mapindex) && !mapindex[j])
{
- if (j > k) k = j;
- index[j] = i;
+ if (j > k)
+ k = j;
+ mapindex[j] = i;
}
#ifdef SIGRTMIN
i = SIGRTMIN;
@@ -238,15 +309,17 @@ main()
#else
j = i;
#endif
- if (j >= elementsof(index)) j = elementsof(index) - 1;
- if (i <= j && i > 0 && i < elementsof(index) && j > 0 && j < elementsof(index))
+ if (j >= elementsof(mapindex))
+ j = elementsof(mapindex) - 1;
+ if (i <= j && i > 0 && i < elementsof(mapindex) && j > 0 && j < elementsof(mapindex))
{
- if (j > k) k = j;
- index[i] = RANGE_MIN | RANGE_RT;
+ if (j > k)
+ k = j;
+ mapindex[i] = RANGE_MIN | RANGE_RT;
n = 1;
while (++i < j)
- index[i] = RANGE_RT | n++;
- index[j] = RANGE_MAX | RANGE_RT | n;
+ mapindex[i] = RANGE_RT | n++;
+ mapindex[j] = RANGE_MAX | RANGE_RT | n;
}
#endif
printf("#pragma prototyped\n");
@@ -255,23 +328,43 @@ main()
printf("static const char* const sig_name[] =\n");
printf("{\n");
for (i = 0; i <= k; i++)
- if (!(j = index[i])) printf(" \"%d\",\n", i);
+ if (!(j = mapindex[i]))
+ printf(" \"%d\",\n", i);
else if (j & RANGE_RT)
{
- if (j & RANGE_MIN) printf(" \"RTMIN\",\n");
- else if (j & RANGE_MAX) printf(" \"RTMAX\",\n");
- else printf(" \"RT%d\",\n", j & RANGE_SIG);
+ if (j & RANGE_MIN)
+ printf(" \"RTMIN\",\n");
+ else if (j & RANGE_MAX)
+ printf(" \"RTMAX\",\n");
+ else
+ {
+ m = j & RANGE_SIG;
+ if (m > n / 2)
+ printf(" \"RTMAX-%d\",\n", n - m);
+ else
+ printf(" \"RTMIN+%d\",\n", m);
+ }
}
- else printf(" \"%s\",\n", map[j].name);
+ else
+ printf(" \"%s\",\n", map[j].name);
printf(" 0\n");
printf("};\n");
printf("\n");
printf("static const char* const sig_text[] =\n");
printf("{\n");
for (i = 0; i <= k; i++)
- if (!(j = index[i])) printf(" \"Signal %d\",\n", i);
- else if (j & RANGE_RT) printf(" \"Realtime priority %d%s\",\n", j & RANGE_SIG, (j & RANGE_MIN) ? " (lo)" : (j & RANGE_MAX) ? " (hi)" : "");
- else printf(" \"%s\",\n", map[j].text);
+ if (!(j = mapindex[i]))
+ printf(" \"Signal %d\",\n", i);
+ else if (j & RANGE_RT)
+ printf(" \"Realtime priority %d%s\",\n", j & RANGE_SIG, (j & RANGE_MIN) ? " (lo)" : (j & RANGE_MAX) ? " (hi)" : "");
+ else if (map[j].text)
+ printf(" \"%s\",\n", map[j].text);
+#if _lib_strsignal
+ else if (s = strsignal(i))
+ printf(" \"%s\",\n", s);
+#endif
+ else
+ printf(" \"Signal %d\",\n", i);
printf(" 0\n");
printf("};\n");
return 0;
diff --git a/usr/src/lib/libast/common/features/stdio b/usr/src/lib/libast/common/features/stdio
index 9951d517b8..b323893998 100644
--- a/usr/src/lib/libast/common/features/stdio
+++ b/usr/src/lib/libast/common/features/stdio
@@ -117,7 +117,7 @@ cat{
extern int fpurge(FILE*);
extern int fputc(int, FILE*);
extern int fputs(const char*, FILE*);
- extern ssize_t fread(void*, size_t, size_t, FILE*);
+ extern size_t fread(void*, size_t, size_t, FILE*);
extern FILE* freopen(const char*, const char*, FILE*);
extern int fscanf(FILE*, const char*, ...);
extern int fseek(FILE*, long, int);
@@ -125,7 +125,7 @@ cat{
extern int fsetpos(FILE*, const fpos_t*);
extern long ftell(FILE*);
extern off_t ftello(FILE*);
- extern ssize_t fwrite(const void*, size_t, size_t, FILE*);
+ extern size_t fwrite(const void*, size_t, size_t, FILE*);
extern int getc(FILE*);
extern int getchar(void);
extern char* gets(char*);
@@ -184,6 +184,10 @@ cat{
extern int putc_unlocked(int, FILE*);
extern int putchar_unlocked(int);
+ extern void flockfile(FILE*);
+ extern int ftrylockfile(FILE*);
+ extern void funlockfile(FILE*);
+
#ifdef _USE_GNU
extern int fcloseall(void);
@@ -295,6 +299,7 @@ output{
printf("#define vsscanf _ast_vsscanf\n");
printf("#define fcloseall _ast_fcloseall\n");
+ printf("#define _filbuf _ast__filbuf\n");
printf("#define fmemopen _ast_fmemopen\n");
printf("#define __getdelim _ast___getdelim\n");
printf("#define getdelim _ast_getdelim\n");
@@ -316,6 +321,10 @@ output{
printf("#define putc_unlocked _ast_putc_unlocked\n");
printf("#define putchar_unlocked _ast_putchar_unlocked\n");
+ printf("#define flockfile _ast_flockfile\n");
+ printf("#define ftrylockfile _ast_ftrylockfile\n");
+ printf("#define funlockfile _ast_funlockfile\n");
+
printf("\n");
#endif
return 0;
@@ -389,7 +398,7 @@ cat{
extern int fpurge(FILE*);
extern int fputc(int, FILE*);
extern int fputs(const char*, FILE*);
- extern ssize_t fread(void*, size_t, size_t, FILE*);
+ extern size_t fread(void*, size_t, size_t, FILE*);
extern FILE* freopen(const char*, const char*, FILE*);
extern int fscanf(FILE*, const char*, ...);
extern int fseek(FILE*, long, int);
@@ -397,7 +406,7 @@ cat{
extern int fsetpos(FILE*, const fpos_t*);
extern long ftell(FILE*);
extern off_t ftello(FILE*);
- extern ssize_t fwrite(const void*, size_t, size_t, FILE*);
+ extern size_t fwrite(const void*, size_t, size_t, FILE*);
extern int getc(FILE*);
extern int getchar(void);
extern char* gets(char*);
diff --git a/usr/src/lib/libast/common/features/time b/usr/src/lib/libast/common/features/time
index 4dc5167ab8..6c15113fb8 100644
--- a/usr/src/lib/libast/common/features/time
+++ b/usr/src/lib/libast/common/features/time
@@ -40,7 +40,7 @@ if ! mem timeval.tv_sec sys/time.h {
endif
cat{
-#ifndef CLOCKS_PER_SEC
+#if !defined(CLOCKS_PER_SEC) && defined(CLK_TCK)
#define CLOCKS_PER_SEC CLK_TCK
#endif
}end
diff --git a/usr/src/lib/libast/common/features/tvlib b/usr/src/lib/libast/common/features/tvlib
index e1440f99f6..046e19636e 100644
--- a/usr/src/lib/libast/common/features/tvlib
+++ b/usr/src/lib/libast/common/features/tvlib
@@ -1,6 +1,7 @@
hdr time
lib clock_settime,gettimeofday,settimeofday,stime,utimes
lib nanosleep,usleep
+lib utimensat -D_ATFILE_SOURCE sys/stat.h
if ! mem timeval.tv_sec sys/time.h {
struct timeval
diff --git a/usr/src/lib/libast/common/hash/hashalloc.c b/usr/src/lib/libast/common/hash/hashalloc.c
index f920439f86..e9be11083e 100644
--- a/usr/src/lib/libast/common/hash/hashalloc.c
+++ b/usr/src/lib/libast/common/hash/hashalloc.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/hash/hashdump.c b/usr/src/lib/libast/common/hash/hashdump.c
index b1dad4d4b5..ee96b88d53 100644
--- a/usr/src/lib/libast/common/hash/hashdump.c
+++ b/usr/src/lib/libast/common/hash/hashdump.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/hash/hashfree.c b/usr/src/lib/libast/common/hash/hashfree.c
index 8b54e7af3e..14fd4e6bcd 100644
--- a/usr/src/lib/libast/common/hash/hashfree.c
+++ b/usr/src/lib/libast/common/hash/hashfree.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/hash/hashlast.c b/usr/src/lib/libast/common/hash/hashlast.c
index b6e7c65006..e3459fd89a 100644
--- a/usr/src/lib/libast/common/hash/hashlast.c
+++ b/usr/src/lib/libast/common/hash/hashlast.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/hash/hashlib.h b/usr/src/lib/libast/common/hash/hashlib.h
index 226e6a9ea1..8ca9d17e17 100644
--- a/usr/src/lib/libast/common/hash/hashlib.h
+++ b/usr/src/lib/libast/common/hash/hashlib.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/hash/hashlook.c b/usr/src/lib/libast/common/hash/hashlook.c
index ed8aef3e4b..b5292f94c0 100644
--- a/usr/src/lib/libast/common/hash/hashlook.c
+++ b/usr/src/lib/libast/common/hash/hashlook.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -219,7 +219,8 @@ hashlook(register Hash_table_t* tab, const char* name, long flags, const char* v
if (!(i = tab->bucketsize))
i = (sizeof(Hash_bucket_t) + sizeof(char*) - 1) / sizeof(char*);
i *= sizeof(char*);
- if (b->name == ((char*)b + i) && strlen(b->name) <= (m = strlen(value)))
+ m = strlen(value);
+ if (b->name == ((char*)b + i) && strlen(b->name) <= m)
{
strcpy(b->name, value);
name = 0;
diff --git a/usr/src/lib/libast/common/hash/hashscan.c b/usr/src/lib/libast/common/hash/hashscan.c
index 9443307b3a..313ebd3957 100644
--- a/usr/src/lib/libast/common/hash/hashscan.c
+++ b/usr/src/lib/libast/common/hash/hashscan.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/hash/hashsize.c b/usr/src/lib/libast/common/hash/hashsize.c
index 504f931ad9..62e363085c 100644
--- a/usr/src/lib/libast/common/hash/hashsize.c
+++ b/usr/src/lib/libast/common/hash/hashsize.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/hash/hashview.c b/usr/src/lib/libast/common/hash/hashview.c
index 5aa230d3c7..6da2ab3179 100644
--- a/usr/src/lib/libast/common/hash/hashview.c
+++ b/usr/src/lib/libast/common/hash/hashview.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/hash/hashwalk.c b/usr/src/lib/libast/common/hash/hashwalk.c
index fe79808d9d..90fc6201df 100644
--- a/usr/src/lib/libast/common/hash/hashwalk.c
+++ b/usr/src/lib/libast/common/hash/hashwalk.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/hash/memhash.c b/usr/src/lib/libast/common/hash/memhash.c
index 8c8fd15203..d045c9b4a4 100644
--- a/usr/src/lib/libast/common/hash/memhash.c
+++ b/usr/src/lib/libast/common/hash/memhash.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/hash/memsum.c b/usr/src/lib/libast/common/hash/memsum.c
index 78de588e6c..ce59e6dd52 100644
--- a/usr/src/lib/libast/common/hash/memsum.c
+++ b/usr/src/lib/libast/common/hash/memsum.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/hash/strhash.c b/usr/src/lib/libast/common/hash/strhash.c
index 27d954b8fc..f993b0dae7 100644
--- a/usr/src/lib/libast/common/hash/strhash.c
+++ b/usr/src/lib/libast/common/hash/strhash.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/hash/strkey.c b/usr/src/lib/libast/common/hash/strkey.c
index 59f8a7310a..57176e9581 100644
--- a/usr/src/lib/libast/common/hash/strkey.c
+++ b/usr/src/lib/libast/common/hash/strkey.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/hash/strsum.c b/usr/src/lib/libast/common/hash/strsum.c
index 7881b87263..2c4d302777 100644
--- a/usr/src/lib/libast/common/hash/strsum.c
+++ b/usr/src/lib/libast/common/hash/strsum.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/include/ast.h b/usr/src/lib/libast/common/include/ast.h
index 6c35bd418b..ec3834159a 100644
--- a/usr/src/lib/libast/common/include/ast.h
+++ b/usr/src/lib/libast/common/include/ast.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -315,7 +315,9 @@ extern double strntod(const char*, size_t, char**);
extern _ast_fltmax_t strntold(const char*, size_t, char**);
extern long strntol(const char*, size_t, char**, int);
extern intmax_t strntoll(const char*, size_t, char**, int);
+extern long strnton(const char*, size_t, char**, char*, int);
extern unsigned long strntoul(const char*, size_t, char**, int);
+extern intmax_t strntonll(const char*, size_t, char**, char*, int);
extern uintmax_t strntoull(const char*, size_t, char**, int);
extern int stropt(const char*, const void*, int, int(*)(void*, const void*, int, const char*), void*);
extern int strperm(const char*, char**, int);
diff --git a/usr/src/lib/libast/common/include/ast_dir.h b/usr/src/lib/libast/common/include/ast_dir.h
index 1d92240c2c..ead03c1eee 100644
--- a/usr/src/lib/libast/common/include/ast_dir.h
+++ b/usr/src/lib/libast/common/include/ast_dir.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/include/ast_getopt.h b/usr/src/lib/libast/common/include/ast_getopt.h
index 26673deed7..b1d262670f 100644
--- a/usr/src/lib/libast/common/include/ast_getopt.h
+++ b/usr/src/lib/libast/common/include/ast_getopt.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -24,6 +24,10 @@
* legacy standard getopt interface
*/
+#ifdef _AST_STD_I
+#undef _AST_GETOPT_H
+#define _AST_GETOPT_H -1
+#endif
#ifndef _AST_GETOPT_H
#define _AST_GETOPT_H 1
diff --git a/usr/src/lib/libast/common/include/ast_std.h b/usr/src/lib/libast/common/include/ast_std.h
index 431be6e02b..b9ae148c62 100644
--- a/usr/src/lib/libast/common/include/ast_std.h
+++ b/usr/src/lib/libast/common/include/ast_std.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -107,16 +107,24 @@ struct lconv
#define extern __EXPORT__
#endif
+#undef getenv
+#define getenv _ast_getenv
+
#undef localeconv
#define localeconv _ast_localeconv
#undef setlocale
#define setlocale _ast_setlocale
+#undef setenviron
+#define setenviron _ast_setenviron
+
#undef strerror
#define strerror _ast_strerror
+extern char* getenv(const char*);
extern struct lconv* localeconv(void);
+extern char* setenviron(const char*);
extern char* setlocale(int, const char*);
extern char* strerror(int);
@@ -319,6 +327,16 @@ extern int _ast_getpgrp(void);
#undef _AST_STD_I
+#if _AST_GETOPT_H < 0
+#undef _AST_GETOPT_H
+#include <ast_getopt.h>
+#endif
+
+#if _GETOPT_H < 0
+#undef _GETOPT_H
+#include <getopt.h>
+#endif
+
#if _REGEX_H < 0
#undef _REGEX_H
#include <regex.h>
diff --git a/usr/src/lib/libast/common/include/ast_version.h b/usr/src/lib/libast/common/include/ast_version.h
index 09b618f16b..585bdce431 100644
--- a/usr/src/lib/libast/common/include/ast_version.h
+++ b/usr/src/lib/libast/common/include/ast_version.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -25,4 +25,4 @@
* AT&T Research
*/
-#define _AST_VERSION 20061111L
+#define _AST_VERSION 20080910L
diff --git a/usr/src/lib/libast/common/include/ast_windows.h b/usr/src/lib/libast/common/include/ast_windows.h
index 0459cbe072..da18e66cc6 100644
--- a/usr/src/lib/libast/common/include/ast_windows.h
+++ b/usr/src/lib/libast/common/include/ast_windows.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/include/ccode.h b/usr/src/lib/libast/common/include/ccode.h
index 1642c99181..c4312af2e9 100644
--- a/usr/src/lib/libast/common/include/ccode.h
+++ b/usr/src/lib/libast/common/include/ccode.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/include/cdt.h b/usr/src/lib/libast/common/include/cdt.h
index f6274cef92..3dc5b7b7f8 100644
--- a/usr/src/lib/libast/common/include/cdt.h
+++ b/usr/src/lib/libast/common/include/cdt.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/include/cmdarg.h b/usr/src/lib/libast/common/include/cmdarg.h
new file mode 100644
index 0000000000..07307edc9f
--- /dev/null
+++ b/usr/src/lib/libast/common/include/cmdarg.h
@@ -0,0 +1,84 @@
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* David Korn <dgk@research.att.com> *
+* Phong Vo <kpv@research.att.com> *
+* *
+***********************************************************************/
+#pragma prototyped
+/*
+ * Glenn Fowler
+ * AT&T Research
+ *
+ * xargs/tw command arg list interface definitions
+ */
+
+#ifndef _CMDARG_H
+#define _CMDARG_H
+
+#define CMD_CHECKED (1<<9) /* cmdopen() argv[0] ok */
+#define CMD_EMPTY (1<<0) /* run once, even if no args */
+#define CMD_EXACT (1<<1) /* last command must have argmax*/
+#define CMD_IGNORE (1<<2) /* ignore EXIT_QUIT exit */
+#define CMD_INSERT (1<<3) /* argpat for insertion */
+#define CMD_MINIMUM (1<<4) /* argmax is a minimum */
+#define CMD_NEWLINE (1<<5) /* echo separator is newline */
+#define CMD_POST (1<<6) /* argpat is post arg position */
+#define CMD_QUERY (1<<7) /* trace and query each command */
+#define CMD_SILENT (1<<10) /* no error messages */
+#define CMD_TRACE (1<<8) /* trace each command */
+
+#define CMD_USER (1<<12)
+
+typedef struct /* cmd + args info */
+{
+ struct
+ {
+ size_t args; /* total args */
+ size_t commands; /* total commands */
+ } total;
+
+ int argcount; /* current arg count */
+ int argmax; /* max # args */
+ int echo; /* just an echo */
+ int flags; /* CMD_* flags */
+ int insertlen; /* strlen(insert) */
+ int offset; /* post arg offset */
+
+ char** argv; /* exec argv */
+ char** firstarg; /* first argv file arg */
+ char** insertarg; /* argv before insert */
+ char** postarg; /* start of post arg list */
+ char** nextarg; /* next argv file arg */
+ char* nextstr; /* next string ends before here */
+ char* laststr; /* last string ends before here */
+ char* insert; /* replace with current arg */
+ char buf[1]; /* argv and arg buffer */
+} Cmdarg_t;
+
+#if _BLD_ast && defined(__EXPORT__)
+#define extern __EXPORT__
+#endif
+
+extern Cmdarg_t* cmdopen(char**, int, int, const char*, int);
+extern int cmdflush(Cmdarg_t*);
+extern int cmdarg(Cmdarg_t*, const char*, int);
+extern int cmdclose(Cmdarg_t*);
+
+#undef extern
+
+#endif
diff --git a/usr/src/lib/libast/common/include/debug.h b/usr/src/lib/libast/common/include/debug.h
index 36ef9f0044..e0637d2f46 100644
--- a/usr/src/lib/libast/common/include/debug.h
+++ b/usr/src/lib/libast/common/include/debug.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -31,20 +31,58 @@
#include <ast.h>
#include <error.h>
+#if !defined(DEBUG) && _BLD_DEBUG
+#define DEBUG _BLD_DEBUG
+#endif
+
#if DEBUG || _BLD_DEBUG
+
#define debug(x) x
#define message(x) do if (error_info.trace < 0) { error x; } while (0)
#define messagef(x) do if (error_info.trace < 0) { errorf x; } while (0)
+
+#define DEBUG_BEGTIME() debug_elapsed(1)
+#define DEBUG_GETTIME() debug_elapsed(0)
+#define DEBUG_ASSERT(p) ((p) ? 0 : (debug_fatal(__FILE__, __LINE__),0))
+#define DEBUG_COUNT(n) ((n) += 1)
+#define DEBUG_TALLY(c,n,v) ((c) ? ((n) += (v)) : (n))
+#define DEBUG_DECLARE(t,v) t v
+#define DEBUG_SET(n,v) ((n) = (v))
+#define DEBUG_PRINT(fd,s,v) do {char _b[1024];write(fd,_b,sfsprintf(_b,sizeof(_b),s,v));} while(0)
+#define DEBUG_WRITE(fd,d,n) write((fd),(d),(n))
+#define DEBUG_TEMP(temp) (temp) /* debugging stuff that should be removed */
+#define DEBUG_RETURN(x) (debug_fatal(__FILE__, __LINE__), (x))
+#define DEBUG_BREAK (debug_fatal(__FILE__, __LINE__))
+#define DEBUG_GOTO(label) do { debug_fatal(__FILE__, __LINE__); goto label; } while(0)
+
#else
+
#define debug(x)
#define message(x)
#define messagef(x)
+
+#define DEBUG_BEGTIME()
+#define DEBUG_GETTIME()
+#define DEBUG_ASSERT(p)
+#define DEBUG_COUNT(n)
+#define DEBUG_TALLY(c,n,v)
+#define DEBUG_DECLARE(t,v)
+#define DEBUG_SET(n,v)
+#define DEBUG_PRINT(fd,s,v)
+#define DEBUG_WRITE(fd,d,n)
+#define DEBUG_KPV(x)
+#define DEBUG_RETURN(x) return(x)
+#define DEBUG_BREAK break
+#define DEBUG_GOTO(label) goto label
+
#endif
#if _BLD_ast && defined(__EXPORT__)
#define extern __EXPORT__
#endif
+extern double debug_elapsed(int);
+extern void debug_fatal(const char*, int);
extern void systrace(const char*);
#undef extern
diff --git a/usr/src/lib/libast/common/include/dt.h b/usr/src/lib/libast/common/include/dt.h
index be441089ad..54824790c6 100644
--- a/usr/src/lib/libast/common/include/dt.h
+++ b/usr/src/lib/libast/common/include/dt.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/include/error.h b/usr/src/lib/libast/common/include/error.h
index e1af2396de..e10f80d69f 100644
--- a/usr/src/lib/libast/common/include/error.h
+++ b/usr/src/lib/libast/common/include/error.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/include/find.h b/usr/src/lib/libast/common/include/find.h
index ca5338de7e..46946a1d08 100644
--- a/usr/src/lib/libast/common/include/find.h
+++ b/usr/src/lib/libast/common/include/find.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/include/fnv.h b/usr/src/lib/libast/common/include/fnv.h
index 76dc256f80..89c39598f4 100644
--- a/usr/src/lib/libast/common/include/fnv.h
+++ b/usr/src/lib/libast/common/include/fnv.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/include/fs3d.h b/usr/src/lib/libast/common/include/fs3d.h
index d0fa846421..acedc1b017 100644
--- a/usr/src/lib/libast/common/include/fs3d.h
+++ b/usr/src/lib/libast/common/include/fs3d.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/include/fts.h b/usr/src/lib/libast/common/include/fts.h
index 58e00d0f46..3464b1fc7d 100644
--- a/usr/src/lib/libast/common/include/fts.h
+++ b/usr/src/lib/libast/common/include/fts.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -118,6 +118,10 @@ struct Ftsent
#ifdef _FTSENT_PRIVATE_
_FTSENT_PRIVATE_
+#else
+ short _fts_pad_1; /* <ftwalk.h> compatibility */
+ struct stat _fts_pad_2; /* <ftwalk.h> compatibility */
+ FTS* fts; /* fts_open() handle */
#endif
};
@@ -125,6 +129,7 @@ struct Ftsent
struct Fts
{
int fts_errno; /* last errno */
+ void* fts_handle; /* user defined handle */
#ifdef _FTS_PRIVATE_
_FTS_PRIVATE_
@@ -139,6 +144,7 @@ struct Fts
extern FTSENT* fts_children(FTS*, int);
extern int fts_close(FTS*);
extern int fts_flags(void);
+extern int fts_local(FTSENT*);
extern int fts_notify(int(*)(FTS*, FTSENT*, void*), void*);
extern FTS* fts_open(char* const*, int, int(*)(FTSENT* const*, FTSENT* const*));
extern FTSENT* fts_read(FTS*);
diff --git a/usr/src/lib/libast/common/include/ftwalk.h b/usr/src/lib/libast/common/include/ftwalk.h
index e222f6e734..f7b1216061 100644
--- a/usr/src/lib/libast/common/include/ftwalk.h
+++ b/usr/src/lib/libast/common/include/ftwalk.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/include/glob.h b/usr/src/lib/libast/common/include/glob.h
index 8ba75ac20b..5469884213 100644
--- a/usr/src/lib/libast/common/include/glob.h
+++ b/usr/src/lib/libast/common/include/glob.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -68,8 +68,8 @@ struct _glob_
void* (*gl_diropen)(glob_t*, const char*);
char* (*gl_dirnext)(glob_t*, void*);
void (*gl_dirclose)(glob_t*, void*);
- int (*gl_type)(glob_t*, const char*);
- int (*gl_attr)(glob_t*, const char*);
+ int (*gl_type)(glob_t*, const char*, int);
+ int (*gl_attr)(glob_t*, const char*, int);
/* gnu extensions -- but how do you synthesize dirent and stat? */
diff --git a/usr/src/lib/libast/common/include/hash.h b/usr/src/lib/libast/common/include/hash.h
index 1143461633..50ea5e1831 100644
--- a/usr/src/lib/libast/common/include/hash.h
+++ b/usr/src/lib/libast/common/include/hash.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/include/hashkey.h b/usr/src/lib/libast/common/include/hashkey.h
index 6c246aa6bc..f47c53a64a 100644
--- a/usr/src/lib/libast/common/include/hashkey.h
+++ b/usr/src/lib/libast/common/include/hashkey.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/include/hashpart.h b/usr/src/lib/libast/common/include/hashpart.h
index b01ef3d672..c12f9bd396 100644
--- a/usr/src/lib/libast/common/include/hashpart.h
+++ b/usr/src/lib/libast/common/include/hashpart.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/include/ip6.h b/usr/src/lib/libast/common/include/ip6.h
new file mode 100644
index 0000000000..4a7f2df01e
--- /dev/null
+++ b/usr/src/lib/libast/common/include/ip6.h
@@ -0,0 +1,40 @@
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* David Korn <dgk@research.att.com> *
+* Phong Vo <kpv@research.att.com> *
+* *
+***********************************************************************/
+#pragma prototyped
+
+#if !_IP6_H
+#define _IP6_H 1
+
+#define IP6ADDR 16
+#define IP6BITS IP6ADDR
+#define IP6PREFIX (IP6ADDR+1)
+
+#if _BLD_ast && defined(__EXPORT__)
+#define extern __EXPORT__
+#endif
+
+extern char* fmtip6(unsigned char*, int);
+extern int strtoip6(const char*, char**, unsigned char*, unsigned char*);
+
+#undef extern
+
+#endif
diff --git a/usr/src/lib/libast/common/include/ls.h b/usr/src/lib/libast/common/include/ls.h
index 7c76462c86..7fe969071b 100644
--- a/usr/src/lib/libast/common/include/ls.h
+++ b/usr/src/lib/libast/common/include/ls.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/include/magic.h b/usr/src/lib/libast/common/include/magic.h
index a1dda68470..b6827316c5 100644
--- a/usr/src/lib/libast/common/include/magic.h
+++ b/usr/src/lib/libast/common/include/magic.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/include/magicid.h b/usr/src/lib/libast/common/include/magicid.h
index 66e7343da3..65fbdbfab7 100644
--- a/usr/src/lib/libast/common/include/magicid.h
+++ b/usr/src/lib/libast/common/include/magicid.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/include/mc.h b/usr/src/lib/libast/common/include/mc.h
index 88406b6ed2..e4d8fd049d 100644
--- a/usr/src/lib/libast/common/include/mc.h
+++ b/usr/src/lib/libast/common/include/mc.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/include/mime.h b/usr/src/lib/libast/common/include/mime.h
index a25b06c0ec..e50929ed82 100644
--- a/usr/src/lib/libast/common/include/mime.h
+++ b/usr/src/lib/libast/common/include/mime.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/include/mnt.h b/usr/src/lib/libast/common/include/mnt.h
index 402972e6f9..1e03907f0b 100644
--- a/usr/src/lib/libast/common/include/mnt.h
+++ b/usr/src/lib/libast/common/include/mnt.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/include/modecanon.h b/usr/src/lib/libast/common/include/modecanon.h
index bed378551d..4f51bdea96 100644
--- a/usr/src/lib/libast/common/include/modecanon.h
+++ b/usr/src/lib/libast/common/include/modecanon.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/include/modex.h b/usr/src/lib/libast/common/include/modex.h
index 62f3103a1c..f8d119ec64 100644
--- a/usr/src/lib/libast/common/include/modex.h
+++ b/usr/src/lib/libast/common/include/modex.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/include/namval.h b/usr/src/lib/libast/common/include/namval.h
index fe5f2d4221..d66647451e 100644
--- a/usr/src/lib/libast/common/include/namval.h
+++ b/usr/src/lib/libast/common/include/namval.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/include/option.h b/usr/src/lib/libast/common/include/option.h
index 87315616fb..874c06ff88 100644
--- a/usr/src/lib/libast/common/include/option.h
+++ b/usr/src/lib/libast/common/include/option.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -99,6 +99,7 @@ extern char* opthelp(const char*, const char*);
extern char* optusage(const char*);
extern int optstr(const char*, const char*);
extern int optesc(Sfio_t*, const char*, int);
+extern Opt_t* optctx(Opt_t*, Opt_t*);
#undef extern
diff --git a/usr/src/lib/libast/common/include/proc.h b/usr/src/lib/libast/common/include/proc.h
index 8535b49dd7..43bf3a1791 100644
--- a/usr/src/lib/libast/common/include/proc.h
+++ b/usr/src/lib/libast/common/include/proc.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -32,12 +32,14 @@
#define PROC_ARGMOD (1<<0) /* argv[-1],argv[0] can be modified */
#define PROC_BACKGROUND (1<<1) /* shell background (&) setup */
+#define PROC_CHECK (1<<17) /* check that command exists */
#define PROC_CLEANUP (1<<2) /* close parent redirect fds on error */
#define PROC_DAEMON (1<<3) /* daemon setup */
#define PROC_ENVCLEAR (1<<4) /* clear environment */
#define PROC_FOREGROUND (1<<14) /* system(3) setup */
#define PROC_GID (1<<5) /* setgid(getgid()) */
#define PROC_IGNORE (1<<6) /* ignore parent pipe errors */
+#define PROC_IGNOREPATH (1<<16) /* procrun() intercept to ignore path */
#define PROC_OVERLAY (1<<7) /* overlay current process if possible */
#define PROC_PARANOID (1<<8) /* restrict everything */
#define PROC_PRIVELEGED (1<<9) /* setuid(0), setgid(getegid()) */
@@ -94,8 +96,8 @@ _PROC_PRIVATE_
extern int procclose(Proc_t*);
extern int procfree(Proc_t*);
-extern Proc_t* procopen(const char*, char**, char**, long*, long);
-extern int procrun(const char*, char**);
+extern Proc_t* procopen(const char*, char**, char**, long*, int);
+extern int procrun(const char*, char**, int);
#undef extern
diff --git a/usr/src/lib/libast/common/include/recfmt.h b/usr/src/lib/libast/common/include/recfmt.h
index e90375cb03..65a58dfaf9 100644
--- a/usr/src/lib/libast/common/include/recfmt.h
+++ b/usr/src/lib/libast/common/include/recfmt.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/include/regex.h b/usr/src/lib/libast/common/include/regex.h
index 4251bbefbd..a1ecf9d4be 100644
--- a/usr/src/lib/libast/common/include/regex.h
+++ b/usr/src/lib/libast/common/include/regex.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/include/sfdisc.h b/usr/src/lib/libast/common/include/sfdisc.h
index b58d50674f..0fdd0f297c 100644
--- a/usr/src/lib/libast/common/include/sfdisc.h
+++ b/usr/src/lib/libast/common/include/sfdisc.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/include/sfio.h b/usr/src/lib/libast/common/include/sfio.h
index 9feba3043e..11317dad65 100644
--- a/usr/src/lib/libast/common/include/sfio.h
+++ b/usr/src/lib/libast/common/include/sfio.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -22,7 +22,7 @@
#ifndef _SFIO_H
#define _SFIO_H 1
-#define SFIO_VERSION 20050202L
+#define SFIO_VERSION 20080717L
/* Public header file for the sfio library
**
@@ -181,6 +181,7 @@ struct _sffmt_s
/* for the notify function and discipline exception */
#define SF_NEW 0 /* new stream */
#define SF_SETFD (-1) /* about to set the file descriptor */
+#define SF_MTACCESS (-2) /* starting a multi-threaded stream */
#define SF_BUFSIZE 8192 /* default buffer size */
#define SF_UNBOUND (-1) /* unbounded buffer size */
@@ -240,7 +241,7 @@ extern int sfclrlock _ARG_((Sfio_t*));
extern Void_t* sfsetbuf _ARG_((Sfio_t*, Void_t*, size_t));
extern Sfdisc_t* sfdisc _ARG_((Sfio_t*,Sfdisc_t*));
extern int sfraise _ARG_((Sfio_t*, int, Void_t*));
-extern int sfnotify _ARG_((void(*)(Sfio_t*, int, int)));
+extern int sfnotify _ARG_((void(*)(Sfio_t*, int, void*)));
extern int sfset _ARG_((Sfio_t*, int, int));
extern int sfsetfd _ARG_((Sfio_t*, int));
extern Sfio_t* sfpool _ARG_((Sfio_t*, Sfio_t*, int));
diff --git a/usr/src/lib/libast/common/include/sfio_s.h b/usr/src/lib/libast/common/include/sfio_s.h
index 27936a16b1..19a23d4772 100644
--- a/usr/src/lib/libast/common/include/sfio_s.h
+++ b/usr/src/lib/libast/common/include/sfio_s.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/include/sfio_t.h b/usr/src/lib/libast/common/include/sfio_t.h
index 36be6ecc94..c5251d3f34 100644
--- a/usr/src/lib/libast/common/include/sfio_t.h
+++ b/usr/src/lib/libast/common/include/sfio_t.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/include/shcmd.h b/usr/src/lib/libast/common/include/shcmd.h
new file mode 100644
index 0000000000..b25d2467a5
--- /dev/null
+++ b/usr/src/lib/libast/common/include/shcmd.h
@@ -0,0 +1,92 @@
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* David Korn <dgk@research.att.com> *
+* Phong Vo <kpv@research.att.com> *
+* *
+***********************************************************************/
+#pragma prototyped
+
+/*
+ * ksh builtin command api
+ */
+
+#ifndef _SHCMD_H
+#define _SHCMD_H 1
+
+#ifndef SH_VERSION
+# define Shell_t void
+#endif
+#ifndef NV_DEFAULT
+# define Namval_t void
+#endif
+#ifndef ERROR_NOTIFY
+# define ERROR_NOTIFY 1
+#endif
+
+typedef int (*Shbltin_f)(int, char**, void*);
+
+#undef Shbltin_t
+typedef struct Shbltin_s
+{
+ Shell_t *shp;
+ void *ptr;
+ int version;
+ int (*shrun)(int, char**);
+ int (*shtrap)(const char*, int);
+ void (*shexit)(int);
+ Namval_t *(*shbltin)(const char*, Shbltin_f, void*);
+ unsigned char notify;
+ unsigned char sigset;
+ unsigned char nosfio;
+ Namval_t *bnode;
+ Namval_t *vnode;
+ char *data;
+ int flags;
+ char *(*shgetenv)(const char*);
+ char *(*shsetenv)(const char*);
+ int invariant;
+} Shbltin_t;
+
+#if defined(SH_VERSION) || defined(_SH_PRIVATE)
+# undef Shell_t
+# undef Namval_t
+#else
+# define sh_run(c, ac, av) ((c)?(*((Shbltin_t*)(c))->shrun)(ac,av):-1)
+# define sh_system(c,str) ((c)?(*((Shbltin_t*)(c))->shtrap)(str,0):system(str))
+# define sh_exit(c,n) ((c)?(*((Shbltin_t*)(c))->shexit)(n):exit(n))
+# define sh_checksig(c) ((c) && ((Shbltin_t*)(c))->sigset)
+# if defined(SFIO_VERSION) || defined(_AST_H)
+# define LIB_INIT(c)
+# else
+# define LIB_INIT(c) ((c) && (((Shbltin_t*)(c))->nosfio = 1))
+# endif
+# ifndef _CMD_H
+# define cmdinit(ac,av,c,cat,flg) do { if((ac)<=0) return(0); \
+ (((Shbltin_t*)(c))->notify = ((flg)&ERROR_NOTIFY)?1:0);} while(0)
+# endif
+#endif
+
+#if _BLD_ast && defined(__EXPORT__)
+#define extern __EXPORT__
+#endif
+
+extern int astintercept(Shbltin_t*, int);
+
+#undef extern
+
+#endif
diff --git a/usr/src/lib/libast/common/include/stack.h b/usr/src/lib/libast/common/include/stack.h
index 4ca2de0cf4..2d9d03835f 100644
--- a/usr/src/lib/libast/common/include/stack.h
+++ b/usr/src/lib/libast/common/include/stack.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/include/stak.h b/usr/src/lib/libast/common/include/stak.h
index c61d313edc..4d0c49648d 100644
--- a/usr/src/lib/libast/common/include/stak.h
+++ b/usr/src/lib/libast/common/include/stak.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/include/stk.h b/usr/src/lib/libast/common/include/stk.h
index e89cc7a151..53bcde612f 100644
--- a/usr/src/lib/libast/common/include/stk.h
+++ b/usr/src/lib/libast/common/include/stk.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -71,6 +71,7 @@ extern char* stkcopy(Stk_t*,const char*);
extern char* stkset(Stk_t*, char*, unsigned);
extern char* _stkseek(Stk_t*, unsigned);
extern char* stkfreeze(Stk_t*, unsigned);
+extern int stkon(Stk_t*, char *);
#undef extern
diff --git a/usr/src/lib/libast/common/include/swap.h b/usr/src/lib/libast/common/include/swap.h
index 25ccbf0a17..bce2045bd5 100644
--- a/usr/src/lib/libast/common/include/swap.h
+++ b/usr/src/lib/libast/common/include/swap.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/include/tar.h b/usr/src/lib/libast/common/include/tar.h
index c696afdd3f..a6794fd420 100644
--- a/usr/src/lib/libast/common/include/tar.h
+++ b/usr/src/lib/libast/common/include/tar.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/include/times.h b/usr/src/lib/libast/common/include/times.h
index 11ed270e78..4f442ca3ee 100644
--- a/usr/src/lib/libast/common/include/times.h
+++ b/usr/src/lib/libast/common/include/times.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/include/tm.h b/usr/src/lib/libast/common/include/tm.h
index 0c91344b76..1a490a63a5 100644
--- a/usr/src/lib/libast/common/include/tm.h
+++ b/usr/src/lib/libast/common/include/tm.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/include/tok.h b/usr/src/lib/libast/common/include/tok.h
index bca70d7ab2..5b8a5fa1df 100644
--- a/usr/src/lib/libast/common/include/tok.h
+++ b/usr/src/lib/libast/common/include/tok.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/include/usage.h b/usr/src/lib/libast/common/include/usage.h
index 81b59e1aca..d969a0e4c1 100644
--- a/usr/src/lib/libast/common/include/usage.h
+++ b/usr/src/lib/libast/common/include/usage.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/include/vdb.h b/usr/src/lib/libast/common/include/vdb.h
index 9288cb36ff..ed1251a2d8 100644
--- a/usr/src/lib/libast/common/include/vdb.h
+++ b/usr/src/lib/libast/common/include/vdb.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/include/vecargs.h b/usr/src/lib/libast/common/include/vecargs.h
index 55e1279086..45d3e683f1 100644
--- a/usr/src/lib/libast/common/include/vecargs.h
+++ b/usr/src/lib/libast/common/include/vecargs.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/include/vmalloc.h b/usr/src/lib/libast/common/include/vmalloc.h
index f0a8114c6a..8cf3e9b974 100644
--- a/usr/src/lib/libast/common/include/vmalloc.h
+++ b/usr/src/lib/libast/common/include/vmalloc.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -27,7 +27,7 @@
** Written by Kiem-Phong Vo, kpv@research.att.com, 01/16/94.
*/
-#define VMALLOC_VERSION 20050928L
+#define VMALLOC_VERSION 20070911L
#if _PACKAGE_ast
#include <ast_std.h>
diff --git a/usr/src/lib/libast/common/include/wait.h b/usr/src/lib/libast/common/include/wait.h
index 136def40d1..c64bf8f47f 100644
--- a/usr/src/lib/libast/common/include/wait.h
+++ b/usr/src/lib/libast/common/include/wait.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/llib-last b/usr/src/lib/libast/common/llib-last
index 69019e07ec..58a6963d54 100644
--- a/usr/src/lib/libast/common/llib-last
+++ b/usr/src/lib/libast/common/llib-last
@@ -19,41 +19,48 @@
* CDDL HEADER END
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* lib/libast/common/llib-last
*
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*LINTLIBRARY*/
/*PROTOLIB1*/
#define _FTWALK_H 1
-#include <ast.h>
#include <align.h>
+#include <ast.h>
#include <ast_botch.h>
#include <ast_ccode.h>
#include <ast_common.h>
#include <ast_dir.h>
#include <ast_dirent.h>
+#include <ast_fcntl.h>
#include <ast_float.h>
#include <ast_fs.h>
#include <ast_getopt.h>
#include <ast_iconv.h>
#include <ast_lib.h>
#include <ast_limits.h>
+#include <ast_map.h>
#include <ast_mmap.h>
#include <ast_mode.h>
+#include <ast_ndbm.h>
#include <ast_nl_types.h>
#include <ast_param.h>
+#include <ast_standards.h>
+#include <ast_std.h>
+#include <ast_stdio.h>
+#include <ast_sys.h>
#include <ast_time.h>
#include <ast_tty.h>
-#include <ast_types.h>
#include <ast_version.h>
+#include <ast_vfork.h>
+#include <ast_wait.h>
+#include <ast_wchar.h>
#include <bytesex.h>
#include <ccode.h>
#include <cdt.h>
@@ -68,14 +75,15 @@
#include <fs3d.h>
#include <fts.h>
#include <ftw.h>
+#include <ftwalk.h>
#include <getopt.h>
#include <glob.h>
#include <hash.h>
#include <hashkey.h>
#include <hashpart.h>
#include <iconv.h>
+#include <ip6.h>
#include <lc.h>
-#include <limits.h>
#include <ls.h>
#include <magic.h>
#include <magicid.h>
@@ -83,21 +91,24 @@
#include <mime.h>
#include <mnt.h>
#include <modecanon.h>
+#include <modex.h>
#include <namval.h>
#include <nl_types.h>
#include <option.h>
#include <preroot.h>
#include <proc.h>
+#include <prototyped.h>
#include <re_comp.h>
#include <recfmt.h>
#include <regex.h>
-#include <regexp.h>
#include <sfdisc.h>
+#include <sfio.h>
#include <sfio_s.h>
#include <sfio_t.h>
#include <sig.h>
#include <stack.h>
#include <stak.h>
+#include <stdio.h>
#include <stk.h>
#include <swap.h>
#include <tar.h>
@@ -109,554 +120,7 @@
#include <usage.h>
#include <vdb.h>
#include <vecargs.h>
+#include <vmalloc.h>
#include <wait.h>
#include <wchar.h>
#include <wordexp.h>
-
-#if defined(_AST_STD_H) || defined(_POSIX_SOURCE) || defined(_XOPEN_SOURCE)
-#define _AST_mode_t mode_t
-#else
-#define _AST_mode_t int
-#endif
-
-/* automatically generated data start here */
-/* tmpastinclude/ast.h */
-extern char* astconf(const char*, const char*, const char*);
-extern Ast_confdisc_f astconfdisc(Ast_confdisc_f);
-extern void astconflist(Sfio_t*, const char*, int, const char*);
-extern off_t astcopy(int, int, off_t);
-extern int astlicense(char*, int, char*, char*, int, int, int);
-extern int astquery(int, const char*, ...);
-extern void astwinsize(int, int*, int*);
-extern ssize_t base64encode(const void*, size_t, void**, void*, size_t, void**);
-extern ssize_t base64decode(const void*, size_t, void**, void*, size_t, void**);
-extern int chresc(const char*, char**);
-extern int chrtoi(const char*);
-extern int eaccess(const char*, int);
-/*
-extern char* fmtbase(long, int, int);
-extern char* fmtbasell(_ast_intmax_t, int, int);
-extern char* fmtbuf(size_t);
-extern char* fmtclock(Sfulong_t);
-extern char* fmtelapsed(unsigned long, int);
-extern char* fmterror(int);
-extern char* fmtesc(const char*);
-extern char* fmtesq(const char*, const char*);
-extern char* fmtident(const char*);
-extern char* fmtip4(unsigned _ast_int4_t, int);
-extern char* fmtfmt(const char*);
-extern char* fmtgid(int);
-extern char* fmtmatch(const char*);
-extern char* fmtmode(int, int);
-extern char* fmtnesq(const char*, const char*, size_t);
-extern char* fmtnum(unsigned long, int);
-extern char* fmtperm(int);
-extern char* fmtquote(const char*, const char*, const char*, size_t, int);
-extern char* fmtre(const char*);
-extern char* fmtscale(Sfulong_t, int);
-extern char* fmtsignal(int);
-extern char* fmttime(const char*, time_t);
-extern char* fmtuid(int);
-extern char* fmtversion(unsigned long);
-*/
-extern void* _ast_memdup(const void*, size_t);
-extern void _ast_memfatal(void);
-extern unsigned int _ast_memhash(const void*, int);
-extern unsigned long memsum(const void*, int, unsigned long);
-extern char* _ast_pathaccess(char*, const char*, const char*, const char*, int);
-extern char* _ast_pathbin(void);
-extern char* _ast_pathcanon(char*, int);
-extern char* _ast_pathcat(char*, const char*, int, const char*, const char*);
-extern int _ast_pathcd(const char*, const char*);
-extern int _ast_pathcheck(const char*, const char*, Pathcheck_t*);
-extern int _ast_pathexists(char*, int);
-extern char* _ast_pathfind(const char*, const char*, const char*, char*, size_t);
-extern int _ast_pathgetlink(const char*, char*, int);
-extern int _ast_pathinclude(const char*);
-extern char* _ast_pathkey(char*, char*, const char*, const char*, const char*);
-extern size_t _ast_pathnative(const char*, char*, size_t);
-extern char* _ast_pathpath(char*, const char*, const char*, int);
-extern size_t _ast_pathposix(const char*, char*, size_t);
-extern char* _ast_pathprobe(char*, char*, const char*, const char*, const char*, int);
-extern char* _ast_pathrepl(char*, const char*, const char*);
-extern int _ast_pathsetlink(const char*, const char*);
-extern char* _ast_pathshell(void);
-extern char* _ast_pathtemp(char*, size_t, const char*, const char*, int*);
-extern char* _ast_pathtmp(char*, const char*, const char*, int*);
-extern char* _ast_setenviron(const char*);
-extern int _ast_stracmp(const char*, const char*);
-extern char* _ast_strcopy(char*, const char*);
-extern unsigned long _ast_strelapsed(const char*, char**, int);
-extern int _ast_stresc(char*);
-extern long _ast_streval(const char*, char**, long(*)(const char*, char**));
-extern long _ast_strexpr(const char*, char**, long(*)(const char*, char**, void*), void*);
-extern int _ast_strgid(const char*);
-extern int _ast_strgrpmatch(const char*, const char*, int*, int, int);
-extern unsigned int strhash(const char*);
-extern void* _ast_strlook(const void*, size_t, const char*);
-extern int _ast_strmatch(const char*, const char*);
-extern int _ast_strmode(const char*);
-extern int _ast_strnacmp(const char*, const char*, size_t);
-extern char* _ast_strncopy(char*, const char*, size_t);
-extern double _ast_strntod(const char*, size_t, char**);
-extern _ast_fltmax_t _ast_strntold(const char*, size_t, char**);
-extern long _ast_strntol(const char*, size_t, char**, int);
-extern _ast_intmax_t _ast_strntoll(const char*, size_t, char**, int);
-extern unsigned long strntoul(const char*, size_t, char**, int);
-extern unsigned _ast_intmax_t strntoull(const char*, size_t, char**, int);
-extern int _ast_stropt(const char*, const void*, int, int(*)(void*, const void*, int, const char*), void*);
-extern int _ast_strperm(const char*, char**, int);
-extern void* _ast_strpsearch(const void*, size_t, size_t, const char*, char**);
-extern void* _ast_strsearch(const void*, size_t, size_t, Strcmp_f, const char*, void*);
-extern void _ast_strsort(char**, int, int(*)(const char*, const char*));
-extern char* _ast_strsubmatch(const char*, const char*, int);
-extern unsigned long _ast_strsum(const char*, unsigned long);
-extern char* _ast_strtape(const char*, char**);
-extern int _ast_strtoip4(const char*, char**, unsigned _ast_int4_t*, unsigned char*);
-extern long _ast_strton(const char*, char**, char*, int);
-extern _ast_intmax_t _ast_strtonll(const char*, char**, char*, int);
-extern int _ast_struid(const char*);
-extern int _ast_struniq(char**, int);
-extern char** environ;
-
-/* tmpastinclude/align.h */
-
-/* tmpastinclude/ast_botch.h */
-
-/* tmpastinclude/ast_ccode.h */
-
-/* tmpastinclude/ast_common.h */
-
-/* tmpastinclude/ast_dir.h */
-
-/* tmpastinclude/ast_dirent.h */
-
-/* tmpastinclude/ast_float.h */
-
-/* tmpastinclude/ast_fs.h */
-extern int fstatvfs(int, struct statvfs*);
-extern int statvfs(const char*, struct statvfs*);
-extern int statvfs64(const char*, struct statvfs64*);
-extern int fstatvfs64(int, struct statvfs64*);
-
-/* tmpastinclude/ast_getopt.h */
-extern int opterr;
-extern int optind;
-extern int optopt;
-extern char* optarg;
-extern int _ast_getopt(int, char* const*, const char*);
-extern int _ast_getsubopt(char**, char* const*, char**);
-
-/* tmpastinclude/ast_hdr.h */
-
-/* tmpastinclude/ast_iconv.h */
-extern _ast_iconv_t _ast_iconv_open(const char*, const char*);
-extern size_t _ast_iconv(_ast_iconv_t, char**, size_t*, char**, size_t*);
-extern int _ast_iconv_close(_ast_iconv_t);
-extern _ast_iconv_list_t* _ast_iconv_list(_ast_iconv_list_t*);
-extern int _ast_iconv_name(const char*, char*, size_t);
-extern ssize_t _ast_iconv_move(_ast_iconv_t, Sfio_t*, Sfio_t*, size_t, size_t*);
-extern ssize_t _ast_iconv_write(_ast_iconv_t, Sfio_t*, char**, size_t*, size_t*);
-extern ssize_t _ast_iconv_move(_ast_iconv_t, FILE*, FILE*, size_t, size_t*);
-extern ssize_t _ast_iconv_write(_ast_iconv_t, FILE*, char**, size_t*, size_t*);
-
-/* tmpastinclude/ast_lib.h */
-
-/* tmpastinclude/ast_limits.h */
-
-/* tmpastinclude/ast_mmap.h */
-
-/* tmpastinclude/ast_mode.h */
-
-/* tmpastinclude/ast_nl_types.h */
-extern nl_catd catopen(const char*, int);
-extern char* catgets(nl_catd, int, int, const char*);
-extern int catclose(nl_catd);
-
-/* tmpastinclude/ast_param.h */
-
-/* tmpastinclude/ast_time.h */
-
-/* tmpastinclude/ast_tty.h */
-
-/* tmpastinclude/ast_types.h */
-
-/* tmpastinclude/ast_unistd.h */
-
-/* tmpastinclude/ast_version.h */
-
-/* tmpastinclude/ast_wait.h */
-
-/* tmpastinclude/bytesex.h */
-
-/* tmpastinclude/ccode.h */
-extern unsigned char* _ccmap(int, int);
-extern void* _ccmapcpy(unsigned char*, void*, const void*, size_t);
-extern void* _ccmapstr(unsigned char*, void*, size_t);
-extern int ccmapid(const char*);
-extern char* ccmapname(int);
-extern void* ccnative(void*, const void*, size_t);
-extern Ccmap_t* ccmaplist(Ccmap_t*);
-
-/* tmpastinclude/cdt.h */
-extern Dtmethod_t* Dtset;
-extern Dtmethod_t* Dtbag;
-extern Dtmethod_t* Dtoset;
-extern Dtmethod_t* Dtobag;
-extern Dtmethod_t* Dtlist;
-extern Dtmethod_t* Dtstack;
-extern Dtmethod_t* Dtqueue;
-extern Dtmethod_t* Dtorder;
-extern Dtmethod_t* Dttree;
-extern Dtmethod_t* Dthash;
-extern Dtmethod_t _Dttree;
-extern Dtmethod_t _Dthash;
-extern Dtmethod_t _Dtlist;
-extern Dtmethod_t _Dtqueue;
-extern Dtmethod_t _Dtstack;
-extern Dt_t* dtopen(Dtdisc_t*, Dtmethod_t*);
-extern int dtclose(Dt_t*);
-extern Dt_t* dtview(Dt_t*, Dt_t*);
-extern Dtdisc_t* dtdisc(Dt_t* dt, Dtdisc_t*, int);
-extern Dtmethod_t* dtmethod(Dt_t*, Dtmethod_t*);
-extern Dtlink_t* dtflatten(Dt_t*);
-extern Dtlink_t* dtextract(Dt_t*);
-extern int dtrestore(Dt_t*, Dtlink_t*);
-extern int dttreeset(Dt_t*, int, int);
-extern int dtwalk(Dt_t*, int(*)(Dt_t*,Void_t*,Void_t*), Void_t*);
-extern Void_t* dtrenew(Dt_t*, Void_t*);
-extern int dtsize(Dt_t*);
-extern int dtstat(Dt_t*, Dtstat_t*, int);
-extern unsigned int dtstrhash(unsigned int, Void_t*, int);
-extern int memcmp(const Void_t*, const Void_t*, size_t);
-extern int strcmp(const char*, const char*);
-
-/* tmpastinclude/debug.h */
-extern void systrace(const char*);
-
-/* tmpastinclude/dirent.h */
-
-/* tmpastinclude/dt.h */
-extern Dt_t* dtnew(Vmalloc_t*, Dtdisc_t*, Dtmethod_t*);
-
-/* tmpastinclude/endian.h */
-
-/* tmpastinclude/error.h */
-extern int errno;
-extern Error_info_t error_info;
-extern void error(int, ...);
-extern int errormsg(const char*, int, ...);
-extern int errorf(void*, void*, int, ...);
-extern void errorv(const char*, int, va_list);
-extern char* errorx(const char*, const char*, const char*, const char*);
-extern void liberror(const char*, int, ...);
-extern int libevent(void*, void*, int, ...);
-
-/* tmpastinclude/find.h */
-extern Find_t* findopen(const char*, const char*, const char*, Finddisc_t*);
-extern char* findread(Find_t*);
-extern int findwrite(Find_t*, const char*, size_t, const char*);
-extern int findclose(Find_t*);
-
-/* tmpastinclude/fnmatch.h */
-extern int _ast_fnmatch(const char*, const char*, int);
-
-/* tmpastinclude/fnv.h */
-
-/* tmpastinclude/fs3d.h */
-extern int mount(const char*, char*, int, void*);
-extern int fs3d(int);
-extern char* pathnext(char*, char*, long*);
-
-/* tmpastinclude/fts.h */
-extern FTSENT* _ast_fts_children(FTS*, int);
-extern int _ast_fts_close(FTS*);
-extern int _ast_fts_flags(void);
-extern int _ast_fts_notify(int(*)(FTS*, FTSENT*, void*), void*);
-extern FTS* _ast_fts_open(char* const*, int, int(*)(FTSENT* const*, FTSENT* const*));
-extern FTSENT* _ast_fts_read(FTS*);
-extern int _ast_fts_set(FTS*, FTSENT*, int);
-
-/* tmpastinclude/ftw.h */
-extern int _ast_ftw(const char*, int(*)(const char*, const struct stat*, int), int);
-extern int _ast_nftw(const char*, int(*)(const char*, const struct stat*, int, struct FTW*), int, int);
-
-/* tmpastinclude/getopt.h */
-extern int getopt_long(int, char* const*, const char*, const struct option*, int*);
-extern int getopt_long_only(int, char* const*, const char*, const struct option*, int*);
-
-/* tmpastinclude/glob.h */
-extern int _ast_glob(const char*, int, int(*)(const char*,int), glob_t*);
-extern void _ast_globfree(glob_t*);
-
-/* tmpastinclude/hash.h */
-extern Hash_table_t* hashalloc(Hash_table_t*, ...);
-extern void hashdone(Hash_position_t*);
-extern void hashdump(Hash_table_t*, int);
-extern Hash_table_t* hashfree(Hash_table_t*);
-extern Hash_bucket_t* hashlast(Hash_table_t*);
-extern char* hashlook(Hash_table_t*, const char*, long, const char*);
-extern Hash_bucket_t* hashnext(Hash_position_t*);
-extern Hash_position_t* hashscan(Hash_table_t*, int);
-extern void hashsize(Hash_table_t*, int);
-extern Hash_table_t* hashview(Hash_table_t*, Hash_table_t*);
-extern int hashwalk(Hash_table_t*, int, int (*)(const char*, char*, void*), void*);
-
-/* tmpastinclude/hashkey.h */
-extern long _ast_strkey(const char*);
-
-/* tmpastinclude/hashpart.h */
-
-/* tmpastinclude/iconv.h */
-
-/* tmpastinclude/lc.h */
-extern size_t lccanon(Lc_t*, unsigned long flags, char*, size_t);
-extern Lc_category_t* lccategories(void);
-extern int lcindex(int, int);
-extern Lc_info_t* lcinfo(int);
-extern Lc_t* lcmake(const char*);
-extern Lc_t* lcscan(Lc_t*);
-
-/* tmpastinclude/limits.h */
-
-/* tmpastinclude/ls.h */
-extern int chmod(const char*, _AST_mode_t);
-extern int fstat(int, struct stat*);
-extern int lstat(const char*, struct stat*);
-extern int mkdir(const char*, _AST_mode_t);
-extern int mkfifo(const char*, _AST_mode_t);
-extern int mknod(const char*, _AST_mode_t, dev_t);
-extern int stat(const char*, struct stat*);
-extern _AST_mode_t umask(_AST_mode_t);
-extern off_t _iblocks(struct stat*);
-extern char* fmtdev(struct stat*);
-extern char* fmtfs(struct stat*);
-extern char* fmtls(char*, const char*, struct stat*, const char*, const char*, int);
-extern int _ast_pathstat(const char*, struct stat*);
-
-/* tmpastinclude/magic.h */
-extern Magic_t* magicopen(Magicdisc_t*);
-extern int magicload(Magic_t*, const char*, unsigned long);
-extern int magiclist(Magic_t*, Sfio_t*);
-extern char* magictype(Magic_t*, Sfio_t*, const char*, struct stat*);
-extern int magicclose(Magic_t*);
-
-/* tmpastinclude/magicid.h */
-
-/* tmpastinclude/mc.h */
-extern char* mcfind(char*, const char*, const char*, int, int);
-extern Mc_t* mcopen(Sfio_t*);
-extern char* mcget(Mc_t*, int, int, const char*);
-extern int mcput(Mc_t*, int, int, const char*);
-extern int mcdump(Mc_t*, Sfio_t*);
-extern int mcindex(const char*, char**, int*, int*);
-extern int mcclose(Mc_t*);
-
-/* tmpastinclude/mime.h */
-extern Mime_t* mimeopen(Mimedisc_t*);
-extern int mimeload(Mime_t*, const char*, unsigned long);
-extern int mimelist(Mime_t*, Sfio_t*, const char*);
-extern int mimeclose(Mime_t*);
-extern int mimeset(Mime_t*, char*, unsigned long);
-extern char* mimetype(Mime_t*, Sfio_t*, const char*, struct stat*);
-extern char* mimeview(Mime_t*, const char*, const char*, const char*, const char*);
-extern int mimehead(Mime_t*, void*, size_t, size_t, char*);
-extern int mimecmp(const char*, const char*, char**);
-
-/* tmpastinclude/mnt.h */
-extern void* mntopen(const char*, const char*);
-extern Mnt_t* mntread(void*);
-extern int mntwrite(void*, const Mnt_t*);
-extern int mntclose(void*);
-
-/* tmpastinclude/modecanon.h */
-
-/* tmpastinclude/namval.h */
-
-/* tmpastinclude/nl_types.h */
-
-/* tmpastinclude/option.h */
-extern Opt_t opt_info;
-extern int _ast_optget(char**, const char*);
-extern int _ast_optjoin(char**, ...);
-extern char* _ast_opthelp(const char*, const char*);
-extern char* _ast_optusage(const char*);
-extern int _ast_optstr(const char*, const char*);
-extern int _ast_optesc(Sfio_t*, const char*, int);
-
-/* tmpastinclude/preroot.h */
-
-/* tmpastinclude/proc.h */
-extern int _ast_procclose(Proc_t*);
-extern int _ast_procfree(Proc_t*);
-extern Proc_t* _ast_procopen(const char*, char**, char**, long*, long);
-extern int _ast_procrun(const char*, char**);
-
-/* tmpastinclude/re_comp.h */
-extern char* _ast_re_comp(const char*);
-extern int _ast_re_exec(const char*);
-
-/* tmpastinclude/recfmt.h */
-extern char* fmtrec(Recfmt_t, int);
-extern Recfmt_t recfmt(const void*, size_t, off_t);
-extern Recfmt_t recstr(const char*, char**);
-extern ssize_t reclen(Recfmt_t, const void*, size_t);
-
-/* tmpastinclude/regex.h */
-extern int _ast_regcomp(regex_t*, const char*, regflags_t);
-extern size_t _ast_regerror(int, const regex_t*, char*, size_t);
-extern int _ast_regexec(const regex_t*, const char*, size_t, regmatch_t*, regflags_t);
-extern void _ast_regfree(regex_t*);
-extern regclass_t _ast_regclass(const char*, char**);
-extern int _ast_regaddclass(const char*, regclass_t);
-extern int _ast_regcollate(const char*, char**, char*, int);
-extern int _ast_regcomb(regex_t*, regex_t*);
-extern int _ast_regdup(regex_t*, regex_t*);
-extern int _ast_regncomp(regex_t*, const char*, size_t, regflags_t);
-extern int _ast_regnexec(const regex_t*, const char*, size_t, size_t, regmatch_t*, regflags_t);
-extern void _ast_regfatal(regex_t*, int, int);
-extern void _ast_regfatalpat(regex_t*, int, int, const char*);
-extern int _ast_regrecord(const regex_t*);
-extern int _ast_regrexec(const regex_t*, const char*, size_t, size_t, regmatch_t*, regflags_t, regflags_t, void*, regrecord_t);
-extern regstat_t* _ast_regstat(const regex_t*);
-extern regex_t* _ast_regcache(const char*, regflags_t, int*);
-extern int _ast_regsubcomp(regex_t*, const char*, const regflags_t*, int, regflags_t);
-extern int _ast_regsubexec(const regex_t*, const char*, size_t, regmatch_t*);
-extern int _ast_regsubflags(regex_t*, const char*, char**, int, const regflags_t*, int*, regflags_t*);
-extern void _ast_regsubfree(regex_t*);
-extern void _ast_regalloc(void*, regresize_t, regflags_t);
-extern int _ast_regsub(const regex_t*, struct _sfio_s*, const char*, const char*, size_t, regmatch_t*, regflags_t);
-
-/* tmpastinclude/regexp.h */
-extern int _re_comp(regexp_t*, const char*, char*, unsigned int);
-extern int _re_exec(regexp_t*, const char*, const char*, int);
-extern char* _re_putc(int);
-extern char* _re_read(regexp_t*, const char*, char*, const char*, int);
-
-/* tmpastinclude/sfdisc.h */
-extern int sfkeyprintf(Sfio_t*, void*, const char*, Sf_key_lookup_t, Sf_key_convert_t);
-extern int sfkeyprintf(Sfio_t*, void*, const char*, Sf_key_lookup_t, Sf_key_convert_t);
-extern int sfdcdio(Sfio_t*, size_t);
-extern int sfdcdos(Sfio_t*);
-extern int sfdcfilter(Sfio_t*, const char*);
-extern int sfdcmore(Sfio_t*, const char*, int, int);
-extern int sfdcprefix(Sfio_t*, const char*);
-extern int sfdcseekable(Sfio_t*);
-extern int sfdcslow(Sfio_t*);
-extern int sfdctee(Sfio_t*, Sfio_t*);
-extern int sfdcunion(Sfio_t*, Sfio_t**, int);
-extern Sfio_t* sfdcsubstream(Sfio_t*, Sfio_t*, Sfoff_t, Sfoff_t);
-
-/* tmpastinclude/sfio_s.h */
-
-/* tmpastinclude/sfio_t.h */
-
-/* tmpastinclude/sig.h */
-extern int kill(pid_t, int);
-extern int killpg(pid_t, int);
-extern Sig_info_t sig_info;
-extern int sigcritical(int);
-extern int sigunblock(int);
-
-/* tmpastinclude/stack.h */
-extern STACK stackalloc(int, void*);
-extern void stackfree(STACK);
-extern void stackclear(STACK);
-extern void* stackget(STACK);
-extern int stackpush(STACK, void*);
-extern int stackpop(STACK);
-extern void stacktell(STACK, int, STACKPOS*);
-
-/* tmpastinclude/stak.h */
-
-/* tmpastinclude/stk.h */
-extern Sfio_t _Stk_data;
-extern Stk_t* stkopen(int);
-extern Stk_t* stkinstall(Stk_t*, char*(*)(int));
-extern int stkclose(Stk_t*);
-extern int stklink(Stk_t*);
-extern char* stkalloc(Stk_t*, unsigned);
-extern char* stkcopy(Stk_t*,const char*);
-extern char* stkset(Stk_t*, char*, unsigned);
-extern char* _stkseek(Stk_t*, unsigned);
-extern char* stkfreeze(Stk_t*, unsigned);
-
-/* tmpastinclude/swap.h */
-extern void* swapmem (int, const void*, void*, size_t);
-extern intmax_t swapget (int, const void*, int);
-extern void* swapput (int, void*, int, intmax_t);
-extern int swapop (const void*, const void*, int);
-
-/* tmpastinclude/tar.h */
-
-/* tmpastinclude/times.h */
-extern int _ast_touch(const char*, time_t, time_t, int);
-
-/* tmpastinclude/tm.h */
-extern Tm_data_t tm_data;
-extern Tm_info_t tm_info;
-extern time_t tmdate(const char*, char**, time_t*);
-extern int tmequiv(Tm_t*);
-extern Tm_t* tmfix(Tm_t*);
-extern char* tmfmt(char*, size_t, const char*, time_t*);
-extern char* tmform(char*, const char*, time_t*);
-extern int tmgoff(const char*, char**, int);
-extern void tminit(Tm_zone_t*);
-extern time_t tmleap(time_t*);
-extern int tmlex(const char*, char**, char**, int, char**, int);
-extern char** tmlocale(void);
-extern Tm_t* tmmake(time_t*);
-extern char* tmpoff(char*, size_t, const char*, int, int);
-extern time_t tmscan(const char*, char**, const char*, char**, time_t*, long);
-extern int tmsleep(time_t, time_t);
-extern time_t tmtime(Tm_t*, int);
-extern Tm_zone_t* tmtype(const char*, char**);
-extern int tmweek(Tm_t*, int, int, int);
-extern int tmword(const char*, char**, const char*, char**, int);
-extern Tm_zone_t* tmzone(const char*, char**, const char*, int*);
-
-/* tmpastinclude/tmx.h */
-extern Time_t tmxdate(const char*, char**, Time_t);
-extern char* tmxfmt(char*, size_t, const char*, Time_t);
-extern Time_t tmxleap(Time_t);
-extern Tm_t* tmxmake(Time_t);
-extern Time_t tmxscan(const char*, char**, const char*, char**, Time_t, long);
-extern int tmxsleep(Time_t);
-extern Time_t tmxtime(Tm_t*, int);
-extern Time_t tmxgettime(void);
-extern int tmxsettime(Time_t);
-extern int tmxtouch(const char*, Time_t, Time_t, Time_t, int);
-extern char* fmttmx(const char*, Time_t);
-
-/* tmpastinclude/tok.h */
-extern Sfio_t* tokline(const char*, int, int*);
-extern int tokscan(char*, char**, const char*, ...);
-extern char* tokopen(char*, int);
-extern void tokclose(char*);
-extern char* tokread(char*);
-
-/* tmpastinclude/tv.h */
-extern int tvgettime(Tv_t*);
-extern int tvsettime(const Tv_t*);
-extern int tvcmp(const Tv_t*, const Tv_t*);
-extern int tvtouch(const char*, const Tv_t*, const Tv_t*, const Tv_t*, int);
-extern int tvsleep(const Tv_t*, Tv_t*);
-extern char* fmttv(const char*, Tv_t*);
-
-/* tmpastinclude/usage.h */
-
-/* tmpastinclude/vdb.h */
-
-/* tmpastinclude/vecargs.h */
-extern int vecargs(char**, int*, char***);
-extern char** vecfile(const char*);
-extern void vecfree(char**, int);
-extern char** vecload(char*);
-extern char** vecstring(const char*);
-
-/* tmpastinclude/wchar.h */
-
-/* tmpastinclude/wordexp.h */
-extern int _ast_wordexp(const char*, wordexp_t*, int);
-extern int _ast_wordfree(wordexp_t*);
-/* end of automatically generated data */
diff --git a/usr/src/lib/libast/common/man/sfio.3 b/usr/src/lib/libast/common/man/sfio.3
index 8f99e72dca..df6037537a 100644
--- a/usr/src/lib/libast/common/man/sfio.3
+++ b/usr/src/lib/libast/common/man/sfio.3
@@ -869,8 +869,9 @@ into the buffer.
.Tp
\f5n == 0\fP:
If the argument \f5type\fP is \f50\fP,
-\f5sfreserve()\fP attempts to get \fIat least\fP \f51\fP byte into the buffer;
-otherwise, no attempt will be made to read data into the buffer.
+\f5sfreserve()\fP attempts to get \fIat least\fP \f51\fP byte into the buffer
+but does not consume it (as consistent with \f5n == 0\fP).
+If \f5type != 0\fP, no attempt will be made to read data into the buffer.
For example, the call \f5sfreserve(f, 0, -1)\fP only returns the buffer status,
i.e., size of existing buffered data and pointer to such data, if any.
The call \f5sfreserve(f, 0, SF_LOCKR)\fP is similar but also locks the stream.
@@ -1697,14 +1698,28 @@ After a successful discipline stack manipulation,
the stream I/O position (see \f5sfseek()\fP and \f5sftell()\fP)
and extent (see \f5sfsize()\fP) are updated
to reflect that defined by the top discipline.
+\f5sfdisc()\fP returns \f5NULL\fP on failure.
+
+If the value of \f5disc\fP is identical to the value of \f5f\fP,
+then the top discipline on the discipline
+stack is returned without any further action.
+An application can then use this feature of \f5sfdisc()\fP
+and the field \f5disc\fP (below) of the discipline structure
+to traverse the entire discipline stack of a stream \f5f\fP as follows:
+
+.nf
+.ft 5
+ for(disc = sfdisc(f, (Sfdisc_t*)f); disc; disc = disc->disc)
+.ft 1
+.fi
+
If \f5disc\fP is \f5SF_POPDISC\fP or \f5(Sfdisc_t*)0\fP,
the top element of the stack, if any, is popped and its address is returned.
Otherwise, \f5disc\fP is pushed onto the discipline stack.
In this case, if successful, \f5sfdisc()\fP returns
the discipline that was pushed down.
-\f5sfdisc()\fP returns \f5NULL\fP on failure.
-Note that a discipline can be used only on one stream at a time.
+Note that a discipline can be used on only one stream at a time.
An application should take care to allocate different discipline
structures for use with different streams.
A discipline structure is of the type \f5Sfdisc_t\fP which
@@ -1716,6 +1731,7 @@ contains the following public fields:
Sfwrite_f writef;
Sfseek_f seekf;
Sfexcept_f exceptf;
+ Sfdisc_t* disc;
.ft 1
.fi
@@ -1797,8 +1813,8 @@ discipline is about to be pushed or popped.
A stream buffer is always synchronized before pushing or popping a discipline.
If this synchronization fails, \f5SF_DBUFFER\fP will be raised with
-\f5*((size_t*)value)\fP being the amount of buffered data.
-If the return value of \f5exceptf\fP is positive,
+\f5*((size_t*)value)\fP being the amount of data still in the buffer.
+If the return value of \f5exceptf\fP is non-negative,
the push or pop operation will continue normally;
otherwise, \f5sfdisc()\fP returns failure.
.Tp
diff --git a/usr/src/lib/libast/common/man/stk.3 b/usr/src/lib/libast/common/man/stk.3
index d3b9d36376..3e658216f7 100644
--- a/usr/src/lib/libast/common/man/stk.3
+++ b/usr/src/lib/libast/common/man/stk.3
@@ -22,6 +22,7 @@ char *stkseek(Stk_t *\fIstack\fP, unsigned \fIoffset\fP);
int stktell(Stk_t *\fIstack\fP);
char *stkptr(Stk_t *\fIstack\fP, unsigned \fIoffset\fP);
char *stkfreeze(Stk_t *\fIstack\fP, unsigned \fIextra\fP);
+int stkon(Stk *\fIstack\fP, char* \fIaddr\fP)
\fR
.fi
.SH DESCRIPTION
@@ -144,6 +145,10 @@ If \fIextra\fP is non-zero, \fIextra\fP bytes are added to the stack
before the current object is terminated. The first added byte will
contain zero and the contents of the remaining bytes are undefined.
.PP
+The \f5stkon\fP()
+function returns non-zero if the address given by \fIaddr\fP is
+on the stack \fIstack\fP and \f50\fP otherwise.
+.PP
.SH HISTORY
The
\f5stk\fP
diff --git a/usr/src/lib/libast/common/misc/astintercept.c b/usr/src/lib/libast/common/misc/astintercept.c
new file mode 100644
index 0000000000..414224aa03
--- /dev/null
+++ b/usr/src/lib/libast/common/misc/astintercept.c
@@ -0,0 +1,53 @@
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* David Korn <dgk@research.att.com> *
+* Phong Vo <kpv@research.att.com> *
+* *
+***********************************************************************/
+#pragma prototyped
+
+#include "intercepts.h"
+
+/*
+ * NOTE: the "intercepts" definition is in getenv.c because some static linkers
+ * miss lone references to "intercepts" without "astintercept()"
+ */
+
+/*
+ * set/clear ast intercept callouts
+ */
+
+int
+astintercept(Shbltin_t* call, int set)
+{
+ if (call->shgetenv)
+ {
+ if (set)
+ intercepts.intercept_getenv = call->shgetenv;
+ else
+ intercepts.intercept_getenv = 0;
+ }
+ if (call->shsetenv)
+ {
+ if (set)
+ intercepts.intercept_setenviron = call->shsetenv;
+ else
+ intercepts.intercept_setenviron = 0;
+ }
+ return 0;
+}
diff --git a/usr/src/lib/libast/common/misc/cmdarg.c b/usr/src/lib/libast/common/misc/cmdarg.c
new file mode 100644
index 0000000000..b27f2152c7
--- /dev/null
+++ b/usr/src/lib/libast/common/misc/cmdarg.c
@@ -0,0 +1,350 @@
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* David Korn <dgk@research.att.com> *
+* Phong Vo <kpv@research.att.com> *
+* *
+***********************************************************************/
+#pragma prototyped
+/*
+ * Glenn Fowler
+ * AT&T Research
+ *
+ * xargs/tw command arg list support
+ */
+
+#include <ast.h>
+#include <ctype.h>
+#include <error.h>
+#include <proc.h>
+
+#include "cmdarg.h"
+
+#ifndef EXIT_QUIT
+#define EXIT_QUIT 255
+#endif
+
+static const char* echo[] = { "echo", 0 };
+
+/*
+ * open a cmdarg stream
+ * initialize the command for execution
+ * argv[-1] is reserved for procrun(PROC_ARGMOD)
+ */
+
+Cmdarg_t*
+cmdopen(char** argv, int argmax, int size, const char* argpat, int flags)
+{
+ register Cmdarg_t* cmd;
+ register int n;
+ register char** p;
+ register char* s;
+ char* sh;
+ int c;
+ int m;
+ int argc;
+ long x;
+
+ char** post = 0;
+
+ n = sizeof(char**);
+ if (*argv)
+ {
+ for (p = argv + 1; *p; p++)
+ {
+ if ((flags & CMD_POST) && argpat && streq(*p, argpat))
+ {
+ *p = 0;
+ post = p + 1;
+ argpat = 0;
+ }
+ else
+ n += strlen(*p) + 1;
+ }
+ argc = p - argv;
+ }
+ else
+ argc = 0;
+ for (p = environ; *p; p++)
+ n += sizeof(char**) + strlen(*p) + 1;
+ if ((x = strtol(astconf("ARG_MAX", NiL, NiL), NiL, 0)) <= 0)
+ x = ARG_MAX;
+ if (size <= 0 || size > x)
+ size = x;
+ sh = pathshell();
+ m = n + (argc + 4) * sizeof(char**) + strlen(sh) + 1;
+ m = roundof(m, sizeof(char**));
+ if (size < m)
+ {
+ error(2, "size must be at least %d", m);
+ return 0;
+ }
+ if ((m = x / 10) > 2048)
+ m = 2048;
+ if (size > (x - m))
+ size = x - m;
+ n = size - n;
+ m = ((flags & CMD_INSERT) && argpat) ? (strlen(argpat) + 1) : 0;
+ if (!(cmd = newof(0, Cmdarg_t, 1, n + m)))
+ {
+ error(ERROR_SYSTEM|2, "out of space");
+ return 0;
+ }
+ c = n / sizeof(char**);
+ if (argmax <= 0 || argmax > c)
+ argmax = c;
+ s = cmd->buf;
+ if (!argv[0])
+ {
+ argv = (char**)echo;
+ cmd->echo = 1;
+ }
+ else if (streq(argv[0], echo[0]))
+ {
+ cmd->echo = 1;
+ flags &= ~CMD_NEWLINE;
+ }
+ else if (!(flags & CMD_CHECKED))
+ {
+ if (!pathpath(s, argv[0], NiL, PATH_REGULAR|PATH_EXECUTE))
+ {
+ if (!(flags & CMD_SILENT))
+ {
+ error(ERROR_SYSTEM|2, "%s: command not found", argv[0]);
+ exit(EXIT_NOTFOUND);
+ }
+ free(cmd);
+ return 0;
+ }
+ argv[0] = s;
+ }
+ s += strlen(s) + 1;
+ if (m)
+ {
+ cmd->insert = strcpy(s, argpat);
+ cmd->insertlen = m - 1;
+ s += m;
+ }
+ s += sizeof(char**) - (s - cmd->buf) % sizeof(char**);
+ p = (char**)s;
+ n -= strlen(*p++ = sh) + 1;
+ cmd->argv = p;
+ while (*p = *argv++)
+ p++;
+ if (m)
+ {
+ argmax = 1;
+ *p++ = 0;
+ cmd->insertarg = p;
+ argv = cmd->argv;
+ c = *cmd->insert;
+ while (s = *argv)
+ {
+ while ((s = strchr(s, c)) && strncmp(cmd->insert, s, cmd->insertlen))
+ s++;
+ *p++ = s ? *argv : (char*)0;
+ argv++;
+ }
+ *p++ = 0;
+ }
+ cmd->firstarg = cmd->nextarg = p;
+ cmd->laststr = cmd->nextstr = cmd->buf + n;
+ cmd->argmax = argmax;
+ cmd->flags = flags;
+ cmd->offset = ((cmd->postarg = post) ? (argc - (post - argv)) : 0) + 3;
+ return cmd;
+}
+
+/*
+ * flush outstanding command file args
+ */
+
+int
+cmdflush(register Cmdarg_t* cmd)
+{
+ register char* s;
+ register char** p;
+ register int n;
+
+ if (cmd->flags & CMD_EMPTY)
+ cmd->flags &= ~CMD_EMPTY;
+ else if (cmd->nextarg <= cmd->firstarg)
+ return 0;
+ if ((cmd->flags & CMD_MINIMUM) && cmd->argcount < cmd->argmax)
+ {
+ if (!(cmd->flags & CMD_SILENT))
+ error(2, "%d arg command would be too long", cmd->argcount);
+ return -1;
+ }
+ cmd->total.args += cmd->argcount;
+ cmd->total.commands++;
+ cmd->argcount = 0;
+ if (p = cmd->postarg)
+ while (*cmd->nextarg++ = *p++);
+ else
+ *cmd->nextarg = 0;
+ if (s = cmd->insert)
+ {
+ char* a;
+ char* b;
+ char* e;
+ char* t;
+ char* u;
+ int c;
+ int m;
+
+ a = cmd->firstarg[0];
+ b = (char*)&cmd->nextarg[1];
+ e = cmd->nextstr;
+ c = *s;
+ m = cmd->insertlen;
+ for (n = 1; cmd->argv[n]; n++)
+ if (t = cmd->insertarg[n])
+ {
+ cmd->argv[n] = b;
+ for (;;)
+ {
+ if (!(u = strchr(t, c)))
+ {
+ b += sfsprintf(b, e - b, "%s", t);
+ break;
+ }
+ if (!strncmp(s, u, m))
+ {
+ b += sfsprintf(b, e - b, "%-.*s%s", u - t, t, a);
+ t = u + m;
+ }
+ else if (b >= e)
+ break;
+ else
+ {
+ *b++ = *u++;
+ t = u;
+ }
+ }
+ if (b < e)
+ *b++ = 0;
+ }
+ if (b >= e)
+ {
+ if (!(cmd->flags & CMD_SILENT))
+ error(2, "%s: command too large after insert", a);
+ return -1;
+ }
+ }
+ cmd->nextarg = cmd->firstarg;
+ cmd->nextstr = cmd->laststr;
+ if (cmd->flags & (CMD_QUERY|CMD_TRACE))
+ {
+ p = cmd->argv;
+ sfprintf(sfstderr, "+ %s", *p);
+ while (s = *++p)
+ sfprintf(sfstderr, " %s", s);
+ if (!(cmd->flags & CMD_QUERY))
+ sfprintf(sfstderr, "\n");
+ else if (astquery(1, "? "))
+ return 0;
+ }
+ if (cmd->echo)
+ {
+ n = (cmd->flags & CMD_NEWLINE) ? '\n' : ' ';
+ for (p = cmd->argv + 1; s = *p++;)
+ sfputr(sfstdout, s, *p ? n : '\n');
+ n = 0;
+ }
+ else if ((n = procrun(*cmd->argv, cmd->argv, PROC_ARGMOD|PROC_IGNOREPATH)) == -1)
+ {
+ if (!(cmd->flags & CMD_SILENT))
+ {
+ error(ERROR_SYSTEM|2, "%s: command exec error", *cmd->argv);
+ exit(EXIT_NOTFOUND - 1);
+ }
+ return -1;
+ }
+ else if (n >= EXIT_NOTFOUND - 1)
+ {
+ if (!(cmd->flags & CMD_SILENT))
+ exit(n);
+ }
+ else if (!(cmd->flags & CMD_IGNORE))
+ {
+ if (n == EXIT_QUIT && !(cmd->flags & CMD_SILENT))
+ exit(2);
+ if (n)
+ error_info.errors++;
+ }
+ return n;
+}
+
+/*
+ * add file to the command arg list
+ */
+
+int
+cmdarg(register Cmdarg_t* cmd, const char* file, register int len)
+{
+ int i;
+ int r;
+
+ r = 0;
+ if (len)
+ {
+ while ((cmd->nextstr -= len + 1) < (char*)(cmd->nextarg + cmd->offset))
+ {
+ if (cmd->nextarg == cmd->firstarg)
+ {
+ error(2, "%s: path too long for exec args", file);
+ return -1;
+ }
+ if (i = cmdflush(cmd))
+ {
+ if (r < i)
+ r = i;
+ if (!(cmd->flags & CMD_IGNORE))
+ return r;
+ }
+ }
+ *cmd->nextarg++ = cmd->nextstr;
+ memcpy(cmd->nextstr, file, len);
+ cmd->nextstr[len] = 0;
+ cmd->argcount++;
+ if (cmd->argcount >= cmd->argmax && (i = cmdflush(cmd)) > r)
+ r = i;
+ }
+ return r;
+}
+
+/*
+ * close a cmdarg stream
+ */
+
+int
+cmdclose(Cmdarg_t* cmd)
+{
+ int n;
+
+ if ((cmd->flags & CMD_EXACT) && cmd->argcount < cmd->argmax)
+ {
+ if (!(cmd->flags & CMD_SILENT))
+ error(2, "only %d arguments for last command", cmd->argcount);
+ return -1;
+ }
+ cmd->flags &= ~CMD_MINIMUM;
+ n = cmdflush(cmd);
+ free(cmd);
+ return n;
+}
diff --git a/usr/src/lib/libast/common/misc/debug.c b/usr/src/lib/libast/common/misc/debug.c
new file mode 100644
index 0000000000..2304eb7a2b
--- /dev/null
+++ b/usr/src/lib/libast/common/misc/debug.c
@@ -0,0 +1,66 @@
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* David Korn <dgk@research.att.com> *
+* Phong Vo <kpv@research.att.com> *
+* *
+***********************************************************************/
+#pragma prototyped
+/*
+ * <debug.h> support
+ */
+
+#include <ast.h>
+#include <error.h>
+#include <debug.h>
+
+void
+debug_fatal(const char* file, int line)
+{
+ error(2, "%s:%d: debug error", file, line);
+ abort();
+}
+
+#if _sys_times
+
+#include <sys/times.h>
+#include <sys/resource.h>
+
+double
+debug_elapsed(int set)
+{
+ double tm;
+ struct rusage ru;
+
+ static double prev;
+
+ getrusage(RUSAGE_SELF, &ru);
+ tm = (double)ru.ru_utime.tv_sec + (double)ru.ru_utime.tv_usec/1000000.0;
+ if (set)
+ return prev = tm;
+ return tm - prev;
+}
+
+#else
+
+double
+debug_elapsed(int set)
+{
+ return 0;
+}
+
+#endif
diff --git a/usr/src/lib/libast/common/misc/error.c b/usr/src/lib/libast/common/misc/error.c
index 89a3378c83..faab838264 100644
--- a/usr/src/lib/libast/common/misc/error.c
+++ b/usr/src/lib/libast/common/misc/error.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -619,8 +619,6 @@ errorv(const char* id, int level, va_list ap)
* error_info context control
*/
-#include <error.h>
-
static Error_info_t* freecontext;
Error_info_t*
diff --git a/usr/src/lib/libast/common/misc/errorf.c b/usr/src/lib/libast/common/misc/errorf.c
index 5230a3a6c9..be41031d60 100644
--- a/usr/src/lib/libast/common/misc/errorf.c
+++ b/usr/src/lib/libast/common/misc/errorf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/misc/errormsg.c b/usr/src/lib/libast/common/misc/errormsg.c
index 0785528dc6..95b974e01e 100644
--- a/usr/src/lib/libast/common/misc/errormsg.c
+++ b/usr/src/lib/libast/common/misc/errormsg.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/misc/errorx.c b/usr/src/lib/libast/common/misc/errorx.c
index d476efab05..f88d49232d 100644
--- a/usr/src/lib/libast/common/misc/errorx.c
+++ b/usr/src/lib/libast/common/misc/errorx.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -33,7 +33,7 @@ errorx(const char* loc, const char* cmd, const char* cat, const char* msg)
{
char* s;
- error_info.translate = translate; /* 2007-03-19 OLD_Error_info_t workaround */
+ if (!error_info.translate) error_info.translate = translate; /* 2007-03-19 OLD_Error_info_t workaround */
if (ERROR_translating())
{
if (!loc)
diff --git a/usr/src/lib/libast/common/misc/fastfind.c b/usr/src/lib/libast/common/misc/fastfind.c
index 1602029759..ef5d13139d 100644
--- a/usr/src/lib/libast/common/misc/fastfind.c
+++ b/usr/src/lib/libast/common/misc/fastfind.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/misc/findlib.h b/usr/src/lib/libast/common/misc/findlib.h
index 50d977ebea..fa21a9e977 100644
--- a/usr/src/lib/libast/common/misc/findlib.h
+++ b/usr/src/lib/libast/common/misc/findlib.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/misc/fmtrec.c b/usr/src/lib/libast/common/misc/fmtrec.c
index 5d3b51db1a..78b8b46e23 100644
--- a/usr/src/lib/libast/common/misc/fmtrec.c
+++ b/usr/src/lib/libast/common/misc/fmtrec.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/misc/fs3d.c b/usr/src/lib/libast/common/misc/fs3d.c
index 3db7bb1f3f..91b73dd121 100644
--- a/usr/src/lib/libast/common/misc/fs3d.c
+++ b/usr/src/lib/libast/common/misc/fs3d.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -42,25 +42,29 @@ fs3d(register int op)
static char on[] = FS3D_on;
static char off[] = FS3D_off;
- if (fsview < 0) return(0);
+ if (fsview < 0)
+ return 0;
/*
* get the current setting
*/
- if (!fsview && mount("", "", 0, NiL))
+ if (!fsview && (!getenv("LD_PRELOAD") || mount("", "", 0, NiL)))
goto nope;
if (FS3D_op(op) == FS3D_OP_INIT && mount(FS3D_init, NiL, FS3D_VIEW, NiL))
goto nope;
if (mount(on, val, FS3D_VIEW|FS3D_GET|FS3D_SIZE(sizeof(val)), NiL))
goto nope;
- if (v = strchr(val, ' ')) v++;
- else v = val;
+ if (v = strchr(val, ' '))
+ v++;
+ else
+ v = val;
if (!strcmp(v, on))
cur = FS3D_ON;
else if (!strncmp(v, off, sizeof(off) - 1) && v[sizeof(off)] == '=')
cur = FS3D_LIMIT((int)strtol(v + sizeof(off) + 1, NiL, 0));
- else cur = FS3D_OFF;
+ else
+ cur = FS3D_OFF;
if (cur != op)
{
switch (FS3D_op(op))
@@ -83,8 +87,8 @@ fs3d(register int op)
goto nope;
}
fsview = 1;
- return(cur);
+ return cur;
nope:
fsview = -1;
- return(0);
+ return 0;
}
diff --git a/usr/src/lib/libast/common/misc/fts.c b/usr/src/lib/libast/common/misc/fts.c
index c7fe8493cc..29c638cada 100644
--- a/usr/src/lib/libast/common/misc/fts.c
+++ b/usr/src/lib/libast/common/misc/fts.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -32,6 +32,7 @@
#include <ast_dir.h>
#include <error.h>
#include <fs3d.h>
+#include <ls.h>
struct Ftsent;
@@ -70,7 +71,7 @@ typedef int (*Stat_f)(const char*, struct stat*);
char* home; /* home/path buffer */ \
char* endbase; /* space to build paths */ \
char* endbuf; /* space to build paths */ \
- char* pad;
+ char* pad[2]; /* $0.02 to splain this */
/*
* NOTE: <ftwalk.h> relies on status and statb being the first two elements
@@ -79,12 +80,12 @@ typedef int (*Stat_f)(const char*, struct stat*);
#define _FTSENT_PRIVATE_ \
short status; /* internal status */ \
struct stat statb; /* fts_statp data */ \
+ FTS* fts; /* fts_open() handle */ \
int nd; /* popdir() count */ \
FTSENT* left; /* left child */ \
FTSENT* right; /* right child */ \
FTSENT* pwd; /* pwd parent */ \
FTSENT* stack; /* getlist() stack */ \
- FTS* fts; /* for fts verification */ \
long nlink; /* FTS_D link count */ \
unsigned char must; /* must stat */ \
unsigned char type; /* DT_* type */ \
@@ -515,9 +516,13 @@ info(FTS* fts, register FTSENT* f, const char* path, struct stat* sp, int flags)
{
f->fts_parent->nlink--;
#ifdef D_TYPE
- f->must = 0;
if ((f->nlink = sp->st_nlink) < 2)
+ {
+ f->must = 2;
f->nlink = 2;
+ }
+ else
+ f->must = 0;
#else
if ((f->nlink = sp->st_nlink) >= 2)
f->must = 1;
@@ -1457,6 +1462,22 @@ fts_flags(void)
}
/*
+ * return 1 if ent is mounted on a local filesystem
+ */
+
+int
+fts_local(FTSENT* ent)
+{
+#ifdef ST_LOCAL
+ struct statvfs fs;
+
+ return statvfs(ent->fts_path, &fs) || (fs.f_flag & ST_LOCAL);
+#else
+ return !strgrpmatch(fmtfs(ent->fts_statp), "([an]fs|samb)", NiL, 0, STR_LEFT|STR_ICASE);
+#endif
+}
+
+/*
* close an open fts stream
*/
@@ -1488,23 +1509,43 @@ fts_close(register FTS* fts)
x = f->fts_link;
free(f);
}
+ free(fts);
return 0;
}
/*
* register function to be called for each fts_read() entry
+ * context==0 => unregister notifyf
*/
int
fts_notify(Notify_f notifyf, void* context)
{
register Notify_t* np;
+ register Notify_t* pp;
- if (!(np = newof(0, Notify_t, 1, 0)))
+ if (context)
+ {
+ if (!(np = newof(0, Notify_t, 1, 0)))
+ return -1;
+ np->notifyf = notifyf;
+ np->context = context;
+ np->next = notify;
+ notify = np;
+ }
+ else
+ {
+ for (np = notify, pp = 0; np; pp = np, np = np->next)
+ if (np->notifyf == notifyf)
+ {
+ if (pp)
+ pp->next = np->next;
+ else
+ notify = np->next;
+ free(np);
+ return 0;
+ }
return -1;
- np->notifyf = notifyf;
- np->context = context;
- np->next = notify;
- notify = np;
+ }
return 0;
}
diff --git a/usr/src/lib/libast/common/misc/ftwalk.c b/usr/src/lib/libast/common/misc/ftwalk.c
index d3c3dc2027..b8b3276279 100644
--- a/usr/src/lib/libast/common/misc/ftwalk.c
+++ b/usr/src/lib/libast/common/misc/ftwalk.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/misc/ftwflags.c b/usr/src/lib/libast/common/misc/ftwflags.c
index f13069a6b9..22899a52d2 100644
--- a/usr/src/lib/libast/common/misc/ftwflags.c
+++ b/usr/src/lib/libast/common/misc/ftwflags.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/misc/getcwd.c b/usr/src/lib/libast/common/misc/getcwd.c
index 54a4978a66..deee50b7a4 100644
--- a/usr/src/lib/libast/common/misc/getcwd.c
+++ b/usr/src/lib/libast/common/misc/getcwd.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/misc/getenv.c b/usr/src/lib/libast/common/misc/getenv.c
new file mode 100644
index 0000000000..fa4407c1ef
--- /dev/null
+++ b/usr/src/lib/libast/common/misc/getenv.c
@@ -0,0 +1,43 @@
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* David Korn <dgk@research.att.com> *
+* Phong Vo <kpv@research.att.com> *
+* *
+***********************************************************************/
+#pragma prototyped
+
+#include "intercepts.h"
+
+/*
+ * NOTE: the "intercepts" definition is here instead of astintercept.c because some
+ * static linkers miss lone references to "intercepts" without "astintercept()"
+ * ALSO: { 0 } definition required by some dynamic linkers avers to common symbols
+ */
+
+Intercepts_t intercepts = { 0 };
+
+/*
+ * get name from the environment
+ */
+
+char*
+getenv(const char* name)
+{
+#undef getenv
+ return intercepts.intercept_getenv ? (*intercepts.intercept_getenv)(name) : getenv(name);
+}
diff --git a/usr/src/lib/libast/common/misc/glob.c b/usr/src/lib/libast/common/misc/glob.c
index 2849d3111c..4178731409 100644
--- a/usr/src/lib/libast/common/misc/glob.c
+++ b/usr/src/lib/libast/common/misc/glob.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -118,12 +118,12 @@ gl_dirclose(glob_t* gp, void* handle)
*/
static int
-gl_type(glob_t* gp, const char* path)
+gl_type(glob_t* gp, const char* path, int flags)
{
register int type;
struct stat st;
- if ((*gp->gl_stat)(path, &st))
+ if ((flags & GLOB_STARSTAR) ? (*gp->gl_lstat)(path, &st) : (*gp->gl_stat)(path, &st))
type = 0;
else if (S_ISDIR(st.st_mode))
type = GLOB_DIR;
@@ -141,7 +141,7 @@ gl_type(glob_t* gp, const char* path)
*/
static int
-gl_attr(glob_t* gp, const char* path)
+gl_attr(glob_t* gp, const char* path, int flags)
{
return strchr(astconf("PATH_ATTRIBUTES", path, NiL), 'c') ? GLOB_ICASE : 0;
}
@@ -245,7 +245,7 @@ addmatch(register glob_t* gp, const char* dir, const char* pat, register const c
stakputs(pat);
if (rescan)
{
- if ((*gp->gl_type)(gp, stakptr(MATCHPATH(gp))) != GLOB_DIR)
+ if ((*gp->gl_type)(gp, stakptr(MATCHPATH(gp)), 0) != GLOB_DIR)
return;
stakputc(gp->gl_delim);
offset = staktell();
@@ -263,7 +263,7 @@ addmatch(register glob_t* gp, const char* dir, const char* pat, register const c
}
else
{
- if (!endslash && (gp->gl_flags & GLOB_MARK) && (type = (*gp->gl_type)(gp, stakptr(MATCHPATH(gp)))))
+ if (!endslash && (gp->gl_flags & GLOB_MARK) && (type = (*gp->gl_type)(gp, stakptr(MATCHPATH(gp)), 0)))
{
if ((gp->gl_flags & GLOB_COMPLETE) && type != GLOB_EXE)
{
@@ -350,12 +350,12 @@ again:
if (!first && !*rescan && *(rescan - 2) == gp->gl_delim)
{
*(rescan - 2) = 0;
- c = (*gp->gl_type)(gp, prefix);
+ c = (*gp->gl_type)(gp, prefix, 0);
*(rescan - 2) = gp->gl_delim;
if (c == GLOB_DIR)
addmatch(gp, NiL, prefix, NiL, rescan - 1, anymeta);
}
- else if ((anymeta || !(gp->gl_flags & GLOB_NOCHECK)) && (*gp->gl_type)(gp, prefix))
+ else if ((anymeta || !(gp->gl_flags & GLOB_NOCHECK)) && (*gp->gl_type)(gp, prefix, 0))
addmatch(gp, NiL, prefix, NiL, NiL, anymeta);
return;
case '[':
@@ -480,9 +480,9 @@ skip:
break;
prefix = streq(dirname, ".") ? (char*)0 : dirname;
}
- if (dirf = (*gp->gl_diropen)(gp, dirname))
+ if ((!starstar && !gp->gl_starstar || (*gp->gl_type)(gp, dirname, GLOB_STARSTAR) == GLOB_DIR) && (dirf = (*gp->gl_diropen)(gp, dirname)))
{
- if (!(gp->re_flags & REG_ICASE) && ((*gp->gl_attr)(gp, dirname) & GLOB_ICASE))
+ if (!(gp->re_flags & REG_ICASE) && ((*gp->gl_attr)(gp, dirname, 0) & GLOB_ICASE))
{
if (!prei)
{
@@ -619,6 +619,7 @@ glob(const char* pattern, int flags, int (*errfn)(const char*, int), register gl
gp->gl_attr = 0;
gp->gl_nextdir = 0;
gp->gl_stat = 0;
+ gp->gl_lstat = 0;
gp->gl_extra = 0;
}
if (!(flags & GLOB_ALTDIRFUNC))
@@ -627,8 +628,10 @@ glob(const char* pattern, int flags, int (*errfn)(const char*, int), register gl
gp->gl_readdir = (GL_readdir_f)readdir;
gp->gl_closedir = (GL_closedir_f)closedir;
if (!gp->gl_stat)
- gp->gl_stat = (flags & GLOB_STARSTAR) ? (GL_stat_f)lstat : (GL_stat_f)pathstat;
+ gp->gl_stat = (GL_stat_f)pathstat;
}
+ if (!gp->gl_lstat)
+ gp->gl_lstat = (GL_stat_f)lstat;
if (!gp->gl_intr)
gp->gl_intr = &intr;
if (!gp->gl_delim)
@@ -704,7 +707,7 @@ glob(const char* pattern, int flags, int (*errfn)(const char*, int), register gl
else
f |= GLOB_NOCHECK;
continue;
- case 'R':
+ case 'O':
if (n)
f |= GLOB_STARSTAR;
else
@@ -716,8 +719,6 @@ glob(const char* pattern, int flags, int (*errfn)(const char*, int), register gl
gp->re_flags |= REG_ICASE;
else
gp->re_flags &= ~REG_ICASE;
- if ((f & (GLOB_STARSTAR|GLOB_ALTDIRFUNC)) == GLOB_STARSTAR)
- gp->gl_stat = (GL_stat_f)lstat;
if (x)
optlen = pat - (char*)pattern;
break;
diff --git a/usr/src/lib/libast/common/misc/intercepts.h b/usr/src/lib/libast/common/misc/intercepts.h
new file mode 100644
index 0000000000..d9c207bde4
--- /dev/null
+++ b/usr/src/lib/libast/common/misc/intercepts.h
@@ -0,0 +1,40 @@
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* David Korn <dgk@research.att.com> *
+* Phong Vo <kpv@research.att.com> *
+* *
+***********************************************************************/
+#pragma prototyped
+
+#ifndef _INTERCEPTS_H
+#define _INTERCEPTS_H 1
+
+#include <ast.h>
+#include <shcmd.h>
+
+typedef struct Intercepts_s
+{
+ char* (*intercept_getenv)(const char*);
+ char* (*intercept_setenviron)(const char*);
+} Intercepts_t;
+
+#define intercepts _ast_intercepts
+
+extern Intercepts_t intercepts;
+
+#endif
diff --git a/usr/src/lib/libast/common/misc/liberror.c b/usr/src/lib/libast/common/misc/liberror.c
index 639d4962c1..dbddb2e67d 100644
--- a/usr/src/lib/libast/common/misc/liberror.c
+++ b/usr/src/lib/libast/common/misc/liberror.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/misc/libevent.c b/usr/src/lib/libast/common/misc/libevent.c
index f881615f87..06b8eeaff4 100644
--- a/usr/src/lib/libast/common/misc/libevent.c
+++ b/usr/src/lib/libast/common/misc/libevent.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/misc/magic.c b/usr/src/lib/libast/common/misc/magic.c
index 91a9b05e00..e26d59d37e 100644
--- a/usr/src/lib/libast/common/misc/magic.c
+++ b/usr/src/lib/libast/common/misc/magic.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -29,7 +29,7 @@
* the sum of the hacks {s5,v10,planix} is _____ than the parts
*/
-static const char id[] = "\n@(#)$Id: magic library (AT&T Research) 2007-01-08 $\0\n";
+static const char id[] = "\n@(#)$Id: magic library (AT&T Research) 2008-09-10 $\0\n";
static const char lib[] = "libast:magic";
@@ -396,11 +396,14 @@ static char*
vcdecomp(char* b, char* e, unsigned char* m, unsigned char* x)
{
unsigned char* map;
+ const char* o;
int c;
int n;
int i;
+ int a;
map = CCMAP(CC_ASCII, CC_NATIVE);
+ a = 0;
i = 1;
for (;;)
{
@@ -408,12 +411,47 @@ vcdecomp(char* b, char* e, unsigned char* m, unsigned char* x)
i = 0;
else
*b++ = '^';
- while (b < e && m < x && (c = *m++))
+ if (m < (x - 1) && !*(m + 1))
{
- if (map)
- c = map[c];
- *b++ = c;
+ /*
+ * obsolete indices
+ */
+
+ if (!a)
+ {
+ a = 1;
+ o = "old, ";
+ while (b < e && (c = *o++))
+ *b++ = c;
+ }
+ switch (*m)
+ {
+ case 0: o = "delta"; break;
+ case 1: o = "huffman"; break;
+ case 2: o = "huffgroup"; break;
+ case 3: o = "arith"; break;
+ case 4: o = "bwt"; break;
+ case 5: o = "rle"; break;
+ case 6: o = "mtf"; break;
+ case 7: o = "transpose"; break;
+ case 8: o = "table"; break;
+ case 9: o = "huffpart"; break;
+ case 50: o = "map"; break;
+ case 100: o = "recfm"; break;
+ case 101: o = "ss7"; break;
+ default: o = "UNKNOWN"; break;
+ }
+ m += 2;
+ while (b < e && (c = *o++))
+ *b++ = c;
}
+ else
+ while (b < e && m < x && (c = *m++))
+ {
+ if (map)
+ c = map[c];
+ *b++ = c;
+ }
if (b >= e)
break;
n = 0;
@@ -512,6 +550,8 @@ ckmagic(register Magic_t* mp, const char* file, char* buf, struct stat* st, unsi
}
break;
}
+ p = "";
+ num = 0;
if (!ep->expr)
num = ep->offset + off;
else
diff --git a/usr/src/lib/libast/common/misc/mime.c b/usr/src/lib/libast/common/misc/mime.c
index 82064d7925..c08ed50dff 100644
--- a/usr/src/lib/libast/common/misc/mime.c
+++ b/usr/src/lib/libast/common/misc/mime.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/misc/mimelib.h b/usr/src/lib/libast/common/misc/mimelib.h
index 51840a0c76..48ffa22c83 100644
--- a/usr/src/lib/libast/common/misc/mimelib.h
+++ b/usr/src/lib/libast/common/misc/mimelib.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/misc/mimetype.c b/usr/src/lib/libast/common/misc/mimetype.c
index 5842a029b8..50955c96ee 100644
--- a/usr/src/lib/libast/common/misc/mimetype.c
+++ b/usr/src/lib/libast/common/misc/mimetype.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/misc/optctx.c b/usr/src/lib/libast/common/misc/optctx.c
new file mode 100644
index 0000000000..c255643ada
--- /dev/null
+++ b/usr/src/lib/libast/common/misc/optctx.c
@@ -0,0 +1,70 @@
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* David Korn <dgk@research.att.com> *
+* Phong Vo <kpv@research.att.com> *
+* *
+***********************************************************************/
+#pragma prototyped
+/*
+ * Glenn Fowler
+ * AT&T Research
+ *
+ * _opt_infop_ context control
+ *
+ * allocate new context:
+ * new_context = optctx(0, 0);
+ * free new context:
+ * optctx(0, new_context);
+ * switch to new_context:
+ * old_context = optctx(new_context, 0);
+ * switch to old_context and free new_context:
+ * optctx(old_context, new_context);
+ */
+
+#include <optlib.h>
+
+static Opt_t* freecontext;
+
+Opt_t*
+optctx(Opt_t* p, Opt_t* o)
+{
+ if (o)
+ {
+ if (freecontext)
+ free(o);
+ else
+ freecontext = o;
+ if (!p)
+ return 0;
+ }
+ if (p)
+ {
+ o = _opt_infop_;
+ _opt_infop_ = p;
+ }
+ else
+ {
+ if (o = freecontext)
+ freecontext = 0;
+ else if (!(o = newof(0, Opt_t, 1, 0)))
+ return 0;
+ memset(o, 0, sizeof(Opt_t));
+ o->state = _opt_infop_->state;
+ }
+ return o;
+}
diff --git a/usr/src/lib/libast/common/misc/optesc.c b/usr/src/lib/libast/common/misc/optesc.c
index 911ba67ae3..e8e2f4f6c2 100644
--- a/usr/src/lib/libast/common/misc/optesc.c
+++ b/usr/src/lib/libast/common/misc/optesc.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/misc/optget.c b/usr/src/lib/libast/common/misc/optget.c
index d8b1f34f47..79041fb694 100644
--- a/usr/src/lib/libast/common/misc/optget.c
+++ b/usr/src/lib/libast/common/misc/optget.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -680,14 +680,16 @@ static char*
save(const char* s)
{
Save_t* p;
+ Dtdisc_t* d;
- static Dtdisc_t disc;
static Dt_t* dict;
if (!dict)
{
- disc.key = offsetof(Save_t, text);
- if (!(dict = dtopen(&disc, Dthash)))
+ if (!(d = newof(0, Dtdisc_t, 1, 0)))
+ return (char*)s;
+ d->key = offsetof(Save_t, text);
+ if (!(dict = dtopen(d, Dthash)))
return (char*)s;
}
if (!(p = (Save_t*)dtmatch(dict, s)))
@@ -755,24 +757,27 @@ init(register char* s, Optpass_t* p)
p->version = 1;
else
{
- if (*s < '0' || *s > '9')
+ if (!isdigit(*s))
p->version = 1;
else
- while (*s >= '0' && *s <= '9')
+ while (isdigit(*s))
p->version = p->version * 10 + (*s++ - '0');
while (*s && *s != '?' && *s != ']')
{
c = *s++;
- if (*s < '0' || *s > '9')
+ if (!isdigit(*s))
n = 1;
else
{
n = 0;
- while (*s >= '0' && *s <= '9')
+ while (isdigit(*s))
n = n * 10 + (*s++ - '0');
}
switch (c)
{
+ case '+':
+ p->flags |= OPT_plus;
+ break;
case 'c':
p->flags |= OPT_cache;
break;
@@ -782,6 +787,9 @@ init(register char* s, Optpass_t* p)
case 'l':
p->flags |= OPT_long;
break;
+ case 'n':
+ p->flags |= OPT_numeric;
+ break;
case 'o':
p->flags |= OPT_old;
break;
@@ -839,6 +847,7 @@ init(register char* s, Optpass_t* p)
s++;
p->flags |= OPT_plus;
}
+ s = next(s, 0);
if (*s != '[')
for (t = s, a = 0; *t; t++)
if (!a && *t == '-')
@@ -1051,7 +1060,7 @@ localize(Push_t* psp, char* s, char* e, int term, int n, char* catalog, int vers
*/
static int
-label(register Sfio_t* sp, int sep, register char* s, int z, int level, int style, int f, Sfio_t* ip, int version, char* catalog)
+label(register Sfio_t* sp, int sep, register char* s, int about, int z, int level, int style, int f, Sfio_t* ip, int version, char* catalog)
{
register int c;
register char* t;
@@ -1084,6 +1093,8 @@ label(register Sfio_t* sp, int sep, register char* s, int z, int level, int styl
sep = !sep || z < 0;
va = 0;
y = 0;
+ if (about)
+ sfputc(sp, '(');
if (version < 1)
{
a = 0;
@@ -1180,7 +1191,7 @@ label(register Sfio_t* sp, int sep, register char* s, int z, int level, int styl
if (va & OPT_optional)
sfputc(sp, '[');
sfputc(sp, '=');
- label(sp, 0, y, -1, 0, style, FONT_ITALIC, ip, version, catalog);
+ label(sp, 0, y, 0, -1, 0, style, FONT_ITALIC, ip, version, catalog);
if (va & OPT_optional)
sfputc(sp, ']');
y = 0;
@@ -1338,6 +1349,8 @@ label(register Sfio_t* sp, int sep, register char* s, int z, int level, int styl
restore:
if (f)
sfputr(sp, font(f, style, 0), -1);
+ if (about)
+ sfputc(sp, ')');
if (psp)
pop(psp);
return r;
@@ -1415,7 +1428,7 @@ args(register Sfio_t* sp, register char* p, register int n, int flags, int style
}
}
if (n)
- label(sp, sep, p, n, 0, style, 0, ip, version, catalog);
+ label(sp, sep, p, 0, n, 0, style, 0, ip, version, catalog);
}
/*
@@ -1425,7 +1438,7 @@ args(register Sfio_t* sp, register char* p, register int n, int flags, int style
*/
static int
-item(Sfio_t* sp, char* s, int level, int style, Sfio_t* ip, int version, char* catalog)
+item(Sfio_t* sp, char* s, int about, int level, int style, Sfio_t* ip, int version, char* catalog)
{
register char* t;
int n;
@@ -1446,7 +1459,7 @@ item(Sfio_t* sp, char* s, int level, int style, Sfio_t* ip, int version, char* c
for (n = 0; n < level; n++)
sfputc(sp, '\t');
}
- label(sp, 0, s + 1, -1, level, style, FONT_LITERAL, ip, version, catalog);
+ label(sp, 0, s + 1, about, -1, level, style, FONT_LITERAL, ip, version, catalog);
sfputc(sp, '\n');
if (style >= STYLE_nroff)
sfprintf(sp, ".DE");
@@ -1459,7 +1472,7 @@ item(Sfio_t* sp, char* s, int level, int style, Sfio_t* ip, int version, char* c
if (level)
{
if (style >= STYLE_nroff)
- sfprintf(sp, ".H%d ", (level + 1) / 2);
+ sfprintf(sp, ".H%d ", (level - (level > 2)) / 2);
else
for (n = 0; n < level; n++)
sfputc(sp, '\t');
@@ -1476,9 +1489,9 @@ item(Sfio_t* sp, char* s, int level, int style, Sfio_t* ip, int version, char* c
opt_info.state->flags |= OPT_proprietary;
break;
}
- label(sp, 0, s, -1, level, 0, 0, ip, version, catalog);
+ label(sp, 0, s, about, -1, level, 0, 0, ip, version, catalog);
sfputr(sp, "\">", -1);
- label(sp, 0, s, -1, level, style, level ? FONT_BOLD : 0, ip, version, catalog);
+ label(sp, 0, s, about, -1, level, style, level ? FONT_BOLD : 0, ip, version, catalog);
sfputr(sp, "</A>", -1);
if (!level)
sfputr(sp, "</H4>", -1);
@@ -1494,14 +1507,14 @@ item(Sfio_t* sp, char* s, int level, int style, Sfio_t* ip, int version, char* c
else if (style != STYLE_options && style != STYLE_match || *s == '-' || *s == '+')
sfputc(sp, '\t');
}
- label(sp, 0, s, -1, level, style, FONT_BOLD, ip, version, catalog);
+ label(sp, 0, s, about, -1, level, style, FONT_BOLD, ip, version, catalog);
}
}
else
{
par = 1;
if (style >= STYLE_nroff)
- sfputr(sp, ".PP", -1);
+ sfputr(sp, level ? ".SP" : ".PP", -1);
}
if (style >= STYLE_nroff || !level)
sfputc(sp, '\n');
@@ -1528,6 +1541,7 @@ textout(Sfio_t* sp, register char* p, int style, int level, int bump, Sfio_t* ip
int a;
int f;
int par;
+ int about;
Push_t* tsp;
int ident = 0;
@@ -1535,6 +1549,7 @@ textout(Sfio_t* sp, register char* p, int style, int level, int bump, Sfio_t* ip
Push_t* psp = 0;
again:
+ about = 0;
if ((c = *p) == GO)
{
for (;;)
@@ -1548,7 +1563,7 @@ textout(Sfio_t* sp, register char* p, int style, int level, int bump, Sfio_t* ip
}
else if (*p != OG)
{
- if (level <= 1 || *p != '[' || *(p + 1) != '-')
+ if (level <= 1 || *p != '[' || *(p + 1) != '-' || style == STYLE_man && *(p + 2) == '?' || isalpha(*(p + 2)))
break;
p = skip(p, 0, 0, 0, 1, level, 0, version);
}
@@ -1574,15 +1589,38 @@ textout(Sfio_t* sp, register char* p, int style, int level, int bump, Sfio_t* ip
level++;
}
if (c == '-' && level > 1)
- return skip(p, 0, 0, 0, 1, level, 1, version);
+ {
+ if (style == STYLE_man)
+ {
+ about = 1;
+ if (*(p + 1) == '-')
+ p++;
+ }
+ else
+ for (;;)
+ {
+ p = skip(p, 0, 0, 0, 1, level, 0, version);
+ while (*(p = next(p + 1, version)) == '\n');
+ if (*p == '[')
+ {
+ if ((c = *++p) != '-')
+ break;
+ }
+ else if (*p == GO)
+ goto again;
+ else if (*p == OG)
+ return p + 1;
+ }
+ }
if (c == '+' || c == '-' && (bump = 3) || c != ' ' && level > 1)
{
p = skip(t = p + 1, '?', 0, 0, 1, level, 0, version);
- if (c == '-' && (*t == '?' || *t >= '0' && *t <= '9'))
+ if (c == '-' && (*t == '?' || isdigit(*t) || *p == '?' && *(p + 1) == '\n'))
{
if ((c = *p) != '?')
return skip(p, 0, 0, 0, 1, level, 1, version);
- par = item(sp, C("version"), level, style, ip, version, ID);
+ e = C("version");
+ par = item(sp, e, about, level, style, ip, version, ID);
for (;;)
{
while (isspace(*(p + 1)))
@@ -1619,10 +1657,10 @@ textout(Sfio_t* sp, register char* p, int style, int level, int bump, Sfio_t* ip
*((t = e) + 1) = '|';
}
}
- par = item(sp, t, level, style, ip, version, catalog);
+ par = item(sp, t, about, level, style, ip, version, catalog);
c = *p;
}
- if (level)
+ if (!about && level)
par = 0;
}
else
@@ -2020,6 +2058,7 @@ opthelp(const char* oopts, const char* what)
int z;
int style;
int head;
+ int margin;
int mode;
int mutex;
int prefix;
@@ -2270,9 +2309,9 @@ opthelp(const char* oopts, const char* what)
p++;
else if (c != '[')
{
- if (c == '{')
+ if (c == GO)
vl++;
- else if (c == '}')
+ else if (c == OG)
vl--;
continue;
}
@@ -2550,7 +2589,7 @@ opthelp(const char* oopts, const char* what)
break;
continue;
}
- if (*p == '}')
+ if (*p == OG)
{
p++;
continue;
@@ -2563,7 +2602,9 @@ opthelp(const char* oopts, const char* what)
w = 0;
d = 0;
s = 0;
+ rb = re = 0;
sl = 0;
+ vl = 0;
if (*p == '[')
{
if ((c = *(p = next(p + 1, version))) == '-')
@@ -2581,7 +2622,7 @@ opthelp(const char* oopts, const char* what)
}
else if (style == STYLE_match && *what == '-')
{
- if (*(p + 1) == '?' || *(p + 1) >= '0' && *(p + 1) <= '9')
+ if (*(p + 1) == '?' || isdigit(*(p + 1)))
s = C("version");
else
s = p + 1;
@@ -2776,7 +2817,8 @@ opthelp(const char* oopts, const char* what)
if (!f && !w)
z = -1;
}
- ov = u = v = y = 0;
+ ov = 0;
+ u = v = y = 0;
if (*p == ':' && (a |= OPT_string) || *p == '#' && (a |= OPT_number))
{
message((-21, "opthelp: arg %s", show(p)));
@@ -2852,7 +2894,7 @@ opthelp(const char* oopts, const char* what)
if (!head)
{
head = 1;
- item(sp_body, (flags & OPT_functions) ? C("FUNCTIONS") : C("OPTIONS"), 0, style, sp_info, version, ID);
+ item(sp_body, (flags & OPT_functions) ? C("FUNCTIONS") : C("OPTIONS"), 0, 0, style, sp_info, version, ID);
}
if (style >= STYLE_nroff)
{
@@ -2895,7 +2937,7 @@ opthelp(const char* oopts, const char* what)
else
sfputr(sp, "void", -1);
if (w)
- label(sp_body, ' ', w, -1, 0, style, FONT_BOLD, sp_info, version, catalog);
+ label(sp_body, ' ', w, 0, -1, 0, style, FONT_BOLD, sp_info, version, catalog);
}
else
{
@@ -2907,10 +2949,10 @@ opthelp(const char* oopts, const char* what)
sfputc(sp_body, ' ');
if (w)
{
- if (label(sp_body, 0, w, -1, 0, style, 0, sp_info, version, catalog))
+ if (label(sp_body, 0, w, 0, -1, 0, style, 0, sp_info, version, catalog))
{
sfputc(sp_body, '|');
- label(sp_body, 0, w, -1, 0, style, 0, sp_info, version, native);
+ label(sp_body, 0, w, 0, -1, 0, style, 0, sp_info, version, native);
}
}
else
@@ -2932,7 +2974,7 @@ opthelp(const char* oopts, const char* what)
}
sfputc(sp_body, ' ');
if (y)
- label(sp_body, 0, y, -1, 0, style, 0, sp_info, version, catalog);
+ label(sp_body, 0, y, 0, -1, 0, style, 0, sp_info, version, catalog);
else
sfputc(sp_body, '-');
if (v)
@@ -2978,10 +3020,10 @@ opthelp(const char* oopts, const char* what)
if (prefix > 1)
sfputc(sp_body, '-');
}
- if (label(sp_body, 0, w, -1, 0, style, FONT_BOLD, sp_info, version, catalog))
+ if (label(sp_body, 0, w, 0, -1, 0, style, FONT_BOLD, sp_info, version, catalog))
{
sfputc(sp_body, '|');
- label(sp_body, 0, w, -1, 0, style, FONT_BOLD, sp_info, version, native);
+ label(sp_body, 0, w, 0, -1, 0, style, FONT_BOLD, sp_info, version, native);
}
}
if (y)
@@ -2992,7 +3034,7 @@ opthelp(const char* oopts, const char* what)
sfputc(sp_body, ' ');
if (w)
sfputc(sp_body, prefix == 1 ? ' ' : '=');
- label(sp_body, 0, y, -1, 0, style, FONT_ITALIC, sp_info, version, catalog);
+ label(sp_body, 0, y, 0, -1, 0, style, FONT_ITALIC, sp_info, version, catalog);
if (a & OPT_optional)
sfputc(sp_body, ']');
}
@@ -3081,7 +3123,7 @@ opthelp(const char* oopts, const char* what)
for (t = p; *t == '\t' || *t == '\n'; t++);
if (*t)
{
- item(sp_body, C("IMPLEMENTATION"), 0, style, sp_info, version, ID);
+ item(sp_body, C("IMPLEMENTATION"), 0, 0, style, sp_info, version, ID);
sfputr(sp_body, p, -1);
}
}
@@ -3106,41 +3148,39 @@ opthelp(const char* oopts, const char* what)
sfprintf(sp, "\
.\\\" format with nroff|troff|groff -man\n\
.fp 5 CW\n\
-.nr mI 0\n\
-.de mI\n\
-.if \\\\n(mI>\\\\$1 \\{\n\
-. nr mI \\\\n(mI-1\n\
-. RE\n\
-.mI \\\\$1\n\
-.\\}\n\
-.if \\\\n(mI<\\\\$1 \\{\n\
-. nr mI \\\\n(mI+1\n\
-. RS\n\
-.mI \\\\$1\n\
-.\\}\n\
+.nr mH 5\n\
+.de H0\n\
+.nr mH 0\n\
+.in 5n\n\
+\\fB\\\\$1\\fP\n\
+.in 7n\n\
..\n\
.de H1\n\
-.mI 1\n\
-.TP\n\
+.nr mH 1\n\
+.in 7n\n\
\\fB\\\\$1\\fP\n\
+.in 9n\n\
..\n\
.de H2\n\
-.mI 2\n\
-.TP\n\
+.nr mH 2\n\
+.in 11n\n\
\\fB\\\\$1\\fP\n\
+.in 13n\n\
..\n\
.de H3\n\
-.mI 3\n\
-.TP\n\
+.nr mH 3\n\
+.in 15n\n\
\\fB\\\\$1\\fP\n\
+.in 17n\n\
..\n\
.de H4\n\
-.mI 4\n\
-.TP\n\
+.nr mH 4\n\
+.in 19n\n\
\\fB\\\\$1\\fP\n\
+.in 21n\n\
..\n\
.de OP\n\
-.mI 0\n\
+.nr mH 0\n\
.ie !'\\\\$1'-' \\{\n\
.ds mO \\\\fB\\\\-\\\\$1\\\\fP\n\
.ds mS ,\\\\0\n\
@@ -3156,13 +3196,30 @@ opthelp(const char* oopts, const char* what)
.as mO \\\\*(mS\\\\fB%s\\\\$2\\\\fP\n\
.if !'\\\\$4'-' .as mO =\\\\fI\\\\$4\\\\fP\n\
.\\}\n\
-.TP\n\
+.in 5n\n\
\\\\*(mO\n\
+.in 9n\n\
+..\n\
+.de SP\n\
+.if \\\\n(mH==2 .in 9n\n\
+.if \\\\n(mH==3 .in 13n\n\
+.if \\\\n(mH==4 .in 17n\n\
..\n\
.de FN\n\
-.mI 0\n\
-.TP\n\
+.nr mH 0\n\
+.in 5n\n\
\\\\$1 \\\\$2\n\
+.in 9n\n\
+..\n\
+.de DS\n\
+.in +3n\n\
+.ft 5\n\
+.nf\n\
+..\n\
+.de DE\n\
+.fi\n\
+.ft R\n\
+.in -3n\n\
..\n\
.TH %s %d\n\
"
@@ -3213,7 +3270,7 @@ opthelp(const char* oopts, const char* what)
sfclose(sp_head);
sp_head = 0;
}
- item(sp, C("SYNOPSIS"), 0, style, sp_info, version, ID);
+ item(sp, C("SYNOPSIS"), 0, 0, style, sp_info, version, ID);
}
if (x)
{
@@ -3254,12 +3311,15 @@ opthelp(const char* oopts, const char* what)
goto nospace;
name = error_info.id ? error_info.id : "command";
m = strlen(name) + 1;
+#if 0
if (!opt_info.state->width)
+#endif
{
astwinsize(1, NiL, &opt_info.state->width);
if (opt_info.state->width < 20)
opt_info.state->width = OPT_WIDTH;
}
+ margin = style == STYLE_api ? (8 * 1024) : (opt_info.state->width - 1);
if (!(opt_info.state->flags & OPT_preformat))
{
if (style >= STYLE_man || matched < 0)
@@ -3279,7 +3339,7 @@ opthelp(const char* oopts, const char* what)
}
else
co = 0;
- if ((rm = opt_info.state->width - ts - 1) < OPT_MARGIN)
+ if ((rm = margin - ts) < OPT_MARGIN)
rm = OPT_MARGIN;
ip = indent;
ip->stop = (ip+1)->stop = style >= STYLE_html ? 0 : 2;
@@ -3297,7 +3357,7 @@ opthelp(const char* oopts, const char* what)
tp = 0;
sfputc(mp, '\n');
co = 0;
- rm = opt_info.state->width - 1;
+ rm = margin;
ts = ip->stop;
if (*p == '\n')
{
@@ -3362,7 +3422,7 @@ opthelp(const char* oopts, const char* what)
{
sfputc(mp, '\n');
co = 0;
- rm = opt_info.state->width - 1;
+ rm = margin;
ts = ip->stop;
}
}
@@ -3509,7 +3569,7 @@ opthelp(const char* oopts, const char* what)
sfputc(mp, '\n');
for (co = 0; co < ts; co++)
sfputc(mp, ' ');
- rm = opt_info.state->width - 1;
+ rm = margin;
}
}
else
@@ -3756,7 +3816,7 @@ optget(register char** argv, const char* oopts)
Optcache_t* pcache;
Optpass_t* pass;
-#if !_YOU_FIGURED_OUT_HOW_TO_GET_ALL_DLLS_TO_DO_THIS_
+#if !_PACKAGE_astsa && !_YOU_FIGURED_OUT_HOW_TO_GET_ALL_DLLS_TO_DO_THIS_
/*
* these are not initialized by all dlls!
*/
@@ -3879,11 +3939,13 @@ optget(register char** argv, const char* oopts)
opt_info.index++;
return 0;
}
+ else if (*s == c)
+ return 0;
}
else if (*s == '?')
n = 1;
}
- else if ((c = *s++) != '-' && (c != '+' || !(pass->flags & OPT_plus) && (*s < '0' || *s > '9' || !strmatch(opts, version ? "*\\]#\\[*" : "*#*"))))
+ else if ((c = *s++) != '-' && (c != '+' || !(pass->flags & OPT_plus) && (!(pass->flags & OPT_numeric) || !isdigit(*s))))
{
if (!(pass->flags & OPT_old) || !isalpha(c))
return 0;
@@ -3902,6 +3964,14 @@ optget(register char** argv, const char* oopts)
opt_info.index++;
return 0;
}
+ else if (*s == c)
+ {
+ /*
+ * ---* or +++* are operands
+ */
+
+ return 0;
+ }
if (version || *s == '?' || !(pass->flags & OPT_minus))
{
/*
@@ -4639,7 +4709,7 @@ optget(register char** argv, const char* oopts)
goto help;
}
}
- if (w || c < '0' || c > '9' || !numopt)
+ if (w || !isdigit(c) || !numopt || !(pass->flags & OPT_numeric))
{
pop(psp);
return opterror("", version, catalog, 0);
diff --git a/usr/src/lib/libast/common/misc/optjoin.c b/usr/src/lib/libast/common/misc/optjoin.c
index 6aa0903810..bab68823fa 100644
--- a/usr/src/lib/libast/common/misc/optjoin.c
+++ b/usr/src/lib/libast/common/misc/optjoin.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/misc/optlib.h b/usr/src/lib/libast/common/misc/optlib.h
index afdf85398a..08871b4012 100644
--- a/usr/src/lib/libast/common/misc/optlib.h
+++ b/usr/src/lib/libast/common/misc/optlib.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -37,9 +37,10 @@
#define OPT_functions 0x02
#define OPT_ignore 0x04
#define OPT_long 0x08
-#define OPT_old 0x10
-#define OPT_plus 0x20
-#define OPT_proprietary 0x40
+#define OPT_numeric 0x10
+#define OPT_old 0x20
+#define OPT_plus 0x40
+#define OPT_proprietary 0x80
#define OPT_cache_flag 0x01
#define OPT_cache_invert 0x02
diff --git a/usr/src/lib/libast/common/misc/procclose.c b/usr/src/lib/libast/common/misc/procclose.c
index 02f8b943ec..317ea584a1 100644
--- a/usr/src/lib/libast/common/misc/procclose.c
+++ b/usr/src/lib/libast/common/misc/procclose.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -65,17 +65,21 @@ procclose(register Proc_t* p)
sigcritical(0);
else
{
- signal(SIGINT, p->sigint);
- signal(SIGQUIT, p->sigquit);
+ if (p->sigint != SIG_IGN)
+ signal(SIGINT, p->sigint);
+ if (p->sigquit != SIG_IGN)
+ signal(SIGQUIT, p->sigquit);
#if defined(SIGCHLD)
#if _lib_sigprocmask
sigprocmask(SIG_SETMASK, &p->mask, NiL);
#else
#if _lib_sigsetmask
sigsetmask(p->mask);
+#else
+ if (p->sigchld != SIG_DFL)
+ signal(SIGCHLD, p->sigchld);
#endif
#endif
- signal(SIGCHLD, p->sigchld);
#endif
}
status = status == -1 ?
diff --git a/usr/src/lib/libast/common/misc/procfree.c b/usr/src/lib/libast/common/misc/procfree.c
index 36a9ce463f..6a7d429af6 100644
--- a/usr/src/lib/libast/common/misc/procfree.c
+++ b/usr/src/lib/libast/common/misc/procfree.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/misc/proclib.h b/usr/src/lib/libast/common/misc/proclib.h
index 45749ae47a..55801fec6b 100644
--- a/usr/src/lib/libast/common/misc/proclib.h
+++ b/usr/src/lib/libast/common/misc/proclib.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/misc/procopen.c b/usr/src/lib/libast/common/misc/procopen.c
index bdb845a671..ba026296c0 100644
--- a/usr/src/lib/libast/common/misc/procopen.c
+++ b/usr/src/lib/libast/common/misc/procopen.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -360,7 +360,7 @@ restore(Proc_t* proc)
*/
Proc_t*
-procopen(const char* cmd, char** argv, char** envv, long* modv, long flags)
+procopen(const char* cmd, char** argv, char** envv, long* modv, int flags)
{
register Proc_t* proc = 0;
register int procfd;
@@ -368,6 +368,7 @@ procopen(const char* cmd, char** argv, char** envv, long* modv, long flags)
char** v;
int i;
int forked = 0;
+ int signalled = 0;
long n;
char path[PATH_MAX];
char env[PATH_MAX + 2];
@@ -469,10 +470,10 @@ procopen(const char* cmd, char** argv, char** envv, long* modv, long flags)
sigcritical(SIG_REG_EXEC|SIG_REG_PROC);
else
{
+ signalled = 1;
proc->sigint = signal(SIGINT, SIG_IGN);
proc->sigquit = signal(SIGQUIT, SIG_IGN);
#if defined(SIGCHLD)
- proc->sigchld = signal(SIGCHLD, SIG_DFL);
#if _lib_sigprocmask
sigemptyset(&mask);
sigaddset(&mask, SIGCHLD);
@@ -481,6 +482,8 @@ procopen(const char* cmd, char** argv, char** envv, long* modv, long flags)
#if _lib_sigsetmask
mask = sigmask(SIGCHLD);
proc->mask = sigblock(mask);
+#else
+ proc->sigchld = signal(SIGCHLD, SIG_DFL);
#endif
#endif
#endif
@@ -491,25 +494,35 @@ procopen(const char* cmd, char** argv, char** envv, long* modv, long flags)
else if (!proc->pid)
{
if (proc->sigint != SIG_IGN)
+ {
proc->sigint = SIG_DFL;
- signal(SIGINT, proc->sigint);
+ signal(SIGINT, proc->sigint);
+ }
if (proc->sigquit != SIG_IGN)
+ {
proc->sigquit = SIG_DFL;
- signal(SIGQUIT, proc->sigquit);
+ signal(SIGQUIT, proc->sigquit);
+ }
#if defined(SIGCHLD)
+#if _lib_sigprocmask
+ sigprocmask(SIG_SETMASK, &proc->mask, NiL);
+#else
+#if _lib_sigsetmask
+ sigsetmask(proc->mask);
+#else
if (proc->sigchld != SIG_IGN)
- proc->sigchld = SIG_DFL;
- signal(SIGCHLD, proc->sigchld);
+ signal(SIGCHLD, SIG_DFL);
+#endif
+#endif
#endif
}
- if (proc->pid == -1)
+ else if (proc->pid == -1)
goto bad;
forked = 1;
}
#endif
if (!proc->pid)
{
- char* s;
#if _use_spawnveg
char** oenviron = 0;
char* oenviron0 = 0;
@@ -731,11 +744,23 @@ sfsync(sfstderr);
{
if (flags & PROC_FOREGROUND)
{
+ signalled = 1;
proc->sigint = signal(SIGINT, SIG_IGN);
proc->sigquit = signal(SIGQUIT, SIG_IGN);
#if defined(SIGCHLD)
+#if _lib_sigprocmask
+ sigemptyset(&mask);
+ sigaddset(&mask, SIGCHLD);
+ sigprocmask(SIG_BLOCK, &mask, &proc->mask);
+#else
+#if _lib_sigsetmask
+ mask = sigmask(SIGCHLD);
+ proc->mask = sigblock(mask);
+#else
proc->sigchld = signal(SIGCHLD, SIG_DFL);
#endif
+#endif
+#endif
}
}
else if (modv)
@@ -798,6 +823,25 @@ sfsync(sfstderr);
return proc;
}
bad:
+ if (signalled)
+ {
+ if (proc->sigint != SIG_IGN)
+ signal(SIGINT, proc->sigint);
+ if (proc->sigquit != SIG_IGN)
+ signal(SIGQUIT, proc->sigquit);
+#if defined(SIGCHLD)
+#if _lib_sigprocmask
+ sigprocmask(SIG_SETMASK, &proc->mask, NiL);
+#else
+#if _lib_sigsetmask
+ sigsetmask(proc->mask);
+#else
+ if (proc->sigchld != SIG_DFL)
+ signal(SIGCHLD, proc->sigchld);
+#endif
+#endif
+#endif
+ }
if ((flags & PROC_CLEANUP) && modv)
for (i = 0; n = modv[i]; i++)
switch (PROC_OP(n))
diff --git a/usr/src/lib/libast/common/misc/procrun.c b/usr/src/lib/libast/common/misc/procrun.c
index 67b07b24cc..757613eb00 100644
--- a/usr/src/lib/libast/common/misc/procrun.c
+++ b/usr/src/lib/libast/common/misc/procrun.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -34,7 +34,16 @@
#include "proclib.h"
int
-procrun(const char* path, char** argv)
+procrun(const char* path, char** argv, int flags)
{
- return procclose(procopen(path, argv, NiL, NiL, PROC_FOREGROUND|PROC_GID|PROC_UID));
+#if __OBSOLETE__ < 20090101
+ flags &= argv ? PROC_ARGMOD : PROC_CHECK;
+#endif
+ if (flags & PROC_CHECK)
+ {
+ char buf[PATH_MAX];
+
+ return pathpath(buf, path, NiL, PATH_REGULAR|PATH_EXECUTE) ? 0 : -1;
+ }
+ return procclose(procopen(path, argv, NiL, NiL, flags|PROC_FOREGROUND|PROC_GID|PROC_UID));
}
diff --git a/usr/src/lib/libast/common/misc/recfmt.c b/usr/src/lib/libast/common/misc/recfmt.c
index 73aa77d197..404c809634 100644
--- a/usr/src/lib/libast/common/misc/recfmt.c
+++ b/usr/src/lib/libast/common/misc/recfmt.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/misc/reclen.c b/usr/src/lib/libast/common/misc/reclen.c
index fa9ffd3149..507619b35e 100644
--- a/usr/src/lib/libast/common/misc/reclen.c
+++ b/usr/src/lib/libast/common/misc/reclen.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/misc/recstr.c b/usr/src/lib/libast/common/misc/recstr.c
index 1d0c823b91..f5e069c747 100644
--- a/usr/src/lib/libast/common/misc/recstr.c
+++ b/usr/src/lib/libast/common/misc/recstr.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -178,7 +178,10 @@ recstr(register const char* s, char** e)
continue;
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
+ v = 0;
a[n++] = strtol(s, &t, 0);
+ if (t > s && (*(t - 1) == 'l' || *(t - 1) == 'L'))
+ t--;
s = (const char*)t - 1;
continue;
}
@@ -186,6 +189,8 @@ recstr(register const char* s, char** e)
}
if (e)
*e = (char*)s;
+ if (a[3] > (a[1] - a[2]))
+ a[3] = a[1] - a[2];
return REC_V_RECORD(REC_V_TYPE(a[1], a[2], a[3], a[4], a[5]), a[0]);
case '%':
if (e)
diff --git a/usr/src/lib/libast/common/misc/setenviron.c b/usr/src/lib/libast/common/misc/setenviron.c
index 1bf9a57f8c..bc42f192ca 100644
--- a/usr/src/lib/libast/common/misc/setenviron.c
+++ b/usr/src/lib/libast/common/misc/setenviron.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -20,6 +20,11 @@
* *
***********************************************************************/
#pragma prototyped
+
+#include "intercepts.h"
+
+#include <fs3d.h>
+
/*
* put name=value in the environment
* pointer to value returned
@@ -32,14 +37,12 @@
* _ always placed at the top
*/
-#include <ast.h>
-#include <fs3d.h>
-
#define INCREMENT 16 /* environ increment */
char*
setenviron(const char* akey)
{
+#undef setenviron
static char** envv; /* recorded environ */
static char** next; /* next free slot */
static char** last; /* last free slot (0) */
@@ -53,6 +56,8 @@ setenviron(const char* akey)
int n;
ast.env_serial++;
+ if (intercepts.intercept_setenviron)
+ return (*intercepts.intercept_setenviron)(akey);
if (p && !v)
{
environ = next = p;
diff --git a/usr/src/lib/libast/common/misc/sigcrit.c b/usr/src/lib/libast/common/misc/sigcrit.c
index a51f7408a0..5941e8cd4b 100644
--- a/usr/src/lib/libast/common/misc/sigcrit.c
+++ b/usr/src/lib/libast/common/misc/sigcrit.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/misc/sigdata.c b/usr/src/lib/libast/common/misc/sigdata.c
index a3e5cd6d72..b295004b98 100644
--- a/usr/src/lib/libast/common/misc/sigdata.c
+++ b/usr/src/lib/libast/common/misc/sigdata.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/misc/signal.c b/usr/src/lib/libast/common/misc/signal.c
index 1eddd1329e..1eb9ed26cb 100644
--- a/usr/src/lib/libast/common/misc/signal.c
+++ b/usr/src/lib/libast/common/misc/signal.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -76,16 +76,22 @@ signal(int sig, Sig_handler_t fun)
{
struct sigaction na;
struct sigaction oa;
+ int unblock;
#ifdef SIGNO_MASK
unsigned int flags;
#endif
+ if (sig < 0)
+ {
+ sig = -sig;
+ unblock = 0;
+ }
+ else
+ unblock = fun == SIG_DFL;
#ifdef SIGNO_MASK
flags = sig & ~SIGNO_MASK;
sig &= SIGNO_MASK;
#endif
- if (fun == SIG_DFL)
- sigunblock(sig);
memzero(&na, sizeof(na));
na.sa_handler = fun;
#if defined(SA_INTERRUPT) || defined(SA_RESTART)
@@ -116,7 +122,11 @@ signal(int sig, Sig_handler_t fun)
break;
}
#endif
- return(sigaction(sig, &na, &oa) ? (Sig_handler_t)0 : oa.sa_handler);
+ if (sigaction(sig, &na, &oa))
+ return 0;
+ if (unblock)
+ sigunblock(sig);
+ return oa.sa_handler;
}
#else
diff --git a/usr/src/lib/libast/common/misc/stack.c b/usr/src/lib/libast/common/misc/stack.c
index 05621992b2..3878653442 100644
--- a/usr/src/lib/libast/common/misc/stack.c
+++ b/usr/src/lib/libast/common/misc/stack.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/misc/state.c b/usr/src/lib/libast/common/misc/state.c
index 343fb3b89c..ec0681e234 100644
--- a/usr/src/lib/libast/common/misc/state.c
+++ b/usr/src/lib/libast/common/misc/state.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
#pragma prototyped
-static const char id[] = "\n@(#)$Id: ast (AT&T Research) 2005-05-01 $\0\n";
+static const char id[] = "\n@(#)$Id: ast (AT&T Research) 2008-04-01 $\0\n";
#include <ast.h>
diff --git a/usr/src/lib/libast/common/misc/stk.c b/usr/src/lib/libast/common/misc/stk.c
index 9688e4b6cd..52f90137ff 100644
--- a/usr/src/lib/libast/common/misc/stk.c
+++ b/usr/src/lib/libast/common/misc/stk.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -318,6 +318,18 @@ int stkclose(Sfio_t* stream)
}
/*
+ * returns 1 if <loc> is on this stack
+ */
+int stkon(register Sfio_t * stream, register char* loc)
+{
+ register struct stk *sp = stream2stk(stream);
+ register struct frame *fp;
+ for(fp=(struct frame*)sp->stkbase; fp; fp=(struct frame*)fp->prev)
+ if(loc>=((char*)(fp+1)) && loc< fp->end)
+ return(1);
+ return(0);
+}
+/*
* reset the bottom of the current stack back to <loc>
* if <loc> is not in this stack, then the stack is reset to the beginning
* otherwise, the top of the stack is set to stkbot+<offset>
@@ -439,6 +451,21 @@ char *stkcopy(Sfio_t *stream, const char* str)
{
register unsigned char *cp = (unsigned char*)str;
register int n;
+ register int off=stktell(stream);
+ char buff[40], *tp=buff;
+ if(off)
+ {
+ if(off > sizeof(buff))
+ {
+ if(!(tp = malloc(off)))
+ {
+ struct stk *sp = stream2stk(stream);
+ if(!sp->stkoverflow || !(tp = (*sp->stkoverflow)(off)))
+ return(0);
+ }
+ }
+ memcpy(tp, stream->_data, off);
+ }
while(*cp++);
n = roundof(cp-(unsigned char*)str,STK_ALIGN);
if(!init)
@@ -448,6 +475,13 @@ char *stkcopy(Sfio_t *stream, const char* str)
return(0);
strcpy((char*)(cp=stream->_data),str);
stream->_data = stream->_next = cp+n;
+ if(off)
+ {
+ _stkseek(stream,off);
+ memcpy(stream->_data, tp, off);
+ if(tp!=buff)
+ free((void*)tp);
+ }
return((char*)cp);
}
diff --git a/usr/src/lib/libast/common/misc/systrace.c b/usr/src/lib/libast/common/misc/systrace.c
index 87604ad422..38d8fa172d 100644
--- a/usr/src/lib/libast/common/misc/systrace.c
+++ b/usr/src/lib/libast/common/misc/systrace.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/misc/translate.c b/usr/src/lib/libast/common/misc/translate.c
index 7db6f34850..995cdcd51b 100644
--- a/usr/src/lib/libast/common/misc/translate.c
+++ b/usr/src/lib/libast/common/misc/translate.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/misc/univdata.c b/usr/src/lib/libast/common/misc/univdata.c
index 2399b6ade9..afeeb943b9 100644
--- a/usr/src/lib/libast/common/misc/univdata.c
+++ b/usr/src/lib/libast/common/misc/univdata.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/misc/univlib.h b/usr/src/lib/libast/common/misc/univlib.h
index c161eebc60..24a728a312 100644
--- a/usr/src/lib/libast/common/misc/univlib.h
+++ b/usr/src/lib/libast/common/misc/univlib.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/obsolete/spawn.c b/usr/src/lib/libast/common/obsolete/spawn.c
index 8784224b42..22f215ff85 100644
--- a/usr/src/lib/libast/common/obsolete/spawn.c
+++ b/usr/src/lib/libast/common/obsolete/spawn.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/path/pathaccess.c b/usr/src/lib/libast/common/path/pathaccess.c
index 8d84e2aa2c..b23d7d30ad 100644
--- a/usr/src/lib/libast/common/path/pathaccess.c
+++ b/usr/src/lib/libast/common/path/pathaccess.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/path/pathbin.c b/usr/src/lib/libast/common/path/pathbin.c
index 227f1a5ffa..58f4301142 100644
--- a/usr/src/lib/libast/common/path/pathbin.c
+++ b/usr/src/lib/libast/common/path/pathbin.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/path/pathcanon.c b/usr/src/lib/libast/common/path/pathcanon.c
index 5f31c460b7..c119bca002 100644
--- a/usr/src/lib/libast/common/path/pathcanon.c
+++ b/usr/src/lib/libast/common/path/pathcanon.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -66,8 +66,13 @@ pathcanon(char* path, int flags)
dots = loop = 0;
phys = path;
v = path + ((flags >> 5) & 01777);
- if (*path == '/' && *(path + 1) == '/' && *astconf("PATH_LEADING_SLASHES", NiL, NiL) == '1')
- do path++; while (*path == '/' && *(path + 1) == '/');
+ if (*path == '/')
+ {
+ if (*(path + 1) == '/' && *astconf("PATH_LEADING_SLASHES", NiL, NiL) == '1')
+ do path++; while (*path == '/' && *(path + 1) == '/');
+ if (!*(path + 1))
+ return path + 1;
+ }
p = r = s = t = path;
for (;;) switch (*t++ = *s++)
{
diff --git a/usr/src/lib/libast/common/path/pathcat.c b/usr/src/lib/libast/common/path/pathcat.c
index b8bff4e286..92091826f8 100644
--- a/usr/src/lib/libast/common/path/pathcat.c
+++ b/usr/src/lib/libast/common/path/pathcat.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/path/pathcd.c b/usr/src/lib/libast/common/path/pathcd.c
index 6c48f0c9d7..363cb1f709 100644
--- a/usr/src/lib/libast/common/path/pathcd.c
+++ b/usr/src/lib/libast/common/path/pathcd.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/path/pathcheck.c b/usr/src/lib/libast/common/path/pathcheck.c
index 071640098a..0bedbb185b 100644
--- a/usr/src/lib/libast/common/path/pathcheck.c
+++ b/usr/src/lib/libast/common/path/pathcheck.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/path/pathexists.c b/usr/src/lib/libast/common/path/pathexists.c
index fb13240996..ceb5f2ec56 100644
--- a/usr/src/lib/libast/common/path/pathexists.c
+++ b/usr/src/lib/libast/common/path/pathexists.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/path/pathfind.c b/usr/src/lib/libast/common/path/pathfind.c
index e73e7bf4d5..6f1907589b 100644
--- a/usr/src/lib/libast/common/path/pathfind.c
+++ b/usr/src/lib/libast/common/path/pathfind.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/path/pathgetlink.c b/usr/src/lib/libast/common/path/pathgetlink.c
index 1bb9dcfee1..515b0dbcd9 100644
--- a/usr/src/lib/libast/common/path/pathgetlink.c
+++ b/usr/src/lib/libast/common/path/pathgetlink.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/path/pathkey.c b/usr/src/lib/libast/common/path/pathkey.c
index ddbb9e7659..dbe350ded3 100644
--- a/usr/src/lib/libast/common/path/pathkey.c
+++ b/usr/src/lib/libast/common/path/pathkey.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/path/pathnative.c b/usr/src/lib/libast/common/path/pathnative.c
index 2fbd6dd74c..125ec26712 100644
--- a/usr/src/lib/libast/common/path/pathnative.c
+++ b/usr/src/lib/libast/common/path/pathnative.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/path/pathpath.c b/usr/src/lib/libast/common/path/pathpath.c
index 520fdb9e52..f080bb63e3 100644
--- a/usr/src/lib/libast/common/path/pathpath.c
+++ b/usr/src/lib/libast/common/path/pathpath.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/path/pathposix.c b/usr/src/lib/libast/common/path/pathposix.c
index 1fe816dcc8..d8d097c0fe 100644
--- a/usr/src/lib/libast/common/path/pathposix.c
+++ b/usr/src/lib/libast/common/path/pathposix.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/path/pathprobe.c b/usr/src/lib/libast/common/path/pathprobe.c
index ea19903be9..09e629a665 100644
--- a/usr/src/lib/libast/common/path/pathprobe.c
+++ b/usr/src/lib/libast/common/path/pathprobe.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -60,6 +60,7 @@ static int
rofs(const char* path)
{
struct statvfs vfs;
+ struct stat st;
if (!statvfs(path, &vfs))
{
@@ -68,7 +69,7 @@ rofs(const char* path)
return 1;
#endif
#if defined(ST_NOSUID)
- if (vfs.f_flag & ST_NOSUID)
+ if ((vfs.f_flag & ST_NOSUID) && (stat(path, &st) || st.st_uid != getuid() && st.st_uid != geteuid()))
return 1;
#endif
}
@@ -238,8 +239,8 @@ pathprobe(char* path, char* attr, const char* lang, const char* tool, const char
ops[1] = 0;
if (pp = procopen(proc, arg, NiL, ops, PROC_READ))
{
- if ((v = x - e) > sizeof(ver))
- v = sizeof(ver);
+ if ((v = x - e) >= sizeof(ver))
+ v = sizeof(ver) - 1;
for (k = p = ver;; k++)
{
if (k >= p)
@@ -249,7 +250,7 @@ pathprobe(char* path, char* attr, const char* lang, const char* tool, const char
v -= r;
p = k + r;
}
- if (*k == '\n')
+ if (*k == '\n' || *k == '\r')
break;
if (*k == n)
*k = ' ';
@@ -291,7 +292,7 @@ pathprobe(char* path, char* attr, const char* lang, const char* tool, const char
*ap++ = (char*)tool;
*ap++ = proc;
*ap = 0;
- if (procrun(exe, arg))
+ if (procrun(exe, arg, 0))
return 0;
if (eaccess(path, R_OK))
return 0;
diff --git a/usr/src/lib/libast/common/path/pathrepl.c b/usr/src/lib/libast/common/path/pathrepl.c
index dcee401965..dd424e473a 100644
--- a/usr/src/lib/libast/common/path/pathrepl.c
+++ b/usr/src/lib/libast/common/path/pathrepl.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/path/pathsetlink.c b/usr/src/lib/libast/common/path/pathsetlink.c
index 80787e4309..9c8a507a92 100644
--- a/usr/src/lib/libast/common/path/pathsetlink.c
+++ b/usr/src/lib/libast/common/path/pathsetlink.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/path/pathshell.c b/usr/src/lib/libast/common/path/pathshell.c
index f1418f5015..2ed2987829 100644
--- a/usr/src/lib/libast/common/path/pathshell.c
+++ b/usr/src/lib/libast/common/path/pathshell.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/path/pathstat.c b/usr/src/lib/libast/common/path/pathstat.c
index 16e5c4fc85..2d13bbd334 100644
--- a/usr/src/lib/libast/common/path/pathstat.c
+++ b/usr/src/lib/libast/common/path/pathstat.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/path/pathtemp.c b/usr/src/lib/libast/common/path/pathtemp.c
index 88d713dc9f..1656e1193e 100644
--- a/usr/src/lib/libast/common/path/pathtemp.c
+++ b/usr/src/lib/libast/common/path/pathtemp.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/path/pathtmp.c b/usr/src/lib/libast/common/path/pathtmp.c
index 7ef4df6b64..98791c6aa2 100644
--- a/usr/src/lib/libast/common/path/pathtmp.c
+++ b/usr/src/lib/libast/common/path/pathtmp.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/port/astconf.c b/usr/src/lib/libast/common/port/astconf.c
index e69141fddd..c0b08e8386 100644
--- a/usr/src/lib/libast/common/port/astconf.c
+++ b/usr/src/lib/libast/common/port/astconf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -26,7 +26,7 @@
* extended to allow some features to be set per-process
*/
-static const char id[] = "\n@(#)$Id: getconf (AT&T Research) 2006-11-15 $\0\n";
+static const char id[] = "\n@(#)$Id: getconf (AT&T Research) 2008-04-24 $\0\n";
#include "univlib.h"
@@ -78,6 +78,7 @@ static const char id[] = "\n@(#)$Id: getconf (AT&T Research) 2006-11-15 $\0\n";
#define CONF_ERROR (CONF_USER<<0)
#define CONF_READONLY (CONF_USER<<1)
#define CONF_ALLOC (CONF_USER<<2)
+#define CONF_GLOBAL (CONF_USER<<3)
#define INITIALIZE() do{if(!state.data)synthesize(NiL,NiL,NiL);}while(0)
@@ -103,7 +104,7 @@ typedef struct Feature_s
char* strict;
short length;
short standard;
- unsigned short flags;
+ unsigned int flags;
short op;
} Feature_t;
@@ -111,7 +112,7 @@ typedef struct
{
Conf_t* conf;
const char* name;
- unsigned short flags;
+ unsigned int flags;
short call;
short standard;
short section;
@@ -267,7 +268,7 @@ typedef struct
static State_t state = { "getconf", "_AST_FEATURES", dynamic };
-static char* feature(const char*, const char*, const char*, int, Error_f);
+static char* feature(const char*, const char*, const char*, unsigned int, Error_f);
/*
* return fmtbuf() copy of s
@@ -294,6 +295,10 @@ synthesize(register Feature_t* fp, const char* path, const char* value)
register char* v;
register int n;
+#if DEBUG || DEBUG_astconf
+ if (fp)
+ error(-2, "astconf synthesize name=%s path=%s value=%s fp=%p%s", fp->name, path, value, fp, state.synthesizing ? " SYNTHESIZING" : "");
+#endif
if (state.synthesizing)
return null;
if (!state.data)
@@ -461,6 +466,9 @@ initialize(register Feature_t* fp, const char* path, const char* command, const
register char* p;
register int ok = 1;
+#if DEBUG || DEBUG_astconf
+ error(-2, "astconf initialize name=%s path=%s command=%s succeed=%s fail=%s fp=%p%s", fp->name, path, command, succeed, fail, fp, state.synthesizing ? " SYNTHESIZING" : "");
+#endif
switch (fp->op)
{
case OP_conformance:
@@ -485,6 +493,9 @@ initialize(register Feature_t* fp, const char* path, const char* command, const
register char* d = p;
Sfio_t* tmp;
+#if DEBUG || DEBUG_astconf
+ error(-2, "astconf initialize name=%s ok=%d PATH=%s", fp->name, ok, p);
+#endif
if (tmp = sfstropen())
{
for (;;)
@@ -518,13 +529,19 @@ initialize(register Feature_t* fp, const char* path, const char* command, const
r = 0;
if (fp->op == OP_universe)
{
- if (strneq(p, "bin:", 4) || strneq(p, "usr/bin:", 8))
- break;
+ if (p[0] == 'u' && p[1] == 's' && p[2] == 'r' && p[3] == '/')
+ for (p += 4; *p == '/'; p++);
+ if (p[0] == 'b' && p[1] == 'i' && p[2] == 'n')
+ {
+ for (p += 3; *p == '/'; p++);
+ if (!*p || *p == ':')
+ break;
+ }
}
}
if (fp->op == OP_universe)
{
- if (strneq(p, "5bin", 4))
+ if (strneq(p, "xpg", 3) || strneq(p, "5bin", 4))
{
ok = 1;
break;
@@ -557,11 +574,18 @@ initialize(register Feature_t* fp, const char* path, const char* command, const
*/
static char*
-format(register Feature_t* fp, const char* path, const char* value, int flags, Error_f conferror)
+format(register Feature_t* fp, const char* path, const char* value, unsigned int flags, Error_f conferror)
{
register Feature_t* sp;
register int n;
+#if DEBUG || DEBUG_astconf
+ error(-2, "astconf format name=%s path=%s value=%s flags=%04x fp=%p%s", fp->name, path, value, flags, fp, state.synthesizing ? " SYNTHESIZING" : "");
+#endif
+ if (value)
+ fp->flags &= ~CONF_GLOBAL;
+ else if (fp->flags & CONF_GLOBAL)
+ return fp->value;
switch (fp->op)
{
@@ -647,7 +671,9 @@ format(register Feature_t* fp, const char* path, const char* value, int flags, E
n = 1;
strcpy(fp->value, univ_name[n - 1]);
#else
- if (!synthesize(fp, path, value))
+ if (value && streq(path, "="))
+ strcpy(fp->value, value);
+ else
initialize(fp, path, "echo", "att", "ucb");
#endif
#endif
@@ -658,6 +684,8 @@ format(register Feature_t* fp, const char* path, const char* value, int flags, E
break;
}
+ if (streq(path, "="))
+ fp->flags |= CONF_GLOBAL;
return fp->value;
}
@@ -668,7 +696,7 @@ format(register Feature_t* fp, const char* path, const char* value, int flags, E
*/
static char*
-feature(const char* name, const char* path, const char* value, int flags, Error_f conferror)
+feature(const char* name, const char* path, const char* value, unsigned int flags, Error_f conferror)
{
register Feature_t* fp;
register int n;
@@ -677,7 +705,7 @@ feature(const char* name, const char* path, const char* value, int flags, Error_
value = null;
for (fp = state.features; fp && !streq(fp->name, name); fp = fp->next);
#if DEBUG || DEBUG_astconf
- error(-2, "astconf feature name=%s path=%s value=%s flags=%04x fp=%p", name, path, value, flags, fp);
+ error(-2, "astconf feature name=%s path=%s value=%s flags=%04x fp=%p%s", name, path, value, flags, fp, state.synthesizing ? " SYNTHESIZING" : "");
#endif
if (!fp)
{
@@ -719,7 +747,7 @@ feature(const char* name, const char* path, const char* value, int flags, Error_
*/
static int
-lookup(register Lookup_t* look, const char* name, int flags)
+lookup(register Lookup_t* look, const char* name, unsigned int flags)
{
register Conf_t* mid = (Conf_t*)conf;
register Conf_t* lo = mid;
@@ -739,7 +767,7 @@ lookup(register Lookup_t* look, const char* name, int flags)
name++;
again:
for (p = prefix; p < &prefix[prefix_elements]; p++)
- if (strneq(name, p->name, p->length) && ((c = name[p->length] == '_' || name[p->length] == '(') || (v = isdigit(name[p->length]) && name[p->length + 1] == '_')))
+ if (strneq(name, p->name, p->length) && ((c = name[p->length] == '_' || name[p->length] == '(' || name[p->length] == '#') || (v = isdigit(name[p->length]) && name[p->length + 1] == '_')))
{
if (p->call < 0)
{
@@ -753,14 +781,16 @@ lookup(register Lookup_t* look, const char* name, int flags)
break;
look->call = p->call;
}
- if (name[p->length] == '(')
+ if (name[p->length] == '(' || name[p->length] == '#')
{
look->conf = &num;
strncpy((char*)num.name, name, sizeof(num.name));
num.call = p->call;
num.flags = *name == 'C' ? CONF_STRING : 0;
num.op = (short)strtol(name + p->length + 1, &e, 10);
- if (*e++ != ')' || *e)
+ if (name[p->length] == '(' && *e == ')')
+ e++;
+ if (*e)
break;
return 1;
}
@@ -857,11 +887,12 @@ static char*
print(Sfio_t* sp, register Lookup_t* look, const char* name, const char* path, int listflags, Error_f conferror)
{
register Conf_t* p = look->conf;
- register int flags = look->flags;
+ register unsigned int flags = look->flags;
char* call;
char* f;
const char* s;
int i;
+ int n;
int olderrno;
int drop;
int defined;
@@ -1002,6 +1033,25 @@ print(Sfio_t* sp, register Lookup_t* look, const char* name, const char* path, i
break;
case 0:
call = 0;
+ if (p->standard == CONF_AST)
+ {
+ if (streq(look->name, "RELEASE") && (i = open("/proc/version", O_RDONLY)) >= 0)
+ {
+ n = read(i, buf, sizeof(buf) - 1);
+ close(i);
+ if (n > 0 && buf[n - 1] == '\n')
+ n--;
+ if (n > 0 && buf[n - 1] == '\r')
+ n--;
+ buf[n] = 0;
+ if (buf[0])
+ {
+ v = 0;
+ s = buf;
+ break;
+ }
+ }
+ }
if (p->flags & CONF_MINMAX_DEF)
{
if (!((p->flags & CONF_LIMIT_DEF)))
diff --git a/usr/src/lib/libast/common/port/astcopy.c b/usr/src/lib/libast/common/port/astcopy.c
index 2dbf712ddc..74c47eca32 100644
--- a/usr/src/lib/libast/common/port/astcopy.c
+++ b/usr/src/lib/libast/common/port/astcopy.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/port/astdynamic.c b/usr/src/lib/libast/common/port/astdynamic.c
index 9e69dc1f9c..faff88ad69 100644
--- a/usr/src/lib/libast/common/port/astdynamic.c
+++ b/usr/src/lib/libast/common/port/astdynamic.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/port/astlicense.c b/usr/src/lib/libast/common/port/astlicense.c
index e5bab4d8c4..5e15cee13a 100644
--- a/usr/src/lib/libast/common/port/astlicense.c
+++ b/usr/src/lib/libast/common/port/astlicense.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/port/astmath.c b/usr/src/lib/libast/common/port/astmath.c
index 0722116328..8637dc9300 100644
--- a/usr/src/lib/libast/common/port/astmath.c
+++ b/usr/src/lib/libast/common/port/astmath.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -27,6 +27,10 @@
* linux.sparc sfdlen,sfputd frexp,ldexp
*/
+#if N >= 8
+#define _ISOC99_SOURCE 1
+#endif
+
#include <math.h>
int
@@ -59,4 +63,10 @@ main()
#if N == 6
return isnan(value);
#endif
+#if N == 7
+ return copysign(1.0, value) < 0;
+#endif
+#if N == 8
+ return signbit(value);
+#endif
}
diff --git a/usr/src/lib/libast/common/port/astquery.c b/usr/src/lib/libast/common/port/astquery.c
index 540a501ceb..3c45c861fc 100644
--- a/usr/src/lib/libast/common/port/astquery.c
+++ b/usr/src/lib/libast/common/port/astquery.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/port/aststatic.c b/usr/src/lib/libast/common/port/aststatic.c
index 8c8975155e..4ac6bc08a3 100644
--- a/usr/src/lib/libast/common/port/aststatic.c
+++ b/usr/src/lib/libast/common/port/aststatic.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/port/astwinsize.c b/usr/src/lib/libast/common/port/astwinsize.c
index 32d1bfe400..21416eb9ec 100644
--- a/usr/src/lib/libast/common/port/astwinsize.c
+++ b/usr/src/lib/libast/common/port/astwinsize.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/port/iblocks.c b/usr/src/lib/libast/common/port/iblocks.c
index 7ace66c35a..33e88f01dc 100644
--- a/usr/src/lib/libast/common/port/iblocks.c
+++ b/usr/src/lib/libast/common/port/iblocks.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/port/lc.c b/usr/src/lib/libast/common/port/lc.c
index e632d00182..0e6aa22cfc 100644
--- a/usr/src/lib/libast/common/port/lc.c
+++ b/usr/src/lib/libast/common/port/lc.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -26,58 +26,19 @@
*/
#include "lclib.h"
+#include "lclang.h"
#include <ctype.h>
-#if _WINIX
-
-#include <ast_windows.h>
-
-#define LANG_CHINESE_SIMPLIFIED LANG_CHINESE
-#define LANG_CHINESE_TRADITIONAL LANG_CHINESE
-#define LANG_NORWEGIAN_BOKMAL LANG_NORWEGIAN
-#define LANG_NORWEGIAN_NYNORSK LANG_NORWEGIAN
-#define LANG_SERBO_CROATIAN LANG_CROATIAN
-
-#define CTRY_CZECH_REPUBLIC CTRY_CZECH
-
-#define SUBLANG_CHINESE_SIMPLIFIED_CHINA SUBLANG_CHINESE_SIMPLIFIED
-#define SUBLANG_CHINESE_SIMPLIFIED_HONG_KONG SUBLANG_CHINESE_HONGKONG
-#define SUBLANG_CHINESE_SIMPLIFIED_SINGAPORE SUBLANG_CHINESE_SINGAPORE
-#define SUBLANG_CHINESE_TRADITIONAL_TAIWAN SUBLANG_CHINESE_TRADITIONAL
-#define SUBLANG_DUTCH_NETHERLANDS_ANTILLES SUBLANG_DUTCH
-#define SUBLANG_DUTCH_BELGIUM SUBLANG_DUTCH_BELGIAN
-#define SUBLANG_ENGLISH_AUSTRALIA SUBLANG_ENGLISH_AUS
-#define SUBLANG_ENGLISH_CANADA SUBLANG_ENGLISH_CAN
-#define SUBLANG_ENGLISH_IRELAND SUBLANG_ENGLISH_EIRE
-#define SUBLANG_ENGLISH_NEW_ZEALAND SUBLANG_ENGLISH_NZ
-#define SUBLANG_ENGLISH_TRINIDAD_TOBAGO SUBLANG_ENGLISH_CARIBBEAN
-#define SUBLANG_ENGLISH_UNITED_KINGDOM SUBLANG_ENGLISH_UK
-#define SUBLANG_ENGLISH_UNITED_STATES SUBLANG_ENGLISH_US
-#define SUBLANG_FRENCH_BELGIUM SUBLANG_FRENCH_BELGIAN
-#define SUBLANG_FRENCH_CANADA SUBLANG_FRENCH_CANADIAN
-#define SUBLANG_FRENCH_SWITZERLAND SUBLANG_FRENCH_SWISS
-#define SUBLANG_GERMAN_AUSTRIA SUBLANG_GERMAN_AUSTRIAN
-#define SUBLANG_GERMAN_SWITZERLAND SUBLANG_GERMAN_SWISS
-#define SUBLANG_ITALIAN_SWITZERLAND SUBLANG_ITALIAN_SWISS
-#define SUBLANG_NORWEGIAN_BOKMAL_NORWAY SUBLANG_NORWEGIAN_BOKMAL
-#define SUBLANG_NORWEGIAN_NORWAY SUBLANG_NORWEGIAN_BOKMAL
-#define SUBLANG_NORWEGIAN_NYNORSK_NORWAY SUBLANG_NORWEGIAN_NYNORSK
-#define SUBLANG_PORTUGUESE_BRAZIL SUBLANG_PORTUGUESE_BRAZILIAN
-
-#endif
-
-#include "lctab.h"
-
static Lc_numeric_t default_numeric = { '.', -1 };
static Lc_t default_lc =
{
"C",
"POSIX",
- &language[0],
- &territory[0],
- &charset[0],
+ &lc_languages[0],
+ &lc_territories[0],
+ &lc_charsets[0],
0,
LC_default|LC_checked|LC_local,
0,
@@ -105,9 +66,9 @@ static Lc_t debug_lc =
{
"debug",
"debug",
- &language[1],
- &territory[1],
- &charset[0],
+ &lc_languages[1],
+ &lc_territories[1],
+ &lc_charsets[0],
0,
LC_debug|LC_checked|LC_local,
0,
@@ -184,7 +145,7 @@ lcindex(int category, int min)
Lc_category_t*
lccategories(void)
{
- return &categories[0];
+ return (Lc_category_t*)&lc_categories[0];
}
/*
@@ -333,7 +294,7 @@ canonical(const Lc_language_t* lp, const Lc_territory_t* tp, const Lc_charset_t*
}
if (s < e)
{
- if (tp && tp != &territory[0] && (!(flags & (LC_abbreviated|LC_default)) || !lp || !streq(lp->code, tp->code)))
+ if (tp && tp != &lc_territories[0] && (!(flags & (LC_abbreviated|LC_default)) || !lp || !streq(lp->code, tp->code)))
{
if (lp)
*s++ = '_';
@@ -452,7 +413,7 @@ lcmake(const char* name)
for (lc = lcs; lc; lc = lc->next)
if (!strcasecmp(t, lc->code) || !strcasecmp(t, lc->name))
return lc;
- for (mp = map; mp->code; mp++)
+ for (mp = lc_maps; mp->code; mp++)
if (streq(t, mp->code))
{
lp = mp->language;
@@ -553,15 +514,15 @@ lcmake(const char* name)
n = strlen(s = language_name);
if (n == 2)
- for (lp = language; lp->code && !streq(s, lp->code); lp++);
+ for (lp = lc_languages; lp->code && !streq(s, lp->code); lp++);
else if (n == 3)
{
- for (lp = language; lp->code && (!lp->alternates || !match(s, lp->alternates, n, 0)); lp++);
+ for (lp = lc_languages; lp->code && (!lp->alternates || !match(s, lp->alternates, n, 0)); lp++);
if (!lp->code)
{
c = s[2];
s[2] = 0;
- for (lp = language; lp->code && !streq(s, lp->code); lp++);
+ for (lp = lc_languages; lp->code && !streq(s, lp->code); lp++);
s[2] = c;
if (lp->code)
n = 1;
@@ -571,18 +532,18 @@ lcmake(const char* name)
lp = 0;
if (!lp || !lp->code)
{
- for (lp = language; lp->code && !match(s, lp->name, 0, 0); lp++);
+ for (lp = lc_languages; lp->code && !match(s, lp->name, 0, 0); lp++);
if (!lp || !lp->code)
{
if (!territory_name)
{
if (n == 2)
- for (tp = territory; tp->code && !streq(s, tp->code); tp++);
+ for (tp = lc_territories; tp->code && !streq(s, tp->code); tp++);
else
{
z = 0;
tpb = 0;
- for (tp = territory; tp->name; tp++)
+ for (tp = lc_territories; tp->name; tp++)
if ((i = match(s, tp->name, 3, 0)) > z)
{
tpb = tp;
@@ -609,8 +570,8 @@ lcmake(const char* name)
return 0;
name = ((Lc_language_t*)lp)->code = ((Lc_language_t*)lp)->name = (const char*)(lp + 1);
memcpy((char*)lp->code, s, z - 1);
- tp = &territory[0];
- cp = ((Lc_language_t*)lp)->charset = &charset[0];
+ tp = &lc_territories[0];
+ cp = ((Lc_language_t*)lp)->charset = &lc_charsets[0];
al = 0;
goto override;
}
@@ -627,7 +588,7 @@ lcmake(const char* name)
{
n = 0;
primary = 0;
- for (tp = territory; tp->code; tp++)
+ for (tp = lc_territories; tp->code; tp++)
if (tp->languages[0] == lp)
{
if (tp->flags & LC_primary)
@@ -648,7 +609,7 @@ lcmake(const char* name)
n = strlen(s);
if (n == 2)
{
- for (tp = territory; tp->code; tp++)
+ for (tp = lc_territories; tp->code; tp++)
if (streq(s, tp->code))
{
for (i = 0; i < elementsof(tp->languages) && lp != tp->languages[i]; i++);
@@ -659,7 +620,7 @@ lcmake(const char* name)
}
else
{
- for (tp = territory; tp->code; tp++)
+ for (tp = lc_territories; tp->code; tp++)
if (match(s, tp->name, 3, 0))
{
for (i = 0; i < elementsof(tp->languages) && lp != tp->languages[i]; i++);
@@ -684,7 +645,7 @@ lcmake(const char* name)
c = *s;
*s = 0;
if (!(cp = lp->charset) || !match_charset(w, cp))
- for (cp = charset; cp->code; cp++)
+ for (cp = lc_charsets; cp->code; cp++)
if (match_charset(w, cp))
{
ppa = cp;
@@ -721,7 +682,7 @@ lcmake(const char* name)
*/
if (s = charset_name)
- for (cp = charset; cp->code; cp++)
+ for (cp = lc_charsets; cp->code; cp++)
if (match_charset(s, cp))
break;
if (!cp || !cp->code)
@@ -739,9 +700,9 @@ lcmake(const char* name)
return 0;
strcpy((char*)(lc->name = (const char*)(lc + 1)), name);
strcpy((char*)(lc->code = lc->name + n), s);
- lc->language = lp ? lp : &language[0];
- lc->territory = tp ? tp : &territory[0];
- lc->charset = cp ? cp : &charset[0];
+ lc->language = lp ? lp : &lc_languages[0];
+ lc->territory = tp ? tp : &lc_territories[0];
+ lc->charset = cp ? cp : &lc_charsets[0];
lc->attributes = al;
for (i = 0; i < elementsof(lc->info); i++)
lc->info[i].lc = lc;
@@ -796,22 +757,22 @@ lcscan(Lc_t* lc)
{
if (++ls->language >= elementsof(ls->lc.territory->languages) || !(ls->lc.language = ls->lc.territory->languages[ls->language]))
{
- if (++ls->territory >= (elementsof(territory) - 1))
+ if (!lc_territories[++ls->territory].code)
{
free(ls);
return 0;
}
- ls->lc.territory = &territory[ls->territory];
+ ls->lc.territory = &lc_territories[ls->territory];
ls->lc.language = ls->lc.territory->languages[ls->language = 0];
}
if (ls->lc.language)
{
- ls->lc.charset = ls->lc.language->charset ? ls->lc.language->charset : &charset[0];
+ ls->lc.charset = ls->lc.language->charset ? ls->lc.language->charset : &lc_charsets[0];
ls->list.attribute = ls->lc.language->attributes[ls->attribute = 0];
}
else
{
- ls->lc.charset = &charset[0];
+ ls->lc.charset = &lc_charsets[0];
ls->list.attribute = 0;
}
}
diff --git a/usr/src/lib/libast/common/port/lcgen.c b/usr/src/lib/libast/common/port/lcgen.c
index bfc8656406..1272faa5cd 100644
--- a/usr/src/lib/libast/common/port/lcgen.c
+++ b/usr/src/lib/libast/common/port/lcgen.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -294,7 +294,7 @@ char** argv;
line = 0;
if (!(hdr = *argv++) || !(lib = *argv++) || *argv)
{
- fprintf(stderr, "%s: hdr and lib arguments expected\n", command);
+ fprintf(stderr, "%s: { hdr lib tab } arguments expected\n", command);
return 1;
}
if (!(hf = fopen(hdr, "w")))
@@ -333,6 +333,10 @@ char** argv;
fprintf(hf, "#define LC_verbose\t\t0x00200\n");
fprintf(hf, "#define LC_user\t\t\t0x10000\n");
fprintf(lf, "/* : : generated by %s : : */\n", command);
+ fprintf(lf, "\n");
+ fprintf(lf, "#include \"lclib.h\"\n");
+ fprintf(lf, "#include \"lclang.h\"\n");
+ fprintf(lf, "\n");
while (s = fgets(buf, sizeof(buf), stdin))
{
line++;
@@ -501,7 +505,7 @@ char** argv;
if (s = copy(&b, arg[4]))
{
i = 0;
- fprintf(lf, "\nstatic Lc_attribute_t attribute_%s[] =\n{\n", lp->link.code);
+ fprintf(lf, "\nconst Lc_attribute_t attribute_%s[] =\n{\n", lp->link.code);
while (*(b = s))
{
for (f = 0; *s && *s != '|'; s++)
@@ -686,7 +690,7 @@ char** argv;
fprintf(hf, "extern Lc_t*\t\tlcscan(Lc_t*);\n");
fprintf(hf, "\n");
fprintf(hf, "#undef\textern\n");
- fprintf(lf, "\nstatic const Lc_charset_t charset[] =\n{\n");
+ fprintf(lf, "\nconst Lc_charset_t lc_charsets[] =\n{\n");
for (cp = (Charset_t*)state.charset.root; cp; cp = (Charset_t*)cp->link.next)
{
fprintf(lf, "{\"%s\",", cp->link.code);
@@ -701,12 +705,12 @@ char** argv;
fprintf(lf, "},\n");
}
fprintf(lf, "\t0\n};\n");
- fprintf(lf, "\nstatic const Lc_language_t language[] =\n{\n");
- fprintf(lf, "{\"C\",\"C\",\"POSIX\",&charset[0],LC_default,0,");
+ fprintf(lf, "\nconst Lc_language_t lc_languages[] =\n{\n");
+ fprintf(lf, "{\"C\",\"C\",\"POSIX\",&lc_charsets[0],LC_default,0,");
for (i = 0; i < language_attribute_max; i++)
fprintf(lf, "0,");
fprintf(lf, "},\n");
- fprintf(lf, "{\"debug\",\"debug\",0,&charset[0],LC_debug,0,");
+ fprintf(lf, "{\"debug\",\"debug\",0,&lc_charsets[0],LC_debug,0,");
for (i = 0; i < language_attribute_max; i++)
fprintf(lf, "0,");
fprintf(lf, "},\n");
@@ -717,7 +721,7 @@ char** argv;
fprintf(lf, "\"%s\",", lp->alternates);
else
fprintf(lf, "0,");
- fprintf(lf, "&charset[%d],0,", lp->charset ? lp->charset->link.index : 0);
+ fprintf(lf, "&lc_charsets[%d],0,", lp->charset ? lp->charset->link.index : 0);
macro(lf, "LANG", lp->name, (char*)0);
for (i = 0, al = lp->attributes; al; al = al->next, i++)
fprintf(lf, "&attribute_%s[%d],", lp->link.code, al->attribute->link.index);
@@ -726,12 +730,12 @@ char** argv;
fprintf(lf, "\n},\n");
}
fprintf(lf, "\t0\n};\n");
- fprintf(lf, "\nstatic const Lc_territory_t territory[] =\n{\n");
- fprintf(lf, "{\"C\",\"C\",LC_default,0,&language[0],");
+ fprintf(lf, "\nconst Lc_territory_t lc_territories[] =\n{\n");
+ fprintf(lf, "{\"C\",\"C\",LC_default,0,&lc_languages[0],");
for (i = 1; i < 2 * territory_language_max; i++)
fprintf(lf, "0,");
fprintf(lf, "},\n");
- fprintf(lf, "{\"debug\",\"debug\",LC_debug,0,&language[1],");
+ fprintf(lf, "{\"debug\",\"debug\",LC_debug,0,&lc_languages[1],");
for (i = 1; i < 2 * territory_language_max; i++)
fprintf(lf, "0,");
fprintf(lf, "},\n");
@@ -744,7 +748,7 @@ char** argv;
fprintf(lf, "0,");
macro(lf, "CTRY", tp->name, (char*)0);
for (i = 0, ll = tp->languages; ll; ll = ll->next, i++)
- fprintf(lf, "&language[%d],", ll->language->link.index);
+ fprintf(lf, "&lc_languages[%d],", ll->language->link.index);
for (; i < territory_language_max; i++)
fprintf(lf, "0,");
for (i = 0, ll = tp->languages; ll; ll = ll->next, i++)
@@ -754,13 +758,13 @@ char** argv;
fprintf(lf, "\n},\n");
}
fprintf(lf, "\t0\n};\n");
- fprintf(lf, "\nstatic const Lc_map_t map[] =\n{\n");
+ fprintf(lf, "\nconst Lc_map_t lc_maps[] =\n{\n");
for (mp = (Map_t*)state.map.root; mp; mp = (Map_t*)mp->link.next)
{
fprintf(lf, "{\"%s\",", mp->link.code);
- fprintf(lf, "&language[%d],", mp->language->link.index);
- fprintf(lf, "&territory[%d],", mp->territory->link.index);
- fprintf(lf, "&charset[%d],", mp->charset ? mp->charset->link.index : 0);
+ fprintf(lf, "&lc_languages[%d],", mp->language->link.index);
+ fprintf(lf, "&lc_territories[%d],", mp->territory->link.index);
+ fprintf(lf, "&lc_charsets[%d],", mp->charset ? mp->charset->link.index : 0);
if (mp->attribute)
fprintf(lf, "&attribute_%s[%d]", mp->language->link.code, mp->attribute->link.index);
else
diff --git a/usr/src/lib/libast/common/port/lclang.h b/usr/src/lib/libast/common/port/lclang.h
new file mode 100644
index 0000000000..0e0d1242f8
--- /dev/null
+++ b/usr/src/lib/libast/common/port/lclang.h
@@ -0,0 +1,62 @@
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* David Korn <dgk@research.att.com> *
+* Phong Vo <kpv@research.att.com> *
+* *
+***********************************************************************/
+/*
+ * lc (sub)lang definitions -- very windowsish
+ */
+
+#if _WINIX
+
+#include <ast_windows.h>
+
+#define LANG_CHINESE_SIMPLIFIED LANG_CHINESE
+#define LANG_CHINESE_TRADITIONAL LANG_CHINESE
+#define LANG_NORWEGIAN_BOKMAL LANG_NORWEGIAN
+#define LANG_NORWEGIAN_NYNORSK LANG_NORWEGIAN
+#define LANG_SERBO_CROATIAN LANG_CROATIAN
+
+#define CTRY_CZECH_REPUBLIC CTRY_CZECH
+
+#define SUBLANG_CHINESE_SIMPLIFIED_CHINA SUBLANG_CHINESE_SIMPLIFIED
+#define SUBLANG_CHINESE_SIMPLIFIED_HONG_KONG SUBLANG_CHINESE_HONGKONG
+#define SUBLANG_CHINESE_SIMPLIFIED_SINGAPORE SUBLANG_CHINESE_SINGAPORE
+#define SUBLANG_CHINESE_TRADITIONAL_TAIWAN SUBLANG_CHINESE_TRADITIONAL
+#define SUBLANG_DUTCH_NETHERLANDS_ANTILLES SUBLANG_DUTCH
+#define SUBLANG_DUTCH_BELGIUM SUBLANG_DUTCH_BELGIAN
+#define SUBLANG_ENGLISH_AUSTRALIA SUBLANG_ENGLISH_AUS
+#define SUBLANG_ENGLISH_CANADA SUBLANG_ENGLISH_CAN
+#define SUBLANG_ENGLISH_IRELAND SUBLANG_ENGLISH_EIRE
+#define SUBLANG_ENGLISH_NEW_ZEALAND SUBLANG_ENGLISH_NZ
+#define SUBLANG_ENGLISH_TRINIDAD_TOBAGO SUBLANG_ENGLISH_CARIBBEAN
+#define SUBLANG_ENGLISH_UNITED_KINGDOM SUBLANG_ENGLISH_UK
+#define SUBLANG_ENGLISH_UNITED_STATES SUBLANG_ENGLISH_US
+#define SUBLANG_FRENCH_BELGIUM SUBLANG_FRENCH_BELGIAN
+#define SUBLANG_FRENCH_CANADA SUBLANG_FRENCH_CANADIAN
+#define SUBLANG_FRENCH_SWITZERLAND SUBLANG_FRENCH_SWISS
+#define SUBLANG_GERMAN_AUSTRIA SUBLANG_GERMAN_AUSTRIAN
+#define SUBLANG_GERMAN_SWITZERLAND SUBLANG_GERMAN_SWISS
+#define SUBLANG_ITALIAN_SWITZERLAND SUBLANG_ITALIAN_SWISS
+#define SUBLANG_NORWEGIAN_BOKMAL_NORWAY SUBLANG_NORWEGIAN_BOKMAL
+#define SUBLANG_NORWEGIAN_NORWAY SUBLANG_NORWEGIAN_BOKMAL
+#define SUBLANG_NORWEGIAN_NYNORSK_NORWAY SUBLANG_NORWEGIAN_NYNORSK
+#define SUBLANG_PORTUGUESE_BRAZIL SUBLANG_PORTUGUESE_BRAZILIAN
+
+#endif
diff --git a/usr/src/lib/libast/common/port/lclib.h b/usr/src/lib/libast/common/port/lclib.h
index 898bbe27a4..ae648a5168 100644
--- a/usr/src/lib/libast/common/port/lclib.h
+++ b/usr/src/lib/libast/common/port/lclib.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -28,10 +28,15 @@
#ifndef _LCLIB_H
#define _LCLIB_H 1
-#define categories _ast_categories
#define locales _ast_locales
#define translate _ast_translate
+#define lc_categories _ast_lc_categories
+#define lc_charsets _ast_lc_charsets
+#define lc_languages _ast_lc_languages
+#define lc_maps _ast_lc_maps
+#define lc_territories _ast_lc_territories
+
struct Lc_info_s;
#define _LC_PRIVATE_ \
@@ -53,9 +58,14 @@ typedef struct Lc_numeric_s
#define LCINFO(c) (&locales[c]->info[c])
-extern Lc_category_t categories[];
-extern Lc_t* locales[];
+extern const Lc_charset_t lc_charsets[];
+extern const Lc_language_t lc_languages[];
+extern const Lc_map_t lc_maps[];
+extern const Lc_territory_t lc_territories[];
+
+extern Lc_category_t lc_categories[];
+extern Lc_t* locales[];
-extern char* translate(const char*, const char*, const char*, const char*);
+extern char* translate(const char*, const char*, const char*, const char*);
#endif
diff --git a/usr/src/lib/libast/common/port/mc.c b/usr/src/lib/libast/common/port/mc.c
index 8945841ae9..6b016578e8 100644
--- a/usr/src/lib/libast/common/port/mc.c
+++ b/usr/src/lib/libast/common/port/mc.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -154,7 +154,7 @@ mcfind(char* path, const char* locale, const char* catalog, int category, int nl
case_C:
if (!catalog)
last = 1;
- v = categories[category].name;
+ v = lc_categories[category].name;
break;
default:
*s++ = c;
diff --git a/usr/src/lib/libast/common/port/mnt.c b/usr/src/lib/libast/common/port/mnt.c
index fb8c6332fa..d7531b028c 100644
--- a/usr/src/lib/libast/common/port/mnt.c
+++ b/usr/src/lib/libast/common/port/mnt.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/port/touch.c b/usr/src/lib/libast/common/port/touch.c
index 89403c80cb..85e85009f6 100644
--- a/usr/src/lib/libast/common/port/touch.c
+++ b/usr/src/lib/libast/common/port/touch.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/preroot/getpreroot.c b/usr/src/lib/libast/common/preroot/getpreroot.c
index a35915d52d..c8d82de894 100644
--- a/usr/src/lib/libast/common/preroot/getpreroot.c
+++ b/usr/src/lib/libast/common/preroot/getpreroot.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/preroot/ispreroot.c b/usr/src/lib/libast/common/preroot/ispreroot.c
index 540c42df50..7a99a1ab2f 100644
--- a/usr/src/lib/libast/common/preroot/ispreroot.c
+++ b/usr/src/lib/libast/common/preroot/ispreroot.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/preroot/realopen.c b/usr/src/lib/libast/common/preroot/realopen.c
index a13fb0ac22..67be26f329 100644
--- a/usr/src/lib/libast/common/preroot/realopen.c
+++ b/usr/src/lib/libast/common/preroot/realopen.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/preroot/setpreroot.c b/usr/src/lib/libast/common/preroot/setpreroot.c
index 5863d14d28..7ea63abe93 100644
--- a/usr/src/lib/libast/common/preroot/setpreroot.c
+++ b/usr/src/lib/libast/common/preroot/setpreroot.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/regex/regalloc.c b/usr/src/lib/libast/common/regex/regalloc.c
index 76d37de427..6df78772a2 100644
--- a/usr/src/lib/libast/common/regex/regalloc.c
+++ b/usr/src/lib/libast/common/regex/regalloc.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/regex/regcache.c b/usr/src/lib/libast/common/regex/regcache.c
index ff9554e904..e306bb0855 100644
--- a/usr/src/lib/libast/common/regex/regcache.c
+++ b/usr/src/lib/libast/common/regex/regcache.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -29,27 +29,36 @@
#include <ast.h>
#include <regex.h>
-#define CACHE 8 /* # cached re's */
+#define CACHE 8 /* default # cached re's */
#define MAXPAT 256 /* max pattern length + 1 */
#define KEEP 01
#define DROP 02
+typedef union Pattern_u
+{
+ unsigned long key;
+ char buf[MAXPAT];
+} Pattern_t;
+
typedef struct Cache_s
{
+ Pattern_t pattern;
regex_t re;
unsigned long serial;
regflags_t reflags;
int flags;
- char pattern[MAXPAT];
} Cache_t;
-static struct State_s
+typedef struct State_s
{
- Cache_t* cache[CACHE];
+ unsigned int size;
unsigned long serial;
char* locale;
-} matchstate;
+ Cache_t** cache;
+} State_t;
+
+static State_t matchstate;
/*
* flush the cache
@@ -60,7 +69,7 @@ flushcache(void)
{
register int i;
- for (i = 0; i < elementsof(matchstate.cache); i++)
+ for (i = matchstate.size; i--;)
if (matchstate.cache[i] && matchstate.cache[i]->flags)
{
matchstate.cache[i]->flags = 0;
@@ -81,18 +90,36 @@ regcache(const char* pattern, regflags_t reflags, int* status)
int empty;
int unused;
int old;
+ Pattern_t head;
/*
- * 0 pattern flushes the cache
+ * 0 pattern flushes the cache and reflags>0 extends cache
*/
if (!pattern)
{
flushcache();
+ i = 0;
+ if (reflags > matchstate.size)
+ {
+ if (matchstate.cache = newof(matchstate.cache, Cache_t*, reflags, 0))
+ matchstate.size = reflags;
+ else
+ {
+ matchstate.size = 0;
+ i = 1;
+ }
+ }
if (status)
- *status = 0;
+ *status = i;
return 0;
}
+ if (!matchstate.cache)
+ {
+ if (!(matchstate.cache = newof(0, Cache_t*, CACHE, 0)))
+ return 0;
+ matchstate.size = CACHE;
+ }
/*
* flush the cache if the locale changed
@@ -110,9 +137,13 @@ regcache(const char* pattern, regflags_t reflags, int* status)
* check if the pattern is in the cache
*/
+ for (i = 0; i < sizeof(unsigned long) && pattern[i]; i++)
+ head.buf[i] = pattern[i];
+ for (; i < sizeof(unsigned long); i++)
+ head.buf[i] = 0;
empty = unused = -1;
old = 0;
- for (i = 0; i < elementsof(matchstate.cache); i++)
+ for (i = matchstate.size; i--;)
if (!matchstate.cache[i])
empty = i;
else if (!(matchstate.cache[i]->flags & KEEP))
@@ -124,11 +155,11 @@ regcache(const char* pattern, regflags_t reflags, int* status)
}
unused = i;
}
- else if (streq(matchstate.cache[i]->pattern, pattern) && matchstate.cache[i]->reflags == reflags)
+ else if (matchstate.cache[i]->pattern.key == head.key && !strcmp(matchstate.cache[i]->pattern.buf, pattern) && matchstate.cache[i]->reflags == reflags)
break;
else if (!matchstate.cache[old] || matchstate.cache[old]->serial > matchstate.cache[i]->serial)
old = i;
- if (i >= elementsof(matchstate.cache))
+ if (i < 0)
{
if (unused < 0)
{
@@ -149,10 +180,12 @@ regcache(const char* pattern, regflags_t reflags, int* status)
regfree(&cp->re);
}
cp->reflags = reflags;
- if (strlen(pattern) < sizeof(cp->pattern))
+ if ((i = strlen(pattern)) < sizeof(cp->pattern.buf))
{
- strcpy(cp->pattern, pattern);
- pattern = (const char*)cp->pattern;
+ if (i < sizeof(unsigned long))
+ memset(cp->pattern.buf, 0, sizeof(unsigned long));
+ strcpy(cp->pattern.buf, pattern);
+ pattern = (const char*)cp->pattern.buf;
cp->flags = KEEP;
}
else
diff --git a/usr/src/lib/libast/common/regex/regclass.c b/usr/src/lib/libast/common/regex/regclass.c
index 85eac41f55..2a4ada89ae 100644
--- a/usr/src/lib/libast/common/regex/regclass.c
+++ b/usr/src/lib/libast/common/regex/regclass.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/regex/regcoll.c b/usr/src/lib/libast/common/regex/regcoll.c
index 29bb85ffc0..6294becacd 100644
--- a/usr/src/lib/libast/common/regex/regcoll.c
+++ b/usr/src/lib/libast/common/regex/regcoll.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -244,6 +244,7 @@ regcollate(register const char* s, char** e, char* buf, int size)
for (a = z; a; a = a->next)
if ((attr[0] & a->attr[0]) == attr[0] && (attr[1] & a->attr[1]) == attr[1] && (attr[2] & a->attr[2]) == attr[2])
{
+#if 0
if (a->code <= 0xff)
{
#if CC_NATIVE != CC_ASCII
@@ -255,13 +256,11 @@ regcollate(register const char* s, char** e, char* buf, int size)
ul = 0;
break;
}
+#endif
w[0] = a->code;
w[1] = 0;
if ((r = wcstombs(buf, w, size)) > 0)
- {
- r--;
ul = 0;
- }
break;
}
if (!ul)
@@ -272,10 +271,18 @@ regcollate(register const char* s, char** e, char* buf, int size)
}
if (r < 0)
{
- if ((r = s - t - 2) > (size - 1))
+ if ((n = s - t - 2) > (size - 1))
return -1;
- memcpy(buf, t, r);
- buf[r] = 0;
+ memcpy(buf, t, n);
+ buf[n] = 0;
+ if (n == 1)
+ r = n;
+ else
+ {
+ for (t = buf; isalnum(*t); t++);
+ if (!*t)
+ r = n;
+ }
}
}
else if (*s++ != term || *s++ != ']')
diff --git a/usr/src/lib/libast/common/regex/regcomp.c b/usr/src/lib/libast/common/regex/regcomp.c
index dc34df68fa..9b6dbf8f98 100644
--- a/usr/src/lib/libast/common/regex/regcomp.c
+++ b/usr/src/lib/libast/common/regex/regcomp.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -586,16 +586,19 @@ stats(register Cenv_t* env, register Rex_t* e)
}
break;
case REX_STRING:
- cm = env->stats.m;
- if ((env->stats.m += e->re.string.size) < cm)
- return 1;
- cn = env->stats.n;
- if ((env->stats.n += e->re.string.size) < cn)
- return 1;
- if (!env->stats.x || env->stats.x->re.string.size < e->re.string.size)
+ if (!e->map)
{
- env->stats.x = e;
- env->stats.l = cm;
+ cm = env->stats.m;
+ if ((env->stats.m += e->re.string.size) < cm)
+ return 1;
+ cn = env->stats.n;
+ if ((env->stats.n += e->re.string.size) < cn)
+ return 1;
+ if (!env->stats.x || env->stats.x->re.string.size < e->re.string.size)
+ {
+ env->stats.x = e;
+ env->stats.l = cm;
+ }
}
break;
case REX_TRIE:
@@ -654,8 +657,11 @@ magic(register Cenv_t* env, register int c, int escaped)
}
if (sp == ep)
{
- env->error = *sp ? REG_BADBR : REG_EBRACE;
- goto bad;
+ if (env->type < SRE || *sp != ',')
+ {
+ env->error = *sp ? REG_BADBR : REG_EBRACE;
+ goto bad;
+ }
}
else if (n > RE_DUP_MAX)
{
@@ -1011,7 +1017,7 @@ token(register Cenv_t* env)
static Celt_t*
col(Celt_t* ce, int ic, unsigned char* bp, int bw, int bc, unsigned char* ep, int ew, int ec)
{
- register unsigned char* s;
+ register char* s;
register unsigned char* k;
register unsigned char* e;
register int c;
@@ -1029,41 +1035,43 @@ col(Celt_t* ce, int ic, unsigned char* bp, int bw, int bc, unsigned char* ep, in
c = bc;
if (ic)
{
- if (iswupper(c))
+ if (isupper(c))
{
- c = towlower(c);
- cc = 1;
+ c = tolower(c);
+ cc = -1;
}
- else if (iswlower(c))
+ else if (islower(c))
{
- c = towupper(c);
- cc = 1;
+ c = toupper(c);
+ cc = -1;
}
}
*k++ = c;
}
else if (bw < COLL_KEY_MAX)
{
- s = bp;
- e = s + bw;
- while (s < e)
+ s = (char*)bp;
+ if (ic)
{
- c = *s++;
- if (ic)
+ c = mbchar(s);
+ if (iswupper(c))
{
- if (isupper(c))
- {
- c = tolower(c);
- cc = 1;
- }
- else if (islower(c))
- {
- c = toupper(c);
- cc = 1;
- }
+ c = towlower(c);
+ cc = 1;
}
- *k++ = c;
+ else if (iswlower(c))
+ {
+ c = towupper(c);
+ cc = 1;
+ }
+ }
+ if (cc > 0)
+ {
+ cc = -1;
+ k += wctomb((char*)k, c);
}
+ else
+ for (e = k + bw; k < e; *k++ = *s++);
}
*k = 0;
mbxfrm(ce->beg, key, COLL_KEY_MAX);
@@ -1083,41 +1091,43 @@ col(Celt_t* ce, int ic, unsigned char* bp, int bw, int bc, unsigned char* ep, in
c = ec;
if (ic)
{
- if (iswupper(c))
+ if (isupper(c))
{
- c = towlower(c);
- cc = 1;
+ c = tolower(c);
+ cc = -1;
}
- else if (iswlower(c))
+ else if (islower(c))
{
- c = towupper(c);
- cc = 1;
+ c = toupper(c);
+ cc = -1;
}
}
*k++ = c;
}
else if (ew < COLL_KEY_MAX)
{
- s = ep;
- e = s + ew;
- while (s < e)
+ s = (char*)ep;
+ if (ic)
{
- c = *s++;
- if (ic)
+ c = mbchar(s);
+ if (iswupper(c))
{
- if (isupper(c))
- {
- c = tolower(c);
- cc = 1;
- }
- else if (islower(c))
- {
- c = toupper(c);
- cc = 1;
- }
+ c = towlower(c);
+ cc = 1;
+ }
+ else if (iswlower(c))
+ {
+ c = towupper(c);
+ cc = 1;
}
- *k++ = c;
}
+ if (cc > 0)
+ {
+ cc = -1;
+ k += wctomb((char*)k, c);
+ }
+ else
+ for (e = k + ew; k < e; *k++ = *s++);
}
*k = 0;
mbxfrm(ce->end, key, COLL_KEY_MAX);
@@ -1168,8 +1178,6 @@ bra(Cenv_t* env)
if (!(e = node(env, REX_CLASS, 1, 1, sizeof(Set_t))))
return 0;
collate = complicated = elements = 0;
- first = env->cursor;
- start = first + MBSIZE(first);
if (*env->cursor == '^' || env->type >= SRE && *env->cursor == '!')
{
env->cursor++;
@@ -1177,6 +1185,8 @@ bra(Cenv_t* env)
}
else
neg = 0;
+ first = env->cursor;
+ start = first + MBSIZE(first);
if (*env->cursor == 0 || *(env->cursor + 1) == 0 || *env->cursor == env->terminator || *(env->cursor + 1) == env->terminator || (env->flags & REG_ESCAPE) && (*env->cursor == env->delimiter || *env->cursor != '\\' && *(env->cursor + 1) == env->delimiter))
goto error;
begin = env->cursor + MBSIZE(env->cursor);
@@ -1393,11 +1403,13 @@ bra(Cenv_t* env)
Cchr_t* xc;
Celt_t* ce;
Cchr_t key;
- int cw;
int rw;
int rc;
+ int wc;
unsigned char* rp;
unsigned char* pp;
+ char* wp;
+ char cb[2][COLL_KEY_MAX+1];
static Dtdisc_t disc;
@@ -1432,7 +1444,7 @@ bra(Cenv_t* env)
drop(env->disc, e);
if (ic = env->flags & REG_ICASE)
elements *= 2;
- if (!(e = node(env, REX_COLL_CLASS, 1, 1, (elements + 1) * sizeof(Celt_t))))
+ if (!(e = node(env, REX_COLL_CLASS, 1, 1, (elements + 2) * sizeof(Celt_t))))
return 0;
ce = (Celt_t*)e->re.data;
e->re.collate.invert = neg;
@@ -1561,52 +1573,36 @@ bra(Cenv_t* env)
goto erange;
if (inrange == 1)
ce = col(ce, ic, rp, rw, rc, NiL, 0, 0);
+ pp = (unsigned char*)cb[inrange];
rp = env->cursor + 1;
- if ((rw = regcollate((char*)env->cursor, (char**)&env->cursor, (char*)buf, sizeof(buf) - 1)) < 0)
+ if ((rw = regcollate((char*)env->cursor, (char**)&env->cursor, (char*)pp, COLL_KEY_MAX)) < 0)
goto ecollate;
+ wp = (char*)pp;
+ wc = mbchar(wp);
c = 0;
if (ic)
- for (i = 0; i < rw; i += MBSIZE(buf+i))
- if (isupper(buf[i]))
- {
- buf[i] = tolower(buf[i]);
- c = 1;
- }
- else if (islower(buf[i]))
- c = 1;
- for (;;)
{
- mbxfrm(key.key, buf, COLL_KEY_MAX);
- if (!(cc = (Cchr_t*)dtsearch(dt, &key)))
+ if (iswupper(wc))
{
- if (!isalnum(buf[0]))
- {
- strcpy((char*)ce->beg, (char*)key.key);
- ce->typ = COLL_char;
- ce++;
- break;
- }
- if (!(cc = (Cchr_t*)dtprev(dt, &key)))
- goto ecollate;
+ wc = towlower(wc);
+ rw = wctomb((char*)pp, wc);
+ c = 'u';
}
- xc = cc;
- if (islower(buf[0]))
- {
+ else if (iswlower(wc))
+ c = 'l';
+ }
+ for (;;)
+ {
+ mbxfrm(key.key, (char*)pp, COLL_KEY_MAX);
+ if (!(cc = (Cchr_t*)dtsearch(dt, &key)) && !(cc = (Cchr_t*)dtprev(dt, &key)))
+ goto ecollate;
+ xc = (tc = (Cchr_t*)dtprev(dt, cc)) && !strcasecmp((char*)tc->nam, (char*)cc->nam) ? tc : cc;
+ if (c == 'l' || c == 'L' && !(c = 0))
ce->typ = COLL_range_lc;
- if ((tc = (Cchr_t*)dtprev(dt, cc)) && !strcasecmp((char*)tc->nam, (char*)cc->nam))
- xc = tc;
- }
- else if (isupper(buf[0]))
- {
+ else if (c == 'u' || c == 'U' && !(c = 0))
ce->typ = COLL_range_uc;
- if ((tc = (Cchr_t*)dtprev(dt, cc)) && !strcasecmp((char*)tc->nam, (char*)cc->nam))
- xc = tc;
- }
else
- {
ce->typ = COLL_range;
- xc = cc;
- }
strcpy((char*)ce->beg, (char*)xc->key);
if (!(cc = (Cchr_t*)dtnext(dt, cc)))
goto ecollate;
@@ -1617,31 +1613,25 @@ bra(Cenv_t* env)
ce++;
if (!c)
break;
- c = 0;
- for (i = 0; i < rw; i++)
- if (islower(buf[i]))
- buf[i] = toupper(buf[i]);
+ if (c == 'u')
+ {
+ wc = towlower(wc);
+ c = 'L';
+ }
+ else
+ {
+ wc = towupper(wc);
+ c = 'U';
+ }
+ rw = wctomb((char*)pp, wc);
}
inrange = 0;
- c = buf[0];
+ c = *pp;
continue;
case '.':
- pp = env->cursor + 1;
- if ((w = regcollate((char*)env->cursor, (char**)&env->cursor, (char*)buf, sizeof(buf) - 1)) < 0)
+ pp = (unsigned char*)cb[inrange];
+ if ((w = regcollate((char*)env->cursor, (char**)&env->cursor, (char*)pp, COLL_KEY_MAX)) < 0)
goto ecollate;
- if (w > 1)
- {
- if (w > COLL_KEY_MAX)
- goto ecollate;
- if (ic)
- for (i = 0; i < w; i += MBSIZE(buf+i))
- if (isupper(buf[i]))
- buf[i] = tolower(buf[i]);
- cw = mbxfrm(ce->beg, buf, COLL_KEY_MAX);
- buf[1] = 0;
- if (mbxfrm(ce->beg, buf, COLL_KEY_MAX) < cw)
- goto ecollate;
- }
c = buf[0];
break;
default:
@@ -1741,8 +1731,8 @@ ccl(Cenv_t* env, int type)
ce = (Celt_t*)e->re.data;
e->re.collate.invert = 0;
e->re.collate.elements = ce;
- ce->typ = COLL_call;
ce->fun = f;
+ ce->typ = COLL_call;
ce++;
ce->typ = COLL_end;
}
@@ -2039,9 +2029,11 @@ grp(Cenv_t* env, int parno)
case 'G':
case 'I':
case 'K':
- case 'M':
- case 'N':
- case 'R':
+ case 'L':
+ case 'M': /* glob(3) */
+ case 'N': /* glob(3) */
+ case 'O': /* glob(3) */
+ case 'R': /* pcre */
case 'S':
case 'U': /* pcre */
case 'X': /* pcre */
@@ -2052,6 +2044,13 @@ grp(Cenv_t* env, int parno)
{
switch (c)
{
+ case ')':
+ if (!(env->flags & REG_LITERAL))
+ {
+ env->error = REG_BADRPT;
+ return 0;
+ }
+ /*FALLTHROUGH*/
case 0:
case T_CLOSE:
x = 0;
@@ -2155,7 +2154,7 @@ grp(Cenv_t* env, int parno)
case 'N':
/* used by caller to disable glob(3) GLOB_NOCHECK */
break;
- case 'R':
+ case 'O':
/* used by caller to disable glob(3) GLOB_STARSTAR */
break;
case 'S':
@@ -2455,7 +2454,7 @@ grp(Cenv_t* env, int parno)
return 0;
c = token(env);
env->parnest--;
- if (c != T_CLOSE)
+ if (c != T_CLOSE && (!(env->flags & REG_LITERAL) || c != ')'))
{
env->error = REG_EPAREN;
return 0;
@@ -2528,22 +2527,22 @@ seq(Cenv_t* env)
n = 1;
*s++ = (env->flags & REG_ICASE) ? toupper(c) : c;
}
- else if (c == C_ESC)
+ else if (c == C_ESC || (env->flags & REG_ICASE))
{
- if ((n = wctomb(NiL, env->token.lex)) < 0)
- continue;
- if (!n)
+ c = (c == C_ESC) ? env->token.lex : mbchar(p);
+ if (env->flags & REG_ICASE)
+ c = towupper(c);
+ if ((&buf[sizeof(buf)] - s) < MB_CUR_MAX)
+ break;
+ if ((n = wctomb((char*)s, c)) < 0)
+ *s++ = c;
+ else if (n)
+ s += n;
+ else
{
n = 1;
*s++ = 0;
}
- else if (s < &buf[sizeof(buf) - n])
- {
- wctomb((char*)s, c);
- s += n;
- }
- else
- break;
}
else
{
@@ -2583,10 +2582,10 @@ seq(Cenv_t* env)
}
else
{
- if (!(e = node(env, REX_STRING, 0, 0, n)))
+ if (!(f = node(env, REX_STRING, 0, 0, n)))
return 0;
- memcpy((char*)(e->re.string.base = (unsigned char*)e->re.data), (char*)p, n);
- e->re.string.size = n;
+ memcpy((char*)(f->re.string.base = (unsigned char*)f->re.data), (char*)p, n);
+ f->re.string.size = n;
}
if (!(f = rep(env, f, 0, 0)) || !(f = cat(env, f, seq(env))))
{
@@ -2954,7 +2953,7 @@ special(Cenv_t* env, regex_t* p)
else
x = 0;
}
- if ((x || t) && !env->map) /* HERE: figure out map */
+ if (x || t)
{
Bm_mask_t** mask;
Bm_mask_t* h;
@@ -3112,7 +3111,7 @@ special(Cenv_t* env, regex_t* p)
env->error = REG_ENULL;
return 1;
case REX_STRING:
- if (env->flags & (REG_LEFT|REG_LITERAL|REG_RIGHT))
+ if ((env->flags & (REG_LEFT|REG_LITERAL|REG_RIGHT)) || e->map)
return 0;
s = e->re.string.base;
n = e->re.string.size;
diff --git a/usr/src/lib/libast/common/regex/regdecomp.c b/usr/src/lib/libast/common/regex/regdecomp.c
index 8f5a2af04e..7f400a81ce 100644
--- a/usr/src/lib/libast/common/regex/regdecomp.c
+++ b/usr/src/lib/libast/common/regex/regdecomp.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -75,7 +75,6 @@ decomp(register Rex_t* e, Sfio_t* sp, int type, int delimiter, regflags_t flags)
unsigned char* s;
unsigned char* t;
int c;
- int d;
int cb;
int cd;
int cr;
diff --git a/usr/src/lib/libast/common/regex/regerror.c b/usr/src/lib/libast/common/regex/regerror.c
index e58d6701dc..477f007da1 100644
--- a/usr/src/lib/libast/common/regex/regerror.c
+++ b/usr/src/lib/libast/common/regex/regerror.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -25,7 +25,7 @@
* posix regex error message handler
*/
-static const char id[] = "\n@(#)$Id: regex (AT&T Research) 2004-05-24 $\0\n";
+static const char id[] = "\n@(#)$Id: regex (AT&T Research) 2008-05-11 $\0\n";
#include "reglib.h"
diff --git a/usr/src/lib/libast/common/regex/regexec.c b/usr/src/lib/libast/common/regex/regexec.c
index 60acf41934..a5dca77586 100644
--- a/usr/src/lib/libast/common/regex/regexec.c
+++ b/usr/src/lib/libast/common/regex/regexec.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/regex/regfatal.c b/usr/src/lib/libast/common/regex/regfatal.c
index 4d0b94e27a..3da0162482 100644
--- a/usr/src/lib/libast/common/regex/regfatal.c
+++ b/usr/src/lib/libast/common/regex/regfatal.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/regex/reginit.c b/usr/src/lib/libast/common/regex/reginit.c
index e27fd10a70..fa027fac53 100644
--- a/usr/src/lib/libast/common/regex/reginit.c
+++ b/usr/src/lib/libast/common/regex/reginit.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -27,8 +27,18 @@
#include "reglib.h"
+#if _PACKAGE_ast
+
#include <ccode.h>
+#else
+
+#define CC_bel '\a'
+#define CC_esc '\033'
+#define CC_vt '\v'
+
+#endif
+
/*
* state shared by all threads
*/
diff --git a/usr/src/lib/libast/common/regex/reglib.h b/usr/src/lib/libast/common/regex/reglib.h
index e2a85fea2a..4260ba901e 100644
--- a/usr/src/lib/libast/common/regex/reglib.h
+++ b/usr/src/lib/libast/common/regex/reglib.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -72,7 +72,7 @@ typedef struct regsubop_s
#define RE_DUP_INF (RE_DUP_MAX+1) /* infinity, for * */
#define BACK_REF_MAX 9
-#define REG_COMP (REG_DELIMITED|REG_ESCAPE|REG_EXTENDED|REG_FIRST|REG_ICASE|REG_NOSUB|REG_NEWLINE|REG_SHELL|REG_AUGMENTED|REG_LEFT|REG_LITERAL|REG_MINIMAL|REG_NULL|REG_RIGHT|REG_LENIENT|REG_MUSTDELIM)
+#define REG_COMP (REG_DELIMITED|REG_ESCAPE|REG_EXTENDED|REG_FIRST|REG_ICASE|REG_NOSUB|REG_NEWLINE|REG_SHELL|REG_AUGMENTED|REG_LEFT|REG_LITERAL|REG_MINIMAL|REG_MULTIREF|REG_NULL|REG_RIGHT|REG_LENIENT|REG_MUSTDELIM)
#define REG_EXEC (REG_ADVANCE|REG_INVERT|REG_NOTBOL|REG_NOTEOL|REG_STARTEND)
#define REX_NULL 0 /* null string (internal) */
@@ -259,7 +259,7 @@ extern int _reg_iswblank(wint_t);
* collation element support
*/
-#define COLL_KEY_MAX 15
+#define COLL_KEY_MAX 32
#if COLL_KEY_MAX < MB_LEN_MAX
#undef COLL_KEY_MAX
diff --git a/usr/src/lib/libast/common/regex/regnexec.c b/usr/src/lib/libast/common/regex/regnexec.c
index 3406e33a0a..a265d0ffd1 100644
--- a/usr/src/lib/libast/common/regex/regnexec.c
+++ b/usr/src/lib/libast/common/regex/regnexec.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -302,38 +302,6 @@ pospush(Env_t* env, Rex_t* rex, unsigned char* p, int be)
* returns 1 if new is better, -1 if old, else 0.
*/
-#if _AST_REGEX_DEBUG
-
-static void
-showmatch(regmatch_t* p)
-{
- sfputc(sfstdout, '(');
- if (p->rm_so < 0)
- sfputc(sfstdout, '?');
- else
- sfprintf(sfstdout, "%d", p->rm_so);
- sfputc(sfstdout, ',');
- if (p->rm_eo < 0)
- sfputc(sfstdout, '?');
- else
- sfprintf(sfstdout, "%d", p->rm_eo);
- sfputc(sfstdout, ')');
-}
-
-static int
-better(Env_t* env, Pos_t* os, Pos_t* ns, Pos_t* oend, Pos_t* nend, int level)
-#define better _better
-{
- int i;
-
- DEBUG_CODE(0x0040,{sfprintf(sfstdout, "AHA better old ");for (i = 0; i <= env->nsub; i++)showmatch(&env->best[i]);sfprintf(sfstdout, "\n new ");for (i = 0; i <= env->nsub; i++)showmatch(&env->match[i]);sfprintf(sfstdout, "\n");},{0;});
- i = better(env, os, ns, oend, nend, 0);
- DEBUG_TEST(0x0040,(sfprintf(sfstdout, " %s\n", i <= 0 ? "OLD" : "NEW")),(0));
- return i;
-}
-
-#endif
-
static int
better(Env_t* env, Pos_t* os, Pos_t* ns, Pos_t* oend, Pos_t* nend, int level)
{
@@ -394,7 +362,38 @@ better(Env_t* env, Pos_t* os, Pos_t* ns, Pos_t* oend, Pos_t* nend, int level)
}
}
-#undef better
+#if _AST_REGEX_DEBUG
+
+static void
+showmatch(regmatch_t* p)
+{
+ sfputc(sfstdout, '(');
+ if (p->rm_so < 0)
+ sfputc(sfstdout, '?');
+ else
+ sfprintf(sfstdout, "%d", p->rm_so);
+ sfputc(sfstdout, ',');
+ if (p->rm_eo < 0)
+ sfputc(sfstdout, '?');
+ else
+ sfprintf(sfstdout, "%d", p->rm_eo);
+ sfputc(sfstdout, ')');
+}
+
+static int
+_better(Env_t* env, Pos_t* os, Pos_t* ns, Pos_t* oend, Pos_t* nend, int level)
+{
+ int i;
+
+ DEBUG_CODE(0x0040,{sfprintf(sfstdout, "AHA better old ");for (i = 0; i <= env->nsub; i++)showmatch(&env->best[i]);sfprintf(sfstdout, "\n new ");for (i = 0; i <= env->nsub; i++)showmatch(&env->match[i]);sfprintf(sfstdout, "\n");},{0;});
+ i = better(env, os, ns, oend, nend, 0);
+ DEBUG_TEST(0x0040,(sfprintf(sfstdout, " %s\n", i <= 0 ? "OLD" : "NEW")),(0));
+ return i;
+}
+
+#define better _better
+
+#endif
#define follow(e,r,c,s) ((r)->next?parse(e,(r)->next,c,s):(c)?parse(e,c,0,s):BEST)
@@ -1461,6 +1460,8 @@ DEBUG_TEST(0x0200,(sfprintf(sfstdout,"AHA#%04d 0x%04x parse %s=>%s `%-.*s'\n", _
bitset(rex->re.neg_catch.index, s - rex->re.neg_catch.beg);
return NONE;
case REX_NEST:
+ if (s >= env->end)
+ return NONE;
do
{
if ((c = *s++) == rex->re.nest.primary)
diff --git a/usr/src/lib/libast/common/regex/regrecord.c b/usr/src/lib/libast/common/regex/regrecord.c
index b17b143a87..4247cec1b2 100644
--- a/usr/src/lib/libast/common/regex/regrecord.c
+++ b/usr/src/lib/libast/common/regex/regrecord.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/regex/regrexec.c b/usr/src/lib/libast/common/regex/regrexec.c
index cefc7bc7fb..bfda0a3b14 100644
--- a/usr/src/lib/libast/common/regex/regrexec.c
+++ b/usr/src/lib/libast/common/regex/regrexec.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/regex/regstat.c b/usr/src/lib/libast/common/regex/regstat.c
index af7a180b21..35f15e696d 100644
--- a/usr/src/lib/libast/common/regex/regstat.c
+++ b/usr/src/lib/libast/common/regex/regstat.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/regex/regsub.c b/usr/src/lib/libast/common/regex/regsub.c
index 255fd0a05d..f456251b51 100644
--- a/usr/src/lib/libast/common/regex/regsub.c
+++ b/usr/src/lib/libast/common/regex/regsub.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -249,6 +249,7 @@ regsub(const regex_t* p, Sfio_t* dp, const char* op, const char* sp, size_t nmat
return fatal(p->env->disc, REG_BADPAT, NiL);
m = (flags >> 16) & 0x3fff;
sre = !!(p->env->flags & REG_SHELL);
+ r = 0;
do
{
if (--m > 0)
diff --git a/usr/src/lib/libast/common/regex/regsubcomp.c b/usr/src/lib/libast/common/regex/regsubcomp.c
index f8806a2544..83a0664989 100644
--- a/usr/src/lib/libast/common/regex/regsubcomp.c
+++ b/usr/src/lib/libast/common/regex/regsubcomp.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -201,17 +201,6 @@ regsubcomp(regex_t* p, register const char* s, const regflags_t* map, int minmat
p->re_npat = s - o - 1;
break;
}
- else if (c == '~')
- {
- if (!sre || *s != '(')
- {
- *t++ = c;
- continue;
- }
- r = s - 1;
- s++;
- c = *s++;
- }
else if (c == '\\')
{
if (*s == c)
@@ -226,12 +215,6 @@ regsubcomp(regex_t* p, register const char* s, const regflags_t* map, int minmat
regfree(p);
return fatal(disc, REG_EESCAPE, s - 2);
}
- if (sre)
- {
- *t++ = chresc(s - 2, &e);
- s = (const char*)e;
- continue;
- }
if (c == '&')
{
*t++ = c;
@@ -279,22 +262,10 @@ regsubcomp(regex_t* p, register const char* s, const regflags_t* map, int minmat
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
c -= '0';
- if (sre)
- while (isdigit(*s))
- c = c * 10 + *s++ - '0';
- else if (isdigit(*s) && (p->env->flags & REG_MULTIREF))
+ if (isdigit(*s) && (p->env->flags & REG_MULTIREF))
c = c * 10 + *s++ - '0';
break;
case 'l':
- if (sre)
- {
- if (*s != ')')
- {
- c = -1;
- break;
- }
- s++;
- }
if (c = *s)
{
s++;
@@ -304,15 +275,6 @@ regsubcomp(regex_t* p, register const char* s, const regflags_t* map, int minmat
}
continue;
case 'u':
- if (sre)
- {
- if (*s != ')')
- {
- c = -1;
- break;
- }
- s++;
- }
if (c = *s)
{
s++;
@@ -322,15 +284,6 @@ regsubcomp(regex_t* p, register const char* s, const regflags_t* map, int minmat
}
continue;
case 'E':
- if (sre)
- {
- if (*s != ')')
- {
- c = -1;
- break;
- }
- s++;
- }
f = g;
set:
if ((op->len = (t - sub->re_rhs) - op->off) && (n = ++op - sub->re_ops) >= nops)
@@ -346,28 +299,10 @@ regsubcomp(regex_t* p, register const char* s, const regflags_t* map, int minmat
op->off = t - sub->re_rhs;
continue;
case 'L':
- if (sre)
- {
- if (*s != ')')
- {
- c = -1;
- break;
- }
- s++;
- }
g = f;
f = REG_SUB_LOWER;
goto set;
case 'U':
- if (sre)
- {
- if (*s != ')')
- {
- c = -1;
- break;
- }
- s++;
- }
g = f;
f = REG_SUB_UPPER;
goto set;
@@ -382,16 +317,6 @@ regsubcomp(regex_t* p, register const char* s, const regflags_t* map, int minmat
c = -1;
break;
}
- if (sre)
- {
- if (c < 0 || *s != ')')
- {
- while (r < s)
- *t++ = *r++;
- continue;
- }
- s++;
- }
if (c > p->re_nsub)
{
regfree(p);
diff --git a/usr/src/lib/libast/common/regex/regsubexec.c b/usr/src/lib/libast/common/regex/regsubexec.c
index 9682e69f5d..5040167934 100644
--- a/usr/src/lib/libast/common/regex/regsubexec.c
+++ b/usr/src/lib/libast/common/regex/regsubexec.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -158,6 +158,7 @@ regsubexec(const regex_t* p, const char* s, size_t nmatch, regmatch_t* match)
m = b->re_min;
b->re_cur = b->re_buf;
e = (const char*)p->env->end;
+ c = 0;
for (;;)
{
if (--m > 0)
@@ -165,11 +166,11 @@ regsubexec(const regex_t* p, const char* s, size_t nmatch, regmatch_t* match)
else
{
PUTS(p, b, s, match->rm_so, return fatal(p->env->disc, c, NiL));
- if (c = sub(p, b, s, b->re_ops, nmatch, match))
+ if (!c && (c = sub(p, b, s, b->re_ops, nmatch, match)))
return fatal(p->env->disc, c, NiL);
}
s += match->rm_eo;
- if (m <= 0 && !(b->re_flags & REG_SUB_ALL))
+ if (m <= 0 && !(b->re_flags & REG_SUB_ALL) || !*s)
break;
if (c = regnexec(p, s, e - s, nmatch, match, p->env->flags|(match->rm_so == match->rm_eo ? REG_ADVANCE : 0)))
{
@@ -177,6 +178,11 @@ regsubexec(const regex_t* p, const char* s, size_t nmatch, regmatch_t* match)
return fatal(p->env->disc, c, NiL);
break;
}
+ if (!match->rm_so && !match->rm_eo && *s && m <= 1)
+ {
+ match->rm_so = match->rm_eo = 1;
+ c = 1;
+ }
}
while (s < e)
{
diff --git a/usr/src/lib/libast/common/regex/ucs_names.h b/usr/src/lib/libast/common/regex/ucs_names.h
index 91c8a2aa91..daf835f73e 100644
--- a/usr/src/lib/libast/common/regex/ucs_names.h
+++ b/usr/src/lib/libast/common/regex/ucs_names.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/sfio/_sfclrerr.c b/usr/src/lib/libast/common/sfio/_sfclrerr.c
index a500392cd8..fbae931f5d 100644
--- a/usr/src/lib/libast/common/sfio/_sfclrerr.c
+++ b/usr/src/lib/libast/common/sfio/_sfclrerr.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/sfio/_sfdlen.c b/usr/src/lib/libast/common/sfio/_sfdlen.c
index 76db0f8d73..326ff1f6c4 100644
--- a/usr/src/lib/libast/common/sfio/_sfdlen.c
+++ b/usr/src/lib/libast/common/sfio/_sfdlen.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/sfio/_sfeof.c b/usr/src/lib/libast/common/sfio/_sfeof.c
index 8f6b809b1c..e2946b30c8 100644
--- a/usr/src/lib/libast/common/sfio/_sfeof.c
+++ b/usr/src/lib/libast/common/sfio/_sfeof.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/sfio/_sferror.c b/usr/src/lib/libast/common/sfio/_sferror.c
index 1f898d816e..fdcfc95369 100644
--- a/usr/src/lib/libast/common/sfio/_sferror.c
+++ b/usr/src/lib/libast/common/sfio/_sferror.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/sfio/_sffileno.c b/usr/src/lib/libast/common/sfio/_sffileno.c
index c8e369b734..1d38365c29 100644
--- a/usr/src/lib/libast/common/sfio/_sffileno.c
+++ b/usr/src/lib/libast/common/sfio/_sffileno.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/sfio/_sfgetc.c b/usr/src/lib/libast/common/sfio/_sfgetc.c
index ddf07dbd71..22ed7b8547 100644
--- a/usr/src/lib/libast/common/sfio/_sfgetc.c
+++ b/usr/src/lib/libast/common/sfio/_sfgetc.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/sfio/_sfgetl.c b/usr/src/lib/libast/common/sfio/_sfgetl.c
index 6c8ade54e5..a9d57e32bd 100644
--- a/usr/src/lib/libast/common/sfio/_sfgetl.c
+++ b/usr/src/lib/libast/common/sfio/_sfgetl.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/sfio/_sfgetl2.c b/usr/src/lib/libast/common/sfio/_sfgetl2.c
index d55a3d3a8d..a983a38492 100644
--- a/usr/src/lib/libast/common/sfio/_sfgetl2.c
+++ b/usr/src/lib/libast/common/sfio/_sfgetl2.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/sfio/_sfgetu.c b/usr/src/lib/libast/common/sfio/_sfgetu.c
index bccb6fbe8a..8d8a7434c2 100644
--- a/usr/src/lib/libast/common/sfio/_sfgetu.c
+++ b/usr/src/lib/libast/common/sfio/_sfgetu.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/sfio/_sfgetu2.c b/usr/src/lib/libast/common/sfio/_sfgetu2.c
index 96d62d0a6d..ff12230a1e 100644
--- a/usr/src/lib/libast/common/sfio/_sfgetu2.c
+++ b/usr/src/lib/libast/common/sfio/_sfgetu2.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/sfio/_sfllen.c b/usr/src/lib/libast/common/sfio/_sfllen.c
index dbfc40e18e..1a2e6922f7 100644
--- a/usr/src/lib/libast/common/sfio/_sfllen.c
+++ b/usr/src/lib/libast/common/sfio/_sfllen.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/sfio/_sfopen.c b/usr/src/lib/libast/common/sfio/_sfopen.c
index 67528f0f9e..e8a041759d 100644
--- a/usr/src/lib/libast/common/sfio/_sfopen.c
+++ b/usr/src/lib/libast/common/sfio/_sfopen.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -35,15 +35,16 @@ extern
#undef extern
#if __STD_C
-Sfio_t* _sfopen(reg Sfio_t* f, const char* file, const char* mode)
+Sfio_t* _sfopen(Sfio_t* f, const char* file, const char* mode)
#else
Sfio_t* _sfopen(f,file,mode)
-reg Sfio_t* f; /* old stream structure */
+Sfio_t* f; /* old stream structure */
char* file; /* file/string to be opened */
-reg char* mode; /* mode of the stream */
+char* mode; /* mode of the stream */
#endif
{
int fd, oldfd, oflags, sflags;
+ SFMTXDECL(f);
/* get the control flags */
if((sflags = _sftype(mode,&oflags,NIL(int*))) == 0)
@@ -51,7 +52,7 @@ reg char* mode; /* mode of the stream */
/* changing the control flags */
if(f && !file && !((f->flags|sflags)&SF_STRING) )
- { SFMTXSTART(f, NIL(Sfio_t*));
+ { SFMTXENTER(f, NIL(Sfio_t*));
if(f->mode&SF_INIT ) /* stream uninitialized, ok to set flags */
{ f->flags |= (sflags & (SF_FLAGS & ~SF_RDWR));
diff --git a/usr/src/lib/libast/common/sfio/_sfputc.c b/usr/src/lib/libast/common/sfio/_sfputc.c
index 596d0a9a29..27f3705ebc 100644
--- a/usr/src/lib/libast/common/sfio/_sfputc.c
+++ b/usr/src/lib/libast/common/sfio/_sfputc.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/sfio/_sfputd.c b/usr/src/lib/libast/common/sfio/_sfputd.c
index 0a830635cb..0e02a6c30b 100644
--- a/usr/src/lib/libast/common/sfio/_sfputd.c
+++ b/usr/src/lib/libast/common/sfio/_sfputd.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -40,8 +40,9 @@ Sfdouble_t v;
int exp;
uchar c[N_ARRAY];
Sfdouble_t x;
+ SFMTXDECL(f);
- SFMTXSTART(f,-1);
+ SFMTXENTER(f,-1);
if(f->mode != SF_WRITE && _sfmode(f,SF_WRITE,0) < 0)
SFMTXRETURN(f, -1);
diff --git a/usr/src/lib/libast/common/sfio/_sfputl.c b/usr/src/lib/libast/common/sfio/_sfputl.c
index 80ccf682bd..410d346562 100644
--- a/usr/src/lib/libast/common/sfio/_sfputl.c
+++ b/usr/src/lib/libast/common/sfio/_sfputl.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -27,10 +27,10 @@
*/
#if __STD_C
-int _sfputl(reg Sfio_t* f, Sflong_t v)
+int _sfputl(Sfio_t* f, Sflong_t v)
#else
int _sfputl(f,v)
-reg Sfio_t* f; /* write a portable long to this stream */
+Sfio_t* f; /* write a portable long to this stream */
Sflong_t v; /* the value to be written */
#endif
{
@@ -38,8 +38,9 @@ Sflong_t v; /* the value to be written */
reg uchar *s, *ps;
reg ssize_t n, p;
uchar c[N_ARRAY];
+ SFMTXDECL(f);
- SFMTXSTART(f,-1);
+ SFMTXENTER(f,-1);
if(f->mode != SF_WRITE && _sfmode(f,SF_WRITE,0) < 0)
SFMTXRETURN(f, -1);
SFLOCK(f,0);
diff --git a/usr/src/lib/libast/common/sfio/_sfputm.c b/usr/src/lib/libast/common/sfio/_sfputm.c
index 23ff83cd73..30e41edf8c 100644
--- a/usr/src/lib/libast/common/sfio/_sfputm.c
+++ b/usr/src/lib/libast/common/sfio/_sfputm.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -27,10 +27,10 @@
*/
#if __STD_C
-int _sfputm(reg Sfio_t* f, Sfulong_t v, Sfulong_t m)
+int _sfputm(Sfio_t* f, Sfulong_t v, Sfulong_t m)
#else
int _sfputm(f,v,m)
-reg Sfio_t* f; /* write a portable ulong to this stream */
+Sfio_t* f; /* write a portable ulong to this stream */
Sfulong_t v; /* the unsigned value to be written */
Sfulong_t m; /* the max value of the range */
#endif
@@ -39,8 +39,9 @@ Sfulong_t m; /* the max value of the range */
reg uchar *s, *ps;
reg ssize_t n, p;
uchar c[N_ARRAY];
+ SFMTXDECL(f);
- SFMTXSTART(f, -1);
+ SFMTXENTER(f, -1);
if(v > m || (f->mode != SF_WRITE && _sfmode(f,SF_WRITE,0) < 0) )
SFMTXRETURN(f, -1);
diff --git a/usr/src/lib/libast/common/sfio/_sfputu.c b/usr/src/lib/libast/common/sfio/_sfputu.c
index 5620948ac3..a83e9b9d14 100644
--- a/usr/src/lib/libast/common/sfio/_sfputu.c
+++ b/usr/src/lib/libast/common/sfio/_sfputu.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -27,10 +27,10 @@
*/
#if __STD_C
-int _sfputu(reg Sfio_t* f, Sfulong_t v)
+int _sfputu(Sfio_t* f, Sfulong_t v)
#else
int _sfputu(f,v)
-reg Sfio_t* f; /* write a portable ulong to this stream */
+Sfio_t* f; /* write a portable ulong to this stream */
Sfulong_t v; /* the unsigned value to be written */
#endif
{
@@ -38,8 +38,9 @@ Sfulong_t v; /* the unsigned value to be written */
reg uchar *s, *ps;
reg ssize_t n, p;
uchar c[N_ARRAY];
+ SFMTXDECL(f);
- SFMTXSTART(f, -1);
+ SFMTXENTER(f, -1);
if(f->mode != SF_WRITE && _sfmode(f,SF_WRITE,0) < 0)
SFMTXRETURN(f, -1);
diff --git a/usr/src/lib/libast/common/sfio/_sfslen.c b/usr/src/lib/libast/common/sfio/_sfslen.c
index 08f9ac6bf1..c86daec1f0 100644
--- a/usr/src/lib/libast/common/sfio/_sfslen.c
+++ b/usr/src/lib/libast/common/sfio/_sfslen.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/sfio/_sfstacked.c b/usr/src/lib/libast/common/sfio/_sfstacked.c
index ebb00952db..e16ec78b58 100644
--- a/usr/src/lib/libast/common/sfio/_sfstacked.c
+++ b/usr/src/lib/libast/common/sfio/_sfstacked.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/sfio/_sfulen.c b/usr/src/lib/libast/common/sfio/_sfulen.c
index e7f09bdf20..058e110e1a 100644
--- a/usr/src/lib/libast/common/sfio/_sfulen.c
+++ b/usr/src/lib/libast/common/sfio/_sfulen.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/sfio/_sfvalue.c b/usr/src/lib/libast/common/sfio/_sfvalue.c
index c9aba31cab..bafbe85f2c 100644
--- a/usr/src/lib/libast/common/sfio/_sfvalue.c
+++ b/usr/src/lib/libast/common/sfio/_sfvalue.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/sfio/sfclose.c b/usr/src/lib/libast/common/sfio/sfclose.c
index fdfa271228..46377baabc 100644
--- a/usr/src/lib/libast/common/sfio/sfclose.c
+++ b/usr/src/lib/libast/common/sfio/sfclose.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -27,16 +27,17 @@
*/
#if __STD_C
-int sfclose(reg Sfio_t* f)
+int sfclose(Sfio_t* f)
#else
int sfclose(f)
-reg Sfio_t* f;
+Sfio_t* f;
#endif
{
reg int local, ex, rv;
Void_t* data = NIL(Void_t*);
+ SFMTXDECL(f);
- SFMTXSTART(f, -1);
+ SFMTXENTER(f, -1);
GETLOCAL(f,local);
@@ -52,6 +53,7 @@ reg Sfio_t* f;
if(!(pop = (*_Sfstack)(f,NIL(Sfio_t*))) )
SFMTXRETURN(f,-1);
+
if(sfclose(pop) < 0)
{ (*_Sfstack)(f,pop);
SFMTXRETURN(f,-1);
@@ -116,7 +118,7 @@ reg Sfio_t* f;
/* zap the file descriptor */
if(_Sfnotify)
- (*_Sfnotify)(f,SF_CLOSING,f->file);
+ (*_Sfnotify)(f, SF_CLOSING, (void*)((long)f->file));
if(f->file >= 0 && !(f->flags&SF_STRING))
CLOSE(f->file);
f->file = -1;
diff --git a/usr/src/lib/libast/common/sfio/sfclrlock.c b/usr/src/lib/libast/common/sfio/sfclrlock.c
index 3f0a61e7fc..ed6f253d68 100644
--- a/usr/src/lib/libast/common/sfio/sfclrlock.c
+++ b/usr/src/lib/libast/common/sfio/sfclrlock.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -28,19 +28,20 @@
** Written by Kiem-Phong Vo
*/
#if __STD_C
-int sfclrlock(reg Sfio_t* f)
+int sfclrlock(Sfio_t* f)
#else
int sfclrlock(f)
-reg Sfio_t *f;
+Sfio_t *f;
#endif
{
int rv;
+ SFMTXDECL(f);
/* already closed */
if(f && (f->mode&SF_AVAIL))
return 0;
- SFMTXSTART(f,0);
+ SFMTXENTER(f,0);
/* clear error bits */
f->flags &= ~(SF_ERROR|SF_EOF);
diff --git a/usr/src/lib/libast/common/sfio/sfcvt.c b/usr/src/lib/libast/common/sfio/sfcvt.c
index 93f91931ae..61312db04a 100644
--- a/usr/src/lib/libast/common/sfio/sfcvt.c
+++ b/usr/src/lib/libast/common/sfio/sfcvt.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,6 +19,9 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
+#if __STDC__
+#include "FEATURE/isoc99"
+#endif
#include "sfhdr.h"
/* Convert a floating point value to ASCII.
@@ -48,12 +51,58 @@ static char *Zero = "0";
#endif
#endif
+#if ! _lib_signbit && defined(signbit)
+#undef _lib_signbit
+#define _lib_signbit 1
+#endif
+
+#if ! _lib_signbit
+#if ! _ast_fltmax_double
+static int neg0ld(Sfdouble_t f)
+{
+ Sfdouble_t z = -0.0;
+ return !memcmp(&f, &z, sizeof(f));
+}
+#endif
+static int neg0d(double f)
+{
+ double z = -0.0;
+ return !memcmp(&f, &z, sizeof(f));
+}
+#endif
+
+#if ULONG_DIG && ULONG_DIG < (DBL_DIG-1)
+#define CVT_LDBL_INT long
+#define CVT_LDBL_MAXINT LONG_MAX
+#else
+#if UINT_DIG && UINT_DIG < (DBL_DIG-1)
+#define CVT_LDBL_INT int
+#define CVT_LDBL_MAXINT INT_MAX
+#else
+#define CVT_LDBL_INT long
+#define CVT_LDBL_MAXINT SF_MAXLONG
+#endif
+#endif
+
+#if ULONG_DIG && ULONG_DIG < (DBL_DIG-1)
+#define CVT_DBL_INT long
+#define CVT_DBL_MAXINT LONG_MAX
+#else
+#if UINT_DIG && UINT_DIG < (DBL_DIG-1)
+#define CVT_DBL_INT int
+#define CVT_DBL_MAXINT INT_MAX
+#else
+#define CVT_DBL_INT long
+#define CVT_DBL_MAXINT SF_MAXLONG
+#endif
+#endif
+
#if __STD_C
-char* _sfcvt(Sfdouble_t dv, char* buf, size_t size, int n_digit,
+char* _sfcvt(Void_t* vp, char* buf, size_t size, int n_digit,
int* decpt, int* sign, int* len, int format)
#else
-char* _sfcvt(dv,buf,size,n_digit,decpt,sign,len,format)
-Sfdouble_t dv; /* value to convert */
+char* _sfcvt(vp,buf,size,n_digit,decpt,sign,len,format)
+Void_t* vp; /* pointer to value to convert */
char* buf; /* conversion goes here */
size_t size; /* size of buf */
int n_digit; /* number of digits wanted */
@@ -73,36 +122,50 @@ int format; /* conversion format */
*sign = *decpt = 0;
- if(isnanl(dv))
- return SF_NAN;
-#if _lib_isinf
- if (n = isinf(dv))
- { if (n < 0)
- *sign = 1;
- return SF_INF;
- }
-#endif
#if !_ast_fltmax_double
if(format&SFFMT_LDOUBLE)
- { Sfdouble_t f = dv;
-#if _c99_in_the_wild
+ { Sfdouble_t f = *(Sfdouble_t*)vp;
+
+ if(isnanl(f))
+ {
#if _lib_signbit
- if (signbit(f))
-#else
-#if _lib_copysignl
- if (copysignl(1.0, f) < 0.0)
-#else
-#if _lib_copysign
- if (copysign(1.0, (double)f) < 0.0)
+ if (signbit(f))
#else
- if (f < 0.0)
+ if (f < 0)
#endif
+ *sign = 1;
+ return SF_NAN;
+ }
+#if _lib_isinf
+ if (n = isinf(f))
+ {
+#if _lib_signbit
+ if (signbit(f))
+#else
+ if (n < 0 || f < 0)
#endif
+ *sign = 1;
+ return SF_INF;
+ }
#endif
+# if _c99_in_the_wild
+# if _lib_signbit
+ if (signbit(f))
+# else
+# if _lib_copysignl
+ if (copysignl(1.0, f) < 0.0)
+# else
+# if _lib_copysign
+ if (copysign(1.0, (double)f) < 0.0)
+# else
+ if (f < 0.0)
+# endif
+# endif
+# endif
{ f = -f;
*sign = 1;
}
-#if _lib_fpclassify
+# if _lib_fpclassify
switch (fpclassify(f))
{
case FP_INFINITE:
@@ -112,13 +175,17 @@ int format; /* conversion format */
case FP_ZERO:
return SF_ZERO;
}
-#endif
-#else
- if (f < 0.0)
+# endif
+# else
+# if _lib_signbit
+ if (signbit(f))
+# else
+ if (f < 0.0 || f == 0.0 && neg0ld(f))
+# endif
{ f = -f;
*sign = 1;
}
-#endif
+# endif
if(f < LDBL_MIN)
return SF_ZERO;
if(f > LDBL_MAX)
@@ -153,7 +220,7 @@ int format; /* conversion format */
}
n = 0;
- if(f >= (Sfdouble_t)SF_MAXLONG)
+ if(f >= (Sfdouble_t)CVT_LDBL_MAXINT)
{ /* scale to a small enough number to fit an int */
v = SF_MAXEXP10-1;
do
@@ -165,16 +232,30 @@ int format; /* conversion format */
if((n += (1<<v)) >= SF_IDIGITS)
return SF_INF;
}
- } while(f >= (Sfdouble_t)SF_MAXLONG);
+ } while(f >= (Sfdouble_t)CVT_LDBL_MAXINT);
+ }
+ else if(f > 0.0 && f < 0.1)
+ { /* scale to avoid excessive multiply by 10 below */
+ v = SF_MAXEXP10-1;
+ do
+ { if(f <= _Sfneg10[v])
+ { f *= _Sfpos10[v];
+ if((n += (1<<v)) >= SF_IDIGITS)
+ return SF_INF;
+ }
+ else if (--v < 0)
+ break;
+ } while(f < 0.1);
+ n = -n;
}
*decpt = (int)n;
b = sp = buf + SF_INTPART;
- if((v = (long)f) != 0)
+ if((v = (CVT_LDBL_INT)f) != 0)
{ /* translate the integer part */
f -= (Sfdouble_t)v;
- sfucvt(v,sp,n,ep,long,ulong);
+ sfucvt(v,sp,n,ep,CVT_LDBL_INT,unsigned CVT_LDBL_INT);
n = b-sp;
if((*decpt += (int)n) >= SF_IDIGITS)
@@ -224,29 +305,44 @@ int format; /* conversion format */
}
} else
#endif
- { double f = (double)dv;
+ { double f = *(double*)vp;
+ if(isnan(f))
+ {
+#if _lib_signbit
+ if (signbit(f))
+#else
+ if (f < 0)
+#endif
+ *sign = 1;
+ return SF_NAN;
+ }
#if _lib_isinf
if (n = isinf(f))
- { if (n < 0)
+ {
+#if _lib_signbit
+ if (signbit(f))
+#else
+ if (n < 0 || f < 0)
+#endif
*sign = 1;
return SF_INF;
}
#endif
#if _c99_in_the_wild
-#if _lib_signbit
+# if _lib_signbit
if (signbit(f))
-#else
-#if _lib_copysign
+# else
+# if _lib_copysign
if (copysign(1.0, f) < 0.0)
-#else
+# else
if (f < 0.0)
-#endif
-#endif
+# endif
+# endif
{ f = -f;
*sign = 1;
}
-#if _lib_fpclassify
+# if _lib_fpclassify
switch (fpclassify(f))
{
case FP_INFINITE:
@@ -256,9 +352,13 @@ int format; /* conversion format */
case FP_ZERO:
return SF_ZERO;
}
-#endif
+# endif
#else
- if (f < 0.0)
+# if _lib_signbit
+ if (signbit(f))
+# else
+ if (f < 0.0 || f == 0.0 && neg0d(f))
+# endif
{ f = -f;
*sign = 1;
}
@@ -296,7 +396,7 @@ int format; /* conversion format */
}
}
n = 0;
- if(f >= (double)SF_MAXLONG)
+ if(f >= (double)CVT_DBL_MAXINT)
{ /* scale to a small enough number to fit an int */
v = SF_MAXEXP10-1;
do
@@ -307,16 +407,30 @@ int format; /* conversion format */
if((n += (1<<v)) >= SF_IDIGITS)
return SF_INF;
}
- } while(f >= (double)SF_MAXLONG);
+ } while(f >= (double)CVT_DBL_MAXINT);
+ }
+ else if(f > 0.0 && f < 1e-8)
+ { /* scale to avoid excessive multiply by 10 below */
+ v = SF_MAXEXP10-1;
+ do
+ { if(f <= _Sfneg10[v])
+ { f *= _Sfpos10[v];
+ if((n += (1<<v)) >= SF_IDIGITS)
+ return SF_INF;
+ }
+ else if(--v < 0)
+ break;
+ } while(f < 0.1);
+ n = -n;
}
*decpt = (int)n;
b = sp = buf + SF_INTPART;
- if((v = (long)f) != 0)
+ if((v = (CVT_DBL_INT)f) != 0)
{ /* translate the integer part */
f -= (double)v;
- sfucvt(v,sp,n,ep,long,ulong);
+ sfucvt(v,sp,n,ep,CVT_DBL_INT,unsigned CVT_DBL_INT);
n = b-sp;
if((*decpt += (int)n) >= SF_IDIGITS)
@@ -361,6 +475,7 @@ int format; /* conversion format */
}
else /* n == 10 */
{ do { *sp++ = '9'; } while(sp < ep);
+ break;
}
}
}
diff --git a/usr/src/lib/libast/common/sfio/sfdisc.c b/usr/src/lib/libast/common/sfio/sfdisc.c
index 34e9f47c45..9bc9125445 100644
--- a/usr/src/lib/libast/common/sfio/sfdisc.c
+++ b/usr/src/lib/libast/common/sfio/sfdisc.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -104,29 +104,35 @@ Sfdisc_t* disc;
}
#if __STD_C
-Sfdisc_t* sfdisc(reg Sfio_t* f, reg Sfdisc_t* disc)
+Sfdisc_t* sfdisc(Sfio_t* f, Sfdisc_t* disc)
#else
Sfdisc_t* sfdisc(f,disc)
-reg Sfio_t* f;
-reg Sfdisc_t* disc;
+Sfio_t* f;
+Sfdisc_t* disc;
#endif
{
- reg Sfdisc_t *d, *rdisc;
- reg Sfread_f oreadf;
- reg Sfwrite_f owritef;
- reg Sfseek_f oseekf;
+ Sfdisc_t *d, *rdisc;
+ Sfread_f oreadf;
+ Sfwrite_f owritef;
+ Sfseek_f oseekf;
ssize_t n;
- reg Dccache_t *dcca = NIL(Dccache_t*);
+ Dccache_t *dcca = NIL(Dccache_t*);
+ SFMTXDECL(f);
+
+ SFMTXENTER(f, NIL(Sfdisc_t*));
- SFMTXSTART(f, NIL(Sfdisc_t*));
+ if((Sfio_t*)disc == f) /* special case to get the top discipline */
+ SFMTXRETURN(f,f->disc);
if((f->flags&SF_READ) && f->proc && (f->mode&SF_WRITE) )
{ /* make sure in read mode to check for read-ahead data */
if(_sfmode(f,SF_READ,0) < 0)
SFMTXRETURN(f, NIL(Sfdisc_t*));
}
- else if((f->mode&SF_RDWR) != f->mode && _sfmode(f,0,0) < 0)
- SFMTXRETURN(f, NIL(Sfdisc_t*));
+ else
+ { if((f->mode&SF_RDWR) != f->mode && _sfmode(f,0,0) < 0)
+ SFMTXRETURN(f, NIL(Sfdisc_t*));
+ }
SFLOCK(f,0);
rdisc = NIL(Sfdisc_t*);
diff --git a/usr/src/lib/libast/common/sfio/sfdlen.c b/usr/src/lib/libast/common/sfio/sfdlen.c
index 8865b2d453..404b89e859 100644
--- a/usr/src/lib/libast/common/sfio/sfdlen.c
+++ b/usr/src/lib/libast/common/sfio/sfdlen.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/sfio/sfecvt.c b/usr/src/lib/libast/common/sfio/sfecvt.c
index d02eb749ad..85fa74b3f2 100644
--- a/usr/src/lib/libast/common/sfio/sfecvt.c
+++ b/usr/src/lib/libast/common/sfio/sfecvt.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -34,5 +34,5 @@ int* sign; /* to return sign */
int len;
static char buf[SF_MAXDIGITS];
- return _sfcvt((Sfdouble_t)dval,buf,sizeof(buf),n_digit,decpt,sign,&len,SFFMT_EFORMAT);
+ return _sfcvt(&dval,buf,sizeof(buf),n_digit,decpt,sign,&len,SFFMT_EFORMAT);
}
diff --git a/usr/src/lib/libast/common/sfio/sfexcept.c b/usr/src/lib/libast/common/sfio/sfexcept.c
index bc7c32717e..52b20760d0 100644
--- a/usr/src/lib/libast/common/sfio/sfexcept.c
+++ b/usr/src/lib/libast/common/sfio/sfexcept.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -38,8 +38,9 @@ Sfdisc_t* disc; /* discipline in use */
reg int ev, local, lock;
reg ssize_t size;
reg uchar* data;
+ SFMTXDECL(f);
- SFMTXSTART(f,-1);
+ SFMTXENTER(f,-1);
GETLOCAL(f,local);
lock = f->mode&SF_LOCK;
diff --git a/usr/src/lib/libast/common/sfio/sfextern.c b/usr/src/lib/libast/common/sfio/sfextern.c
index 36ca0a0836..ddc96837d2 100644
--- a/usr/src/lib/libast/common/sfio/sfextern.c
+++ b/usr/src/lib/libast/common/sfio/sfextern.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -43,7 +43,7 @@ Sfextern_t _Sfextern =
{ NIL(Sfpool_t*), 0, 0, 0, NIL(Sfio_t**) }, /* _Sfpool */
NIL(int(*)_ARG_((Sfio_t*,int))), /* _Sfpmove */
NIL(Sfio_t*(*)_ARG_((Sfio_t*, Sfio_t*))), /* _Sfstack */
- NIL(void(*)_ARG_((Sfio_t*, int, int))), /* _Sfnotify */
+ NIL(void(*)_ARG_((Sfio_t*, int, void*))), /* _Sfnotify */
NIL(int(*)_ARG_((Sfio_t*))), /* _Sfstdsync */
{ NIL(Sfread_f), /* _Sfudisc */
NIL(Sfwrite_f),
@@ -60,8 +60,8 @@ Sfextern_t _Sfextern =
};
ssize_t _Sfi = -1; /* value for a few fast macro functions */
-#if INT_MAX == LONG_MAX
-ssize_t _Sfmaxr = 64*1024; /* default maximum size for a record */
+#ifdef _ast_int8_t
+ssize_t _Sfmaxr = 256*1024; /* default maximum size for a record */
#else
ssize_t _Sfmaxr = 16*1024; /* default maximum size for a record */
#endif
@@ -71,18 +71,20 @@ static Vtmutex_t _Sfmtxin, _Sfmtxout, _Sfmtxerr;
#define SFMTXIN (&_Sfmtxin)
#define SFMTXOUT (&_Sfmtxout)
#define SFMTXERR (&_Sfmtxerr)
+#define SF_STDSAFE SF_MTSAFE
#else
#define SFMTXIN (0)
#define SFMTXOUT (0)
#define SFMTXERR (0)
+#define SF_STDSAFE (0)
#endif
Sfio_t _Sfstdin = SFNEW(NIL(char*),-1,0,
- (SF_READ |SF_STATIC|SF_MTSAFE),NIL(Sfdisc_t*),SFMTXIN);
+ (SF_READ |SF_STATIC|SF_STDSAFE),NIL(Sfdisc_t*),SFMTXIN);
Sfio_t _Sfstdout = SFNEW(NIL(char*),-1,1,
- (SF_WRITE|SF_STATIC|SF_MTSAFE),NIL(Sfdisc_t*),SFMTXOUT);
+ (SF_WRITE|SF_STATIC|SF_STDSAFE),NIL(Sfdisc_t*),SFMTXOUT);
Sfio_t _Sfstderr = SFNEW(NIL(char*),-1,2,
- (SF_WRITE|SF_STATIC|SF_MTSAFE),NIL(Sfdisc_t*),SFMTXERR);
+ (SF_WRITE|SF_STATIC|SF_STDSAFE),NIL(Sfdisc_t*),SFMTXERR);
#undef sfstdin
#undef sfstdout
diff --git a/usr/src/lib/libast/common/sfio/sffcvt.c b/usr/src/lib/libast/common/sfio/sffcvt.c
index bb133590a4..bc108ea962 100644
--- a/usr/src/lib/libast/common/sfio/sffcvt.c
+++ b/usr/src/lib/libast/common/sfio/sffcvt.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -34,5 +34,5 @@ int* sign; /* to return sign */
int len;
static char buf[SF_MAXDIGITS];
- return _sfcvt((Sfdouble_t)dval,buf,sizeof(buf),n_digit,decpt,sign,&len,0);
+ return _sfcvt(&dval,buf,sizeof(buf),n_digit,decpt,sign,&len,0);
}
diff --git a/usr/src/lib/libast/common/sfio/sffilbuf.c b/usr/src/lib/libast/common/sfio/sffilbuf.c
index 9e0d2b8e7b..a6c2a4fa9c 100644
--- a/usr/src/lib/libast/common/sfio/sffilbuf.c
+++ b/usr/src/lib/libast/common/sfio/sffilbuf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -41,8 +41,9 @@ reg int n; /* see above */
{
reg ssize_t r;
reg int first, local, rcrv, rc, justseek;
+ SFMTXDECL(f);
- SFMTXSTART(f,-1);
+ SFMTXENTER(f,-1);
GETLOCAL(f,local);
diff --git a/usr/src/lib/libast/common/sfio/sfflsbuf.c b/usr/src/lib/libast/common/sfio/sfflsbuf.c
index fb7dc3b61d..5e71fedb5d 100644
--- a/usr/src/lib/libast/common/sfio/sfflsbuf.c
+++ b/usr/src/lib/libast/common/sfio/sfflsbuf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -28,20 +28,21 @@
*/
#if __STD_C
-int _sfflsbuf(reg Sfio_t* f, reg int c)
+int _sfflsbuf(Sfio_t* f, int c)
#else
int _sfflsbuf(f,c)
-reg Sfio_t* f; /* write out the buffered content of this stream */
-reg int c; /* if c>=0, c is also written out */
+Sfio_t* f; /* write out the buffered content of this stream */
+int c; /* if c>=0, c is also written out */
#endif
{
- reg ssize_t n, w;
- reg uchar* data;
+ ssize_t n, w;
+ uchar* data;
uchar outc;
- reg int local, isall;
+ int local, isall;
int inpc = c;
+ SFMTXDECL(f);
- SFMTXSTART(f,-1);
+ SFMTXENTER(f,-1);
GETLOCAL(f,local);
diff --git a/usr/src/lib/libast/common/sfio/sfgetd.c b/usr/src/lib/libast/common/sfio/sfgetd.c
index da72cf7796..b6e31af5f6 100644
--- a/usr/src/lib/libast/common/sfio/sfgetd.c
+++ b/usr/src/lib/libast/common/sfio/sfgetd.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -36,8 +36,9 @@ Sfio_t* f;
reg uchar *s, *ends, c;
reg int p, sign, exp;
Sfdouble_t v;
+ SFMTXDECL(f);
- SFMTXSTART(f,-1.);
+ SFMTXENTER(f,-1.);
if((sign = sfgetc(f)) < 0 || (exp = (int)sfgetu(f)) < 0)
SFMTXRETURN(f, -1.);
diff --git a/usr/src/lib/libast/common/sfio/sfgetl.c b/usr/src/lib/libast/common/sfio/sfgetl.c
index 6e49f4f023..cfd14632b1 100644
--- a/usr/src/lib/libast/common/sfio/sfgetl.c
+++ b/usr/src/lib/libast/common/sfio/sfgetl.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -27,17 +27,18 @@
*/
#if __STD_C
-Sflong_t sfgetl(reg Sfio_t* f)
+Sflong_t sfgetl(Sfio_t* f)
#else
Sflong_t sfgetl(f)
-reg Sfio_t* f;
+Sfio_t* f;
#endif
{
Sflong_t v;
- reg uchar *s, *ends, c;
- reg int p;
+ uchar *s, *ends, c;
+ int p;
+ SFMTXDECL(f);
- SFMTXSTART(f,(Sflong_t)(-1));
+ SFMTXENTER(f,(Sflong_t)(-1));
if(f->mode != SF_READ && _sfmode(f,SF_READ,0) < 0)
SFMTXRETURN(f, (Sflong_t)(-1));
diff --git a/usr/src/lib/libast/common/sfio/sfgetm.c b/usr/src/lib/libast/common/sfio/sfgetm.c
index 275b0144e4..e2232c955c 100644
--- a/usr/src/lib/libast/common/sfio/sfgetm.c
+++ b/usr/src/lib/libast/common/sfio/sfgetm.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -27,18 +27,19 @@
*/
#if __STD_C
-Sfulong_t sfgetm(reg Sfio_t* f, Sfulong_t m)
+Sfulong_t sfgetm(Sfio_t* f, Sfulong_t m)
#else
Sfulong_t sfgetm(f, m)
-reg Sfio_t* f;
+Sfio_t* f;
Sfulong_t m;
#endif
{
Sfulong_t v;
reg uchar *s, *ends, c;
reg int p;
+ SFMTXDECL(f);
- SFMTXSTART(f, (Sfulong_t)(-1));
+ SFMTXENTER(f, (Sfulong_t)(-1));
if(f->mode != SF_READ && _sfmode(f,SF_READ,0) < 0)
SFMTXRETURN(f, (Sfulong_t)(-1));
diff --git a/usr/src/lib/libast/common/sfio/sfgetr.c b/usr/src/lib/libast/common/sfio/sfgetr.c
index a3df6757a9..64b10103be 100644
--- a/usr/src/lib/libast/common/sfio/sfgetr.c
+++ b/usr/src/lib/libast/common/sfio/sfgetr.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -28,20 +28,21 @@
*/
#if __STD_C
-char* sfgetr(reg Sfio_t *f, reg int rc, int type)
+char* sfgetr(Sfio_t *f, int rc, int type)
#else
char* sfgetr(f,rc,type)
-reg Sfio_t* f; /* stream to read from */
-reg int rc; /* record separator */
+Sfio_t* f; /* stream to read from */
+int rc; /* record separator */
int type;
#endif
{
- reg ssize_t n, un;
- reg uchar *s, *ends, *us;
- reg int found;
- reg Sfrsrv_t* rsrv;
+ ssize_t n, un;
+ uchar *s, *ends, *us;
+ int found;
+ Sfrsrv_t* rsrv;
+ SFMTXDECL(f);
- SFMTXSTART(f, NIL(char*));
+ SFMTXENTER(f, NIL(char*));
if(rc < 0 || (f->mode != SF_READ && _sfmode(f,SF_READ,0) < 0) )
SFMTXRETURN(f, NIL(char*));
@@ -57,7 +58,12 @@ int type;
type = type < 0 ? SF_LASTR : type == 1 ? SF_STRING : type;
if(type&SF_LASTR) /* return the broken record */
- { if((rsrv = f->rsrv) && (un = -rsrv->slen) > 0)
+ { if((f->flags&SF_STRING) && (un = f->endb - f->next))
+ { us = f->next;
+ f->next = f->endb;
+ found = 1;
+ }
+ else if((rsrv = f->rsrv) && (un = -rsrv->slen) > 0)
{ us = rsrv->data;
found = 1;
}
@@ -112,7 +118,7 @@ int type;
/* amount to be read */
n = s - f->next;
- if(!found && _Sfmaxr > 0 && un+n+1 >= _Sfmaxr) /* already exceed limit */
+ if(!found && (_Sfmaxr > 0 && un+n+1 >= _Sfmaxr || (f->flags&SF_STRING))) /* already exceed limit */
{ us = NIL(uchar*);
goto done;
}
diff --git a/usr/src/lib/libast/common/sfio/sfgetu.c b/usr/src/lib/libast/common/sfio/sfgetu.c
index 788ac2965c..a6fb82d9d5 100644
--- a/usr/src/lib/libast/common/sfio/sfgetu.c
+++ b/usr/src/lib/libast/common/sfio/sfgetu.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -27,17 +27,18 @@
*/
#if __STD_C
-Sfulong_t sfgetu(reg Sfio_t* f)
+Sfulong_t sfgetu(Sfio_t* f)
#else
Sfulong_t sfgetu(f)
-reg Sfio_t* f;
+Sfio_t* f;
#endif
{
Sfulong_t v;
- reg uchar *s, *ends, c;
- reg int p;
+ uchar *s, *ends, c;
+ int p;
+ SFMTXDECL(f);
- SFMTXSTART(f, (Sfulong_t)(-1));
+ SFMTXENTER(f, (Sfulong_t)(-1));
if(f->mode != SF_READ && _sfmode(f,SF_READ,0) < 0)
SFMTXRETURN(f, (Sfulong_t)(-1));
diff --git a/usr/src/lib/libast/common/sfio/sfhdr.h b/usr/src/lib/libast/common/sfio/sfhdr.h
index 9d2a121865..5fd9dd52fb 100644
--- a/usr/src/lib/libast/common/sfio/sfhdr.h
+++ b/usr/src/lib/libast/common/sfio/sfhdr.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -361,22 +361,48 @@
#define SFMBDCL(mb)
#endif /* _has_multibyte */
+/* dealing with streams that might be accessed concurrently */
#if vt_threaded
-/* initialization */
-#define SFONCE() (_Sfdone ? 0 : vtonce(_Sfonce,_Sfoncef))
+#define SFMTXdecl(ff,_mf_) Sfio_t* _mf_ = (ff)
+#define SFMTXbegin(ff,_mf_,rv) \
+ { if((ff)->_flags&SF_MTSAFE) \
+ { (_mf_) = (ff); \
+ if(sfmutex((ff), SFMTX_LOCK) != 0) return(rv); \
+ if(_Sfnotify) \
+ { (*_Sfnotify)((_mf_), SF_MTACCESS, (Void_t*)(&(ff)) ); \
+ if(!(ff)) (ff) = (_mf_); \
+ } \
+ } \
+ }
+#define SFMTXend(ff,_mf_) \
+ { if((ff)->_flags&SF_MTSAFE) \
+ { if(_Sfnotify) \
+ (*_Sfnotify)((_mf_), SF_MTACCESS, NIL(Void_t*) ); \
+ sfmutex((ff), SFMTX_UNLOCK); \
+ (ff) = (_mf_); \
+ } \
+ }
+
+#define SFONCE() (_Sfdone ? 0 : vtonce(_Sfonce,_Sfoncef))
+
+#define SFMTXLOCK(f) (((f)->flags&SF_MTSAFE) ? sfmutex(f,SFMTX_LOCK) : 0)
+#define SFMTXUNLOCK(f) (((f)->flags&SF_MTSAFE) ? sfmutex(f,SFMTX_UNLOCK) : 0)
-/* to lock/unlock a stream on entering and returning from some function */
-#define SFMTXLOCK(f) (((f)->flags&SF_MTSAFE) ? sfmutex(f,SFMTX_LOCK) : 0)
-#define SFMTXUNLOCK(f) (((f)->flags&SF_MTSAFE) ? sfmutex(f,SFMTX_UNLOCK) : 0)
-#define SFMTXSTART(f,v) { if(!f || SFMTXLOCK(f) != 0) return(v); }
-#define SFMTXRETURN(f,v) { SFMTXUNLOCK(f); return(v); }
+#define SFMTXDECL(ff) SFMTXdecl((ff), _mtxf1_)
+#define SFMTXBEGIN(ff,v) { SFMTXbegin((ff), _mtxf1_, (v) ); }
+#define SFMTXEND(ff) { SFMTXend(ff, _mtxf1_); }
+#define SFMTXENTER(ff,v) { if(!(ff)) return(v); SFMTXBEGIN((ff), (v)); }
+#define SFMTXRETURN(ff,v) { SFMTXEND(ff); return(v); }
+
+#define SFMTXDECL2(ff) SFMTXdecl((ff), _mtxf2_)
+#define SFMTXBEGIN2(ff,v) { SFMTXbegin((ff), _mtxf2_, (v) ); }
+#define SFMTXEND2(ff) { SFMTXend((ff), _mtxf2_); }
-/* start and end critical region for a pool */
#define POOLMTXLOCK(p) ( vtmtxlock(&(p)->mutex) )
#define POOLMTXUNLOCK(p) ( vtmtxunlock(&(p)->mutex) )
-#define POOLMTXSTART(p) { POOLMTXLOCK(p); }
-#define POOLMTXRETURN(p,v) { POOLMTXUNLOCK(p); return(v); }
+#define POOLMTXENTER(p) { POOLMTXLOCK(p); }
+#define POOLMTXRETURN(p,rv) { POOLMTXUNLOCK(p); return(rv); }
#else /*!vt_threaded*/
@@ -387,12 +413,20 @@
#define SFMTXLOCK(f) /*(0)*/
#define SFMTXUNLOCK(f) /*(0)*/
-#define SFMTXSTART(f,v) { if(!f) return(v); }
-#define SFMTXRETURN(f,v) { return(v); }
+
+#define SFMTXDECL(ff) /*(0)*/
+#define SFMTXBEGIN(ff,v) /*(0)*/
+#define SFMTXEND(ff) /*(0)*/
+#define SFMTXENTER(ff,v) { if(!(ff)) return(v); }
+#define SFMTXRETURN(ff,v) { return(v); }
+
+#define SFMTXDECL2(ff) /*(0)*/
+#define SFMTXBEGIN2(ff,v) /*(0)*/
+#define SFMTXEND2(ff) /*(0)*/
#define POOLMTXLOCK(p)
#define POOLMTXUNLOCK(p)
-#define POOLMTXSTART(p)
+#define POOLMTXENTER(p)
#define POOLMTXRETURN(p,v) { return(v); }
#endif /*vt_threaded*/
@@ -547,7 +581,7 @@
#ifndef S_ISFIFO
# ifdef S_IFIFO
-# define S_ISFIFO(m) (((m)&S_IFIFO) == S_IFIFO)
+# define S_ISFIFO(m) (((m)&S_IFMT) == S_IFIFO)
# else
# define S_ISFIFO(m) (0)
# endif
@@ -769,7 +803,7 @@ typedef struct _sfextern_s
struct _sfpool_s sf_pool;
int (*sf_pmove)_ARG_((Sfio_t*, int));
Sfio_t* (*sf_stack)_ARG_((Sfio_t*, Sfio_t*));
- void (*sf_notify)_ARG_((Sfio_t*, int, int));
+ void (*sf_notify)_ARG_((Sfio_t*, int, void*));
int (*sf_stdsync)_ARG_((Sfio_t*));
struct _sfdisc_s sf_udisc;
void (*sf_cleanup)_ARG_((void));
@@ -1130,7 +1164,7 @@ extern int _sfpclose _ARG_((Sfio_t*));
extern int _sfexcept _ARG_((Sfio_t*, int, ssize_t, Sfdisc_t*));
extern Sfrsrv_t* _sfrsrv _ARG_((Sfio_t*, ssize_t));
extern int _sfsetpool _ARG_((Sfio_t*));
-extern char* _sfcvt _ARG_((Sfdouble_t,char*,size_t,int,int*,int*,int*,int));
+extern char* _sfcvt _ARG_((Void_t*,char*,size_t,int,int*,int*,int*,int));
extern char** _sfgetpath _ARG_((char*));
#if _BLD_sfio && defined(__EXPORT__)
diff --git a/usr/src/lib/libast/common/sfio/sfllen.c b/usr/src/lib/libast/common/sfio/sfllen.c
index 18087b3de5..02b0657077 100644
--- a/usr/src/lib/libast/common/sfio/sfllen.c
+++ b/usr/src/lib/libast/common/sfio/sfllen.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/sfio/sfmode.c b/usr/src/lib/libast/common/sfio/sfmode.c
index 99b920a144..d30e404881 100644
--- a/usr/src/lib/libast/common/sfio/sfmode.c
+++ b/usr/src/lib/libast/common/sfio/sfmode.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -20,7 +20,7 @@
* *
***********************************************************************/
#include "sfhdr.h"
-static char* Version = "\n@(#)$Id: sfio (AT&T Research) 2006-02-07 $\0\n";
+static char* Version = "\n@(#)$Id: sfio (AT&T Research) 2008-07-17 $\0\n";
/* Functions to set a given stream to some desired mode
**
@@ -45,6 +45,7 @@ static char* Version = "\n@(#)$Id: sfio (AT&T Research) 2006-02-07 $\0\n";
** 05/31/2003 (sfsetbuf(f,f,align_size) to set alignment for data)
** (%I1d is fixed to handle "signed char" correctly)
** 01/01/2004 Porting issues to various platforms resolved.
+** 06/01/2008 Allowing notify() at entering/exiting thread-safe routines.
*/
/* the below is for protecting the application from SIGPIPE */
@@ -127,7 +128,7 @@ Sfio_t* f;
if(!(p = f->pool) )
p = f->pool = &_Sfpool;
- POOLMTXSTART(p);
+ POOLMTXENTER(p);
rv = -1;
@@ -581,7 +582,7 @@ reg int local; /* a local call */
errno = EBADF;
if(_Sfnotify) /* notify application of the error */
- (*_Sfnotify)(f,wanted,f->file);
+ (*_Sfnotify)(f, wanted, (void*)((long)f->file));
rv = -1;
break;
diff --git a/usr/src/lib/libast/common/sfio/sfmove.c b/usr/src/lib/libast/common/sfio/sfmove.c
index 11431bd57b..ae1af300ad 100644
--- a/usr/src/lib/libast/common/sfio/sfmove.c
+++ b/usr/src/lib/libast/common/sfio/sfmove.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -47,10 +47,12 @@ reg int rc; /* record separator */
Sfoff_t n_move, sk, cur;
uchar *rbuf = NIL(uchar*);
ssize_t rsize = 0;
+ SFMTXDECL(fr);
+ SFMTXDECL2(fw);
- SFMTXSTART(fr, (Sfoff_t)0);
+ SFMTXENTER(fr, (Sfoff_t)0);
if(fw)
- SFMTXLOCK(fw);
+ SFMTXBEGIN2(fw, (Sfoff_t)0);
for(n_move = 0; n != 0; )
{
@@ -230,11 +232,11 @@ reg int rc; /* record separator */
if(rbuf)
free(rbuf);
- SFOPEN(fr,0);
if(fw)
{ SFOPEN(fw,0);
- SFMTXUNLOCK(fw);
+ SFMTXEND2(fw);
}
+ SFOPEN(fr,0);
SFMTXRETURN(fr, n_move);
}
diff --git a/usr/src/lib/libast/common/sfio/sfmutex.c b/usr/src/lib/libast/common/sfio/sfmutex.c
index 7c36a54f10..c887a12f6e 100644
--- a/usr/src/lib/libast/common/sfio/sfmutex.c
+++ b/usr/src/lib/libast/common/sfio/sfmutex.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/sfio/sfnew.c b/usr/src/lib/libast/common/sfio/sfnew.c
index caa631e4db..8c462eba8b 100644
--- a/usr/src/lib/libast/common/sfio/sfnew.c
+++ b/usr/src/lib/libast/common/sfio/sfnew.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -120,7 +120,7 @@ int flags; /* type of file stream */
f->endb = f->endr = f->endw = f->next = f->data;
if(_Sfnotify)
- (*_Sfnotify)(f,SF_NEW,f->file);
+ (*_Sfnotify)(f, SF_NEW, (void*)((long)f->file));
if(f->flags&SF_STRING)
(void)_sfmode(f,f->mode&SF_RDWR,0);
diff --git a/usr/src/lib/libast/common/sfio/sfnotify.c b/usr/src/lib/libast/common/sfio/sfnotify.c
index 011f306145..cee5b9909f 100644
--- a/usr/src/lib/libast/common/sfio/sfnotify.c
+++ b/usr/src/lib/libast/common/sfio/sfnotify.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -27,7 +27,7 @@
** Written by Kiem-Phong Vo.
*/
#if __STD_C
-int sfnotify(void (*notify)(Sfio_t*, int, int))
+int sfnotify(void(*notify)(Sfio_t*, int, void*))
#else
int sfnotify(notify)
void (*notify)();
diff --git a/usr/src/lib/libast/common/sfio/sfnputc.c b/usr/src/lib/libast/common/sfio/sfnputc.c
index 74e63aafe5..b58eb6989b 100644
--- a/usr/src/lib/libast/common/sfio/sfnputc.c
+++ b/usr/src/lib/libast/common/sfio/sfnputc.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -27,20 +27,21 @@
*/
#if __STD_C
-ssize_t sfnputc(reg Sfio_t* f, reg int c, reg size_t n)
+ssize_t sfnputc(Sfio_t* f, int c, size_t n)
#else
ssize_t sfnputc(f,c,n)
-reg Sfio_t* f; /* file to write */
-reg int c; /* char to be written */
-reg size_t n; /* number of time to repeat */
+Sfio_t* f; /* file to write */
+int c; /* char to be written */
+size_t n; /* number of time to repeat */
#endif
{
reg uchar* ps;
reg ssize_t p, w;
uchar buf[128];
reg int local;
+ SFMTXDECL(f);
- SFMTXSTART(f,-1);
+ SFMTXENTER(f,-1);
GETLOCAL(f,local);
if(SFMODE(f,local) != SF_WRITE && _sfmode(f,SF_WRITE,local) < 0)
diff --git a/usr/src/lib/libast/common/sfio/sfopen.c b/usr/src/lib/libast/common/sfio/sfopen.c
index 04d55073f8..ed7a664722 100644
--- a/usr/src/lib/libast/common/sfio/sfopen.c
+++ b/usr/src/lib/libast/common/sfio/sfopen.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/sfio/sfpeek.c b/usr/src/lib/libast/common/sfio/sfpeek.c
index 9a2d3ef36b..be92216d8a 100644
--- a/usr/src/lib/libast/common/sfio/sfpeek.c
+++ b/usr/src/lib/libast/common/sfio/sfpeek.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/sfio/sfpkrd.c b/usr/src/lib/libast/common/sfio/sfpkrd.c
index 10ab826f87..7769682432 100644
--- a/usr/src/lib/libast/common/sfio/sfpkrd.c
+++ b/usr/src/lib/libast/common/sfio/sfpkrd.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -163,7 +163,7 @@ int action; /* >0: peeking, if rc>=0, get action records,
#endif /*_lib_select*/
if(r == -2)
{
-#if !_lib_poll && !_lib_select /* both poll and select cann't be used */
+#if !_lib_poll && !_lib_select /* both poll and select can't be used */
#ifdef FIONREAD /* quick and dirty check for availability */
long nsec = tm < 0 ? 0 : (tm+999)/1000;
while(nsec > 0 && r < 0)
@@ -208,6 +208,7 @@ int action; /* >0: peeking, if rc>=0, get action records,
* work around macos 10.4 recv(MSG_PEEK) bug that consumes pipe() data
*/
+ struct stat st;
static int recv_peek_ok;
if (!recv_peek_ok)
{
@@ -219,7 +220,7 @@ int action; /* >0: peeking, if rc>=0, get action records,
close(fds[0]);
close(fds[1]);
}
- if (recv_peek_ok < 0)
+ if (recv_peek_ok < 0 && !fstat(fd, &st) && !S_ISSOCK(st.st_mode))
{
r = -1;
t &= ~SOCKET_PEEK;
diff --git a/usr/src/lib/libast/common/sfio/sfpoll.c b/usr/src/lib/libast/common/sfio/sfpoll.c
index 642da85217..708d81fe44 100644
--- a/usr/src/lib/libast/common/sfio/sfpoll.c
+++ b/usr/src/lib/libast/common/sfio/sfpoll.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/sfio/sfpool.c b/usr/src/lib/libast/common/sfio/sfpool.c
index 67cfd04979..bf94a76d82 100644
--- a/usr/src/lib/libast/common/sfio/sfpool.c
+++ b/usr/src/lib/libast/common/sfio/sfpool.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -41,7 +41,7 @@ static int delpool(p)
reg Sfpool_t* p;
#endif
{
- POOLMTXSTART(p);
+ POOLMTXENTER(p);
if(p->s_sf && p->sf != p->array)
free((Void_t*)p->sf);
@@ -85,7 +85,7 @@ reg int mode;
POOLMTXUNLOCK(last);
}
- POOLMTXSTART(p);
+ POOLMTXENTER(p);
p->mode = mode&SF_SHARE;
p->s_sf = sizeof(p->array)/sizeof(p->array[0]);
@@ -108,7 +108,7 @@ int n; /* current position in pool */
reg ssize_t k, w, v;
reg int rv;
- POOLMTXSTART(p);
+ POOLMTXENTER(p);
if(n == 0)
POOLMTXRETURN(p,0);
@@ -175,7 +175,7 @@ Sfio_t* f; /* the stream */
int n; /* position in pool */
#endif
{
- POOLMTXSTART(p);
+ POOLMTXENTER(p);
p->n_sf -= 1;
for(; n < p->n_sf; ++n)
diff --git a/usr/src/lib/libast/common/sfio/sfpopen.c b/usr/src/lib/libast/common/sfio/sfpopen.c
index 2ee4b50cd1..d44b86e66f 100644
--- a/usr/src/lib/libast/common/sfio/sfpopen.c
+++ b/usr/src/lib/libast/common/sfio/sfpopen.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/sfio/sfprintf.c b/usr/src/lib/libast/common/sfio/sfprintf.c
index 0fa85d6069..46b07066b0 100644
--- a/usr/src/lib/libast/common/sfio/sfprintf.c
+++ b/usr/src/lib/libast/common/sfio/sfprintf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -69,21 +69,20 @@ va_list args;
-1,SF_WRITE|SF_STRING)) )
return -1;
- if((rv = sfvprintf(f,form,args)) < 0 )
- return -1;
- if(s && n > 0)
- { if((rv+1) >= n)
- n--;
- else
- n = rv;
- memcpy(s, f->data, n);
- s[n] = 0;
+ if((rv = sfvprintf(f,form,args)) >= 0 )
+ { if(s && n > 0)
+ { if((rv+1) >= n)
+ n--;
+ else
+ n = rv;
+ memcpy(s, f->data, n);
+ s[n] = 0;
+ }
+ _Sfi = rv;
}
sfclose(f);
- _Sfi = rv;
-
return rv;
}
diff --git a/usr/src/lib/libast/common/sfio/sfprints.c b/usr/src/lib/libast/common/sfio/sfprints.c
index 35f0f6017e..3e2c7261c7 100644
--- a/usr/src/lib/libast/common/sfio/sfprints.c
+++ b/usr/src/lib/libast/common/sfio/sfprints.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/sfio/sfpurge.c b/usr/src/lib/libast/common/sfio/sfpurge.c
index 4c1716bcee..d24567c0cf 100644
--- a/usr/src/lib/libast/common/sfio/sfpurge.c
+++ b/usr/src/lib/libast/common/sfio/sfpurge.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -27,15 +27,16 @@
*/
#if __STD_C
-int sfpurge(reg Sfio_t* f)
+int sfpurge(Sfio_t* f)
#else
int sfpurge(f)
-reg Sfio_t* f;
+Sfio_t* f;
#endif
{
reg int mode;
+ SFMTXDECL(f);
- SFMTXSTART(f,-1);
+ SFMTXENTER(f,-1);
if((mode = f->mode&SF_RDWR) != (int)f->mode && _sfmode(f,mode|SF_SYNCED,0) < 0)
SFMTXRETURN(f, -1);
diff --git a/usr/src/lib/libast/common/sfio/sfputd.c b/usr/src/lib/libast/common/sfio/sfputd.c
index 08a03ecdba..a3a64f7c34 100644
--- a/usr/src/lib/libast/common/sfio/sfputd.c
+++ b/usr/src/lib/libast/common/sfio/sfputd.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/sfio/sfputl.c b/usr/src/lib/libast/common/sfio/sfputl.c
index 3a77764505..281452d1b0 100644
--- a/usr/src/lib/libast/common/sfio/sfputl.c
+++ b/usr/src/lib/libast/common/sfio/sfputl.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/sfio/sfputm.c b/usr/src/lib/libast/common/sfio/sfputm.c
index c48700e7d3..6652839cf3 100644
--- a/usr/src/lib/libast/common/sfio/sfputm.c
+++ b/usr/src/lib/libast/common/sfio/sfputm.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/sfio/sfputr.c b/usr/src/lib/libast/common/sfio/sfputr.c
index 7f2da997a5..87dd1dd71a 100644
--- a/usr/src/lib/libast/common/sfio/sfputr.c
+++ b/usr/src/lib/libast/common/sfio/sfputr.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -26,18 +26,19 @@
** Written by Kiem-Phong Vo.
*/
#if __STD_C
-ssize_t sfputr(reg Sfio_t* f, const char* s, reg int rc)
+ssize_t sfputr(Sfio_t* f, const char* s, int rc)
#else
ssize_t sfputr(f,s,rc)
-reg Sfio_t* f; /* write to this stream */
+Sfio_t* f; /* write to this stream */
char* s; /* string to write */
-reg int rc; /* record separator. */
+int rc; /* record separator. */
#endif
{
reg ssize_t p, n, w;
reg uchar* ps;
+ SFMTXDECL(f);
- SFMTXSTART(f,-1);
+ SFMTXENTER(f,-1);
if(f->mode != SF_WRITE && _sfmode(f,SF_WRITE,0) < 0)
SFMTXRETURN(f, -1);
diff --git a/usr/src/lib/libast/common/sfio/sfputu.c b/usr/src/lib/libast/common/sfio/sfputu.c
index 28061e6e43..a72ba27592 100644
--- a/usr/src/lib/libast/common/sfio/sfputu.c
+++ b/usr/src/lib/libast/common/sfio/sfputu.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/sfio/sfraise.c b/usr/src/lib/libast/common/sfio/sfraise.c
index bf37338e0d..be98f6e15d 100644
--- a/usr/src/lib/libast/common/sfio/sfraise.c
+++ b/usr/src/lib/libast/common/sfio/sfraise.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -64,11 +64,12 @@ Void_t* data; /* associated data */
{
reg Sfdisc_t *disc, *next, *d;
reg int local, rv;
+ SFMTXDECL(f);
if(!f)
return _sfraiseall(type,data);
- SFMTXSTART(f, -1);
+ SFMTXENTER(f, -1);
GETLOCAL(f,local);
if(!SFKILLED(f) &&
diff --git a/usr/src/lib/libast/common/sfio/sfrd.c b/usr/src/lib/libast/common/sfio/sfrd.c
index 6ad4c5fb3d..515976d379 100644
--- a/usr/src/lib/libast/common/sfio/sfrd.c
+++ b/usr/src/lib/libast/common/sfio/sfrd.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -58,20 +58,21 @@ static void _sfwrsync()
}
#if __STD_C
-ssize_t sfrd(reg Sfio_t* f, reg Void_t* buf, reg size_t n, Sfdisc_t* disc)
+ssize_t sfrd(Sfio_t* f, Void_t* buf, size_t n, Sfdisc_t* disc)
#else
ssize_t sfrd(f,buf,n,disc)
-reg Sfio_t* f;
-reg Void_t* buf;
-reg size_t n;
+Sfio_t* f;
+Void_t* buf;
+size_t n;
Sfdisc_t* disc;
#endif
{
Sfoff_t r;
reg Sfdisc_t* dc;
reg int local, rcrv, dosync, oerrno;
+ SFMTXDECL(f);
- SFMTXSTART(f,-1);
+ SFMTXENTER(f,-1);
GETLOCAL(f,local);
if((rcrv = f->mode & (SF_RC|SF_RV)) )
diff --git a/usr/src/lib/libast/common/sfio/sfread.c b/usr/src/lib/libast/common/sfio/sfread.c
index 945491d836..f0d893b2ba 100644
--- a/usr/src/lib/libast/common/sfio/sfread.c
+++ b/usr/src/lib/libast/common/sfio/sfread.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -27,19 +27,20 @@
*/
#if __STD_C
-ssize_t sfread(reg Sfio_t* f, Void_t* buf, reg size_t n)
+ssize_t sfread(Sfio_t* f, Void_t* buf, size_t n)
#else
ssize_t sfread(f,buf,n)
-reg Sfio_t* f; /* read from this stream. */
+Sfio_t* f; /* read from this stream. */
Void_t* buf; /* buffer to read into */
-reg size_t n; /* number of bytes to be read. */
+size_t n; /* number of bytes to be read. */
#endif
{
reg uchar *s, *begs;
reg ssize_t r;
reg int local, justseek;
+ SFMTXDECL(f);
- SFMTXSTART(f, (ssize_t)(-1));
+ SFMTXENTER(f, (ssize_t)(-1));
GETLOCAL(f,local);
justseek = f->bits&SF_JUSTSEEK; f->bits &= ~SF_JUSTSEEK;
diff --git a/usr/src/lib/libast/common/sfio/sfreserve.c b/usr/src/lib/libast/common/sfio/sfreserve.c
index 27e7749618..0e9cdd6fdf 100644
--- a/usr/src/lib/libast/common/sfio/sfreserve.c
+++ b/usr/src/lib/libast/common/sfio/sfreserve.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -27,10 +27,10 @@
*/
#if __STD_C
-Void_t* sfreserve(reg Sfio_t* f, ssize_t size, int type)
+Void_t* sfreserve(Sfio_t* f, ssize_t size, int type)
#else
Void_t* sfreserve(f,size,type)
-reg Sfio_t* f; /* file to peek */
+Sfio_t* f; /* file to peek */
ssize_t size; /* size of peek */
int type; /* LOCKR: lock stream, LASTR: last record */
#endif
@@ -39,8 +39,9 @@ int type; /* LOCKR: lock stream, LASTR: last record */
reg Sfrsrv_t* rsrv;
reg Void_t* data;
reg int mode, local;
+ SFMTXDECL(f);
- SFMTXSTART(f,NIL(Void_t*));
+ SFMTXENTER(f,NIL(Void_t*));
sz = size < 0 ? -size : size;
@@ -105,14 +106,16 @@ int type; /* LOCKR: lock stream, LASTR: last record */
if(n > 0 && n >= sz) /* all done */
break;
- /* amount to perform IO */
- if(size == 0 || (f->mode&SF_WRITE) )
+ /* set amount to perform IO */
+ if(size == 0 || (f->mode&SF_WRITE))
iosz = -1;
+ else if(size < 0 && n == 0 && f->push) /* maybe stack-pop */
+ iosz = sz; /* so only get what is asked for */
else
- { iosz = sz - n;
- if(type != SF_LOCKR && size < 0 && iosz < (f->size - n) )
- iosz = f->size - n;
- if(iosz <= 0)
+ { iosz = sz - n; /* get enough to fulfill requirement */
+ if(size < 0 && iosz < (f->size - n) )
+ iosz = f->size - n; /* get as much as possible */
+ if(iosz <= 0) /* nothing to do */
break;
}
@@ -133,7 +136,13 @@ int type; /* LOCKR: lock stream, LASTR: last record */
break;
}
}
- else (void)SFFILBUF(f, iosz );
+ else
+ { /* sfreserve(f,0,0) == sfread(f, sfreserve(f,-1,SF_LOCKR), 0) */
+ if(size == 0 && type == 0)
+ f->mode |= SF_RV;
+
+ (void)SFFILBUF(f, iosz );
+ }
if((n = f->endb - f->next) <= 0)
n = 0;
diff --git a/usr/src/lib/libast/common/sfio/sfresize.c b/usr/src/lib/libast/common/sfio/sfresize.c
index 170e2363ac..d9a6f77d6a 100644
--- a/usr/src/lib/libast/common/sfio/sfresize.c
+++ b/usr/src/lib/libast/common/sfio/sfresize.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -33,7 +33,9 @@ Sfio_t* f;
Sfoff_t size;
#endif
{
- SFMTXSTART(f, -1);
+ SFMTXDECL(f);
+
+ SFMTXENTER(f, -1);
if(size < 0 || f->extent < 0 ||
(f->mode != SF_WRITE && _sfmode(f,SF_WRITE,0) < 0) )
diff --git a/usr/src/lib/libast/common/sfio/sfscanf.c b/usr/src/lib/libast/common/sfio/sfscanf.c
index 322e540c89..68977ed7f0 100644
--- a/usr/src/lib/libast/common/sfio/sfscanf.c
+++ b/usr/src/lib/libast/common/sfio/sfscanf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/sfio/sfseek.c b/usr/src/lib/libast/common/sfio/sfseek.c
index b330338cc6..045911d7a9 100644
--- a/usr/src/lib/libast/common/sfio/sfseek.c
+++ b/usr/src/lib/libast/common/sfio/sfseek.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -59,8 +59,9 @@ int type; /* 0: from org, 1: from here, 2: from end */
{
Sfoff_t r, s;
int mode, local, hardseek, mustsync;
+ SFMTXDECL(f);
- SFMTXSTART(f, (Sfoff_t)(-1));
+ SFMTXENTER(f, (Sfoff_t)(-1));
GETLOCAL(f,local);
diff --git a/usr/src/lib/libast/common/sfio/sfset.c b/usr/src/lib/libast/common/sfio/sfset.c
index 2618ba60b4..051aa5baed 100644
--- a/usr/src/lib/libast/common/sfio/sfset.c
+++ b/usr/src/lib/libast/common/sfio/sfset.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -27,17 +27,18 @@
*/
#if __STD_C
-int sfset(reg Sfio_t* f, reg int flags, reg int set)
+int sfset(Sfio_t* f, int flags, int set)
#else
int sfset(f,flags,set)
-reg Sfio_t* f;
-reg int flags;
-reg int set;
+Sfio_t* f;
+int flags;
+int set;
#endif
{
reg int oflags;
+ SFMTXDECL(f);
- SFMTXSTART(f,0);
+ SFMTXENTER(f,0);
if(flags == 0 && set == 0)
SFMTXRETURN(f, (f->flags&SF_FLAGS));
diff --git a/usr/src/lib/libast/common/sfio/sfsetbuf.c b/usr/src/lib/libast/common/sfio/sfsetbuf.c
index 79748507fe..566e7191b7 100644
--- a/usr/src/lib/libast/common/sfio/sfsetbuf.c
+++ b/usr/src/lib/libast/common/sfio/sfsetbuf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -90,12 +90,12 @@ static int setlinemode()
}
#if __STD_C
-Void_t* sfsetbuf(reg Sfio_t* f, reg Void_t* buf, reg size_t size)
+Void_t* sfsetbuf(Sfio_t* f, Void_t* buf, size_t size)
#else
Void_t* sfsetbuf(f,buf,size)
-reg Sfio_t* f; /* stream to be buffered */
-reg Void_t* buf; /* new buffer */
-reg size_t size; /* buffer size, -1 for default size */
+Sfio_t* f; /* stream to be buffered */
+Void_t* buf; /* new buffer */
+size_t size; /* buffer size, -1 for default size */
#endif
{
int sf_malloc, oflags, init, okmmap, local;
@@ -104,10 +104,11 @@ reg size_t size; /* buffer size, -1 for default size */
sfstat_t st;
uchar* obuf = NIL(uchar*);
ssize_t osize = 0;
+ SFMTXDECL(f);
SFONCE();
- SFMTXSTART(f,NIL(Void_t*));
+ SFMTXENTER(f,NIL(Void_t*));
GETLOCAL(f,local);
diff --git a/usr/src/lib/libast/common/sfio/sfsetfd.c b/usr/src/lib/libast/common/sfio/sfsetfd.c
index f3a10b1473..f21193b540 100644
--- a/usr/src/lib/libast/common/sfio/sfsetfd.c
+++ b/usr/src/lib/libast/common/sfio/sfsetfd.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -27,11 +27,11 @@
*/
#if __STD_C
-static int _sfdup(reg int fd, reg int newfd)
+static int _sfdup(int fd, int newfd)
#else
static int _sfdup(fd,newfd)
-reg int fd;
-reg int newfd;
+int fd;
+int newfd;
#endif
{
reg int dupfd;
@@ -56,16 +56,17 @@ reg int newfd;
}
#if __STD_C
-int sfsetfd(reg Sfio_t* f, reg int newfd)
+int sfsetfd(Sfio_t* f, int newfd)
#else
int sfsetfd(f,newfd)
-reg Sfio_t *f;
-reg int newfd;
+Sfio_t *f;
+int newfd;
#endif
{
reg int oldfd;
+ SFMTXDECL(f);
- SFMTXSTART(f, -1);
+ SFMTXENTER(f, -1);
if(f->flags&SF_STRING)
SFMTXRETURN(f, -1);
@@ -127,7 +128,7 @@ reg int newfd;
/* notify changes */
if(_Sfnotify)
- (*_Sfnotify)(f,SF_SETFD,newfd);
+ (*_Sfnotify)(f, SF_SETFD, (void*)((long)newfd));
f->file = newfd;
diff --git a/usr/src/lib/libast/common/sfio/sfsize.c b/usr/src/lib/libast/common/sfio/sfsize.c
index fbfcbb8c75..bea3b42b23 100644
--- a/usr/src/lib/libast/common/sfio/sfsize.c
+++ b/usr/src/lib/libast/common/sfio/sfsize.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -26,17 +26,18 @@
** Written by Kiem-Phong Vo.
*/
#if __STD_C
-Sfoff_t sfsize(reg Sfio_t* f)
+Sfoff_t sfsize(Sfio_t* f)
#else
Sfoff_t sfsize(f)
-reg Sfio_t* f;
+Sfio_t* f;
#endif
{
Sfdisc_t* disc;
reg int mode;
Sfoff_t s;
+ SFMTXDECL(f);
- SFMTXSTART(f, (Sfoff_t)(-1));
+ SFMTXENTER(f, (Sfoff_t)(-1));
if((mode = f->mode&SF_RDWR) != (int)f->mode && _sfmode(f,mode,0) < 0)
SFMTXRETURN(f, (Sfoff_t)(-1));
diff --git a/usr/src/lib/libast/common/sfio/sfsk.c b/usr/src/lib/libast/common/sfio/sfsk.c
index e59cb5167d..6e7c542da7 100644
--- a/usr/src/lib/libast/common/sfio/sfsk.c
+++ b/usr/src/lib/libast/common/sfio/sfsk.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -26,12 +26,12 @@
** Written by Kiem-Phong Vo.
*/
#if __STD_C
-Sfoff_t sfsk(reg Sfio_t* f, Sfoff_t addr, reg int type, Sfdisc_t* disc)
+Sfoff_t sfsk(Sfio_t* f, Sfoff_t addr, int type, Sfdisc_t* disc)
#else
Sfoff_t sfsk(f,addr,type,disc)
-reg Sfio_t* f;
+Sfio_t* f;
Sfoff_t addr;
-reg int type;
+int type;
Sfdisc_t* disc;
#endif
{
@@ -39,8 +39,9 @@ Sfdisc_t* disc;
reg Sfdisc_t* dc;
reg ssize_t s;
reg int local, mode;
+ SFMTXDECL(f);
- SFMTXSTART(f, (Sfoff_t)(-1));
+ SFMTXENTER(f, (Sfoff_t)(-1));
GETLOCAL(f,local);
if(!local && !(f->bits&SF_DCDOWN))
diff --git a/usr/src/lib/libast/common/sfio/sfstack.c b/usr/src/lib/libast/common/sfio/sfstack.c
index 27012aa23c..c2c86a7d58 100644
--- a/usr/src/lib/libast/common/sfio/sfstack.c
+++ b/usr/src/lib/libast/common/sfio/sfstack.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/sfio/sfstrtod.c b/usr/src/lib/libast/common/sfio/sfstrtod.c
index 87941e342f..a42e6b3551 100644
--- a/usr/src/lib/libast/common/sfio/sfstrtod.c
+++ b/usr/src/lib/libast/common/sfio/sfstrtod.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/sfio/sfstrtof.h b/usr/src/lib/libast/common/sfio/sfstrtof.h
index 2402c8c202..bc7c0113a6 100644
--- a/usr/src/lib/libast/common/sfio/sfstrtof.h
+++ b/usr/src/lib/libast/common/sfio/sfstrtof.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -299,7 +299,7 @@ S2F_function(str, end) char* str; char** end;
}
PUT(s);
if (v == 0)
- return v;
+ return negative ? -v : v;
if (fraction >= 0)
m -= 4 * (digits - fraction);
if (m < S2F_exp_2_min)
@@ -369,7 +369,7 @@ S2F_function(str, end) char* str; char** end;
}
do c = GET(s); while (c && !isspace(c));
PUT(s);
- return S2F_nan;
+ return negative ? -S2F_nan : S2F_nan;
}
else if (c < '1' || c > '9')
{
@@ -469,8 +469,9 @@ S2F_function(str, end) char* str; char** end;
* and at most one divide overall
*/
+ v = 0;
if (!part)
- return 0;
+ return negative ? -v : v;
else if ((m = parts[part-1].digits - digits) > 0)
digits += m;
else
@@ -480,7 +481,6 @@ S2F_function(str, end) char* str; char** end;
* combine the parts
*/
- v = 0;
while (part--)
{
p = parts[part].batch;
diff --git a/usr/src/lib/libast/common/sfio/sfswap.c b/usr/src/lib/libast/common/sfio/sfswap.c
index b4523e927b..0526591212 100644
--- a/usr/src/lib/libast/common/sfio/sfswap.c
+++ b/usr/src/lib/libast/common/sfio/sfswap.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/sfio/sfsync.c b/usr/src/lib/libast/common/sfio/sfsync.c
index 2d02f32242..4bcd095226 100644
--- a/usr/src/lib/libast/common/sfio/sfsync.c
+++ b/usr/src/lib/libast/common/sfio/sfsync.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -88,11 +88,12 @@ reg Sfio_t* f; /* stream to be synchronized */
{
int local, rv, mode, lock;
Sfio_t* origf;
+ SFMTXDECL(f);
if(!(origf = f) )
return _sfall();
- SFMTXSTART(origf,-1);
+ SFMTXENTER(origf,-1);
GETLOCAL(origf,local);
diff --git a/usr/src/lib/libast/common/sfio/sftable.c b/usr/src/lib/libast/common/sfio/sftable.c
index 6ea7b3b2a3..23a82fbe77 100644
--- a/usr/src/lib/libast/common/sfio/sftable.c
+++ b/usr/src/lib/libast/common/sfio/sftable.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/sfio/sftell.c b/usr/src/lib/libast/common/sfio/sftell.c
index 0f067d68c2..bdd4dcef46 100644
--- a/usr/src/lib/libast/common/sfio/sftell.c
+++ b/usr/src/lib/libast/common/sfio/sftell.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -27,16 +27,17 @@
*/
#if __STD_C
-Sfoff_t sftell(reg Sfio_t* f)
+Sfoff_t sftell(Sfio_t* f)
#else
Sfoff_t sftell(f)
-reg Sfio_t *f;
+Sfio_t *f;
#endif
{
reg int mode;
Sfoff_t p;
+ SFMTXDECL(f);
- SFMTXSTART(f, (Sfoff_t)(-1));
+ SFMTXENTER(f, (Sfoff_t)(-1));
/* set the stream to the right mode */
if((mode = f->mode&SF_RDWR) != (int)f->mode && _sfmode(f,mode,0) < 0)
diff --git a/usr/src/lib/libast/common/sfio/sftmp.c b/usr/src/lib/libast/common/sfio/sftmp.c
index 845826ba80..47b6b34b69 100644
--- a/usr/src/lib/libast/common/sfio/sftmp.c
+++ b/usr/src/lib/libast/common/sfio/sftmp.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -294,7 +294,7 @@ Sfdisc_t* disc;
reg int fd, m;
reg Sfio_t* sf;
Sfio_t newf, savf;
- void (*notifyf)_ARG_((Sfio_t*, int, int));
+ void (*notifyf)_ARG_((Sfio_t*, int, void*));
NOTUSED(val);
@@ -356,7 +356,7 @@ Sfdisc_t* disc;
/* announce change of status */
if(notifyf)
- (*notifyf)(f,SF_NEW,f->file);
+ (*notifyf)(f, SF_NEW, (void*)((long)f->file));
f->disc = disc->disc;
@@ -369,13 +369,13 @@ Sfdisc_t* disc;
}
#if __STD_C
-Sfio_t* sftmp(reg size_t s)
+Sfio_t* sftmp(size_t s)
#else
Sfio_t* sftmp(s)
-reg size_t s;
+size_t s;
#endif
{
- reg Sfio_t* f;
+ Sfio_t* f;
static Sfdisc_t Tmpdisc =
{ NIL(Sfread_f), NIL(Sfwrite_f), NIL(Sfseek_f), _tmpexcept,
#if _tmp_rmfail
diff --git a/usr/src/lib/libast/common/sfio/sfungetc.c b/usr/src/lib/libast/common/sfio/sfungetc.c
index 7dfbda4af4..b51b558676 100644
--- a/usr/src/lib/libast/common/sfio/sfungetc.c
+++ b/usr/src/lib/libast/common/sfio/sfungetc.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -26,13 +26,13 @@
** Written by Kiem-Phong Vo.
*/
#if __STD_C
-static int _uexcept(reg Sfio_t* f, reg int type, Void_t* val, reg Sfdisc_t* disc)
+static int _uexcept(Sfio_t* f, int type, Void_t* val, Sfdisc_t* disc)
#else
static int _uexcept(f,type,val,disc)
-reg Sfio_t *f;
-reg int type;
+Sfio_t *f;
+int type;
Void_t* val;
-reg Sfdisc_t *disc;
+Sfdisc_t *disc;
#endif
{
NOTUSED(val);
@@ -49,16 +49,17 @@ reg Sfdisc_t *disc;
}
#if __STD_C
-int sfungetc(reg Sfio_t* f, reg int c)
+int sfungetc(Sfio_t* f, int c)
#else
int sfungetc(f,c)
-reg Sfio_t* f; /* push back one byte to this stream */
-reg int c; /* the value to be pushed back */
+Sfio_t* f; /* push back one byte to this stream */
+int c; /* the value to be pushed back */
#endif
{
reg Sfio_t* uf;
+ SFMTXDECL(f);
- SFMTXSTART(f, -1)
+ SFMTXENTER(f, -1)
if(c < 0 || (f->mode != SF_READ && _sfmode(f,SF_READ,0) < 0))
SFMTXRETURN(f, -1);
diff --git a/usr/src/lib/libast/common/sfio/sfvprintf.c b/usr/src/lib/libast/common/sfio/sfvprintf.c
index d73538e6fd..a78fe2f3b5 100644
--- a/usr/src/lib/libast/common/sfio/sfvprintf.c
+++ b/usr/src/lib/libast/common/sfio/sfvprintf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -110,6 +110,7 @@ va_list args; /* arg list if !argf */
#endif
ssize_t size;
Sfdouble_t dval;
+ Void_t* valp;
char *tls[2], **ls; /* for %..[separ]s */
char* t_str; /* stuff between () */
ssize_t n_str; /* its length */
@@ -133,7 +134,7 @@ va_list args; /* arg list if !argf */
SFMBDCL(mbs) /* state of some string */
#ifdef mbwidth
char* osp;
- int n_w, sf_wcwidth;
+ int n_w, wc;
#endif
#endif
@@ -171,9 +172,11 @@ va_list args; /* arg list if !argf */
}
#endif /* _sffmt_small */
+ SFMTXDECL(f);
+
SFCVINIT(); /* initialize conversion tables */
- SFMTXSTART(f,-1);
+ SFMTXENTER(f,-1);
if(!form)
SFMTXRETURN(f, -1);
@@ -189,9 +192,6 @@ va_list args; /* arg list if !argf */
f->endb = f->data+sizeof(data);
}
SFINIT(f);
-#if _has_multibyte && defined(mbwidth)
- sf_wcwidth = f->flags & SF_WCWIDTH;
-#endif
tls[1] = NIL(char*);
@@ -662,8 +662,11 @@ loop_fmt :
continue;
case 'S':
- flags = (flags & ~SFFMT_TYPES) | SFFMT_LONG;
+ flags = (flags & ~(SFFMT_TYPES|SFFMT_LDOUBLE)) | SFFMT_LONG;
case 's':
+#if _has_multibyte && defined(mbwidth)
+ wc = (flags & SFFMT_LDOUBLE) && mbwide();
+#endif
if(base >= 0) /* list of strings */
{ if(!(ls = argv.sp) || !ls[0])
continue;
@@ -698,7 +701,7 @@ loop_fmt :
if((n_s = wcrtomb(buf, *wsp, &mbs)) <= 0)
break;
#ifdef mbwidth
- if(sf_wcwidth )
+ if(wc)
{ n_w = mbwidth(*wsp);
if(precis >= 0 && (w+n_w) > precis )
break;
@@ -711,12 +714,12 @@ loop_fmt :
v += n_s;
}
#ifdef mbwidth
- if(!sf_wcwidth )
+ if(!wc)
w = v;
#endif
}
-#if defined(mbwide) && defined(mbchar) && defined(mbwidth)
- else if (mbwide())
+#if _has_multibyte && defined(mbwidth)
+ else if (wc)
{ w = 0;
SFMBCLR(&mbs);
ssp = sp;
@@ -726,7 +729,7 @@ loop_fmt :
break;
osp = ssp;
n = mbchar(osp);
- n_w = sf_wcwidth ? mbwidth(n) : 1;
+ n_w = mbwidth(n);
if(precis >= 0 && (w+n_w) > precis )
break;
w += n_w;
@@ -779,8 +782,11 @@ loop_fmt :
continue;
case 'C':
- flags = (flags & ~SFFMT_TYPES) | SFFMT_LONG;
+ flags = (flags & ~(SFFMT_TYPES|SFFMT_LDOUBLE)) | SFFMT_LONG;
case 'c':
+#if _has_multibyte && defined(mbwidth)
+ wc = (flags & SFFMT_LDOUBLE) && mbwide();
+#endif
if(precis <= 0) /* # of times to repeat a character */
precis = 1;
#if _has_multibyte
@@ -818,7 +824,7 @@ loop_fmt :
if((n_s = wcrtomb(buf, *wsp++, &mbs)) <= 0)
break;
#ifdef mbwidth
- if(sf_wcwidth)
+ if(wc)
n_s = mbwidth(*(wsp - 1));
#endif
n = width - precis*n_s; /* padding amount */
@@ -951,6 +957,9 @@ loop_fmt :
#if _PACKAGE_ast
if(scale)
{ sp = fmtscale(lv, scale);
+#if _has_multibyte && defined(mbwidth)
+ wc = 0;
+#endif
goto str_cvt;
}
#endif
@@ -1008,6 +1017,9 @@ loop_fmt :
#if _PACKAGE_ast
if(scale)
{ sp = fmtscale(v, scale);
+#if _has_multibyte && defined(mbwidth)
+ wc = 0;
+#endif
goto str_cvt;
}
#endif
@@ -1103,24 +1115,26 @@ loop_fmt :
#if !_ast_fltmax_double
if(size == sizeof(Sfdouble_t) )
{ v = SFFMT_LDOUBLE;
+ valp = &argv.ld;
dval = argv.ld;
}
else
#endif
{ v = 0;
+ valp = &argv.d;
dval = argv.d;
}
if(fmt == 'e' || fmt == 'E' && (v |= SFFMT_UPPER))
{ v |= SFFMT_EFORMAT;
n = (precis = precis < 0 ? FPRECIS : precis)+1;
- ep = _sfcvt(dval,tmp+1,sizeof(tmp)-1, min(n,SF_FDIGITS),
+ ep = _sfcvt(valp,tmp+1,sizeof(tmp)-1, min(n,SF_FDIGITS),
&decpt, &sign, &n_s, v);
goto e_format;
}
else if(fmt == 'f' || fmt == 'F' && (v |= SFFMT_UPPER))
{ precis = precis < 0 ? FPRECIS : precis;
- ep = _sfcvt(dval,tmp+1,sizeof(tmp)-1, min(precis,SF_FDIGITS),
+ ep = _sfcvt(valp,tmp+1,sizeof(tmp)-1, min(precis,SF_FDIGITS),
&decpt, &sign, &n_s, v);
goto f_format;
}
@@ -1132,7 +1146,7 @@ loop_fmt :
else precis = 2*(sizeof(double) - 2);
}
n = precis + 1;
- ep = _sfcvt(dval,tmp+1,sizeof(tmp)-1, min(n,SF_FDIGITS),
+ ep = _sfcvt(valp,tmp+1,sizeof(tmp)-1, min(n,SF_FDIGITS),
&decpt, &sign, &n_s, v);
sp = endsp = buf+1; /* reserve space for sign */
@@ -1147,7 +1161,7 @@ loop_fmt :
if(fmt == 'G')
v |= SFFMT_UPPER;
v |= SFFMT_EFORMAT;
- ep = _sfcvt(dval,tmp+1,sizeof(tmp)-1, min(precis,SF_FDIGITS),
+ ep = _sfcvt(valp,tmp+1,sizeof(tmp)-1, min(precis,SF_FDIGITS),
&decpt, &sign, &n_s, v);
if(dval == 0.)
decpt = 1;
diff --git a/usr/src/lib/libast/common/sfio/sfvscanf.c b/usr/src/lib/libast/common/sfio/sfvscanf.c
index 6314bdc79f..a6f008b651 100644
--- a/usr/src/lib/libast/common/sfio/sfvscanf.c
+++ b/usr/src/lib/libast/common/sfio/sfvscanf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -348,9 +348,11 @@ va_list args;
(int)(*d++) : -1 )
#define SFungetc(f,c) (d -= 1)
+ SFMTXDECL(f);
+
SFCVINIT(); /* initialize conversion tables */
- SFMTXSTART(f,-1);
+ SFMTXENTER(f,-1);
if(!form || f->mode != SF_READ && _sfmode(f,SF_READ,0) < 0)
SFMTXRETURN(f, -1);
@@ -414,6 +416,8 @@ loop_fmt:
if(*form == '%')
{ form += 1;
+ do SFgetc(f,inp); while(isspace(inp)); /* skip starting blanks */
+ SFungetc(f,inp);
goto match_1;
}
diff --git a/usr/src/lib/libast/common/sfio/sfwr.c b/usr/src/lib/libast/common/sfio/sfwr.c
index 5c44c1596f..80c3aecfe4 100644
--- a/usr/src/lib/libast/common/sfio/sfwr.c
+++ b/usr/src/lib/libast/common/sfio/sfwr.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -28,12 +28,12 @@
/* hole preserving writes */
#if __STD_C
-static ssize_t sfoutput(Sfio_t* f, reg char* buf, reg size_t n)
+static ssize_t sfoutput(Sfio_t* f, char* buf, size_t n)
#else
static ssize_t sfoutput(f,buf,n)
Sfio_t* f;
-reg char* buf;
-reg size_t n;
+char* buf;
+size_t n;
#endif
{ reg char *sp, *wbuf, *endbuf;
reg ssize_t s, w, wr;
@@ -122,20 +122,21 @@ reg size_t n;
}
#if __STD_C
-ssize_t sfwr(reg Sfio_t* f, reg const Void_t* buf, reg size_t n, reg Sfdisc_t* disc)
+ssize_t sfwr(Sfio_t* f, const Void_t* buf, size_t n, Sfdisc_t* disc)
#else
ssize_t sfwr(f,buf,n,disc)
-reg Sfio_t* f;
-reg Void_t* buf;
-reg size_t n;
-reg Sfdisc_t* disc;
+Sfio_t* f;
+Void_t* buf;
+size_t n;
+Sfdisc_t* disc;
#endif
{
reg ssize_t w;
reg Sfdisc_t* dc;
reg int local, oerrno;
+ SFMTXDECL(f);
- SFMTXSTART(f,(ssize_t)(-1));
+ SFMTXENTER(f,(ssize_t)(-1));
GETLOCAL(f,local);
if(!local && !(f->bits&SF_DCDOWN)) /* an external user's call */
diff --git a/usr/src/lib/libast/common/sfio/sfwrite.c b/usr/src/lib/libast/common/sfio/sfwrite.c
index be7241ade8..82f7a04e61 100644
--- a/usr/src/lib/libast/common/sfio/sfwrite.c
+++ b/usr/src/lib/libast/common/sfio/sfwrite.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -27,19 +27,20 @@
*/
#if __STD_C
-ssize_t sfwrite(reg Sfio_t* f, const Void_t* buf, reg size_t n)
+ssize_t sfwrite(Sfio_t* f, const Void_t* buf, size_t n)
#else
ssize_t sfwrite(f,buf,n)
-reg Sfio_t* f; /* write to this stream. */
+Sfio_t* f; /* write to this stream. */
Void_t* buf; /* buffer to be written. */
-reg size_t n; /* number of bytes. */
+size_t n; /* number of bytes. */
#endif
{
reg uchar *s, *begs, *next;
reg ssize_t w;
reg int local;
+ SFMTXDECL(f);
- SFMTXSTART(f, (ssize_t)(-1));
+ SFMTXENTER(f, (ssize_t)(-1));
GETLOCAL(f,local);
diff --git a/usr/src/lib/libast/common/sfio/vthread.h b/usr/src/lib/libast/common/sfio/vthread.h
index cd2f7625ae..eb49278449 100644
--- a/usr/src/lib/libast/common/sfio/vthread.h
+++ b/usr/src/lib/libast/common/sfio/vthread.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/std/bytesex.h b/usr/src/lib/libast/common/std/bytesex.h
index 2bf2022afb..95c43e160d 100644
--- a/usr/src/lib/libast/common/std/bytesex.h
+++ b/usr/src/lib/libast/common/std/bytesex.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/std/dirent.h b/usr/src/lib/libast/common/std/dirent.h
index 32f33800b5..b94f22215f 100644
--- a/usr/src/lib/libast/common/std/dirent.h
+++ b/usr/src/lib/libast/common/std/dirent.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/std/endian.h b/usr/src/lib/libast/common/std/endian.h
index 2299b5a3bc..12539254b6 100644
--- a/usr/src/lib/libast/common/std/endian.h
+++ b/usr/src/lib/libast/common/std/endian.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/std/iconv.h b/usr/src/lib/libast/common/std/iconv.h
index e63b3f0fcd..58bc8240d2 100644
--- a/usr/src/lib/libast/common/std/iconv.h
+++ b/usr/src/lib/libast/common/std/iconv.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/std/nl_types.h b/usr/src/lib/libast/common/std/nl_types.h
index db7383c626..36c901d8ed 100644
--- a/usr/src/lib/libast/common/std/nl_types.h
+++ b/usr/src/lib/libast/common/std/nl_types.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/std/stdio.h b/usr/src/lib/libast/common/std/stdio.h
index 7e137c5712..42d7ed8269 100644
--- a/usr/src/lib/libast/common/std/stdio.h
+++ b/usr/src/lib/libast/common/std/stdio.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/std/wchar.h b/usr/src/lib/libast/common/std/wchar.h
index 557a403adc..7796480d09 100644
--- a/usr/src/lib/libast/common/std/wchar.h
+++ b/usr/src/lib/libast/common/std/wchar.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/_doprnt.c b/usr/src/lib/libast/common/stdio/_doprnt.c
index b1b7cc68ee..abe981daeb 100644
--- a/usr/src/lib/libast/common/stdio/_doprnt.c
+++ b/usr/src/lib/libast/common/stdio/_doprnt.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/_doscan.c b/usr/src/lib/libast/common/stdio/_doscan.c
index 1072ca4b42..1e1f40006b 100644
--- a/usr/src/lib/libast/common/stdio/_doscan.c
+++ b/usr/src/lib/libast/common/stdio/_doscan.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/_filbuf.c b/usr/src/lib/libast/common/stdio/_filbuf.c
index eb8306000a..48fc226ca7 100644
--- a/usr/src/lib/libast/common/stdio/_filbuf.c
+++ b/usr/src/lib/libast/common/stdio/_filbuf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/_flsbuf.c b/usr/src/lib/libast/common/stdio/_flsbuf.c
index 27ae6c1007..4c335cec46 100644
--- a/usr/src/lib/libast/common/stdio/_flsbuf.c
+++ b/usr/src/lib/libast/common/stdio/_flsbuf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/_stdfun.c b/usr/src/lib/libast/common/stdio/_stdfun.c
index 9db057bf8b..94c8b77241 100644
--- a/usr/src/lib/libast/common/stdio/_stdfun.c
+++ b/usr/src/lib/libast/common/stdio/_stdfun.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/_stdopen.c b/usr/src/lib/libast/common/stdio/_stdopen.c
index 73cbbc7dbf..cd2b40babf 100644
--- a/usr/src/lib/libast/common/stdio/_stdopen.c
+++ b/usr/src/lib/libast/common/stdio/_stdopen.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/_stdprintf.c b/usr/src/lib/libast/common/stdio/_stdprintf.c
index fed31a2bf9..0ccd914243 100644
--- a/usr/src/lib/libast/common/stdio/_stdprintf.c
+++ b/usr/src/lib/libast/common/stdio/_stdprintf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/_stdscanf.c b/usr/src/lib/libast/common/stdio/_stdscanf.c
index 210455e56c..863847ccf2 100644
--- a/usr/src/lib/libast/common/stdio/_stdscanf.c
+++ b/usr/src/lib/libast/common/stdio/_stdscanf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/_stdsprnt.c b/usr/src/lib/libast/common/stdio/_stdsprnt.c
index 3b35d404d4..ebff0918a3 100644
--- a/usr/src/lib/libast/common/stdio/_stdsprnt.c
+++ b/usr/src/lib/libast/common/stdio/_stdsprnt.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/_stdvbuf.c b/usr/src/lib/libast/common/stdio/_stdvbuf.c
index b057072bcc..7ad8add7e6 100644
--- a/usr/src/lib/libast/common/stdio/_stdvbuf.c
+++ b/usr/src/lib/libast/common/stdio/_stdvbuf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/_stdvsnprnt.c b/usr/src/lib/libast/common/stdio/_stdvsnprnt.c
index fdcd5e97a1..4d07332060 100644
--- a/usr/src/lib/libast/common/stdio/_stdvsnprnt.c
+++ b/usr/src/lib/libast/common/stdio/_stdvsnprnt.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/_stdvsprnt.c b/usr/src/lib/libast/common/stdio/_stdvsprnt.c
index 4ac5bc09e3..7a145eeef7 100644
--- a/usr/src/lib/libast/common/stdio/_stdvsprnt.c
+++ b/usr/src/lib/libast/common/stdio/_stdvsprnt.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/_stdvsscn.c b/usr/src/lib/libast/common/stdio/_stdvsscn.c
index 1eb7dd6065..451d036675 100644
--- a/usr/src/lib/libast/common/stdio/_stdvsscn.c
+++ b/usr/src/lib/libast/common/stdio/_stdvsscn.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/asprintf.c b/usr/src/lib/libast/common/stdio/asprintf.c
index 59fcf7bfb2..f7ed170751 100644
--- a/usr/src/lib/libast/common/stdio/asprintf.c
+++ b/usr/src/lib/libast/common/stdio/asprintf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/clearerr.c b/usr/src/lib/libast/common/stdio/clearerr.c
index 694ba8cccf..c7198a7c7a 100644
--- a/usr/src/lib/libast/common/stdio/clearerr.c
+++ b/usr/src/lib/libast/common/stdio/clearerr.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/fclose.c b/usr/src/lib/libast/common/stdio/fclose.c
index 7b5932612b..e7cbcfd483 100644
--- a/usr/src/lib/libast/common/stdio/fclose.c
+++ b/usr/src/lib/libast/common/stdio/fclose.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/fdopen.c b/usr/src/lib/libast/common/stdio/fdopen.c
index 2b773bb948..92e1d7d9e5 100644
--- a/usr/src/lib/libast/common/stdio/fdopen.c
+++ b/usr/src/lib/libast/common/stdio/fdopen.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/feof.c b/usr/src/lib/libast/common/stdio/feof.c
index 506df65e64..8357345e69 100644
--- a/usr/src/lib/libast/common/stdio/feof.c
+++ b/usr/src/lib/libast/common/stdio/feof.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/ferror.c b/usr/src/lib/libast/common/stdio/ferror.c
index b04748b41a..698ade88b8 100644
--- a/usr/src/lib/libast/common/stdio/ferror.c
+++ b/usr/src/lib/libast/common/stdio/ferror.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/fflush.c b/usr/src/lib/libast/common/stdio/fflush.c
index 6f56b3e2ae..e30eb34bd7 100644
--- a/usr/src/lib/libast/common/stdio/fflush.c
+++ b/usr/src/lib/libast/common/stdio/fflush.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/fgetc.c b/usr/src/lib/libast/common/stdio/fgetc.c
index 411ca510d8..880c4a5abd 100644
--- a/usr/src/lib/libast/common/stdio/fgetc.c
+++ b/usr/src/lib/libast/common/stdio/fgetc.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/fgetpos.c b/usr/src/lib/libast/common/stdio/fgetpos.c
index dc7f8d16e9..988a3ebf2f 100644
--- a/usr/src/lib/libast/common/stdio/fgetpos.c
+++ b/usr/src/lib/libast/common/stdio/fgetpos.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/fgets.c b/usr/src/lib/libast/common/stdio/fgets.c
index 2b3f9d309f..99880271a0 100644
--- a/usr/src/lib/libast/common/stdio/fgets.c
+++ b/usr/src/lib/libast/common/stdio/fgets.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/fgetwc.c b/usr/src/lib/libast/common/stdio/fgetwc.c
index acf98c8a16..03728d867e 100644
--- a/usr/src/lib/libast/common/stdio/fgetwc.c
+++ b/usr/src/lib/libast/common/stdio/fgetwc.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/fgetws.c b/usr/src/lib/libast/common/stdio/fgetws.c
index e065eb45b0..d7e941c10a 100644
--- a/usr/src/lib/libast/common/stdio/fgetws.c
+++ b/usr/src/lib/libast/common/stdio/fgetws.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/fileno.c b/usr/src/lib/libast/common/stdio/fileno.c
index ab4eca5b67..f0cb8db31e 100644
--- a/usr/src/lib/libast/common/stdio/fileno.c
+++ b/usr/src/lib/libast/common/stdio/fileno.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/amd64/include/ast/ast_types.h b/usr/src/lib/libast/common/stdio/flockfile.c
index 6449f59df8..1da30178ef 100644
--- a/usr/src/lib/libast/amd64/include/ast/ast_types.h
+++ b/usr/src/lib/libast/common/stdio/flockfile.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,8 +19,14 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated by iffe version 2007-04-04 : : */
-#ifndef _def_types_ast
-#define _def_types_ast 1
-#define _sys_types 1 /* #include <sys/types.h> ok */
-#endif
+#pragma prototyped
+
+#include "stdhdr.h"
+
+void
+flockfile(Sfio_t* f)
+{
+ STDIO_VOID(f, "flockfile", void, (Sfio_t*), (f))
+
+ (void)sfmutex(f, SFMTX_LOCK);
+}
diff --git a/usr/src/lib/libast/common/stdio/fopen.c b/usr/src/lib/libast/common/stdio/fopen.c
index c926cee610..27d942a04b 100644
--- a/usr/src/lib/libast/common/stdio/fopen.c
+++ b/usr/src/lib/libast/common/stdio/fopen.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/fprintf.c b/usr/src/lib/libast/common/stdio/fprintf.c
index a1260375b1..c9974ff04c 100644
--- a/usr/src/lib/libast/common/stdio/fprintf.c
+++ b/usr/src/lib/libast/common/stdio/fprintf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/fpurge.c b/usr/src/lib/libast/common/stdio/fpurge.c
index 96e6118baf..e71564657e 100644
--- a/usr/src/lib/libast/common/stdio/fpurge.c
+++ b/usr/src/lib/libast/common/stdio/fpurge.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/fputc.c b/usr/src/lib/libast/common/stdio/fputc.c
index eee99dc127..1c4ece7e61 100644
--- a/usr/src/lib/libast/common/stdio/fputc.c
+++ b/usr/src/lib/libast/common/stdio/fputc.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/fputs.c b/usr/src/lib/libast/common/stdio/fputs.c
index 9ac183531f..1fd2c228b9 100644
--- a/usr/src/lib/libast/common/stdio/fputs.c
+++ b/usr/src/lib/libast/common/stdio/fputs.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/fputwc.c b/usr/src/lib/libast/common/stdio/fputwc.c
index 31745fe836..0fe7f8c9e8 100644
--- a/usr/src/lib/libast/common/stdio/fputwc.c
+++ b/usr/src/lib/libast/common/stdio/fputwc.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/fputws.c b/usr/src/lib/libast/common/stdio/fputws.c
index 9b3bf6897a..a37f961f5a 100644
--- a/usr/src/lib/libast/common/stdio/fputws.c
+++ b/usr/src/lib/libast/common/stdio/fputws.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/fread.c b/usr/src/lib/libast/common/stdio/fread.c
index 5ef44d15d8..0caeebc590 100644
--- a/usr/src/lib/libast/common/stdio/fread.c
+++ b/usr/src/lib/libast/common/stdio/fread.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -23,7 +23,7 @@
#include "stdhdr.h"
-ssize_t
+size_t
fread(void* p, size_t s, size_t n, Sfio_t* f)
{
ssize_t v;
diff --git a/usr/src/lib/libast/common/stdio/freopen.c b/usr/src/lib/libast/common/stdio/freopen.c
index d66b8a2bc8..f774b91b47 100644
--- a/usr/src/lib/libast/common/stdio/freopen.c
+++ b/usr/src/lib/libast/common/stdio/freopen.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/fscanf.c b/usr/src/lib/libast/common/stdio/fscanf.c
index 50c0f627f7..73da47c4a2 100644
--- a/usr/src/lib/libast/common/stdio/fscanf.c
+++ b/usr/src/lib/libast/common/stdio/fscanf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/fseek.c b/usr/src/lib/libast/common/stdio/fseek.c
index 952beaf67a..84233b1b87 100644
--- a/usr/src/lib/libast/common/stdio/fseek.c
+++ b/usr/src/lib/libast/common/stdio/fseek.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/fseeko.c b/usr/src/lib/libast/common/stdio/fseeko.c
index b6d74272b3..1bafc4c97e 100644
--- a/usr/src/lib/libast/common/stdio/fseeko.c
+++ b/usr/src/lib/libast/common/stdio/fseeko.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/fsetpos.c b/usr/src/lib/libast/common/stdio/fsetpos.c
index a39f11fa54..9e5c193cad 100644
--- a/usr/src/lib/libast/common/stdio/fsetpos.c
+++ b/usr/src/lib/libast/common/stdio/fsetpos.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/ftell.c b/usr/src/lib/libast/common/stdio/ftell.c
index 665b1f087a..225b34f408 100644
--- a/usr/src/lib/libast/common/stdio/ftell.c
+++ b/usr/src/lib/libast/common/stdio/ftell.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/ftello.c b/usr/src/lib/libast/common/stdio/ftello.c
index b03f182d75..0fbcbe153f 100644
--- a/usr/src/lib/libast/common/stdio/ftello.c
+++ b/usr/src/lib/libast/common/stdio/ftello.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/ast_types.h b/usr/src/lib/libast/common/stdio/ftrylockfile.c
index 6449f59df8..d4c40a5ce1 100644
--- a/usr/src/lib/libast/i386/include/ast/ast_types.h
+++ b/usr/src/lib/libast/common/stdio/ftrylockfile.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,8 +19,14 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated by iffe version 2007-04-04 : : */
-#ifndef _def_types_ast
-#define _def_types_ast 1
-#define _sys_types 1 /* #include <sys/types.h> ok */
-#endif
+#pragma prototyped
+
+#include "stdhdr.h"
+
+int
+ftrylockfile(Sfio_t* f)
+{
+ STDIO_INT(f, "ftrylockfile", int, (Sfio_t*), (f))
+
+ return sfmutex(f, SFMTX_TRYLOCK);
+}
diff --git a/usr/src/lib/libast/sparcv9/include/ast/ast_types.h b/usr/src/lib/libast/common/stdio/funlockfile.c
index 6449f59df8..6aee88a525 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/ast_types.h
+++ b/usr/src/lib/libast/common/stdio/funlockfile.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,8 +19,14 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated by iffe version 2007-04-04 : : */
-#ifndef _def_types_ast
-#define _def_types_ast 1
-#define _sys_types 1 /* #include <sys/types.h> ok */
-#endif
+#pragma prototyped
+
+#include "stdhdr.h"
+
+void
+funlockfile(Sfio_t* f)
+{
+ STDIO_VOID(f, "funlockfile", void, (Sfio_t*), (f))
+
+ (void)sfmutex(f, SFMTX_UNLOCK);
+}
diff --git a/usr/src/lib/libast/common/stdio/fwide.c b/usr/src/lib/libast/common/stdio/fwide.c
index a07ec9a196..4d472cafaa 100644
--- a/usr/src/lib/libast/common/stdio/fwide.c
+++ b/usr/src/lib/libast/common/stdio/fwide.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/fwprintf.c b/usr/src/lib/libast/common/stdio/fwprintf.c
index 3573e66678..3e7579369b 100644
--- a/usr/src/lib/libast/common/stdio/fwprintf.c
+++ b/usr/src/lib/libast/common/stdio/fwprintf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/fwrite.c b/usr/src/lib/libast/common/stdio/fwrite.c
index 1e7aace404..94a192ae4f 100644
--- a/usr/src/lib/libast/common/stdio/fwrite.c
+++ b/usr/src/lib/libast/common/stdio/fwrite.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -23,7 +23,7 @@
#include "stdhdr.h"
-ssize_t
+size_t
fwrite(const void* p, size_t s, size_t n, Sfio_t* f)
{
ssize_t v;
diff --git a/usr/src/lib/libast/common/stdio/fwscanf.c b/usr/src/lib/libast/common/stdio/fwscanf.c
index 7ebd2fc4f6..29838447a3 100644
--- a/usr/src/lib/libast/common/stdio/fwscanf.c
+++ b/usr/src/lib/libast/common/stdio/fwscanf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/getc.c b/usr/src/lib/libast/common/stdio/getc.c
index 901b897859..bfc0c9a0f6 100644
--- a/usr/src/lib/libast/common/stdio/getc.c
+++ b/usr/src/lib/libast/common/stdio/getc.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/getchar.c b/usr/src/lib/libast/common/stdio/getchar.c
index 18e1f2d413..f1c4a168b3 100644
--- a/usr/src/lib/libast/common/stdio/getchar.c
+++ b/usr/src/lib/libast/common/stdio/getchar.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/getw.c b/usr/src/lib/libast/common/stdio/getw.c
index e65358a2d8..031f4588c5 100644
--- a/usr/src/lib/libast/common/stdio/getw.c
+++ b/usr/src/lib/libast/common/stdio/getw.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/getwc.c b/usr/src/lib/libast/common/stdio/getwc.c
index 5cce3c7aa8..27d1273a86 100644
--- a/usr/src/lib/libast/common/stdio/getwc.c
+++ b/usr/src/lib/libast/common/stdio/getwc.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/getwchar.c b/usr/src/lib/libast/common/stdio/getwchar.c
index d7ea812b7b..2b08127e46 100644
--- a/usr/src/lib/libast/common/stdio/getwchar.c
+++ b/usr/src/lib/libast/common/stdio/getwchar.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/pclose.c b/usr/src/lib/libast/common/stdio/pclose.c
index 647bb5ebb6..51bdf3071b 100644
--- a/usr/src/lib/libast/common/stdio/pclose.c
+++ b/usr/src/lib/libast/common/stdio/pclose.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/popen.c b/usr/src/lib/libast/common/stdio/popen.c
index 47ffc3bb69..0f15e8b961 100644
--- a/usr/src/lib/libast/common/stdio/popen.c
+++ b/usr/src/lib/libast/common/stdio/popen.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/printf.c b/usr/src/lib/libast/common/stdio/printf.c
index 031f3fcda6..45dd3c8b5c 100644
--- a/usr/src/lib/libast/common/stdio/printf.c
+++ b/usr/src/lib/libast/common/stdio/printf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/putc.c b/usr/src/lib/libast/common/stdio/putc.c
index 5b6f3f7f13..c42448dd6b 100644
--- a/usr/src/lib/libast/common/stdio/putc.c
+++ b/usr/src/lib/libast/common/stdio/putc.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/putchar.c b/usr/src/lib/libast/common/stdio/putchar.c
index b318339a45..a43c666486 100644
--- a/usr/src/lib/libast/common/stdio/putchar.c
+++ b/usr/src/lib/libast/common/stdio/putchar.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/puts.c b/usr/src/lib/libast/common/stdio/puts.c
index 95c50464fe..96c114a3d9 100644
--- a/usr/src/lib/libast/common/stdio/puts.c
+++ b/usr/src/lib/libast/common/stdio/puts.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/putw.c b/usr/src/lib/libast/common/stdio/putw.c
index 0bb83e0d12..662a746d2a 100644
--- a/usr/src/lib/libast/common/stdio/putw.c
+++ b/usr/src/lib/libast/common/stdio/putw.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/putwc.c b/usr/src/lib/libast/common/stdio/putwc.c
index 7d3a709886..5929ca938b 100644
--- a/usr/src/lib/libast/common/stdio/putwc.c
+++ b/usr/src/lib/libast/common/stdio/putwc.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/putwchar.c b/usr/src/lib/libast/common/stdio/putwchar.c
index 005cfe62ad..9d6215ecde 100644
--- a/usr/src/lib/libast/common/stdio/putwchar.c
+++ b/usr/src/lib/libast/common/stdio/putwchar.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/rewind.c b/usr/src/lib/libast/common/stdio/rewind.c
index 813594245d..ae475316ab 100644
--- a/usr/src/lib/libast/common/stdio/rewind.c
+++ b/usr/src/lib/libast/common/stdio/rewind.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/scanf.c b/usr/src/lib/libast/common/stdio/scanf.c
index 69344d4f3a..459b3340e6 100644
--- a/usr/src/lib/libast/common/stdio/scanf.c
+++ b/usr/src/lib/libast/common/stdio/scanf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/setbuf.c b/usr/src/lib/libast/common/stdio/setbuf.c
index a82142376a..54998bda2a 100644
--- a/usr/src/lib/libast/common/stdio/setbuf.c
+++ b/usr/src/lib/libast/common/stdio/setbuf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/setbuffer.c b/usr/src/lib/libast/common/stdio/setbuffer.c
index 09ab19933f..9f2559e52a 100644
--- a/usr/src/lib/libast/common/stdio/setbuffer.c
+++ b/usr/src/lib/libast/common/stdio/setbuffer.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/setlinebuf.c b/usr/src/lib/libast/common/stdio/setlinebuf.c
index e677985a92..d354a94d0d 100644
--- a/usr/src/lib/libast/common/stdio/setlinebuf.c
+++ b/usr/src/lib/libast/common/stdio/setlinebuf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/setvbuf.c b/usr/src/lib/libast/common/stdio/setvbuf.c
index f271557138..f2d5cc46c7 100644
--- a/usr/src/lib/libast/common/stdio/setvbuf.c
+++ b/usr/src/lib/libast/common/stdio/setvbuf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/snprintf.c b/usr/src/lib/libast/common/stdio/snprintf.c
index 15092692bd..20495a7354 100644
--- a/usr/src/lib/libast/common/stdio/snprintf.c
+++ b/usr/src/lib/libast/common/stdio/snprintf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/sprintf.c b/usr/src/lib/libast/common/stdio/sprintf.c
index 4503b71c0b..c887627f9a 100644
--- a/usr/src/lib/libast/common/stdio/sprintf.c
+++ b/usr/src/lib/libast/common/stdio/sprintf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/sscanf.c b/usr/src/lib/libast/common/stdio/sscanf.c
index 4055b413e9..4d064d3758 100644
--- a/usr/src/lib/libast/common/stdio/sscanf.c
+++ b/usr/src/lib/libast/common/stdio/sscanf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/stdhdr.h b/usr/src/lib/libast/common/stdio/stdhdr.h
index d62ce91955..1b0c160453 100644
--- a/usr/src/lib/libast/common/stdio/stdhdr.h
+++ b/usr/src/lib/libast/common/stdio/stdhdr.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/stdio_c99.c b/usr/src/lib/libast/common/stdio/stdio_c99.c
index 6fe0d2c409..c75aad10e1 100644
--- a/usr/src/lib/libast/common/stdio/stdio_c99.c
+++ b/usr/src/lib/libast/common/stdio/stdio_c99.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/stdio_gnu.c b/usr/src/lib/libast/common/stdio/stdio_gnu.c
index 3db96d6748..ea420bb666 100644
--- a/usr/src/lib/libast/common/stdio/stdio_gnu.c
+++ b/usr/src/lib/libast/common/stdio/stdio_gnu.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/swprintf.c b/usr/src/lib/libast/common/stdio/swprintf.c
index 93da9590d2..b7b412f726 100644
--- a/usr/src/lib/libast/common/stdio/swprintf.c
+++ b/usr/src/lib/libast/common/stdio/swprintf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/swscanf.c b/usr/src/lib/libast/common/stdio/swscanf.c
index 957d2ccebf..acf72fdc48 100644
--- a/usr/src/lib/libast/common/stdio/swscanf.c
+++ b/usr/src/lib/libast/common/stdio/swscanf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/tmpfile.c b/usr/src/lib/libast/common/stdio/tmpfile.c
index d07fe0f642..cfcd311da5 100644
--- a/usr/src/lib/libast/common/stdio/tmpfile.c
+++ b/usr/src/lib/libast/common/stdio/tmpfile.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/ungetc.c b/usr/src/lib/libast/common/stdio/ungetc.c
index 2cc349a44c..bf3f5fa8fc 100644
--- a/usr/src/lib/libast/common/stdio/ungetc.c
+++ b/usr/src/lib/libast/common/stdio/ungetc.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/ungetwc.c b/usr/src/lib/libast/common/stdio/ungetwc.c
index 0b95324f4f..08c5aa362a 100644
--- a/usr/src/lib/libast/common/stdio/ungetwc.c
+++ b/usr/src/lib/libast/common/stdio/ungetwc.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/vasprintf.c b/usr/src/lib/libast/common/stdio/vasprintf.c
index 1031f52da4..6bdaf77fa0 100644
--- a/usr/src/lib/libast/common/stdio/vasprintf.c
+++ b/usr/src/lib/libast/common/stdio/vasprintf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/vfprintf.c b/usr/src/lib/libast/common/stdio/vfprintf.c
index 768d6f1c7c..cff1bd5d1d 100644
--- a/usr/src/lib/libast/common/stdio/vfprintf.c
+++ b/usr/src/lib/libast/common/stdio/vfprintf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/vfscanf.c b/usr/src/lib/libast/common/stdio/vfscanf.c
index c458925d7f..c9d4df1051 100644
--- a/usr/src/lib/libast/common/stdio/vfscanf.c
+++ b/usr/src/lib/libast/common/stdio/vfscanf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/vfwprintf.c b/usr/src/lib/libast/common/stdio/vfwprintf.c
index f3b8622bf8..a4a274c340 100644
--- a/usr/src/lib/libast/common/stdio/vfwprintf.c
+++ b/usr/src/lib/libast/common/stdio/vfwprintf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/vfwscanf.c b/usr/src/lib/libast/common/stdio/vfwscanf.c
index 2bdda90546..4ae8697fca 100644
--- a/usr/src/lib/libast/common/stdio/vfwscanf.c
+++ b/usr/src/lib/libast/common/stdio/vfwscanf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/vprintf.c b/usr/src/lib/libast/common/stdio/vprintf.c
index fef547d589..0824e692e9 100644
--- a/usr/src/lib/libast/common/stdio/vprintf.c
+++ b/usr/src/lib/libast/common/stdio/vprintf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/vscanf.c b/usr/src/lib/libast/common/stdio/vscanf.c
index 468bb0d02b..4e36c27bb3 100644
--- a/usr/src/lib/libast/common/stdio/vscanf.c
+++ b/usr/src/lib/libast/common/stdio/vscanf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/vsnprintf.c b/usr/src/lib/libast/common/stdio/vsnprintf.c
index b551a07a16..8ce4424d40 100644
--- a/usr/src/lib/libast/common/stdio/vsnprintf.c
+++ b/usr/src/lib/libast/common/stdio/vsnprintf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/vsprintf.c b/usr/src/lib/libast/common/stdio/vsprintf.c
index f47d75a6e0..7f3c173aaf 100644
--- a/usr/src/lib/libast/common/stdio/vsprintf.c
+++ b/usr/src/lib/libast/common/stdio/vsprintf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/vsscanf.c b/usr/src/lib/libast/common/stdio/vsscanf.c
index 5815aacb31..ea5a1adccd 100644
--- a/usr/src/lib/libast/common/stdio/vsscanf.c
+++ b/usr/src/lib/libast/common/stdio/vsscanf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/vswprintf.c b/usr/src/lib/libast/common/stdio/vswprintf.c
index 47fc724bd6..a3e90472b6 100644
--- a/usr/src/lib/libast/common/stdio/vswprintf.c
+++ b/usr/src/lib/libast/common/stdio/vswprintf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/vswscanf.c b/usr/src/lib/libast/common/stdio/vswscanf.c
index 9458930b93..da785c3723 100644
--- a/usr/src/lib/libast/common/stdio/vswscanf.c
+++ b/usr/src/lib/libast/common/stdio/vswscanf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/vwprintf.c b/usr/src/lib/libast/common/stdio/vwprintf.c
index 68dec6c7b9..77cdfcf99a 100644
--- a/usr/src/lib/libast/common/stdio/vwprintf.c
+++ b/usr/src/lib/libast/common/stdio/vwprintf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/vwscanf.c b/usr/src/lib/libast/common/stdio/vwscanf.c
index ba58fb38b4..fd388d0894 100644
--- a/usr/src/lib/libast/common/stdio/vwscanf.c
+++ b/usr/src/lib/libast/common/stdio/vwscanf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/wprintf.c b/usr/src/lib/libast/common/stdio/wprintf.c
index d710c83d34..180c83ef72 100644
--- a/usr/src/lib/libast/common/stdio/wprintf.c
+++ b/usr/src/lib/libast/common/stdio/wprintf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/stdio/wscanf.c b/usr/src/lib/libast/common/stdio/wscanf.c
index 985af725af..607a109219 100644
--- a/usr/src/lib/libast/common/stdio/wscanf.c
+++ b/usr/src/lib/libast/common/stdio/wscanf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/base64.c b/usr/src/lib/libast/common/string/base64.c
index 407213cba4..8132fdc3b7 100644
--- a/usr/src/lib/libast/common/string/base64.c
+++ b/usr/src/lib/libast/common/string/base64.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/ccmap.c b/usr/src/lib/libast/common/string/ccmap.c
index aae6d9ee83..139662c0f1 100644
--- a/usr/src/lib/libast/common/string/ccmap.c
+++ b/usr/src/lib/libast/common/string/ccmap.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/ccmapid.c b/usr/src/lib/libast/common/string/ccmapid.c
index 946a283013..52369e32c3 100644
--- a/usr/src/lib/libast/common/string/ccmapid.c
+++ b/usr/src/lib/libast/common/string/ccmapid.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/ccnative.c b/usr/src/lib/libast/common/string/ccnative.c
index fbdc6f8037..def38beee1 100644
--- a/usr/src/lib/libast/common/string/ccnative.c
+++ b/usr/src/lib/libast/common/string/ccnative.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/chresc.c b/usr/src/lib/libast/common/string/chresc.c
index 669ecfdf3a..ac9bb1c3df 100644
--- a/usr/src/lib/libast/common/string/chresc.c
+++ b/usr/src/lib/libast/common/string/chresc.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/chrtoi.c b/usr/src/lib/libast/common/string/chrtoi.c
index c42a775264..929809ee7b 100644
--- a/usr/src/lib/libast/common/string/chrtoi.c
+++ b/usr/src/lib/libast/common/string/chrtoi.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/fmtbase.c b/usr/src/lib/libast/common/string/fmtbase.c
index 7ff155e650..be5db317e1 100644
--- a/usr/src/lib/libast/common/string/fmtbase.c
+++ b/usr/src/lib/libast/common/string/fmtbase.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/fmtbuf.c b/usr/src/lib/libast/common/string/fmtbuf.c
index 3035fb5612..0423e21225 100644
--- a/usr/src/lib/libast/common/string/fmtbuf.c
+++ b/usr/src/lib/libast/common/string/fmtbuf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/fmtclock.c b/usr/src/lib/libast/common/string/fmtclock.c
index 3caaeeafe7..4a7f48eb48 100644
--- a/usr/src/lib/libast/common/string/fmtclock.c
+++ b/usr/src/lib/libast/common/string/fmtclock.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -37,8 +37,15 @@ fmtclock(register Sfulong_t t)
static unsigned int clk_tck;
- if (!clk_tck && !(clk_tck = (unsigned int)strtoul(astconf("CLK_TCK", NiL, NiL), NiL, 10)))
- clk_tck = 60;
+ if (!clk_tck)
+ {
+#ifdef CLOCKS_PER_SEC
+ clk_tck = CLOCKS_PER_SEC;
+#else
+ if (!(clk_tck = (unsigned int)strtoul(astconf("CLK_TCK", NiL, NiL), NiL, 10)))
+ clk_tck = 60;
+#endif
+ }
if (t == 0)
return "0";
if (t == ((Sfulong_t)~0))
diff --git a/usr/src/lib/libast/common/string/fmtdev.c b/usr/src/lib/libast/common/string/fmtdev.c
index 1e0cb29326..3b591ea8bc 100644
--- a/usr/src/lib/libast/common/string/fmtdev.c
+++ b/usr/src/lib/libast/common/string/fmtdev.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/fmtelapsed.c b/usr/src/lib/libast/common/string/fmtelapsed.c
index 6c940f1b6b..7df376be13 100644
--- a/usr/src/lib/libast/common/string/fmtelapsed.c
+++ b/usr/src/lib/libast/common/string/fmtelapsed.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/fmterror.c b/usr/src/lib/libast/common/string/fmterror.c
index 738dae50ff..379510f352 100644
--- a/usr/src/lib/libast/common/string/fmterror.c
+++ b/usr/src/lib/libast/common/string/fmterror.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/fmtesc.c b/usr/src/lib/libast/common/string/fmtesc.c
index 76b850d596..48b4efe8bd 100644
--- a/usr/src/lib/libast/common/string/fmtesc.c
+++ b/usr/src/lib/libast/common/string/fmtesc.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/fmtfmt.c b/usr/src/lib/libast/common/string/fmtfmt.c
index b4ec90ed54..dddfb805d8 100644
--- a/usr/src/lib/libast/common/string/fmtfmt.c
+++ b/usr/src/lib/libast/common/string/fmtfmt.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/fmtfs.c b/usr/src/lib/libast/common/string/fmtfs.c
index b4c275f5f9..1b7e0b1866 100644
--- a/usr/src/lib/libast/common/string/fmtfs.c
+++ b/usr/src/lib/libast/common/string/fmtfs.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/fmtgid.c b/usr/src/lib/libast/common/string/fmtgid.c
index eff0c87c66..9e5c9fe957 100644
--- a/usr/src/lib/libast/common/string/fmtgid.c
+++ b/usr/src/lib/libast/common/string/fmtgid.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/fmtident.c b/usr/src/lib/libast/common/string/fmtident.c
index f20c2be497..5210503c49 100644
--- a/usr/src/lib/libast/common/string/fmtident.c
+++ b/usr/src/lib/libast/common/string/fmtident.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/fmtip4.c b/usr/src/lib/libast/common/string/fmtip4.c
index 37750d2b77..623ae26dc9 100644
--- a/usr/src/lib/libast/common/string/fmtip4.c
+++ b/usr/src/lib/libast/common/string/fmtip4.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/fmtip6.c b/usr/src/lib/libast/common/string/fmtip6.c
new file mode 100644
index 0000000000..d5c0a6b894
--- /dev/null
+++ b/usr/src/lib/libast/common/string/fmtip6.c
@@ -0,0 +1,170 @@
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* David Korn <dgk@research.att.com> *
+* Phong Vo <kpv@research.att.com> *
+* *
+***********************************************************************/
+#pragma prototyped
+
+#if _PACKAGE_ast
+#include <ast.h>
+#endif
+
+#include <ip6.h>
+
+#if !_PACKAGE_ast
+
+/*
+ * return a pointer to n bytes from a circular re-use buffer
+ */
+
+static char*
+fmtbuf(int n)
+{
+ char* b;
+
+ static char buf[1024];
+ static char* p = buf;
+
+ if ((&buf[sizeof(buf)] - p) < n)
+ p = buf;
+ b = p;
+ p += n;
+ return b;
+}
+
+#endif
+
+/*
+ * copy p to s, then convert 0<=n<=999 to text
+ * next char in s returned
+ * caller ensures that s can take strlen(p)+3 bytes
+ */
+
+static char*
+dec(char* s, char* p, int n)
+{
+ while (*s = *p++)
+ s++;
+ if (n >= 100)
+ *s++ = '0' + ((n / 100) % 10);
+ if (n >= 10)
+ *s++ = '0' + ((n / 10) % 10);
+ *s++ = '0' + (n % 10);
+ return s;
+}
+
+/*
+ * return pointer to normalized ipv6 address addr
+ * with optional prefix bits if 0 < bits <= 128
+ * return value in short-term circular buffer
+ */
+
+char*
+fmtip6(unsigned char* addr, int bits)
+{
+ register unsigned char* a = addr;
+ register int n = IP6ADDR;
+ register int i;
+ register int z;
+ register int k;
+ register int m;
+ unsigned char r[IP6ADDR];
+ char* b;
+ char* s;
+
+ static const char dig[] = "0123456789ABCDEF";
+
+ s = b = fmtbuf(44);
+ r[m = z = 0] = 0;
+ if (a[0] == 0x20 && a[1] == 0x02 && (a[2] || a[3] || a[4] || a[5]))
+ {
+ z = 6;
+ s = dec(s, "2002:", a[2]);
+ s = dec(s, ".", a[3]);
+ s = dec(s, ".", a[4]);
+ s = dec(s, ".", a[5]);
+ }
+ for (i = z; i < n; i += 2)
+ {
+ for (k = i; i < n - 1 && !a[i] && !a[i + 1]; i += 2);
+ if ((r[k] = i - k) > r[m] || r[k] == r[m] && i >= (n - 1))
+ m = k;
+ }
+ if (!m)
+ switch (r[m])
+ {
+ case 0:
+ m = -1;
+ break;
+ case 14:
+ if (!a[14] && a[15] <= 15)
+ break;
+ /*FALLTHROUGH*/
+ case 12:
+ s = dec(s, "::", a[12]);
+ s = dec(s, ".", a[13]);
+ s = dec(s, ".", a[14]);
+ s = dec(s, ".", a[15]);
+ n = 0;
+ break;
+ case 10:
+ if (a[10] == 0xFF && a[11] == 0xFF)
+ {
+ s = dec(s, "::FFFF:", a[12]);
+ s = dec(s, ".", a[13]);
+ s = dec(s, ".", a[14]);
+ s = dec(s, ".", a[15]);
+ n = 0;
+ }
+ break;
+ }
+ for (i = z; i < n; i++)
+ {
+ if (i == m)
+ {
+ *s++ = ':';
+ *s++ = ':';
+ if ((i += r[m]) >= n)
+ break;
+ z = 0;
+ }
+ else if (i && !(i & 1))
+ {
+ if (z)
+ z = 0;
+ else
+ *s++ = '0';
+ *s++ = ':';
+ }
+ if ((k = (a[i] >> 4) & 0xf) || z)
+ {
+ z = 1;
+ *s++ = dig[k];
+ }
+ if ((k = a[i] & 0xf) || z)
+ {
+ z = 1;
+ *s++ = dig[k];
+ }
+ }
+ if (bits > 0 && bits <= 128)
+ s = dec(s, "/", bits);
+ *s = 0;
+ return b;
+}
diff --git a/usr/src/lib/libast/common/string/fmtls.c b/usr/src/lib/libast/common/string/fmtls.c
index ea00c00ffc..b8a835d2c1 100644
--- a/usr/src/lib/libast/common/string/fmtls.c
+++ b/usr/src/lib/libast/common/string/fmtls.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/fmtmatch.c b/usr/src/lib/libast/common/string/fmtmatch.c
index f5b27c71bd..44428a1d4e 100644
--- a/usr/src/lib/libast/common/string/fmtmatch.c
+++ b/usr/src/lib/libast/common/string/fmtmatch.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/fmtmode.c b/usr/src/lib/libast/common/string/fmtmode.c
index ae1dcaa8ec..542833582c 100644
--- a/usr/src/lib/libast/common/string/fmtmode.c
+++ b/usr/src/lib/libast/common/string/fmtmode.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/fmtnum.c b/usr/src/lib/libast/common/string/fmtnum.c
index a5410492e3..b35ee66f1b 100644
--- a/usr/src/lib/libast/common/string/fmtnum.c
+++ b/usr/src/lib/libast/common/string/fmtnum.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/fmtperm.c b/usr/src/lib/libast/common/string/fmtperm.c
index 187c43559e..b88e9a71d3 100644
--- a/usr/src/lib/libast/common/string/fmtperm.c
+++ b/usr/src/lib/libast/common/string/fmtperm.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/fmtre.c b/usr/src/lib/libast/common/string/fmtre.c
index 7f90074109..14f2df085c 100644
--- a/usr/src/lib/libast/common/string/fmtre.c
+++ b/usr/src/lib/libast/common/string/fmtre.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -148,6 +148,7 @@ fmtre(const char* as)
continue;
}
p->len = 0;
+ p->min = 0;
*t++ = *s++;
*t++ = '?';
}
diff --git a/usr/src/lib/libast/common/string/fmtscale.c b/usr/src/lib/libast/common/string/fmtscale.c
index 1c012b4c0d..2646c1b744 100644
--- a/usr/src/lib/libast/common/string/fmtscale.c
+++ b/usr/src/lib/libast/common/string/fmtscale.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/fmtsignal.c b/usr/src/lib/libast/common/string/fmtsignal.c
index a555f0f522..de435505d3 100644
--- a/usr/src/lib/libast/common/string/fmtsignal.c
+++ b/usr/src/lib/libast/common/string/fmtsignal.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/fmttime.c b/usr/src/lib/libast/common/string/fmttime.c
index a8094007c4..b67a0c788c 100644
--- a/usr/src/lib/libast/common/string/fmttime.c
+++ b/usr/src/lib/libast/common/string/fmttime.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/fmttmx.c b/usr/src/lib/libast/common/string/fmttmx.c
index c2c785ab21..f79693aa11 100644
--- a/usr/src/lib/libast/common/string/fmttmx.c
+++ b/usr/src/lib/libast/common/string/fmttmx.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/fmttv.c b/usr/src/lib/libast/common/string/fmttv.c
index 083d4f77d6..bdf8fabcdf 100644
--- a/usr/src/lib/libast/common/string/fmttv.c
+++ b/usr/src/lib/libast/common/string/fmttv.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/fmtuid.c b/usr/src/lib/libast/common/string/fmtuid.c
index 8561ca426d..ae33c07848 100644
--- a/usr/src/lib/libast/common/string/fmtuid.c
+++ b/usr/src/lib/libast/common/string/fmtuid.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/fmtversion.c b/usr/src/lib/libast/common/string/fmtversion.c
index 7ef6a6ed62..0868eafa04 100644
--- a/usr/src/lib/libast/common/string/fmtversion.c
+++ b/usr/src/lib/libast/common/string/fmtversion.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/memdup.c b/usr/src/lib/libast/common/string/memdup.c
index 98f8087fa6..f15de32dd9 100644
--- a/usr/src/lib/libast/common/string/memdup.c
+++ b/usr/src/lib/libast/common/string/memdup.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/modedata.c b/usr/src/lib/libast/common/string/modedata.c
index d24fd99392..9a73e9980f 100644
--- a/usr/src/lib/libast/common/string/modedata.c
+++ b/usr/src/lib/libast/common/string/modedata.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/modei.c b/usr/src/lib/libast/common/string/modei.c
index 61b351493f..78cff935f5 100644
--- a/usr/src/lib/libast/common/string/modei.c
+++ b/usr/src/lib/libast/common/string/modei.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/modelib.h b/usr/src/lib/libast/common/string/modelib.h
index 12a67200f7..6668ad2e24 100644
--- a/usr/src/lib/libast/common/string/modelib.h
+++ b/usr/src/lib/libast/common/string/modelib.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/modex.c b/usr/src/lib/libast/common/string/modex.c
index 6c1e0f1604..8a21f0c2da 100644
--- a/usr/src/lib/libast/common/string/modex.c
+++ b/usr/src/lib/libast/common/string/modex.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/stracmp.c b/usr/src/lib/libast/common/string/stracmp.c
index 330b7655cc..c0a0a2a5eb 100644
--- a/usr/src/lib/libast/common/string/stracmp.c
+++ b/usr/src/lib/libast/common/string/stracmp.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/strcopy.c b/usr/src/lib/libast/common/string/strcopy.c
index d14cd37940..1815a5c685 100644
--- a/usr/src/lib/libast/common/string/strcopy.c
+++ b/usr/src/lib/libast/common/string/strcopy.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/strdup.c b/usr/src/lib/libast/common/string/strdup.c
index 96b0ec4114..6831319620 100644
--- a/usr/src/lib/libast/common/string/strdup.c
+++ b/usr/src/lib/libast/common/string/strdup.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/strelapsed.c b/usr/src/lib/libast/common/string/strelapsed.c
index a64719fa12..fe49de2034 100644
--- a/usr/src/lib/libast/common/string/strelapsed.c
+++ b/usr/src/lib/libast/common/string/strelapsed.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -42,6 +42,7 @@ strelapsed(register const char* s, char** e, int n)
unsigned long t = 0;
int f = 0;
int p = 0;
+ int z = 1;
int m;
const char* last;
@@ -51,6 +52,15 @@ strelapsed(register const char* s, char** e, int n)
s++;
if (!*(last = s))
break;
+ if (z)
+ {
+ z = 0;
+ if (*s == '0' && (!(c = *(s + 1)) || isspace(c) || c == '_'))
+ {
+ last = s + 1;
+ break;
+ }
+ }
v = 0;
while ((c = *s++) >= '0' && c <= '9')
v = v * 10 + c - '0';
diff --git a/usr/src/lib/libast/common/string/strerror.c b/usr/src/lib/libast/common/string/strerror.c
index d053683052..54f6c8119c 100644
--- a/usr/src/lib/libast/common/string/strerror.c
+++ b/usr/src/lib/libast/common/string/strerror.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/stresc.c b/usr/src/lib/libast/common/string/stresc.c
index f6f0026eb9..eb53caa96c 100644
--- a/usr/src/lib/libast/common/string/stresc.c
+++ b/usr/src/lib/libast/common/string/stresc.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/streval.c b/usr/src/lib/libast/common/string/streval.c
index adc8000f2d..9b815c12a7 100644
--- a/usr/src/lib/libast/common/string/streval.c
+++ b/usr/src/lib/libast/common/string/streval.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/strexpr.c b/usr/src/lib/libast/common/string/strexpr.c
index bd4fa6aa76..d2055edfc6 100644
--- a/usr/src/lib/libast/common/string/strexpr.c
+++ b/usr/src/lib/libast/common/string/strexpr.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/strgid.c b/usr/src/lib/libast/common/string/strgid.c
index 10efdbdb99..dce5b04bc1 100644
--- a/usr/src/lib/libast/common/string/strgid.c
+++ b/usr/src/lib/libast/common/string/strgid.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/strlcat.c b/usr/src/lib/libast/common/string/strlcat.c
index 05dda0fcbe..3bbd39c689 100644
--- a/usr/src/lib/libast/common/string/strlcat.c
+++ b/usr/src/lib/libast/common/string/strlcat.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/strlcpy.c b/usr/src/lib/libast/common/string/strlcpy.c
index 7849db81b6..40b4c41cd9 100644
--- a/usr/src/lib/libast/common/string/strlcpy.c
+++ b/usr/src/lib/libast/common/string/strlcpy.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/strlook.c b/usr/src/lib/libast/common/string/strlook.c
index 43df592ea6..dbb05cd39d 100644
--- a/usr/src/lib/libast/common/string/strlook.c
+++ b/usr/src/lib/libast/common/string/strlook.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/strmatch.c b/usr/src/lib/libast/common/string/strmatch.c
index 169cf84ebf..9d38777298 100644
--- a/usr/src/lib/libast/common/string/strmatch.c
+++ b/usr/src/lib/libast/common/string/strmatch.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -93,7 +93,11 @@ strgrpmatch(const char* b, const char* p, int* sub, int n, register int flags)
return 0;
}
if (!*p)
+ {
+ if (sub && n > 0)
+ sub[0] = sub[1] = 0;
return *b == 0;
+ }
/*
* convert flags
diff --git a/usr/src/lib/libast/common/string/strmode.c b/usr/src/lib/libast/common/string/strmode.c
index ba33716bc8..e7e0d03ff2 100644
--- a/usr/src/lib/libast/common/string/strmode.c
+++ b/usr/src/lib/libast/common/string/strmode.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/strnacmp.c b/usr/src/lib/libast/common/string/strnacmp.c
index a77d33074e..f32e943f3e 100644
--- a/usr/src/lib/libast/common/string/strnacmp.c
+++ b/usr/src/lib/libast/common/string/strnacmp.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/strncopy.c b/usr/src/lib/libast/common/string/strncopy.c
index c25142f391..8441d905fd 100644
--- a/usr/src/lib/libast/common/string/strncopy.c
+++ b/usr/src/lib/libast/common/string/strncopy.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/strntod.c b/usr/src/lib/libast/common/string/strntod.c
index 29ea63403f..fb42b59fca 100644
--- a/usr/src/lib/libast/common/string/strntod.c
+++ b/usr/src/lib/libast/common/string/strntod.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/strntol.c b/usr/src/lib/libast/common/string/strntol.c
index 59a6f50536..0cc0af02ec 100644
--- a/usr/src/lib/libast/common/string/strntol.c
+++ b/usr/src/lib/libast/common/string/strntol.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/strntold.c b/usr/src/lib/libast/common/string/strntold.c
index 525ed5929b..83fcb9bf4a 100644
--- a/usr/src/lib/libast/common/string/strntold.c
+++ b/usr/src/lib/libast/common/string/strntold.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/strntoll.c b/usr/src/lib/libast/common/string/strntoll.c
index 158fbb34ac..7aa5cd48b9 100644
--- a/usr/src/lib/libast/common/string/strntoll.c
+++ b/usr/src/lib/libast/common/string/strntoll.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/ast_types.h b/usr/src/lib/libast/common/string/strnton.c
index 6449f59df8..43129dec1b 100644
--- a/usr/src/lib/libast/sparc/include/ast/ast_types.h
+++ b/usr/src/lib/libast/common/string/strnton.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,8 +19,14 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated by iffe version 2007-04-04 : : */
-#ifndef _def_types_ast
-#define _def_types_ast 1
-#define _sys_types 1 /* #include <sys/types.h> ok */
-#endif
+/*
+ * strnton() implementation
+ */
+
+#define S2I_function strnton
+#define S2I_number long
+#define S2I_unumber unsigned long
+#define S2I_multiplier 1
+#define S2I_size 1
+
+#include "strtoi.h"
diff --git a/usr/src/lib/libast/common/string/strntonll.c b/usr/src/lib/libast/common/string/strntonll.c
new file mode 100644
index 0000000000..5ab4077f18
--- /dev/null
+++ b/usr/src/lib/libast/common/string/strntonll.c
@@ -0,0 +1,32 @@
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* David Korn <dgk@research.att.com> *
+* Phong Vo <kpv@research.att.com> *
+* *
+***********************************************************************/
+/*
+ * strntonll() implementation
+ */
+
+#define S2I_function strntonll
+#define S2I_number intmax_t
+#define S2I_unumber uintmax_t
+#define S2I_multiplier 1
+#define S2I_size 1
+
+#include "strtoi.h"
diff --git a/usr/src/lib/libast/common/string/strntoul.c b/usr/src/lib/libast/common/string/strntoul.c
index ff98a61c88..db65fa6c60 100644
--- a/usr/src/lib/libast/common/string/strntoul.c
+++ b/usr/src/lib/libast/common/string/strntoul.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/strntoull.c b/usr/src/lib/libast/common/string/strntoull.c
index 19f2b25717..985356e2d1 100644
--- a/usr/src/lib/libast/common/string/strntoull.c
+++ b/usr/src/lib/libast/common/string/strntoull.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/stropt.c b/usr/src/lib/libast/common/string/stropt.c
index 9f28e9fb40..9890d9f8c1 100644
--- a/usr/src/lib/libast/common/string/stropt.c
+++ b/usr/src/lib/libast/common/string/stropt.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/strperm.c b/usr/src/lib/libast/common/string/strperm.c
index b54b193186..2eab0fadd1 100644
--- a/usr/src/lib/libast/common/string/strperm.c
+++ b/usr/src/lib/libast/common/string/strperm.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/strpsearch.c b/usr/src/lib/libast/common/string/strpsearch.c
index e627a5981c..69affd692e 100644
--- a/usr/src/lib/libast/common/string/strpsearch.c
+++ b/usr/src/lib/libast/common/string/strpsearch.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/strsearch.c b/usr/src/lib/libast/common/string/strsearch.c
index da5c9d7833..eebe7ac192 100644
--- a/usr/src/lib/libast/common/string/strsearch.c
+++ b/usr/src/lib/libast/common/string/strsearch.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/strsort.c b/usr/src/lib/libast/common/string/strsort.c
index daae6393cc..54e4067d5d 100644
--- a/usr/src/lib/libast/common/string/strsort.c
+++ b/usr/src/lib/libast/common/string/strsort.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/strtape.c b/usr/src/lib/libast/common/string/strtape.c
index 4f3d258a7e..75fc9ae5db 100644
--- a/usr/src/lib/libast/common/string/strtape.c
+++ b/usr/src/lib/libast/common/string/strtape.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/strtoi.h b/usr/src/lib/libast/common/string/strtoi.h
index 0f233d9ae5..3939aa2db7 100644
--- a/usr/src/lib/libast/common/string/strtoi.h
+++ b/usr/src/lib/libast/common/string/strtoi.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -357,7 +357,7 @@ S2I_function(a, e, base) const char* a; char** e; int base;
c = 0;
break;
}
- else if (c != thousand || !S2I_valid(s))
+ else if (!S2I_valid(s) || c != thousand)
break;
else if (!p && (s - b) > 4)
{
diff --git a/usr/src/lib/libast/common/string/strtoip4.c b/usr/src/lib/libast/common/string/strtoip4.c
index 3b00020af5..66b4eb32fe 100644
--- a/usr/src/lib/libast/common/string/strtoip4.c
+++ b/usr/src/lib/libast/common/string/strtoip4.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/strtoip6.c b/usr/src/lib/libast/common/string/strtoip6.c
new file mode 100644
index 0000000000..bfc8a00053
--- /dev/null
+++ b/usr/src/lib/libast/common/string/strtoip6.c
@@ -0,0 +1,200 @@
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* David Korn <dgk@research.att.com> *
+* Phong Vo <kpv@research.att.com> *
+* *
+***********************************************************************/
+#pragma prototyped
+
+#if _PACKAGE_ast
+#include <ast.h>
+#else
+#include <stdint.h>
+#endif
+
+#include <ctype.h>
+#include <ip6.h>
+
+/*
+ * convert string to ipv6 network byte order ip address
+ * with optional prefix bits
+ * pointer to first unused char placed in *e, even on error
+ * return 0:ok <0:error
+ */
+
+#define COL 16
+#define DOT 17
+#define END 18
+#define PFX 19
+
+int
+strtoip6(register const char* s, char** e, unsigned char* addr, unsigned char* bits)
+{
+ register unsigned char* b = addr;
+ register unsigned char* x = b + IP6ADDR;
+ register unsigned char* z;
+ register int c;
+ register uint32_t a;
+
+ static unsigned char lex[256];
+
+ if (!lex[0])
+ {
+ for (c = 0; c < sizeof(lex); ++c)
+ lex[c] = END;
+ lex['0'] = 0;
+ lex['1'] = 1;
+ lex['2'] = 2;
+ lex['3'] = 3;
+ lex['4'] = 4;
+ lex['5'] = 5;
+ lex['6'] = 6;
+ lex['7'] = 7;
+ lex['8'] = 8;
+ lex['9'] = 9;
+ lex['A'] = lex['a'] = 10;
+ lex['B'] = lex['b'] = 11;
+ lex['C'] = lex['c'] = 12;
+ lex['D'] = lex['d'] = 13;
+ lex['E'] = lex['e'] = 14;
+ lex['F'] = lex['f'] = 15;
+ lex[':'] = COL;
+ lex['.'] = DOT;
+ lex['/'] = PFX;
+ }
+ while (isspace(*s))
+ s++;
+ z = 0;
+ a = 0;
+ if (*s)
+ for (;;)
+ {
+ switch (c = lex[*((unsigned char*)s++)])
+ {
+ case END:
+ case PFX:
+ if ((x - b) < 2)
+ break;
+ *b++ = a>>8;
+ *b++ = a;
+ break;
+ case COL:
+ if ((x - b) < 2)
+ break;
+ *b++ = a>>8;
+ *b++ = a;
+ a = 0;
+ if (*s == ':')
+ {
+ if (z)
+ {
+ s--;
+ break;
+ }
+ z = b;
+ if ((c = lex[*((unsigned char*)++s)]) >= 16)
+ {
+ s++;
+ break;
+ }
+ }
+ continue;
+ case DOT:
+ if (b >= x)
+ {
+ s--;
+ break;
+ }
+ *b++ = ((a >> 8) & 0xf) * 100 + ((a >> 4) & 0xf) * 10 + (a & 0xf);
+ a = 0;
+ for (;;)
+ {
+ switch (c = lex[*((unsigned char*)s++)])
+ {
+ case COL:
+ case END:
+ case PFX:
+ if (b < x)
+ *b++ = a;
+ a = 0;
+ break;
+ case DOT:
+ if (b >= x)
+ break;
+ *b++ = a;
+ a = 0;
+ continue;
+ default:
+ a = (a * 10) + c;
+ continue;
+ }
+ break;
+ }
+ if (c == COL)
+ {
+ if (*s == ':')
+ {
+ if (z)
+ {
+ s--;
+ break;
+ }
+ z = b;
+ if ((c = lex[*((unsigned char*)++s)]) >= 16)
+ {
+ s++;
+ break;
+ }
+ }
+ if ((b - addr) == 6 && addr[0] == 0x20 && addr[1] == 0x02)
+ continue;
+ }
+ break;
+ default:
+ a = (a << 4) | c;
+ continue;
+ }
+ break;
+ }
+ if (b == addr)
+ c = END + 1;
+ else
+ {
+ if (z)
+ {
+ while (b > z)
+ *--x = *--b;
+ while (x > z)
+ *--x = 0;
+ }
+ else
+ while (b < x)
+ *b++ = 0;
+ if (bits)
+ {
+ a = 0;
+ if (c == PFX)
+ while ((c = lex[*((unsigned char*)s++)]) < 10)
+ a = a * 10 + c;
+ *bits = a;
+ }
+ }
+ if (e)
+ *e = (char*)(s - 1);
+ return c == END ? 0 : -1;
+}
diff --git a/usr/src/lib/libast/common/string/strton.c b/usr/src/lib/libast/common/string/strton.c
index 6b62fcff6d..35410be6d8 100644
--- a/usr/src/lib/libast/common/string/strton.c
+++ b/usr/src/lib/libast/common/string/strton.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/strtonll.c b/usr/src/lib/libast/common/string/strtonll.c
index eae3c43502..520ee67698 100644
--- a/usr/src/lib/libast/common/string/strtonll.c
+++ b/usr/src/lib/libast/common/string/strtonll.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/struid.c b/usr/src/lib/libast/common/string/struid.c
index 851d49b5e5..51c3a7b6be 100644
--- a/usr/src/lib/libast/common/string/struid.c
+++ b/usr/src/lib/libast/common/string/struid.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/struniq.c b/usr/src/lib/libast/common/string/struniq.c
index 906533e658..061b9169b7 100644
--- a/usr/src/lib/libast/common/string/struniq.c
+++ b/usr/src/lib/libast/common/string/struniq.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/swapget.c b/usr/src/lib/libast/common/string/swapget.c
index 04a58d0743..cdcdc32cb0 100644
--- a/usr/src/lib/libast/common/string/swapget.c
+++ b/usr/src/lib/libast/common/string/swapget.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/swapmem.c b/usr/src/lib/libast/common/string/swapmem.c
index 29184f32dc..8aa02d554b 100644
--- a/usr/src/lib/libast/common/string/swapmem.c
+++ b/usr/src/lib/libast/common/string/swapmem.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/swapop.c b/usr/src/lib/libast/common/string/swapop.c
index a7910a5783..6071dcfeee 100644
--- a/usr/src/lib/libast/common/string/swapop.c
+++ b/usr/src/lib/libast/common/string/swapop.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/swapput.c b/usr/src/lib/libast/common/string/swapput.c
index 7d98b4d181..f2669b9337 100644
--- a/usr/src/lib/libast/common/string/swapput.c
+++ b/usr/src/lib/libast/common/string/swapput.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/tok.c b/usr/src/lib/libast/common/string/tok.c
index 7bf89ca30c..32dda53e90 100644
--- a/usr/src/lib/libast/common/string/tok.c
+++ b/usr/src/lib/libast/common/string/tok.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/tokline.c b/usr/src/lib/libast/common/string/tokline.c
index 06ddb983b5..42c122d2f3 100644
--- a/usr/src/lib/libast/common/string/tokline.c
+++ b/usr/src/lib/libast/common/string/tokline.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/string/tokscan.c b/usr/src/lib/libast/common/string/tokscan.c
index f415c6709a..88b8a9693f 100644
--- a/usr/src/lib/libast/common/string/tokscan.c
+++ b/usr/src/lib/libast/common/string/tokscan.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/tm/tmdata.c b/usr/src/lib/libast/common/tm/tmdata.c
index 76e4431a44..a71ff9041e 100644
--- a/usr/src/lib/libast/common/tm/tmdata.c
+++ b/usr/src/lib/libast/common/tm/tmdata.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -185,7 +185,7 @@ static short sum[] = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 36
static Tm_leap_t leap[] =
{
- 946684822, 23, /* 1999-12-31+23:59:60 UTC*/
+ 1136073622, 23, /* 2005-12-31+23:59:60 UTC*/
915148821, 22, /* 1998-12-31+23:59:60 UTC */
867715220, 21, /* 1997-06-30+23:59:60 UTC */
820454419, 20, /* 1995-12-31+23:59:60 UTC */
@@ -229,6 +229,7 @@ static Tm_zone_t zone[] =
0, "UCT", 0, ( 0 * 60), 0, /* UTC */
0, "UTC", 0, ( 0 * 60), 0, /* UTC */
0, "CUT", 0, ( 0 * 60), 0, /* UTC */
+ 0, "Z", 0, ( 0 * 60), 0, /* UTC */
"USA", "HST", 0, (10 * 60), 0, /* Hawaii */
0, "YST", "YDT", ( 9 * 60), TM_DST, /* Yukon */
0, "PST", "PDT", ( 8 * 60), TM_DST, /* Pacific */
diff --git a/usr/src/lib/libast/common/tm/tmdate.c b/usr/src/lib/libast/common/tm/tmdate.c
index f5d1095d3c..ff89abe081 100644
--- a/usr/src/lib/libast/common/tm/tmdate.c
+++ b/usr/src/lib/libast/common/tm/tmdate.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/tm/tmequiv.c b/usr/src/lib/libast/common/tm/tmequiv.c
index 58c25b73c7..0a630e21bb 100644
--- a/usr/src/lib/libast/common/tm/tmequiv.c
+++ b/usr/src/lib/libast/common/tm/tmequiv.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/tm/tmfix.c b/usr/src/lib/libast/common/tm/tmfix.c
index 234bf56b9e..048161ea70 100644
--- a/usr/src/lib/libast/common/tm/tmfix.c
+++ b/usr/src/lib/libast/common/tm/tmfix.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/tm/tmfmt.c b/usr/src/lib/libast/common/tm/tmfmt.c
index 58a9ed1ccb..8349a814b3 100644
--- a/usr/src/lib/libast/common/tm/tmfmt.c
+++ b/usr/src/lib/libast/common/tm/tmfmt.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/tm/tmform.c b/usr/src/lib/libast/common/tm/tmform.c
index f4054a2c34..88040a0991 100644
--- a/usr/src/lib/libast/common/tm/tmform.c
+++ b/usr/src/lib/libast/common/tm/tmform.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/tm/tmgoff.c b/usr/src/lib/libast/common/tm/tmgoff.c
index ac6cfca89d..51d369757e 100644
--- a/usr/src/lib/libast/common/tm/tmgoff.c
+++ b/usr/src/lib/libast/common/tm/tmgoff.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/tm/tminit.c b/usr/src/lib/libast/common/tm/tminit.c
index 6ccab8c24e..fc2cb58a1d 100644
--- a/usr/src/lib/libast/common/tm/tminit.c
+++ b/usr/src/lib/libast/common/tm/tminit.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/tm/tmleap.c b/usr/src/lib/libast/common/tm/tmleap.c
index 0aa3d00b64..1bbd94289d 100644
--- a/usr/src/lib/libast/common/tm/tmleap.c
+++ b/usr/src/lib/libast/common/tm/tmleap.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/tm/tmlex.c b/usr/src/lib/libast/common/tm/tmlex.c
index 13339833c6..79d4b6f75d 100644
--- a/usr/src/lib/libast/common/tm/tmlex.c
+++ b/usr/src/lib/libast/common/tm/tmlex.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/tm/tmlocale.c b/usr/src/lib/libast/common/tm/tmlocale.c
index 9d88e6e273..7d542d16ce 100644
--- a/usr/src/lib/libast/common/tm/tmlocale.c
+++ b/usr/src/lib/libast/common/tm/tmlocale.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -474,7 +474,11 @@ static const Map_t map[] =
MON_10, (TM_MONTH+9),
MON_11, (TM_MONTH+10),
MON_12, (TM_MONTH+11),
+#ifdef _DATE_FMT
+ _DATE_FMT, TM_DEFAULT,
+#else
D_T_FMT, TM_DEFAULT,
+#endif
D_FMT, TM_DATE,
T_FMT, TM_TIME,
#ifdef ERA
diff --git a/usr/src/lib/libast/common/tm/tmmake.c b/usr/src/lib/libast/common/tm/tmmake.c
index f8d39ca3fa..df405877dd 100644
--- a/usr/src/lib/libast/common/tm/tmmake.c
+++ b/usr/src/lib/libast/common/tm/tmmake.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/tm/tmpoff.c b/usr/src/lib/libast/common/tm/tmpoff.c
index 442568574a..9f52d92bf7 100644
--- a/usr/src/lib/libast/common/tm/tmpoff.c
+++ b/usr/src/lib/libast/common/tm/tmpoff.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/tm/tmscan.c b/usr/src/lib/libast/common/tm/tmscan.c
index 928adb7612..1ef02b07f1 100644
--- a/usr/src/lib/libast/common/tm/tmscan.c
+++ b/usr/src/lib/libast/common/tm/tmscan.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/tm/tmsleep.c b/usr/src/lib/libast/common/tm/tmsleep.c
index 6158190dfd..69bc893020 100644
--- a/usr/src/lib/libast/common/tm/tmsleep.c
+++ b/usr/src/lib/libast/common/tm/tmsleep.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/tm/tmtime.c b/usr/src/lib/libast/common/tm/tmtime.c
index a57dcc00cb..9853a3cc15 100644
--- a/usr/src/lib/libast/common/tm/tmtime.c
+++ b/usr/src/lib/libast/common/tm/tmtime.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/tm/tmtype.c b/usr/src/lib/libast/common/tm/tmtype.c
index 29a0a8c77e..fb79fbc8ab 100644
--- a/usr/src/lib/libast/common/tm/tmtype.c
+++ b/usr/src/lib/libast/common/tm/tmtype.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/tm/tmweek.c b/usr/src/lib/libast/common/tm/tmweek.c
index 7618bd4cde..ce3f8a46a1 100644
--- a/usr/src/lib/libast/common/tm/tmweek.c
+++ b/usr/src/lib/libast/common/tm/tmweek.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/tm/tmword.c b/usr/src/lib/libast/common/tm/tmword.c
index 8333322856..6e8b571138 100644
--- a/usr/src/lib/libast/common/tm/tmword.c
+++ b/usr/src/lib/libast/common/tm/tmword.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/tm/tmxdate.c b/usr/src/lib/libast/common/tm/tmxdate.c
index 72a260459e..4307be04fd 100644
--- a/usr/src/lib/libast/common/tm/tmxdate.c
+++ b/usr/src/lib/libast/common/tm/tmxdate.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -31,6 +31,7 @@
#include <tmx.h>
#include <ctype.h>
+#include <debug.h>
#define dig1(s,n) ((n)=((*(s)++)-'0'))
#define dig2(s,n) ((n)=((*(s)++)-'0')*10,(n)+=(*(s)++)-'0')
@@ -51,11 +52,12 @@
#define MONTH (1<<11)
#define NEXT (1<<12)
#define NSEC (1<<13)
-#define SECOND (1<<14)
-#define THIS (1L<<15)
-#define WDAY (1L<<16)
-#define YEAR (1L<<17)
-#define ZONE (1L<<18)
+#define ORDINAL (1<<14)
+#define SECOND (1<<15)
+#define THIS (1L<<16)
+#define WDAY (1L<<17)
+#define YEAR (1L<<18)
+#define ZONE (1L<<19)
/*
* parse cron range into set
@@ -151,6 +153,7 @@ tmxdate(register const char* s, char** e, Time_t now)
* check DATEMSK first
*/
+ debug((error(-1, "AHA tmxdate 2008-05-22")));
fix = tmxscan(s, &last, NiL, &t, now, 0);
if (t && !*last)
{
@@ -185,6 +188,7 @@ tmxdate(register const char* s, char** e, Time_t now)
state &= (state & HOLD) ? ~(HOLD) : ~(EXACT|LAST|NEXT|THIS);
if ((set|state) & (YEAR|MONTH|DAY))
skip['/'] = 1;
+ message((-1, "AHA#%d state=%s%s%s%s| set=%s%s%s%s|", __LINE__, (state & EXACT) ? "|EXACT" : "", (state & LAST) ? "|LAST" : "", (state & THIS) ? "|THIS" : "", (state & NEXT) ? "|NEXT" : "", (set & EXACT) ? "|EXACT" : "", (set & LAST) ? "|LAST" : "", (set & THIS) ? "|THIS" : "", (set & NEXT) ? "|NEXT" : ""));
for (;;)
{
if (*s == '.' || *s == '-' || *s == '+')
@@ -281,7 +285,7 @@ tmxdate(register const char* s, char** e, Time_t now)
{
Time_t tt;
char hit[60];
- char mon[12];
+ char mon[13];
char day[7];
state |= CRON;
@@ -432,10 +436,11 @@ tmxdate(register const char* s, char** e, Time_t now)
now = n;
goto sns;
}
+ if ((*t == 'T' || *t == 't') && ((set|state) & (YEAR|MONTH|DAY)) == (YEAR|MONTH) && isdigit(*(t + 1)))
+ t++;
u = t + (*t == '-');
if ((w == 2 || w == 4) && (*u == 'W' || *u == 'w') && isdigit(*(u + 1)))
{
- t = u;
if (w == 4)
{
if ((n -= 1900) < TM_WINDOW)
@@ -444,47 +449,58 @@ tmxdate(register const char* s, char** e, Time_t now)
else if (n < TM_WINDOW)
n += 100;
m = n;
- n = strtol(s = t + 1, &t, 0);
- if ((i = (t - s)) < 2 || i > 3)
+ n = strtol(++u, &t, 10);
+ if ((i = (t - u)) < 2 || i > 3)
break;
- if (dig2(s, j) < 0 || j > 53)
- break;
- if (!(t - s) && *t == '-')
- n = strtol(s = t + 1, &t, 0);
- if (!(i = (t - s)))
+ if (i == 3)
+ {
+ k = n % 10;
+ n /= 10;
+ }
+ else if (*t != '-')
k = 1;
- else if (i != 1 || dig1(s, k) < 1 || k > 7)
+ else if (*++t && dig1(t, k) < 1 || k > 7)
break;
- else if (k == 7)
+ if (n < 0 || n > 53)
+ break;
+ if (k == 7)
k = 0;
tm->tm_year = m;
- tmweek(tm, 2, j, k);
+ tmweek(tm, 2, n, k);
set |= YEAR|MONTH|DAY;
+ s = t;
continue;
}
- else if ((w == 6 || w == 8) && (*u == 'T' || *u == 't') && isdigit(*(u + 1)))
+ else if (w == 6 || w == 8 && (n / 1000000) > 12)
{
- t = u;
+ t = (char*)s;
flags = 0;
- if (w == 8)
+ if (w == 8 || w == 6 && *u != 'T' && *u != 't')
{
- dig4(s, m);
+ dig4(t, m);
if ((m -= 1900) < TM_WINDOW)
break;
}
else
{
- dig2(s, m);
+ dig2(t, m);
if (m < TM_WINDOW)
m += 100;
}
flags |= YEAR;
- if (dig2(s, l) <= 0 || l > 12)
+ if (dig2(t, l) <= 0 || l > 12)
break;
flags |= MONTH;
- if (dig2(s, k) < 1 || k > 31)
- break;
- n = strtol(s = t + 1, &t, 0);
+ if (*t != 'T' && *t != 't' || !isdigit(*++t))
+ {
+ if (w == 6)
+ goto save_yymm;
+ if (dig2(t, k) < 1 || k > 31)
+ break;
+ flags |= DAY;
+ goto save_yymmdd;
+ }
+ n = strtol(s = t, &t, 0);
if ((t - s) < 2)
break;
if (dig2(s, j) > 24)
@@ -524,20 +540,26 @@ tmxdate(register const char* s, char** e, Time_t now)
}
else if (f == -1 && isalpha(*t) && tmlex(t, &t, tm_info.format + TM_ORDINAL, TM_ORDINALS - TM_ORDINAL, NiL, 0) >= 0)
{
+ message((-1, "AHA#%d n=%d", __LINE__, n));
ordinal:
- state |= (f = n) ? NEXT : THIS;
+ if (n)
+ n--;
+ message((-1, "AHA#%d n=%d", __LINE__, n));
+ state |= ((f = n) ? NEXT : THIS)|ORDINAL;
set &= ~(EXACT|LAST|NEXT|THIS);
set |= state & (EXACT|LAST|NEXT|THIS);
for (s = t; skip[*s]; s++);
if (isdigit(*s))
{
- n = strtol(s, &t, 10);
+ if (n = strtol(s, &t, 10))
+ n--;
s = t;
if (*s == '_')
s++;
}
else
n = -1;
+ message((-1, "AHA#%d f=%d n=%d", __LINE__, f, n));
}
else
{
@@ -556,7 +578,7 @@ tmxdate(register const char* s, char** e, Time_t now)
break;
state |= CCYYMMDDHHMMSS;
p = 0;
- if ((i == 7 || i == 5) && !*t)
+ if ((i == 7 || i == 5) && (!*t || *t == 'Z' || *t == 'z'))
{
if (i == 7)
{
@@ -654,13 +676,15 @@ tmxdate(register const char* s, char** e, Time_t now)
break;
}
save:
- tm->tm_year = m;
- tm->tm_mon = l - 1;
- tm->tm_mday = k;
tm->tm_hour = j;
tm->tm_min = i;
tm->tm_sec = n;
tm->tm_nsec = p;
+ save_yymmdd:
+ tm->tm_mday = k;
+ save_yymm:
+ tm->tm_mon = l - 1;
+ tm->tm_year = m;
s = t;
set |= flags;
continue;
@@ -727,6 +751,7 @@ tmxdate(register const char* s, char** e, Time_t now)
}
if (f >= 0 || (state & (LAST|NEXT)))
{
+ message((-1, "AHA#%d f=%d i=%d j=%d k=%d l=%d", __LINE__, f, i, j, k, l));
state &= ~HOLD;
if (f < 0)
{
@@ -823,9 +848,11 @@ tmxdate(register const char* s, char** e, Time_t now)
continue;
case TM_ORDINAL:
j += TM_ORDINALS - TM_ORDINAL;
+ message((-1, "AHA#%d j=%d", __LINE__, j));
/*FALLTHROUGH*/
case TM_ORDINALS:
n = j - TM_ORDINALS + 1;
+ message((-1, "AHA#%d n=%d", __LINE__, n));
goto ordinal;
case TM_MERIDIAN:
if (f >= 0)
@@ -890,6 +917,7 @@ tmxdate(register const char* s, char** e, Time_t now)
}
/*FALLTHROUGH*/
case TM_DAYS:
+ message((-1, "AHA#%d n=%d j=%d f=%d state=%s%s%s%s|", __LINE__, n, j, f, (state & EXACT) ? "|EXACT" : "", (state & LAST) ? "|LAST" : "", (state & THIS) ? "|THIS" : "", (state & NEXT) ? "|NEXT" : ""));
if (n == -1)
{
/*
@@ -898,16 +926,41 @@ tmxdate(register const char* s, char** e, Time_t now)
if (j == TM_PARTS && f == -1)
{
+ state &= ~(LAST|NEXT|THIS|ORDINAL); /*AHA*/
n = 2;
goto ordinal;
}
n = 1;
}
+
+ /*
+ * disambiguate "last" vs. { "previous" "final" }
+ */
+
+ while (isspace(*s))
+ s++;
+ message((-1, "AHA#%d disambiguate LAST s='%s'", __LINE__, s));
+ if ((k = tmlex(s, &t, tm_info.format + TM_NEXT, TM_EXACT - TM_NEXT, NiL, 0)) >= 0)
+ {
+ s = t;
+ if (state & LAST)
+ {
+ state &= ~LAST;
+ set &= ~LAST;
+ state |= FINAL;
+ set |= FINAL;
+ message((-1, "AHA#%d LAST => FINAL", __LINE__));
+ }
+ else
+ state &= ~(THIS|NEXT);
+ }
+ message((-1, "AHA#%d disambiguate LAST k=%d", __LINE__, k));
if (state & LAST)
n = -n;
else if (!(state & NEXT))
n--;
m = (f > 0) ? f * n : n;
+ message((-1, "AHA#%d f=%d n=%d i=%d j=%d k=%d l=%d m=%d state=%s%s%s%s|", __LINE__, f, n, i, j, k, l, m, (state & EXACT) ? "|EXACT" : "", (state & LAST) ? "|LAST" : "", (state & THIS) ? "|THIS" : "", (state & NEXT) ? "|NEXT" : ""));
switch (j)
{
case TM_DAYS+0:
@@ -975,21 +1028,47 @@ tmxdate(register const char* s, char** e, Time_t now)
set |= HOUR;
goto clear_min;
}
+ if (m >= 0 && (state & ORDINAL))
+ tm->tm_mday = 1;
tm = tmxmake(tmxtime(tm, zone));
day = j -= TM_DAY;
dir = m;
+ message((-1, "AHA#%d j=%d m=%d", __LINE__, j, m));
j -= tm->tm_wday;
+ message((-1, "AHA#%d mday=%d wday=%d day=%d dir=%d f=%d i=%d j=%d l=%d m=%d", __LINE__, tm->tm_mday, tm->tm_wday, day, dir, f, i, j, l, m));
if (state & (LAST|NEXT|THIS))
{
+ if (state & ORDINAL)
+ {
+ while (isspace(*s))
+ s++;
+ if (isdigit(*s) || tmlex(s, &t, tm_info.format, TM_DAY_ABBREV, NiL, 0) >= 0)
+ {
+ state &= ~(LAST|NEXT|THIS);
+ goto clear_hour;
+ }
+ }
if (j < 0)
j += 7;
}
else if (j > 0)
j -= 7;
- tm->tm_mday += j + m * 7;
+ message((-1, "AHA#%d day=%d mday=%d f=%d m=%d j=%d state=%s%s%s%s|", __LINE__, day, tm->tm_mday, f, m, j, (state & EXACT) ? "|EXACT" : "", (state & LAST) ? "|LAST" : "", (state & THIS) ? "|THIS" : "", (state & NEXT) ? "|NEXT" : ""));
set |= DAY;
- if (state & (LAST|NEXT|THIS))
+ if (set & FINAL)
goto clear_hour;
+ else if (state & (LAST|NEXT|THIS))
+ {
+ if (f >= 0)
+ day = -1;
+ else if (m > 0 && (state & (NEXT|YEAR|MONTH)) == NEXT && j >= 0)
+ m--;
+ tm->tm_mday += j + m * 7;
+ set &= ~(LAST|NEXT|THIS|ORDINAL); /*AHA*/
+ state &= ~(LAST|NEXT|THIS|ORDINAL); /*AHA*/
+ if (!(state & EXACT))
+ goto clear_hour;
+ }
continue;
case TM_MONTH_ABBREV:
j += TM_MONTH - TM_MONTH_ABBREV;
@@ -1058,13 +1137,15 @@ tmxdate(register const char* s, char** e, Time_t now)
zone = zp->west + dst;
tm_info.date = zp;
state |= ZONE;
- continue;
+ if (n < 0)
+ continue;
}
- if (!type && (zp = tmtype(s, &t)))
+ else if (!type && (zp = tmtype(s, &t)))
{
s = t;
type = zp->type;
- continue;
+ if (n < 0)
+ continue;
}
state |= BREAK;
}
@@ -1124,6 +1205,8 @@ tmxdate(register const char* s, char** e, Time_t now)
tm->tm_year += ((state & NEXT) ? 1 : 0) + ((tm->tm_mon < n) ? 1 : 0);
if (state & MDAY)
goto clear_hour;
+ set &= ~(LAST|NEXT|THIS); /*AHA*/
+ state &= ~(LAST|NEXT|THIS); /*AHA*/
goto clear_mday;
}
continue;
@@ -1181,6 +1264,7 @@ tmxdate(register const char* s, char** e, Time_t now)
continue;
tm->tm_mday = 1;
clear_hour:
+ message((-1, "AHA#%d DAY", __LINE__));
set |= DAY;
if ((set|state) & (EXACT|HOUR))
continue;
@@ -1204,8 +1288,8 @@ tmxdate(register const char* s, char** e, Time_t now)
done:
if (day >= 0 && !(state & (MDAY|WDAY)))
{
- if ((m = dir) > 0)
- m--;
+ message((-1, "AHA#%d day=%d dir=%d%s", __LINE__, day, dir, (state & FINAL) ? " FINAL" : ""));
+ m = dir;
if (state & MONTH)
tm->tm_mday = 1;
else if (m < 0)
diff --git a/usr/src/lib/libast/common/tm/tmxfmt.c b/usr/src/lib/libast/common/tm/tmxfmt.c
index 3019a8d7b9..5228d29036 100644
--- a/usr/src/lib/libast/common/tm/tmxfmt.c
+++ b/usr/src/lib/libast/common/tm/tmxfmt.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -46,8 +46,17 @@ number(register char* s, register char* e, register long n, register int p, int
{
char* b;
- if (w && w > p)
- p = w;
+ if (w)
+ {
+ if (p > 0 && (pad == 0 || pad == '0'))
+ while (w > p)
+ {
+ p++;
+ n *= 10;
+ }
+ else if (w > p)
+ p = w;
+ }
switch (pad)
{
case '-':
@@ -242,9 +251,8 @@ tmxfmt(char* buf, size_t len, const char* format, Time_t t)
case 'o': /* OBSOLETE */
p = tm_info.deformat;
goto push;
- case 'F': /* TM_DEFAULT */
- case 'O': /* OBSOLETE */
- p = tm_info.format[TM_DEFAULT];
+ case 'F': /* ISO 8601:2000 standard date format */
+ p = "%Y-%m-%d";
goto push;
case 'g': /* %V 2 digit year */
case 'G': /* %V 4 digit year */
@@ -303,6 +311,10 @@ tmxfmt(char* buf, size_t len, const char* format, Time_t t)
}
p = tm_info.format[TM_RECENT];
goto push;
+ case 'L': /* TM_DEFAULT */
+ case 'O': /* OBSOLETE */
+ p = tm_info.format[TM_DEFAULT];
+ goto push;
case 'm': /* month number */
cp = number(cp, ep, (long)(tp->tm_mon + 1), 2, width, pad);
continue;
@@ -447,7 +459,7 @@ tmxfmt(char* buf, size_t len, const char* format, Time_t t)
continue;
case 'z': /* time zone west offset */
if ((ep - cp) >= 16)
- cp = tmpoff(cp, ep - cp, "", (flags & TM_UTC) ? 0 : tm_info.zone->west, 24 * 60);
+ cp = tmpoff(cp, ep - cp, "", (flags & TM_UTC) ? 0 : tm_info.zone->west - (tp->tm_isdst ? 60 : 0), 24 * 60);
continue;
case 'Z': /* time zone */
p = (flags & TM_UTC) ? tm_info.format[TM_UT] : tp->tm_isdst && tm_info.zone->daylight ? tm_info.zone->daylight : tm_info.zone->standard;
diff --git a/usr/src/lib/libast/common/tm/tmxgettime.c b/usr/src/lib/libast/common/tm/tmxgettime.c
index 06f476d117..a07dab0728 100644
--- a/usr/src/lib/libast/common/tm/tmxgettime.c
+++ b/usr/src/lib/libast/common/tm/tmxgettime.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/tm/tmxleap.c b/usr/src/lib/libast/common/tm/tmxleap.c
index 23f13bafd3..12373eff36 100644
--- a/usr/src/lib/libast/common/tm/tmxleap.c
+++ b/usr/src/lib/libast/common/tm/tmxleap.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/tm/tmxmake.c b/usr/src/lib/libast/common/tm/tmxmake.c
index 5c49499b96..0fa21fc1af 100644
--- a/usr/src/lib/libast/common/tm/tmxmake.c
+++ b/usr/src/lib/libast/common/tm/tmxmake.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/tm/tmxscan.c b/usr/src/lib/libast/common/tm/tmxscan.c
index 5feafe7f67..e27f6f7541 100644
--- a/usr/src/lib/libast/common/tm/tmxscan.c
+++ b/usr/src/lib/libast/common/tm/tmxscan.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -262,6 +262,9 @@ scan(register const char* s, char** e, const char* format, char** f, Time_t t, l
goto more;
}
continue;
+ case 'F':
+ p = "%Y-%m-%d";
+ break;
case 'H':
case 'k':
NUMBER(2, 0, 23);
diff --git a/usr/src/lib/libast/common/tm/tmxsettime.c b/usr/src/lib/libast/common/tm/tmxsettime.c
index 25cf6b2c66..7b90cf4cd2 100644
--- a/usr/src/lib/libast/common/tm/tmxsettime.c
+++ b/usr/src/lib/libast/common/tm/tmxsettime.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/tm/tmxsleep.c b/usr/src/lib/libast/common/tm/tmxsleep.c
index da87478f83..4330a7801b 100644
--- a/usr/src/lib/libast/common/tm/tmxsleep.c
+++ b/usr/src/lib/libast/common/tm/tmxsleep.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/tm/tmxtime.c b/usr/src/lib/libast/common/tm/tmxtime.c
index 262d893317..a773dbff9a 100644
--- a/usr/src/lib/libast/common/tm/tmxtime.c
+++ b/usr/src/lib/libast/common/tm/tmxtime.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/tm/tmxtouch.c b/usr/src/lib/libast/common/tm/tmxtouch.c
index 67d84fecd2..d3545c32c6 100644
--- a/usr/src/lib/libast/common/tm/tmxtouch.c
+++ b/usr/src/lib/libast/common/tm/tmxtouch.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/tm/tmzone.c b/usr/src/lib/libast/common/tm/tmzone.c
index 784668d589..da0f35fe0e 100644
--- a/usr/src/lib/libast/common/tm/tmzone.c
+++ b/usr/src/lib/libast/common/tm/tmzone.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/tm/tvcmp.c b/usr/src/lib/libast/common/tm/tvcmp.c
index 39ce1631c4..0ab31a4783 100644
--- a/usr/src/lib/libast/common/tm/tvcmp.c
+++ b/usr/src/lib/libast/common/tm/tvcmp.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/tm/tvgettime.c b/usr/src/lib/libast/common/tm/tvgettime.c
index c20706beb2..47797c72a0 100644
--- a/usr/src/lib/libast/common/tm/tvgettime.c
+++ b/usr/src/lib/libast/common/tm/tvgettime.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/tm/tvsettime.c b/usr/src/lib/libast/common/tm/tvsettime.c
index 7cb46ae93a..6de2f12c12 100644
--- a/usr/src/lib/libast/common/tm/tvsettime.c
+++ b/usr/src/lib/libast/common/tm/tvsettime.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/tm/tvsleep.c b/usr/src/lib/libast/common/tm/tvsleep.c
index 6c5e31e634..cf8b735cdc 100644
--- a/usr/src/lib/libast/common/tm/tvsleep.c
+++ b/usr/src/lib/libast/common/tm/tvsleep.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/tm/tvtouch.c b/usr/src/lib/libast/common/tm/tvtouch.c
index 78ed01839a..1591ec66f9 100644
--- a/usr/src/lib/libast/common/tm/tvtouch.c
+++ b/usr/src/lib/libast/common/tm/tvtouch.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -33,6 +33,10 @@ __STDPP__directive pragma pp:hide utime
#define utime ______utime
#endif
+#ifndef _ATFILE_SOURCE
+#define _ATFILE_SOURCE 1
+#endif
+
#include <ast.h>
#include <ls.h>
#include <tv.h>
@@ -67,17 +71,71 @@ extern int utime(const char*, const time_t*);
* Tv_t==TV_TOUCH_RETAIN retains path value if it exists, current time otherwise
* otherwise it is exact time
* file created if it doesn't exist and (flags&1)
+ * symlink not followed if (flags&2)
* cv most likely ignored on most implementations
+ *
+ * NOTE: when *at() calls are integrated we need macros for the flags!
*/
int
tvtouch(const char* path, register const Tv_t* av, register const Tv_t* mv, const Tv_t* cv, int flags)
{
- struct stat st;
- Tv_t now;
int fd;
int mode;
int oerrno;
+ struct stat st;
+
+#if _lib_utimensat
+ struct timespec ts[2];
+
+ errno = oerrno;
+ if (!av)
+ {
+ ts[0].tv_sec = 0;
+ ts[0].tv_nsec = UTIME_NOW;
+ }
+ else if (av == TV_TOUCH_RETAIN)
+ {
+ ts[0].tv_sec = 0;
+ ts[0].tv_nsec = UTIME_OMIT;
+ }
+ else
+ {
+ ts[0].tv_sec = av->tv_sec;
+ ts[0].tv_nsec = NS(av->tv_nsec);
+ }
+ if (!mv)
+ {
+ ts[1].tv_sec = 0;
+ ts[1].tv_nsec = UTIME_NOW;
+ }
+ else if (mv == TV_TOUCH_RETAIN)
+ {
+ ts[1].tv_sec = 0;
+ ts[1].tv_nsec = UTIME_OMIT;
+ }
+ else
+ {
+ ts[1].tv_sec = mv->tv_sec;
+ ts[1].tv_nsec = NS(mv->tv_nsec);
+ }
+ if (!cv && av == TV_TOUCH_RETAIN && mv == TV_TOUCH_RETAIN && !stat(path, &st) && !chmod(path, st.st_mode & S_IPERM))
+ return 0;
+ if (!utimensat(AT_FDCWD, path, ts[0].tv_nsec == UTIME_NOW && ts[1].tv_nsec == UTIME_NOW ? (struct timespec*)0 : ts, (flags & 2) ? AT_SYMLINK_NOFOLLOW : 0))
+ return 0;
+ if (errno != ENOENT || !(flags & 1))
+ return -1;
+ umask(mode = umask(0));
+ mode = (~mode) & (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
+ if ((fd = open(path, O_WRONLY|O_CREAT|O_TRUNC, mode)) < 0)
+ return -1;
+ close(fd);
+ errno = oerrno;
+ if ((ts[0].tv_nsec != UTIME_NOW || ts[1].tv_nsec != UTIME_NOW) && utimensat(AT_FDCWD, path, ts, (flags & 2) ? AT_SYMLINK_NOFOLLOW : 0))
+ return -1;
+ return 0;
+#else
+ Tv_t now;
#if _lib_utimets
struct timespec am[2];
#else
@@ -228,5 +286,6 @@ tvtouch(const char* path, register const Tv_t* av, register const Tv_t* mv, cons
#endif
#endif
#endif
+#endif
}
diff --git a/usr/src/lib/libast/common/uwin/a64l.c b/usr/src/lib/libast/common/uwin/a64l.c
index 3142d2c6ef..36be08484e 100644
--- a/usr/src/lib/libast/common/uwin/a64l.c
+++ b/usr/src/lib/libast/common/uwin/a64l.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/uwin/cbrt.c b/usr/src/lib/libast/common/uwin/cbrt.c
index 8c8c32c1b9..511c99e258 100644
--- a/usr/src/lib/libast/common/uwin/cbrt.c
+++ b/usr/src/lib/libast/common/uwin/cbrt.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/uwin/err.c b/usr/src/lib/libast/common/uwin/err.c
index f84599a2dd..920f3af5be 100644
--- a/usr/src/lib/libast/common/uwin/err.c
+++ b/usr/src/lib/libast/common/uwin/err.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/uwin/getpass.c b/usr/src/lib/libast/common/uwin/getpass.c
index 4d74eef5c4..11d5c49f58 100644
--- a/usr/src/lib/libast/common/uwin/getpass.c
+++ b/usr/src/lib/libast/common/uwin/getpass.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/uwin/rand48.c b/usr/src/lib/libast/common/uwin/rand48.c
index 06c6ec5f02..d8e3aa238c 100644
--- a/usr/src/lib/libast/common/uwin/rand48.c
+++ b/usr/src/lib/libast/common/uwin/rand48.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/uwin/rint.c b/usr/src/lib/libast/common/uwin/rint.c
index 3a16fb5013..6761a429ab 100644
--- a/usr/src/lib/libast/common/uwin/rint.c
+++ b/usr/src/lib/libast/common/uwin/rint.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/vec/vecargs.c b/usr/src/lib/libast/common/vec/vecargs.c
index e30cd3b689..1ce1c2dc3a 100644
--- a/usr/src/lib/libast/common/vec/vecargs.c
+++ b/usr/src/lib/libast/common/vec/vecargs.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/vec/vecfile.c b/usr/src/lib/libast/common/vec/vecfile.c
index 0a81b31b1a..7bb91b6c14 100644
--- a/usr/src/lib/libast/common/vec/vecfile.c
+++ b/usr/src/lib/libast/common/vec/vecfile.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/vec/vecfree.c b/usr/src/lib/libast/common/vec/vecfree.c
index 474fbc98d2..fed8e5a76b 100644
--- a/usr/src/lib/libast/common/vec/vecfree.c
+++ b/usr/src/lib/libast/common/vec/vecfree.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/vec/vecload.c b/usr/src/lib/libast/common/vec/vecload.c
index 6439ae1091..1f7f18a38d 100644
--- a/usr/src/lib/libast/common/vec/vecload.c
+++ b/usr/src/lib/libast/common/vec/vecload.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/vec/vecstring.c b/usr/src/lib/libast/common/vec/vecstring.c
index a4be2a9e0a..71d1042c0c 100644
--- a/usr/src/lib/libast/common/vec/vecstring.c
+++ b/usr/src/lib/libast/common/vec/vecstring.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/vmalloc/malloc.c b/usr/src/lib/libast/common/vmalloc/malloc.c
index 24241d7b46..abe71cbf8b 100644
--- a/usr/src/lib/libast/common/vmalloc/malloc.c
+++ b/usr/src/lib/libast/common/vmalloc/malloc.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/vmalloc/vmbest.c b/usr/src/lib/libast/common/vmalloc/vmbest.c
index a84e3dfe0c..8e9ef32436 100644
--- a/usr/src/lib/libast/common/vmalloc/vmbest.c
+++ b/usr/src/lib/libast/common/vmalloc/vmbest.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -543,13 +543,17 @@ Vmalloc_t* vm;
reg Seg_t *seg, *next;
reg Block_t *bp, *t;
reg size_t size, segsize, round;
- reg int local;
+ reg int local, inuse;
reg Vmdata_t* vd = vm->data;
+ SETINUSE(vd, inuse);
+
if(!(local = vd->mode&VM_TRUST) )
{ GETLOCAL(vd,local);
if(ISLOCK(vd,local))
+ { CLRINUSE(vd, inuse);
return -1;
+ }
SETLOCK(vd,local);
}
@@ -618,6 +622,7 @@ Vmalloc_t* vm;
CLRLOCK(vd,local); /**/ASSERT(_vmbestcheck(vd, NIL(Block_t*)) == 0);
+ CLRINUSE(vd, inuse);
return 0;
}
@@ -633,12 +638,12 @@ reg size_t size; /* desired block size */
reg size_t s;
reg int n;
reg Block_t *tp, *np;
- reg int local;
+ reg int local, inuse;
size_t orgsize = 0;
if(!(_Vmassert & VM_init))
{ char *chk = getenv("VMCHECK");
- _Vmassert = VM_init|VM_primary|VM_secondary;
+ _Vmassert = VM_init;
if(chk)
{ int set = 1;
for(;; set ? (_Vmassert |= n) : (_Vmassert &= ~n))
@@ -673,18 +678,16 @@ reg size_t size; /* desired block size */
case 'C':
n = VM_check;
continue;
- case 'p':
- case 'P':
- n = VM_primary;
+#if _mem_mmap_anon || _mem_mmap_zero
+ case 'm':
+ case 'M':
+ n = VM_mmap;
+#endif
continue;
case 'r':
case 'R':
n = VM_region;
continue;
- case 's':
- case 'S':
- n = VM_secondary;
- continue;
default:
n = 0;
continue;
@@ -695,10 +698,14 @@ reg size_t size; /* desired block size */
}
/**/COUNT(N_alloc);
+ SETINUSE(vd, inuse);
+
if(!(local = vd->mode&VM_TRUST))
{ GETLOCAL(vd,local); /**/ASSERT(!ISLOCK(vd,local));
if(ISLOCK(vd,local) )
+ { CLRINUSE(vd, inuse);
return NIL(Void_t*);
+ }
SETLOCK(vd,local);
orgsize = size;
}
@@ -759,6 +766,7 @@ reg size_t size; /* desired block size */
vd->mode &= ~VM_AGAIN;
else
{ CLRLOCK(vd,local);
+ CLRINUSE(vd, inuse);
return NIL(Void_t*);
}
}
@@ -798,6 +806,7 @@ done:
CLRLOCK(vd,local);
ANNOUNCE(local, vm, VM_ALLOC, DATA(tp), vm->disc);
+ CLRINUSE(vd, inuse);
return DATA(tp);
}
@@ -813,12 +822,16 @@ Void_t* addr; /* address to check */
reg Block_t *b, *endb;
reg long offset;
reg Vmdata_t* vd = vm->data;
- reg int local;
+ reg int local, inuse;
+
+ SETINUSE(vd, inuse);
if(!(local = vd->mode&VM_TRUST) )
{ GETLOCAL(vd,local); /**/ASSERT(!ISLOCK(vd,local));
if(ISLOCK(vd,local))
+ { CLRINUSE(vd, inuse);
return -1L;
+ }
SETLOCK(vd,local);
}
@@ -856,6 +869,7 @@ Void_t* addr; /* address to check */
done:
CLRLOCK(vd,local);
+ CLRINUSE(vd, inuse);
return offset;
}
@@ -870,7 +884,7 @@ Void_t* data;
reg Vmdata_t* vd = vm->data;
reg Block_t *bp;
reg size_t s;
- reg int local;
+ reg int local, inuse;
#ifdef DEBUG
if((local = (int)data) >= 0 && local <= 0xf)
@@ -887,12 +901,14 @@ Void_t* data;
/**/COUNT(N_free);
+ SETINUSE(vd, inuse);
+
if(!(local = vd->mode&VM_TRUST) )
{ GETLOCAL(vd,local); /**/ASSERT(!ISLOCK(vd,local));
- if(ISLOCK(vd,local) )
- return -1;
- if(KPVADDR(vm,data,bestaddr) != 0 )
+ if(ISLOCK(vd,local) || KPVADDR(vm,data,bestaddr) != 0 )
+ { CLRINUSE(vd, inuse);
return -1;
+ }
SETLOCK(vd,local);
}
@@ -935,6 +951,7 @@ Void_t* data;
CLRLOCK(vd,local);
ANNOUNCE(local, vm, VM_FREE, data, vm->disc);
+ CLRINUSE(vd, inuse);
return 0;
}
@@ -949,13 +966,15 @@ int type; /* !=0 to move, <0 for not copy */
#endif
{
reg Block_t *rp, *np, *t;
- int local;
+ int local, inuse;
size_t s, bs, oldsize = 0, orgsize = 0;
Void_t *oldd, *orgdata = NIL(Void_t*);
Vmdata_t *vd = vm->data;
/**/COUNT(N_resize);
+ SETINUSE(vd, inuse);
+
if(!data)
{ if((data = bestalloc(vm,size)) )
{ oldsize = 0;
@@ -965,15 +984,16 @@ int type; /* !=0 to move, <0 for not copy */
}
if(size == 0)
{ (void)bestfree(vm,data);
+ CLRINUSE(vd, inuse);
return NIL(Void_t*);
}
if(!(local = vd->mode&VM_TRUST) )
{ GETLOCAL(vd,local); /**/ASSERT(!ISLOCK(vd,local));
- if(ISLOCK(vd,local) )
- return NIL(Void_t*);
- if(!local && KPVADDR(vm,data,bestaddr) != 0 )
+ if(ISLOCK(vd,local) || (!local && KPVADDR(vm,data,bestaddr) != 0 ) )
+ { CLRINUSE(vd, inuse);
return NIL(Void_t*);
+ }
SETLOCK(vd,local);
orgdata = data; /* for tracing */
@@ -1065,6 +1085,7 @@ int type; /* !=0 to move, <0 for not copy */
done: if(data && (type&VM_RSZERO) && (size = SIZE(BLOCK(data))&~BITS) > oldsize )
memset((Void_t*)((Vmuchar_t*)data + oldsize), 0, size-oldsize);
+ CLRINUSE(vd, inuse);
return data;
}
@@ -1080,10 +1101,15 @@ Void_t* addr; /* address to check */
reg Block_t *b, *endb;
reg long size;
reg Vmdata_t* vd = vm->data;
+ reg int inuse;
+
+ SETINUSE(vd, inuse);
if(!(vd->mode&VM_TRUST) )
{ if(ISLOCK(vd,0))
+ { CLRINUSE(vd, inuse);
return -1L;
+ }
SETLOCK(vd,0);
}
@@ -1110,6 +1136,7 @@ Void_t* addr; /* address to check */
done:
CLRLOCK(vd,0);
+ CLRINUSE(vd, inuse);
return size;
}
@@ -1125,17 +1152,21 @@ size_t align;
reg Vmuchar_t *data;
reg Block_t *tp, *np;
reg Seg_t* seg;
- reg int local;
+ reg int local, inuse;
reg size_t s, extra, orgsize = 0, orgalign = 0;
reg Vmdata_t* vd = vm->data;
if(size <= 0 || align <= 0)
return NIL(Void_t*);
+ SETINUSE(vd, inuse);
+
if(!(local = vd->mode&VM_TRUST) )
{ GETLOCAL(vd,local); /**/ASSERT(!ISLOCK(vd,local));
if(ISLOCK(vd,local) )
+ { CLRINUSE(vd, inuse);
return NIL(Void_t*);
+ }
SETLOCK(vd,local);
orgsize = size;
orgalign = align;
@@ -1207,6 +1238,7 @@ done:
CLRLOCK(vd,local);
ANNOUNCE(local, vm, VM_ALLOC, (Void_t*)data, vm->disc);
+ CLRINUSE(vd, inuse);
return (Void_t*)data;
}
@@ -1285,15 +1317,9 @@ Vmdisc_t* disc; /* discipline structure */
if(csize == 0) /* allocating new memory */
{
-#if ( _mem_sbrk || _mem_mmap_anon || _mem_mmap_zero )
-#define ALTERNATES VM_primary
-#endif
+
#if _mem_sbrk /* try using sbrk() and brk() */
-#if ALTERNATES
- if (_Vmassert & ALTERNATES)
-#undef ALTERNATES
-#define ALTERNATES VM_secondary
-#endif
+ if(!(_Vmassert & VM_mmap))
{
addr = (Vmuchar_t*)sbrk(0); /* old break value */
if(addr && addr != (Vmuchar_t*)BRK_FAILED )
@@ -1303,11 +1329,6 @@ Vmdisc_t* disc; /* discipline structure */
#endif /* _mem_sbrk */
#if _mem_mmap_anon /* anonymous mmap */
-#if ALTERNATES
- if (_Vmassert & ALTERNATES)
-#undef ALTERNATES
-#define ALTERNATES VM_secondary
-#endif
{
addr = (Vmuchar_t*)mmap(0, nsize, PROT_READ|PROT_WRITE,
MAP_ANON|MAP_PRIVATE, -1, 0);
@@ -1317,11 +1338,6 @@ Vmdisc_t* disc; /* discipline structure */
#endif /* _mem_mmap_anon */
#if _mem_mmap_zero /* mmap from /dev/zero */
-#if ALTERNATES
- if (_Vmassert & ALTERNATES)
-#undef ALTERNATES
-#define ALTERNATES VM_secondary
-#endif
{
if(mmdc->fd < 0)
{ int fd;
@@ -1351,16 +1367,8 @@ Vmdisc_t* disc; /* discipline structure */
}
else
{ addr = caddr; /* in case !_mem_sbrk */
-#if ( _mem_sbrk || _mem_mmap_anon || _mem_mmap_zero )
-#undef ALTERNATES
-#define ALTERNATES VM_primary
-#endif
+
#if _mem_sbrk
-#if ALTERNATES
- if (_Vmassert & ALTERNATES)
-#undef ALTERNATES
-#define ALTERNATES VM_secondary
-#endif
{
addr = (Vmuchar_t*)sbrk(0);
if(!addr || addr == (Vmuchar_t*)BRK_FAILED)
@@ -1375,11 +1383,6 @@ Vmdisc_t* disc; /* discipline structure */
#endif /* _mem_sbrk */
#if _mem_mmap_zero || _mem_mmap_anon
-#if ALTERNATES
- if (_Vmassert & ALTERNATES)
-#undef ALTERNATES
-#define ALTERNATES VM_secondary
-#endif
{
if(((Vmuchar_t*)caddr+csize) > addr) /* in mmap-space */
if(nsize == 0 && munmap(caddr,csize) == 0)
@@ -1391,7 +1394,7 @@ Vmdisc_t* disc; /* discipline structure */
}
#endif /*_done_sbrkmem*/
-#if !_done_sbrkmem /* use native malloc/free as a last resource */
+#if !_done_sbrkmem /* use native malloc/free as a last resort */
/**/ASSERT(_std_malloc); /* _std_malloc should be well-defined */
NOTUSED(vm);
NOTUSED(disc);
diff --git a/usr/src/lib/libast/common/vmalloc/vmclear.c b/usr/src/lib/libast/common/vmalloc/vmclear.c
index 3aaee44694..d80a396628 100644
--- a/usr/src/lib/libast/common/vmalloc/vmclear.c
+++ b/usr/src/lib/libast/common/vmalloc/vmclear.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -43,10 +43,14 @@ Vmalloc_t* vm;
reg Block_t* tp;
reg size_t size, s;
reg Vmdata_t* vd = vm->data;
+ reg int inuse;
+ SETINUSE(vd, inuse);
if(!(vd->mode&VM_TRUST) )
{ if(ISLOCK(vd,0))
+ { CLRINUSE(vd, inuse);
return -1;
+ }
SETLOCK(vd,0);
}
@@ -83,6 +87,7 @@ Vmalloc_t* vm;
}
CLRLOCK(vd,0);
+ CLRINUSE(vd, inuse);
return 0;
}
diff --git a/usr/src/lib/libast/common/vmalloc/vmclose.c b/usr/src/lib/libast/common/vmalloc/vmclose.c
index 9ad1a0719d..3ada670748 100644
--- a/usr/src/lib/libast/common/vmalloc/vmclose.c
+++ b/usr/src/lib/libast/common/vmalloc/vmclose.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/vmalloc/vmdcheap.c b/usr/src/lib/libast/common/vmalloc/vmdcheap.c
index c4697c7536..7c985ee68c 100644
--- a/usr/src/lib/libast/common/vmalloc/vmdcheap.c
+++ b/usr/src/lib/libast/common/vmalloc/vmdcheap.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/vmalloc/vmdebug.c b/usr/src/lib/libast/common/vmalloc/vmdebug.c
index 61eb8fedb0..f04c527e19 100644
--- a/usr/src/lib/libast/common/vmalloc/vmdebug.c
+++ b/usr/src/lib/libast/common/vmalloc/vmdebug.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -274,11 +274,14 @@ Void_t* addr;
reg Vmuchar_t* data;
reg long offset = -1L;
reg Vmdata_t* vd = vm->data;
- reg int local;
+ reg int local, inuse;
+ SETINUSE(vd, inuse);
GETLOCAL(vd,local);
if(ISLOCK(vd,local) || !addr)
+ { CLRINUSE(vd, inuse);
return -1L;
+ }
SETLOCK(vd,local);
b = endb = NIL(Block_t*);
@@ -319,6 +322,7 @@ Void_t* addr;
done:
CLRLOCK(vd,local);
+ CLRINUSE(vd, inuse);
return offset;
}
@@ -335,9 +339,13 @@ Void_t* addr;
reg Seg_t* seg;
reg long size;
reg Vmdata_t* vd = vm->data;
+ reg int inuse;
+ SETINUSE(vd, inuse);
if(ISLOCK(vd,0))
+ { CLRINUSE(vd, inuse);
return -1L;
+ }
SETLOCK(vd,0);
size = -1L;
@@ -359,6 +367,7 @@ Void_t* addr;
}
done:
CLRLOCK(vd,0);
+ CLRINUSE(vd, inuse);
return size;
}
@@ -376,11 +385,14 @@ size_t size;
reg int line;
reg Void_t* func;
reg Vmdata_t* vd = vm->data;
+ reg int inuse;
+ SETINUSE(vd, inuse);
VMFLF(vm,file,line,func);
if(ISLOCK(vd,0) )
{ dbwarn(vm,NIL(Vmuchar_t*),0,file,line,func,DB_ALLOC);
+ CLRINUSE(vd, inuse);
return NIL(Void_t*);
}
SETLOCK(vd,0);
@@ -411,6 +423,7 @@ size_t size;
done:
CLRLOCK(vd,0);
ANNOUNCE(0, vm, VM_ALLOC, (Void_t*)data, vm->disc);
+ CLRINUSE(vd, inuse);
return (Void_t*)data;
}
@@ -429,14 +442,19 @@ Void_t* data;
reg long offset;
reg int rv, *ip, *endip;
reg Vmdata_t* vd = vm->data;
+ reg int inuse;
+ SETINUSE(vd, inuse);
VMFLF(vm,file,line,func);
if(!data)
+ { CLRINUSE(vd, inuse);
return 0;
+ }
if(ISLOCK(vd,0) )
{ dbwarn(vm,NIL(Vmuchar_t*),0,file,line,func,DB_FREE);
+ CLRINUSE(vd, inuse);
return -1;
}
SETLOCK(vd,0);
@@ -449,6 +467,7 @@ Void_t* data;
(void)(*vm->disc->exceptf)(vm,VM_BADADDR,data,vm->disc);
dbwarn(vm,(Vmuchar_t*)data,offset == -1L ? 0 : 1,file,line,func,DB_FREE);
CLRLOCK(vd,0);
+ CLRINUSE(vd, inuse);
return -1;
}
@@ -469,6 +488,7 @@ Void_t* data;
rv = KPVFREE((vm), (Void_t*)DB2BEST(data), (*Vmbest->freef));
CLRLOCK(vd,0);
ANNOUNCE(0, vm, VM_FREE, data, vm->disc);
+ CLRINUSE(vd, inuse);
return rv;
}
@@ -490,7 +510,9 @@ int type; /* !=0 for movable, >0 for copy */
int line, oldline;
Void_t* func;
reg Vmdata_t* vd = vm->data;
+ reg int inuse;
+ SETINUSE(vd, inuse);
if(!addr)
{ oldsize = 0;
data = (Vmuchar_t*)dballoc(vm,size);
@@ -498,6 +520,7 @@ int type; /* !=0 for movable, >0 for copy */
}
if(size == 0)
{ (void)dbfree(vm,addr);
+ CLRINUSE(vd, inuse);
return NIL(Void_t*);
}
@@ -505,6 +528,7 @@ int type; /* !=0 for movable, >0 for copy */
if(ISLOCK(vd,0) )
{ dbwarn(vm,NIL(Vmuchar_t*),0,file,line,func,DB_RESIZE);
+ CLRINUSE(vd, inuse);
return NIL(Void_t*);
}
SETLOCK(vd,0);
@@ -517,6 +541,7 @@ int type; /* !=0 for movable, >0 for copy */
(void)(*vm->disc->exceptf)(vm,VM_BADADDR,addr,vm->disc);
dbwarn(vm,(Vmuchar_t*)addr,offset == -1L ? 0 : 1,file,line,func,DB_RESIZE);
CLRLOCK(vd,0);
+ CLRINUSE(vd, inuse);
return NIL(Void_t*);
}
@@ -558,6 +583,7 @@ done: if(data && (type&VM_RSZERO) && size > oldsize)
{ reg Vmuchar_t *d = data+oldsize, *ed = data+size;
do { *d++ = 0; } while(d < ed);
}
+ CLRINUSE(vd, inuse);
return (Void_t*)data;
}
@@ -681,14 +707,20 @@ size_t align;
reg int line;
reg Void_t* func;
reg Vmdata_t* vd = vm->data;
+ reg int inuse;
+ SETINUSE(vd, inuse);
VMFLF(vm,file,line,func);
if(size <= 0 || align <= 0)
+ { CLRINUSE(vd, inuse);
return NIL(Void_t*);
+ }
if(ISLOCK(vd,0) )
+ { CLRINUSE(vd, inuse);
return NIL(Void_t*);
+ }
SETLOCK(vd,0);
if((s = ROUND(size,ALIGN) + DB_EXTRA) < sizeof(Body_t))
@@ -708,6 +740,7 @@ size_t align;
done:
CLRLOCK(vd,0);
ANNOUNCE(0, vm, VM_ALLOC, (Void_t*)data, vm->disc);
+ CLRINUSE(vd, inuse);
return (Void_t*)data;
}
diff --git a/usr/src/lib/libast/common/vmalloc/vmdisc.c b/usr/src/lib/libast/common/vmalloc/vmdisc.c
index 78393c3136..89fd04b318 100644
--- a/usr/src/lib/libast/common/vmalloc/vmdisc.c
+++ b/usr/src/lib/libast/common/vmalloc/vmdisc.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/vmalloc/vmexit.c b/usr/src/lib/libast/common/vmalloc/vmexit.c
index 29a169393b..b381567070 100644
--- a/usr/src/lib/libast/common/vmalloc/vmexit.c
+++ b/usr/src/lib/libast/common/vmalloc/vmexit.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/vmalloc/vmgetmem.c b/usr/src/lib/libast/common/vmalloc/vmgetmem.c
index 2ed647f732..b919155140 100644
--- a/usr/src/lib/libast/common/vmalloc/vmgetmem.c
+++ b/usr/src/lib/libast/common/vmalloc/vmgetmem.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -35,6 +35,8 @@ void _STUB_vmgetmem(){}
* vmgetmem(r,0,n) allocate n bytes initialized to 0
* vmgetmem(r,p,0) free p
* vmgetmem(r,p,n) realloc p to n bytes
+ *
+ * Written by Glenn S. Fowler.
*/
#if __STD_C
diff --git a/usr/src/lib/libast/common/vmalloc/vmhdr.h b/usr/src/lib/libast/common/vmalloc/vmhdr.h
index ac322a93a6..8a33270f69 100644
--- a/usr/src/lib/libast/common/vmalloc/vmhdr.h
+++ b/usr/src/lib/libast/common/vmalloc/vmhdr.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -128,9 +128,8 @@ typedef int ssize_t;
#define VM_check 0x0001 /* enable detailed checks */
#define VM_abort 0x0002 /* abort() on assertion failure */
-#define VM_primary 0x0004 /* enable primary native allocation */
-#define VM_region 0x0008 /* enable region segment checks */
-#define VM_secondary 0x0010 /* enable secondary native allocation */
+#define VM_region 0x0004 /* enable region segment checks */
+#define VM_mmap 0x0010 /* favor mmap allocation */
#define VM_init 0x8000 /* VMCHECK env var checked */
#if _UWIN
@@ -200,10 +199,13 @@ extern void _vmmessage _ARG_((const char*, long, const char*, long));
#define VM_AGAIN 0010000 /* research the arena for space */
#define VM_LOCK 0020000 /* region is locked */
#define VM_LOCAL 0040000 /* local call, bypass lock */
-#define VM_UNUSED 0104060
+#define VM_INUSE 0004000 /* some operation is running */
+#define VM_UNUSED 0100060
#define VMETHOD(vd) ((vd)->mode&VM_METHODS)
/* test/set/clear lock state */
+#define SETINUSE(vd,iu) (((iu) = (vd)->mode&VM_INUSE), ((vd)->mode |= VM_INUSE) )
+#define CLRINUSE(vd,iu) ((iu) ? 0 : ((vd)->mode &= ~VM_INUSE) )
#define SETLOCAL(vd) ((vd)->mode |= VM_LOCAL)
#define GETLOCAL(vd,l) (((l) = (vd)->mode&VM_LOCAL), ((vd)->mode &= ~VM_LOCAL) )
#define ISLOCK(vd,l) ((l) ? 0 : ((vd)->mode & VM_LOCK) )
diff --git a/usr/src/lib/libast/common/vmalloc/vmlast.c b/usr/src/lib/libast/common/vmalloc/vmlast.c
index 056e30ce59..9a723b0ee4 100644
--- a/usr/src/lib/libast/common/vmalloc/vmlast.c
+++ b/usr/src/lib/libast/common/vmalloc/vmlast.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -44,13 +44,16 @@ size_t size;
reg Seg_t *seg, *last;
reg size_t s;
reg Vmdata_t* vd = vm->data;
- reg int local;
+ reg int local, inuse;
size_t orgsize = 0;
+ SETINUSE(vd, inuse);
if(!(local = vd->mode&VM_TRUST))
{ GETLOCAL(vd,local);
if(ISLOCK(vd,local))
+ { CLRINUSE(vd, inuse);
return NIL(Void_t*);
+ }
SETLOCK(vd,local);
orgsize = size;
}
@@ -95,6 +98,7 @@ got_block:
done:
CLRLOCK(vd,local);
ANNOUNCE(local, vm, VM_ALLOC, (Void_t*)tp, vm->disc);
+ CLRINUSE(vd, inuse);
return (Void_t*)tp;
}
@@ -110,20 +114,25 @@ reg Void_t* data;
reg Block_t* fp;
reg size_t s;
reg Vmdata_t* vd = vm->data;
- reg int local;
+ reg int local, inuse;
if(!data)
return 0;
+
+ SETINUSE(vd, inuse);
if(!(local = vd->mode&VM_TRUST) )
{ GETLOCAL(vd, local);
if(ISLOCK(vd, local))
+ { CLRINUSE(vd, inuse);
return -1;
+ }
SETLOCK(vd, local);
}
if(data != (Void_t*)vd->free)
{ if(!local && vm->disc->exceptf)
(void)(*vm->disc->exceptf)(vm,VM_BADADDR,data,vm->disc);
CLRLOCK(vd, local);
+ CLRINUSE(vd, inuse);
return -1;
}
@@ -144,6 +153,7 @@ reg Void_t* data;
CLRLOCK(vd, local);
ANNOUNCE(local, vm, VM_FREE, data, vm->disc);
+ CLRINUSE(vd, inuse);
return 0;
}
@@ -162,11 +172,12 @@ int type;
reg size_t oldsize;
reg ssize_t s, ds;
reg Vmdata_t* vd = vm->data;
- reg int local;
+ reg int local, inuse;
reg Void_t* addr;
Void_t* orgdata = NIL(Void_t*);
size_t orgsize = 0;
+ SETINUSE(vd, inuse);
if(!data)
{ oldsize = 0;
data = lastalloc(vm,size);
@@ -174,13 +185,16 @@ int type;
}
if(size <= 0)
{ (void)lastfree(vm,data);
+ CLRINUSE(vd, inuse);
return NIL(Void_t*);
}
if(!(local = vd->mode&VM_TRUST))
{ GETLOCAL(vd, local);
if(ISLOCK(vd, local))
+ { CLRINUSE(vd, inuse);
return NIL(Void_t*);
+ }
SETLOCK(vd, local);
orgdata = data;
orgsize = size;
@@ -196,6 +210,7 @@ int type;
if(!seg || (VLONG(data)%ALIGN) != 0 ||
(seg->last && (Vmuchar_t*)data > (Vmuchar_t*)seg->last) )
{ CLRLOCK(vd,0);
+ CLRINUSE(vd, inuse);
return NIL(Void_t*);
}
}
@@ -286,6 +301,7 @@ int type;
done: if(data && (type&VM_RSZERO) && size > oldsize)
memset((Void_t*)((Vmuchar_t*)data + oldsize), 0, size-oldsize);
+ CLRINUSE(vd, inuse);
return data;
}
@@ -337,10 +353,14 @@ Vmalloc_t* vm;
reg Seg_t *seg, *next;
reg size_t s;
reg Vmdata_t* vd = vm->data;
+ reg int inuse;
+ SETINUSE(vd, inuse);
if(!(vd->mode&VM_TRUST))
{ if(ISLOCK(vd,0))
+ { CLRINUSE(vd, inuse);
return -1;
+ }
SETLOCK(vd,0);
}
@@ -363,6 +383,7 @@ Vmalloc_t* vm;
(*_Vmtrace)(vm,(Vmuchar_t*)0,(Vmuchar_t*)0,0,0);
CLRLOCK(vd,0);
+ CLRINUSE(vd, inuse);
return 0;
}
@@ -378,17 +399,20 @@ size_t align;
reg Vmuchar_t* data;
reg Seg_t* seg;
reg Block_t* next;
- reg int local;
+ reg int local, inuse;
reg size_t s, orgsize = 0, orgalign = 0;
reg Vmdata_t* vd = vm->data;
if(size <= 0 || align <= 0)
return NIL(Void_t*);
+ SETINUSE(vd, inuse);
if(!(local = vd->mode&VM_TRUST) )
{ GETLOCAL(vd,local);
if(ISLOCK(vd,local) )
+ { CLRINUSE(vd, inuse);
return NIL(Void_t*);
+ }
SETLOCK(vd,local);
orgsize = size;
orgalign = align;
@@ -428,6 +452,7 @@ done:
CLRLOCK(vd,local);
ANNOUNCE(local, vm, VM_ALLOC, (Void_t*)data, vm->disc);
+ CLRINUSE(vd, inuse);
return (Void_t*)data;
}
diff --git a/usr/src/lib/libast/common/vmalloc/vmmopen.c b/usr/src/lib/libast/common/vmalloc/vmmopen.c
index 90692ae744..4586895fbb 100644
--- a/usr/src/lib/libast/common/vmalloc/vmmopen.c
+++ b/usr/src/lib/libast/common/vmalloc/vmmopen.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/vmalloc/vmopen.c b/usr/src/lib/libast/common/vmalloc/vmopen.c
index d441410906..0f85550396 100644
--- a/usr/src/lib/libast/common/vmalloc/vmopen.c
+++ b/usr/src/lib/libast/common/vmalloc/vmopen.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/vmalloc/vmpool.c b/usr/src/lib/libast/common/vmalloc/vmpool.c
index 62ffb17cff..a318cb9150 100644
--- a/usr/src/lib/libast/common/vmalloc/vmpool.c
+++ b/usr/src/lib/libast/common/vmalloc/vmpool.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -50,7 +50,7 @@ reg size_t size;
reg Block_t *tp, *next;
reg size_t s;
reg Seg_t* seg;
- reg int local;
+ reg int local, inuse;
if(size <= 0)
return NIL(Void_t*);
@@ -60,10 +60,13 @@ reg size_t size;
else return NIL(Void_t*);
}
+ SETINUSE(vd, inuse);
if(!(local = vd->mode&VM_TRUST) )
{ GETLOCAL(vd,local);
if(ISLOCK(vd, local))
+ { CLRINUSE(vd, inuse);
return NIL(Void_t*);
+ }
SETLOCK(vd, local);
}
@@ -115,6 +118,7 @@ done:
CLRLOCK(vd, local);
ANNOUNCE(local, vm, VM_ALLOC, (Void_t*)tp, vm->disc);
+ CLRINUSE(vd, inuse);
return (Void_t*)tp;
}
@@ -132,12 +136,15 @@ reg Void_t* addr;
reg Seg_t* seg;
reg long offset;
reg Vmdata_t* vd = vm->data;
- reg int local;
+ reg int local, inuse;
+ SETINUSE(vd, inuse);
if(!(local = vd->mode&VM_TRUST))
{ GETLOCAL(vd,local);
if(ISLOCK(vd,local))
+ { CLRINUSE(vd, inuse);
return -1L;
+ }
SETLOCK(vd,local);
}
@@ -164,6 +171,7 @@ reg Void_t* addr;
done :
CLRLOCK(vd,local);
+ CLRINUSE(vd, inuse);
return offset;
}
@@ -177,20 +185,24 @@ reg Void_t* data;
{
reg Block_t* bp;
reg Vmdata_t* vd = vm->data;
- reg int local;
+ reg int local, inuse;
if(!data)
return 0;
+ SETINUSE(vd, inuse);
if(!(local = vd->mode&VM_TRUST))
{ GETLOCAL(vd, local);
if(ISLOCK(vd, local) || vd->pool <= 0)
+ { CLRINUSE(vd, inuse);
return -1;
+ }
if(KPVADDR(vm,data,pooladdr) != 0)
{ if(vm->disc->exceptf)
(void)(*vm->disc->exceptf)(vm,VM_BADADDR,data,vm->disc);
+ CLRINUSE(vd, inuse);
return -1;
}
@@ -207,6 +219,7 @@ reg Void_t* data;
CLRLOCK(vd,local);
ANNOUNCE(local, vm, VM_FREE, data, vm->disc);
+ CLRINUSE(vd, inuse);
return 0;
}
@@ -220,20 +233,23 @@ size_t size;
int type;
#endif
{
- int local;
+ int local, inuse;
reg Vmdata_t* vd = vm->data;
NOTUSED(type);
+ SETINUSE(vd, inuse);
if(!data)
{ if((data = poolalloc(vm,size)) && (type&VM_RSZERO) )
{ reg int *d = (int*)data, *ed = (int*)((char*)data+size);
do { *d++ = 0;} while(d < ed);
}
+ CLRINUSE(vd, inuse);
return data;
}
if(size == 0)
{ (void)poolfree(vm,data);
+ CLRINUSE(vd, inuse);
return NIL(Void_t*);
}
@@ -241,11 +257,14 @@ int type;
{ GETLOCAL(vd, local);
if(ISLOCK(vd, local) )
+ { CLRINUSE(vd, inuse);
return NIL(Void_t*);
+ }
if(size != vd->pool || KPVADDR(vm,data,pooladdr) != 0)
{ if(vm->disc->exceptf)
(void)(*vm->disc->exceptf)(vm,VM_BADADDR,data,vm->disc);
+ CLRINUSE(vd, inuse);
return NIL(Void_t*);
}
@@ -254,6 +273,7 @@ int type;
}
ANNOUNCE(local, vm, VM_RESIZE, data, vm->disc);
+ CLRINUSE(vd, inuse);
return data;
}
@@ -279,10 +299,14 @@ Vmalloc_t* vm;
reg Seg_t *seg, *next;
reg size_t s;
reg Vmdata_t* vd = vm->data;
+ reg int inuse;
+ SETINUSE(vd, inuse);
if(!(vd->mode&VM_TRUST))
{ if(ISLOCK(vd,0))
+ { CLRINUSE(vd, inuse);
return -1;
+ }
SETLOCK(vd,0);
}
@@ -305,6 +329,7 @@ Vmalloc_t* vm;
(*_Vmtrace)(vm, (Vmuchar_t*)0, (Vmuchar_t*)0, 0, 0);
CLRLOCK(vd,0);
+ CLRINUSE(vd, inuse);
return 0;
}
diff --git a/usr/src/lib/libast/common/vmalloc/vmprivate.c b/usr/src/lib/libast/common/vmalloc/vmprivate.c
index 74e9dcf565..a16e2dc92c 100644
--- a/usr/src/lib/libast/common/vmalloc/vmprivate.c
+++ b/usr/src/lib/libast/common/vmalloc/vmprivate.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -27,7 +27,7 @@ void _STUB_vmprivate(){}
#include "vmhdr.h"
-static char* Version = "\n@(#)$Id: Vmalloc (AT&T Research) 2005-09-28 $\0\n";
+static char* Version = "\n@(#)$Id: Vmalloc (AT&T Research) 2007-09-11 $\0\n";
#if _sys_stat
#include <sys/stat.h>
diff --git a/usr/src/lib/libast/common/vmalloc/vmprofile.c b/usr/src/lib/libast/common/vmalloc/vmprofile.c
index bead2b5be2..a9e620468e 100644
--- a/usr/src/lib/libast/common/vmalloc/vmprofile.c
+++ b/usr/src/lib/libast/common/vmalloc/vmprofile.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -471,15 +471,18 @@ size_t size;
reg size_t s;
reg Void_t* data;
reg char* file;
- reg int line, local;
+ reg int line, local, inuse;
reg Void_t* func;
reg Vmdata_t* vd = vm->data;
VMFLF(vm,file,line,func);
+ SETINUSE(vd, inuse);
if(!(local = vd->mode&VM_TRUST) )
{ GETLOCAL(vd, local);
if(ISLOCK(vd, local))
+ { CLRINUSE(vd, inuse);
return NIL(Void_t*);
+ }
SETLOCK(vd, local);
}
@@ -496,6 +499,7 @@ size_t size;
done:
CLRLOCK(vd, local);
ANNOUNCE(local, vm, VM_ALLOC, (Void_t*)data, vm->disc);
+ CLRINUSE(vd, inuse);
return data;
}
@@ -510,7 +514,7 @@ Void_t* data;
reg Pfobj_t* pf;
reg size_t s;
reg char* file;
- reg int line, rv, local;
+ reg int line, rv, local, inuse;
reg Void_t* func;
reg Vmdata_t* vd = vm->data;
@@ -519,10 +523,13 @@ Void_t* data;
if(!data)
return 0;
+ SETINUSE(vd, inuse);
if(!(local = vd->mode&VM_TRUST) )
{ GETLOCAL(vd,local);
if(ISLOCK(vd,local))
+ { CLRINUSE(vd, inuse);
return -1;
+ }
SETLOCK(vd,local);
}
@@ -530,6 +537,7 @@ Void_t* data;
{ if(vm->disc->exceptf)
(void)(*vm->disc->exceptf)(vm,VM_BADADDR,data,vm->disc);
CLRLOCK(vd,0);
+ CLRINUSE(vd, inuse);
return -1;
}
@@ -551,6 +559,7 @@ Void_t* data;
rv = KPVFREE((vm), (Void_t*)data, (*Vmbest->freef));
CLRLOCK(vd,local);
ANNOUNCE(local, vm, VM_FREE, data, vm->disc);
+ CLRINUSE(vd, inuse);
return rv;
}
@@ -569,11 +578,12 @@ int type;
reg size_t news;
reg Void_t* addr;
reg char* file;
- reg int line, local;
+ reg int line, local, inuse;
reg Void_t* func;
reg size_t oldsize;
reg Vmdata_t* vd = vm->data;
+ SETINUSE(vd, inuse);
if(!data)
{ oldsize = 0;
addr = pfalloc(vm,size);
@@ -581,6 +591,7 @@ int type;
}
if(size == 0)
{ (void)pffree(vm,data);
+ CLRINUSE(vd, inuse);
return NIL(Void_t*);
}
@@ -588,7 +599,9 @@ int type;
if(!(local = vd->mode&VM_TRUST))
{ GETLOCAL(vd, local);
if(ISLOCK(vd, local))
+ { CLRINUSE(vd, inuse);
return NIL(Void_t*);
+ }
SETLOCK(vd, local);
}
@@ -596,6 +609,7 @@ int type;
{ if(vm->disc->exceptf)
(void)(*vm->disc->exceptf)(vm,VM_BADADDR,data,vm->disc);
CLRLOCK(vd, local);
+ CLRINUSE(vd, inuse);
return NIL(Void_t*);
}
@@ -637,6 +651,7 @@ done: if(addr && (type&VM_RSZERO) && oldsize < size)
do { *d++ = 0; } while(d < ed);
}
+ CLRINUSE(vd, inuse);
return addr;
}
@@ -684,16 +699,19 @@ size_t align;
reg size_t s;
reg Void_t* data;
reg char* file;
- reg int line, local;
+ reg int line, local, inuse;
reg Void_t* func;
reg Vmdata_t* vd = vm->data;
VMFLF(vm,file,line,func);
+ SETINUSE(vd, inuse);
if(!(local = vd->mode&VM_TRUST) )
{ GETLOCAL(vd,local);
if(ISLOCK(vd, local))
+ { CLRINUSE(vd, inuse);
return NIL(Void_t*);
+ }
SETLOCK(vd, local);
}
@@ -710,6 +728,7 @@ size_t align;
done:
CLRLOCK(vd, local);
ANNOUNCE(local, vm, VM_ALLOC, data, vm->disc);
+ CLRINUSE(vd, inuse);
return data;
}
diff --git a/usr/src/lib/libast/common/vmalloc/vmregion.c b/usr/src/lib/libast/common/vmalloc/vmregion.c
index 43ba0785f8..61a59562d5 100644
--- a/usr/src/lib/libast/common/vmalloc/vmregion.c
+++ b/usr/src/lib/libast/common/vmalloc/vmregion.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/vmalloc/vmsegment.c b/usr/src/lib/libast/common/vmalloc/vmsegment.c
index 8e2453e50a..2eb4ae35e3 100644
--- a/usr/src/lib/libast/common/vmalloc/vmsegment.c
+++ b/usr/src/lib/libast/common/vmalloc/vmsegment.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -42,10 +42,14 @@ Void_t* addr; /* address */
{
reg Seg_t* seg;
reg Vmdata_t* vd = vm->data;
+ reg int inuse;
+ SETINUSE(vd, inuse);
if(!(vd->mode&VM_TRUST))
{ if(ISLOCK(vd,0))
+ { CLRINUSE(vd, inuse);
return NIL(Void_t*);
+ }
SETLOCK(vd,0);
}
@@ -55,6 +59,7 @@ Void_t* addr; /* address */
break;
CLRLOCK(vd,0);
+ CLRINUSE(vd, inuse);
return seg ? (Void_t*)seg->addr : NIL(Void_t*);
}
diff --git a/usr/src/lib/libast/common/vmalloc/vmset.c b/usr/src/lib/libast/common/vmalloc/vmset.c
index 0a6a1a5efd..3fbc354464 100644
--- a/usr/src/lib/libast/common/vmalloc/vmset.c
+++ b/usr/src/lib/libast/common/vmalloc/vmset.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -41,15 +41,18 @@ int flags; /* flags must be in VM_FLAGS */
int on; /* !=0 if turning on, else turning off */
#endif
{
- reg int mode;
+ reg int mode, inuse;
reg Vmdata_t* vd = vm->data;
if(flags == 0 && on == 0)
return vd->mode;
+ SETINUSE(vd, inuse);
if(!(vd->mode&VM_TRUST) )
{ if(ISLOCK(vd,0))
+ { CLRINUSE(vd, inuse);
return 0;
+ }
SETLOCK(vd,0);
}
@@ -63,6 +66,7 @@ int on; /* !=0 if turning on, else turning off */
vd->mode &= ~VM_TRUST;
CLRLOCK(vd,0);
+ CLRINUSE(vd, inuse);
return mode;
}
diff --git a/usr/src/lib/libast/common/vmalloc/vmstat.c b/usr/src/lib/libast/common/vmalloc/vmstat.c
index 21a3f2b5a1..dc2c1097c2 100644
--- a/usr/src/lib/libast/common/vmalloc/vmstat.c
+++ b/usr/src/lib/libast/common/vmalloc/vmstat.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -43,13 +43,19 @@ Vmstat_t* st;
reg Seg_t* seg;
reg Block_t *b, *endb;
reg size_t s = 0;
- reg Vmdata_t* vd = vm->data;
+ reg Vmdata_t* vd = vm ? vm->data : Vmregion->data;
+ reg int inuse;
+ SETINUSE(vd, inuse);
if(!st)
- return -1;
+ { CLRINUSE(vd, inuse);
+ return inuse ? 1 : 0;
+ }
if(!(vd->mode&VM_TRUST))
{ if(ISLOCK(vd,0))
+ { CLRINUSE(vd, inuse);
return -1;
+ }
SETLOCK(vd,0);
}
@@ -122,7 +128,8 @@ Vmstat_t* st;
}
CLRLOCK(vd,0);
- return 0;
+ CLRINUSE(vd, inuse);
+ return inuse ? 1 : 0;
}
#endif
diff --git a/usr/src/lib/libast/common/vmalloc/vmstrdup.c b/usr/src/lib/libast/common/vmalloc/vmstrdup.c
index 3d4f77a551..8bbe524fb3 100644
--- a/usr/src/lib/libast/common/vmalloc/vmstrdup.c
+++ b/usr/src/lib/libast/common/vmalloc/vmstrdup.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/vmalloc/vmtrace.c b/usr/src/lib/libast/common/vmalloc/vmtrace.c
index e6f46abb44..7111d229ea 100644
--- a/usr/src/lib/libast/common/vmalloc/vmtrace.c
+++ b/usr/src/lib/libast/common/vmalloc/vmtrace.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/common/vmalloc/vmwalk.c b/usr/src/lib/libast/common/vmalloc/vmwalk.c
index b401d79902..6597870d79 100644
--- a/usr/src/lib/libast/common/vmalloc/vmwalk.c
+++ b/usr/src/lib/libast/common/vmalloc/vmwalk.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/Makefile b/usr/src/lib/libast/i386/Makefile
index 647e6e2ab3..309ec29f43 100644
--- a/usr/src/lib/libast/i386/Makefile
+++ b/usr/src/lib/libast/i386/Makefile
@@ -18,12 +18,11 @@
#
# CDDL HEADER END
#
+
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
# Platform-specific config
# Note that "HOSTTYPE" matches the value used by AT&T upstream.
@@ -31,7 +30,8 @@ ASTPLATFORMCPPFLAGS = '-DHOSTTYPE="sol$(RELEASE_MINOR).i386"'
# platform-specific sources
OBJECTS = \
- i386/src/lib/libast/conftab.o
+ i386/src/lib/libast/conftab.o \
+ i386/src/lib/libast/lctab.o
OBJDIRS = \
i386/src/lib/libast
diff --git a/usr/src/lib/libast/i386/include/ast/align.h b/usr/src/lib/libast/i386/include/ast/align.h
index a6c8d77177..7287667b33 100644
--- a/usr/src/lib/libast/i386/include/ast/align.h
+++ b/usr/src/lib/libast/i386/include/ast/align.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/align.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/align.c by iffe version 2008-01-31 : : */
#ifndef _def_align_ast
#define _def_align_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/include/ast/ast.h b/usr/src/lib/libast/i386/include/ast/ast.h
index ea1569f946..f5335ae8a2 100644
--- a/usr/src/lib/libast/i386/include/ast/ast.h
+++ b/usr/src/lib/libast/i386/include/ast/ast.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -333,7 +333,9 @@ extern __MANGLE__ double strntod __PROTO__((const char*, size_t, char**));
extern __MANGLE__ _ast_fltmax_t strntold __PROTO__((const char*, size_t, char**));
extern __MANGLE__ long strntol __PROTO__((const char*, size_t, char**, int));
extern __MANGLE__ intmax_t strntoll __PROTO__((const char*, size_t, char**, int));
+extern __MANGLE__ long strnton __PROTO__((const char*, size_t, char**, char*, int));
extern __MANGLE__ unsigned long strntoul __PROTO__((const char*, size_t, char**, int));
+extern __MANGLE__ intmax_t strntonll __PROTO__((const char*, size_t, char**, char*, int));
extern __MANGLE__ uintmax_t strntoull __PROTO__((const char*, size_t, char**, int));
extern __MANGLE__ int stropt __PROTO__((const char*, const __V_*, int, int(*)(__V_*, const __V_*, int, const char*), __V_*));
extern __MANGLE__ int strperm __PROTO__((const char*, char**, int));
diff --git a/usr/src/lib/libast/i386/include/ast/ast_botch.h b/usr/src/lib/libast/i386/include/ast/ast_botch.h
index 8c100aac74..e8bdabcda3 100644
--- a/usr/src/lib/libast/i386/include/ast/ast_botch.h
+++ b/usr/src/lib/libast/i386/include/ast/ast_botch.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/botch.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/botch.c by iffe version 2008-01-31 : : */
#ifndef _def_botch_ast
#define _def_botch_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/include/ast/ast_ccode.h b/usr/src/lib/libast/i386/include/ast/ast_ccode.h
index 0b46e34c38..8717cfb8db 100644
--- a/usr/src/lib/libast/i386/include/ast/ast_ccode.h
+++ b/usr/src/lib/libast/i386/include/ast/ast_ccode.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/ccode by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/ccode by iffe version 2008-01-31 : : */
#ifndef _def_ccode_ast
#define _def_ccode_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/include/ast/ast_common.h b/usr/src/lib/libast/i386/include/ast/ast_common.h
index b32e1ed12b..f4ac70b9fd 100644
--- a/usr/src/lib/libast/i386/include/ast/ast_common.h
+++ b/usr/src/lib/libast/i386/include/ast/ast_common.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/common by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/common by iffe version 2008-01-31 : : */
#ifndef _AST_COMMON_H
#define _AST_COMMON_H 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/include/ast/ast_dir.h b/usr/src/lib/libast/i386/include/ast/ast_dir.h
index 336b7f38a6..a402906410 100644
--- a/usr/src/lib/libast/i386/include/ast/ast_dir.h
+++ b/usr/src/lib/libast/i386/include/ast/ast_dir.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/ast_dirent.h b/usr/src/lib/libast/i386/include/ast/ast_dirent.h
index c0723a1fde..488c3ee03f 100644
--- a/usr/src/lib/libast/i386/include/ast/ast_dirent.h
+++ b/usr/src/lib/libast/i386/include/ast/ast_dirent.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/dirent by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/dirent by iffe version 2008-01-31 : : */
#ifndef _def_dirent_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/i386/include/ast/ast_fcntl.h b/usr/src/lib/libast/i386/include/ast/ast_fcntl.h
index c9a69f9c0d..3b0da8bd54 100644
--- a/usr/src/lib/libast/i386/include/ast/ast_fcntl.h
+++ b/usr/src/lib/libast/i386/include/ast/ast_fcntl.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/fcntl.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/fcntl.c by iffe version 2008-01-31 : : */
#ifndef _def_fcntl_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
diff --git a/usr/src/lib/libast/i386/include/ast/ast_float.h b/usr/src/lib/libast/i386/include/ast/ast_float.h
index 0c4a8ba62f..be3594d6ad 100644
--- a/usr/src/lib/libast/i386/include/ast/ast_float.h
+++ b/usr/src/lib/libast/i386/include/ast/ast_float.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/float by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/float by iffe version 2008-01-31 : : */
#ifndef _def_float_ast
#if !defined(__PROTO__)
@@ -89,13 +89,16 @@
#define _hdr_math 1 /* #include <math.h> ok */
#define _hdr_values 1 /* #include <values.h> ok */
#define _LIB_m 1 /* -lm is a library */
+#define _lib_fpclassify 1 /* fpclassify() in default lib(s) */
#define _lib_frexp 1 /* frexp() in default lib(s) */
#define _lib_frexpl 1 /* frexpl() in default lib(s) */
#define _lib_ldexp 1 /* ldexp() in default lib(s) */
#define _lib_ldexpl 1 /* ldexpl() in default lib(s) */
#define _lib_finite 1 /* finite() in default lib(s) */
+#define _lib_isinf 1 /* isinf() in default lib(s) */
#define _lib_isnan 1 /* isnan() in default lib(s) */
#define _lib_isnanl 1 /* isnanl() in default lib(s) */
+#define _lib_signbit 1 /* signbit() in default lib(s) */
#define _lib_copysign 1 /* copysign() in default lib(s) */
#define _lib_copysignl 1 /* copysignl() in default lib(s) */
#include <ast_common.h>
diff --git a/usr/src/lib/libast/i386/include/ast/ast_fs.h b/usr/src/lib/libast/i386/include/ast/ast_fs.h
index 0d0e39f6b0..c4d8e36045 100644
--- a/usr/src/lib/libast/i386/include/ast/ast_fs.h
+++ b/usr/src/lib/libast/i386/include/ast/ast_fs.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/fs by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/fs by iffe version 2008-01-31 : : */
#ifndef _def_fs_ast
#if !defined(__PROTO__)
@@ -93,20 +93,9 @@
#define _lib_mknod 1 /* mknod() in default lib(s) */
#define _lib_sync 1 /* sync() in default lib(s) */
#include <sys/stat.h>
+#include <sys/mkdev.h>
#define FS_default "ufs"
#if defined(__STDPP__directive) && defined(__STDPP__initial)
-__STDPP__directive pragma pp:initial
-#endif
-#ifndef major
-#define major(x) ( major_t ) ( ( ( ( unsigned ) ( ( x ) ) ) >> 8 ) & 0x7f )
-#endif
-#ifndef minor
-#define minor(x) ( minor_t ) ( ( ( x ) ) & 0xff )
-#endif
-#ifndef makedev
-#define makedev(x,y) ( unsigned short ) ( ( ( ( x ) ) << 8 ) | ( ( ( y ) ) & 0xff ) )
-#endif
-#if defined(__STDPP__directive) && defined(__STDPP__initial)
__STDPP__directive pragma pp:noinitial
#endif
#define _hdr_stdio 1 /* #include <stdio.h> ok */
diff --git a/usr/src/lib/libast/i386/include/ast/ast_getopt.h b/usr/src/lib/libast/i386/include/ast/ast_getopt.h
index 0de85c6172..060c18a246 100644
--- a/usr/src/lib/libast/i386/include/ast/ast_getopt.h
+++ b/usr/src/lib/libast/i386/include/ast/ast_getopt.h
@@ -1,39 +1,17 @@
/* : : generated by proto : : */
-/***********************************************************************
-* *
-* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
-* and is licensed under the *
-* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
-* *
-* A copy of the License is available at *
-* http://www.opensource.org/licenses/cpl1.0.txt *
-* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
-* *
-* Information and Software Systems Research *
-* AT&T Research *
-* Florham Park NJ *
-* *
-* Glenn Fowler <gsf@research.att.com> *
-* David Korn <dgk@research.att.com> *
-* Phong Vo <kpv@research.att.com> *
-* *
-***********************************************************************/
-
-/*
- * legacy standard getopt interface
- */
-#ifndef _AST_GETOPT_H
#if !defined(__PROTO__)
#include <prototyped.h>
#endif
#if !defined(__LINKAGE__)
#define __LINKAGE__ /* 2004-08-11 transition */
#endif
-
+#ifdef _AST_STD_I
+#undef _AST_GETOPT_H
+#define _AST_GETOPT_H -1
+#endif
+#ifndef _AST_GETOPT_H
#define _AST_GETOPT_H 1
extern __MANGLE__ int opterr;
diff --git a/usr/src/lib/libast/i386/include/ast/ast_iconv.h b/usr/src/lib/libast/i386/include/ast/ast_iconv.h
index 001a08e992..314d29bd3f 100644
--- a/usr/src/lib/libast/i386/include/ast/ast_iconv.h
+++ b/usr/src/lib/libast/i386/include/ast/ast_iconv.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/iconv by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/iconv by iffe version 2008-01-31 : : */
#ifndef _def_iconv_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/i386/include/ast/ast_lib.h b/usr/src/lib/libast/i386/include/ast/ast_lib.h
index 7826d47485..0c33652fa7 100644
--- a/usr/src/lib/libast/i386/include/ast/ast_lib.h
+++ b/usr/src/lib/libast/i386/include/ast/ast_lib.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/lib by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/lib by iffe version 2008-01-31 : : */
#ifndef _def_lib_ast
#define _def_lib_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/include/ast/ast_limits.h b/usr/src/lib/libast/i386/include/ast/ast_limits.h
index a75dc78d31..57cea0a209 100644
--- a/usr/src/lib/libast/i386/include/ast/ast_limits.h
+++ b/usr/src/lib/libast/i386/include/ast/ast_limits.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/limits.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/limits.c by iffe version 2008-01-31 : : */
#ifndef _def_limits_ast
#define _def_limits_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/include/ast/ast_map.h b/usr/src/lib/libast/i386/include/ast/ast_map.h
index ef22364fbb..73150b3996 100644
--- a/usr/src/lib/libast/i386/include/ast/ast_map.h
+++ b/usr/src/lib/libast/i386/include/ast/ast_map.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/map.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/map.c by iffe version 2008-01-31 : : */
#ifndef _def_map_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
@@ -142,6 +142,14 @@ extern __MANGLE__ char* getcwd __PROTO__((char*, size_t));
#define getopt_long _ast_getopt_long
#undef getopt_long_only
#define getopt_long_only _ast_getopt_long_only
+#undef optopt
+#define optopt _ast_optopt
+#undef optarg
+#define optarg _ast_optarg
+#undef optind
+#define optind _ast_optind
+#undef opterr
+#define opterr _ast_opterr
#undef getwd
#define getwd _ast_getwd
extern __MANGLE__ char* getwd __PROTO__((char*));
@@ -167,6 +175,8 @@ extern __MANGLE__ char* mktemp __PROTO__((char*));
#define mktime _ast_mktime
#undef nftw
#define nftw _ast_nftw
+#undef optctx
+#define optctx _ast_optctx
#undef optesc
#define optesc _ast_optesc
#undef optget
@@ -295,7 +305,7 @@ extern __MANGLE__ char* realpath __PROTO__((const char*, char*));
extern __MANGLE__ int remove __PROTO__((const char*));
#undef resolvepath
#define resolvepath _ast_resolvepath
-extern __MANGLE__ char* resolvepath __PROTO__((const char*, char*, size_t));
+extern __MANGLE__ int resolvepath __PROTO__((const char*, char*, size_t));
#undef setenv
#define setenv _ast_setenv
extern __MANGLE__ int setenv __PROTO__((const char*, const char*, int));
diff --git a/usr/src/lib/libast/i386/include/ast/ast_mmap.h b/usr/src/lib/libast/i386/include/ast/ast_mmap.h
index 0759029a5e..d1371a1f80 100644
--- a/usr/src/lib/libast/i386/include/ast/ast_mmap.h
+++ b/usr/src/lib/libast/i386/include/ast/ast_mmap.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/mmap by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/mmap by iffe version 2008-01-31 : : */
#ifndef _def_mmap_ast
#define _def_mmap_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/include/ast/ast_mode.h b/usr/src/lib/libast/i386/include/ast/ast_mode.h
index 6e666a5ff3..3c64e13ec6 100644
--- a/usr/src/lib/libast/i386/include/ast/ast_mode.h
+++ b/usr/src/lib/libast/i386/include/ast/ast_mode.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/mode.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/mode.c by iffe version 2008-01-31 : : */
#ifndef _def_mode_ast
#define _def_mode_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/include/ast/ast_namval.h b/usr/src/lib/libast/i386/include/ast/ast_namval.h
new file mode 100644
index 0000000000..4c9b12f480
--- /dev/null
+++ b/usr/src/lib/libast/i386/include/ast/ast_namval.h
@@ -0,0 +1,51 @@
+
+/* : : generated by proto : : */
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* David Korn <dgk@research.att.com> *
+* Phong Vo <kpv@research.att.com> *
+* *
+***********************************************************************/
+
+/*
+ * Glenn Fowler
+ * AT&T Research
+ *
+ * common name-value struct support
+ */
+
+#ifndef _NAMVAL_H
+#if !defined(__PROTO__)
+#include <prototyped.h>
+#endif
+#if !defined(__LINKAGE__)
+#define __LINKAGE__ /* 2004-08-11 transition */
+#endif
+
+#define _NAMVAL_H
+
+typedef struct
+{
+ char* name;
+ int value;
+#ifdef _NAMVAL_PRIVATE_
+ _NAMVAL_PRIVATE_
+#endif
+} Namval_t;
+
+#endif
diff --git a/usr/src/lib/libast/i386/include/ast/ast_ndbm.h b/usr/src/lib/libast/i386/include/ast/ast_ndbm.h
new file mode 100644
index 0000000000..ee6158c893
--- /dev/null
+++ b/usr/src/lib/libast/i386/include/ast/ast_ndbm.h
@@ -0,0 +1,30 @@
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* David Korn <dgk@research.att.com> *
+* Phong Vo <kpv@research.att.com> *
+* *
+***********************************************************************/
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/ndbm by iffe version 2008-01-31 : : */
+#ifndef _def_ndbm_ast
+#define _def_ndbm_ast 1
+#define _sys_types 1 /* #include <sys/types.h> ok */
+#define _hdr_ndbm 1 /* #include <ndbm.h> ok */
+#include <ndbm.h>
+#define _use_ndbm 1
+
+#endif
diff --git a/usr/src/lib/libast/i386/include/ast/ast_nl_types.h b/usr/src/lib/libast/i386/include/ast/ast_nl_types.h
index edaed7184d..b12b443045 100644
--- a/usr/src/lib/libast/i386/include/ast/ast_nl_types.h
+++ b/usr/src/lib/libast/i386/include/ast/ast_nl_types.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/nl_types by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/nl_types by iffe version 2008-01-31 : : */
#ifndef _def_nl_types_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/i386/include/ast/ast_param.h b/usr/src/lib/libast/i386/include/ast/ast_param.h
index dd71ec8a02..6893791ab9 100644
--- a/usr/src/lib/libast/i386/include/ast/ast_param.h
+++ b/usr/src/lib/libast/i386/include/ast/ast_param.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/param.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/param.sh by iffe version 2008-01-31 : : */
#ifndef _def_param_ast
#define _def_param_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/include/ast/ast_standards.h b/usr/src/lib/libast/i386/include/ast/ast_standards.h
index 836beb8e9e..fce59534a7 100644
--- a/usr/src/lib/libast/i386/include/ast/ast_standards.h
+++ b/usr/src/lib/libast/i386/include/ast/ast_standards.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/standards by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/standards by iffe version 2008-01-31 : : */
#ifndef _def_standards_ast
#define _def_standards_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/include/ast/ast_std.h b/usr/src/lib/libast/i386/include/ast/ast_std.h
index 68e7984670..4f3f3dd9da 100644
--- a/usr/src/lib/libast/i386/include/ast/ast_std.h
+++ b/usr/src/lib/libast/i386/include/ast/ast_std.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -117,16 +117,24 @@ struct lconv
#define __MANGLE__ __LINKAGE__ __EXPORT__
#endif
+#undef getenv
+#define getenv _ast_getenv
+
#undef localeconv
#define localeconv _ast_localeconv
#undef setlocale
#define setlocale _ast_setlocale
+#undef setenviron
+#define setenviron _ast_setenviron
+
#undef strerror
#define strerror _ast_strerror
+extern __MANGLE__ char* getenv __PROTO__((const char*));
extern __MANGLE__ struct lconv* localeconv __PROTO__((void));
+extern __MANGLE__ char* setenviron __PROTO__((const char*));
extern __MANGLE__ char* setlocale __PROTO__((int, const char*));
extern __MANGLE__ char* strerror __PROTO__((int));
@@ -335,6 +343,16 @@ extern __MANGLE__ int _ast_getpgrp __PROTO__((void));
#undef _AST_STD_I
+#if _AST_GETOPT_H < 0
+#undef _AST_GETOPT_H
+#include <ast_getopt.h>
+#endif
+
+#if _GETOPT_H < 0
+#undef _GETOPT_H
+#include <getopt.h>
+#endif
+
#if _REGEX_H < 0
#undef _REGEX_H
#include <regex.h>
diff --git a/usr/src/lib/libast/i386/include/ast/ast_stdio.h b/usr/src/lib/libast/i386/include/ast/ast_stdio.h
index a02241c624..69f189a28e 100644
--- a/usr/src/lib/libast/i386/include/ast/ast_stdio.h
+++ b/usr/src/lib/libast/i386/include/ast/ast_stdio.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/stdio by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/stdio by iffe version 2008-01-31 : : */
#ifndef _SFSTDIO_H
#if !defined(__PROTO__)
@@ -199,7 +199,7 @@ extern __MANGLE__ int fprintf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fpurge __PROTO__((FILE*));
extern __MANGLE__ int fputc __PROTO__((int, FILE*));
extern __MANGLE__ int fputs __PROTO__((const char*, FILE*));
-extern __MANGLE__ ssize_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
extern __MANGLE__ FILE* freopen __PROTO__((const char*, const char*, FILE*));
extern __MANGLE__ int fscanf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fseek __PROTO__((FILE*, long, int));
@@ -207,7 +207,7 @@ extern __MANGLE__ int fseeko __PROTO__((FILE*, off_t, int));
extern __MANGLE__ int fsetpos __PROTO__((FILE*, const fpos_t*));
extern __MANGLE__ long ftell __PROTO__((FILE*));
extern __MANGLE__ off_t ftello __PROTO__((FILE*));
-extern __MANGLE__ ssize_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
extern __MANGLE__ int getc __PROTO__((FILE*));
extern __MANGLE__ int getchar __PROTO__((void));
extern __MANGLE__ char* gets __PROTO__((char*));
@@ -266,6 +266,10 @@ extern __MANGLE__ int getchar_unlocked __PROTO__((void));
extern __MANGLE__ int putc_unlocked __PROTO__((int, FILE*));
extern __MANGLE__ int putchar_unlocked __PROTO__((int));
+extern __MANGLE__ void flockfile __PROTO__((FILE*));
+extern __MANGLE__ int ftrylockfile __PROTO__((FILE*));
+extern __MANGLE__ void funlockfile __PROTO__((FILE*));
+
#ifdef _USE_GNU
extern __MANGLE__ int fcloseall __PROTO__((void));
@@ -345,6 +349,7 @@ extern __MANGLE__ ssize_t getline __PROTO__((char**, size_t*, FILE*));
#define vsprintf _ast_vsprintf
#define vsscanf _ast_vsscanf
#define fcloseall _ast_fcloseall
+#define _filbuf _ast__filbuf
#define fmemopen _ast_fmemopen
#define __getdelim _ast___getdelim
#define getdelim _ast_getdelim
@@ -364,6 +369,9 @@ extern __MANGLE__ ssize_t getline __PROTO__((char**, size_t*, FILE*));
#define getchar_unlocked _ast_getchar_unlocked
#define putc_unlocked _ast_putc_unlocked
#define putchar_unlocked _ast_putchar_unlocked
+#define flockfile _ast_flockfile
+#define ftrylockfile _ast_ftrylockfile
+#define funlockfile _ast_funlockfile
#if defined(__STDPP__directive) && defined(__STDPP__initial)
__STDPP__directive pragma pp:initial
@@ -423,7 +431,7 @@ extern __MANGLE__ int fprintf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fpurge __PROTO__((FILE*));
extern __MANGLE__ int fputc __PROTO__((int, FILE*));
extern __MANGLE__ int fputs __PROTO__((const char*, FILE*));
-extern __MANGLE__ ssize_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
extern __MANGLE__ FILE* freopen __PROTO__((const char*, const char*, FILE*));
extern __MANGLE__ int fscanf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fseek __PROTO__((FILE*, long, int));
@@ -431,7 +439,7 @@ extern __MANGLE__ int fseeko __PROTO__((FILE*, off_t, int));
extern __MANGLE__ int fsetpos __PROTO__((FILE*, const fpos_t*));
extern __MANGLE__ long ftell __PROTO__((FILE*));
extern __MANGLE__ off_t ftello __PROTO__((FILE*));
-extern __MANGLE__ ssize_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
extern __MANGLE__ int getc __PROTO__((FILE*));
extern __MANGLE__ int getchar __PROTO__((void));
extern __MANGLE__ char* gets __PROTO__((char*));
diff --git a/usr/src/lib/libast/i386/include/ast/ast_sys.h b/usr/src/lib/libast/i386/include/ast/ast_sys.h
index e9d4d677ef..28a1dfea31 100644
--- a/usr/src/lib/libast/i386/include/ast/ast_sys.h
+++ b/usr/src/lib/libast/i386/include/ast/ast_sys.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/sys by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/sys by iffe version 2008-01-31 : : */
#ifndef _AST_SYS_H
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/i386/include/ast/ast_time.h b/usr/src/lib/libast/i386/include/ast/ast_time.h
index 173ffea355..09c701be72 100644
--- a/usr/src/lib/libast/i386/include/ast/ast_time.h
+++ b/usr/src/lib/libast/i386/include/ast/ast_time.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/time by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/time by iffe version 2008-01-31 : : */
#ifndef _def_time_ast
#if !defined(__PROTO__)
@@ -97,7 +97,7 @@
#include <sys/times.h>
-#ifndef CLOCKS_PER_SEC
+#if !defined(CLOCKS_PER_SEC) && defined(CLK_TCK)
#define CLOCKS_PER_SEC CLK_TCK
#endif
diff --git a/usr/src/lib/libast/i386/include/ast/ast_tty.h b/usr/src/lib/libast/i386/include/ast/ast_tty.h
index aa7e5746a7..0c0e4dccb7 100644
--- a/usr/src/lib/libast/i386/include/ast/ast_tty.h
+++ b/usr/src/lib/libast/i386/include/ast/ast_tty.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/tty by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/tty by iffe version 2008-01-31 : : */
#ifndef _def_tty_ast
#define _def_tty_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/include/ast/ast_version.h b/usr/src/lib/libast/i386/include/ast/ast_version.h
index 0e586f9555..5882fbd2a5 100644
--- a/usr/src/lib/libast/i386/include/ast/ast_version.h
+++ b/usr/src/lib/libast/i386/include/ast/ast_version.h
@@ -7,4 +7,4 @@
#if !defined(__LINKAGE__)
#define __LINKAGE__ /* 2004-08-11 transition */
#endif
-#define _AST_VERSION 20061111L
+#define _AST_VERSION 20080910L
diff --git a/usr/src/lib/libast/i386/include/ast/ast_vfork.h b/usr/src/lib/libast/i386/include/ast/ast_vfork.h
index 7a0a8620be..05f8d6a6a3 100644
--- a/usr/src/lib/libast/i386/include/ast/ast_vfork.h
+++ b/usr/src/lib/libast/i386/include/ast/ast_vfork.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/vfork by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/vfork by iffe version 2008-01-31 : : */
#ifndef _def_vfork_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/i386/include/ast/ast_wait.h b/usr/src/lib/libast/i386/include/ast/ast_wait.h
index 220157ea87..0c6ac1a3bf 100644
--- a/usr/src/lib/libast/i386/include/ast/ast_wait.h
+++ b/usr/src/lib/libast/i386/include/ast/ast_wait.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/wait by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/wait by iffe version 2008-01-31 : : */
#ifndef _def_wait_ast
#define _def_wait_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/include/ast/ast_wchar.h b/usr/src/lib/libast/i386/include/ast/ast_wchar.h
index 3a4322c182..fb5148ea56 100644
--- a/usr/src/lib/libast/i386/include/ast/ast_wchar.h
+++ b/usr/src/lib/libast/i386/include/ast/ast_wchar.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/wchar by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/wchar by iffe version 2008-01-31 : : */
#ifndef _def_wchar_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/i386/include/ast/ast_windows.h b/usr/src/lib/libast/i386/include/ast/ast_windows.h
index 90e0260f59..b329b2d2f5 100644
--- a/usr/src/lib/libast/i386/include/ast/ast_windows.h
+++ b/usr/src/lib/libast/i386/include/ast/ast_windows.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/bytesex.h b/usr/src/lib/libast/i386/include/ast/bytesex.h
index 2bf2022afb..95c43e160d 100644
--- a/usr/src/lib/libast/i386/include/ast/bytesex.h
+++ b/usr/src/lib/libast/i386/include/ast/bytesex.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/ccode.h b/usr/src/lib/libast/i386/include/ast/ccode.h
index d26926ebc4..70c8d76471 100644
--- a/usr/src/lib/libast/i386/include/ast/ccode.h
+++ b/usr/src/lib/libast/i386/include/ast/ccode.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/cdt.h b/usr/src/lib/libast/i386/include/ast/cdt.h
index f6274cef92..3dc5b7b7f8 100644
--- a/usr/src/lib/libast/i386/include/ast/cdt.h
+++ b/usr/src/lib/libast/i386/include/ast/cdt.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/debug.h b/usr/src/lib/libast/i386/include/ast/debug.h
index ad7ecb7a54..565212e93b 100644
--- a/usr/src/lib/libast/i386/include/ast/debug.h
+++ b/usr/src/lib/libast/i386/include/ast/debug.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -40,14 +40,50 @@
#include <ast.h>
#include <error.h>
+#if !defined(DEBUG) && _BLD_DEBUG
+#define DEBUG _BLD_DEBUG
+#endif
+
#if DEBUG || _BLD_DEBUG
+
#define debug(x) x
#define message(x) do if (error_info.trace < 0) { error x; } while (0)
#define messagef(x) do if (error_info.trace < 0) { errorf x; } while (0)
+
+#define DEBUG_BEGTIME() debug_elapsed(1)
+#define DEBUG_GETTIME() debug_elapsed(0)
+#define DEBUG_ASSERT(p) ((p) ? 0 : (debug_fatal(__FILE__, __LINE__),0))
+#define DEBUG_COUNT(n) ((n) += 1)
+#define DEBUG_TALLY(c,n,v) ((c) ? ((n) += (v)) : (n))
+#define DEBUG_DECLARE(t,v) t v
+#define DEBUG_SET(n,v) ((n) = (v))
+#define DEBUG_PRINT(fd,s,v) do {char _b[1024];write(fd,_b,sfsprintf(_b,sizeof(_b),s,v));} while(0)
+#define DEBUG_WRITE(fd,d,n) write((fd),(d),(n))
+#define DEBUG_TEMP(temp) (temp) /* debugging stuff that should be removed */
+#define DEBUG_RETURN(x) (debug_fatal(__FILE__, __LINE__), (x))
+#define DEBUG_BREAK (debug_fatal(__FILE__, __LINE__))
+#define DEBUG_GOTO(label) do { debug_fatal(__FILE__, __LINE__); goto label; } while(0)
+
#else
+
#define debug(x)
#define message(x)
#define messagef(x)
+
+#define DEBUG_BEGTIME()
+#define DEBUG_GETTIME()
+#define DEBUG_ASSERT(p)
+#define DEBUG_COUNT(n)
+#define DEBUG_TALLY(c,n,v)
+#define DEBUG_DECLARE(t,v)
+#define DEBUG_SET(n,v)
+#define DEBUG_PRINT(fd,s,v)
+#define DEBUG_WRITE(fd,d,n)
+#define DEBUG_KPV(x)
+#define DEBUG_RETURN(x) return(x)
+#define DEBUG_BREAK break
+#define DEBUG_GOTO(label) goto label
+
#endif
#if _BLD_ast && defined(__EXPORT__)
@@ -55,6 +91,8 @@
#define __MANGLE__ __LINKAGE__ __EXPORT__
#endif
+extern __MANGLE__ double debug_elapsed __PROTO__((int));
+extern __MANGLE__ void debug_fatal __PROTO__((const char*, int));
extern __MANGLE__ void systrace __PROTO__((const char*));
#undef __MANGLE__
diff --git a/usr/src/lib/libast/i386/include/ast/dirent.h b/usr/src/lib/libast/i386/include/ast/dirent.h
index 32f33800b5..b94f22215f 100644
--- a/usr/src/lib/libast/i386/include/ast/dirent.h
+++ b/usr/src/lib/libast/i386/include/ast/dirent.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/dt.h b/usr/src/lib/libast/i386/include/ast/dt.h
index 0b7c331577..12299246bb 100644
--- a/usr/src/lib/libast/i386/include/ast/dt.h
+++ b/usr/src/lib/libast/i386/include/ast/dt.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/endian.h b/usr/src/lib/libast/i386/include/ast/endian.h
index 2299b5a3bc..12539254b6 100644
--- a/usr/src/lib/libast/i386/include/ast/endian.h
+++ b/usr/src/lib/libast/i386/include/ast/endian.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/error.h b/usr/src/lib/libast/i386/include/ast/error.h
index d6d171a15e..1cb01835f7 100644
--- a/usr/src/lib/libast/i386/include/ast/error.h
+++ b/usr/src/lib/libast/i386/include/ast/error.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/find.h b/usr/src/lib/libast/i386/include/ast/find.h
index 0caf2019cf..c094791a30 100644
--- a/usr/src/lib/libast/i386/include/ast/find.h
+++ b/usr/src/lib/libast/i386/include/ast/find.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/fnmatch.h b/usr/src/lib/libast/i386/include/ast/fnmatch.h
index 83e2dd9943..56c7dd7dce 100644
--- a/usr/src/lib/libast/i386/include/ast/fnmatch.h
+++ b/usr/src/lib/libast/i386/include/ast/fnmatch.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/fnv.h b/usr/src/lib/libast/i386/include/ast/fnv.h
index 6af5c1489c..badccc3071 100644
--- a/usr/src/lib/libast/i386/include/ast/fnv.h
+++ b/usr/src/lib/libast/i386/include/ast/fnv.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/fs3d.h b/usr/src/lib/libast/i386/include/ast/fs3d.h
index a16099d7ae..a52478f85c 100644
--- a/usr/src/lib/libast/i386/include/ast/fs3d.h
+++ b/usr/src/lib/libast/i386/include/ast/fs3d.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/fts.h b/usr/src/lib/libast/i386/include/ast/fts.h
index 081fe2a712..a8ce187391 100644
--- a/usr/src/lib/libast/i386/include/ast/fts.h
+++ b/usr/src/lib/libast/i386/include/ast/fts.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -127,6 +127,10 @@ struct Ftsent
#ifdef _FTSENT_PRIVATE_
_FTSENT_PRIVATE_
+#else
+ short _fts_pad_1; /* <ftwalk.h> compatibility */
+ struct stat _fts_pad_2; /* <ftwalk.h> compatibility */
+ FTS* fts; /* fts_open() handle */
#endif
};
@@ -134,6 +138,7 @@ struct Ftsent
struct Fts
{
int fts_errno; /* last errno */
+ __V_* fts_handle; /* user defined handle */
#ifdef _FTS_PRIVATE_
_FTS_PRIVATE_
@@ -149,6 +154,7 @@ struct Fts
extern __MANGLE__ FTSENT* fts_children __PROTO__((FTS*, int));
extern __MANGLE__ int fts_close __PROTO__((FTS*));
extern __MANGLE__ int fts_flags __PROTO__((void));
+extern __MANGLE__ int fts_local __PROTO__((FTSENT*));
extern __MANGLE__ int fts_notify __PROTO__((int(*)(FTS*, FTSENT*, __V_*), __V_*));
extern __MANGLE__ FTS* fts_open __PROTO__((char* const*, int, int(*)(FTSENT* const*, FTSENT* const*)));
extern __MANGLE__ FTSENT* fts_read __PROTO__((FTS*));
diff --git a/usr/src/lib/libast/i386/include/ast/ftw.h b/usr/src/lib/libast/i386/include/ast/ftw.h
index bd39851cbc..3d43cb2609 100644
--- a/usr/src/lib/libast/i386/include/ast/ftw.h
+++ b/usr/src/lib/libast/i386/include/ast/ftw.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/ftwalk.h b/usr/src/lib/libast/i386/include/ast/ftwalk.h
index 1ee713a37a..7172b76565 100644
--- a/usr/src/lib/libast/i386/include/ast/ftwalk.h
+++ b/usr/src/lib/libast/i386/include/ast/ftwalk.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/getopt.h b/usr/src/lib/libast/i386/include/ast/getopt.h
index 01348b6402..4ad28bbb01 100644
--- a/usr/src/lib/libast/i386/include/ast/getopt.h
+++ b/usr/src/lib/libast/i386/include/ast/getopt.h
@@ -7,12 +7,15 @@
#if !defined(__LINKAGE__)
#define __LINKAGE__ /* 2004-08-11 transition */
#endif
-#include <ast_getopt.h>
-
-#if !defined(_GETOPT_H) && !defined(_AST_STD_I)
+#ifdef _AST_STD_I
+#define _GETOPT_H -1
+#endif
+#ifndef _GETOPT_H
#define _GETOPT_H 1
+#include <ast_getopt.h>
+
#define no_argument 0
#define required_argument 1
#define optional_argument 2
diff --git a/usr/src/lib/libast/i386/include/ast/glob.h b/usr/src/lib/libast/i386/include/ast/glob.h
index e02733177d..62c420bb4f 100644
--- a/usr/src/lib/libast/i386/include/ast/glob.h
+++ b/usr/src/lib/libast/i386/include/ast/glob.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -77,8 +77,8 @@ struct _glob_
__V_* (*gl_diropen) __PROTO__((glob_t*, const char*));
char* (*gl_dirnext) __PROTO__((glob_t*, __V_*));
void (*gl_dirclose) __PROTO__((glob_t*, __V_*));
- int (*gl_type) __PROTO__((glob_t*, const char*));
- int (*gl_attr) __PROTO__((glob_t*, const char*));
+ int (*gl_type) __PROTO__((glob_t*, const char*, int));
+ int (*gl_attr) __PROTO__((glob_t*, const char*, int));
/* gnu extensions -- but how do you synthesize dirent and stat? */
diff --git a/usr/src/lib/libast/i386/include/ast/hash.h b/usr/src/lib/libast/i386/include/ast/hash.h
index 4050612983..3ad42981e3 100644
--- a/usr/src/lib/libast/i386/include/ast/hash.h
+++ b/usr/src/lib/libast/i386/include/ast/hash.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/hashkey.h b/usr/src/lib/libast/i386/include/ast/hashkey.h
index 1ce051ff26..ac0557f6df 100644
--- a/usr/src/lib/libast/i386/include/ast/hashkey.h
+++ b/usr/src/lib/libast/i386/include/ast/hashkey.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/hashpart.h b/usr/src/lib/libast/i386/include/ast/hashpart.h
index b2aa79649a..90f2be5c31 100644
--- a/usr/src/lib/libast/i386/include/ast/hashpart.h
+++ b/usr/src/lib/libast/i386/include/ast/hashpart.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/iconv.h b/usr/src/lib/libast/i386/include/ast/iconv.h
index e63b3f0fcd..58bc8240d2 100644
--- a/usr/src/lib/libast/i386/include/ast/iconv.h
+++ b/usr/src/lib/libast/i386/include/ast/iconv.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/ip6.h b/usr/src/lib/libast/i386/include/ast/ip6.h
new file mode 100644
index 0000000000..2712064a7e
--- /dev/null
+++ b/usr/src/lib/libast/i386/include/ast/ip6.h
@@ -0,0 +1,28 @@
+
+/* : : generated by proto : : */
+
+#if !defined(__PROTO__)
+#include <prototyped.h>
+#endif
+#if !defined(__LINKAGE__)
+#define __LINKAGE__ /* 2004-08-11 transition */
+#endif
+#if !_IP6_H
+#define _IP6_H 1
+
+#define IP6ADDR 16
+#define IP6BITS IP6ADDR
+#define IP6PREFIX (IP6ADDR+1)
+
+#if _BLD_ast && defined(__EXPORT__)
+#undef __MANGLE__
+#define __MANGLE__ __LINKAGE__ __EXPORT__
+#endif
+
+extern __MANGLE__ char* fmtip6 __PROTO__((unsigned char*, int));
+extern __MANGLE__ int strtoip6 __PROTO__((const char*, char**, unsigned char*, unsigned char*));
+
+#undef __MANGLE__
+#define __MANGLE__ __LINKAGE__
+
+#endif
diff --git a/usr/src/lib/libast/i386/include/ast/lc.h b/usr/src/lib/libast/i386/include/ast/lc.h
index fdd804f36e..b225864bbc 100644
--- a/usr/src/lib/libast/i386/include/ast/lc.h
+++ b/usr/src/lib/libast/i386/include/ast/lc.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/ls.h b/usr/src/lib/libast/i386/include/ast/ls.h
index cce1771b3f..b195c70e0c 100644
--- a/usr/src/lib/libast/i386/include/ast/ls.h
+++ b/usr/src/lib/libast/i386/include/ast/ls.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/magic.h b/usr/src/lib/libast/i386/include/ast/magic.h
index f484f2b20d..cf3c0fdcb8 100644
--- a/usr/src/lib/libast/i386/include/ast/magic.h
+++ b/usr/src/lib/libast/i386/include/ast/magic.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/magicid.h b/usr/src/lib/libast/i386/include/ast/magicid.h
index ceadff2653..66507d4d0b 100644
--- a/usr/src/lib/libast/i386/include/ast/magicid.h
+++ b/usr/src/lib/libast/i386/include/ast/magicid.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/mc.h b/usr/src/lib/libast/i386/include/ast/mc.h
index 4b55665b3b..be15276038 100644
--- a/usr/src/lib/libast/i386/include/ast/mc.h
+++ b/usr/src/lib/libast/i386/include/ast/mc.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/mime.h b/usr/src/lib/libast/i386/include/ast/mime.h
index b018b68c9a..c214a31130 100644
--- a/usr/src/lib/libast/i386/include/ast/mime.h
+++ b/usr/src/lib/libast/i386/include/ast/mime.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/mnt.h b/usr/src/lib/libast/i386/include/ast/mnt.h
index d877416642..ddce19fc9d 100644
--- a/usr/src/lib/libast/i386/include/ast/mnt.h
+++ b/usr/src/lib/libast/i386/include/ast/mnt.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/modecanon.h b/usr/src/lib/libast/i386/include/ast/modecanon.h
index ce107238e3..f207540d5b 100644
--- a/usr/src/lib/libast/i386/include/ast/modecanon.h
+++ b/usr/src/lib/libast/i386/include/ast/modecanon.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/modex.h b/usr/src/lib/libast/i386/include/ast/modex.h
index 458ad18ac1..96971e347b 100644
--- a/usr/src/lib/libast/i386/include/ast/modex.h
+++ b/usr/src/lib/libast/i386/include/ast/modex.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/namval.h b/usr/src/lib/libast/i386/include/ast/namval.h
index d746970d58..4c9b12f480 100644
--- a/usr/src/lib/libast/i386/include/ast/namval.h
+++ b/usr/src/lib/libast/i386/include/ast/namval.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/nl_types.h b/usr/src/lib/libast/i386/include/ast/nl_types.h
index db7383c626..36c901d8ed 100644
--- a/usr/src/lib/libast/i386/include/ast/nl_types.h
+++ b/usr/src/lib/libast/i386/include/ast/nl_types.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/option.h b/usr/src/lib/libast/i386/include/ast/option.h
index 7204047891..0cb1ca74c5 100644
--- a/usr/src/lib/libast/i386/include/ast/option.h
+++ b/usr/src/lib/libast/i386/include/ast/option.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -112,6 +112,7 @@ extern __MANGLE__ char* opthelp __PROTO__((const char*, const char*));
extern __MANGLE__ char* optusage __PROTO__((const char*));
extern __MANGLE__ int optstr __PROTO__((const char*, const char*));
extern __MANGLE__ int optesc __PROTO__((Sfio_t*, const char*, int));
+extern __MANGLE__ Opt_t* optctx __PROTO__((Opt_t*, Opt_t*));
#undef __MANGLE__
#define __MANGLE__ __LINKAGE__
diff --git a/usr/src/lib/libast/i386/include/ast/preroot.h b/usr/src/lib/libast/i386/include/ast/preroot.h
index 5cd0efce61..f1ab677142 100644
--- a/usr/src/lib/libast/i386/include/ast/preroot.h
+++ b/usr/src/lib/libast/i386/include/ast/preroot.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/preroot.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/preroot.sh by iffe version 2008-01-31 : : */
#ifndef _def_preroot_ast
#define _def_preroot_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/include/ast/proc.h b/usr/src/lib/libast/i386/include/ast/proc.h
index 1196fc5b3f..2bfa576970 100644
--- a/usr/src/lib/libast/i386/include/ast/proc.h
+++ b/usr/src/lib/libast/i386/include/ast/proc.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -41,12 +41,14 @@
#define PROC_ARGMOD (1<<0) /* argv[-1],argv[0] can be modified */
#define PROC_BACKGROUND (1<<1) /* shell background (&) setup */
+#define PROC_CHECK (1<<17) /* check that command exists */
#define PROC_CLEANUP (1<<2) /* close parent redirect fds on error */
#define PROC_DAEMON (1<<3) /* daemon setup */
#define PROC_ENVCLEAR (1<<4) /* clear environment */
#define PROC_FOREGROUND (1<<14) /* system(3) setup */
#define PROC_GID (1<<5) /* setgid(getgid()) */
#define PROC_IGNORE (1<<6) /* ignore parent pipe errors */
+#define PROC_IGNOREPATH (1<<16) /* procrun() intercept to ignore path */
#define PROC_OVERLAY (1<<7) /* overlay current process if possible */
#define PROC_PARANOID (1<<8) /* restrict everything */
#define PROC_PRIVELEGED (1<<9) /* setuid(0), setgid(getegid()) */
@@ -104,8 +106,8 @@ _PROC_PRIVATE_
extern __MANGLE__ int procclose __PROTO__((Proc_t*));
extern __MANGLE__ int procfree __PROTO__((Proc_t*));
-extern __MANGLE__ Proc_t* procopen __PROTO__((const char*, char**, char**, long*, long));
-extern __MANGLE__ int procrun __PROTO__((const char*, char**));
+extern __MANGLE__ Proc_t* procopen __PROTO__((const char*, char**, char**, long*, int));
+extern __MANGLE__ int procrun __PROTO__((const char*, char**, int));
#undef __MANGLE__
#define __MANGLE__ __LINKAGE__
diff --git a/usr/src/lib/libast/i386/include/ast/re_comp.h b/usr/src/lib/libast/i386/include/ast/re_comp.h
index 5da565e880..381bc801fc 100644
--- a/usr/src/lib/libast/i386/include/ast/re_comp.h
+++ b/usr/src/lib/libast/i386/include/ast/re_comp.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/recfmt.h b/usr/src/lib/libast/i386/include/ast/recfmt.h
index 1a66761ec2..133e37da41 100644
--- a/usr/src/lib/libast/i386/include/ast/recfmt.h
+++ b/usr/src/lib/libast/i386/include/ast/recfmt.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/regexp.h b/usr/src/lib/libast/i386/include/ast/regexp.h
index b7f3ed6313..e1c6258b3e 100644
--- a/usr/src/lib/libast/i386/include/ast/regexp.h
+++ b/usr/src/lib/libast/i386/include/ast/regexp.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/sfdisc.h b/usr/src/lib/libast/i386/include/ast/sfdisc.h
index 9e657f045b..5303d9a62e 100644
--- a/usr/src/lib/libast/i386/include/ast/sfdisc.h
+++ b/usr/src/lib/libast/i386/include/ast/sfdisc.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/sfio.h b/usr/src/lib/libast/i386/include/ast/sfio.h
index 9feba3043e..11317dad65 100644
--- a/usr/src/lib/libast/i386/include/ast/sfio.h
+++ b/usr/src/lib/libast/i386/include/ast/sfio.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -22,7 +22,7 @@
#ifndef _SFIO_H
#define _SFIO_H 1
-#define SFIO_VERSION 20050202L
+#define SFIO_VERSION 20080717L
/* Public header file for the sfio library
**
@@ -181,6 +181,7 @@ struct _sffmt_s
/* for the notify function and discipline exception */
#define SF_NEW 0 /* new stream */
#define SF_SETFD (-1) /* about to set the file descriptor */
+#define SF_MTACCESS (-2) /* starting a multi-threaded stream */
#define SF_BUFSIZE 8192 /* default buffer size */
#define SF_UNBOUND (-1) /* unbounded buffer size */
@@ -240,7 +241,7 @@ extern int sfclrlock _ARG_((Sfio_t*));
extern Void_t* sfsetbuf _ARG_((Sfio_t*, Void_t*, size_t));
extern Sfdisc_t* sfdisc _ARG_((Sfio_t*,Sfdisc_t*));
extern int sfraise _ARG_((Sfio_t*, int, Void_t*));
-extern int sfnotify _ARG_((void(*)(Sfio_t*, int, int)));
+extern int sfnotify _ARG_((void(*)(Sfio_t*, int, void*)));
extern int sfset _ARG_((Sfio_t*, int, int));
extern int sfsetfd _ARG_((Sfio_t*, int));
extern Sfio_t* sfpool _ARG_((Sfio_t*, Sfio_t*, int));
diff --git a/usr/src/lib/libast/i386/include/ast/sfio_s.h b/usr/src/lib/libast/i386/include/ast/sfio_s.h
index 27936a16b1..19a23d4772 100644
--- a/usr/src/lib/libast/i386/include/ast/sfio_s.h
+++ b/usr/src/lib/libast/i386/include/ast/sfio_s.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/sfio_t.h b/usr/src/lib/libast/i386/include/ast/sfio_t.h
index 36be6ecc94..c5251d3f34 100644
--- a/usr/src/lib/libast/i386/include/ast/sfio_t.h
+++ b/usr/src/lib/libast/i386/include/ast/sfio_t.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/shcmd.h b/usr/src/lib/libast/i386/include/ast/shcmd.h
new file mode 100644
index 0000000000..14e282a3d0
--- /dev/null
+++ b/usr/src/lib/libast/i386/include/ast/shcmd.h
@@ -0,0 +1,103 @@
+
+/* : : generated by proto : : */
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* David Korn <dgk@research.att.com> *
+* Phong Vo <kpv@research.att.com> *
+* *
+***********************************************************************/
+
+
+/*
+ * ksh builtin command api
+ */
+
+#ifndef _SHCMD_H
+#if !defined(__PROTO__)
+#include <prototyped.h>
+#endif
+#if !defined(__LINKAGE__)
+#define __LINKAGE__ /* 2004-08-11 transition */
+#endif
+
+#define _SHCMD_H 1
+
+#ifndef SH_VERSION
+# define Shell_t void
+#endif
+#ifndef NV_DEFAULT
+# define Namval_t void
+#endif
+#ifndef ERROR_NOTIFY
+# define ERROR_NOTIFY 1
+#endif
+
+typedef int (*Shbltin_f) __PROTO__((int, char**, __V_*));
+
+#undef Shbltin_t
+typedef struct Shbltin_s
+{
+ Shell_t *shp;
+ __V_ *ptr;
+ int version;
+ int (*shrun) __PROTO__((int, char**));
+ int (*shtrap) __PROTO__((const char*, int));
+ void (*shexit) __PROTO__((int));
+ Namval_t *(*shbltin) __PROTO__((const char*, Shbltin_f, __V_*));
+ unsigned char notify;
+ unsigned char sigset;
+ unsigned char nosfio;
+ Namval_t *bnode;
+ Namval_t *vnode;
+ char *data;
+ int flags;
+ char *(*shgetenv) __PROTO__((const char*));
+ char *(*shsetenv) __PROTO__((const char*));
+ int invariant;
+} Shbltin_t;
+
+#if defined(SH_VERSION) || defined(_SH_PRIVATE)
+# undef Shell_t
+# undef Namval_t
+#else
+# define sh_run(c, ac, av) ((c)?(*((Shbltin_t*)(c))->shrun)(ac,av):-1)
+# define sh_system(c,str) ((c)?(*((Shbltin_t*)(c))->shtrap)(str,0):system(str))
+# define sh_exit(c,n) ((c)?(*((Shbltin_t*)(c))->shexit)(n):exit(n))
+# define sh_checksig(c) ((c) && ((Shbltin_t*)(c))->sigset)
+# if defined(SFIO_VERSION) || defined(_AST_H)
+# define LIB_INIT(c)
+# else
+# define LIB_INIT(c) ((c) && (((Shbltin_t*)(c))->nosfio = 1))
+# endif
+# ifndef _CMD_H
+# define cmdinit(ac,av,c,cat,flg) do { if((ac)<=0) return(0); \
+ (((Shbltin_t*)(c))->notify = ((flg)&ERROR_NOTIFY)?1:0);} while(0)
+# endif
+#endif
+
+#if _BLD_ast && defined(__EXPORT__)
+#undef __MANGLE__
+#define __MANGLE__ __LINKAGE__ __EXPORT__
+#endif
+
+extern __MANGLE__ int astintercept __PROTO__((Shbltin_t*, int));
+
+#undef __MANGLE__
+#define __MANGLE__ __LINKAGE__
+
+#endif
diff --git a/usr/src/lib/libast/i386/include/ast/sig.h b/usr/src/lib/libast/i386/include/ast/sig.h
index 267f3b5959..d755292cdd 100644
--- a/usr/src/lib/libast/i386/include/ast/sig.h
+++ b/usr/src/lib/libast/i386/include/ast/sig.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/sig.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/sig.sh by iffe version 2008-01-31 : : */
#ifndef _def_sig_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
diff --git a/usr/src/lib/libast/i386/include/ast/stack.h b/usr/src/lib/libast/i386/include/ast/stack.h
index ad32ebb8ab..5c55255f06 100644
--- a/usr/src/lib/libast/i386/include/ast/stack.h
+++ b/usr/src/lib/libast/i386/include/ast/stack.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/stak.h b/usr/src/lib/libast/i386/include/ast/stak.h
index e0e707b0e5..321be20328 100644
--- a/usr/src/lib/libast/i386/include/ast/stak.h
+++ b/usr/src/lib/libast/i386/include/ast/stak.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/stdio.h b/usr/src/lib/libast/i386/include/ast/stdio.h
index 7e137c5712..42d7ed8269 100644
--- a/usr/src/lib/libast/i386/include/ast/stdio.h
+++ b/usr/src/lib/libast/i386/include/ast/stdio.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/stk.h b/usr/src/lib/libast/i386/include/ast/stk.h
index 24947d24f1..ef9a946ce0 100644
--- a/usr/src/lib/libast/i386/include/ast/stk.h
+++ b/usr/src/lib/libast/i386/include/ast/stk.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -84,6 +84,7 @@ extern __MANGLE__ char* stkcopy __PROTO__((Stk_t*,const char*));
extern __MANGLE__ char* stkset __PROTO__((Stk_t*, char*, unsigned));
extern __MANGLE__ char* _stkseek __PROTO__((Stk_t*, unsigned));
extern __MANGLE__ char* stkfreeze __PROTO__((Stk_t*, unsigned));
+extern __MANGLE__ int stkon __PROTO__((Stk_t*, char *));
#undef __MANGLE__
#define __MANGLE__ __LINKAGE__
diff --git a/usr/src/lib/libast/i386/include/ast/swap.h b/usr/src/lib/libast/i386/include/ast/swap.h
index d89248d12b..81e49db105 100644
--- a/usr/src/lib/libast/i386/include/ast/swap.h
+++ b/usr/src/lib/libast/i386/include/ast/swap.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/tar.h b/usr/src/lib/libast/i386/include/ast/tar.h
index 910b6e8612..3a9a99b0ac 100644
--- a/usr/src/lib/libast/i386/include/ast/tar.h
+++ b/usr/src/lib/libast/i386/include/ast/tar.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/times.h b/usr/src/lib/libast/i386/include/ast/times.h
index 25e81662be..1ed0f2135a 100644
--- a/usr/src/lib/libast/i386/include/ast/times.h
+++ b/usr/src/lib/libast/i386/include/ast/times.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/tm.h b/usr/src/lib/libast/i386/include/ast/tm.h
index f790a9a66e..29c0d4f1fa 100644
--- a/usr/src/lib/libast/i386/include/ast/tm.h
+++ b/usr/src/lib/libast/i386/include/ast/tm.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/tmx.h b/usr/src/lib/libast/i386/include/ast/tmx.h
index bf5f3094c9..6b3ca63285 100644
--- a/usr/src/lib/libast/i386/include/ast/tmx.h
+++ b/usr/src/lib/libast/i386/include/ast/tmx.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/tmx by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/tmx by iffe version 2008-01-31 : : */
#ifndef _TMX_H
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/i386/include/ast/tok.h b/usr/src/lib/libast/i386/include/ast/tok.h
index 3637489918..1d5112837c 100644
--- a/usr/src/lib/libast/i386/include/ast/tok.h
+++ b/usr/src/lib/libast/i386/include/ast/tok.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/tv.h b/usr/src/lib/libast/i386/include/ast/tv.h
index 21ab4abdbf..eb57020181 100644
--- a/usr/src/lib/libast/i386/include/ast/tv.h
+++ b/usr/src/lib/libast/i386/include/ast/tv.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/tv by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/tv by iffe version 2008-01-31 : : */
#ifndef _TV_H
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/i386/include/ast/usage.h b/usr/src/lib/libast/i386/include/ast/usage.h
index 81b59e1aca..d969a0e4c1 100644
--- a/usr/src/lib/libast/i386/include/ast/usage.h
+++ b/usr/src/lib/libast/i386/include/ast/usage.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/vdb.h b/usr/src/lib/libast/i386/include/ast/vdb.h
index 63e310c724..ba47e14901 100644
--- a/usr/src/lib/libast/i386/include/ast/vdb.h
+++ b/usr/src/lib/libast/i386/include/ast/vdb.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/vecargs.h b/usr/src/lib/libast/i386/include/ast/vecargs.h
index 4d329cd154..121e9d5010 100644
--- a/usr/src/lib/libast/i386/include/ast/vecargs.h
+++ b/usr/src/lib/libast/i386/include/ast/vecargs.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/vmalloc.h b/usr/src/lib/libast/i386/include/ast/vmalloc.h
index f0a8114c6a..8cf3e9b974 100644
--- a/usr/src/lib/libast/i386/include/ast/vmalloc.h
+++ b/usr/src/lib/libast/i386/include/ast/vmalloc.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -27,7 +27,7 @@
** Written by Kiem-Phong Vo, kpv@research.att.com, 01/16/94.
*/
-#define VMALLOC_VERSION 20050928L
+#define VMALLOC_VERSION 20070911L
#if _PACKAGE_ast
#include <ast_std.h>
diff --git a/usr/src/lib/libast/i386/include/ast/wait.h b/usr/src/lib/libast/i386/include/ast/wait.h
index 6910081961..08160043fa 100644
--- a/usr/src/lib/libast/i386/include/ast/wait.h
+++ b/usr/src/lib/libast/i386/include/ast/wait.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/wchar.h b/usr/src/lib/libast/i386/include/ast/wchar.h
index 557a403adc..7796480d09 100644
--- a/usr/src/lib/libast/i386/include/ast/wchar.h
+++ b/usr/src/lib/libast/i386/include/ast/wchar.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/include/ast/wordexp.h b/usr/src/lib/libast/i386/include/ast/wordexp.h
index b2e80d9f35..c3f97b37d9 100644
--- a/usr/src/lib/libast/i386/include/ast/wordexp.h
+++ b/usr/src/lib/libast/i386/include/ast/wordexp.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/align b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/align
index 23ab6030ef..08a43ae9da 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/align
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/align
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/align.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/align.c by iffe version 2008-01-31 : : */
#ifndef _def_align_ast
#define _def_align_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/botch b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/botch
index f622454838..9aa7e03bc9 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/botch
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/botch
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/botch.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/botch.c by iffe version 2008-01-31 : : */
#ifndef _def_botch_ast
#define _def_botch_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/ccode b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/ccode
index 26e608f1d0..d7684a82db 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/ccode
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/ccode
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/ccode by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/ccode by iffe version 2008-01-31 : : */
#ifndef _def_ccode_ast
#define _def_ccode_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/common b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/common
index 9727c082e0..ea3d39f8c1 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/common
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/common
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/common by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/common by iffe version 2008-01-31 : : */
#ifndef _AST_COMMON_H
#define _AST_COMMON_H 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/dirent b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/dirent
index 0cdf633a20..81ba45ad54 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/dirent
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/dirent
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/dirent by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/dirent by iffe version 2008-01-31 : : */
#ifndef _def_dirent_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/eaccess b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/eaccess
index 1a75e5905b..e1e91b7484 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/eaccess
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/eaccess
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/eaccess by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/eaccess by iffe version 2008-01-31 : : */
#ifndef _def_eaccess_ast
#define _def_eaccess_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/errno b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/errno
index 6af7dde98e..a9c0fc3cbe 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/errno
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/errno
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/errno by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/errno by iffe version 2008-01-31 : : */
#ifndef _def_errno_ast
#define _def_errno_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/fcntl b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/fcntl
index 78510ec979..22b6e0a868 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/fcntl
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/fcntl
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/fcntl.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/fcntl.c by iffe version 2008-01-31 : : */
#ifndef _def_fcntl_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/float b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/float
index 9afe6e6ff8..a4914d2f39 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/float
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/float
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/float by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/float by iffe version 2008-01-31 : : */
#ifndef _def_float_ast
#if !defined(__PROTO__)
@@ -68,13 +68,16 @@
#define _hdr_math 1 /* #include <math.h> ok */
#define _hdr_values 1 /* #include <values.h> ok */
#define _LIB_m 1 /* -lm is a library */
+#define _lib_fpclassify 1 /* fpclassify() in default lib(s) */
#define _lib_frexp 1 /* frexp() in default lib(s) */
#define _lib_frexpl 1 /* frexpl() in default lib(s) */
#define _lib_ldexp 1 /* ldexp() in default lib(s) */
#define _lib_ldexpl 1 /* ldexpl() in default lib(s) */
#define _lib_finite 1 /* finite() in default lib(s) */
+#define _lib_isinf 1 /* isinf() in default lib(s) */
#define _lib_isnan 1 /* isnan() in default lib(s) */
#define _lib_isnanl 1 /* isnanl() in default lib(s) */
+#define _lib_signbit 1 /* signbit() in default lib(s) */
#define _lib_copysign 1 /* copysign() in default lib(s) */
#define _lib_copysignl 1 /* copysignl() in default lib(s) */
#include <ast_common.h>
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/fs b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/fs
index 34eb5498d2..b18bef1b29 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/fs
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/fs
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/fs by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/fs by iffe version 2008-01-31 : : */
#ifndef _def_fs_ast
#if !defined(__PROTO__)
@@ -72,20 +72,9 @@
#define _lib_mknod 1 /* mknod() in default lib(s) */
#define _lib_sync 1 /* sync() in default lib(s) */
#include <sys/stat.h>
+#include <sys/mkdev.h>
#define FS_default "ufs"
#if defined(__STDPP__directive) && defined(__STDPP__initial)
-__STDPP__directive pragma pp:initial
-#endif
-#ifndef major
-#define major(x) ( major_t ) ( ( ( ( unsigned ) ( ( x ) ) ) >> 8 ) & 0x7f )
-#endif
-#ifndef minor
-#define minor(x) ( minor_t ) ( ( ( x ) ) & 0xff )
-#endif
-#ifndef makedev
-#define makedev(x,y) ( unsigned short ) ( ( ( ( x ) ) << 8 ) | ( ( ( y ) ) & 0xff ) )
-#endif
-#if defined(__STDPP__directive) && defined(__STDPP__initial)
__STDPP__directive pragma pp:noinitial
#endif
#define _hdr_stdio 1 /* #include <stdio.h> ok */
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/hack b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/hack
index dfa4fd2d63..de39f993ac 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/hack
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/hack
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/hack by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/hack by iffe version 2008-01-31 : : */
#ifndef _def_hack_ast
#define _def_hack_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/iconv b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/iconv
index b8aee7e488..449c82bd36 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/iconv
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/iconv
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/iconv by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/iconv by iffe version 2008-01-31 : : */
#ifndef _def_iconv_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/isoc99 b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/isoc99
new file mode 100644
index 0000000000..0f1650ba0e
--- /dev/null
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/isoc99
@@ -0,0 +1,11 @@
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/isoc99 by iffe version 2008-01-31 : : */
+#ifndef _def_isoc99_ast
+#define _def_isoc99_ast 1
+#define _sys_types 1 /* #include <sys/types.h> ok */
+#define _LIB_m 1 /* -lm is a library */
+/* _ISOC99_SOURCE plays nice */
+#ifndef _ISOC99_SOURCE
+#define _ISOC99_SOURCE 1
+#endif
+
+#endif
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/lib b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/lib
index c7bfb927c9..8304bd96b9 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/lib
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/lib
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/lib by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/lib by iffe version 2008-01-31 : : */
#ifndef _def_lib_ast
#define _def_lib_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/libpath b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/libpath
index 75420108a9..33e0f3c97c 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/libpath
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/libpath
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/libpath.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/libpath.sh by iffe version 2008-01-31 : : */
#ifndef _def_libpath_ast
#define _def_libpath_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/limits b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/limits
index dc1593a119..e2608b975e 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/limits
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/limits
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/limits.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/limits.c by iffe version 2008-01-31 : : */
#ifndef _def_limits_ast
#define _def_limits_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/map b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/map
index 5ae49fb0a6..fe3d5fddbc 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/map
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/map
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/map.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/map.c by iffe version 2008-01-31 : : */
#ifndef _def_map_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
@@ -121,6 +121,14 @@ extern __MANGLE__ char* getcwd __PROTO__((char*, size_t));
#define getopt_long _ast_getopt_long
#undef getopt_long_only
#define getopt_long_only _ast_getopt_long_only
+#undef optopt
+#define optopt _ast_optopt
+#undef optarg
+#define optarg _ast_optarg
+#undef optind
+#define optind _ast_optind
+#undef opterr
+#define opterr _ast_opterr
#undef getwd
#define getwd _ast_getwd
extern __MANGLE__ char* getwd __PROTO__((char*));
@@ -146,6 +154,8 @@ extern __MANGLE__ char* mktemp __PROTO__((char*));
#define mktime _ast_mktime
#undef nftw
#define nftw _ast_nftw
+#undef optctx
+#define optctx _ast_optctx
#undef optesc
#define optesc _ast_optesc
#undef optget
@@ -274,7 +284,7 @@ extern __MANGLE__ char* realpath __PROTO__((const char*, char*));
extern __MANGLE__ int remove __PROTO__((const char*));
#undef resolvepath
#define resolvepath _ast_resolvepath
-extern __MANGLE__ char* resolvepath __PROTO__((const char*, char*, size_t));
+extern __MANGLE__ int resolvepath __PROTO__((const char*, char*, size_t));
#undef setenv
#define setenv _ast_setenv
extern __MANGLE__ int setenv __PROTO__((const char*, const char*, int));
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/mmap b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/mmap
index 957987b8aa..448ab22df8 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/mmap
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/mmap
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/mmap by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/mmap by iffe version 2008-01-31 : : */
#ifndef _def_mmap_ast
#define _def_mmap_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/mode b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/mode
index d9e489168f..b663948b0f 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/mode
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/mode
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/mode.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/mode.c by iffe version 2008-01-31 : : */
#ifndef _def_mode_ast
#define _def_mode_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/ndbm b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/ndbm
new file mode 100644
index 0000000000..d21a376500
--- /dev/null
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/ndbm
@@ -0,0 +1,9 @@
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/ndbm by iffe version 2008-01-31 : : */
+#ifndef _def_ndbm_ast
+#define _def_ndbm_ast 1
+#define _sys_types 1 /* #include <sys/types.h> ok */
+#define _hdr_ndbm 1 /* #include <ndbm.h> ok */
+#include <ndbm.h>
+#define _use_ndbm 1
+
+#endif
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/nl_types b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/nl_types
index 088c1c0cb2..2f713d9855 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/nl_types
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/nl_types
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/nl_types by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/nl_types by iffe version 2008-01-31 : : */
#ifndef _def_nl_types_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/omitted b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/omitted
index 28602542f8..e321578c70 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/omitted
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/omitted
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/omitted by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/omitted by iffe version 2008-01-31 : : */
#ifndef _def_omitted_ast
#define _def_omitted_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/param b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/param
index 74a6367a3a..f10c928b22 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/param
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/param
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/param.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/param.sh by iffe version 2008-01-31 : : */
#ifndef _def_param_ast
#define _def_param_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/preroot b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/preroot
index 5180fe4be7..7215b1a074 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/preroot
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/preroot
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/preroot.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/preroot.sh by iffe version 2008-01-31 : : */
#ifndef _def_preroot_ast
#define _def_preroot_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/sfinit b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/sfinit
index 42331943d1..92e3bff69e 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/sfinit
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/sfinit
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/sfinit.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/sfinit.c by iffe version 2008-01-31 : : */
#ifndef _def_sfinit_ast
#define _def_sfinit_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/sfio b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/sfio
index 75b71e2e22..a16a3d1a64 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/sfio
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/sfio
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/sfio by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/sfio by iffe version 2008-01-31 : : */
#ifndef _def_sfio_ast
#define _def_sfio_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/sig b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/sig
index 32bdf7dd50..f187f7276d 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/sig
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/sig
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/sig.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/sig.sh by iffe version 2008-01-31 : : */
#ifndef _def_sig_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/siglist b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/siglist
new file mode 100644
index 0000000000..82e6361823
--- /dev/null
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/siglist
@@ -0,0 +1,125 @@
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/siglist by iffe version 2008-01-31 : : */
+#ifndef _def_siglist_ast
+#define _def_siglist_ast 1
+#define _sys_types 1 /* #include <sys/types.h> ok */
+#define _hdr_string 1 /* #include <string.h> ok */
+#define _hdr_signal 1 /* #include <signal.h> ok */
+#define _lib_strsignal 1 /* strsignal() in default lib(s) */
+#if defined(SIGINT) && !defined(HAD_SIGINT)
+0,"INT",SIGINT,
+#endif
+#if defined(SIGQUIT) && !defined(HAD_SIGQUIT)
+0,"QUIT",SIGQUIT,
+#endif
+#if defined(SIGILL) && !defined(HAD_SIGILL)
+0,"ILL",SIGILL,
+#endif
+#if defined(SIGTRAP) && !defined(HAD_SIGTRAP)
+0,"TRAP",SIGTRAP,
+#endif
+#if defined(SIGIOT) && !defined(HAD_SIGIOT)
+0,"IOT",SIGIOT,
+#endif
+#if defined(SIGEMT) && !defined(HAD_SIGEMT)
+0,"EMT",SIGEMT,
+#endif
+#if defined(SIGFPE) && !defined(HAD_SIGFPE)
+0,"FPE",SIGFPE,
+#endif
+#if defined(SIGKILL) && !defined(HAD_SIGKILL)
+0,"KILL",SIGKILL,
+#endif
+#if defined(SIGBUS) && !defined(HAD_SIGBUS)
+0,"BUS",SIGBUS,
+#endif
+#if defined(SIGSEGV) && !defined(HAD_SIGSEGV)
+0,"SEGV",SIGSEGV,
+#endif
+#if defined(SIGSYS) && !defined(HAD_SIGSYS)
+0,"SYS",SIGSYS,
+#endif
+#if defined(SIGPIPE) && !defined(HAD_SIGPIPE)
+0,"PIPE",SIGPIPE,
+#endif
+#if defined(SIGALRM) && !defined(HAD_SIGALRM)
+0,"ALRM",SIGALRM,
+#endif
+#if defined(SIGTERM) && !defined(HAD_SIGTERM)
+0,"TERM",SIGTERM,
+#endif
+#if defined(SIGUSR1) && !defined(HAD_SIGUSR1)
+0,"USR1",SIGUSR1,
+#endif
+#if defined(SIGUSR2) && !defined(HAD_SIGUSR2)
+0,"USR2",SIGUSR2,
+#endif
+#if defined(SIGCHLD) && !defined(HAD_SIGCHLD)
+0,"CHLD",SIGCHLD,
+#endif
+#if defined(SIGPWR) && !defined(HAD_SIGPWR)
+0,"PWR",SIGPWR,
+#endif
+#if defined(SIGWINCH) && !defined(HAD_SIGWINCH)
+0,"WINCH",SIGWINCH,
+#endif
+#if defined(SIGURG) && !defined(HAD_SIGURG)
+0,"URG",SIGURG,
+#endif
+#if defined(SIGPOLL) && !defined(HAD_SIGPOLL)
+0,"POLL",SIGPOLL,
+#endif
+#if defined(SIGSTOP) && !defined(HAD_SIGSTOP)
+0,"STOP",SIGSTOP,
+#endif
+#if defined(SIGTSTP) && !defined(HAD_SIGTSTP)
+0,"TSTP",SIGTSTP,
+#endif
+#if defined(SIGCONT) && !defined(HAD_SIGCONT)
+0,"CONT",SIGCONT,
+#endif
+#if defined(SIGTTIN) && !defined(HAD_SIGTTIN)
+0,"TTIN",SIGTTIN,
+#endif
+#if defined(SIGTTOU) && !defined(HAD_SIGTTOU)
+0,"TTOU",SIGTTOU,
+#endif
+#if defined(SIGVTALRM) && !defined(HAD_SIGVTALRM)
+0,"VTALRM",SIGVTALRM,
+#endif
+#if defined(SIGPROF) && !defined(HAD_SIGPROF)
+0,"PROF",SIGPROF,
+#endif
+#if defined(SIGXCPU) && !defined(HAD_SIGXCPU)
+0,"XCPU",SIGXCPU,
+#endif
+#if defined(SIGXFSZ) && !defined(HAD_SIGXFSZ)
+0,"XFSZ",SIGXFSZ,
+#endif
+#if defined(SIGWAITING) && !defined(HAD_SIGWAITING)
+0,"WAITING",SIGWAITING,
+#endif
+#if defined(SIGLWP) && !defined(HAD_SIGLWP)
+0,"LWP",SIGLWP,
+#endif
+#if defined(SIGFREEZE) && !defined(HAD_SIGFREEZE)
+0,"FREEZE",SIGFREEZE,
+#endif
+#if defined(SIGTHAW) && !defined(HAD_SIGTHAW)
+0,"THAW",SIGTHAW,
+#endif
+#if defined(SIGCANCEL) && !defined(HAD_SIGCANCEL)
+0,"CANCEL",SIGCANCEL,
+#endif
+#if defined(SIGLOST) && !defined(HAD_SIGLOST)
+0,"LOST",SIGLOST,
+#endif
+#if defined(SIGXRES) && !defined(HAD_SIGXRES)
+0,"XRES",SIGXRES,
+#endif
+#if defined(SIGJVM1) && !defined(HAD_SIGJVM1)
+0,"JVM1",SIGJVM1,
+#endif
+#if defined(SIGJVM2) && !defined(HAD_SIGJVM2)
+0,"JVM2",SIGJVM2,
+#endif
+#endif
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/signal b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/signal
index f39542f08c..f37e3f068d 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/signal
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/signal
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/signal.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/signal.c by iffe version 2008-01-31 : : */
#ifndef _def_signal_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
@@ -103,18 +103,18 @@ static const char* const sig_name[] =
"LWP",
"FREEZE",
"THAW",
- "36",
+ "CANCEL",
"LOST",
- "38",
- "39",
- "40",
+ "XRES",
+ "JVM1",
+ "JVM2",
"RTMIN",
- "RT1",
- "RT2",
- "RT3",
- "RT4",
- "RT5",
- "RT6",
+ "RTMIN+1",
+ "RTMIN+2",
+ "RTMIN+3",
+ "RTMAX-3",
+ "RTMAX-2",
+ "RTMAX-1",
"RTMAX",
0
};
@@ -157,11 +157,11 @@ static const char* const sig_text[] =
"Thread event",
"CPR freeze",
"CPR thaw",
- "Signal 36",
+ "Thread Cancellation",
"Resources lost",
- "Signal 38",
- "Signal 39",
- "Signal 40",
+ "Resource Control Exceeded",
+ "Reserved for JVM 1",
+ "Reserved for JVM 2",
"Realtime priority 0 (lo)",
"Realtime priority 1",
"Realtime priority 2",
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/standards b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/standards
index 186cf1c635..03c21fffe3 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/standards
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/standards
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/standards by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/standards by iffe version 2008-01-31 : : */
#ifndef _def_standards_ast
#define _def_standards_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/stdio b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/stdio
index 6c72b2d2f4..4657a0929d 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/stdio
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/stdio
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/stdio by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/stdio by iffe version 2008-01-31 : : */
#ifndef _SFSTDIO_H
#if !defined(__PROTO__)
@@ -178,7 +178,7 @@ extern __MANGLE__ int fprintf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fpurge __PROTO__((FILE*));
extern __MANGLE__ int fputc __PROTO__((int, FILE*));
extern __MANGLE__ int fputs __PROTO__((const char*, FILE*));
-extern __MANGLE__ ssize_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
extern __MANGLE__ FILE* freopen __PROTO__((const char*, const char*, FILE*));
extern __MANGLE__ int fscanf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fseek __PROTO__((FILE*, long, int));
@@ -186,7 +186,7 @@ extern __MANGLE__ int fseeko __PROTO__((FILE*, off_t, int));
extern __MANGLE__ int fsetpos __PROTO__((FILE*, const fpos_t*));
extern __MANGLE__ long ftell __PROTO__((FILE*));
extern __MANGLE__ off_t ftello __PROTO__((FILE*));
-extern __MANGLE__ ssize_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
extern __MANGLE__ int getc __PROTO__((FILE*));
extern __MANGLE__ int getchar __PROTO__((void));
extern __MANGLE__ char* gets __PROTO__((char*));
@@ -245,6 +245,10 @@ extern __MANGLE__ int getchar_unlocked __PROTO__((void));
extern __MANGLE__ int putc_unlocked __PROTO__((int, FILE*));
extern __MANGLE__ int putchar_unlocked __PROTO__((int));
+extern __MANGLE__ void flockfile __PROTO__((FILE*));
+extern __MANGLE__ int ftrylockfile __PROTO__((FILE*));
+extern __MANGLE__ void funlockfile __PROTO__((FILE*));
+
#ifdef _USE_GNU
extern __MANGLE__ int fcloseall __PROTO__((void));
@@ -324,6 +328,7 @@ extern __MANGLE__ ssize_t getline __PROTO__((char**, size_t*, FILE*));
#define vsprintf _ast_vsprintf
#define vsscanf _ast_vsscanf
#define fcloseall _ast_fcloseall
+#define _filbuf _ast__filbuf
#define fmemopen _ast_fmemopen
#define __getdelim _ast___getdelim
#define getdelim _ast_getdelim
@@ -343,6 +348,9 @@ extern __MANGLE__ ssize_t getline __PROTO__((char**, size_t*, FILE*));
#define getchar_unlocked _ast_getchar_unlocked
#define putc_unlocked _ast_putc_unlocked
#define putchar_unlocked _ast_putchar_unlocked
+#define flockfile _ast_flockfile
+#define ftrylockfile _ast_ftrylockfile
+#define funlockfile _ast_funlockfile
#if defined(__STDPP__directive) && defined(__STDPP__initial)
__STDPP__directive pragma pp:initial
@@ -402,7 +410,7 @@ extern __MANGLE__ int fprintf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fpurge __PROTO__((FILE*));
extern __MANGLE__ int fputc __PROTO__((int, FILE*));
extern __MANGLE__ int fputs __PROTO__((const char*, FILE*));
-extern __MANGLE__ ssize_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
extern __MANGLE__ FILE* freopen __PROTO__((const char*, const char*, FILE*));
extern __MANGLE__ int fscanf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fseek __PROTO__((FILE*, long, int));
@@ -410,7 +418,7 @@ extern __MANGLE__ int fseeko __PROTO__((FILE*, off_t, int));
extern __MANGLE__ int fsetpos __PROTO__((FILE*, const fpos_t*));
extern __MANGLE__ long ftell __PROTO__((FILE*));
extern __MANGLE__ off_t ftello __PROTO__((FILE*));
-extern __MANGLE__ ssize_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
extern __MANGLE__ int getc __PROTO__((FILE*));
extern __MANGLE__ int getchar __PROTO__((void));
extern __MANGLE__ char* gets __PROTO__((char*));
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/sys b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/sys
index 9e024f86e7..55d8137d6f 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/sys
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/sys
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/sys by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/sys by iffe version 2008-01-31 : : */
#ifndef _AST_SYS_H
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/time b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/time
index fd36809299..83fd6b7121 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/time
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/time
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/time by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/time by iffe version 2008-01-31 : : */
#ifndef _def_time_ast
#if !defined(__PROTO__)
@@ -76,7 +76,7 @@
#include <sys/times.h>
-#ifndef CLOCKS_PER_SEC
+#if !defined(CLOCKS_PER_SEC) && defined(CLK_TCK)
#define CLOCKS_PER_SEC CLK_TCK
#endif
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/tmlib b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/tmlib
index d6a8ab2888..fac870b534 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/tmlib
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/tmlib
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/tmlib by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/tmlib by iffe version 2008-01-31 : : */
#ifndef _def_tmlib_ast
#if !defined(__PROTO__)
@@ -63,6 +63,9 @@
#define _def_tmlib_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define tmlocaltime(p) localtime(p)
+#define _tzset_environ 1 /* tzset() bypasses user getenv() */
+#define tmlocaltime(p) _tm_localtime(p)
+
+extern __MANGLE__ struct tm* _tm_localtime __PROTO__((const time_t*));
#endif
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/tmx b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/tmx
index 567ee89369..a576776476 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/tmx
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/tmx
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/tmx by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/tmx by iffe version 2008-01-31 : : */
#ifndef _TMX_H
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/tty b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/tty
index e645095122..04cec09685 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/tty
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/tty
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/tty by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/tty by iffe version 2008-01-31 : : */
#ifndef _def_tty_ast
#define _def_tty_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/tv b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/tv
index 272ec802d8..5e7b8ce3f4 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/tv
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/tv
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/tv by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/tv by iffe version 2008-01-31 : : */
#ifndef _TV_H
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/tvlib b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/tvlib
index bb0bc14537..88616f5462 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/tvlib
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/tvlib
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/tvlib by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/tvlib by iffe version 2008-01-31 : : */
#ifndef _def_tvlib_ast
#define _def_tvlib_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
@@ -10,6 +10,7 @@
#define _lib_utimes 1 /* utimes() in default lib(s) */
#define _lib_nanosleep 1 /* nanosleep() in default lib(s) */
#define _lib_usleep 1 /* usleep() in default lib(s) */
+#define _sys_stat 1 /* #include <sys/stat.h> ok */
#define _sys_time 1 /* #include <sys/time.h> ok */
#define _lib_clock_gettime 1 /* execute{\ passed */
#define tmgettimeofday(p) gettimeofday(p,(struct timezone*)0)
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/types b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/types
deleted file mode 100644
index 343b5954a0..0000000000
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/types
+++ /dev/null
@@ -1,5 +0,0 @@
-/* : : generated by iffe version 2007-04-04 : : */
-#ifndef _def_types_ast
-#define _def_types_ast 1
-#define _sys_types 1 /* #include <sys/types.h> ok */
-#endif
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/uwin b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/uwin
index 7e594f3dd6..acc87f68cd 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/uwin
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/uwin
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/uwin by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/uwin by iffe version 2008-01-31 : : */
#ifndef _def_uwin_ast
#define _def_uwin_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/vfork b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/vfork
index f1993151cc..5ebb662a08 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/vfork
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/vfork
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/vfork by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/vfork by iffe version 2008-01-31 : : */
#ifndef _def_vfork_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/vmalloc b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/vmalloc
index 95c5564ae6..cbfeafdd9c 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/vmalloc
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/vmalloc
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/vmalloc by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/vmalloc by iffe version 2008-01-31 : : */
#ifndef _def_vmalloc_ast
#define _def_vmalloc_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/wait b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/wait
index 9ed6722037..a113121028 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/wait
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/wait
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/wait by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/wait by iffe version 2008-01-31 : : */
#ifndef _def_wait_ast
#define _def_wait_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/wchar b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/wchar
index a3f8a10eff..11d8827727 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/FEATURE/wchar
+++ b/usr/src/lib/libast/i386/src/lib/libast/FEATURE/wchar
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/wchar by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/wchar by iffe version 2008-01-31 : : */
#ifndef _def_wchar_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/i386/src/lib/libast/align.h b/usr/src/lib/libast/i386/src/lib/libast/align.h
index 23ab6030ef..08a43ae9da 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/align.h
+++ b/usr/src/lib/libast/i386/src/lib/libast/align.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/align.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/align.c by iffe version 2008-01-31 : : */
#ifndef _def_align_ast
#define _def_align_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/src/lib/libast/ast_botch.h b/usr/src/lib/libast/i386/src/lib/libast/ast_botch.h
index f622454838..9aa7e03bc9 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/ast_botch.h
+++ b/usr/src/lib/libast/i386/src/lib/libast/ast_botch.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/botch.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/botch.c by iffe version 2008-01-31 : : */
#ifndef _def_botch_ast
#define _def_botch_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/src/lib/libast/ast_ccode.h b/usr/src/lib/libast/i386/src/lib/libast/ast_ccode.h
index 26e608f1d0..d7684a82db 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/ast_ccode.h
+++ b/usr/src/lib/libast/i386/src/lib/libast/ast_ccode.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/ccode by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/ccode by iffe version 2008-01-31 : : */
#ifndef _def_ccode_ast
#define _def_ccode_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/src/lib/libast/ast_common.h b/usr/src/lib/libast/i386/src/lib/libast/ast_common.h
index f9ed8fb491..91c4301b16 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/ast_common.h
+++ b/usr/src/lib/libast/i386/src/lib/libast/ast_common.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/common by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/common by iffe version 2008-01-31 : : */
#ifndef _AST_COMMON_H
#define _AST_COMMON_H 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/src/lib/libast/ast_dirent.h b/usr/src/lib/libast/i386/src/lib/libast/ast_dirent.h
index 0cdf633a20..81ba45ad54 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/ast_dirent.h
+++ b/usr/src/lib/libast/i386/src/lib/libast/ast_dirent.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/dirent by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/dirent by iffe version 2008-01-31 : : */
#ifndef _def_dirent_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/i386/src/lib/libast/ast_fcntl.h b/usr/src/lib/libast/i386/src/lib/libast/ast_fcntl.h
index 78510ec979..22b6e0a868 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/ast_fcntl.h
+++ b/usr/src/lib/libast/i386/src/lib/libast/ast_fcntl.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/fcntl.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/fcntl.c by iffe version 2008-01-31 : : */
#ifndef _def_fcntl_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
diff --git a/usr/src/lib/libast/i386/src/lib/libast/ast_float.h b/usr/src/lib/libast/i386/src/lib/libast/ast_float.h
index 9afe6e6ff8..a4914d2f39 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/ast_float.h
+++ b/usr/src/lib/libast/i386/src/lib/libast/ast_float.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/float by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/float by iffe version 2008-01-31 : : */
#ifndef _def_float_ast
#if !defined(__PROTO__)
@@ -68,13 +68,16 @@
#define _hdr_math 1 /* #include <math.h> ok */
#define _hdr_values 1 /* #include <values.h> ok */
#define _LIB_m 1 /* -lm is a library */
+#define _lib_fpclassify 1 /* fpclassify() in default lib(s) */
#define _lib_frexp 1 /* frexp() in default lib(s) */
#define _lib_frexpl 1 /* frexpl() in default lib(s) */
#define _lib_ldexp 1 /* ldexp() in default lib(s) */
#define _lib_ldexpl 1 /* ldexpl() in default lib(s) */
#define _lib_finite 1 /* finite() in default lib(s) */
+#define _lib_isinf 1 /* isinf() in default lib(s) */
#define _lib_isnan 1 /* isnan() in default lib(s) */
#define _lib_isnanl 1 /* isnanl() in default lib(s) */
+#define _lib_signbit 1 /* signbit() in default lib(s) */
#define _lib_copysign 1 /* copysign() in default lib(s) */
#define _lib_copysignl 1 /* copysignl() in default lib(s) */
#include <ast_common.h>
diff --git a/usr/src/lib/libast/i386/src/lib/libast/ast_fs.h b/usr/src/lib/libast/i386/src/lib/libast/ast_fs.h
index 34eb5498d2..b18bef1b29 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/ast_fs.h
+++ b/usr/src/lib/libast/i386/src/lib/libast/ast_fs.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/fs by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/fs by iffe version 2008-01-31 : : */
#ifndef _def_fs_ast
#if !defined(__PROTO__)
@@ -72,20 +72,9 @@
#define _lib_mknod 1 /* mknod() in default lib(s) */
#define _lib_sync 1 /* sync() in default lib(s) */
#include <sys/stat.h>
+#include <sys/mkdev.h>
#define FS_default "ufs"
#if defined(__STDPP__directive) && defined(__STDPP__initial)
-__STDPP__directive pragma pp:initial
-#endif
-#ifndef major
-#define major(x) ( major_t ) ( ( ( ( unsigned ) ( ( x ) ) ) >> 8 ) & 0x7f )
-#endif
-#ifndef minor
-#define minor(x) ( minor_t ) ( ( ( x ) ) & 0xff )
-#endif
-#ifndef makedev
-#define makedev(x,y) ( unsigned short ) ( ( ( ( x ) ) << 8 ) | ( ( ( y ) ) & 0xff ) )
-#endif
-#if defined(__STDPP__directive) && defined(__STDPP__initial)
__STDPP__directive pragma pp:noinitial
#endif
#define _hdr_stdio 1 /* #include <stdio.h> ok */
diff --git a/usr/src/lib/libast/i386/src/lib/libast/ast_iconv.h b/usr/src/lib/libast/i386/src/lib/libast/ast_iconv.h
index b8aee7e488..449c82bd36 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/ast_iconv.h
+++ b/usr/src/lib/libast/i386/src/lib/libast/ast_iconv.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/iconv by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/iconv by iffe version 2008-01-31 : : */
#ifndef _def_iconv_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/i386/src/lib/libast/ast_lib.h b/usr/src/lib/libast/i386/src/lib/libast/ast_lib.h
index c7bfb927c9..8304bd96b9 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/ast_lib.h
+++ b/usr/src/lib/libast/i386/src/lib/libast/ast_lib.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/lib by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/lib by iffe version 2008-01-31 : : */
#ifndef _def_lib_ast
#define _def_lib_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/src/lib/libast/ast_limits.h b/usr/src/lib/libast/i386/src/lib/libast/ast_limits.h
index dc1593a119..e2608b975e 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/ast_limits.h
+++ b/usr/src/lib/libast/i386/src/lib/libast/ast_limits.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/limits.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/limits.c by iffe version 2008-01-31 : : */
#ifndef _def_limits_ast
#define _def_limits_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/src/lib/libast/ast_map.h b/usr/src/lib/libast/i386/src/lib/libast/ast_map.h
index 5ae49fb0a6..fe3d5fddbc 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/ast_map.h
+++ b/usr/src/lib/libast/i386/src/lib/libast/ast_map.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/map.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/map.c by iffe version 2008-01-31 : : */
#ifndef _def_map_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
@@ -121,6 +121,14 @@ extern __MANGLE__ char* getcwd __PROTO__((char*, size_t));
#define getopt_long _ast_getopt_long
#undef getopt_long_only
#define getopt_long_only _ast_getopt_long_only
+#undef optopt
+#define optopt _ast_optopt
+#undef optarg
+#define optarg _ast_optarg
+#undef optind
+#define optind _ast_optind
+#undef opterr
+#define opterr _ast_opterr
#undef getwd
#define getwd _ast_getwd
extern __MANGLE__ char* getwd __PROTO__((char*));
@@ -146,6 +154,8 @@ extern __MANGLE__ char* mktemp __PROTO__((char*));
#define mktime _ast_mktime
#undef nftw
#define nftw _ast_nftw
+#undef optctx
+#define optctx _ast_optctx
#undef optesc
#define optesc _ast_optesc
#undef optget
@@ -274,7 +284,7 @@ extern __MANGLE__ char* realpath __PROTO__((const char*, char*));
extern __MANGLE__ int remove __PROTO__((const char*));
#undef resolvepath
#define resolvepath _ast_resolvepath
-extern __MANGLE__ char* resolvepath __PROTO__((const char*, char*, size_t));
+extern __MANGLE__ int resolvepath __PROTO__((const char*, char*, size_t));
#undef setenv
#define setenv _ast_setenv
extern __MANGLE__ int setenv __PROTO__((const char*, const char*, int));
diff --git a/usr/src/lib/libast/i386/src/lib/libast/ast_mmap.h b/usr/src/lib/libast/i386/src/lib/libast/ast_mmap.h
index 957987b8aa..448ab22df8 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/ast_mmap.h
+++ b/usr/src/lib/libast/i386/src/lib/libast/ast_mmap.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/mmap by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/mmap by iffe version 2008-01-31 : : */
#ifndef _def_mmap_ast
#define _def_mmap_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/src/lib/libast/ast_mode.h b/usr/src/lib/libast/i386/src/lib/libast/ast_mode.h
index d9e489168f..b663948b0f 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/ast_mode.h
+++ b/usr/src/lib/libast/i386/src/lib/libast/ast_mode.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/mode.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/mode.c by iffe version 2008-01-31 : : */
#ifndef _def_mode_ast
#define _def_mode_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/src/lib/libast/ast_ndbm.h b/usr/src/lib/libast/i386/src/lib/libast/ast_ndbm.h
new file mode 100644
index 0000000000..d21a376500
--- /dev/null
+++ b/usr/src/lib/libast/i386/src/lib/libast/ast_ndbm.h
@@ -0,0 +1,9 @@
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/ndbm by iffe version 2008-01-31 : : */
+#ifndef _def_ndbm_ast
+#define _def_ndbm_ast 1
+#define _sys_types 1 /* #include <sys/types.h> ok */
+#define _hdr_ndbm 1 /* #include <ndbm.h> ok */
+#include <ndbm.h>
+#define _use_ndbm 1
+
+#endif
diff --git a/usr/src/lib/libast/i386/src/lib/libast/ast_nl_types.h b/usr/src/lib/libast/i386/src/lib/libast/ast_nl_types.h
index 088c1c0cb2..2f713d9855 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/ast_nl_types.h
+++ b/usr/src/lib/libast/i386/src/lib/libast/ast_nl_types.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/nl_types by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/nl_types by iffe version 2008-01-31 : : */
#ifndef _def_nl_types_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/i386/src/lib/libast/ast_param.h b/usr/src/lib/libast/i386/src/lib/libast/ast_param.h
index 74a6367a3a..f10c928b22 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/ast_param.h
+++ b/usr/src/lib/libast/i386/src/lib/libast/ast_param.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/param.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/param.sh by iffe version 2008-01-31 : : */
#ifndef _def_param_ast
#define _def_param_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/src/lib/libast/ast_standards.h b/usr/src/lib/libast/i386/src/lib/libast/ast_standards.h
index 186cf1c635..03c21fffe3 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/ast_standards.h
+++ b/usr/src/lib/libast/i386/src/lib/libast/ast_standards.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/standards by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/standards by iffe version 2008-01-31 : : */
#ifndef _def_standards_ast
#define _def_standards_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/src/lib/libast/ast_stdio.h b/usr/src/lib/libast/i386/src/lib/libast/ast_stdio.h
index 6c72b2d2f4..4657a0929d 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/ast_stdio.h
+++ b/usr/src/lib/libast/i386/src/lib/libast/ast_stdio.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/stdio by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/stdio by iffe version 2008-01-31 : : */
#ifndef _SFSTDIO_H
#if !defined(__PROTO__)
@@ -178,7 +178,7 @@ extern __MANGLE__ int fprintf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fpurge __PROTO__((FILE*));
extern __MANGLE__ int fputc __PROTO__((int, FILE*));
extern __MANGLE__ int fputs __PROTO__((const char*, FILE*));
-extern __MANGLE__ ssize_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
extern __MANGLE__ FILE* freopen __PROTO__((const char*, const char*, FILE*));
extern __MANGLE__ int fscanf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fseek __PROTO__((FILE*, long, int));
@@ -186,7 +186,7 @@ extern __MANGLE__ int fseeko __PROTO__((FILE*, off_t, int));
extern __MANGLE__ int fsetpos __PROTO__((FILE*, const fpos_t*));
extern __MANGLE__ long ftell __PROTO__((FILE*));
extern __MANGLE__ off_t ftello __PROTO__((FILE*));
-extern __MANGLE__ ssize_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
extern __MANGLE__ int getc __PROTO__((FILE*));
extern __MANGLE__ int getchar __PROTO__((void));
extern __MANGLE__ char* gets __PROTO__((char*));
@@ -245,6 +245,10 @@ extern __MANGLE__ int getchar_unlocked __PROTO__((void));
extern __MANGLE__ int putc_unlocked __PROTO__((int, FILE*));
extern __MANGLE__ int putchar_unlocked __PROTO__((int));
+extern __MANGLE__ void flockfile __PROTO__((FILE*));
+extern __MANGLE__ int ftrylockfile __PROTO__((FILE*));
+extern __MANGLE__ void funlockfile __PROTO__((FILE*));
+
#ifdef _USE_GNU
extern __MANGLE__ int fcloseall __PROTO__((void));
@@ -324,6 +328,7 @@ extern __MANGLE__ ssize_t getline __PROTO__((char**, size_t*, FILE*));
#define vsprintf _ast_vsprintf
#define vsscanf _ast_vsscanf
#define fcloseall _ast_fcloseall
+#define _filbuf _ast__filbuf
#define fmemopen _ast_fmemopen
#define __getdelim _ast___getdelim
#define getdelim _ast_getdelim
@@ -343,6 +348,9 @@ extern __MANGLE__ ssize_t getline __PROTO__((char**, size_t*, FILE*));
#define getchar_unlocked _ast_getchar_unlocked
#define putc_unlocked _ast_putc_unlocked
#define putchar_unlocked _ast_putchar_unlocked
+#define flockfile _ast_flockfile
+#define ftrylockfile _ast_ftrylockfile
+#define funlockfile _ast_funlockfile
#if defined(__STDPP__directive) && defined(__STDPP__initial)
__STDPP__directive pragma pp:initial
@@ -402,7 +410,7 @@ extern __MANGLE__ int fprintf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fpurge __PROTO__((FILE*));
extern __MANGLE__ int fputc __PROTO__((int, FILE*));
extern __MANGLE__ int fputs __PROTO__((const char*, FILE*));
-extern __MANGLE__ ssize_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
extern __MANGLE__ FILE* freopen __PROTO__((const char*, const char*, FILE*));
extern __MANGLE__ int fscanf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fseek __PROTO__((FILE*, long, int));
@@ -410,7 +418,7 @@ extern __MANGLE__ int fseeko __PROTO__((FILE*, off_t, int));
extern __MANGLE__ int fsetpos __PROTO__((FILE*, const fpos_t*));
extern __MANGLE__ long ftell __PROTO__((FILE*));
extern __MANGLE__ off_t ftello __PROTO__((FILE*));
-extern __MANGLE__ ssize_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
extern __MANGLE__ int getc __PROTO__((FILE*));
extern __MANGLE__ int getchar __PROTO__((void));
extern __MANGLE__ char* gets __PROTO__((char*));
diff --git a/usr/src/lib/libast/i386/src/lib/libast/ast_sys.h b/usr/src/lib/libast/i386/src/lib/libast/ast_sys.h
index 9e024f86e7..55d8137d6f 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/ast_sys.h
+++ b/usr/src/lib/libast/i386/src/lib/libast/ast_sys.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/sys by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/sys by iffe version 2008-01-31 : : */
#ifndef _AST_SYS_H
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/i386/src/lib/libast/ast_time.h b/usr/src/lib/libast/i386/src/lib/libast/ast_time.h
index fd36809299..83fd6b7121 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/ast_time.h
+++ b/usr/src/lib/libast/i386/src/lib/libast/ast_time.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/time by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/time by iffe version 2008-01-31 : : */
#ifndef _def_time_ast
#if !defined(__PROTO__)
@@ -76,7 +76,7 @@
#include <sys/times.h>
-#ifndef CLOCKS_PER_SEC
+#if !defined(CLOCKS_PER_SEC) && defined(CLK_TCK)
#define CLOCKS_PER_SEC CLK_TCK
#endif
diff --git a/usr/src/lib/libast/i386/src/lib/libast/ast_tty.h b/usr/src/lib/libast/i386/src/lib/libast/ast_tty.h
index e645095122..04cec09685 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/ast_tty.h
+++ b/usr/src/lib/libast/i386/src/lib/libast/ast_tty.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/tty by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/tty by iffe version 2008-01-31 : : */
#ifndef _def_tty_ast
#define _def_tty_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/src/lib/libast/ast_types.h b/usr/src/lib/libast/i386/src/lib/libast/ast_types.h
deleted file mode 100644
index 343b5954a0..0000000000
--- a/usr/src/lib/libast/i386/src/lib/libast/ast_types.h
+++ /dev/null
@@ -1,5 +0,0 @@
-/* : : generated by iffe version 2007-04-04 : : */
-#ifndef _def_types_ast
-#define _def_types_ast 1
-#define _sys_types 1 /* #include <sys/types.h> ok */
-#endif
diff --git a/usr/src/lib/libast/i386/src/lib/libast/ast_vfork.h b/usr/src/lib/libast/i386/src/lib/libast/ast_vfork.h
index f1993151cc..5ebb662a08 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/ast_vfork.h
+++ b/usr/src/lib/libast/i386/src/lib/libast/ast_vfork.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/vfork by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/vfork by iffe version 2008-01-31 : : */
#ifndef _def_vfork_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/i386/src/lib/libast/ast_wait.h b/usr/src/lib/libast/i386/src/lib/libast/ast_wait.h
index 9ed6722037..a113121028 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/ast_wait.h
+++ b/usr/src/lib/libast/i386/src/lib/libast/ast_wait.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/wait by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/wait by iffe version 2008-01-31 : : */
#ifndef _def_wait_ast
#define _def_wait_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/src/lib/libast/ast_wchar.h b/usr/src/lib/libast/i386/src/lib/libast/ast_wchar.h
index a3f8a10eff..11d8827727 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/ast_wchar.h
+++ b/usr/src/lib/libast/i386/src/lib/libast/ast_wchar.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/wchar by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/wchar by iffe version 2008-01-31 : : */
#ifndef _def_wchar_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/i386/src/lib/libast/conftab.c b/usr/src/lib/libast/i386/src/lib/libast/conftab.c
index fc8c45b7a2..10dab929ea 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/conftab.c
+++ b/usr/src/lib/libast/i386/src/lib/libast/conftab.c
@@ -1,63 +1,3 @@
-
-/* : : generated by proto : : */
-
-#if !defined(__PROTO__)
-# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
-# if defined(__cplusplus)
-# define __LINKAGE__ "C"
-# else
-# define __LINKAGE__
-# endif
-# define __STDARG__
-# define __PROTO__(x) x
-# define __OTORP__(x)
-# define __PARAM__(n,o) n
-# if !defined(__STDC__) && !defined(__cplusplus)
-# if !defined(c_plusplus)
-# define const
-# endif
-# define signed
-# define void int
-# define volatile
-# define __V_ char
-# else
-# define __V_ void
-# endif
-# else
-# define __PROTO__(x) ()
-# define __OTORP__(x) x
-# define __PARAM__(n,o) o
-# define __LINKAGE__
-# define __V_ char
-# define const
-# define signed
-# define void int
-# define volatile
-# endif
-# define __MANGLE__ __LINKAGE__
-# if defined(__cplusplus) || defined(c_plusplus)
-# define __VARARG__ ...
-# else
-# define __VARARG__
-# endif
-# if defined(__STDARG__)
-# define __VA_START__(p,a) va_start(p,a)
-# else
-# define __VA_START__(p,a) va_start(p)
-# endif
-# if !defined(__INLINE__)
-# if defined(__cplusplus)
-# define __INLINE__ extern __MANGLE__ inline
-# else
-# if defined(_WIN32) && !defined(__GNUC__)
-# define __INLINE__ __inline
-# endif
-# endif
-# endif
-#endif
-#if !defined(__LINKAGE__)
-#define __LINKAGE__ /* 2004-08-11 transition */
-#endif
#include "FEATURE/standards"
#include "FEATURE/common"
#include <sys/types.h>
@@ -70,7 +10,7 @@
#include "FEATURE/param"
#include "conftab.h"
-/* : : generated by conf from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/comp/conf.tab : : */
+/* : : generated by conf from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/comp/conf.tab : : */
/*
* prefix strings -- the first few are indexed by Conf_t.standard
@@ -105,111 +45,111 @@ int prefix_elements = (int)sizeof(prefix) / (int)sizeof(prefix[0]);
const Conf_t conf[] =
{
-{ "ABI_AIO_XFER_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "ABI_ASYNCHRONOUS_IO", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "ABI_ASYNC_IO", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "ADVISORY_INFO", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_ADVISORY_INFO },
-{ "AIO_LISTIO_MAX", { 0, 0 }, { _POSIX_AIO_LISTIO_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_AIO_LISTIO_MAX },
-{ "AIO_MAX", { 0, 0 }, { _POSIX_AIO_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_AIO_MAX },
-{ "AIO_PRIO_DELTA_MAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, _SC_AIO_PRIO_DELTA_MAX },
-{ "ALLOC_SIZE_MIN", { 0, 0 }, { 0, 0 }, CONF_LIMIT|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_ALLOC_SIZE_MIN },
-{ "ARCHITECTURE", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "ARG_MAX", { 0, 0 }, { _POSIX_ARG_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_ARG_MAX },
-{ "ASYNCHRONOUS_IO", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_ASYNCHRONOUS_IO },
-{ "ASYNC_IO", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_ASYNC_IO },
-{ "ATEXIT_MAX", { 0, 0 }, { 32, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_XOPEN, 1, CONF_sysconf, _SC_ATEXIT_MAX },
-{ "AUDIT", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "AVAIL_PROCESSORS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "AVPHYS_PAGES", { 0, 0 }, { 0, 0 }, 0, CONF_SUN, 1, CONF_sysconf, _SC_AVPHYS_PAGES },
-{ "BARRIERS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_BARRIERS },
-{ "BC_BASE_MAX", { 0, 0 }, { _POSIX2_BC_BASE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_BC_BASE_MAX },
-{ "BC_DIM_MAX", { 0, 0 }, { _POSIX2_BC_DIM_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_BC_DIM_MAX },
-{ "BC_SCALE_MAX", { 0, 0 }, { _POSIX2_BC_SCALE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_BC_SCALE_MAX },
-{ "BC_STRING_MAX", { 0, 0 }, { _POSIX2_BC_STRING_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_BC_STRING_MAX },
-{ "BUSTYPES", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "CHARCLASS_NAME_MAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "CHAR_BIT", { 8, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "CHAR_MAX", { 127, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "CHAR_MIN", { -128, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "CHAR_TERM", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_CHAR_TERM },
-{ "CHILD_MAX", { 0, 0 }, { _POSIX_CHILD_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_CHILD_MAX },
-{ "CHOWN_RESTRICTED", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_CHOWN_RESTRICTED },
-{ "CKPT", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "CLK_TCK", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_POSIX, 1, CONF_sysconf, _SC_CLK_TCK },
-{ "CLOCKRES_MIN", { 0, 0 }, { _POSIX_CLOCKRES_MIN, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_PREFIX_ONLY|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "CLOCKS_PER_SEC", { 1000000, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_LIMIT|CONF_LIMIT_DEF, CONF_POSIX, 1, CONF_nop, -1 },
-{ "CLOCK_SELECTION", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_CLOCK_SELECTION },
-{ "COLL_WEIGHTS_MAX", { 0, 0 }, { _POSIX2_COLL_WEIGHTS_MAX, 0 }, CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_COLL_WEIGHTS_MAX },
-{ "CPUTIME", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_CPUTIME },
-{ "CPU_KEYBITS1", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "CPU_VERSION", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "CRYPT", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_CRYPT },
-{ "C_BIND", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 2, CONF_sysconf, _SC_2_C_BIND },
-{ "C_DEV", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 2, CONF_sysconf, _SC_2_C_DEV },
-{ "C_VERSION", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 2, CONF_sysconf, _SC_2_C_VERSION },
-{ "DATAKEYS_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "DELAYTIMER_MAX", { 0, 0 }, { _POSIX_DELAYTIMER_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_DELAYTIMER_MAX },
-{ "ENH_I18N", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_ENH_I18N },
-{ "EQUIV_CLASS_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "EXEC_INTERPRETER_LENGTH", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "EXPR_NEST_MAX", { 0, 0 }, { _POSIX2_EXPR_NEST_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_EXPR_NEST_MAX },
-{ "FCHR_MAX", { 0, 0 }, { LONG_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
-{ "FILESIZEBITS", { 0, 0 }, { 0, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_FILESIZEBITS },
-{ "FILE_LOCKING", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "FORT_DEV", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_FORT_DEV },
-{ "FORT_RUN", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_FORT_RUN },
-{ "FSYNC", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_FSYNC },
-{ "GETGR_R_SIZE_MAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_sysconf, _SC_GETGR_R_SIZE_MAX },
-{ "GETPW_R_SIZE_MAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_sysconf, _SC_GETPW_R_SIZE_MAX },
-{ "HOSTID", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "HOSTNAME", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "HOST_NAME_MAX", { 0, 0 }, { _POSIX_HOST_NAME_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_HOST_NAME_MAX },
-{ "HW_PROVIDER", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "HW_SERIAL", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "ILP32_OFF32", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XBS5, 1, CONF_sysconf, -1 },
+{ "ABI_AIO_XFER_MAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "ABI_ASYNCHRONOUS_IO", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "ABI_ASYNC_IO", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "ADVISORY_INFO", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_ADVISORY_INFO },
+{ "AIO_LISTIO_MAX", { 0ULL, 0 }, { _POSIX_AIO_LISTIO_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_AIO_LISTIO_MAX },
+{ "AIO_MAX", { 0ULL, 0 }, { _POSIX_AIO_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_AIO_MAX },
+{ "AIO_PRIO_DELTA_MAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, _SC_AIO_PRIO_DELTA_MAX },
+{ "ALLOC_SIZE_MIN", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_ALLOC_SIZE_MIN },
+{ "ARCHITECTURE", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, SI_ARCHITECTURE },
+{ "ARG_MAX", { 0ULL, 0 }, { _POSIX_ARG_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_ARG_MAX },
+{ "ASYNCHRONOUS_IO", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_ASYNCHRONOUS_IO },
+{ "ASYNC_IO", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_ASYNC_IO },
+{ "ATEXIT_MAX", { 0ULL, 0 }, { 32ULL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_XOPEN, 1, CONF_sysconf, _SC_ATEXIT_MAX },
+{ "AUDIT", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "AVAIL_PROCESSORS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "AVPHYS_PAGES", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SUN, 1, CONF_sysconf, _SC_AVPHYS_PAGES },
+{ "BARRIERS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_BARRIERS },
+{ "BC_BASE_MAX", { 0ULL, 0 }, { _POSIX2_BC_BASE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_BC_BASE_MAX },
+{ "BC_DIM_MAX", { 0ULL, 0 }, { _POSIX2_BC_DIM_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_BC_DIM_MAX },
+{ "BC_SCALE_MAX", { 0ULL, 0 }, { _POSIX2_BC_SCALE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_BC_SCALE_MAX },
+{ "BC_STRING_MAX", { 0ULL, 0 }, { _POSIX2_BC_STRING_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_BC_STRING_MAX },
+{ "BUSTYPES", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
+{ "CHARCLASS_NAME_MAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "CHAR_BIT", { 8ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "CHAR_MAX", { 127ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "CHAR_MIN", { -127LL-1LL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "CHAR_TERM", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_CHAR_TERM },
+{ "CHILD_MAX", { 0ULL, 0 }, { _POSIX_CHILD_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_CHILD_MAX },
+{ "CHOWN_RESTRICTED", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_CHOWN_RESTRICTED },
+{ "CKPT", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "CLK_TCK", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_POSIX, 1, CONF_sysconf, _SC_CLK_TCK },
+{ "CLOCKRES_MIN", { 0ULL, 0 }, { _POSIX_CLOCKRES_MIN, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_PREFIX_ONLY|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "CLOCKS_PER_SEC", { 1000000ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_LIMIT|CONF_LIMIT_DEF, CONF_POSIX, 1, CONF_nop, -1 },
+{ "CLOCK_SELECTION", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_CLOCK_SELECTION },
+{ "COLL_WEIGHTS_MAX", { 0ULL, 0 }, { _POSIX2_COLL_WEIGHTS_MAX, 0 }, CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_COLL_WEIGHTS_MAX },
+{ "CPUTIME", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_CPUTIME },
+{ "CPU_KEYBITS1", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "CPU_VERSION", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "CRYPT", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_CRYPT },
+{ "C_BIND", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 2, CONF_sysconf, _SC_2_C_BIND },
+{ "C_DEV", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 2, CONF_sysconf, _SC_2_C_DEV },
+{ "C_VERSION", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 2, CONF_sysconf, _SC_2_C_VERSION },
+{ "DATAKEYS_MAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "DELAYTIMER_MAX", { 0ULL, 0 }, { _POSIX_DELAYTIMER_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_DELAYTIMER_MAX },
+{ "ENH_I18N", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_ENH_I18N },
+{ "EQUIV_CLASS_MAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "EXEC_INTERPRETER_LENGTH", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "EXPR_NEST_MAX", { 0ULL, 0 }, { _POSIX2_EXPR_NEST_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_EXPR_NEST_MAX },
+{ "FCHR_MAX", { 0ULL, 0 }, { LONG_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
+{ "FILESIZEBITS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_FILESIZEBITS },
+{ "FILE_LOCKING", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "FORT_DEV", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_FORT_DEV },
+{ "FORT_RUN", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_FORT_RUN },
+{ "FSYNC", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_FSYNC },
+{ "GETGR_R_SIZE_MAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_C, 1, CONF_sysconf, _SC_GETGR_R_SIZE_MAX },
+{ "GETPW_R_SIZE_MAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_C, 1, CONF_sysconf, _SC_GETPW_R_SIZE_MAX },
+{ "HOSTID", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "HOSTNAME", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, SI_HOSTNAME },
+{ "HOST_NAME_MAX", { 0ULL, 0 }, { _POSIX_HOST_NAME_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_HOST_NAME_MAX },
+{ "HW_PROVIDER", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, SI_HW_PROVIDER },
+{ "HW_SERIAL", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "ILP32_OFF32", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XBS5, 1, CONF_sysconf, -1 },
{ "ILP32_OFF32_CFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "ILP32_OFF32_LDFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "ILP32_OFF32_LIBS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "ILP32_OFF32_LINTFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
-{ "ILP32_OFFBIG", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XBS5, 1, CONF_sysconf, -1 },
+{ "ILP32_OFFBIG", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XBS5, 1, CONF_sysconf, -1 },
{ "ILP32_OFFBIG_CFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "ILP32_OFFBIG_LDFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "ILP32_OFFBIG_LIBS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "ILP32_OFFBIG_LINTFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
-{ "INITTAB_NAME", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "INT_MAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
-{ "INT_MIN", { -2147483648, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "IOV_MAX", { 0, 0 }, { _XOPEN_IOV_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_XOPEN, 1, CONF_sysconf, _SC_IOV_MAX },
-{ "IO_TYPE", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "IPV6", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_IPV6 },
-{ "IP_SECOPTS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "JOB_CONTROL", { 0, 0 }, { 1, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_JOB_CONTROL },
-{ "KERNEL_CLIST", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_CLIST_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_DISK", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_DISK_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_DMABUF", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_DMABUF_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_FILE", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_FILE_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_FLCKREC", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_FLCKREC_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_INODE", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_INODE_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_MOUNT", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_MOUNT_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_PINODE", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_PINODE_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_PROC", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_PROC_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_REGION", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_REGION_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_S5INODE", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_S5INODE_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_STAMP", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "KERN_POINTERS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "KERN_SIM", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "LEGACY", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, -1 },
+{ "INITTAB_NAME", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
+{ "INT_MAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
+{ "INT_MIN", { -2147483647LL-1LL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "IOV_MAX", { 0ULL, 0 }, { _XOPEN_IOV_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_XOPEN, 1, CONF_sysconf, _SC_IOV_MAX },
+{ "IO_TYPE", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "IPV6", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_IPV6 },
+{ "IP_SECOPTS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "JOB_CONTROL", { 0ULL, 0 }, { 1ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_JOB_CONTROL },
+{ "KERNEL_CLIST", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_CLIST_MAX", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_DISK", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_DISK_MAX", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_DMABUF", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_DMABUF_MAX", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_FILE", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_FILE_MAX", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_FLCKREC", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_FLCKREC_MAX", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_INODE", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_INODE_MAX", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_MOUNT", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_MOUNT_MAX", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_PINODE", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_PINODE_MAX", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_PROC", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_PROC_MAX", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_REGION", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_REGION_MAX", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_S5INODE", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_S5INODE_MAX", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_STAMP", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
+{ "KERN_POINTERS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "KERN_SIM", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "LEGACY", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, -1 },
{ "LFS64_CFLAGS", { 0, 0 }, { 0, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING, CONF_POSIX, 1, CONF_confstr, _CS_LFS64_CFLAGS },
{ "LFS64_LDFLAGS", { 0, 0 }, { 0, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING, CONF_POSIX, 1, CONF_confstr, _CS_LFS64_LDFLAGS },
{ "LFS64_LIBS", { 0, 0 }, { 0, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING, CONF_POSIX, 1, CONF_confstr, _CS_LFS64_LIBS },
@@ -218,234 +158,234 @@ const Conf_t conf[] =
{ "LFS_LDFLAGS", { 0, 0 }, { 0, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING, CONF_POSIX, 1, CONF_confstr, _CS_LFS_LDFLAGS },
{ "LFS_LIBS", { 0, 0 }, { 0, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING, CONF_POSIX, 1, CONF_confstr, _CS_LFS_LIBS },
{ "LFS_LINTFLAGS", { 0, 0 }, { 0, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING, CONF_POSIX, 1, CONF_confstr, _CS_LFS_LINTFLAGS },
-{ "LINE_MAX", { 0, 0 }, { _POSIX2_LINE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_LINE_MAX },
-{ "LINK_MAX", { 0, 0 }, { _POSIX_LINK_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_LINK_MAX },
-{ "LLONG_MAX", { 9223372036854775807LL, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "LLONG_MIN", { (-9223372036854775807LL-1LL), 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "LOCALEDEF", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_LOCALEDEF },
-{ "LOGIN_NAME_MAX", { 0, 0 }, { _POSIX_LOGIN_NAME_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_LOGIN_NAME_MAX },
-{ "LOGNAME_MAX", { 0, 0 }, { 8, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, _SC_LOGNAME_MAX },
-{ "LONG_BIT", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "LONG_MAX", { 2147483647, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "LONG_MIN", { -2147483648, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "LP64_OFF64", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XBS5, 1, CONF_sysconf, -1 },
+{ "LINE_MAX", { 0ULL, 0 }, { _POSIX2_LINE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_LINE_MAX },
+{ "LINK_MAX", { 0ULL, 0 }, { _POSIX_LINK_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_LINK_MAX },
+{ "LLONG_MAX", { 9223372036854775807ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "LLONG_MIN", { -9223372036854775807LL-1LL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "LOCALEDEF", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_LOCALEDEF },
+{ "LOGIN_NAME_MAX", { 0ULL, 0 }, { _POSIX_LOGIN_NAME_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_LOGIN_NAME_MAX },
+{ "LOGNAME_MAX", { 0ULL, 0 }, { 8ULL, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, _SC_LOGNAME_MAX },
+{ "LONG_BIT", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "LONG_MAX", { 2147483647ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "LONG_MIN", { -2147483647LL-1LL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "LP64_OFF64", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XBS5, 1, CONF_sysconf, -1 },
{ "LP64_OFF64_CFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "LP64_OFF64_LDFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "LP64_OFF64_LIBS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "LP64_OFF64_LINTFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
-{ "LPBIG_OFFBIG", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XBS5, 1, CONF_sysconf, -1 },
+{ "LPBIG_OFFBIG", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XBS5, 1, CONF_sysconf, -1 },
{ "LPBIG_OFFBIG_CFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "LPBIG_OFFBIG_LDFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "LPBIG_OFFBIG_LIBS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "LPBIG_OFFBIG_LINTFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
-{ "MACHINE", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "MAPPED_FILES", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MAPPED_FILES },
-{ "MAX_CANON", { 0, 0 }, { _POSIX_MAX_CANON, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_MAX_CANON },
-{ "MAX_INPUT", { 0, 0 }, { _POSIX_MAX_INPUT, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_MAX_INPUT },
-{ "MB_LEN_MAX", { 5, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "MCAS_OFFSET", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "MEMLOCK", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MEMLOCK },
-{ "MEMLOCK_RANGE", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MEMLOCK_RANGE },
-{ "MEMORY_PROTECTION", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MEMORY_PROTECTION },
-{ "MESSAGE_PASSING", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MESSAGE_PASSING },
-{ "MMAP_FIXED_ALIGNMENT", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "MONOTONIC_CLOCK", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MONOTONIC_CLOCK },
-{ "MQ_OPEN_MAX", { 0, 0 }, { _POSIX_MQ_OPEN_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_MQ_OPEN_MAX },
-{ "MQ_PRIO_MAX", { 0, 0 }, { _POSIX_MQ_PRIO_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_MQ_PRIO_MAX },
-{ "MSEM_LOCKID", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "MULTI_PROCESS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "NACLS_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SVID, 1, CONF_sysconf, -1 },
-{ "NAME_MAX", { 0, 0 }, { _POSIX_NAME_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_NAME_MAX },
-{ "NGROUPS_MAX", { 0, 0 }, { _POSIX_NGROUPS_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_NGROUPS_MAX },
-{ "NL_ARGMAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "NL_LANGMAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "NL_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "NL_MSGMAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "NL_NMAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "NL_SETMAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "NL_SPECMAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "NL_TEXTMAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "NO_TRUNC", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_NO_TRUNC },
-{ "NPROCESSORS_CONF", { 0, 0 }, { 0, 0 }, 0, CONF_SVID, 1, CONF_sysconf, _SC_NPROCESSORS_CONF },
-{ "NPROCESSORS_ONLN", { 0, 0 }, { 0, 0 }, 0, CONF_SVID, 1, CONF_sysconf, _SC_NPROCESSORS_ONLN },
-{ "NPROC_CONF", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "NPROC_ONLN", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "NSS_BUFLEN_GROUP", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "NSS_BUFLEN_PASSWD", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "NUM_PROCESSORS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "NZERO", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "OPEN_MAX", { 0, 0 }, { _POSIX_OPEN_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_OPEN_MAX },
-{ "OPEN_MAX_CEIL", { OPEN_MAX, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_AST, 1, CONF_nop, -1 },
-{ "OSREL_MAJ", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "OSREL_MIN", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "OSREL_PATCH", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "OS_BASE", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "OS_PROVIDER", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "OS_VERSION", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE, CONF_AES, 1, CONF_sysconf, -1 },
-{ "PAGESIZE", { 0, 0 }, { 4096, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_PAGESIZE },
-{ "PAGE_SIZE", { 0, 0 }, { 0, 0 }, CONF_MINMAX|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, _SC_PAGE_SIZE },
-{ "PASS_MAX", { 0, 0 }, { 8, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, _SC_PASS_MAX },
+{ "MACHINE", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, SI_MACHINE },
+{ "MAPPED_FILES", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MAPPED_FILES },
+{ "MAX_CANON", { 0ULL, 0 }, { _POSIX_MAX_CANON, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_MAX_CANON },
+{ "MAX_INPUT", { 0ULL, 0 }, { _POSIX_MAX_INPUT, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_MAX_INPUT },
+{ "MB_LEN_MAX", { 5ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "MCAS_OFFSET", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "MEMLOCK", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MEMLOCK },
+{ "MEMLOCK_RANGE", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MEMLOCK_RANGE },
+{ "MEMORY_PROTECTION", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MEMORY_PROTECTION },
+{ "MESSAGE_PASSING", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MESSAGE_PASSING },
+{ "MMAP_FIXED_ALIGNMENT", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "MONOTONIC_CLOCK", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MONOTONIC_CLOCK },
+{ "MQ_OPEN_MAX", { 0ULL, 0 }, { _POSIX_MQ_OPEN_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_MQ_OPEN_MAX },
+{ "MQ_PRIO_MAX", { 0ULL, 0 }, { _POSIX_MQ_PRIO_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_MQ_PRIO_MAX },
+{ "MSEM_LOCKID", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "MULTI_PROCESS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "NACLS_MAX", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SVID, 1, CONF_sysconf, -1 },
+{ "NAME_MAX", { 0ULL, 0 }, { _POSIX_NAME_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_NAME_MAX },
+{ "NGROUPS_MAX", { 0ULL, 0 }, { _POSIX_NGROUPS_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_NGROUPS_MAX },
+{ "NL_ARGMAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "NL_LANGMAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "NL_MAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "NL_MSGMAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "NL_NMAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "NL_SETMAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "NL_SPECMAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "NL_TEXTMAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "NO_TRUNC", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_NO_TRUNC },
+{ "NPROCESSORS_CONF", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SVID, 1, CONF_sysconf, _SC_NPROCESSORS_CONF },
+{ "NPROCESSORS_ONLN", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SVID, 1, CONF_sysconf, _SC_NPROCESSORS_ONLN },
+{ "NPROC_CONF", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "NPROC_ONLN", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "NSS_BUFLEN_GROUP", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "NSS_BUFLEN_PASSWD", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "NUM_PROCESSORS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "NZERO", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "OPEN_MAX", { 0ULL, 0 }, { _POSIX_OPEN_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_OPEN_MAX },
+{ "OPEN_MAX_CEIL", { OPEN_MAX, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_AST, 1, CONF_nop, -1 },
+{ "OSREL_MAJ", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "OSREL_MIN", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "OSREL_PATCH", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "OS_BASE", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
+{ "OS_PROVIDER", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
+{ "OS_VERSION", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE, CONF_AES, 1, CONF_sysconf, -1 },
+{ "PAGESIZE", { 0ULL, 0 }, { 4096ULL, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_PAGESIZE },
+{ "PAGE_SIZE", { 0ULL, 0 }, { 0ULL, 0 }, CONF_MINMAX|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, _SC_PAGE_SIZE },
+{ "PASS_MAX", { 0ULL, 0 }, { 8ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, _SC_PASS_MAX },
{ "PATH", { 0, 0 }, { 0, "/bin:/usr/bin" }, CONF_DEFER_CALL|CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_confstr, _CS_PATH },
-{ "PATH_MAX", { 0, 0 }, { _POSIX_PATH_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_PATH_MAX },
-{ "PBS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS },
-{ "PBS_ACCOUNTING", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_ACCOUNTING },
-{ "PBS_CHECKPOINT", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_CHECKPOINT },
-{ "PBS_LOCATE", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_LOCATE },
-{ "PBS_MESSAGE", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_MESSAGE },
-{ "PBS_TRACK", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_TRACK },
-{ "PHYS_PAGES", { 0, 0 }, { 0, 0 }, 0, CONF_SUN, 1, CONF_sysconf, _SC_PHYS_PAGES },
-{ "PID_MAX", { 0, 0 }, { 30000, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
-{ "PII", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PII_INTERNET", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PII_INTERNET_DGRAM", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PII_INTERNET_STREAM", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PII_OSI", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PII_OSI_CLTS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PII_OSI_COTS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PII_OSI_M", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PII_SOCKET", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PII_XTI", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PIPE_BUF", { 0, 0 }, { _POSIX_PIPE_BUF, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_PIPE_BUF },
-{ "POLL", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PRIORITIZED_IO", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_PRIORITIZED_IO },
-{ "PRIORITY_SCHEDULING", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_PRIORITY_SCHEDULING },
-{ "PRIO_IO", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_PRIO_IO },
-{ "PROC_RSRC_MGR", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "PTHREAD_DESTRUCTOR_ITERATIONS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "PTHREAD_KEYS_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "PTHREAD_STACK_MIN", { 4096, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_LIMIT|CONF_LIMIT_DEF, CONF_POSIX, 1, CONF_nop, -1 },
-{ "PTHREAD_THREADS_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "PTRDIFF_MAX", { 2147483647, 0 }, { 65535, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_LIMIT_DEF|CONF_MINMAX_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "PTRDIFF_MIN", { -2147483648, 0 }, { -65535, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_LIMIT_DEF|CONF_MINMAX_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "RAW_SOCKETS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_RAW_SOCKETS },
-{ "READER_WRITER_LOCKS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_READER_WRITER_LOCKS },
-{ "REALTIME", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, -1 },
-{ "REALTIME_SIGNALS", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_REALTIME_SIGNALS },
-{ "REALTIME_THREADS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, -1 },
-{ "REC_INCR_XFER_SIZE", { 0, 0 }, { 0, 0 }, CONF_LIMIT|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_REC_INCR_XFER_SIZE },
-{ "REC_MAX_XFER_SIZE", { 0, 0 }, { 0, 0 }, CONF_LIMIT|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_REC_MAX_XFER_SIZE },
-{ "REC_MIN_XFER_SIZE", { 0, 0 }, { 0, 0 }, CONF_LIMIT|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_REC_MIN_XFER_SIZE },
-{ "REC_XFER_ALIGN", { 0, 0 }, { 0, 0 }, CONF_LIMIT|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_REC_XFER_ALIGN },
-{ "REENTRANT_FUNCTIONS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "REGEXP", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_REGEXP },
-{ "REGEX_VERSION", { 0, 0 }, { 20030916, 0 }, CONF_FEATURE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "RELEASE", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "RESOURCE_LIMITS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "RE_DUP_MAX", { 0, 0 }, { _POSIX2_RE_DUP_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_RE_DUP_MAX },
-{ "RTSIG_MAX", { 0, 0 }, { _POSIX_RTSIG_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_RTSIG_MAX },
-{ "SAVED_IDS", { 0, 0 }, { 1, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SAVED_IDS },
-{ "SCHAR_MAX", { 127, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "SCHAR_MIN", { -128, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "SECURITY_CLASS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "SELECT", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "SEMAPHORES", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SEMAPHORES },
-{ "SEM_NSEMS_MAX", { 0, 0 }, { _POSIX_SEM_NSEMS_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_SEM_NSEMS_MAX },
-{ "SEM_VALUE_MAX", { 0, 0 }, { _POSIX_SEM_VALUE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_SEM_VALUE_MAX },
+{ "PATH_MAX", { 0ULL, 0 }, { _POSIX_PATH_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_PATH_MAX },
+{ "PBS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS },
+{ "PBS_ACCOUNTING", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_ACCOUNTING },
+{ "PBS_CHECKPOINT", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_CHECKPOINT },
+{ "PBS_LOCATE", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_LOCATE },
+{ "PBS_MESSAGE", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_MESSAGE },
+{ "PBS_TRACK", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_TRACK },
+{ "PHYS_PAGES", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SUN, 1, CONF_sysconf, _SC_PHYS_PAGES },
+{ "PID_MAX", { 0ULL, 0 }, { 30000ULL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
+{ "PII", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PII_INTERNET", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PII_INTERNET_DGRAM", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PII_INTERNET_STREAM", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PII_OSI", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PII_OSI_CLTS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PII_OSI_COTS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PII_OSI_M", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PII_SOCKET", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PII_XTI", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PIPE_BUF", { 0ULL, 0 }, { _POSIX_PIPE_BUF, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_PIPE_BUF },
+{ "POLL", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PRIORITIZED_IO", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_PRIORITIZED_IO },
+{ "PRIORITY_SCHEDULING", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_PRIORITY_SCHEDULING },
+{ "PRIO_IO", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_PRIO_IO },
+{ "PROC_RSRC_MGR", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "PTHREAD_DESTRUCTOR_ITERATIONS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "PTHREAD_KEYS_MAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "PTHREAD_STACK_MIN", { 4096ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_LIMIT|CONF_LIMIT_DEF, CONF_POSIX, 1, CONF_nop, -1 },
+{ "PTHREAD_THREADS_MAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "PTRDIFF_MAX", { 2147483647ULL, 0 }, { 65535ULL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_LIMIT_DEF|CONF_MINMAX_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "PTRDIFF_MIN", { -2147483647LL-1LL, 0 }, { -65535LL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_LIMIT_DEF|CONF_MINMAX_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "RAW_SOCKETS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_RAW_SOCKETS },
+{ "READER_WRITER_LOCKS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_READER_WRITER_LOCKS },
+{ "REALTIME", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, -1 },
+{ "REALTIME_SIGNALS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_REALTIME_SIGNALS },
+{ "REALTIME_THREADS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, -1 },
+{ "REC_INCR_XFER_SIZE", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_REC_INCR_XFER_SIZE },
+{ "REC_MAX_XFER_SIZE", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_REC_MAX_XFER_SIZE },
+{ "REC_MIN_XFER_SIZE", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_REC_MIN_XFER_SIZE },
+{ "REC_XFER_ALIGN", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_REC_XFER_ALIGN },
+{ "REENTRANT_FUNCTIONS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "REGEXP", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_REGEXP },
+{ "REGEX_VERSION", { 0ULL, 0 }, { 20030916ULL, 0 }, CONF_FEATURE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "RELEASE", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_AST, 1, CONF_nop, -1 },
+{ "RESOURCE_LIMITS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "RE_DUP_MAX", { 0ULL, 0 }, { _POSIX2_RE_DUP_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_RE_DUP_MAX },
+{ "RTSIG_MAX", { 0ULL, 0 }, { _POSIX_RTSIG_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_RTSIG_MAX },
+{ "SAVED_IDS", { 0ULL, 0 }, { 1ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SAVED_IDS },
+{ "SCHAR_MAX", { 127ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "SCHAR_MIN", { -127LL-1LL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "SECURITY_CLASS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "SELECT", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "SEMAPHORES", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SEMAPHORES },
+{ "SEM_NSEMS_MAX", { 0ULL, 0 }, { _POSIX_SEM_NSEMS_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_SEM_NSEMS_MAX },
+{ "SEM_VALUE_MAX", { 0ULL, 0 }, { _POSIX_SEM_VALUE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_SEM_VALUE_MAX },
{ "SH", { 0, 0 }, { 0, "/bin/sh" }, CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING|CONF_MINMAX_DEF, CONF_AST, 1, CONF_confstr, -1 },
-{ "SHARED_MEMORY_OBJECTS", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SHARED_MEMORY_OBJECTS },
-{ "SHELL", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SHELL },
-{ "SHM", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_SHM },
-{ "SHRT_MAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
-{ "SHRT_MIN", { -32768, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "SIGQUEUE_MAX", { 0, 0 }, { _POSIX_SIGQUEUE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_SIGQUEUE_MAX },
-{ "SIGRT_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SVID, 1, CONF_sysconf, _SC_SIGRT_MAX },
-{ "SIGRT_MIN", { 0, 0 }, { 0, 0 }, 0, CONF_SVID, 1, CONF_sysconf, _SC_SIGRT_MIN },
-{ "SIG_ATOMIC_MAX", { 2147483647, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "SIG_ATOMIC_MIN", { -2147483648, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "SIZE_MAX", { UINT_MAX, 0 }, { 65535, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_LIMIT_DEF|CONF_MINMAX_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "SLVM_MAXNODES", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "SOCK_MAXBUF", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "SOFTPOWER", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "SPAWN", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SPAWN },
-{ "SPIN_LOCKS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SPIN_LOCKS },
-{ "SPORADIC_SERVER", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SPORADIC_SERVER },
-{ "SRPC_DOMAIN", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "SHARED_MEMORY_OBJECTS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SHARED_MEMORY_OBJECTS },
+{ "SHELL", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SHELL },
+{ "SHM", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_SHM },
+{ "SHRT_MAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
+{ "SHRT_MIN", { -32767LL-1LL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "SIGQUEUE_MAX", { 0ULL, 0 }, { _POSIX_SIGQUEUE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_SIGQUEUE_MAX },
+{ "SIGRT_MAX", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SVID, 1, CONF_sysconf, _SC_SIGRT_MAX },
+{ "SIGRT_MIN", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SVID, 1, CONF_sysconf, _SC_SIGRT_MIN },
+{ "SIG_ATOMIC_MAX", { 2147483647ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "SIG_ATOMIC_MIN", { -2147483647LL-1LL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "SIZE_MAX", { UINT_MAX, 0 }, { 65535ULL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_LIMIT_DEF|CONF_MINMAX_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "SLVM_MAXNODES", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "SOCK_MAXBUF", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "SOFTPOWER", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "SPAWN", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SPAWN },
+{ "SPIN_LOCKS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SPIN_LOCKS },
+{ "SPORADIC_SERVER", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SPORADIC_SERVER },
+{ "SRPC_DOMAIN", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
{ "SSIZE_MAX", { INT_MAX, 0 }, { _POSIX_SSIZE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_LIMIT_DEF|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_nop, -1 },
-{ "SS_REPL_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SS_REPL_MAX },
-{ "STD_BLK", { 0, 0 }, { 1024, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
-{ "STREAMS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_STREAMS },
-{ "STREAM_MAX", { 0, 0 }, { _POSIX_STREAM_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_STREAM_MAX },
-{ "SW_DEV", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_SW_DEV },
-{ "SYMLINKS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_pathconf, _PC_2_SYMLINKS },
-{ "SYMLINK_MAX", { 0, 0 }, { _POSIX_SYMLINK_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_SYMLINK_MAX },
-{ "SYMLOOP_MAX", { 0, 0 }, { _POSIX_SYMLOOP_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_SYMLOOP_MAX },
-{ "SYNCHRONIZED_IO", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SYNCHRONIZED_IO },
-{ "SYNC_IO", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_SYNC_IO },
-{ "SYSNAME", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "SYSPID_MAX", { 0, 0 }, { 2, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
-{ "THREADS", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREADS },
-{ "THREADS_PRIO_CEILING", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "THREADS_PRIO_INHERIT", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "THREAD_ATTR_STACKADDR", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_ATTR_STACKADDR },
-{ "THREAD_ATTR_STACKSIZE", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_ATTR_STACKSIZE },
-{ "THREAD_CPUTIME", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_CPUTIME },
-{ "THREAD_DESTRUCTOR_ITERATIONS", { 0, 0 }, { _POSIX_THREAD_DESTRUCTOR_ITERATIONS, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_PREFIX_ONLY|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_DESTRUCTOR_ITERATIONS },
-{ "THREAD_KEYS_MAX", { 0, 0 }, { _POSIX_THREAD_KEYS_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_PREFIX_ONLY|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_KEYS_MAX },
-{ "THREAD_PRIORITY_SCHEDULING", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_PRIORITY_SCHEDULING },
-{ "THREAD_PRIO_INHERIT", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_PRIO_INHERIT },
-{ "THREAD_PRIO_PROTECT", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_PRIO_PROTECT },
-{ "THREAD_PROCESS_SHARED", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_PROCESS_SHARED },
-{ "THREAD_SAFE_FUNCTIONS", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_SAFE_FUNCTIONS },
-{ "THREAD_SPORADIC_SERVER", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_SPORADIC_SERVER },
-{ "THREAD_STACK_MIN", { 0, 0 }, { 0, 0 }, CONF_LIMIT|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_STACK_MIN },
-{ "THREAD_THREADS_MAX", { 0, 0 }, { _POSIX_THREAD_THREADS_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_PREFIX_ONLY|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_THREADS_MAX },
-{ "TIMEOUTS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TIMEOUTS },
-{ "TIMERS", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TIMERS },
-{ "TIMER_MAX", { 0, 0 }, { _POSIX_TIMER_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_TIMER_MAX },
+{ "SS_REPL_MAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SS_REPL_MAX },
+{ "STD_BLK", { 0ULL, 0 }, { 1024ULL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
+{ "STREAMS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_STREAMS },
+{ "STREAM_MAX", { 0ULL, 0 }, { _POSIX_STREAM_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_STREAM_MAX },
+{ "SW_DEV", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_SW_DEV },
+{ "SYMLINKS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_pathconf, _PC_2_SYMLINKS },
+{ "SYMLINK_MAX", { 0ULL, 0 }, { _POSIX_SYMLINK_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_SYMLINK_MAX },
+{ "SYMLOOP_MAX", { 0ULL, 0 }, { _POSIX_SYMLOOP_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_SYMLOOP_MAX },
+{ "SYNCHRONIZED_IO", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SYNCHRONIZED_IO },
+{ "SYNC_IO", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_SYNC_IO },
+{ "SYSNAME", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, SI_SYSNAME },
+{ "SYSPID_MAX", { 0ULL, 0 }, { 2ULL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
+{ "THREADS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREADS },
+{ "THREADS_PRIO_CEILING", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "THREADS_PRIO_INHERIT", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "THREAD_ATTR_STACKADDR", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_ATTR_STACKADDR },
+{ "THREAD_ATTR_STACKSIZE", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_ATTR_STACKSIZE },
+{ "THREAD_CPUTIME", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_CPUTIME },
+{ "THREAD_DESTRUCTOR_ITERATIONS", { 0ULL, 0 }, { _POSIX_THREAD_DESTRUCTOR_ITERATIONS, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_PREFIX_ONLY|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_DESTRUCTOR_ITERATIONS },
+{ "THREAD_KEYS_MAX", { 0ULL, 0 }, { _POSIX_THREAD_KEYS_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_PREFIX_ONLY|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_KEYS_MAX },
+{ "THREAD_PRIORITY_SCHEDULING", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_PRIORITY_SCHEDULING },
+{ "THREAD_PRIO_INHERIT", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_PRIO_INHERIT },
+{ "THREAD_PRIO_PROTECT", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_PRIO_PROTECT },
+{ "THREAD_PROCESS_SHARED", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_PROCESS_SHARED },
+{ "THREAD_SAFE_FUNCTIONS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_SAFE_FUNCTIONS },
+{ "THREAD_SPORADIC_SERVER", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_SPORADIC_SERVER },
+{ "THREAD_STACK_MIN", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_STACK_MIN },
+{ "THREAD_THREADS_MAX", { 0ULL, 0 }, { _POSIX_THREAD_THREADS_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_PREFIX_ONLY|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_THREADS_MAX },
+{ "TIMEOUTS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TIMEOUTS },
+{ "TIMERS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TIMERS },
+{ "TIMER_MAX", { 0ULL, 0 }, { _POSIX_TIMER_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_TIMER_MAX },
{ "TMP", { 0, 0 }, { 0, "/tmp" }, CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING|CONF_MINMAX_DEF, CONF_AST, 1, CONF_confstr, -1 },
-{ "TMP_MAX", { 17576, 0 }, { 10000, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_LIMIT_DEF|CONF_MINMAX_DEF, CONF_C, 1, CONF_sysconf, -1 },
-{ "TRACE", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE },
-{ "TRACE_EVENT_FILTER", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_EVENT_FILTER },
-{ "TRACE_EVENT_NAME_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_EVENT_NAME_MAX },
-{ "TRACE_INHERIT", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_INHERIT },
-{ "TRACE_LOG", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_LOG },
-{ "TRACE_NAME_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_NAME_MAX },
-{ "TRACE_SYS_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_SYS_MAX },
-{ "TRACE_USER_EVENT_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_USER_EVENT_MAX },
-{ "TTY_NAME_MAX", { 0, 0 }, { _POSIX_TTY_NAME_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_TTY_NAME_MAX },
-{ "TYPED_MEMORY_OBJECTS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TYPED_MEMORY_OBJECTS },
-{ "TZNAME_MAX", { 0, 0 }, { _POSIX_TZNAME_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_TZNAME_MAX },
-{ "T_IOV_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_C, 1, CONF_sysconf, _SC_T_IOV_MAX },
-{ "UCHAR_MAX", { 255, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "UCHAR_MIN", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
-{ "UID_MAX", { 0, 0 }, { 60002, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
-{ "UINT_MAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
-{ "UIO_MAXIOV", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "ULLONG_MAX", { 18446744073709551615ULL, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "ULONG_MAX", { 4294967295, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "UNIX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_UNIX },
-{ "UPE", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_UPE },
-{ "USER_LIMIT", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "USHRT_MAX", { 65535, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "V6_ILP32_OFF32", { 0, 0 }, { 0, 0 }, CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_V6_ILP32_OFF32 },
-{ "V6_ILP32_OFFBIG", { 0, 0 }, { 0, 0 }, CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_V6_ILP32_OFFBIG },
-{ "V6_LP64_OFF64", { 0, 0 }, { 0, 0 }, CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_V6_LP64_OFF64 },
-{ "V6_LPBIG_OFFBIG", { 0, 0 }, { 0, 0 }, CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_V6_LPBIG_OFFBIG },
-{ "VDISABLE", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_VDISABLE },
+{ "TMP_MAX", { 17576ULL, 0 }, { 10000ULL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_LIMIT_DEF|CONF_MINMAX_DEF, CONF_C, 1, CONF_sysconf, -1 },
+{ "TRACE", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE },
+{ "TRACE_EVENT_FILTER", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_EVENT_FILTER },
+{ "TRACE_EVENT_NAME_MAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_EVENT_NAME_MAX },
+{ "TRACE_INHERIT", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_INHERIT },
+{ "TRACE_LOG", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_LOG },
+{ "TRACE_NAME_MAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_NAME_MAX },
+{ "TRACE_SYS_MAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_SYS_MAX },
+{ "TRACE_USER_EVENT_MAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_USER_EVENT_MAX },
+{ "TTY_NAME_MAX", { 0ULL, 0 }, { _POSIX_TTY_NAME_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_TTY_NAME_MAX },
+{ "TYPED_MEMORY_OBJECTS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TYPED_MEMORY_OBJECTS },
+{ "TZNAME_MAX", { 0ULL, 0 }, { _POSIX_TZNAME_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_TZNAME_MAX },
+{ "T_IOV_MAX", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_C, 1, CONF_sysconf, _SC_T_IOV_MAX },
+{ "UCHAR_MAX", { 255ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "UCHAR_MIN", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
+{ "UID_MAX", { 0ULL, 0 }, { 60002ULL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
+{ "UINT_MAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
+{ "UIO_MAXIOV", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "ULLONG_MAX", { 18446744073709551615ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "ULONG_MAX", { 4294967295ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "UNIX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_UNIX },
+{ "UPE", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_UPE },
+{ "USER_LIMIT", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
+{ "USHRT_MAX", { 65535ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "V6_ILP32_OFF32", { 0ULL, 0 }, { 0ULL, 0 }, CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_V6_ILP32_OFF32 },
+{ "V6_ILP32_OFFBIG", { 0ULL, 0 }, { 0ULL, 0 }, CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_V6_ILP32_OFFBIG },
+{ "V6_LP64_OFF64", { 0ULL, 0 }, { 0ULL, 0 }, CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_V6_LP64_OFF64 },
+{ "V6_LPBIG_OFFBIG", { 0ULL, 0 }, { 0ULL, 0 }, CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_V6_LPBIG_OFFBIG },
+{ "VDISABLE", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_VDISABLE },
{ "VERSION", { 0, 0 }, { 0, 0 }, CONF_PREFIXED|CONF_STANDARD|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "VERSION", { 0, 0 }, { 200112, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "VERSION", { 0, 0 }, { 200112, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 2, CONF_sysconf, -1 },
-{ "VERSION", { 0, 0 }, { 600, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_VERSION },
-{ "VERSION", { 0, 0 }, { 0, 0 }, CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_XPG, 3, CONF_sysconf, -1 },
-{ "VERSION", { 0, 0 }, { 0, 0 }, CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_XPG, 4, CONF_sysconf, -1 },
-{ "VERSION", { 0, 0 }, { 0, 0 }, CONF_MINMAX|CONF_PREFIXED|CONF_STANDARD, CONF_AST, 1, CONF_nop, -1 },
-{ "VERSION", { 0, 0 }, { 0, 0 }, CONF_PREFIXED|CONF_STANDARD, CONF_GNU, 1, CONF_nop, -1 },
-{ "VERSION", { 0, 0 }, { 0, 0 }, CONF_PREFIXED|CONF_STANDARD, CONF_TRUSTEDBSD, 1, CONF_nop, -1 },
-{ "VERSION_88", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_LIMIT|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "VERSION_88", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
-{ "VERSION_90", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_LIMIT|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "VERSION_90", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
-{ "VERSION_93", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_LIMIT|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "VERSION_93", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
-{ "WCHAR_MAX", { 2147483647, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "WCHAR_MIN", { -2147483648, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "WINT_MAX", { 2147483647, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "WINT_MIN", { -2147483648, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "WORD_BIT", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "XCU_VERSION", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_XCU_VERSION },
-{ "XPG2", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "XPG3", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "XPG4", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "VERSION", { 0ULL, 0 }, { 200112ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "VERSION", { 0ULL, 0 }, { 200112ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 2, CONF_sysconf, -1 },
+{ "VERSION", { 0ULL, 0 }, { 600ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_VERSION },
+{ "VERSION", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_XPG, 3, CONF_sysconf, -1 },
+{ "VERSION", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_XPG, 4, CONF_sysconf, -1 },
+{ "VERSION", { 0ULL, 0 }, { 0ULL, 0 }, CONF_MINMAX|CONF_PREFIXED|CONF_STANDARD, CONF_AST, 1, CONF_nop, -1 },
+{ "VERSION", { 0ULL, 0 }, { 0ULL, 0 }, CONF_PREFIXED|CONF_STANDARD, CONF_GNU, 1, CONF_nop, -1 },
+{ "VERSION", { 0ULL, 0 }, { 0ULL, 0 }, CONF_PREFIXED|CONF_STANDARD, CONF_TRUSTEDBSD, 1, CONF_nop, -1 },
+{ "VERSION_88", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_LIMIT|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "VERSION_88", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
+{ "VERSION_90", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_LIMIT|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "VERSION_90", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
+{ "VERSION_93", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_LIMIT|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "VERSION_93", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
+{ "WCHAR_MAX", { 2147483647ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "WCHAR_MIN", { -2147483647LL-1LL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "WINT_MAX", { 2147483647ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "WINT_MIN", { -2147483647LL-1LL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "WORD_BIT", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "XCU_VERSION", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_XCU_VERSION },
+{ "XPG2", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "XPG3", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "XPG4", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_nop, -1 },
};
int conf_elements = (int)sizeof(conf) / (int)sizeof(conf[0]);
diff --git a/usr/src/lib/libast/i386/src/lib/libast/conftab.h b/usr/src/lib/libast/i386/src/lib/libast/conftab.h
index 24843afa7d..165462f87f 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/conftab.h
+++ b/usr/src/lib/libast/i386/src/lib/libast/conftab.h
@@ -1,66 +1,4 @@
-
-/* : : generated by proto : : */
-
-
#ifndef _CONFTAB_H
-#if !defined(__PROTO__)
-# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
-# if defined(__cplusplus)
-# define __LINKAGE__ "C"
-# else
-# define __LINKAGE__
-# endif
-# define __STDARG__
-# define __PROTO__(x) x
-# define __OTORP__(x)
-# define __PARAM__(n,o) n
-# if !defined(__STDC__) && !defined(__cplusplus)
-# if !defined(c_plusplus)
-# define const
-# endif
-# define signed
-# define void int
-# define volatile
-# define __V_ char
-# else
-# define __V_ void
-# endif
-# else
-# define __PROTO__(x) ()
-# define __OTORP__(x) x
-# define __PARAM__(n,o) o
-# define __LINKAGE__
-# define __V_ char
-# define const
-# define signed
-# define void int
-# define volatile
-# endif
-# define __MANGLE__ __LINKAGE__
-# if defined(__cplusplus) || defined(c_plusplus)
-# define __VARARG__ ...
-# else
-# define __VARARG__
-# endif
-# if defined(__STDARG__)
-# define __VA_START__(p,a) va_start(p,a)
-# else
-# define __VA_START__(p,a) va_start(p)
-# endif
-# if !defined(__INLINE__)
-# if defined(__cplusplus)
-# define __INLINE__ extern __MANGLE__ inline
-# else
-# if defined(_WIN32) && !defined(__GNUC__)
-# define __INLINE__ __inline
-# endif
-# endif
-# endif
-#endif
-#if !defined(__LINKAGE__)
-#define __LINKAGE__ /* 2004-08-11 transition */
-#endif
-
#define _CONFTAB_H
#if !defined(SYS_NMLEN)
@@ -68,7 +6,11 @@
#endif
#include <sys/systeminfo.h>
-/* : : generated by conf from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/comp/conf.tab : : */
+/* : : generated by conf from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/comp/conf.tab : : */
+
+#if !defined(const) && !defined(__STDC__) && !defined(__cplusplus) && !defined(c_plusplus)
+#define const
+#endif
#define conf _ast_conf_data
#define conf_elements _ast_conf_ndata
@@ -117,8 +59,6 @@
struct Conf_s; typedef struct Conf_s Conf_t;
-typedef int (*Conf_f) __PROTO__((Conf_t*, intmax_t*, char**));
-
typedef struct Value_s
{
intmax_t number;
@@ -130,7 +70,7 @@ struct Conf_s
const char name[32];
Value_t limit;
Value_t minmax;
- short flags;
+ unsigned int flags;
short standard;
short section;
short call;
@@ -145,10 +85,10 @@ typedef struct Prefix_s
short call;
} Prefix_t;
-extern __MANGLE__ const Conf_t conf[];
-extern __MANGLE__ int conf_elements;
+extern const Conf_t conf[];
+extern int conf_elements;
-extern __MANGLE__ const Prefix_t prefix[];
-extern __MANGLE__ int prefix_elements;
+extern const Prefix_t prefix[];
+extern int prefix_elements;
#endif
diff --git a/usr/src/lib/libast/i386/src/lib/libast/lc.h b/usr/src/lib/libast/i386/src/lib/libast/lc.h
index fdd804f36e..b225864bbc 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/lc.h
+++ b/usr/src/lib/libast/i386/src/lib/libast/lc.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/i386/src/lib/libast/lctab.h b/usr/src/lib/libast/i386/src/lib/libast/lctab.c
index 6abbd72c65..4927e1fd3a 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/lctab.h
+++ b/usr/src/lib/libast/i386/src/lib/libast/lctab.c
@@ -1,6 +1,10 @@
/* : : generated by ./lcgen : : */
-static Lc_attribute_t attribute_es[] =
+#include "lclib.h"
+#include "lclang.h"
+
+
+const Lc_attribute_t attribute_es[] =
{
{"traditional",LC_default,
#ifdef SUBLANG_SPANISH_TRADITIONAL
@@ -20,7 +24,7 @@ SUBLANG_SPANISH_MODERN,
},
};
-static const Lc_charset_t charset[] =
+const Lc_charset_t lc_charsets[] =
{
{"iso8859-1","latin1|west-europe","1252",},
{"iso8859-2","latin2|east-europe","1250",},
@@ -42,11 +46,11 @@ static const Lc_charset_t charset[] =
0
};
-static const Lc_language_t language[] =
+const Lc_language_t lc_languages[] =
{
-{"C","C","POSIX",&charset[0],LC_default,0,0,0,},
-{"debug","debug",0,&charset[0],LC_debug,0,0,0,},
-{"aa","afar",0,&charset[0],0,
+{"C","C","POSIX",&lc_charsets[0],LC_default,0,0,0,},
+{"debug","debug",0,&lc_charsets[0],LC_debug,0,0,0,},
+{"aa","afar",0,&lc_charsets[0],0,
#ifdef LANG_AFAR
LANG_AFAR,
#else
@@ -54,7 +58,7 @@ LANG_AFAR,
#endif
0,0,
},
-{"ab","abkhazian",0,&charset[0],0,
+{"ab","abkhazian",0,&lc_charsets[0],0,
#ifdef LANG_ABKHAZIAN
LANG_ABKHAZIAN,
#else
@@ -62,7 +66,7 @@ LANG_ABKHAZIAN,
#endif
0,0,
},
-{"af","afrikaans","afr",&charset[0],0,
+{"af","afrikaans","afr",&lc_charsets[0],0,
#ifdef LANG_AFRIKAANS
LANG_AFRIKAANS,
#else
@@ -70,7 +74,7 @@ LANG_AFRIKAANS,
#endif
0,0,
},
-{"am","amharic",0,&charset[0],0,
+{"am","amharic",0,&lc_charsets[0],0,
#ifdef LANG_AMHARIC
LANG_AMHARIC,
#else
@@ -78,7 +82,7 @@ LANG_AMHARIC,
#endif
0,0,
},
-{"ar","arabic","ara",&charset[5],0,
+{"ar","arabic","ara",&lc_charsets[5],0,
#ifdef LANG_ARABIC
LANG_ARABIC,
#else
@@ -86,7 +90,7 @@ LANG_ARABIC,
#endif
0,0,
},
-{"as","assamese",0,&charset[0],0,
+{"as","assamese",0,&lc_charsets[0],0,
#ifdef LANG_ASSAMESE
LANG_ASSAMESE,
#else
@@ -94,7 +98,7 @@ LANG_ASSAMESE,
#endif
0,0,
},
-{"ay","aymara",0,&charset[0],0,
+{"ay","aymara",0,&lc_charsets[0],0,
#ifdef LANG_AYMARA
LANG_AYMARA,
#else
@@ -102,7 +106,7 @@ LANG_AYMARA,
#endif
0,0,
},
-{"az","azerbaijani",0,&charset[0],0,
+{"az","azerbaijani",0,&lc_charsets[0],0,
#ifdef LANG_AZERBAIJANI
LANG_AZERBAIJANI,
#else
@@ -110,7 +114,7 @@ LANG_AZERBAIJANI,
#endif
0,0,
},
-{"ba","bashkir",0,&charset[0],0,
+{"ba","bashkir",0,&lc_charsets[0],0,
#ifdef LANG_BASHKIR
LANG_BASHKIR,
#else
@@ -118,7 +122,7 @@ LANG_BASHKIR,
#endif
0,0,
},
-{"be","belarusian","bel",&charset[0],0,
+{"be","belarusian","bel",&lc_charsets[0],0,
#ifdef LANG_BELARUSIAN
LANG_BELARUSIAN,
#else
@@ -126,7 +130,7 @@ LANG_BELARUSIAN,
#endif
0,0,
},
-{"bg","bulgarian","bul",&charset[4],0,
+{"bg","bulgarian","bul",&lc_charsets[4],0,
#ifdef LANG_BULGARIAN
LANG_BULGARIAN,
#else
@@ -134,7 +138,7 @@ LANG_BULGARIAN,
#endif
0,0,
},
-{"bh","bihari",0,&charset[0],0,
+{"bh","bihari",0,&lc_charsets[0],0,
#ifdef LANG_BIHARI
LANG_BIHARI,
#else
@@ -142,7 +146,7 @@ LANG_BIHARI,
#endif
0,0,
},
-{"bi","bislama",0,&charset[0],0,
+{"bi","bislama",0,&lc_charsets[0],0,
#ifdef LANG_BISLAMA
LANG_BISLAMA,
#else
@@ -150,7 +154,7 @@ LANG_BISLAMA,
#endif
0,0,
},
-{"bn","bengali-bangla",0,&charset[0],0,
+{"bn","bengali-bangla",0,&lc_charsets[0],0,
#ifdef LANG_BENGALI_BANGLA
LANG_BENGALI_BANGLA,
#else
@@ -158,7 +162,7 @@ LANG_BENGALI_BANGLA,
#endif
0,0,
},
-{"bo","tibetan",0,&charset[0],0,
+{"bo","tibetan",0,&lc_charsets[0],0,
#ifdef LANG_TIBETAN
LANG_TIBETAN,
#else
@@ -166,7 +170,7 @@ LANG_TIBETAN,
#endif
0,0,
},
-{"br","breton",0,&charset[0],0,
+{"br","breton",0,&lc_charsets[0],0,
#ifdef LANG_BRETON
LANG_BRETON,
#else
@@ -174,7 +178,7 @@ LANG_BRETON,
#endif
0,0,
},
-{"ca","catalan","cat",&charset[0],0,
+{"ca","catalan","cat",&lc_charsets[0],0,
#ifdef LANG_CATALAN
LANG_CATALAN,
#else
@@ -182,7 +186,7 @@ LANG_CATALAN,
#endif
0,0,
},
-{"co","corsican",0,&charset[0],0,
+{"co","corsican",0,&lc_charsets[0],0,
#ifdef LANG_CORSICAN
LANG_CORSICAN,
#else
@@ -190,7 +194,7 @@ LANG_CORSICAN,
#endif
0,0,
},
-{"cs","czech","ces|cze",&charset[1],0,
+{"cs","czech","ces|cze",&lc_charsets[1],0,
#ifdef LANG_CZECH
LANG_CZECH,
#else
@@ -198,7 +202,7 @@ LANG_CZECH,
#endif
0,0,
},
-{"cy","welsh",0,&charset[0],0,
+{"cy","welsh",0,&lc_charsets[0],0,
#ifdef LANG_WELSH
LANG_WELSH,
#else
@@ -206,7 +210,7 @@ LANG_WELSH,
#endif
0,0,
},
-{"da","danish","dan",&charset[0],0,
+{"da","danish","dan",&lc_charsets[0],0,
#ifdef LANG_DANISH
LANG_DANISH,
#else
@@ -214,7 +218,7 @@ LANG_DANISH,
#endif
0,0,
},
-{"de","german","deu|ger",&charset[0],0,
+{"de","german","deu|ger",&lc_charsets[0],0,
#ifdef LANG_GERMAN
LANG_GERMAN,
#else
@@ -222,7 +226,7 @@ LANG_GERMAN,
#endif
0,0,
},
-{"dz","bhutani",0,&charset[0],0,
+{"dz","bhutani",0,&lc_charsets[0],0,
#ifdef LANG_BHUTANI
LANG_BHUTANI,
#else
@@ -230,7 +234,7 @@ LANG_BHUTANI,
#endif
0,0,
},
-{"el","greek","ell|gre",&charset[6],0,
+{"el","greek","ell|gre",&lc_charsets[6],0,
#ifdef LANG_GREEK
LANG_GREEK,
#else
@@ -238,7 +242,7 @@ LANG_GREEK,
#endif
0,0,
},
-{"en","english","eng",&charset[0],0,
+{"en","english","eng",&lc_charsets[0],0,
#ifdef LANG_ENGLISH
LANG_ENGLISH,
#else
@@ -246,7 +250,7 @@ LANG_ENGLISH,
#endif
0,0,
},
-{"eo","esperanto",0,&charset[0],0,
+{"eo","esperanto",0,&lc_charsets[0],0,
#ifdef LANG_ESPERANTO
LANG_ESPERANTO,
#else
@@ -254,7 +258,7 @@ LANG_ESPERANTO,
#endif
0,0,
},
-{"es","spanish","spa",&charset[0],0,
+{"es","spanish","spa",&lc_charsets[0],0,
#ifdef LANG_SPANISH
LANG_SPANISH,
#else
@@ -262,7 +266,7 @@ LANG_SPANISH,
#endif
&attribute_es[0],&attribute_es[1],
},
-{"et","estonian","est",&charset[2],0,
+{"et","estonian","est",&lc_charsets[2],0,
#ifdef LANG_ESTONIAN
LANG_ESTONIAN,
#else
@@ -270,7 +274,7 @@ LANG_ESTONIAN,
#endif
0,0,
},
-{"eu","basque","eus|baq",&charset[0],0,
+{"eu","basque","eus|baq",&lc_charsets[0],0,
#ifdef LANG_BASQUE
LANG_BASQUE,
#else
@@ -278,7 +282,7 @@ LANG_BASQUE,
#endif
0,0,
},
-{"fa","persian",0,&charset[0],0,
+{"fa","persian",0,&lc_charsets[0],0,
#ifdef LANG_PERSIAN
LANG_PERSIAN,
#else
@@ -286,7 +290,7 @@ LANG_PERSIAN,
#endif
0,0,
},
-{"fi","finnish","fin",&charset[0],0,
+{"fi","finnish","fin",&lc_charsets[0],0,
#ifdef LANG_FINNISH
LANG_FINNISH,
#else
@@ -294,7 +298,7 @@ LANG_FINNISH,
#endif
0,0,
},
-{"fj","fiji",0,&charset[0],0,
+{"fj","fiji",0,&lc_charsets[0],0,
#ifdef LANG_FIJI
LANG_FIJI,
#else
@@ -302,7 +306,7 @@ LANG_FIJI,
#endif
0,0,
},
-{"fo","faeroese",0,&charset[0],0,
+{"fo","faeroese",0,&lc_charsets[0],0,
#ifdef LANG_FAEROESE
LANG_FAEROESE,
#else
@@ -310,7 +314,7 @@ LANG_FAEROESE,
#endif
0,0,
},
-{"fr","french","fra|fre",&charset[0],0,
+{"fr","french","fra|fre",&lc_charsets[0],0,
#ifdef LANG_FRENCH
LANG_FRENCH,
#else
@@ -318,7 +322,7 @@ LANG_FRENCH,
#endif
0,0,
},
-{"fy","frisian",0,&charset[0],0,
+{"fy","frisian",0,&lc_charsets[0],0,
#ifdef LANG_FRISIAN
LANG_FRISIAN,
#else
@@ -326,7 +330,7 @@ LANG_FRISIAN,
#endif
0,0,
},
-{"ga","irish",0,&charset[11],0,
+{"ga","irish",0,&lc_charsets[11],0,
#ifdef LANG_IRISH
LANG_IRISH,
#else
@@ -334,7 +338,7 @@ LANG_IRISH,
#endif
0,0,
},
-{"gd","scots-gaelic",0,&charset[11],0,
+{"gd","scots-gaelic",0,&lc_charsets[11],0,
#ifdef LANG_SCOTS_GAELIC
LANG_SCOTS_GAELIC,
#else
@@ -342,7 +346,7 @@ LANG_SCOTS_GAELIC,
#endif
0,0,
},
-{"gl","galician",0,&charset[0],0,
+{"gl","galician",0,&lc_charsets[0],0,
#ifdef LANG_GALICIAN
LANG_GALICIAN,
#else
@@ -350,7 +354,7 @@ LANG_GALICIAN,
#endif
0,0,
},
-{"gn","guarani",0,&charset[0],0,
+{"gn","guarani",0,&lc_charsets[0],0,
#ifdef LANG_GUARANI
LANG_GUARANI,
#else
@@ -358,7 +362,7 @@ LANG_GUARANI,
#endif
0,0,
},
-{"gu","gujarati",0,&charset[0],0,
+{"gu","gujarati",0,&lc_charsets[0],0,
#ifdef LANG_GUJARATI
LANG_GUJARATI,
#else
@@ -366,7 +370,7 @@ LANG_GUJARATI,
#endif
0,0,
},
-{"ha","hausa",0,&charset[0],0,
+{"ha","hausa",0,&lc_charsets[0],0,
#ifdef LANG_HAUSA
LANG_HAUSA,
#else
@@ -374,7 +378,7 @@ LANG_HAUSA,
#endif
0,0,
},
-{"he","hebrew","heb",&charset[7],0,
+{"he","hebrew","heb",&lc_charsets[7],0,
#ifdef LANG_HEBREW
LANG_HEBREW,
#else
@@ -382,7 +386,7 @@ LANG_HEBREW,
#endif
0,0,
},
-{"hi","hindi",0,&charset[0],0,
+{"hi","hindi",0,&lc_charsets[0],0,
#ifdef LANG_HINDI
LANG_HINDI,
#else
@@ -390,7 +394,7 @@ LANG_HINDI,
#endif
0,0,
},
-{"hr","croatian","hrv|scr",&charset[1],0,
+{"hr","croatian","hrv|scr",&lc_charsets[1],0,
#ifdef LANG_CROATIAN
LANG_CROATIAN,
#else
@@ -398,7 +402,7 @@ LANG_CROATIAN,
#endif
0,0,
},
-{"hu","hungarian","hun",&charset[1],0,
+{"hu","hungarian","hun",&lc_charsets[1],0,
#ifdef LANG_HUNGARIAN
LANG_HUNGARIAN,
#else
@@ -406,7 +410,7 @@ LANG_HUNGARIAN,
#endif
0,0,
},
-{"hy","armenian",0,&charset[0],0,
+{"hy","armenian",0,&lc_charsets[0],0,
#ifdef LANG_ARMENIAN
LANG_ARMENIAN,
#else
@@ -414,7 +418,7 @@ LANG_ARMENIAN,
#endif
0,0,
},
-{"ia","interlingua",0,&charset[0],0,
+{"ia","interlingua",0,&lc_charsets[0],0,
#ifdef LANG_INTERLINGUA
LANG_INTERLINGUA,
#else
@@ -422,7 +426,7 @@ LANG_INTERLINGUA,
#endif
0,0,
},
-{"id","indonesian","ind",&charset[0],0,
+{"id","indonesian","ind",&lc_charsets[0],0,
#ifdef LANG_INDONESIAN
LANG_INDONESIAN,
#else
@@ -430,7 +434,7 @@ LANG_INDONESIAN,
#endif
0,0,
},
-{"ie","interlingue",0,&charset[0],0,
+{"ie","interlingue",0,&lc_charsets[0],0,
#ifdef LANG_INTERLINGUE
LANG_INTERLINGUE,
#else
@@ -438,7 +442,7 @@ LANG_INTERLINGUE,
#endif
0,0,
},
-{"ik","inupiak",0,&charset[0],0,
+{"ik","inupiak",0,&lc_charsets[0],0,
#ifdef LANG_INUPIAK
LANG_INUPIAK,
#else
@@ -446,7 +450,7 @@ LANG_INUPIAK,
#endif
0,0,
},
-{"in","indonesian",0,&charset[0],0,
+{"in","indonesian",0,&lc_charsets[0],0,
#ifdef LANG_INDONESIAN
LANG_INDONESIAN,
#else
@@ -454,7 +458,7 @@ LANG_INDONESIAN,
#endif
0,0,
},
-{"is","icelandic","isl|ice",&charset[0],0,
+{"is","icelandic","isl|ice",&lc_charsets[0],0,
#ifdef LANG_ICELANDIC
LANG_ICELANDIC,
#else
@@ -462,7 +466,7 @@ LANG_ICELANDIC,
#endif
0,0,
},
-{"it","italian","ita",&charset[0],0,
+{"it","italian","ita",&lc_charsets[0],0,
#ifdef LANG_ITALIAN
LANG_ITALIAN,
#else
@@ -470,7 +474,7 @@ LANG_ITALIAN,
#endif
0,0,
},
-{"iw","hebrew",0,&charset[0],0,
+{"iw","hebrew",0,&lc_charsets[0],0,
#ifdef LANG_HEBREW
LANG_HEBREW,
#else
@@ -478,7 +482,7 @@ LANG_HEBREW,
#endif
0,0,
},
-{"ja","japanese","jpn",&charset[0],0,
+{"ja","japanese","jpn",&lc_charsets[0],0,
#ifdef LANG_JAPANESE
LANG_JAPANESE,
#else
@@ -486,7 +490,7 @@ LANG_JAPANESE,
#endif
0,0,
},
-{"ji","yiddish",0,&charset[0],0,
+{"ji","yiddish",0,&lc_charsets[0],0,
#ifdef LANG_YIDDISH
LANG_YIDDISH,
#else
@@ -494,7 +498,7 @@ LANG_YIDDISH,
#endif
0,0,
},
-{"jw","javanese",0,&charset[0],0,
+{"jw","javanese",0,&lc_charsets[0],0,
#ifdef LANG_JAVANESE
LANG_JAVANESE,
#else
@@ -502,7 +506,7 @@ LANG_JAVANESE,
#endif
0,0,
},
-{"ka","georgian",0,&charset[0],0,
+{"ka","georgian",0,&lc_charsets[0],0,
#ifdef LANG_GEORGIAN
LANG_GEORGIAN,
#else
@@ -510,7 +514,7 @@ LANG_GEORGIAN,
#endif
0,0,
},
-{"kk","kazakh","kaz",&charset[0],0,
+{"kk","kazakh","kaz",&lc_charsets[0],0,
#ifdef LANG_KAZAKH
LANG_KAZAKH,
#else
@@ -518,7 +522,7 @@ LANG_KAZAKH,
#endif
0,0,
},
-{"kl","greenlandic",0,&charset[0],0,
+{"kl","greenlandic",0,&lc_charsets[0],0,
#ifdef LANG_GREENLANDIC
LANG_GREENLANDIC,
#else
@@ -526,7 +530,7 @@ LANG_GREENLANDIC,
#endif
0,0,
},
-{"km","cambodian",0,&charset[0],0,
+{"km","cambodian",0,&lc_charsets[0],0,
#ifdef LANG_CAMBODIAN
LANG_CAMBODIAN,
#else
@@ -534,7 +538,7 @@ LANG_CAMBODIAN,
#endif
0,0,
},
-{"kn","kannada",0,&charset[0],0,
+{"kn","kannada",0,&lc_charsets[0],0,
#ifdef LANG_KANNADA
LANG_KANNADA,
#else
@@ -542,7 +546,7 @@ LANG_KANNADA,
#endif
0,0,
},
-{"ko","korean","kor",&charset[0],0,
+{"ko","korean","kor",&lc_charsets[0],0,
#ifdef LANG_KOREAN
LANG_KOREAN,
#else
@@ -550,7 +554,7 @@ LANG_KOREAN,
#endif
0,0,
},
-{"ks","kashmiri",0,&charset[0],0,
+{"ks","kashmiri",0,&lc_charsets[0],0,
#ifdef LANG_KASHMIRI
LANG_KASHMIRI,
#else
@@ -558,7 +562,7 @@ LANG_KASHMIRI,
#endif
0,0,
},
-{"ku","kurdish",0,&charset[0],0,
+{"ku","kurdish",0,&lc_charsets[0],0,
#ifdef LANG_KURDISH
LANG_KURDISH,
#else
@@ -566,7 +570,7 @@ LANG_KURDISH,
#endif
0,0,
},
-{"ky","kirghiz",0,&charset[0],0,
+{"ky","kirghiz",0,&lc_charsets[0],0,
#ifdef LANG_KIRGHIZ
LANG_KIRGHIZ,
#else
@@ -574,7 +578,7 @@ LANG_KIRGHIZ,
#endif
0,0,
},
-{"la","latin",0,&charset[0],0,
+{"la","latin",0,&lc_charsets[0],0,
#ifdef LANG_LATIN
LANG_LATIN,
#else
@@ -582,7 +586,7 @@ LANG_LATIN,
#endif
0,0,
},
-{"ln","lingala",0,&charset[0],0,
+{"ln","lingala",0,&lc_charsets[0],0,
#ifdef LANG_LINGALA
LANG_LINGALA,
#else
@@ -590,7 +594,7 @@ LANG_LINGALA,
#endif
0,0,
},
-{"lo","laothian",0,&charset[0],0,
+{"lo","laothian",0,&lc_charsets[0],0,
#ifdef LANG_LAOTHIAN
LANG_LAOTHIAN,
#else
@@ -598,7 +602,7 @@ LANG_LAOTHIAN,
#endif
0,0,
},
-{"lt","lithuanian","lit",&charset[10],0,
+{"lt","lithuanian","lit",&lc_charsets[10],0,
#ifdef LANG_LITHUANIAN
LANG_LITHUANIAN,
#else
@@ -606,7 +610,7 @@ LANG_LITHUANIAN,
#endif
0,0,
},
-{"lv","latvian","lav",&charset[10],0,
+{"lv","latvian","lav",&lc_charsets[10],0,
#ifdef LANG_LATVIAN
LANG_LATVIAN,
#else
@@ -614,7 +618,7 @@ LANG_LATVIAN,
#endif
0,0,
},
-{"mg","malagasy",0,&charset[0],0,
+{"mg","malagasy",0,&lc_charsets[0],0,
#ifdef LANG_MALAGASY
LANG_MALAGASY,
#else
@@ -622,7 +626,7 @@ LANG_MALAGASY,
#endif
0,0,
},
-{"mi","maori",0,&charset[0],0,
+{"mi","maori",0,&lc_charsets[0],0,
#ifdef LANG_MAORI
LANG_MAORI,
#else
@@ -630,7 +634,7 @@ LANG_MAORI,
#endif
0,0,
},
-{"mk","macedonian","mkd|mac",&charset[0],0,
+{"mk","macedonian","mkd|mac",&lc_charsets[0],0,
#ifdef LANG_MACEDONIAN
LANG_MACEDONIAN,
#else
@@ -638,7 +642,7 @@ LANG_MACEDONIAN,
#endif
0,0,
},
-{"ml","malayalam","mal",&charset[0],0,
+{"ml","malayalam","mal",&lc_charsets[0],0,
#ifdef LANG_MALAYALAM
LANG_MALAYALAM,
#else
@@ -646,7 +650,7 @@ LANG_MALAYALAM,
#endif
0,0,
},
-{"mn","mongolian",0,&charset[0],0,
+{"mn","mongolian",0,&lc_charsets[0],0,
#ifdef LANG_MONGOLIAN
LANG_MONGOLIAN,
#else
@@ -654,7 +658,7 @@ LANG_MONGOLIAN,
#endif
0,0,
},
-{"mo","moldavian",0,&charset[0],0,
+{"mo","moldavian",0,&lc_charsets[0],0,
#ifdef LANG_MOLDAVIAN
LANG_MOLDAVIAN,
#else
@@ -662,7 +666,7 @@ LANG_MOLDAVIAN,
#endif
0,0,
},
-{"mr","marathi",0,&charset[0],0,
+{"mr","marathi",0,&lc_charsets[0],0,
#ifdef LANG_MARATHI
LANG_MARATHI,
#else
@@ -670,7 +674,7 @@ LANG_MARATHI,
#endif
0,0,
},
-{"ms","malay","msa|may",&charset[0],0,
+{"ms","malay","msa|may",&lc_charsets[0],0,
#ifdef LANG_MALAY
LANG_MALAY,
#else
@@ -678,7 +682,7 @@ LANG_MALAY,
#endif
0,0,
},
-{"mt","maltese",0,&charset[0],0,
+{"mt","maltese",0,&lc_charsets[0],0,
#ifdef LANG_MALTESE
LANG_MALTESE,
#else
@@ -686,7 +690,7 @@ LANG_MALTESE,
#endif
0,0,
},
-{"my","burmese",0,&charset[0],0,
+{"my","burmese",0,&lc_charsets[0],0,
#ifdef LANG_BURMESE
LANG_BURMESE,
#else
@@ -694,7 +698,7 @@ LANG_BURMESE,
#endif
0,0,
},
-{"na","nauru",0,&charset[0],0,
+{"na","nauru",0,&lc_charsets[0],0,
#ifdef LANG_NAURU
LANG_NAURU,
#else
@@ -702,7 +706,7 @@ LANG_NAURU,
#endif
0,0,
},
-{"nb","norwegian-bokmal","nob",&charset[0],0,
+{"nb","norwegian-bokmal","nob",&lc_charsets[0],0,
#ifdef LANG_NORWEGIAN_BOKMAL
LANG_NORWEGIAN_BOKMAL,
#else
@@ -710,7 +714,7 @@ LANG_NORWEGIAN_BOKMAL,
#endif
0,0,
},
-{"ne","nepali",0,&charset[0],0,
+{"ne","nepali",0,&lc_charsets[0],0,
#ifdef LANG_NEPALI
LANG_NEPALI,
#else
@@ -718,7 +722,7 @@ LANG_NEPALI,
#endif
0,0,
},
-{"nl","dutch","nld|dut",&charset[0],0,
+{"nl","dutch","nld|dut",&lc_charsets[0],0,
#ifdef LANG_DUTCH
LANG_DUTCH,
#else
@@ -726,7 +730,7 @@ LANG_DUTCH,
#endif
0,0,
},
-{"nn","norwegian-nynorsk","nno|non",&charset[0],0,
+{"nn","norwegian-nynorsk","nno|non",&lc_charsets[0],0,
#ifdef LANG_NORWEGIAN_NYNORSK
LANG_NORWEGIAN_NYNORSK,
#else
@@ -734,7 +738,7 @@ LANG_NORWEGIAN_NYNORSK,
#endif
0,0,
},
-{"no","norwegian","nor",&charset[0],0,
+{"no","norwegian","nor",&lc_charsets[0],0,
#ifdef LANG_NORWEGIAN
LANG_NORWEGIAN,
#else
@@ -742,7 +746,7 @@ LANG_NORWEGIAN,
#endif
0,0,
},
-{"oc","occitan",0,&charset[0],0,
+{"oc","occitan",0,&lc_charsets[0],0,
#ifdef LANG_OCCITAN
LANG_OCCITAN,
#else
@@ -750,7 +754,7 @@ LANG_OCCITAN,
#endif
0,0,
},
-{"om","oromo",0,&charset[0],0,
+{"om","oromo",0,&lc_charsets[0],0,
#ifdef LANG_OROMO
LANG_OROMO,
#else
@@ -758,7 +762,7 @@ LANG_OROMO,
#endif
0,0,
},
-{"or","oriya",0,&charset[0],0,
+{"or","oriya",0,&lc_charsets[0],0,
#ifdef LANG_ORIYA
LANG_ORIYA,
#else
@@ -766,7 +770,7 @@ LANG_ORIYA,
#endif
0,0,
},
-{"pa","punjabi",0,&charset[0],0,
+{"pa","punjabi",0,&lc_charsets[0],0,
#ifdef LANG_PUNJABI
LANG_PUNJABI,
#else
@@ -774,7 +778,7 @@ LANG_PUNJABI,
#endif
0,0,
},
-{"pl","polish","pol",&charset[1],0,
+{"pl","polish","pol",&lc_charsets[1],0,
#ifdef LANG_POLISH
LANG_POLISH,
#else
@@ -782,7 +786,7 @@ LANG_POLISH,
#endif
0,0,
},
-{"ps","pushto",0,&charset[0],0,
+{"ps","pushto",0,&lc_charsets[0],0,
#ifdef LANG_PUSHTO
LANG_PUSHTO,
#else
@@ -790,7 +794,7 @@ LANG_PUSHTO,
#endif
0,0,
},
-{"pt","portuguese","por",&charset[0],0,
+{"pt","portuguese","por",&lc_charsets[0],0,
#ifdef LANG_PORTUGUESE
LANG_PORTUGUESE,
#else
@@ -798,7 +802,7 @@ LANG_PORTUGUESE,
#endif
0,0,
},
-{"qu","quechua",0,&charset[0],0,
+{"qu","quechua",0,&lc_charsets[0],0,
#ifdef LANG_QUECHUA
LANG_QUECHUA,
#else
@@ -806,7 +810,7 @@ LANG_QUECHUA,
#endif
0,0,
},
-{"rm","rhaeto-romance",0,&charset[0],0,
+{"rm","rhaeto-romance",0,&lc_charsets[0],0,
#ifdef LANG_RHAETO_ROMANCE
LANG_RHAETO_ROMANCE,
#else
@@ -814,7 +818,7 @@ LANG_RHAETO_ROMANCE,
#endif
0,0,
},
-{"rn","kirundi",0,&charset[0],0,
+{"rn","kirundi",0,&lc_charsets[0],0,
#ifdef LANG_KIRUNDI
LANG_KIRUNDI,
#else
@@ -822,7 +826,7 @@ LANG_KIRUNDI,
#endif
0,0,
},
-{"ro","romanian","ron|rum",&charset[1],0,
+{"ro","romanian","ron|rum",&lc_charsets[1],0,
#ifdef LANG_ROMANIAN
LANG_ROMANIAN,
#else
@@ -830,7 +834,7 @@ LANG_ROMANIAN,
#endif
0,0,
},
-{"ru","russian","rus",&charset[4],0,
+{"ru","russian","rus",&lc_charsets[4],0,
#ifdef LANG_RUSSIAN
LANG_RUSSIAN,
#else
@@ -838,7 +842,7 @@ LANG_RUSSIAN,
#endif
0,0,
},
-{"rw","kinyarwanda",0,&charset[0],0,
+{"rw","kinyarwanda",0,&lc_charsets[0],0,
#ifdef LANG_KINYARWANDA
LANG_KINYARWANDA,
#else
@@ -846,7 +850,7 @@ LANG_KINYARWANDA,
#endif
0,0,
},
-{"sa","sanskrit",0,&charset[0],0,
+{"sa","sanskrit",0,&lc_charsets[0],0,
#ifdef LANG_SANSKRIT
LANG_SANSKRIT,
#else
@@ -854,7 +858,7 @@ LANG_SANSKRIT,
#endif
0,0,
},
-{"sd","sindhi",0,&charset[0],0,
+{"sd","sindhi",0,&lc_charsets[0],0,
#ifdef LANG_SINDHI
LANG_SINDHI,
#else
@@ -862,7 +866,7 @@ LANG_SINDHI,
#endif
0,0,
},
-{"sg","sangro",0,&charset[0],0,
+{"sg","sangro",0,&lc_charsets[0],0,
#ifdef LANG_SANGRO
LANG_SANGRO,
#else
@@ -870,7 +874,7 @@ LANG_SANGRO,
#endif
0,0,
},
-{"sh","serbo-croatian",0,&charset[0],0,
+{"sh","serbo-croatian",0,&lc_charsets[0],0,
#ifdef LANG_SERBO_CROATIAN
LANG_SERBO_CROATIAN,
#else
@@ -878,7 +882,7 @@ LANG_SERBO_CROATIAN,
#endif
0,0,
},
-{"si","singhalese",0,&charset[0],0,
+{"si","singhalese",0,&lc_charsets[0],0,
#ifdef LANG_SINGHALESE
LANG_SINGHALESE,
#else
@@ -886,7 +890,7 @@ LANG_SINGHALESE,
#endif
0,0,
},
-{"sk","slovak","slk|slo",&charset[1],0,
+{"sk","slovak","slk|slo",&lc_charsets[1],0,
#ifdef LANG_SLOVAK
LANG_SLOVAK,
#else
@@ -894,7 +898,7 @@ LANG_SLOVAK,
#endif
0,0,
},
-{"sl","slovenian","slv",&charset[1],0,
+{"sl","slovenian","slv",&lc_charsets[1],0,
#ifdef LANG_SLOVENIAN
LANG_SLOVENIAN,
#else
@@ -902,7 +906,7 @@ LANG_SLOVENIAN,
#endif
0,0,
},
-{"sm","samoan",0,&charset[0],0,
+{"sm","samoan",0,&lc_charsets[0],0,
#ifdef LANG_SAMOAN
LANG_SAMOAN,
#else
@@ -910,7 +914,7 @@ LANG_SAMOAN,
#endif
0,0,
},
-{"sn","shona",0,&charset[0],0,
+{"sn","shona",0,&lc_charsets[0],0,
#ifdef LANG_SHONA
LANG_SHONA,
#else
@@ -918,7 +922,7 @@ LANG_SHONA,
#endif
0,0,
},
-{"so","somali",0,&charset[0],0,
+{"so","somali",0,&lc_charsets[0],0,
#ifdef LANG_SOMALI
LANG_SOMALI,
#else
@@ -926,7 +930,7 @@ LANG_SOMALI,
#endif
0,0,
},
-{"sq","albanian","sqi|alb",&charset[0],0,
+{"sq","albanian","sqi|alb",&lc_charsets[0],0,
#ifdef LANG_ALBANIAN
LANG_ALBANIAN,
#else
@@ -934,7 +938,7 @@ LANG_ALBANIAN,
#endif
0,0,
},
-{"sr","serbian","srp",&charset[1],0,
+{"sr","serbian","srp",&lc_charsets[1],0,
#ifdef LANG_SERBIAN
LANG_SERBIAN,
#else
@@ -942,7 +946,7 @@ LANG_SERBIAN,
#endif
0,0,
},
-{"ss","siswati",0,&charset[0],0,
+{"ss","siswati",0,&lc_charsets[0],0,
#ifdef LANG_SISWATI
LANG_SISWATI,
#else
@@ -950,7 +954,7 @@ LANG_SISWATI,
#endif
0,0,
},
-{"st","sesotho",0,&charset[0],0,
+{"st","sesotho",0,&lc_charsets[0],0,
#ifdef LANG_SESOTHO
LANG_SESOTHO,
#else
@@ -958,7 +962,7 @@ LANG_SESOTHO,
#endif
0,0,
},
-{"su","sudanese",0,&charset[0],0,
+{"su","sudanese",0,&lc_charsets[0],0,
#ifdef LANG_SUDANESE
LANG_SUDANESE,
#else
@@ -966,7 +970,7 @@ LANG_SUDANESE,
#endif
0,0,
},
-{"sv","swedish","swe",&charset[0],0,
+{"sv","swedish","swe",&lc_charsets[0],0,
#ifdef LANG_SWEDISH
LANG_SWEDISH,
#else
@@ -974,7 +978,7 @@ LANG_SWEDISH,
#endif
0,0,
},
-{"sw","swahili","swa",&charset[0],0,
+{"sw","swahili","swa",&lc_charsets[0],0,
#ifdef LANG_SWAHILI
LANG_SWAHILI,
#else
@@ -982,7 +986,7 @@ LANG_SWAHILI,
#endif
0,0,
},
-{"ta","tamil",0,&charset[0],0,
+{"ta","tamil",0,&lc_charsets[0],0,
#ifdef LANG_TAMIL
LANG_TAMIL,
#else
@@ -990,7 +994,7 @@ LANG_TAMIL,
#endif
0,0,
},
-{"te","telugu",0,&charset[0],0,
+{"te","telugu",0,&lc_charsets[0],0,
#ifdef LANG_TELUGU
LANG_TELUGU,
#else
@@ -998,7 +1002,7 @@ LANG_TELUGU,
#endif
0,0,
},
-{"tg","tajik",0,&charset[0],0,
+{"tg","tajik",0,&lc_charsets[0],0,
#ifdef LANG_TAJIK
LANG_TAJIK,
#else
@@ -1006,7 +1010,7 @@ LANG_TAJIK,
#endif
0,0,
},
-{"th","thai","tha",&charset[0],0,
+{"th","thai","tha",&lc_charsets[0],0,
#ifdef LANG_THAI
LANG_THAI,
#else
@@ -1014,7 +1018,7 @@ LANG_THAI,
#endif
0,0,
},
-{"ti","tigrinya",0,&charset[0],0,
+{"ti","tigrinya",0,&lc_charsets[0],0,
#ifdef LANG_TIGRINYA
LANG_TIGRINYA,
#else
@@ -1022,7 +1026,7 @@ LANG_TIGRINYA,
#endif
0,0,
},
-{"tk","turkmen",0,&charset[0],0,
+{"tk","turkmen",0,&lc_charsets[0],0,
#ifdef LANG_TURKMEN
LANG_TURKMEN,
#else
@@ -1030,7 +1034,7 @@ LANG_TURKMEN,
#endif
0,0,
},
-{"tl","tagalog",0,&charset[0],0,
+{"tl","tagalog",0,&lc_charsets[0],0,
#ifdef LANG_TAGALOG
LANG_TAGALOG,
#else
@@ -1038,7 +1042,7 @@ LANG_TAGALOG,
#endif
0,0,
},
-{"tn","setswana",0,&charset[0],0,
+{"tn","setswana",0,&lc_charsets[0],0,
#ifdef LANG_SETSWANA
LANG_SETSWANA,
#else
@@ -1046,7 +1050,7 @@ LANG_SETSWANA,
#endif
0,0,
},
-{"to","tonga",0,&charset[0],0,
+{"to","tonga",0,&lc_charsets[0],0,
#ifdef LANG_TONGA
LANG_TONGA,
#else
@@ -1054,7 +1058,7 @@ LANG_TONGA,
#endif
0,0,
},
-{"tr","turkish","tur",&charset[8],0,
+{"tr","turkish","tur",&lc_charsets[8],0,
#ifdef LANG_TURKISH
LANG_TURKISH,
#else
@@ -1062,7 +1066,7 @@ LANG_TURKISH,
#endif
0,0,
},
-{"ts","tsonga",0,&charset[0],0,
+{"ts","tsonga",0,&lc_charsets[0],0,
#ifdef LANG_TSONGA
LANG_TSONGA,
#else
@@ -1070,7 +1074,7 @@ LANG_TSONGA,
#endif
0,0,
},
-{"tt","tatar","tat",&charset[0],0,
+{"tt","tatar","tat",&lc_charsets[0],0,
#ifdef LANG_TATAR
LANG_TATAR,
#else
@@ -1078,7 +1082,7 @@ LANG_TATAR,
#endif
0,0,
},
-{"tw","chinese-traditional","cht",&charset[0],0,
+{"tw","chinese-traditional","cht",&lc_charsets[0],0,
#ifdef LANG_CHINESE_TRADITIONAL
LANG_CHINESE_TRADITIONAL,
#else
@@ -1086,7 +1090,7 @@ LANG_CHINESE_TRADITIONAL,
#endif
0,0,
},
-{"uk","ukrainian","ukr",&charset[4],0,
+{"uk","ukrainian","ukr",&lc_charsets[4],0,
#ifdef LANG_UKRAINIAN
LANG_UKRAINIAN,
#else
@@ -1094,7 +1098,7 @@ LANG_UKRAINIAN,
#endif
0,0,
},
-{"ur","urdu",0,&charset[0],0,
+{"ur","urdu",0,&lc_charsets[0],0,
#ifdef LANG_URDU
LANG_URDU,
#else
@@ -1102,7 +1106,7 @@ LANG_URDU,
#endif
0,0,
},
-{"uz","uzbek","uzb",&charset[0],0,
+{"uz","uzbek","uzb",&lc_charsets[0],0,
#ifdef LANG_UZBEK
LANG_UZBEK,
#else
@@ -1110,7 +1114,7 @@ LANG_UZBEK,
#endif
0,0,
},
-{"vi","vietnamese",0,&charset[0],0,
+{"vi","vietnamese",0,&lc_charsets[0],0,
#ifdef LANG_VIETNAMESE
LANG_VIETNAMESE,
#else
@@ -1118,7 +1122,7 @@ LANG_VIETNAMESE,
#endif
0,0,
},
-{"vo","volapuk",0,&charset[0],0,
+{"vo","volapuk",0,&lc_charsets[0],0,
#ifdef LANG_VOLAPUK
LANG_VOLAPUK,
#else
@@ -1126,7 +1130,7 @@ LANG_VOLAPUK,
#endif
0,0,
},
-{"wo","wolof",0,&charset[0],0,
+{"wo","wolof",0,&lc_charsets[0],0,
#ifdef LANG_WOLOF
LANG_WOLOF,
#else
@@ -1134,7 +1138,7 @@ LANG_WOLOF,
#endif
0,0,
},
-{"xh","xhosa",0,&charset[0],0,
+{"xh","xhosa",0,&lc_charsets[0],0,
#ifdef LANG_XHOSA
LANG_XHOSA,
#else
@@ -1142,7 +1146,7 @@ LANG_XHOSA,
#endif
0,0,
},
-{"yo","yoruba",0,&charset[0],0,
+{"yo","yoruba",0,&lc_charsets[0],0,
#ifdef LANG_YORUBA
LANG_YORUBA,
#else
@@ -1150,7 +1154,7 @@ LANG_YORUBA,
#endif
0,0,
},
-{"zh","chinese-simplified","zho|chi|chs",&charset[0],0,
+{"zh","chinese-simplified","zho|chi|chs",&lc_charsets[0],0,
#ifdef LANG_CHINESE_SIMPLIFIED
LANG_CHINESE_SIMPLIFIED,
#else
@@ -1158,7 +1162,7 @@ LANG_CHINESE_SIMPLIFIED,
#endif
0,0,
},
-{"zu","zulu",0,&charset[0],0,
+{"zu","zulu",0,&lc_charsets[0],0,
#ifdef LANG_ZULU
LANG_ZULU,
#else
@@ -1169,10 +1173,10 @@ LANG_ZULU,
0
};
-static const Lc_territory_t territory[] =
+const Lc_territory_t lc_territories[] =
{
-{"C","C",LC_default,0,&language[0],0,0,0,0,0,0,0,},
-{"debug","debug",LC_debug,0,&language[1],0,0,0,0,0,0,0,},
+{"C","C",LC_default,0,&lc_languages[0],0,0,0,0,0,0,0,},
+{"debug","debug",LC_debug,0,&lc_languages[1],0,0,0,0,0,0,0,},
{"al","albania",0,
#ifdef CTRY_ALBANIA
CTRY_ALBANIA,
@@ -1187,7 +1191,7 @@ CTRY_NETHERLANDS_ANTILLES,
#else
0,
#endif
-&language[86],0,0,0,
+&lc_languages[86],0,0,0,
#ifdef SUBLANG_DUTCH_NETHERLANDS_ANTILLES
SUBLANG_DUTCH_NETHERLANDS_ANTILLES,
#else
@@ -1201,7 +1205,7 @@ CTRY_ARGENTINA,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_ARGENTINA
SUBLANG_SPANISH_ARGENTINA,
#else
@@ -1215,7 +1219,7 @@ CTRY_AUSTRIA,
#else
0,
#endif
-&language[23],0,0,0,
+&lc_languages[23],0,0,0,
#ifdef SUBLANG_GERMAN_AUSTRIA
SUBLANG_GERMAN_AUSTRIA,
#else
@@ -1229,7 +1233,7 @@ CTRY_AUSTRALIA,
#else
0,
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_AUSTRALIA
SUBLANG_ENGLISH_AUSTRALIA,
#else
@@ -1251,7 +1255,7 @@ CTRY_BELGIUM,
#else
0,
#endif
-&language[86],&language[35],&language[23],0,
+&lc_languages[86],&lc_languages[35],&lc_languages[23],0,
#ifdef SUBLANG_DUTCH_BELGIUM
SUBLANG_DUTCH_BELGIUM,
#else
@@ -1277,7 +1281,7 @@ CTRY_BULGARIA,
#else
0,
#endif
-&language[12],0,0,0,
+&lc_languages[12],0,0,0,
#ifdef SUBLANG_BULGARIAN_BULGARIA
SUBLANG_BULGARIAN_BULGARIA,
#else
@@ -1291,7 +1295,7 @@ CTRY_BRUNEI_DARUSSALAM,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_BRUNEI_DARUSSALAM
SUBLANG_ARABIC_BRUNEI_DARUSSALAM,
#else
@@ -1305,7 +1309,7 @@ CTRY_BOLIVIA,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_BOLIVIA
SUBLANG_SPANISH_BOLIVIA,
#else
@@ -1319,7 +1323,7 @@ CTRY_BRAZIL,
#else
0,
#endif
-&language[95],0,0,0,
+&lc_languages[95],0,0,0,
#ifdef SUBLANG_PORTUGUESE_BRAZIL
SUBLANG_PORTUGUESE_BRAZIL,
#else
@@ -1333,7 +1337,7 @@ CTRY_BOTSWANA,
#else
0,
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_BOTSWANA
SUBLANG_ENGLISH_BOTSWANA,
#else
@@ -1347,7 +1351,7 @@ CTRY_BELARUS,
#else
0,
#endif
-&language[100],0,0,0,
+&lc_languages[100],0,0,0,
#ifdef SUBLANG_RUSSIAN_BELARUS
SUBLANG_RUSSIAN_BELARUS,
#else
@@ -1361,7 +1365,7 @@ CTRY_BELIZE,
#else
0,
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_BELIZE
SUBLANG_ENGLISH_BELIZE,
#else
@@ -1375,7 +1379,7 @@ CTRY_CANADA,
#else
0,
#endif
-&language[26],&language[35],0,0,
+&lc_languages[26],&lc_languages[35],0,0,
#ifdef SUBLANG_ENGLISH_CANADA
SUBLANG_ENGLISH_CANADA,
#else
@@ -1395,7 +1399,7 @@ CTRY_SWITZERLAND,
#else
0,
#endif
-&language[35],&language[23],&language[54],0,
+&lc_languages[35],&lc_languages[23],&lc_languages[54],0,
#ifdef SUBLANG_FRENCH_SWITZERLAND
SUBLANG_FRENCH_SWITZERLAND,
#else
@@ -1421,7 +1425,7 @@ CTRY_CHILE,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_CHILE
SUBLANG_SPANISH_CHILE,
#else
@@ -1435,7 +1439,7 @@ CTRY_CHINA,
#else
0,
#endif
-&language[140],0,0,0,
+&lc_languages[140],0,0,0,
#ifdef SUBLANG_CHINESE_SIMPLIFIED_CHINA
SUBLANG_CHINESE_SIMPLIFIED_CHINA,
#else
@@ -1449,7 +1453,7 @@ CTRY_COLOMBIA,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_COLOMBIA
SUBLANG_SPANISH_COLOMBIA,
#else
@@ -1463,7 +1467,7 @@ CTRY_COSTA_RICA,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_COSTA_RICA
SUBLANG_SPANISH_COSTA_RICA,
#else
@@ -1477,7 +1481,7 @@ CTRY_CZECH_REPUBLIC,
#else
0,
#endif
-&language[20],0,0,0,
+&lc_languages[20],0,0,0,
#ifdef SUBLANG_CZECH_CZECH_REPUBLIC
SUBLANG_CZECH_CZECH_REPUBLIC,
#else
@@ -1491,7 +1495,7 @@ CTRY_GERMANY,
#else
0,
#endif
-&language[23],0,0,0,
+&lc_languages[23],0,0,0,
#ifdef SUBLANG_GERMAN_GERMANY
SUBLANG_GERMAN_GERMANY,
#else
@@ -1505,7 +1509,7 @@ CTRY_DENMARK,
#else
0,
#endif
-&language[22],&language[26],0,0,
+&lc_languages[22],&lc_languages[26],0,0,
#ifdef SUBLANG_DANISH_DENMARK
SUBLANG_DANISH_DENMARK,
#else
@@ -1525,7 +1529,7 @@ CTRY_DOMINICAN_REPUBLIC,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_DOMINICAN_REPUBLIC
SUBLANG_SPANISH_DOMINICAN_REPUBLIC,
#else
@@ -1547,7 +1551,7 @@ CTRY_ECUADOR,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_ECUADOR
SUBLANG_SPANISH_ECUADOR,
#else
@@ -1561,7 +1565,7 @@ CTRY_ESTONIA,
#else
0,
#endif
-&language[29],0,0,0,
+&lc_languages[29],0,0,0,
#ifdef SUBLANG_ESTONIAN_ESTONIA
SUBLANG_ESTONIAN_ESTONIA,
#else
@@ -1575,7 +1579,7 @@ CTRY_EGYPT,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_EGYPT
SUBLANG_ARABIC_EGYPT,
#else
@@ -1589,7 +1593,7 @@ CTRY_SPAIN,
#else
0,
#endif
-&language[28],&language[18],&language[30],&language[39],
+&lc_languages[28],&lc_languages[18],&lc_languages[30],&lc_languages[39],
#ifdef SUBLANG_SPANISH_SPAIN
SUBLANG_SPANISH_SPAIN,
#else
@@ -1621,7 +1625,7 @@ CTRY_FINLAND,
#else
0,
#endif
-&language[117],0,0,0,
+&lc_languages[117],0,0,0,
#ifdef SUBLANG_SWEDISH_FINLAND
SUBLANG_SWEDISH_FINLAND,
#else
@@ -1635,7 +1639,7 @@ CTRY_FAROE_ISLANDS,
#else
0,
#endif
-&language[34],0,0,0,
+&lc_languages[34],0,0,0,
#ifdef SUBLANG_FAEROESE_FAROE_ISLANDS
SUBLANG_FAEROESE_FAROE_ISLANDS,
#else
@@ -1649,7 +1653,7 @@ CTRY_FRANCE,
#else
0,
#endif
-&language[35],0,0,0,
+&lc_languages[35],0,0,0,
#ifdef SUBLANG_FRENCH_FRANCE
SUBLANG_FRENCH_FRANCE,
#else
@@ -1671,7 +1675,7 @@ CTRY_ENGLAND,
#endif
#endif
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_UNITED_KINGDOM
SUBLANG_ENGLISH_UNITED_KINGDOM,
#else
@@ -1693,7 +1697,7 @@ CTRY_GREENLAND,
#else
0,
#endif
-&language[61],0,0,0,
+&lc_languages[61],0,0,0,
#ifdef SUBLANG_GREENLANDIC_GREENLAND
SUBLANG_GREENLANDIC_GREENLAND,
#else
@@ -1707,7 +1711,7 @@ CTRY_GREECE,
#else
0,
#endif
-&language[25],0,0,0,
+&lc_languages[25],0,0,0,
#ifdef SUBLANG_GREEK_GREECE
SUBLANG_GREEK_GREECE,
#else
@@ -1721,7 +1725,7 @@ CTRY_GUATEMALA,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_GUATEMALA
SUBLANG_SPANISH_GUATEMALA,
#else
@@ -1735,7 +1739,7 @@ CTRY_HONG_KONG,
#else
0,
#endif
-&language[140],0,0,0,
+&lc_languages[140],0,0,0,
#ifdef SUBLANG_CHINESE_SIMPLIFIED_HONG_KONG
SUBLANG_CHINESE_SIMPLIFIED_HONG_KONG,
#else
@@ -1749,7 +1753,7 @@ CTRY_HONDURAS,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_HONDURAS
SUBLANG_SPANISH_HONDURAS,
#else
@@ -1763,7 +1767,7 @@ CTRY_CROATIA,
#else
0,
#endif
-&language[45],0,0,0,
+&lc_languages[45],0,0,0,
#ifdef SUBLANG_CROATIAN_CROATIA
SUBLANG_CROATIAN_CROATIA,
#else
@@ -1777,7 +1781,7 @@ CTRY_HUNGARY,
#else
0,
#endif
-&language[46],0,0,0,
+&lc_languages[46],0,0,0,
#ifdef SUBLANG_HUNGARIAN_HUNGARY
SUBLANG_HUNGARIAN_HUNGARY,
#else
@@ -1791,7 +1795,7 @@ CTRY_INDONESIA,
#else
0,
#endif
-&language[49],0,0,0,
+&lc_languages[49],0,0,0,
#ifdef SUBLANG_INDONESIAN_INDONESIA
SUBLANG_INDONESIAN_INDONESIA,
#else
@@ -1805,7 +1809,7 @@ CTRY_IRELAND,
#else
0,
#endif
-&language[26],&language[37],0,0,
+&lc_languages[26],&lc_languages[37],0,0,
#ifdef SUBLANG_ENGLISH_IRELAND
SUBLANG_ENGLISH_IRELAND,
#else
@@ -1825,7 +1829,7 @@ CTRY_ISRAEL,
#else
0,
#endif
-&language[43],0,0,0,
+&lc_languages[43],0,0,0,
#ifdef SUBLANG_HEBREW_ISRAEL
SUBLANG_HEBREW_ISRAEL,
#else
@@ -1839,7 +1843,7 @@ CTRY_IRAQ,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_IRAQ
SUBLANG_ARABIC_IRAQ,
#else
@@ -1853,7 +1857,7 @@ CTRY_ICELAND,
#else
0,
#endif
-&language[53],0,0,0,
+&lc_languages[53],0,0,0,
#ifdef SUBLANG_ICELANDIC_ICELAND
SUBLANG_ICELANDIC_ICELAND,
#else
@@ -1867,7 +1871,7 @@ CTRY_ITALY,
#else
0,
#endif
-&language[54],0,0,0,
+&lc_languages[54],0,0,0,
#ifdef SUBLANG_ITALIAN_ITALY
SUBLANG_ITALIAN_ITALY,
#else
@@ -1881,7 +1885,7 @@ CTRY_JAMAICA,
#else
0,
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_JAMAICA
SUBLANG_ENGLISH_JAMAICA,
#else
@@ -1895,7 +1899,7 @@ CTRY_JORDAN,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_JORDAN
SUBLANG_ARABIC_JORDAN,
#else
@@ -1909,7 +1913,7 @@ CTRY_JAPAN,
#else
0,
#endif
-&language[56],0,0,0,
+&lc_languages[56],0,0,0,
#ifdef SUBLANG_JAPANESE_JAPAN
SUBLANG_JAPANESE_JAPAN,
#else
@@ -1931,7 +1935,7 @@ CTRY_SOUTH_KOREA,
#else
0,
#endif
-&language[64],0,0,0,
+&lc_languages[64],0,0,0,
#ifdef SUBLANG_KOREAN_SOUTH_KOREA
SUBLANG_KOREAN_SOUTH_KOREA,
#else
@@ -1945,7 +1949,7 @@ CTRY_KUWAIT,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_KUWAIT
SUBLANG_ARABIC_KUWAIT,
#else
@@ -1959,7 +1963,7 @@ CTRY_LEBANON,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_LEBANON
SUBLANG_ARABIC_LEBANON,
#else
@@ -1973,7 +1977,7 @@ CTRY_LIECHTENSTEIN,
#else
0,
#endif
-&language[23],&language[35],0,0,
+&lc_languages[23],&lc_languages[35],0,0,
#ifdef SUBLANG_GERMAN_LIECHTENSTEIN
SUBLANG_GERMAN_LIECHTENSTEIN,
#else
@@ -1993,7 +1997,7 @@ CTRY_LITHUANIA,
#else
0,
#endif
-&language[71],0,0,0,
+&lc_languages[71],0,0,0,
#ifdef SUBLANG_LITHUANIAN_LITHUANIA
SUBLANG_LITHUANIAN_LITHUANIA,
#else
@@ -2007,7 +2011,7 @@ CTRY_LUXEMBOURG,
#else
0,
#endif
-&language[23],&language[35],0,0,
+&lc_languages[23],&lc_languages[35],0,0,
#ifdef SUBLANG_GERMAN_LUXEMBOURG
SUBLANG_GERMAN_LUXEMBOURG,
#else
@@ -2027,7 +2031,7 @@ CTRY_LATVIA,
#else
0,
#endif
-&language[72],0,0,0,
+&lc_languages[72],0,0,0,
#ifdef SUBLANG_LATVIAN_LATVIA
SUBLANG_LATVIAN_LATVIA,
#else
@@ -2041,7 +2045,7 @@ CTRY_LIBYA,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_LIBYA
SUBLANG_ARABIC_LIBYA,
#else
@@ -2055,7 +2059,7 @@ CTRY_MOROCCO,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_MOROCCO
SUBLANG_ARABIC_MOROCCO,
#else
@@ -2069,7 +2073,7 @@ CTRY_MACEDONIA,
#else
0,
#endif
-&language[75],0,0,0,
+&lc_languages[75],0,0,0,
#ifdef SUBLANG_MACEDONIAN_MACEDONIA
SUBLANG_MACEDONIAN_MACEDONIA,
#else
@@ -2083,7 +2087,7 @@ CTRY_MACAU,
#else
0,
#endif
-&language[140],0,0,0,
+&lc_languages[140],0,0,0,
#ifdef SUBLANG_CHINESE_SIMPLIFIED_MACAU
SUBLANG_CHINESE_SIMPLIFIED_MACAU,
#else
@@ -2097,7 +2101,7 @@ CTRY_MEXICO,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_MEXICO
SUBLANG_SPANISH_MEXICO,
#else
@@ -2119,7 +2123,7 @@ CTRY_NICARAGUA,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_NICARAGUA
SUBLANG_SPANISH_NICARAGUA,
#else
@@ -2133,7 +2137,7 @@ CTRY_NETHERLANDS,
#else
0,
#endif
-&language[86],0,0,0,
+&lc_languages[86],0,0,0,
#ifdef SUBLANG_DUTCH_NETHERLANDS
SUBLANG_DUTCH_NETHERLANDS,
#else
@@ -2147,7 +2151,7 @@ CTRY_NORWAY,
#else
0,
#endif
-&language[84],&language[88],&language[87],0,
+&lc_languages[84],&lc_languages[88],&lc_languages[87],0,
#ifdef SUBLANG_NORWEGIAN_BOKMAL_NORWAY
SUBLANG_NORWEGIAN_BOKMAL_NORWAY,
#else
@@ -2173,7 +2177,7 @@ CTRY_NEW_ZEALAND,
#else
0,
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_NEW_ZEALAND
SUBLANG_ENGLISH_NEW_ZEALAND,
#else
@@ -2187,7 +2191,7 @@ CTRY_OMAN,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_OMAN
SUBLANG_ARABIC_OMAN,
#else
@@ -2201,7 +2205,7 @@ CTRY_PANAMA,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_PANAMA
SUBLANG_SPANISH_PANAMA,
#else
@@ -2215,7 +2219,7 @@ CTRY_PERU,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_PERU
SUBLANG_SPANISH_PERU,
#else
@@ -2229,7 +2233,7 @@ CTRY_POLAND,
#else
0,
#endif
-&language[93],0,0,0,
+&lc_languages[93],0,0,0,
#ifdef SUBLANG_POLISH_POLAND
SUBLANG_POLISH_POLAND,
#else
@@ -2243,7 +2247,7 @@ CTRY_PUERTO_RICO,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_PUERTO_RICO
SUBLANG_SPANISH_PUERTO_RICO,
#else
@@ -2257,7 +2261,7 @@ CTRY_PORTUGAL,
#else
0,
#endif
-&language[95],0,0,0,
+&lc_languages[95],0,0,0,
#ifdef SUBLANG_PORTUGUESE_PORTUGAL
SUBLANG_PORTUGUESE_PORTUGAL,
#else
@@ -2271,7 +2275,7 @@ CTRY_PARAGUAY,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_PARAGUAY
SUBLANG_SPANISH_PARAGUAY,
#else
@@ -2285,7 +2289,7 @@ CTRY_ROMANIA,
#else
0,
#endif
-&language[99],0,0,0,
+&lc_languages[99],0,0,0,
#ifdef SUBLANG_ROMANIAN_ROMANIA
SUBLANG_ROMANIAN_ROMANIA,
#else
@@ -2299,7 +2303,7 @@ CTRY_RUSSIA,
#else
0,
#endif
-&language[100],0,0,0,
+&lc_languages[100],0,0,0,
#ifdef SUBLANG_RUSSIAN_RUSSIA
SUBLANG_RUSSIAN_RUSSIA,
#else
@@ -2313,7 +2317,7 @@ CTRY_SAUDI_ARABIA,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_SAUDI_ARABIA
SUBLANG_ARABIC_SAUDI_ARABIA,
#else
@@ -2327,7 +2331,7 @@ CTRY_SWEDEN,
#else
0,
#endif
-&language[117],0,0,0,
+&lc_languages[117],0,0,0,
#ifdef SUBLANG_SWEDISH_SWEDEN
SUBLANG_SWEDISH_SWEDEN,
#else
@@ -2341,7 +2345,7 @@ CTRY_SINGAPORE,
#else
0,
#endif
-&language[140],0,0,0,
+&lc_languages[140],0,0,0,
#ifdef SUBLANG_CHINESE_SIMPLIFIED_SINGAPORE
SUBLANG_CHINESE_SIMPLIFIED_SINGAPORE,
#else
@@ -2355,7 +2359,7 @@ CTRY_SLOVENIA,
#else
0,
#endif
-&language[108],0,0,0,
+&lc_languages[108],0,0,0,
#ifdef SUBLANG_SLOVENIAN_SLOVENIA
SUBLANG_SLOVENIAN_SLOVENIA,
#else
@@ -2369,7 +2373,7 @@ CTRY_SLOVAKIA,
#else
0,
#endif
-&language[107],0,0,0,
+&lc_languages[107],0,0,0,
#ifdef SUBLANG_SLOVAK_SLOVAKIA
SUBLANG_SLOVAK_SLOVAKIA,
#else
@@ -2383,7 +2387,7 @@ CTRY_SERBIA,
#else
0,
#endif
-&language[113],0,0,0,
+&lc_languages[113],0,0,0,
#ifdef SUBLANG_SERBIAN_SERBIA
SUBLANG_SERBIAN_SERBIA,
#else
@@ -2397,7 +2401,7 @@ CTRY_EL_SALVADOR,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_EL_SALVADOR
SUBLANG_SPANISH_EL_SALVADOR,
#else
@@ -2411,7 +2415,7 @@ CTRY_SYRIA,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_SYRIA
SUBLANG_ARABIC_SYRIA,
#else
@@ -2425,7 +2429,7 @@ CTRY_THAILAND,
#else
0,
#endif
-&language[122],0,0,0,
+&lc_languages[122],0,0,0,
#ifdef SUBLANG_THAI_THAILAND
SUBLANG_THAI_THAILAND,
#else
@@ -2439,7 +2443,7 @@ CTRY_TUNISIA,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_TUNISIA
SUBLANG_ARABIC_TUNISIA,
#else
@@ -2453,7 +2457,7 @@ CTRY_TURKEY,
#else
0,
#endif
-&language[128],0,0,0,
+&lc_languages[128],0,0,0,
#ifdef SUBLANG_TURKISH_TURKEY
SUBLANG_TURKISH_TURKEY,
#else
@@ -2467,7 +2471,7 @@ CTRY_TRINIDAD_TOBAGO,
#else
0,
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_TRINIDAD_TOBAGO
SUBLANG_ENGLISH_TRINIDAD_TOBAGO,
#else
@@ -2481,7 +2485,7 @@ CTRY_TAIWAN,
#else
0,
#endif
-&language[131],0,0,0,
+&lc_languages[131],0,0,0,
#ifdef SUBLANG_CHINESE_TRADITIONAL_TAIWAN
SUBLANG_CHINESE_TRADITIONAL_TAIWAN,
#else
@@ -2495,7 +2499,7 @@ CTRY_UKRAINE,
#else
0,
#endif
-&language[132],&language[100],0,0,
+&lc_languages[132],&lc_languages[100],0,0,
#ifdef SUBLANG_UKRAINIAN_UKRAINE
SUBLANG_UKRAINIAN_UKRAINE,
#else
@@ -2515,7 +2519,7 @@ CTRY_UNITED_KINGDOM,
#else
0,
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_UNITED_KINGDOM
SUBLANG_ENGLISH_UNITED_KINGDOM,
#else
@@ -2533,7 +2537,7 @@ CTRY_USA,
0,
#endif
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_UNITED_STATES
SUBLANG_ENGLISH_UNITED_STATES,
#else
@@ -2551,7 +2555,7 @@ CTRY_URUGUAY,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_URUGUAY
SUBLANG_SPANISH_URUGUAY,
#else
@@ -2565,7 +2569,7 @@ CTRY_VENEZUELA,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_VENEZUELA
SUBLANG_SPANISH_VENEZUELA,
#else
@@ -2579,7 +2583,7 @@ CTRY_YUGOSLAVIA,
#else
0,
#endif
-&language[113],0,0,0,
+&lc_languages[113],0,0,0,
#ifdef SUBLANG_SERBIAN_YUGOSLAVIA
SUBLANG_SERBIAN_YUGOSLAVIA,
#else
@@ -2593,7 +2597,7 @@ CTRY_SOUTH_AFRICA,
#else
0,
#endif
-&language[4],0,0,0,
+&lc_languages[4],0,0,0,
#ifdef SUBLANG_AFRIKAANS_SOUTH_AFRICA
SUBLANG_AFRIKAANS_SOUTH_AFRICA,
#else
@@ -2607,7 +2611,7 @@ CTRY_ZIMBABWE,
#else
0,
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_ZIMBABWE
SUBLANG_ENGLISH_ZIMBABWE,
#else
@@ -2618,13 +2622,13 @@ SUBLANG_ENGLISH_ZIMBABWE,
0
};
-static const Lc_map_t map[] =
+const Lc_map_t lc_maps[] =
{
-{"enu",&language[26],&territory[93],&charset[0],0},
-{"enz",&language[26],&territory[68],&charset[0],0},
-{"esm",&language[28],&territory[63],&charset[0],0},
-{"esn",&language[28],&territory[30],&charset[0],&attribute_es[1]},
-{"esp",&language[28],&territory[30],&charset[0],&attribute_es[0]},
-{"usa",&language[26],&territory[93],&charset[0],0},
+{"enu",&lc_languages[26],&lc_territories[93],&lc_charsets[0],0},
+{"enz",&lc_languages[26],&lc_territories[68],&lc_charsets[0],0},
+{"esm",&lc_languages[28],&lc_territories[63],&lc_charsets[0],0},
+{"esn",&lc_languages[28],&lc_territories[30],&lc_charsets[0],&attribute_es[1]},
+{"esp",&lc_languages[28],&lc_territories[30],&lc_charsets[0],&attribute_es[0]},
+{"usa",&lc_languages[26],&lc_territories[93],&lc_charsets[0],0},
0
};
diff --git a/usr/src/lib/libast/i386/src/lib/libast/preroot.h b/usr/src/lib/libast/i386/src/lib/libast/preroot.h
index 5180fe4be7..7215b1a074 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/preroot.h
+++ b/usr/src/lib/libast/i386/src/lib/libast/preroot.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/preroot.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/preroot.sh by iffe version 2008-01-31 : : */
#ifndef _def_preroot_ast
#define _def_preroot_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/i386/src/lib/libast/sig.h b/usr/src/lib/libast/i386/src/lib/libast/sig.h
index 32bdf7dd50..f187f7276d 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/sig.h
+++ b/usr/src/lib/libast/i386/src/lib/libast/sig.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/sig.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/sig.sh by iffe version 2008-01-31 : : */
#ifndef _def_sig_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
diff --git a/usr/src/lib/libast/i386/src/lib/libast/tmx.h b/usr/src/lib/libast/i386/src/lib/libast/tmx.h
index 567ee89369..a576776476 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/tmx.h
+++ b/usr/src/lib/libast/i386/src/lib/libast/tmx.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/tmx by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/tmx by iffe version 2008-01-31 : : */
#ifndef _TMX_H
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/i386/src/lib/libast/tv.h b/usr/src/lib/libast/i386/src/lib/libast/tv.h
index 272ec802d8..5e7b8ce3f4 100644
--- a/usr/src/lib/libast/i386/src/lib/libast/tv.h
+++ b/usr/src/lib/libast/i386/src/lib/libast/tv.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libast/features/tv by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libast/features/tv by iffe version 2008-01-31 : : */
#ifndef _TV_H
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/mapfile-vers b/usr/src/lib/libast/mapfile-vers
index 3d87a87a3b..42811eb440 100644
--- a/usr/src/lib/libast/mapfile-vers
+++ b/usr/src/lib/libast/mapfile-vers
@@ -23,8 +23,6 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
# functions
SUNWprivate_1.1 {
@@ -36,11 +34,11 @@ SUNWprivate_1.1 {
_Vmextern;
_Vmheap;
_ast___getdelim;
+ _ast__filbuf;
_ast_asprintf;
_ast_basename;
_ast_calloc;
_ast_catclose;
- _ast_categories;
_ast_catgets;
_ast_catopen;
_ast_cfree;
@@ -67,6 +65,7 @@ SUNWprivate_1.1 {
_ast_fgetwc;
_ast_fgetws;
_ast_fileno_unlocked;
+ _ast_flockfile;
_ast_fmemopen;
_ast_fnmatch;
_ast_fopen;
@@ -92,6 +91,7 @@ SUNWprivate_1.1 {
_ast_ftell;
_ast_ftello64;
_ast_ftello;
+ _ast_ftrylockfile;
_ast_fts_children;
_ast_fts_close;
_ast_fts_flags;
@@ -102,6 +102,7 @@ SUNWprivate_1.1 {
_ast_ftw;
_ast_ftwalk;
_ast_ftwflags;
+ _ast_funlockfile;
_ast_fwide;
_ast_fwprintf;
_ast_fwrite;
@@ -112,12 +113,14 @@ SUNWprivate_1.1 {
_ast_getcwd;
_ast_getdate;
_ast_getdelim;
+ _ast_getenv;
_ast_getline;
_ast_getopt;
_ast_getopt_long;
_ast_getopt_long_only;
_ast_getpgrp;
_ast_gets;
+ _ast_getsubopt;
_ast_getw;
_ast_getwc;
_ast_getwchar;
@@ -133,6 +136,12 @@ SUNWprivate_1.1 {
_ast_iconv_open;
_ast_iconv_write;
_ast_info;
+ _ast_intercepts;
+ _ast_lc_categories;
+ _ast_lc_charsets;
+ _ast_lc_languages;
+ _ast_lc_maps;
+ _ast_lc_territories;
_ast_localeconv;
_ast_locales;
_ast_malloc;
@@ -145,10 +154,15 @@ SUNWprivate_1.1 {
_ast_mktemp;
_ast_mktime;
_ast_nftw;
+ _ast_optarg;
+ _ast_optctx;
+ _ast_opterr;
_ast_optesc;
_ast_optget;
_ast_opthelp;
+ _ast_optind;
_ast_optjoin;
+ _ast_optopt;
_ast_optstr;
_ast_optusage;
_ast_pathaccess;
@@ -178,7 +192,6 @@ SUNWprivate_1.1 {
_ast_procclose;
_ast_procfree;
_ast_procopen;
- _ast_procrun = NODIRECT; # Allow libshell to override
_ast_putc_unlocked;
_ast_putchar_unlocked;
_ast_putenv;
@@ -311,7 +324,6 @@ SUNWprivate_1.1 {
_ccmapcpy;
_ccmapstr;
_error_info_;
- _filbuf;
_fini;
_hash_info_;
_iblocks;
@@ -368,6 +380,7 @@ SUNWprivate_1.1 {
astconflist;
astcopy;
astgetconf;
+ astintercept;
astlicense;
astquery;
astwinsize;
@@ -435,7 +448,6 @@ SUNWprivate_1.1 {
fmtuid;
fmtversion;
fs3d;
- getsubopt;
hashalloc;
hashdone;
hashdump;
@@ -482,10 +494,6 @@ SUNWprivate_1.1 {
mntwrite;
modei;
modex;
- optarg;
- opterr;
- optind;
- optopt;
pvalloc;
recfmt;
reclen;
@@ -557,7 +565,6 @@ SUNWprivate_1.1 {
sfsscanf;
sfstack;
sfstacked;
- sfstrtmp;
sfswap;
sfsync;
sftell;
diff --git a/usr/src/lib/libast/sparc/Makefile b/usr/src/lib/libast/sparc/Makefile
index 7ca62b2d77..63d22de006 100644
--- a/usr/src/lib/libast/sparc/Makefile
+++ b/usr/src/lib/libast/sparc/Makefile
@@ -18,12 +18,12 @@
#
# CDDL HEADER END
#
+
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
+
# Platform-specific config
# Note that "HOSTTYPE" matches the value used by AT&T upstream.
@@ -31,7 +31,8 @@ ASTPLATFORMCPPFLAGS = '-DHOSTTYPE="sol$(RELEASE_MINOR).sun4"'
# platform-specific sources
OBJECTS = \
- sparc/src/lib/libast/conftab.o
+ sparc/src/lib/libast/conftab.o \
+ sparc/src/lib/libast/lctab.o
OBJDIRS = \
sparc/src/lib/libast
diff --git a/usr/src/lib/libast/sparc/include/ast/align.h b/usr/src/lib/libast/sparc/include/ast/align.h
index 2d8d7edd3d..55df32793a 100644
--- a/usr/src/lib/libast/sparc/include/ast/align.h
+++ b/usr/src/lib/libast/sparc/include/ast/align.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/align.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/align.c by iffe version 2008-01-31 : : */
#ifndef _def_align_ast
#define _def_align_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/include/ast/ast.h b/usr/src/lib/libast/sparc/include/ast/ast.h
index ea1569f946..f5335ae8a2 100644
--- a/usr/src/lib/libast/sparc/include/ast/ast.h
+++ b/usr/src/lib/libast/sparc/include/ast/ast.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -333,7 +333,9 @@ extern __MANGLE__ double strntod __PROTO__((const char*, size_t, char**));
extern __MANGLE__ _ast_fltmax_t strntold __PROTO__((const char*, size_t, char**));
extern __MANGLE__ long strntol __PROTO__((const char*, size_t, char**, int));
extern __MANGLE__ intmax_t strntoll __PROTO__((const char*, size_t, char**, int));
+extern __MANGLE__ long strnton __PROTO__((const char*, size_t, char**, char*, int));
extern __MANGLE__ unsigned long strntoul __PROTO__((const char*, size_t, char**, int));
+extern __MANGLE__ intmax_t strntonll __PROTO__((const char*, size_t, char**, char*, int));
extern __MANGLE__ uintmax_t strntoull __PROTO__((const char*, size_t, char**, int));
extern __MANGLE__ int stropt __PROTO__((const char*, const __V_*, int, int(*)(__V_*, const __V_*, int, const char*), __V_*));
extern __MANGLE__ int strperm __PROTO__((const char*, char**, int));
diff --git a/usr/src/lib/libast/sparc/include/ast/ast_botch.h b/usr/src/lib/libast/sparc/include/ast/ast_botch.h
index 5109e1ce1c..b7532f9e98 100644
--- a/usr/src/lib/libast/sparc/include/ast/ast_botch.h
+++ b/usr/src/lib/libast/sparc/include/ast/ast_botch.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/botch.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/botch.c by iffe version 2008-01-31 : : */
#ifndef _def_botch_ast
#define _def_botch_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/include/ast/ast_ccode.h b/usr/src/lib/libast/sparc/include/ast/ast_ccode.h
index c42fb2d6c7..fefe5cc7b0 100644
--- a/usr/src/lib/libast/sparc/include/ast/ast_ccode.h
+++ b/usr/src/lib/libast/sparc/include/ast/ast_ccode.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/ccode by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/ccode by iffe version 2008-01-31 : : */
#ifndef _def_ccode_ast
#define _def_ccode_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/include/ast/ast_common.h b/usr/src/lib/libast/sparc/include/ast/ast_common.h
index a74cd0efdf..2da0ae6e58 100644
--- a/usr/src/lib/libast/sparc/include/ast/ast_common.h
+++ b/usr/src/lib/libast/sparc/include/ast/ast_common.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/common by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/common by iffe version 2008-01-31 : : */
#ifndef _AST_COMMON_H
#define _AST_COMMON_H 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/include/ast/ast_dir.h b/usr/src/lib/libast/sparc/include/ast/ast_dir.h
index 336b7f38a6..a402906410 100644
--- a/usr/src/lib/libast/sparc/include/ast/ast_dir.h
+++ b/usr/src/lib/libast/sparc/include/ast/ast_dir.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/ast_dirent.h b/usr/src/lib/libast/sparc/include/ast/ast_dirent.h
index 08cebaf71a..805c02da9a 100644
--- a/usr/src/lib/libast/sparc/include/ast/ast_dirent.h
+++ b/usr/src/lib/libast/sparc/include/ast/ast_dirent.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/dirent by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/dirent by iffe version 2008-01-31 : : */
#ifndef _def_dirent_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparc/include/ast/ast_fcntl.h b/usr/src/lib/libast/sparc/include/ast/ast_fcntl.h
index 81b9c10bdf..05e75c6ba8 100644
--- a/usr/src/lib/libast/sparc/include/ast/ast_fcntl.h
+++ b/usr/src/lib/libast/sparc/include/ast/ast_fcntl.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/fcntl.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/fcntl.c by iffe version 2008-01-31 : : */
#ifndef _def_fcntl_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
diff --git a/usr/src/lib/libast/sparc/include/ast/ast_float.h b/usr/src/lib/libast/sparc/include/ast/ast_float.h
index c6cf96cce5..9e377ab4c1 100644
--- a/usr/src/lib/libast/sparc/include/ast/ast_float.h
+++ b/usr/src/lib/libast/sparc/include/ast/ast_float.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/float by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/float by iffe version 2008-01-31 : : */
#ifndef _def_float_ast
#if !defined(__PROTO__)
@@ -89,13 +89,16 @@
#define _hdr_math 1 /* #include <math.h> ok */
#define _hdr_values 1 /* #include <values.h> ok */
#define _LIB_m 1 /* -lm is a library */
+#define _lib_fpclassify 1 /* fpclassify() in default lib(s) */
#define _lib_frexp 1 /* frexp() in default lib(s) */
#define _lib_frexpl 1 /* frexpl() in default lib(s) */
#define _lib_ldexp 1 /* ldexp() in default lib(s) */
#define _lib_ldexpl 1 /* ldexpl() in default lib(s) */
#define _lib_finite 1 /* finite() in default lib(s) */
+#define _lib_isinf 1 /* isinf() in default lib(s) */
#define _lib_isnan 1 /* isnan() in default lib(s) */
#define _lib_isnanl 1 /* isnanl() in default lib(s) */
+#define _lib_signbit 1 /* signbit() in default lib(s) */
#define _lib_copysign 1 /* copysign() in default lib(s) */
#define _lib_copysignl 1 /* copysignl() in default lib(s) */
#include <ast_common.h>
diff --git a/usr/src/lib/libast/sparc/include/ast/ast_fs.h b/usr/src/lib/libast/sparc/include/ast/ast_fs.h
index af7984f100..6038294501 100644
--- a/usr/src/lib/libast/sparc/include/ast/ast_fs.h
+++ b/usr/src/lib/libast/sparc/include/ast/ast_fs.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/fs by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/fs by iffe version 2008-01-31 : : */
#ifndef _def_fs_ast
#if !defined(__PROTO__)
@@ -89,20 +89,9 @@
#define _lib_mknod 1 /* mknod() in default lib(s) */
#define _lib_sync 1 /* sync() in default lib(s) */
#include <sys/stat.h>
+#include <sys/mkdev.h>
#define FS_default "ufs"
#if defined(__STDPP__directive) && defined(__STDPP__initial)
-__STDPP__directive pragma pp:initial
-#endif
-#ifndef major
-#define major(x) ( major_t ) ( ( ( ( unsigned ) ( ( x ) ) ) >> 8 ) & 0x7f )
-#endif
-#ifndef minor
-#define minor(x) ( minor_t ) ( ( ( x ) ) & 0xff )
-#endif
-#ifndef makedev
-#define makedev(x,y) ( unsigned short ) ( ( ( ( x ) ) << 8 ) | ( ( ( y ) ) & 0xff ) )
-#endif
-#if defined(__STDPP__directive) && defined(__STDPP__initial)
__STDPP__directive pragma pp:noinitial
#endif
#define _hdr_stdio 1 /* #include <stdio.h> ok */
diff --git a/usr/src/lib/libast/sparc/include/ast/ast_getopt.h b/usr/src/lib/libast/sparc/include/ast/ast_getopt.h
index 0de85c6172..060c18a246 100644
--- a/usr/src/lib/libast/sparc/include/ast/ast_getopt.h
+++ b/usr/src/lib/libast/sparc/include/ast/ast_getopt.h
@@ -1,39 +1,17 @@
/* : : generated by proto : : */
-/***********************************************************************
-* *
-* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
-* and is licensed under the *
-* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
-* *
-* A copy of the License is available at *
-* http://www.opensource.org/licenses/cpl1.0.txt *
-* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
-* *
-* Information and Software Systems Research *
-* AT&T Research *
-* Florham Park NJ *
-* *
-* Glenn Fowler <gsf@research.att.com> *
-* David Korn <dgk@research.att.com> *
-* Phong Vo <kpv@research.att.com> *
-* *
-***********************************************************************/
-
-/*
- * legacy standard getopt interface
- */
-#ifndef _AST_GETOPT_H
#if !defined(__PROTO__)
#include <prototyped.h>
#endif
#if !defined(__LINKAGE__)
#define __LINKAGE__ /* 2004-08-11 transition */
#endif
-
+#ifdef _AST_STD_I
+#undef _AST_GETOPT_H
+#define _AST_GETOPT_H -1
+#endif
+#ifndef _AST_GETOPT_H
#define _AST_GETOPT_H 1
extern __MANGLE__ int opterr;
diff --git a/usr/src/lib/libast/sparc/include/ast/ast_iconv.h b/usr/src/lib/libast/sparc/include/ast/ast_iconv.h
index b064ed1706..a9ff7e8408 100644
--- a/usr/src/lib/libast/sparc/include/ast/ast_iconv.h
+++ b/usr/src/lib/libast/sparc/include/ast/ast_iconv.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/iconv by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/iconv by iffe version 2008-01-31 : : */
#ifndef _def_iconv_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparc/include/ast/ast_lib.h b/usr/src/lib/libast/sparc/include/ast/ast_lib.h
index b0ba266538..9a9e784ad9 100644
--- a/usr/src/lib/libast/sparc/include/ast/ast_lib.h
+++ b/usr/src/lib/libast/sparc/include/ast/ast_lib.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/lib by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/lib by iffe version 2008-01-31 : : */
#ifndef _def_lib_ast
#define _def_lib_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/include/ast/ast_limits.h b/usr/src/lib/libast/sparc/include/ast/ast_limits.h
index 3a8a7804d8..937534cc0d 100644
--- a/usr/src/lib/libast/sparc/include/ast/ast_limits.h
+++ b/usr/src/lib/libast/sparc/include/ast/ast_limits.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/limits.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/limits.c by iffe version 2008-01-31 : : */
#ifndef _def_limits_ast
#define _def_limits_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/include/ast/ast_map.h b/usr/src/lib/libast/sparc/include/ast/ast_map.h
index 247eba135d..225d5afb03 100644
--- a/usr/src/lib/libast/sparc/include/ast/ast_map.h
+++ b/usr/src/lib/libast/sparc/include/ast/ast_map.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/map.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/map.c by iffe version 2008-01-31 : : */
#ifndef _def_map_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
@@ -142,6 +142,14 @@ extern __MANGLE__ char* getcwd __PROTO__((char*, size_t));
#define getopt_long _ast_getopt_long
#undef getopt_long_only
#define getopt_long_only _ast_getopt_long_only
+#undef optopt
+#define optopt _ast_optopt
+#undef optarg
+#define optarg _ast_optarg
+#undef optind
+#define optind _ast_optind
+#undef opterr
+#define opterr _ast_opterr
#undef getwd
#define getwd _ast_getwd
extern __MANGLE__ char* getwd __PROTO__((char*));
@@ -167,6 +175,8 @@ extern __MANGLE__ char* mktemp __PROTO__((char*));
#define mktime _ast_mktime
#undef nftw
#define nftw _ast_nftw
+#undef optctx
+#define optctx _ast_optctx
#undef optesc
#define optesc _ast_optesc
#undef optget
@@ -295,7 +305,7 @@ extern __MANGLE__ char* realpath __PROTO__((const char*, char*));
extern __MANGLE__ int remove __PROTO__((const char*));
#undef resolvepath
#define resolvepath _ast_resolvepath
-extern __MANGLE__ char* resolvepath __PROTO__((const char*, char*, size_t));
+extern __MANGLE__ int resolvepath __PROTO__((const char*, char*, size_t));
#undef setenv
#define setenv _ast_setenv
extern __MANGLE__ int setenv __PROTO__((const char*, const char*, int));
diff --git a/usr/src/lib/libast/sparc/include/ast/ast_mmap.h b/usr/src/lib/libast/sparc/include/ast/ast_mmap.h
index 01528ff7cc..34b939995a 100644
--- a/usr/src/lib/libast/sparc/include/ast/ast_mmap.h
+++ b/usr/src/lib/libast/sparc/include/ast/ast_mmap.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/mmap by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/mmap by iffe version 2008-01-31 : : */
#ifndef _def_mmap_ast
#define _def_mmap_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
@@ -28,6 +28,7 @@
#define _lib_mmap64 1 /* mmap64 interface and implementation work */
#define _mmap_anon 1 /* use mmap MAP_ANON to get raw memory */
#define _mmap_devzero 1 /* use mmap on /dev/zero to get raw memory */
+#define _mmap_worthy 1 /* mmap is good */
/* some systems get it wrong but escape concise detection */
#ifndef _NO_MMAP
diff --git a/usr/src/lib/libast/sparc/include/ast/ast_mode.h b/usr/src/lib/libast/sparc/include/ast/ast_mode.h
index 90b763b151..fe2d6c8bea 100644
--- a/usr/src/lib/libast/sparc/include/ast/ast_mode.h
+++ b/usr/src/lib/libast/sparc/include/ast/ast_mode.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/mode.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/mode.c by iffe version 2008-01-31 : : */
#ifndef _def_mode_ast
#define _def_mode_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/include/ast/ast_namval.h b/usr/src/lib/libast/sparc/include/ast/ast_namval.h
new file mode 100644
index 0000000000..4c9b12f480
--- /dev/null
+++ b/usr/src/lib/libast/sparc/include/ast/ast_namval.h
@@ -0,0 +1,51 @@
+
+/* : : generated by proto : : */
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* David Korn <dgk@research.att.com> *
+* Phong Vo <kpv@research.att.com> *
+* *
+***********************************************************************/
+
+/*
+ * Glenn Fowler
+ * AT&T Research
+ *
+ * common name-value struct support
+ */
+
+#ifndef _NAMVAL_H
+#if !defined(__PROTO__)
+#include <prototyped.h>
+#endif
+#if !defined(__LINKAGE__)
+#define __LINKAGE__ /* 2004-08-11 transition */
+#endif
+
+#define _NAMVAL_H
+
+typedef struct
+{
+ char* name;
+ int value;
+#ifdef _NAMVAL_PRIVATE_
+ _NAMVAL_PRIVATE_
+#endif
+} Namval_t;
+
+#endif
diff --git a/usr/src/lib/libast/sparc/include/ast/ast_ndbm.h b/usr/src/lib/libast/sparc/include/ast/ast_ndbm.h
new file mode 100644
index 0000000000..48ca492dd4
--- /dev/null
+++ b/usr/src/lib/libast/sparc/include/ast/ast_ndbm.h
@@ -0,0 +1,30 @@
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* David Korn <dgk@research.att.com> *
+* Phong Vo <kpv@research.att.com> *
+* *
+***********************************************************************/
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/ndbm by iffe version 2008-01-31 : : */
+#ifndef _def_ndbm_ast
+#define _def_ndbm_ast 1
+#define _sys_types 1 /* #include <sys/types.h> ok */
+#define _hdr_ndbm 1 /* #include <ndbm.h> ok */
+#include <ndbm.h>
+#define _use_ndbm 1
+
+#endif
diff --git a/usr/src/lib/libast/sparc/include/ast/ast_nl_types.h b/usr/src/lib/libast/sparc/include/ast/ast_nl_types.h
index 15e008c056..a7d7d12172 100644
--- a/usr/src/lib/libast/sparc/include/ast/ast_nl_types.h
+++ b/usr/src/lib/libast/sparc/include/ast/ast_nl_types.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/nl_types by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/nl_types by iffe version 2008-01-31 : : */
#ifndef _def_nl_types_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparc/include/ast/ast_param.h b/usr/src/lib/libast/sparc/include/ast/ast_param.h
index 810684662f..da001d829f 100644
--- a/usr/src/lib/libast/sparc/include/ast/ast_param.h
+++ b/usr/src/lib/libast/sparc/include/ast/ast_param.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/param.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/param.sh by iffe version 2008-01-31 : : */
#ifndef _def_param_ast
#define _def_param_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/include/ast/ast_standards.h b/usr/src/lib/libast/sparc/include/ast/ast_standards.h
index 3571b54431..5a697fc0da 100644
--- a/usr/src/lib/libast/sparc/include/ast/ast_standards.h
+++ b/usr/src/lib/libast/sparc/include/ast/ast_standards.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/standards by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/standards by iffe version 2008-01-31 : : */
#ifndef _def_standards_ast
#define _def_standards_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/include/ast/ast_std.h b/usr/src/lib/libast/sparc/include/ast/ast_std.h
index 68e7984670..4f3f3dd9da 100644
--- a/usr/src/lib/libast/sparc/include/ast/ast_std.h
+++ b/usr/src/lib/libast/sparc/include/ast/ast_std.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -117,16 +117,24 @@ struct lconv
#define __MANGLE__ __LINKAGE__ __EXPORT__
#endif
+#undef getenv
+#define getenv _ast_getenv
+
#undef localeconv
#define localeconv _ast_localeconv
#undef setlocale
#define setlocale _ast_setlocale
+#undef setenviron
+#define setenviron _ast_setenviron
+
#undef strerror
#define strerror _ast_strerror
+extern __MANGLE__ char* getenv __PROTO__((const char*));
extern __MANGLE__ struct lconv* localeconv __PROTO__((void));
+extern __MANGLE__ char* setenviron __PROTO__((const char*));
extern __MANGLE__ char* setlocale __PROTO__((int, const char*));
extern __MANGLE__ char* strerror __PROTO__((int));
@@ -335,6 +343,16 @@ extern __MANGLE__ int _ast_getpgrp __PROTO__((void));
#undef _AST_STD_I
+#if _AST_GETOPT_H < 0
+#undef _AST_GETOPT_H
+#include <ast_getopt.h>
+#endif
+
+#if _GETOPT_H < 0
+#undef _GETOPT_H
+#include <getopt.h>
+#endif
+
#if _REGEX_H < 0
#undef _REGEX_H
#include <regex.h>
diff --git a/usr/src/lib/libast/sparc/include/ast/ast_stdio.h b/usr/src/lib/libast/sparc/include/ast/ast_stdio.h
index 3e85be0e7e..7ee7ac581b 100644
--- a/usr/src/lib/libast/sparc/include/ast/ast_stdio.h
+++ b/usr/src/lib/libast/sparc/include/ast/ast_stdio.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/stdio by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/stdio by iffe version 2008-01-31 : : */
#ifndef _SFSTDIO_H
#if !defined(__PROTO__)
@@ -199,7 +199,7 @@ extern __MANGLE__ int fprintf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fpurge __PROTO__((FILE*));
extern __MANGLE__ int fputc __PROTO__((int, FILE*));
extern __MANGLE__ int fputs __PROTO__((const char*, FILE*));
-extern __MANGLE__ ssize_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
extern __MANGLE__ FILE* freopen __PROTO__((const char*, const char*, FILE*));
extern __MANGLE__ int fscanf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fseek __PROTO__((FILE*, long, int));
@@ -207,7 +207,7 @@ extern __MANGLE__ int fseeko __PROTO__((FILE*, off_t, int));
extern __MANGLE__ int fsetpos __PROTO__((FILE*, const fpos_t*));
extern __MANGLE__ long ftell __PROTO__((FILE*));
extern __MANGLE__ off_t ftello __PROTO__((FILE*));
-extern __MANGLE__ ssize_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
extern __MANGLE__ int getc __PROTO__((FILE*));
extern __MANGLE__ int getchar __PROTO__((void));
extern __MANGLE__ char* gets __PROTO__((char*));
@@ -266,6 +266,10 @@ extern __MANGLE__ int getchar_unlocked __PROTO__((void));
extern __MANGLE__ int putc_unlocked __PROTO__((int, FILE*));
extern __MANGLE__ int putchar_unlocked __PROTO__((int));
+extern __MANGLE__ void flockfile __PROTO__((FILE*));
+extern __MANGLE__ int ftrylockfile __PROTO__((FILE*));
+extern __MANGLE__ void funlockfile __PROTO__((FILE*));
+
#ifdef _USE_GNU
extern __MANGLE__ int fcloseall __PROTO__((void));
@@ -345,6 +349,7 @@ extern __MANGLE__ ssize_t getline __PROTO__((char**, size_t*, FILE*));
#define vsprintf _ast_vsprintf
#define vsscanf _ast_vsscanf
#define fcloseall _ast_fcloseall
+#define _filbuf _ast__filbuf
#define fmemopen _ast_fmemopen
#define __getdelim _ast___getdelim
#define getdelim _ast_getdelim
@@ -364,6 +369,9 @@ extern __MANGLE__ ssize_t getline __PROTO__((char**, size_t*, FILE*));
#define getchar_unlocked _ast_getchar_unlocked
#define putc_unlocked _ast_putc_unlocked
#define putchar_unlocked _ast_putchar_unlocked
+#define flockfile _ast_flockfile
+#define ftrylockfile _ast_ftrylockfile
+#define funlockfile _ast_funlockfile
#if defined(__STDPP__directive) && defined(__STDPP__initial)
__STDPP__directive pragma pp:initial
@@ -423,7 +431,7 @@ extern __MANGLE__ int fprintf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fpurge __PROTO__((FILE*));
extern __MANGLE__ int fputc __PROTO__((int, FILE*));
extern __MANGLE__ int fputs __PROTO__((const char*, FILE*));
-extern __MANGLE__ ssize_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
extern __MANGLE__ FILE* freopen __PROTO__((const char*, const char*, FILE*));
extern __MANGLE__ int fscanf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fseek __PROTO__((FILE*, long, int));
@@ -431,7 +439,7 @@ extern __MANGLE__ int fseeko __PROTO__((FILE*, off_t, int));
extern __MANGLE__ int fsetpos __PROTO__((FILE*, const fpos_t*));
extern __MANGLE__ long ftell __PROTO__((FILE*));
extern __MANGLE__ off_t ftello __PROTO__((FILE*));
-extern __MANGLE__ ssize_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
extern __MANGLE__ int getc __PROTO__((FILE*));
extern __MANGLE__ int getchar __PROTO__((void));
extern __MANGLE__ char* gets __PROTO__((char*));
diff --git a/usr/src/lib/libast/sparc/include/ast/ast_sys.h b/usr/src/lib/libast/sparc/include/ast/ast_sys.h
index eb8ae4221f..10898b74de 100644
--- a/usr/src/lib/libast/sparc/include/ast/ast_sys.h
+++ b/usr/src/lib/libast/sparc/include/ast/ast_sys.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/sys by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/sys by iffe version 2008-01-31 : : */
#ifndef _AST_SYS_H
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparc/include/ast/ast_time.h b/usr/src/lib/libast/sparc/include/ast/ast_time.h
index 1171a4e1b5..7d491b9d03 100644
--- a/usr/src/lib/libast/sparc/include/ast/ast_time.h
+++ b/usr/src/lib/libast/sparc/include/ast/ast_time.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/time by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/time by iffe version 2008-01-31 : : */
#ifndef _def_time_ast
#if !defined(__PROTO__)
@@ -97,7 +97,7 @@
#include <sys/times.h>
-#ifndef CLOCKS_PER_SEC
+#if !defined(CLOCKS_PER_SEC) && defined(CLK_TCK)
#define CLOCKS_PER_SEC CLK_TCK
#endif
diff --git a/usr/src/lib/libast/sparc/include/ast/ast_tty.h b/usr/src/lib/libast/sparc/include/ast/ast_tty.h
index 430c3305c4..ca02a68486 100644
--- a/usr/src/lib/libast/sparc/include/ast/ast_tty.h
+++ b/usr/src/lib/libast/sparc/include/ast/ast_tty.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/tty by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/tty by iffe version 2008-01-31 : : */
#ifndef _def_tty_ast
#define _def_tty_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/include/ast/ast_version.h b/usr/src/lib/libast/sparc/include/ast/ast_version.h
index 0e586f9555..5882fbd2a5 100644
--- a/usr/src/lib/libast/sparc/include/ast/ast_version.h
+++ b/usr/src/lib/libast/sparc/include/ast/ast_version.h
@@ -7,4 +7,4 @@
#if !defined(__LINKAGE__)
#define __LINKAGE__ /* 2004-08-11 transition */
#endif
-#define _AST_VERSION 20061111L
+#define _AST_VERSION 20080910L
diff --git a/usr/src/lib/libast/sparc/include/ast/ast_vfork.h b/usr/src/lib/libast/sparc/include/ast/ast_vfork.h
index 24e96c3105..545cc84ef9 100644
--- a/usr/src/lib/libast/sparc/include/ast/ast_vfork.h
+++ b/usr/src/lib/libast/sparc/include/ast/ast_vfork.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/vfork by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/vfork by iffe version 2008-01-31 : : */
#ifndef _def_vfork_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparc/include/ast/ast_wait.h b/usr/src/lib/libast/sparc/include/ast/ast_wait.h
index f875aa1ad5..c0d9128eb7 100644
--- a/usr/src/lib/libast/sparc/include/ast/ast_wait.h
+++ b/usr/src/lib/libast/sparc/include/ast/ast_wait.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/wait by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/wait by iffe version 2008-01-31 : : */
#ifndef _def_wait_ast
#define _def_wait_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/include/ast/ast_wchar.h b/usr/src/lib/libast/sparc/include/ast/ast_wchar.h
index d637e9e18a..ff10eeffa4 100644
--- a/usr/src/lib/libast/sparc/include/ast/ast_wchar.h
+++ b/usr/src/lib/libast/sparc/include/ast/ast_wchar.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/wchar by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/wchar by iffe version 2008-01-31 : : */
#ifndef _def_wchar_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparc/include/ast/ast_windows.h b/usr/src/lib/libast/sparc/include/ast/ast_windows.h
index 90e0260f59..b329b2d2f5 100644
--- a/usr/src/lib/libast/sparc/include/ast/ast_windows.h
+++ b/usr/src/lib/libast/sparc/include/ast/ast_windows.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/bytesex.h b/usr/src/lib/libast/sparc/include/ast/bytesex.h
index 2bf2022afb..95c43e160d 100644
--- a/usr/src/lib/libast/sparc/include/ast/bytesex.h
+++ b/usr/src/lib/libast/sparc/include/ast/bytesex.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/ccode.h b/usr/src/lib/libast/sparc/include/ast/ccode.h
index d26926ebc4..70c8d76471 100644
--- a/usr/src/lib/libast/sparc/include/ast/ccode.h
+++ b/usr/src/lib/libast/sparc/include/ast/ccode.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/cdt.h b/usr/src/lib/libast/sparc/include/ast/cdt.h
index f6274cef92..3dc5b7b7f8 100644
--- a/usr/src/lib/libast/sparc/include/ast/cdt.h
+++ b/usr/src/lib/libast/sparc/include/ast/cdt.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/debug.h b/usr/src/lib/libast/sparc/include/ast/debug.h
index ad7ecb7a54..565212e93b 100644
--- a/usr/src/lib/libast/sparc/include/ast/debug.h
+++ b/usr/src/lib/libast/sparc/include/ast/debug.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -40,14 +40,50 @@
#include <ast.h>
#include <error.h>
+#if !defined(DEBUG) && _BLD_DEBUG
+#define DEBUG _BLD_DEBUG
+#endif
+
#if DEBUG || _BLD_DEBUG
+
#define debug(x) x
#define message(x) do if (error_info.trace < 0) { error x; } while (0)
#define messagef(x) do if (error_info.trace < 0) { errorf x; } while (0)
+
+#define DEBUG_BEGTIME() debug_elapsed(1)
+#define DEBUG_GETTIME() debug_elapsed(0)
+#define DEBUG_ASSERT(p) ((p) ? 0 : (debug_fatal(__FILE__, __LINE__),0))
+#define DEBUG_COUNT(n) ((n) += 1)
+#define DEBUG_TALLY(c,n,v) ((c) ? ((n) += (v)) : (n))
+#define DEBUG_DECLARE(t,v) t v
+#define DEBUG_SET(n,v) ((n) = (v))
+#define DEBUG_PRINT(fd,s,v) do {char _b[1024];write(fd,_b,sfsprintf(_b,sizeof(_b),s,v));} while(0)
+#define DEBUG_WRITE(fd,d,n) write((fd),(d),(n))
+#define DEBUG_TEMP(temp) (temp) /* debugging stuff that should be removed */
+#define DEBUG_RETURN(x) (debug_fatal(__FILE__, __LINE__), (x))
+#define DEBUG_BREAK (debug_fatal(__FILE__, __LINE__))
+#define DEBUG_GOTO(label) do { debug_fatal(__FILE__, __LINE__); goto label; } while(0)
+
#else
+
#define debug(x)
#define message(x)
#define messagef(x)
+
+#define DEBUG_BEGTIME()
+#define DEBUG_GETTIME()
+#define DEBUG_ASSERT(p)
+#define DEBUG_COUNT(n)
+#define DEBUG_TALLY(c,n,v)
+#define DEBUG_DECLARE(t,v)
+#define DEBUG_SET(n,v)
+#define DEBUG_PRINT(fd,s,v)
+#define DEBUG_WRITE(fd,d,n)
+#define DEBUG_KPV(x)
+#define DEBUG_RETURN(x) return(x)
+#define DEBUG_BREAK break
+#define DEBUG_GOTO(label) goto label
+
#endif
#if _BLD_ast && defined(__EXPORT__)
@@ -55,6 +91,8 @@
#define __MANGLE__ __LINKAGE__ __EXPORT__
#endif
+extern __MANGLE__ double debug_elapsed __PROTO__((int));
+extern __MANGLE__ void debug_fatal __PROTO__((const char*, int));
extern __MANGLE__ void systrace __PROTO__((const char*));
#undef __MANGLE__
diff --git a/usr/src/lib/libast/sparc/include/ast/dirent.h b/usr/src/lib/libast/sparc/include/ast/dirent.h
index 32f33800b5..b94f22215f 100644
--- a/usr/src/lib/libast/sparc/include/ast/dirent.h
+++ b/usr/src/lib/libast/sparc/include/ast/dirent.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/dt.h b/usr/src/lib/libast/sparc/include/ast/dt.h
index 0b7c331577..12299246bb 100644
--- a/usr/src/lib/libast/sparc/include/ast/dt.h
+++ b/usr/src/lib/libast/sparc/include/ast/dt.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/endian.h b/usr/src/lib/libast/sparc/include/ast/endian.h
index 2299b5a3bc..12539254b6 100644
--- a/usr/src/lib/libast/sparc/include/ast/endian.h
+++ b/usr/src/lib/libast/sparc/include/ast/endian.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/error.h b/usr/src/lib/libast/sparc/include/ast/error.h
index d6d171a15e..1cb01835f7 100644
--- a/usr/src/lib/libast/sparc/include/ast/error.h
+++ b/usr/src/lib/libast/sparc/include/ast/error.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/find.h b/usr/src/lib/libast/sparc/include/ast/find.h
index 0caf2019cf..c094791a30 100644
--- a/usr/src/lib/libast/sparc/include/ast/find.h
+++ b/usr/src/lib/libast/sparc/include/ast/find.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/fnmatch.h b/usr/src/lib/libast/sparc/include/ast/fnmatch.h
index 83e2dd9943..56c7dd7dce 100644
--- a/usr/src/lib/libast/sparc/include/ast/fnmatch.h
+++ b/usr/src/lib/libast/sparc/include/ast/fnmatch.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/fnv.h b/usr/src/lib/libast/sparc/include/ast/fnv.h
index 6af5c1489c..badccc3071 100644
--- a/usr/src/lib/libast/sparc/include/ast/fnv.h
+++ b/usr/src/lib/libast/sparc/include/ast/fnv.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/fs3d.h b/usr/src/lib/libast/sparc/include/ast/fs3d.h
index a16099d7ae..a52478f85c 100644
--- a/usr/src/lib/libast/sparc/include/ast/fs3d.h
+++ b/usr/src/lib/libast/sparc/include/ast/fs3d.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/fts.h b/usr/src/lib/libast/sparc/include/ast/fts.h
index 081fe2a712..a8ce187391 100644
--- a/usr/src/lib/libast/sparc/include/ast/fts.h
+++ b/usr/src/lib/libast/sparc/include/ast/fts.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -127,6 +127,10 @@ struct Ftsent
#ifdef _FTSENT_PRIVATE_
_FTSENT_PRIVATE_
+#else
+ short _fts_pad_1; /* <ftwalk.h> compatibility */
+ struct stat _fts_pad_2; /* <ftwalk.h> compatibility */
+ FTS* fts; /* fts_open() handle */
#endif
};
@@ -134,6 +138,7 @@ struct Ftsent
struct Fts
{
int fts_errno; /* last errno */
+ __V_* fts_handle; /* user defined handle */
#ifdef _FTS_PRIVATE_
_FTS_PRIVATE_
@@ -149,6 +154,7 @@ struct Fts
extern __MANGLE__ FTSENT* fts_children __PROTO__((FTS*, int));
extern __MANGLE__ int fts_close __PROTO__((FTS*));
extern __MANGLE__ int fts_flags __PROTO__((void));
+extern __MANGLE__ int fts_local __PROTO__((FTSENT*));
extern __MANGLE__ int fts_notify __PROTO__((int(*)(FTS*, FTSENT*, __V_*), __V_*));
extern __MANGLE__ FTS* fts_open __PROTO__((char* const*, int, int(*)(FTSENT* const*, FTSENT* const*)));
extern __MANGLE__ FTSENT* fts_read __PROTO__((FTS*));
diff --git a/usr/src/lib/libast/sparc/include/ast/ftw.h b/usr/src/lib/libast/sparc/include/ast/ftw.h
index bd39851cbc..3d43cb2609 100644
--- a/usr/src/lib/libast/sparc/include/ast/ftw.h
+++ b/usr/src/lib/libast/sparc/include/ast/ftw.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/ftwalk.h b/usr/src/lib/libast/sparc/include/ast/ftwalk.h
index 1ee713a37a..7172b76565 100644
--- a/usr/src/lib/libast/sparc/include/ast/ftwalk.h
+++ b/usr/src/lib/libast/sparc/include/ast/ftwalk.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/getopt.h b/usr/src/lib/libast/sparc/include/ast/getopt.h
index 01348b6402..4ad28bbb01 100644
--- a/usr/src/lib/libast/sparc/include/ast/getopt.h
+++ b/usr/src/lib/libast/sparc/include/ast/getopt.h
@@ -7,12 +7,15 @@
#if !defined(__LINKAGE__)
#define __LINKAGE__ /* 2004-08-11 transition */
#endif
-#include <ast_getopt.h>
-
-#if !defined(_GETOPT_H) && !defined(_AST_STD_I)
+#ifdef _AST_STD_I
+#define _GETOPT_H -1
+#endif
+#ifndef _GETOPT_H
#define _GETOPT_H 1
+#include <ast_getopt.h>
+
#define no_argument 0
#define required_argument 1
#define optional_argument 2
diff --git a/usr/src/lib/libast/sparc/include/ast/glob.h b/usr/src/lib/libast/sparc/include/ast/glob.h
index e02733177d..62c420bb4f 100644
--- a/usr/src/lib/libast/sparc/include/ast/glob.h
+++ b/usr/src/lib/libast/sparc/include/ast/glob.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -77,8 +77,8 @@ struct _glob_
__V_* (*gl_diropen) __PROTO__((glob_t*, const char*));
char* (*gl_dirnext) __PROTO__((glob_t*, __V_*));
void (*gl_dirclose) __PROTO__((glob_t*, __V_*));
- int (*gl_type) __PROTO__((glob_t*, const char*));
- int (*gl_attr) __PROTO__((glob_t*, const char*));
+ int (*gl_type) __PROTO__((glob_t*, const char*, int));
+ int (*gl_attr) __PROTO__((glob_t*, const char*, int));
/* gnu extensions -- but how do you synthesize dirent and stat? */
diff --git a/usr/src/lib/libast/sparc/include/ast/hash.h b/usr/src/lib/libast/sparc/include/ast/hash.h
index 4050612983..3ad42981e3 100644
--- a/usr/src/lib/libast/sparc/include/ast/hash.h
+++ b/usr/src/lib/libast/sparc/include/ast/hash.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/hashkey.h b/usr/src/lib/libast/sparc/include/ast/hashkey.h
index 1ce051ff26..ac0557f6df 100644
--- a/usr/src/lib/libast/sparc/include/ast/hashkey.h
+++ b/usr/src/lib/libast/sparc/include/ast/hashkey.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/hashpart.h b/usr/src/lib/libast/sparc/include/ast/hashpart.h
index b2aa79649a..90f2be5c31 100644
--- a/usr/src/lib/libast/sparc/include/ast/hashpart.h
+++ b/usr/src/lib/libast/sparc/include/ast/hashpart.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/iconv.h b/usr/src/lib/libast/sparc/include/ast/iconv.h
index e63b3f0fcd..58bc8240d2 100644
--- a/usr/src/lib/libast/sparc/include/ast/iconv.h
+++ b/usr/src/lib/libast/sparc/include/ast/iconv.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/ip6.h b/usr/src/lib/libast/sparc/include/ast/ip6.h
new file mode 100644
index 0000000000..2712064a7e
--- /dev/null
+++ b/usr/src/lib/libast/sparc/include/ast/ip6.h
@@ -0,0 +1,28 @@
+
+/* : : generated by proto : : */
+
+#if !defined(__PROTO__)
+#include <prototyped.h>
+#endif
+#if !defined(__LINKAGE__)
+#define __LINKAGE__ /* 2004-08-11 transition */
+#endif
+#if !_IP6_H
+#define _IP6_H 1
+
+#define IP6ADDR 16
+#define IP6BITS IP6ADDR
+#define IP6PREFIX (IP6ADDR+1)
+
+#if _BLD_ast && defined(__EXPORT__)
+#undef __MANGLE__
+#define __MANGLE__ __LINKAGE__ __EXPORT__
+#endif
+
+extern __MANGLE__ char* fmtip6 __PROTO__((unsigned char*, int));
+extern __MANGLE__ int strtoip6 __PROTO__((const char*, char**, unsigned char*, unsigned char*));
+
+#undef __MANGLE__
+#define __MANGLE__ __LINKAGE__
+
+#endif
diff --git a/usr/src/lib/libast/sparc/include/ast/lc.h b/usr/src/lib/libast/sparc/include/ast/lc.h
index fdd804f36e..b225864bbc 100644
--- a/usr/src/lib/libast/sparc/include/ast/lc.h
+++ b/usr/src/lib/libast/sparc/include/ast/lc.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/ls.h b/usr/src/lib/libast/sparc/include/ast/ls.h
index cce1771b3f..b195c70e0c 100644
--- a/usr/src/lib/libast/sparc/include/ast/ls.h
+++ b/usr/src/lib/libast/sparc/include/ast/ls.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/magic.h b/usr/src/lib/libast/sparc/include/ast/magic.h
index f484f2b20d..cf3c0fdcb8 100644
--- a/usr/src/lib/libast/sparc/include/ast/magic.h
+++ b/usr/src/lib/libast/sparc/include/ast/magic.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/magicid.h b/usr/src/lib/libast/sparc/include/ast/magicid.h
index ceadff2653..66507d4d0b 100644
--- a/usr/src/lib/libast/sparc/include/ast/magicid.h
+++ b/usr/src/lib/libast/sparc/include/ast/magicid.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/mc.h b/usr/src/lib/libast/sparc/include/ast/mc.h
index 4b55665b3b..be15276038 100644
--- a/usr/src/lib/libast/sparc/include/ast/mc.h
+++ b/usr/src/lib/libast/sparc/include/ast/mc.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/mime.h b/usr/src/lib/libast/sparc/include/ast/mime.h
index b018b68c9a..c214a31130 100644
--- a/usr/src/lib/libast/sparc/include/ast/mime.h
+++ b/usr/src/lib/libast/sparc/include/ast/mime.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/mnt.h b/usr/src/lib/libast/sparc/include/ast/mnt.h
index d877416642..ddce19fc9d 100644
--- a/usr/src/lib/libast/sparc/include/ast/mnt.h
+++ b/usr/src/lib/libast/sparc/include/ast/mnt.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/modecanon.h b/usr/src/lib/libast/sparc/include/ast/modecanon.h
index ce107238e3..f207540d5b 100644
--- a/usr/src/lib/libast/sparc/include/ast/modecanon.h
+++ b/usr/src/lib/libast/sparc/include/ast/modecanon.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/modex.h b/usr/src/lib/libast/sparc/include/ast/modex.h
index 458ad18ac1..96971e347b 100644
--- a/usr/src/lib/libast/sparc/include/ast/modex.h
+++ b/usr/src/lib/libast/sparc/include/ast/modex.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/namval.h b/usr/src/lib/libast/sparc/include/ast/namval.h
index d746970d58..4c9b12f480 100644
--- a/usr/src/lib/libast/sparc/include/ast/namval.h
+++ b/usr/src/lib/libast/sparc/include/ast/namval.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/nl_types.h b/usr/src/lib/libast/sparc/include/ast/nl_types.h
index db7383c626..36c901d8ed 100644
--- a/usr/src/lib/libast/sparc/include/ast/nl_types.h
+++ b/usr/src/lib/libast/sparc/include/ast/nl_types.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/option.h b/usr/src/lib/libast/sparc/include/ast/option.h
index 7204047891..0cb1ca74c5 100644
--- a/usr/src/lib/libast/sparc/include/ast/option.h
+++ b/usr/src/lib/libast/sparc/include/ast/option.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -112,6 +112,7 @@ extern __MANGLE__ char* opthelp __PROTO__((const char*, const char*));
extern __MANGLE__ char* optusage __PROTO__((const char*));
extern __MANGLE__ int optstr __PROTO__((const char*, const char*));
extern __MANGLE__ int optesc __PROTO__((Sfio_t*, const char*, int));
+extern __MANGLE__ Opt_t* optctx __PROTO__((Opt_t*, Opt_t*));
#undef __MANGLE__
#define __MANGLE__ __LINKAGE__
diff --git a/usr/src/lib/libast/sparc/include/ast/preroot.h b/usr/src/lib/libast/sparc/include/ast/preroot.h
index 0c4a92fe4d..b183ce7a8d 100644
--- a/usr/src/lib/libast/sparc/include/ast/preroot.h
+++ b/usr/src/lib/libast/sparc/include/ast/preroot.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/preroot.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/preroot.sh by iffe version 2008-01-31 : : */
#ifndef _def_preroot_ast
#define _def_preroot_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/include/ast/proc.h b/usr/src/lib/libast/sparc/include/ast/proc.h
index 1196fc5b3f..2bfa576970 100644
--- a/usr/src/lib/libast/sparc/include/ast/proc.h
+++ b/usr/src/lib/libast/sparc/include/ast/proc.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -41,12 +41,14 @@
#define PROC_ARGMOD (1<<0) /* argv[-1],argv[0] can be modified */
#define PROC_BACKGROUND (1<<1) /* shell background (&) setup */
+#define PROC_CHECK (1<<17) /* check that command exists */
#define PROC_CLEANUP (1<<2) /* close parent redirect fds on error */
#define PROC_DAEMON (1<<3) /* daemon setup */
#define PROC_ENVCLEAR (1<<4) /* clear environment */
#define PROC_FOREGROUND (1<<14) /* system(3) setup */
#define PROC_GID (1<<5) /* setgid(getgid()) */
#define PROC_IGNORE (1<<6) /* ignore parent pipe errors */
+#define PROC_IGNOREPATH (1<<16) /* procrun() intercept to ignore path */
#define PROC_OVERLAY (1<<7) /* overlay current process if possible */
#define PROC_PARANOID (1<<8) /* restrict everything */
#define PROC_PRIVELEGED (1<<9) /* setuid(0), setgid(getegid()) */
@@ -104,8 +106,8 @@ _PROC_PRIVATE_
extern __MANGLE__ int procclose __PROTO__((Proc_t*));
extern __MANGLE__ int procfree __PROTO__((Proc_t*));
-extern __MANGLE__ Proc_t* procopen __PROTO__((const char*, char**, char**, long*, long));
-extern __MANGLE__ int procrun __PROTO__((const char*, char**));
+extern __MANGLE__ Proc_t* procopen __PROTO__((const char*, char**, char**, long*, int));
+extern __MANGLE__ int procrun __PROTO__((const char*, char**, int));
#undef __MANGLE__
#define __MANGLE__ __LINKAGE__
diff --git a/usr/src/lib/libast/sparc/include/ast/re_comp.h b/usr/src/lib/libast/sparc/include/ast/re_comp.h
index 5da565e880..381bc801fc 100644
--- a/usr/src/lib/libast/sparc/include/ast/re_comp.h
+++ b/usr/src/lib/libast/sparc/include/ast/re_comp.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/recfmt.h b/usr/src/lib/libast/sparc/include/ast/recfmt.h
index 1a66761ec2..133e37da41 100644
--- a/usr/src/lib/libast/sparc/include/ast/recfmt.h
+++ b/usr/src/lib/libast/sparc/include/ast/recfmt.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/regexp.h b/usr/src/lib/libast/sparc/include/ast/regexp.h
index b7f3ed6313..e1c6258b3e 100644
--- a/usr/src/lib/libast/sparc/include/ast/regexp.h
+++ b/usr/src/lib/libast/sparc/include/ast/regexp.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/sfdisc.h b/usr/src/lib/libast/sparc/include/ast/sfdisc.h
index 9e657f045b..5303d9a62e 100644
--- a/usr/src/lib/libast/sparc/include/ast/sfdisc.h
+++ b/usr/src/lib/libast/sparc/include/ast/sfdisc.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/sfio.h b/usr/src/lib/libast/sparc/include/ast/sfio.h
index 9feba3043e..11317dad65 100644
--- a/usr/src/lib/libast/sparc/include/ast/sfio.h
+++ b/usr/src/lib/libast/sparc/include/ast/sfio.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -22,7 +22,7 @@
#ifndef _SFIO_H
#define _SFIO_H 1
-#define SFIO_VERSION 20050202L
+#define SFIO_VERSION 20080717L
/* Public header file for the sfio library
**
@@ -181,6 +181,7 @@ struct _sffmt_s
/* for the notify function and discipline exception */
#define SF_NEW 0 /* new stream */
#define SF_SETFD (-1) /* about to set the file descriptor */
+#define SF_MTACCESS (-2) /* starting a multi-threaded stream */
#define SF_BUFSIZE 8192 /* default buffer size */
#define SF_UNBOUND (-1) /* unbounded buffer size */
@@ -240,7 +241,7 @@ extern int sfclrlock _ARG_((Sfio_t*));
extern Void_t* sfsetbuf _ARG_((Sfio_t*, Void_t*, size_t));
extern Sfdisc_t* sfdisc _ARG_((Sfio_t*,Sfdisc_t*));
extern int sfraise _ARG_((Sfio_t*, int, Void_t*));
-extern int sfnotify _ARG_((void(*)(Sfio_t*, int, int)));
+extern int sfnotify _ARG_((void(*)(Sfio_t*, int, void*)));
extern int sfset _ARG_((Sfio_t*, int, int));
extern int sfsetfd _ARG_((Sfio_t*, int));
extern Sfio_t* sfpool _ARG_((Sfio_t*, Sfio_t*, int));
diff --git a/usr/src/lib/libast/sparc/include/ast/sfio_s.h b/usr/src/lib/libast/sparc/include/ast/sfio_s.h
index 27936a16b1..19a23d4772 100644
--- a/usr/src/lib/libast/sparc/include/ast/sfio_s.h
+++ b/usr/src/lib/libast/sparc/include/ast/sfio_s.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/sfio_t.h b/usr/src/lib/libast/sparc/include/ast/sfio_t.h
index 36be6ecc94..c5251d3f34 100644
--- a/usr/src/lib/libast/sparc/include/ast/sfio_t.h
+++ b/usr/src/lib/libast/sparc/include/ast/sfio_t.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/shcmd.h b/usr/src/lib/libast/sparc/include/ast/shcmd.h
new file mode 100644
index 0000000000..14e282a3d0
--- /dev/null
+++ b/usr/src/lib/libast/sparc/include/ast/shcmd.h
@@ -0,0 +1,103 @@
+
+/* : : generated by proto : : */
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* David Korn <dgk@research.att.com> *
+* Phong Vo <kpv@research.att.com> *
+* *
+***********************************************************************/
+
+
+/*
+ * ksh builtin command api
+ */
+
+#ifndef _SHCMD_H
+#if !defined(__PROTO__)
+#include <prototyped.h>
+#endif
+#if !defined(__LINKAGE__)
+#define __LINKAGE__ /* 2004-08-11 transition */
+#endif
+
+#define _SHCMD_H 1
+
+#ifndef SH_VERSION
+# define Shell_t void
+#endif
+#ifndef NV_DEFAULT
+# define Namval_t void
+#endif
+#ifndef ERROR_NOTIFY
+# define ERROR_NOTIFY 1
+#endif
+
+typedef int (*Shbltin_f) __PROTO__((int, char**, __V_*));
+
+#undef Shbltin_t
+typedef struct Shbltin_s
+{
+ Shell_t *shp;
+ __V_ *ptr;
+ int version;
+ int (*shrun) __PROTO__((int, char**));
+ int (*shtrap) __PROTO__((const char*, int));
+ void (*shexit) __PROTO__((int));
+ Namval_t *(*shbltin) __PROTO__((const char*, Shbltin_f, __V_*));
+ unsigned char notify;
+ unsigned char sigset;
+ unsigned char nosfio;
+ Namval_t *bnode;
+ Namval_t *vnode;
+ char *data;
+ int flags;
+ char *(*shgetenv) __PROTO__((const char*));
+ char *(*shsetenv) __PROTO__((const char*));
+ int invariant;
+} Shbltin_t;
+
+#if defined(SH_VERSION) || defined(_SH_PRIVATE)
+# undef Shell_t
+# undef Namval_t
+#else
+# define sh_run(c, ac, av) ((c)?(*((Shbltin_t*)(c))->shrun)(ac,av):-1)
+# define sh_system(c,str) ((c)?(*((Shbltin_t*)(c))->shtrap)(str,0):system(str))
+# define sh_exit(c,n) ((c)?(*((Shbltin_t*)(c))->shexit)(n):exit(n))
+# define sh_checksig(c) ((c) && ((Shbltin_t*)(c))->sigset)
+# if defined(SFIO_VERSION) || defined(_AST_H)
+# define LIB_INIT(c)
+# else
+# define LIB_INIT(c) ((c) && (((Shbltin_t*)(c))->nosfio = 1))
+# endif
+# ifndef _CMD_H
+# define cmdinit(ac,av,c,cat,flg) do { if((ac)<=0) return(0); \
+ (((Shbltin_t*)(c))->notify = ((flg)&ERROR_NOTIFY)?1:0);} while(0)
+# endif
+#endif
+
+#if _BLD_ast && defined(__EXPORT__)
+#undef __MANGLE__
+#define __MANGLE__ __LINKAGE__ __EXPORT__
+#endif
+
+extern __MANGLE__ int astintercept __PROTO__((Shbltin_t*, int));
+
+#undef __MANGLE__
+#define __MANGLE__ __LINKAGE__
+
+#endif
diff --git a/usr/src/lib/libast/sparc/include/ast/sig.h b/usr/src/lib/libast/sparc/include/ast/sig.h
index 3b09fd5f94..a154747b8c 100644
--- a/usr/src/lib/libast/sparc/include/ast/sig.h
+++ b/usr/src/lib/libast/sparc/include/ast/sig.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/sig.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/sig.sh by iffe version 2008-01-31 : : */
#ifndef _def_sig_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
diff --git a/usr/src/lib/libast/sparc/include/ast/stack.h b/usr/src/lib/libast/sparc/include/ast/stack.h
index ad32ebb8ab..5c55255f06 100644
--- a/usr/src/lib/libast/sparc/include/ast/stack.h
+++ b/usr/src/lib/libast/sparc/include/ast/stack.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/stak.h b/usr/src/lib/libast/sparc/include/ast/stak.h
index e0e707b0e5..321be20328 100644
--- a/usr/src/lib/libast/sparc/include/ast/stak.h
+++ b/usr/src/lib/libast/sparc/include/ast/stak.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/stdio.h b/usr/src/lib/libast/sparc/include/ast/stdio.h
index 7e137c5712..42d7ed8269 100644
--- a/usr/src/lib/libast/sparc/include/ast/stdio.h
+++ b/usr/src/lib/libast/sparc/include/ast/stdio.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/stk.h b/usr/src/lib/libast/sparc/include/ast/stk.h
index 24947d24f1..ef9a946ce0 100644
--- a/usr/src/lib/libast/sparc/include/ast/stk.h
+++ b/usr/src/lib/libast/sparc/include/ast/stk.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -84,6 +84,7 @@ extern __MANGLE__ char* stkcopy __PROTO__((Stk_t*,const char*));
extern __MANGLE__ char* stkset __PROTO__((Stk_t*, char*, unsigned));
extern __MANGLE__ char* _stkseek __PROTO__((Stk_t*, unsigned));
extern __MANGLE__ char* stkfreeze __PROTO__((Stk_t*, unsigned));
+extern __MANGLE__ int stkon __PROTO__((Stk_t*, char *));
#undef __MANGLE__
#define __MANGLE__ __LINKAGE__
diff --git a/usr/src/lib/libast/sparc/include/ast/swap.h b/usr/src/lib/libast/sparc/include/ast/swap.h
index d89248d12b..81e49db105 100644
--- a/usr/src/lib/libast/sparc/include/ast/swap.h
+++ b/usr/src/lib/libast/sparc/include/ast/swap.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/tar.h b/usr/src/lib/libast/sparc/include/ast/tar.h
index 910b6e8612..3a9a99b0ac 100644
--- a/usr/src/lib/libast/sparc/include/ast/tar.h
+++ b/usr/src/lib/libast/sparc/include/ast/tar.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/times.h b/usr/src/lib/libast/sparc/include/ast/times.h
index 25e81662be..1ed0f2135a 100644
--- a/usr/src/lib/libast/sparc/include/ast/times.h
+++ b/usr/src/lib/libast/sparc/include/ast/times.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/tm.h b/usr/src/lib/libast/sparc/include/ast/tm.h
index f790a9a66e..29c0d4f1fa 100644
--- a/usr/src/lib/libast/sparc/include/ast/tm.h
+++ b/usr/src/lib/libast/sparc/include/ast/tm.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/tmx.h b/usr/src/lib/libast/sparc/include/ast/tmx.h
index 9388396616..68d897dc15 100644
--- a/usr/src/lib/libast/sparc/include/ast/tmx.h
+++ b/usr/src/lib/libast/sparc/include/ast/tmx.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/tmx by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/tmx by iffe version 2008-01-31 : : */
#ifndef _TMX_H
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparc/include/ast/tok.h b/usr/src/lib/libast/sparc/include/ast/tok.h
index 3637489918..1d5112837c 100644
--- a/usr/src/lib/libast/sparc/include/ast/tok.h
+++ b/usr/src/lib/libast/sparc/include/ast/tok.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/tv.h b/usr/src/lib/libast/sparc/include/ast/tv.h
index 38633bccf2..85358a7d6c 100644
--- a/usr/src/lib/libast/sparc/include/ast/tv.h
+++ b/usr/src/lib/libast/sparc/include/ast/tv.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/tv by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/tv by iffe version 2008-01-31 : : */
#ifndef _TV_H
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparc/include/ast/usage.h b/usr/src/lib/libast/sparc/include/ast/usage.h
index 81b59e1aca..d969a0e4c1 100644
--- a/usr/src/lib/libast/sparc/include/ast/usage.h
+++ b/usr/src/lib/libast/sparc/include/ast/usage.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/vdb.h b/usr/src/lib/libast/sparc/include/ast/vdb.h
index 63e310c724..ba47e14901 100644
--- a/usr/src/lib/libast/sparc/include/ast/vdb.h
+++ b/usr/src/lib/libast/sparc/include/ast/vdb.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/vecargs.h b/usr/src/lib/libast/sparc/include/ast/vecargs.h
index 4d329cd154..121e9d5010 100644
--- a/usr/src/lib/libast/sparc/include/ast/vecargs.h
+++ b/usr/src/lib/libast/sparc/include/ast/vecargs.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/vmalloc.h b/usr/src/lib/libast/sparc/include/ast/vmalloc.h
index f0a8114c6a..8cf3e9b974 100644
--- a/usr/src/lib/libast/sparc/include/ast/vmalloc.h
+++ b/usr/src/lib/libast/sparc/include/ast/vmalloc.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -27,7 +27,7 @@
** Written by Kiem-Phong Vo, kpv@research.att.com, 01/16/94.
*/
-#define VMALLOC_VERSION 20050928L
+#define VMALLOC_VERSION 20070911L
#if _PACKAGE_ast
#include <ast_std.h>
diff --git a/usr/src/lib/libast/sparc/include/ast/wait.h b/usr/src/lib/libast/sparc/include/ast/wait.h
index 6910081961..08160043fa 100644
--- a/usr/src/lib/libast/sparc/include/ast/wait.h
+++ b/usr/src/lib/libast/sparc/include/ast/wait.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/wchar.h b/usr/src/lib/libast/sparc/include/ast/wchar.h
index 557a403adc..7796480d09 100644
--- a/usr/src/lib/libast/sparc/include/ast/wchar.h
+++ b/usr/src/lib/libast/sparc/include/ast/wchar.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/include/ast/wordexp.h b/usr/src/lib/libast/sparc/include/ast/wordexp.h
index b2e80d9f35..c3f97b37d9 100644
--- a/usr/src/lib/libast/sparc/include/ast/wordexp.h
+++ b/usr/src/lib/libast/sparc/include/ast/wordexp.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/align b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/align
index 09939a36da..a3113b6b2c 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/align
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/align
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/align.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/align.c by iffe version 2008-01-31 : : */
#ifndef _def_align_ast
#define _def_align_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/botch b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/botch
index ce25726723..c3ed99bc2a 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/botch
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/botch
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/botch.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/botch.c by iffe version 2008-01-31 : : */
#ifndef _def_botch_ast
#define _def_botch_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/ccode b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/ccode
index 002834f2fa..8d0727ee21 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/ccode
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/ccode
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/ccode by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/ccode by iffe version 2008-01-31 : : */
#ifndef _def_ccode_ast
#define _def_ccode_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/common b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/common
index 21fed4d7b4..e2f3a275a5 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/common
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/common
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/common by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/common by iffe version 2008-01-31 : : */
#ifndef _AST_COMMON_H
#define _AST_COMMON_H 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/dirent b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/dirent
index 8221b60e80..62a98fe825 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/dirent
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/dirent
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/dirent by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/dirent by iffe version 2008-01-31 : : */
#ifndef _def_dirent_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/eaccess b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/eaccess
index 0c21b46fbf..26e8c921d7 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/eaccess
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/eaccess
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/eaccess by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/eaccess by iffe version 2008-01-31 : : */
#ifndef _def_eaccess_ast
#define _def_eaccess_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/errno b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/errno
index 238ead0128..2568119338 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/errno
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/errno
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/errno by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/errno by iffe version 2008-01-31 : : */
#ifndef _def_errno_ast
#define _def_errno_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/fcntl b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/fcntl
index 4cbf8fa21d..3d39832d33 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/fcntl
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/fcntl
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/fcntl.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/fcntl.c by iffe version 2008-01-31 : : */
#ifndef _def_fcntl_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/float b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/float
index abb9593b60..4f7ff9e57d 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/float
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/float
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/float by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/float by iffe version 2008-01-31 : : */
#ifndef _def_float_ast
#if !defined(__PROTO__)
@@ -68,13 +68,16 @@
#define _hdr_math 1 /* #include <math.h> ok */
#define _hdr_values 1 /* #include <values.h> ok */
#define _LIB_m 1 /* -lm is a library */
+#define _lib_fpclassify 1 /* fpclassify() in default lib(s) */
#define _lib_frexp 1 /* frexp() in default lib(s) */
#define _lib_frexpl 1 /* frexpl() in default lib(s) */
#define _lib_ldexp 1 /* ldexp() in default lib(s) */
#define _lib_ldexpl 1 /* ldexpl() in default lib(s) */
#define _lib_finite 1 /* finite() in default lib(s) */
+#define _lib_isinf 1 /* isinf() in default lib(s) */
#define _lib_isnan 1 /* isnan() in default lib(s) */
#define _lib_isnanl 1 /* isnanl() in default lib(s) */
+#define _lib_signbit 1 /* signbit() in default lib(s) */
#define _lib_copysign 1 /* copysign() in default lib(s) */
#define _lib_copysignl 1 /* copysignl() in default lib(s) */
#include <ast_common.h>
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/fs b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/fs
index c2ad71dadc..e5672249ea 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/fs
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/fs
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/fs by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/fs by iffe version 2008-01-31 : : */
#ifndef _def_fs_ast
#if !defined(__PROTO__)
@@ -68,20 +68,9 @@
#define _lib_mknod 1 /* mknod() in default lib(s) */
#define _lib_sync 1 /* sync() in default lib(s) */
#include <sys/stat.h>
+#include <sys/mkdev.h>
#define FS_default "ufs"
#if defined(__STDPP__directive) && defined(__STDPP__initial)
-__STDPP__directive pragma pp:initial
-#endif
-#ifndef major
-#define major(x) ( major_t ) ( ( ( ( unsigned ) ( ( x ) ) ) >> 8 ) & 0x7f )
-#endif
-#ifndef minor
-#define minor(x) ( minor_t ) ( ( ( x ) ) & 0xff )
-#endif
-#ifndef makedev
-#define makedev(x,y) ( unsigned short ) ( ( ( ( x ) ) << 8 ) | ( ( ( y ) ) & 0xff ) )
-#endif
-#if defined(__STDPP__directive) && defined(__STDPP__initial)
__STDPP__directive pragma pp:noinitial
#endif
#define _hdr_stdio 1 /* #include <stdio.h> ok */
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/hack b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/hack
index f8ae1928f5..42af8246ea 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/hack
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/hack
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/hack by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/hack by iffe version 2008-01-31 : : */
#ifndef _def_hack_ast
#define _def_hack_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/iconv b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/iconv
index be50daaeca..b9cb3d1b41 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/iconv
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/iconv
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/iconv by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/iconv by iffe version 2008-01-31 : : */
#ifndef _def_iconv_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/isoc99 b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/isoc99
new file mode 100644
index 0000000000..3f5cd55351
--- /dev/null
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/isoc99
@@ -0,0 +1,11 @@
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/isoc99 by iffe version 2008-01-31 : : */
+#ifndef _def_isoc99_ast
+#define _def_isoc99_ast 1
+#define _sys_types 1 /* #include <sys/types.h> ok */
+#define _LIB_m 1 /* -lm is a library */
+/* _ISOC99_SOURCE plays nice */
+#ifndef _ISOC99_SOURCE
+#define _ISOC99_SOURCE 1
+#endif
+
+#endif
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/lib b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/lib
index 5fe12a8acb..09fec9d2e6 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/lib
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/lib
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/lib by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/lib by iffe version 2008-01-31 : : */
#ifndef _def_lib_ast
#define _def_lib_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/libpath b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/libpath
index c098e8871a..4d68591268 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/libpath
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/libpath
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/libpath.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/libpath.sh by iffe version 2008-01-31 : : */
#ifndef _def_libpath_ast
#define _def_libpath_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/limits b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/limits
index 4abdc47133..aa30dfe16a 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/limits
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/limits
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/limits.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/limits.c by iffe version 2008-01-31 : : */
#ifndef _def_limits_ast
#define _def_limits_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/map b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/map
index da0d809423..af8a8f68d7 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/map
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/map
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/map.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/map.c by iffe version 2008-01-31 : : */
#ifndef _def_map_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
@@ -121,6 +121,14 @@ extern __MANGLE__ char* getcwd __PROTO__((char*, size_t));
#define getopt_long _ast_getopt_long
#undef getopt_long_only
#define getopt_long_only _ast_getopt_long_only
+#undef optopt
+#define optopt _ast_optopt
+#undef optarg
+#define optarg _ast_optarg
+#undef optind
+#define optind _ast_optind
+#undef opterr
+#define opterr _ast_opterr
#undef getwd
#define getwd _ast_getwd
extern __MANGLE__ char* getwd __PROTO__((char*));
@@ -146,6 +154,8 @@ extern __MANGLE__ char* mktemp __PROTO__((char*));
#define mktime _ast_mktime
#undef nftw
#define nftw _ast_nftw
+#undef optctx
+#define optctx _ast_optctx
#undef optesc
#define optesc _ast_optesc
#undef optget
@@ -274,7 +284,7 @@ extern __MANGLE__ char* realpath __PROTO__((const char*, char*));
extern __MANGLE__ int remove __PROTO__((const char*));
#undef resolvepath
#define resolvepath _ast_resolvepath
-extern __MANGLE__ char* resolvepath __PROTO__((const char*, char*, size_t));
+extern __MANGLE__ int resolvepath __PROTO__((const char*, char*, size_t));
#undef setenv
#define setenv _ast_setenv
extern __MANGLE__ int setenv __PROTO__((const char*, const char*, int));
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/mmap b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/mmap
index 4a54d5bc78..20c894c9fe 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/mmap
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/mmap
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/mmap by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/mmap by iffe version 2008-01-31 : : */
#ifndef _def_mmap_ast
#define _def_mmap_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
@@ -7,6 +7,7 @@
#define _lib_mmap64 1 /* mmap64 interface and implementation work */
#define _mmap_anon 1 /* use mmap MAP_ANON to get raw memory */
#define _mmap_devzero 1 /* use mmap on /dev/zero to get raw memory */
+#define _mmap_worthy 1 /* mmap is good */
/* some systems get it wrong but escape concise detection */
#ifndef _NO_MMAP
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/mode b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/mode
index 4347cc2d13..ca8bae2c91 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/mode
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/mode
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/mode.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/mode.c by iffe version 2008-01-31 : : */
#ifndef _def_mode_ast
#define _def_mode_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/ndbm b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/ndbm
new file mode 100644
index 0000000000..fec155cde2
--- /dev/null
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/ndbm
@@ -0,0 +1,9 @@
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/ndbm by iffe version 2008-01-31 : : */
+#ifndef _def_ndbm_ast
+#define _def_ndbm_ast 1
+#define _sys_types 1 /* #include <sys/types.h> ok */
+#define _hdr_ndbm 1 /* #include <ndbm.h> ok */
+#include <ndbm.h>
+#define _use_ndbm 1
+
+#endif
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/nl_types b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/nl_types
index 57348178a9..7290f4df17 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/nl_types
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/nl_types
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/nl_types by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/nl_types by iffe version 2008-01-31 : : */
#ifndef _def_nl_types_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/omitted b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/omitted
index 0f88dcabac..10b65d37fe 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/omitted
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/omitted
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/omitted by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/omitted by iffe version 2008-01-31 : : */
#ifndef _def_omitted_ast
#define _def_omitted_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/param b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/param
index 577a0edf88..6b14c7d72d 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/param
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/param
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/param.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/param.sh by iffe version 2008-01-31 : : */
#ifndef _def_param_ast
#define _def_param_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/preroot b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/preroot
index 7780f31251..57a661e1d5 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/preroot
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/preroot
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/preroot.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/preroot.sh by iffe version 2008-01-31 : : */
#ifndef _def_preroot_ast
#define _def_preroot_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/sfinit b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/sfinit
index 0d0df0ccbd..1badda4725 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/sfinit
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/sfinit
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/sfinit.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/sfinit.c by iffe version 2008-01-31 : : */
#ifndef _def_sfinit_ast
#define _def_sfinit_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/sfio b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/sfio
index 465503bc8a..f1069c1f0d 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/sfio
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/sfio
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/sfio by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/sfio by iffe version 2008-01-31 : : */
#ifndef _def_sfio_ast
#define _def_sfio_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/sig b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/sig
index 72939b001b..10e7ce106c 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/sig
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/sig
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/sig.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/sig.sh by iffe version 2008-01-31 : : */
#ifndef _def_sig_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/siglist b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/siglist
new file mode 100644
index 0000000000..e21458c476
--- /dev/null
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/siglist
@@ -0,0 +1,125 @@
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/siglist by iffe version 2008-01-31 : : */
+#ifndef _def_siglist_ast
+#define _def_siglist_ast 1
+#define _sys_types 1 /* #include <sys/types.h> ok */
+#define _hdr_string 1 /* #include <string.h> ok */
+#define _hdr_signal 1 /* #include <signal.h> ok */
+#define _lib_strsignal 1 /* strsignal() in default lib(s) */
+#if defined(SIGINT) && !defined(HAD_SIGINT)
+0,"INT",SIGINT,
+#endif
+#if defined(SIGQUIT) && !defined(HAD_SIGQUIT)
+0,"QUIT",SIGQUIT,
+#endif
+#if defined(SIGILL) && !defined(HAD_SIGILL)
+0,"ILL",SIGILL,
+#endif
+#if defined(SIGTRAP) && !defined(HAD_SIGTRAP)
+0,"TRAP",SIGTRAP,
+#endif
+#if defined(SIGIOT) && !defined(HAD_SIGIOT)
+0,"IOT",SIGIOT,
+#endif
+#if defined(SIGEMT) && !defined(HAD_SIGEMT)
+0,"EMT",SIGEMT,
+#endif
+#if defined(SIGFPE) && !defined(HAD_SIGFPE)
+0,"FPE",SIGFPE,
+#endif
+#if defined(SIGKILL) && !defined(HAD_SIGKILL)
+0,"KILL",SIGKILL,
+#endif
+#if defined(SIGBUS) && !defined(HAD_SIGBUS)
+0,"BUS",SIGBUS,
+#endif
+#if defined(SIGSEGV) && !defined(HAD_SIGSEGV)
+0,"SEGV",SIGSEGV,
+#endif
+#if defined(SIGSYS) && !defined(HAD_SIGSYS)
+0,"SYS",SIGSYS,
+#endif
+#if defined(SIGPIPE) && !defined(HAD_SIGPIPE)
+0,"PIPE",SIGPIPE,
+#endif
+#if defined(SIGALRM) && !defined(HAD_SIGALRM)
+0,"ALRM",SIGALRM,
+#endif
+#if defined(SIGTERM) && !defined(HAD_SIGTERM)
+0,"TERM",SIGTERM,
+#endif
+#if defined(SIGUSR1) && !defined(HAD_SIGUSR1)
+0,"USR1",SIGUSR1,
+#endif
+#if defined(SIGUSR2) && !defined(HAD_SIGUSR2)
+0,"USR2",SIGUSR2,
+#endif
+#if defined(SIGCHLD) && !defined(HAD_SIGCHLD)
+0,"CHLD",SIGCHLD,
+#endif
+#if defined(SIGPWR) && !defined(HAD_SIGPWR)
+0,"PWR",SIGPWR,
+#endif
+#if defined(SIGWINCH) && !defined(HAD_SIGWINCH)
+0,"WINCH",SIGWINCH,
+#endif
+#if defined(SIGURG) && !defined(HAD_SIGURG)
+0,"URG",SIGURG,
+#endif
+#if defined(SIGPOLL) && !defined(HAD_SIGPOLL)
+0,"POLL",SIGPOLL,
+#endif
+#if defined(SIGSTOP) && !defined(HAD_SIGSTOP)
+0,"STOP",SIGSTOP,
+#endif
+#if defined(SIGTSTP) && !defined(HAD_SIGTSTP)
+0,"TSTP",SIGTSTP,
+#endif
+#if defined(SIGCONT) && !defined(HAD_SIGCONT)
+0,"CONT",SIGCONT,
+#endif
+#if defined(SIGTTIN) && !defined(HAD_SIGTTIN)
+0,"TTIN",SIGTTIN,
+#endif
+#if defined(SIGTTOU) && !defined(HAD_SIGTTOU)
+0,"TTOU",SIGTTOU,
+#endif
+#if defined(SIGVTALRM) && !defined(HAD_SIGVTALRM)
+0,"VTALRM",SIGVTALRM,
+#endif
+#if defined(SIGPROF) && !defined(HAD_SIGPROF)
+0,"PROF",SIGPROF,
+#endif
+#if defined(SIGXCPU) && !defined(HAD_SIGXCPU)
+0,"XCPU",SIGXCPU,
+#endif
+#if defined(SIGXFSZ) && !defined(HAD_SIGXFSZ)
+0,"XFSZ",SIGXFSZ,
+#endif
+#if defined(SIGWAITING) && !defined(HAD_SIGWAITING)
+0,"WAITING",SIGWAITING,
+#endif
+#if defined(SIGLWP) && !defined(HAD_SIGLWP)
+0,"LWP",SIGLWP,
+#endif
+#if defined(SIGFREEZE) && !defined(HAD_SIGFREEZE)
+0,"FREEZE",SIGFREEZE,
+#endif
+#if defined(SIGTHAW) && !defined(HAD_SIGTHAW)
+0,"THAW",SIGTHAW,
+#endif
+#if defined(SIGCANCEL) && !defined(HAD_SIGCANCEL)
+0,"CANCEL",SIGCANCEL,
+#endif
+#if defined(SIGLOST) && !defined(HAD_SIGLOST)
+0,"LOST",SIGLOST,
+#endif
+#if defined(SIGXRES) && !defined(HAD_SIGXRES)
+0,"XRES",SIGXRES,
+#endif
+#if defined(SIGJVM1) && !defined(HAD_SIGJVM1)
+0,"JVM1",SIGJVM1,
+#endif
+#if defined(SIGJVM2) && !defined(HAD_SIGJVM2)
+0,"JVM2",SIGJVM2,
+#endif
+#endif
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/signal b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/signal
index 8459924a5c..dc8c8b8d00 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/signal
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/signal
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/signal.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/signal.c by iffe version 2008-01-31 : : */
#ifndef _def_signal_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
@@ -103,18 +103,18 @@ static const char* const sig_name[] =
"LWP",
"FREEZE",
"THAW",
- "36",
+ "CANCEL",
"LOST",
- "38",
- "39",
- "40",
+ "XRES",
+ "JVM1",
+ "JVM2",
"RTMIN",
- "RT1",
- "RT2",
- "RT3",
- "RT4",
- "RT5",
- "RT6",
+ "RTMIN+1",
+ "RTMIN+2",
+ "RTMIN+3",
+ "RTMAX-3",
+ "RTMAX-2",
+ "RTMAX-1",
"RTMAX",
0
};
@@ -157,11 +157,11 @@ static const char* const sig_text[] =
"Thread event",
"CPR freeze",
"CPR thaw",
- "Signal 36",
+ "Thread Cancellation",
"Resources lost",
- "Signal 38",
- "Signal 39",
- "Signal 40",
+ "Resource Control Exceeded",
+ "Reserved for JVM 1",
+ "Reserved for JVM 2",
"Realtime priority 0 (lo)",
"Realtime priority 1",
"Realtime priority 2",
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/standards b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/standards
index b859405156..1e7c62f706 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/standards
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/standards
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/standards by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/standards by iffe version 2008-01-31 : : */
#ifndef _def_standards_ast
#define _def_standards_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/stdio b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/stdio
index f531374a22..de7c89e350 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/stdio
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/stdio
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/stdio by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/stdio by iffe version 2008-01-31 : : */
#ifndef _SFSTDIO_H
#if !defined(__PROTO__)
@@ -178,7 +178,7 @@ extern __MANGLE__ int fprintf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fpurge __PROTO__((FILE*));
extern __MANGLE__ int fputc __PROTO__((int, FILE*));
extern __MANGLE__ int fputs __PROTO__((const char*, FILE*));
-extern __MANGLE__ ssize_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
extern __MANGLE__ FILE* freopen __PROTO__((const char*, const char*, FILE*));
extern __MANGLE__ int fscanf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fseek __PROTO__((FILE*, long, int));
@@ -186,7 +186,7 @@ extern __MANGLE__ int fseeko __PROTO__((FILE*, off_t, int));
extern __MANGLE__ int fsetpos __PROTO__((FILE*, const fpos_t*));
extern __MANGLE__ long ftell __PROTO__((FILE*));
extern __MANGLE__ off_t ftello __PROTO__((FILE*));
-extern __MANGLE__ ssize_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
extern __MANGLE__ int getc __PROTO__((FILE*));
extern __MANGLE__ int getchar __PROTO__((void));
extern __MANGLE__ char* gets __PROTO__((char*));
@@ -245,6 +245,10 @@ extern __MANGLE__ int getchar_unlocked __PROTO__((void));
extern __MANGLE__ int putc_unlocked __PROTO__((int, FILE*));
extern __MANGLE__ int putchar_unlocked __PROTO__((int));
+extern __MANGLE__ void flockfile __PROTO__((FILE*));
+extern __MANGLE__ int ftrylockfile __PROTO__((FILE*));
+extern __MANGLE__ void funlockfile __PROTO__((FILE*));
+
#ifdef _USE_GNU
extern __MANGLE__ int fcloseall __PROTO__((void));
@@ -324,6 +328,7 @@ extern __MANGLE__ ssize_t getline __PROTO__((char**, size_t*, FILE*));
#define vsprintf _ast_vsprintf
#define vsscanf _ast_vsscanf
#define fcloseall _ast_fcloseall
+#define _filbuf _ast__filbuf
#define fmemopen _ast_fmemopen
#define __getdelim _ast___getdelim
#define getdelim _ast_getdelim
@@ -343,6 +348,9 @@ extern __MANGLE__ ssize_t getline __PROTO__((char**, size_t*, FILE*));
#define getchar_unlocked _ast_getchar_unlocked
#define putc_unlocked _ast_putc_unlocked
#define putchar_unlocked _ast_putchar_unlocked
+#define flockfile _ast_flockfile
+#define ftrylockfile _ast_ftrylockfile
+#define funlockfile _ast_funlockfile
#if defined(__STDPP__directive) && defined(__STDPP__initial)
__STDPP__directive pragma pp:initial
@@ -402,7 +410,7 @@ extern __MANGLE__ int fprintf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fpurge __PROTO__((FILE*));
extern __MANGLE__ int fputc __PROTO__((int, FILE*));
extern __MANGLE__ int fputs __PROTO__((const char*, FILE*));
-extern __MANGLE__ ssize_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
extern __MANGLE__ FILE* freopen __PROTO__((const char*, const char*, FILE*));
extern __MANGLE__ int fscanf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fseek __PROTO__((FILE*, long, int));
@@ -410,7 +418,7 @@ extern __MANGLE__ int fseeko __PROTO__((FILE*, off_t, int));
extern __MANGLE__ int fsetpos __PROTO__((FILE*, const fpos_t*));
extern __MANGLE__ long ftell __PROTO__((FILE*));
extern __MANGLE__ off_t ftello __PROTO__((FILE*));
-extern __MANGLE__ ssize_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
extern __MANGLE__ int getc __PROTO__((FILE*));
extern __MANGLE__ int getchar __PROTO__((void));
extern __MANGLE__ char* gets __PROTO__((char*));
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/sys b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/sys
index 091269fd30..c73ea23b86 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/sys
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/sys
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/sys by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/sys by iffe version 2008-01-31 : : */
#ifndef _AST_SYS_H
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/time b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/time
index c20d4cad00..c772198ef6 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/time
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/time
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/time by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/time by iffe version 2008-01-31 : : */
#ifndef _def_time_ast
#if !defined(__PROTO__)
@@ -76,7 +76,7 @@
#include <sys/times.h>
-#ifndef CLOCKS_PER_SEC
+#if !defined(CLOCKS_PER_SEC) && defined(CLK_TCK)
#define CLOCKS_PER_SEC CLK_TCK
#endif
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/tmlib b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/tmlib
index 8fe4f5a0da..3597d6a274 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/tmlib
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/tmlib
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/tmlib by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/tmlib by iffe version 2008-01-31 : : */
#ifndef _def_tmlib_ast
#if !defined(__PROTO__)
@@ -63,6 +63,9 @@
#define _def_tmlib_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define tmlocaltime(p) localtime(p)
+#define _tzset_environ 1 /* tzset() bypasses user getenv() */
+#define tmlocaltime(p) _tm_localtime(p)
+
+extern __MANGLE__ struct tm* _tm_localtime __PROTO__((const time_t*));
#endif
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/tmx b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/tmx
index f9d742ea73..189ba75695 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/tmx
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/tmx
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/tmx by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/tmx by iffe version 2008-01-31 : : */
#ifndef _TMX_H
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/tty b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/tty
index dce44fe8e3..d677e658e3 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/tty
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/tty
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/tty by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/tty by iffe version 2008-01-31 : : */
#ifndef _def_tty_ast
#define _def_tty_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/tv b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/tv
index 9ec820b351..0ead9fa85c 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/tv
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/tv
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/tv by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/tv by iffe version 2008-01-31 : : */
#ifndef _TV_H
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/tvlib b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/tvlib
index c2798de246..eccd218a2c 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/tvlib
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/tvlib
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/tvlib by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/tvlib by iffe version 2008-01-31 : : */
#ifndef _def_tvlib_ast
#define _def_tvlib_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
@@ -10,6 +10,7 @@
#define _lib_utimes 1 /* utimes() in default lib(s) */
#define _lib_nanosleep 1 /* nanosleep() in default lib(s) */
#define _lib_usleep 1 /* usleep() in default lib(s) */
+#define _sys_stat 1 /* #include <sys/stat.h> ok */
#define _sys_time 1 /* #include <sys/time.h> ok */
#define _lib_clock_gettime 1 /* execute{\ passed */
#define tmgettimeofday(p) gettimeofday(p,(struct timezone*)0)
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/types b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/types
deleted file mode 100644
index 343b5954a0..0000000000
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/types
+++ /dev/null
@@ -1,5 +0,0 @@
-/* : : generated by iffe version 2007-04-04 : : */
-#ifndef _def_types_ast
-#define _def_types_ast 1
-#define _sys_types 1 /* #include <sys/types.h> ok */
-#endif
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/uwin b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/uwin
index 66b740925f..2f8d56aeab 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/uwin
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/uwin
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/uwin by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/uwin by iffe version 2008-01-31 : : */
#ifndef _def_uwin_ast
#define _def_uwin_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/vfork b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/vfork
index d70a055a5b..2da80228cf 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/vfork
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/vfork
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/vfork by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/vfork by iffe version 2008-01-31 : : */
#ifndef _def_vfork_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/vmalloc b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/vmalloc
index b810c821b8..b3dccf8aff 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/vmalloc
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/vmalloc
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/vmalloc by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/vmalloc by iffe version 2008-01-31 : : */
#ifndef _def_vmalloc_ast
#define _def_vmalloc_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/wait b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/wait
index 3bcc94d23b..46bb607432 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/wait
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/wait
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/wait by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/wait by iffe version 2008-01-31 : : */
#ifndef _def_wait_ast
#define _def_wait_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/wchar b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/wchar
index 03e01de07a..a3ced6a848 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/wchar
+++ b/usr/src/lib/libast/sparc/src/lib/libast/FEATURE/wchar
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/wchar by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/wchar by iffe version 2008-01-31 : : */
#ifndef _def_wchar_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/align.h b/usr/src/lib/libast/sparc/src/lib/libast/align.h
index 09939a36da..a3113b6b2c 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/align.h
+++ b/usr/src/lib/libast/sparc/src/lib/libast/align.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/align.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/align.c by iffe version 2008-01-31 : : */
#ifndef _def_align_ast
#define _def_align_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/ast_botch.h b/usr/src/lib/libast/sparc/src/lib/libast/ast_botch.h
index ce25726723..c3ed99bc2a 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/ast_botch.h
+++ b/usr/src/lib/libast/sparc/src/lib/libast/ast_botch.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/botch.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/botch.c by iffe version 2008-01-31 : : */
#ifndef _def_botch_ast
#define _def_botch_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/ast_ccode.h b/usr/src/lib/libast/sparc/src/lib/libast/ast_ccode.h
index 002834f2fa..8d0727ee21 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/ast_ccode.h
+++ b/usr/src/lib/libast/sparc/src/lib/libast/ast_ccode.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/ccode by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/ccode by iffe version 2008-01-31 : : */
#ifndef _def_ccode_ast
#define _def_ccode_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/ast_common.h b/usr/src/lib/libast/sparc/src/lib/libast/ast_common.h
index 0b5de4487b..1425e28c09 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/ast_common.h
+++ b/usr/src/lib/libast/sparc/src/lib/libast/ast_common.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/common by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/common by iffe version 2008-01-31 : : */
#ifndef _AST_COMMON_H
#define _AST_COMMON_H 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/ast_dirent.h b/usr/src/lib/libast/sparc/src/lib/libast/ast_dirent.h
index 8221b60e80..62a98fe825 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/ast_dirent.h
+++ b/usr/src/lib/libast/sparc/src/lib/libast/ast_dirent.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/dirent by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/dirent by iffe version 2008-01-31 : : */
#ifndef _def_dirent_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/ast_fcntl.h b/usr/src/lib/libast/sparc/src/lib/libast/ast_fcntl.h
index 4cbf8fa21d..3d39832d33 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/ast_fcntl.h
+++ b/usr/src/lib/libast/sparc/src/lib/libast/ast_fcntl.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/fcntl.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/fcntl.c by iffe version 2008-01-31 : : */
#ifndef _def_fcntl_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/ast_float.h b/usr/src/lib/libast/sparc/src/lib/libast/ast_float.h
index abb9593b60..4f7ff9e57d 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/ast_float.h
+++ b/usr/src/lib/libast/sparc/src/lib/libast/ast_float.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/float by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/float by iffe version 2008-01-31 : : */
#ifndef _def_float_ast
#if !defined(__PROTO__)
@@ -68,13 +68,16 @@
#define _hdr_math 1 /* #include <math.h> ok */
#define _hdr_values 1 /* #include <values.h> ok */
#define _LIB_m 1 /* -lm is a library */
+#define _lib_fpclassify 1 /* fpclassify() in default lib(s) */
#define _lib_frexp 1 /* frexp() in default lib(s) */
#define _lib_frexpl 1 /* frexpl() in default lib(s) */
#define _lib_ldexp 1 /* ldexp() in default lib(s) */
#define _lib_ldexpl 1 /* ldexpl() in default lib(s) */
#define _lib_finite 1 /* finite() in default lib(s) */
+#define _lib_isinf 1 /* isinf() in default lib(s) */
#define _lib_isnan 1 /* isnan() in default lib(s) */
#define _lib_isnanl 1 /* isnanl() in default lib(s) */
+#define _lib_signbit 1 /* signbit() in default lib(s) */
#define _lib_copysign 1 /* copysign() in default lib(s) */
#define _lib_copysignl 1 /* copysignl() in default lib(s) */
#include <ast_common.h>
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/ast_fs.h b/usr/src/lib/libast/sparc/src/lib/libast/ast_fs.h
index c2ad71dadc..e5672249ea 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/ast_fs.h
+++ b/usr/src/lib/libast/sparc/src/lib/libast/ast_fs.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/fs by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/fs by iffe version 2008-01-31 : : */
#ifndef _def_fs_ast
#if !defined(__PROTO__)
@@ -68,20 +68,9 @@
#define _lib_mknod 1 /* mknod() in default lib(s) */
#define _lib_sync 1 /* sync() in default lib(s) */
#include <sys/stat.h>
+#include <sys/mkdev.h>
#define FS_default "ufs"
#if defined(__STDPP__directive) && defined(__STDPP__initial)
-__STDPP__directive pragma pp:initial
-#endif
-#ifndef major
-#define major(x) ( major_t ) ( ( ( ( unsigned ) ( ( x ) ) ) >> 8 ) & 0x7f )
-#endif
-#ifndef minor
-#define minor(x) ( minor_t ) ( ( ( x ) ) & 0xff )
-#endif
-#ifndef makedev
-#define makedev(x,y) ( unsigned short ) ( ( ( ( x ) ) << 8 ) | ( ( ( y ) ) & 0xff ) )
-#endif
-#if defined(__STDPP__directive) && defined(__STDPP__initial)
__STDPP__directive pragma pp:noinitial
#endif
#define _hdr_stdio 1 /* #include <stdio.h> ok */
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/ast_iconv.h b/usr/src/lib/libast/sparc/src/lib/libast/ast_iconv.h
index be50daaeca..b9cb3d1b41 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/ast_iconv.h
+++ b/usr/src/lib/libast/sparc/src/lib/libast/ast_iconv.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/iconv by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/iconv by iffe version 2008-01-31 : : */
#ifndef _def_iconv_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/ast_lib.h b/usr/src/lib/libast/sparc/src/lib/libast/ast_lib.h
index 5fe12a8acb..09fec9d2e6 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/ast_lib.h
+++ b/usr/src/lib/libast/sparc/src/lib/libast/ast_lib.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/lib by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/lib by iffe version 2008-01-31 : : */
#ifndef _def_lib_ast
#define _def_lib_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/ast_limits.h b/usr/src/lib/libast/sparc/src/lib/libast/ast_limits.h
index 4abdc47133..aa30dfe16a 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/ast_limits.h
+++ b/usr/src/lib/libast/sparc/src/lib/libast/ast_limits.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/limits.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/limits.c by iffe version 2008-01-31 : : */
#ifndef _def_limits_ast
#define _def_limits_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/ast_map.h b/usr/src/lib/libast/sparc/src/lib/libast/ast_map.h
index da0d809423..af8a8f68d7 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/ast_map.h
+++ b/usr/src/lib/libast/sparc/src/lib/libast/ast_map.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/map.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/map.c by iffe version 2008-01-31 : : */
#ifndef _def_map_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
@@ -121,6 +121,14 @@ extern __MANGLE__ char* getcwd __PROTO__((char*, size_t));
#define getopt_long _ast_getopt_long
#undef getopt_long_only
#define getopt_long_only _ast_getopt_long_only
+#undef optopt
+#define optopt _ast_optopt
+#undef optarg
+#define optarg _ast_optarg
+#undef optind
+#define optind _ast_optind
+#undef opterr
+#define opterr _ast_opterr
#undef getwd
#define getwd _ast_getwd
extern __MANGLE__ char* getwd __PROTO__((char*));
@@ -146,6 +154,8 @@ extern __MANGLE__ char* mktemp __PROTO__((char*));
#define mktime _ast_mktime
#undef nftw
#define nftw _ast_nftw
+#undef optctx
+#define optctx _ast_optctx
#undef optesc
#define optesc _ast_optesc
#undef optget
@@ -274,7 +284,7 @@ extern __MANGLE__ char* realpath __PROTO__((const char*, char*));
extern __MANGLE__ int remove __PROTO__((const char*));
#undef resolvepath
#define resolvepath _ast_resolvepath
-extern __MANGLE__ char* resolvepath __PROTO__((const char*, char*, size_t));
+extern __MANGLE__ int resolvepath __PROTO__((const char*, char*, size_t));
#undef setenv
#define setenv _ast_setenv
extern __MANGLE__ int setenv __PROTO__((const char*, const char*, int));
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/ast_mmap.h b/usr/src/lib/libast/sparc/src/lib/libast/ast_mmap.h
index 4a54d5bc78..20c894c9fe 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/ast_mmap.h
+++ b/usr/src/lib/libast/sparc/src/lib/libast/ast_mmap.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/mmap by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/mmap by iffe version 2008-01-31 : : */
#ifndef _def_mmap_ast
#define _def_mmap_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
@@ -7,6 +7,7 @@
#define _lib_mmap64 1 /* mmap64 interface and implementation work */
#define _mmap_anon 1 /* use mmap MAP_ANON to get raw memory */
#define _mmap_devzero 1 /* use mmap on /dev/zero to get raw memory */
+#define _mmap_worthy 1 /* mmap is good */
/* some systems get it wrong but escape concise detection */
#ifndef _NO_MMAP
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/ast_mode.h b/usr/src/lib/libast/sparc/src/lib/libast/ast_mode.h
index 4347cc2d13..ca8bae2c91 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/ast_mode.h
+++ b/usr/src/lib/libast/sparc/src/lib/libast/ast_mode.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/mode.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/mode.c by iffe version 2008-01-31 : : */
#ifndef _def_mode_ast
#define _def_mode_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/ast_ndbm.h b/usr/src/lib/libast/sparc/src/lib/libast/ast_ndbm.h
new file mode 100644
index 0000000000..fec155cde2
--- /dev/null
+++ b/usr/src/lib/libast/sparc/src/lib/libast/ast_ndbm.h
@@ -0,0 +1,9 @@
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/ndbm by iffe version 2008-01-31 : : */
+#ifndef _def_ndbm_ast
+#define _def_ndbm_ast 1
+#define _sys_types 1 /* #include <sys/types.h> ok */
+#define _hdr_ndbm 1 /* #include <ndbm.h> ok */
+#include <ndbm.h>
+#define _use_ndbm 1
+
+#endif
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/ast_nl_types.h b/usr/src/lib/libast/sparc/src/lib/libast/ast_nl_types.h
index 57348178a9..7290f4df17 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/ast_nl_types.h
+++ b/usr/src/lib/libast/sparc/src/lib/libast/ast_nl_types.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/nl_types by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/nl_types by iffe version 2008-01-31 : : */
#ifndef _def_nl_types_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/ast_param.h b/usr/src/lib/libast/sparc/src/lib/libast/ast_param.h
index 577a0edf88..6b14c7d72d 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/ast_param.h
+++ b/usr/src/lib/libast/sparc/src/lib/libast/ast_param.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/param.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/param.sh by iffe version 2008-01-31 : : */
#ifndef _def_param_ast
#define _def_param_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/ast_standards.h b/usr/src/lib/libast/sparc/src/lib/libast/ast_standards.h
index b859405156..1e7c62f706 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/ast_standards.h
+++ b/usr/src/lib/libast/sparc/src/lib/libast/ast_standards.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/standards by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/standards by iffe version 2008-01-31 : : */
#ifndef _def_standards_ast
#define _def_standards_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/ast_stdio.h b/usr/src/lib/libast/sparc/src/lib/libast/ast_stdio.h
index f531374a22..de7c89e350 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/ast_stdio.h
+++ b/usr/src/lib/libast/sparc/src/lib/libast/ast_stdio.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/stdio by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/stdio by iffe version 2008-01-31 : : */
#ifndef _SFSTDIO_H
#if !defined(__PROTO__)
@@ -178,7 +178,7 @@ extern __MANGLE__ int fprintf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fpurge __PROTO__((FILE*));
extern __MANGLE__ int fputc __PROTO__((int, FILE*));
extern __MANGLE__ int fputs __PROTO__((const char*, FILE*));
-extern __MANGLE__ ssize_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
extern __MANGLE__ FILE* freopen __PROTO__((const char*, const char*, FILE*));
extern __MANGLE__ int fscanf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fseek __PROTO__((FILE*, long, int));
@@ -186,7 +186,7 @@ extern __MANGLE__ int fseeko __PROTO__((FILE*, off_t, int));
extern __MANGLE__ int fsetpos __PROTO__((FILE*, const fpos_t*));
extern __MANGLE__ long ftell __PROTO__((FILE*));
extern __MANGLE__ off_t ftello __PROTO__((FILE*));
-extern __MANGLE__ ssize_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
extern __MANGLE__ int getc __PROTO__((FILE*));
extern __MANGLE__ int getchar __PROTO__((void));
extern __MANGLE__ char* gets __PROTO__((char*));
@@ -245,6 +245,10 @@ extern __MANGLE__ int getchar_unlocked __PROTO__((void));
extern __MANGLE__ int putc_unlocked __PROTO__((int, FILE*));
extern __MANGLE__ int putchar_unlocked __PROTO__((int));
+extern __MANGLE__ void flockfile __PROTO__((FILE*));
+extern __MANGLE__ int ftrylockfile __PROTO__((FILE*));
+extern __MANGLE__ void funlockfile __PROTO__((FILE*));
+
#ifdef _USE_GNU
extern __MANGLE__ int fcloseall __PROTO__((void));
@@ -324,6 +328,7 @@ extern __MANGLE__ ssize_t getline __PROTO__((char**, size_t*, FILE*));
#define vsprintf _ast_vsprintf
#define vsscanf _ast_vsscanf
#define fcloseall _ast_fcloseall
+#define _filbuf _ast__filbuf
#define fmemopen _ast_fmemopen
#define __getdelim _ast___getdelim
#define getdelim _ast_getdelim
@@ -343,6 +348,9 @@ extern __MANGLE__ ssize_t getline __PROTO__((char**, size_t*, FILE*));
#define getchar_unlocked _ast_getchar_unlocked
#define putc_unlocked _ast_putc_unlocked
#define putchar_unlocked _ast_putchar_unlocked
+#define flockfile _ast_flockfile
+#define ftrylockfile _ast_ftrylockfile
+#define funlockfile _ast_funlockfile
#if defined(__STDPP__directive) && defined(__STDPP__initial)
__STDPP__directive pragma pp:initial
@@ -402,7 +410,7 @@ extern __MANGLE__ int fprintf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fpurge __PROTO__((FILE*));
extern __MANGLE__ int fputc __PROTO__((int, FILE*));
extern __MANGLE__ int fputs __PROTO__((const char*, FILE*));
-extern __MANGLE__ ssize_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
extern __MANGLE__ FILE* freopen __PROTO__((const char*, const char*, FILE*));
extern __MANGLE__ int fscanf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fseek __PROTO__((FILE*, long, int));
@@ -410,7 +418,7 @@ extern __MANGLE__ int fseeko __PROTO__((FILE*, off_t, int));
extern __MANGLE__ int fsetpos __PROTO__((FILE*, const fpos_t*));
extern __MANGLE__ long ftell __PROTO__((FILE*));
extern __MANGLE__ off_t ftello __PROTO__((FILE*));
-extern __MANGLE__ ssize_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
extern __MANGLE__ int getc __PROTO__((FILE*));
extern __MANGLE__ int getchar __PROTO__((void));
extern __MANGLE__ char* gets __PROTO__((char*));
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/ast_sys.h b/usr/src/lib/libast/sparc/src/lib/libast/ast_sys.h
index 091269fd30..c73ea23b86 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/ast_sys.h
+++ b/usr/src/lib/libast/sparc/src/lib/libast/ast_sys.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/sys by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/sys by iffe version 2008-01-31 : : */
#ifndef _AST_SYS_H
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/ast_time.h b/usr/src/lib/libast/sparc/src/lib/libast/ast_time.h
index c20d4cad00..c772198ef6 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/ast_time.h
+++ b/usr/src/lib/libast/sparc/src/lib/libast/ast_time.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/time by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/time by iffe version 2008-01-31 : : */
#ifndef _def_time_ast
#if !defined(__PROTO__)
@@ -76,7 +76,7 @@
#include <sys/times.h>
-#ifndef CLOCKS_PER_SEC
+#if !defined(CLOCKS_PER_SEC) && defined(CLK_TCK)
#define CLOCKS_PER_SEC CLK_TCK
#endif
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/ast_tty.h b/usr/src/lib/libast/sparc/src/lib/libast/ast_tty.h
index dce44fe8e3..d677e658e3 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/ast_tty.h
+++ b/usr/src/lib/libast/sparc/src/lib/libast/ast_tty.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/tty by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/tty by iffe version 2008-01-31 : : */
#ifndef _def_tty_ast
#define _def_tty_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/ast_types.h b/usr/src/lib/libast/sparc/src/lib/libast/ast_types.h
deleted file mode 100644
index 343b5954a0..0000000000
--- a/usr/src/lib/libast/sparc/src/lib/libast/ast_types.h
+++ /dev/null
@@ -1,5 +0,0 @@
-/* : : generated by iffe version 2007-04-04 : : */
-#ifndef _def_types_ast
-#define _def_types_ast 1
-#define _sys_types 1 /* #include <sys/types.h> ok */
-#endif
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/ast_vfork.h b/usr/src/lib/libast/sparc/src/lib/libast/ast_vfork.h
index d70a055a5b..2da80228cf 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/ast_vfork.h
+++ b/usr/src/lib/libast/sparc/src/lib/libast/ast_vfork.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/vfork by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/vfork by iffe version 2008-01-31 : : */
#ifndef _def_vfork_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/ast_wait.h b/usr/src/lib/libast/sparc/src/lib/libast/ast_wait.h
index 3bcc94d23b..46bb607432 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/ast_wait.h
+++ b/usr/src/lib/libast/sparc/src/lib/libast/ast_wait.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/wait by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/wait by iffe version 2008-01-31 : : */
#ifndef _def_wait_ast
#define _def_wait_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/ast_wchar.h b/usr/src/lib/libast/sparc/src/lib/libast/ast_wchar.h
index 03e01de07a..a3ced6a848 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/ast_wchar.h
+++ b/usr/src/lib/libast/sparc/src/lib/libast/ast_wchar.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/wchar by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/wchar by iffe version 2008-01-31 : : */
#ifndef _def_wchar_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/conftab.c b/usr/src/lib/libast/sparc/src/lib/libast/conftab.c
index 49d887d6d2..c073c29d26 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/conftab.c
+++ b/usr/src/lib/libast/sparc/src/lib/libast/conftab.c
@@ -1,63 +1,3 @@
-
-/* : : generated by proto : : */
-
-#if !defined(__PROTO__)
-# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
-# if defined(__cplusplus)
-# define __LINKAGE__ "C"
-# else
-# define __LINKAGE__
-# endif
-# define __STDARG__
-# define __PROTO__(x) x
-# define __OTORP__(x)
-# define __PARAM__(n,o) n
-# if !defined(__STDC__) && !defined(__cplusplus)
-# if !defined(c_plusplus)
-# define const
-# endif
-# define signed
-# define void int
-# define volatile
-# define __V_ char
-# else
-# define __V_ void
-# endif
-# else
-# define __PROTO__(x) ()
-# define __OTORP__(x) x
-# define __PARAM__(n,o) o
-# define __LINKAGE__
-# define __V_ char
-# define const
-# define signed
-# define void int
-# define volatile
-# endif
-# define __MANGLE__ __LINKAGE__
-# if defined(__cplusplus) || defined(c_plusplus)
-# define __VARARG__ ...
-# else
-# define __VARARG__
-# endif
-# if defined(__STDARG__)
-# define __VA_START__(p,a) va_start(p,a)
-# else
-# define __VA_START__(p,a) va_start(p)
-# endif
-# if !defined(__INLINE__)
-# if defined(__cplusplus)
-# define __INLINE__ extern __MANGLE__ inline
-# else
-# if defined(_WIN32) && !defined(__GNUC__)
-# define __INLINE__ __inline
-# endif
-# endif
-# endif
-#endif
-#if !defined(__LINKAGE__)
-#define __LINKAGE__ /* 2004-08-11 transition */
-#endif
#include "FEATURE/standards"
#include "FEATURE/common"
#include <sys/types.h>
@@ -70,7 +10,7 @@
#include "FEATURE/param"
#include "conftab.h"
-/* : : generated by conf from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/comp/conf.tab : : */
+/* : : generated by conf from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/comp/conf.tab : : */
/*
* prefix strings -- the first few are indexed by Conf_t.standard
@@ -105,111 +45,111 @@ int prefix_elements = (int)sizeof(prefix) / (int)sizeof(prefix[0]);
const Conf_t conf[] =
{
-{ "ABI_AIO_XFER_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "ABI_ASYNCHRONOUS_IO", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "ABI_ASYNC_IO", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "ADVISORY_INFO", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_ADVISORY_INFO },
-{ "AIO_LISTIO_MAX", { 0, 0 }, { _POSIX_AIO_LISTIO_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_AIO_LISTIO_MAX },
-{ "AIO_MAX", { 0, 0 }, { _POSIX_AIO_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_AIO_MAX },
-{ "AIO_PRIO_DELTA_MAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, _SC_AIO_PRIO_DELTA_MAX },
-{ "ALLOC_SIZE_MIN", { 0, 0 }, { 0, 0 }, CONF_LIMIT|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_ALLOC_SIZE_MIN },
-{ "ARCHITECTURE", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "ARG_MAX", { 0, 0 }, { _POSIX_ARG_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_ARG_MAX },
-{ "ASYNCHRONOUS_IO", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_ASYNCHRONOUS_IO },
-{ "ASYNC_IO", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_ASYNC_IO },
-{ "ATEXIT_MAX", { 0, 0 }, { 32, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_XOPEN, 1, CONF_sysconf, _SC_ATEXIT_MAX },
-{ "AUDIT", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "AVAIL_PROCESSORS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "AVPHYS_PAGES", { 0, 0 }, { 0, 0 }, 0, CONF_SUN, 1, CONF_sysconf, _SC_AVPHYS_PAGES },
-{ "BARRIERS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_BARRIERS },
-{ "BC_BASE_MAX", { 0, 0 }, { _POSIX2_BC_BASE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_BC_BASE_MAX },
-{ "BC_DIM_MAX", { 0, 0 }, { _POSIX2_BC_DIM_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_BC_DIM_MAX },
-{ "BC_SCALE_MAX", { 0, 0 }, { _POSIX2_BC_SCALE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_BC_SCALE_MAX },
-{ "BC_STRING_MAX", { 0, 0 }, { _POSIX2_BC_STRING_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_BC_STRING_MAX },
-{ "BUSTYPES", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "CHARCLASS_NAME_MAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "CHAR_BIT", { 8, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "CHAR_MAX", { 127, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "CHAR_MIN", { -128, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "CHAR_TERM", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_CHAR_TERM },
-{ "CHILD_MAX", { 0, 0 }, { _POSIX_CHILD_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_CHILD_MAX },
-{ "CHOWN_RESTRICTED", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_CHOWN_RESTRICTED },
-{ "CKPT", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "CLK_TCK", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_POSIX, 1, CONF_sysconf, _SC_CLK_TCK },
-{ "CLOCKRES_MIN", { 0, 0 }, { _POSIX_CLOCKRES_MIN, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_PREFIX_ONLY|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "CLOCKS_PER_SEC", { 1000000, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_LIMIT|CONF_LIMIT_DEF, CONF_POSIX, 1, CONF_nop, -1 },
-{ "CLOCK_SELECTION", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_CLOCK_SELECTION },
-{ "COLL_WEIGHTS_MAX", { 0, 0 }, { _POSIX2_COLL_WEIGHTS_MAX, 0 }, CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_COLL_WEIGHTS_MAX },
-{ "CPUTIME", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_CPUTIME },
-{ "CPU_KEYBITS1", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "CPU_VERSION", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "CRYPT", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_CRYPT },
-{ "C_BIND", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 2, CONF_sysconf, _SC_2_C_BIND },
-{ "C_DEV", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 2, CONF_sysconf, _SC_2_C_DEV },
-{ "C_VERSION", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 2, CONF_sysconf, _SC_2_C_VERSION },
-{ "DATAKEYS_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "DELAYTIMER_MAX", { 0, 0 }, { _POSIX_DELAYTIMER_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_DELAYTIMER_MAX },
-{ "ENH_I18N", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_ENH_I18N },
-{ "EQUIV_CLASS_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "EXEC_INTERPRETER_LENGTH", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "EXPR_NEST_MAX", { 0, 0 }, { _POSIX2_EXPR_NEST_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_EXPR_NEST_MAX },
-{ "FCHR_MAX", { 0, 0 }, { LONG_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
-{ "FILESIZEBITS", { 0, 0 }, { 0, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_FILESIZEBITS },
-{ "FILE_LOCKING", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "FORT_DEV", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_FORT_DEV },
-{ "FORT_RUN", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_FORT_RUN },
-{ "FSYNC", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_FSYNC },
-{ "GETGR_R_SIZE_MAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_sysconf, _SC_GETGR_R_SIZE_MAX },
-{ "GETPW_R_SIZE_MAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_sysconf, _SC_GETPW_R_SIZE_MAX },
-{ "HOSTID", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "HOSTNAME", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "HOST_NAME_MAX", { 0, 0 }, { _POSIX_HOST_NAME_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_HOST_NAME_MAX },
-{ "HW_PROVIDER", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "HW_SERIAL", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "ILP32_OFF32", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XBS5, 1, CONF_sysconf, -1 },
+{ "ABI_AIO_XFER_MAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "ABI_ASYNCHRONOUS_IO", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "ABI_ASYNC_IO", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "ADVISORY_INFO", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_ADVISORY_INFO },
+{ "AIO_LISTIO_MAX", { 0ULL, 0 }, { _POSIX_AIO_LISTIO_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_AIO_LISTIO_MAX },
+{ "AIO_MAX", { 0ULL, 0 }, { _POSIX_AIO_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_AIO_MAX },
+{ "AIO_PRIO_DELTA_MAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, _SC_AIO_PRIO_DELTA_MAX },
+{ "ALLOC_SIZE_MIN", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_ALLOC_SIZE_MIN },
+{ "ARCHITECTURE", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, SI_ARCHITECTURE },
+{ "ARG_MAX", { 0ULL, 0 }, { _POSIX_ARG_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_ARG_MAX },
+{ "ASYNCHRONOUS_IO", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_ASYNCHRONOUS_IO },
+{ "ASYNC_IO", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_ASYNC_IO },
+{ "ATEXIT_MAX", { 0ULL, 0 }, { 32ULL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_XOPEN, 1, CONF_sysconf, _SC_ATEXIT_MAX },
+{ "AUDIT", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "AVAIL_PROCESSORS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "AVPHYS_PAGES", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SUN, 1, CONF_sysconf, _SC_AVPHYS_PAGES },
+{ "BARRIERS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_BARRIERS },
+{ "BC_BASE_MAX", { 0ULL, 0 }, { _POSIX2_BC_BASE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_BC_BASE_MAX },
+{ "BC_DIM_MAX", { 0ULL, 0 }, { _POSIX2_BC_DIM_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_BC_DIM_MAX },
+{ "BC_SCALE_MAX", { 0ULL, 0 }, { _POSIX2_BC_SCALE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_BC_SCALE_MAX },
+{ "BC_STRING_MAX", { 0ULL, 0 }, { _POSIX2_BC_STRING_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_BC_STRING_MAX },
+{ "BUSTYPES", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
+{ "CHARCLASS_NAME_MAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "CHAR_BIT", { 8ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "CHAR_MAX", { 127ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "CHAR_MIN", { -127LL-1LL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "CHAR_TERM", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_CHAR_TERM },
+{ "CHILD_MAX", { 0ULL, 0 }, { _POSIX_CHILD_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_CHILD_MAX },
+{ "CHOWN_RESTRICTED", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_CHOWN_RESTRICTED },
+{ "CKPT", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "CLK_TCK", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_POSIX, 1, CONF_sysconf, _SC_CLK_TCK },
+{ "CLOCKRES_MIN", { 0ULL, 0 }, { _POSIX_CLOCKRES_MIN, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_PREFIX_ONLY|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "CLOCKS_PER_SEC", { 1000000ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_LIMIT|CONF_LIMIT_DEF, CONF_POSIX, 1, CONF_nop, -1 },
+{ "CLOCK_SELECTION", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_CLOCK_SELECTION },
+{ "COLL_WEIGHTS_MAX", { 0ULL, 0 }, { _POSIX2_COLL_WEIGHTS_MAX, 0 }, CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_COLL_WEIGHTS_MAX },
+{ "CPUTIME", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_CPUTIME },
+{ "CPU_KEYBITS1", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "CPU_VERSION", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "CRYPT", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_CRYPT },
+{ "C_BIND", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 2, CONF_sysconf, _SC_2_C_BIND },
+{ "C_DEV", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 2, CONF_sysconf, _SC_2_C_DEV },
+{ "C_VERSION", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 2, CONF_sysconf, _SC_2_C_VERSION },
+{ "DATAKEYS_MAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "DELAYTIMER_MAX", { 0ULL, 0 }, { _POSIX_DELAYTIMER_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_DELAYTIMER_MAX },
+{ "ENH_I18N", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_ENH_I18N },
+{ "EQUIV_CLASS_MAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "EXEC_INTERPRETER_LENGTH", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "EXPR_NEST_MAX", { 0ULL, 0 }, { _POSIX2_EXPR_NEST_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_EXPR_NEST_MAX },
+{ "FCHR_MAX", { 0ULL, 0 }, { LONG_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
+{ "FILESIZEBITS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_FILESIZEBITS },
+{ "FILE_LOCKING", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "FORT_DEV", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_FORT_DEV },
+{ "FORT_RUN", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_FORT_RUN },
+{ "FSYNC", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_FSYNC },
+{ "GETGR_R_SIZE_MAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_C, 1, CONF_sysconf, _SC_GETGR_R_SIZE_MAX },
+{ "GETPW_R_SIZE_MAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_C, 1, CONF_sysconf, _SC_GETPW_R_SIZE_MAX },
+{ "HOSTID", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "HOSTNAME", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, SI_HOSTNAME },
+{ "HOST_NAME_MAX", { 0ULL, 0 }, { _POSIX_HOST_NAME_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_HOST_NAME_MAX },
+{ "HW_PROVIDER", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, SI_HW_PROVIDER },
+{ "HW_SERIAL", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "ILP32_OFF32", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XBS5, 1, CONF_sysconf, -1 },
{ "ILP32_OFF32_CFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "ILP32_OFF32_LDFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "ILP32_OFF32_LIBS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "ILP32_OFF32_LINTFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
-{ "ILP32_OFFBIG", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XBS5, 1, CONF_sysconf, -1 },
+{ "ILP32_OFFBIG", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XBS5, 1, CONF_sysconf, -1 },
{ "ILP32_OFFBIG_CFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "ILP32_OFFBIG_LDFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "ILP32_OFFBIG_LIBS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "ILP32_OFFBIG_LINTFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
-{ "INITTAB_NAME", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "INT_MAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
-{ "INT_MIN", { -2147483648, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "IOV_MAX", { 0, 0 }, { _XOPEN_IOV_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_XOPEN, 1, CONF_sysconf, _SC_IOV_MAX },
-{ "IO_TYPE", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "IPV6", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_IPV6 },
-{ "IP_SECOPTS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "JOB_CONTROL", { 0, 0 }, { 1, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_JOB_CONTROL },
-{ "KERNEL_CLIST", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_CLIST_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_DISK", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_DISK_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_DMABUF", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_DMABUF_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_FILE", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_FILE_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_FLCKREC", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_FLCKREC_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_INODE", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_INODE_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_MOUNT", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_MOUNT_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_PINODE", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_PINODE_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_PROC", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_PROC_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_REGION", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_REGION_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_S5INODE", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_S5INODE_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_STAMP", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "KERN_POINTERS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "KERN_SIM", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "LEGACY", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, -1 },
+{ "INITTAB_NAME", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
+{ "INT_MAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
+{ "INT_MIN", { -2147483647LL-1LL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "IOV_MAX", { 0ULL, 0 }, { _XOPEN_IOV_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_XOPEN, 1, CONF_sysconf, _SC_IOV_MAX },
+{ "IO_TYPE", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "IPV6", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_IPV6 },
+{ "IP_SECOPTS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "JOB_CONTROL", { 0ULL, 0 }, { 1ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_JOB_CONTROL },
+{ "KERNEL_CLIST", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_CLIST_MAX", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_DISK", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_DISK_MAX", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_DMABUF", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_DMABUF_MAX", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_FILE", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_FILE_MAX", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_FLCKREC", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_FLCKREC_MAX", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_INODE", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_INODE_MAX", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_MOUNT", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_MOUNT_MAX", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_PINODE", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_PINODE_MAX", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_PROC", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_PROC_MAX", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_REGION", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_REGION_MAX", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_S5INODE", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_S5INODE_MAX", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_STAMP", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
+{ "KERN_POINTERS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "KERN_SIM", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "LEGACY", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, -1 },
{ "LFS64_CFLAGS", { 0, 0 }, { 0, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING, CONF_POSIX, 1, CONF_confstr, _CS_LFS64_CFLAGS },
{ "LFS64_LDFLAGS", { 0, 0 }, { 0, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING, CONF_POSIX, 1, CONF_confstr, _CS_LFS64_LDFLAGS },
{ "LFS64_LIBS", { 0, 0 }, { 0, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING, CONF_POSIX, 1, CONF_confstr, _CS_LFS64_LIBS },
@@ -218,234 +158,234 @@ const Conf_t conf[] =
{ "LFS_LDFLAGS", { 0, 0 }, { 0, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING, CONF_POSIX, 1, CONF_confstr, _CS_LFS_LDFLAGS },
{ "LFS_LIBS", { 0, 0 }, { 0, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING, CONF_POSIX, 1, CONF_confstr, _CS_LFS_LIBS },
{ "LFS_LINTFLAGS", { 0, 0 }, { 0, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING, CONF_POSIX, 1, CONF_confstr, _CS_LFS_LINTFLAGS },
-{ "LINE_MAX", { 0, 0 }, { _POSIX2_LINE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_LINE_MAX },
-{ "LINK_MAX", { 0, 0 }, { _POSIX_LINK_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_LINK_MAX },
-{ "LLONG_MAX", { 9223372036854775807LL, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "LLONG_MIN", { (-9223372036854775807LL-1LL), 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "LOCALEDEF", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_LOCALEDEF },
-{ "LOGIN_NAME_MAX", { 0, 0 }, { _POSIX_LOGIN_NAME_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_LOGIN_NAME_MAX },
-{ "LOGNAME_MAX", { 0, 0 }, { 8, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, _SC_LOGNAME_MAX },
-{ "LONG_BIT", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "LONG_MAX", { 2147483647, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "LONG_MIN", { -2147483648, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "LP64_OFF64", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XBS5, 1, CONF_sysconf, -1 },
+{ "LINE_MAX", { 0ULL, 0 }, { _POSIX2_LINE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_LINE_MAX },
+{ "LINK_MAX", { 0ULL, 0 }, { _POSIX_LINK_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_LINK_MAX },
+{ "LLONG_MAX", { 9223372036854775807ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "LLONG_MIN", { -9223372036854775807LL-1LL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "LOCALEDEF", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_LOCALEDEF },
+{ "LOGIN_NAME_MAX", { 0ULL, 0 }, { _POSIX_LOGIN_NAME_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_LOGIN_NAME_MAX },
+{ "LOGNAME_MAX", { 0ULL, 0 }, { 8ULL, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, _SC_LOGNAME_MAX },
+{ "LONG_BIT", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "LONG_MAX", { 2147483647ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "LONG_MIN", { -2147483647LL-1LL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "LP64_OFF64", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XBS5, 1, CONF_sysconf, -1 },
{ "LP64_OFF64_CFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "LP64_OFF64_LDFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "LP64_OFF64_LIBS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "LP64_OFF64_LINTFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
-{ "LPBIG_OFFBIG", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XBS5, 1, CONF_sysconf, -1 },
+{ "LPBIG_OFFBIG", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XBS5, 1, CONF_sysconf, -1 },
{ "LPBIG_OFFBIG_CFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "LPBIG_OFFBIG_LDFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "LPBIG_OFFBIG_LIBS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "LPBIG_OFFBIG_LINTFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
-{ "MACHINE", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "MAPPED_FILES", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MAPPED_FILES },
-{ "MAX_CANON", { 0, 0 }, { _POSIX_MAX_CANON, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_MAX_CANON },
-{ "MAX_INPUT", { 0, 0 }, { _POSIX_MAX_INPUT, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_MAX_INPUT },
-{ "MB_LEN_MAX", { 5, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "MCAS_OFFSET", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "MEMLOCK", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MEMLOCK },
-{ "MEMLOCK_RANGE", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MEMLOCK_RANGE },
-{ "MEMORY_PROTECTION", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MEMORY_PROTECTION },
-{ "MESSAGE_PASSING", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MESSAGE_PASSING },
-{ "MMAP_FIXED_ALIGNMENT", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "MONOTONIC_CLOCK", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MONOTONIC_CLOCK },
-{ "MQ_OPEN_MAX", { 0, 0 }, { _POSIX_MQ_OPEN_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_MQ_OPEN_MAX },
-{ "MQ_PRIO_MAX", { 0, 0 }, { _POSIX_MQ_PRIO_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_MQ_PRIO_MAX },
-{ "MSEM_LOCKID", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "MULTI_PROCESS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "NACLS_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SVID, 1, CONF_sysconf, -1 },
-{ "NAME_MAX", { 0, 0 }, { _POSIX_NAME_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_NAME_MAX },
-{ "NGROUPS_MAX", { 0, 0 }, { _POSIX_NGROUPS_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_NGROUPS_MAX },
-{ "NL_ARGMAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "NL_LANGMAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "NL_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "NL_MSGMAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "NL_NMAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "NL_SETMAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "NL_SPECMAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "NL_TEXTMAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "NO_TRUNC", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_NO_TRUNC },
-{ "NPROCESSORS_CONF", { 0, 0 }, { 0, 0 }, 0, CONF_SVID, 1, CONF_sysconf, _SC_NPROCESSORS_CONF },
-{ "NPROCESSORS_ONLN", { 0, 0 }, { 0, 0 }, 0, CONF_SVID, 1, CONF_sysconf, _SC_NPROCESSORS_ONLN },
-{ "NPROC_CONF", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "NPROC_ONLN", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "NSS_BUFLEN_GROUP", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "NSS_BUFLEN_PASSWD", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "NUM_PROCESSORS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "NZERO", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "OPEN_MAX", { 0, 0 }, { _POSIX_OPEN_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_OPEN_MAX },
-{ "OPEN_MAX_CEIL", { OPEN_MAX, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_AST, 1, CONF_nop, -1 },
-{ "OSREL_MAJ", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "OSREL_MIN", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "OSREL_PATCH", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "OS_BASE", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "OS_PROVIDER", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "OS_VERSION", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE, CONF_AES, 1, CONF_sysconf, -1 },
-{ "PAGESIZE", { 0, 0 }, { 4096, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_PAGESIZE },
-{ "PAGE_SIZE", { 0, 0 }, { 0, 0 }, CONF_MINMAX|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, _SC_PAGE_SIZE },
-{ "PASS_MAX", { 0, 0 }, { 8, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, _SC_PASS_MAX },
+{ "MACHINE", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, SI_MACHINE },
+{ "MAPPED_FILES", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MAPPED_FILES },
+{ "MAX_CANON", { 0ULL, 0 }, { _POSIX_MAX_CANON, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_MAX_CANON },
+{ "MAX_INPUT", { 0ULL, 0 }, { _POSIX_MAX_INPUT, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_MAX_INPUT },
+{ "MB_LEN_MAX", { 5ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "MCAS_OFFSET", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "MEMLOCK", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MEMLOCK },
+{ "MEMLOCK_RANGE", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MEMLOCK_RANGE },
+{ "MEMORY_PROTECTION", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MEMORY_PROTECTION },
+{ "MESSAGE_PASSING", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MESSAGE_PASSING },
+{ "MMAP_FIXED_ALIGNMENT", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "MONOTONIC_CLOCK", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MONOTONIC_CLOCK },
+{ "MQ_OPEN_MAX", { 0ULL, 0 }, { _POSIX_MQ_OPEN_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_MQ_OPEN_MAX },
+{ "MQ_PRIO_MAX", { 0ULL, 0 }, { _POSIX_MQ_PRIO_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_MQ_PRIO_MAX },
+{ "MSEM_LOCKID", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "MULTI_PROCESS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "NACLS_MAX", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SVID, 1, CONF_sysconf, -1 },
+{ "NAME_MAX", { 0ULL, 0 }, { _POSIX_NAME_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_NAME_MAX },
+{ "NGROUPS_MAX", { 0ULL, 0 }, { _POSIX_NGROUPS_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_NGROUPS_MAX },
+{ "NL_ARGMAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "NL_LANGMAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "NL_MAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "NL_MSGMAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "NL_NMAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "NL_SETMAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "NL_SPECMAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "NL_TEXTMAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "NO_TRUNC", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_NO_TRUNC },
+{ "NPROCESSORS_CONF", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SVID, 1, CONF_sysconf, _SC_NPROCESSORS_CONF },
+{ "NPROCESSORS_ONLN", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SVID, 1, CONF_sysconf, _SC_NPROCESSORS_ONLN },
+{ "NPROC_CONF", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "NPROC_ONLN", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "NSS_BUFLEN_GROUP", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "NSS_BUFLEN_PASSWD", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "NUM_PROCESSORS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "NZERO", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "OPEN_MAX", { 0ULL, 0 }, { _POSIX_OPEN_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_OPEN_MAX },
+{ "OPEN_MAX_CEIL", { OPEN_MAX, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_AST, 1, CONF_nop, -1 },
+{ "OSREL_MAJ", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "OSREL_MIN", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "OSREL_PATCH", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "OS_BASE", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
+{ "OS_PROVIDER", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
+{ "OS_VERSION", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE, CONF_AES, 1, CONF_sysconf, -1 },
+{ "PAGESIZE", { 0ULL, 0 }, { 4096ULL, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_PAGESIZE },
+{ "PAGE_SIZE", { 0ULL, 0 }, { 0ULL, 0 }, CONF_MINMAX|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, _SC_PAGE_SIZE },
+{ "PASS_MAX", { 0ULL, 0 }, { 8ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, _SC_PASS_MAX },
{ "PATH", { 0, 0 }, { 0, "/bin:/usr/bin" }, CONF_DEFER_CALL|CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_confstr, _CS_PATH },
-{ "PATH_MAX", { 0, 0 }, { _POSIX_PATH_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_PATH_MAX },
-{ "PBS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS },
-{ "PBS_ACCOUNTING", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_ACCOUNTING },
-{ "PBS_CHECKPOINT", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_CHECKPOINT },
-{ "PBS_LOCATE", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_LOCATE },
-{ "PBS_MESSAGE", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_MESSAGE },
-{ "PBS_TRACK", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_TRACK },
-{ "PHYS_PAGES", { 0, 0 }, { 0, 0 }, 0, CONF_SUN, 1, CONF_sysconf, _SC_PHYS_PAGES },
-{ "PID_MAX", { 0, 0 }, { 30000, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
-{ "PII", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PII_INTERNET", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PII_INTERNET_DGRAM", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PII_INTERNET_STREAM", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PII_OSI", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PII_OSI_CLTS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PII_OSI_COTS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PII_OSI_M", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PII_SOCKET", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PII_XTI", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PIPE_BUF", { 0, 0 }, { _POSIX_PIPE_BUF, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_PIPE_BUF },
-{ "POLL", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PRIORITIZED_IO", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_PRIORITIZED_IO },
-{ "PRIORITY_SCHEDULING", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_PRIORITY_SCHEDULING },
-{ "PRIO_IO", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_PRIO_IO },
-{ "PROC_RSRC_MGR", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "PTHREAD_DESTRUCTOR_ITERATIONS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "PTHREAD_KEYS_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "PTHREAD_STACK_MIN", { 4096, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_LIMIT|CONF_LIMIT_DEF, CONF_POSIX, 1, CONF_nop, -1 },
-{ "PTHREAD_THREADS_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "PTRDIFF_MAX", { 2147483647, 0 }, { 65535, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_LIMIT_DEF|CONF_MINMAX_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "PTRDIFF_MIN", { -2147483648, 0 }, { -65535, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_LIMIT_DEF|CONF_MINMAX_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "RAW_SOCKETS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_RAW_SOCKETS },
-{ "READER_WRITER_LOCKS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_READER_WRITER_LOCKS },
-{ "REALTIME", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, -1 },
-{ "REALTIME_SIGNALS", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_REALTIME_SIGNALS },
-{ "REALTIME_THREADS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, -1 },
-{ "REC_INCR_XFER_SIZE", { 0, 0 }, { 0, 0 }, CONF_LIMIT|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_REC_INCR_XFER_SIZE },
-{ "REC_MAX_XFER_SIZE", { 0, 0 }, { 0, 0 }, CONF_LIMIT|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_REC_MAX_XFER_SIZE },
-{ "REC_MIN_XFER_SIZE", { 0, 0 }, { 0, 0 }, CONF_LIMIT|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_REC_MIN_XFER_SIZE },
-{ "REC_XFER_ALIGN", { 0, 0 }, { 0, 0 }, CONF_LIMIT|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_REC_XFER_ALIGN },
-{ "REENTRANT_FUNCTIONS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "REGEXP", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_REGEXP },
-{ "REGEX_VERSION", { 0, 0 }, { 20030916, 0 }, CONF_FEATURE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "RELEASE", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "RESOURCE_LIMITS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "RE_DUP_MAX", { 0, 0 }, { _POSIX2_RE_DUP_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_RE_DUP_MAX },
-{ "RTSIG_MAX", { 0, 0 }, { _POSIX_RTSIG_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_RTSIG_MAX },
-{ "SAVED_IDS", { 0, 0 }, { 1, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SAVED_IDS },
-{ "SCHAR_MAX", { 127, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "SCHAR_MIN", { -128, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "SECURITY_CLASS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "SELECT", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "SEMAPHORES", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SEMAPHORES },
-{ "SEM_NSEMS_MAX", { 0, 0 }, { _POSIX_SEM_NSEMS_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_SEM_NSEMS_MAX },
-{ "SEM_VALUE_MAX", { 0, 0 }, { _POSIX_SEM_VALUE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_SEM_VALUE_MAX },
+{ "PATH_MAX", { 0ULL, 0 }, { _POSIX_PATH_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_PATH_MAX },
+{ "PBS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS },
+{ "PBS_ACCOUNTING", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_ACCOUNTING },
+{ "PBS_CHECKPOINT", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_CHECKPOINT },
+{ "PBS_LOCATE", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_LOCATE },
+{ "PBS_MESSAGE", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_MESSAGE },
+{ "PBS_TRACK", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_TRACK },
+{ "PHYS_PAGES", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SUN, 1, CONF_sysconf, _SC_PHYS_PAGES },
+{ "PID_MAX", { 0ULL, 0 }, { 30000ULL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
+{ "PII", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PII_INTERNET", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PII_INTERNET_DGRAM", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PII_INTERNET_STREAM", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PII_OSI", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PII_OSI_CLTS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PII_OSI_COTS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PII_OSI_M", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PII_SOCKET", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PII_XTI", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PIPE_BUF", { 0ULL, 0 }, { _POSIX_PIPE_BUF, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_PIPE_BUF },
+{ "POLL", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PRIORITIZED_IO", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_PRIORITIZED_IO },
+{ "PRIORITY_SCHEDULING", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_PRIORITY_SCHEDULING },
+{ "PRIO_IO", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_PRIO_IO },
+{ "PROC_RSRC_MGR", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "PTHREAD_DESTRUCTOR_ITERATIONS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "PTHREAD_KEYS_MAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "PTHREAD_STACK_MIN", { 4096ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_LIMIT|CONF_LIMIT_DEF, CONF_POSIX, 1, CONF_nop, -1 },
+{ "PTHREAD_THREADS_MAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "PTRDIFF_MAX", { 2147483647ULL, 0 }, { 65535ULL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_LIMIT_DEF|CONF_MINMAX_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "PTRDIFF_MIN", { -2147483647LL-1LL, 0 }, { -65535LL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_LIMIT_DEF|CONF_MINMAX_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "RAW_SOCKETS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_RAW_SOCKETS },
+{ "READER_WRITER_LOCKS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_READER_WRITER_LOCKS },
+{ "REALTIME", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, -1 },
+{ "REALTIME_SIGNALS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_REALTIME_SIGNALS },
+{ "REALTIME_THREADS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, -1 },
+{ "REC_INCR_XFER_SIZE", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_REC_INCR_XFER_SIZE },
+{ "REC_MAX_XFER_SIZE", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_REC_MAX_XFER_SIZE },
+{ "REC_MIN_XFER_SIZE", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_REC_MIN_XFER_SIZE },
+{ "REC_XFER_ALIGN", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_REC_XFER_ALIGN },
+{ "REENTRANT_FUNCTIONS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "REGEXP", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_REGEXP },
+{ "REGEX_VERSION", { 0ULL, 0 }, { 20030916ULL, 0 }, CONF_FEATURE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "RELEASE", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_AST, 1, CONF_nop, -1 },
+{ "RESOURCE_LIMITS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "RE_DUP_MAX", { 0ULL, 0 }, { _POSIX2_RE_DUP_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_RE_DUP_MAX },
+{ "RTSIG_MAX", { 0ULL, 0 }, { _POSIX_RTSIG_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_RTSIG_MAX },
+{ "SAVED_IDS", { 0ULL, 0 }, { 1ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SAVED_IDS },
+{ "SCHAR_MAX", { 127ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "SCHAR_MIN", { -127LL-1LL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "SECURITY_CLASS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "SELECT", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "SEMAPHORES", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SEMAPHORES },
+{ "SEM_NSEMS_MAX", { 0ULL, 0 }, { _POSIX_SEM_NSEMS_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_SEM_NSEMS_MAX },
+{ "SEM_VALUE_MAX", { 0ULL, 0 }, { _POSIX_SEM_VALUE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_SEM_VALUE_MAX },
{ "SH", { 0, 0 }, { 0, "/bin/sh" }, CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING|CONF_MINMAX_DEF, CONF_AST, 1, CONF_confstr, -1 },
-{ "SHARED_MEMORY_OBJECTS", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SHARED_MEMORY_OBJECTS },
-{ "SHELL", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SHELL },
-{ "SHM", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_SHM },
-{ "SHRT_MAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
-{ "SHRT_MIN", { -32768, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "SIGQUEUE_MAX", { 0, 0 }, { _POSIX_SIGQUEUE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_SIGQUEUE_MAX },
-{ "SIGRT_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SVID, 1, CONF_sysconf, _SC_SIGRT_MAX },
-{ "SIGRT_MIN", { 0, 0 }, { 0, 0 }, 0, CONF_SVID, 1, CONF_sysconf, _SC_SIGRT_MIN },
-{ "SIG_ATOMIC_MAX", { 2147483647, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "SIG_ATOMIC_MIN", { -2147483648, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "SIZE_MAX", { UINT_MAX, 0 }, { 65535, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_LIMIT_DEF|CONF_MINMAX_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "SLVM_MAXNODES", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "SOCK_MAXBUF", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "SOFTPOWER", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "SPAWN", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SPAWN },
-{ "SPIN_LOCKS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SPIN_LOCKS },
-{ "SPORADIC_SERVER", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SPORADIC_SERVER },
-{ "SRPC_DOMAIN", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "SHARED_MEMORY_OBJECTS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SHARED_MEMORY_OBJECTS },
+{ "SHELL", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SHELL },
+{ "SHM", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_SHM },
+{ "SHRT_MAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
+{ "SHRT_MIN", { -32767LL-1LL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "SIGQUEUE_MAX", { 0ULL, 0 }, { _POSIX_SIGQUEUE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_SIGQUEUE_MAX },
+{ "SIGRT_MAX", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SVID, 1, CONF_sysconf, _SC_SIGRT_MAX },
+{ "SIGRT_MIN", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_SVID, 1, CONF_sysconf, _SC_SIGRT_MIN },
+{ "SIG_ATOMIC_MAX", { 2147483647ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "SIG_ATOMIC_MIN", { -2147483647LL-1LL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "SIZE_MAX", { UINT_MAX, 0 }, { 65535ULL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_LIMIT_DEF|CONF_MINMAX_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "SLVM_MAXNODES", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "SOCK_MAXBUF", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "SOFTPOWER", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "SPAWN", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SPAWN },
+{ "SPIN_LOCKS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SPIN_LOCKS },
+{ "SPORADIC_SERVER", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SPORADIC_SERVER },
+{ "SRPC_DOMAIN", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
{ "SSIZE_MAX", { INT_MAX, 0 }, { _POSIX_SSIZE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_LIMIT_DEF|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_nop, -1 },
-{ "SS_REPL_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SS_REPL_MAX },
-{ "STD_BLK", { 0, 0 }, { 1024, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
-{ "STREAMS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_STREAMS },
-{ "STREAM_MAX", { 0, 0 }, { _POSIX_STREAM_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_STREAM_MAX },
-{ "SW_DEV", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_SW_DEV },
-{ "SYMLINKS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_pathconf, _PC_2_SYMLINKS },
-{ "SYMLINK_MAX", { 0, 0 }, { _POSIX_SYMLINK_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_SYMLINK_MAX },
-{ "SYMLOOP_MAX", { 0, 0 }, { _POSIX_SYMLOOP_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_SYMLOOP_MAX },
-{ "SYNCHRONIZED_IO", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SYNCHRONIZED_IO },
-{ "SYNC_IO", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_SYNC_IO },
-{ "SYSNAME", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "SYSPID_MAX", { 0, 0 }, { 2, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
-{ "THREADS", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREADS },
-{ "THREADS_PRIO_CEILING", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "THREADS_PRIO_INHERIT", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "THREAD_ATTR_STACKADDR", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_ATTR_STACKADDR },
-{ "THREAD_ATTR_STACKSIZE", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_ATTR_STACKSIZE },
-{ "THREAD_CPUTIME", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_CPUTIME },
-{ "THREAD_DESTRUCTOR_ITERATIONS", { 0, 0 }, { _POSIX_THREAD_DESTRUCTOR_ITERATIONS, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_PREFIX_ONLY|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_DESTRUCTOR_ITERATIONS },
-{ "THREAD_KEYS_MAX", { 0, 0 }, { _POSIX_THREAD_KEYS_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_PREFIX_ONLY|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_KEYS_MAX },
-{ "THREAD_PRIORITY_SCHEDULING", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_PRIORITY_SCHEDULING },
-{ "THREAD_PRIO_INHERIT", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_PRIO_INHERIT },
-{ "THREAD_PRIO_PROTECT", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_PRIO_PROTECT },
-{ "THREAD_PROCESS_SHARED", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_PROCESS_SHARED },
-{ "THREAD_SAFE_FUNCTIONS", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_SAFE_FUNCTIONS },
-{ "THREAD_SPORADIC_SERVER", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_SPORADIC_SERVER },
-{ "THREAD_STACK_MIN", { 0, 0 }, { 0, 0 }, CONF_LIMIT|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_STACK_MIN },
-{ "THREAD_THREADS_MAX", { 0, 0 }, { _POSIX_THREAD_THREADS_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_PREFIX_ONLY|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_THREADS_MAX },
-{ "TIMEOUTS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TIMEOUTS },
-{ "TIMERS", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TIMERS },
-{ "TIMER_MAX", { 0, 0 }, { _POSIX_TIMER_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_TIMER_MAX },
+{ "SS_REPL_MAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SS_REPL_MAX },
+{ "STD_BLK", { 0ULL, 0 }, { 1024ULL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
+{ "STREAMS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_STREAMS },
+{ "STREAM_MAX", { 0ULL, 0 }, { _POSIX_STREAM_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_STREAM_MAX },
+{ "SW_DEV", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_SW_DEV },
+{ "SYMLINKS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_pathconf, _PC_2_SYMLINKS },
+{ "SYMLINK_MAX", { 0ULL, 0 }, { _POSIX_SYMLINK_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_SYMLINK_MAX },
+{ "SYMLOOP_MAX", { 0ULL, 0 }, { _POSIX_SYMLOOP_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_SYMLOOP_MAX },
+{ "SYNCHRONIZED_IO", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SYNCHRONIZED_IO },
+{ "SYNC_IO", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_SYNC_IO },
+{ "SYSNAME", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, SI_SYSNAME },
+{ "SYSPID_MAX", { 0ULL, 0 }, { 2ULL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
+{ "THREADS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREADS },
+{ "THREADS_PRIO_CEILING", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "THREADS_PRIO_INHERIT", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "THREAD_ATTR_STACKADDR", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_ATTR_STACKADDR },
+{ "THREAD_ATTR_STACKSIZE", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_ATTR_STACKSIZE },
+{ "THREAD_CPUTIME", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_CPUTIME },
+{ "THREAD_DESTRUCTOR_ITERATIONS", { 0ULL, 0 }, { _POSIX_THREAD_DESTRUCTOR_ITERATIONS, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_PREFIX_ONLY|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_DESTRUCTOR_ITERATIONS },
+{ "THREAD_KEYS_MAX", { 0ULL, 0 }, { _POSIX_THREAD_KEYS_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_PREFIX_ONLY|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_KEYS_MAX },
+{ "THREAD_PRIORITY_SCHEDULING", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_PRIORITY_SCHEDULING },
+{ "THREAD_PRIO_INHERIT", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_PRIO_INHERIT },
+{ "THREAD_PRIO_PROTECT", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_PRIO_PROTECT },
+{ "THREAD_PROCESS_SHARED", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_PROCESS_SHARED },
+{ "THREAD_SAFE_FUNCTIONS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_SAFE_FUNCTIONS },
+{ "THREAD_SPORADIC_SERVER", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_SPORADIC_SERVER },
+{ "THREAD_STACK_MIN", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_STACK_MIN },
+{ "THREAD_THREADS_MAX", { 0ULL, 0 }, { _POSIX_THREAD_THREADS_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_PREFIX_ONLY|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_THREADS_MAX },
+{ "TIMEOUTS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TIMEOUTS },
+{ "TIMERS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TIMERS },
+{ "TIMER_MAX", { 0ULL, 0 }, { _POSIX_TIMER_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_TIMER_MAX },
{ "TMP", { 0, 0 }, { 0, "/tmp" }, CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING|CONF_MINMAX_DEF, CONF_AST, 1, CONF_confstr, -1 },
-{ "TMP_MAX", { 17576, 0 }, { 10000, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_LIMIT_DEF|CONF_MINMAX_DEF, CONF_C, 1, CONF_sysconf, -1 },
-{ "TRACE", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE },
-{ "TRACE_EVENT_FILTER", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_EVENT_FILTER },
-{ "TRACE_EVENT_NAME_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_EVENT_NAME_MAX },
-{ "TRACE_INHERIT", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_INHERIT },
-{ "TRACE_LOG", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_LOG },
-{ "TRACE_NAME_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_NAME_MAX },
-{ "TRACE_SYS_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_SYS_MAX },
-{ "TRACE_USER_EVENT_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_USER_EVENT_MAX },
-{ "TTY_NAME_MAX", { 0, 0 }, { _POSIX_TTY_NAME_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_TTY_NAME_MAX },
-{ "TYPED_MEMORY_OBJECTS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TYPED_MEMORY_OBJECTS },
-{ "TZNAME_MAX", { 0, 0 }, { _POSIX_TZNAME_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_TZNAME_MAX },
-{ "T_IOV_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_C, 1, CONF_sysconf, _SC_T_IOV_MAX },
-{ "UCHAR_MAX", { 255, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "UCHAR_MIN", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
-{ "UID_MAX", { 0, 0 }, { 60002, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
-{ "UINT_MAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
-{ "UIO_MAXIOV", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "ULLONG_MAX", { 18446744073709551615ULL, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "ULONG_MAX", { 4294967295, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "UNIX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_UNIX },
-{ "UPE", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_UPE },
-{ "USER_LIMIT", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "USHRT_MAX", { 65535, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "V6_ILP32_OFF32", { 0, 0 }, { 0, 0 }, CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_V6_ILP32_OFF32 },
-{ "V6_ILP32_OFFBIG", { 0, 0 }, { 0, 0 }, CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_V6_ILP32_OFFBIG },
-{ "V6_LP64_OFF64", { 0, 0 }, { 0, 0 }, CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_V6_LP64_OFF64 },
-{ "V6_LPBIG_OFFBIG", { 0, 0 }, { 0, 0 }, CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_V6_LPBIG_OFFBIG },
-{ "VDISABLE", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_VDISABLE },
+{ "TMP_MAX", { 17576ULL, 0 }, { 10000ULL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_LIMIT_DEF|CONF_MINMAX_DEF, CONF_C, 1, CONF_sysconf, -1 },
+{ "TRACE", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE },
+{ "TRACE_EVENT_FILTER", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_EVENT_FILTER },
+{ "TRACE_EVENT_NAME_MAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_EVENT_NAME_MAX },
+{ "TRACE_INHERIT", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_INHERIT },
+{ "TRACE_LOG", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_LOG },
+{ "TRACE_NAME_MAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_NAME_MAX },
+{ "TRACE_SYS_MAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_SYS_MAX },
+{ "TRACE_USER_EVENT_MAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_USER_EVENT_MAX },
+{ "TTY_NAME_MAX", { 0ULL, 0 }, { _POSIX_TTY_NAME_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_TTY_NAME_MAX },
+{ "TYPED_MEMORY_OBJECTS", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TYPED_MEMORY_OBJECTS },
+{ "TZNAME_MAX", { 0ULL, 0 }, { _POSIX_TZNAME_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_TZNAME_MAX },
+{ "T_IOV_MAX", { 0ULL, 0 }, { 0ULL, 0 }, 0, CONF_C, 1, CONF_sysconf, _SC_T_IOV_MAX },
+{ "UCHAR_MAX", { 255ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "UCHAR_MIN", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
+{ "UID_MAX", { 0ULL, 0 }, { 60002ULL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
+{ "UINT_MAX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
+{ "UIO_MAXIOV", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "ULLONG_MAX", { 18446744073709551615ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "ULONG_MAX", { 4294967295ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "UNIX", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_UNIX },
+{ "UPE", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_UPE },
+{ "USER_LIMIT", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
+{ "USHRT_MAX", { 65535ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "V6_ILP32_OFF32", { 0ULL, 0 }, { 0ULL, 0 }, CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_V6_ILP32_OFF32 },
+{ "V6_ILP32_OFFBIG", { 0ULL, 0 }, { 0ULL, 0 }, CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_V6_ILP32_OFFBIG },
+{ "V6_LP64_OFF64", { 0ULL, 0 }, { 0ULL, 0 }, CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_V6_LP64_OFF64 },
+{ "V6_LPBIG_OFFBIG", { 0ULL, 0 }, { 0ULL, 0 }, CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_V6_LPBIG_OFFBIG },
+{ "VDISABLE", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_VDISABLE },
{ "VERSION", { 0, 0 }, { 0, 0 }, CONF_PREFIXED|CONF_STANDARD|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "VERSION", { 0, 0 }, { 200112, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "VERSION", { 0, 0 }, { 200112, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 2, CONF_sysconf, -1 },
-{ "VERSION", { 0, 0 }, { 600, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_VERSION },
-{ "VERSION", { 0, 0 }, { 0, 0 }, CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_XPG, 3, CONF_sysconf, -1 },
-{ "VERSION", { 0, 0 }, { 0, 0 }, CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_XPG, 4, CONF_sysconf, -1 },
-{ "VERSION", { 0, 0 }, { 0, 0 }, CONF_MINMAX|CONF_PREFIXED|CONF_STANDARD, CONF_AST, 1, CONF_nop, -1 },
-{ "VERSION", { 0, 0 }, { 0, 0 }, CONF_PREFIXED|CONF_STANDARD, CONF_GNU, 1, CONF_nop, -1 },
-{ "VERSION", { 0, 0 }, { 0, 0 }, CONF_PREFIXED|CONF_STANDARD, CONF_TRUSTEDBSD, 1, CONF_nop, -1 },
-{ "VERSION_88", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_LIMIT|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "VERSION_88", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
-{ "VERSION_90", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_LIMIT|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "VERSION_90", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
-{ "VERSION_93", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_LIMIT|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "VERSION_93", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
-{ "WCHAR_MAX", { 2147483647, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "WCHAR_MIN", { -2147483648, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "WINT_MAX", { 2147483647, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "WINT_MIN", { -2147483648, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "WORD_BIT", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "XCU_VERSION", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_XCU_VERSION },
-{ "XPG2", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "XPG3", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "XPG4", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "VERSION", { 0ULL, 0 }, { 200112ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "VERSION", { 0ULL, 0 }, { 200112ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 2, CONF_sysconf, -1 },
+{ "VERSION", { 0ULL, 0 }, { 600ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_VERSION },
+{ "VERSION", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_XPG, 3, CONF_sysconf, -1 },
+{ "VERSION", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_XPG, 4, CONF_sysconf, -1 },
+{ "VERSION", { 0ULL, 0 }, { 0ULL, 0 }, CONF_MINMAX|CONF_PREFIXED|CONF_STANDARD, CONF_AST, 1, CONF_nop, -1 },
+{ "VERSION", { 0ULL, 0 }, { 0ULL, 0 }, CONF_PREFIXED|CONF_STANDARD, CONF_GNU, 1, CONF_nop, -1 },
+{ "VERSION", { 0ULL, 0 }, { 0ULL, 0 }, CONF_PREFIXED|CONF_STANDARD, CONF_TRUSTEDBSD, 1, CONF_nop, -1 },
+{ "VERSION_88", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_LIMIT|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "VERSION_88", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
+{ "VERSION_90", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_LIMIT|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "VERSION_90", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
+{ "VERSION_93", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_LIMIT|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "VERSION_93", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
+{ "WCHAR_MAX", { 2147483647ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "WCHAR_MIN", { -2147483647LL-1LL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "WINT_MAX", { 2147483647ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "WINT_MIN", { -2147483647LL-1LL, 0 }, { 0ULL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "WORD_BIT", { 0ULL, 0 }, { 0ULL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "XCU_VERSION", { 0ULL, 0 }, { 0ULL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_XCU_VERSION },
+{ "XPG2", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "XPG3", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "XPG4", { 0ULL, 0 }, { 0ULL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_nop, -1 },
};
int conf_elements = (int)sizeof(conf) / (int)sizeof(conf[0]);
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/conftab.h b/usr/src/lib/libast/sparc/src/lib/libast/conftab.h
index c16dbc0e06..d5e15e0a5b 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/conftab.h
+++ b/usr/src/lib/libast/sparc/src/lib/libast/conftab.h
@@ -1,66 +1,4 @@
-
-/* : : generated by proto : : */
-
-
#ifndef _CONFTAB_H
-#if !defined(__PROTO__)
-# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
-# if defined(__cplusplus)
-# define __LINKAGE__ "C"
-# else
-# define __LINKAGE__
-# endif
-# define __STDARG__
-# define __PROTO__(x) x
-# define __OTORP__(x)
-# define __PARAM__(n,o) n
-# if !defined(__STDC__) && !defined(__cplusplus)
-# if !defined(c_plusplus)
-# define const
-# endif
-# define signed
-# define void int
-# define volatile
-# define __V_ char
-# else
-# define __V_ void
-# endif
-# else
-# define __PROTO__(x) ()
-# define __OTORP__(x) x
-# define __PARAM__(n,o) o
-# define __LINKAGE__
-# define __V_ char
-# define const
-# define signed
-# define void int
-# define volatile
-# endif
-# define __MANGLE__ __LINKAGE__
-# if defined(__cplusplus) || defined(c_plusplus)
-# define __VARARG__ ...
-# else
-# define __VARARG__
-# endif
-# if defined(__STDARG__)
-# define __VA_START__(p,a) va_start(p,a)
-# else
-# define __VA_START__(p,a) va_start(p)
-# endif
-# if !defined(__INLINE__)
-# if defined(__cplusplus)
-# define __INLINE__ extern __MANGLE__ inline
-# else
-# if defined(_WIN32) && !defined(__GNUC__)
-# define __INLINE__ __inline
-# endif
-# endif
-# endif
-#endif
-#if !defined(__LINKAGE__)
-#define __LINKAGE__ /* 2004-08-11 transition */
-#endif
-
#define _CONFTAB_H
#if !defined(SYS_NMLEN)
@@ -68,7 +6,11 @@
#endif
#include <sys/systeminfo.h>
-/* : : generated by conf from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/comp/conf.tab : : */
+/* : : generated by conf from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/comp/conf.tab : : */
+
+#if !defined(const) && !defined(__STDC__) && !defined(__cplusplus) && !defined(c_plusplus)
+#define const
+#endif
#define conf _ast_conf_data
#define conf_elements _ast_conf_ndata
@@ -117,8 +59,6 @@
struct Conf_s; typedef struct Conf_s Conf_t;
-typedef int (*Conf_f) __PROTO__((Conf_t*, intmax_t*, char**));
-
typedef struct Value_s
{
intmax_t number;
@@ -130,7 +70,7 @@ struct Conf_s
const char name[32];
Value_t limit;
Value_t minmax;
- short flags;
+ unsigned int flags;
short standard;
short section;
short call;
@@ -145,10 +85,10 @@ typedef struct Prefix_s
short call;
} Prefix_t;
-extern __MANGLE__ const Conf_t conf[];
-extern __MANGLE__ int conf_elements;
+extern const Conf_t conf[];
+extern int conf_elements;
-extern __MANGLE__ const Prefix_t prefix[];
-extern __MANGLE__ int prefix_elements;
+extern const Prefix_t prefix[];
+extern int prefix_elements;
#endif
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/lc.h b/usr/src/lib/libast/sparc/src/lib/libast/lc.h
index fdd804f36e..b225864bbc 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/lc.h
+++ b/usr/src/lib/libast/sparc/src/lib/libast/lc.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/lctab.h b/usr/src/lib/libast/sparc/src/lib/libast/lctab.c
index 6abbd72c65..4927e1fd3a 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/lctab.h
+++ b/usr/src/lib/libast/sparc/src/lib/libast/lctab.c
@@ -1,6 +1,10 @@
/* : : generated by ./lcgen : : */
-static Lc_attribute_t attribute_es[] =
+#include "lclib.h"
+#include "lclang.h"
+
+
+const Lc_attribute_t attribute_es[] =
{
{"traditional",LC_default,
#ifdef SUBLANG_SPANISH_TRADITIONAL
@@ -20,7 +24,7 @@ SUBLANG_SPANISH_MODERN,
},
};
-static const Lc_charset_t charset[] =
+const Lc_charset_t lc_charsets[] =
{
{"iso8859-1","latin1|west-europe","1252",},
{"iso8859-2","latin2|east-europe","1250",},
@@ -42,11 +46,11 @@ static const Lc_charset_t charset[] =
0
};
-static const Lc_language_t language[] =
+const Lc_language_t lc_languages[] =
{
-{"C","C","POSIX",&charset[0],LC_default,0,0,0,},
-{"debug","debug",0,&charset[0],LC_debug,0,0,0,},
-{"aa","afar",0,&charset[0],0,
+{"C","C","POSIX",&lc_charsets[0],LC_default,0,0,0,},
+{"debug","debug",0,&lc_charsets[0],LC_debug,0,0,0,},
+{"aa","afar",0,&lc_charsets[0],0,
#ifdef LANG_AFAR
LANG_AFAR,
#else
@@ -54,7 +58,7 @@ LANG_AFAR,
#endif
0,0,
},
-{"ab","abkhazian",0,&charset[0],0,
+{"ab","abkhazian",0,&lc_charsets[0],0,
#ifdef LANG_ABKHAZIAN
LANG_ABKHAZIAN,
#else
@@ -62,7 +66,7 @@ LANG_ABKHAZIAN,
#endif
0,0,
},
-{"af","afrikaans","afr",&charset[0],0,
+{"af","afrikaans","afr",&lc_charsets[0],0,
#ifdef LANG_AFRIKAANS
LANG_AFRIKAANS,
#else
@@ -70,7 +74,7 @@ LANG_AFRIKAANS,
#endif
0,0,
},
-{"am","amharic",0,&charset[0],0,
+{"am","amharic",0,&lc_charsets[0],0,
#ifdef LANG_AMHARIC
LANG_AMHARIC,
#else
@@ -78,7 +82,7 @@ LANG_AMHARIC,
#endif
0,0,
},
-{"ar","arabic","ara",&charset[5],0,
+{"ar","arabic","ara",&lc_charsets[5],0,
#ifdef LANG_ARABIC
LANG_ARABIC,
#else
@@ -86,7 +90,7 @@ LANG_ARABIC,
#endif
0,0,
},
-{"as","assamese",0,&charset[0],0,
+{"as","assamese",0,&lc_charsets[0],0,
#ifdef LANG_ASSAMESE
LANG_ASSAMESE,
#else
@@ -94,7 +98,7 @@ LANG_ASSAMESE,
#endif
0,0,
},
-{"ay","aymara",0,&charset[0],0,
+{"ay","aymara",0,&lc_charsets[0],0,
#ifdef LANG_AYMARA
LANG_AYMARA,
#else
@@ -102,7 +106,7 @@ LANG_AYMARA,
#endif
0,0,
},
-{"az","azerbaijani",0,&charset[0],0,
+{"az","azerbaijani",0,&lc_charsets[0],0,
#ifdef LANG_AZERBAIJANI
LANG_AZERBAIJANI,
#else
@@ -110,7 +114,7 @@ LANG_AZERBAIJANI,
#endif
0,0,
},
-{"ba","bashkir",0,&charset[0],0,
+{"ba","bashkir",0,&lc_charsets[0],0,
#ifdef LANG_BASHKIR
LANG_BASHKIR,
#else
@@ -118,7 +122,7 @@ LANG_BASHKIR,
#endif
0,0,
},
-{"be","belarusian","bel",&charset[0],0,
+{"be","belarusian","bel",&lc_charsets[0],0,
#ifdef LANG_BELARUSIAN
LANG_BELARUSIAN,
#else
@@ -126,7 +130,7 @@ LANG_BELARUSIAN,
#endif
0,0,
},
-{"bg","bulgarian","bul",&charset[4],0,
+{"bg","bulgarian","bul",&lc_charsets[4],0,
#ifdef LANG_BULGARIAN
LANG_BULGARIAN,
#else
@@ -134,7 +138,7 @@ LANG_BULGARIAN,
#endif
0,0,
},
-{"bh","bihari",0,&charset[0],0,
+{"bh","bihari",0,&lc_charsets[0],0,
#ifdef LANG_BIHARI
LANG_BIHARI,
#else
@@ -142,7 +146,7 @@ LANG_BIHARI,
#endif
0,0,
},
-{"bi","bislama",0,&charset[0],0,
+{"bi","bislama",0,&lc_charsets[0],0,
#ifdef LANG_BISLAMA
LANG_BISLAMA,
#else
@@ -150,7 +154,7 @@ LANG_BISLAMA,
#endif
0,0,
},
-{"bn","bengali-bangla",0,&charset[0],0,
+{"bn","bengali-bangla",0,&lc_charsets[0],0,
#ifdef LANG_BENGALI_BANGLA
LANG_BENGALI_BANGLA,
#else
@@ -158,7 +162,7 @@ LANG_BENGALI_BANGLA,
#endif
0,0,
},
-{"bo","tibetan",0,&charset[0],0,
+{"bo","tibetan",0,&lc_charsets[0],0,
#ifdef LANG_TIBETAN
LANG_TIBETAN,
#else
@@ -166,7 +170,7 @@ LANG_TIBETAN,
#endif
0,0,
},
-{"br","breton",0,&charset[0],0,
+{"br","breton",0,&lc_charsets[0],0,
#ifdef LANG_BRETON
LANG_BRETON,
#else
@@ -174,7 +178,7 @@ LANG_BRETON,
#endif
0,0,
},
-{"ca","catalan","cat",&charset[0],0,
+{"ca","catalan","cat",&lc_charsets[0],0,
#ifdef LANG_CATALAN
LANG_CATALAN,
#else
@@ -182,7 +186,7 @@ LANG_CATALAN,
#endif
0,0,
},
-{"co","corsican",0,&charset[0],0,
+{"co","corsican",0,&lc_charsets[0],0,
#ifdef LANG_CORSICAN
LANG_CORSICAN,
#else
@@ -190,7 +194,7 @@ LANG_CORSICAN,
#endif
0,0,
},
-{"cs","czech","ces|cze",&charset[1],0,
+{"cs","czech","ces|cze",&lc_charsets[1],0,
#ifdef LANG_CZECH
LANG_CZECH,
#else
@@ -198,7 +202,7 @@ LANG_CZECH,
#endif
0,0,
},
-{"cy","welsh",0,&charset[0],0,
+{"cy","welsh",0,&lc_charsets[0],0,
#ifdef LANG_WELSH
LANG_WELSH,
#else
@@ -206,7 +210,7 @@ LANG_WELSH,
#endif
0,0,
},
-{"da","danish","dan",&charset[0],0,
+{"da","danish","dan",&lc_charsets[0],0,
#ifdef LANG_DANISH
LANG_DANISH,
#else
@@ -214,7 +218,7 @@ LANG_DANISH,
#endif
0,0,
},
-{"de","german","deu|ger",&charset[0],0,
+{"de","german","deu|ger",&lc_charsets[0],0,
#ifdef LANG_GERMAN
LANG_GERMAN,
#else
@@ -222,7 +226,7 @@ LANG_GERMAN,
#endif
0,0,
},
-{"dz","bhutani",0,&charset[0],0,
+{"dz","bhutani",0,&lc_charsets[0],0,
#ifdef LANG_BHUTANI
LANG_BHUTANI,
#else
@@ -230,7 +234,7 @@ LANG_BHUTANI,
#endif
0,0,
},
-{"el","greek","ell|gre",&charset[6],0,
+{"el","greek","ell|gre",&lc_charsets[6],0,
#ifdef LANG_GREEK
LANG_GREEK,
#else
@@ -238,7 +242,7 @@ LANG_GREEK,
#endif
0,0,
},
-{"en","english","eng",&charset[0],0,
+{"en","english","eng",&lc_charsets[0],0,
#ifdef LANG_ENGLISH
LANG_ENGLISH,
#else
@@ -246,7 +250,7 @@ LANG_ENGLISH,
#endif
0,0,
},
-{"eo","esperanto",0,&charset[0],0,
+{"eo","esperanto",0,&lc_charsets[0],0,
#ifdef LANG_ESPERANTO
LANG_ESPERANTO,
#else
@@ -254,7 +258,7 @@ LANG_ESPERANTO,
#endif
0,0,
},
-{"es","spanish","spa",&charset[0],0,
+{"es","spanish","spa",&lc_charsets[0],0,
#ifdef LANG_SPANISH
LANG_SPANISH,
#else
@@ -262,7 +266,7 @@ LANG_SPANISH,
#endif
&attribute_es[0],&attribute_es[1],
},
-{"et","estonian","est",&charset[2],0,
+{"et","estonian","est",&lc_charsets[2],0,
#ifdef LANG_ESTONIAN
LANG_ESTONIAN,
#else
@@ -270,7 +274,7 @@ LANG_ESTONIAN,
#endif
0,0,
},
-{"eu","basque","eus|baq",&charset[0],0,
+{"eu","basque","eus|baq",&lc_charsets[0],0,
#ifdef LANG_BASQUE
LANG_BASQUE,
#else
@@ -278,7 +282,7 @@ LANG_BASQUE,
#endif
0,0,
},
-{"fa","persian",0,&charset[0],0,
+{"fa","persian",0,&lc_charsets[0],0,
#ifdef LANG_PERSIAN
LANG_PERSIAN,
#else
@@ -286,7 +290,7 @@ LANG_PERSIAN,
#endif
0,0,
},
-{"fi","finnish","fin",&charset[0],0,
+{"fi","finnish","fin",&lc_charsets[0],0,
#ifdef LANG_FINNISH
LANG_FINNISH,
#else
@@ -294,7 +298,7 @@ LANG_FINNISH,
#endif
0,0,
},
-{"fj","fiji",0,&charset[0],0,
+{"fj","fiji",0,&lc_charsets[0],0,
#ifdef LANG_FIJI
LANG_FIJI,
#else
@@ -302,7 +306,7 @@ LANG_FIJI,
#endif
0,0,
},
-{"fo","faeroese",0,&charset[0],0,
+{"fo","faeroese",0,&lc_charsets[0],0,
#ifdef LANG_FAEROESE
LANG_FAEROESE,
#else
@@ -310,7 +314,7 @@ LANG_FAEROESE,
#endif
0,0,
},
-{"fr","french","fra|fre",&charset[0],0,
+{"fr","french","fra|fre",&lc_charsets[0],0,
#ifdef LANG_FRENCH
LANG_FRENCH,
#else
@@ -318,7 +322,7 @@ LANG_FRENCH,
#endif
0,0,
},
-{"fy","frisian",0,&charset[0],0,
+{"fy","frisian",0,&lc_charsets[0],0,
#ifdef LANG_FRISIAN
LANG_FRISIAN,
#else
@@ -326,7 +330,7 @@ LANG_FRISIAN,
#endif
0,0,
},
-{"ga","irish",0,&charset[11],0,
+{"ga","irish",0,&lc_charsets[11],0,
#ifdef LANG_IRISH
LANG_IRISH,
#else
@@ -334,7 +338,7 @@ LANG_IRISH,
#endif
0,0,
},
-{"gd","scots-gaelic",0,&charset[11],0,
+{"gd","scots-gaelic",0,&lc_charsets[11],0,
#ifdef LANG_SCOTS_GAELIC
LANG_SCOTS_GAELIC,
#else
@@ -342,7 +346,7 @@ LANG_SCOTS_GAELIC,
#endif
0,0,
},
-{"gl","galician",0,&charset[0],0,
+{"gl","galician",0,&lc_charsets[0],0,
#ifdef LANG_GALICIAN
LANG_GALICIAN,
#else
@@ -350,7 +354,7 @@ LANG_GALICIAN,
#endif
0,0,
},
-{"gn","guarani",0,&charset[0],0,
+{"gn","guarani",0,&lc_charsets[0],0,
#ifdef LANG_GUARANI
LANG_GUARANI,
#else
@@ -358,7 +362,7 @@ LANG_GUARANI,
#endif
0,0,
},
-{"gu","gujarati",0,&charset[0],0,
+{"gu","gujarati",0,&lc_charsets[0],0,
#ifdef LANG_GUJARATI
LANG_GUJARATI,
#else
@@ -366,7 +370,7 @@ LANG_GUJARATI,
#endif
0,0,
},
-{"ha","hausa",0,&charset[0],0,
+{"ha","hausa",0,&lc_charsets[0],0,
#ifdef LANG_HAUSA
LANG_HAUSA,
#else
@@ -374,7 +378,7 @@ LANG_HAUSA,
#endif
0,0,
},
-{"he","hebrew","heb",&charset[7],0,
+{"he","hebrew","heb",&lc_charsets[7],0,
#ifdef LANG_HEBREW
LANG_HEBREW,
#else
@@ -382,7 +386,7 @@ LANG_HEBREW,
#endif
0,0,
},
-{"hi","hindi",0,&charset[0],0,
+{"hi","hindi",0,&lc_charsets[0],0,
#ifdef LANG_HINDI
LANG_HINDI,
#else
@@ -390,7 +394,7 @@ LANG_HINDI,
#endif
0,0,
},
-{"hr","croatian","hrv|scr",&charset[1],0,
+{"hr","croatian","hrv|scr",&lc_charsets[1],0,
#ifdef LANG_CROATIAN
LANG_CROATIAN,
#else
@@ -398,7 +402,7 @@ LANG_CROATIAN,
#endif
0,0,
},
-{"hu","hungarian","hun",&charset[1],0,
+{"hu","hungarian","hun",&lc_charsets[1],0,
#ifdef LANG_HUNGARIAN
LANG_HUNGARIAN,
#else
@@ -406,7 +410,7 @@ LANG_HUNGARIAN,
#endif
0,0,
},
-{"hy","armenian",0,&charset[0],0,
+{"hy","armenian",0,&lc_charsets[0],0,
#ifdef LANG_ARMENIAN
LANG_ARMENIAN,
#else
@@ -414,7 +418,7 @@ LANG_ARMENIAN,
#endif
0,0,
},
-{"ia","interlingua",0,&charset[0],0,
+{"ia","interlingua",0,&lc_charsets[0],0,
#ifdef LANG_INTERLINGUA
LANG_INTERLINGUA,
#else
@@ -422,7 +426,7 @@ LANG_INTERLINGUA,
#endif
0,0,
},
-{"id","indonesian","ind",&charset[0],0,
+{"id","indonesian","ind",&lc_charsets[0],0,
#ifdef LANG_INDONESIAN
LANG_INDONESIAN,
#else
@@ -430,7 +434,7 @@ LANG_INDONESIAN,
#endif
0,0,
},
-{"ie","interlingue",0,&charset[0],0,
+{"ie","interlingue",0,&lc_charsets[0],0,
#ifdef LANG_INTERLINGUE
LANG_INTERLINGUE,
#else
@@ -438,7 +442,7 @@ LANG_INTERLINGUE,
#endif
0,0,
},
-{"ik","inupiak",0,&charset[0],0,
+{"ik","inupiak",0,&lc_charsets[0],0,
#ifdef LANG_INUPIAK
LANG_INUPIAK,
#else
@@ -446,7 +450,7 @@ LANG_INUPIAK,
#endif
0,0,
},
-{"in","indonesian",0,&charset[0],0,
+{"in","indonesian",0,&lc_charsets[0],0,
#ifdef LANG_INDONESIAN
LANG_INDONESIAN,
#else
@@ -454,7 +458,7 @@ LANG_INDONESIAN,
#endif
0,0,
},
-{"is","icelandic","isl|ice",&charset[0],0,
+{"is","icelandic","isl|ice",&lc_charsets[0],0,
#ifdef LANG_ICELANDIC
LANG_ICELANDIC,
#else
@@ -462,7 +466,7 @@ LANG_ICELANDIC,
#endif
0,0,
},
-{"it","italian","ita",&charset[0],0,
+{"it","italian","ita",&lc_charsets[0],0,
#ifdef LANG_ITALIAN
LANG_ITALIAN,
#else
@@ -470,7 +474,7 @@ LANG_ITALIAN,
#endif
0,0,
},
-{"iw","hebrew",0,&charset[0],0,
+{"iw","hebrew",0,&lc_charsets[0],0,
#ifdef LANG_HEBREW
LANG_HEBREW,
#else
@@ -478,7 +482,7 @@ LANG_HEBREW,
#endif
0,0,
},
-{"ja","japanese","jpn",&charset[0],0,
+{"ja","japanese","jpn",&lc_charsets[0],0,
#ifdef LANG_JAPANESE
LANG_JAPANESE,
#else
@@ -486,7 +490,7 @@ LANG_JAPANESE,
#endif
0,0,
},
-{"ji","yiddish",0,&charset[0],0,
+{"ji","yiddish",0,&lc_charsets[0],0,
#ifdef LANG_YIDDISH
LANG_YIDDISH,
#else
@@ -494,7 +498,7 @@ LANG_YIDDISH,
#endif
0,0,
},
-{"jw","javanese",0,&charset[0],0,
+{"jw","javanese",0,&lc_charsets[0],0,
#ifdef LANG_JAVANESE
LANG_JAVANESE,
#else
@@ -502,7 +506,7 @@ LANG_JAVANESE,
#endif
0,0,
},
-{"ka","georgian",0,&charset[0],0,
+{"ka","georgian",0,&lc_charsets[0],0,
#ifdef LANG_GEORGIAN
LANG_GEORGIAN,
#else
@@ -510,7 +514,7 @@ LANG_GEORGIAN,
#endif
0,0,
},
-{"kk","kazakh","kaz",&charset[0],0,
+{"kk","kazakh","kaz",&lc_charsets[0],0,
#ifdef LANG_KAZAKH
LANG_KAZAKH,
#else
@@ -518,7 +522,7 @@ LANG_KAZAKH,
#endif
0,0,
},
-{"kl","greenlandic",0,&charset[0],0,
+{"kl","greenlandic",0,&lc_charsets[0],0,
#ifdef LANG_GREENLANDIC
LANG_GREENLANDIC,
#else
@@ -526,7 +530,7 @@ LANG_GREENLANDIC,
#endif
0,0,
},
-{"km","cambodian",0,&charset[0],0,
+{"km","cambodian",0,&lc_charsets[0],0,
#ifdef LANG_CAMBODIAN
LANG_CAMBODIAN,
#else
@@ -534,7 +538,7 @@ LANG_CAMBODIAN,
#endif
0,0,
},
-{"kn","kannada",0,&charset[0],0,
+{"kn","kannada",0,&lc_charsets[0],0,
#ifdef LANG_KANNADA
LANG_KANNADA,
#else
@@ -542,7 +546,7 @@ LANG_KANNADA,
#endif
0,0,
},
-{"ko","korean","kor",&charset[0],0,
+{"ko","korean","kor",&lc_charsets[0],0,
#ifdef LANG_KOREAN
LANG_KOREAN,
#else
@@ -550,7 +554,7 @@ LANG_KOREAN,
#endif
0,0,
},
-{"ks","kashmiri",0,&charset[0],0,
+{"ks","kashmiri",0,&lc_charsets[0],0,
#ifdef LANG_KASHMIRI
LANG_KASHMIRI,
#else
@@ -558,7 +562,7 @@ LANG_KASHMIRI,
#endif
0,0,
},
-{"ku","kurdish",0,&charset[0],0,
+{"ku","kurdish",0,&lc_charsets[0],0,
#ifdef LANG_KURDISH
LANG_KURDISH,
#else
@@ -566,7 +570,7 @@ LANG_KURDISH,
#endif
0,0,
},
-{"ky","kirghiz",0,&charset[0],0,
+{"ky","kirghiz",0,&lc_charsets[0],0,
#ifdef LANG_KIRGHIZ
LANG_KIRGHIZ,
#else
@@ -574,7 +578,7 @@ LANG_KIRGHIZ,
#endif
0,0,
},
-{"la","latin",0,&charset[0],0,
+{"la","latin",0,&lc_charsets[0],0,
#ifdef LANG_LATIN
LANG_LATIN,
#else
@@ -582,7 +586,7 @@ LANG_LATIN,
#endif
0,0,
},
-{"ln","lingala",0,&charset[0],0,
+{"ln","lingala",0,&lc_charsets[0],0,
#ifdef LANG_LINGALA
LANG_LINGALA,
#else
@@ -590,7 +594,7 @@ LANG_LINGALA,
#endif
0,0,
},
-{"lo","laothian",0,&charset[0],0,
+{"lo","laothian",0,&lc_charsets[0],0,
#ifdef LANG_LAOTHIAN
LANG_LAOTHIAN,
#else
@@ -598,7 +602,7 @@ LANG_LAOTHIAN,
#endif
0,0,
},
-{"lt","lithuanian","lit",&charset[10],0,
+{"lt","lithuanian","lit",&lc_charsets[10],0,
#ifdef LANG_LITHUANIAN
LANG_LITHUANIAN,
#else
@@ -606,7 +610,7 @@ LANG_LITHUANIAN,
#endif
0,0,
},
-{"lv","latvian","lav",&charset[10],0,
+{"lv","latvian","lav",&lc_charsets[10],0,
#ifdef LANG_LATVIAN
LANG_LATVIAN,
#else
@@ -614,7 +618,7 @@ LANG_LATVIAN,
#endif
0,0,
},
-{"mg","malagasy",0,&charset[0],0,
+{"mg","malagasy",0,&lc_charsets[0],0,
#ifdef LANG_MALAGASY
LANG_MALAGASY,
#else
@@ -622,7 +626,7 @@ LANG_MALAGASY,
#endif
0,0,
},
-{"mi","maori",0,&charset[0],0,
+{"mi","maori",0,&lc_charsets[0],0,
#ifdef LANG_MAORI
LANG_MAORI,
#else
@@ -630,7 +634,7 @@ LANG_MAORI,
#endif
0,0,
},
-{"mk","macedonian","mkd|mac",&charset[0],0,
+{"mk","macedonian","mkd|mac",&lc_charsets[0],0,
#ifdef LANG_MACEDONIAN
LANG_MACEDONIAN,
#else
@@ -638,7 +642,7 @@ LANG_MACEDONIAN,
#endif
0,0,
},
-{"ml","malayalam","mal",&charset[0],0,
+{"ml","malayalam","mal",&lc_charsets[0],0,
#ifdef LANG_MALAYALAM
LANG_MALAYALAM,
#else
@@ -646,7 +650,7 @@ LANG_MALAYALAM,
#endif
0,0,
},
-{"mn","mongolian",0,&charset[0],0,
+{"mn","mongolian",0,&lc_charsets[0],0,
#ifdef LANG_MONGOLIAN
LANG_MONGOLIAN,
#else
@@ -654,7 +658,7 @@ LANG_MONGOLIAN,
#endif
0,0,
},
-{"mo","moldavian",0,&charset[0],0,
+{"mo","moldavian",0,&lc_charsets[0],0,
#ifdef LANG_MOLDAVIAN
LANG_MOLDAVIAN,
#else
@@ -662,7 +666,7 @@ LANG_MOLDAVIAN,
#endif
0,0,
},
-{"mr","marathi",0,&charset[0],0,
+{"mr","marathi",0,&lc_charsets[0],0,
#ifdef LANG_MARATHI
LANG_MARATHI,
#else
@@ -670,7 +674,7 @@ LANG_MARATHI,
#endif
0,0,
},
-{"ms","malay","msa|may",&charset[0],0,
+{"ms","malay","msa|may",&lc_charsets[0],0,
#ifdef LANG_MALAY
LANG_MALAY,
#else
@@ -678,7 +682,7 @@ LANG_MALAY,
#endif
0,0,
},
-{"mt","maltese",0,&charset[0],0,
+{"mt","maltese",0,&lc_charsets[0],0,
#ifdef LANG_MALTESE
LANG_MALTESE,
#else
@@ -686,7 +690,7 @@ LANG_MALTESE,
#endif
0,0,
},
-{"my","burmese",0,&charset[0],0,
+{"my","burmese",0,&lc_charsets[0],0,
#ifdef LANG_BURMESE
LANG_BURMESE,
#else
@@ -694,7 +698,7 @@ LANG_BURMESE,
#endif
0,0,
},
-{"na","nauru",0,&charset[0],0,
+{"na","nauru",0,&lc_charsets[0],0,
#ifdef LANG_NAURU
LANG_NAURU,
#else
@@ -702,7 +706,7 @@ LANG_NAURU,
#endif
0,0,
},
-{"nb","norwegian-bokmal","nob",&charset[0],0,
+{"nb","norwegian-bokmal","nob",&lc_charsets[0],0,
#ifdef LANG_NORWEGIAN_BOKMAL
LANG_NORWEGIAN_BOKMAL,
#else
@@ -710,7 +714,7 @@ LANG_NORWEGIAN_BOKMAL,
#endif
0,0,
},
-{"ne","nepali",0,&charset[0],0,
+{"ne","nepali",0,&lc_charsets[0],0,
#ifdef LANG_NEPALI
LANG_NEPALI,
#else
@@ -718,7 +722,7 @@ LANG_NEPALI,
#endif
0,0,
},
-{"nl","dutch","nld|dut",&charset[0],0,
+{"nl","dutch","nld|dut",&lc_charsets[0],0,
#ifdef LANG_DUTCH
LANG_DUTCH,
#else
@@ -726,7 +730,7 @@ LANG_DUTCH,
#endif
0,0,
},
-{"nn","norwegian-nynorsk","nno|non",&charset[0],0,
+{"nn","norwegian-nynorsk","nno|non",&lc_charsets[0],0,
#ifdef LANG_NORWEGIAN_NYNORSK
LANG_NORWEGIAN_NYNORSK,
#else
@@ -734,7 +738,7 @@ LANG_NORWEGIAN_NYNORSK,
#endif
0,0,
},
-{"no","norwegian","nor",&charset[0],0,
+{"no","norwegian","nor",&lc_charsets[0],0,
#ifdef LANG_NORWEGIAN
LANG_NORWEGIAN,
#else
@@ -742,7 +746,7 @@ LANG_NORWEGIAN,
#endif
0,0,
},
-{"oc","occitan",0,&charset[0],0,
+{"oc","occitan",0,&lc_charsets[0],0,
#ifdef LANG_OCCITAN
LANG_OCCITAN,
#else
@@ -750,7 +754,7 @@ LANG_OCCITAN,
#endif
0,0,
},
-{"om","oromo",0,&charset[0],0,
+{"om","oromo",0,&lc_charsets[0],0,
#ifdef LANG_OROMO
LANG_OROMO,
#else
@@ -758,7 +762,7 @@ LANG_OROMO,
#endif
0,0,
},
-{"or","oriya",0,&charset[0],0,
+{"or","oriya",0,&lc_charsets[0],0,
#ifdef LANG_ORIYA
LANG_ORIYA,
#else
@@ -766,7 +770,7 @@ LANG_ORIYA,
#endif
0,0,
},
-{"pa","punjabi",0,&charset[0],0,
+{"pa","punjabi",0,&lc_charsets[0],0,
#ifdef LANG_PUNJABI
LANG_PUNJABI,
#else
@@ -774,7 +778,7 @@ LANG_PUNJABI,
#endif
0,0,
},
-{"pl","polish","pol",&charset[1],0,
+{"pl","polish","pol",&lc_charsets[1],0,
#ifdef LANG_POLISH
LANG_POLISH,
#else
@@ -782,7 +786,7 @@ LANG_POLISH,
#endif
0,0,
},
-{"ps","pushto",0,&charset[0],0,
+{"ps","pushto",0,&lc_charsets[0],0,
#ifdef LANG_PUSHTO
LANG_PUSHTO,
#else
@@ -790,7 +794,7 @@ LANG_PUSHTO,
#endif
0,0,
},
-{"pt","portuguese","por",&charset[0],0,
+{"pt","portuguese","por",&lc_charsets[0],0,
#ifdef LANG_PORTUGUESE
LANG_PORTUGUESE,
#else
@@ -798,7 +802,7 @@ LANG_PORTUGUESE,
#endif
0,0,
},
-{"qu","quechua",0,&charset[0],0,
+{"qu","quechua",0,&lc_charsets[0],0,
#ifdef LANG_QUECHUA
LANG_QUECHUA,
#else
@@ -806,7 +810,7 @@ LANG_QUECHUA,
#endif
0,0,
},
-{"rm","rhaeto-romance",0,&charset[0],0,
+{"rm","rhaeto-romance",0,&lc_charsets[0],0,
#ifdef LANG_RHAETO_ROMANCE
LANG_RHAETO_ROMANCE,
#else
@@ -814,7 +818,7 @@ LANG_RHAETO_ROMANCE,
#endif
0,0,
},
-{"rn","kirundi",0,&charset[0],0,
+{"rn","kirundi",0,&lc_charsets[0],0,
#ifdef LANG_KIRUNDI
LANG_KIRUNDI,
#else
@@ -822,7 +826,7 @@ LANG_KIRUNDI,
#endif
0,0,
},
-{"ro","romanian","ron|rum",&charset[1],0,
+{"ro","romanian","ron|rum",&lc_charsets[1],0,
#ifdef LANG_ROMANIAN
LANG_ROMANIAN,
#else
@@ -830,7 +834,7 @@ LANG_ROMANIAN,
#endif
0,0,
},
-{"ru","russian","rus",&charset[4],0,
+{"ru","russian","rus",&lc_charsets[4],0,
#ifdef LANG_RUSSIAN
LANG_RUSSIAN,
#else
@@ -838,7 +842,7 @@ LANG_RUSSIAN,
#endif
0,0,
},
-{"rw","kinyarwanda",0,&charset[0],0,
+{"rw","kinyarwanda",0,&lc_charsets[0],0,
#ifdef LANG_KINYARWANDA
LANG_KINYARWANDA,
#else
@@ -846,7 +850,7 @@ LANG_KINYARWANDA,
#endif
0,0,
},
-{"sa","sanskrit",0,&charset[0],0,
+{"sa","sanskrit",0,&lc_charsets[0],0,
#ifdef LANG_SANSKRIT
LANG_SANSKRIT,
#else
@@ -854,7 +858,7 @@ LANG_SANSKRIT,
#endif
0,0,
},
-{"sd","sindhi",0,&charset[0],0,
+{"sd","sindhi",0,&lc_charsets[0],0,
#ifdef LANG_SINDHI
LANG_SINDHI,
#else
@@ -862,7 +866,7 @@ LANG_SINDHI,
#endif
0,0,
},
-{"sg","sangro",0,&charset[0],0,
+{"sg","sangro",0,&lc_charsets[0],0,
#ifdef LANG_SANGRO
LANG_SANGRO,
#else
@@ -870,7 +874,7 @@ LANG_SANGRO,
#endif
0,0,
},
-{"sh","serbo-croatian",0,&charset[0],0,
+{"sh","serbo-croatian",0,&lc_charsets[0],0,
#ifdef LANG_SERBO_CROATIAN
LANG_SERBO_CROATIAN,
#else
@@ -878,7 +882,7 @@ LANG_SERBO_CROATIAN,
#endif
0,0,
},
-{"si","singhalese",0,&charset[0],0,
+{"si","singhalese",0,&lc_charsets[0],0,
#ifdef LANG_SINGHALESE
LANG_SINGHALESE,
#else
@@ -886,7 +890,7 @@ LANG_SINGHALESE,
#endif
0,0,
},
-{"sk","slovak","slk|slo",&charset[1],0,
+{"sk","slovak","slk|slo",&lc_charsets[1],0,
#ifdef LANG_SLOVAK
LANG_SLOVAK,
#else
@@ -894,7 +898,7 @@ LANG_SLOVAK,
#endif
0,0,
},
-{"sl","slovenian","slv",&charset[1],0,
+{"sl","slovenian","slv",&lc_charsets[1],0,
#ifdef LANG_SLOVENIAN
LANG_SLOVENIAN,
#else
@@ -902,7 +906,7 @@ LANG_SLOVENIAN,
#endif
0,0,
},
-{"sm","samoan",0,&charset[0],0,
+{"sm","samoan",0,&lc_charsets[0],0,
#ifdef LANG_SAMOAN
LANG_SAMOAN,
#else
@@ -910,7 +914,7 @@ LANG_SAMOAN,
#endif
0,0,
},
-{"sn","shona",0,&charset[0],0,
+{"sn","shona",0,&lc_charsets[0],0,
#ifdef LANG_SHONA
LANG_SHONA,
#else
@@ -918,7 +922,7 @@ LANG_SHONA,
#endif
0,0,
},
-{"so","somali",0,&charset[0],0,
+{"so","somali",0,&lc_charsets[0],0,
#ifdef LANG_SOMALI
LANG_SOMALI,
#else
@@ -926,7 +930,7 @@ LANG_SOMALI,
#endif
0,0,
},
-{"sq","albanian","sqi|alb",&charset[0],0,
+{"sq","albanian","sqi|alb",&lc_charsets[0],0,
#ifdef LANG_ALBANIAN
LANG_ALBANIAN,
#else
@@ -934,7 +938,7 @@ LANG_ALBANIAN,
#endif
0,0,
},
-{"sr","serbian","srp",&charset[1],0,
+{"sr","serbian","srp",&lc_charsets[1],0,
#ifdef LANG_SERBIAN
LANG_SERBIAN,
#else
@@ -942,7 +946,7 @@ LANG_SERBIAN,
#endif
0,0,
},
-{"ss","siswati",0,&charset[0],0,
+{"ss","siswati",0,&lc_charsets[0],0,
#ifdef LANG_SISWATI
LANG_SISWATI,
#else
@@ -950,7 +954,7 @@ LANG_SISWATI,
#endif
0,0,
},
-{"st","sesotho",0,&charset[0],0,
+{"st","sesotho",0,&lc_charsets[0],0,
#ifdef LANG_SESOTHO
LANG_SESOTHO,
#else
@@ -958,7 +962,7 @@ LANG_SESOTHO,
#endif
0,0,
},
-{"su","sudanese",0,&charset[0],0,
+{"su","sudanese",0,&lc_charsets[0],0,
#ifdef LANG_SUDANESE
LANG_SUDANESE,
#else
@@ -966,7 +970,7 @@ LANG_SUDANESE,
#endif
0,0,
},
-{"sv","swedish","swe",&charset[0],0,
+{"sv","swedish","swe",&lc_charsets[0],0,
#ifdef LANG_SWEDISH
LANG_SWEDISH,
#else
@@ -974,7 +978,7 @@ LANG_SWEDISH,
#endif
0,0,
},
-{"sw","swahili","swa",&charset[0],0,
+{"sw","swahili","swa",&lc_charsets[0],0,
#ifdef LANG_SWAHILI
LANG_SWAHILI,
#else
@@ -982,7 +986,7 @@ LANG_SWAHILI,
#endif
0,0,
},
-{"ta","tamil",0,&charset[0],0,
+{"ta","tamil",0,&lc_charsets[0],0,
#ifdef LANG_TAMIL
LANG_TAMIL,
#else
@@ -990,7 +994,7 @@ LANG_TAMIL,
#endif
0,0,
},
-{"te","telugu",0,&charset[0],0,
+{"te","telugu",0,&lc_charsets[0],0,
#ifdef LANG_TELUGU
LANG_TELUGU,
#else
@@ -998,7 +1002,7 @@ LANG_TELUGU,
#endif
0,0,
},
-{"tg","tajik",0,&charset[0],0,
+{"tg","tajik",0,&lc_charsets[0],0,
#ifdef LANG_TAJIK
LANG_TAJIK,
#else
@@ -1006,7 +1010,7 @@ LANG_TAJIK,
#endif
0,0,
},
-{"th","thai","tha",&charset[0],0,
+{"th","thai","tha",&lc_charsets[0],0,
#ifdef LANG_THAI
LANG_THAI,
#else
@@ -1014,7 +1018,7 @@ LANG_THAI,
#endif
0,0,
},
-{"ti","tigrinya",0,&charset[0],0,
+{"ti","tigrinya",0,&lc_charsets[0],0,
#ifdef LANG_TIGRINYA
LANG_TIGRINYA,
#else
@@ -1022,7 +1026,7 @@ LANG_TIGRINYA,
#endif
0,0,
},
-{"tk","turkmen",0,&charset[0],0,
+{"tk","turkmen",0,&lc_charsets[0],0,
#ifdef LANG_TURKMEN
LANG_TURKMEN,
#else
@@ -1030,7 +1034,7 @@ LANG_TURKMEN,
#endif
0,0,
},
-{"tl","tagalog",0,&charset[0],0,
+{"tl","tagalog",0,&lc_charsets[0],0,
#ifdef LANG_TAGALOG
LANG_TAGALOG,
#else
@@ -1038,7 +1042,7 @@ LANG_TAGALOG,
#endif
0,0,
},
-{"tn","setswana",0,&charset[0],0,
+{"tn","setswana",0,&lc_charsets[0],0,
#ifdef LANG_SETSWANA
LANG_SETSWANA,
#else
@@ -1046,7 +1050,7 @@ LANG_SETSWANA,
#endif
0,0,
},
-{"to","tonga",0,&charset[0],0,
+{"to","tonga",0,&lc_charsets[0],0,
#ifdef LANG_TONGA
LANG_TONGA,
#else
@@ -1054,7 +1058,7 @@ LANG_TONGA,
#endif
0,0,
},
-{"tr","turkish","tur",&charset[8],0,
+{"tr","turkish","tur",&lc_charsets[8],0,
#ifdef LANG_TURKISH
LANG_TURKISH,
#else
@@ -1062,7 +1066,7 @@ LANG_TURKISH,
#endif
0,0,
},
-{"ts","tsonga",0,&charset[0],0,
+{"ts","tsonga",0,&lc_charsets[0],0,
#ifdef LANG_TSONGA
LANG_TSONGA,
#else
@@ -1070,7 +1074,7 @@ LANG_TSONGA,
#endif
0,0,
},
-{"tt","tatar","tat",&charset[0],0,
+{"tt","tatar","tat",&lc_charsets[0],0,
#ifdef LANG_TATAR
LANG_TATAR,
#else
@@ -1078,7 +1082,7 @@ LANG_TATAR,
#endif
0,0,
},
-{"tw","chinese-traditional","cht",&charset[0],0,
+{"tw","chinese-traditional","cht",&lc_charsets[0],0,
#ifdef LANG_CHINESE_TRADITIONAL
LANG_CHINESE_TRADITIONAL,
#else
@@ -1086,7 +1090,7 @@ LANG_CHINESE_TRADITIONAL,
#endif
0,0,
},
-{"uk","ukrainian","ukr",&charset[4],0,
+{"uk","ukrainian","ukr",&lc_charsets[4],0,
#ifdef LANG_UKRAINIAN
LANG_UKRAINIAN,
#else
@@ -1094,7 +1098,7 @@ LANG_UKRAINIAN,
#endif
0,0,
},
-{"ur","urdu",0,&charset[0],0,
+{"ur","urdu",0,&lc_charsets[0],0,
#ifdef LANG_URDU
LANG_URDU,
#else
@@ -1102,7 +1106,7 @@ LANG_URDU,
#endif
0,0,
},
-{"uz","uzbek","uzb",&charset[0],0,
+{"uz","uzbek","uzb",&lc_charsets[0],0,
#ifdef LANG_UZBEK
LANG_UZBEK,
#else
@@ -1110,7 +1114,7 @@ LANG_UZBEK,
#endif
0,0,
},
-{"vi","vietnamese",0,&charset[0],0,
+{"vi","vietnamese",0,&lc_charsets[0],0,
#ifdef LANG_VIETNAMESE
LANG_VIETNAMESE,
#else
@@ -1118,7 +1122,7 @@ LANG_VIETNAMESE,
#endif
0,0,
},
-{"vo","volapuk",0,&charset[0],0,
+{"vo","volapuk",0,&lc_charsets[0],0,
#ifdef LANG_VOLAPUK
LANG_VOLAPUK,
#else
@@ -1126,7 +1130,7 @@ LANG_VOLAPUK,
#endif
0,0,
},
-{"wo","wolof",0,&charset[0],0,
+{"wo","wolof",0,&lc_charsets[0],0,
#ifdef LANG_WOLOF
LANG_WOLOF,
#else
@@ -1134,7 +1138,7 @@ LANG_WOLOF,
#endif
0,0,
},
-{"xh","xhosa",0,&charset[0],0,
+{"xh","xhosa",0,&lc_charsets[0],0,
#ifdef LANG_XHOSA
LANG_XHOSA,
#else
@@ -1142,7 +1146,7 @@ LANG_XHOSA,
#endif
0,0,
},
-{"yo","yoruba",0,&charset[0],0,
+{"yo","yoruba",0,&lc_charsets[0],0,
#ifdef LANG_YORUBA
LANG_YORUBA,
#else
@@ -1150,7 +1154,7 @@ LANG_YORUBA,
#endif
0,0,
},
-{"zh","chinese-simplified","zho|chi|chs",&charset[0],0,
+{"zh","chinese-simplified","zho|chi|chs",&lc_charsets[0],0,
#ifdef LANG_CHINESE_SIMPLIFIED
LANG_CHINESE_SIMPLIFIED,
#else
@@ -1158,7 +1162,7 @@ LANG_CHINESE_SIMPLIFIED,
#endif
0,0,
},
-{"zu","zulu",0,&charset[0],0,
+{"zu","zulu",0,&lc_charsets[0],0,
#ifdef LANG_ZULU
LANG_ZULU,
#else
@@ -1169,10 +1173,10 @@ LANG_ZULU,
0
};
-static const Lc_territory_t territory[] =
+const Lc_territory_t lc_territories[] =
{
-{"C","C",LC_default,0,&language[0],0,0,0,0,0,0,0,},
-{"debug","debug",LC_debug,0,&language[1],0,0,0,0,0,0,0,},
+{"C","C",LC_default,0,&lc_languages[0],0,0,0,0,0,0,0,},
+{"debug","debug",LC_debug,0,&lc_languages[1],0,0,0,0,0,0,0,},
{"al","albania",0,
#ifdef CTRY_ALBANIA
CTRY_ALBANIA,
@@ -1187,7 +1191,7 @@ CTRY_NETHERLANDS_ANTILLES,
#else
0,
#endif
-&language[86],0,0,0,
+&lc_languages[86],0,0,0,
#ifdef SUBLANG_DUTCH_NETHERLANDS_ANTILLES
SUBLANG_DUTCH_NETHERLANDS_ANTILLES,
#else
@@ -1201,7 +1205,7 @@ CTRY_ARGENTINA,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_ARGENTINA
SUBLANG_SPANISH_ARGENTINA,
#else
@@ -1215,7 +1219,7 @@ CTRY_AUSTRIA,
#else
0,
#endif
-&language[23],0,0,0,
+&lc_languages[23],0,0,0,
#ifdef SUBLANG_GERMAN_AUSTRIA
SUBLANG_GERMAN_AUSTRIA,
#else
@@ -1229,7 +1233,7 @@ CTRY_AUSTRALIA,
#else
0,
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_AUSTRALIA
SUBLANG_ENGLISH_AUSTRALIA,
#else
@@ -1251,7 +1255,7 @@ CTRY_BELGIUM,
#else
0,
#endif
-&language[86],&language[35],&language[23],0,
+&lc_languages[86],&lc_languages[35],&lc_languages[23],0,
#ifdef SUBLANG_DUTCH_BELGIUM
SUBLANG_DUTCH_BELGIUM,
#else
@@ -1277,7 +1281,7 @@ CTRY_BULGARIA,
#else
0,
#endif
-&language[12],0,0,0,
+&lc_languages[12],0,0,0,
#ifdef SUBLANG_BULGARIAN_BULGARIA
SUBLANG_BULGARIAN_BULGARIA,
#else
@@ -1291,7 +1295,7 @@ CTRY_BRUNEI_DARUSSALAM,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_BRUNEI_DARUSSALAM
SUBLANG_ARABIC_BRUNEI_DARUSSALAM,
#else
@@ -1305,7 +1309,7 @@ CTRY_BOLIVIA,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_BOLIVIA
SUBLANG_SPANISH_BOLIVIA,
#else
@@ -1319,7 +1323,7 @@ CTRY_BRAZIL,
#else
0,
#endif
-&language[95],0,0,0,
+&lc_languages[95],0,0,0,
#ifdef SUBLANG_PORTUGUESE_BRAZIL
SUBLANG_PORTUGUESE_BRAZIL,
#else
@@ -1333,7 +1337,7 @@ CTRY_BOTSWANA,
#else
0,
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_BOTSWANA
SUBLANG_ENGLISH_BOTSWANA,
#else
@@ -1347,7 +1351,7 @@ CTRY_BELARUS,
#else
0,
#endif
-&language[100],0,0,0,
+&lc_languages[100],0,0,0,
#ifdef SUBLANG_RUSSIAN_BELARUS
SUBLANG_RUSSIAN_BELARUS,
#else
@@ -1361,7 +1365,7 @@ CTRY_BELIZE,
#else
0,
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_BELIZE
SUBLANG_ENGLISH_BELIZE,
#else
@@ -1375,7 +1379,7 @@ CTRY_CANADA,
#else
0,
#endif
-&language[26],&language[35],0,0,
+&lc_languages[26],&lc_languages[35],0,0,
#ifdef SUBLANG_ENGLISH_CANADA
SUBLANG_ENGLISH_CANADA,
#else
@@ -1395,7 +1399,7 @@ CTRY_SWITZERLAND,
#else
0,
#endif
-&language[35],&language[23],&language[54],0,
+&lc_languages[35],&lc_languages[23],&lc_languages[54],0,
#ifdef SUBLANG_FRENCH_SWITZERLAND
SUBLANG_FRENCH_SWITZERLAND,
#else
@@ -1421,7 +1425,7 @@ CTRY_CHILE,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_CHILE
SUBLANG_SPANISH_CHILE,
#else
@@ -1435,7 +1439,7 @@ CTRY_CHINA,
#else
0,
#endif
-&language[140],0,0,0,
+&lc_languages[140],0,0,0,
#ifdef SUBLANG_CHINESE_SIMPLIFIED_CHINA
SUBLANG_CHINESE_SIMPLIFIED_CHINA,
#else
@@ -1449,7 +1453,7 @@ CTRY_COLOMBIA,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_COLOMBIA
SUBLANG_SPANISH_COLOMBIA,
#else
@@ -1463,7 +1467,7 @@ CTRY_COSTA_RICA,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_COSTA_RICA
SUBLANG_SPANISH_COSTA_RICA,
#else
@@ -1477,7 +1481,7 @@ CTRY_CZECH_REPUBLIC,
#else
0,
#endif
-&language[20],0,0,0,
+&lc_languages[20],0,0,0,
#ifdef SUBLANG_CZECH_CZECH_REPUBLIC
SUBLANG_CZECH_CZECH_REPUBLIC,
#else
@@ -1491,7 +1495,7 @@ CTRY_GERMANY,
#else
0,
#endif
-&language[23],0,0,0,
+&lc_languages[23],0,0,0,
#ifdef SUBLANG_GERMAN_GERMANY
SUBLANG_GERMAN_GERMANY,
#else
@@ -1505,7 +1509,7 @@ CTRY_DENMARK,
#else
0,
#endif
-&language[22],&language[26],0,0,
+&lc_languages[22],&lc_languages[26],0,0,
#ifdef SUBLANG_DANISH_DENMARK
SUBLANG_DANISH_DENMARK,
#else
@@ -1525,7 +1529,7 @@ CTRY_DOMINICAN_REPUBLIC,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_DOMINICAN_REPUBLIC
SUBLANG_SPANISH_DOMINICAN_REPUBLIC,
#else
@@ -1547,7 +1551,7 @@ CTRY_ECUADOR,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_ECUADOR
SUBLANG_SPANISH_ECUADOR,
#else
@@ -1561,7 +1565,7 @@ CTRY_ESTONIA,
#else
0,
#endif
-&language[29],0,0,0,
+&lc_languages[29],0,0,0,
#ifdef SUBLANG_ESTONIAN_ESTONIA
SUBLANG_ESTONIAN_ESTONIA,
#else
@@ -1575,7 +1579,7 @@ CTRY_EGYPT,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_EGYPT
SUBLANG_ARABIC_EGYPT,
#else
@@ -1589,7 +1593,7 @@ CTRY_SPAIN,
#else
0,
#endif
-&language[28],&language[18],&language[30],&language[39],
+&lc_languages[28],&lc_languages[18],&lc_languages[30],&lc_languages[39],
#ifdef SUBLANG_SPANISH_SPAIN
SUBLANG_SPANISH_SPAIN,
#else
@@ -1621,7 +1625,7 @@ CTRY_FINLAND,
#else
0,
#endif
-&language[117],0,0,0,
+&lc_languages[117],0,0,0,
#ifdef SUBLANG_SWEDISH_FINLAND
SUBLANG_SWEDISH_FINLAND,
#else
@@ -1635,7 +1639,7 @@ CTRY_FAROE_ISLANDS,
#else
0,
#endif
-&language[34],0,0,0,
+&lc_languages[34],0,0,0,
#ifdef SUBLANG_FAEROESE_FAROE_ISLANDS
SUBLANG_FAEROESE_FAROE_ISLANDS,
#else
@@ -1649,7 +1653,7 @@ CTRY_FRANCE,
#else
0,
#endif
-&language[35],0,0,0,
+&lc_languages[35],0,0,0,
#ifdef SUBLANG_FRENCH_FRANCE
SUBLANG_FRENCH_FRANCE,
#else
@@ -1671,7 +1675,7 @@ CTRY_ENGLAND,
#endif
#endif
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_UNITED_KINGDOM
SUBLANG_ENGLISH_UNITED_KINGDOM,
#else
@@ -1693,7 +1697,7 @@ CTRY_GREENLAND,
#else
0,
#endif
-&language[61],0,0,0,
+&lc_languages[61],0,0,0,
#ifdef SUBLANG_GREENLANDIC_GREENLAND
SUBLANG_GREENLANDIC_GREENLAND,
#else
@@ -1707,7 +1711,7 @@ CTRY_GREECE,
#else
0,
#endif
-&language[25],0,0,0,
+&lc_languages[25],0,0,0,
#ifdef SUBLANG_GREEK_GREECE
SUBLANG_GREEK_GREECE,
#else
@@ -1721,7 +1725,7 @@ CTRY_GUATEMALA,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_GUATEMALA
SUBLANG_SPANISH_GUATEMALA,
#else
@@ -1735,7 +1739,7 @@ CTRY_HONG_KONG,
#else
0,
#endif
-&language[140],0,0,0,
+&lc_languages[140],0,0,0,
#ifdef SUBLANG_CHINESE_SIMPLIFIED_HONG_KONG
SUBLANG_CHINESE_SIMPLIFIED_HONG_KONG,
#else
@@ -1749,7 +1753,7 @@ CTRY_HONDURAS,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_HONDURAS
SUBLANG_SPANISH_HONDURAS,
#else
@@ -1763,7 +1767,7 @@ CTRY_CROATIA,
#else
0,
#endif
-&language[45],0,0,0,
+&lc_languages[45],0,0,0,
#ifdef SUBLANG_CROATIAN_CROATIA
SUBLANG_CROATIAN_CROATIA,
#else
@@ -1777,7 +1781,7 @@ CTRY_HUNGARY,
#else
0,
#endif
-&language[46],0,0,0,
+&lc_languages[46],0,0,0,
#ifdef SUBLANG_HUNGARIAN_HUNGARY
SUBLANG_HUNGARIAN_HUNGARY,
#else
@@ -1791,7 +1795,7 @@ CTRY_INDONESIA,
#else
0,
#endif
-&language[49],0,0,0,
+&lc_languages[49],0,0,0,
#ifdef SUBLANG_INDONESIAN_INDONESIA
SUBLANG_INDONESIAN_INDONESIA,
#else
@@ -1805,7 +1809,7 @@ CTRY_IRELAND,
#else
0,
#endif
-&language[26],&language[37],0,0,
+&lc_languages[26],&lc_languages[37],0,0,
#ifdef SUBLANG_ENGLISH_IRELAND
SUBLANG_ENGLISH_IRELAND,
#else
@@ -1825,7 +1829,7 @@ CTRY_ISRAEL,
#else
0,
#endif
-&language[43],0,0,0,
+&lc_languages[43],0,0,0,
#ifdef SUBLANG_HEBREW_ISRAEL
SUBLANG_HEBREW_ISRAEL,
#else
@@ -1839,7 +1843,7 @@ CTRY_IRAQ,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_IRAQ
SUBLANG_ARABIC_IRAQ,
#else
@@ -1853,7 +1857,7 @@ CTRY_ICELAND,
#else
0,
#endif
-&language[53],0,0,0,
+&lc_languages[53],0,0,0,
#ifdef SUBLANG_ICELANDIC_ICELAND
SUBLANG_ICELANDIC_ICELAND,
#else
@@ -1867,7 +1871,7 @@ CTRY_ITALY,
#else
0,
#endif
-&language[54],0,0,0,
+&lc_languages[54],0,0,0,
#ifdef SUBLANG_ITALIAN_ITALY
SUBLANG_ITALIAN_ITALY,
#else
@@ -1881,7 +1885,7 @@ CTRY_JAMAICA,
#else
0,
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_JAMAICA
SUBLANG_ENGLISH_JAMAICA,
#else
@@ -1895,7 +1899,7 @@ CTRY_JORDAN,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_JORDAN
SUBLANG_ARABIC_JORDAN,
#else
@@ -1909,7 +1913,7 @@ CTRY_JAPAN,
#else
0,
#endif
-&language[56],0,0,0,
+&lc_languages[56],0,0,0,
#ifdef SUBLANG_JAPANESE_JAPAN
SUBLANG_JAPANESE_JAPAN,
#else
@@ -1931,7 +1935,7 @@ CTRY_SOUTH_KOREA,
#else
0,
#endif
-&language[64],0,0,0,
+&lc_languages[64],0,0,0,
#ifdef SUBLANG_KOREAN_SOUTH_KOREA
SUBLANG_KOREAN_SOUTH_KOREA,
#else
@@ -1945,7 +1949,7 @@ CTRY_KUWAIT,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_KUWAIT
SUBLANG_ARABIC_KUWAIT,
#else
@@ -1959,7 +1963,7 @@ CTRY_LEBANON,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_LEBANON
SUBLANG_ARABIC_LEBANON,
#else
@@ -1973,7 +1977,7 @@ CTRY_LIECHTENSTEIN,
#else
0,
#endif
-&language[23],&language[35],0,0,
+&lc_languages[23],&lc_languages[35],0,0,
#ifdef SUBLANG_GERMAN_LIECHTENSTEIN
SUBLANG_GERMAN_LIECHTENSTEIN,
#else
@@ -1993,7 +1997,7 @@ CTRY_LITHUANIA,
#else
0,
#endif
-&language[71],0,0,0,
+&lc_languages[71],0,0,0,
#ifdef SUBLANG_LITHUANIAN_LITHUANIA
SUBLANG_LITHUANIAN_LITHUANIA,
#else
@@ -2007,7 +2011,7 @@ CTRY_LUXEMBOURG,
#else
0,
#endif
-&language[23],&language[35],0,0,
+&lc_languages[23],&lc_languages[35],0,0,
#ifdef SUBLANG_GERMAN_LUXEMBOURG
SUBLANG_GERMAN_LUXEMBOURG,
#else
@@ -2027,7 +2031,7 @@ CTRY_LATVIA,
#else
0,
#endif
-&language[72],0,0,0,
+&lc_languages[72],0,0,0,
#ifdef SUBLANG_LATVIAN_LATVIA
SUBLANG_LATVIAN_LATVIA,
#else
@@ -2041,7 +2045,7 @@ CTRY_LIBYA,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_LIBYA
SUBLANG_ARABIC_LIBYA,
#else
@@ -2055,7 +2059,7 @@ CTRY_MOROCCO,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_MOROCCO
SUBLANG_ARABIC_MOROCCO,
#else
@@ -2069,7 +2073,7 @@ CTRY_MACEDONIA,
#else
0,
#endif
-&language[75],0,0,0,
+&lc_languages[75],0,0,0,
#ifdef SUBLANG_MACEDONIAN_MACEDONIA
SUBLANG_MACEDONIAN_MACEDONIA,
#else
@@ -2083,7 +2087,7 @@ CTRY_MACAU,
#else
0,
#endif
-&language[140],0,0,0,
+&lc_languages[140],0,0,0,
#ifdef SUBLANG_CHINESE_SIMPLIFIED_MACAU
SUBLANG_CHINESE_SIMPLIFIED_MACAU,
#else
@@ -2097,7 +2101,7 @@ CTRY_MEXICO,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_MEXICO
SUBLANG_SPANISH_MEXICO,
#else
@@ -2119,7 +2123,7 @@ CTRY_NICARAGUA,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_NICARAGUA
SUBLANG_SPANISH_NICARAGUA,
#else
@@ -2133,7 +2137,7 @@ CTRY_NETHERLANDS,
#else
0,
#endif
-&language[86],0,0,0,
+&lc_languages[86],0,0,0,
#ifdef SUBLANG_DUTCH_NETHERLANDS
SUBLANG_DUTCH_NETHERLANDS,
#else
@@ -2147,7 +2151,7 @@ CTRY_NORWAY,
#else
0,
#endif
-&language[84],&language[88],&language[87],0,
+&lc_languages[84],&lc_languages[88],&lc_languages[87],0,
#ifdef SUBLANG_NORWEGIAN_BOKMAL_NORWAY
SUBLANG_NORWEGIAN_BOKMAL_NORWAY,
#else
@@ -2173,7 +2177,7 @@ CTRY_NEW_ZEALAND,
#else
0,
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_NEW_ZEALAND
SUBLANG_ENGLISH_NEW_ZEALAND,
#else
@@ -2187,7 +2191,7 @@ CTRY_OMAN,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_OMAN
SUBLANG_ARABIC_OMAN,
#else
@@ -2201,7 +2205,7 @@ CTRY_PANAMA,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_PANAMA
SUBLANG_SPANISH_PANAMA,
#else
@@ -2215,7 +2219,7 @@ CTRY_PERU,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_PERU
SUBLANG_SPANISH_PERU,
#else
@@ -2229,7 +2233,7 @@ CTRY_POLAND,
#else
0,
#endif
-&language[93],0,0,0,
+&lc_languages[93],0,0,0,
#ifdef SUBLANG_POLISH_POLAND
SUBLANG_POLISH_POLAND,
#else
@@ -2243,7 +2247,7 @@ CTRY_PUERTO_RICO,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_PUERTO_RICO
SUBLANG_SPANISH_PUERTO_RICO,
#else
@@ -2257,7 +2261,7 @@ CTRY_PORTUGAL,
#else
0,
#endif
-&language[95],0,0,0,
+&lc_languages[95],0,0,0,
#ifdef SUBLANG_PORTUGUESE_PORTUGAL
SUBLANG_PORTUGUESE_PORTUGAL,
#else
@@ -2271,7 +2275,7 @@ CTRY_PARAGUAY,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_PARAGUAY
SUBLANG_SPANISH_PARAGUAY,
#else
@@ -2285,7 +2289,7 @@ CTRY_ROMANIA,
#else
0,
#endif
-&language[99],0,0,0,
+&lc_languages[99],0,0,0,
#ifdef SUBLANG_ROMANIAN_ROMANIA
SUBLANG_ROMANIAN_ROMANIA,
#else
@@ -2299,7 +2303,7 @@ CTRY_RUSSIA,
#else
0,
#endif
-&language[100],0,0,0,
+&lc_languages[100],0,0,0,
#ifdef SUBLANG_RUSSIAN_RUSSIA
SUBLANG_RUSSIAN_RUSSIA,
#else
@@ -2313,7 +2317,7 @@ CTRY_SAUDI_ARABIA,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_SAUDI_ARABIA
SUBLANG_ARABIC_SAUDI_ARABIA,
#else
@@ -2327,7 +2331,7 @@ CTRY_SWEDEN,
#else
0,
#endif
-&language[117],0,0,0,
+&lc_languages[117],0,0,0,
#ifdef SUBLANG_SWEDISH_SWEDEN
SUBLANG_SWEDISH_SWEDEN,
#else
@@ -2341,7 +2345,7 @@ CTRY_SINGAPORE,
#else
0,
#endif
-&language[140],0,0,0,
+&lc_languages[140],0,0,0,
#ifdef SUBLANG_CHINESE_SIMPLIFIED_SINGAPORE
SUBLANG_CHINESE_SIMPLIFIED_SINGAPORE,
#else
@@ -2355,7 +2359,7 @@ CTRY_SLOVENIA,
#else
0,
#endif
-&language[108],0,0,0,
+&lc_languages[108],0,0,0,
#ifdef SUBLANG_SLOVENIAN_SLOVENIA
SUBLANG_SLOVENIAN_SLOVENIA,
#else
@@ -2369,7 +2373,7 @@ CTRY_SLOVAKIA,
#else
0,
#endif
-&language[107],0,0,0,
+&lc_languages[107],0,0,0,
#ifdef SUBLANG_SLOVAK_SLOVAKIA
SUBLANG_SLOVAK_SLOVAKIA,
#else
@@ -2383,7 +2387,7 @@ CTRY_SERBIA,
#else
0,
#endif
-&language[113],0,0,0,
+&lc_languages[113],0,0,0,
#ifdef SUBLANG_SERBIAN_SERBIA
SUBLANG_SERBIAN_SERBIA,
#else
@@ -2397,7 +2401,7 @@ CTRY_EL_SALVADOR,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_EL_SALVADOR
SUBLANG_SPANISH_EL_SALVADOR,
#else
@@ -2411,7 +2415,7 @@ CTRY_SYRIA,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_SYRIA
SUBLANG_ARABIC_SYRIA,
#else
@@ -2425,7 +2429,7 @@ CTRY_THAILAND,
#else
0,
#endif
-&language[122],0,0,0,
+&lc_languages[122],0,0,0,
#ifdef SUBLANG_THAI_THAILAND
SUBLANG_THAI_THAILAND,
#else
@@ -2439,7 +2443,7 @@ CTRY_TUNISIA,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_TUNISIA
SUBLANG_ARABIC_TUNISIA,
#else
@@ -2453,7 +2457,7 @@ CTRY_TURKEY,
#else
0,
#endif
-&language[128],0,0,0,
+&lc_languages[128],0,0,0,
#ifdef SUBLANG_TURKISH_TURKEY
SUBLANG_TURKISH_TURKEY,
#else
@@ -2467,7 +2471,7 @@ CTRY_TRINIDAD_TOBAGO,
#else
0,
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_TRINIDAD_TOBAGO
SUBLANG_ENGLISH_TRINIDAD_TOBAGO,
#else
@@ -2481,7 +2485,7 @@ CTRY_TAIWAN,
#else
0,
#endif
-&language[131],0,0,0,
+&lc_languages[131],0,0,0,
#ifdef SUBLANG_CHINESE_TRADITIONAL_TAIWAN
SUBLANG_CHINESE_TRADITIONAL_TAIWAN,
#else
@@ -2495,7 +2499,7 @@ CTRY_UKRAINE,
#else
0,
#endif
-&language[132],&language[100],0,0,
+&lc_languages[132],&lc_languages[100],0,0,
#ifdef SUBLANG_UKRAINIAN_UKRAINE
SUBLANG_UKRAINIAN_UKRAINE,
#else
@@ -2515,7 +2519,7 @@ CTRY_UNITED_KINGDOM,
#else
0,
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_UNITED_KINGDOM
SUBLANG_ENGLISH_UNITED_KINGDOM,
#else
@@ -2533,7 +2537,7 @@ CTRY_USA,
0,
#endif
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_UNITED_STATES
SUBLANG_ENGLISH_UNITED_STATES,
#else
@@ -2551,7 +2555,7 @@ CTRY_URUGUAY,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_URUGUAY
SUBLANG_SPANISH_URUGUAY,
#else
@@ -2565,7 +2569,7 @@ CTRY_VENEZUELA,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_VENEZUELA
SUBLANG_SPANISH_VENEZUELA,
#else
@@ -2579,7 +2583,7 @@ CTRY_YUGOSLAVIA,
#else
0,
#endif
-&language[113],0,0,0,
+&lc_languages[113],0,0,0,
#ifdef SUBLANG_SERBIAN_YUGOSLAVIA
SUBLANG_SERBIAN_YUGOSLAVIA,
#else
@@ -2593,7 +2597,7 @@ CTRY_SOUTH_AFRICA,
#else
0,
#endif
-&language[4],0,0,0,
+&lc_languages[4],0,0,0,
#ifdef SUBLANG_AFRIKAANS_SOUTH_AFRICA
SUBLANG_AFRIKAANS_SOUTH_AFRICA,
#else
@@ -2607,7 +2611,7 @@ CTRY_ZIMBABWE,
#else
0,
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_ZIMBABWE
SUBLANG_ENGLISH_ZIMBABWE,
#else
@@ -2618,13 +2622,13 @@ SUBLANG_ENGLISH_ZIMBABWE,
0
};
-static const Lc_map_t map[] =
+const Lc_map_t lc_maps[] =
{
-{"enu",&language[26],&territory[93],&charset[0],0},
-{"enz",&language[26],&territory[68],&charset[0],0},
-{"esm",&language[28],&territory[63],&charset[0],0},
-{"esn",&language[28],&territory[30],&charset[0],&attribute_es[1]},
-{"esp",&language[28],&territory[30],&charset[0],&attribute_es[0]},
-{"usa",&language[26],&territory[93],&charset[0],0},
+{"enu",&lc_languages[26],&lc_territories[93],&lc_charsets[0],0},
+{"enz",&lc_languages[26],&lc_territories[68],&lc_charsets[0],0},
+{"esm",&lc_languages[28],&lc_territories[63],&lc_charsets[0],0},
+{"esn",&lc_languages[28],&lc_territories[30],&lc_charsets[0],&attribute_es[1]},
+{"esp",&lc_languages[28],&lc_territories[30],&lc_charsets[0],&attribute_es[0]},
+{"usa",&lc_languages[26],&lc_territories[93],&lc_charsets[0],0},
0
};
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/preroot.h b/usr/src/lib/libast/sparc/src/lib/libast/preroot.h
index 7780f31251..57a661e1d5 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/preroot.h
+++ b/usr/src/lib/libast/sparc/src/lib/libast/preroot.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/preroot.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/preroot.sh by iffe version 2008-01-31 : : */
#ifndef _def_preroot_ast
#define _def_preroot_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/sig.h b/usr/src/lib/libast/sparc/src/lib/libast/sig.h
index 72939b001b..10e7ce106c 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/sig.h
+++ b/usr/src/lib/libast/sparc/src/lib/libast/sig.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/sig.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/sig.sh by iffe version 2008-01-31 : : */
#ifndef _def_sig_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/tmx.h b/usr/src/lib/libast/sparc/src/lib/libast/tmx.h
index f9d742ea73..189ba75695 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/tmx.h
+++ b/usr/src/lib/libast/sparc/src/lib/libast/tmx.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/tmx by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/tmx by iffe version 2008-01-31 : : */
#ifndef _TMX_H
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparc/src/lib/libast/tv.h b/usr/src/lib/libast/sparc/src/lib/libast/tv.h
index 9ec820b351..0ead9fa85c 100644
--- a/usr/src/lib/libast/sparc/src/lib/libast/tv.h
+++ b/usr/src/lib/libast/sparc/src/lib/libast/tv.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libast/features/tv by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libast/features/tv by iffe version 2008-01-31 : : */
#ifndef _TV_H
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparcv9/Makefile b/usr/src/lib/libast/sparcv9/Makefile
index be8a95ce37..6a680ee6c6 100644
--- a/usr/src/lib/libast/sparcv9/Makefile
+++ b/usr/src/lib/libast/sparcv9/Makefile
@@ -18,12 +18,12 @@
#
# CDDL HEADER END
#
+
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
+
# Platform-specific config
# Note that "HOSTTYPE" matches the value used by AT&T upstream.
@@ -31,7 +31,8 @@ ASTPLATFORMCPPFLAGS = '-DHOSTTYPE="sol$(RELEASE_MINOR).sun4"'
# platform-specific sources
OBJECTS = \
- sparcv9/src/lib/libast/conftab.o
+ sparcv9/src/lib/libast/conftab.o \
+ sparcv9/src/lib/libast/lctab.o
OBJDIRS = \
sparcv9/src/lib/libast
diff --git a/usr/src/lib/libast/sparcv9/include/ast/align.h b/usr/src/lib/libast/sparcv9/include/ast/align.h
index 5b874e5ecc..5f6cef50cc 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/align.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/align.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/align.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/align.c by iffe version 2008-01-31 : : */
#ifndef _def_align_ast
#define _def_align_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/include/ast/ast.h b/usr/src/lib/libast/sparcv9/include/ast/ast.h
index ea1569f946..f5335ae8a2 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/ast.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/ast.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -333,7 +333,9 @@ extern __MANGLE__ double strntod __PROTO__((const char*, size_t, char**));
extern __MANGLE__ _ast_fltmax_t strntold __PROTO__((const char*, size_t, char**));
extern __MANGLE__ long strntol __PROTO__((const char*, size_t, char**, int));
extern __MANGLE__ intmax_t strntoll __PROTO__((const char*, size_t, char**, int));
+extern __MANGLE__ long strnton __PROTO__((const char*, size_t, char**, char*, int));
extern __MANGLE__ unsigned long strntoul __PROTO__((const char*, size_t, char**, int));
+extern __MANGLE__ intmax_t strntonll __PROTO__((const char*, size_t, char**, char*, int));
extern __MANGLE__ uintmax_t strntoull __PROTO__((const char*, size_t, char**, int));
extern __MANGLE__ int stropt __PROTO__((const char*, const __V_*, int, int(*)(__V_*, const __V_*, int, const char*), __V_*));
extern __MANGLE__ int strperm __PROTO__((const char*, char**, int));
diff --git a/usr/src/lib/libast/sparcv9/include/ast/ast_botch.h b/usr/src/lib/libast/sparcv9/include/ast/ast_botch.h
index 62ab0a2325..d21da2aaac 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/ast_botch.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/ast_botch.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/botch.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/botch.c by iffe version 2008-01-31 : : */
#ifndef _def_botch_ast
#define _def_botch_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/include/ast/ast_ccode.h b/usr/src/lib/libast/sparcv9/include/ast/ast_ccode.h
index 044a145303..b1a5219a63 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/ast_ccode.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/ast_ccode.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/ccode by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/ccode by iffe version 2008-01-31 : : */
#ifndef _def_ccode_ast
#define _def_ccode_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/include/ast/ast_common.h b/usr/src/lib/libast/sparcv9/include/ast/ast_common.h
index 439e2a78f2..ab2221a08d 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/ast_common.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/ast_common.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/common by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/common by iffe version 2008-01-31 : : */
#ifndef _AST_COMMON_H
#define _AST_COMMON_H 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/include/ast/ast_dir.h b/usr/src/lib/libast/sparcv9/include/ast/ast_dir.h
index 336b7f38a6..a402906410 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/ast_dir.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/ast_dir.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/ast_dirent.h b/usr/src/lib/libast/sparcv9/include/ast/ast_dirent.h
index dc89aa9045..46020fa183 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/ast_dirent.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/ast_dirent.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/dirent by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/dirent by iffe version 2008-01-31 : : */
#ifndef _def_dirent_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparcv9/include/ast/ast_fcntl.h b/usr/src/lib/libast/sparcv9/include/ast/ast_fcntl.h
index 7da3e4baad..e9164e7881 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/ast_fcntl.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/ast_fcntl.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/fcntl.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/fcntl.c by iffe version 2008-01-31 : : */
#ifndef _def_fcntl_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
diff --git a/usr/src/lib/libast/sparcv9/include/ast/ast_float.h b/usr/src/lib/libast/sparcv9/include/ast/ast_float.h
index 3a11f21309..2904cd9cf1 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/ast_float.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/ast_float.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/float by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/float by iffe version 2008-01-31 : : */
#ifndef _def_float_ast
#if !defined(__PROTO__)
@@ -89,13 +89,16 @@
#define _hdr_math 1 /* #include <math.h> ok */
#define _hdr_values 1 /* #include <values.h> ok */
#define _LIB_m 1 /* -lm is a library */
+#define _lib_fpclassify 1 /* fpclassify() in default lib(s) */
#define _lib_frexp 1 /* frexp() in default lib(s) */
#define _lib_frexpl 1 /* frexpl() in default lib(s) */
#define _lib_ldexp 1 /* ldexp() in default lib(s) */
#define _lib_ldexpl 1 /* ldexpl() in default lib(s) */
#define _lib_finite 1 /* finite() in default lib(s) */
+#define _lib_isinf 1 /* isinf() in default lib(s) */
#define _lib_isnan 1 /* isnan() in default lib(s) */
#define _lib_isnanl 1 /* isnanl() in default lib(s) */
+#define _lib_signbit 1 /* signbit() in default lib(s) */
#define _lib_copysign 1 /* copysign() in default lib(s) */
#define _lib_copysignl 1 /* copysignl() in default lib(s) */
#include <ast_common.h>
diff --git a/usr/src/lib/libast/sparcv9/include/ast/ast_fs.h b/usr/src/lib/libast/sparcv9/include/ast/ast_fs.h
index c83a8b85bb..354d8245ed 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/ast_fs.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/ast_fs.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/fs by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/fs by iffe version 2008-01-31 : : */
#ifndef _def_fs_ast
#if !defined(__PROTO__)
@@ -89,20 +89,9 @@
#define _lib_mknod 1 /* mknod() in default lib(s) */
#define _lib_sync 1 /* sync() in default lib(s) */
#include <sys/stat.h>
+#include <sys/mkdev.h>
#define FS_default "ufs"
#if defined(__STDPP__directive) && defined(__STDPP__initial)
-__STDPP__directive pragma pp:initial
-#endif
-#ifndef major
-#define major(x) ( major_t ) ( ( ( ( unsigned ) ( ( x ) ) ) >> 8 ) & 0x7f )
-#endif
-#ifndef minor
-#define minor(x) ( minor_t ) ( ( ( x ) ) & 0xff )
-#endif
-#ifndef makedev
-#define makedev(x,y) ( unsigned short ) ( ( ( ( x ) ) << 8 ) | ( ( ( y ) ) & 0xff ) )
-#endif
-#if defined(__STDPP__directive) && defined(__STDPP__initial)
__STDPP__directive pragma pp:noinitial
#endif
#define _hdr_stdio 1 /* #include <stdio.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/include/ast/ast_getopt.h b/usr/src/lib/libast/sparcv9/include/ast/ast_getopt.h
index 0de85c6172..060c18a246 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/ast_getopt.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/ast_getopt.h
@@ -1,39 +1,17 @@
/* : : generated by proto : : */
-/***********************************************************************
-* *
-* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
-* and is licensed under the *
-* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
-* *
-* A copy of the License is available at *
-* http://www.opensource.org/licenses/cpl1.0.txt *
-* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
-* *
-* Information and Software Systems Research *
-* AT&T Research *
-* Florham Park NJ *
-* *
-* Glenn Fowler <gsf@research.att.com> *
-* David Korn <dgk@research.att.com> *
-* Phong Vo <kpv@research.att.com> *
-* *
-***********************************************************************/
-
-/*
- * legacy standard getopt interface
- */
-#ifndef _AST_GETOPT_H
#if !defined(__PROTO__)
#include <prototyped.h>
#endif
#if !defined(__LINKAGE__)
#define __LINKAGE__ /* 2004-08-11 transition */
#endif
-
+#ifdef _AST_STD_I
+#undef _AST_GETOPT_H
+#define _AST_GETOPT_H -1
+#endif
+#ifndef _AST_GETOPT_H
#define _AST_GETOPT_H 1
extern __MANGLE__ int opterr;
diff --git a/usr/src/lib/libast/sparcv9/include/ast/ast_iconv.h b/usr/src/lib/libast/sparcv9/include/ast/ast_iconv.h
index 546c94c7e4..0629e61bee 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/ast_iconv.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/ast_iconv.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/iconv by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/iconv by iffe version 2008-01-31 : : */
#ifndef _def_iconv_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparcv9/include/ast/ast_lib.h b/usr/src/lib/libast/sparcv9/include/ast/ast_lib.h
index ec2755bd45..d44704c408 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/ast_lib.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/ast_lib.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/lib by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/lib by iffe version 2008-01-31 : : */
#ifndef _def_lib_ast
#define _def_lib_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/include/ast/ast_limits.h b/usr/src/lib/libast/sparcv9/include/ast/ast_limits.h
index aa9bb8f9a0..805c03a45d 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/ast_limits.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/ast_limits.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/limits.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/limits.c by iffe version 2008-01-31 : : */
#ifndef _def_limits_ast
#define _def_limits_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/include/ast/ast_map.h b/usr/src/lib/libast/sparcv9/include/ast/ast_map.h
index 3d05908817..e18bcb27af 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/ast_map.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/ast_map.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/map.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/map.c by iffe version 2008-01-31 : : */
#ifndef _def_map_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
@@ -142,6 +142,14 @@ extern __MANGLE__ char* getcwd __PROTO__((char*, size_t));
#define getopt_long _ast_getopt_long
#undef getopt_long_only
#define getopt_long_only _ast_getopt_long_only
+#undef optopt
+#define optopt _ast_optopt
+#undef optarg
+#define optarg _ast_optarg
+#undef optind
+#define optind _ast_optind
+#undef opterr
+#define opterr _ast_opterr
#undef getwd
#define getwd _ast_getwd
extern __MANGLE__ char* getwd __PROTO__((char*));
@@ -167,6 +175,8 @@ extern __MANGLE__ char* mktemp __PROTO__((char*));
#define mktime _ast_mktime
#undef nftw
#define nftw _ast_nftw
+#undef optctx
+#define optctx _ast_optctx
#undef optesc
#define optesc _ast_optesc
#undef optget
@@ -295,7 +305,7 @@ extern __MANGLE__ char* realpath __PROTO__((const char*, char*));
extern __MANGLE__ int remove __PROTO__((const char*));
#undef resolvepath
#define resolvepath _ast_resolvepath
-extern __MANGLE__ char* resolvepath __PROTO__((const char*, char*, size_t));
+extern __MANGLE__ int resolvepath __PROTO__((const char*, char*, size_t));
#undef setenv
#define setenv _ast_setenv
extern __MANGLE__ int setenv __PROTO__((const char*, const char*, int));
diff --git a/usr/src/lib/libast/sparcv9/include/ast/ast_mmap.h b/usr/src/lib/libast/sparcv9/include/ast/ast_mmap.h
index 66b7fe43c0..e076458cf8 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/ast_mmap.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/ast_mmap.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/mmap by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/mmap by iffe version 2008-01-31 : : */
#ifndef _def_mmap_ast
#define _def_mmap_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/include/ast/ast_mode.h b/usr/src/lib/libast/sparcv9/include/ast/ast_mode.h
index 674760685e..733b4a3ba9 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/ast_mode.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/ast_mode.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/mode.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/mode.c by iffe version 2008-01-31 : : */
#ifndef _def_mode_ast
#define _def_mode_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/include/ast/ast_namval.h b/usr/src/lib/libast/sparcv9/include/ast/ast_namval.h
new file mode 100644
index 0000000000..4c9b12f480
--- /dev/null
+++ b/usr/src/lib/libast/sparcv9/include/ast/ast_namval.h
@@ -0,0 +1,51 @@
+
+/* : : generated by proto : : */
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* David Korn <dgk@research.att.com> *
+* Phong Vo <kpv@research.att.com> *
+* *
+***********************************************************************/
+
+/*
+ * Glenn Fowler
+ * AT&T Research
+ *
+ * common name-value struct support
+ */
+
+#ifndef _NAMVAL_H
+#if !defined(__PROTO__)
+#include <prototyped.h>
+#endif
+#if !defined(__LINKAGE__)
+#define __LINKAGE__ /* 2004-08-11 transition */
+#endif
+
+#define _NAMVAL_H
+
+typedef struct
+{
+ char* name;
+ int value;
+#ifdef _NAMVAL_PRIVATE_
+ _NAMVAL_PRIVATE_
+#endif
+} Namval_t;
+
+#endif
diff --git a/usr/src/lib/libast/sparcv9/include/ast/ast_ndbm.h b/usr/src/lib/libast/sparcv9/include/ast/ast_ndbm.h
new file mode 100644
index 0000000000..3818920d7a
--- /dev/null
+++ b/usr/src/lib/libast/sparcv9/include/ast/ast_ndbm.h
@@ -0,0 +1,30 @@
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* David Korn <dgk@research.att.com> *
+* Phong Vo <kpv@research.att.com> *
+* *
+***********************************************************************/
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/ndbm by iffe version 2008-01-31 : : */
+#ifndef _def_ndbm_ast
+#define _def_ndbm_ast 1
+#define _sys_types 1 /* #include <sys/types.h> ok */
+#define _hdr_ndbm 1 /* #include <ndbm.h> ok */
+#include <ndbm.h>
+#define _use_ndbm 1
+
+#endif
diff --git a/usr/src/lib/libast/sparcv9/include/ast/ast_nl_types.h b/usr/src/lib/libast/sparcv9/include/ast/ast_nl_types.h
index 90ac05aeea..930c8428d6 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/ast_nl_types.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/ast_nl_types.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/nl_types by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/nl_types by iffe version 2008-01-31 : : */
#ifndef _def_nl_types_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparcv9/include/ast/ast_param.h b/usr/src/lib/libast/sparcv9/include/ast/ast_param.h
index cb0c504848..259bad3eb6 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/ast_param.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/ast_param.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/param.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/param.sh by iffe version 2008-01-31 : : */
#ifndef _def_param_ast
#define _def_param_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/include/ast/ast_standards.h b/usr/src/lib/libast/sparcv9/include/ast/ast_standards.h
index a6713c0db7..63f05ff515 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/ast_standards.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/ast_standards.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/standards by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/standards by iffe version 2008-01-31 : : */
#ifndef _def_standards_ast
#define _def_standards_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/include/ast/ast_std.h b/usr/src/lib/libast/sparcv9/include/ast/ast_std.h
index 68e7984670..4f3f3dd9da 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/ast_std.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/ast_std.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -117,16 +117,24 @@ struct lconv
#define __MANGLE__ __LINKAGE__ __EXPORT__
#endif
+#undef getenv
+#define getenv _ast_getenv
+
#undef localeconv
#define localeconv _ast_localeconv
#undef setlocale
#define setlocale _ast_setlocale
+#undef setenviron
+#define setenviron _ast_setenviron
+
#undef strerror
#define strerror _ast_strerror
+extern __MANGLE__ char* getenv __PROTO__((const char*));
extern __MANGLE__ struct lconv* localeconv __PROTO__((void));
+extern __MANGLE__ char* setenviron __PROTO__((const char*));
extern __MANGLE__ char* setlocale __PROTO__((int, const char*));
extern __MANGLE__ char* strerror __PROTO__((int));
@@ -335,6 +343,16 @@ extern __MANGLE__ int _ast_getpgrp __PROTO__((void));
#undef _AST_STD_I
+#if _AST_GETOPT_H < 0
+#undef _AST_GETOPT_H
+#include <ast_getopt.h>
+#endif
+
+#if _GETOPT_H < 0
+#undef _GETOPT_H
+#include <getopt.h>
+#endif
+
#if _REGEX_H < 0
#undef _REGEX_H
#include <regex.h>
diff --git a/usr/src/lib/libast/sparcv9/include/ast/ast_stdio.h b/usr/src/lib/libast/sparcv9/include/ast/ast_stdio.h
index 121a85717a..2017750455 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/ast_stdio.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/ast_stdio.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/stdio by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/stdio by iffe version 2008-01-31 : : */
#ifndef _SFSTDIO_H
#if !defined(__PROTO__)
@@ -199,7 +199,7 @@ extern __MANGLE__ int fprintf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fpurge __PROTO__((FILE*));
extern __MANGLE__ int fputc __PROTO__((int, FILE*));
extern __MANGLE__ int fputs __PROTO__((const char*, FILE*));
-extern __MANGLE__ ssize_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
extern __MANGLE__ FILE* freopen __PROTO__((const char*, const char*, FILE*));
extern __MANGLE__ int fscanf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fseek __PROTO__((FILE*, long, int));
@@ -207,7 +207,7 @@ extern __MANGLE__ int fseeko __PROTO__((FILE*, off_t, int));
extern __MANGLE__ int fsetpos __PROTO__((FILE*, const fpos_t*));
extern __MANGLE__ long ftell __PROTO__((FILE*));
extern __MANGLE__ off_t ftello __PROTO__((FILE*));
-extern __MANGLE__ ssize_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
extern __MANGLE__ int getc __PROTO__((FILE*));
extern __MANGLE__ int getchar __PROTO__((void));
extern __MANGLE__ char* gets __PROTO__((char*));
@@ -266,6 +266,10 @@ extern __MANGLE__ int getchar_unlocked __PROTO__((void));
extern __MANGLE__ int putc_unlocked __PROTO__((int, FILE*));
extern __MANGLE__ int putchar_unlocked __PROTO__((int));
+extern __MANGLE__ void flockfile __PROTO__((FILE*));
+extern __MANGLE__ int ftrylockfile __PROTO__((FILE*));
+extern __MANGLE__ void funlockfile __PROTO__((FILE*));
+
#ifdef _USE_GNU
extern __MANGLE__ int fcloseall __PROTO__((void));
@@ -345,6 +349,7 @@ extern __MANGLE__ ssize_t getline __PROTO__((char**, size_t*, FILE*));
#define vsprintf _ast_vsprintf
#define vsscanf _ast_vsscanf
#define fcloseall _ast_fcloseall
+#define _filbuf _ast__filbuf
#define fmemopen _ast_fmemopen
#define __getdelim _ast___getdelim
#define getdelim _ast_getdelim
@@ -364,6 +369,9 @@ extern __MANGLE__ ssize_t getline __PROTO__((char**, size_t*, FILE*));
#define getchar_unlocked _ast_getchar_unlocked
#define putc_unlocked _ast_putc_unlocked
#define putchar_unlocked _ast_putchar_unlocked
+#define flockfile _ast_flockfile
+#define ftrylockfile _ast_ftrylockfile
+#define funlockfile _ast_funlockfile
#if defined(__STDPP__directive) && defined(__STDPP__initial)
__STDPP__directive pragma pp:initial
@@ -423,7 +431,7 @@ extern __MANGLE__ int fprintf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fpurge __PROTO__((FILE*));
extern __MANGLE__ int fputc __PROTO__((int, FILE*));
extern __MANGLE__ int fputs __PROTO__((const char*, FILE*));
-extern __MANGLE__ ssize_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
extern __MANGLE__ FILE* freopen __PROTO__((const char*, const char*, FILE*));
extern __MANGLE__ int fscanf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fseek __PROTO__((FILE*, long, int));
@@ -431,7 +439,7 @@ extern __MANGLE__ int fseeko __PROTO__((FILE*, off_t, int));
extern __MANGLE__ int fsetpos __PROTO__((FILE*, const fpos_t*));
extern __MANGLE__ long ftell __PROTO__((FILE*));
extern __MANGLE__ off_t ftello __PROTO__((FILE*));
-extern __MANGLE__ ssize_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
extern __MANGLE__ int getc __PROTO__((FILE*));
extern __MANGLE__ int getchar __PROTO__((void));
extern __MANGLE__ char* gets __PROTO__((char*));
diff --git a/usr/src/lib/libast/sparcv9/include/ast/ast_sys.h b/usr/src/lib/libast/sparcv9/include/ast/ast_sys.h
index 493fdadafb..ad32fd43a6 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/ast_sys.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/ast_sys.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/sys by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/sys by iffe version 2008-01-31 : : */
#ifndef _AST_SYS_H
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparcv9/include/ast/ast_time.h b/usr/src/lib/libast/sparcv9/include/ast/ast_time.h
index 28c415109d..e1564ee374 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/ast_time.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/ast_time.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/time by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/time by iffe version 2008-01-31 : : */
#ifndef _def_time_ast
#if !defined(__PROTO__)
@@ -97,7 +97,7 @@
#include <sys/times.h>
-#ifndef CLOCKS_PER_SEC
+#if !defined(CLOCKS_PER_SEC) && defined(CLK_TCK)
#define CLOCKS_PER_SEC CLK_TCK
#endif
diff --git a/usr/src/lib/libast/sparcv9/include/ast/ast_tty.h b/usr/src/lib/libast/sparcv9/include/ast/ast_tty.h
index a46782c692..e0a03bbe45 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/ast_tty.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/ast_tty.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/tty by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/tty by iffe version 2008-01-31 : : */
#ifndef _def_tty_ast
#define _def_tty_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/include/ast/ast_version.h b/usr/src/lib/libast/sparcv9/include/ast/ast_version.h
index 0e586f9555..5882fbd2a5 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/ast_version.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/ast_version.h
@@ -7,4 +7,4 @@
#if !defined(__LINKAGE__)
#define __LINKAGE__ /* 2004-08-11 transition */
#endif
-#define _AST_VERSION 20061111L
+#define _AST_VERSION 20080910L
diff --git a/usr/src/lib/libast/sparcv9/include/ast/ast_vfork.h b/usr/src/lib/libast/sparcv9/include/ast/ast_vfork.h
index 06fc6a49a5..3a9c783f17 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/ast_vfork.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/ast_vfork.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/vfork by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/vfork by iffe version 2008-01-31 : : */
#ifndef _def_vfork_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparcv9/include/ast/ast_wait.h b/usr/src/lib/libast/sparcv9/include/ast/ast_wait.h
index 443d16814f..9871a31b0c 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/ast_wait.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/ast_wait.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/wait by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/wait by iffe version 2008-01-31 : : */
#ifndef _def_wait_ast
#define _def_wait_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/include/ast/ast_wchar.h b/usr/src/lib/libast/sparcv9/include/ast/ast_wchar.h
index 442617c82f..d16e55a896 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/ast_wchar.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/ast_wchar.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/wchar by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/wchar by iffe version 2008-01-31 : : */
#ifndef _def_wchar_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparcv9/include/ast/ast_windows.h b/usr/src/lib/libast/sparcv9/include/ast/ast_windows.h
index 90e0260f59..b329b2d2f5 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/ast_windows.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/ast_windows.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/bytesex.h b/usr/src/lib/libast/sparcv9/include/ast/bytesex.h
index 2bf2022afb..95c43e160d 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/bytesex.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/bytesex.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/ccode.h b/usr/src/lib/libast/sparcv9/include/ast/ccode.h
index d26926ebc4..70c8d76471 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/ccode.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/ccode.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/cdt.h b/usr/src/lib/libast/sparcv9/include/ast/cdt.h
index f6274cef92..3dc5b7b7f8 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/cdt.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/cdt.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/debug.h b/usr/src/lib/libast/sparcv9/include/ast/debug.h
index ad7ecb7a54..565212e93b 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/debug.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/debug.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -40,14 +40,50 @@
#include <ast.h>
#include <error.h>
+#if !defined(DEBUG) && _BLD_DEBUG
+#define DEBUG _BLD_DEBUG
+#endif
+
#if DEBUG || _BLD_DEBUG
+
#define debug(x) x
#define message(x) do if (error_info.trace < 0) { error x; } while (0)
#define messagef(x) do if (error_info.trace < 0) { errorf x; } while (0)
+
+#define DEBUG_BEGTIME() debug_elapsed(1)
+#define DEBUG_GETTIME() debug_elapsed(0)
+#define DEBUG_ASSERT(p) ((p) ? 0 : (debug_fatal(__FILE__, __LINE__),0))
+#define DEBUG_COUNT(n) ((n) += 1)
+#define DEBUG_TALLY(c,n,v) ((c) ? ((n) += (v)) : (n))
+#define DEBUG_DECLARE(t,v) t v
+#define DEBUG_SET(n,v) ((n) = (v))
+#define DEBUG_PRINT(fd,s,v) do {char _b[1024];write(fd,_b,sfsprintf(_b,sizeof(_b),s,v));} while(0)
+#define DEBUG_WRITE(fd,d,n) write((fd),(d),(n))
+#define DEBUG_TEMP(temp) (temp) /* debugging stuff that should be removed */
+#define DEBUG_RETURN(x) (debug_fatal(__FILE__, __LINE__), (x))
+#define DEBUG_BREAK (debug_fatal(__FILE__, __LINE__))
+#define DEBUG_GOTO(label) do { debug_fatal(__FILE__, __LINE__); goto label; } while(0)
+
#else
+
#define debug(x)
#define message(x)
#define messagef(x)
+
+#define DEBUG_BEGTIME()
+#define DEBUG_GETTIME()
+#define DEBUG_ASSERT(p)
+#define DEBUG_COUNT(n)
+#define DEBUG_TALLY(c,n,v)
+#define DEBUG_DECLARE(t,v)
+#define DEBUG_SET(n,v)
+#define DEBUG_PRINT(fd,s,v)
+#define DEBUG_WRITE(fd,d,n)
+#define DEBUG_KPV(x)
+#define DEBUG_RETURN(x) return(x)
+#define DEBUG_BREAK break
+#define DEBUG_GOTO(label) goto label
+
#endif
#if _BLD_ast && defined(__EXPORT__)
@@ -55,6 +91,8 @@
#define __MANGLE__ __LINKAGE__ __EXPORT__
#endif
+extern __MANGLE__ double debug_elapsed __PROTO__((int));
+extern __MANGLE__ void debug_fatal __PROTO__((const char*, int));
extern __MANGLE__ void systrace __PROTO__((const char*));
#undef __MANGLE__
diff --git a/usr/src/lib/libast/sparcv9/include/ast/dirent.h b/usr/src/lib/libast/sparcv9/include/ast/dirent.h
index 32f33800b5..b94f22215f 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/dirent.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/dirent.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/dt.h b/usr/src/lib/libast/sparcv9/include/ast/dt.h
index 0b7c331577..12299246bb 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/dt.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/dt.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/endian.h b/usr/src/lib/libast/sparcv9/include/ast/endian.h
index 2299b5a3bc..12539254b6 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/endian.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/endian.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/error.h b/usr/src/lib/libast/sparcv9/include/ast/error.h
index d6d171a15e..1cb01835f7 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/error.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/error.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/find.h b/usr/src/lib/libast/sparcv9/include/ast/find.h
index 0caf2019cf..c094791a30 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/find.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/find.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/fnmatch.h b/usr/src/lib/libast/sparcv9/include/ast/fnmatch.h
index 83e2dd9943..56c7dd7dce 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/fnmatch.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/fnmatch.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/fnv.h b/usr/src/lib/libast/sparcv9/include/ast/fnv.h
index 6af5c1489c..badccc3071 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/fnv.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/fnv.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/fs3d.h b/usr/src/lib/libast/sparcv9/include/ast/fs3d.h
index a16099d7ae..a52478f85c 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/fs3d.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/fs3d.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/fts.h b/usr/src/lib/libast/sparcv9/include/ast/fts.h
index 081fe2a712..a8ce187391 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/fts.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/fts.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -127,6 +127,10 @@ struct Ftsent
#ifdef _FTSENT_PRIVATE_
_FTSENT_PRIVATE_
+#else
+ short _fts_pad_1; /* <ftwalk.h> compatibility */
+ struct stat _fts_pad_2; /* <ftwalk.h> compatibility */
+ FTS* fts; /* fts_open() handle */
#endif
};
@@ -134,6 +138,7 @@ struct Ftsent
struct Fts
{
int fts_errno; /* last errno */
+ __V_* fts_handle; /* user defined handle */
#ifdef _FTS_PRIVATE_
_FTS_PRIVATE_
@@ -149,6 +154,7 @@ struct Fts
extern __MANGLE__ FTSENT* fts_children __PROTO__((FTS*, int));
extern __MANGLE__ int fts_close __PROTO__((FTS*));
extern __MANGLE__ int fts_flags __PROTO__((void));
+extern __MANGLE__ int fts_local __PROTO__((FTSENT*));
extern __MANGLE__ int fts_notify __PROTO__((int(*)(FTS*, FTSENT*, __V_*), __V_*));
extern __MANGLE__ FTS* fts_open __PROTO__((char* const*, int, int(*)(FTSENT* const*, FTSENT* const*)));
extern __MANGLE__ FTSENT* fts_read __PROTO__((FTS*));
diff --git a/usr/src/lib/libast/sparcv9/include/ast/ftw.h b/usr/src/lib/libast/sparcv9/include/ast/ftw.h
index bd39851cbc..3d43cb2609 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/ftw.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/ftw.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/ftwalk.h b/usr/src/lib/libast/sparcv9/include/ast/ftwalk.h
index 1ee713a37a..7172b76565 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/ftwalk.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/ftwalk.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/getopt.h b/usr/src/lib/libast/sparcv9/include/ast/getopt.h
index 01348b6402..4ad28bbb01 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/getopt.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/getopt.h
@@ -7,12 +7,15 @@
#if !defined(__LINKAGE__)
#define __LINKAGE__ /* 2004-08-11 transition */
#endif
-#include <ast_getopt.h>
-
-#if !defined(_GETOPT_H) && !defined(_AST_STD_I)
+#ifdef _AST_STD_I
+#define _GETOPT_H -1
+#endif
+#ifndef _GETOPT_H
#define _GETOPT_H 1
+#include <ast_getopt.h>
+
#define no_argument 0
#define required_argument 1
#define optional_argument 2
diff --git a/usr/src/lib/libast/sparcv9/include/ast/glob.h b/usr/src/lib/libast/sparcv9/include/ast/glob.h
index e02733177d..62c420bb4f 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/glob.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/glob.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -77,8 +77,8 @@ struct _glob_
__V_* (*gl_diropen) __PROTO__((glob_t*, const char*));
char* (*gl_dirnext) __PROTO__((glob_t*, __V_*));
void (*gl_dirclose) __PROTO__((glob_t*, __V_*));
- int (*gl_type) __PROTO__((glob_t*, const char*));
- int (*gl_attr) __PROTO__((glob_t*, const char*));
+ int (*gl_type) __PROTO__((glob_t*, const char*, int));
+ int (*gl_attr) __PROTO__((glob_t*, const char*, int));
/* gnu extensions -- but how do you synthesize dirent and stat? */
diff --git a/usr/src/lib/libast/sparcv9/include/ast/hash.h b/usr/src/lib/libast/sparcv9/include/ast/hash.h
index 4050612983..3ad42981e3 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/hash.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/hash.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/hashkey.h b/usr/src/lib/libast/sparcv9/include/ast/hashkey.h
index 1ce051ff26..ac0557f6df 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/hashkey.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/hashkey.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/hashpart.h b/usr/src/lib/libast/sparcv9/include/ast/hashpart.h
index b2aa79649a..90f2be5c31 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/hashpart.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/hashpart.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/iconv.h b/usr/src/lib/libast/sparcv9/include/ast/iconv.h
index e63b3f0fcd..58bc8240d2 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/iconv.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/iconv.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/ip6.h b/usr/src/lib/libast/sparcv9/include/ast/ip6.h
new file mode 100644
index 0000000000..2712064a7e
--- /dev/null
+++ b/usr/src/lib/libast/sparcv9/include/ast/ip6.h
@@ -0,0 +1,28 @@
+
+/* : : generated by proto : : */
+
+#if !defined(__PROTO__)
+#include <prototyped.h>
+#endif
+#if !defined(__LINKAGE__)
+#define __LINKAGE__ /* 2004-08-11 transition */
+#endif
+#if !_IP6_H
+#define _IP6_H 1
+
+#define IP6ADDR 16
+#define IP6BITS IP6ADDR
+#define IP6PREFIX (IP6ADDR+1)
+
+#if _BLD_ast && defined(__EXPORT__)
+#undef __MANGLE__
+#define __MANGLE__ __LINKAGE__ __EXPORT__
+#endif
+
+extern __MANGLE__ char* fmtip6 __PROTO__((unsigned char*, int));
+extern __MANGLE__ int strtoip6 __PROTO__((const char*, char**, unsigned char*, unsigned char*));
+
+#undef __MANGLE__
+#define __MANGLE__ __LINKAGE__
+
+#endif
diff --git a/usr/src/lib/libast/sparcv9/include/ast/lc.h b/usr/src/lib/libast/sparcv9/include/ast/lc.h
index fdd804f36e..b225864bbc 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/lc.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/lc.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/ls.h b/usr/src/lib/libast/sparcv9/include/ast/ls.h
index cce1771b3f..b195c70e0c 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/ls.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/ls.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/magic.h b/usr/src/lib/libast/sparcv9/include/ast/magic.h
index f484f2b20d..cf3c0fdcb8 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/magic.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/magic.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/magicid.h b/usr/src/lib/libast/sparcv9/include/ast/magicid.h
index ceadff2653..66507d4d0b 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/magicid.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/magicid.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/mc.h b/usr/src/lib/libast/sparcv9/include/ast/mc.h
index 4b55665b3b..be15276038 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/mc.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/mc.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/mime.h b/usr/src/lib/libast/sparcv9/include/ast/mime.h
index b018b68c9a..c214a31130 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/mime.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/mime.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/mnt.h b/usr/src/lib/libast/sparcv9/include/ast/mnt.h
index d877416642..ddce19fc9d 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/mnt.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/mnt.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/modecanon.h b/usr/src/lib/libast/sparcv9/include/ast/modecanon.h
index ce107238e3..f207540d5b 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/modecanon.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/modecanon.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/modex.h b/usr/src/lib/libast/sparcv9/include/ast/modex.h
index 458ad18ac1..96971e347b 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/modex.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/modex.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/namval.h b/usr/src/lib/libast/sparcv9/include/ast/namval.h
index d746970d58..4c9b12f480 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/namval.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/namval.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/nl_types.h b/usr/src/lib/libast/sparcv9/include/ast/nl_types.h
index db7383c626..36c901d8ed 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/nl_types.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/nl_types.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/option.h b/usr/src/lib/libast/sparcv9/include/ast/option.h
index 7204047891..0cb1ca74c5 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/option.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/option.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -112,6 +112,7 @@ extern __MANGLE__ char* opthelp __PROTO__((const char*, const char*));
extern __MANGLE__ char* optusage __PROTO__((const char*));
extern __MANGLE__ int optstr __PROTO__((const char*, const char*));
extern __MANGLE__ int optesc __PROTO__((Sfio_t*, const char*, int));
+extern __MANGLE__ Opt_t* optctx __PROTO__((Opt_t*, Opt_t*));
#undef __MANGLE__
#define __MANGLE__ __LINKAGE__
diff --git a/usr/src/lib/libast/sparcv9/include/ast/preroot.h b/usr/src/lib/libast/sparcv9/include/ast/preroot.h
index f9e45684f4..43cc7b8567 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/preroot.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/preroot.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/preroot.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/preroot.sh by iffe version 2008-01-31 : : */
#ifndef _def_preroot_ast
#define _def_preroot_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/include/ast/proc.h b/usr/src/lib/libast/sparcv9/include/ast/proc.h
index 1196fc5b3f..2bfa576970 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/proc.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/proc.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -41,12 +41,14 @@
#define PROC_ARGMOD (1<<0) /* argv[-1],argv[0] can be modified */
#define PROC_BACKGROUND (1<<1) /* shell background (&) setup */
+#define PROC_CHECK (1<<17) /* check that command exists */
#define PROC_CLEANUP (1<<2) /* close parent redirect fds on error */
#define PROC_DAEMON (1<<3) /* daemon setup */
#define PROC_ENVCLEAR (1<<4) /* clear environment */
#define PROC_FOREGROUND (1<<14) /* system(3) setup */
#define PROC_GID (1<<5) /* setgid(getgid()) */
#define PROC_IGNORE (1<<6) /* ignore parent pipe errors */
+#define PROC_IGNOREPATH (1<<16) /* procrun() intercept to ignore path */
#define PROC_OVERLAY (1<<7) /* overlay current process if possible */
#define PROC_PARANOID (1<<8) /* restrict everything */
#define PROC_PRIVELEGED (1<<9) /* setuid(0), setgid(getegid()) */
@@ -104,8 +106,8 @@ _PROC_PRIVATE_
extern __MANGLE__ int procclose __PROTO__((Proc_t*));
extern __MANGLE__ int procfree __PROTO__((Proc_t*));
-extern __MANGLE__ Proc_t* procopen __PROTO__((const char*, char**, char**, long*, long));
-extern __MANGLE__ int procrun __PROTO__((const char*, char**));
+extern __MANGLE__ Proc_t* procopen __PROTO__((const char*, char**, char**, long*, int));
+extern __MANGLE__ int procrun __PROTO__((const char*, char**, int));
#undef __MANGLE__
#define __MANGLE__ __LINKAGE__
diff --git a/usr/src/lib/libast/sparcv9/include/ast/re_comp.h b/usr/src/lib/libast/sparcv9/include/ast/re_comp.h
index 5da565e880..381bc801fc 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/re_comp.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/re_comp.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/recfmt.h b/usr/src/lib/libast/sparcv9/include/ast/recfmt.h
index 1a66761ec2..133e37da41 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/recfmt.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/recfmt.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/regexp.h b/usr/src/lib/libast/sparcv9/include/ast/regexp.h
index b7f3ed6313..e1c6258b3e 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/regexp.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/regexp.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/sfdisc.h b/usr/src/lib/libast/sparcv9/include/ast/sfdisc.h
index 9e657f045b..5303d9a62e 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/sfdisc.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/sfdisc.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/sfio.h b/usr/src/lib/libast/sparcv9/include/ast/sfio.h
index 9feba3043e..11317dad65 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/sfio.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/sfio.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -22,7 +22,7 @@
#ifndef _SFIO_H
#define _SFIO_H 1
-#define SFIO_VERSION 20050202L
+#define SFIO_VERSION 20080717L
/* Public header file for the sfio library
**
@@ -181,6 +181,7 @@ struct _sffmt_s
/* for the notify function and discipline exception */
#define SF_NEW 0 /* new stream */
#define SF_SETFD (-1) /* about to set the file descriptor */
+#define SF_MTACCESS (-2) /* starting a multi-threaded stream */
#define SF_BUFSIZE 8192 /* default buffer size */
#define SF_UNBOUND (-1) /* unbounded buffer size */
@@ -240,7 +241,7 @@ extern int sfclrlock _ARG_((Sfio_t*));
extern Void_t* sfsetbuf _ARG_((Sfio_t*, Void_t*, size_t));
extern Sfdisc_t* sfdisc _ARG_((Sfio_t*,Sfdisc_t*));
extern int sfraise _ARG_((Sfio_t*, int, Void_t*));
-extern int sfnotify _ARG_((void(*)(Sfio_t*, int, int)));
+extern int sfnotify _ARG_((void(*)(Sfio_t*, int, void*)));
extern int sfset _ARG_((Sfio_t*, int, int));
extern int sfsetfd _ARG_((Sfio_t*, int));
extern Sfio_t* sfpool _ARG_((Sfio_t*, Sfio_t*, int));
diff --git a/usr/src/lib/libast/sparcv9/include/ast/sfio_s.h b/usr/src/lib/libast/sparcv9/include/ast/sfio_s.h
index 27936a16b1..19a23d4772 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/sfio_s.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/sfio_s.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/sfio_t.h b/usr/src/lib/libast/sparcv9/include/ast/sfio_t.h
index 36be6ecc94..c5251d3f34 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/sfio_t.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/sfio_t.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/shcmd.h b/usr/src/lib/libast/sparcv9/include/ast/shcmd.h
new file mode 100644
index 0000000000..14e282a3d0
--- /dev/null
+++ b/usr/src/lib/libast/sparcv9/include/ast/shcmd.h
@@ -0,0 +1,103 @@
+
+/* : : generated by proto : : */
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* David Korn <dgk@research.att.com> *
+* Phong Vo <kpv@research.att.com> *
+* *
+***********************************************************************/
+
+
+/*
+ * ksh builtin command api
+ */
+
+#ifndef _SHCMD_H
+#if !defined(__PROTO__)
+#include <prototyped.h>
+#endif
+#if !defined(__LINKAGE__)
+#define __LINKAGE__ /* 2004-08-11 transition */
+#endif
+
+#define _SHCMD_H 1
+
+#ifndef SH_VERSION
+# define Shell_t void
+#endif
+#ifndef NV_DEFAULT
+# define Namval_t void
+#endif
+#ifndef ERROR_NOTIFY
+# define ERROR_NOTIFY 1
+#endif
+
+typedef int (*Shbltin_f) __PROTO__((int, char**, __V_*));
+
+#undef Shbltin_t
+typedef struct Shbltin_s
+{
+ Shell_t *shp;
+ __V_ *ptr;
+ int version;
+ int (*shrun) __PROTO__((int, char**));
+ int (*shtrap) __PROTO__((const char*, int));
+ void (*shexit) __PROTO__((int));
+ Namval_t *(*shbltin) __PROTO__((const char*, Shbltin_f, __V_*));
+ unsigned char notify;
+ unsigned char sigset;
+ unsigned char nosfio;
+ Namval_t *bnode;
+ Namval_t *vnode;
+ char *data;
+ int flags;
+ char *(*shgetenv) __PROTO__((const char*));
+ char *(*shsetenv) __PROTO__((const char*));
+ int invariant;
+} Shbltin_t;
+
+#if defined(SH_VERSION) || defined(_SH_PRIVATE)
+# undef Shell_t
+# undef Namval_t
+#else
+# define sh_run(c, ac, av) ((c)?(*((Shbltin_t*)(c))->shrun)(ac,av):-1)
+# define sh_system(c,str) ((c)?(*((Shbltin_t*)(c))->shtrap)(str,0):system(str))
+# define sh_exit(c,n) ((c)?(*((Shbltin_t*)(c))->shexit)(n):exit(n))
+# define sh_checksig(c) ((c) && ((Shbltin_t*)(c))->sigset)
+# if defined(SFIO_VERSION) || defined(_AST_H)
+# define LIB_INIT(c)
+# else
+# define LIB_INIT(c) ((c) && (((Shbltin_t*)(c))->nosfio = 1))
+# endif
+# ifndef _CMD_H
+# define cmdinit(ac,av,c,cat,flg) do { if((ac)<=0) return(0); \
+ (((Shbltin_t*)(c))->notify = ((flg)&ERROR_NOTIFY)?1:0);} while(0)
+# endif
+#endif
+
+#if _BLD_ast && defined(__EXPORT__)
+#undef __MANGLE__
+#define __MANGLE__ __LINKAGE__ __EXPORT__
+#endif
+
+extern __MANGLE__ int astintercept __PROTO__((Shbltin_t*, int));
+
+#undef __MANGLE__
+#define __MANGLE__ __LINKAGE__
+
+#endif
diff --git a/usr/src/lib/libast/sparcv9/include/ast/sig.h b/usr/src/lib/libast/sparcv9/include/ast/sig.h
index 7c7f5eeb23..a095a0cf26 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/sig.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/sig.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/sig.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/sig.sh by iffe version 2008-01-31 : : */
#ifndef _def_sig_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
diff --git a/usr/src/lib/libast/sparcv9/include/ast/stack.h b/usr/src/lib/libast/sparcv9/include/ast/stack.h
index ad32ebb8ab..5c55255f06 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/stack.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/stack.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/stak.h b/usr/src/lib/libast/sparcv9/include/ast/stak.h
index e0e707b0e5..321be20328 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/stak.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/stak.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/stdio.h b/usr/src/lib/libast/sparcv9/include/ast/stdio.h
index 7e137c5712..42d7ed8269 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/stdio.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/stdio.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/stk.h b/usr/src/lib/libast/sparcv9/include/ast/stk.h
index 24947d24f1..ef9a946ce0 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/stk.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/stk.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -84,6 +84,7 @@ extern __MANGLE__ char* stkcopy __PROTO__((Stk_t*,const char*));
extern __MANGLE__ char* stkset __PROTO__((Stk_t*, char*, unsigned));
extern __MANGLE__ char* _stkseek __PROTO__((Stk_t*, unsigned));
extern __MANGLE__ char* stkfreeze __PROTO__((Stk_t*, unsigned));
+extern __MANGLE__ int stkon __PROTO__((Stk_t*, char *));
#undef __MANGLE__
#define __MANGLE__ __LINKAGE__
diff --git a/usr/src/lib/libast/sparcv9/include/ast/swap.h b/usr/src/lib/libast/sparcv9/include/ast/swap.h
index d89248d12b..81e49db105 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/swap.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/swap.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/tar.h b/usr/src/lib/libast/sparcv9/include/ast/tar.h
index 910b6e8612..3a9a99b0ac 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/tar.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/tar.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/times.h b/usr/src/lib/libast/sparcv9/include/ast/times.h
index 25e81662be..1ed0f2135a 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/times.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/times.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/tm.h b/usr/src/lib/libast/sparcv9/include/ast/tm.h
index f790a9a66e..29c0d4f1fa 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/tm.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/tm.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/tmx.h b/usr/src/lib/libast/sparcv9/include/ast/tmx.h
index bf69ccfda8..c8a9b7477f 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/tmx.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/tmx.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/tmx by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/tmx by iffe version 2008-01-31 : : */
#ifndef _TMX_H
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparcv9/include/ast/tok.h b/usr/src/lib/libast/sparcv9/include/ast/tok.h
index 3637489918..1d5112837c 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/tok.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/tok.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/tv.h b/usr/src/lib/libast/sparcv9/include/ast/tv.h
index 95aea300f6..94d87c22b3 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/tv.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/tv.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
***********************************************************************/
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/tv by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/tv by iffe version 2008-01-31 : : */
#ifndef _TV_H
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparcv9/include/ast/usage.h b/usr/src/lib/libast/sparcv9/include/ast/usage.h
index 81b59e1aca..d969a0e4c1 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/usage.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/usage.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/vdb.h b/usr/src/lib/libast/sparcv9/include/ast/vdb.h
index 63e310c724..ba47e14901 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/vdb.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/vdb.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/vecargs.h b/usr/src/lib/libast/sparcv9/include/ast/vecargs.h
index 4d329cd154..121e9d5010 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/vecargs.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/vecargs.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/vmalloc.h b/usr/src/lib/libast/sparcv9/include/ast/vmalloc.h
index f0a8114c6a..8cf3e9b974 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/vmalloc.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/vmalloc.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -27,7 +27,7 @@
** Written by Kiem-Phong Vo, kpv@research.att.com, 01/16/94.
*/
-#define VMALLOC_VERSION 20050928L
+#define VMALLOC_VERSION 20070911L
#if _PACKAGE_ast
#include <ast_std.h>
diff --git a/usr/src/lib/libast/sparcv9/include/ast/wait.h b/usr/src/lib/libast/sparcv9/include/ast/wait.h
index 6910081961..08160043fa 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/wait.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/wait.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/wchar.h b/usr/src/lib/libast/sparcv9/include/ast/wchar.h
index 557a403adc..7796480d09 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/wchar.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/wchar.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/include/ast/wordexp.h b/usr/src/lib/libast/sparcv9/include/ast/wordexp.h
index b2e80d9f35..c3f97b37d9 100644
--- a/usr/src/lib/libast/sparcv9/include/ast/wordexp.h
+++ b/usr/src/lib/libast/sparcv9/include/ast/wordexp.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/align b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/align
index 67bdb68aae..47a9dd4cd7 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/align
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/align
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/align.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/align.c by iffe version 2008-01-31 : : */
#ifndef _def_align_ast
#define _def_align_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/botch b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/botch
index bd5405c63c..826811b6de 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/botch
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/botch
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/botch.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/botch.c by iffe version 2008-01-31 : : */
#ifndef _def_botch_ast
#define _def_botch_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/ccode b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/ccode
index 7055bf926b..af262d71e8 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/ccode
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/ccode
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/ccode by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/ccode by iffe version 2008-01-31 : : */
#ifndef _def_ccode_ast
#define _def_ccode_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/common b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/common
index 858d0995e7..b8458bb017 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/common
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/common
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/common by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/common by iffe version 2008-01-31 : : */
#ifndef _AST_COMMON_H
#define _AST_COMMON_H 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/dirent b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/dirent
index 5c447ac078..0fced82d9e 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/dirent
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/dirent
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/dirent by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/dirent by iffe version 2008-01-31 : : */
#ifndef _def_dirent_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/eaccess b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/eaccess
index c2ebb0ca07..8cd966b6e6 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/eaccess
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/eaccess
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/eaccess by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/eaccess by iffe version 2008-01-31 : : */
#ifndef _def_eaccess_ast
#define _def_eaccess_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/errno b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/errno
index 85bd48edd7..c0c3262ab1 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/errno
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/errno
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/errno by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/errno by iffe version 2008-01-31 : : */
#ifndef _def_errno_ast
#define _def_errno_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/fcntl b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/fcntl
index 156e2ec213..cbc1b8ade8 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/fcntl
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/fcntl
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/fcntl.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/fcntl.c by iffe version 2008-01-31 : : */
#ifndef _def_fcntl_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/float b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/float
index de179a370c..282df4d035 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/float
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/float
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/float by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/float by iffe version 2008-01-31 : : */
#ifndef _def_float_ast
#if !defined(__PROTO__)
@@ -68,13 +68,16 @@
#define _hdr_math 1 /* #include <math.h> ok */
#define _hdr_values 1 /* #include <values.h> ok */
#define _LIB_m 1 /* -lm is a library */
+#define _lib_fpclassify 1 /* fpclassify() in default lib(s) */
#define _lib_frexp 1 /* frexp() in default lib(s) */
#define _lib_frexpl 1 /* frexpl() in default lib(s) */
#define _lib_ldexp 1 /* ldexp() in default lib(s) */
#define _lib_ldexpl 1 /* ldexpl() in default lib(s) */
#define _lib_finite 1 /* finite() in default lib(s) */
+#define _lib_isinf 1 /* isinf() in default lib(s) */
#define _lib_isnan 1 /* isnan() in default lib(s) */
#define _lib_isnanl 1 /* isnanl() in default lib(s) */
+#define _lib_signbit 1 /* signbit() in default lib(s) */
#define _lib_copysign 1 /* copysign() in default lib(s) */
#define _lib_copysignl 1 /* copysignl() in default lib(s) */
#include <ast_common.h>
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/fs b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/fs
index d3e524a3d0..7548ff404e 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/fs
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/fs
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/fs by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/fs by iffe version 2008-01-31 : : */
#ifndef _def_fs_ast
#if !defined(__PROTO__)
@@ -68,20 +68,9 @@
#define _lib_mknod 1 /* mknod() in default lib(s) */
#define _lib_sync 1 /* sync() in default lib(s) */
#include <sys/stat.h>
+#include <sys/mkdev.h>
#define FS_default "ufs"
#if defined(__STDPP__directive) && defined(__STDPP__initial)
-__STDPP__directive pragma pp:initial
-#endif
-#ifndef major
-#define major(x) ( major_t ) ( ( ( ( unsigned ) ( ( x ) ) ) >> 8 ) & 0x7f )
-#endif
-#ifndef minor
-#define minor(x) ( minor_t ) ( ( ( x ) ) & 0xff )
-#endif
-#ifndef makedev
-#define makedev(x,y) ( unsigned short ) ( ( ( ( x ) ) << 8 ) | ( ( ( y ) ) & 0xff ) )
-#endif
-#if defined(__STDPP__directive) && defined(__STDPP__initial)
__STDPP__directive pragma pp:noinitial
#endif
#define _hdr_stdio 1 /* #include <stdio.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/hack b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/hack
index 01e6e9f357..a430fbeeea 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/hack
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/hack
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/hack by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/hack by iffe version 2008-01-31 : : */
#ifndef _def_hack_ast
#define _def_hack_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/iconv b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/iconv
index 2409c25672..c6c5d452bf 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/iconv
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/iconv
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/iconv by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/iconv by iffe version 2008-01-31 : : */
#ifndef _def_iconv_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/isoc99 b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/isoc99
new file mode 100644
index 0000000000..96b9949b89
--- /dev/null
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/isoc99
@@ -0,0 +1,11 @@
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/isoc99 by iffe version 2008-01-31 : : */
+#ifndef _def_isoc99_ast
+#define _def_isoc99_ast 1
+#define _sys_types 1 /* #include <sys/types.h> ok */
+#define _LIB_m 1 /* -lm is a library */
+/* _ISOC99_SOURCE plays nice */
+#ifndef _ISOC99_SOURCE
+#define _ISOC99_SOURCE 1
+#endif
+
+#endif
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/lib b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/lib
index c546bc76ef..ff4a6baa81 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/lib
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/lib
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/lib by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/lib by iffe version 2008-01-31 : : */
#ifndef _def_lib_ast
#define _def_lib_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/libpath b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/libpath
index 6801765db9..9bbb2a1b69 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/libpath
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/libpath
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/libpath.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/libpath.sh by iffe version 2008-01-31 : : */
#ifndef _def_libpath_ast
#define _def_libpath_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/limits b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/limits
index d4f848a557..0e62d36fb7 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/limits
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/limits
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/limits.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/limits.c by iffe version 2008-01-31 : : */
#ifndef _def_limits_ast
#define _def_limits_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/map b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/map
index 6103ce9791..98bb09fcef 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/map
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/map
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/map.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/map.c by iffe version 2008-01-31 : : */
#ifndef _def_map_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
@@ -121,6 +121,14 @@ extern __MANGLE__ char* getcwd __PROTO__((char*, size_t));
#define getopt_long _ast_getopt_long
#undef getopt_long_only
#define getopt_long_only _ast_getopt_long_only
+#undef optopt
+#define optopt _ast_optopt
+#undef optarg
+#define optarg _ast_optarg
+#undef optind
+#define optind _ast_optind
+#undef opterr
+#define opterr _ast_opterr
#undef getwd
#define getwd _ast_getwd
extern __MANGLE__ char* getwd __PROTO__((char*));
@@ -146,6 +154,8 @@ extern __MANGLE__ char* mktemp __PROTO__((char*));
#define mktime _ast_mktime
#undef nftw
#define nftw _ast_nftw
+#undef optctx
+#define optctx _ast_optctx
#undef optesc
#define optesc _ast_optesc
#undef optget
@@ -274,7 +284,7 @@ extern __MANGLE__ char* realpath __PROTO__((const char*, char*));
extern __MANGLE__ int remove __PROTO__((const char*));
#undef resolvepath
#define resolvepath _ast_resolvepath
-extern __MANGLE__ char* resolvepath __PROTO__((const char*, char*, size_t));
+extern __MANGLE__ int resolvepath __PROTO__((const char*, char*, size_t));
#undef setenv
#define setenv _ast_setenv
extern __MANGLE__ int setenv __PROTO__((const char*, const char*, int));
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/mmap b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/mmap
index 47b8dc23b2..310a5aed05 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/mmap
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/mmap
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/mmap by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/mmap by iffe version 2008-01-31 : : */
#ifndef _def_mmap_ast
#define _def_mmap_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/mode b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/mode
index 58c29a7ff5..6d4729935b 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/mode
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/mode
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/mode.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/mode.c by iffe version 2008-01-31 : : */
#ifndef _def_mode_ast
#define _def_mode_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/ndbm b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/ndbm
new file mode 100644
index 0000000000..42bec1ff86
--- /dev/null
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/ndbm
@@ -0,0 +1,9 @@
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/ndbm by iffe version 2008-01-31 : : */
+#ifndef _def_ndbm_ast
+#define _def_ndbm_ast 1
+#define _sys_types 1 /* #include <sys/types.h> ok */
+#define _hdr_ndbm 1 /* #include <ndbm.h> ok */
+#include <ndbm.h>
+#define _use_ndbm 1
+
+#endif
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/nl_types b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/nl_types
index 08f46d7dee..7babd03ed3 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/nl_types
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/nl_types
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/nl_types by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/nl_types by iffe version 2008-01-31 : : */
#ifndef _def_nl_types_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/omitted b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/omitted
index d70464bbac..409dbefe47 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/omitted
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/omitted
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/omitted by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/omitted by iffe version 2008-01-31 : : */
#ifndef _def_omitted_ast
#define _def_omitted_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/param b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/param
index 4a9644522d..12a9a5c76c 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/param
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/param
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/param.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/param.sh by iffe version 2008-01-31 : : */
#ifndef _def_param_ast
#define _def_param_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/preroot b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/preroot
index 508e3aada4..1f65b6c24d 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/preroot
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/preroot
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/preroot.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/preroot.sh by iffe version 2008-01-31 : : */
#ifndef _def_preroot_ast
#define _def_preroot_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/sfinit b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/sfinit
index c68b631e2a..7e6f16e370 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/sfinit
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/sfinit
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/sfinit.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/sfinit.c by iffe version 2008-01-31 : : */
#ifndef _def_sfinit_ast
#define _def_sfinit_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/sfio b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/sfio
index e51f7a598a..f9da74edd7 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/sfio
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/sfio
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/sfio by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/sfio by iffe version 2008-01-31 : : */
#ifndef _def_sfio_ast
#define _def_sfio_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/sig b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/sig
index 40e930cd93..0af59f7f3a 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/sig
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/sig
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/sig.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/sig.sh by iffe version 2008-01-31 : : */
#ifndef _def_sig_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/siglist b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/siglist
new file mode 100644
index 0000000000..58c2f0c016
--- /dev/null
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/siglist
@@ -0,0 +1,125 @@
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/siglist by iffe version 2008-01-31 : : */
+#ifndef _def_siglist_ast
+#define _def_siglist_ast 1
+#define _sys_types 1 /* #include <sys/types.h> ok */
+#define _hdr_string 1 /* #include <string.h> ok */
+#define _hdr_signal 1 /* #include <signal.h> ok */
+#define _lib_strsignal 1 /* strsignal() in default lib(s) */
+#if defined(SIGINT) && !defined(HAD_SIGINT)
+0,"INT",SIGINT,
+#endif
+#if defined(SIGQUIT) && !defined(HAD_SIGQUIT)
+0,"QUIT",SIGQUIT,
+#endif
+#if defined(SIGILL) && !defined(HAD_SIGILL)
+0,"ILL",SIGILL,
+#endif
+#if defined(SIGTRAP) && !defined(HAD_SIGTRAP)
+0,"TRAP",SIGTRAP,
+#endif
+#if defined(SIGIOT) && !defined(HAD_SIGIOT)
+0,"IOT",SIGIOT,
+#endif
+#if defined(SIGEMT) && !defined(HAD_SIGEMT)
+0,"EMT",SIGEMT,
+#endif
+#if defined(SIGFPE) && !defined(HAD_SIGFPE)
+0,"FPE",SIGFPE,
+#endif
+#if defined(SIGKILL) && !defined(HAD_SIGKILL)
+0,"KILL",SIGKILL,
+#endif
+#if defined(SIGBUS) && !defined(HAD_SIGBUS)
+0,"BUS",SIGBUS,
+#endif
+#if defined(SIGSEGV) && !defined(HAD_SIGSEGV)
+0,"SEGV",SIGSEGV,
+#endif
+#if defined(SIGSYS) && !defined(HAD_SIGSYS)
+0,"SYS",SIGSYS,
+#endif
+#if defined(SIGPIPE) && !defined(HAD_SIGPIPE)
+0,"PIPE",SIGPIPE,
+#endif
+#if defined(SIGALRM) && !defined(HAD_SIGALRM)
+0,"ALRM",SIGALRM,
+#endif
+#if defined(SIGTERM) && !defined(HAD_SIGTERM)
+0,"TERM",SIGTERM,
+#endif
+#if defined(SIGUSR1) && !defined(HAD_SIGUSR1)
+0,"USR1",SIGUSR1,
+#endif
+#if defined(SIGUSR2) && !defined(HAD_SIGUSR2)
+0,"USR2",SIGUSR2,
+#endif
+#if defined(SIGCHLD) && !defined(HAD_SIGCHLD)
+0,"CHLD",SIGCHLD,
+#endif
+#if defined(SIGPWR) && !defined(HAD_SIGPWR)
+0,"PWR",SIGPWR,
+#endif
+#if defined(SIGWINCH) && !defined(HAD_SIGWINCH)
+0,"WINCH",SIGWINCH,
+#endif
+#if defined(SIGURG) && !defined(HAD_SIGURG)
+0,"URG",SIGURG,
+#endif
+#if defined(SIGPOLL) && !defined(HAD_SIGPOLL)
+0,"POLL",SIGPOLL,
+#endif
+#if defined(SIGSTOP) && !defined(HAD_SIGSTOP)
+0,"STOP",SIGSTOP,
+#endif
+#if defined(SIGTSTP) && !defined(HAD_SIGTSTP)
+0,"TSTP",SIGTSTP,
+#endif
+#if defined(SIGCONT) && !defined(HAD_SIGCONT)
+0,"CONT",SIGCONT,
+#endif
+#if defined(SIGTTIN) && !defined(HAD_SIGTTIN)
+0,"TTIN",SIGTTIN,
+#endif
+#if defined(SIGTTOU) && !defined(HAD_SIGTTOU)
+0,"TTOU",SIGTTOU,
+#endif
+#if defined(SIGVTALRM) && !defined(HAD_SIGVTALRM)
+0,"VTALRM",SIGVTALRM,
+#endif
+#if defined(SIGPROF) && !defined(HAD_SIGPROF)
+0,"PROF",SIGPROF,
+#endif
+#if defined(SIGXCPU) && !defined(HAD_SIGXCPU)
+0,"XCPU",SIGXCPU,
+#endif
+#if defined(SIGXFSZ) && !defined(HAD_SIGXFSZ)
+0,"XFSZ",SIGXFSZ,
+#endif
+#if defined(SIGWAITING) && !defined(HAD_SIGWAITING)
+0,"WAITING",SIGWAITING,
+#endif
+#if defined(SIGLWP) && !defined(HAD_SIGLWP)
+0,"LWP",SIGLWP,
+#endif
+#if defined(SIGFREEZE) && !defined(HAD_SIGFREEZE)
+0,"FREEZE",SIGFREEZE,
+#endif
+#if defined(SIGTHAW) && !defined(HAD_SIGTHAW)
+0,"THAW",SIGTHAW,
+#endif
+#if defined(SIGCANCEL) && !defined(HAD_SIGCANCEL)
+0,"CANCEL",SIGCANCEL,
+#endif
+#if defined(SIGLOST) && !defined(HAD_SIGLOST)
+0,"LOST",SIGLOST,
+#endif
+#if defined(SIGXRES) && !defined(HAD_SIGXRES)
+0,"XRES",SIGXRES,
+#endif
+#if defined(SIGJVM1) && !defined(HAD_SIGJVM1)
+0,"JVM1",SIGJVM1,
+#endif
+#if defined(SIGJVM2) && !defined(HAD_SIGJVM2)
+0,"JVM2",SIGJVM2,
+#endif
+#endif
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/signal b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/signal
index 10dd975320..907ccd9782 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/signal
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/signal
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/signal.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/signal.c by iffe version 2008-01-31 : : */
#ifndef _def_signal_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
@@ -103,18 +103,18 @@ static const char* const sig_name[] =
"LWP",
"FREEZE",
"THAW",
- "36",
+ "CANCEL",
"LOST",
- "38",
- "39",
- "40",
+ "XRES",
+ "JVM1",
+ "JVM2",
"RTMIN",
- "RT1",
- "RT2",
- "RT3",
- "RT4",
- "RT5",
- "RT6",
+ "RTMIN+1",
+ "RTMIN+2",
+ "RTMIN+3",
+ "RTMAX-3",
+ "RTMAX-2",
+ "RTMAX-1",
"RTMAX",
0
};
@@ -157,11 +157,11 @@ static const char* const sig_text[] =
"Thread event",
"CPR freeze",
"CPR thaw",
- "Signal 36",
+ "Thread Cancellation",
"Resources lost",
- "Signal 38",
- "Signal 39",
- "Signal 40",
+ "Resource Control Exceeded",
+ "Reserved for JVM 1",
+ "Reserved for JVM 2",
"Realtime priority 0 (lo)",
"Realtime priority 1",
"Realtime priority 2",
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/standards b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/standards
index f625ff6f49..79a23337bf 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/standards
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/standards
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/standards by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/standards by iffe version 2008-01-31 : : */
#ifndef _def_standards_ast
#define _def_standards_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/stdio b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/stdio
index 0a1824b6fa..bb1b0953c4 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/stdio
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/stdio
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/stdio by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/stdio by iffe version 2008-01-31 : : */
#ifndef _SFSTDIO_H
#if !defined(__PROTO__)
@@ -178,7 +178,7 @@ extern __MANGLE__ int fprintf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fpurge __PROTO__((FILE*));
extern __MANGLE__ int fputc __PROTO__((int, FILE*));
extern __MANGLE__ int fputs __PROTO__((const char*, FILE*));
-extern __MANGLE__ ssize_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
extern __MANGLE__ FILE* freopen __PROTO__((const char*, const char*, FILE*));
extern __MANGLE__ int fscanf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fseek __PROTO__((FILE*, long, int));
@@ -186,7 +186,7 @@ extern __MANGLE__ int fseeko __PROTO__((FILE*, off_t, int));
extern __MANGLE__ int fsetpos __PROTO__((FILE*, const fpos_t*));
extern __MANGLE__ long ftell __PROTO__((FILE*));
extern __MANGLE__ off_t ftello __PROTO__((FILE*));
-extern __MANGLE__ ssize_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
extern __MANGLE__ int getc __PROTO__((FILE*));
extern __MANGLE__ int getchar __PROTO__((void));
extern __MANGLE__ char* gets __PROTO__((char*));
@@ -245,6 +245,10 @@ extern __MANGLE__ int getchar_unlocked __PROTO__((void));
extern __MANGLE__ int putc_unlocked __PROTO__((int, FILE*));
extern __MANGLE__ int putchar_unlocked __PROTO__((int));
+extern __MANGLE__ void flockfile __PROTO__((FILE*));
+extern __MANGLE__ int ftrylockfile __PROTO__((FILE*));
+extern __MANGLE__ void funlockfile __PROTO__((FILE*));
+
#ifdef _USE_GNU
extern __MANGLE__ int fcloseall __PROTO__((void));
@@ -324,6 +328,7 @@ extern __MANGLE__ ssize_t getline __PROTO__((char**, size_t*, FILE*));
#define vsprintf _ast_vsprintf
#define vsscanf _ast_vsscanf
#define fcloseall _ast_fcloseall
+#define _filbuf _ast__filbuf
#define fmemopen _ast_fmemopen
#define __getdelim _ast___getdelim
#define getdelim _ast_getdelim
@@ -343,6 +348,9 @@ extern __MANGLE__ ssize_t getline __PROTO__((char**, size_t*, FILE*));
#define getchar_unlocked _ast_getchar_unlocked
#define putc_unlocked _ast_putc_unlocked
#define putchar_unlocked _ast_putchar_unlocked
+#define flockfile _ast_flockfile
+#define ftrylockfile _ast_ftrylockfile
+#define funlockfile _ast_funlockfile
#if defined(__STDPP__directive) && defined(__STDPP__initial)
__STDPP__directive pragma pp:initial
@@ -402,7 +410,7 @@ extern __MANGLE__ int fprintf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fpurge __PROTO__((FILE*));
extern __MANGLE__ int fputc __PROTO__((int, FILE*));
extern __MANGLE__ int fputs __PROTO__((const char*, FILE*));
-extern __MANGLE__ ssize_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
extern __MANGLE__ FILE* freopen __PROTO__((const char*, const char*, FILE*));
extern __MANGLE__ int fscanf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fseek __PROTO__((FILE*, long, int));
@@ -410,7 +418,7 @@ extern __MANGLE__ int fseeko __PROTO__((FILE*, off_t, int));
extern __MANGLE__ int fsetpos __PROTO__((FILE*, const fpos_t*));
extern __MANGLE__ long ftell __PROTO__((FILE*));
extern __MANGLE__ off_t ftello __PROTO__((FILE*));
-extern __MANGLE__ ssize_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
extern __MANGLE__ int getc __PROTO__((FILE*));
extern __MANGLE__ int getchar __PROTO__((void));
extern __MANGLE__ char* gets __PROTO__((char*));
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/sys b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/sys
index 8b3d838a49..40bdd3f74d 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/sys
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/sys
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/sys by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/sys by iffe version 2008-01-31 : : */
#ifndef _AST_SYS_H
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/time b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/time
index 89db712e51..701c9d785f 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/time
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/time
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/time by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/time by iffe version 2008-01-31 : : */
#ifndef _def_time_ast
#if !defined(__PROTO__)
@@ -76,7 +76,7 @@
#include <sys/times.h>
-#ifndef CLOCKS_PER_SEC
+#if !defined(CLOCKS_PER_SEC) && defined(CLK_TCK)
#define CLOCKS_PER_SEC CLK_TCK
#endif
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/tmlib b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/tmlib
index 4cb071effe..6361871dc1 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/tmlib
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/tmlib
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/tmlib by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/tmlib by iffe version 2008-01-31 : : */
#ifndef _def_tmlib_ast
#if !defined(__PROTO__)
@@ -63,6 +63,9 @@
#define _def_tmlib_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define tmlocaltime(p) localtime(p)
+#define _tzset_environ 1 /* tzset() bypasses user getenv() */
+#define tmlocaltime(p) _tm_localtime(p)
+
+extern __MANGLE__ struct tm* _tm_localtime __PROTO__((const time_t*));
#endif
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/tmx b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/tmx
index 11aa0d9b2b..d08369abf8 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/tmx
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/tmx
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/tmx by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/tmx by iffe version 2008-01-31 : : */
#ifndef _TMX_H
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/tty b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/tty
index fee4db4ea4..4e0a72ed3f 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/tty
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/tty
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/tty by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/tty by iffe version 2008-01-31 : : */
#ifndef _def_tty_ast
#define _def_tty_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/tv b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/tv
index 7f91a2883e..765511125b 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/tv
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/tv
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/tv by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/tv by iffe version 2008-01-31 : : */
#ifndef _TV_H
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/tvlib b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/tvlib
index 62d643333f..4a32d75885 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/tvlib
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/tvlib
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/tvlib by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/tvlib by iffe version 2008-01-31 : : */
#ifndef _def_tvlib_ast
#define _def_tvlib_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
@@ -10,6 +10,7 @@
#define _lib_utimes 1 /* utimes() in default lib(s) */
#define _lib_nanosleep 1 /* nanosleep() in default lib(s) */
#define _lib_usleep 1 /* usleep() in default lib(s) */
+#define _sys_stat 1 /* #include <sys/stat.h> ok */
#define _sys_time 1 /* #include <sys/time.h> ok */
#define _lib_clock_gettime 1 /* execute{\ passed */
#define tmgettimeofday(p) gettimeofday(p,(struct timezone*)0)
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/types b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/types
deleted file mode 100644
index 343b5954a0..0000000000
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/types
+++ /dev/null
@@ -1,5 +0,0 @@
-/* : : generated by iffe version 2007-04-04 : : */
-#ifndef _def_types_ast
-#define _def_types_ast 1
-#define _sys_types 1 /* #include <sys/types.h> ok */
-#endif
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/uwin b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/uwin
index a315020330..e69ca63ac6 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/uwin
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/uwin
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/uwin by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/uwin by iffe version 2008-01-31 : : */
#ifndef _def_uwin_ast
#define _def_uwin_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/vfork b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/vfork
index 975726cf26..e5adaaa12b 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/vfork
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/vfork
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/vfork by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/vfork by iffe version 2008-01-31 : : */
#ifndef _def_vfork_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/vmalloc b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/vmalloc
index 033a1d2315..809dd009a8 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/vmalloc
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/vmalloc
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/vmalloc by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/vmalloc by iffe version 2008-01-31 : : */
#ifndef _def_vmalloc_ast
#define _def_vmalloc_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/wait b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/wait
index 69a5c225da..9371585de4 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/wait
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/wait
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/wait by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/wait by iffe version 2008-01-31 : : */
#ifndef _def_wait_ast
#define _def_wait_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/wchar b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/wchar
index c667a53fa1..a5f734dd1a 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/wchar
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/FEATURE/wchar
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/wchar by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/wchar by iffe version 2008-01-31 : : */
#ifndef _def_wchar_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/align.h b/usr/src/lib/libast/sparcv9/src/lib/libast/align.h
index 67bdb68aae..47a9dd4cd7 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/align.h
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/align.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/align.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/align.c by iffe version 2008-01-31 : : */
#ifndef _def_align_ast
#define _def_align_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_botch.h b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_botch.h
index bd5405c63c..826811b6de 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_botch.h
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_botch.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/botch.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/botch.c by iffe version 2008-01-31 : : */
#ifndef _def_botch_ast
#define _def_botch_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_ccode.h b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_ccode.h
index 7055bf926b..af262d71e8 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_ccode.h
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_ccode.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/ccode by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/ccode by iffe version 2008-01-31 : : */
#ifndef _def_ccode_ast
#define _def_ccode_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_common.h b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_common.h
index 23fce187e2..6485009f1e 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_common.h
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_common.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/common by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/common by iffe version 2008-01-31 : : */
#ifndef _AST_COMMON_H
#define _AST_COMMON_H 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_dirent.h b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_dirent.h
index 5c447ac078..0fced82d9e 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_dirent.h
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_dirent.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/dirent by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/dirent by iffe version 2008-01-31 : : */
#ifndef _def_dirent_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_fcntl.h b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_fcntl.h
index 156e2ec213..cbc1b8ade8 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_fcntl.h
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_fcntl.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/fcntl.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/fcntl.c by iffe version 2008-01-31 : : */
#ifndef _def_fcntl_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_float.h b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_float.h
index de179a370c..282df4d035 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_float.h
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_float.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/float by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/float by iffe version 2008-01-31 : : */
#ifndef _def_float_ast
#if !defined(__PROTO__)
@@ -68,13 +68,16 @@
#define _hdr_math 1 /* #include <math.h> ok */
#define _hdr_values 1 /* #include <values.h> ok */
#define _LIB_m 1 /* -lm is a library */
+#define _lib_fpclassify 1 /* fpclassify() in default lib(s) */
#define _lib_frexp 1 /* frexp() in default lib(s) */
#define _lib_frexpl 1 /* frexpl() in default lib(s) */
#define _lib_ldexp 1 /* ldexp() in default lib(s) */
#define _lib_ldexpl 1 /* ldexpl() in default lib(s) */
#define _lib_finite 1 /* finite() in default lib(s) */
+#define _lib_isinf 1 /* isinf() in default lib(s) */
#define _lib_isnan 1 /* isnan() in default lib(s) */
#define _lib_isnanl 1 /* isnanl() in default lib(s) */
+#define _lib_signbit 1 /* signbit() in default lib(s) */
#define _lib_copysign 1 /* copysign() in default lib(s) */
#define _lib_copysignl 1 /* copysignl() in default lib(s) */
#include <ast_common.h>
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_fs.h b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_fs.h
index d3e524a3d0..7548ff404e 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_fs.h
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_fs.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/fs by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/fs by iffe version 2008-01-31 : : */
#ifndef _def_fs_ast
#if !defined(__PROTO__)
@@ -68,20 +68,9 @@
#define _lib_mknod 1 /* mknod() in default lib(s) */
#define _lib_sync 1 /* sync() in default lib(s) */
#include <sys/stat.h>
+#include <sys/mkdev.h>
#define FS_default "ufs"
#if defined(__STDPP__directive) && defined(__STDPP__initial)
-__STDPP__directive pragma pp:initial
-#endif
-#ifndef major
-#define major(x) ( major_t ) ( ( ( ( unsigned ) ( ( x ) ) ) >> 8 ) & 0x7f )
-#endif
-#ifndef minor
-#define minor(x) ( minor_t ) ( ( ( x ) ) & 0xff )
-#endif
-#ifndef makedev
-#define makedev(x,y) ( unsigned short ) ( ( ( ( x ) ) << 8 ) | ( ( ( y ) ) & 0xff ) )
-#endif
-#if defined(__STDPP__directive) && defined(__STDPP__initial)
__STDPP__directive pragma pp:noinitial
#endif
#define _hdr_stdio 1 /* #include <stdio.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_iconv.h b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_iconv.h
index 2409c25672..c6c5d452bf 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_iconv.h
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_iconv.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/iconv by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/iconv by iffe version 2008-01-31 : : */
#ifndef _def_iconv_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_lib.h b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_lib.h
index c546bc76ef..ff4a6baa81 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_lib.h
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_lib.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/lib by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/lib by iffe version 2008-01-31 : : */
#ifndef _def_lib_ast
#define _def_lib_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_limits.h b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_limits.h
index d4f848a557..0e62d36fb7 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_limits.h
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_limits.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/limits.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/limits.c by iffe version 2008-01-31 : : */
#ifndef _def_limits_ast
#define _def_limits_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_map.h b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_map.h
index 6103ce9791..98bb09fcef 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_map.h
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_map.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/map.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/map.c by iffe version 2008-01-31 : : */
#ifndef _def_map_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
@@ -121,6 +121,14 @@ extern __MANGLE__ char* getcwd __PROTO__((char*, size_t));
#define getopt_long _ast_getopt_long
#undef getopt_long_only
#define getopt_long_only _ast_getopt_long_only
+#undef optopt
+#define optopt _ast_optopt
+#undef optarg
+#define optarg _ast_optarg
+#undef optind
+#define optind _ast_optind
+#undef opterr
+#define opterr _ast_opterr
#undef getwd
#define getwd _ast_getwd
extern __MANGLE__ char* getwd __PROTO__((char*));
@@ -146,6 +154,8 @@ extern __MANGLE__ char* mktemp __PROTO__((char*));
#define mktime _ast_mktime
#undef nftw
#define nftw _ast_nftw
+#undef optctx
+#define optctx _ast_optctx
#undef optesc
#define optesc _ast_optesc
#undef optget
@@ -274,7 +284,7 @@ extern __MANGLE__ char* realpath __PROTO__((const char*, char*));
extern __MANGLE__ int remove __PROTO__((const char*));
#undef resolvepath
#define resolvepath _ast_resolvepath
-extern __MANGLE__ char* resolvepath __PROTO__((const char*, char*, size_t));
+extern __MANGLE__ int resolvepath __PROTO__((const char*, char*, size_t));
#undef setenv
#define setenv _ast_setenv
extern __MANGLE__ int setenv __PROTO__((const char*, const char*, int));
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_mmap.h b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_mmap.h
index 47b8dc23b2..310a5aed05 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_mmap.h
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_mmap.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/mmap by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/mmap by iffe version 2008-01-31 : : */
#ifndef _def_mmap_ast
#define _def_mmap_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_mode.h b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_mode.h
index 58c29a7ff5..6d4729935b 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_mode.h
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_mode.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/mode.c by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/mode.c by iffe version 2008-01-31 : : */
#ifndef _def_mode_ast
#define _def_mode_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_ndbm.h b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_ndbm.h
new file mode 100644
index 0000000000..42bec1ff86
--- /dev/null
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_ndbm.h
@@ -0,0 +1,9 @@
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/ndbm by iffe version 2008-01-31 : : */
+#ifndef _def_ndbm_ast
+#define _def_ndbm_ast 1
+#define _sys_types 1 /* #include <sys/types.h> ok */
+#define _hdr_ndbm 1 /* #include <ndbm.h> ok */
+#include <ndbm.h>
+#define _use_ndbm 1
+
+#endif
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_nl_types.h b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_nl_types.h
index 08f46d7dee..7babd03ed3 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_nl_types.h
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_nl_types.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/nl_types by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/nl_types by iffe version 2008-01-31 : : */
#ifndef _def_nl_types_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_param.h b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_param.h
index 4a9644522d..12a9a5c76c 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_param.h
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_param.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/param.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/param.sh by iffe version 2008-01-31 : : */
#ifndef _def_param_ast
#define _def_param_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_standards.h b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_standards.h
index f625ff6f49..79a23337bf 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_standards.h
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_standards.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/standards by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/standards by iffe version 2008-01-31 : : */
#ifndef _def_standards_ast
#define _def_standards_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_stdio.h b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_stdio.h
index 0a1824b6fa..bb1b0953c4 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_stdio.h
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_stdio.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/stdio by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/stdio by iffe version 2008-01-31 : : */
#ifndef _SFSTDIO_H
#if !defined(__PROTO__)
@@ -178,7 +178,7 @@ extern __MANGLE__ int fprintf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fpurge __PROTO__((FILE*));
extern __MANGLE__ int fputc __PROTO__((int, FILE*));
extern __MANGLE__ int fputs __PROTO__((const char*, FILE*));
-extern __MANGLE__ ssize_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
extern __MANGLE__ FILE* freopen __PROTO__((const char*, const char*, FILE*));
extern __MANGLE__ int fscanf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fseek __PROTO__((FILE*, long, int));
@@ -186,7 +186,7 @@ extern __MANGLE__ int fseeko __PROTO__((FILE*, off_t, int));
extern __MANGLE__ int fsetpos __PROTO__((FILE*, const fpos_t*));
extern __MANGLE__ long ftell __PROTO__((FILE*));
extern __MANGLE__ off_t ftello __PROTO__((FILE*));
-extern __MANGLE__ ssize_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
extern __MANGLE__ int getc __PROTO__((FILE*));
extern __MANGLE__ int getchar __PROTO__((void));
extern __MANGLE__ char* gets __PROTO__((char*));
@@ -245,6 +245,10 @@ extern __MANGLE__ int getchar_unlocked __PROTO__((void));
extern __MANGLE__ int putc_unlocked __PROTO__((int, FILE*));
extern __MANGLE__ int putchar_unlocked __PROTO__((int));
+extern __MANGLE__ void flockfile __PROTO__((FILE*));
+extern __MANGLE__ int ftrylockfile __PROTO__((FILE*));
+extern __MANGLE__ void funlockfile __PROTO__((FILE*));
+
#ifdef _USE_GNU
extern __MANGLE__ int fcloseall __PROTO__((void));
@@ -324,6 +328,7 @@ extern __MANGLE__ ssize_t getline __PROTO__((char**, size_t*, FILE*));
#define vsprintf _ast_vsprintf
#define vsscanf _ast_vsscanf
#define fcloseall _ast_fcloseall
+#define _filbuf _ast__filbuf
#define fmemopen _ast_fmemopen
#define __getdelim _ast___getdelim
#define getdelim _ast_getdelim
@@ -343,6 +348,9 @@ extern __MANGLE__ ssize_t getline __PROTO__((char**, size_t*, FILE*));
#define getchar_unlocked _ast_getchar_unlocked
#define putc_unlocked _ast_putc_unlocked
#define putchar_unlocked _ast_putchar_unlocked
+#define flockfile _ast_flockfile
+#define ftrylockfile _ast_ftrylockfile
+#define funlockfile _ast_funlockfile
#if defined(__STDPP__directive) && defined(__STDPP__initial)
__STDPP__directive pragma pp:initial
@@ -402,7 +410,7 @@ extern __MANGLE__ int fprintf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fpurge __PROTO__((FILE*));
extern __MANGLE__ int fputc __PROTO__((int, FILE*));
extern __MANGLE__ int fputs __PROTO__((const char*, FILE*));
-extern __MANGLE__ ssize_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fread __PROTO__((__V_*, size_t, size_t, FILE*));
extern __MANGLE__ FILE* freopen __PROTO__((const char*, const char*, FILE*));
extern __MANGLE__ int fscanf __PROTO__((FILE*, const char*, ...));
extern __MANGLE__ int fseek __PROTO__((FILE*, long, int));
@@ -410,7 +418,7 @@ extern __MANGLE__ int fseeko __PROTO__((FILE*, off_t, int));
extern __MANGLE__ int fsetpos __PROTO__((FILE*, const fpos_t*));
extern __MANGLE__ long ftell __PROTO__((FILE*));
extern __MANGLE__ off_t ftello __PROTO__((FILE*));
-extern __MANGLE__ ssize_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
+extern __MANGLE__ size_t fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
extern __MANGLE__ int getc __PROTO__((FILE*));
extern __MANGLE__ int getchar __PROTO__((void));
extern __MANGLE__ char* gets __PROTO__((char*));
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_sys.h b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_sys.h
index 8b3d838a49..40bdd3f74d 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_sys.h
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_sys.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/sys by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/sys by iffe version 2008-01-31 : : */
#ifndef _AST_SYS_H
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_time.h b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_time.h
index 89db712e51..701c9d785f 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_time.h
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_time.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/time by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/time by iffe version 2008-01-31 : : */
#ifndef _def_time_ast
#if !defined(__PROTO__)
@@ -76,7 +76,7 @@
#include <sys/times.h>
-#ifndef CLOCKS_PER_SEC
+#if !defined(CLOCKS_PER_SEC) && defined(CLK_TCK)
#define CLOCKS_PER_SEC CLK_TCK
#endif
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_tty.h b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_tty.h
index fee4db4ea4..4e0a72ed3f 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_tty.h
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_tty.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/tty by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/tty by iffe version 2008-01-31 : : */
#ifndef _def_tty_ast
#define _def_tty_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_types.h b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_types.h
deleted file mode 100644
index 343b5954a0..0000000000
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_types.h
+++ /dev/null
@@ -1,5 +0,0 @@
-/* : : generated by iffe version 2007-04-04 : : */
-#ifndef _def_types_ast
-#define _def_types_ast 1
-#define _sys_types 1 /* #include <sys/types.h> ok */
-#endif
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_vfork.h b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_vfork.h
index 975726cf26..e5adaaa12b 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_vfork.h
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_vfork.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/vfork by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/vfork by iffe version 2008-01-31 : : */
#ifndef _def_vfork_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_wait.h b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_wait.h
index 69a5c225da..9371585de4 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_wait.h
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_wait.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/wait by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/wait by iffe version 2008-01-31 : : */
#ifndef _def_wait_ast
#define _def_wait_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_wchar.h b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_wchar.h
index c667a53fa1..a5f734dd1a 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/ast_wchar.h
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/ast_wchar.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/wchar by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/wchar by iffe version 2008-01-31 : : */
#ifndef _def_wchar_ast
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/conftab.c b/usr/src/lib/libast/sparcv9/src/lib/libast/conftab.c
index ad51298b85..a9a530c64b 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/conftab.c
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/conftab.c
@@ -1,63 +1,3 @@
-
-/* : : generated by proto : : */
-
-#if !defined(__PROTO__)
-# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
-# if defined(__cplusplus)
-# define __LINKAGE__ "C"
-# else
-# define __LINKAGE__
-# endif
-# define __STDARG__
-# define __PROTO__(x) x
-# define __OTORP__(x)
-# define __PARAM__(n,o) n
-# if !defined(__STDC__) && !defined(__cplusplus)
-# if !defined(c_plusplus)
-# define const
-# endif
-# define signed
-# define void int
-# define volatile
-# define __V_ char
-# else
-# define __V_ void
-# endif
-# else
-# define __PROTO__(x) ()
-# define __OTORP__(x) x
-# define __PARAM__(n,o) o
-# define __LINKAGE__
-# define __V_ char
-# define const
-# define signed
-# define void int
-# define volatile
-# endif
-# define __MANGLE__ __LINKAGE__
-# if defined(__cplusplus) || defined(c_plusplus)
-# define __VARARG__ ...
-# else
-# define __VARARG__
-# endif
-# if defined(__STDARG__)
-# define __VA_START__(p,a) va_start(p,a)
-# else
-# define __VA_START__(p,a) va_start(p)
-# endif
-# if !defined(__INLINE__)
-# if defined(__cplusplus)
-# define __INLINE__ extern __MANGLE__ inline
-# else
-# if defined(_WIN32) && !defined(__GNUC__)
-# define __INLINE__ __inline
-# endif
-# endif
-# endif
-#endif
-#if !defined(__LINKAGE__)
-#define __LINKAGE__ /* 2004-08-11 transition */
-#endif
#include "FEATURE/standards"
#include "FEATURE/common"
#include <sys/types.h>
@@ -70,7 +10,7 @@
#include "FEATURE/param"
#include "conftab.h"
-/* : : generated by conf from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/comp/conf.tab : : */
+/* : : generated by conf from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/comp/conf.tab : : */
/*
* prefix strings -- the first few are indexed by Conf_t.standard
@@ -105,111 +45,111 @@ int prefix_elements = (int)sizeof(prefix) / (int)sizeof(prefix[0]);
const Conf_t conf[] =
{
-{ "ABI_AIO_XFER_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "ABI_ASYNCHRONOUS_IO", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "ABI_ASYNC_IO", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "ADVISORY_INFO", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_ADVISORY_INFO },
-{ "AIO_LISTIO_MAX", { 0, 0 }, { _POSIX_AIO_LISTIO_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_AIO_LISTIO_MAX },
-{ "AIO_MAX", { 0, 0 }, { _POSIX_AIO_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_AIO_MAX },
-{ "AIO_PRIO_DELTA_MAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, _SC_AIO_PRIO_DELTA_MAX },
-{ "ALLOC_SIZE_MIN", { 0, 0 }, { 0, 0 }, CONF_LIMIT|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_ALLOC_SIZE_MIN },
-{ "ARCHITECTURE", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "ARG_MAX", { 0, 0 }, { _POSIX_ARG_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_ARG_MAX },
-{ "ASYNCHRONOUS_IO", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_ASYNCHRONOUS_IO },
-{ "ASYNC_IO", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_ASYNC_IO },
-{ "ATEXIT_MAX", { 0, 0 }, { 32, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_XOPEN, 1, CONF_sysconf, _SC_ATEXIT_MAX },
-{ "AUDIT", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "AVAIL_PROCESSORS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "AVPHYS_PAGES", { 0, 0 }, { 0, 0 }, 0, CONF_SUN, 1, CONF_sysconf, _SC_AVPHYS_PAGES },
-{ "BARRIERS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_BARRIERS },
-{ "BC_BASE_MAX", { 0, 0 }, { _POSIX2_BC_BASE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_BC_BASE_MAX },
-{ "BC_DIM_MAX", { 0, 0 }, { _POSIX2_BC_DIM_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_BC_DIM_MAX },
-{ "BC_SCALE_MAX", { 0, 0 }, { _POSIX2_BC_SCALE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_BC_SCALE_MAX },
-{ "BC_STRING_MAX", { 0, 0 }, { _POSIX2_BC_STRING_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_BC_STRING_MAX },
-{ "BUSTYPES", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "CHARCLASS_NAME_MAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "CHAR_BIT", { 8, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "CHAR_MAX", { 127, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "CHAR_MIN", { -128, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "CHAR_TERM", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_CHAR_TERM },
-{ "CHILD_MAX", { 0, 0 }, { _POSIX_CHILD_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_CHILD_MAX },
-{ "CHOWN_RESTRICTED", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_CHOWN_RESTRICTED },
-{ "CKPT", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "CLK_TCK", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_POSIX, 1, CONF_sysconf, _SC_CLK_TCK },
-{ "CLOCKRES_MIN", { 0, 0 }, { _POSIX_CLOCKRES_MIN, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_PREFIX_ONLY|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "CLOCKS_PER_SEC", { 1000000, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_LIMIT|CONF_LIMIT_DEF, CONF_POSIX, 1, CONF_nop, -1 },
-{ "CLOCK_SELECTION", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_CLOCK_SELECTION },
-{ "COLL_WEIGHTS_MAX", { 0, 0 }, { _POSIX2_COLL_WEIGHTS_MAX, 0 }, CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_COLL_WEIGHTS_MAX },
-{ "CPUTIME", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_CPUTIME },
-{ "CPU_KEYBITS1", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "CPU_VERSION", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "CRYPT", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_CRYPT },
-{ "C_BIND", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 2, CONF_sysconf, _SC_2_C_BIND },
-{ "C_DEV", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 2, CONF_sysconf, _SC_2_C_DEV },
-{ "C_VERSION", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 2, CONF_sysconf, _SC_2_C_VERSION },
-{ "DATAKEYS_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "DELAYTIMER_MAX", { 0, 0 }, { _POSIX_DELAYTIMER_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_DELAYTIMER_MAX },
-{ "ENH_I18N", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_ENH_I18N },
-{ "EQUIV_CLASS_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "EXEC_INTERPRETER_LENGTH", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "EXPR_NEST_MAX", { 0, 0 }, { _POSIX2_EXPR_NEST_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_EXPR_NEST_MAX },
-{ "FCHR_MAX", { 0, 0 }, { LONG_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
-{ "FILESIZEBITS", { 0, 0 }, { 0, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_FILESIZEBITS },
-{ "FILE_LOCKING", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "FORT_DEV", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_FORT_DEV },
-{ "FORT_RUN", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_FORT_RUN },
-{ "FSYNC", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_FSYNC },
-{ "GETGR_R_SIZE_MAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_sysconf, _SC_GETGR_R_SIZE_MAX },
-{ "GETPW_R_SIZE_MAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_sysconf, _SC_GETPW_R_SIZE_MAX },
-{ "HOSTID", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "HOSTNAME", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "HOST_NAME_MAX", { 0, 0 }, { _POSIX_HOST_NAME_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_HOST_NAME_MAX },
-{ "HW_PROVIDER", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "HW_SERIAL", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "ILP32_OFF32", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XBS5, 1, CONF_sysconf, -1 },
+{ "ABI_AIO_XFER_MAX", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "ABI_ASYNCHRONOUS_IO", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "ABI_ASYNC_IO", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "ADVISORY_INFO", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_ADVISORY_INFO },
+{ "AIO_LISTIO_MAX", { 0UL, 0 }, { _POSIX_AIO_LISTIO_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_AIO_LISTIO_MAX },
+{ "AIO_MAX", { 0UL, 0 }, { _POSIX_AIO_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_AIO_MAX },
+{ "AIO_PRIO_DELTA_MAX", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, _SC_AIO_PRIO_DELTA_MAX },
+{ "ALLOC_SIZE_MIN", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_ALLOC_SIZE_MIN },
+{ "ARCHITECTURE", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, SI_ARCHITECTURE },
+{ "ARG_MAX", { 0UL, 0 }, { _POSIX_ARG_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_ARG_MAX },
+{ "ASYNCHRONOUS_IO", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_ASYNCHRONOUS_IO },
+{ "ASYNC_IO", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_ASYNC_IO },
+{ "ATEXIT_MAX", { 0UL, 0 }, { 32UL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_XOPEN, 1, CONF_sysconf, _SC_ATEXIT_MAX },
+{ "AUDIT", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "AVAIL_PROCESSORS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "AVPHYS_PAGES", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SUN, 1, CONF_sysconf, _SC_AVPHYS_PAGES },
+{ "BARRIERS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_BARRIERS },
+{ "BC_BASE_MAX", { 0UL, 0 }, { _POSIX2_BC_BASE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_BC_BASE_MAX },
+{ "BC_DIM_MAX", { 0UL, 0 }, { _POSIX2_BC_DIM_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_BC_DIM_MAX },
+{ "BC_SCALE_MAX", { 0UL, 0 }, { _POSIX2_BC_SCALE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_BC_SCALE_MAX },
+{ "BC_STRING_MAX", { 0UL, 0 }, { _POSIX2_BC_STRING_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_BC_STRING_MAX },
+{ "BUSTYPES", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
+{ "CHARCLASS_NAME_MAX", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "CHAR_BIT", { 8UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "CHAR_MAX", { 127UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "CHAR_MIN", { -127L-1L, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "CHAR_TERM", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_CHAR_TERM },
+{ "CHILD_MAX", { 0UL, 0 }, { _POSIX_CHILD_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_CHILD_MAX },
+{ "CHOWN_RESTRICTED", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_CHOWN_RESTRICTED },
+{ "CKPT", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "CLK_TCK", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_POSIX, 1, CONF_sysconf, _SC_CLK_TCK },
+{ "CLOCKRES_MIN", { 0UL, 0 }, { _POSIX_CLOCKRES_MIN, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_PREFIX_ONLY|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "CLOCKS_PER_SEC", { 1000000UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_LIMIT|CONF_LIMIT_DEF, CONF_POSIX, 1, CONF_nop, -1 },
+{ "CLOCK_SELECTION", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_CLOCK_SELECTION },
+{ "COLL_WEIGHTS_MAX", { 0UL, 0 }, { _POSIX2_COLL_WEIGHTS_MAX, 0 }, CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_COLL_WEIGHTS_MAX },
+{ "CPUTIME", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_CPUTIME },
+{ "CPU_KEYBITS1", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "CPU_VERSION", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "CRYPT", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_CRYPT },
+{ "C_BIND", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 2, CONF_sysconf, _SC_2_C_BIND },
+{ "C_DEV", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 2, CONF_sysconf, _SC_2_C_DEV },
+{ "C_VERSION", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 2, CONF_sysconf, _SC_2_C_VERSION },
+{ "DATAKEYS_MAX", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "DELAYTIMER_MAX", { 0UL, 0 }, { _POSIX_DELAYTIMER_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_DELAYTIMER_MAX },
+{ "ENH_I18N", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_ENH_I18N },
+{ "EQUIV_CLASS_MAX", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "EXEC_INTERPRETER_LENGTH", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "EXPR_NEST_MAX", { 0UL, 0 }, { _POSIX2_EXPR_NEST_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_EXPR_NEST_MAX },
+{ "FCHR_MAX", { 0UL, 0 }, { LONG_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
+{ "FILESIZEBITS", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_FILESIZEBITS },
+{ "FILE_LOCKING", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "FORT_DEV", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_FORT_DEV },
+{ "FORT_RUN", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_FORT_RUN },
+{ "FSYNC", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_FSYNC },
+{ "GETGR_R_SIZE_MAX", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_C, 1, CONF_sysconf, _SC_GETGR_R_SIZE_MAX },
+{ "GETPW_R_SIZE_MAX", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_C, 1, CONF_sysconf, _SC_GETPW_R_SIZE_MAX },
+{ "HOSTID", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "HOSTNAME", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, SI_HOSTNAME },
+{ "HOST_NAME_MAX", { 0UL, 0 }, { _POSIX_HOST_NAME_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_HOST_NAME_MAX },
+{ "HW_PROVIDER", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, SI_HW_PROVIDER },
+{ "HW_SERIAL", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "ILP32_OFF32", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XBS5, 1, CONF_sysconf, -1 },
{ "ILP32_OFF32_CFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "ILP32_OFF32_LDFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "ILP32_OFF32_LIBS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "ILP32_OFF32_LINTFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
-{ "ILP32_OFFBIG", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XBS5, 1, CONF_sysconf, -1 },
+{ "ILP32_OFFBIG", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XBS5, 1, CONF_sysconf, -1 },
{ "ILP32_OFFBIG_CFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "ILP32_OFFBIG_LDFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "ILP32_OFFBIG_LIBS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "ILP32_OFFBIG_LINTFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
-{ "INITTAB_NAME", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "INT_MAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
-{ "INT_MIN", { -2147483648, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "IOV_MAX", { 0, 0 }, { _XOPEN_IOV_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_XOPEN, 1, CONF_sysconf, _SC_IOV_MAX },
-{ "IO_TYPE", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "IPV6", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_IPV6 },
-{ "IP_SECOPTS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "JOB_CONTROL", { 0, 0 }, { 1, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_JOB_CONTROL },
-{ "KERNEL_CLIST", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_CLIST_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_DISK", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_DISK_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_DMABUF", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_DMABUF_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_FILE", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_FILE_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_FLCKREC", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_FLCKREC_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_INODE", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_INODE_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_MOUNT", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_MOUNT_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_PINODE", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_PINODE_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_PROC", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_PROC_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_REGION", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_REGION_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_S5INODE", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_S5INODE_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
-{ "KERNEL_STAMP", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "KERN_POINTERS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "KERN_SIM", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "LEGACY", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, -1 },
+{ "INITTAB_NAME", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
+{ "INT_MAX", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
+{ "INT_MIN", { -2147483647L-1L, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "IOV_MAX", { 0UL, 0 }, { _XOPEN_IOV_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_XOPEN, 1, CONF_sysconf, _SC_IOV_MAX },
+{ "IO_TYPE", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "IPV6", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_IPV6 },
+{ "IP_SECOPTS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "JOB_CONTROL", { 0UL, 0 }, { 1UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_JOB_CONTROL },
+{ "KERNEL_CLIST", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_CLIST_MAX", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_DISK", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_DISK_MAX", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_DMABUF", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_DMABUF_MAX", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_FILE", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_FILE_MAX", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_FLCKREC", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_FLCKREC_MAX", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_INODE", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_INODE_MAX", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_MOUNT", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_MOUNT_MAX", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_PINODE", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_PINODE_MAX", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_PROC", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_PROC_MAX", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_REGION", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_REGION_MAX", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_S5INODE", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_S5INODE_MAX", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SCO, 1, CONF_sysconf, -1 },
+{ "KERNEL_STAMP", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
+{ "KERN_POINTERS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "KERN_SIM", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "LEGACY", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, -1 },
{ "LFS64_CFLAGS", { 0, 0 }, { 0, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING, CONF_POSIX, 1, CONF_confstr, _CS_LFS64_CFLAGS },
{ "LFS64_LDFLAGS", { 0, 0 }, { 0, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING, CONF_POSIX, 1, CONF_confstr, _CS_LFS64_LDFLAGS },
{ "LFS64_LIBS", { 0, 0 }, { 0, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING, CONF_POSIX, 1, CONF_confstr, _CS_LFS64_LIBS },
@@ -218,234 +158,234 @@ const Conf_t conf[] =
{ "LFS_LDFLAGS", { 0, 0 }, { 0, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING, CONF_POSIX, 1, CONF_confstr, _CS_LFS_LDFLAGS },
{ "LFS_LIBS", { 0, 0 }, { 0, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING, CONF_POSIX, 1, CONF_confstr, _CS_LFS_LIBS },
{ "LFS_LINTFLAGS", { 0, 0 }, { 0, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING, CONF_POSIX, 1, CONF_confstr, _CS_LFS_LINTFLAGS },
-{ "LINE_MAX", { 0, 0 }, { _POSIX2_LINE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_LINE_MAX },
-{ "LINK_MAX", { 0, 0 }, { _POSIX_LINK_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_LINK_MAX },
-{ "LLONG_MAX", { 9223372036854775807LL, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "LLONG_MIN", { (-9223372036854775807LL-1LL), 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "LOCALEDEF", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_LOCALEDEF },
-{ "LOGIN_NAME_MAX", { 0, 0 }, { _POSIX_LOGIN_NAME_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_LOGIN_NAME_MAX },
-{ "LOGNAME_MAX", { 0, 0 }, { 8, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, _SC_LOGNAME_MAX },
-{ "LONG_BIT", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "LONG_MAX", { 2147483647, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "LONG_MIN", { -2147483648, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "LP64_OFF64", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XBS5, 1, CONF_sysconf, -1 },
+{ "LINE_MAX", { 0UL, 0 }, { _POSIX2_LINE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_LINE_MAX },
+{ "LINK_MAX", { 0UL, 0 }, { _POSIX_LINK_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_LINK_MAX },
+{ "LLONG_MAX", { 9223372036854775807UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "LLONG_MIN", { -9223372036854775807L-1L, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "LOCALEDEF", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_LOCALEDEF },
+{ "LOGIN_NAME_MAX", { 0UL, 0 }, { _POSIX_LOGIN_NAME_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_LOGIN_NAME_MAX },
+{ "LOGNAME_MAX", { 0UL, 0 }, { 8UL, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, _SC_LOGNAME_MAX },
+{ "LONG_BIT", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "LONG_MAX", { 2147483647UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "LONG_MIN", { -2147483647L-1L, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "LP64_OFF64", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XBS5, 1, CONF_sysconf, -1 },
{ "LP64_OFF64_CFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "LP64_OFF64_LDFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "LP64_OFF64_LIBS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "LP64_OFF64_LINTFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
-{ "LPBIG_OFFBIG", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XBS5, 1, CONF_sysconf, -1 },
+{ "LPBIG_OFFBIG", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XBS5, 1, CONF_sysconf, -1 },
{ "LPBIG_OFFBIG_CFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "LPBIG_OFFBIG_LDFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "LPBIG_OFFBIG_LIBS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
{ "LPBIG_OFFBIG_LINTFLAGS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_STRING, CONF_XBS5, 1, CONF_confstr, -1 },
-{ "MACHINE", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "MAPPED_FILES", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MAPPED_FILES },
-{ "MAX_CANON", { 0, 0 }, { _POSIX_MAX_CANON, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_MAX_CANON },
-{ "MAX_INPUT", { 0, 0 }, { _POSIX_MAX_INPUT, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_MAX_INPUT },
-{ "MB_LEN_MAX", { 5, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "MCAS_OFFSET", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "MEMLOCK", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MEMLOCK },
-{ "MEMLOCK_RANGE", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MEMLOCK_RANGE },
-{ "MEMORY_PROTECTION", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MEMORY_PROTECTION },
-{ "MESSAGE_PASSING", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MESSAGE_PASSING },
-{ "MMAP_FIXED_ALIGNMENT", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "MONOTONIC_CLOCK", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MONOTONIC_CLOCK },
-{ "MQ_OPEN_MAX", { 0, 0 }, { _POSIX_MQ_OPEN_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_MQ_OPEN_MAX },
-{ "MQ_PRIO_MAX", { 0, 0 }, { _POSIX_MQ_PRIO_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_MQ_PRIO_MAX },
-{ "MSEM_LOCKID", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "MULTI_PROCESS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "NACLS_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SVID, 1, CONF_sysconf, -1 },
-{ "NAME_MAX", { 0, 0 }, { _POSIX_NAME_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_NAME_MAX },
-{ "NGROUPS_MAX", { 0, 0 }, { _POSIX_NGROUPS_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_NGROUPS_MAX },
-{ "NL_ARGMAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "NL_LANGMAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "NL_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "NL_MSGMAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "NL_NMAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "NL_SETMAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "NL_SPECMAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "NL_TEXTMAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "NO_TRUNC", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_NO_TRUNC },
-{ "NPROCESSORS_CONF", { 0, 0 }, { 0, 0 }, 0, CONF_SVID, 1, CONF_sysconf, _SC_NPROCESSORS_CONF },
-{ "NPROCESSORS_ONLN", { 0, 0 }, { 0, 0 }, 0, CONF_SVID, 1, CONF_sysconf, _SC_NPROCESSORS_ONLN },
-{ "NPROC_CONF", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "NPROC_ONLN", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "NSS_BUFLEN_GROUP", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "NSS_BUFLEN_PASSWD", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "NUM_PROCESSORS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "NZERO", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "OPEN_MAX", { 0, 0 }, { _POSIX_OPEN_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_OPEN_MAX },
-{ "OPEN_MAX_CEIL", { OPEN_MAX, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_AST, 1, CONF_nop, -1 },
-{ "OSREL_MAJ", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "OSREL_MIN", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "OSREL_PATCH", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "OS_BASE", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "OS_PROVIDER", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "OS_VERSION", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE, CONF_AES, 1, CONF_sysconf, -1 },
-{ "PAGESIZE", { 0, 0 }, { 4096, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_PAGESIZE },
-{ "PAGE_SIZE", { 0, 0 }, { 0, 0 }, CONF_MINMAX|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, _SC_PAGE_SIZE },
-{ "PASS_MAX", { 0, 0 }, { 8, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, _SC_PASS_MAX },
+{ "MACHINE", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, SI_MACHINE },
+{ "MAPPED_FILES", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MAPPED_FILES },
+{ "MAX_CANON", { 0UL, 0 }, { _POSIX_MAX_CANON, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_MAX_CANON },
+{ "MAX_INPUT", { 0UL, 0 }, { _POSIX_MAX_INPUT, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_MAX_INPUT },
+{ "MB_LEN_MAX", { 5UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "MCAS_OFFSET", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "MEMLOCK", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MEMLOCK },
+{ "MEMLOCK_RANGE", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MEMLOCK_RANGE },
+{ "MEMORY_PROTECTION", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MEMORY_PROTECTION },
+{ "MESSAGE_PASSING", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MESSAGE_PASSING },
+{ "MMAP_FIXED_ALIGNMENT", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "MONOTONIC_CLOCK", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_MONOTONIC_CLOCK },
+{ "MQ_OPEN_MAX", { 0UL, 0 }, { _POSIX_MQ_OPEN_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_MQ_OPEN_MAX },
+{ "MQ_PRIO_MAX", { 0UL, 0 }, { _POSIX_MQ_PRIO_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_MQ_PRIO_MAX },
+{ "MSEM_LOCKID", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "MULTI_PROCESS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "NACLS_MAX", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SVID, 1, CONF_sysconf, -1 },
+{ "NAME_MAX", { 0UL, 0 }, { _POSIX_NAME_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_NAME_MAX },
+{ "NGROUPS_MAX", { 0UL, 0 }, { _POSIX_NGROUPS_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_NGROUPS_MAX },
+{ "NL_ARGMAX", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "NL_LANGMAX", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "NL_MAX", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "NL_MSGMAX", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "NL_NMAX", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "NL_SETMAX", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "NL_SPECMAX", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "NL_TEXTMAX", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "NO_TRUNC", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_NO_TRUNC },
+{ "NPROCESSORS_CONF", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SVID, 1, CONF_sysconf, _SC_NPROCESSORS_CONF },
+{ "NPROCESSORS_ONLN", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SVID, 1, CONF_sysconf, _SC_NPROCESSORS_ONLN },
+{ "NPROC_CONF", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "NPROC_ONLN", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "NSS_BUFLEN_GROUP", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "NSS_BUFLEN_PASSWD", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "NUM_PROCESSORS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "NZERO", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "OPEN_MAX", { 0UL, 0 }, { _POSIX_OPEN_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_OPEN_MAX },
+{ "OPEN_MAX_CEIL", { OPEN_MAX, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_AST, 1, CONF_nop, -1 },
+{ "OSREL_MAJ", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "OSREL_MIN", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "OSREL_PATCH", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "OS_BASE", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
+{ "OS_PROVIDER", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
+{ "OS_VERSION", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE, CONF_AES, 1, CONF_sysconf, -1 },
+{ "PAGESIZE", { 0UL, 0 }, { 4096UL, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_PAGESIZE },
+{ "PAGE_SIZE", { 0UL, 0 }, { 0UL, 0 }, CONF_MINMAX|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, _SC_PAGE_SIZE },
+{ "PASS_MAX", { 0UL, 0 }, { 8UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, _SC_PASS_MAX },
{ "PATH", { 0, 0 }, { 0, "/bin:/usr/bin" }, CONF_DEFER_CALL|CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_confstr, _CS_PATH },
-{ "PATH_MAX", { 0, 0 }, { _POSIX_PATH_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_PATH_MAX },
-{ "PBS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS },
-{ "PBS_ACCOUNTING", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_ACCOUNTING },
-{ "PBS_CHECKPOINT", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_CHECKPOINT },
-{ "PBS_LOCATE", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_LOCATE },
-{ "PBS_MESSAGE", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_MESSAGE },
-{ "PBS_TRACK", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_TRACK },
-{ "PHYS_PAGES", { 0, 0 }, { 0, 0 }, 0, CONF_SUN, 1, CONF_sysconf, _SC_PHYS_PAGES },
-{ "PID_MAX", { 0, 0 }, { 30000, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
-{ "PII", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PII_INTERNET", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PII_INTERNET_DGRAM", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PII_INTERNET_STREAM", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PII_OSI", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PII_OSI_CLTS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PII_OSI_COTS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PII_OSI_M", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PII_SOCKET", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PII_XTI", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PIPE_BUF", { 0, 0 }, { _POSIX_PIPE_BUF, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_PIPE_BUF },
-{ "POLL", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "PRIORITIZED_IO", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_PRIORITIZED_IO },
-{ "PRIORITY_SCHEDULING", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_PRIORITY_SCHEDULING },
-{ "PRIO_IO", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_PRIO_IO },
-{ "PROC_RSRC_MGR", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "PTHREAD_DESTRUCTOR_ITERATIONS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "PTHREAD_KEYS_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "PTHREAD_STACK_MIN", { 4096, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_LIMIT|CONF_LIMIT_DEF, CONF_POSIX, 1, CONF_nop, -1 },
-{ "PTHREAD_THREADS_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "PTRDIFF_MAX", { 9223372036854775807LL, 0 }, { 65535, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_LIMIT_DEF|CONF_MINMAX_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "PTRDIFF_MIN", { (-9223372036854775807LL-1LL), 0 }, { -65535, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_LIMIT_DEF|CONF_MINMAX_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "RAW_SOCKETS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_RAW_SOCKETS },
-{ "READER_WRITER_LOCKS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_READER_WRITER_LOCKS },
-{ "REALTIME", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, -1 },
-{ "REALTIME_SIGNALS", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_REALTIME_SIGNALS },
-{ "REALTIME_THREADS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, -1 },
-{ "REC_INCR_XFER_SIZE", { 0, 0 }, { 0, 0 }, CONF_LIMIT|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_REC_INCR_XFER_SIZE },
-{ "REC_MAX_XFER_SIZE", { 0, 0 }, { 0, 0 }, CONF_LIMIT|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_REC_MAX_XFER_SIZE },
-{ "REC_MIN_XFER_SIZE", { 0, 0 }, { 0, 0 }, CONF_LIMIT|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_REC_MIN_XFER_SIZE },
-{ "REC_XFER_ALIGN", { 0, 0 }, { 0, 0 }, CONF_LIMIT|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_REC_XFER_ALIGN },
-{ "REENTRANT_FUNCTIONS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "REGEXP", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_REGEXP },
-{ "REGEX_VERSION", { 0, 0 }, { 20030916, 0 }, CONF_FEATURE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "RELEASE", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "RESOURCE_LIMITS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "RE_DUP_MAX", { 0, 0 }, { _POSIX2_RE_DUP_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_RE_DUP_MAX },
-{ "RTSIG_MAX", { 0, 0 }, { _POSIX_RTSIG_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_RTSIG_MAX },
-{ "SAVED_IDS", { 0, 0 }, { 1, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SAVED_IDS },
-{ "SCHAR_MAX", { 127, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "SCHAR_MIN", { -128, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "SECURITY_CLASS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "SELECT", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "SEMAPHORES", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SEMAPHORES },
-{ "SEM_NSEMS_MAX", { 0, 0 }, { _POSIX_SEM_NSEMS_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_SEM_NSEMS_MAX },
-{ "SEM_VALUE_MAX", { 0, 0 }, { _POSIX_SEM_VALUE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_SEM_VALUE_MAX },
+{ "PATH_MAX", { 0UL, 0 }, { _POSIX_PATH_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_PATH_MAX },
+{ "PBS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS },
+{ "PBS_ACCOUNTING", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_ACCOUNTING },
+{ "PBS_CHECKPOINT", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_CHECKPOINT },
+{ "PBS_LOCATE", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_LOCATE },
+{ "PBS_MESSAGE", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_MESSAGE },
+{ "PBS_TRACK", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_PBS_TRACK },
+{ "PHYS_PAGES", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SUN, 1, CONF_sysconf, _SC_PHYS_PAGES },
+{ "PID_MAX", { 0UL, 0 }, { 30000UL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
+{ "PII", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PII_INTERNET", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PII_INTERNET_DGRAM", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PII_INTERNET_STREAM", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PII_OSI", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PII_OSI_CLTS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PII_OSI_COTS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PII_OSI_M", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PII_SOCKET", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PII_XTI", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PIPE_BUF", { 0UL, 0 }, { _POSIX_PIPE_BUF, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_PIPE_BUF },
+{ "POLL", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "PRIORITIZED_IO", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_PRIORITIZED_IO },
+{ "PRIORITY_SCHEDULING", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_PRIORITY_SCHEDULING },
+{ "PRIO_IO", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_PRIO_IO },
+{ "PROC_RSRC_MGR", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "PTHREAD_DESTRUCTOR_ITERATIONS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "PTHREAD_KEYS_MAX", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "PTHREAD_STACK_MIN", { 4096UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_LIMIT|CONF_LIMIT_DEF, CONF_POSIX, 1, CONF_nop, -1 },
+{ "PTHREAD_THREADS_MAX", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "PTRDIFF_MAX", { 9223372036854775807UL, 0 }, { 65535UL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_LIMIT_DEF|CONF_MINMAX_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "PTRDIFF_MIN", { -9223372036854775807L-1L, 0 }, { -65535L, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_LIMIT_DEF|CONF_MINMAX_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "RAW_SOCKETS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_RAW_SOCKETS },
+{ "READER_WRITER_LOCKS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_READER_WRITER_LOCKS },
+{ "REALTIME", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, -1 },
+{ "REALTIME_SIGNALS", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_REALTIME_SIGNALS },
+{ "REALTIME_THREADS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, -1 },
+{ "REC_INCR_XFER_SIZE", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_REC_INCR_XFER_SIZE },
+{ "REC_MAX_XFER_SIZE", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_REC_MAX_XFER_SIZE },
+{ "REC_MIN_XFER_SIZE", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_REC_MIN_XFER_SIZE },
+{ "REC_XFER_ALIGN", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_REC_XFER_ALIGN },
+{ "REENTRANT_FUNCTIONS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "REGEXP", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_REGEXP },
+{ "REGEX_VERSION", { 0UL, 0 }, { 20030916UL, 0 }, CONF_FEATURE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "RELEASE", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_AST, 1, CONF_nop, -1 },
+{ "RESOURCE_LIMITS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "RE_DUP_MAX", { 0UL, 0 }, { _POSIX2_RE_DUP_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_RE_DUP_MAX },
+{ "RTSIG_MAX", { 0UL, 0 }, { _POSIX_RTSIG_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_RTSIG_MAX },
+{ "SAVED_IDS", { 0UL, 0 }, { 1UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SAVED_IDS },
+{ "SCHAR_MAX", { 127UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "SCHAR_MIN", { -127L-1L, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "SECURITY_CLASS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "SELECT", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "SEMAPHORES", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SEMAPHORES },
+{ "SEM_NSEMS_MAX", { 0UL, 0 }, { _POSIX_SEM_NSEMS_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_SEM_NSEMS_MAX },
+{ "SEM_VALUE_MAX", { 0UL, 0 }, { _POSIX_SEM_VALUE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_SEM_VALUE_MAX },
{ "SH", { 0, 0 }, { 0, "/bin/sh" }, CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING|CONF_MINMAX_DEF, CONF_AST, 1, CONF_confstr, -1 },
-{ "SHARED_MEMORY_OBJECTS", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SHARED_MEMORY_OBJECTS },
-{ "SHELL", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SHELL },
-{ "SHM", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_SHM },
-{ "SHRT_MAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
-{ "SHRT_MIN", { -32768, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "SIGQUEUE_MAX", { 0, 0 }, { _POSIX_SIGQUEUE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_SIGQUEUE_MAX },
-{ "SIGRT_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_SVID, 1, CONF_sysconf, _SC_SIGRT_MAX },
-{ "SIGRT_MIN", { 0, 0 }, { 0, 0 }, 0, CONF_SVID, 1, CONF_sysconf, _SC_SIGRT_MIN },
-{ "SIG_ATOMIC_MAX", { 2147483647, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "SIG_ATOMIC_MIN", { -2147483648, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "SIZE_MAX", { UINT_MAX, 0 }, { 65535, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_LIMIT_DEF|CONF_MINMAX_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "SLVM_MAXNODES", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "SOCK_MAXBUF", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "SOFTPOWER", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "SPAWN", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SPAWN },
-{ "SPIN_LOCKS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SPIN_LOCKS },
-{ "SPORADIC_SERVER", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SPORADIC_SERVER },
-{ "SRPC_DOMAIN", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "SHARED_MEMORY_OBJECTS", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SHARED_MEMORY_OBJECTS },
+{ "SHELL", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SHELL },
+{ "SHM", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_SHM },
+{ "SHRT_MAX", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
+{ "SHRT_MIN", { -32767L-1L, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "SIGQUEUE_MAX", { 0UL, 0 }, { _POSIX_SIGQUEUE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_SIGQUEUE_MAX },
+{ "SIGRT_MAX", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SVID, 1, CONF_sysconf, _SC_SIGRT_MAX },
+{ "SIGRT_MIN", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_SVID, 1, CONF_sysconf, _SC_SIGRT_MIN },
+{ "SIG_ATOMIC_MAX", { 2147483647UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "SIG_ATOMIC_MIN", { -2147483647L-1L, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "SIZE_MAX", { UINT_MAX, 0 }, { 65535UL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_LIMIT_DEF|CONF_MINMAX_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "SLVM_MAXNODES", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "SOCK_MAXBUF", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "SOFTPOWER", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "SPAWN", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SPAWN },
+{ "SPIN_LOCKS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SPIN_LOCKS },
+{ "SPORADIC_SERVER", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SPORADIC_SERVER },
+{ "SRPC_DOMAIN", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
{ "SSIZE_MAX", { INT_MAX, 0 }, { _POSIX_SSIZE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_LIMIT_DEF|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_nop, -1 },
-{ "SS_REPL_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SS_REPL_MAX },
-{ "STD_BLK", { 0, 0 }, { 1024, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
-{ "STREAMS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_STREAMS },
-{ "STREAM_MAX", { 0, 0 }, { _POSIX_STREAM_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_STREAM_MAX },
-{ "SW_DEV", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_SW_DEV },
-{ "SYMLINKS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_pathconf, _PC_2_SYMLINKS },
-{ "SYMLINK_MAX", { 0, 0 }, { _POSIX_SYMLINK_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_SYMLINK_MAX },
-{ "SYMLOOP_MAX", { 0, 0 }, { _POSIX_SYMLOOP_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_SYMLOOP_MAX },
-{ "SYNCHRONIZED_IO", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SYNCHRONIZED_IO },
-{ "SYNC_IO", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_SYNC_IO },
-{ "SYSNAME", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "SYSPID_MAX", { 0, 0 }, { 2, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
-{ "THREADS", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREADS },
-{ "THREADS_PRIO_CEILING", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "THREADS_PRIO_INHERIT", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "THREAD_ATTR_STACKADDR", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_ATTR_STACKADDR },
-{ "THREAD_ATTR_STACKSIZE", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_ATTR_STACKSIZE },
-{ "THREAD_CPUTIME", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_CPUTIME },
-{ "THREAD_DESTRUCTOR_ITERATIONS", { 0, 0 }, { _POSIX_THREAD_DESTRUCTOR_ITERATIONS, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_PREFIX_ONLY|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_DESTRUCTOR_ITERATIONS },
-{ "THREAD_KEYS_MAX", { 0, 0 }, { _POSIX_THREAD_KEYS_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_PREFIX_ONLY|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_KEYS_MAX },
-{ "THREAD_PRIORITY_SCHEDULING", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_PRIORITY_SCHEDULING },
-{ "THREAD_PRIO_INHERIT", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_PRIO_INHERIT },
-{ "THREAD_PRIO_PROTECT", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_PRIO_PROTECT },
-{ "THREAD_PROCESS_SHARED", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_PROCESS_SHARED },
-{ "THREAD_SAFE_FUNCTIONS", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_SAFE_FUNCTIONS },
-{ "THREAD_SPORADIC_SERVER", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_SPORADIC_SERVER },
-{ "THREAD_STACK_MIN", { 0, 0 }, { 0, 0 }, CONF_LIMIT|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_STACK_MIN },
-{ "THREAD_THREADS_MAX", { 0, 0 }, { _POSIX_THREAD_THREADS_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_PREFIX_ONLY|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_THREADS_MAX },
-{ "TIMEOUTS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TIMEOUTS },
-{ "TIMERS", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TIMERS },
-{ "TIMER_MAX", { 0, 0 }, { _POSIX_TIMER_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_TIMER_MAX },
+{ "SS_REPL_MAX", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SS_REPL_MAX },
+{ "STD_BLK", { 0UL, 0 }, { 1024UL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
+{ "STREAMS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_STREAMS },
+{ "STREAM_MAX", { 0UL, 0 }, { _POSIX_STREAM_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_STREAM_MAX },
+{ "SW_DEV", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_SW_DEV },
+{ "SYMLINKS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_pathconf, _PC_2_SYMLINKS },
+{ "SYMLINK_MAX", { 0UL, 0 }, { _POSIX_SYMLINK_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_SYMLINK_MAX },
+{ "SYMLOOP_MAX", { 0UL, 0 }, { _POSIX_SYMLOOP_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_SYMLOOP_MAX },
+{ "SYNCHRONIZED_IO", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_SYNCHRONIZED_IO },
+{ "SYNC_IO", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_SYNC_IO },
+{ "SYSNAME", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, SI_SYSNAME },
+{ "SYSPID_MAX", { 0UL, 0 }, { 2UL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
+{ "THREADS", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREADS },
+{ "THREADS_PRIO_CEILING", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "THREADS_PRIO_INHERIT", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "THREAD_ATTR_STACKADDR", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_ATTR_STACKADDR },
+{ "THREAD_ATTR_STACKSIZE", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_ATTR_STACKSIZE },
+{ "THREAD_CPUTIME", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_CPUTIME },
+{ "THREAD_DESTRUCTOR_ITERATIONS", { 0UL, 0 }, { _POSIX_THREAD_DESTRUCTOR_ITERATIONS, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_PREFIX_ONLY|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_DESTRUCTOR_ITERATIONS },
+{ "THREAD_KEYS_MAX", { 0UL, 0 }, { _POSIX_THREAD_KEYS_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_PREFIX_ONLY|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_KEYS_MAX },
+{ "THREAD_PRIORITY_SCHEDULING", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_PRIORITY_SCHEDULING },
+{ "THREAD_PRIO_INHERIT", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_PRIO_INHERIT },
+{ "THREAD_PRIO_PROTECT", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_PRIO_PROTECT },
+{ "THREAD_PROCESS_SHARED", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_PROCESS_SHARED },
+{ "THREAD_SAFE_FUNCTIONS", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_SAFE_FUNCTIONS },
+{ "THREAD_SPORADIC_SERVER", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_SPORADIC_SERVER },
+{ "THREAD_STACK_MIN", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_STACK_MIN },
+{ "THREAD_THREADS_MAX", { 0UL, 0 }, { _POSIX_THREAD_THREADS_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_PREFIX_ONLY|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_THREAD_THREADS_MAX },
+{ "TIMEOUTS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TIMEOUTS },
+{ "TIMERS", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TIMERS },
+{ "TIMER_MAX", { 0UL, 0 }, { _POSIX_TIMER_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_TIMER_MAX },
{ "TMP", { 0, 0 }, { 0, "/tmp" }, CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING|CONF_MINMAX_DEF, CONF_AST, 1, CONF_confstr, -1 },
-{ "TMP_MAX", { 17576, 0 }, { 10000, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_LIMIT_DEF|CONF_MINMAX_DEF, CONF_C, 1, CONF_sysconf, -1 },
-{ "TRACE", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE },
-{ "TRACE_EVENT_FILTER", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_EVENT_FILTER },
-{ "TRACE_EVENT_NAME_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_EVENT_NAME_MAX },
-{ "TRACE_INHERIT", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_INHERIT },
-{ "TRACE_LOG", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_LOG },
-{ "TRACE_NAME_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_NAME_MAX },
-{ "TRACE_SYS_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_SYS_MAX },
-{ "TRACE_USER_EVENT_MAX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_USER_EVENT_MAX },
-{ "TTY_NAME_MAX", { 0, 0 }, { _POSIX_TTY_NAME_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_TTY_NAME_MAX },
-{ "TYPED_MEMORY_OBJECTS", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TYPED_MEMORY_OBJECTS },
-{ "TZNAME_MAX", { 0, 0 }, { _POSIX_TZNAME_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_TZNAME_MAX },
-{ "T_IOV_MAX", { 0, 0 }, { 0, 0 }, 0, CONF_C, 1, CONF_sysconf, _SC_T_IOV_MAX },
-{ "UCHAR_MAX", { 255, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "UCHAR_MIN", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
-{ "UID_MAX", { 0, 0 }, { 60002, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
-{ "UINT_MAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
-{ "UIO_MAXIOV", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
-{ "ULLONG_MAX", { 18446744073709551615ULL, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "ULONG_MAX", { 4294967295, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "UNIX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_UNIX },
-{ "UPE", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_UPE },
-{ "USER_LIMIT", { 0, 0 }, { 0, 0 }, 0|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "USHRT_MAX", { 65535, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "V6_ILP32_OFF32", { 0, 0 }, { 0, 0 }, CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_V6_ILP32_OFF32 },
-{ "V6_ILP32_OFFBIG", { 0, 0 }, { 0, 0 }, CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_V6_ILP32_OFFBIG },
-{ "V6_LP64_OFF64", { 0, 0 }, { 0, 0 }, CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_V6_LP64_OFF64 },
-{ "V6_LPBIG_OFFBIG", { 0, 0 }, { 0, 0 }, CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_V6_LPBIG_OFFBIG },
-{ "VDISABLE", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_VDISABLE },
+{ "TMP_MAX", { 17576UL, 0 }, { 10000UL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_LIMIT_DEF|CONF_MINMAX_DEF, CONF_C, 1, CONF_sysconf, -1 },
+{ "TRACE", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE },
+{ "TRACE_EVENT_FILTER", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_EVENT_FILTER },
+{ "TRACE_EVENT_NAME_MAX", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_EVENT_NAME_MAX },
+{ "TRACE_INHERIT", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_INHERIT },
+{ "TRACE_LOG", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_LOG },
+{ "TRACE_NAME_MAX", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_NAME_MAX },
+{ "TRACE_SYS_MAX", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_SYS_MAX },
+{ "TRACE_USER_EVENT_MAX", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_NOUNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TRACE_USER_EVENT_MAX },
+{ "TTY_NAME_MAX", { 0UL, 0 }, { _POSIX_TTY_NAME_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_TTY_NAME_MAX },
+{ "TYPED_MEMORY_OBJECTS", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_TYPED_MEMORY_OBJECTS },
+{ "TZNAME_MAX", { 0UL, 0 }, { _POSIX_TZNAME_MAX, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_TZNAME_MAX },
+{ "T_IOV_MAX", { 0UL, 0 }, { 0UL, 0 }, 0, CONF_C, 1, CONF_sysconf, _SC_T_IOV_MAX },
+{ "UCHAR_MAX", { 255UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "UCHAR_MIN", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
+{ "UID_MAX", { 0UL, 0 }, { 60002UL, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
+{ "UINT_MAX", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
+{ "UIO_MAXIOV", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
+{ "ULLONG_MAX", { 18446744073709551615UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "ULONG_MAX", { 4294967295UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "UNIX", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_UNIX },
+{ "UPE", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_UPE },
+{ "USER_LIMIT", { 0, 0 }, { 0, 0 }, CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
+{ "USHRT_MAX", { 65535UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "V6_ILP32_OFF32", { 0UL, 0 }, { 0UL, 0 }, CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_V6_ILP32_OFF32 },
+{ "V6_ILP32_OFFBIG", { 0UL, 0 }, { 0UL, 0 }, CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_V6_ILP32_OFFBIG },
+{ "V6_LP64_OFF64", { 0UL, 0 }, { 0UL, 0 }, CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_V6_LP64_OFF64 },
+{ "V6_LPBIG_OFFBIG", { 0UL, 0 }, { 0UL, 0 }, CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_sysconf, _SC_V6_LPBIG_OFFBIG },
+{ "VDISABLE", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 1, CONF_pathconf, _PC_VDISABLE },
{ "VERSION", { 0, 0 }, { 0, 0 }, CONF_PREFIXED|CONF_STANDARD|CONF_STRING, CONF_SVID, 1, CONF_sysinfo, -1 },
-{ "VERSION", { 0, 0 }, { 200112, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "VERSION", { 0, 0 }, { 200112, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 2, CONF_sysconf, -1 },
-{ "VERSION", { 0, 0 }, { 600, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_VERSION },
-{ "VERSION", { 0, 0 }, { 0, 0 }, CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_XPG, 3, CONF_sysconf, -1 },
-{ "VERSION", { 0, 0 }, { 0, 0 }, CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_XPG, 4, CONF_sysconf, -1 },
-{ "VERSION", { 0, 0 }, { 0, 0 }, CONF_MINMAX|CONF_PREFIXED|CONF_STANDARD, CONF_AST, 1, CONF_nop, -1 },
-{ "VERSION", { 0, 0 }, { 0, 0 }, CONF_PREFIXED|CONF_STANDARD, CONF_GNU, 1, CONF_nop, -1 },
-{ "VERSION", { 0, 0 }, { 0, 0 }, CONF_PREFIXED|CONF_STANDARD, CONF_TRUSTEDBSD, 1, CONF_nop, -1 },
-{ "VERSION_88", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_LIMIT|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "VERSION_88", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
-{ "VERSION_90", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_LIMIT|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "VERSION_90", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
-{ "VERSION_93", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_LIMIT|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
-{ "VERSION_93", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
-{ "WCHAR_MAX", { 2147483647, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "WCHAR_MIN", { -2147483648, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "WINT_MAX", { 2147483647, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "WINT_MIN", { -2147483648, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-{ "WORD_BIT", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "XCU_VERSION", { 0, 0 }, { 0, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_XCU_VERSION },
-{ "XPG2", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "XPG3", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_nop, -1 },
-{ "XPG4", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "VERSION", { 0UL, 0 }, { 200112UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "VERSION", { 0UL, 0 }, { 200112UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 2, CONF_sysconf, -1 },
+{ "VERSION", { 0UL, 0 }, { 600UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_VERSION },
+{ "VERSION", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_XPG, 3, CONF_sysconf, -1 },
+{ "VERSION", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_MM|CONF_FEATURE|CONF_PREFIXED|CONF_STANDARD|CONF_UNDERSCORE, CONF_XPG, 4, CONF_sysconf, -1 },
+{ "VERSION", { 0UL, 0 }, { 0UL, 0 }, CONF_MINMAX|CONF_PREFIXED|CONF_STANDARD, CONF_AST, 1, CONF_nop, -1 },
+{ "VERSION", { 0UL, 0 }, { 0UL, 0 }, CONF_PREFIXED|CONF_STANDARD, CONF_GNU, 1, CONF_nop, -1 },
+{ "VERSION", { 0UL, 0 }, { 0UL, 0 }, CONF_PREFIXED|CONF_STANDARD, CONF_TRUSTEDBSD, 1, CONF_nop, -1 },
+{ "VERSION_88", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_LIMIT|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "VERSION_88", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
+{ "VERSION_90", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_LIMIT|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "VERSION_90", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
+{ "VERSION_93", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_LIMIT|CONF_STANDARD|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_sysconf, -1 },
+{ "VERSION_93", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
+{ "WCHAR_MAX", { 2147483647UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "WCHAR_MIN", { -2147483647L-1L, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "WINT_MAX", { 2147483647UL, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "WINT_MIN", { -2147483647L-1L, 0 }, { 0UL, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
+{ "WORD_BIT", { 0UL, 0 }, { 0UL, 0 }, CONF_LIMIT, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "XCU_VERSION", { 0UL, 0 }, { 0UL, 0 }, CONF_DEFER_CALL|CONF_DEFER_MM|CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_XCU_VERSION },
+{ "XPG2", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "XPG3", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_nop, -1 },
+{ "XPG4", { 0UL, 0 }, { 0UL, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_XOPEN, 1, CONF_nop, -1 },
};
int conf_elements = (int)sizeof(conf) / (int)sizeof(conf[0]);
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/conftab.h b/usr/src/lib/libast/sparcv9/src/lib/libast/conftab.h
index b88d4b5182..6306df6d31 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/conftab.h
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/conftab.h
@@ -1,66 +1,4 @@
-
-/* : : generated by proto : : */
-
-
#ifndef _CONFTAB_H
-#if !defined(__PROTO__)
-# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
-# if defined(__cplusplus)
-# define __LINKAGE__ "C"
-# else
-# define __LINKAGE__
-# endif
-# define __STDARG__
-# define __PROTO__(x) x
-# define __OTORP__(x)
-# define __PARAM__(n,o) n
-# if !defined(__STDC__) && !defined(__cplusplus)
-# if !defined(c_plusplus)
-# define const
-# endif
-# define signed
-# define void int
-# define volatile
-# define __V_ char
-# else
-# define __V_ void
-# endif
-# else
-# define __PROTO__(x) ()
-# define __OTORP__(x) x
-# define __PARAM__(n,o) o
-# define __LINKAGE__
-# define __V_ char
-# define const
-# define signed
-# define void int
-# define volatile
-# endif
-# define __MANGLE__ __LINKAGE__
-# if defined(__cplusplus) || defined(c_plusplus)
-# define __VARARG__ ...
-# else
-# define __VARARG__
-# endif
-# if defined(__STDARG__)
-# define __VA_START__(p,a) va_start(p,a)
-# else
-# define __VA_START__(p,a) va_start(p)
-# endif
-# if !defined(__INLINE__)
-# if defined(__cplusplus)
-# define __INLINE__ extern __MANGLE__ inline
-# else
-# if defined(_WIN32) && !defined(__GNUC__)
-# define __INLINE__ __inline
-# endif
-# endif
-# endif
-#endif
-#if !defined(__LINKAGE__)
-#define __LINKAGE__ /* 2004-08-11 transition */
-#endif
-
#define _CONFTAB_H
#if !defined(SYS_NMLEN)
@@ -68,7 +6,11 @@
#endif
#include <sys/systeminfo.h>
-/* : : generated by conf from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/comp/conf.tab : : */
+/* : : generated by conf from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/comp/conf.tab : : */
+
+#if !defined(const) && !defined(__STDC__) && !defined(__cplusplus) && !defined(c_plusplus)
+#define const
+#endif
#define conf _ast_conf_data
#define conf_elements _ast_conf_ndata
@@ -117,8 +59,6 @@
struct Conf_s; typedef struct Conf_s Conf_t;
-typedef int (*Conf_f) __PROTO__((Conf_t*, intmax_t*, char**));
-
typedef struct Value_s
{
intmax_t number;
@@ -130,7 +70,7 @@ struct Conf_s
const char name[32];
Value_t limit;
Value_t minmax;
- short flags;
+ unsigned int flags;
short standard;
short section;
short call;
@@ -145,10 +85,10 @@ typedef struct Prefix_s
short call;
} Prefix_t;
-extern __MANGLE__ const Conf_t conf[];
-extern __MANGLE__ int conf_elements;
+extern const Conf_t conf[];
+extern int conf_elements;
-extern __MANGLE__ const Prefix_t prefix[];
-extern __MANGLE__ int prefix_elements;
+extern const Prefix_t prefix[];
+extern int prefix_elements;
#endif
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/lc.h b/usr/src/lib/libast/sparcv9/src/lib/libast/lc.h
index fdd804f36e..b225864bbc 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/lc.h
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/lc.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1985-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1985-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/lctab.h b/usr/src/lib/libast/sparcv9/src/lib/libast/lctab.c
index 6abbd72c65..4927e1fd3a 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/lctab.h
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/lctab.c
@@ -1,6 +1,10 @@
/* : : generated by ./lcgen : : */
-static Lc_attribute_t attribute_es[] =
+#include "lclib.h"
+#include "lclang.h"
+
+
+const Lc_attribute_t attribute_es[] =
{
{"traditional",LC_default,
#ifdef SUBLANG_SPANISH_TRADITIONAL
@@ -20,7 +24,7 @@ SUBLANG_SPANISH_MODERN,
},
};
-static const Lc_charset_t charset[] =
+const Lc_charset_t lc_charsets[] =
{
{"iso8859-1","latin1|west-europe","1252",},
{"iso8859-2","latin2|east-europe","1250",},
@@ -42,11 +46,11 @@ static const Lc_charset_t charset[] =
0
};
-static const Lc_language_t language[] =
+const Lc_language_t lc_languages[] =
{
-{"C","C","POSIX",&charset[0],LC_default,0,0,0,},
-{"debug","debug",0,&charset[0],LC_debug,0,0,0,},
-{"aa","afar",0,&charset[0],0,
+{"C","C","POSIX",&lc_charsets[0],LC_default,0,0,0,},
+{"debug","debug",0,&lc_charsets[0],LC_debug,0,0,0,},
+{"aa","afar",0,&lc_charsets[0],0,
#ifdef LANG_AFAR
LANG_AFAR,
#else
@@ -54,7 +58,7 @@ LANG_AFAR,
#endif
0,0,
},
-{"ab","abkhazian",0,&charset[0],0,
+{"ab","abkhazian",0,&lc_charsets[0],0,
#ifdef LANG_ABKHAZIAN
LANG_ABKHAZIAN,
#else
@@ -62,7 +66,7 @@ LANG_ABKHAZIAN,
#endif
0,0,
},
-{"af","afrikaans","afr",&charset[0],0,
+{"af","afrikaans","afr",&lc_charsets[0],0,
#ifdef LANG_AFRIKAANS
LANG_AFRIKAANS,
#else
@@ -70,7 +74,7 @@ LANG_AFRIKAANS,
#endif
0,0,
},
-{"am","amharic",0,&charset[0],0,
+{"am","amharic",0,&lc_charsets[0],0,
#ifdef LANG_AMHARIC
LANG_AMHARIC,
#else
@@ -78,7 +82,7 @@ LANG_AMHARIC,
#endif
0,0,
},
-{"ar","arabic","ara",&charset[5],0,
+{"ar","arabic","ara",&lc_charsets[5],0,
#ifdef LANG_ARABIC
LANG_ARABIC,
#else
@@ -86,7 +90,7 @@ LANG_ARABIC,
#endif
0,0,
},
-{"as","assamese",0,&charset[0],0,
+{"as","assamese",0,&lc_charsets[0],0,
#ifdef LANG_ASSAMESE
LANG_ASSAMESE,
#else
@@ -94,7 +98,7 @@ LANG_ASSAMESE,
#endif
0,0,
},
-{"ay","aymara",0,&charset[0],0,
+{"ay","aymara",0,&lc_charsets[0],0,
#ifdef LANG_AYMARA
LANG_AYMARA,
#else
@@ -102,7 +106,7 @@ LANG_AYMARA,
#endif
0,0,
},
-{"az","azerbaijani",0,&charset[0],0,
+{"az","azerbaijani",0,&lc_charsets[0],0,
#ifdef LANG_AZERBAIJANI
LANG_AZERBAIJANI,
#else
@@ -110,7 +114,7 @@ LANG_AZERBAIJANI,
#endif
0,0,
},
-{"ba","bashkir",0,&charset[0],0,
+{"ba","bashkir",0,&lc_charsets[0],0,
#ifdef LANG_BASHKIR
LANG_BASHKIR,
#else
@@ -118,7 +122,7 @@ LANG_BASHKIR,
#endif
0,0,
},
-{"be","belarusian","bel",&charset[0],0,
+{"be","belarusian","bel",&lc_charsets[0],0,
#ifdef LANG_BELARUSIAN
LANG_BELARUSIAN,
#else
@@ -126,7 +130,7 @@ LANG_BELARUSIAN,
#endif
0,0,
},
-{"bg","bulgarian","bul",&charset[4],0,
+{"bg","bulgarian","bul",&lc_charsets[4],0,
#ifdef LANG_BULGARIAN
LANG_BULGARIAN,
#else
@@ -134,7 +138,7 @@ LANG_BULGARIAN,
#endif
0,0,
},
-{"bh","bihari",0,&charset[0],0,
+{"bh","bihari",0,&lc_charsets[0],0,
#ifdef LANG_BIHARI
LANG_BIHARI,
#else
@@ -142,7 +146,7 @@ LANG_BIHARI,
#endif
0,0,
},
-{"bi","bislama",0,&charset[0],0,
+{"bi","bislama",0,&lc_charsets[0],0,
#ifdef LANG_BISLAMA
LANG_BISLAMA,
#else
@@ -150,7 +154,7 @@ LANG_BISLAMA,
#endif
0,0,
},
-{"bn","bengali-bangla",0,&charset[0],0,
+{"bn","bengali-bangla",0,&lc_charsets[0],0,
#ifdef LANG_BENGALI_BANGLA
LANG_BENGALI_BANGLA,
#else
@@ -158,7 +162,7 @@ LANG_BENGALI_BANGLA,
#endif
0,0,
},
-{"bo","tibetan",0,&charset[0],0,
+{"bo","tibetan",0,&lc_charsets[0],0,
#ifdef LANG_TIBETAN
LANG_TIBETAN,
#else
@@ -166,7 +170,7 @@ LANG_TIBETAN,
#endif
0,0,
},
-{"br","breton",0,&charset[0],0,
+{"br","breton",0,&lc_charsets[0],0,
#ifdef LANG_BRETON
LANG_BRETON,
#else
@@ -174,7 +178,7 @@ LANG_BRETON,
#endif
0,0,
},
-{"ca","catalan","cat",&charset[0],0,
+{"ca","catalan","cat",&lc_charsets[0],0,
#ifdef LANG_CATALAN
LANG_CATALAN,
#else
@@ -182,7 +186,7 @@ LANG_CATALAN,
#endif
0,0,
},
-{"co","corsican",0,&charset[0],0,
+{"co","corsican",0,&lc_charsets[0],0,
#ifdef LANG_CORSICAN
LANG_CORSICAN,
#else
@@ -190,7 +194,7 @@ LANG_CORSICAN,
#endif
0,0,
},
-{"cs","czech","ces|cze",&charset[1],0,
+{"cs","czech","ces|cze",&lc_charsets[1],0,
#ifdef LANG_CZECH
LANG_CZECH,
#else
@@ -198,7 +202,7 @@ LANG_CZECH,
#endif
0,0,
},
-{"cy","welsh",0,&charset[0],0,
+{"cy","welsh",0,&lc_charsets[0],0,
#ifdef LANG_WELSH
LANG_WELSH,
#else
@@ -206,7 +210,7 @@ LANG_WELSH,
#endif
0,0,
},
-{"da","danish","dan",&charset[0],0,
+{"da","danish","dan",&lc_charsets[0],0,
#ifdef LANG_DANISH
LANG_DANISH,
#else
@@ -214,7 +218,7 @@ LANG_DANISH,
#endif
0,0,
},
-{"de","german","deu|ger",&charset[0],0,
+{"de","german","deu|ger",&lc_charsets[0],0,
#ifdef LANG_GERMAN
LANG_GERMAN,
#else
@@ -222,7 +226,7 @@ LANG_GERMAN,
#endif
0,0,
},
-{"dz","bhutani",0,&charset[0],0,
+{"dz","bhutani",0,&lc_charsets[0],0,
#ifdef LANG_BHUTANI
LANG_BHUTANI,
#else
@@ -230,7 +234,7 @@ LANG_BHUTANI,
#endif
0,0,
},
-{"el","greek","ell|gre",&charset[6],0,
+{"el","greek","ell|gre",&lc_charsets[6],0,
#ifdef LANG_GREEK
LANG_GREEK,
#else
@@ -238,7 +242,7 @@ LANG_GREEK,
#endif
0,0,
},
-{"en","english","eng",&charset[0],0,
+{"en","english","eng",&lc_charsets[0],0,
#ifdef LANG_ENGLISH
LANG_ENGLISH,
#else
@@ -246,7 +250,7 @@ LANG_ENGLISH,
#endif
0,0,
},
-{"eo","esperanto",0,&charset[0],0,
+{"eo","esperanto",0,&lc_charsets[0],0,
#ifdef LANG_ESPERANTO
LANG_ESPERANTO,
#else
@@ -254,7 +258,7 @@ LANG_ESPERANTO,
#endif
0,0,
},
-{"es","spanish","spa",&charset[0],0,
+{"es","spanish","spa",&lc_charsets[0],0,
#ifdef LANG_SPANISH
LANG_SPANISH,
#else
@@ -262,7 +266,7 @@ LANG_SPANISH,
#endif
&attribute_es[0],&attribute_es[1],
},
-{"et","estonian","est",&charset[2],0,
+{"et","estonian","est",&lc_charsets[2],0,
#ifdef LANG_ESTONIAN
LANG_ESTONIAN,
#else
@@ -270,7 +274,7 @@ LANG_ESTONIAN,
#endif
0,0,
},
-{"eu","basque","eus|baq",&charset[0],0,
+{"eu","basque","eus|baq",&lc_charsets[0],0,
#ifdef LANG_BASQUE
LANG_BASQUE,
#else
@@ -278,7 +282,7 @@ LANG_BASQUE,
#endif
0,0,
},
-{"fa","persian",0,&charset[0],0,
+{"fa","persian",0,&lc_charsets[0],0,
#ifdef LANG_PERSIAN
LANG_PERSIAN,
#else
@@ -286,7 +290,7 @@ LANG_PERSIAN,
#endif
0,0,
},
-{"fi","finnish","fin",&charset[0],0,
+{"fi","finnish","fin",&lc_charsets[0],0,
#ifdef LANG_FINNISH
LANG_FINNISH,
#else
@@ -294,7 +298,7 @@ LANG_FINNISH,
#endif
0,0,
},
-{"fj","fiji",0,&charset[0],0,
+{"fj","fiji",0,&lc_charsets[0],0,
#ifdef LANG_FIJI
LANG_FIJI,
#else
@@ -302,7 +306,7 @@ LANG_FIJI,
#endif
0,0,
},
-{"fo","faeroese",0,&charset[0],0,
+{"fo","faeroese",0,&lc_charsets[0],0,
#ifdef LANG_FAEROESE
LANG_FAEROESE,
#else
@@ -310,7 +314,7 @@ LANG_FAEROESE,
#endif
0,0,
},
-{"fr","french","fra|fre",&charset[0],0,
+{"fr","french","fra|fre",&lc_charsets[0],0,
#ifdef LANG_FRENCH
LANG_FRENCH,
#else
@@ -318,7 +322,7 @@ LANG_FRENCH,
#endif
0,0,
},
-{"fy","frisian",0,&charset[0],0,
+{"fy","frisian",0,&lc_charsets[0],0,
#ifdef LANG_FRISIAN
LANG_FRISIAN,
#else
@@ -326,7 +330,7 @@ LANG_FRISIAN,
#endif
0,0,
},
-{"ga","irish",0,&charset[11],0,
+{"ga","irish",0,&lc_charsets[11],0,
#ifdef LANG_IRISH
LANG_IRISH,
#else
@@ -334,7 +338,7 @@ LANG_IRISH,
#endif
0,0,
},
-{"gd","scots-gaelic",0,&charset[11],0,
+{"gd","scots-gaelic",0,&lc_charsets[11],0,
#ifdef LANG_SCOTS_GAELIC
LANG_SCOTS_GAELIC,
#else
@@ -342,7 +346,7 @@ LANG_SCOTS_GAELIC,
#endif
0,0,
},
-{"gl","galician",0,&charset[0],0,
+{"gl","galician",0,&lc_charsets[0],0,
#ifdef LANG_GALICIAN
LANG_GALICIAN,
#else
@@ -350,7 +354,7 @@ LANG_GALICIAN,
#endif
0,0,
},
-{"gn","guarani",0,&charset[0],0,
+{"gn","guarani",0,&lc_charsets[0],0,
#ifdef LANG_GUARANI
LANG_GUARANI,
#else
@@ -358,7 +362,7 @@ LANG_GUARANI,
#endif
0,0,
},
-{"gu","gujarati",0,&charset[0],0,
+{"gu","gujarati",0,&lc_charsets[0],0,
#ifdef LANG_GUJARATI
LANG_GUJARATI,
#else
@@ -366,7 +370,7 @@ LANG_GUJARATI,
#endif
0,0,
},
-{"ha","hausa",0,&charset[0],0,
+{"ha","hausa",0,&lc_charsets[0],0,
#ifdef LANG_HAUSA
LANG_HAUSA,
#else
@@ -374,7 +378,7 @@ LANG_HAUSA,
#endif
0,0,
},
-{"he","hebrew","heb",&charset[7],0,
+{"he","hebrew","heb",&lc_charsets[7],0,
#ifdef LANG_HEBREW
LANG_HEBREW,
#else
@@ -382,7 +386,7 @@ LANG_HEBREW,
#endif
0,0,
},
-{"hi","hindi",0,&charset[0],0,
+{"hi","hindi",0,&lc_charsets[0],0,
#ifdef LANG_HINDI
LANG_HINDI,
#else
@@ -390,7 +394,7 @@ LANG_HINDI,
#endif
0,0,
},
-{"hr","croatian","hrv|scr",&charset[1],0,
+{"hr","croatian","hrv|scr",&lc_charsets[1],0,
#ifdef LANG_CROATIAN
LANG_CROATIAN,
#else
@@ -398,7 +402,7 @@ LANG_CROATIAN,
#endif
0,0,
},
-{"hu","hungarian","hun",&charset[1],0,
+{"hu","hungarian","hun",&lc_charsets[1],0,
#ifdef LANG_HUNGARIAN
LANG_HUNGARIAN,
#else
@@ -406,7 +410,7 @@ LANG_HUNGARIAN,
#endif
0,0,
},
-{"hy","armenian",0,&charset[0],0,
+{"hy","armenian",0,&lc_charsets[0],0,
#ifdef LANG_ARMENIAN
LANG_ARMENIAN,
#else
@@ -414,7 +418,7 @@ LANG_ARMENIAN,
#endif
0,0,
},
-{"ia","interlingua",0,&charset[0],0,
+{"ia","interlingua",0,&lc_charsets[0],0,
#ifdef LANG_INTERLINGUA
LANG_INTERLINGUA,
#else
@@ -422,7 +426,7 @@ LANG_INTERLINGUA,
#endif
0,0,
},
-{"id","indonesian","ind",&charset[0],0,
+{"id","indonesian","ind",&lc_charsets[0],0,
#ifdef LANG_INDONESIAN
LANG_INDONESIAN,
#else
@@ -430,7 +434,7 @@ LANG_INDONESIAN,
#endif
0,0,
},
-{"ie","interlingue",0,&charset[0],0,
+{"ie","interlingue",0,&lc_charsets[0],0,
#ifdef LANG_INTERLINGUE
LANG_INTERLINGUE,
#else
@@ -438,7 +442,7 @@ LANG_INTERLINGUE,
#endif
0,0,
},
-{"ik","inupiak",0,&charset[0],0,
+{"ik","inupiak",0,&lc_charsets[0],0,
#ifdef LANG_INUPIAK
LANG_INUPIAK,
#else
@@ -446,7 +450,7 @@ LANG_INUPIAK,
#endif
0,0,
},
-{"in","indonesian",0,&charset[0],0,
+{"in","indonesian",0,&lc_charsets[0],0,
#ifdef LANG_INDONESIAN
LANG_INDONESIAN,
#else
@@ -454,7 +458,7 @@ LANG_INDONESIAN,
#endif
0,0,
},
-{"is","icelandic","isl|ice",&charset[0],0,
+{"is","icelandic","isl|ice",&lc_charsets[0],0,
#ifdef LANG_ICELANDIC
LANG_ICELANDIC,
#else
@@ -462,7 +466,7 @@ LANG_ICELANDIC,
#endif
0,0,
},
-{"it","italian","ita",&charset[0],0,
+{"it","italian","ita",&lc_charsets[0],0,
#ifdef LANG_ITALIAN
LANG_ITALIAN,
#else
@@ -470,7 +474,7 @@ LANG_ITALIAN,
#endif
0,0,
},
-{"iw","hebrew",0,&charset[0],0,
+{"iw","hebrew",0,&lc_charsets[0],0,
#ifdef LANG_HEBREW
LANG_HEBREW,
#else
@@ -478,7 +482,7 @@ LANG_HEBREW,
#endif
0,0,
},
-{"ja","japanese","jpn",&charset[0],0,
+{"ja","japanese","jpn",&lc_charsets[0],0,
#ifdef LANG_JAPANESE
LANG_JAPANESE,
#else
@@ -486,7 +490,7 @@ LANG_JAPANESE,
#endif
0,0,
},
-{"ji","yiddish",0,&charset[0],0,
+{"ji","yiddish",0,&lc_charsets[0],0,
#ifdef LANG_YIDDISH
LANG_YIDDISH,
#else
@@ -494,7 +498,7 @@ LANG_YIDDISH,
#endif
0,0,
},
-{"jw","javanese",0,&charset[0],0,
+{"jw","javanese",0,&lc_charsets[0],0,
#ifdef LANG_JAVANESE
LANG_JAVANESE,
#else
@@ -502,7 +506,7 @@ LANG_JAVANESE,
#endif
0,0,
},
-{"ka","georgian",0,&charset[0],0,
+{"ka","georgian",0,&lc_charsets[0],0,
#ifdef LANG_GEORGIAN
LANG_GEORGIAN,
#else
@@ -510,7 +514,7 @@ LANG_GEORGIAN,
#endif
0,0,
},
-{"kk","kazakh","kaz",&charset[0],0,
+{"kk","kazakh","kaz",&lc_charsets[0],0,
#ifdef LANG_KAZAKH
LANG_KAZAKH,
#else
@@ -518,7 +522,7 @@ LANG_KAZAKH,
#endif
0,0,
},
-{"kl","greenlandic",0,&charset[0],0,
+{"kl","greenlandic",0,&lc_charsets[0],0,
#ifdef LANG_GREENLANDIC
LANG_GREENLANDIC,
#else
@@ -526,7 +530,7 @@ LANG_GREENLANDIC,
#endif
0,0,
},
-{"km","cambodian",0,&charset[0],0,
+{"km","cambodian",0,&lc_charsets[0],0,
#ifdef LANG_CAMBODIAN
LANG_CAMBODIAN,
#else
@@ -534,7 +538,7 @@ LANG_CAMBODIAN,
#endif
0,0,
},
-{"kn","kannada",0,&charset[0],0,
+{"kn","kannada",0,&lc_charsets[0],0,
#ifdef LANG_KANNADA
LANG_KANNADA,
#else
@@ -542,7 +546,7 @@ LANG_KANNADA,
#endif
0,0,
},
-{"ko","korean","kor",&charset[0],0,
+{"ko","korean","kor",&lc_charsets[0],0,
#ifdef LANG_KOREAN
LANG_KOREAN,
#else
@@ -550,7 +554,7 @@ LANG_KOREAN,
#endif
0,0,
},
-{"ks","kashmiri",0,&charset[0],0,
+{"ks","kashmiri",0,&lc_charsets[0],0,
#ifdef LANG_KASHMIRI
LANG_KASHMIRI,
#else
@@ -558,7 +562,7 @@ LANG_KASHMIRI,
#endif
0,0,
},
-{"ku","kurdish",0,&charset[0],0,
+{"ku","kurdish",0,&lc_charsets[0],0,
#ifdef LANG_KURDISH
LANG_KURDISH,
#else
@@ -566,7 +570,7 @@ LANG_KURDISH,
#endif
0,0,
},
-{"ky","kirghiz",0,&charset[0],0,
+{"ky","kirghiz",0,&lc_charsets[0],0,
#ifdef LANG_KIRGHIZ
LANG_KIRGHIZ,
#else
@@ -574,7 +578,7 @@ LANG_KIRGHIZ,
#endif
0,0,
},
-{"la","latin",0,&charset[0],0,
+{"la","latin",0,&lc_charsets[0],0,
#ifdef LANG_LATIN
LANG_LATIN,
#else
@@ -582,7 +586,7 @@ LANG_LATIN,
#endif
0,0,
},
-{"ln","lingala",0,&charset[0],0,
+{"ln","lingala",0,&lc_charsets[0],0,
#ifdef LANG_LINGALA
LANG_LINGALA,
#else
@@ -590,7 +594,7 @@ LANG_LINGALA,
#endif
0,0,
},
-{"lo","laothian",0,&charset[0],0,
+{"lo","laothian",0,&lc_charsets[0],0,
#ifdef LANG_LAOTHIAN
LANG_LAOTHIAN,
#else
@@ -598,7 +602,7 @@ LANG_LAOTHIAN,
#endif
0,0,
},
-{"lt","lithuanian","lit",&charset[10],0,
+{"lt","lithuanian","lit",&lc_charsets[10],0,
#ifdef LANG_LITHUANIAN
LANG_LITHUANIAN,
#else
@@ -606,7 +610,7 @@ LANG_LITHUANIAN,
#endif
0,0,
},
-{"lv","latvian","lav",&charset[10],0,
+{"lv","latvian","lav",&lc_charsets[10],0,
#ifdef LANG_LATVIAN
LANG_LATVIAN,
#else
@@ -614,7 +618,7 @@ LANG_LATVIAN,
#endif
0,0,
},
-{"mg","malagasy",0,&charset[0],0,
+{"mg","malagasy",0,&lc_charsets[0],0,
#ifdef LANG_MALAGASY
LANG_MALAGASY,
#else
@@ -622,7 +626,7 @@ LANG_MALAGASY,
#endif
0,0,
},
-{"mi","maori",0,&charset[0],0,
+{"mi","maori",0,&lc_charsets[0],0,
#ifdef LANG_MAORI
LANG_MAORI,
#else
@@ -630,7 +634,7 @@ LANG_MAORI,
#endif
0,0,
},
-{"mk","macedonian","mkd|mac",&charset[0],0,
+{"mk","macedonian","mkd|mac",&lc_charsets[0],0,
#ifdef LANG_MACEDONIAN
LANG_MACEDONIAN,
#else
@@ -638,7 +642,7 @@ LANG_MACEDONIAN,
#endif
0,0,
},
-{"ml","malayalam","mal",&charset[0],0,
+{"ml","malayalam","mal",&lc_charsets[0],0,
#ifdef LANG_MALAYALAM
LANG_MALAYALAM,
#else
@@ -646,7 +650,7 @@ LANG_MALAYALAM,
#endif
0,0,
},
-{"mn","mongolian",0,&charset[0],0,
+{"mn","mongolian",0,&lc_charsets[0],0,
#ifdef LANG_MONGOLIAN
LANG_MONGOLIAN,
#else
@@ -654,7 +658,7 @@ LANG_MONGOLIAN,
#endif
0,0,
},
-{"mo","moldavian",0,&charset[0],0,
+{"mo","moldavian",0,&lc_charsets[0],0,
#ifdef LANG_MOLDAVIAN
LANG_MOLDAVIAN,
#else
@@ -662,7 +666,7 @@ LANG_MOLDAVIAN,
#endif
0,0,
},
-{"mr","marathi",0,&charset[0],0,
+{"mr","marathi",0,&lc_charsets[0],0,
#ifdef LANG_MARATHI
LANG_MARATHI,
#else
@@ -670,7 +674,7 @@ LANG_MARATHI,
#endif
0,0,
},
-{"ms","malay","msa|may",&charset[0],0,
+{"ms","malay","msa|may",&lc_charsets[0],0,
#ifdef LANG_MALAY
LANG_MALAY,
#else
@@ -678,7 +682,7 @@ LANG_MALAY,
#endif
0,0,
},
-{"mt","maltese",0,&charset[0],0,
+{"mt","maltese",0,&lc_charsets[0],0,
#ifdef LANG_MALTESE
LANG_MALTESE,
#else
@@ -686,7 +690,7 @@ LANG_MALTESE,
#endif
0,0,
},
-{"my","burmese",0,&charset[0],0,
+{"my","burmese",0,&lc_charsets[0],0,
#ifdef LANG_BURMESE
LANG_BURMESE,
#else
@@ -694,7 +698,7 @@ LANG_BURMESE,
#endif
0,0,
},
-{"na","nauru",0,&charset[0],0,
+{"na","nauru",0,&lc_charsets[0],0,
#ifdef LANG_NAURU
LANG_NAURU,
#else
@@ -702,7 +706,7 @@ LANG_NAURU,
#endif
0,0,
},
-{"nb","norwegian-bokmal","nob",&charset[0],0,
+{"nb","norwegian-bokmal","nob",&lc_charsets[0],0,
#ifdef LANG_NORWEGIAN_BOKMAL
LANG_NORWEGIAN_BOKMAL,
#else
@@ -710,7 +714,7 @@ LANG_NORWEGIAN_BOKMAL,
#endif
0,0,
},
-{"ne","nepali",0,&charset[0],0,
+{"ne","nepali",0,&lc_charsets[0],0,
#ifdef LANG_NEPALI
LANG_NEPALI,
#else
@@ -718,7 +722,7 @@ LANG_NEPALI,
#endif
0,0,
},
-{"nl","dutch","nld|dut",&charset[0],0,
+{"nl","dutch","nld|dut",&lc_charsets[0],0,
#ifdef LANG_DUTCH
LANG_DUTCH,
#else
@@ -726,7 +730,7 @@ LANG_DUTCH,
#endif
0,0,
},
-{"nn","norwegian-nynorsk","nno|non",&charset[0],0,
+{"nn","norwegian-nynorsk","nno|non",&lc_charsets[0],0,
#ifdef LANG_NORWEGIAN_NYNORSK
LANG_NORWEGIAN_NYNORSK,
#else
@@ -734,7 +738,7 @@ LANG_NORWEGIAN_NYNORSK,
#endif
0,0,
},
-{"no","norwegian","nor",&charset[0],0,
+{"no","norwegian","nor",&lc_charsets[0],0,
#ifdef LANG_NORWEGIAN
LANG_NORWEGIAN,
#else
@@ -742,7 +746,7 @@ LANG_NORWEGIAN,
#endif
0,0,
},
-{"oc","occitan",0,&charset[0],0,
+{"oc","occitan",0,&lc_charsets[0],0,
#ifdef LANG_OCCITAN
LANG_OCCITAN,
#else
@@ -750,7 +754,7 @@ LANG_OCCITAN,
#endif
0,0,
},
-{"om","oromo",0,&charset[0],0,
+{"om","oromo",0,&lc_charsets[0],0,
#ifdef LANG_OROMO
LANG_OROMO,
#else
@@ -758,7 +762,7 @@ LANG_OROMO,
#endif
0,0,
},
-{"or","oriya",0,&charset[0],0,
+{"or","oriya",0,&lc_charsets[0],0,
#ifdef LANG_ORIYA
LANG_ORIYA,
#else
@@ -766,7 +770,7 @@ LANG_ORIYA,
#endif
0,0,
},
-{"pa","punjabi",0,&charset[0],0,
+{"pa","punjabi",0,&lc_charsets[0],0,
#ifdef LANG_PUNJABI
LANG_PUNJABI,
#else
@@ -774,7 +778,7 @@ LANG_PUNJABI,
#endif
0,0,
},
-{"pl","polish","pol",&charset[1],0,
+{"pl","polish","pol",&lc_charsets[1],0,
#ifdef LANG_POLISH
LANG_POLISH,
#else
@@ -782,7 +786,7 @@ LANG_POLISH,
#endif
0,0,
},
-{"ps","pushto",0,&charset[0],0,
+{"ps","pushto",0,&lc_charsets[0],0,
#ifdef LANG_PUSHTO
LANG_PUSHTO,
#else
@@ -790,7 +794,7 @@ LANG_PUSHTO,
#endif
0,0,
},
-{"pt","portuguese","por",&charset[0],0,
+{"pt","portuguese","por",&lc_charsets[0],0,
#ifdef LANG_PORTUGUESE
LANG_PORTUGUESE,
#else
@@ -798,7 +802,7 @@ LANG_PORTUGUESE,
#endif
0,0,
},
-{"qu","quechua",0,&charset[0],0,
+{"qu","quechua",0,&lc_charsets[0],0,
#ifdef LANG_QUECHUA
LANG_QUECHUA,
#else
@@ -806,7 +810,7 @@ LANG_QUECHUA,
#endif
0,0,
},
-{"rm","rhaeto-romance",0,&charset[0],0,
+{"rm","rhaeto-romance",0,&lc_charsets[0],0,
#ifdef LANG_RHAETO_ROMANCE
LANG_RHAETO_ROMANCE,
#else
@@ -814,7 +818,7 @@ LANG_RHAETO_ROMANCE,
#endif
0,0,
},
-{"rn","kirundi",0,&charset[0],0,
+{"rn","kirundi",0,&lc_charsets[0],0,
#ifdef LANG_KIRUNDI
LANG_KIRUNDI,
#else
@@ -822,7 +826,7 @@ LANG_KIRUNDI,
#endif
0,0,
},
-{"ro","romanian","ron|rum",&charset[1],0,
+{"ro","romanian","ron|rum",&lc_charsets[1],0,
#ifdef LANG_ROMANIAN
LANG_ROMANIAN,
#else
@@ -830,7 +834,7 @@ LANG_ROMANIAN,
#endif
0,0,
},
-{"ru","russian","rus",&charset[4],0,
+{"ru","russian","rus",&lc_charsets[4],0,
#ifdef LANG_RUSSIAN
LANG_RUSSIAN,
#else
@@ -838,7 +842,7 @@ LANG_RUSSIAN,
#endif
0,0,
},
-{"rw","kinyarwanda",0,&charset[0],0,
+{"rw","kinyarwanda",0,&lc_charsets[0],0,
#ifdef LANG_KINYARWANDA
LANG_KINYARWANDA,
#else
@@ -846,7 +850,7 @@ LANG_KINYARWANDA,
#endif
0,0,
},
-{"sa","sanskrit",0,&charset[0],0,
+{"sa","sanskrit",0,&lc_charsets[0],0,
#ifdef LANG_SANSKRIT
LANG_SANSKRIT,
#else
@@ -854,7 +858,7 @@ LANG_SANSKRIT,
#endif
0,0,
},
-{"sd","sindhi",0,&charset[0],0,
+{"sd","sindhi",0,&lc_charsets[0],0,
#ifdef LANG_SINDHI
LANG_SINDHI,
#else
@@ -862,7 +866,7 @@ LANG_SINDHI,
#endif
0,0,
},
-{"sg","sangro",0,&charset[0],0,
+{"sg","sangro",0,&lc_charsets[0],0,
#ifdef LANG_SANGRO
LANG_SANGRO,
#else
@@ -870,7 +874,7 @@ LANG_SANGRO,
#endif
0,0,
},
-{"sh","serbo-croatian",0,&charset[0],0,
+{"sh","serbo-croatian",0,&lc_charsets[0],0,
#ifdef LANG_SERBO_CROATIAN
LANG_SERBO_CROATIAN,
#else
@@ -878,7 +882,7 @@ LANG_SERBO_CROATIAN,
#endif
0,0,
},
-{"si","singhalese",0,&charset[0],0,
+{"si","singhalese",0,&lc_charsets[0],0,
#ifdef LANG_SINGHALESE
LANG_SINGHALESE,
#else
@@ -886,7 +890,7 @@ LANG_SINGHALESE,
#endif
0,0,
},
-{"sk","slovak","slk|slo",&charset[1],0,
+{"sk","slovak","slk|slo",&lc_charsets[1],0,
#ifdef LANG_SLOVAK
LANG_SLOVAK,
#else
@@ -894,7 +898,7 @@ LANG_SLOVAK,
#endif
0,0,
},
-{"sl","slovenian","slv",&charset[1],0,
+{"sl","slovenian","slv",&lc_charsets[1],0,
#ifdef LANG_SLOVENIAN
LANG_SLOVENIAN,
#else
@@ -902,7 +906,7 @@ LANG_SLOVENIAN,
#endif
0,0,
},
-{"sm","samoan",0,&charset[0],0,
+{"sm","samoan",0,&lc_charsets[0],0,
#ifdef LANG_SAMOAN
LANG_SAMOAN,
#else
@@ -910,7 +914,7 @@ LANG_SAMOAN,
#endif
0,0,
},
-{"sn","shona",0,&charset[0],0,
+{"sn","shona",0,&lc_charsets[0],0,
#ifdef LANG_SHONA
LANG_SHONA,
#else
@@ -918,7 +922,7 @@ LANG_SHONA,
#endif
0,0,
},
-{"so","somali",0,&charset[0],0,
+{"so","somali",0,&lc_charsets[0],0,
#ifdef LANG_SOMALI
LANG_SOMALI,
#else
@@ -926,7 +930,7 @@ LANG_SOMALI,
#endif
0,0,
},
-{"sq","albanian","sqi|alb",&charset[0],0,
+{"sq","albanian","sqi|alb",&lc_charsets[0],0,
#ifdef LANG_ALBANIAN
LANG_ALBANIAN,
#else
@@ -934,7 +938,7 @@ LANG_ALBANIAN,
#endif
0,0,
},
-{"sr","serbian","srp",&charset[1],0,
+{"sr","serbian","srp",&lc_charsets[1],0,
#ifdef LANG_SERBIAN
LANG_SERBIAN,
#else
@@ -942,7 +946,7 @@ LANG_SERBIAN,
#endif
0,0,
},
-{"ss","siswati",0,&charset[0],0,
+{"ss","siswati",0,&lc_charsets[0],0,
#ifdef LANG_SISWATI
LANG_SISWATI,
#else
@@ -950,7 +954,7 @@ LANG_SISWATI,
#endif
0,0,
},
-{"st","sesotho",0,&charset[0],0,
+{"st","sesotho",0,&lc_charsets[0],0,
#ifdef LANG_SESOTHO
LANG_SESOTHO,
#else
@@ -958,7 +962,7 @@ LANG_SESOTHO,
#endif
0,0,
},
-{"su","sudanese",0,&charset[0],0,
+{"su","sudanese",0,&lc_charsets[0],0,
#ifdef LANG_SUDANESE
LANG_SUDANESE,
#else
@@ -966,7 +970,7 @@ LANG_SUDANESE,
#endif
0,0,
},
-{"sv","swedish","swe",&charset[0],0,
+{"sv","swedish","swe",&lc_charsets[0],0,
#ifdef LANG_SWEDISH
LANG_SWEDISH,
#else
@@ -974,7 +978,7 @@ LANG_SWEDISH,
#endif
0,0,
},
-{"sw","swahili","swa",&charset[0],0,
+{"sw","swahili","swa",&lc_charsets[0],0,
#ifdef LANG_SWAHILI
LANG_SWAHILI,
#else
@@ -982,7 +986,7 @@ LANG_SWAHILI,
#endif
0,0,
},
-{"ta","tamil",0,&charset[0],0,
+{"ta","tamil",0,&lc_charsets[0],0,
#ifdef LANG_TAMIL
LANG_TAMIL,
#else
@@ -990,7 +994,7 @@ LANG_TAMIL,
#endif
0,0,
},
-{"te","telugu",0,&charset[0],0,
+{"te","telugu",0,&lc_charsets[0],0,
#ifdef LANG_TELUGU
LANG_TELUGU,
#else
@@ -998,7 +1002,7 @@ LANG_TELUGU,
#endif
0,0,
},
-{"tg","tajik",0,&charset[0],0,
+{"tg","tajik",0,&lc_charsets[0],0,
#ifdef LANG_TAJIK
LANG_TAJIK,
#else
@@ -1006,7 +1010,7 @@ LANG_TAJIK,
#endif
0,0,
},
-{"th","thai","tha",&charset[0],0,
+{"th","thai","tha",&lc_charsets[0],0,
#ifdef LANG_THAI
LANG_THAI,
#else
@@ -1014,7 +1018,7 @@ LANG_THAI,
#endif
0,0,
},
-{"ti","tigrinya",0,&charset[0],0,
+{"ti","tigrinya",0,&lc_charsets[0],0,
#ifdef LANG_TIGRINYA
LANG_TIGRINYA,
#else
@@ -1022,7 +1026,7 @@ LANG_TIGRINYA,
#endif
0,0,
},
-{"tk","turkmen",0,&charset[0],0,
+{"tk","turkmen",0,&lc_charsets[0],0,
#ifdef LANG_TURKMEN
LANG_TURKMEN,
#else
@@ -1030,7 +1034,7 @@ LANG_TURKMEN,
#endif
0,0,
},
-{"tl","tagalog",0,&charset[0],0,
+{"tl","tagalog",0,&lc_charsets[0],0,
#ifdef LANG_TAGALOG
LANG_TAGALOG,
#else
@@ -1038,7 +1042,7 @@ LANG_TAGALOG,
#endif
0,0,
},
-{"tn","setswana",0,&charset[0],0,
+{"tn","setswana",0,&lc_charsets[0],0,
#ifdef LANG_SETSWANA
LANG_SETSWANA,
#else
@@ -1046,7 +1050,7 @@ LANG_SETSWANA,
#endif
0,0,
},
-{"to","tonga",0,&charset[0],0,
+{"to","tonga",0,&lc_charsets[0],0,
#ifdef LANG_TONGA
LANG_TONGA,
#else
@@ -1054,7 +1058,7 @@ LANG_TONGA,
#endif
0,0,
},
-{"tr","turkish","tur",&charset[8],0,
+{"tr","turkish","tur",&lc_charsets[8],0,
#ifdef LANG_TURKISH
LANG_TURKISH,
#else
@@ -1062,7 +1066,7 @@ LANG_TURKISH,
#endif
0,0,
},
-{"ts","tsonga",0,&charset[0],0,
+{"ts","tsonga",0,&lc_charsets[0],0,
#ifdef LANG_TSONGA
LANG_TSONGA,
#else
@@ -1070,7 +1074,7 @@ LANG_TSONGA,
#endif
0,0,
},
-{"tt","tatar","tat",&charset[0],0,
+{"tt","tatar","tat",&lc_charsets[0],0,
#ifdef LANG_TATAR
LANG_TATAR,
#else
@@ -1078,7 +1082,7 @@ LANG_TATAR,
#endif
0,0,
},
-{"tw","chinese-traditional","cht",&charset[0],0,
+{"tw","chinese-traditional","cht",&lc_charsets[0],0,
#ifdef LANG_CHINESE_TRADITIONAL
LANG_CHINESE_TRADITIONAL,
#else
@@ -1086,7 +1090,7 @@ LANG_CHINESE_TRADITIONAL,
#endif
0,0,
},
-{"uk","ukrainian","ukr",&charset[4],0,
+{"uk","ukrainian","ukr",&lc_charsets[4],0,
#ifdef LANG_UKRAINIAN
LANG_UKRAINIAN,
#else
@@ -1094,7 +1098,7 @@ LANG_UKRAINIAN,
#endif
0,0,
},
-{"ur","urdu",0,&charset[0],0,
+{"ur","urdu",0,&lc_charsets[0],0,
#ifdef LANG_URDU
LANG_URDU,
#else
@@ -1102,7 +1106,7 @@ LANG_URDU,
#endif
0,0,
},
-{"uz","uzbek","uzb",&charset[0],0,
+{"uz","uzbek","uzb",&lc_charsets[0],0,
#ifdef LANG_UZBEK
LANG_UZBEK,
#else
@@ -1110,7 +1114,7 @@ LANG_UZBEK,
#endif
0,0,
},
-{"vi","vietnamese",0,&charset[0],0,
+{"vi","vietnamese",0,&lc_charsets[0],0,
#ifdef LANG_VIETNAMESE
LANG_VIETNAMESE,
#else
@@ -1118,7 +1122,7 @@ LANG_VIETNAMESE,
#endif
0,0,
},
-{"vo","volapuk",0,&charset[0],0,
+{"vo","volapuk",0,&lc_charsets[0],0,
#ifdef LANG_VOLAPUK
LANG_VOLAPUK,
#else
@@ -1126,7 +1130,7 @@ LANG_VOLAPUK,
#endif
0,0,
},
-{"wo","wolof",0,&charset[0],0,
+{"wo","wolof",0,&lc_charsets[0],0,
#ifdef LANG_WOLOF
LANG_WOLOF,
#else
@@ -1134,7 +1138,7 @@ LANG_WOLOF,
#endif
0,0,
},
-{"xh","xhosa",0,&charset[0],0,
+{"xh","xhosa",0,&lc_charsets[0],0,
#ifdef LANG_XHOSA
LANG_XHOSA,
#else
@@ -1142,7 +1146,7 @@ LANG_XHOSA,
#endif
0,0,
},
-{"yo","yoruba",0,&charset[0],0,
+{"yo","yoruba",0,&lc_charsets[0],0,
#ifdef LANG_YORUBA
LANG_YORUBA,
#else
@@ -1150,7 +1154,7 @@ LANG_YORUBA,
#endif
0,0,
},
-{"zh","chinese-simplified","zho|chi|chs",&charset[0],0,
+{"zh","chinese-simplified","zho|chi|chs",&lc_charsets[0],0,
#ifdef LANG_CHINESE_SIMPLIFIED
LANG_CHINESE_SIMPLIFIED,
#else
@@ -1158,7 +1162,7 @@ LANG_CHINESE_SIMPLIFIED,
#endif
0,0,
},
-{"zu","zulu",0,&charset[0],0,
+{"zu","zulu",0,&lc_charsets[0],0,
#ifdef LANG_ZULU
LANG_ZULU,
#else
@@ -1169,10 +1173,10 @@ LANG_ZULU,
0
};
-static const Lc_territory_t territory[] =
+const Lc_territory_t lc_territories[] =
{
-{"C","C",LC_default,0,&language[0],0,0,0,0,0,0,0,},
-{"debug","debug",LC_debug,0,&language[1],0,0,0,0,0,0,0,},
+{"C","C",LC_default,0,&lc_languages[0],0,0,0,0,0,0,0,},
+{"debug","debug",LC_debug,0,&lc_languages[1],0,0,0,0,0,0,0,},
{"al","albania",0,
#ifdef CTRY_ALBANIA
CTRY_ALBANIA,
@@ -1187,7 +1191,7 @@ CTRY_NETHERLANDS_ANTILLES,
#else
0,
#endif
-&language[86],0,0,0,
+&lc_languages[86],0,0,0,
#ifdef SUBLANG_DUTCH_NETHERLANDS_ANTILLES
SUBLANG_DUTCH_NETHERLANDS_ANTILLES,
#else
@@ -1201,7 +1205,7 @@ CTRY_ARGENTINA,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_ARGENTINA
SUBLANG_SPANISH_ARGENTINA,
#else
@@ -1215,7 +1219,7 @@ CTRY_AUSTRIA,
#else
0,
#endif
-&language[23],0,0,0,
+&lc_languages[23],0,0,0,
#ifdef SUBLANG_GERMAN_AUSTRIA
SUBLANG_GERMAN_AUSTRIA,
#else
@@ -1229,7 +1233,7 @@ CTRY_AUSTRALIA,
#else
0,
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_AUSTRALIA
SUBLANG_ENGLISH_AUSTRALIA,
#else
@@ -1251,7 +1255,7 @@ CTRY_BELGIUM,
#else
0,
#endif
-&language[86],&language[35],&language[23],0,
+&lc_languages[86],&lc_languages[35],&lc_languages[23],0,
#ifdef SUBLANG_DUTCH_BELGIUM
SUBLANG_DUTCH_BELGIUM,
#else
@@ -1277,7 +1281,7 @@ CTRY_BULGARIA,
#else
0,
#endif
-&language[12],0,0,0,
+&lc_languages[12],0,0,0,
#ifdef SUBLANG_BULGARIAN_BULGARIA
SUBLANG_BULGARIAN_BULGARIA,
#else
@@ -1291,7 +1295,7 @@ CTRY_BRUNEI_DARUSSALAM,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_BRUNEI_DARUSSALAM
SUBLANG_ARABIC_BRUNEI_DARUSSALAM,
#else
@@ -1305,7 +1309,7 @@ CTRY_BOLIVIA,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_BOLIVIA
SUBLANG_SPANISH_BOLIVIA,
#else
@@ -1319,7 +1323,7 @@ CTRY_BRAZIL,
#else
0,
#endif
-&language[95],0,0,0,
+&lc_languages[95],0,0,0,
#ifdef SUBLANG_PORTUGUESE_BRAZIL
SUBLANG_PORTUGUESE_BRAZIL,
#else
@@ -1333,7 +1337,7 @@ CTRY_BOTSWANA,
#else
0,
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_BOTSWANA
SUBLANG_ENGLISH_BOTSWANA,
#else
@@ -1347,7 +1351,7 @@ CTRY_BELARUS,
#else
0,
#endif
-&language[100],0,0,0,
+&lc_languages[100],0,0,0,
#ifdef SUBLANG_RUSSIAN_BELARUS
SUBLANG_RUSSIAN_BELARUS,
#else
@@ -1361,7 +1365,7 @@ CTRY_BELIZE,
#else
0,
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_BELIZE
SUBLANG_ENGLISH_BELIZE,
#else
@@ -1375,7 +1379,7 @@ CTRY_CANADA,
#else
0,
#endif
-&language[26],&language[35],0,0,
+&lc_languages[26],&lc_languages[35],0,0,
#ifdef SUBLANG_ENGLISH_CANADA
SUBLANG_ENGLISH_CANADA,
#else
@@ -1395,7 +1399,7 @@ CTRY_SWITZERLAND,
#else
0,
#endif
-&language[35],&language[23],&language[54],0,
+&lc_languages[35],&lc_languages[23],&lc_languages[54],0,
#ifdef SUBLANG_FRENCH_SWITZERLAND
SUBLANG_FRENCH_SWITZERLAND,
#else
@@ -1421,7 +1425,7 @@ CTRY_CHILE,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_CHILE
SUBLANG_SPANISH_CHILE,
#else
@@ -1435,7 +1439,7 @@ CTRY_CHINA,
#else
0,
#endif
-&language[140],0,0,0,
+&lc_languages[140],0,0,0,
#ifdef SUBLANG_CHINESE_SIMPLIFIED_CHINA
SUBLANG_CHINESE_SIMPLIFIED_CHINA,
#else
@@ -1449,7 +1453,7 @@ CTRY_COLOMBIA,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_COLOMBIA
SUBLANG_SPANISH_COLOMBIA,
#else
@@ -1463,7 +1467,7 @@ CTRY_COSTA_RICA,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_COSTA_RICA
SUBLANG_SPANISH_COSTA_RICA,
#else
@@ -1477,7 +1481,7 @@ CTRY_CZECH_REPUBLIC,
#else
0,
#endif
-&language[20],0,0,0,
+&lc_languages[20],0,0,0,
#ifdef SUBLANG_CZECH_CZECH_REPUBLIC
SUBLANG_CZECH_CZECH_REPUBLIC,
#else
@@ -1491,7 +1495,7 @@ CTRY_GERMANY,
#else
0,
#endif
-&language[23],0,0,0,
+&lc_languages[23],0,0,0,
#ifdef SUBLANG_GERMAN_GERMANY
SUBLANG_GERMAN_GERMANY,
#else
@@ -1505,7 +1509,7 @@ CTRY_DENMARK,
#else
0,
#endif
-&language[22],&language[26],0,0,
+&lc_languages[22],&lc_languages[26],0,0,
#ifdef SUBLANG_DANISH_DENMARK
SUBLANG_DANISH_DENMARK,
#else
@@ -1525,7 +1529,7 @@ CTRY_DOMINICAN_REPUBLIC,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_DOMINICAN_REPUBLIC
SUBLANG_SPANISH_DOMINICAN_REPUBLIC,
#else
@@ -1547,7 +1551,7 @@ CTRY_ECUADOR,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_ECUADOR
SUBLANG_SPANISH_ECUADOR,
#else
@@ -1561,7 +1565,7 @@ CTRY_ESTONIA,
#else
0,
#endif
-&language[29],0,0,0,
+&lc_languages[29],0,0,0,
#ifdef SUBLANG_ESTONIAN_ESTONIA
SUBLANG_ESTONIAN_ESTONIA,
#else
@@ -1575,7 +1579,7 @@ CTRY_EGYPT,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_EGYPT
SUBLANG_ARABIC_EGYPT,
#else
@@ -1589,7 +1593,7 @@ CTRY_SPAIN,
#else
0,
#endif
-&language[28],&language[18],&language[30],&language[39],
+&lc_languages[28],&lc_languages[18],&lc_languages[30],&lc_languages[39],
#ifdef SUBLANG_SPANISH_SPAIN
SUBLANG_SPANISH_SPAIN,
#else
@@ -1621,7 +1625,7 @@ CTRY_FINLAND,
#else
0,
#endif
-&language[117],0,0,0,
+&lc_languages[117],0,0,0,
#ifdef SUBLANG_SWEDISH_FINLAND
SUBLANG_SWEDISH_FINLAND,
#else
@@ -1635,7 +1639,7 @@ CTRY_FAROE_ISLANDS,
#else
0,
#endif
-&language[34],0,0,0,
+&lc_languages[34],0,0,0,
#ifdef SUBLANG_FAEROESE_FAROE_ISLANDS
SUBLANG_FAEROESE_FAROE_ISLANDS,
#else
@@ -1649,7 +1653,7 @@ CTRY_FRANCE,
#else
0,
#endif
-&language[35],0,0,0,
+&lc_languages[35],0,0,0,
#ifdef SUBLANG_FRENCH_FRANCE
SUBLANG_FRENCH_FRANCE,
#else
@@ -1671,7 +1675,7 @@ CTRY_ENGLAND,
#endif
#endif
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_UNITED_KINGDOM
SUBLANG_ENGLISH_UNITED_KINGDOM,
#else
@@ -1693,7 +1697,7 @@ CTRY_GREENLAND,
#else
0,
#endif
-&language[61],0,0,0,
+&lc_languages[61],0,0,0,
#ifdef SUBLANG_GREENLANDIC_GREENLAND
SUBLANG_GREENLANDIC_GREENLAND,
#else
@@ -1707,7 +1711,7 @@ CTRY_GREECE,
#else
0,
#endif
-&language[25],0,0,0,
+&lc_languages[25],0,0,0,
#ifdef SUBLANG_GREEK_GREECE
SUBLANG_GREEK_GREECE,
#else
@@ -1721,7 +1725,7 @@ CTRY_GUATEMALA,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_GUATEMALA
SUBLANG_SPANISH_GUATEMALA,
#else
@@ -1735,7 +1739,7 @@ CTRY_HONG_KONG,
#else
0,
#endif
-&language[140],0,0,0,
+&lc_languages[140],0,0,0,
#ifdef SUBLANG_CHINESE_SIMPLIFIED_HONG_KONG
SUBLANG_CHINESE_SIMPLIFIED_HONG_KONG,
#else
@@ -1749,7 +1753,7 @@ CTRY_HONDURAS,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_HONDURAS
SUBLANG_SPANISH_HONDURAS,
#else
@@ -1763,7 +1767,7 @@ CTRY_CROATIA,
#else
0,
#endif
-&language[45],0,0,0,
+&lc_languages[45],0,0,0,
#ifdef SUBLANG_CROATIAN_CROATIA
SUBLANG_CROATIAN_CROATIA,
#else
@@ -1777,7 +1781,7 @@ CTRY_HUNGARY,
#else
0,
#endif
-&language[46],0,0,0,
+&lc_languages[46],0,0,0,
#ifdef SUBLANG_HUNGARIAN_HUNGARY
SUBLANG_HUNGARIAN_HUNGARY,
#else
@@ -1791,7 +1795,7 @@ CTRY_INDONESIA,
#else
0,
#endif
-&language[49],0,0,0,
+&lc_languages[49],0,0,0,
#ifdef SUBLANG_INDONESIAN_INDONESIA
SUBLANG_INDONESIAN_INDONESIA,
#else
@@ -1805,7 +1809,7 @@ CTRY_IRELAND,
#else
0,
#endif
-&language[26],&language[37],0,0,
+&lc_languages[26],&lc_languages[37],0,0,
#ifdef SUBLANG_ENGLISH_IRELAND
SUBLANG_ENGLISH_IRELAND,
#else
@@ -1825,7 +1829,7 @@ CTRY_ISRAEL,
#else
0,
#endif
-&language[43],0,0,0,
+&lc_languages[43],0,0,0,
#ifdef SUBLANG_HEBREW_ISRAEL
SUBLANG_HEBREW_ISRAEL,
#else
@@ -1839,7 +1843,7 @@ CTRY_IRAQ,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_IRAQ
SUBLANG_ARABIC_IRAQ,
#else
@@ -1853,7 +1857,7 @@ CTRY_ICELAND,
#else
0,
#endif
-&language[53],0,0,0,
+&lc_languages[53],0,0,0,
#ifdef SUBLANG_ICELANDIC_ICELAND
SUBLANG_ICELANDIC_ICELAND,
#else
@@ -1867,7 +1871,7 @@ CTRY_ITALY,
#else
0,
#endif
-&language[54],0,0,0,
+&lc_languages[54],0,0,0,
#ifdef SUBLANG_ITALIAN_ITALY
SUBLANG_ITALIAN_ITALY,
#else
@@ -1881,7 +1885,7 @@ CTRY_JAMAICA,
#else
0,
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_JAMAICA
SUBLANG_ENGLISH_JAMAICA,
#else
@@ -1895,7 +1899,7 @@ CTRY_JORDAN,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_JORDAN
SUBLANG_ARABIC_JORDAN,
#else
@@ -1909,7 +1913,7 @@ CTRY_JAPAN,
#else
0,
#endif
-&language[56],0,0,0,
+&lc_languages[56],0,0,0,
#ifdef SUBLANG_JAPANESE_JAPAN
SUBLANG_JAPANESE_JAPAN,
#else
@@ -1931,7 +1935,7 @@ CTRY_SOUTH_KOREA,
#else
0,
#endif
-&language[64],0,0,0,
+&lc_languages[64],0,0,0,
#ifdef SUBLANG_KOREAN_SOUTH_KOREA
SUBLANG_KOREAN_SOUTH_KOREA,
#else
@@ -1945,7 +1949,7 @@ CTRY_KUWAIT,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_KUWAIT
SUBLANG_ARABIC_KUWAIT,
#else
@@ -1959,7 +1963,7 @@ CTRY_LEBANON,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_LEBANON
SUBLANG_ARABIC_LEBANON,
#else
@@ -1973,7 +1977,7 @@ CTRY_LIECHTENSTEIN,
#else
0,
#endif
-&language[23],&language[35],0,0,
+&lc_languages[23],&lc_languages[35],0,0,
#ifdef SUBLANG_GERMAN_LIECHTENSTEIN
SUBLANG_GERMAN_LIECHTENSTEIN,
#else
@@ -1993,7 +1997,7 @@ CTRY_LITHUANIA,
#else
0,
#endif
-&language[71],0,0,0,
+&lc_languages[71],0,0,0,
#ifdef SUBLANG_LITHUANIAN_LITHUANIA
SUBLANG_LITHUANIAN_LITHUANIA,
#else
@@ -2007,7 +2011,7 @@ CTRY_LUXEMBOURG,
#else
0,
#endif
-&language[23],&language[35],0,0,
+&lc_languages[23],&lc_languages[35],0,0,
#ifdef SUBLANG_GERMAN_LUXEMBOURG
SUBLANG_GERMAN_LUXEMBOURG,
#else
@@ -2027,7 +2031,7 @@ CTRY_LATVIA,
#else
0,
#endif
-&language[72],0,0,0,
+&lc_languages[72],0,0,0,
#ifdef SUBLANG_LATVIAN_LATVIA
SUBLANG_LATVIAN_LATVIA,
#else
@@ -2041,7 +2045,7 @@ CTRY_LIBYA,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_LIBYA
SUBLANG_ARABIC_LIBYA,
#else
@@ -2055,7 +2059,7 @@ CTRY_MOROCCO,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_MOROCCO
SUBLANG_ARABIC_MOROCCO,
#else
@@ -2069,7 +2073,7 @@ CTRY_MACEDONIA,
#else
0,
#endif
-&language[75],0,0,0,
+&lc_languages[75],0,0,0,
#ifdef SUBLANG_MACEDONIAN_MACEDONIA
SUBLANG_MACEDONIAN_MACEDONIA,
#else
@@ -2083,7 +2087,7 @@ CTRY_MACAU,
#else
0,
#endif
-&language[140],0,0,0,
+&lc_languages[140],0,0,0,
#ifdef SUBLANG_CHINESE_SIMPLIFIED_MACAU
SUBLANG_CHINESE_SIMPLIFIED_MACAU,
#else
@@ -2097,7 +2101,7 @@ CTRY_MEXICO,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_MEXICO
SUBLANG_SPANISH_MEXICO,
#else
@@ -2119,7 +2123,7 @@ CTRY_NICARAGUA,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_NICARAGUA
SUBLANG_SPANISH_NICARAGUA,
#else
@@ -2133,7 +2137,7 @@ CTRY_NETHERLANDS,
#else
0,
#endif
-&language[86],0,0,0,
+&lc_languages[86],0,0,0,
#ifdef SUBLANG_DUTCH_NETHERLANDS
SUBLANG_DUTCH_NETHERLANDS,
#else
@@ -2147,7 +2151,7 @@ CTRY_NORWAY,
#else
0,
#endif
-&language[84],&language[88],&language[87],0,
+&lc_languages[84],&lc_languages[88],&lc_languages[87],0,
#ifdef SUBLANG_NORWEGIAN_BOKMAL_NORWAY
SUBLANG_NORWEGIAN_BOKMAL_NORWAY,
#else
@@ -2173,7 +2177,7 @@ CTRY_NEW_ZEALAND,
#else
0,
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_NEW_ZEALAND
SUBLANG_ENGLISH_NEW_ZEALAND,
#else
@@ -2187,7 +2191,7 @@ CTRY_OMAN,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_OMAN
SUBLANG_ARABIC_OMAN,
#else
@@ -2201,7 +2205,7 @@ CTRY_PANAMA,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_PANAMA
SUBLANG_SPANISH_PANAMA,
#else
@@ -2215,7 +2219,7 @@ CTRY_PERU,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_PERU
SUBLANG_SPANISH_PERU,
#else
@@ -2229,7 +2233,7 @@ CTRY_POLAND,
#else
0,
#endif
-&language[93],0,0,0,
+&lc_languages[93],0,0,0,
#ifdef SUBLANG_POLISH_POLAND
SUBLANG_POLISH_POLAND,
#else
@@ -2243,7 +2247,7 @@ CTRY_PUERTO_RICO,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_PUERTO_RICO
SUBLANG_SPANISH_PUERTO_RICO,
#else
@@ -2257,7 +2261,7 @@ CTRY_PORTUGAL,
#else
0,
#endif
-&language[95],0,0,0,
+&lc_languages[95],0,0,0,
#ifdef SUBLANG_PORTUGUESE_PORTUGAL
SUBLANG_PORTUGUESE_PORTUGAL,
#else
@@ -2271,7 +2275,7 @@ CTRY_PARAGUAY,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_PARAGUAY
SUBLANG_SPANISH_PARAGUAY,
#else
@@ -2285,7 +2289,7 @@ CTRY_ROMANIA,
#else
0,
#endif
-&language[99],0,0,0,
+&lc_languages[99],0,0,0,
#ifdef SUBLANG_ROMANIAN_ROMANIA
SUBLANG_ROMANIAN_ROMANIA,
#else
@@ -2299,7 +2303,7 @@ CTRY_RUSSIA,
#else
0,
#endif
-&language[100],0,0,0,
+&lc_languages[100],0,0,0,
#ifdef SUBLANG_RUSSIAN_RUSSIA
SUBLANG_RUSSIAN_RUSSIA,
#else
@@ -2313,7 +2317,7 @@ CTRY_SAUDI_ARABIA,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_SAUDI_ARABIA
SUBLANG_ARABIC_SAUDI_ARABIA,
#else
@@ -2327,7 +2331,7 @@ CTRY_SWEDEN,
#else
0,
#endif
-&language[117],0,0,0,
+&lc_languages[117],0,0,0,
#ifdef SUBLANG_SWEDISH_SWEDEN
SUBLANG_SWEDISH_SWEDEN,
#else
@@ -2341,7 +2345,7 @@ CTRY_SINGAPORE,
#else
0,
#endif
-&language[140],0,0,0,
+&lc_languages[140],0,0,0,
#ifdef SUBLANG_CHINESE_SIMPLIFIED_SINGAPORE
SUBLANG_CHINESE_SIMPLIFIED_SINGAPORE,
#else
@@ -2355,7 +2359,7 @@ CTRY_SLOVENIA,
#else
0,
#endif
-&language[108],0,0,0,
+&lc_languages[108],0,0,0,
#ifdef SUBLANG_SLOVENIAN_SLOVENIA
SUBLANG_SLOVENIAN_SLOVENIA,
#else
@@ -2369,7 +2373,7 @@ CTRY_SLOVAKIA,
#else
0,
#endif
-&language[107],0,0,0,
+&lc_languages[107],0,0,0,
#ifdef SUBLANG_SLOVAK_SLOVAKIA
SUBLANG_SLOVAK_SLOVAKIA,
#else
@@ -2383,7 +2387,7 @@ CTRY_SERBIA,
#else
0,
#endif
-&language[113],0,0,0,
+&lc_languages[113],0,0,0,
#ifdef SUBLANG_SERBIAN_SERBIA
SUBLANG_SERBIAN_SERBIA,
#else
@@ -2397,7 +2401,7 @@ CTRY_EL_SALVADOR,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_EL_SALVADOR
SUBLANG_SPANISH_EL_SALVADOR,
#else
@@ -2411,7 +2415,7 @@ CTRY_SYRIA,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_SYRIA
SUBLANG_ARABIC_SYRIA,
#else
@@ -2425,7 +2429,7 @@ CTRY_THAILAND,
#else
0,
#endif
-&language[122],0,0,0,
+&lc_languages[122],0,0,0,
#ifdef SUBLANG_THAI_THAILAND
SUBLANG_THAI_THAILAND,
#else
@@ -2439,7 +2443,7 @@ CTRY_TUNISIA,
#else
0,
#endif
-&language[6],0,0,0,
+&lc_languages[6],0,0,0,
#ifdef SUBLANG_ARABIC_TUNISIA
SUBLANG_ARABIC_TUNISIA,
#else
@@ -2453,7 +2457,7 @@ CTRY_TURKEY,
#else
0,
#endif
-&language[128],0,0,0,
+&lc_languages[128],0,0,0,
#ifdef SUBLANG_TURKISH_TURKEY
SUBLANG_TURKISH_TURKEY,
#else
@@ -2467,7 +2471,7 @@ CTRY_TRINIDAD_TOBAGO,
#else
0,
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_TRINIDAD_TOBAGO
SUBLANG_ENGLISH_TRINIDAD_TOBAGO,
#else
@@ -2481,7 +2485,7 @@ CTRY_TAIWAN,
#else
0,
#endif
-&language[131],0,0,0,
+&lc_languages[131],0,0,0,
#ifdef SUBLANG_CHINESE_TRADITIONAL_TAIWAN
SUBLANG_CHINESE_TRADITIONAL_TAIWAN,
#else
@@ -2495,7 +2499,7 @@ CTRY_UKRAINE,
#else
0,
#endif
-&language[132],&language[100],0,0,
+&lc_languages[132],&lc_languages[100],0,0,
#ifdef SUBLANG_UKRAINIAN_UKRAINE
SUBLANG_UKRAINIAN_UKRAINE,
#else
@@ -2515,7 +2519,7 @@ CTRY_UNITED_KINGDOM,
#else
0,
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_UNITED_KINGDOM
SUBLANG_ENGLISH_UNITED_KINGDOM,
#else
@@ -2533,7 +2537,7 @@ CTRY_USA,
0,
#endif
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_UNITED_STATES
SUBLANG_ENGLISH_UNITED_STATES,
#else
@@ -2551,7 +2555,7 @@ CTRY_URUGUAY,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_URUGUAY
SUBLANG_SPANISH_URUGUAY,
#else
@@ -2565,7 +2569,7 @@ CTRY_VENEZUELA,
#else
0,
#endif
-&language[28],0,0,0,
+&lc_languages[28],0,0,0,
#ifdef SUBLANG_SPANISH_VENEZUELA
SUBLANG_SPANISH_VENEZUELA,
#else
@@ -2579,7 +2583,7 @@ CTRY_YUGOSLAVIA,
#else
0,
#endif
-&language[113],0,0,0,
+&lc_languages[113],0,0,0,
#ifdef SUBLANG_SERBIAN_YUGOSLAVIA
SUBLANG_SERBIAN_YUGOSLAVIA,
#else
@@ -2593,7 +2597,7 @@ CTRY_SOUTH_AFRICA,
#else
0,
#endif
-&language[4],0,0,0,
+&lc_languages[4],0,0,0,
#ifdef SUBLANG_AFRIKAANS_SOUTH_AFRICA
SUBLANG_AFRIKAANS_SOUTH_AFRICA,
#else
@@ -2607,7 +2611,7 @@ CTRY_ZIMBABWE,
#else
0,
#endif
-&language[26],0,0,0,
+&lc_languages[26],0,0,0,
#ifdef SUBLANG_ENGLISH_ZIMBABWE
SUBLANG_ENGLISH_ZIMBABWE,
#else
@@ -2618,13 +2622,13 @@ SUBLANG_ENGLISH_ZIMBABWE,
0
};
-static const Lc_map_t map[] =
+const Lc_map_t lc_maps[] =
{
-{"enu",&language[26],&territory[93],&charset[0],0},
-{"enz",&language[26],&territory[68],&charset[0],0},
-{"esm",&language[28],&territory[63],&charset[0],0},
-{"esn",&language[28],&territory[30],&charset[0],&attribute_es[1]},
-{"esp",&language[28],&territory[30],&charset[0],&attribute_es[0]},
-{"usa",&language[26],&territory[93],&charset[0],0},
+{"enu",&lc_languages[26],&lc_territories[93],&lc_charsets[0],0},
+{"enz",&lc_languages[26],&lc_territories[68],&lc_charsets[0],0},
+{"esm",&lc_languages[28],&lc_territories[63],&lc_charsets[0],0},
+{"esn",&lc_languages[28],&lc_territories[30],&lc_charsets[0],&attribute_es[1]},
+{"esp",&lc_languages[28],&lc_territories[30],&lc_charsets[0],&attribute_es[0]},
+{"usa",&lc_languages[26],&lc_territories[93],&lc_charsets[0],0},
0
};
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/preroot.h b/usr/src/lib/libast/sparcv9/src/lib/libast/preroot.h
index 508e3aada4..1f65b6c24d 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/preroot.h
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/preroot.h
@@ -1,4 +1,4 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/preroot.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/preroot.sh by iffe version 2008-01-31 : : */
#ifndef _def_preroot_ast
#define _def_preroot_ast 1
#define _sys_types 1 /* #include <sys/types.h> ok */
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/sig.h b/usr/src/lib/libast/sparcv9/src/lib/libast/sig.h
index 40e930cd93..0af59f7f3a 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/sig.h
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/sig.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/sig.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/sig.sh by iffe version 2008-01-31 : : */
#ifndef _def_sig_ast
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/tmx.h b/usr/src/lib/libast/sparcv9/src/lib/libast/tmx.h
index 11aa0d9b2b..d08369abf8 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/tmx.h
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/tmx.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/tmx by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/tmx by iffe version 2008-01-31 : : */
#ifndef _TMX_H
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libast/sparcv9/src/lib/libast/tv.h b/usr/src/lib/libast/sparcv9/src/lib/libast/tv.h
index 7f91a2883e..765511125b 100644
--- a/usr/src/lib/libast/sparcv9/src/lib/libast/tv.h
+++ b/usr/src/lib/libast/sparcv9/src/lib/libast/tv.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libast/features/tv by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libast/features/tv by iffe version 2008-01-31 : : */
#ifndef _TV_H
#if !defined(__PROTO__)
diff --git a/usr/src/lib/libcmd/Makefile b/usr/src/lib/libcmd/Makefile
index 022938b848..45c808effe 100644
--- a/usr/src/lib/libcmd/Makefile
+++ b/usr/src/lib/libcmd/Makefile
@@ -18,14 +18,14 @@
#
# CDDL HEADER END
#
+
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
-SHELL=/usr/bin/ksh
+
+SHELL=/usr/bin/ksh93
include ../Makefile.lib
diff --git a/usr/src/lib/libcmd/Makefile.com b/usr/src/lib/libcmd/Makefile.com
index 388e72a927..2b9873103c 100644
--- a/usr/src/lib/libcmd/Makefile.com
+++ b/usr/src/lib/libcmd/Makefile.com
@@ -18,14 +18,14 @@
#
# CDDL HEADER END
#
+
#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
-SHELL=/usr/bin/ksh
+
+SHELL=/usr/bin/ksh93
LIBRARY = libcmd.a
VERS = .1
@@ -33,6 +33,7 @@ OBJECTS = \
basename.o \
cat.o \
chgrp.o \
+ cksum.o \
chmod.o \
chown.o \
cmdinit.o \
@@ -52,16 +53,20 @@ OBJECTS = \
join.o \
ln.o \
logname.o \
+ md5sum.o \
mkdir.o \
mkfifo.o \
mv.o \
paste.o \
pathchk.o \
+ pids.o \
+ readlink.o \
rev.o \
revlib.o \
rm.o \
rmdir.o \
stty.o \
+ sum.o \
sync.o \
tail.o \
tee.o \
@@ -79,13 +84,19 @@ include ../../Makefile.lib
# automated code updates easier.
MAPFILES= ../mapfile-vers
-# Set common AST build flags (e.g., needed to support the math stuff).
+# Set common AST build flags (e.g. C99/XPG6, needed to support the math stuff)
include ../../../Makefile.ast
LIBS = $(DYNLIB) $(LINTLIB)
$(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC)
-LDLIBS += -last -lsocket -lnsl -lc
+
+LDLIBS += \
+ -lsum \
+ -last \
+ -lsocket \
+ -lnsl \
+ -lc
SRCDIR = ../common
@@ -108,16 +119,14 @@ CPPFLAGS = \
'-DUSAGE_LICENSE=\
"[-author?Glenn Fowler <gsf@research.att.com>]"\
"[-author?David Korn <dgk@research.att.com>]"\
- "[-copyright?Copyright (c) 1992-2007 AT&T Knowledge Ventures]"\
+ "[-copyright?Copyright (c) 1992-2008 AT&T Intellectual Property]"\
"[-license?http://www.opensource.org/licenses/cpl1.0.txt]"\
"[--catalog?libcmd]"'
CFLAGS += \
- $(CCVERBOSE) \
- -xstrconst
+ $(ASTCFLAGS)
CFLAGS64 += \
- $(CCVERBOSE) \
- -xstrconst
+ $(ASTCFLAGS64)
pics/sync.o := CERRWARN += -erroff=E_END_OF_LOOP_CODE_NOT_REACHED
@@ -132,6 +141,5 @@ all: $(LIBS)
#
lint:
@ print "usr/src/lib/libcmd is not lint-clean: skipping"
- @ $(TRUE)
include ../../Makefile.targ
diff --git a/usr/src/lib/libcmd/amd64/include/ast/cmd.h b/usr/src/lib/libcmd/amd64/include/ast/cmd.h
index 2484c17c5a..9ac1c90993 100644
--- a/usr/src/lib/libcmd/amd64/include/ast/cmd.h
+++ b/usr/src/lib/libcmd/amd64/include/ast/cmd.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -40,9 +40,9 @@
#include <ast.h>
#include <error.h>
#include <stak.h>
+#include <shcmd.h>
#define cmdinit _cmd_init
-#define cmdquit() 0
#if _BLD_cmd && defined(__EXPORT__)
#undef __MANGLE__
@@ -60,11 +60,13 @@
#ifdef CMD_STANDALONE
+#define CMD_CONTEXT(c) ((Shbltin_t*)0)
+
#if CMD_DYNAMIC
#include <dlldefs.h>
-typedef int (*Builtin_f) __PROTO__((int, char**, __V_*));
+typedef int (*Shbltin_f) __PROTO__((int, char**, __V_*));
#else
@@ -106,7 +108,7 @@ main __PARAM__((int argc, char** argv), (argc, argv)) __OTORP__(int argc; char**
register char* s;
register char* t;
__V_* dll;
- Builtin_f fun;
+ Shbltin_f fun;
char buf[64];
if (s = strrchr(argv[0], '/'))
@@ -126,16 +128,16 @@ main __PARAM__((int argc, char** argv), (argc, argv)) __OTORP__(int argc; char**
{
if (dll = dlopen(NiL, RTLD_LAZY))
{
- if (fun = (Builtin_f)dlsym(dll, buf + 1))
+ if (fun = (Shbltin_f)dlsym(dll, buf + 1))
break;
- if (fun = (Builtin_f)dlsym(dll, buf))
+ if (fun = (Shbltin_f)dlsym(dll, buf))
break;
}
if (dll = dllfind("cmd", NiL, RTLD_LAZY))
{
- if (fun = (Builtin_f)dlsym(dll, buf + 1))
+ if (fun = (Shbltin_f)dlsym(dll, buf + 1))
break;
- if (fun = (Builtin_f)dlsym(dll, buf))
+ if (fun = (Shbltin_f)dlsym(dll, buf))
break;
}
return 127;
@@ -149,27 +151,12 @@ main __PARAM__((int argc, char** argv), (argc, argv)) __OTORP__(int argc; char**
#else
#undef cmdinit
+#ifdef _MSC_VER
+#define CMD_CONTEXT(p) ((Shbltin_t*)(p))
#define cmdinit(a,b,c,d,e) do{if(_cmd_init(a,b,c,d,e))return -1;}while(0)
-
-#ifndef CMD_BUILTIN
-
-#undef cmdquit
-#define cmdquit() (_cmd_quit)
-
-#if _BLD_cmd && defined(__EXPORT__)
-#undef __MANGLE__
-#define __MANGLE__ __LINKAGE__ __EXPORT__
-#endif
-#if !_BLD_cmd && defined(__IMPORT__)
-#undef __MANGLE__
-#define __MANGLE__ __LINKAGE__ __IMPORT__
-#endif
-
-extern __MANGLE__ int _cmd_quit;
-
-#undef __MANGLE__
-#define __MANGLE__ __LINKAGE__
-
+#else
+#define CMD_CONTEXT(p) (((p)&&((Shbltin_t*)(p))->version>=20071012&&((Shbltin_t*)(p))->version<20350101)?((Shbltin_t*)(p)):0)
+#define cmdinit(a,b,c,d,e) do{if((c)&&!CMD_CONTEXT(c))c=0;if(_cmd_init(a,b,c,d,e))return -1;}while(0)
#endif
#if _BLD_cmd && defined(__EXPORT__)
diff --git a/usr/src/lib/libcmd/amd64/include/ast/cmdext.h b/usr/src/lib/libcmd/amd64/include/ast/cmdext.h
index b5c58b5d04..602f8d7a7d 100644
--- a/usr/src/lib/libcmd/amd64/include/ast/cmdext.h
+++ b/usr/src/lib/libcmd/amd64/include/ast/cmdext.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -55,6 +55,7 @@ extern __MANGLE__ int b_mkfifo __PROTO__((int, char**, __V_*));
extern __MANGLE__ int b_mv __PROTO__((int, char**, __V_*));
extern __MANGLE__ int b_paste __PROTO__((int, char**, __V_*));
extern __MANGLE__ int b_pathchk __PROTO__((int, char**, __V_*));
+extern __MANGLE__ int b_pids __PROTO__((int, char**, __V_*));
extern __MANGLE__ int b_rev __PROTO__((int, char**, __V_*));
extern __MANGLE__ int b_rm __PROTO__((int, char**, __V_*));
extern __MANGLE__ int b_rmdir __PROTO__((int, char**, __V_*));
diff --git a/usr/src/lib/libcmd/amd64/src/lib/libcmd/FEATURE/ids b/usr/src/lib/libcmd/amd64/src/lib/libcmd/FEATURE/ids
index 397e8afccb..4edd14f3cf 100644
--- a/usr/src/lib/libcmd/amd64/src/lib/libcmd/FEATURE/ids
+++ b/usr/src/lib/libcmd/amd64/src/lib/libcmd/FEATURE/ids
@@ -1,8 +1,8 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libcmd/features/ids by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libcmd/features/ids by iffe version 2008-01-31 : : */
#ifndef _def_ids_cmd
#define _def_ids_cmd 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
#define _lib_endgrent 1 /* endgrent() in default lib(s) */
#define _lib_getgrent 1 /* getgrent() in default lib(s) */
diff --git a/usr/src/lib/libcmd/amd64/src/lib/libcmd/FEATURE/sockets b/usr/src/lib/libcmd/amd64/src/lib/libcmd/FEATURE/sockets
index b40d706945..90b55e7c99 100644
--- a/usr/src/lib/libcmd/amd64/src/lib/libcmd/FEATURE/sockets
+++ b/usr/src/lib/libcmd/amd64/src/lib/libcmd/FEATURE/sockets
@@ -1,8 +1,8 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libcmd/features/sockets by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libcmd/features/sockets by iffe version 2008-01-31 : : */
#ifndef _def_sockets_cmd
#define _def_sockets_cmd 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
#define _sys_socket 1 /* #include <sys/socket.h> ok */
#define _hdr_arpa_inet 1 /* #include <arpa/inet.h> ok */
diff --git a/usr/src/lib/libcmd/amd64/src/lib/libcmd/FEATURE/symlink b/usr/src/lib/libcmd/amd64/src/lib/libcmd/FEATURE/symlink
index 4975396e7b..43ae73a5c4 100644
--- a/usr/src/lib/libcmd/amd64/src/lib/libcmd/FEATURE/symlink
+++ b/usr/src/lib/libcmd/amd64/src/lib/libcmd/FEATURE/symlink
@@ -1,8 +1,8 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libcmd/features/symlink by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libcmd/features/symlink by iffe version 2008-01-31 : : */
#ifndef _def_symlink_cmd
#define _def_symlink_cmd 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
#define _lib_lchown 1 /* lchown implemented */
#endif
diff --git a/usr/src/lib/libcmd/amd64/src/lib/libcmd/FEATURE/utsname b/usr/src/lib/libcmd/amd64/src/lib/libcmd/FEATURE/utsname
index 34d932c637..b6cb394d64 100644
--- a/usr/src/lib/libcmd/amd64/src/lib/libcmd/FEATURE/utsname
+++ b/usr/src/lib/libcmd/amd64/src/lib/libcmd/FEATURE/utsname
@@ -1,8 +1,8 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libcmd/features/utsname by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libcmd/features/utsname by iffe version 2008-01-31 : : */
#ifndef _def_utsname_cmd
#define _def_utsname_cmd 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
#define _lib_getdomainname 1 /* getdomainname() in default lib(s) */
#define _lib_gethostid 1 /* gethostid() in default lib(s) */
diff --git a/usr/src/lib/libcmd/common/RELEASE b/usr/src/lib/libcmd/common/RELEASE
index 7e343a5607..6300890d12 100644
--- a/usr/src/lib/libcmd/common/RELEASE
+++ b/usr/src/lib/libcmd/common/RELEASE
@@ -1,4 +1,38 @@
-07-03-28 date.c: add --unelepsed=scale, -U: fmtelapsed() => strelapsed()
+08-10-15 rm.c: handle 'rm -f x x' => exit 0
+08-09-08 stty.c: #ifdef guard TAB[012] -- freebsd: damn the posix, full speed ahead
+08-06-17 shcmd.h: move to libast
+08-04-24 uniq.c: add optget() 'n' option for -1 => -f1
+08-04-24 getconf.c: clarify diffs between "name - value" and "name = value"
+08-04-01 cut.c: add write error check
+08-04-01 paste.c: fix --noserial stream vector access bug
+08-04-01 pids.c: add ls/ps style --format=format
+08-04-01 stty.c: fix off2 unitialized reference
+08-03-28 chgrp.c: add --before=file
+08-03-14 pids.c: add
+08-03-11 chgrp.c: fix -m to use uid:gid as lookup key
+08-02-11 Makefile: add -lmd possibly required by sumlib.o -- hack alert
+08-01-30 expr.c: fix <=0 type that broke substr * 1 * -- wow
+07-12-13 cp.c: fix builtin state reinitialization
+07-11-29 rev.c: honor multibyte locales
+07-11-27 cp.c: open non-existent destination with O_EXCL
+07-11-27 stty.c: add -t,--terminal-group to list tty pgrp
+07-11-27 cksum.c: --silent -s => -S, -s == -x sys5 for gnu compatibility
+07-11-11 tee.c: drop ancient bsd compatibility "-" operand => SIGINT
+07-10-29 cksum.c: add SUM_LEGACY for -r
+07-10-12 cp.c: plug usage string memory leak by using per-builtin state
+07-09-21 cksum.c: add sumprint() default scale arg, --scale, --bsd for solaris
+07-09-10 chmod.c: add --show,-n
+07-07-27 wclib.c: bias <wchar.h> checks for modern unix
+07-07-17 cat.c: fix --squeeze-blank to reduce multiple blank lines to *one*
+07-05-20 cmd.h: handle msvc's balk at if(0)0=0;
+07-05-20 cksum.c: #include <modex.h>
+07-05-11 cmd.h: add _CMD_CONTEXT_OK() to verify >= 20070511 context
+07-05-09 fds.c: handle ipv6 sockets
+07-05-09 cmd.h: <shbltin.h> : cmdquit() => sh_checksig(context)
+07-04-25 mkdir.c: force (S_ISVTX|S_ISUID|S_ISGID) after mkdir(2)
+07-04-24 procrun.c: add -last intercept => sh_run() and whence -q
+07-04-19 uname.c: name operands first checked for CS_NAME, then NAME
+07-03-28 date.c: add --unelapsed=scale, -U: fmtelapsed() => strelapsed()
07-03-25 wclib.h: iswspace() requires <wctype.h>!
07-03-11 tty.c: add sysV --line-number, -l
07-02-26 Makefile: sumlib.o: direct extract from +lsum (vcodex someday)
diff --git a/usr/src/lib/libcmd/common/basename.c b/usr/src/lib/libcmd/common/basename.c
index f715091c32..c5c86aa154 100644
--- a/usr/src/lib/libcmd/common/basename.c
+++ b/usr/src/lib/libcmd/common/basename.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libcmd/common/cat.c b/usr/src/lib/libcmd/common/cat.c
index 884726e572..76af2f2765 100644
--- a/usr/src/lib/libcmd/common/cat.c
+++ b/usr/src/lib/libcmd/common/cat.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -31,7 +31,7 @@
#include <fcntl.h>
static const char usage[] =
-"[-?\n@(#)$Id: cat (AT&T Research) 2006-05-17 $\n]"
+"[-?\n@(#)$Id: cat (AT&T Research) 2007-07-17 $\n]"
USAGE_LICENSE
"[+NAME?cat - concatenate files]"
"[+DESCRIPTION?\bcat\b copies each \afile\a in sequence to the standard"
@@ -111,6 +111,7 @@ vcat(register char* states, Sfio_t *fdin, Sfio_t *fdout, int flags)
unsigned char* inbuff;
int printdefer = (flags&(B_FLAG|N_FLAG));
int lastchar;
+ int lastline;
unsigned char meta[4];
@@ -197,6 +198,7 @@ vcat(register char* states, Sfio_t *fdin, Sfio_t *fdout, int flags)
while ((n=states[*cp])==T_CONTROL);
break;
case T_NEWLINE:
+ lastline = line;
if (flags&S_FLAG)
{
while (states[*++cp]==T_NEWLINE)
@@ -209,6 +211,12 @@ vcat(register char* states, Sfio_t *fdin, Sfio_t *fdout, int flags)
if (flags&E_FLAG)
sfputc(fdout,'$');
sfputc(fdout,'\n');
+ if(line > lastline)
+ {
+ if (flags&E_FLAG)
+ sfputc(fdout,'$');
+ sfputc(fdout,'\n');
+ }
if (!(flags&(N_FLAG|B_FLAG)))
continue;
line++;
@@ -327,7 +335,7 @@ b_cat(int argc, char** argv, void* context)
if (!(flags&T_FLAG))
states['\t'] = 0;
}
- if (flags&(V_FLAG|T_FLAG|N_FLAG|E_FLAG|B_FLAG))
+ if (flags&(V_FLAG|T_FLAG|N_FLAG|E_FLAG|B_FLAG|S_FLAG))
{
states['\n'] = T_NEWLINE;
dovcat = 1;
diff --git a/usr/src/lib/libcmd/common/chgrp.c b/usr/src/lib/libcmd/common/chgrp.c
index 5538f5e310..5525157070 100644
--- a/usr/src/lib/libcmd/common/chgrp.c
+++ b/usr/src/lib/libcmd/common/chgrp.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -28,7 +28,7 @@
*/
static const char usage_1[] =
-"[-?@(#)$Id: chgrp (AT&T Research) 2006-10-11 $\n]"
+"[-?@(#)$Id: chgrp (AT&T Research) 2008-03-28 $\n]"
USAGE_LICENSE
;
@@ -49,24 +49,34 @@ static const char usage_own_1[] =
;
static const char usage_2[] =
+"[b:before?Only change files with \bctime\b before (less than) the "
+ "\bmtime\b of \afile\a.]:[file]"
"[c:changes?Describe only files whose ownership actually changes.]"
"[f:quiet|silent?Do not report files whose ownership fails to change.]"
-"[l|h:symlink?Change the ownership of the symbolic links on systems that"
-" support this.]"
-"[m:map?The first operand is interpreted as a file that contains a map"
-" of \afrom_uid:from_gid to_uid:to_gid\a pairs. Ownership of files"
-" matching the \afrom\a part of any pair is changed to the corresponding"
-" \ato\a part of the pair. The process stops at the first match for"
-" each file. Unmatched files are silently ignored.]"
+"[l|h:symlink?Change the ownership of the symbolic links on systems that "
+ "support this.]"
+"[m:map?The first operand is interpreted as a file that contains a map "
+ "of space separated \afrom_uid:from_gid to_uid:to_gid\a pairs. The "
+ "\auid\a or \agid\a part of each pair may be omitted to mean any \auid\a "
+ "or \agid\a. Ownership of files matching the \afrom\a part of any pair "
+ "is changed to the corresponding \ato\a part of the pair. The matching "
+ "for each file operand is in the order \auid\a:\agid\a, \auid\a:, "
+ ":\agid\a. For a given file, once a \auid\a or \agid\a mapping is "
+ "determined it is not overridden by any subsequent match. Unmatched "
+ "files are silently ignored.]"
"[n:show?Show actions but don't execute.]"
-"[r:reference?Omit the explicit ownership operand and use the ownership of"
-" \afile\a instead.]:[file]"
+"[r:reference?Omit the explicit ownership operand and use the ownership "
+ "of \afile\a instead.]:[file]"
+"[u:unmapped?Print a diagnostic for each file for which either the "
+ "\auid\a or \agid\a or both were not mapped.]"
"[v:verbose?Describe changed permissions of all files.]"
-"[H:metaphysical?Follow symbolic links for command arguments; otherwise don't"
-" follow symbolic links when traversing directories.]"
+"[H:metaphysical?Follow symbolic links for command arguments; otherwise "
+ "don't follow symbolic links when traversing directories.]"
"[L:logical|follow?Follow symbolic links when traversing directories.]"
-"[P:physical|nofollow?Don't follow symbolic links when traversing directories.]"
-"[R:recursive?Recursively change ownership of directories and their contents.]"
+"[P:physical|nofollow?Don't follow symbolic links when traversing "
+ "directories.]"
+"[R:recursive?Recursively change ownership of directories and their "
+ "contents.]"
"[X:test?Canonicalize output for testing.]"
"\n"
@@ -103,12 +113,17 @@ __STDPP__directive pragma pp:nohide lchown
#undef lchown
#endif
-typedef struct /* uid/gid map */
+typedef struct Key_s /* uid/gid key */
+{
+ int uid; /* uid */
+ int gid; /* gid */
+} Key_t;
+
+typedef struct Map_s /* uid/gid map */
{
Dtlink_t link; /* dictionary link */
- int id; /* id */
- int uid; /* id maps to this uid */
- int gid; /* id maps to this gid */
+ Key_t key; /* key */
+ Key_t to; /* map to these */
} Map_t;
#define NOID (-1)
@@ -120,7 +135,8 @@ typedef struct /* uid/gid map */
#define OPT_SHOW (1<<4) /* show but don't do */
#define OPT_TEST (1<<5) /* canonicalize output */
#define OPT_UID (1<<6) /* have uid */
-#define OPT_VERBOSE (1<<7) /* have uid */
+#define OPT_UNMAPPED (1<<7) /* unmapped file diagnostic */
+#define OPT_VERBOSE (1<<8) /* have uid */
extern int lchown(const char*, uid_t, gid_t);
@@ -143,14 +159,14 @@ lchown(const char* path, uid_t uid, gid_t gid)
*/
static void
-getids(register char* s, char** e, int* uid, int* gid, int options)
+getids(register char* s, char** e, Key_t* key, int options)
{
register char* t;
register int n;
char* z;
char buf[64];
- *uid = *gid = NOID;
+ key->uid = key->gid = NOID;
while (isspace(*s))
s++;
for (t = s; (n = *t) && n != ':' && n != '.' && !isspace(n); t++);
@@ -160,8 +176,6 @@ getids(register char* s, char** e, int* uid, int* gid, int options)
if ((n = t++ - s) >= sizeof(buf))
n = sizeof(buf) - 1;
*((s = (char*)memcpy(buf, s, n)) + n) = 0;
- while (isspace(*t))
- t++;
}
if (options & OPT_CHOWN)
{
@@ -173,7 +187,7 @@ getids(register char* s, char** e, int* uid, int* gid, int options)
if (*z)
error(ERROR_exit(1), "%s: unknown user", s);
}
- *uid = n;
+ key->uid = n;
}
for (s = t; (n = *t) && !isspace(n); t++);
if (n)
@@ -191,7 +205,7 @@ getids(register char* s, char** e, int* uid, int* gid, int options)
if (*z)
error(ERROR_exit(1), "%s: unknown group", s);
}
- *gid = n;
+ key->gid = n;
}
if (e)
*e = t;
@@ -205,19 +219,25 @@ b_chgrp(int argc, char** argv, void* context)
register Map_t* m;
register FTS* fts;
register FTSENT*ent;
+ register int i;
Dt_t* map = 0;
int flags;
int uid;
int gid;
char* op;
char* usage;
+ char* t;
Sfio_t* sp;
+ unsigned long before;
Dtdisc_t mapdisc;
+ Key_t keys[3];
+ Key_t key;
struct stat st;
int (*chownf)(const char*, uid_t, gid_t);
cmdinit(argc, argv, context, ERROR_CATALOG, ERROR_NOTIFY);
flags = fts_flags() | FTS_TOP | FTS_NOPOSTORDER | FTS_NOSEEDOTDIR;
+ before = ~0;
if (!(sp = sfstropen()))
error(ERROR_SYSTEM|3, "out of space");
sfputr(sp, usage_1, -1);
@@ -240,6 +260,11 @@ b_chgrp(int argc, char** argv, void* context)
{
switch (optget(argv, usage))
{
+ case 'b':
+ if (stat(opt_info.arg, &st))
+ error(ERROR_exit(1), "%s: cannot stat", opt_info.arg);
+ before = st.st_mtime;
+ continue;
case 'c':
case 'v':
options |= OPT_VERBOSE;
@@ -252,8 +277,8 @@ b_chgrp(int argc, char** argv, void* context)
continue;
case 'm':
memset(&mapdisc, 0, sizeof(mapdisc));
- mapdisc.key = offsetof(Map_t, id);
- mapdisc.size = sizeof(int);
+ mapdisc.key = offsetof(Map_t, key);
+ mapdisc.size = sizeof(Key_t);
if (!(map = dtopen(&mapdisc, Dthash)))
error(ERROR_exit(1), "out of space [id map]");
continue;
@@ -267,6 +292,9 @@ b_chgrp(int argc, char** argv, void* context)
gid = st.st_gid;
options |= OPT_UID|OPT_GID;
continue;
+ case 'u':
+ options |= OPT_UNMAPPED;
+ continue;
case 'H':
flags |= FTS_META|FTS_PHYSICAL;
continue;
@@ -299,60 +327,33 @@ b_chgrp(int argc, char** argv, void* context)
s = *argv;
if (map)
{
- char* t;
- int nuid;
- int ngid;
-
if (streq(s, "-"))
sp = sfstdin;
else if (!(sp = sfopen(NiL, s, "r")))
error(ERROR_exit(1), "%s: cannot read", s);
while (s = sfgetr(sp, '\n', 1))
{
- getids(s, &t, &uid, &gid, options);
- getids(t, NiL, &nuid, &ngid, options);
- if (uid != NOID)
- {
- if (m = (Map_t*)dtmatch(map, &uid))
- {
- m->uid = nuid;
- if (m->gid == NOID)
- m->gid = ngid;
- }
- else if (m = (Map_t*)stakalloc(sizeof(Map_t)))
- {
- m->id = uid;
- m->uid = nuid;
- m->gid = ngid;
- dtinsert(map, m);
- }
- else
- error(ERROR_exit(1), "out of space [id dictionary]");
- }
- if (gid != NOID)
+ getids(s, &t, &key, options);
+ if (!(m = (Map_t*)dtmatch(map, &key)))
{
- if (gid == uid || (m = (Map_t*)dtmatch(map, &gid)))
- m->gid = ngid;
- else if (m = (Map_t*)stakalloc(sizeof(Map_t)))
- {
- m->id = gid;
- m->uid = NOID;
- m->gid = ngid;
- dtinsert(map, m);
- }
- else
+ if (!(m = (Map_t*)stakalloc(sizeof(Map_t))))
error(ERROR_exit(1), "out of space [id dictionary]");
+ m->key = key;
+ m->to.uid = m->to.gid = NOID;
+ dtinsert(map, m);
}
+ getids(t, NiL, &m->to, options);
}
if (sp != sfstdin)
sfclose(sp);
+ keys[1].gid = keys[2].uid = NOID;
}
else if (!(options & (OPT_UID|OPT_GID)))
{
- getids(s, NiL, &uid, &gid, options);
- if (uid != NOID)
+ getids(s, NiL, &key, options);
+ if ((uid = key.uid) != NOID)
options |= OPT_UID;
- if (gid != NOID)
+ if ((gid = key.gid) != NOID)
options |= OPT_GID;
}
switch (options & (OPT_UID|OPT_GID))
@@ -372,7 +373,7 @@ b_chgrp(int argc, char** argv, void* context)
}
if (!(fts = fts_open(argv + 1, flags, NiL)))
error(ERROR_system(1), "%s: not found", argv[1]);
- while (!cmdquit() && (ent = fts_read(fts)))
+ while (!sh_checksig(context) && (ent = fts_read(fts)))
switch (ent->fts_info)
{
case FTS_F:
@@ -380,23 +381,31 @@ b_chgrp(int argc, char** argv, void* context)
case FTS_SL:
case FTS_SLNONE:
anyway:
+ if ((unsigned long)ent->fts_statp->st_ctime >= before)
+ break;
if (map)
{
options &= ~(OPT_UID|OPT_GID);
- uid = ent->fts_statp->st_uid;
- gid = ent->fts_statp->st_gid;
- if ((m = (Map_t*)dtmatch(map, &uid)) && m->uid != NOID)
- {
- uid = m->uid;
- options |= OPT_UID;
- }
- if (gid != uid)
- m = (Map_t*)dtmatch(map, &gid);
- if (m && m->gid != NOID)
+ uid = gid = NOID;
+ keys[0].uid = keys[1].uid = ent->fts_statp->st_uid;
+ keys[0].gid = keys[2].gid = ent->fts_statp->st_gid;
+ i = 0;
+ do
{
- gid = m->gid;
- options |= OPT_GID;
- }
+ if (m = (Map_t*)dtmatch(map, &keys[i]))
+ {
+ if (uid == NOID && m->to.uid != NOID)
+ {
+ uid = m->to.uid;
+ options |= OPT_UID;
+ }
+ if (gid == NOID && m->to.gid != NOID)
+ {
+ gid = m->to.gid;
+ options |= OPT_GID;
+ }
+ }
+ } while (++i < elementsof(keys) && (uid == NOID || gid == NOID));
}
else
{
@@ -405,7 +414,16 @@ b_chgrp(int argc, char** argv, void* context)
if (!(options & OPT_GID))
gid = ent->fts_statp->st_gid;
}
- if (uid != ent->fts_statp->st_uid || gid != ent->fts_statp->st_gid)
+ if ((options & OPT_UNMAPPED) && (uid == NOID || gid == NOID))
+ {
+ if (uid == NOID && gid == NOID)
+ error(ERROR_warn(0), "%s: uid and gid not mapped", ent->fts_path);
+ else if (uid == NOID)
+ error(ERROR_warn(0), "%s: uid not mapped", ent->fts_path);
+ else
+ error(ERROR_warn(0), "%s: gid not mapped", ent->fts_path);
+ }
+ if (uid != ent->fts_statp->st_uid && uid != NOID || gid != ent->fts_statp->st_gid && gid != NOID)
{
if ((ent->fts_info & FTS_SL) && (flags & FTS_PHYSICAL) && (options & OPT_LCHOWN))
{
@@ -424,7 +442,7 @@ b_chgrp(int argc, char** argv, void* context)
ent->fts_statp->st_uid = 0;
ent->fts_statp->st_gid = 0;
}
- sfprintf(sfstdout, "%s uid:%05d->%05d gid:%05d->%05d %s\n", op, ent->fts_statp->st_uid, uid, ent->fts_statp->st_gid, gid, ent->fts_accpath);
+ sfprintf(sfstdout, "%s uid:%05d->%05d gid:%05d->%05d %s\n", op, ent->fts_statp->st_uid, uid, ent->fts_statp->st_gid, gid, ent->fts_path);
}
if (!(options & OPT_SHOW) && (*chownf)(ent->fts_accpath, uid, gid) && !(options & OPT_FORCE))
error(ERROR_system(0), "%s: cannot change%s", ent->fts_accpath, s);
diff --git a/usr/src/lib/libcmd/common/chmod.c b/usr/src/lib/libcmd/common/chmod.c
index b1745585a0..f8fc03226a 100644
--- a/usr/src/lib/libcmd/common/chmod.c
+++ b/usr/src/lib/libcmd/common/chmod.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -28,7 +28,7 @@
*/
static const char usage[] =
-"[-?\n@(#)$Id: chmod (AT&T Research) 2007-07-26 $\n]"
+"[-?\n@(#)$Id: chmod (AT&T Research) 2007-09-10 $\n]"
USAGE_LICENSE
"[+NAME?chmod - change the access permissions of files]"
"[+DESCRIPTION?\bchmod\b changes the permission of each file "
@@ -92,7 +92,7 @@ USAGE_LICENSE
"[+?When the \b-c\b or \b-v\b options are specified, change notifications "
"are written to standard output using the format, "
- "\bmode of %s changed to %0.4o (%s)\b, with arguments of the "
+ "\b%s: mode changed to %0.4o (%s)\b, with arguments of the "
"pathname, the numeric mode, and the resulting permission bits as "
"would be displayed by the \bls\b command.]"
@@ -111,6 +111,7 @@ USAGE_LICENSE
"support this.]"
"[i:ignore-umask?Ignore the \bumask\b(2) value in symbolic mode "
"expressions. This is probably how you expect \bchmod\b to work.]"
+"[n:show?Show actions but do not change any file modes.]"
"[F:reference?Omit the \amode\a operand and use the mode of \afile\a "
"instead.]:[file]"
"[v:verbose?Describe changed permissions of all files.]"
@@ -159,6 +160,7 @@ b_chmod(int argc, char** argv, void* context)
int (*chmodf)(const char*, mode_t);
int notify = 0;
int ignore = 0;
+ int show = 0;
#if _lib_lchmod
int chlink = 0;
#endif
@@ -190,6 +192,9 @@ b_chmod(int argc, char** argv, void* context)
case 'i':
ignore = 1;
continue;
+ case 'n':
+ show = 1;
+ continue;
case 'v':
notify = 2;
continue;
@@ -247,7 +252,7 @@ b_chmod(int argc, char** argv, void* context)
umask(ignore);
error(ERROR_system(1), "%s: not found", *argv);
}
- while (!cmdquit() && (ent = fts_read(fts)))
+ while (!sh_checksig(context) && (ent = fts_read(fts)))
switch (ent->fts_info)
{
case FTS_SL:
@@ -264,7 +269,7 @@ b_chmod(int argc, char** argv, void* context)
anyway:
if (amode)
mode = strperm(amode, &last, ent->fts_statp->st_mode);
- if ((*chmodf)(ent->fts_accpath, mode) >= 0)
+ if (show || (*chmodf)(ent->fts_accpath, mode) >= 0)
{
if (notify == 2 || notify == 1 && (mode&S_IPERM) != (ent->fts_statp->st_mode&S_IPERM))
sfprintf(sfstdout, "%s: mode changed to %0.4o (%s)\n", ent->fts_path, mode, fmtmode(mode, 1)+1);
diff --git a/usr/src/lib/libcmd/common/chown.c b/usr/src/lib/libcmd/common/chown.c
index f31421df18..83340c346a 100644
--- a/usr/src/lib/libcmd/common/chown.c
+++ b/usr/src/lib/libcmd/common/chown.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libcmd/common/cksum.c b/usr/src/lib/libcmd/common/cksum.c
index 25d9ee0c0f..56a80131a6 100644
--- a/usr/src/lib/libcmd/common/cksum.c
+++ b/usr/src/lib/libcmd/common/cksum.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -27,7 +27,7 @@
*/
static const char usage[] =
-"[-?\n@(#)$Id: sum (AT&T Research) 2007-02-07 $\n]"
+"[-?\n@(#)$Id: sum (AT&T Research) 2007-11-27 $\n]"
USAGE_LICENSE
"[+NAME?cksum,md5sum,sum - print file checksum and block count]"
"[+DESCRIPTION?\bsum\b lists the checksum, and for most methods the block"
@@ -50,6 +50,8 @@ USAGE_LICENSE
"[a:all?List the checksum for all files. Use with \b--total\b to list both"
" individual and total checksums and block counts.]"
"[b:binary?Read files in binary mode. This is the default.]"
+"[B:scale?Block count scale (bytes per block) override for methods that"
+" include size in the output. The default is method specific.]#[scale]"
"[c:check?Each \afile\a is interpreted as the output from a previous \bsum\b."
" If \b--header\b or \b--permissions\b was specified in the previous"
" \bsum\b then the checksum method is automatically determined,"
@@ -74,8 +76,8 @@ USAGE_LICENSE
" specified then the mode, user and group for each path in \afile\a"
" are updated if necessary to match those in \afile\a. A warning is"
" printed on the standard error for each changed file.]"
-"[r:recursive?Recursively checksum the contents of directories.]"
-"[s:silent|status?No output for \b--check\b; 0 exit status means all sums"
+"[R:recursive?Recursively checksum the contents of directories.]"
+"[S:silent|status?No output for \b--check\b; 0 exit status means all sums"
" matched, non-0 means at least one sum failed to match. Ignored for"
" \b--permissions\b.]"
"[t:total?List only the total checksum and block count of all files."
@@ -95,6 +97,10 @@ USAGE_LICENSE
" determined by \bgetconf PATH_RESOLVE\b.]"
"[P:physical?Don't follow symbolic links when traversing directories. The"
" default is determined by \bgetconf PATH_RESOLVE\b.]"
+"[r:bsd?Equivalent to \b--method=bsd --scale=512\b for compatibility with"
+" other \bsum\b(1) implementations.]"
+"[s:sysv?Equivalent to \b--method=sys5\b for compatibility with other"
+" \bsum\b(1) implementations.]"
"\n"
"\n[ file ... ]\n"
@@ -106,6 +112,7 @@ USAGE_LICENSE
#include <cmd.h>
#include <sum.h>
#include <ls.h>
+#include <modex.h>
#include <fts.h>
#include <error.h>
@@ -113,6 +120,7 @@ typedef struct State_s /* program state */
{
int all; /* list all items */
Sfio_t* check; /* check previous output */
+ int flags; /* sumprint() SUM_* flags */
gid_t gid; /* caller gid */
int header; /* list method on output */
int list; /* list file name too */
@@ -120,6 +128,7 @@ typedef struct State_s /* program state */
int permissions; /* include mode,uer,group */
int haveperm; /* permissions in the input */
int recursive; /* recursively descend dirs */
+ size_t scale; /* scale override */
unsigned long size; /* combined size of all files */
int silent; /* silent check, 0 exit if ok */
int (*sort)(FTSENT* const*, FTSENT* const*);
@@ -221,7 +230,7 @@ pr(State_t* state, Sfio_t* op, Sfio_t* ip, char* file, int perm, struct stat* st
sumdone(state->sum);
if (!state->total || state->all)
{
- sumprint(state->sum, op, SUM_SIZE|SUM_SCALE);
+ sumprint(state->sum, op, state->flags|SUM_SCALE, state->scale);
if (perm >= 0)
{
if (perm)
@@ -433,8 +442,8 @@ int
b_cksum(int argc, register char** argv, void* context)
{
register int flags;
- register char* s;
char* file;
+ char* method;
Sfio_t* sp;
FTS* fts;
FTSENT* ent;
@@ -445,7 +454,9 @@ b_cksum(int argc, register char** argv, void* context)
memset(&state, 0, sizeof(state));
setlocale(LC_ALL, "");
flags = fts_flags() | FTS_TOP | FTS_NOPOSTORDER | FTS_NOSEEDOTDIR;
+ state.flags = SUM_SIZE;
state.warn = 1;
+ method = 0;
optinit(&optdisc, optinfo);
for (;;)
{
@@ -457,6 +468,9 @@ b_cksum(int argc, register char** argv, void* context)
case 'b':
state.text = 0;
continue;
+ case 'B':
+ state.scale = opt_info.num;
+ continue;
case 'c':
if (!(state.check = sfstropen()))
error(3, "out of space [check]");
@@ -471,11 +485,19 @@ b_cksum(int argc, register char** argv, void* context)
state.permissions = 1;
continue;
case 'r':
+ method = "bsd";
+ state.scale = 512;
+ state.flags |= SUM_LEGACY;
+ continue;
+ case 'R':
flags &= ~FTS_TOP;
state.recursive = 1;
state.sort = order;
continue;
case 's':
+ method = "sys5";
+ continue;
+ case 'S':
state.silent = opt_info.num;
continue;
case 't':
@@ -485,8 +507,7 @@ b_cksum(int argc, register char** argv, void* context)
state.warn = opt_info.num;
continue;
case 'x':
- if (!(state.sum = sumopen(opt_info.arg)))
- error(3, "%s: unknown checksum method", opt_info.arg);
+ method = opt_info.arg;
continue;
case 'H':
flags |= FTS_META|FTS_PHYSICAL;
@@ -518,6 +539,8 @@ b_cksum(int argc, register char** argv, void* context)
* check the method
*/
+ if (method && !(state.sum = sumopen(method)))
+ error(3, "%s: unknown checksum method", method);
if (!state.sum && !(state.sum = sumopen(error_info.id)) && !(state.sum = sumopen(astconf("UNIVERSE", NiL, NiL))))
state.sum = sumopen(NiL);
@@ -560,7 +583,7 @@ b_cksum(int argc, register char** argv, void* context)
error(ERROR_system(1), "%s: not found", *argv);
else
{
- while (!cmdquit() && (ent = fts_read(fts)))
+ while (!sh_checksig(context) && (ent = fts_read(fts)))
switch (ent->fts_info)
{
case FTS_SL:
@@ -591,7 +614,7 @@ b_cksum(int argc, register char** argv, void* context)
}
if (state.total)
{
- sumprint(state.sum, sfstdout, SUM_TOTAL|SUM_SIZE|SUM_SCALE);
+ sumprint(state.sum, sfstdout, state.flags|SUM_TOTAL|SUM_SCALE, state.scale);
sfputc(sfstdout, '\n');
}
sumclose(state.sum);
diff --git a/usr/src/lib/libcmd/common/cmd.h b/usr/src/lib/libcmd/common/cmd.h
index 50092c2018..8fe4094d78 100644
--- a/usr/src/lib/libcmd/common/cmd.h
+++ b/usr/src/lib/libcmd/common/cmd.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -31,9 +31,9 @@
#include <ast.h>
#include <error.h>
#include <stak.h>
+#include <shcmd.h>
#define cmdinit _cmd_init
-#define cmdquit() 0
#if _BLD_cmd && defined(__EXPORT__)
#define extern __EXPORT__
@@ -49,11 +49,13 @@
#ifdef CMD_STANDALONE
+#define CMD_CONTEXT(c) ((Shbltin_t*)0)
+
#if CMD_DYNAMIC
#include <dlldefs.h>
-typedef int (*Builtin_f)(int, char**, void*);
+typedef int (*Shbltin_f)(int, char**, void*);
#else
@@ -97,7 +99,7 @@ main(int argc, char** argv)
register char* s;
register char* t;
void* dll;
- Builtin_f fun;
+ Shbltin_f fun;
char buf[64];
if (s = strrchr(argv[0], '/'))
@@ -117,16 +119,16 @@ main(int argc, char** argv)
{
if (dll = dlopen(NiL, RTLD_LAZY))
{
- if (fun = (Builtin_f)dlsym(dll, buf + 1))
+ if (fun = (Shbltin_f)dlsym(dll, buf + 1))
break;
- if (fun = (Builtin_f)dlsym(dll, buf))
+ if (fun = (Shbltin_f)dlsym(dll, buf))
break;
}
if (dll = dllfind("cmd", NiL, RTLD_LAZY))
{
- if (fun = (Builtin_f)dlsym(dll, buf + 1))
+ if (fun = (Shbltin_f)dlsym(dll, buf + 1))
break;
- if (fun = (Builtin_f)dlsym(dll, buf))
+ if (fun = (Shbltin_f)dlsym(dll, buf))
break;
}
return 127;
@@ -140,24 +142,12 @@ main(int argc, char** argv)
#else
#undef cmdinit
+#ifdef _MSC_VER
+#define CMD_CONTEXT(p) ((Shbltin_t*)(p))
#define cmdinit(a,b,c,d,e) do{if(_cmd_init(a,b,c,d,e))return -1;}while(0)
-
-#ifndef CMD_BUILTIN
-
-#undef cmdquit
-#define cmdquit() (_cmd_quit)
-
-#if _BLD_cmd && defined(__EXPORT__)
-#define extern extern __EXPORT__
-#endif
-#if !_BLD_cmd && defined(__IMPORT__)
-#define extern extern __IMPORT__
-#endif
-
-extern int _cmd_quit;
-
-#undef extern
-
+#else
+#define CMD_CONTEXT(p) (((p)&&((Shbltin_t*)(p))->version>=20071012&&((Shbltin_t*)(p))->version<20350101)?((Shbltin_t*)(p)):0)
+#define cmdinit(a,b,c,d,e) do{if((c)&&!CMD_CONTEXT(c))c=0;if(_cmd_init(a,b,c,d,e))return -1;}while(0)
#endif
#if _BLD_cmd && defined(__EXPORT__)
diff --git a/usr/src/lib/libcmd/common/cmdinit.c b/usr/src/lib/libcmd/common/cmdinit.c
index 0a8f4359c8..bd450ebf47 100644
--- a/usr/src/lib/libcmd/common/cmdinit.c
+++ b/usr/src/lib/libcmd/common/cmdinit.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -25,19 +25,13 @@
#include <cmd.h>
-int _cmd_quit = 0;
-
int
_cmd_init(int argc, char** argv, void* context, const char* catalog, int flags)
{
register char* cp;
if (argc < 0)
- {
- _cmd_quit = 1;
return -1;
- }
- _cmd_quit = 0;
if (cp = strrchr(argv[0], '/'))
cp++;
else
diff --git a/usr/src/lib/libcmd/common/cmp.c b/usr/src/lib/libcmd/common/cmp.c
index 3baebdd8da..06223f5695 100644
--- a/usr/src/lib/libcmd/common/cmp.c
+++ b/usr/src/lib/libcmd/common/cmp.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libcmd/common/comm.c b/usr/src/lib/libcmd/common/comm.c
index 3e28867e7e..347867d656 100644
--- a/usr/src/lib/libcmd/common/comm.c
+++ b/usr/src/lib/libcmd/common/comm.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libcmd/common/cp.c b/usr/src/lib/libcmd/common/cp.c
index 3aa6b75273..c3484b0cb0 100644
--- a/usr/src/lib/libcmd/common/cp.c
+++ b/usr/src/lib/libcmd/common/cp.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -27,7 +27,7 @@
*/
static const char usage_head[] =
-"[-?@(#)$Id: cp (AT&T Research) 2006-11-21 $\n]"
+"[-?@(#)$Id: cp (AT&T Research) 2007-12-13 $\n]"
USAGE_LICENSE
;
@@ -152,7 +152,6 @@ typedef struct State_s /* program state */
int missmode; /* default missing dir mode */
int official; /* move to next view */
int op; /* {CP,LN,MV} */
- int pathsiz; /* state.path buffer size */
int perm; /* permissions to preserve */
int postsiz; /* state.path post index */
int presiz; /* state.path pre index */
@@ -163,10 +162,15 @@ typedef struct State_s /* program state */
int uid; /* caller uid */
int update; /* replace only if newer */
int verbose; /* list each file before op */
+ int wflags; /* open() for write flags */
int (*link)(const char*, const char*); /* link */
int (*stat)(const char*, struct stat*); /* stat */
+#define INITSTATE pathsiz /* (re)init state before this */
+ int pathsiz; /* state.path buffer size */
+
+
char* path; /* to pathname buffer */
char* opname; /* state.op message string */
char* suffix; /* backup suffix */
@@ -229,8 +233,6 @@ visit(State_t* state, register FTSENT* ent)
FTSENT* sub;
struct stat st;
- if (cmdquit())
- return -1;
if (ent->fts_info == FTS_DC)
{
error(2, "%s: directory causes cycle", ent->fts_path);
@@ -569,7 +571,7 @@ visit(State_t* state, register FTSENT* ent)
error(ERROR_SYSTEM|2, "%s: cannot read", ent->fts_path);
return 0;
}
- else if ((wfd = open(state->path, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, ent->fts_statp->st_mode & state->perm)) < 0)
+ else if ((wfd = open(state->path, st.st_mode ? (state->wflags & ~O_EXCL) : state->wflags, ent->fts_statp->st_mode & state->perm)) < 0)
{
error(ERROR_SYSTEM|2, "%s: cannot write", state->path);
if (ent->fts_statp->st_size > 0)
@@ -662,134 +664,144 @@ b_cp(int argc, register char** argv, void* context)
int path_resolve;
int standard;
struct stat st;
- State_t state;
+ State_t* state;
+ Shbltin_t* sh;
cmdinit(argc, argv, context, ERROR_CATALOG, ERROR_NOTIFY);
- memset(&state, 0, sizeof(state));
- state.presiz = -1;
+ if (!(sh = CMD_CONTEXT(context)) || !(state = (State_t*)sh->ptr))
+ {
+ if (!(state = newof(0, State_t, 1, 0)))
+ error(ERROR_SYSTEM|3, "out of space");
+ if (sh)
+ sh->ptr = state;
+ }
+ else
+ memset(state, 0, offsetof(State_t, INITSTATE));
+ state->presiz = -1;
backup_type = 0;
- state.flags = FTS_NOCHDIR|FTS_NOSEEDOTDIR;
- state.uid = geteuid();
- if (!(state.tmp = sfstropen()))
+ state->flags = FTS_NOCHDIR|FTS_NOSEEDOTDIR;
+ state->uid = geteuid();
+ state->wflags = O_WRONLY|O_CREAT|O_TRUNC|O_BINARY;
+ if (!state->tmp && !(state->tmp = sfstropen()))
error(ERROR_SYSTEM|3, "out of space [tmp string]");
- sfputr(state.tmp, usage_head, -1);
+ sfputr(state->tmp, usage_head, -1);
standard = !strcmp(astconf("CONFORMANCE", NiL, NiL), "standard");
switch (error_info.id[0])
{
case 'c':
case 'C':
- sfputr(state.tmp, usage_cp, -1);
- state.op = CP;
- state.stat = stat;
+ sfputr(state->tmp, usage_cp, -1);
+ state->op = CP;
+ state->stat = stat;
path_resolve = -1;
break;
case 'l':
case 'L':
- sfputr(state.tmp, usage_ln, -1);
- state.op = LN;
- state.flags |= FTS_PHYSICAL;
- state.link = link;
- state.stat = lstat;
+ sfputr(state->tmp, usage_ln, -1);
+ state->op = LN;
+ state->flags |= FTS_PHYSICAL;
+ state->link = link;
+ state->stat = lstat;
path_resolve = 1;
break;
case 'm':
case 'M':
- sfputr(state.tmp, usage_mv, -1);
- state.op = MV;
- state.flags |= FTS_PHYSICAL;
- state.preserve = 1;
- state.stat = lstat;
+ sfputr(state->tmp, usage_mv, -1);
+ state->op = MV;
+ state->flags |= FTS_PHYSICAL;
+ state->preserve = 1;
+ state->stat = lstat;
path_resolve = 1;
break;
default:
error(3, "not implemented");
break;
}
- sfputr(state.tmp, usage_tail, -1);
- if (!(usage = sfstruse(state.tmp)))
- error(ERROR_SYSTEM|3, "%s: out of space", state.path);
- state.opname = state.op == CP ? ERROR_translate(0, 0, 0, "overwrite") : ERROR_translate(0, 0, 0, "replace");
+ sfputr(state->tmp, usage_tail, -1);
+ if (!(usage = sfstruse(state->tmp)))
+ error(ERROR_SYSTEM|3, "%s: out of space", state->path);
+ state->opname = state->op == CP ? ERROR_translate(0, 0, 0, "overwrite") : ERROR_translate(0, 0, 0, "replace");
for (;;)
{
switch (optget(argv, usage))
{
case 'a':
- state.flags |= FTS_PHYSICAL;
- state.preserve = 1;
- state.recursive = 1;
+ state->flags |= FTS_PHYSICAL;
+ state->preserve = 1;
+ state->recursive = 1;
path_resolve = 1;
continue;
case 'b':
- state.backup = 1;
+ state->backup = 1;
continue;
case 'f':
- state.force = 1;
- if (state.op != CP || !standard)
- state.interactive = 0;
+ state->force = 1;
+ if (state->op != CP || !standard)
+ state->interactive = 0;
continue;
case 'h':
- state.hierarchy = 1;
+ state->hierarchy = 1;
continue;
case 'i':
- state.interactive = 1;
- if (state.op != CP || !standard)
- state.force = 0;
+ state->interactive = 1;
+ if (state->op != CP || !standard)
+ state->force = 0;
continue;
case 'l':
- state.op = LN;
- state.link = link;
- state.stat = lstat;
+ state->op = LN;
+ state->link = link;
+ state->stat = lstat;
continue;
case 'p':
- state.preserve = 1;
+ state->preserve = 1;
continue;
case 'r':
- state.recursive = 1;
+ state->recursive = 1;
if (path_resolve < 0)
path_resolve = 0;
continue;
case 's':
- state.op = LN;
- state.link = pathsetlink;
- state.stat = lstat;
+ state->op = LN;
+ state->link = pathsetlink;
+ state->stat = lstat;
continue;
case 'u':
- state.update = 1;
+ state->update = 1;
continue;
case 'v':
- state.verbose = 1;
+ state->verbose = 1;
continue;
case 'x':
- state.flags |= FTS_XDEV;
+ state->flags |= FTS_XDEV;
continue;
case 'F':
#if _lib_fsync
- state.sync = 1;
+ state->sync = 1;
#else
error(1, "%s not implemented on this system", opt_info.name);
#endif
continue;
case 'H':
- state.flags |= FTS_META|FTS_PHYSICAL;
+ state->flags |= FTS_META|FTS_PHYSICAL;
path_resolve = 1;
continue;
case 'L':
- state.flags &= ~FTS_PHYSICAL;
+ state->flags &= ~FTS_PHYSICAL;
path_resolve = 1;
continue;
case 'P':
- state.flags &= ~FTS_META;
- state.flags |= FTS_PHYSICAL;
+ state->flags &= ~FTS_META;
+ state->flags |= FTS_PHYSICAL;
path_resolve = 1;
continue;
case 'R':
- state.recursive = 1;
- state.flags &= ~FTS_META;
- state.flags |= FTS_PHYSICAL;
+ state->recursive = 1;
+ state->flags &= ~FTS_META;
+ state->flags |= FTS_PHYSICAL;
path_resolve = 1;
continue;
case 'S':
- state.suffix = opt_info.arg;
+ state->suffix = opt_info.arg;
continue;
case 'V':
backup_type = opt_info.arg;
@@ -814,15 +826,19 @@ b_cp(int argc, register char** argv, void* context)
error(3, "out of space");
memcpy(v, argv, (argc + 1) * sizeof(char*));
argv = v;
- if (!argc && !standard)
+ if (!standard)
{
- argc++;
- argv[1] = (char*)dot;
+ state->wflags |= O_EXCL;
+ if (!argc)
+ {
+ argc++;
+ argv[1] = (char*)dot;
+ }
}
- if (state.backup)
+ if (state->backup)
{
if (!(file = backup_type) && !(backup_type = getenv("VERSION_CONTROL")))
- state.backup = BAK_existing;
+ state->backup = BAK_existing;
else
switch (strkey(backup_type))
{
@@ -834,7 +850,7 @@ b_cp(int argc, register char** argv, void* context)
case HASHKEY1('e'):
case HASHKEY3('n','i','l'):
case HASHKEY2('n','i'):
- state.backup = BAK_existing;
+ state->backup = BAK_existing;
break;
case HASHKEY5('n','e','v','e','r'):
case HASHKEY4('n','e','v','e'):
@@ -846,7 +862,7 @@ b_cp(int argc, register char** argv, void* context)
case HASHKEY3('s','i','m'):
case HASHKEY2('s','i'):
case HASHKEY1('s'):
- state.backup = BAK_simple;
+ state->backup = BAK_simple;
break;
case HASHKEY6('n','u','m','b','e','r'):
case HASHKEY5('n','u','m','b','e'):
@@ -854,21 +870,21 @@ b_cp(int argc, register char** argv, void* context)
case HASHKEY3('n','u','m'):
case HASHKEY2('n','u'):
case HASHKEY1('t'):
- state.backup = BAK_number;
+ state->backup = BAK_number;
break;
default:
if (file)
error(2, "%s: unknown backup type", backup_type);
break;
}
- if (!state.suffix && !(state.suffix = getenv("SIMPLE_BACKUP_SUFFIX")))
- state.suffix = "~";
- state.suflen = strlen(state.suffix);
+ if (!state->suffix && !(state->suffix = getenv("SIMPLE_BACKUP_SUFFIX")))
+ state->suffix = "~";
+ state->suflen = strlen(state->suffix);
}
if (argc <= 0 || error_info.errors)
error(ERROR_USAGE|4, "%s", optusage(NiL));
if (!path_resolve)
- state.flags |= fts_flags();
+ state->flags |= fts_flags();
file = argv[argc];
argv[argc] = 0;
if (s = strrchr(file, '/'))
@@ -880,35 +896,34 @@ b_cp(int argc, register char** argv, void* context)
}
if (file != (char*)dot)
pathcanon(file, 0);
- if (!(state.directory = !stat(file, &st) && S_ISDIR(st.st_mode)) && argc > 1)
+ if (!(state->directory = !stat(file, &st) && S_ISDIR(st.st_mode)) && argc > 1)
error(ERROR_USAGE|4, "%s", optusage(NiL));
- if (s && !state.directory)
+ if (s && !state->directory)
error(3, "%s: not a directory", file);
- if ((state.fs3d = fs3d(FS3D_TEST)) && strmatch(file, "...|*/...|.../*"))
- state.official = 1;
- state.postsiz = strlen(file);
- state.pathsiz = roundof(state.postsiz + 2, PATH_CHUNK);
- if (!(state.path = newof(0, char, state.pathsiz, 0)))
+ if ((state->fs3d = fs3d(FS3D_TEST)) && strmatch(file, "...|*/...|.../*"))
+ state->official = 1;
+ state->postsiz = strlen(file);
+ if (state->pathsiz < roundof(state->postsiz + 2, PATH_CHUNK) && !(state->path = newof(state->path, char, state->pathsiz = roundof(state->postsiz + 2, PATH_CHUNK), 0)))
error(3, "out of space");
- memcpy(state.path, file, state.postsiz + 1);
- if (state.directory && state.path[state.postsiz - 1] != '/')
- state.path[state.postsiz++] = '/';
- if (state.hierarchy)
+ memcpy(state->path, file, state->postsiz + 1);
+ if (state->directory && state->path[state->postsiz - 1] != '/')
+ state->path[state->postsiz++] = '/';
+ if (state->hierarchy)
{
- if (!state.directory)
+ if (!state->directory)
error(3, "%s: last argument must be a directory", file);
- state.missmode = st.st_mode;
+ state->missmode = st.st_mode;
}
- state.perm = state.uid ? S_IPERM : (S_IPERM & ~S_ISVTX);
- if (!state.recursive)
- state.flags |= FTS_TOP;
- if (fts = fts_open(argv, state.flags, NiL))
+ state->perm = state->uid ? S_IPERM : (S_IPERM & ~S_ISVTX);
+ if (!state->recursive)
+ state->flags |= FTS_TOP;
+ if (fts = fts_open(argv, state->flags, NiL))
{
- while ((ent = fts_read(fts)) && !visit(&state, ent));
+ while (!sh_checksig(context) && (ent = fts_read(fts)) && !visit(state, ent));
fts_close(fts);
}
- else if (state.link != pathsetlink)
- switch (state.op)
+ else if (state->link != pathsetlink)
+ switch (state->op)
{
case CP:
error(ERROR_SYSTEM|2, "%s: cannot copy", argv[0]);
@@ -920,8 +935,7 @@ b_cp(int argc, register char** argv, void* context)
error(ERROR_SYSTEM|2, "%s: cannot move", argv[0]);
break;
}
- else if ((*state.link)(*argv, state.path))
- error(ERROR_SYSTEM|2, "%s: cannot link to %s", *argv, state.path);
- free(state.path);
+ else if ((*state->link)(*argv, state->path))
+ error(ERROR_SYSTEM|2, "%s: cannot link to %s", *argv, state->path);
return error_info.errors != 0;
}
diff --git a/usr/src/lib/libcmd/common/cut.c b/usr/src/lib/libcmd/common/cut.c
index 732d1784da..305ebdaf9d 100644
--- a/usr/src/lib/libcmd/common/cut.c
+++ b/usr/src/lib/libcmd/common/cut.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -29,7 +29,7 @@
*/
static const char usage[] =
-"[-?\n@(#)$Id: cut (AT&T Research) 2007-01-23 $\n]"
+"[-?\n@(#)$Id: cut (AT&T Research) 2008-04-01 $\n]"
USAGE_LICENSE
"[+NAME?cut - cut out selected columns or fields of each line of a file]"
"[+DESCRIPTION?\bcut\b bytes, characters, or character-delimited fields "
@@ -249,7 +249,7 @@ static int advance(const char *str, register int n, register int inlen)
* cut each line of file <fdin> and put results to <fdout> using list <list>
*/
-static int cutcols(Cut_t *cuthdr,Sfio_t *fdin,Sfio_t *fdout)
+static void cutcols(Cut_t *cuthdr,Sfio_t *fdin,Sfio_t *fdout)
{
register int c, ncol=0,len;
register const int *lp = cuthdr->list;
@@ -274,7 +274,7 @@ static int cutcols(Cut_t *cuthdr,Sfio_t *fdin,Sfio_t *fdout)
ncol++;
ncol -= c;
if(!skip && sfwrite(fdout,(char*)inp,c)<0)
- return(-1);
+ return;
inp += c;
if(ncol)
break;
@@ -285,7 +285,6 @@ static int cutcols(Cut_t *cuthdr,Sfio_t *fdin,Sfio_t *fdout)
if(!cuthdr->nlflag && (skip || cuthdr->reclen))
sfputc(fdout,cuthdr->ldelim);
}
- return(c);
}
/*
@@ -295,7 +294,7 @@ static int cutcols(Cut_t *cuthdr,Sfio_t *fdin,Sfio_t *fdout)
#define endline(c) (((signed char)-1)<0?(c)<0:(c)==((char)-1))
-static int cutfields(Cut_t *cuthdr,Sfio_t *fdin,Sfio_t *fdout)
+static void cutfields(Cut_t *cuthdr,Sfio_t *fdin,Sfio_t *fdout)
{
register unsigned char *cp;
register int c, nfields;
@@ -397,7 +396,7 @@ static int cutfields(Cut_t *cuthdr,Sfio_t *fdin,Sfio_t *fdout)
goto failed;
}
/* see whether to save in tmp file */
- if(nodelim && inword && !cuthdr->sflag && (c=cp-first)>0)
+ if(inword && nodelim && !cuthdr->sflag && (c=cp-first)>0)
{
/* copy line to tmpfile in case no fields */
if(!fdtmp)
@@ -409,7 +408,6 @@ static int cutfields(Cut_t *cuthdr,Sfio_t *fdin,Sfio_t *fdout)
failed:
if(fdtmp)
sfclose(fdtmp);
- return(0);
}
int
@@ -506,7 +504,8 @@ b_cut(int argc,char *argv[], void* context)
cutcols(cuthdr,fp,sfstdout);
if(fp!=sfstdin)
sfclose(fp);
- }
- while(cp= *argv++);
+ } while(cp = *argv++);
+ if (sfsync(sfstdout))
+ error(ERROR_system(0), "write error");
return(error_info.errors?1:0);
}
diff --git a/usr/src/lib/libcmd/common/date.c b/usr/src/lib/libcmd/common/date.c
index b2ea46d146..1984570b2d 100644
--- a/usr/src/lib/libcmd/common/date.c
+++ b/usr/src/lib/libcmd/common/date.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -27,7 +27,7 @@
*/
static const char usage[] =
-"[-?\n@(#)$Id: date (AT&T Research) 2007-03-28 $\n]"
+"[-?\n@(#)$Id: date (AT&T Research) 2007-05-21 $\n]"
USAGE_LICENSE
"[+NAME?date - set/list/convert dates]"
"[+DESCRIPTION?\bdate\b sets the current date and time (with appropriate"
@@ -96,7 +96,7 @@ USAGE_LICENSE
" [+e?blank padded day of month number]"
" [+E?unpadded day of month number]"
" [+f?locale default override date format]"
-" [+F?locale default date format]"
+" [+F?%ISO 8601:2000 standard date format; equivalent to Y-%m-%d]"
" [+g?\bls\b(1) \b-l\b recent date with \ahh:mm\a]"
" [+G?\bls\b(1) \b-l\b distant date with \ayyyy\a]"
" [+h?abbreviated month name]"
@@ -108,6 +108,7 @@ USAGE_LICENSE
" [+k?\bdate\b(1) style date]"
" [+K?all numeric date; equivalent to \b%Y-%m-%d+%H:%M:%S\b]"
" [+l?\bls\b(1) \b-l\b date; equivalent to \b%Q/%g/%G/\b]"
+" [+L?locale default date format]"
" [+m?month number]"
" [+M?minutes]"
" [+n?newline character]"
@@ -206,7 +207,7 @@ typedef struct Fmt
*/
static int
-settime(const char* cmd, Time_t now, int adjust, int network)
+settime(void* context, const char* cmd, Time_t now, int adjust, int network)
{
char* s;
char** argv;
@@ -222,13 +223,13 @@ settime(const char* cmd, Time_t now, int adjust, int network)
*argv++ = s;
if (streq(astconf("UNIVERSE", NiL, NiL), "att"))
{
- tmxfmt(buf, sizeof(buf), "%m%d%H" "%M" "%Y.%S", now);
+ tmxfmt(buf, sizeof(buf), "%m%d%H" "%M%Y.%S", now);
if (adjust)
*argv++ = "-a";
}
else
{
- tmxfmt(buf, sizeof(buf), "%Y" "%m%d%H" "%M.%S", now);
+ tmxfmt(buf, sizeof(buf), "%Y%m%d%H" "%M.%S", now);
if (network)
*argv++ = "-n";
if (tm_info.flags & TM_UTC)
@@ -236,7 +237,7 @@ settime(const char* cmd, Time_t now, int adjust, int network)
}
*argv++ = buf;
*argv = 0;
- if (!procrun(s, args))
+ if (!sh_run(context, argv - args, args))
return 0;
}
return -1;
@@ -473,7 +474,7 @@ b_date(int argc, register char** argv, void* context)
tmxfmt(buf, sizeof(buf), format, now);
sfprintf(sfstdout, "%s\n", buf);
}
- else if (settime(cmd, now, increment, network))
+ else if (settime(context, cmd, now, increment, network))
error(ERROR_SYSTEM|3, "cannot set system time");
}
while (fmts != &fmt)
diff --git a/usr/src/lib/libcmd/common/dirname.c b/usr/src/lib/libcmd/common/dirname.c
index f4a3c820c3..71e69d8594 100644
--- a/usr/src/lib/libcmd/common/dirname.c
+++ b/usr/src/lib/libcmd/common/dirname.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libcmd/common/expr.c b/usr/src/lib/libcmd/common/expr.c
index 1baee2435e..ff5d45e039 100644
--- a/usr/src/lib/libcmd/common/expr.c
+++ b/usr/src/lib/libcmd/common/expr.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -27,7 +27,7 @@
*/
static const char usage[] =
-"[-?\n@(#)$Id: expr (AT&T Research) 2004-05-27 $\n]"
+"[-?\n@(#)$Id: expr (AT&T Research) 2008-01-30 $\n]"
USAGE_LICENSE
"[+NAME?expr - evaluate arguments as an expression]"
"[+DESCRIPTION?\bexpr\b evaluates an expression given as arguments and writes "
@@ -240,7 +240,7 @@ static int getnode(State_t* state, Node_t *np)
if (!(cp = *state->arglist++))
error(ERROR_exit(2), "position argument expected");
i = strtol(cp, &ep, 10);
- if (*ep || --i <= 0)
+ if (*ep || --i < 0)
i = -1;
if (!(cp = *state->arglist++))
error(ERROR_exit(2), "length argument expected");
diff --git a/usr/src/lib/libcmd/common/fds.c b/usr/src/lib/libcmd/common/fds.c
index b7e9fb2e88..bafa2c09f7 100644
--- a/usr/src/lib/libcmd/common/fds.c
+++ b/usr/src/lib/libcmd/common/fds.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,7 +21,7 @@
#pragma prototyped
static const char usage[] =
-"[-?\n@(#)$Id: fds (AT&T Research) 2006-10-26 $\n]"
+"[-?\n@(#)$Id: fds (AT&T Research) 2008-08-26 $\n]"
USAGE_LICENSE
"[+NAME?fds - list open file descriptor status]"
"[+DESCRIPTION?\bfds\b lists the status for each open file descriptor. "
@@ -29,7 +29,7 @@ USAGE_LICENSE
"calling shell, otherwise it lists the file descriptors passed across "
"\bexec\b(2).]"
"[l:long?List file descriptor details.]"
-"[+SEE ALSO?\blogname\b(1), \bwho\b(1), \bgetgroups\b(2)]"
+"[+SEE ALSO?\blogname\b(1), \bwho\b(1), \bgetgroups\b(2), \bgetsockname\b(2), \bgetsockopts\b(2)]"
;
#include <cmd.h>
@@ -52,6 +52,108 @@ USAGE_LICENSE
#define major(x) (int)(((unsigned int)(x)>>8)&0xff)
#endif
+#undef getconf
+#define getconf(x) strtol(astconf(x,NiL,NiL),NiL,0)
+
+#ifdef S_IFSOCK
+
+typedef struct NV_s
+{
+ const char* name;
+ int value;
+} NV_t;
+
+static const NV_t family[] =
+{
+#ifdef AF_LOCAL
+ "pipe", AF_LOCAL,
+#endif
+#ifdef AF_UNIX
+ "pipe", AF_UNIX,
+#endif
+#ifdef AF_FILE
+ "FILE", AF_FILE,
+#endif
+#ifdef AF_INET
+ "INET", AF_INET,
+#endif
+#ifdef AF_AX25
+ "AX25", AF_AX25,
+#endif
+#ifdef AF_IPX
+ "IPX", AF_IPX,
+#endif
+#ifdef AF_APPLETALK
+ "APPLETALK", AF_APPLETALK,
+#endif
+#ifdef AF_NETROM
+ "NETROM", AF_NETROM,
+#endif
+#ifdef AF_BRIDGE
+ "BRIDGE", AF_BRIDGE,
+#endif
+#ifdef AF_ATMPVC
+ "ATMPVC", AF_ATMPVC,
+#endif
+#ifdef AF_X25
+ "X25", AF_X25,
+#endif
+#ifdef AF_INET6
+ "INET6", AF_INET6,
+#endif
+#ifdef AF_ROSE
+ "ROSE", AF_ROSE,
+#endif
+#ifdef AF_DECnet
+ "DECnet", AF_DECnet,
+#endif
+#ifdef AF_NETBEUI
+ "NETBEUI", AF_NETBEUI,
+#endif
+#ifdef AF_SECURITY
+ "SECURITY", AF_SECURITY,
+#endif
+#ifdef AF_KEY
+ "KEY", AF_KEY,
+#endif
+#ifdef AF_NETLINK
+ "NETLINK", AF_NETLINK,
+#endif
+#ifdef AF_ROUTE
+ "ROUTE", AF_ROUTE,
+#endif
+#ifdef AF_PACKET
+ "PACKET", AF_PACKET,
+#endif
+#ifdef AF_ASH
+ "ASH", AF_ASH,
+#endif
+#ifdef AF_ECONET
+ "ECONET", AF_ECONET,
+#endif
+#ifdef AF_ATMSVC
+ "ATMSVC", AF_ATMSVC,
+#endif
+#ifdef AF_SNA
+ "SNA", AF_SNA,
+#endif
+#ifdef AF_IRDA
+ "IRDA", AF_IRDA,
+#endif
+#ifdef AF_PPPOX
+ "PPPOX", AF_PPPOX,
+#endif
+#ifdef AF_WANPIPE
+ "WANPIPE", AF_WANPIPE,
+#endif
+#ifdef AF_BLUETOOTH
+ "BLUETOOTH", AF_BLUETOOTH,
+#endif
+ 0
+};
+
+#endif
+
int
b_fds(int argc, char** argv, void* context)
{
@@ -61,13 +163,21 @@ b_fds(int argc, char** argv, void* context)
register char* x;
int flags;
int details;
+ int open_max;
struct stat st;
#ifdef S_IFSOCK
struct sockaddr_in addr;
+ char* a;
+ unsigned char* b;
+ unsigned char* e;
+ socklen_t addrlen;
socklen_t len;
int type;
+ int port;
int prot;
- char num[32];
+ char nam[256];
+ char num[64];
+ char fam[64];
#endif
cmdinit(argc, argv, context, ERROR_CATALOG, 0);
@@ -91,78 +201,142 @@ b_fds(int argc, char** argv, void* context)
argv += opt_info.index;
if (error_info.errors || *argv)
error(ERROR_USAGE|4, "%s", optusage(NiL));
- for (i = 0; i <= OPEN_MAX; i++)
+ if ((open_max = getconf("OPEN_MAX")) <= 0)
+ open_max = OPEN_MAX;
+ for (i = 0; i <= open_max; i++)
+ {
if (fstat(i, &st))
- /* not open */;
- else if (details)
{
- if ((flags = fcntl(i, F_GETFL, (char*)0)) == -1)
- m = "--";
- else
- switch (flags & (O_RDONLY|O_WRONLY|O_RDWR))
- {
- case O_RDONLY:
- m = "r-";
- break;
- case O_WRONLY:
- m = "-w";
- break;
- case O_RDWR:
- m = "rw";
- break;
- default:
- m = "??";
- break;
- }
- x = (fcntl(i, F_GETFD, (char*)0) > 0) ? "x" : "-";
- if (isatty(i) && (s = ttyname(i)))
- sfprintf(sfstdout, "%02d %s%s %s %s\n", i, m, x, fmtmode(st.st_mode, 0), s);
+ /* not open */
+ continue;
+ }
+ if (!details)
+ {
+ sfprintf(sfstdout, "%d\n", i);
+ continue;
+ }
+ if ((flags = fcntl(i, F_GETFL, (char*)0)) == -1)
+ m = "--";
+ else
+ switch (flags & (O_RDONLY|O_WRONLY|O_RDWR))
+ {
+ case O_RDONLY:
+ m = "r-";
+ break;
+ case O_WRONLY:
+ m = "-w";
+ break;
+ case O_RDWR:
+ m = "rw";
+ break;
+ default:
+ m = "??";
+ break;
+ }
+ x = (fcntl(i, F_GETFD, (char*)0) > 0) ? "x" : "-";
+ if (isatty(i) && (s = ttyname(i)))
+ {
+ sfprintf(sfstdout, "%02d %s%s %s %s\n", i, m, x, fmtmode(st.st_mode, 0), s);
+ continue;
+ }
#ifdef S_IFSOCK
- else if ((len = sizeof(addr))
- && !getsockname(i, (struct sockaddr*)&addr, (void*)&len)
- && len == sizeof(addr)
- && addr.sin_family == AF_INET
+ addrlen = sizeof(addr);
+ memset(&addr, 0, addrlen);
+ if (!getsockname(i, (struct sockaddr*)&addr, (void*)&addrlen))
+ {
+ type = 0;
+ prot = 0;
#ifdef SO_TYPE
- && (len = sizeof(type))
- && !getsockopt(i, SOL_SOCKET, SO_TYPE, (void*)&type, (void*)&len)
- && len == sizeof(type)
-#else
- && !(type = 0)
+ len = sizeof(type);
+ if (getsockopt(i, SOL_SOCKET, SO_TYPE, (void*)&type, (void*)&len))
+ type = -1;
#endif
#ifdef SO_PROTOTYPE
- && (len = sizeof(prot))
- && (!getsockopt(i, SOL_SOCKET, SO_PROTOTYPE, (void*)&prot, (void*)&len) || !(prot = 0))
-#else
- && !(prot = 0)
+ len = sizeof(prot);
+ if (getsockopt(i, SOL_SOCKET, SO_PROTOTYPE, (void*)&prot, (void*)&len))
+ prot = -1;
#endif
- )
+ if (!st.st_mode)
+ st.st_mode = S_IFSOCK|S_IRUSR|S_IWUSR;
+ s = 0;
+ switch (type)
{
- if (!st.st_mode)
- st.st_mode = S_IFSOCK|S_IRUSR|S_IWUSR;
- s = 0;
- switch (type)
+ case SOCK_DGRAM:
+ switch (addr.sin_family)
{
- case SOCK_DGRAM:
+ case AF_INET:
+#ifdef AF_INET6
+ case AF_INET6:
+#endif
s = "udp";
break;
- case SOCK_STREAM:
- if (prot == 0)
- s = "tcp";
+ }
+ break;
+ case SOCK_STREAM:
+ switch (addr.sin_family)
+ {
+ case AF_INET:
+#ifdef AF_INET6
+ case AF_INET6:
+#endif
#ifdef IPPROTO_SCTP
- else if (prot == IPPROTO_SCTP)
+ if (prot == IPPROTO_SCTP)
s = "sctp";
+ else
#endif
+ s = "tcp";
break;
}
- if (!s)
- sfprintf(sfstdout, s = num, "type.%d.prot.%d", type, prot);
- sfprintf(sfstdout, "%02d %s%s %s /dev/%s/%s/%d\n", i, m, x, fmtmode(st.st_mode, 0), s, inet_ntoa(addr.sin_addr), ntohs(addr.sin_port));
+ break;
+#ifdef SOCK_RAW
+ case SOCK_RAW:
+ s = "raw";
+ break;
+#endif
+#ifdef SOCK_RDM
+ case SOCK_RDM:
+ s = "rdm";
+ break;
+#endif
+#ifdef SOCK_SEQPACKET
+ case SOCK_SEQPACKET:
+ s = "seqpacket";
+ break;
+#endif
}
+ if (!s)
+ {
+ for (type = 0; family[type].name && family[type].value != addr.sin_family; type++);
+ if (!(s = (char*)family[type].name))
+ sfsprintf(s = num, sizeof(num), "family.%d", addr.sin_family);
+ }
+ port = 0;
+#ifdef INET6_ADDRSTRLEN
+ if (a = (char*)inet_ntop(addr.sin_family, &addr.sin_addr, nam, sizeof(nam)))
+ port = ntohs(addr.sin_port);
+ else
#endif
+ if (addr.sin_family == AF_INET)
+ {
+ a = inet_ntoa(addr.sin_addr);
+ port = ntohs(addr.sin_port);
+ }
+ else
+ {
+ a = fam;
+ e = (b = (unsigned char*)&addr) + addrlen;
+ while (b < e && a < &fam[sizeof(fam)-1])
+ a += sfsprintf(a, &fam[sizeof(fam)] - a - 1, ".%d", *b++);
+ a = a == fam ? "0" : fam + 1;
+ }
+ if (port)
+ sfprintf(sfstdout, "%02d %s%s %s /dev/%s/%s/%d\n", i, m, x, fmtmode(st.st_mode, 0), s, a, port);
else
- sfprintf(sfstdout, "%02d %s%s %s /dev/inode/%u/%u\n", i, m, x, fmtmode(st.st_mode, 0), st.st_dev, st.st_ino);
+ sfprintf(sfstdout, "%02d %s%s %s /dev/%s/%s\n", i, m, x, fmtmode(st.st_mode, 0), s, a);
+ continue;
}
- else
- sfprintf(sfstdout, "%d\n", i);
+#endif
+ sfprintf(sfstdout, "%02d %s%s %s /dev/inode/%u/%u\n", i, m, x, fmtmode(st.st_mode, 0), st.st_dev, st.st_ino);
+ }
return 0;
}
diff --git a/usr/src/lib/libcmd/common/fmt.c b/usr/src/lib/libcmd/common/fmt.c
index 2cbcc9c8ea..95f5fd4528 100644
--- a/usr/src/lib/libcmd/common/fmt.c
+++ b/usr/src/lib/libcmd/common/fmt.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libcmd/common/fold.c b/usr/src/lib/libcmd/common/fold.c
index 459ad35850..6541da8035 100644
--- a/usr/src/lib/libcmd/common/fold.c
+++ b/usr/src/lib/libcmd/common/fold.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libcmd/common/getconf.c b/usr/src/lib/libcmd/common/getconf.c
index d30d002c0b..bceae0e167 100644
--- a/usr/src/lib/libcmd/common/getconf.c
+++ b/usr/src/lib/libcmd/common/getconf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -27,7 +27,7 @@
*/
static const char usage[] =
-"[-?\n@(#)$Id: getconf (AT&T Research) 2007-02-07 $\n]"
+"[-?\n@(#)$Id: getconf (AT&T Research) 2008-04-24 $\n]"
USAGE_LICENSE
"[+NAME?getconf - get configuration values]"
"[+DESCRIPTION?\bgetconf\b displays the system configuration value for"
@@ -36,6 +36,8 @@ USAGE_LICENSE
" directory if \apath\a is omitted. If \avalue\a is specified then"
" \bgetconf\b attempts to change the process local value to \avalue\a."
" \b-\b may be used in place of \apath\a when it is not relevant."
+" If \apath\a is \b=\b then the the \avalue\a is cached and used"
+" for subsequent tests in the calling and all child processes."
" Only \bwritable\b variables may be set; \breadonly\b variables"
" cannot be changed.]"
"[+?The current value for \aname\a is written to the standard output. If"
@@ -121,7 +123,7 @@ USAGE_LICENSE
typedef struct Path_s
{
- char* path;
+ const char* path;
int len;
} Path_t;
@@ -131,8 +133,8 @@ b_getconf(int argc, char** argv, void* context)
register char* name;
register char* path;
register char* value;
- register char* s;
- register char* t;
+ register const char* s;
+ register const char* t;
char* pattern;
char* native;
char* cmd;
@@ -387,7 +389,8 @@ b_getconf(int argc, char** argv, void* context)
* don't blame us for crappy diagnostics
*/
- if ((n = procrun(cmd, oargv)) >= EXIT_NOEXEC)
+ oargv[0] = cmd;
+ if ((n = sh_run(context, argc, oargv)) >= EXIT_NOEXEC)
error(ERROR_SYSTEM|2, "%s: exec error [%d]", cmd, n);
return n;
}
diff --git a/usr/src/lib/libcmd/common/head.c b/usr/src/lib/libcmd/common/head.c
index 707d0478a8..cee683e81a 100644
--- a/usr/src/lib/libcmd/common/head.c
+++ b/usr/src/lib/libcmd/common/head.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -27,7 +27,7 @@
*/
static const char usage[] =
-"[-?\n@(#)$Id: head (AT&T Research) 2006-09-27 $\n]"
+"[-n?\n@(#)$Id: head (AT&T Research) 2006-09-27 $\n]"
USAGE_LICENSE
"[+NAME?head - output beginning portion of one or more files ]"
"[+DESCRIPTION?\bhead\b copies one or more input files to standard "
diff --git a/usr/src/lib/libcmd/common/id.c b/usr/src/lib/libcmd/common/id.c
index b880659ad5..a1820e3bf7 100644
--- a/usr/src/lib/libcmd/common/id.c
+++ b/usr/src/lib/libcmd/common/id.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libcmd/common/join.c b/usr/src/lib/libcmd/common/join.c
index 1687c898ca..12b40bc31b 100644
--- a/usr/src/lib/libcmd/common/join.c
+++ b/usr/src/lib/libcmd/common/join.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -134,6 +134,7 @@ typedef struct
int ignorecase;
char* same;
int samesize;
+ void* context;
File_t file[2];
} Join_t;
@@ -269,7 +270,7 @@ getrec(Join_t* jp, int index, int discard)
register char* cp;
register int n = 0;
- if (cmdquit())
+ if (sh_checksig(jp->context))
return 0;
if (discard && fp->discard)
sfraise(fp->iop, SFSK_DISCARD, NiL);
@@ -666,6 +667,7 @@ b_join(int argc, char** argv, void* context)
#endif
if (!(jp = init()))
error(ERROR_system(1),"out of space");
+ jp->context = context;
for (;;)
{
switch (n = optget(argv, usage))
diff --git a/usr/src/lib/libcmd/common/llib-lcmd b/usr/src/lib/libcmd/common/llib-lcmd
index 8908e1c639..f87a732fa8 100644
--- a/usr/src/lib/libcmd/common/llib-lcmd
+++ b/usr/src/lib/libcmd/common/llib-lcmd
@@ -19,67 +19,15 @@
* CDDL HEADER END
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* lib/libcmd/common/llib-lcmd
*
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*LINTLIBRARY*/
/*PROTOLIB1*/
#include <cmd.h>
#include <cmdext.h>
-
-/* automatically generated data start here */
-extern int STANDALONE(int, char**, void*);
-extern int cmdrecurse(int, char**, int, char**);
-extern int b_basename(int, char**, void*);
-extern int b_cat(int, char**, void*);
-extern int b_chgrp(int, char**, void*);
-extern int b_chmod(int, char**, void*);
-extern int b_chown(int, char**, void*);
-extern int b_cmp(int, char**, void*);
-extern int b_comm(int, char**, void*);
-extern int b_cp(int, char**, void*);
-extern int b_cut(int, char**, void*);
-extern int b_date(int, char**, void*);
-extern int b_dirname(int, char**, void*);
-extern int b_expr(int, char**, void*);
-extern int b_fds(int, char**, void*);
-extern int b_fmt(int, char**, void*);
-extern int b_fold(int, char**, void*);
-extern int b_getconf(int, char**, void*);
-extern int b_head(int, char**, void*);
-extern int b_id(int, char**, void*);
-extern int b_join(int, char**, void*);
-extern int b_ln(int, char**, void*);
-extern int b_logname(int, char**, void*);
-extern int b_mkdir(int, char**, void*);
-extern int b_mkfifo(int, char**, void*);
-extern int b_mv(int, char**, void*);
-extern int b_paste(int, char**, void*);
-extern int b_pathchk(int, char**, void*);
-extern int b_rev(int, char**, void*);
-extern int b_rm(int, char**, void*);
-extern int b_rmdir(int, char**, void*);
-extern int b_stty(int, char**, void*);
-extern int b_tail(int, char**, void*);
-extern int b_tee(int, char**, void*);
-extern int b_tty(int, char**, void*);
-extern int b_uname(int, char**, void*);
-extern int b_uniq(int, char**, void*);
-extern int b_wc(int, char**, void*);
-/* end of automatically generated data */
-
-/*
- * The |def*()| functions are the historical contents of Solaris
- * libcmd. They have been moved to libc and libcmd contains only
- * filter symbols for them, redirecting to libc.
- */
-extern int defopen(char *fn);
-extern char *defread(char *cp);
-extern int defcntl(int cmd, int newflags);
diff --git a/usr/src/lib/libcmd/common/ln.c b/usr/src/lib/libcmd/common/ln.c
index 9adb32e3fd..90a6190504 100644
--- a/usr/src/lib/libcmd/common/ln.c
+++ b/usr/src/lib/libcmd/common/ln.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libcmd/common/logname.c b/usr/src/lib/libcmd/common/logname.c
index fe771e95ed..a142653345 100644
--- a/usr/src/lib/libcmd/common/logname.c
+++ b/usr/src/lib/libcmd/common/logname.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libcmd/common/md5sum.c b/usr/src/lib/libcmd/common/md5sum.c
index 11977d008e..f4f7e6ad9b 100644
--- a/usr/src/lib/libcmd/common/md5sum.c
+++ b/usr/src/lib/libcmd/common/md5sum.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libcmd/common/mkdir.c b/usr/src/lib/libcmd/common/mkdir.c
index df47adc11c..596ef2b6b8 100644
--- a/usr/src/lib/libcmd/common/mkdir.c
+++ b/usr/src/lib/libcmd/common/mkdir.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -27,7 +27,7 @@
*/
static const char usage[] =
-"[-?\n@(#)$Id: mkdir (AT&T Research) 2006-08-27 $\n]"
+"[-?\n@(#)$Id: mkdir (AT&T Research) 2007-04-25 $\n]"
USAGE_LICENSE
"[+NAME?mkdir - make directories]"
"[+DESCRIPTION?\bmkdir\b creates one or more directories. By "
@@ -70,6 +70,7 @@ b_mkdir(int argc, char** argv, void* context)
register int pflag = 0;
char* name;
mode_t dmode;
+ struct stat st;
cmdinit(argc, argv, context, ERROR_CATALOG, 0);
while (n = optget(argv, usage)) switch (n)
@@ -142,7 +143,19 @@ b_mkdir(int argc, char** argv, void* context)
error(ERROR_system(0), "%s:", name);
break;
}
- *arg = n;
+ if (!(*arg = n) && (mode & (S_ISVTX|S_ISUID|S_ISGID)))
+ {
+ if (stat(name, &st))
+ {
+ error(ERROR_system(0), "%s: cannot stat", name);
+ break;
+ }
+ if ((st.st_mode & (S_ISVTX|S_ISUID|S_ISGID)) != (mode & (S_ISVTX|S_ISUID|S_ISGID)) && chmod(name, mode))
+ {
+ error(ERROR_system(0), "%s: cannot change mode from %s to %s", name, fmtperm(st.st_mode & (S_ISVTX|S_ISUID|S_ISGID)), fmtperm(mode));
+ break;
+ }
+ }
}
}
}
diff --git a/usr/src/lib/libcmd/common/mkfifo.c b/usr/src/lib/libcmd/common/mkfifo.c
index cffcab1e81..7bc56747f7 100644
--- a/usr/src/lib/libcmd/common/mkfifo.c
+++ b/usr/src/lib/libcmd/common/mkfifo.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libcmd/common/mv.c b/usr/src/lib/libcmd/common/mv.c
index cf4e6785dd..ec08bea2e4 100644
--- a/usr/src/lib/libcmd/common/mv.c
+++ b/usr/src/lib/libcmd/common/mv.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libcmd/common/paste.c b/usr/src/lib/libcmd/common/paste.c
index 5aaeb369ac..ce1dcef087 100644
--- a/usr/src/lib/libcmd/common/paste.c
+++ b/usr/src/lib/libcmd/common/paste.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -29,7 +29,7 @@
*/
static const char usage[] =
-"[-?\n@(#)$Id: paste (AT&T Research) 1999-06-22 $\n]"
+"[-?\n@(#)$Id: paste (AT&T Research) 2008-04-01 $\n]"
USAGE_LICENSE
"[+NAME?paste - merge lines of files]"
"[+DESCRIPTION?\bpaste\b concatenates the corresponding lines of a "
@@ -211,36 +211,24 @@ b_paste(int argc,register char *argv[], void* context)
if(!cp || streq(cp,"-"))
fp = sfstdin;
else if(!(fp = sfopen(NiL,cp,"r")))
- {
error(ERROR_system(0),"%s: cannot open",cp);
- error_info.errors = 1;
- }
if(fp && sflag)
{
if(spaste(fp,sfstdout,delim,dlen) < 0)
- {
error(ERROR_system(0),"write failed");
- error_info.errors = 1;
- }
if(fp!=sfstdin)
sfclose(fp);
}
- else
+ else if(!sflag)
streams[n++] = fp;
- }
- while(cp= *argv++);
+ } while(cp= *argv++);
if(!sflag)
{
if(error_info.errors==0 && paste(n,streams,sfstdout,delim,dlen) < 0)
- {
error(ERROR_system(0),"write failed");
- error_info.errors = 1;
- }
while(--n>=0)
- {
if((fp=streams[n]) && fp!=sfstdin)
sfclose(fp);
- }
}
return(error_info.errors);
}
diff --git a/usr/src/lib/libcmd/common/pathchk.c b/usr/src/lib/libcmd/common/pathchk.c
index fff22f52bf..7b0151d69c 100644
--- a/usr/src/lib/libcmd/common/pathchk.c
+++ b/usr/src/lib/libcmd/common/pathchk.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -78,9 +78,9 @@ USAGE_LICENSE
*/
static long mypathconf(const char *path, int op)
{
- register long r;
+ register long r;
- static const char* ops[] = { "NAME_MAX", "PATH_MAX" };
+ static const char* const ops[] = { "NAME_MAX", "PATH_MAX" };
errno=0;
if((r=strtol(astconf(ops[op], path, NiL), NiL, 0))<0 && errno==0)
diff --git a/usr/src/lib/libcmd/common/pids.c b/usr/src/lib/libcmd/common/pids.c
new file mode 100644
index 0000000000..ca419850c1
--- /dev/null
+++ b/usr/src/lib/libcmd/common/pids.c
@@ -0,0 +1,120 @@
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* David Korn <dgk@research.att.com> *
+* *
+***********************************************************************/
+#pragma prototyped
+
+#define FORMAT "PID=%(pid)d PPID=%(ppid)d PGID=%(pgid)d TID=%(tid)d SID=%(sid)d"
+
+static const char usage[] =
+"[-?\n@(#)$Id: pids (AT&T Research) 2008-04-01 $\n]"
+USAGE_LICENSE
+"[+NAME?pids - list calling shell process ids]"
+"[+DESCRIPTION?When invoked as a shell builtin, \bpids\b lists one or "
+ "more of the calling process ids determined by \bgetpid\b(2), "
+ "\bgetppid\b(2), \bgetpgrp\b(2), \btcgetpgrp\b(2) and \bgetsid\b(2). "
+ "Unknown or invalid ids have the value \b-1\b.]"
+"[f:format?List the ids specified by \aformat\a. \aformat\a follows "
+ "\bprintf\b(3) conventions, except that \bsfio\b(3) inline ids are used "
+ "instead of arguments: "
+ "%[-+]][\awidth\a[.\aprecis\a[.\abase\a]]]]]](\aid\a)\achar\a. The "
+ "supported \aid\as are:]:[format:=" FORMAT "]"
+ "{"
+ "[+pid?The process id.]"
+ "[+pgid?The process group id.]"
+ "[+ppid?The parent process id.]"
+ "[+tid|tty?The controlling terminal id.]"
+ "[+sid?The session id.]"
+ "}"
+"[+SEE ALSO?\bgetpid\b(2), \bgetppid\b(2), \bgetpgrp\b(2), "
+ "\btcgetpgrp\b(2), \bgetsid\b(2)]"
+;
+
+#include <cmd.h>
+#include <ast_tty.h>
+#include <sfdisc.h>
+
+/*
+ * sfkeyprintf() lookup
+ * handle==0 for heading
+ */
+
+static int
+key(void* handle, Sffmt_t* fp, const char* arg, char** ps, Sflong_t* pn)
+{
+ register char* s;
+ int fd;
+ long tid;
+
+ if (!(s = fp->t_str) || streq(s, "pid"))
+ *pn = getpid();
+ else if (streq(s, "pgid"))
+ *pn = getpgid(0);
+ else if (streq(s, "ppid"))
+ *pn = getppid();
+ else if (streq(s, "tid") || streq(s, "tty"))
+ {
+ for (fd = 0; fd < 3; fd++)
+ if ((tid = tcgetpgrp(fd)) >= 0)
+ break;
+ *pn = tid;
+ }
+ else if (streq(s, "sid"))
+ *pn = getsid(0);
+ else if (streq(s, "format"))
+ *ps = (char*)handle;
+ else
+ {
+ error(2, "%s: unknown format identifier", s);
+ return 0;
+ }
+ return 1;
+}
+
+int
+b_pids(int argc, char** argv, void* context)
+{
+ char* format = 0;
+
+ cmdinit(argc, argv, context, ERROR_CATALOG, 0);
+ for (;;)
+ {
+ switch (optget(argv, usage))
+ {
+ case 'f':
+ format = opt_info.arg;
+ continue;
+ case '?':
+ error(ERROR_USAGE|4, "%s", opt_info.arg);
+ continue;
+ case ':':
+ error(2, "%s", opt_info.arg);
+ continue;
+ }
+ break;
+ }
+ argv += opt_info.index;
+ if (error_info.errors || *argv)
+ error(ERROR_USAGE|4, "%s", optusage(NiL));
+ if (!format)
+ format = FORMAT;
+ sfkeyprintf(sfstdout, format, format, key, NiL);
+ sfprintf(sfstdout, "\n");
+ return 0;
+}
diff --git a/usr/src/lib/libcmd/common/readlink.c b/usr/src/lib/libcmd/common/readlink.c
new file mode 100644
index 0000000000..4fc6fcc666
--- /dev/null
+++ b/usr/src/lib/libcmd/common/readlink.c
@@ -0,0 +1,111 @@
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1982-2007 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* David Korn <dgk@research.att.com> *
+* *
+***********************************************************************/
+#pragma prototyped
+
+static const char usage[] =
+"[-?\n@(#)$Id: readlink (AT&T Research) 2008-06-08 $\n]"
+USAGE_LICENSE
+"[+NAME?readlink - read the contents of a symbolic link]"
+"[+DESCRIPTION?\breadlink\b returns the contents of the symbolic "
+ "link referred to by the path argument. Unless the \b-f\b "
+ "option is specified an error will be returned when the path "
+ "is not a symbolic link.]"
+"[f:canonicalize?The returned value will be an absolute pathname that names "
+ "the same file, whose resolution does not involve \".\", \"..\", or "
+ "symbolic links, otherwise only the exact (relative) value will be returned.]"
+"[n:no-newline?Supress newline at the end.]"
+"[v:verbose?Verbose - print errors.]"
+"[+SEE ALSO?\bbasename\b(1),\bdirname\b(2),\breadlink\b(2),\breadpath\n(2)]"
+;
+
+#include <cmd.h>
+
+int
+b_readlink(int argc, char** argv, void* context)
+{
+ register char* s;
+ register int i;
+ register char* m;
+ register char* x;
+ int canonicalize = 0,
+ nonewline = 0,
+ verbose = 0;
+ char buf[PATH_MAX+2];
+ int len = 0;
+ char *filename,
+ *resolvedname = NULL;
+
+ cmdinit(argc, argv, context, ERROR_CATALOG, 0);
+ for (;;)
+ {
+ switch (optget(argv, usage))
+ {
+ case 'f':
+ canonicalize = opt_info.num;
+ continue;
+ case 'n':
+ nonewline = opt_info.num;
+ continue;
+ case 'v':
+ verbose = opt_info.num;
+ continue;
+ case '?':
+ error(ERROR_usage(2), "%s", opt_info.arg);
+ continue;
+ case ':':
+ error(2, "%s", opt_info.arg);
+ continue;
+ }
+ break;
+ }
+ argv += opt_info.index;
+ argc -= opt_info.index;
+ if(error_info.errors || argc != 1)
+ error(ERROR_usage(2),"%s", optusage(NiL));
+ filename = argv[0];
+
+ if (canonicalize)
+ {
+ len = resolvepath(filename, buf, sizeof(buf)-2);
+ }
+ else
+ {
+ len = readlink(filename, buf, sizeof(buf)-2);
+ }
+
+ if (len != -1)
+ resolvedname = buf;
+
+ if (!resolvedname)
+ {
+ if (verbose)
+ error(ERROR_system(1),"%s: readlink failed", filename);
+ else
+ return 1;
+ }
+
+ if (!nonewline)
+ resolvedname[len++] = '\n';
+
+ sfwrite(sfstdout, resolvedname, len);
+
+ return 0;
+}
diff --git a/usr/src/lib/libcmd/common/rev.c b/usr/src/lib/libcmd/common/rev.c
index ce3f2ae425..3c63840bdb 100644
--- a/usr/src/lib/libcmd/common/rev.c
+++ b/usr/src/lib/libcmd/common/rev.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -31,7 +31,7 @@
*/
static const char usage[] =
-"[-?\n@(#)$Id: rev (AT&T Research) 1999-04-10 $\n]"
+"[-?\n@(#)$Id: rev (AT&T Research) 2007-11-29 $\n]"
USAGE_LICENSE
"[+NAME?rev - reverse the characters or lines of one or more files]"
"[+DESCRIPTION?\brev\b copies one or more files to standard output "
@@ -61,19 +61,51 @@ static int rev_char(Sfio_t *in, Sfio_t *out)
{
register int c;
register char *ep, *bp, *cp;
- register int n;
- while(cp = bp = sfgetr(in,'\n',0))
+ register wchar_t *wp, *xp;
+ register size_t n;
+ register size_t w;
+ if (mbwide())
{
- ep = bp + (n=sfvalue(in)) -1;
- while(ep > bp)
+ wp = 0;
+ w = 0;
+ while(cp = bp = sfgetr(in,'\n',0))
{
- c = *--ep;
- *ep = *bp;
- *bp++ = c;
+ ep = bp + (n=sfvalue(in)) - 1;
+ if (n > w)
+ {
+ w = roundof(n + 1, 1024);
+ if (!(wp = newof(wp, wchar_t, w, 0)))
+ {
+ error(ERROR_SYSTEM|2, "out of space");
+ return 0;
+ }
+ }
+ xp = wp;
+ while (cp < ep)
+ *xp++ = mbchar(cp);
+ cp = bp;
+ while (xp > wp)
+ cp += mbconv(cp, *--xp);
+ *cp++ = '\n';
+ if (sfwrite(out, bp, cp - bp) < 0)
+ return -1;
}
- if(sfwrite(out,cp,n)<0)
- return(-1);
+ if (wp)
+ free(wp);
}
+ else
+ while(cp = bp = sfgetr(in,'\n',0))
+ {
+ ep = bp + (n=sfvalue(in)) -1;
+ while(ep > bp)
+ {
+ c = *--ep;
+ *ep = *bp;
+ *bp++ = c;
+ }
+ if(sfwrite(out,cp,n)<0)
+ return(-1);
+ }
return(0);
}
diff --git a/usr/src/lib/libcmd/common/rev.h b/usr/src/lib/libcmd/common/rev.h
index 1ea6d55277..c23ffb381e 100644
--- a/usr/src/lib/libcmd/common/rev.h
+++ b/usr/src/lib/libcmd/common/rev.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libcmd/common/revlib.c b/usr/src/lib/libcmd/common/revlib.c
index 3693d15b2d..d95bbf0c80 100644
--- a/usr/src/lib/libcmd/common/revlib.c
+++ b/usr/src/lib/libcmd/common/revlib.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libcmd/common/rm.c b/usr/src/lib/libcmd/common/rm.c
index 62cf8a8b2f..d64d209b9d 100644
--- a/usr/src/lib/libcmd/common/rm.c
+++ b/usr/src/lib/libcmd/common/rm.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -27,7 +27,7 @@
*/
static const char usage[] =
-"[-?\n@(#)$Id: rm (AT&T Research) 2006-11-21 $\n]"
+"[-?\n@(#)$Id: rm (AT&T Research) 2008-10-15 $\n]"
USAGE_LICENSE
"[+NAME?rm - remove files]"
"[+DESCRIPTION?\brm\b removes the named \afile\a arguments. By default it"
@@ -108,8 +108,6 @@ rm(State_t* state, register FTSENT* ent)
int v;
struct stat st;
- if (cmdquit())
- return -1;
if (ent->fts_info == FTS_NS || ent->fts_info == FTS_ERR || ent->fts_info == FTS_SLNONE)
{
if (!state->force)
@@ -213,6 +211,8 @@ rm(State_t* state, register FTSENT* ent)
if ((ent->fts_info == FTS_DC || state->directory) ? remove(path) : rmdir(path))
switch (errno)
{
+ case ENOENT:
+ break;
case EEXIST:
#if defined(ENOTEMPTY) && (ENOTEMPTY) != (EEXIST)
case ENOTEMPTY:
@@ -316,10 +316,17 @@ rm(State_t* state, register FTSENT* ent)
if (remove(path))
{
nonempty(ent);
- if (!state->force || state->interactive)
- error(ERROR_SYSTEM|2, "%s: not removed", ent->fts_path);
- else
- error_info.errors++;
+ switch (errno)
+ {
+ case ENOENT:
+ break;
+ default:
+ if (!state->force || state->interactive)
+ error(ERROR_SYSTEM|2, "%s: not removed", ent->fts_path);
+ else
+ error_info.errors++;
+ break;
+ }
}
break;
}
@@ -403,7 +410,7 @@ b_rm(int argc, register char** argv, void* context)
set3d = 0;
if (fts = fts_open(argv, FTS_PHYSICAL, NiL))
{
- while ((ent = fts_read(fts)) && !rm(&state, ent));
+ while (!sh_checksig(context) && (ent = fts_read(fts)) && !rm(&state, ent));
fts_close(fts);
}
else if (!state.force)
diff --git a/usr/src/lib/libcmd/common/rmdir.c b/usr/src/lib/libcmd/common/rmdir.c
index 4edcda4df8..e6c370c436 100644
--- a/usr/src/lib/libcmd/common/rmdir.c
+++ b/usr/src/lib/libcmd/common/rmdir.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libcmd/common/shcmd.h b/usr/src/lib/libcmd/common/shcmd.h
new file mode 100644
index 0000000000..d355c7fd75
--- /dev/null
+++ b/usr/src/lib/libcmd/common/shcmd.h
@@ -0,0 +1,80 @@
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* David Korn <dgk@research.att.com> *
+* *
+***********************************************************************/
+#pragma prototyped
+
+/*
+ * ksh builtin command api
+ */
+
+#ifndef _SHCMD_H
+#define _SHCMD_H 1
+
+#ifndef SH_VERSION
+# define Shell_t void
+#endif
+#ifndef NV_DEFAULT
+# define Namval_t void
+#endif
+#ifndef ERROR_NOTIFY
+# define ERROR_NOTIFY 1
+#endif
+
+typedef int (*Shbltin_f)(int, char**, void*);
+
+#undef Shbltin_t
+typedef struct Shbltin_s
+{
+ Shell_t *shp;
+ void *ptr;
+ int version;
+ int (*shrun)(int, char**);
+ int (*shtrap)(const char*, int);
+ void (*shexit)(int);
+ Namval_t *(*shbltin)(const char*, Shbltin_f, void*);
+ unsigned char notify;
+ unsigned char sigset;
+ unsigned char nosfio;
+ Namval_t *bnode;
+ Namval_t *vnode;
+ char *data;
+ int flags;
+} Shbltin_t;
+
+#if defined(SH_VERSION) || defined(_SH_PRIVATE)
+# undef Shell_t
+# undef Namval_t
+#else
+# define sh_run(c, ac, av) ((c)?(*((Shbltin_t*)(c))->shrun)(ac,av):-1)
+# define sh_system(c,str) ((c)?(*((Shbltin_t*)(c))->shtrap)(str,0):system(str))
+# define sh_exit(c,n) ((c)?(*((Shbltin_t*)(c))->shexit)(n):exit(n))
+# define sh_checksig(c) ((c) && ((Shbltin_t*)(c))->sigset)
+# if defined(SFIO_VERSION) || defined(_AST_H)
+# define LIB_INIT(c)
+# else
+# define LIB_INIT(c) ((c) && (((Shbltin_t*)(c))->nosfio = 1))
+# endif
+# ifndef _CMD_H
+# define cmdinit(ac,av,c,cat,flg) do { if((ac)<=0) return(0); \
+ (((Shbltin_t*)(c))->notify = ((flg)&ERROR_NOTIFY)?1:0);} while(0)
+# endif
+#endif
+
+#endif
diff --git a/usr/src/lib/libcmd/common/stty.c b/usr/src/lib/libcmd/common/stty.c
index ef53c61bf7..6868d3f326 100644
--- a/usr/src/lib/libcmd/common/stty.c
+++ b/usr/src/lib/libcmd/common/stty.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -26,7 +26,7 @@
*/
static const char usage[] =
-"[-?@(#)$Id: stty (AT&T Research) 2006-10-31 $\n]"
+"[-?@(#)$Id: stty (AT&T Research) 2008-04-01 $\n]"
USAGE_LICENSE
"[+NAME?stty - set or get terminal modes]"
"[+DESCRIPTION?\bstty\b sets certain terminal I/O modes for the device "
@@ -37,6 +37,7 @@ USAGE_LICENSE
"[g:save?Writes the current settings to standard output in a form that can "
"be used as an argument to another \bstty\b command. The \brows\b "
"and \bcolumns\b values are not included.]"
+"[t:terminal-group?Print the terminal group id of the device, -1 if unknown.]"
"\n"
"\n[mode ...]\n"
"\n"
@@ -57,7 +58,6 @@ USAGE_LICENSE
"[+SEE ALSO?\btegetattr\b(2), \btcsetattr\b(2), \bioctl\b(2)]"
;
-
#include <cmd.h>
#include <ccode.h>
#include <ctype.h>
@@ -83,6 +83,7 @@ USAGE_LICENSE
/* command options */
#define A_FLAG 1
#define G_FLAG 2
+#define T_FLAG 4
/* termios fields */
#define C_FLAG 1
@@ -313,9 +314,15 @@ static const Tty_t Ttable[] =
#endif
#ifdef TABDLY
{ "tabs", TABS, O_FLAG, IG, TABDLY, TAB3, C("Preserve (expand to spaces) tabs") },
+#ifdef TAB0
{ "tab0", BITS, O_FLAG, IG|SS, TABDLY, TAB0 },
+#endif
+#ifdef TAB1
{ "tab1", BITS, O_FLAG, US, TABDLY, TAB1 },
+#endif
+#ifdef TAB2
{ "tab2", BITS, O_FLAG, US, TABDLY, TAB2 },
+#endif
{ "tab3", BITS, O_FLAG, US, TABDLY, TAB3 },
#endif
#ifdef BSDLY
@@ -483,7 +490,7 @@ static void output(struct termios *sp, int flags)
{
case BIT:
case BITS:
- off = 1;
+ off = off2 = 1;
switch(tp->field)
{
case C_FLAG:
@@ -877,6 +884,15 @@ static int infof(Opt_t* op, Sfio_t* sp, const char* s, Optdisc_t* dp)
return(1);
}
+#ifndef _lib_tcgetpgrp
+# ifdef TIOCGPGRP
+ static int _i_;
+# define tcgetpgrp(a) (ioctl(a, TIOCGPGRP, &_i_)>=0?_i_:-1)
+# else
+# define tcgetpgrp(a) (-1)
+# endif /* TIOCGPGRP */
+#endif /* _lib_tcgetpgrp */
+
int
b_stty(int argc, char** argv, void* context)
{
@@ -897,6 +913,9 @@ b_stty(int argc, char** argv, void* context)
{
switch (n = optget(argv, usage))
{
+ case 't':
+ flags |= T_FLAG;
+ continue;
case 'a':
case 'g':
if (!opt_info.offset || !argv[opt_info.index][opt_info.offset])
@@ -926,9 +945,11 @@ b_stty(int argc, char** argv, void* context)
break;
}
argv += opt_info.index;
- if (error_info.errors || (flags && *argv))
+ if (error_info.errors || (flags && *argv) || (flags&(flags-1)))
error(ERROR_usage(2), "%s", optusage(NiL));
- if (*argv)
+ if (flags & T_FLAG)
+ sfprintf(sfstdout, "%d\n", tcgetpgrp(0));
+ else if (*argv)
{
if (!argv[1] && **argv == ':')
gin(*argv, &tty);
diff --git a/usr/src/lib/libcmd/common/sum.c b/usr/src/lib/libcmd/common/sum.c
index 3fa2e520e2..da6dc6fa2a 100644
--- a/usr/src/lib/libcmd/common/sum.c
+++ b/usr/src/lib/libcmd/common/sum.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libcmd/common/sync.c b/usr/src/lib/libcmd/common/sync.c
index d977048766..8ddc855783 100644
--- a/usr/src/lib/libcmd/common/sync.c
+++ b/usr/src/lib/libcmd/common/sync.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libcmd/common/tail.c b/usr/src/lib/libcmd/common/tail.c
index 83de0f7c91..7eb012af7f 100644
--- a/usr/src/lib/libcmd/common/tail.c
+++ b/usr/src/lib/libcmd/common/tail.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -395,7 +395,6 @@ b_tail(int argc, char** argv, void* context)
}
/*FALLTHROUGH*/
case 'n':
- case 'N':
flags |= COUNT;
if (s = opt_info.arg)
number = num(s, &s, &flags, n);
diff --git a/usr/src/lib/libcmd/common/tee.c b/usr/src/lib/libcmd/common/tee.c
index 243d6d0932..c1189bade7 100644
--- a/usr/src/lib/libcmd/common/tee.c
+++ b/usr/src/lib/libcmd/common/tee.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -27,7 +27,7 @@
*/
static const char usage[] =
-"[-?\n@(#)$Id: tee (AT&T Research) 2006-10-10 $\n]"
+"[-?\n@(#)$Id: tee (AT&T Research) 2007-11-11 $\n]"
USAGE_LICENSE
"[+NAME?tee - duplicate standard input]"
"[+DESCRIPTION?\btee\b copies standard input to standard output "
@@ -129,17 +129,14 @@ b_tee(int argc, register char** argv, void* context)
error(ERROR_usage(2), "%s", optusage(NiL));
argv += opt_info.index;
argc -= opt_info.index;
-
- /*
- * for backward compatibility
- */
-
+#if _ANCIENT_BSD_COMPATIBILITY
if (*argv && streq(*argv, "-"))
{
signal(SIGINT, SIG_IGN);
argv++;
argc--;
}
+#endif
if (argc > 0)
{
if (!(tp = (Tee_t*)stakalloc(sizeof(Tee_t) + argc * sizeof(int))))
diff --git a/usr/src/lib/libcmd/common/tty.c b/usr/src/lib/libcmd/common/tty.c
index 22115b2343..4db11b9185 100644
--- a/usr/src/lib/libcmd/common/tty.c
+++ b/usr/src/lib/libcmd/common/tty.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -27,7 +27,7 @@
*/
static const char usage[] =
-"[-?\n@(#)$Id: tty (AT&T Research) 2007-03-11 $\n]"
+"[-?\n@(#)$Id: tty (AT&T Research) 2008-03-13 $\n]"
USAGE_LICENSE
"[+NAME?tty - write the name of the terminal to standard output]"
"[+DESCRIPTION?\btty\b writes the name of the terminal that is connected "
@@ -84,11 +84,14 @@ b_tty(int argc, char *argv[], void* context)
}
if(!sflag)
sfputr(sfstdout,tty,'\n');
+ if(lflag)
+ {
#if _mac_STWLINE
- if(lflag && (n = ioctl(0, STWLINE, 0)) >= 0)
- error(ERROR_OUTPUT, 1, "synchronous line %d", n);
- else
+ if (n = ioctl(0, STWLINE, 0)) >= 0)
+ error(ERROR_OUTPUT, 1, "synchronous line %d", n);
+ else
#endif
- error(ERROR_OUTPUT, 1, "not on an active synchronous line");
+ error(ERROR_OUTPUT, 1, "not on an active synchronous line");
+ }
return(error_info.errors);
}
diff --git a/usr/src/lib/libcmd/common/uname.c b/usr/src/lib/libcmd/common/uname.c
index 97cdf9100f..72605200be 100644
--- a/usr/src/lib/libcmd/common/uname.c
+++ b/usr/src/lib/libcmd/common/uname.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -28,7 +28,7 @@
*/
static const char usage[] =
-"[-?\n@(#)$Id: uname (AT&T Research) 2007-01-22 $\n]"
+"[-?\n@(#)$Id: uname (AT&T Research) 2007-04-19 $\n]"
USAGE_LICENSE
"[+NAME?uname - identify the current system ]"
"[+DESCRIPTION?By default \buname\b writes the operating system name to"
@@ -61,7 +61,9 @@ USAGE_LICENSE
"[f:list?List all \bsysinfo\b(2) names and values, one per line.]"
"[S:sethost?Set the hostname or nodename to \aname\a. No output is"
" written to standard output.]:[name]"
-
+"\n"
+"\n[ name ... ]\n"
+"\n"
"[+SEE ALSO?\bhostname\b(1), \bgetconf\b(1), \buname\b(2),"
" \bsysconf\b(2), \bsysinfo\b(2)]"
;
@@ -327,7 +329,7 @@ b_uname(int argc, char** argv, void* context)
if (!streq(argv[0], s) && (!eaccess(s, X_OK) || !eaccess(s+=4, X_OK)))
{
argv[0] = s;
- return procrun(s, argv);
+ return sh_run(context, argc, argv);
}
error(2, "%s", opt_info.arg);
break;
@@ -367,7 +369,7 @@ b_uname(int argc, char** argv, void* context)
while (t < e && (n = *s++))
*t++ = islower(n) ? toupper(n) : n;
*t = 0;
- sfprintf(sfstdout, "%s%c", *(t = astconf(buf, NiL, NiL)) ? t : "unknown", *argv ? ' ' : '\n');
+ sfprintf(sfstdout, "%s%c", *(t = astconf(buf, NiL, NiL)) ? t : *(t = astconf(buf+3, NiL, NiL)) ? t : "unknown", *argv ? ' ' : '\n');
}
}
else
diff --git a/usr/src/lib/libcmd/common/uniq.c b/usr/src/lib/libcmd/common/uniq.c
index e6e0da4667..d49954a710 100644
--- a/usr/src/lib/libcmd/common/uniq.c
+++ b/usr/src/lib/libcmd/common/uniq.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -26,7 +26,7 @@
*/
static const char usage[] =
-"[-?\n@(#)$Id: uniq (AT&T Research) 2006-08-28 $\n]"
+"[-n?\n@(#)$Id: uniq (AT&T Research) 2008-04-24 $\n]"
USAGE_LICENSE
"[+NAME?uniq - Report or filter out repeated lines in a file]"
"[+DESCRIPTION?\buniq\b reads an input, comparing adjacent lines, and "
diff --git a/usr/src/lib/libcmd/common/wc.c b/usr/src/lib/libcmd/common/wc.c
index 9d4b2567c7..763090fc02 100644
--- a/usr/src/lib/libcmd/common/wc.c
+++ b/usr/src/lib/libcmd/common/wc.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libcmd/common/wc.h b/usr/src/lib/libcmd/common/wc.h
index 0296a898f8..2752af36a3 100644
--- a/usr/src/lib/libcmd/common/wc.h
+++ b/usr/src/lib/libcmd/common/wc.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libcmd/common/wclib.c b/usr/src/lib/libcmd/common/wclib.c
index c16e4efc87..67adb5fe15 100644
--- a/usr/src/lib/libcmd/common/wclib.c
+++ b/usr/src/lib/libcmd/common/wclib.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -30,7 +30,7 @@
#include <wc.h>
#include <ctype.h>
-#if _hdr_wchar && _hdr_wctype
+#if _hdr_wchar && _hdr_wctype && _lib_iswctype
#include <wchar.h>
#include <wctype.h>
diff --git a/usr/src/lib/libcmd/i386/include/ast/cmd.h b/usr/src/lib/libcmd/i386/include/ast/cmd.h
index 2484c17c5a..9ac1c90993 100644
--- a/usr/src/lib/libcmd/i386/include/ast/cmd.h
+++ b/usr/src/lib/libcmd/i386/include/ast/cmd.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -40,9 +40,9 @@
#include <ast.h>
#include <error.h>
#include <stak.h>
+#include <shcmd.h>
#define cmdinit _cmd_init
-#define cmdquit() 0
#if _BLD_cmd && defined(__EXPORT__)
#undef __MANGLE__
@@ -60,11 +60,13 @@
#ifdef CMD_STANDALONE
+#define CMD_CONTEXT(c) ((Shbltin_t*)0)
+
#if CMD_DYNAMIC
#include <dlldefs.h>
-typedef int (*Builtin_f) __PROTO__((int, char**, __V_*));
+typedef int (*Shbltin_f) __PROTO__((int, char**, __V_*));
#else
@@ -106,7 +108,7 @@ main __PARAM__((int argc, char** argv), (argc, argv)) __OTORP__(int argc; char**
register char* s;
register char* t;
__V_* dll;
- Builtin_f fun;
+ Shbltin_f fun;
char buf[64];
if (s = strrchr(argv[0], '/'))
@@ -126,16 +128,16 @@ main __PARAM__((int argc, char** argv), (argc, argv)) __OTORP__(int argc; char**
{
if (dll = dlopen(NiL, RTLD_LAZY))
{
- if (fun = (Builtin_f)dlsym(dll, buf + 1))
+ if (fun = (Shbltin_f)dlsym(dll, buf + 1))
break;
- if (fun = (Builtin_f)dlsym(dll, buf))
+ if (fun = (Shbltin_f)dlsym(dll, buf))
break;
}
if (dll = dllfind("cmd", NiL, RTLD_LAZY))
{
- if (fun = (Builtin_f)dlsym(dll, buf + 1))
+ if (fun = (Shbltin_f)dlsym(dll, buf + 1))
break;
- if (fun = (Builtin_f)dlsym(dll, buf))
+ if (fun = (Shbltin_f)dlsym(dll, buf))
break;
}
return 127;
@@ -149,27 +151,12 @@ main __PARAM__((int argc, char** argv), (argc, argv)) __OTORP__(int argc; char**
#else
#undef cmdinit
+#ifdef _MSC_VER
+#define CMD_CONTEXT(p) ((Shbltin_t*)(p))
#define cmdinit(a,b,c,d,e) do{if(_cmd_init(a,b,c,d,e))return -1;}while(0)
-
-#ifndef CMD_BUILTIN
-
-#undef cmdquit
-#define cmdquit() (_cmd_quit)
-
-#if _BLD_cmd && defined(__EXPORT__)
-#undef __MANGLE__
-#define __MANGLE__ __LINKAGE__ __EXPORT__
-#endif
-#if !_BLD_cmd && defined(__IMPORT__)
-#undef __MANGLE__
-#define __MANGLE__ __LINKAGE__ __IMPORT__
-#endif
-
-extern __MANGLE__ int _cmd_quit;
-
-#undef __MANGLE__
-#define __MANGLE__ __LINKAGE__
-
+#else
+#define CMD_CONTEXT(p) (((p)&&((Shbltin_t*)(p))->version>=20071012&&((Shbltin_t*)(p))->version<20350101)?((Shbltin_t*)(p)):0)
+#define cmdinit(a,b,c,d,e) do{if((c)&&!CMD_CONTEXT(c))c=0;if(_cmd_init(a,b,c,d,e))return -1;}while(0)
#endif
#if _BLD_cmd && defined(__EXPORT__)
diff --git a/usr/src/lib/libcmd/i386/include/ast/cmdext.h b/usr/src/lib/libcmd/i386/include/ast/cmdext.h
index b5c58b5d04..602f8d7a7d 100644
--- a/usr/src/lib/libcmd/i386/include/ast/cmdext.h
+++ b/usr/src/lib/libcmd/i386/include/ast/cmdext.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -55,6 +55,7 @@ extern __MANGLE__ int b_mkfifo __PROTO__((int, char**, __V_*));
extern __MANGLE__ int b_mv __PROTO__((int, char**, __V_*));
extern __MANGLE__ int b_paste __PROTO__((int, char**, __V_*));
extern __MANGLE__ int b_pathchk __PROTO__((int, char**, __V_*));
+extern __MANGLE__ int b_pids __PROTO__((int, char**, __V_*));
extern __MANGLE__ int b_rev __PROTO__((int, char**, __V_*));
extern __MANGLE__ int b_rm __PROTO__((int, char**, __V_*));
extern __MANGLE__ int b_rmdir __PROTO__((int, char**, __V_*));
diff --git a/usr/src/lib/libcmd/i386/src/lib/libcmd/FEATURE/ids b/usr/src/lib/libcmd/i386/src/lib/libcmd/FEATURE/ids
index 214990e44d..91fb2f255e 100644
--- a/usr/src/lib/libcmd/i386/src/lib/libcmd/FEATURE/ids
+++ b/usr/src/lib/libcmd/i386/src/lib/libcmd/FEATURE/ids
@@ -1,8 +1,8 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libcmd/features/ids by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libcmd/features/ids by iffe version 2008-01-31 : : */
#ifndef _def_ids_cmd
#define _def_ids_cmd 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
#define _lib_endgrent 1 /* endgrent() in default lib(s) */
#define _lib_getgrent 1 /* getgrent() in default lib(s) */
diff --git a/usr/src/lib/libcmd/i386/src/lib/libcmd/FEATURE/sockets b/usr/src/lib/libcmd/i386/src/lib/libcmd/FEATURE/sockets
index f5b9d0855b..1b4d8b6101 100644
--- a/usr/src/lib/libcmd/i386/src/lib/libcmd/FEATURE/sockets
+++ b/usr/src/lib/libcmd/i386/src/lib/libcmd/FEATURE/sockets
@@ -1,8 +1,8 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libcmd/features/sockets by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libcmd/features/sockets by iffe version 2008-01-31 : : */
#ifndef _def_sockets_cmd
#define _def_sockets_cmd 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
#define _sys_socket 1 /* #include <sys/socket.h> ok */
#define _hdr_arpa_inet 1 /* #include <arpa/inet.h> ok */
diff --git a/usr/src/lib/libcmd/i386/src/lib/libcmd/FEATURE/symlink b/usr/src/lib/libcmd/i386/src/lib/libcmd/FEATURE/symlink
index 59beb5bfe8..15284effed 100644
--- a/usr/src/lib/libcmd/i386/src/lib/libcmd/FEATURE/symlink
+++ b/usr/src/lib/libcmd/i386/src/lib/libcmd/FEATURE/symlink
@@ -1,8 +1,8 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libcmd/features/symlink by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libcmd/features/symlink by iffe version 2008-01-31 : : */
#ifndef _def_symlink_cmd
#define _def_symlink_cmd 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
#define _lib_lchown 1 /* lchown implemented */
#endif
diff --git a/usr/src/lib/libcmd/i386/src/lib/libcmd/FEATURE/utsname b/usr/src/lib/libcmd/i386/src/lib/libcmd/FEATURE/utsname
index e1cf94aa4b..240a52a974 100644
--- a/usr/src/lib/libcmd/i386/src/lib/libcmd/FEATURE/utsname
+++ b/usr/src/lib/libcmd/i386/src/lib/libcmd/FEATURE/utsname
@@ -1,8 +1,8 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libcmd/features/utsname by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libcmd/features/utsname by iffe version 2008-01-31 : : */
#ifndef _def_utsname_cmd
#define _def_utsname_cmd 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
#define _lib_getdomainname 1 /* getdomainname() in default lib(s) */
#define _lib_gethostid 1 /* gethostid() in default lib(s) */
diff --git a/usr/src/lib/libcmd/mapfile-vers b/usr/src/lib/libcmd/mapfile-vers
index 373f2bc8ac..ab98659ec7 100644
--- a/usr/src/lib/libcmd/mapfile-vers
+++ b/usr/src/lib/libcmd/mapfile-vers
@@ -20,18 +20,19 @@
#
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
# functions by AST/ksh93's version of libcmd
SUNWprivate_1.1 {
global:
+ _cmd_init;
+
b_basename;
b_cat;
b_chgrp;
+ b_cksum;
b_chmod;
b_chown;
b_cmp;
@@ -50,15 +51,19 @@ SUNWprivate_1.1 {
b_join;
b_ln;
b_logname;
+ b_md5sum;
b_mkdir;
b_mkfifo;
b_mv;
b_paste;
b_pathchk;
+ b_pids;
+ b_readlink;
b_rev;
b_rm;
b_rmdir;
b_stty;
+ b_sum;
b_sync;
b_tail;
b_tee;
diff --git a/usr/src/lib/libcmd/sparc/include/ast/cmd.h b/usr/src/lib/libcmd/sparc/include/ast/cmd.h
index 2484c17c5a..9ac1c90993 100644
--- a/usr/src/lib/libcmd/sparc/include/ast/cmd.h
+++ b/usr/src/lib/libcmd/sparc/include/ast/cmd.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -40,9 +40,9 @@
#include <ast.h>
#include <error.h>
#include <stak.h>
+#include <shcmd.h>
#define cmdinit _cmd_init
-#define cmdquit() 0
#if _BLD_cmd && defined(__EXPORT__)
#undef __MANGLE__
@@ -60,11 +60,13 @@
#ifdef CMD_STANDALONE
+#define CMD_CONTEXT(c) ((Shbltin_t*)0)
+
#if CMD_DYNAMIC
#include <dlldefs.h>
-typedef int (*Builtin_f) __PROTO__((int, char**, __V_*));
+typedef int (*Shbltin_f) __PROTO__((int, char**, __V_*));
#else
@@ -106,7 +108,7 @@ main __PARAM__((int argc, char** argv), (argc, argv)) __OTORP__(int argc; char**
register char* s;
register char* t;
__V_* dll;
- Builtin_f fun;
+ Shbltin_f fun;
char buf[64];
if (s = strrchr(argv[0], '/'))
@@ -126,16 +128,16 @@ main __PARAM__((int argc, char** argv), (argc, argv)) __OTORP__(int argc; char**
{
if (dll = dlopen(NiL, RTLD_LAZY))
{
- if (fun = (Builtin_f)dlsym(dll, buf + 1))
+ if (fun = (Shbltin_f)dlsym(dll, buf + 1))
break;
- if (fun = (Builtin_f)dlsym(dll, buf))
+ if (fun = (Shbltin_f)dlsym(dll, buf))
break;
}
if (dll = dllfind("cmd", NiL, RTLD_LAZY))
{
- if (fun = (Builtin_f)dlsym(dll, buf + 1))
+ if (fun = (Shbltin_f)dlsym(dll, buf + 1))
break;
- if (fun = (Builtin_f)dlsym(dll, buf))
+ if (fun = (Shbltin_f)dlsym(dll, buf))
break;
}
return 127;
@@ -149,27 +151,12 @@ main __PARAM__((int argc, char** argv), (argc, argv)) __OTORP__(int argc; char**
#else
#undef cmdinit
+#ifdef _MSC_VER
+#define CMD_CONTEXT(p) ((Shbltin_t*)(p))
#define cmdinit(a,b,c,d,e) do{if(_cmd_init(a,b,c,d,e))return -1;}while(0)
-
-#ifndef CMD_BUILTIN
-
-#undef cmdquit
-#define cmdquit() (_cmd_quit)
-
-#if _BLD_cmd && defined(__EXPORT__)
-#undef __MANGLE__
-#define __MANGLE__ __LINKAGE__ __EXPORT__
-#endif
-#if !_BLD_cmd && defined(__IMPORT__)
-#undef __MANGLE__
-#define __MANGLE__ __LINKAGE__ __IMPORT__
-#endif
-
-extern __MANGLE__ int _cmd_quit;
-
-#undef __MANGLE__
-#define __MANGLE__ __LINKAGE__
-
+#else
+#define CMD_CONTEXT(p) (((p)&&((Shbltin_t*)(p))->version>=20071012&&((Shbltin_t*)(p))->version<20350101)?((Shbltin_t*)(p)):0)
+#define cmdinit(a,b,c,d,e) do{if((c)&&!CMD_CONTEXT(c))c=0;if(_cmd_init(a,b,c,d,e))return -1;}while(0)
#endif
#if _BLD_cmd && defined(__EXPORT__)
diff --git a/usr/src/lib/libcmd/sparc/include/ast/cmdext.h b/usr/src/lib/libcmd/sparc/include/ast/cmdext.h
index b5c58b5d04..602f8d7a7d 100644
--- a/usr/src/lib/libcmd/sparc/include/ast/cmdext.h
+++ b/usr/src/lib/libcmd/sparc/include/ast/cmdext.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -55,6 +55,7 @@ extern __MANGLE__ int b_mkfifo __PROTO__((int, char**, __V_*));
extern __MANGLE__ int b_mv __PROTO__((int, char**, __V_*));
extern __MANGLE__ int b_paste __PROTO__((int, char**, __V_*));
extern __MANGLE__ int b_pathchk __PROTO__((int, char**, __V_*));
+extern __MANGLE__ int b_pids __PROTO__((int, char**, __V_*));
extern __MANGLE__ int b_rev __PROTO__((int, char**, __V_*));
extern __MANGLE__ int b_rm __PROTO__((int, char**, __V_*));
extern __MANGLE__ int b_rmdir __PROTO__((int, char**, __V_*));
diff --git a/usr/src/lib/libcmd/sparc/src/lib/libcmd/FEATURE/ids b/usr/src/lib/libcmd/sparc/src/lib/libcmd/FEATURE/ids
index ee06a813a2..3ce04f892b 100644
--- a/usr/src/lib/libcmd/sparc/src/lib/libcmd/FEATURE/ids
+++ b/usr/src/lib/libcmd/sparc/src/lib/libcmd/FEATURE/ids
@@ -1,8 +1,8 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libcmd/features/ids by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libcmd/features/ids by iffe version 2008-01-31 : : */
#ifndef _def_ids_cmd
#define _def_ids_cmd 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
#define _lib_endgrent 1 /* endgrent() in default lib(s) */
#define _lib_getgrent 1 /* getgrent() in default lib(s) */
diff --git a/usr/src/lib/libcmd/sparc/src/lib/libcmd/FEATURE/sockets b/usr/src/lib/libcmd/sparc/src/lib/libcmd/FEATURE/sockets
index 9fbdd78fe1..bcb69bfd42 100644
--- a/usr/src/lib/libcmd/sparc/src/lib/libcmd/FEATURE/sockets
+++ b/usr/src/lib/libcmd/sparc/src/lib/libcmd/FEATURE/sockets
@@ -1,8 +1,8 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libcmd/features/sockets by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libcmd/features/sockets by iffe version 2008-01-31 : : */
#ifndef _def_sockets_cmd
#define _def_sockets_cmd 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
#define _sys_socket 1 /* #include <sys/socket.h> ok */
#define _hdr_arpa_inet 1 /* #include <arpa/inet.h> ok */
diff --git a/usr/src/lib/libcmd/sparc/src/lib/libcmd/FEATURE/symlink b/usr/src/lib/libcmd/sparc/src/lib/libcmd/FEATURE/symlink
index c06b9a3e85..a5426021fe 100644
--- a/usr/src/lib/libcmd/sparc/src/lib/libcmd/FEATURE/symlink
+++ b/usr/src/lib/libcmd/sparc/src/lib/libcmd/FEATURE/symlink
@@ -1,8 +1,8 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libcmd/features/symlink by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libcmd/features/symlink by iffe version 2008-01-31 : : */
#ifndef _def_symlink_cmd
#define _def_symlink_cmd 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
#define _lib_lchown 1 /* lchown implemented */
#endif
diff --git a/usr/src/lib/libcmd/sparc/src/lib/libcmd/FEATURE/utsname b/usr/src/lib/libcmd/sparc/src/lib/libcmd/FEATURE/utsname
index 37720b4530..d2bf7024f7 100644
--- a/usr/src/lib/libcmd/sparc/src/lib/libcmd/FEATURE/utsname
+++ b/usr/src/lib/libcmd/sparc/src/lib/libcmd/FEATURE/utsname
@@ -1,8 +1,8 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libcmd/features/utsname by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libcmd/features/utsname by iffe version 2008-01-31 : : */
#ifndef _def_utsname_cmd
#define _def_utsname_cmd 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
#define _lib_getdomainname 1 /* getdomainname() in default lib(s) */
#define _lib_gethostid 1 /* gethostid() in default lib(s) */
diff --git a/usr/src/lib/libcmd/sparcv9/include/ast/cmd.h b/usr/src/lib/libcmd/sparcv9/include/ast/cmd.h
index 2484c17c5a..9ac1c90993 100644
--- a/usr/src/lib/libcmd/sparcv9/include/ast/cmd.h
+++ b/usr/src/lib/libcmd/sparcv9/include/ast/cmd.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -40,9 +40,9 @@
#include <ast.h>
#include <error.h>
#include <stak.h>
+#include <shcmd.h>
#define cmdinit _cmd_init
-#define cmdquit() 0
#if _BLD_cmd && defined(__EXPORT__)
#undef __MANGLE__
@@ -60,11 +60,13 @@
#ifdef CMD_STANDALONE
+#define CMD_CONTEXT(c) ((Shbltin_t*)0)
+
#if CMD_DYNAMIC
#include <dlldefs.h>
-typedef int (*Builtin_f) __PROTO__((int, char**, __V_*));
+typedef int (*Shbltin_f) __PROTO__((int, char**, __V_*));
#else
@@ -106,7 +108,7 @@ main __PARAM__((int argc, char** argv), (argc, argv)) __OTORP__(int argc; char**
register char* s;
register char* t;
__V_* dll;
- Builtin_f fun;
+ Shbltin_f fun;
char buf[64];
if (s = strrchr(argv[0], '/'))
@@ -126,16 +128,16 @@ main __PARAM__((int argc, char** argv), (argc, argv)) __OTORP__(int argc; char**
{
if (dll = dlopen(NiL, RTLD_LAZY))
{
- if (fun = (Builtin_f)dlsym(dll, buf + 1))
+ if (fun = (Shbltin_f)dlsym(dll, buf + 1))
break;
- if (fun = (Builtin_f)dlsym(dll, buf))
+ if (fun = (Shbltin_f)dlsym(dll, buf))
break;
}
if (dll = dllfind("cmd", NiL, RTLD_LAZY))
{
- if (fun = (Builtin_f)dlsym(dll, buf + 1))
+ if (fun = (Shbltin_f)dlsym(dll, buf + 1))
break;
- if (fun = (Builtin_f)dlsym(dll, buf))
+ if (fun = (Shbltin_f)dlsym(dll, buf))
break;
}
return 127;
@@ -149,27 +151,12 @@ main __PARAM__((int argc, char** argv), (argc, argv)) __OTORP__(int argc; char**
#else
#undef cmdinit
+#ifdef _MSC_VER
+#define CMD_CONTEXT(p) ((Shbltin_t*)(p))
#define cmdinit(a,b,c,d,e) do{if(_cmd_init(a,b,c,d,e))return -1;}while(0)
-
-#ifndef CMD_BUILTIN
-
-#undef cmdquit
-#define cmdquit() (_cmd_quit)
-
-#if _BLD_cmd && defined(__EXPORT__)
-#undef __MANGLE__
-#define __MANGLE__ __LINKAGE__ __EXPORT__
-#endif
-#if !_BLD_cmd && defined(__IMPORT__)
-#undef __MANGLE__
-#define __MANGLE__ __LINKAGE__ __IMPORT__
-#endif
-
-extern __MANGLE__ int _cmd_quit;
-
-#undef __MANGLE__
-#define __MANGLE__ __LINKAGE__
-
+#else
+#define CMD_CONTEXT(p) (((p)&&((Shbltin_t*)(p))->version>=20071012&&((Shbltin_t*)(p))->version<20350101)?((Shbltin_t*)(p)):0)
+#define cmdinit(a,b,c,d,e) do{if((c)&&!CMD_CONTEXT(c))c=0;if(_cmd_init(a,b,c,d,e))return -1;}while(0)
#endif
#if _BLD_cmd && defined(__EXPORT__)
diff --git a/usr/src/lib/libcmd/sparcv9/include/ast/cmdext.h b/usr/src/lib/libcmd/sparcv9/include/ast/cmdext.h
index b5c58b5d04..602f8d7a7d 100644
--- a/usr/src/lib/libcmd/sparcv9/include/ast/cmdext.h
+++ b/usr/src/lib/libcmd/sparcv9/include/ast/cmdext.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1992-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -55,6 +55,7 @@ extern __MANGLE__ int b_mkfifo __PROTO__((int, char**, __V_*));
extern __MANGLE__ int b_mv __PROTO__((int, char**, __V_*));
extern __MANGLE__ int b_paste __PROTO__((int, char**, __V_*));
extern __MANGLE__ int b_pathchk __PROTO__((int, char**, __V_*));
+extern __MANGLE__ int b_pids __PROTO__((int, char**, __V_*));
extern __MANGLE__ int b_rev __PROTO__((int, char**, __V_*));
extern __MANGLE__ int b_rm __PROTO__((int, char**, __V_*));
extern __MANGLE__ int b_rmdir __PROTO__((int, char**, __V_*));
diff --git a/usr/src/lib/libcmd/sparcv9/src/lib/libcmd/FEATURE/ids b/usr/src/lib/libcmd/sparcv9/src/lib/libcmd/FEATURE/ids
index d74a8c699f..8654d20bb5 100644
--- a/usr/src/lib/libcmd/sparcv9/src/lib/libcmd/FEATURE/ids
+++ b/usr/src/lib/libcmd/sparcv9/src/lib/libcmd/FEATURE/ids
@@ -1,8 +1,8 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libcmd/features/ids by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libcmd/features/ids by iffe version 2008-01-31 : : */
#ifndef _def_ids_cmd
#define _def_ids_cmd 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
#define _lib_endgrent 1 /* endgrent() in default lib(s) */
#define _lib_getgrent 1 /* getgrent() in default lib(s) */
diff --git a/usr/src/lib/libcmd/sparcv9/src/lib/libcmd/FEATURE/sockets b/usr/src/lib/libcmd/sparcv9/src/lib/libcmd/FEATURE/sockets
index 00732f6357..75613c1ffb 100644
--- a/usr/src/lib/libcmd/sparcv9/src/lib/libcmd/FEATURE/sockets
+++ b/usr/src/lib/libcmd/sparcv9/src/lib/libcmd/FEATURE/sockets
@@ -1,8 +1,8 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libcmd/features/sockets by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libcmd/features/sockets by iffe version 2008-01-31 : : */
#ifndef _def_sockets_cmd
#define _def_sockets_cmd 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
#define _sys_socket 1 /* #include <sys/socket.h> ok */
#define _hdr_arpa_inet 1 /* #include <arpa/inet.h> ok */
diff --git a/usr/src/lib/libcmd/sparcv9/src/lib/libcmd/FEATURE/symlink b/usr/src/lib/libcmd/sparcv9/src/lib/libcmd/FEATURE/symlink
index d62a9cabae..0fddf44f02 100644
--- a/usr/src/lib/libcmd/sparcv9/src/lib/libcmd/FEATURE/symlink
+++ b/usr/src/lib/libcmd/sparcv9/src/lib/libcmd/FEATURE/symlink
@@ -1,8 +1,8 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libcmd/features/symlink by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libcmd/features/symlink by iffe version 2008-01-31 : : */
#ifndef _def_symlink_cmd
#define _def_symlink_cmd 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
#define _lib_lchown 1 /* lchown implemented */
#endif
diff --git a/usr/src/lib/libcmd/sparcv9/src/lib/libcmd/FEATURE/utsname b/usr/src/lib/libcmd/sparcv9/src/lib/libcmd/FEATURE/utsname
index 51d38ec3c0..cdf393a6f0 100644
--- a/usr/src/lib/libcmd/sparcv9/src/lib/libcmd/FEATURE/utsname
+++ b/usr/src/lib/libcmd/sparcv9/src/lib/libcmd/FEATURE/utsname
@@ -1,8 +1,8 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libcmd/features/utsname by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libcmd/features/utsname by iffe version 2008-01-31 : : */
#ifndef _def_utsname_cmd
#define _def_utsname_cmd 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
#define _lib_getdomainname 1 /* getdomainname() in default lib(s) */
#define _lib_gethostid 1 /* gethostid() in default lib(s) */
diff --git a/usr/src/lib/libdll/Makefile b/usr/src/lib/libdll/Makefile
index bfe056bbd3..6fda0f6155 100644
--- a/usr/src/lib/libdll/Makefile
+++ b/usr/src/lib/libdll/Makefile
@@ -18,14 +18,13 @@
#
# CDDL HEADER END
#
+
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
-SHELL=/usr/bin/ksh
+SHELL=/usr/bin/ksh93
include ../Makefile.lib
diff --git a/usr/src/lib/libdll/Makefile.com b/usr/src/lib/libdll/Makefile.com
index 31e0864b26..8dddf764b0 100644
--- a/usr/src/lib/libdll/Makefile.com
+++ b/usr/src/lib/libdll/Makefile.com
@@ -18,14 +18,13 @@
#
# CDDL HEADER END
#
+
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
-SHELL=/usr/bin/ksh
+SHELL=/usr/bin/ksh93
LIBRARY= libdll.a
VERS= .1
@@ -46,11 +45,15 @@ include ../../Makefile.lib
# automated code updates easier.
MAPFILES= ../mapfile-vers
-# Set common AST build flags (e.g., needed to support the math stuff).
+# Set common AST build flags (e.g. C99/XPG6, needed to support the math stuff)
include ../../../Makefile.ast
LIBS = $(DYNLIB) $(LINTLIB)
-LDLIBS += -last -lc
+
+LDLIBS += \
+ -last \
+ -lc
+
$(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC)
SRCDIR = ../common
@@ -74,11 +77,9 @@ CPPFLAGS = \
-D_BLD_DLL
CFLAGS += \
- $(CCVERBOSE) \
- -xstrconst
+ $(ASTCFLAGS)
CFLAGS64 += \
- $(CCVERBOSE) \
- -xstrconst
+ $(ASTCFLAGS64)
.KEEP_STATE:
@@ -91,6 +92,5 @@ all: $(LIBS)
#
lint:
@ print "usr/src/lib/libdll is not lint-clean: skipping"
- @ $(TRUE)
include ../../Makefile.targ
diff --git a/usr/src/lib/libdll/amd64/Makefile b/usr/src/lib/libdll/amd64/Makefile
index 859cc09364..781d7acaa7 100644
--- a/usr/src/lib/libdll/amd64/Makefile
+++ b/usr/src/lib/libdll/amd64/Makefile
@@ -18,12 +18,11 @@
#
# CDDL HEADER END
#
+
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
# Platform-specific config
# Note that "HOSTTYPE" matches the value used by AT&T upstream.
diff --git a/usr/src/lib/libdll/amd64/src/lib/libdll/FEATURE/dll b/usr/src/lib/libdll/amd64/src/lib/libdll/FEATURE/dll
index 7c02252c4d..b62e81b7dc 100644
--- a/usr/src/lib/libdll/amd64/src/lib/libdll/FEATURE/dll
+++ b/usr/src/lib/libdll/amd64/src/lib/libdll/FEATURE/dll
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libdll/features/dll by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libdll/features/dll by iffe version 2008-01-31 : : */
#ifndef _def_dll_dll
#if !defined(__PROTO__)
@@ -63,7 +63,7 @@
#define _def_dll_dll 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
#define _hdr_dlfcn 1 /* #include <dlfcn.h> ok */
#define _LIB_dl 1 /* -ldl is a library */
diff --git a/usr/src/lib/libdll/amd64/src/lib/libdll/dlldefs.h b/usr/src/lib/libdll/amd64/src/lib/libdll/dlldefs.h
index 7c02252c4d..b62e81b7dc 100644
--- a/usr/src/lib/libdll/amd64/src/lib/libdll/dlldefs.h
+++ b/usr/src/lib/libdll/amd64/src/lib/libdll/dlldefs.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/lib/libdll/features/dll by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libdll/features/dll by iffe version 2008-01-31 : : */
#ifndef _def_dll_dll
#if !defined(__PROTO__)
@@ -63,7 +63,7 @@
#define _def_dll_dll 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
#define _hdr_dlfcn 1 /* #include <dlfcn.h> ok */
#define _LIB_dl 1 /* -ldl is a library */
diff --git a/usr/src/lib/libdll/common/RELEASE b/usr/src/lib/libdll/common/RELEASE
index 75f6ccd0f6..d4a437cf3d 100644
--- a/usr/src/lib/libdll/common/RELEASE
+++ b/usr/src/lib/libdll/common/RELEASE
@@ -1,3 +1,4 @@
+08-05-12 dllscan.c: LIBSUFFIX==.dylib => default plugin version match 0.0
06-10-11 dllscan.c: check sfstruse() return values -- doh
06-01-25 dllplug.c: add errorf() library message for dlopen() error
05-02-14 dllscan.c: "" || "-" => NiL
diff --git a/usr/src/lib/libdll/common/dlfcn.c b/usr/src/lib/libdll/common/dlfcn.c
index 00c4584667..5b61ff2c58 100644
--- a/usr/src/lib/libdll/common/dlfcn.c
+++ b/usr/src/lib/libdll/common/dlfcn.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1997-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1997-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libdll/common/dllfind.c b/usr/src/lib/libdll/common/dllfind.c
index beba43cdc2..48317c3fa8 100644
--- a/usr/src/lib/libdll/common/dllfind.c
+++ b/usr/src/lib/libdll/common/dllfind.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1997-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1997-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libdll/common/dlllook.c b/usr/src/lib/libdll/common/dlllook.c
index 5a408d8df5..6ea224e61d 100644
--- a/usr/src/lib/libdll/common/dlllook.c
+++ b/usr/src/lib/libdll/common/dlllook.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1997-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1997-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libdll/common/dllnext.c b/usr/src/lib/libdll/common/dllnext.c
index a932d96c7c..33f80f1255 100644
--- a/usr/src/lib/libdll/common/dllnext.c
+++ b/usr/src/lib/libdll/common/dllnext.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1997-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1997-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libdll/common/dllplug.c b/usr/src/lib/libdll/common/dllplug.c
index 303ffb513a..72ae471352 100644
--- a/usr/src/lib/libdll/common/dllplug.c
+++ b/usr/src/lib/libdll/common/dllplug.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1997-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1997-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libdll/common/dllscan.c b/usr/src/lib/libdll/common/dllscan.c
index e40296348e..3863390b2a 100644
--- a/usr/src/lib/libdll/common/dllscan.c
+++ b/usr/src/lib/libdll/common/dllscan.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1997-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1997-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -236,20 +236,24 @@ dllsopen(const char* lib, const char* name, const char* version)
lib = 0;
i = 0;
}
+ if (version && *version && (*version != '-' || *(version + 1)))
+ version = 0;
if (!(scan = vmnewof(vm, 0, Dllscan_t, 1, i)) || !(scan->tmp = sfstropen()))
{
vmclose(vm);
return 0;
}
+ scan->vm = vm;
+ info = dllinfo();
+ scan->flags = info->flags;
if (lib)
{
scan->lib = (char**)(scan + 1);
s = *scan->lib = (char*)(scan->lib + 2);
sfsprintf(s, i, "lib/%s", lib);
+ if (!version && streq(info->suffix, ".dylib"))
+ version = "0.0";
}
- scan->vm = vm;
- info = dllinfo();
- scan->flags = info->flags;
if (!name || !*name || *name == '-' && !*(name + 1))
{
name = (const char*)"?*";
@@ -262,9 +266,8 @@ dllsopen(const char* lib, const char* name, const char* version)
memcpy(scan->pb, name, t - (char*)name);
name = (const char*)(t + 1);
}
- if (!version || !*version || *version == '-' && !*(version + 1))
+ if (!version)
{
- version = 0;
scan->flags |= DLL_MATCH_VERSION;
sfsprintf(scan->nam, sizeof(scan->nam), "%s%s%s", info->prefix, name, info->suffix);
}
diff --git a/usr/src/lib/libdll/common/llib-ldll b/usr/src/lib/libdll/common/llib-ldll
index 446d400cd7..eac4e07d98 100644
--- a/usr/src/lib/libdll/common/llib-ldll
+++ b/usr/src/lib/libdll/common/llib-ldll
@@ -19,27 +19,14 @@
* CDDL HEADER END
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* lib/libdll/common/llib-ldll
*
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*LINTLIBRARY*/
/*PROTOLIB1*/
#include <dlldefs.h>
-
-/* automatically generated data start here */
-extern Dllinfo_t* dllinfo(void);
-extern void* dllplug(const char*, const char*, const char*, int, char*, size_t);
-extern void* dllfind(const char*, const char*, int, char*, size_t);
-extern void* dllnext(int);
-extern void* dlllook(void*, const char*);
-extern Dllscan_t* dllsopen(const char*, const char*, const char*);
-extern Dllent_t* dllsread(Dllscan_t*);
-extern int dllsclose(Dllscan_t*);
-/* end of automatically generated data */
diff --git a/usr/src/lib/libdll/i386/Makefile b/usr/src/lib/libdll/i386/Makefile
index 8ba7064a6b..9569971c6a 100644
--- a/usr/src/lib/libdll/i386/Makefile
+++ b/usr/src/lib/libdll/i386/Makefile
@@ -18,12 +18,11 @@
#
# CDDL HEADER END
#
+
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
# Platform-specific config
# Note that "HOSTTYPE" matches the value used by AT&T upstream.
diff --git a/usr/src/lib/libdll/i386/src/lib/libdll/FEATURE/dll b/usr/src/lib/libdll/i386/src/lib/libdll/FEATURE/dll
index 4a4efa79a4..9c30e76853 100644
--- a/usr/src/lib/libdll/i386/src/lib/libdll/FEATURE/dll
+++ b/usr/src/lib/libdll/i386/src/lib/libdll/FEATURE/dll
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libdll/features/dll by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libdll/features/dll by iffe version 2008-01-31 : : */
#ifndef _def_dll_dll
#if !defined(__PROTO__)
@@ -63,7 +63,7 @@
#define _def_dll_dll 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
#define _hdr_dlfcn 1 /* #include <dlfcn.h> ok */
#define _LIB_dl 1 /* -ldl is a library */
diff --git a/usr/src/lib/libdll/i386/src/lib/libdll/dlldefs.h b/usr/src/lib/libdll/i386/src/lib/libdll/dlldefs.h
index 4a4efa79a4..9c30e76853 100644
--- a/usr/src/lib/libdll/i386/src/lib/libdll/dlldefs.h
+++ b/usr/src/lib/libdll/i386/src/lib/libdll/dlldefs.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/lib/libdll/features/dll by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libdll/features/dll by iffe version 2008-01-31 : : */
#ifndef _def_dll_dll
#if !defined(__PROTO__)
@@ -63,7 +63,7 @@
#define _def_dll_dll 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
#define _hdr_dlfcn 1 /* #include <dlfcn.h> ok */
#define _LIB_dl 1 /* -ldl is a library */
diff --git a/usr/src/lib/libdll/mapfile-vers b/usr/src/lib/libdll/mapfile-vers
index 2ddb1442ce..eb42374c2f 100644
--- a/usr/src/lib/libdll/mapfile-vers
+++ b/usr/src/lib/libdll/mapfile-vers
@@ -20,11 +20,9 @@
#
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
# information generated from usr/src/lib/libdll/i386/src/lib/libdll/dlldefs.h
SUNWprivate_1.1 {
diff --git a/usr/src/lib/libdll/sparc/Makefile b/usr/src/lib/libdll/sparc/Makefile
index 0c579f5e22..c850083cd4 100644
--- a/usr/src/lib/libdll/sparc/Makefile
+++ b/usr/src/lib/libdll/sparc/Makefile
@@ -18,12 +18,11 @@
#
# CDDL HEADER END
#
+
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
# Platform-specific config
# Note that "HOSTTYPE" matches the value used by AT&T upstream.
diff --git a/usr/src/lib/libdll/sparc/src/lib/libdll/FEATURE/dll b/usr/src/lib/libdll/sparc/src/lib/libdll/FEATURE/dll
index ea5573ff05..46b5eaa630 100644
--- a/usr/src/lib/libdll/sparc/src/lib/libdll/FEATURE/dll
+++ b/usr/src/lib/libdll/sparc/src/lib/libdll/FEATURE/dll
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libdll/features/dll by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libdll/features/dll by iffe version 2008-01-31 : : */
#ifndef _def_dll_dll
#if !defined(__PROTO__)
@@ -63,7 +63,7 @@
#define _def_dll_dll 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
#define _hdr_dlfcn 1 /* #include <dlfcn.h> ok */
#define _LIB_dl 1 /* -ldl is a library */
diff --git a/usr/src/lib/libdll/sparc/src/lib/libdll/dlldefs.h b/usr/src/lib/libdll/sparc/src/lib/libdll/dlldefs.h
index ea5573ff05..46b5eaa630 100644
--- a/usr/src/lib/libdll/sparc/src/lib/libdll/dlldefs.h
+++ b/usr/src/lib/libdll/sparc/src/lib/libdll/dlldefs.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/lib/libdll/features/dll by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libdll/features/dll by iffe version 2008-01-31 : : */
#ifndef _def_dll_dll
#if !defined(__PROTO__)
@@ -63,7 +63,7 @@
#define _def_dll_dll 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
#define _hdr_dlfcn 1 /* #include <dlfcn.h> ok */
#define _LIB_dl 1 /* -ldl is a library */
diff --git a/usr/src/lib/libdll/sparcv9/Makefile b/usr/src/lib/libdll/sparcv9/Makefile
index bd91ecadc8..ed28ed1df8 100644
--- a/usr/src/lib/libdll/sparcv9/Makefile
+++ b/usr/src/lib/libdll/sparcv9/Makefile
@@ -18,12 +18,11 @@
#
# CDDL HEADER END
#
+
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
# Platform-specific config
# Note that "HOSTTYPE" matches the value used by AT&T upstream.
diff --git a/usr/src/lib/libdll/sparcv9/src/lib/libdll/FEATURE/dll b/usr/src/lib/libdll/sparcv9/src/lib/libdll/FEATURE/dll
index b83700214c..4e35e0f408 100644
--- a/usr/src/lib/libdll/sparcv9/src/lib/libdll/FEATURE/dll
+++ b/usr/src/lib/libdll/sparcv9/src/lib/libdll/FEATURE/dll
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libdll/features/dll by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libdll/features/dll by iffe version 2008-01-31 : : */
#ifndef _def_dll_dll
#if !defined(__PROTO__)
@@ -63,7 +63,7 @@
#define _def_dll_dll 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
#define _hdr_dlfcn 1 /* #include <dlfcn.h> ok */
#define _LIB_dl 1 /* -ldl is a library */
diff --git a/usr/src/lib/libdll/sparcv9/src/lib/libdll/dlldefs.h b/usr/src/lib/libdll/sparcv9/src/lib/libdll/dlldefs.h
index b83700214c..4e35e0f408 100644
--- a/usr/src/lib/libdll/sparcv9/src/lib/libdll/dlldefs.h
+++ b/usr/src/lib/libdll/sparcv9/src/lib/libdll/dlldefs.h
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/lib/libdll/features/dll by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libdll/features/dll by iffe version 2008-01-31 : : */
#ifndef _def_dll_dll
#if !defined(__PROTO__)
@@ -63,7 +63,7 @@
#define _def_dll_dll 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
#define _hdr_dlfcn 1 /* #include <dlfcn.h> ok */
#define _LIB_dl 1 /* -ldl is a library */
diff --git a/usr/src/lib/libpp/Makefile b/usr/src/lib/libpp/Makefile
index 4091cfcbbf..30cbb5e49f 100644
--- a/usr/src/lib/libpp/Makefile
+++ b/usr/src/lib/libpp/Makefile
@@ -19,13 +19,11 @@
# CDDL HEADER END
#
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
-SHELL=/usr/bin/ksh
+SHELL=/usr/bin/ksh93
include ../Makefile.lib
diff --git a/usr/src/lib/libpp/Makefile.com b/usr/src/lib/libpp/Makefile.com
index f9a16b9af1..8ed741ebdf 100644
--- a/usr/src/lib/libpp/Makefile.com
+++ b/usr/src/lib/libpp/Makefile.com
@@ -19,13 +19,11 @@
# CDDL HEADER END
#
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
-SHELL=/usr/bin/ksh
+SHELL=/usr/bin/ksh93
LIBRARY= libpp.a
VERS= .1
@@ -64,11 +62,15 @@ include ../../Makefile.lib
# automated code updates easier.
MAPFILES= ../mapfile-vers
-# Set common AST build flags (e.g., needed to support the math stuff).
+# Set common AST build flags (e.g. C99/XPG6, needed to support the math stuff)
include ../../../Makefile.ast
LIBS = $(DYNLIB) $(LINTLIB)
-LDLIBS += -last -lc
+
+LDLIBS += \
+ -last \
+ -lc
+
$(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC)
SRCDIR = ../common
@@ -85,16 +87,15 @@ CPPFLAGS = \
-D_PACKAGE_ast \
'-DUSAGE_LICENSE=\
"[-author?Glenn Fowler <gsf@research.att.com>]"\
- "[-copyright?Copyright (c) 1986-2007 AT&T Knowledge Ventures]"\
+ "[-copyright?Copyright (c) 1986-2008 AT&T Intellectual Property]"\
"[-license?http://www.opensource.org/licenses/cpl1.0.txt]"\
"[--catalog?libpp]"'
+
CFLAGS += \
- $(CCVERBOSE) \
- -xstrconst
+ $(ASTCFLAGS)
CFLAGS64 += \
- $(CCVERBOSE) \
- -xstrconst
+ $(ASTCFLAGS64)
pics/ppcall.o := CERRWARN += -erroff=E_INTEGER_OVERFLOW_DETECTED
pics/ppcontrol.o := CERRWARN += -erroff=E_INTEGER_OVERFLOW_DETECTED
@@ -116,6 +117,5 @@ all: $(LIBS)
#
lint:
@ print "usr/src/lib/libpp is not lint-clean: skipping"
- @ $(TRUE)
include ../../Makefile.targ
diff --git a/usr/src/lib/libpp/common/RELEASE b/usr/src/lib/libpp/common/RELEASE
index 179930e147..80a3c89a48 100644
--- a/usr/src/lib/libpp/common/RELEASE
+++ b/usr/src/lib/libpp/common/RELEASE
@@ -1,3 +1,11 @@
+08-05-11 ppproto.c: fix proto test 10 regression
+07-09-21 ppproto.c: add "Public Domain" to the noticed list
+07-08-11 probe.win32: add cl.exe setuid workaround, CC.VERSION[.STRING]
+07-06-12 pplex.c: finish -D:preserve logic update for imake
+07-06-07 pplex.c: handle -D:preserve S_CHRB splices
+07-06-04 ppsearch.c: only apply pp:chop ?old?new? if original not found
+07-03-11 add -D-Y pp:pedantic, PP_WARN macro formal parenthesis checks
+07-01-26 pp.def,probe.win32: add _WCHAR_T_DEFINED
06-09-23 ppop.c: check -I <dev,ino> for c and TYPE_HOSTED|TYPE_VENDOR attrs
06-09-23 pplex.c: add HOSTED check for "/* appears in // comment" -- doh
06-09-05 pp.probe: add version stamp comment
diff --git a/usr/src/lib/libpp/common/gentab.sh b/usr/src/lib/libpp/common/gentab.sh
index 0234ce6c93..d843868970 100644
--- a/usr/src/lib/libpp/common/gentab.sh
+++ b/usr/src/lib/libpp/common/gentab.sh
@@ -1,10 +1,10 @@
########################################################################
# #
# This software is part of the ast package #
-# Copyright (c) 1986-2007 AT&T Knowledge Ventures #
+# Copyright (c) 1986-2008 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
-# by AT&T Knowledge Ventures #
+# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# http://www.opensource.org/licenses/cpl1.0.txt #
diff --git a/usr/src/lib/libpp/common/llib-lpp b/usr/src/lib/libpp/common/llib-lpp
index d3df1ce176..5d49fc1b83 100644
--- a/usr/src/lib/libpp/common/llib-lpp
+++ b/usr/src/lib/libpp/common/llib-lpp
@@ -18,36 +18,15 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* lib/libpp/common/llib-lpp
- *
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*LINTLIBRARY*/
/*PROTOLIB1*/
#include "pp.h"
-
-/* automatically generated data start here */
-extern struct ppglobals pp;
-extern char ppctype[];
-extern int ppargs(char**, int);
-extern void ppcpp(void);
-extern void ppcomment(char*, char*, char*, int);
-extern void* ppcontext(void*, int);
-extern void pperror(int, ...);
-extern void ppincref(char*, char*, int, int);
-extern void ppinput(char*, char*, int);
-extern int pplex(void);
-extern void ppline(int, char*);
-extern void ppmacref(struct ppsymbol*, char*, int, int, unsigned long);
-extern void ppop(int, ...);
-extern void pppragma(char*, char*, char*, char*, int);
-extern int ppprintf(char*, ...);
-extern int ppsync(void);
-/* end of automatically generated data */
diff --git a/usr/src/lib/libpp/common/pp.def b/usr/src/lib/libpp/common/pp.def
index f2d679f3af..f44dac94a5 100644
--- a/usr/src/lib/libpp/common/pp.def
+++ b/usr/src/lib/libpp/common/pp.def
@@ -1,7 +1,7 @@
#
# list of known old cpp predefined symbols
#
-# @(#)pp.def (gsf@research.att.com) 2002-11-26
+# @(#)pp.def (gsf@research.att.com) 2007-01-26
#
# symbols will be tested for the common `_' permutations
# qualifiers may be combinations of
@@ -160,6 +160,7 @@ VAX :architecture:
VAX11C :vendor:
VAXC :vendor:
VMS :system:
+WCHAR_T_DEFINED
WCHAR_TYPE
WIN32 :release:
X86 :architecture:
diff --git a/usr/src/lib/libpp/common/pp.h b/usr/src/lib/libpp/common/pp.h
index 2b91c8e435..08eee17b16 100644
--- a/usr/src/lib/libpp/common/pp.h
+++ b/usr/src/lib/libpp/common/pp.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1986-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1986-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -68,7 +68,7 @@
#define PPBUFSIZ (32*PPBLKSIZ) /* io buffer size */
#define PPTOKSIZ ((PPBUFSIZ/2)-1) /* max token size */
-#define PPWRITE(n) do{if(write(1,pp.outbuf,n)!=(n))pperror(ERROR_SYSTEM|3,"%s: write error",pp.outfile);pp.offset+=(n);pp.lastout=pp.outbuf[n-1];}while(0)
+#define PPWRITE(n) do{if(write(1,pp.outbuf,n)!=(n))pperror(ERROR_SYSTEM|3,"%s: write error",pp.outfile);pp.offset+=(n);pp.lastout=pp.outbuf[(n)-1];}while(0)
#define pplastout() ((pp.outp>pp.outbuf)?*(pp.outp-1):pp.lastout)
#define ppoffset() (pp.offset+pppendout())
diff --git a/usr/src/lib/libpp/common/ppargs.c b/usr/src/lib/libpp/common/ppargs.c
index 0aaff3905e..52da340da3 100644
--- a/usr/src/lib/libpp/common/ppargs.c
+++ b/usr/src/lib/libpp/common/ppargs.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1986-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1986-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -27,7 +27,7 @@
*/
static const char usage[] =
-"[-?\n@(#)$Id: cpp (AT&T Research) 2006-01-11 $\n]"
+"[-?\n@(#)$Id: cpp (AT&T Research) 2007-03-11 $\n]"
USAGE_LICENSE
"[+NAME?cpp - C language preprocessor]"
"[+DESCRIPTION?\bcpp\b is the preprocessor for all C language dialects. It is"
@@ -80,9 +80,11 @@ USAGE_LICENSE
" or the default ISO).]"
" [+-D-T\atest\a, \bpp::test\b \atest\a?Enable implementation specific"
" test code according to \atest\a.]"
-" [+-D-W, pp::warn?Enable pedantic warnings in non-hosted files.]"
+" [+-D-W, pp::warn?Enable warnings in non-hosted files.]"
" [+-D-X\b[\acc\a]]?Preprocess for the compiler \acc\a which must be"
" an executable path or an executable on \b$PATH\b.]"
+" [+-D-Y, pp::pedantic?Enable pedantic \bpp::warn\b warnings in"
+" non-hosted files.]"
" [+-D-Z, pp::pool?Enable pool mode. See \blibpp\b(3).]"
" [+-D-d?List canonicalized \b#define\b statements for non-predefined"
" macros in the output. ]"
@@ -271,6 +273,9 @@ ppargs(char** argv, int last)
case 'X':
ppop(PP_PROBE, n && *s ? s : 0);
goto hasarg;
+ case 'Y':
+ ppop(PP_PEDANTIC, n);
+ break;
case 'Z':
ppop(PP_POOL, n);
break;
diff --git a/usr/src/lib/libpp/common/ppbuiltin.c b/usr/src/lib/libpp/common/ppbuiltin.c
index b9a906f657..4e58af0251 100644
--- a/usr/src/lib/libpp/common/ppbuiltin.c
+++ b/usr/src/lib/libpp/common/ppbuiltin.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1986-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1986-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -46,6 +46,7 @@ ppbuiltin(void)
char* token;
char* t;
long number;
+ long onumber;
struct ppinstk* in;
struct pplist* list;
struct ppsymbol* sym;
@@ -279,7 +280,7 @@ ppbuiltin(void)
#define BACK(a,p) ((a>p)?*--a:(number++?0:((p=pp.outbuf+PPBUFSIZ),(a=pp.outbuf+2*PPBUFSIZ),*--a)))
#define PEEK(a,p) ((a>p)?*(a-1):(number?0:*(pp.outbuf+2*PPBUFSIZ-1)))
- number = pp.outbuf == pp.outb;
+ number = pp.outbuf != pp.outb;
a = pp.outp;
p = pp.outb;
op = 0;
@@ -327,14 +328,21 @@ ppbuiltin(void)
{
if (ppisidig(c))
{
- for (t = p, token = a; ppisidig(PEEK(a, p)); a--);
- for (p = pp.valbuf + 1; a <= token; *p++ = *a++);
+ for (t = p, token = a, onumber = number; ppisidig(PEEK(a, p)) && a >= p; BACK(a, p));
+ p = pp.valbuf + 1;
+ if (a > token)
+ {
+ for (; a < pp.outbuf+2*PPBUFSIZ; *p++ = *a++);
+ a = pp.outbuf;
+ }
+ for (; a <= token; *p++ = *a++);
*p = 0;
p = pp.valbuf + 1;
if (streq(p, "for") || streq(p, "if") || streq(p, "switch") || streq(p, "while"))
{
op = 0;
p = t;
+ number = onumber;
continue;
}
}
@@ -344,7 +352,7 @@ ppbuiltin(void)
}
}
if (op == 3)
- strncpy(pp.funbuf, p, sizeof(pp.funbuf) - 1);
+ p = strncpy(pp.funbuf, p, sizeof(pp.funbuf) - 1);
else if (*pp.funbuf)
p = pp.funbuf;
else
diff --git a/usr/src/lib/libpp/common/ppcall.c b/usr/src/lib/libpp/common/ppcall.c
index 8e273dc92f..b06a5961f9 100644
--- a/usr/src/lib/libpp/common/ppcall.c
+++ b/usr/src/lib/libpp/common/ppcall.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1986-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1986-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libpp/common/ppcomment.c b/usr/src/lib/libpp/common/ppcomment.c
index c938bc2e67..75e5f1e843 100644
--- a/usr/src/lib/libpp/common/ppcomment.c
+++ b/usr/src/lib/libpp/common/ppcomment.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1986-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1986-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libpp/common/ppcontext.c b/usr/src/lib/libpp/common/ppcontext.c
index 220481ab87..7bba261a5f 100644
--- a/usr/src/lib/libpp/common/ppcontext.c
+++ b/usr/src/lib/libpp/common/ppcontext.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1986-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1986-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libpp/common/ppcontrol.c b/usr/src/lib/libpp/common/ppcontrol.c
index a5d9974927..fff96641f3 100644
--- a/usr/src/lib/libpp/common/ppcontrol.c
+++ b/usr/src/lib/libpp/common/ppcontrol.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1986-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1986-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -907,6 +907,24 @@ ppcontrol(void)
#endif
*p++ = (n1 || var.type == TOK_TOKCAT) ? 'C' : 'A';
*p++ = c + ARGOFFSET;
+ if ((pp.state & WARN) && !(pp.mode & (HOSTED|RELAX)) && var.type != TOK_TOKCAT && !(var.type & TOK_ID))
+ {
+ s = pp.in->nextchr;
+ while ((c = *s++) && (c == ' ' || c == '\t'));
+ if (c == '\n')
+ c = 0;
+ else if (c == '*' && *s == ')')
+ c = ')';
+ else if (c == '=' || ppisidig(c) || c == *s || *s == '=')
+ c = 0;
+ if (o != '.' && o != T_PTRMEM)
+ {
+ if ((var.type & TOK_ID) || o == ' ' || ppisseparate(o))
+ o = 0;
+ if (!((o == 0 || o == '(' || o == ')' || o == '[' || o == ']' || o == ',' || o == '|' || o == ';' || o == '{' || o == '}') && (c == '(' || c == ')' || c == '[' || c == ']' || c == ',' || c == '|' || c == ';' || c == '}' || c == 0)) && !(o == '*' && c == ')'))
+ error(1, "%s: %s: formal should be parenthesized in macro value (t=%x o=%#c c=%#c)", sym->name, pp.token, var.type, o, c);
+ }
+ }
var.type = TOK_FORMAL|TOK_ID;
c = '>';
goto checkvalue;
@@ -1621,7 +1639,7 @@ ppcontrol(void)
}
if (!p1 && p3 && (p4 - p3) == 4 && strneq(p3, "STDC", 4))
goto pass;
- if ((pp.state & WARN) && !(pp.mode & (HOSTED|RELAX)))
+ if ((pp.state & WARN) && (pp.mode & (HOSTED|RELAX|PEDANTIC)) == PEDANTIC)
error(1, "#%s: non-standard directive", dirname(PRAGMA));
i0 = !p3 || *p3 != 'n' || *(p3 + 1) != 'o';
if (!p3)
diff --git a/usr/src/lib/libpp/common/ppcpp.c b/usr/src/lib/libpp/common/ppcpp.c
index 23e3fe7541..e9bdae545a 100644
--- a/usr/src/lib/libpp/common/ppcpp.c
+++ b/usr/src/lib/libpp/common/ppcpp.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1986-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1986-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libpp/common/ppdata.c b/usr/src/lib/libpp/common/ppdata.c
index 4c15eaf940..555773e334 100644
--- a/usr/src/lib/libpp/common/ppdata.c
+++ b/usr/src/lib/libpp/common/ppdata.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1986-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1986-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -48,7 +48,7 @@
* only within macro bodies
*/
-static const char id[] = "\n@(#)$Id: libpp (AT&T Research) 2006-11-23 $\0\n";
+static const char id[] = "\n@(#)$Id: libpp (AT&T Research) 2007-06-12 $\0\n";
#include "pplib.h"
diff --git a/usr/src/lib/libpp/common/pperror.c b/usr/src/lib/libpp/common/pperror.c
index 46f7442ec7..e7f575a908 100644
--- a/usr/src/lib/libpp/common/pperror.c
+++ b/usr/src/lib/libpp/common/pperror.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1986-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1986-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libpp/common/ppexpr.c b/usr/src/lib/libpp/common/ppexpr.c
index 5fd93afde5..219b707cb5 100644
--- a/usr/src/lib/libpp/common/ppexpr.c
+++ b/usr/src/lib/libpp/common/ppexpr.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1986-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1986-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libpp/common/ppfsm.c b/usr/src/lib/libpp/common/ppfsm.c
index 5cef65db2a..42a7f4ef1a 100644
--- a/usr/src/lib/libpp/common/ppfsm.c
+++ b/usr/src/lib/libpp/common/ppfsm.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1986-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1986-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libpp/common/ppfsm.h b/usr/src/lib/libpp/common/ppfsm.h
index 1aff931d2b..ac471e0e80 100644
--- a/usr/src/lib/libpp/common/ppfsm.h
+++ b/usr/src/lib/libpp/common/ppfsm.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1986-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1986-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libpp/common/ppincref.c b/usr/src/lib/libpp/common/ppincref.c
index 336940bb12..5d4362cb9d 100644
--- a/usr/src/lib/libpp/common/ppincref.c
+++ b/usr/src/lib/libpp/common/ppincref.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1986-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1986-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libpp/common/ppinput.c b/usr/src/lib/libpp/common/ppinput.c
index 170e5f5dca..0fac34d9e1 100644
--- a/usr/src/lib/libpp/common/ppinput.c
+++ b/usr/src/lib/libpp/common/ppinput.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1986-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1986-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libpp/common/ppkey.c b/usr/src/lib/libpp/common/ppkey.c
index 6dfe481cc4..8bb10531fd 100644
--- a/usr/src/lib/libpp/common/ppkey.c
+++ b/usr/src/lib/libpp/common/ppkey.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1986-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1986-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libpp/common/ppkey.h b/usr/src/lib/libpp/common/ppkey.h
index 95f89e52c1..d87543fed2 100644
--- a/usr/src/lib/libpp/common/ppkey.h
+++ b/usr/src/lib/libpp/common/ppkey.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1986-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1986-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libpp/common/pplex.c b/usr/src/lib/libpp/common/pplex.c
index 364854d8ae..a421393b60 100644
--- a/usr/src/lib/libpp/common/pplex.c
+++ b/usr/src/lib/libpp/common/pplex.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1986-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1986-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -234,7 +234,7 @@ ppcpp(void)
{
ip = bp;
#if CPP
- if (op == tp && (st & (ADD|HIDDEN)) && !(st & PASSTHROUGH))
+ if (op == tp && (st & (ADD|HIDDEN)) && !(st & PASSTHROUGH) && !(pp.option & PRESERVE))
switch (TERM(state))
{
case S_SHARP:
@@ -245,6 +245,8 @@ ppcpp(void)
break;
/*FALLTHROUGH*/
default:
+ if ((pp.option & PRESERVE) && !(st & NEWLINE) && c != '\n')
+ break;
PPSYNCLINE();
tp = op;
break;
@@ -918,7 +920,7 @@ ppcpp(void)
goto fsm_get;
}
#if CPP
- if (st & PASSTHROUGH)
+ if ((st & PASSTHROUGH) || (pp.option & PRESERVE))
{
if (c == '\n') goto fsm_newline;
bp = ip;
@@ -1121,7 +1123,10 @@ ppcpp(void)
#if CPP
if (n && !(st & (PASSTHROUGH|SKIPCONTROL|NOTEXT)) && c == '\'' && (op - tp) <= 2 && !(pp.mode & (HOSTED|RELAX)))
error(1, "empty character constant");
- st &= ~(ESCAPE|NEWLINE);
+ if (pp.option & PRESERVE)
+ st &= ~ESCAPE;
+ else
+ st &= ~(ESCAPE|NEWLINE);
pp.in->flags |= IN_tokens;
count(token);
goto fsm_start;
@@ -1787,7 +1792,7 @@ ppcpp(void)
case S_NL:
#if CPP
- if (op == tp && !(st & JOINING) && pp.in->type == IN_FILE)
+ if (op == tp && !(st & JOINING) && pp.in->type == IN_FILE && !(pp.option & PRESERVE))
{
st |= NEWLINE|HIDDEN;
pp.hidden++;
diff --git a/usr/src/lib/libpp/common/pplib.h b/usr/src/lib/libpp/common/pplib.h
index 3428b4d55f..a450eb63a9 100644
--- a/usr/src/lib/libpp/common/pplib.h
+++ b/usr/src/lib/libpp/common/pplib.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1986-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1986-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libpp/common/ppline.c b/usr/src/lib/libpp/common/ppline.c
index 8ff7c23339..62e56c3a73 100644
--- a/usr/src/lib/libpp/common/ppline.c
+++ b/usr/src/lib/libpp/common/ppline.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1986-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1986-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libpp/common/ppmacref.c b/usr/src/lib/libpp/common/ppmacref.c
index d744f99803..efe97e63ce 100644
--- a/usr/src/lib/libpp/common/ppmacref.c
+++ b/usr/src/lib/libpp/common/ppmacref.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1986-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1986-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libpp/common/ppmisc.c b/usr/src/lib/libpp/common/ppmisc.c
index d7b5d3730e..22a989ada4 100644
--- a/usr/src/lib/libpp/common/ppmisc.c
+++ b/usr/src/lib/libpp/common/ppmisc.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1986-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1986-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libpp/common/ppop.c b/usr/src/lib/libpp/common/ppop.c
index 86e3651864..61f9983469 100644
--- a/usr/src/lib/libpp/common/ppop.c
+++ b/usr/src/lib/libpp/common/ppop.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1986-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1986-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -736,7 +736,7 @@ ppop(int op, ...)
ppop(PP_TRANSITION, 1);
break;
}
- if (!(pp.arg_style & STYLE_gnu))
+ if (!(pp.state & WARN) && !(pp.arg_style & STYLE_gnu))
ppop(PP_PEDANTIC, 1);
if (pp.state & PASSTHROUGH)
{
diff --git a/usr/src/lib/libpp/common/pppragma.c b/usr/src/lib/libpp/common/pppragma.c
index 875a17e5eb..bb442471e3 100644
--- a/usr/src/lib/libpp/common/pppragma.c
+++ b/usr/src/lib/libpp/common/pppragma.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1986-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1986-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libpp/common/ppprintf.c b/usr/src/lib/libpp/common/ppprintf.c
index b8c6c77a07..d1c1f9707a 100644
--- a/usr/src/lib/libpp/common/ppprintf.c
+++ b/usr/src/lib/libpp/common/ppprintf.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1986-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1986-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libpp/common/ppproto.c b/usr/src/lib/libpp/common/ppproto.c
index f03b2535bc..b3e6794921 100644
--- a/usr/src/lib/libpp/common/ppproto.c
+++ b/usr/src/lib/libpp/common/ppproto.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1986-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1986-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -29,7 +29,7 @@
* PROTOMAIN is coded for minimal library support
*/
-static const char id[] = "\n@(#)$Id: proto (AT&T Research) 2006-06-28 $\0\n";
+static const char id[] = "\n@(#)$Id: proto (AT&T Research) 2008-05-11 $\0\n";
#if PROTOMAIN
@@ -55,6 +55,7 @@ static const char id[] = "\n@(#)$Id: proto (AT&T Research) 2006-06-28 $\0\n";
#define MAGICOFF "noticed" /* no notice if found in pragma */
#define MAGICTOP 64 /* must be in these top lines */
#define NOTICED "Copyright" /* no notice if found in magic */
+#define PUBLICDOMAIN "Public Domain" /* no notice if found in magic */
struct proto /* proto buffer state */
{
@@ -1633,7 +1634,11 @@ if !defined(va_start)\n\
break;
case '=':
if (last == '?') flags |= DIRECTIVE;
- else if (paren == 0 && (flags & (INIT|MATCH|SKIP)) == MATCH) goto fsm_statement;
+ else if (paren == 0 && (flags & (INIT|MATCH|SKIP)) == MATCH)
+ {
+ if (last == ')' && proto->brace && (group != 2 || call != 2)) flags |= SKIP;
+ else goto fsm_statement;
+ }
goto fsm_other;
case ',':
#if PROTOMAIN
@@ -2286,6 +2291,11 @@ pppopen(char* file, int fd, char* notice, char* options, char* package, char* co
break;
}
}
+ if (*s == *PUBLICDOMAIN && !strncmp(s, PUBLICDOMAIN, sizeof(PUBLICDOMAIN) - 1))
+ {
+ notice = options = 0;
+ break;
+ }
else if (*s++ == '\n')
{
s--;
diff --git a/usr/src/lib/libpp/common/ppsearch.c b/usr/src/lib/libpp/common/ppsearch.c
index f9bf29fe01..83b956bca9 100644
--- a/usr/src/lib/libpp/common/ppsearch.c
+++ b/usr/src/lib/libpp/common/ppsearch.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1986-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1986-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -86,7 +86,7 @@ ppmultiple(register struct ppfile* fp, register struct ppsymbol* test)
{
if ((pp.mode & (ALLMULTIPLE|LOADING)) == LOADING)
fp->guard = INC_IGNORE;
- if (pp.state & WARN)
+ if ((pp.state & WARN) && (pp.mode & (HOSTED|MARKHOSTED|RELAX|PEDANTIC)) == PEDANTIC)
error(1, "%s: ignored -- already included", fp->name);
else
message((-3, "%s: ignored -- already included", fp->name));
@@ -530,7 +530,7 @@ if (pp.test & 0x0010) error(1, "SEARCH#%d file=%s path=%s index=%d data=<%lu,%lu
xp->guard = INC_TEST;
else
{
- if (pp.state & WARN)
+ if ((pp.state & WARN) && (pp.mode & (HOSTED|MARKHOSTED|RELAX|PEDANTIC)) == PEDANTIC)
error(1, "%s: ignored -- already included", xp->name);
else
message((-3, "%s: ignored -- already included", xp->name));
@@ -598,6 +598,7 @@ ppsearch(char* file, int type, int flags)
struct oplist* cp;
struct ppfile* xp;
int dospath;
+ int chop;
int fd;
int index;
char name[MAXTOKEN + 1];
@@ -605,24 +606,26 @@ ppsearch(char* file, int type, int flags)
pp.include = 0;
fd = -1;
dospath = 0;
+ chop = 0;
again:
pathcanon(file, 0);
- for (cp = pp.chop; cp; cp = cp->next)
- if (strneq(file, cp->value, cp->op))
- {
- if (cp->value[cp->op + 1])
- {
- sfsprintf(name, sizeof(name) - 1, "%s%s", cp->value + cp->op + 1, file + cp->op);
- message((-3, "chop: %s -> %s", file, name));
- file = name;
- }
- else if (strchr(file + cp->op, '/'))
+ if (chop)
+ for (cp = pp.chop; cp; cp = cp->next)
+ if (strneq(file, cp->value, cp->op))
{
- message((-3, "chop: %s -> %s", file, file + cp->op));
- file += cp->op;
+ if (cp->value[cp->op + 1])
+ {
+ sfsprintf(name, sizeof(name) - 1, "%s%s", cp->value + cp->op + 1, file + cp->op);
+ message((-2, "search: %s -> %s", file, name));
+ file = name;
+ }
+ else if (strchr(file + cp->op, '/'))
+ {
+ message((-2, "search: %s -> %s", file, file + cp->op));
+ file += cp->op;
+ }
+ break;
}
- break;
- }
fp = ppsetfile(file);
while ((fp->flags & INC_MAPALL) || (fp->flags & INC_MAPHOSTED) && (pp.mode & HOSTED) || (fp->flags & INC_MAPNOHOSTED) && !(pp.mode & HOSTED))
{
@@ -779,6 +782,12 @@ ppsearch(char* file, int type, int flags)
}
if ((flags & (SEARCH_INCLUDE|SEARCH_NEXT)) == SEARCH_INCLUDE)
{
+ if (!chop && pp.chop)
+ {
+ chop = 1;
+ type = T_STRING;
+ goto again;
+ }
if (!(pp.mode & GENDEPS))
{
if (!(pp.option & ALLPOSSIBLE) || pp.in->prev->prev)
diff --git a/usr/src/lib/libpp/common/ppsym.c b/usr/src/lib/libpp/common/ppsym.c
index 081f1bcd94..5fa4d7ff23 100644
--- a/usr/src/lib/libpp/common/ppsym.c
+++ b/usr/src/lib/libpp/common/ppsym.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1986-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1986-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libpp/common/pptrace.c b/usr/src/lib/libpp/common/pptrace.c
index d1b1204817..a10117f4bd 100644
--- a/usr/src/lib/libpp/common/pptrace.c
+++ b/usr/src/lib/libpp/common/pptrace.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1986-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1986-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libpp/i386/Makefile b/usr/src/lib/libpp/i386/Makefile
index f91f0270e9..34cbd52eb3 100644
--- a/usr/src/lib/libpp/i386/Makefile
+++ b/usr/src/lib/libpp/i386/Makefile
@@ -18,12 +18,12 @@
#
# CDDL HEADER END
#
+
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
+
include ../Makefile.com
diff --git a/usr/src/lib/libpp/mapfile-vers b/usr/src/lib/libpp/mapfile-vers
index 43e4584b85..cd8b20bfc6 100644
--- a/usr/src/lib/libpp/mapfile-vers
+++ b/usr/src/lib/libpp/mapfile-vers
@@ -20,11 +20,9 @@
#
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
SUNWprivate_1.1 {
global:
diff --git a/usr/src/lib/libpp/sparc/Makefile b/usr/src/lib/libpp/sparc/Makefile
index f91f0270e9..79cb51eae6 100644
--- a/usr/src/lib/libpp/sparc/Makefile
+++ b/usr/src/lib/libpp/sparc/Makefile
@@ -18,12 +18,11 @@
#
# CDDL HEADER END
#
+
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
include ../Makefile.com
diff --git a/usr/src/lib/libshell/Makefile b/usr/src/lib/libshell/Makefile
index bd4a38cb78..c30d0df3ed 100644
--- a/usr/src/lib/libshell/Makefile
+++ b/usr/src/lib/libshell/Makefile
@@ -18,14 +18,13 @@
#
# CDDL HEADER END
#
+
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
-SHELL=/usr/bin/ksh
+SHELL=/usr/bin/ksh93
include ../Makefile.lib
diff --git a/usr/src/lib/libshell/Makefile.com b/usr/src/lib/libshell/Makefile.com
index 3e071f416a..54857c5329 100644
--- a/usr/src/lib/libshell/Makefile.com
+++ b/usr/src/lib/libshell/Makefile.com
@@ -18,14 +18,13 @@
#
# CDDL HEADER END
#
+
#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
-SHELL=/usr/bin/ksh
+SHELL=/usr/bin/ksh93
LIBRARY= libshell.a
VERS= .1
@@ -34,6 +33,7 @@ OBJECTS= \
bltins/alarm.o \
bltins/cd_pwd.o \
bltins/cflow.o \
+ bltins/enum.o \
bltins/getopts.o \
bltins/hist.o \
bltins/misc.o \
@@ -81,6 +81,7 @@ OBJECTS= \
sh/name.o \
sh/nvdisc.o \
sh/nvtree.o \
+ sh/nvtype.o \
sh/parse.o \
sh/path.o \
sh/streval.o \
@@ -105,7 +106,11 @@ OBJDIRS = \
PICSDIRS= $(OBJDIRS:%=pics/%)
mkpicdirs:
@mkdir -p $(PICSDIRS)
-
+
+# Specify the MACH we currently use to build and test ksh
+LIBSHELLMACH= $(TARGETMACH)
+LIBSHELLBASE=..
+
include ../../Makefile.astmsg
include ../../Makefile.lib
@@ -114,11 +119,19 @@ include ../../Makefile.lib
# automated code updates easier.
MAPFILES= ../mapfile-vers
-# Set common AST build flags (e.g., needed to support the math stuff).
+# Set common AST build flags (e.g. C99/XPG6, needed to support the math stuff)
include ../../../Makefile.ast
LIBS = $(DYNLIB) $(LINTLIB)
-LDLIBS += -lcmd -ldll -last -lsocket -lsecdb -lm -lc
+
+LDLIBS += \
+ -lcmd \
+ -ldll \
+ -last \
+ -lsocket \
+ -lsecdb \
+ -lm \
+ -lc
$(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC)
@@ -133,17 +146,15 @@ SRCDIR = ../common
# way to explicitly list each single flag.
CPPFLAGS = \
$(DTEXTDOM) $(DTS_ERRNO) \
- -Isrc/cmd/ksh93 \
- -I../common/include \
$(LIBSHELLCPPFLAGS)
-
CFLAGS += \
- $(CCVERBOSE) \
- -xstrconst
+ $(ASTCFLAGS)
CFLAGS64 += \
- $(CCVERBOSE) \
- -xstrconst
+ $(ASTCFLAGS64)
+
+pics/sh/macro.o := CERRWARN += -erroff=E_NO_IMPLICIT_DECL_ALLOWED
+pics/sh/nvdisc.o := CERRWARN += -erroff=E_END_OF_LOOP_CODE_NOT_REACHED
.KEEP_STATE:
@@ -156,6 +167,5 @@ all: mkpicdirs .WAIT $(LIBS)
#
lint:
@ print "usr/src/lib/libshell is not lint-clean: skipping"
- @ $(TRUE)
include ../../Makefile.targ
diff --git a/usr/src/lib/libshell/Makefile.demo b/usr/src/lib/libshell/Makefile.demo
index 608f1569cb..fa8235af6e 100644
--- a/usr/src/lib/libshell/Makefile.demo
+++ b/usr/src/lib/libshell/Makefile.demo
@@ -18,29 +18,51 @@
#
# CDDL HEADER END
#
+
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
ROOTDEMODIRBASE= $(ROOT)/usr/demo/ksh
DEMOFILES= \
+ doc/RELEASE \
+ doc/README \
+ doc/TYPES \
+ doc/DESIGN \
+ doc/COMPATIBILITY \
+ doc/OBSOLETE \
+ bin/crawlsrccomments \
+ bin/filemutexdemo1 \
+ bin/filetree1 \
+ bin/gnaw \
+ bin/mandelbrotset1 \
+ bin/multifollow \
+ bin/primenumbers1 \
+ bin/rssread \
+ bin/shcalc \
+ bin/shircbot \
+ bin/shlint \
+ bin/shman \
+ bin/shnote \
+ bin/shpiano \
+ bin/shtinyurl \
+ bin/shtwitter \
+ bin/svcproptree1 \
+ bin/termclock \
+ bin/test_net_sctp \
+ bin/xmldocumenttree1 \
fun/dirs \
- fun/gnaw \
- fun/mandelbrotset1 \
- fun/rssread \
fun/popd \
fun/pushd \
- fun/termclock \
fun/title \
tests/shtests \
tests/alias.sh \
tests/append.sh \
tests/arith.sh \
tests/arrays.sh \
+ tests/arrays2.sh \
tests/attributes.sh \
tests/basic.sh \
tests/bracket.sh \
@@ -48,6 +70,8 @@ DEMOFILES= \
tests/case.sh \
tests/comvar.sh \
tests/coprocess.sh \
+ tests/cubetype.sh \
+ tests/enum.sh \
tests/exit.sh \
tests/expand.sh \
tests/functions.sh \
@@ -55,19 +79,68 @@ DEMOFILES= \
tests/grep.sh \
tests/heredoc.sh \
tests/io.sh \
+ tests/locale.sh \
tests/nameref.sh \
tests/options.sh \
tests/path.sh \
+ tests/pointtype.sh \
tests/quoting.sh \
tests/quoting2.sh \
+ tests/recttype.sh \
+ tests/restricted.sh \
tests/return.sh \
tests/select.sh \
- tests/substring.sh \
+ tests/sigchld.sh \
+ tests/signal.sh \
+ tests/statics.sh \
+ tests/sun_solaris_builtin_sum.sh \
+ tests/sun_solaris_compoundvario.sh \
+ tests/sun_solaris_cr_6687139_command_substitution_exec_redirection_allocation_loop.sh \
+ tests/sun_solaris_cr_6713682_compound_var_bleeds_through_subshell.sh \
+ tests/sun_solaris_cr_6722134_background_CHLD_trap.sh \
+ tests/sun_solaris_cr_6753538_subshell_leaks_umask.sh \
+ tests/sun_solaris_cr_6754020_weird_square_bracket_expansion.sh \
+ tests/sun_solaris_cr_6763594_command_failure_execs_twice.sh \
+ tests/sun_solaris_cr_6766246_pattern_matching_bug.sh \
tests/sun_solaris_getconf.sh \
+ tests/sun_solaris_local_compound_nameref001.sh \
+ tests/sun_solaris_staticvariables.sh \
+ tests/sun_solaris_vartree001.sh \
+ tests/sun_solaris_vartree002.sh \
+ tests/sun_solaris_vartree003.sh \
+ tests/substring.sh \
+ tests/subshell.sh \
tests/tilde.sh \
- tests/variables.sh
+ tests/timetype.sh \
+ tests/types.sh \
+ tests/variables.sh \
+ tests/vartree1.sh \
+ tests/vartree2.sh
+
+# Rules for executables
+$(ROOTDEMODIRBASE)/tests/shtests := FILEMODE= 755
+$(ROOTDEMODIRBASE)/fun/% := FILEMODE= 755
+$(ROOTDEMODIRBASE)/bin/% := FILEMODE= 755
+
+# ToDO: We should replace the "cat $<" below with $ shcomp $< # once the
+# build machines start to ship /usr/bin/shcomp to compile the scripts
+# in bin/ and use $ shcomp -n $< /dev/null 2>&1 # to do minimum lint-style
+# checks before installation.
+$(ROOTDEMODIRBASE)/bin/%: common/scripts/%.sh
+ cat "$<" >"$(@F)"
+ $(INS) -s -m $(FILEMODE) -f $(@D) "$(@F)"
+ $(RM) "$(@F)"
+
+# Documentation rules
+$(ROOTDEMODIRBASE)/doc/%: common/%
+ $(INS.file)
+
+$(ROOTDEMODIRBASE)/doc/%: misc/%
+ $(INS.file)
ROOTDEMODIRS= $(ROOTDEMODIRBASE) .WAIT \
+ $(ROOTDEMODIRBASE)/bin \
+ $(ROOTDEMODIRBASE)/doc \
$(ROOTDEMODIRBASE)/fun \
$(ROOTDEMODIRBASE)/tests
diff --git a/usr/src/lib/libshell/amd64/Makefile b/usr/src/lib/libshell/amd64/Makefile
index 600ff73f12..9f293be4fa 100644
--- a/usr/src/lib/libshell/amd64/Makefile
+++ b/usr/src/lib/libshell/amd64/Makefile
@@ -18,12 +18,11 @@
#
# CDDL HEADER END
#
+
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
include ../Makefile.com
include ../../Makefile.lib.64
diff --git a/usr/src/lib/libshell/amd64/include/ast/history.h b/usr/src/lib/libshell/amd64/include/ast/history.h
index 55ead66f9e..bfac5d3b35 100644
--- a/usr/src/lib/libshell/amd64/include/ast/history.h
+++ b/usr/src/lib/libshell/amd64/include/ast/history.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -65,7 +65,7 @@ extern __MANGLE__ int _Hist;
#define hist_min(hp) ((_Hist=((int)((hp)->histind-(hp)->histsize)))>=0?_Hist:0)
#define hist_max(hp) ((int)((hp)->histind))
/* these are the history interface routines */
-extern __MANGLE__ int sh_histinit __PROTO__((void));
+extern __MANGLE__ int sh_histinit __PROTO__((__V_ *));
extern __MANGLE__ void hist_cancel __PROTO__((History_t*));
extern __MANGLE__ void hist_close __PROTO__((History_t*));
extern __MANGLE__ int hist_copy __PROTO__((char*, int, int, int));
diff --git a/usr/src/lib/libshell/amd64/include/ast/nval.h b/usr/src/lib/libshell/amd64/include/ast/nval.h
index 06b18217b7..c11fd66143 100644
--- a/usr/src/lib/libshell/amd64/include/ast/nval.h
+++ b/usr/src/lib/libshell/amd64/include/ast/nval.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -40,6 +40,7 @@
#include <ast.h>
#include <cdt.h>
+#include <option.h>
/* for compatibility with old hash library */
#define Hashtab_t Dt_t
@@ -53,8 +54,7 @@ typedef struct Namfun Namfun_t;
typedef struct Namdisc Namdisc_t;
typedef struct Nambfun Nambfun_t;
typedef struct Namarray Namarr_t;
-typedef struct Nambltin Nambltin_t;
-typedef struct Namtype Namtype_t;
+typedef struct Namdecl Namdecl_t;
/*
* This defines the template for nodes that have their own assignment
@@ -73,13 +73,14 @@ struct Namdisc
Namval_t *(*nextf) __PROTO__((Namval_t*, Dt_t*, Namfun_t*));
Namval_t *(*typef) __PROTO__((Namval_t*, Namfun_t*));
int (*readf) __PROTO__((Namval_t*, Sfio_t*, int, Namfun_t*));
+ int (*writef) __PROTO__((Namval_t*, Sfio_t*, int, Namfun_t*));
};
struct Namfun
{
const Namdisc_t *disc;
char nofree;
- char funs;
+ unsigned char subshell;
unsigned short dsize;
Namfun_t *next;
char *last;
@@ -101,22 +102,14 @@ struct Namarray
long nelem; /* number of elements */
__V_ *(*fun) __PROTO__((Namval_t*,const char*,int)); /* associative arrays */
Namval_t *parent; /* for multi-dimensional */
+ Dt_t *table; /* for subscripts */
+ __V_ *scope; /* non-zerp when scoped */
};
-/* Passed as third argument to a builtin when NV_BLTINOPT is set on node */
-struct Nambltin
+/* The context pointer for declaration command */
+struct Namdecl
{
- __V_ *shp;
- Namval_t *np;
- __V_ *ptr;
- __V_ *data;
- int flags;
-};
-
-struct Namtype
-{
- __V_ *shp;
- Namval_t *np;
+ Namval_t *tp; /* point to type */
const char *optstring;
__V_ *optinfof;
};
@@ -141,6 +134,7 @@ struct Namval
};
#define NV_CLASS ".sh.type"
+#define NV_DATA "_" /* special class or instance variable */
#define NV_MINSZ (sizeof(struct Namval)-sizeof(Dtlink_t)-sizeof(char*))
#define nv_namptr(p,n) ((Namval_t*)((char*)(p)+(n)*NV_MINSZ-sizeof(Dtlink_t)))
@@ -172,13 +166,14 @@ struct Namval
#define NV_SHORT (NV_RJUST) /* when integers are not long */
#define NV_LONG (NV_UTOL) /* for long long and long double */
#define NV_UNSIGN (NV_LTOU) /* for unsigned quantities */
-#define NV_DOUBLE (NV_ZFILL) /* for floating point */
+#define NV_DOUBLE (NV_INTEGER|NV_ZFILL) /* for floating point */
#define NV_EXPNOTE (NV_LJUST) /* for scientific notation */
+#define NV_HEXFLOAT (NV_LTOU) /* for C99 base16 float notation */
/* options for nv_open */
#define NV_APPEND 0x10000 /* append value */
-#define NV_MOVE 0x20000 /* for use with nv_clone */
+#define NV_MOVE 0x8000000 /* for use with nv_clone */
#define NV_ADD 8
/* add node if not found */
#define NV_ASSIGN NV_NOFREE /* assignment is possible */
@@ -194,19 +189,21 @@ struct Namval
#define NV_NODISC NV_IDENT /* ignore disciplines */
#define NV_FUNCT NV_IDENT /* option for nv_create */
-#define NV_BLTINOPT NV_ZFILL /* save state for optimization*/
+#define NV_BLTINOPT NV_ZFILL /* mark builtins in libcmd */
#define NV_PUBLIC (~(NV_NOSCOPE|NV_ASSIGN|NV_IDENT|NV_VARNAME|NV_NOADD))
/* numeric types */
+#define NV_INT16P (NV_LJUST|NV_SHORT|NV_INTEGER)
#define NV_INT16 (NV_SHORT|NV_INTEGER)
#define NV_UINT16 (NV_UNSIGN|NV_SHORT|NV_INTEGER)
+#define NV_UINT16P (NV_LJUSTNV_UNSIGN|NV_SHORT|NV_INTEGER)
#define NV_INT32 (NV_INTEGER)
#define NV_UNT32 (NV_UNSIGN|NV_INTEGER)
#define NV_INT64 (NV_LONG|NV_INTEGER)
#define NV_UINT64 (NV_UNSIGN|NV_LONG|NV_INTEGER)
-#define NV_FLOAT (NV_SHORT|NV_DOUBLE|NV_INTEGER)
-#define NV_LDOUBLE (NV_LONG|NV_DOUBLE|NV_INTEGER)
+#define NV_FLOAT (NV_SHORT|NV_DOUBLE)
+#define NV_LDOUBLE (NV_LONG|NV_DOUBLE)
/* name-value pair macros */
#define nv_isattr(np,f) ((np)->nvflag & (f))
@@ -222,6 +219,7 @@ struct Namval
#define NV_ADELETE 5 /* delete current subscript */
#define NV_AADD 6 /* add subscript if not found */
#define NV_ACURRENT 7 /* return current subscript Namval_t* */
+#define NV_ASETSUB 8 /* set current subscript */
/* The following are for nv_disc */
#define NV_FIRST 1
@@ -230,7 +228,7 @@ struct Namval
#define NV_CLONE 4
/* The following are operations for nv_putsub() */
-#define ARRAY_BITS 24
+#define ARRAY_BITS 22
#define ARRAY_ADD (1L<<ARRAY_BITS) /* add subscript if not found */
#define ARRAY_SCAN (2L<<ARRAY_BITS) /* For ${array[@]} */
#define ARRAY_UNDEF (4L<<ARRAY_BITS) /* For ${array} */
@@ -250,7 +248,9 @@ struct Namval
# endif /* _BLD_shell */
#endif /* _DLL */
/* prototype for array interface*/
+extern __MANGLE__ Namarr_t *nv_arrayptr __PROTO__((Namval_t*));
extern __MANGLE__ Namarr_t *nv_setarray __PROTO__((Namval_t*,__V_*(*)(Namval_t*,const char*,int)));
+extern __MANGLE__ int nv_arraynsub __PROTO__((Namarr_t*));
extern __MANGLE__ __V_ *nv_associative __PROTO__((Namval_t*,const char*,int));
extern __MANGLE__ int nv_aindex __PROTO__((Namval_t*));
extern __MANGLE__ int nv_nextsub __PROTO__((Namval_t*));
@@ -264,6 +264,7 @@ extern __MANGLE__ int nv_clone __PROTO__((Namval_t*, Namval_t*, int));
extern __MANGLE__ void nv_close __PROTO__((Namval_t*));
extern __MANGLE__ __V_ *nv_context __PROTO__((Namval_t*));
extern __MANGLE__ Namval_t *nv_create __PROTO__((const char*, Dt_t*, int,Namfun_t*));
+extern __MANGLE__ void nv_delete __PROTO__((Namval_t*, Dt_t*, int));
extern __MANGLE__ Dt_t *nv_dict __PROTO__((Namval_t*));
extern __MANGLE__ Sfdouble_t nv_getn __PROTO__((Namval_t*, Namfun_t*));
extern __MANGLE__ Sfdouble_t nv_getnum __PROTO__((Namval_t*));
@@ -271,13 +272,15 @@ extern __MANGLE__ char *nv_getv __PROTO__((Namval_t*, Namfun_t*));
extern __MANGLE__ char *nv_getval __PROTO__((Namval_t*));
extern __MANGLE__ Namfun_t *nv_hasdisc __PROTO__((Namval_t*, const Namdisc_t*));
extern __MANGLE__ int nv_isnull __PROTO__((Namval_t*));
+extern __MANGLE__ Namfun_t *nv_isvtree __PROTO__((Namval_t*));
extern __MANGLE__ Namval_t *nv_lastdict __PROTO__((void));
+extern __MANGLE__ Namval_t *nv_mkinttype __PROTO__((char*, size_t, int, const char*, Namdisc_t*));
extern __MANGLE__ void nv_newattr __PROTO__((Namval_t*,unsigned,int));
extern __MANGLE__ Namval_t *nv_open __PROTO__((const char*,Dt_t*,int));
extern __MANGLE__ void nv_putval __PROTO__((Namval_t*,const char*,int));
extern __MANGLE__ void nv_putv __PROTO__((Namval_t*,const char*,int,Namfun_t*));
+extern __MANGLE__ int nv_rename __PROTO__((Namval_t*,int));
extern __MANGLE__ int nv_scan __PROTO__((Dt_t*,void(*)(Namval_t*,__V_*),__V_*,int,int));
-extern __MANGLE__ Namval_t *nv_scoped __PROTO__((Namval_t*));
extern __MANGLE__ char *nv_setdisc __PROTO__((Namval_t*,const char*,Namval_t*,Namfun_t*));
extern __MANGLE__ void nv_setref __PROTO__((Namval_t*, Dt_t*,int));
extern __MANGLE__ int nv_settype __PROTO__((Namval_t*, Namval_t*, int));
@@ -285,11 +288,12 @@ extern __MANGLE__ void nv_setvec __PROTO__((Namval_t*,int,int,char*[]));
extern __MANGLE__ void nv_setvtree __PROTO__((Namval_t*));
extern __MANGLE__ int nv_setsize __PROTO__((Namval_t*,int));
extern __MANGLE__ Namfun_t *nv_disc __PROTO__((Namval_t*,Namfun_t*,int));
-extern __MANGLE__ void nv_unset __PROTO__((Namval_t*));
+extern __MANGLE__ void nv_unset __PROTO__((Namval_t*)); /*obsolete */
+extern __MANGLE__ void _nv_unset __PROTO__((Namval_t*,int));
extern __MANGLE__ Namval_t *nv_search __PROTO__((const char *, Dt_t*, int));
-extern __MANGLE__ void nv_unscope __PROTO__((void));
extern __MANGLE__ char *nv_name __PROTO__((Namval_t*));
extern __MANGLE__ Namval_t *nv_type __PROTO__((Namval_t*));
+extern __MANGLE__ void nv_addtype __PROTO__((Namval_t*,const char*, Optdisc_t*, size_t));
extern __MANGLE__ const Namdisc_t *nv_discfun __PROTO__((int));
#ifdef _DLL
@@ -297,6 +301,7 @@ extern __MANGLE__ const Namdisc_t *nv_discfun __PROTO__((int));
#define __MANGLE__ __LINKAGE__
#endif /* _DLL */
+#define nv_unset(np) _nv_unset(np,0)
#define nv_size(np) nv_setsize((np),-1)
#define nv_stack(np,nf) nv_disc(np,nf,0)
@@ -308,7 +313,7 @@ extern __MANGLE__ const Namdisc_t *nv_discfun __PROTO__((int));
# define nv_istype(np) nv_isattr(np)
# define nv_newtype(np) nv_newattr(np)
# define nv_namset(np,a,b) nv_open(np,a,b)
-# define nv_free(np) nv_unset(np)
+# define nv_free(np) nv_unset(np,0)
# define nv_settype(np,a,b,c) nv_setdisc(np,a,b,c)
# define nv_search(np,a,b) nv_open(np,a,((b)?0:NV_NOADD))
# define settype setdisc
diff --git a/usr/src/lib/libshell/amd64/include/ast/shell.h b/usr/src/lib/libshell/amd64/include/ast/shell.h
index 37cafa932b..adcefac221 100644
--- a/usr/src/lib/libshell/amd64/include/ast/shell.h
+++ b/usr/src/lib/libshell/amd64/include/ast/shell.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -36,7 +36,7 @@
*
*/
-#include <cmd.h>
+#include <ast.h>
#include <cdt.h>
#ifdef _SH_PRIVATE
# include "name.h"
@@ -44,7 +44,7 @@
# include <nval.h>
#endif /* _SH_PRIVATE */
-#define SH_VERSION 20060510
+#define SH_VERSION 20071012
#undef NOT_USED
#define NOT_USED(x) (&x,1)
@@ -56,8 +56,9 @@ typedef struct
}
Shopt_t;
-typedef void (*Shinit_f) __PROTO__((int));
-typedef int (*Shbltin_f) __PROTO__((int, char*[], __V_*));
+typedef struct Shell_s Shell_t;
+
+typedef void (*Shinit_f) __PROTO__((Shell_t*, int));
typedef int (*Shwait_f) __PROTO__((int, long, int));
union Shnode_u;
@@ -124,6 +125,7 @@ typedef struct sh_scope
char **argv;
char *cmdname;
char *filename;
+ char *funname;
int lineno;
Dt_t *var_tree;
struct sh_scope *self;
@@ -133,7 +135,7 @@ typedef struct sh_scope
* Saves the state of the shell
*/
-typedef struct sh_static
+struct Shell_s
{
Shopt_t options; /* set -o options */
Dt_t *var_tree; /* for shell variables */
@@ -145,10 +147,11 @@ typedef struct sh_static
int exitval; /* most recent exit value */
unsigned char trapnote; /* set when trap/signal is pending */
char subshell; /* set for virtual subshell */
+ char shcomp; /* set when runing shcomp */
#ifdef _SH_PRIVATE
_SH_PRIVATE
#endif /* _SH_PRIVATE */
-} Shell_t;
+};
/* flags for sh_parse */
#define SH_NL 1 /* Treat new-lines as ; */
@@ -158,9 +161,13 @@ typedef struct sh_static
#define SH_IOCOPROCESS (-2)
#define SH_IOHISTFILE (-3)
+#include <cmd.h>
+
/* symbolic value for sh_fdnotify */
#define SH_FDCLOSE (-1)
+#undef getenv /* -lshell provides its own */
+
#if defined(__EXPORT__) && defined(_DLL)
# ifdef _BLD_shell
#undef __MANGLE__
@@ -179,7 +186,8 @@ extern __MANGLE__ int sh_trap __PROTO__((const char*,int));
extern __MANGLE__ int sh_fun __PROTO__((Namval_t*,Namval_t*, char*[]));
extern __MANGLE__ int sh_funscope __PROTO__((int,char*[],int(*)(__V_*),__V_*,int));
extern __MANGLE__ Sfio_t *sh_iogetiop __PROTO__((int,int));
-extern __MANGLE__ int sh_main __PROTO__((int, char*[], void(*)(int)));
+extern __MANGLE__ int sh_main __PROTO__((int, char*[], Shinit_f));
+extern __MANGLE__ int sh_run __PROTO__((int, char*[]));
extern __MANGLE__ void sh_menu __PROTO__((Sfio_t*, int, char*[]));
extern __MANGLE__ Namval_t *sh_addbuiltin __PROTO__((const char*, int(*)(int, char*[],__V_*), __V_*));
extern __MANGLE__ char *sh_fmtq __PROTO__((const char*));
diff --git a/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/acct b/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/acct
index 76cc13fbf6..a1aab9f098 100644
--- a/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/acct
+++ b/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/acct
@@ -1,11 +1,12 @@
-/* : : generated by iffe version 2007-04-04 : : */
+/* : : generated by iffe version 2008-01-31 : : */
#ifndef _def_acct_ksh93
#define _def_acct_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _lib_acct 1 /* acct() in default lib(s) */
#define _sys_acct 1 /* #include <sys/acct.h> ok */
diff --git a/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/cmds b/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/cmds
index 57854c2559..a94a278e7d 100644
--- a/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/cmds
+++ b/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/cmds
@@ -1,11 +1,12 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/cmd/ksh93/features/cmds by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/cmd/ksh93/features/cmds by iffe version 2008-01-31 : : */
#ifndef _def_cmds_ksh93
#define _def_cmds_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _cmd_newgrp 1 /* newgrp in ?(/usr)/(bin|etc|ucb) */
#define _bin_newgrp 1 /* /bin/newgrp found */
diff --git a/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/dynamic b/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/dynamic
index f9ec2d669f..75cfcd4ac6 100644
--- a/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/dynamic
+++ b/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/dynamic
@@ -1,18 +1,17 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/cmd/ksh93/features/dynamic by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/cmd/ksh93/features/dynamic by iffe version 2008-01-31 : : */
#ifndef _def_dynamic_ksh93
#define _def_dynamic_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
-#define _hdr_dlfcn 1 /* #include <dlfcn.h> ok */
-#define _sys_dl 1 /* #include <sys/dl.h> ok */
-#define _hdr_dlldefs 1 /* #include <dlldefs.h> ok */
-#define _lib_dlopen 1 /* dlopen() in default lib(s) */
-#define _lib_dllfind 1 /* dllfind() in default lib(s) */
-#if !defined(SHOPT_FS_3D) && ( _lib_dllfind || _lib_dlopen || _lib_shl_load || _lib_loadbind )
+#if SHOPT_DYNAMIC
+#include <dlldefs.h>
+#endif
+#if !defined(SHOPT_FS_3D) && SHOPT_DYNAMIC
# define SHOPT_FS_3D 1
#endif /* !SHOPT_FS_3D */
#if SHOPT_FS_3D
diff --git a/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/execargs b/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/execargs
index 9db500ed8e..e84962fedf 100644
--- a/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/execargs
+++ b/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/execargs
@@ -1,10 +1,11 @@
-/* : : generated by iffe version 2007-04-04 : : */
+/* : : generated by iffe version 2008-01-31 : : */
#ifndef _def_execargs_ksh93
#define _def_execargs_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#endif
diff --git a/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/externs b/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/externs
index 748f14c9df..ef4d91917c 100644
--- a/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/externs
+++ b/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/externs
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/cmd/ksh93/features/externs by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/cmd/ksh93/features/externs by iffe version 2008-01-31 : : */
#ifndef _def_externs_ksh93
#if !defined(__PROTO__)
@@ -63,10 +63,11 @@
#define _def_externs_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _hdr_exec_attr 1 /* #include <exec_attr.h> ok */
#define _hdr_math 1 /* #include <math.h> ok */
@@ -78,4 +79,6 @@
#define _lib_fork 1 /* fork() in default lib(s) */
#define _lib_spawnveg 1 /* spawnveg() in default lib(s) */
#define _lib_fchdir 1 /* fchdir() in default lib(s) */
+#define _sys_mman 1 /* #include <sys/mman.h> ok */
+#define _lib_memcntl 1 /* memcntl() in default lib(s) */
#endif
diff --git a/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/locale b/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/locale
index d5a67a858f..6ec3192f18 100644
--- a/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/locale
+++ b/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/locale
@@ -1,11 +1,12 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/cmd/ksh93/features/locale by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/cmd/ksh93/features/locale by iffe version 2008-01-31 : : */
#ifndef _def_locale_ksh93
#define _def_locale_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _hdr_locale 1 /* #include <locale.h> ok */
#define _hdr_wchar 1 /* #include <wchar.h> ok */
diff --git a/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/math b/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/math
index 843a4147cf..a978df9136 100644
--- a/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/math
+++ b/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/math
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/cmd/ksh93/features/math.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/cmd/ksh93/features/math.sh by iffe version 2008-01-31 : : */
#ifndef _def_math_ksh93
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
@@ -62,14 +62,15 @@
#define _def_math_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
-/* : : generated by iffe from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/cmd/ksh93/data/math.tab : : */
+/* : : generated by iffe from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/cmd/ksh93/data/math.tab : : */
typedef Sfdouble_t (*Math_f) __PROTO__((Sfdouble_t,...));
@@ -104,6 +105,7 @@ const struct mathtab shtab_math[] =
"\002atan2", (Math_f)atan2l,
"\001atanh", (Math_f)atanhl,
"\001cbrt", (Math_f)cbrtl,
+ "\001ceil", (Math_f)ceill,
"\002copysign", (Math_f)copysignl,
"\001cos", (Math_f)cosl,
"\001cosh", (Math_f)coshl,
diff --git a/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/options b/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/options
index e9bd00d3d5..e8f9d39ebf 100644
--- a/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/options
+++ b/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/options
@@ -1,11 +1,12 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/cmd/ksh93/features/options by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/cmd/ksh93/features/options by iffe version 2008-01-31 : : */
#ifndef _def_options_ksh93
#define _def_options_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define SHELLMAGIC 1
#ifndef SHOPT_DEVFD
@@ -15,6 +16,9 @@
# define SHOPT_PFSH 1
#endif
#undef SHOPT_TEST_L
+#ifndef SHOPT_SYSRC
+# define SHOPT_SYSRC 1
+#endif
#undef SHOPT_UCB
#if !_PACKAGE_ast && ( (MB_LEN_MAX-1)<=0 || !defined(_lib_mbtowc) )
# undef SHOPT_MULTIBYTE
diff --git a/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/poll b/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/poll
index 76ab8e259f..b7142aab89 100644
--- a/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/poll
+++ b/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/poll
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/cmd/ksh93/features/poll by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/cmd/ksh93/features/poll by iffe version 2008-01-31 : : */
#ifndef _def_poll_ksh93
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
@@ -62,10 +62,11 @@
#define _def_poll_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _hdr_poll 1 /* #include <poll.h> ok */
#define _hdr_netinet_in 1 /* #include <netinet/in.h> ok */
diff --git a/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/pstat b/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/pstat
index 4d6fe66e36..763f166f96 100644
--- a/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/pstat
+++ b/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/pstat
@@ -1,10 +1,11 @@
-/* : : generated by iffe version 2007-04-04 : : */
+/* : : generated by iffe version 2008-01-31 : : */
#ifndef _def_pstat_ksh93
#define _def_pstat_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#endif
diff --git a/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/rlimits b/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/rlimits
index 813ee70722..1a813d00d6 100644
--- a/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/rlimits
+++ b/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/rlimits
@@ -1,11 +1,12 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/cmd/ksh93/features/rlimits by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/cmd/ksh93/features/rlimits by iffe version 2008-01-31 : : */
#ifndef _def_rlimits_ksh93
#define _def_rlimits_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _sys_resource 1 /* #include <sys/resource.h> ok */
#define _lib_getrlimit 1 /* getrlimit() in default lib(s) */
diff --git a/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/setjmp b/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/setjmp
index fa0e877cf8..3ba561b4bc 100644
--- a/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/setjmp
+++ b/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/setjmp
@@ -1,11 +1,12 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/cmd/ksh93/features/setjmp by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/cmd/ksh93/features/setjmp by iffe version 2008-01-31 : : */
#ifndef _def_setjmp_ksh93
#define _def_setjmp_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _lib_sigsetjmp 1 /* sigsetjmp() in default lib(s) */
#define _lib__setjmp 1 /* _setjmp() in default lib(s) */
diff --git a/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/sigfeatures b/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/sigfeatures
index d8ab88e7a5..9bad743681 100644
--- a/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/sigfeatures
+++ b/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/sigfeatures
@@ -1,11 +1,12 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/cmd/ksh93/features/sigfeatures by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/cmd/ksh93/features/sigfeatures by iffe version 2008-01-31 : : */
#ifndef _def_sigfeatures_ksh93
#define _def_sigfeatures_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _lib_sigrelse 1 /* sigrelse() in default lib(s) */
#define _lib_sigprocmask 1 /* sigprocmask() in default lib(s) */
@@ -22,8 +23,8 @@
#endif
#ifdef _lib_sigprocmask
# define sh_sigaction(s,action) do { sigset_t ss;\
- sigemptyset(&ss);\
- sigaddset(&ss,(s));\
+ sigemptyset(&ss); \
+ if(s) sigaddset(&ss,(s)); \
sigprocmask(action,&ss,0); \
}while(0)
# define sigrelease(s) sh_sigaction(s,SIG_UNBLOCK)
diff --git a/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/time b/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/time
index 17539409eb..e5bd1182f5 100644
--- a/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/time
+++ b/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/time
@@ -1,11 +1,12 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/cmd/ksh93/features/time by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/cmd/ksh93/features/time by iffe version 2008-01-31 : : */
#ifndef _def_time_ksh93
#define _def_time_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _hdr_utime 1 /* #include <utime.h> ok */
#define _lib_gettimeofday 1 /* gettimeofday() in default lib(s) */
diff --git a/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/ttys b/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/ttys
index 3f877e9f7b..e665fc6b9e 100644
--- a/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/ttys
+++ b/usr/src/lib/libshell/amd64/src/cmd/ksh93/FEATURE/ttys
@@ -1,11 +1,12 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/src/cmd/ksh93/features/ttys by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/cmd/ksh93/features/ttys by iffe version 2008-01-31 : : */
#ifndef _def_ttys_ksh93
#define _def_ttys_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_64bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _hdr_termios 1 /* #include <termios.h> ok */
#define _hdr_termio 1 /* #include <termio.h> ok */
diff --git a/usr/src/lib/libshell/common/COMPATIBILITY b/usr/src/lib/libshell/common/COMPATIBILITY
index 8f20d44374..d4d645a99a 100644
--- a/usr/src/lib/libshell/common/COMPATIBILITY
+++ b/usr/src/lib/libshell/common/COMPATIBILITY
@@ -125,5 +125,10 @@ omitted features that are completely upward compatible.
the stty lnext character is set to control-v or is unset.
The sequence escape control-v will display the shell version.
+29. In ksh88, DEBUG traps were executed. after each command. In ksh93
+ DEBUG traps are exeucted before each command.
+
+30. In ksh88, a redirection to a file name given by an empty string was
+ ignored. In ksh93, this is an error.
I am interested in expanding this list so please let me know if you
uncover any others.
diff --git a/usr/src/lib/libshell/common/DESIGN b/usr/src/lib/libshell/common/DESIGN
index 8e35e3fc55..c11c0aff1e 100644
--- a/usr/src/lib/libshell/common/DESIGN
+++ b/usr/src/lib/libshell/common/DESIGN
@@ -8,6 +8,11 @@ Directory layout:
The remainder are private.
The directory data contains readonly data files for ksh93.
+ The man pages for built-ins are in builtins.c rather
+ than included as statics with the implementations in the
+ bltins directory because some systems don't make static const
+ data readonly and we want these to be shared by all running
+ shells.
The directory edit contains the code for command line
editing and history.
@@ -59,7 +64,7 @@ Include directory:
4. edit.h contains definitions that are common to both
vi and emacs edit modes.
5. env.h contains interfaces for creating and modifying
- environment variables.
+ environment variables.
6. fault.h contains prototypes for signal related
functions and trap and fault handling.
7. fcin.h contains macro and function definitions for
@@ -134,30 +139,32 @@ sh directory:
18. nvdisc.c contains code related to name-value pair disciplines.
19. nvtree.c contains code for compound variables and for
walking the namespace.
- 20. parse.c contains the code for the shell parser.
- 21. path.c contains the code for pathname lookup and
+ 20. nvtype.c contains most of the code related to types that
+ are created with typeset -T.
+ 21. parse.c contains the code for the shell parser.
+ 22. path.c contains the code for pathname lookup and
some path functions. It also contains the code
that executes commands and scripts.
- 22. pmain.c is just a calls sh_main() so that all of the
+ 23. pmain.c is just a calls sh_main() so that all of the
rest of the shell can be in a shared library.
- 23. shcomp.c contains the main program to the shell
+ 24. shcomp.c contains the main program to the shell
compiler. This program parses a script and creates
a file that the shell can read containing the parse tree.
- 24. streval.c is an C arithmetic evaluator.
- 25. string.c contains some string related functions.
- 26. subshell.c contains the code to save and restore
+ 25. streval.c is an C arithmetic evaluator.
+ 26. string.c contains some string related functions.
+ 27. subshell.c contains the code to save and restore
environments so that subshells can run without creating
a new process.
- 27. suid_exec.c contains the program from running execute
+ 28. suid_exec.c contains the program from running execute
only and/or setuid/setgid scripts.
- 28. tdump.c contains the code to dump a parse tree into
+ 29. tdump.c contains the code to dump a parse tree into
a file.
- 29. timers.c contains code for multiple event timeouts.
- 30. trestore contians the code for restoring the parse
+ 30. timers.c contains code for multiple event timeouts.
+ 31. trestore contians the code for restoring the parse
tree from the file created by tdump.
- 31. userinit.c contains a dummy userinit() function.
+ 32. userinit.c contains a dummy userinit() function.
This is now obsolete with the new version of sh_main().
- 32. waitevent.c contains the sh_waitnotify function so
+ 33. waitevent.c contains the sh_waitnotify function so
that builtins can handle processing events when the
shell is waiting for input or for process completion.
- 33. xec.c is the main shell executuion loop.
+ 34. xec.c is the main shell executuion loop.
diff --git a/usr/src/lib/libshell/common/PROMO.mm b/usr/src/lib/libshell/common/PROMO.mm
index 332ff3a855..def4552243 100644
--- a/usr/src/lib/libshell/common/PROMO.mm
+++ b/usr/src/lib/libshell/common/PROMO.mm
@@ -110,7 +110,7 @@ it to intercept assignments and references.
.LI
Improved debugging: KSH-93 can generate line numbers on execution
traces. Also, I/O redirections are now traced.
-There is a DEBUG trap that gets evaluated after each command
+There is a DEBUG trap that gets evaluated before each command
so that errors can be localized.
.LI
Job Control: On systems that support job control, including
diff --git a/usr/src/lib/libshell/common/README b/usr/src/lib/libshell/common/README
index 3c3899fda2..1feeec8a90 100644
--- a/usr/src/lib/libshell/common/README
+++ b/usr/src/lib/libshell/common/README
@@ -27,7 +27,9 @@ and changing their value will cause all modules that could be affected
by this change to be recompiled.
The options have the following defaults and meanings:
ACCT off Shell accounting.
- ACCTFILE off Enable per user accounting info
+ ACCTFILE off Enable per user accounting info.
+ AUDIT off For auditing specific users
+ AUDITFILE "/etc/ksh_audit"
APPEND on Allows var+=val string and array append.
BASH off Bash compatibility mode. It is not fully implemented
and is experimental.
@@ -69,10 +71,12 @@ The options have the following defaults and meanings:
SEVENBIT off Strip the eigth bit from characters.
SPAWN off Use spawn as combined fork/exec. May improve speed on
some systems.
+ STATS on Add .sh.stats compound variable.
SUID_EXEC on Execute /etc/suid_exec for setuid, setgid script.
TIMEOUT off Set this to the number of seconds for timing out and
exiting the shell when you don't enter a command. If
non-zero, TMOUT can not be set larger than this value.
+ TYPEDEF on Enable typeset type definitions.
VSH on Compile with vi command line editing. The original vi
line editor code was provided by Pat Sullivan at CB.
@@ -125,7 +129,8 @@ equal.
The tests sub-directory contains a number of regression tests for ksh.
To run all these tests with the shell you just built, go to the tests
directory and run the command
- SHELL=../ksh shtests
+ SHELL=$dir/ksh $dir/ksh shtests
+where dir is the directory of the ksh you want to test.
The file PROMO.mm is an advertisement that extolls the virtues of ksh.
The file sh.1 contains the troff (man) description of this Shell.
diff --git a/usr/src/lib/libshell/common/RELEASE b/usr/src/lib/libshell/common/RELEASE
index 034ca7033d..f368dd1531 100644
--- a/usr/src/lib/libshell/common/RELEASE
+++ b/usr/src/lib/libshell/common/RELEASE
@@ -1,4 +1,439 @@
-07-04-18 --- Release ksh93s+ ---
+08-10-31 --- Release ksh93t ---
+08-10-31 Variable scoping/initialization bugs that could dump core were fixed.
+08-10-24 The lexer now accepts all RE characters for patterns prefixed
+ with a ksh ~(...) option expression.
+08-10-24 For ${var/pat/sub} \0 in sub expands to the text matched by pat.
+08-10-18 A bug in array scoping that could dump core has been fixed.
+08-10-10 read -n and -N fixed to count characters in multibyte locales.
+08-10-10 A bug that mishandled _.array[] type references has been fixed.
+08-10-09 ${.sh.version} now contains a catenation of the following (after
+ 'Version') denoting compile time features:
+ A SHOPT_AUDIT
+ B SHOPT_BASH
+ L SHOPT_ACCT
+ M SHOPT_MULTIBYTE
+08-10-09 A bug that caused subshell command substitution with redirection
+ to hang has been fixed.
+08-10-08 Output errors, other than to stderr, now result in a diagnostic.
+08-10-08 ksh93 now supports types that contain arrays of other types as
+ members. Earlier versions core dumped in this case.
+08-10-05 A bug which caused the shell to emit a syntax error for an arithmetic
+ statement of the form (( var.name[sub] = value)) has been fixed.
+08-10-01 A bug that caused subshell command substitution to hang has
+ been fixed.
+08-09-29 When the -p export option of typeset is used with other options,
+ only those variables matching the specified options are displayed.
+08-09-29 When the shell reads the environment and finds variables that are
+ not valid shell assignments, it now passes these on to subsequent
+ commands rather than deleting them.
+08-09-29 A bug in the display of compound variables containing an indexed
+ array of compound variables has been fixed.
+08-09-29 A bug in the display of compound variables containing an associative
+ array with a subscript containing a . in the name has been fixed.
+08-09-26 A core dump in the subshell environment restore has been fixed.
+08-09-24 $(...) has been fixed to properly set the exit status in $?.
+08-09-23 $(<...) with IFS=$'\n\n' has been fixed to retain all but the last
+ of multiple trailing newlines.
+08-09-23 The -p option to typeset when used with other attributes, restricts
+ the output to variables with the specified attributes.
+08-09-22 A bug that sometimes lost the exit status of a job has been fixed.
+08-09-21 A bug that retained trailing command substitution newlines in
+ cases where the command caused the shell to fork has been fixed.
+08-09-19 type, whence -v, and command -v were fixed to comply with POSIX
+ by writing 'not found' diagnostics to the standard error.
+08-09-18 test and [...] were fixed to comply with POSIX in the case
+ of test '(' binop ')' where binop is a valid binary test operator.
+08-09-16 If a method discipline named create is specified when defining a
+ type, this function will be called when an instance is created.
+08-09-15 The variable _ is now set as a reference to the compound variable
+ when defining a compound variable or a type.
+08-09-10 The shell now prints an error message when the type name specified
+ for an indexed array subscript is not an enumeration type.
+08-09-10 A bug in which a subshell that spawned a background process could
+ loose output that was produced after the foreground completed
+ has been fixed.
+08-09-10 A timing bug on some systems that could cause coprocesses started by a
+ subshell to not clean up and prevent other coprocesses has been fixed.
+08-09-09 The typeset -m option is now able to rename array elements from
+ the same array.
+08-09-09 The exit status of 2 from the DEBUG trap causes the next command
+ to be skipped. An exit value of 255 from a DEBUG trap called from
+ a function causes the function to return.
+08-09-08 A bug in which a coprocess created in a subshell that did not
+ complete when the subshell terminated could prevent a coprocess
+ from being created in the parent shell has been fixed.
+08-09-05 An assignment of the form name1=name2 where name1 and name2
+ are both compound variables causes name1 to get a copy of name2.
+ name1+=name2 causes name2 sub-variables to be appended to name1.
+08-09-05 A bug in which unsetting a compound variable did not unset all
+ the sub-variables has been fixed.
+08-09-01 A bug in the subshell cleanup code that could cause SIGSEGV has
+ been fixed.
+06-08-26 The SHLVL variable which is an environment variable used by bash
+ and zsh that gets incremented when the shell starts.
+08-08-25 For an indexed array, a negative subscript now refers to offsets
+ from the end so that -1 refers to the last element.
+08-08-24 An alignment error for shorts on 64 bit architectures has been fixed.
+08-08-22 If oldvar is a compound variable, typeset -C newvar=oldvar creates
+ newvar as a copy of oldvar.
+08-08-19 The ALRM signal no longer cause the sleep builtin to terminate.
+08-08-13 When used in an arithmetic expression, the .sh.version variable
+ now produces a number that will be increasing for each release.
+08-08-11 A bug in which type instantiation with a compound assignment in
+ a dot script in which the type is defined has been fixed.
+08-08-07 The -m option has been added to typeset to move or rename a
+ variable. Not documented yet.
+08-08-06 A bug in read when used in a loop when a prompt was specified
+ when reading from a terminal has been fixed.
+08-08-01 A bug with the pipefail option in which a nested pipeline could
+ cause an asynchronous command to block has been fixed.
+08-08-01 A for loop optimizer bug that treats .sh.lineno as an invariant
+ has been fixed.
+08-07-30 A bug in which expanding compound variable that had a get discipline
+ from with a here document could cause a syntax error has been fixed.
+08-07-18 A bug in which a nameref caused a local variable to be created
+ rather than binding to an existing variable in the global scope
+ has been fixed.
+08-07-17 A bug which occurred when a nameref was created from within a
+ function that was part of a pipeline has been fixed.
+08-07-14 The compile option SHOPT_STATS was added. With this option the
+ compound variable .sh.stats keeps usage statistics that could help
+ with performance tuning.
+08-07-10 The output of set now always uses a single line for each variable.
+ For array variables, the complete set of values is now displayed.
+08-07-09 The typeset -C option can be used with arrays to indicate that
+ each element should default to a compound variable.
+08-07-08 The %B format now outputs compound variables and arrays. The
+ alternate flag # can be used to cause output into a single line.
+08-07-03 When the window change signal, WINCH, is received, the current
+ edit line is redrawn in place.
+08-07-01 A bug in the handling of shared variables when inside an embedded
+ type has been fixed.
+08-06-29 A bug in multiline edit mode which occurred when the prompt length
+ was three characters or less has been fixed.
+08-06-23 A bug in which the SIGCLD was not be triggered when background
+ jobs completed has been fixed.
+08-06-23 KSH_VERSION added as a name reference to .sh.version.
+08-06-20 type now outputs 'special builtin' for special builtins.
+08-06-19 A couple of bugs in multi-dimensional arrays have been fxied.
+08-06-19 A bug in which a syntax error in a dot script could generated
+ a syntax error in the next subsequent command has been fixed.
+08-06-17 Reduced the maximum function call depth to 2048 to avoid exceptions
+ on some architectures.
+08-06-16 A bug in which printf "%B" could generate an exception when the
+ specified variable was not set has been fixed.
+08-06-16 When typeset -p is followed by variable names, it now displays
+ the attributes names and values for the specific names.
+08-06-14 A bug that could effect the drawing of the screen from multiline
+ emacs or gmacs mode when walking up the history file has been fixed.
+08-06-13 A bug in which a compound variable defined in a subshell could
+ have side effects into the parent shell has been fixed.
+08-06-13 A number of bugs related to using .sh.level to set the stack from
+ for DEBUG traps have been fixed.
+08-06-13 The .sh.lineno variable has been added. When .sh.level is changed
+ inside a DEBUG trap, the .sh.lineno contains the calling line number
+ for the specified stack frame.
+08-06-13 The .sh.level variable has been documented and now works.
+08-06-11 The -C option has been added to read for reading compound command
+ definitions from a file.
+08-06-11 The . command is now permitted inside a compound command definition.
+ The dot script can contain declaration commands and dot commands.
+08-06-09 Add -C option to typeset so that typeset -C foo, is equivalent
+ to foo=().
+08-06-09 Added -n warning message for typeset option orderings that are valid
+ with ksh88 but not valid with ksh93, for example Lx5.
+08-06-09 A bug in which the return value for an assignment command containing
+ a command substitution with that failed was zero when the assignment
+ contained redirections has been fixed.
+08-06-09 A bug in the quoting of $ inside a ERE pattern ~(E)(pattern)
+ has been fixed.
+08-06-06 A bug when processing `` command substitution with the character
+ sequence \$' has been fixed.
+08-06-02 When defining a type, the typeset -r attribute causes this field
+ to be required to be specified for each instance of the type and
+ does not allow a default value.
+08-06-02 Several bugs in which compound variables were modified by
+ subshells have been fixed.
+08-05-22 The ceil function has been added to the math functions.
+08-05-21 A bug in which a name reference defined in a function and passed
+ as an argument to another function could cause an incorrect binding.
+08-05-21 A bug in freeing compound variables that are local to functions
+ has been fixed.
+08-05-19 The array expansions ${array[sub1..sub2]} and ${!array[sub1..sub2]}
+ to expand to the value (or subscripts) for array between sub1 and
+ sub2 inclusive. For associative arrays, the range is based on
+ location in the POSIX locale. The .. must be explicit and cannot
+ result from an expansion.
+08-05-15 The trap on SIGCLD is no longer triggered by the completion of
+ the foreground job as with ksh88.
+08-05-14 A bug in the implementation of the editing feature added on
+ 07-09-19 in emacs mode has been fixed.
+08-05-12 A bug in processing the test built-in with parenthesis has been
+ fixed.
+08-05-12 The unset built-in now returns non-zero when deleting an array
+ subscript that is not set.
+08-05-08 Changing the value of HISTFILE or HISTSIZE will cause the old
+ history file to be close and reopened with the new name or size.
+08-05-08 When FPATH is changed functions that were found via a path search
+ will be searched for again.
+08-05-08 A parser bug in which reserved words and labels were recognized
+ inside compound indexed array assignment after a new-line has
+ been fixed.
+08-05-07 A bug in getopts when handling numerical option arguments has
+ been fixed.
+08-05-07 The typeset -S option was added for variables outside type
+ definitions to provide a storage class similar to C static
+ inside a function defined with function name. When outside
+ type definitions and outside a function, the -S option cause
+ the specified variable so be unset before the assignment and
+ before the remaining attributes are supplied.
+08-05-07 A bug that affected the cursor movement in multiline mode when
+ a character was deleted from near the beginning of the any
+ line other than the first.
+08-05-01 In multiline edit mode, the refresh operation will now clear
+ the remaining portion of the last line.
+08-05-01 A bug in computing prompt widths for the edit modes for prompts
+ with multibyte characters has been fixed.
+08-05-01 A bug in the multiline edit mode which could cause the current
+ line to be displayed incorrectly when moving backwards from third
+ or higher line to the previous line has been fixed.
+08-05-01 A bug in which options set in functions declared with the function
+ name syntax were carried across into functions invoked by these
+ functions has been fixed.
+08-04-30 A bug which could cause a coprocess to hang when the read end
+ is a builtin command has been fixed.
+08-04-30 The emacs and vi editors have been modified to handle window
+ change commands as soon as they happen rather than waiting for
+ the next command.
+08-04-28 A bug in which ${!x} did not expand to x when x was unset has been
+ fixed.
+08-04-27 A bug in which the assignment x=(typeset -a foo=([0]=abc)) created
+ x.foo as an associative array has been fixed.
+08-04-25 A bug in which $# did not report correctly when there were more
+ than 32K positional parameters has been fixed.
+08-04-04 Choose the name _ as the sub-variable that holds type or instance
+ specific data used by discipline functions.
+08-03-27 A bug in which the terminal group was not given back to the parent
+ shell when the last part of a pipeline was handled by the parent shell
+ and the other parts of the pipeline complete has been fixed.
+ The symptom was that the pipeline became uninterruptable.
+08-03-25 A bug in restricted mode introduced in ksh93s that caused scripts
+ that did not use #! to executed in restricted mode has been fixed.
+08-03-25 A bug in which the pipefail option did not work for a pipeline
+ within a pipeline has been fixed.
+08-03-24 A bug in which OPTIND was not set correctly in subshells has
+ been fixed.
+08-03-24 A bug which could cause a memory exception when a compound variable
+ containing an indexed array with only element 0 defined was expanded.
+08-03-20 A bug in which ${!var[sub].*} was treated as an error has been fixed.
+08-03-20 Associative array assignments of the form ([name]=value ...)
+ now allow ; as well as space tab and new line to separate elements.
+08-03-18 A buffering problem in which standard error was sometimes
+ not flushed before sleep has been fixed.
+08-03-17 A bug in which a signal sent to $$ while in a subshell would be
+ sent to the subshell rather than the parent has been fixed.
+08-03-17 --default option added to set(1) to handle set +o POSIX semantics.
+ set --state added as a long name alias for set +o.
+08-03-14 A bug in which using monitor mode from within a script could
+ cause the terminal group to change has been fixed.
+08-03-10 The new ${...} command substitution will treat the trailing }
+ as a reserved word even if it is not at the beginning of a command,
+ for example, ${ date }.
+08-03-10 If the name of the ENV begins with /./ or ././ then the
+ /etc/ksh.kshrc file will not be executed on systems that support
+ this interactive initialization file.
+08-03-07 A bug in which ksh -i did not run the ENV file has been fixed.
+08-03-07 A bug in which ulimit did not always produce the same output as
+ ulimit -fS has been fixed.
+08-03-04 A bug in multiline mode in emacs and vi mode which could cause the
+ cursor to be on the wrong line when interrupt was hit has been fixed.
+08-03-03 The change made in ksh93s+ on 07-06-18 in which braces became
+ optional for ${a[i]} inside [[...]] was restored in the case
+ where the argument can be a pattern.
+08-03-03 A bug in which creating a name reference to an associative array
+ instance would fail when the subscript contained characters [ or
+ ] has been fixed.
+08-02-29 The redirection operator >; has been added which for non-special
+ files, generates the output in a temporary file and writes the
+ specified file only of the command has completed successfully.
+08-02-15 A bug in ${var/pattern/string} for patterns of the form ?(*) and +(*)
+ has bee fixed.
+08-02-07 A bug in which test \( ! -e \) produced an error has been fixed.
+08-02-14 The typeset -a option can now optionally be followed by the name
+ of an enumeration type which allows subscripts to be enumerations.
+08-02-14 The enum builtin which creates enumeration types has been added.
+08-02-12 The backoff logic when there are no more processes has been fixed.
+08-02-07 The -X option has been added to typeset. The -X option creates
+ a double precision number that gets displayed using the C99 %a
+ format. It can be used along with -l for long double.
+08-01-31 The -T option to typeset has been added for creating typed
+ variables. Also the -h and -S options have been added to
+ typeset that are only applicable when defining a type.
+08-01-31 The prefix expansion operator @ has been added. ${@name}
+ expands to the type of name or yields the attributes.
+07-11-15 A bug in the macro expander for multibyte characters in which
+ part of the character contains a file pattern byte has been fixed.
+07-10-03 A bug in which : was not allowed as part of an alias name has been
+ fixed.
+07-09-26 A bug in which appending a compound variable to a compound variable
+ or to an index array didn't work has been fixed.
+07-09-19 In both emacs and vi edit mode, the escape sequence \E[A (usually
+ cursor up, when the cursor is at the end of the line will fetch
+ the most recent line starting with the current line.
+07-09-18 The value of ${!var} was correct when var was a reference to an
+ array instance.
+07-09-18 The value of ${!var[sub]} was not expanding to var[sub] and this
+ was fixed. It also fixed ${name} where name is a name reference
+ to var[sub].
+07-09-18 It is now legal to create a name reference without an initialization.
+ It will be bound to a variable on the first assignment.
+07-08-30 A discipline function can be invoked as ${x.foo} and is equivalent
+ to ${ x.foo;} and can be invoked as x.foo inside ((...)).
+07-07-09 A bug in which typeset -a did not list indexed arrays has been
+ fixed.
+07-07-03 The command substitution ${ command;} has been added. It behaves
+ like $(command) except that command is executed in the current
+ shell environment. The ${ must be followed by a blank or an
+ operator.
+
+08-04-17 --- Release ksh93s+ ---
+08-04-17 A bug in which umask was not being restored correctly after a
+ subshell has been fixed.
+08-04-15 A bug in which sending a STOP signal to a job control shell started
+ from within a shell function caused cause the invoking shell to
+ terminate has been fixed.
+08-04-11 A bug which caused $(exec > /dev/null) to go into an infinite loop
+ has been fixed.
+08-03-27 A bug in which typeset -LZ was being treated as -RZ has been fixed.
+08-03-06 A bug with ksh -P on systems that support the the profile shell,
+ in which it would exit after running a non-builtin has been fixed.
+08-01-31 A bug in which command substitution inside ((...)) could cause
+ syntax errors or lead to core dumps has been fixed.
+08-01-17 A bug in which discipline functions could be deleted when invoked
+ from a subshell has been fixed.
+08-01-17 A bug in which a command substitution consisting only of
+ assignments was treated as a noop has been fixed.
+08-01-17 A bug in which discipline functions invoked from withing a
+ compound assignment could fail has been fixed.
+08-01-16 Incomplete arithmetic assignments, for example ((x += )), now
+ generate an error message.
+08-01-16 A bug in which a set discipline defined for a variable before
+ an array assignment could cause a core dump has been fixed.
+08-01-03 A bug in on some systems in which exit status 0 is incorrectly
+ returned by a process that catches the SIGCONT signal is stopped
+ and then continued.
+07-12-13 A race condition in which a program that has been stopped and then
+ continued could loose the exit status has been fixed.
+07-12-12 Code to check for file system out of space write errors for all
+ writes has been added.
+07-12-11 A bug in the macro expander for multibyte characters in which
+ part of the character contains a file pattern byte has been fixed.
+07-12-06 A bug in the emacs edit mode when multiline was set that output
+ a backspace before the newline to the screen has been fixed.
+07-12-04 A bug in which using <n>TAB after a variable name listing expansion
+ in the edit modes would cause the $ to disappear has been fixed.
+07-11-28 A bug in which setting IFS to readonly could cause a subsequent
+ command substitution to fail has been fixed.
+07-11-27 A work around for a gcc 4.* C99 "feature" that could cause a job
+ control shell to go into an infinite loop by adding the volatile
+ attribute to some auto vars in functions that call setjmp().
+07-11-27 A bug in which the shell could read ahead on a pipe causing the
+ standard input to be incorrectly positioned has been fixed.
+07-11-27 A bug in which compound variable UTF-8 multibyte values were not
+ expanded or traced properly has been fixed.
+07-11-21 A bug where an unbalanced '[' in a command argument was not treated
+ properly has been fixed.
+07-11-15 A bug in which compatibility mode (no long option names) getopts(1)
+ incorrectly set the value of OPTARG for flag options has been fixed.
+07-11-15 A bug in which "hash -- name" treated "--" as an invalid name operand
+ has been fixed.
+07-11-15 typeset now handles "-t -- [-r] [--]" for s5r4 hash(1) compatibility.
+07-11-15 A bug in which the umask builtin mis-handled symbolic mode operands
+ has been fixed.
+07-11-15 Bugs in which shell arithmetic and the printf builtin mis-handled the
+ signs of { -NaN -Inf -0.0 } have been fixed.
+07-11-15 The full { SIGRTMIN SIGRTMIN+1 ... SIGRTMAX-1 SIGRTMAX } range
+ of signals, determined at runtime, are now supported.
+07-11-15 A bug in which creating an index array with only subscript 0 created
+ only a simple variable has been fixed.
+07-11-14 A bug in which appending to an indexed array using the form
+ name+=([sub]=value) could cause the array to become an associative
+ array has been fixed.
+07-11-14 A bug in which typeset without arguments could coredump if a
+ variable is declared as in indexed array and has no elements has
+ been fixed.
+07-11-14 A bug in which creating a local SECONDS variable with typeset in
+ a function could corrupt memory has been fixed.
+07-11-14 A bug which could cause a core dump when a script invoked by name
+ from a function used compound variables has been fixed.
+07-11-05 A bug in which printf %d "'AB" did not diagnose unconverted characters
+ has been fixed.
+07-11-05 printf %g "'A" support added for all floating point formats.
+07-11-01 A bug in which typeset -f fun did not display the function definition
+ when invoked in a subshell has been fixed.
+07-10-29 The sleep builtin was fixed so that all floating point constants
+ are valid operands.
+07-10-10 A bug in which the locale was not being restored after
+ LANG=value command has been fixed.
+07-09-20 A bug in which a nameref to a compound variable that was local
+ to the calling function would not expand correctly when displaying
+ is value has been fixed.
+07-09-19 A bug which cause cause a core dump if .sh.edchar returned
+ 80 characters or more from a keyboard trap has been fixed.
+07-09-14 A bug in which could cause a core dump when more than 8 file
+ descriptors were in use has been fixed.
+07-09-10 A bug in which creating a name reference to an instance of
+ an array when the array name is itself a reference has been fixed.
+07-09-10 The file completion code has been modified so that after an = in
+ any word, each : will be considered a path delimiter.
+07-09-06 A bug in which subprocess cleanup could corrupt the malloc() heap
+ has been fixed.
+07-08-26 A bug in which a name reference to an associative array instance
+ could cause the subscript to be evaluated as an arithmetic expression
+ has been fixed.
+07-08-22 A bug in which the value of an array instance was of a compound
+ variable was not expanded correctly has been fixed.
+07-08-14 A bug which could cause a core dump when a compound assignment was
+ made to a compound variable element with a typeset -a attribute
+ has been fixed.
+07-08-08 A bug in which a trap ignored in a subshell caused it to be
+ ignored by the parent has been fixed.
+07-08-07 A bug in which the set command would generated erroneous output
+ for a variable with the -RZ attribute if the variable name had been
+ passed to a function has been fixed.
+07-08-02 A bug in which read x[1] could core dump has been fixed.
+07-08-02 A second bug in which after read x[sub] into an associative array
+ of an element that hasn't been assigned could lead to a core dump
+ has been fixed.
+07-07-31 A bug in which a pipeline that completed correctly could have
+ an exit status of 127 when pipefail was enabled has been fixed.
+07-07-09 The SHOPT_AUDIT compile option has been added for keyboard logging.
+07-06-25 In vi insert mode, ksh no longer emits a backspace character
+ before the carriage return when the newline is entered.
+07-06-25 A bug in which pipefail would cause a command to return 0
+ when the pipeline was the last command and the failure happened
+ on a component other than the last has been fixed.
+07-06-25 A bug in the expansion of ${var/pattern/rep} when pattern or rep
+ contained a left parenthesis in single quotes has been fixed.
+07-06-18 The braces for a subscripted variable with ${var[sub]} are now
+ optional when inside [[...]], ((...)) or as a subscript.
+07-05-28 A bug in brace expansion in which single and double quotes did
+ not treat the comma as a literal character has been fixed.
+07-05-24 The -p option of whence now disables -v.
+07-05-23 Several bug fixes in compound variables and arrays of arrays
+ have been made.
+07-05-15 A bug in which the %B format of printf was affected by the
+ locale has been fixed.
+07-05-14 A bug in which \ was not removed in the replacement pattern with
+ ${var/pattern/rep} when it was not followed by \ or a digit has
+ been fixed.
+07-05-10 A bug in which ksh -R file core dumped if no script was specified
+ has been fixed. it not displays an error message.
+07-05-07 Added additional Solaris signals to signal table.
+07-04-30 A bug in which a pipeline with command substitution inside a
+ function could cause a pipeline that invokes this function to
+ hang when the pipefail option is on has been fixed.
+07-04-30 Added -q to whence.
07-04-18 A small memory leak with each redirection of a non-builtin has
been fixed.
07-03-08 A bug in which set +o output command line options has been fixed.
@@ -619,7 +1054,7 @@
02-06-17 --- Release ksh93n- ---
02-06-17 A bug in which user defined macros could cause a core dump in
- with MULTIBYE mode has been fixed.
+ with MULTIBYTE mode has been fixed.
02-06-17 A bug in which printf format specifiers of the form %2$s were causing
a core dump has been fixed.
02-06-17 A bug in which setting stty to noecho mode did not prevent the
@@ -1326,7 +1761,7 @@
positioned for the last command of a script has been fixed.
95-04-31 A bug in the edit modes which allowed walking back in
the history file for more than HISTSIZE commands has
- beed fixed.
+ been fixed.
95-04-31 A bug which could cause a core dump if variable TMPDIR was
changed between two command substitutions has been fixed.
95-04-31. A bug which prevented a trap on EXIT from being cleared
diff --git a/usr/src/lib/libshell/common/TYPES b/usr/src/lib/libshell/common/TYPES
new file mode 100644
index 0000000000..6eb6f41b5e
--- /dev/null
+++ b/usr/src/lib/libshell/common/TYPES
@@ -0,0 +1,182 @@
+
+The ability for users to define types has been added to ksh93t.
+Here is a quick summary of how types are defined and used in ksh93t.
+This is still a work in progress so some changes and additions
+are likely.
+
+A type can be defined either by a shared library or by using the new
+typeset -T option to the shell. The method for defining types via
+a shared library is not described here. However, the source file
+bltins/enum.c is an example of a builtin that creates enumeration types.
+
+By convention, typenames begin with a capitol letter and end in _t.
+To define a type, use
+ typeset -T Type_t=(
+ definition
+ )
+where definition contains assignment commands, declaration commands,
+and function definitions. A declaration command (for example typeset,
+readonly, and export), is a built-in that differs from other builtins in
+that tilde substitution is performed on arguments after an =, assignments
+do not have to precede the command name, and field splitting and pathname
+expansion is not performed on the arguments.
+For example,
+ typeset -T Pt_t=(
+ float -h 'length in inches' x=1
+ float -h 'width in inches' y=0
+ integer -S count=0
+ len()
+ {
+ print -r $((sqrt(_.x*_.x + _.y*_.y)))
+ }
+ set()
+ {
+ (( _.count++))
+ }
+ )
+
+defines a type Pt_t that has three variables x, y, and count defined as well
+as the discipline functions len and set. The variable x has an initial value
+of 1 and the variable y has an initial value of 0. The new -h option argument,
+is used for documentations purposes as described later and is ignored outside
+of a type definition.
+
+
+The variable count has the new -S attribute which means that it is shared
+between all instances of the type. The -S option to typeset is ignored
+outside of a type definition. Note the variable named _ that is used inside
+the function definition for len and set. It will be a reference to the
+instance of Pt_t that invoked the function. The functions len and set
+could also have been defined with function len and function set, but
+since there are no local variables, the len() and set() form are more
+efficient since they don't need to set up a context for local variables
+and for saving and restoring traps.
+
+If the discipline function named create is defined it will be
+invoked when creating each instance for that type. A function named
+create cannot be defined by any instance.
+
+When a type is defined, a declaration built-in command by this name
+is added to ksh. As with other shell builtins, you can get the man page
+for this newly added command by invoking Pt_t --man. The information from
+the -h options will be embedded in this man page. Any functions that
+use getopts to process arguments will be cross referenced on the generated
+man page.
+
+Since Pt_t is now a declaration command it can be used in the definition
+of other types, for example
+ typeset -T Rect_t=( Pt_t ur ll)
+
+Because a type definition is a command, it can be loaded on first reference
+by putting the definition into a file that is found on FPATH.
+Thus, if this definition is in a file named Pt_t on FPATH, then
+a program can create instances of Pt_t without first including
+the definition.
+
+A type definition is readonly and cannot be unset. Unsetting non-shared
+elements of a type restores them to their default value. Unsetting a
+shared element has no effect.
+
+The Pt_t command is used to create an instance of Pt_t.
+ Pt_t p1
+creates an instance named p1 with the initial value for p1.x set to 1
+and the initial value of p1.y set to 0.
+ Pt_t p2=(x=3 y=4)
+creates an instance with the specified initial values. The len function
+gives the distance of the point to the origin. Thus, p1.len will output
+1 and p2.len will output 5.
+
+ksh93t also introduces a more efficient command substitution mechanism.
+Instead of $(command), the new command substitution ${ command;}
+can be used. Unlike (and ) which are always special, the { and } are
+reserved words and require the space after { and a newline or ; before }.
+Unlike $(), the ${ ;} command substitution executes the command in
+the current shell context saving the need to save and restore
+changes, therefore also allowing side effects.
+
+When trying to expand an element of a type, if the element does not exist,
+ksh will look for a discipline function with that name and treat this as if
+it were the ${ ;} command substitution. Thus, ${p1.len} is equivalent to
+${ p1.len;} and within an arithmetic expression, p1.len will be expanded
+via the new command substitution method.
+
+The type of any variable can be obtained from the new prefix
+operator @. Thus, ${@p1} will output Pt_t.
+
+By default, each instance inherits all the discipline functions defined
+by the type definition other than create. However, each instance can define
+a function by the same name that will override this definition.
+However, only discipline functions with the same name as those defined
+by the type or the standard get, set, append, and unset disciplines
+can be defined by each instance.
+
+Each instance of the type Pt_t behaves like a compound variable except
+that only the variables defined by the type can be referenced or set.
+Thus, p2.x=9 is valid, but p2.z=9 is not. Unless a set discipline function
+does otherwise, the value of $p1 will be expanded to the form of a compound
+variable that can be used for reinput into ksh.
+
+If the variables var1 and var2 are of the same type, then the assignment
+ var2=var1
+will create a copy of the variable var1 into var2. This is equivalent to
+ eval var2="$var1"
+but is faster since the variable does not need to get expanded or reparsed.
+
+The type Pt_t can be referenced as if it were a variable using the name
+.sh.type.Pt_t. To change the default point location for subsequent
+instances of Pt_t, you can do
+ .sh.type.Pt_t=(x=5 y=12)
+so that
+ Pt_t p3
+ p3.len
+would be 13.
+
+Types can be defined for simple variables as well as for compound
+objects such as Pt_t. In this case, the variable named . inside
+the definition refers to the real value for the variable. For example,
+the type definition
+ typeset -T Time_t=(
+ integer .=0
+ _='%H:%M:%S'
+ get()
+ {
+ .sh.value=$(printf "%(${_._})T" "#$((_))" )
+ }
+ set()
+ {
+ .sh.value=$(printf "%(%#)T" "${.sh.value}")
+
+ }
+ )
+
+The sub-variable name _ is reserved for data used by discipline functions
+and will not be included with data written with the %B option to printf.
+In this case it is used to specify a date format.
+
+In this case
+ Time_t t1 t2=now
+will define t1 as the time at the beginning of the epoch and t2
+as the current time. Unlike the previous case, $t2 will output
+the current time in the date format specified by the value t2._.
+However, the value of ${t2.} will expand the instance to a form
+that can be used as input to the shell.
+
+Finally, types can be derived from an existing type. If the first
+element in a type definition is named _, then the new type
+consists of all the elements and discipline functions from the
+type of _ extended by elements and discipline functions defined
+by new type definition. For example,
+
+ typeset -T Pq_t=(
+ Pt_t _
+ float z=0.
+ len()
+ {
+ print -r $((sqrt(_.x*_.x + _.y*_.y + _.z*_.z)))
+ }
+ )
+
+defines a new type Pq_t which is based on Pq_t and contains an additional
+field z and a different len discipline function. It is also possible
+to create a new type Pt_t based on the original Pt_t. In this case
+the original Pt_t is no longer accessible.
diff --git a/usr/src/lib/libshell/common/bltins/alarm.c b/usr/src/lib/libshell/common/bltins/alarm.c
index 6f4aa2f644..ff3369d293 100644
--- a/usr/src/lib/libshell/common/bltins/alarm.c
+++ b/usr/src/lib/libshell/common/bltins/alarm.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -235,7 +235,7 @@ int b_alarm(int argc,char *argv[],void *extra)
register int n,rflag=0;
register Namval_t *np;
register struct tevent *tp;
- register Shell_t *shp = (Shell_t*)extra;
+ register Shell_t *shp = ((Shbltin_t*)extra)->shp;
while (n = optget(argv, sh_optalarm)) switch (n)
{
case 'r':
@@ -262,7 +262,7 @@ int b_alarm(int argc,char *argv[],void *extra)
np = nv_open(argv[0],shp->var_tree,NV_NOARRAY|NV_VARNAME|NV_NOASSIGN);
if(!nv_isnull(np))
nv_unset(np);
- nv_setattr(np, NV_INTEGER|NV_DOUBLE);
+ nv_setattr(np, NV_DOUBLE);
if(!(tp = newof(NIL(struct tevent*),struct tevent,1,0)))
errormsg(SH_DICT,ERROR_exit(1),e_nospace);
tp->fun.disc = &alarmdisc;
diff --git a/usr/src/lib/libshell/common/bltins/cd_pwd.c b/usr/src/lib/libshell/common/bltins/cd_pwd.c
index f57f7c977e..ac9d3f426f 100644
--- a/usr/src/lib/libshell/common/bltins/cd_pwd.c
+++ b/usr/src/lib/libshell/common/bltins/cd_pwd.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -39,7 +39,6 @@
#include <ls.h>
#include <ctype.h>
-#ifdef PATH_BFPATH
/*
* Invalidate path name bindings to relative paths
*/
@@ -50,18 +49,13 @@ static void rehash(register Namval_t *np,void *data)
if(pp && *pp->name!='/')
nv_unset(np);
}
-#endif
int b_cd(int argc, char *argv[],void *extra)
{
-#ifdef PATH_BFPATH
register char *dir;
Pathcomp_t *cdpath = 0;
-#else
- register char *dir, *cdpath="";
-#endif
register const char *dp;
- register Shell_t *shp = (Shell_t*)extra;
+ register Shell_t *shp = ((Shbltin_t*)extra)->shp;
int saverrno=0;
int rval,flag=0;
char *oldpwd;
@@ -105,7 +99,6 @@ int b_cd(int argc, char *argv[],void *extra)
if(*dir != '/')
#endif /* _WINIX */
{
-#ifdef PATH_BFPATH
if(!(cdpath = (Pathcomp_t*)shp->cdpathlist) && (dp=(CDPNOD)->nvalue.cp))
{
if(cdpath=path_addpath((Pathcomp_t*)0,dp,PATH_CDPATH))
@@ -114,38 +107,22 @@ int b_cd(int argc, char *argv[],void *extra)
cdpath->shp = shp;
}
}
-#else
- cdpath = nv_getval(nv_scoped(CDPNOD));
-#endif
if(!oldpwd)
oldpwd = path_pwd(1);
}
-#ifndef PATH_BFPATH
- if(!cdpath)
- cdpath = "";
-#endif
if(*dir=='.')
{
/* test for pathname . ./ .. or ../ */
if(*(dp=dir+1) == '.')
dp++;
if(*dp==0 || *dp=='/')
-#ifdef PATH_BFPATH
cdpath = 0;
-#else
- cdpath = "";
-#endif
}
rval = -1;
do
{
-#ifdef PATH_BFPATH
dp = cdpath?cdpath->name:"";
cdpath = path_nextcomp(cdpath,dir,0);
-#else
- dp = cdpath;
- cdpath=path_join(cdpath,dir);
-#endif
#if _WINIX
if(*stakptr(PATH_OFFSET+1)==':' && isalpha(*stakptr(PATH_OFFSET)))
{
@@ -210,11 +187,7 @@ success:
stakseek(dir-stakptr(0));
}
dir = (char*)stakfreeze(1)+PATH_OFFSET;
-#ifdef PATH_BFPATH
if(*dp && (*dp!='.'||dp[1]) && strchr(dir,'/'))
-#else
- if(*dp && *dp!= ':' && strchr(dir,'/'))
-#endif
sfputr(sfstdout,dir,'\n');
if(*dir != '/')
return(0);
@@ -228,11 +201,9 @@ success:
nv_putval(pwdnod,dir,NV_RDONLY);
nv_onattr(pwdnod,NV_NOFREE|NV_EXPORT);
shp->pwd = pwdnod->nvalue.cp;
-#ifdef PATH_BFPATH
nv_scan(shp->track_tree,rehash,(void*)0,NV_TAGGED,NV_TAGGED);
path_newdir(shp->pathlist);
path_newdir(shp->cdpathlist);
-#endif
return(0);
}
@@ -240,7 +211,7 @@ int b_pwd(int argc, char *argv[],void *extra)
{
register int n, flag = 0;
register char *cp;
- register Shell_t *shp = (Shell_t*)extra;
+ register Shell_t *shp = ((Shbltin_t*)extra)->shp;
NOT_USED(argc);
while((n = optget(argv,sh_optpwd))) switch(n)
{
diff --git a/usr/src/lib/libshell/common/bltins/cflow.c b/usr/src/lib/libshell/common/bltins/cflow.c
index 3f32f4386d..6afe9d584f 100644
--- a/usr/src/lib/libshell/common/bltins/cflow.c
+++ b/usr/src/lib/libshell/common/bltins/cflow.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -47,7 +47,7 @@
int b_return(register int n, register char *argv[],void *extra)
{
register char *arg;
- register Shell_t *shp = (Shell_t*)extra;
+ register Shell_t *shp = ((Shbltin_t*)extra)->shp;
struct checkpt *pp = (struct checkpt*)shp->jmplist;
const char *options = (**argv=='r'?sh_optreturn:sh_optexit);
while((n = optget(argv,options))) switch(n)
@@ -85,7 +85,7 @@ int b_break(register int n, register char *argv[],void *extra)
{
char *arg;
register int cont= **argv=='c';
- register Shell_t *shp = (Shell_t*)extra;
+ register Shell_t *shp = ((Shbltin_t*)extra)->shp;
while((n = optget(argv,cont?sh_optcont:sh_optbreak))) switch(n)
{
case ':':
diff --git a/usr/src/lib/libshell/common/bltins/enum.c b/usr/src/lib/libshell/common/bltins/enum.c
new file mode 100644
index 0000000000..c4d8bf03e9
--- /dev/null
+++ b/usr/src/lib/libshell/common/bltins/enum.c
@@ -0,0 +1,283 @@
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* David Korn <dgk@research.att.com> *
+* *
+***********************************************************************/
+#pragma prototyped
+#include <shell.h>
+
+static const char enum_usage[] =
+"[-?@(#)$Id: enum (AT&T Research) 2008-01-08 $\n]"
+USAGE_LICENSE
+"[+NAME?enum - create an enumeration type]"
+"[+DESCRIPTION?\benum\b is a declaration command that creates an enumeration "
+ "type \atypename\a that can only store any one of the values in the indexed "
+ "array variable \atypename\a.]"
+"[+?If the list of \avalue\as is ommitted, then \atypename\a must name an "
+ "indexed array variable with at least two elements.]"
+"[i:ignorecase?The values are case insensitive.]"
+"\n"
+"\n\atypename\a[\b=(\b \avalue\a ... \b)\b]\n"
+"\n"
+"[+EXIT STATUS]"
+ "{"
+ "[+0?Successful completion.]"
+ "[+>0?An error occurred.]"
+ "}"
+"[+SEE ALSO?\bksh\b(1), \btypeset\b(1).]"
+;
+
+static const char enum_type[] =
+"[-1c?\n@(#)$Id: type (AT&T Labs Research) 2008-01-08 $\n]"
+USAGE_LICENSE
+"[+NAME?\f?\f - create an instance of type \b\f?\f\b]"
+"[+DESCRIPTION?\b\f?\f\b creates a variable for each \aname\a with "
+ "enumeration type \b\f?\f\b where \b\f?\f\b is a type that has been "
+ "created with the \benum\b(1) command.]"
+"[+?The variable can have one of the following values\fvalues\f. "
+ "The the values are \fcase\fcase sensitive.]"
+"[+?If \b=\b\avalue\a is omitted, the default is \fdefault\f.]"
+"[+?If no \aname\as are specified then the names and values of all "
+ "variables of this type are written to standard output.]"
+"[+?\b\f?\f\b is built-in to the shell as a declaration command so that "
+ "field splitting and pathname expansion are not performed on "
+ "the arguments. Tilde expansion occurs on \avalue\a.]"
+"[r?Enables readonly. Once enabled, the value cannot be changed or unset.]"
+"[a?index array. Each \aname\a will converted to an index "
+ "array of type \b\f?\f\b. If a variable already exists, the current "
+ "value will become index \b0\b.]"
+"[A?Associative array. Each \aname\a will converted to an associate "
+ "array of type \b\f?\f\b. If a variable already exists, the current "
+ "value will become subscript \b0\b.]"
+"[h]:[string?Used within a type definition to provide a help string "
+ "for variable \aname\a. Otherwise, it is ignored.]"
+"[S?Used with a type definition to indicate that the variable is shared by "
+ "each instance of the type. When used inside a function defined "
+ "with the \bfunction\b reserved word, the specified variables "
+ "will have function static scope. Otherwise, the variable is "
+ "unset prior to processing the assignment list.]"
+#if 0
+"[p?Causes the output to be in a form of \b\f?\f\b commands that can be "
+ "used as input to the shell to recreate the current type of "
+ "these variables.]"
+#endif
+"\n"
+"\n[name[=value]...]\n"
+"\n"
+"[+EXIT STATUS?]{"
+ "[+0?Successful completion.]"
+ "[+>0?An error occurred.]"
+"}"
+
+"[+SEE ALSO?\benum\b(1), \btypeset\b(1)]"
+;
+
+struct Enum
+{
+ Namfun_t hdr;
+ short nelem;
+ short iflag;
+ const char *values[1];
+};
+
+static int enuminfo(Opt_t* op, Sfio_t *out, const char *str, Optdisc_t *fp)
+{
+ Namval_t *np;
+ struct Enum *ep;
+ int n=0;
+ const char *v;
+ np = *(Namval_t**)(fp+1);
+ ep = (struct Enum*)np->nvfun;
+ if(strcmp(str,"default")==0)
+#if 0
+ sfprintf(out,"\b%s\b%c",ep->values[0],0);
+#else
+ sfprintf(out,"\b%s\b",ep->values[0]);
+#endif
+ else if(strcmp(str,"case")==0)
+ {
+ if(ep->iflag)
+ sfprintf(out,"not ");
+ }
+ else while(v=ep->values[n++])
+ {
+ sfprintf(out,", \b%s\b",v);
+ }
+ return(0);
+}
+
+static Namfun_t *clone_enum(Namval_t* np, Namval_t *mp, int flags, Namfun_t *fp)
+{
+ struct Enum *ep, *pp=(struct Enum*)fp;
+ ep = newof(0,struct Enum,1,pp->nelem*sizeof(char*));
+ memcpy((void*)ep,(void*)pp,sizeof(struct Enum)+pp->nelem*sizeof(char*));
+ return(&ep->hdr);
+}
+
+static void put_enum(Namval_t* np,const char *val,int flags,Namfun_t *fp)
+{
+ struct Enum *ep = (struct Enum*)fp;
+ register const char *v;
+ unsigned short i=0, n;
+ if(!val)
+ {
+ nv_disc(np,&ep->hdr,NV_POP);
+ if(!ep->hdr.nofree)
+ free((void*)ep);
+ nv_putv(np, val, flags,fp);
+ return;
+ }
+ if(flags&NV_INTEGER)
+ {
+ nv_putv(np,val,flags,fp);
+ return;
+ }
+ while(v=ep->values[i])
+ {
+ if(ep->iflag)
+ n = strcasecmp(v,val);
+ else
+ n = strcmp(v,val);
+ if(n==0)
+ {
+ nv_putv(np, (char*)&i, NV_UINT16, fp);
+ return;
+ }
+ i++;
+ }
+ error(ERROR_exit(1), "%s: invalid value %s",nv_name(np),val);
+}
+
+static char* get_enum(register Namval_t* np, Namfun_t *fp)
+{
+ static char buff[6];
+ struct Enum *ep = (struct Enum*)fp;
+ long n = nv_getn(np,fp);
+ if(n < ep->nelem)
+ return((char*)ep->values[n]);
+ sfsprintf(buff,sizeof(buff),"%u%c",n,0);
+ return(buff);
+}
+
+static Sfdouble_t get_nenum(register Namval_t* np, Namfun_t *fp)
+{
+ return(nv_getn(np,fp));
+}
+
+const Namdisc_t ENUM_disc = { 0, put_enum, get_enum, get_nenum, 0,0,clone_enum };
+
+#ifdef STANDALONE
+static int enum_create(int argc, char** argv, void* context)
+#else
+int b_enum(int argc, char** argv, void* context)
+#endif
+{
+ int sz,i,n,iflag = 0;
+ Namval_t *np, *tp;
+ Namarr_t *ap;
+ char *cp,*sp;
+ struct Enum *ep;
+ Shell_t *shp = ((Shbltin_t*)context)->shp;
+ struct {
+ Optdisc_t opt;
+ Namval_t *np;
+ } optdisc;
+
+ cmdinit(argc, argv, context, ERROR_CATALOG, ERROR_NOTIFY);
+ for (;;)
+ {
+ switch (optget(argv, enum_usage))
+ {
+ case 'i':
+ iflag = 'i';
+ continue;
+ case '?':
+ error(ERROR_USAGE|4, "%s", opt_info.arg);
+ break;
+ case ':':
+ error(2, "%s", opt_info.arg);
+ break;
+ }
+ break;
+ }
+ argv += opt_info.index;
+ if (error_info.errors || !*argv || *(argv + 1))
+ {
+ error(ERROR_USAGE|2, "%s", optusage(NiL));
+ return 1;
+ }
+ while(cp = *argv++)
+ {
+ if(!(np = nv_open(cp, (void*)0, NV_VARNAME|NV_NOADD)) || !(ap=nv_arrayptr(np)) || ap->fun || (sz=ap->nelem&(((1L<<ARRAY_BITS)-1))) < 2)
+ error(ERROR_exit(1), "%s must name an array containing at least two elements",cp);
+ n = staktell();
+ sfprintf(stkstd,"%s.%s%c",NV_CLASS,np->nvname,0);
+ tp = nv_open(stakptr(n), shp->var_tree, NV_VARNAME);
+ stakseek(n);
+ n = sz;
+ i = 0;
+ nv_onattr(tp, NV_UINT16);
+ nv_putval(tp, (char*)&i, NV_INTEGER);
+ nv_putsub(np, (char*)0, ARRAY_SCAN);
+ do
+ {
+ sz += strlen(nv_getval(np));
+ }
+ while(nv_nextsub(np));
+ sz += n*sizeof(char*);
+ if(!(ep = newof(0,struct Enum,1,sz)))
+ error(ERROR_system(1), "out of space");
+ ep->iflag = iflag;
+ ep->nelem = n;
+ cp = (char*)&ep->values[n+1];
+ nv_putsub(np, (char*)0, ARRAY_SCAN);
+ ep->values[n] = 0;
+ i = 0;
+ do
+ {
+ ep->values[i++] = cp;
+ sp = nv_getval(np);
+ n = strlen(sp);
+ memcpy(cp,sp,n+1);
+ cp += n+1;
+ }
+ while(nv_nextsub(np));
+ ep->hdr.dsize = sizeof(struct Enum)+sz;
+ ep->hdr.disc = &ENUM_disc;
+ ep->hdr.type = tp;
+ nv_onattr(tp, NV_RDONLY);
+ nv_disc(tp, &ep->hdr,NV_FIRST);
+ memset(&optdisc,0,sizeof(optdisc));
+ optdisc.opt.infof = enuminfo;
+ optdisc.np = tp;
+ nv_addtype(tp, enum_type, &optdisc.opt, sizeof(optdisc));
+ }
+ return error_info.errors != 0;
+}
+
+#ifdef STANDALONE
+void lib_init(int flag, void* context)
+{
+ Shell_t *shp = ((Shbltin_t*)context)->shp;
+ Namval_t *mp,*bp;
+ if(flag)
+ return;
+ bp = sh_addbuiltin("Enum", enum_create, (void*)0);
+ mp = nv_search("typeset",shp->bltin_tree,0);
+ nv_onattr(bp,nv_isattr(mp,NV_PUBLIC));
+}
+#endif
diff --git a/usr/src/lib/libshell/common/bltins/getopts.c b/usr/src/lib/libshell/common/bltins/getopts.c
index 65057da8d2..be48cc8886 100644
--- a/usr/src/lib/libshell/common/bltins/getopts.c
+++ b/usr/src/lib/libshell/common/bltins/getopts.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -35,16 +35,17 @@
static int infof(Opt_t* op, Sfio_t* sp, const char* s, Optdisc_t* dp)
{
+ Shell_t *shp = *(Shell_t**)(dp+1);
+ Stk_t *stkp = shp->stk;
if(nv_search(s,sh.fun_tree,0))
{
- int savtop = staktell();
- char *savptr = stakfreeze(0);
- stakputc('$');
- stakputc('(');
- stakputs(s);
- stakputc(')');
- sfputr(sp,sh_mactry(stakfreeze(1)),-1);
- stakset(savptr,savtop);
+ int savtop = stktell(stkp);
+ char *savptr = stkfreeze(stkp,0);
+ sfputc(stkp,'$');
+ sfputc(stkp,'(');
+ sfputr(stkp,s,')');
+ sfputr(sp,sh_mactry(shp,stkfreeze(stkp,1)),-1);
+ stkset(stkp,savptr,savtop);
}
return(1);
}
@@ -54,14 +55,18 @@ int b_getopts(int argc,char *argv[],void *extra)
register char *options=error_info.context->id;
register Namval_t *np;
register int flag, mode, r=0;
- register Shell_t *shp = (Shell_t*)extra;
+ register Shell_t *shp = ((Shbltin_t*)extra)->shp;
char value[2], key[2];
- int jmpval;
+ int jmpval,extended;
struct checkpt buff, *pp;
- Optdisc_t disc;
+ struct {
+ Optdisc_t hdr;
+ Shell_t *sh;
+ } disc;
memset(&disc, 0, sizeof(disc));
- disc.version = OPT_VERSION;
- disc.infof = infof;
+ disc.hdr.version = OPT_VERSION;
+ disc.hdr.infof = infof;
+ disc.sh = shp;
value[1] = 0;
key[1] = 0;
while((flag = optget(argv,sh_optgetopts))) switch(flag)
@@ -98,6 +103,7 @@ int b_getopts(int argc,char *argv[],void *extra)
opt_info.offset = shp->st.optchar;
if(mode= (*options==':'))
options++;
+ extended = *options=='\n' && *(options+1)=='[' || *options=='[' && *(options+1)=='-';
sh_pushcontext(&buff,1);
jmpval = sigsetjmp(buff.buff,0);
if(jmpval)
@@ -107,7 +113,7 @@ int b_getopts(int argc,char *argv[],void *extra)
pp->mode = SH_JMPERREXIT;
sh_exit(2);
}
- opt_info.disc = &disc;
+ opt_info.disc = &disc.hdr;
switch(opt_info.index>=0 && opt_info.index<=argc?(opt_info.num= LONG_MIN,flag=optget(argv,options)):0)
{
case '?':
@@ -165,18 +171,20 @@ int b_getopts(int argc,char *argv[],void *extra)
np = nv_open(nv_name(OPTARGNOD),shp->var_tree,NV_NOSCOPE);
if(opt_info.num == LONG_MIN)
nv_putval(np, opt_info.arg, NV_RDONLY);
- else if (opt_info.num > 0 && opt_info.arg && opt_info.arg[0] == (char)opt_info.num)
+ else if (opt_info.arg && opt_info.num > 0 && isalpha((char)opt_info.num) && !isdigit(opt_info.arg[0]) && opt_info.arg[0] != '-' && opt_info.arg[0] != '+')
{
key[0] = (char)opt_info.num;
key[1] = 0;
nv_putval(np, key, NV_RDONLY);
}
- else
+ else if(extended)
{
Sfdouble_t d;
d = opt_info.number;
nv_putval(np, (char*)&d, NV_LDOUBLE|NV_RDONLY);
}
+ else
+ nv_putval(np, opt_info.arg, NV_RDONLY);
nv_close(np);
sh_popcontext(&buff);
opt_info.disc = 0;
diff --git a/usr/src/lib/libshell/common/bltins/hist.c b/usr/src/lib/libshell/common/bltins/hist.c
index fcb81958e4..b248515a06 100644
--- a/usr/src/lib/libshell/common/bltins/hist.c
+++ b/usr/src/lib/libshell/common/bltins/hist.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -45,7 +45,7 @@ int b_hist(int argc,char *argv[], void *extra)
register History_t *hp;
register char *arg;
register int flag,fdo;
- register Shell_t *shp = (Shell_t*)extra;
+ register Shell_t *shp = ((Shbltin_t*)extra)->shp;
Sfio_t *outfile;
char *fname;
int range[2], incr, index2, indx= -1;
@@ -57,7 +57,7 @@ int b_hist(int argc,char *argv[], void *extra)
#endif
Histloc_t location;
NOT_USED(argc);
- if(!sh_histinit())
+ if(!sh_histinit((void*)shp))
errormsg(SH_DICT,ERROR_system(1),e_histopen);
hp = shp->hist_ptr;
while((flag = optget(argv,sh_opthist))) switch(flag)
@@ -169,7 +169,7 @@ int b_hist(int argc,char *argv[], void *extra)
range[0] = index2;
if(flag==0)
/* set default termination range */
- range[1] = (lflag?hist_max(hp)-1:range[0]);
+ range[1] = ((lflag && !edit)?hist_max(hp)-1:range[0]);
if(range[1]>=(flag=(hist_max(hp) - !lflag)))
range[1] = flag;
/* check for valid ranges */
@@ -215,7 +215,7 @@ int b_hist(int argc,char *argv[], void *extra)
sfclose(outfile);
hist_eof(hp);
arg = edit;
- if(!arg && !(arg=nv_getval(nv_scoped(HISTEDIT))) && !(arg=nv_getval(nv_scoped(FCEDNOD))))
+ if(!arg && !(arg=nv_getval(sh_scoped(shp,HISTEDIT))) && !(arg=nv_getval(sh_scoped(shp,FCEDNOD))))
arg = (char*)e_defedit;
#ifdef apollo
/*
diff --git a/usr/src/lib/libshell/common/bltins/misc.c b/usr/src/lib/libshell/common/bltins/misc.c
index 974c3de037..22a1410fc3 100644
--- a/usr/src/lib/libshell/common/bltins/misc.c
+++ b/usr/src/lib/libshell/common/bltins/misc.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -63,7 +63,7 @@ int b_exec(int argc,char *argv[], void *extra)
register int n;
logdata.clear = 0;
logdata.arg0 = 0;
- logdata.sh = (Shell_t*)extra;
+ logdata.sh = ((Shbltin_t*)extra)->shp;
logdata.sh->st.ioset = 0;
while (n = optget(argv, sh_optexec)) switch (n)
{
@@ -102,7 +102,7 @@ int B_login(int argc,char *argv[],void *extra)
register Shell_t *shp;
const char *pname;
if(argc)
- shp = (Shell_t*)extra;
+ shp = ((Shbltin_t*)extra)->shp;
else
{
logp = (struct login*)extra;
@@ -143,15 +143,15 @@ int B_login(int argc,char *argv[],void *extra)
if(logp && logp->arg0)
argv[0] = logp->arg0;
#ifdef JOBS
- if(job_close() < 0)
+ if(job_close(shp) < 0)
return(1);
#endif /* JOBS */
/* force bad exec to terminate shell */
pp->mode = SH_JMPEXIT;
sh_sigreset(2);
- sh_freeup();
+ sh_freeup(shp);
path_exec(pname,argv,NIL(struct argnod*));
- sh_done(0);
+ sh_done(shp,0);
}
return(1);
}
@@ -182,7 +182,7 @@ int b_let(int argc,char *argv[],void *extra)
int b_eval(int argc,char *argv[], void *extra)
{
register int r;
- register Shell_t *shp = (Shell_t*)extra;
+ register Shell_t *shp = ((Shbltin_t*)extra)->shp;
NOT_USED(argc);
while (r = optget(argv,sh_opteval)) switch (r)
{
@@ -209,14 +209,14 @@ int b_dot_cmd(register int n,char *argv[],void* extra)
register char *script;
register Namval_t *np;
register int jmpval;
- register Shell_t *shp = (Shell_t*)extra;
+ register Shell_t *shp = ((Shbltin_t*)extra)->shp;
struct sh_scoped savst, *prevscope = shp->st.self;
char *filename=0;
int fd;
struct dolnod *argsave=0, *saveargfor;
struct checkpt buff;
Sfio_t *iop=0;
- NOT_USED(extra);
+ short level;
while (n = optget(argv,sh_optdot)) switch (n)
{
case ':':
@@ -230,9 +230,8 @@ int b_dot_cmd(register int n,char *argv[],void* extra)
script = *argv;
if(error_info.errors || !script)
errormsg(SH_DICT,ERROR_usage(2),"%s",optusage((char*)0));
- if(shp->dot_depth++ > DOTMAX)
+ if(shp->dot_depth+1 > DOTMAX)
errormsg(SH_DICT,ERROR_exit(1),e_toodeep,script);
- shp->st.lineno = error_info.line;
if(!(np=shp->posix_fun))
{
/* check for KornShell style function first */
@@ -241,11 +240,7 @@ int b_dot_cmd(register int n,char *argv[],void* extra)
{
if(!np->nvalue.ip)
{
-#ifdef PATH_BFPATH
- path_search(script,NIL(Pathcomp_t*),0);
-#else
- path_search(script,NIL(char*),0);
-#endif
+ path_search(script,NIL(Pathcomp_t**),0);
if(np->nvalue.ip)
{
if(nv_isattr(np,NV_FPOSIX))
@@ -261,12 +256,19 @@ int b_dot_cmd(register int n,char *argv[],void* extra)
{
if((fd=path_open(script,path_get(script))) < 0)
errormsg(SH_DICT,ERROR_system(1),e_open,script);
- filename = path_fullname(stakptr(PATH_OFFSET));
+ filename = path_fullname(stkptr(shp->stk,PATH_OFFSET));
}
}
*prevscope = shp->st;
+ shp->st.lineno = np?((struct functnod*)nv_funtree(np))->functline:1;
+ shp->st.var_local = shp->st.save_tree = shp->var_tree;
if(filename)
+ {
shp->st.filename = filename;
+ shp->st.lineno = 1;
+ }
+ level = shp->fn_depth+shp->dot_depth+1;
+ nv_putval(SH_LEVELNOD,(char*)&level,NV_INT16);
shp->st.prevst = prevscope;
shp->st.self = &savst;
shp->topscope = (Shscope_t*)shp->st.self;
@@ -277,11 +279,12 @@ int b_dot_cmd(register int n,char *argv[],void* extra)
nv_putval(SH_PATHNAMENOD, shp->st.filename ,NV_NOFREE);
shp->posix_fun = 0;
if(np || argv[1])
- argsave = sh_argnew(argv,&saveargfor);
+ argsave = sh_argnew(shp,argv,&saveargfor);
sh_pushcontext(&buff,SH_JMPDOT);
jmpval = sigsetjmp(buff.buff,0);
if(jmpval == 0)
{
+ shp->dot_depth++;
if(np)
sh_exec((Shnode_t*)(nv_funtree(np)),sh_isstate(SH_ERREXIT));
else
@@ -296,7 +299,7 @@ int b_dot_cmd(register int n,char *argv[],void* extra)
free((void*)shp->st.filename);
shp->dot_depth--;
if((np || argv[1]) && jmpval!=SH_JMPSCRIPT)
- sh_argreset(argsave,saveargfor);
+ sh_argreset(shp,argsave,saveargfor);
else
{
prevscope->dolc = shp->st.dolc;
@@ -340,7 +343,7 @@ int b_false(int argc,register char *argv[], void *extra)
int b_shift(register int n, register char *argv[], void *extra)
{
register char *arg;
- register Shell_t *shp = (Shell_t*)extra;
+ register Shell_t *shp = ((Shbltin_t*)extra)->shp;
while((n = optget(argv,sh_optshift))) switch(n)
{
case ':':
@@ -366,7 +369,7 @@ int b_shift(register int n, register char *argv[], void *extra)
int b_wait(int n,register char *argv[],void *extra)
{
- register Shell_t *shp = (Shell_t*)extra;
+ register Shell_t *shp = ((Shbltin_t*)extra)->shp;
while((n = optget(argv,sh_optwait))) switch(n)
{
case ':':
@@ -392,7 +395,7 @@ int b_wait(int n,register char *argv[],void *extra)
int b_bg(register int n,register char *argv[],void *extra)
{
register int flag = **argv;
- register Shell_t *shp = (Shell_t*)extra;
+ register Shell_t *shp = ((Shbltin_t*)extra)->shp;
register const char *optstr = sh_optbg;
if(*argv[0]=='f')
optstr = sh_optfg;
@@ -426,7 +429,7 @@ int b_bg(register int n,register char *argv[],void *extra)
int b_jobs(register int n,char *argv[],void *extra)
{
register int flag = 0;
- register Shell_t *shp = (Shell_t*)extra;
+ register Shell_t *shp = ((Shbltin_t*)extra)->shp;
while((n = optget(argv,sh_optjobs))) switch(n)
{
case 'l':
@@ -506,7 +509,7 @@ int b_universe(int argc, char *argv[],void *extra)
register int flag, n;
register const char *optstr;
register char *vend;
- register Shell_t *shp = (Shell_t*)extra;
+ register Shell_t *shp = ((Shbltin_t*)extra)->shp;
if(argv[0][1]=='p')
{
optstr = sh_optvpath;
@@ -539,7 +542,7 @@ int b_universe(int argc, char *argv[],void *extra)
flag |= FS3D_GET;
if((n = mount(*argv,(char*)0,flag,0)) >= 0)
{
- vend = stakalloc(++n);
+ vend = stkalloc(shp->stk,++n);
n = mount(*argv,vend,flag|FS3D_SIZE(n),0);
}
if(n < 0)
diff --git a/usr/src/lib/libshell/common/bltins/mkservice.c b/usr/src/lib/libshell/common/bltins/mkservice.c
index bba532b79d..be16f45162 100644
--- a/usr/src/lib/libshell/common/bltins/mkservice.c
+++ b/usr/src/lib/libshell/common/bltins/mkservice.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libshell/common/bltins/print.c b/usr/src/lib/libshell/common/bltins/print.c
index 5363c6f3ab..513d46fb0a 100644
--- a/usr/src/lib/libshell/common/bltins/print.c
+++ b/usr/src/lib/libshell/common/bltins/print.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -60,6 +60,7 @@ struct printf
int argsize;
int intvar;
char **nextarg;
+ char *lastarg;
char cescape;
char err;
Shell_t *sh;
@@ -69,6 +70,7 @@ static int extend(Sfio_t*,void*, Sffmt_t*);
static const char preformat[] = "";
static char *genformat(char*);
static int fmtvecho(const char*, struct printf*);
+static ssize_t fmtbase64(Sfio_t*, char*, int);
struct print
{
@@ -80,24 +82,6 @@ struct print
static char* nullarg[] = { 0, 0 };
-/*
- * Need to handle write failures to avoid locking output pool
- */
-static int outexceptf(Sfio_t* iop, int mode, void* data, Sfdisc_t* dp)
-{
- if(mode==SF_DPOP || mode==SF_FINAL)
- free((void*)dp);
- else if(mode==SF_WRITE && (errno!= EINTR || sh.trapnote))
- {
- int save = errno;
- sfpurge(iop);
- sfpool(iop,NIL(Sfio_t*),SF_WRITE);
- errno = save;
- errormsg(SH_DICT,ERROR_system(1),e_badwrite,sffileno(iop));
- }
- return(0);
-}
-
#if !SHOPT_ECHOPRINT
int B_echo(int argc, char *argv[],void *extra)
{
@@ -105,7 +89,7 @@ static int outexceptf(Sfio_t* iop, int mode, void* data, Sfdisc_t* dp)
struct print prdata;
prdata.options = sh_optecho+5;
prdata.raw = prdata.echon = 0;
- prdata.sh = (Shell_t*)extra;
+ prdata.sh = ((Shbltin_t*)extra)->shp;
NOT_USED(argc);
/* This mess is because /bin/echo on BSD is different */
if(!prdata.sh->universe)
@@ -145,7 +129,7 @@ int b_printf(int argc, char *argv[],void *extra)
struct print prdata;
NOT_USED(argc);
memset(&prdata,0,sizeof(prdata));
- prdata.sh = (Shell_t*)extra;
+ prdata.sh = ((Shbltin_t*)extra)->shp;
prdata.options = sh_optprintf;
return(b_print(-1,argv,&prdata));
}
@@ -159,10 +143,10 @@ int b_print(int argc, char *argv[], void *extra)
{
register Sfio_t *outfile;
register int exitval=0,n, fd = 1;
- register Shell_t *shp = (Shell_t*)extra;
+ register Shell_t *shp = ((Shbltin_t*)extra)->shp;
const char *options, *msg = e_file+4;
char *format = 0;
- int sflag = 0, nflag=0, rflag=0;
+ int sflag = 0, nflag=0, rflag=0, vflag=0;
if(argc>0)
{
options = sh_optprint;
@@ -196,7 +180,7 @@ int b_print(int argc, char *argv[], void *extra)
break;
case 's':
/* print to history file */
- if(!sh_histinit())
+ if(!sh_histinit((void*)shp))
errormsg(SH_DICT,ERROR_system(1),e_history);
fd = sffileno(shp->hist_ptr->histfp);
sh_onstate(SH_HISTORY);
@@ -218,6 +202,9 @@ int b_print(int argc, char *argv[], void *extra)
fd = -1;
break;
+ case 'v':
+ vflag=1;
+ break;
case ':':
/* The following is for backward compatibility */
#if OPT_VERSION >= 19990123
@@ -252,6 +239,8 @@ int b_print(int argc, char *argv[], void *extra)
argv += opt_info.index;
if(error_info.errors || (argc<0 && !(format = *argv++)))
errormsg(SH_DICT,ERROR_usage(2),"%s",optusage((char*)0));
+ if(vflag && format)
+ errormsg(SH_DICT,ERROR_usage(2),"-v and -f are mutually exclusive");
skip:
if(format)
format = genformat(format);
@@ -265,7 +254,7 @@ skip2:
n = 0;
}
else if(!(n=shp->fdstatus[fd]))
- n = sh_iocheckfd(fd);
+ n = sh_iocheckfd(shp,fd);
if(!(n&IOWRITE))
{
/* don't print error message for stdout for compatibility */
@@ -275,20 +264,11 @@ skip2:
}
if(!(outfile=shp->sftable[fd]))
{
- Sfdisc_t *dp;
sh_onstate(SH_NOTRACK);
n = SF_WRITE|((n&IOREAD)?SF_READ:0);
shp->sftable[fd] = outfile = sfnew(NIL(Sfio_t*),shp->outbuff,IOBSIZE,fd,n);
sh_offstate(SH_NOTRACK);
sfpool(outfile,shp->outpool,SF_WRITE);
- if(dp = new_of(Sfdisc_t,0))
- {
- dp->exceptf = outexceptf;
- dp->seekf = 0;
- dp->writef = 0;
- dp->readf = 0;
- sfdisc(outfile,dp);
- }
}
/* turn off share to guarantee atomic writes for printf */
n = sfset(outfile,SF_SHARE|SF_PUBLIC,0);
@@ -316,10 +296,17 @@ skip2:
sfpool(sfstderr,pool,SF_WRITE);
exitval = pdata.err;
}
+ else if(vflag)
+ {
+ while(*argv)
+ fmtbase64(outfile,*argv++,0);
+ }
else
{
/* echo style print */
- if(sh_echolist(outfile,rflag,argv) && !nflag)
+ if(nflag && !argv[0])
+ sfsync((Sfio_t*)0);
+ else if(sh_echolist(outfile,rflag,argv) && !nflag)
sfputc(outfile,'\n');
}
if(sflag)
@@ -454,15 +441,23 @@ static char *fmthtml(const char *string)
return(stakptr(offset));
}
-static void *fmtbase64(char *string, ssize_t *sz)
+#if 1
+static ssize_t fmtbase64(Sfio_t *iop, char *string, int alt)
+#else
+static void *fmtbase64(char *string, ssize_t *sz, int alt)
+#endif
{
char *cp;
Sfdouble_t d;
- size_t size;
+ ssize_t size;
Namval_t *np = nv_open(string, NiL, NV_VARNAME|NV_NOASSIGN|NV_NOADD);
static union types_t number;
- if(!np)
- return("");
+ if(!np || nv_isnull(np))
+ {
+ if(sh_isoption(SH_NOUNSET))
+ errormsg(SH_DICT,ERROR_exit(1),e_notset,string);
+ return(0);
+ }
if(nv_isattr(np,NV_INTEGER))
{
d = nv_getnum(np);
@@ -502,11 +497,51 @@ static void *fmtbase64(char *string, ssize_t *sz)
number.i = (int)d;
}
}
+#if 1
+ return(sfwrite(iop, (void*)&number, size));
+#else
if(sz)
*sz = size;
return((void*)&number);
+#endif
}
if(nv_isattr(np,NV_BINARY))
+#if 1
+ {
+ Namfun_t *fp;
+ for(fp=np->nvfun; fp;fp=fp->next)
+ {
+ if(fp->disc && fp->disc->writef)
+ break;
+ }
+ if(fp)
+ return (*fp->disc->writef)(np, iop, 0, fp);
+ else
+ {
+ int n = nv_size(np);
+ cp = (char*)np->nvalue.cp;
+ if((size = n)==0)
+ size = strlen(cp);
+ size = sfwrite(iop, cp, size);
+ return(n?n:size);
+ }
+ }
+ else if(nv_isarray(np) && nv_arrayptr(np))
+ {
+ nv_outnode(np,iop,(alt?-1:0),0);
+ sfputc(iop,')');
+ return(sftell(iop));
+ }
+ else
+ {
+ if(alt && nv_isvtree(np))
+ nv_onattr(np,NV_EXPORT);
+ if(!(cp = nv_getval(np)))
+ return(0);
+ size = strlen(cp);
+ return(sfwrite(iop,cp,size));
+ }
+#else
nv_onattr(np,NV_RAW);
cp = nv_getval(np);
if(nv_isattr(np,NV_BINARY))
@@ -516,6 +551,33 @@ static void *fmtbase64(char *string, ssize_t *sz)
if(sz)
*sz = size;
return((void*)cp);
+#endif
+}
+
+static int varname(const char *str, int n)
+{
+ register int c,dot=1,len=1;
+ if(n < 0)
+ {
+ if(*str=='.')
+ str++;
+ n = strlen(str);
+ }
+ for(;n > 0; n-=len)
+ {
+#ifdef SHOPT_MULTIBYTE
+ len = mbsize(str);
+ c = mbchar(str);
+#else
+ c = *(unsigned char*)str++;
+#endif
+ if(dot && !(isalpha(c)||c=='_'))
+ break;
+ else if(dot==0 && !(isalnum(c) || c=='_' || c == '.'))
+ break;
+ dot = (c=='.');
+ }
+ return(n==0);
}
static int extend(Sfio_t* sp, void* v, Sffmt_t* fe)
@@ -532,6 +594,20 @@ static int extend(Sfio_t* sp, void* v, Sffmt_t* fe)
struct printf* pp = (struct printf*)fe;
register char* argp = *pp->nextarg;
+ if(fe->n_str>0 && varname(fe->t_str,fe->n_str) && (!argp || varname(argp,-1)))
+ {
+ if(argp)
+ pp->lastarg = argp;
+ else
+ argp = pp->lastarg;
+ if(argp)
+ {
+ sfprintf(pp->sh->strbuf,"%s.%.*s%c",argp,fe->n_str,fe->t_str,0);
+ argp = sfstruse(pp->sh->strbuf);
+ }
+ }
+ else
+ pp->lastarg = 0;
fe->flags |= SFFMT_VALUE;
if(!argp || format=='Z')
{
@@ -662,6 +738,11 @@ static int extend(Sfio_t* sp, void* v, Sffmt_t* fe)
case '\'':
case '"':
value->ll = ((unsigned char*)argp)[1];
+ if(argp[2] && (argp[2] != argp[0] || argp[3]))
+ {
+ errormsg(SH_DICT,ERROR_warn(0),e_charconst,argp);
+ pp->err = 1;
+ }
break;
default:
d = sh_strnum(argp,&lastchar,0);
@@ -698,6 +779,21 @@ static int extend(Sfio_t* sp, void* v, Sffmt_t* fe)
case 'F':
case 'G':
d = sh_strnum(*pp->nextarg,&lastchar,0);
+ switch(*argp)
+ {
+ case '\'':
+ case '"':
+ d = ((unsigned char*)argp)[1];
+ if(argp[2] && (argp[2] != argp[0] || argp[3]))
+ {
+ errormsg(SH_DICT,ERROR_warn(0),e_charconst,argp);
+ pp->err = 1;
+ }
+ break;
+ default:
+ d = sh_strnum(*pp->nextarg,&lastchar,0);
+ break;
+ }
if(SFFMT_LDOUBLE)
{
value->ld = d;
@@ -750,7 +846,11 @@ static int extend(Sfio_t* sp, void* v, Sffmt_t* fe)
}
break;
case 'B':
- value->s = (char*)fmtbase64(value->s, &fe->size);
+ if(!sh.strbuf2)
+ sh.strbuf2 = sfstropen();
+ fe->size = fmtbase64(sh.strbuf2,value->s, fe->flags&SFFMT_ALTER);
+ value->s = sfstruse(sh.strbuf2);
+ fe->flags |= SFFMT_SHORT;
break;
case 'H':
value->s = fmthtml(value->s);
diff --git a/usr/src/lib/libshell/common/bltins/read.c b/usr/src/lib/libshell/common/bltins/read.c
index 930470275c..874b575986 100644
--- a/usr/src/lib/libshell/common/bltins/read.c
+++ b/usr/src/lib/libshell/common/bltins/read.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -19,7 +19,7 @@
***********************************************************************/
#pragma prototyped
/*
- * read [-Aprs] [-d delim] [-u filenum] [-t timeout] [-n n] [-N n] [name...]
+ * read [-ACprs] [-d delim] [-u filenum] [-t timeout] [-n n] [-N n] [name...]
*
* David Korn
* AT&T Labs
@@ -45,23 +45,49 @@
#define N_FLAG 8 /* fixed size read at most */
#define NN_FLAG 0x10 /* fixed size read exact */
#define V_FLAG 0x20 /* use default value */
+#define C_FLAG 0x40 /* read into compound variable */
#define D_FLAG 8 /* must be number of bits for all flags */
+struct read_save
+{
+ char **argv;
+ char *prompt;
+ short fd;
+ short plen;
+ int flags;
+ long timeout;
+};
+
int b_read(int argc,char *argv[], void *extra)
{
Sfdouble_t sec;
register char *name;
register int r, flags=0, fd=0;
- register Shell_t *shp = (Shell_t*)extra;
+ register Shell_t *shp = ((Shbltin_t*)extra)->shp;
long timeout = 1000*shp->st.tmout;
- int save_prompt;
+ int save_prompt, fixargs=((Shbltin_t*)extra)->invariant;
+ struct read_save *rp;
static char default_prompt[3] = {ESC,ESC};
- NOT_USED(argc);
+ if(argc==0)
+ return(0);
+ if(rp = (struct read_save*)(((Shbltin_t*)extra)->data))
+ {
+ flags = rp->flags;
+ timeout = rp->timeout;
+ fd = rp->fd;
+ argv = rp->argv;
+ name = rp->prompt;
+ r = rp->plen;
+ goto bypass;
+ }
while((r = optget(argv,sh_optread))) switch(r)
{
case 'A':
flags |= A_FLAG;
break;
+ case 'C':
+ flags |= C_FLAG;
+ break;
case 't':
sec = sh_strnum(opt_info.arg, (char**)0,1);
timeout = sec ? 1000*sec : 1;
@@ -79,11 +105,11 @@ int b_read(int argc,char *argv[], void *extra)
errormsg(SH_DICT,ERROR_exit(1),e_query);
break;
case 'n': case 'N':
- flags &= ~((1<<D_FLAG)-1);
+ flags &= ((1<<D_FLAG)-1);
flags |= (r=='n'?N_FLAG:NN_FLAG);
r = (int)opt_info.num;
if((unsigned)r > (1<<((8*sizeof(int))-D_FLAG))-1)
- errormsg(SH_DICT,ERROR_exit(1),e_overlimit,"n");
+ errormsg(SH_DICT,ERROR_exit(1),e_overlimit,opt_info.name);
flags |= (r<< D_FLAG);
break;
case 'r':
@@ -112,19 +138,30 @@ int b_read(int argc,char *argv[], void *extra)
if(error_info.errors)
errormsg(SH_DICT,ERROR_usage(2), "%s", optusage((char*)0));
if(!((r=shp->fdstatus[fd])&IOREAD) || !(r&(IOSEEK|IONOSEEK)))
- r = sh_iocheckfd(fd);
+ r = sh_iocheckfd(shp,fd);
if(fd<0 || !(r&IOREAD))
errormsg(SH_DICT,ERROR_system(1),e_file+4);
/* look for prompt */
shp->prompt = default_prompt;
if((name = *argv) && (name=strchr(name,'?')) && (r&IOTTY))
+ r = strlen(name++);
+ else
+ r = 0;
+ if(argc==fixargs && (rp=newof(NIL(struct read_save*),struct read_save,1,0)))
{
- r = strlen(++name)+1;
- if(shp->prompt=(char*)sfreserve(sfstderr,r,SF_LOCKR))
- {
- memcpy(shp->prompt,name,r);
- sfwrite(sfstderr,shp->prompt,r-1);
- }
+ ((Shbltin_t*)extra)->data = (void*)rp;
+ rp->fd = fd;
+ rp->flags = flags;
+ rp->timeout = timeout;
+ rp->argv = argv;
+ rp->prompt = name;
+ rp->plen = r;
+ }
+bypass:
+ if(r && (shp->prompt=(char*)sfreserve(sfstderr,r,SF_LOCKR)))
+ {
+ memcpy(shp->prompt,name,r);
+ sfwrite(sfstderr,shp->prompt,r-1);
}
shp->timeout = 0;
save_prompt = shp->nextprompt;
@@ -166,28 +203,31 @@ int sh_readline(register Shell_t *shp,char **names, int fd, int flags,long timeo
register unsigned char *cp;
register Namval_t *np;
register char *name, *val;
- register Sfio_t *iop;
+ register Sfio_t *iop;
+ Namfun_t *nfp;
char *ifs;
unsigned char *cpmax;
unsigned char *del;
char was_escape = 0;
char use_stak = 0;
- char was_write = 0;
- char was_share = 1;
+ volatile char was_write = 0;
+ volatile char was_share = 1;
int rel, wrd;
long array_index = 0;
void *timeslot=0;
int delim = '\n';
int jmpval=0;
int size = 0;
+ int binary;
struct checkpt buff;
- if(!(iop=shp->sftable[fd]) && !(iop=sh_iostream(fd)))
+ if(!(iop=shp->sftable[fd]) && !(iop=sh_iostream(shp,fd)))
return(1);
+ sh_stats(STAT_READS);
if(names && (name = *names))
{
if(val= strchr(name,'?'))
*val = 0;
- np = nv_open(name,shp->var_tree,NV_NOASSIGN|NV_VARNAME|NV_ARRAY);
+ np = nv_open(name,shp->var_tree,NV_NOASSIGN|NV_VARNAME);
if((flags&V_FLAG) && shp->ed_context)
((struct edit*)shp->ed_context)->e_default = np;
if(flags&A_FLAG)
@@ -197,6 +237,12 @@ int sh_readline(register Shell_t *shp,char **names, int fd, int flags,long timeo
nv_unset(np);
nv_putsub(np,NIL(char*),0L);
}
+ else if(flags&C_FLAG)
+ {
+ delim = -1;
+ nv_unset(np);
+ nv_setvtree(np);
+ }
else
name = *++names;
if(val)
@@ -219,11 +265,12 @@ int sh_readline(register Shell_t *shp,char **names, int fd, int flags,long timeo
if(shp->fdstatus[fd]&IOTTY)
tty_raw(fd,1);
}
- if(!(flags&(N_FLAG|NN_FLAG)))
+ binary = nv_isattr(np,NV_BINARY);
+ if(!binary && !(flags&(N_FLAG|NN_FLAG)))
{
Namval_t *mp;
/* set up state table based on IFS */
- ifs = nv_getval(mp=nv_scoped(IFSNOD));
+ ifs = nv_getval(mp=sh_scoped(shp,IFSNOD));
if((flags&R_FLAG) && shp->ifstable['\\']==S_ESC)
shp->ifstable['\\'] = 0;
else if(!(flags&R_FLAG) && shp->ifstable['\\']==0)
@@ -237,8 +284,19 @@ int sh_readline(register Shell_t *shp,char **names, int fd, int flags,long timeo
shp->ifstable[0] = S_EOF;
}
sfclrerr(iop);
- if(np->nvfun && np->nvfun->disc->readf)
- return((* np->nvfun->disc->readf)(np,iop,delim,np->nvfun));
+ for(nfp=np->nvfun; nfp; nfp = nfp->next)
+ {
+ if(nfp->disc && nfp->disc->readf)
+ {
+ if((c=(*nfp->disc->readf)(np,iop,delim,nfp))>=0)
+ return(c);
+ }
+ }
+ if(binary && !(flags&(N_FLAG|NN_FLAG)))
+ {
+ flags |= NN_FLAG;
+ size = nv_size(np);
+ }
was_write = (sfset(iop,SF_WRITE,0)&SF_WRITE)!=0;
if(fd==0)
was_share = (sfset(iop,SF_SHARE,1)&SF_SHARE)!=0;
@@ -253,13 +311,17 @@ int sh_readline(register Shell_t *shp,char **names, int fd, int flags,long timeo
}
if(flags&(N_FLAG|NN_FLAG))
{
- char buf[64],*var=buf;
+ char buf[64],*var=buf,*cur,*end,*up,*v;
/* reserved buffer */
if((c=size)>=sizeof(buf))
{
if(!(var = (char*)malloc(c+1)))
sh_exit(1);
+ end = var + c;
}
+ else
+ end = var + sizeof(buf) - 1;
+ up = cur = var;
if((sfset(iop,SF_SHARE,1)&SF_SHARE) && fd!=0)
was_share = 1;
if(size==0)
@@ -269,38 +331,93 @@ int sh_readline(register Shell_t *shp,char **names, int fd, int flags,long timeo
}
else
{
- c= (shp->fdstatus[fd]&(IOTTY|IONOSEEK))?1:-1;
- if(flags&NN_FLAG)
- c = size;
- if(cp = sfreserve(iop,c,!(flags&NN_FLAG)))
- c = sfvalue(iop);
- else
- c = 0;
- if(c>size)
- c = size;
- if(c>0)
+ int f,m;
+ for (;;)
{
- memcpy((void*)var,cp,c);
- if(flags&N_FLAG)
- sfread(iop,cp,c);
+ c = (flags&NN_FLAG) ? -size : -1;
+ cp = sfreserve(iop,c,SF_LOCKR);
+ f = 1;
+ if((m = sfvalue(iop)) > 0)
+ {
+ if(!cp)
+ {
+ m = (cp = sfreserve(iop,size,0)) ? sfvalue(iop) : 0;
+ f = 0;
+ }
+ if(m>0 && (flags&N_FLAG) && !binary && (v=memchr(cp,'\n',m)))
+ m = v-(char*)cp;
+ }
+ if((c=m)>size)
+ c = size;
+ if(c>0)
+ {
+ if(c > (end-cur))
+ {
+ int cx = cur - var, ux = up - var;
+ if (var == buf)
+ {
+ m = (end - var) + (c - (end - cur));
+ v = (char*)malloc(m+1);
+ memcpy(v, var, cur - var);
+ }
+ else
+ v = newof(var, char, m, 1);
+ end = v + m;
+ cur = v + cx;
+ up = v + ux;
+ }
+ memcpy((void*)cur,cp,c);
+ if(f)
+ sfread(iop,cp,c);
+ cur += c;
+#if SHOPT_MULTIBYTE
+ if(!binary && mbwide())
+ {
+ int x;
+ int z;
+ int y = cur - up;
+
+ mbinit();
+ *cur = 0;
+ x = z = 0;
+ while (up < cur && (z = mbsize(up)) > 0)
+ {
+ up += z;
+ x++;
+ }
+ if((size -= x) > 0 && (up >= cur || z < 0) && ((flags & NN_FLAG) || z < 0 || m > c))
+ continue;
+ }
+#endif
+ }
+#if SHOPT_MULTIBYTE
+ if(!binary && mbwide() && (up == var || (flags & NN_FLAG) && size))
+ cur = var;
+#endif
+ *cur = 0;
+ if(c>=size)
+ sfclrerr(iop);
+ break;
}
- var[c] = 0;
- if(c>=size)
- sfclrerr(iop);
}
if(timeslot)
timerdel(timeslot);
- if(nv_isattr(np,NV_BINARY))
+ if(binary)
{
- if(c<sizeof(buf))
- var = memdup(var,c);
- nv_putval(np,var, NV_RAW);
- nv_setsize(np,c);
+ if(c==nv_size(np))
+ memcpy((char*)np->nvalue.cp,var,c);
+ else
+ {
+ if(var==buf)
+ var = memdup(var,c);
+ nv_putval(np,var,NV_RAW);
+ nv_setsize(np,c);
+ }
}
else
{
nv_putval(np,var,0);
- if(c>=sizeof(buf))
+ if(var!=buf)
free((void*)var);
}
goto done;
@@ -313,7 +430,7 @@ int sh_readline(register Shell_t *shp,char **names, int fd, int flags,long timeo
timerdel(timeslot);
if((flags&S_FLAG) && !shp->hist_ptr)
{
- sh_histinit();
+ sh_histinit((void*)shp);
if(!shp->hist_ptr)
flags &= ~S_FLAG;
}
diff --git a/usr/src/lib/libshell/common/bltins/shiocmd_solaris.c b/usr/src/lib/libshell/common/bltins/shiocmd_solaris.c
index 25bced42a2..84b875f4cb 100644
--- a/usr/src/lib/libshell/common/bltins/shiocmd_solaris.c
+++ b/usr/src/lib/libshell/common/bltins/shiocmd_solaris.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2007 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,6 +21,7 @@
#include <shell.h>
#include <stdio.h>
+#include <stdbool.h>
#include <option.h>
#include <stk.h>
#include <tm.h>
@@ -31,6 +32,9 @@
#endif
#include <poll.h>
+#define sh_contexttoshb(context) ((Shbltin_t*)(context))
+#define sh_contexttoshell(context) ((context)?(sh_contexttoshb(context)->shp):(NULL))
+
/*
* time formatting related
*/
@@ -487,7 +491,7 @@ extern int b_open(int argc, char *argv[], void *extra)
{
register Namval_t *np;
register int n,oflag=0;
- Shell_t *shp = (Shell_t*)extra;
+ Shell_t *shp = sh_contexttoshell(extra);
struct filedata *fdp;
mode_t mode = 0666;
long flags = 0;
@@ -658,18 +662,18 @@ extern int b_tmpfile(int argc, char *argv[], void *extra)
{
register Namval_t *np;
register int n;
- Shell_t *shp = (Shell_t*)extra;
+ Shell_t *shp = sh_contexttoshell(extra);
struct filedata *fdp;
- int inherit = 0;
+ bool inherit = false;
FILE *file = NULL;
int ffd, fd = -1;
while (n = optget(argv, sh_opttmpfile)) switch (n)
{
case 'i':
- inherit = 1;
+ inherit = true;
break;
case 'I':
- inherit = 0;
+ inherit = false;
break;
case ':':
errormsg(SH_DICT, 2, "%s", opt_info.arg);
@@ -734,17 +738,17 @@ extern int b_dup(int argc, char *argv[], void *extra)
{
register Namval_t *np;
register int n;
- Shell_t *shp = (Shell_t*)extra;
+ Shell_t *shp = sh_contexttoshell(extra);
struct filedata *fdp;
- int inherit = 0;
+ bool inherit = false;
int ffd, fd = -1;
while (n = optget(argv, sh_optdup)) switch (n)
{
case 'i':
- inherit = 1;
+ inherit = true;
break;
case 'I':
- inherit = 0;
+ inherit = false;
break;
case ':':
errormsg(SH_DICT, 2, "%s", opt_info.arg);
@@ -809,7 +813,7 @@ extern int b_stat(int argc, char *argv[], void *extra)
{
register Namval_t *np;
register int n;
- Shell_t *shp = (Shell_t*)extra;
+ Shell_t *shp = sh_contexttoshell(extra);
struct filedata *fdp;
long flags = 0;
struct stat statb;
@@ -854,7 +858,7 @@ extern int b_stat(int argc, char *argv[], void *extra)
}
static const char sh_optpoll[] =
-"[-?\n@(#)$Id: poll (AT&T Labs Research) 2007-05-07 $\n]"
+"[-?\n@(#)$Id: poll (AT&T Labs Research) 2007-12-20 $\n]"
"[-author?Roland Mainz <roland.mainz@nrubsig.org]"
"[-license?http://www.opensource.org/licenses/cpl1.0.txt]"
"[+NAME? poll - input/output multiplexing]"
@@ -957,7 +961,17 @@ static const char sh_optpoll[] =
"[+?Regular files always poll TRUE for reading and writing.]"
-"[t:timeout]:[milliseconds?Timeout in milliseconds. If the value timeout is 0, "
+"[c:fdcount]:[fdcount?Upon successful completion, a non-negative value is "
+ "returned. A positive value indicates the total number of "
+ "file descriptors that has been selected (that is, file "
+ "descriptors for which the revents member is non-zero). A "
+ "value of 0 indicates that the call timed out and no file "
+ "descriptors have been selected. Upon failure, -1 is returned.]"
+"[t:timeout]:[seconds?Timeout in seconds. If the value timeout is 0, "
+ "poll returns immediately. If the value of timeout is -1, poll "
+ "blocks until a requested event occurs or until the call is "
+ "interrupted.]"
+"[T:mtimeout]:[milliseconds?Timeout in milliseconds. If the value timeout is 0, "
"poll returns immediately. If the value of timeout is -1, poll "
"blocks until a requested event occurs or until the call is "
"interrupted.]"
@@ -1041,32 +1055,48 @@ void poll_eventstostr(char *s, int events)
if(*s=='|')
*s='\0';
}
+
+#undef getconf
+#define getconf(x) strtol(astconf(x,NiL,NiL),NiL,0)
extern int b_poll(int argc, char *argv[], void *extra)
{
register Namval_t *np;
register int n;
- Shell_t *shp = (Shell_t*)extra;
+ Shell_t *shp = sh_contexttoshell(extra);
char *varname;
int fd;
-/* |BPOLL_MAX| needs to be larger than |OPEN_MAX| to make sure we
- * can listen to different sets of events per fd.
- */
-#define BPOLL_MAX 512
- struct pollfd pollfd[BPOLL_MAX];
unsigned int numpollfd = 0;
int i;
char *s;
- long timeout = -1;
+ double timeout = -1.;
char buff[256];
-
+ char *pollfdcountvarname = NULL;
+ long open_max,
+ bpoll_max;
+
+ if ((open_max = getconf("OPEN_MAX")) <= 0)
+ open_max = OPEN_MAX;
+ /* |bpoll_max| needs to be larger than |OPEN_MAX| to make sure we
+ * can listen to different sets of events per fd.
+ */
+ bpoll_max = open_max*2L;
+
while (n = optget(argv, sh_optpoll)) switch (n)
{
case 't':
+ case 'T':
errno = 0;
- timeout = strtol(opt_info.arg, (char **)NULL, 0);
+ timeout = strtod(opt_info.arg, (char **)NULL);
if (errno != 0)
errormsg(SH_DICT, ERROR_system(1), "%s: invalid timeout", opt_info.arg);
+
+ /* -t uses seconds, -T milliseconds */
+ if (n == 't')
+ timeout *= 1000.;
+ break;
+ case 'c':
+ pollfdcountvarname = opt_info.arg;
break;
case ':':
errormsg(SH_DICT, 2, "%s", opt_info.arg);
@@ -1081,25 +1111,27 @@ extern int b_poll(int argc, char *argv[], void *extra)
errormsg(SH_DICT, ERROR_usage(2), optusage((char*)0));
varname = argv[0];
+
+ struct pollfd pollfd[bpoll_max];
- for(i=0 ; i < BPOLL_MAX ; i++)
+ for(i=0 ; i < bpoll_max ; i++)
{
- np = nv_open_fmt(shp->var_tree, NV_ARRAY|NV_VARNAME|NV_NOASSIGN|NV_NOFAIL|NV_NOADD, "%s[%d].fd", varname, i);
+ np = nv_open_fmt(shp->var_tree, NV_VARNAME|NV_NOFAIL|NV_NOADD, "%s[%d].fd", varname, i);
if (!np)
break;
fd = (int)nv_getnum(np);
if (fd < 0 || fd > OPEN_MAX)
- errormsg(SH_DICT, ERROR_system(1), "poll: invalid pollfd fd");
+ errormsg(SH_DICT, ERROR_system(1), "invalid pollfd fd");
nv_close(np);
pollfd[i].fd = fd;
- np = nv_open_fmt(shp->var_tree, NV_ARRAY|NV_VARNAME|NV_NOASSIGN|NV_NOFAIL|NV_NOADD, "%s[%d].events", varname, i);
- if (!s)
- errormsg(SH_DICT, ERROR_system(1), "poll: missing pollfd events");
+ np = nv_open_fmt(shp->var_tree, NV_VARNAME|NV_NOFAIL|NV_NOADD, "%s[%d].events", varname, i);
+ if (!np)
+ errormsg(SH_DICT, ERROR_system(1), "missing pollfd events");
s = nv_getval(np);
if (!s)
- errormsg(SH_DICT, ERROR_system(1), "poll: missing pollfd events value");
+ errormsg(SH_DICT, ERROR_system(1), "missing pollfd events value");
pollfd[i].events = poll_strtoevents(s);
nv_close(np);
@@ -1108,19 +1140,30 @@ extern int b_poll(int argc, char *argv[], void *extra)
numpollfd++;
}
- if (i == BPOLL_MAX)
- errormsg(SH_DICT, ERROR_system(1), "poll: cannot handle more than %d entries.", BPOLL_MAX);
+ if (i == bpoll_max)
+ errormsg(SH_DICT, ERROR_system(1), "cannot handle more than %d entries.", bpoll_max);
n = poll(pollfd, numpollfd, timeout);
/* FixMe: EGAIN and EINTR may require extra handling */
if (n < 0)
- errormsg(SH_DICT, ERROR_system(1), "poll: failure");
+ errormsg(SH_DICT, ERROR_system(1), "failure");
+
+ if (pollfdcountvarname)
+ {
+ int32_t v = n;
+
+ np = nv_open_fmt(shp->var_tree, NV_VARNAME|NV_NOFAIL, "%s", pollfdcountvarname);
+ if (!np)
+ errormsg(SH_DICT, ERROR_system(1), "couldn't create poll count variable %s", pollfdcountvarname);
+ nv_putval(np, (char *)&v, NV_INTEGER);
+ nv_close(np);
+ }
for(i=0 ; i < numpollfd ; i++)
{
- np = nv_open_fmt(shp->var_tree, NV_ARRAY|NV_VARNAME|NV_NOASSIGN|NV_NOFAIL, "%s[%d].revents", varname, i);
+ np = nv_open_fmt(shp->var_tree, NV_VARNAME|NV_NOFAIL, "%s[%d].revents", varname, i);
if (!np)
- errormsg(SH_DICT, ERROR_system(1), "poll: couldn't create pollfd %s[%d].revents", varname, i);
+ errormsg(SH_DICT, ERROR_system(1), "couldn't create pollfd %s[%d].revents", varname, i);
poll_eventstostr(buff, pollfd[i].revents);
@@ -1150,7 +1193,7 @@ static const char sh_optrewind[] =
extern int b_rewind(int argc, char *argv[], void *extra)
{
- Shell_t *shp = (Shell_t*)extra;
+ Shell_t *shp = sh_contexttoshell(extra);
int fd = -1;
register int n;
while (n = optget(argv, sh_optrewind)) switch (n)
@@ -1177,4 +1220,3 @@ extern int b_rewind(int argc, char *argv[], void *extra)
return(0);
}
-
diff --git a/usr/src/lib/libshell/common/bltins/shopen.c b/usr/src/lib/libshell/common/bltins/shopen.c
deleted file mode 100644
index 6a7a85a990..0000000000
--- a/usr/src/lib/libshell/common/bltins/shopen.c
+++ /dev/null
@@ -1,533 +0,0 @@
-/***********************************************************************
-* *
-* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
-* and is licensed under the *
-* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
-* *
-* A copy of the License is available at *
-* http://www.opensource.org/licenses/cpl1.0.txt *
-* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
-* *
-* Information and Software Systems Research *
-* AT&T Research *
-* Florham Park NJ *
-* *
-* David Korn <dgk@research.att.com> *
-* *
-***********************************************************************/
-#pragma prototyped
-
-static const char id[] = "\n@(#)$Id: open (AT&T Research) 1998-07-07 $\0\n";
-
-#include <shell.h>
-#include <option.h>
-#include <stk.h>
-#include <tm.h>
-#ifndef SH_DICT
-# define SH_DICT "libshell"
-#endif
-
-/*
- * time formatting related
-*/
-struct dctime
-{
- Namfun_t fun;
- Namval_t *format;
-};
-
-static char *get_time(Namval_t* np, Namfun_t* nfp)
-{
- static char buff[256];
- struct dctime *dp = (struct dctime*)nfp;
- time_t t = nv_getn(np,nfp);
- char *format = nv_getval(dp->format);
- tmfmt(buff,sizeof(buff),format,(time_t*)0);
- return(buff);
-}
-
-static void put_time(Namval_t* np, const char* val, int flag, Namfun_t* nfp)
-{
- struct dctime *dp = (struct dctime*)nfp;
- char *last;
- if(val)
- {
- int32_t t;
- if(flag&NV_INTEGER)
- {
- if(flag&NV_LONG)
- t = *(Sfdouble_t*)val;
- else
- t = *(double*)val;
- }
- else
- {
- t = tmdate(val, &last, (time_t*)0);
- if(*last)
- errormsg(SH_DICT,ERROR_exit(1),"%s: invalid date/time string",val);
- }
- nv_putv(np,(char*)&t,NV_INTEGER,nfp);
- }
- else
- {
- nv_unset(dp->format);
- free((void*)dp->format);
- nv_putv(np,val,flag,nfp);
- }
-}
-
-static Namval_t *create_time(Namval_t *np, const char *name, int flags, Namfun_t *nfp)
-{
- struct dctime *dp = (struct dctime*)nfp;
- if(strcmp(name,"format"))
- return((Namval_t*)0);
- return(dp->format);
-}
-
-static const Namdisc_t timedisc =
-{
- sizeof(struct dctime),
- put_time,
- get_time,
- 0,
- 0,
- create_time,
-};
-
-
-static Namval_t *make_time(Namval_t* np)
-{
- int offset = stktell(stkstd);
- char *name = nv_name(np);
- struct dctime *dp = newof(NULL,struct dctime,1,0);
- if(!dp)
- return((Namval_t*)0);
- sfprintf(stkstd,"%s.format\0",name);
- sfputc(stkstd,0);
- dp->format = nv_search(stkptr(stkstd,offset),sh.var_tree,NV_ADD);
- dp->fun.disc = &timedisc;
- nv_stack(np,&dp->fun);
- return(np);
-}
-
-/*
- * mode formatting related
-*/
-static char *get_mode(Namval_t* np, Namfun_t* nfp)
-{
- mode_t mode = nv_getn(np,nfp);
- return(fmtperm(mode));
-}
-
-static void put_mode(Namval_t* np, const char* val, int flag, Namfun_t* nfp)
-{
- if(val)
- {
- int32_t mode;
- char *last;
- if(flag&NV_INTEGER)
- {
- if(flag&NV_LONG)
- mode = *(Sfdouble_t*)val;
- else
- mode = *(double*)val;
- }
- else
- {
- mode = strperm(val, &last,0);
- if(*last)
- errormsg(SH_DICT,ERROR_exit(1),"%s: invalid mode string",val);
- }
- nv_putv(np,(char*)&mode,NV_INTEGER,nfp);
- }
- else
- nv_putv(np,val,flag,nfp);
-}
-
-static const Namdisc_t modedisc =
-{
- 0,
- put_mode,
- get_mode,
-};
-
-static Namval_t *make_mode(Namval_t* np)
-{
- char *name = nv_name(np);
- Namfun_t *nfp = newof(NULL,Namfun_t,1,0);
- if(!nfp)
- return((Namval_t*)0);
- nfp->disc = &modedisc;
- nv_stack(np,nfp);
- return(np);
-}
-
-/*
- * field related typese and functions
- */
-typedef struct _field_
-{
- char *name; /* field name */
- int flags; /* flags */
- short offset; /* offset of field into data */
- short size; /* size of field */
- Namval_t *(*make)(Namval_t*); /* discipline constructor */
-} Shfield_t;
-
-/*
- * lookup field in field table
- */
-static Shfield_t *sh_findfield(Shfield_t *ftable, int nelem, const char *name)
-{
- Shfield_t *fp = ftable;
- register int i,n;
- register const char *cp;
- for(cp=name; *cp; cp++)
- {
- if(*cp=='.')
- break;
- }
- n = cp-name;
- for(i=0; i < nelem; i++,fp++)
- {
- if(memcmp(fp->name,name,n)==0 && fp->name[n]==0)
- return(fp);
- }
- return(0);
-}
-
-/*
- * class types and functions
- */
-
-typedef struct _class_
-{
- int nelem; /* number of elements */
- int dsize; /* size for data structure */
- Shfield_t *fields; /* field description table */
-} Shclass_t;
-
-struct dcclass
-{
- Namfun_t fun;
- Shclass_t sclass;
-};
-
-static Namval_t *sh_newnode(register Shfield_t *fp, Namval_t *np)
-{
- char *val = np->nvalue + fp->offset;
- char *name = nv_name(np);
- register Namval_t *nq;
- int offset = stktell(stkstd);
- sfprintf(stkstd,"%s.%s\0",name,fp->name);
- sfputc(stkstd,0);
- nq = nv_search(stkptr(stkstd,offset),sh.var_tree,NV_ADD);
- if(fp->size<0)
- val = *(char**)val;
- nv_putval(nq,val,fp->flags|NV_NOFREE);
- if(fp->make)
- (*fp->make)(nq);
- return(nq);
-}
-
-static Namval_t *fieldcreate(Namval_t *np, const char *name, int flags, Namfun_t *nfp)
-{
- struct dcclass *dcp = (struct dcclass*)nfp;
- Shclass_t *sp = &dcp->sclass;
- Shfield_t *fp = sh_findfield(sp->fields,sp->nelem,name);
- Namval_t *nq,**nodes = (Namval_t**)(dcp+1);
- int n = fp-sp->fields;
- int len = strlen(fp->name);
- void *data = (void*)np->nvalue;
- if(!(nq=nodes[n]))
- {
- nodes[n] = nq = sh_newnode(fp,np);
- nfp->last = "";
- }
- if(name[len]==0)
- return(nq);
- return(nq);
-}
-
-static void genvalue(Sfio_t *out, Shclass_t *sp, int indent, Namval_t *npar)
-{
- Shfield_t *fp = sp->fields;
- Namval_t *np, **nodes= (Namval_t**)(sp+1);
- register int i,isarray;
- if(out)
- {
- sfwrite(out,"(\n",2);
- indent++;
- }
- for(i=0; i < sp->nelem; i++,fp++)
- {
-#if 0
- /* handle recursive case */
-#endif
- if(!(np=nodes[i]) && out)
- np = sh_newnode(fp,npar);
- if(np)
- {
- isarray=0;
- if(nv_isattr(np,NV_ARRAY))
- {
- isarray=1;
- if(array_elem(nv_arrayptr(np))==0)
- isarray=2;
- else
- nv_putsub(np,(char*)0,ARRAY_SCAN);
- }
- sfnputc(out,'\t',indent);
- sfputr(out,fp->name,(isarray==2?'\n':'='));
- if(isarray)
- {
- if(isarray==2)
- continue;
- sfwrite(out,"(\n",2);
- sfnputc(out,'\t',++indent);
- }
- while(1)
- {
- char *fmtq;
- if(isarray)
- {
- sfprintf(out,"[%s]",sh_fmtq(nv_getsub(np)));
- sfputc(out,'=');
- }
- if(!(fmtq=nv_getval(np)) || !(fmtq=sh_fmtq(fmtq)))
- fmtq = "";
- sfputr(out,fmtq,'\n');
- if(!nv_nextsub(np))
- break;
- sfnputc(out,'\t',indent);
- }
- if(isarray)
- {
- sfnputc(out,'\t',--indent);
- sfwrite(out,")\n",2);
- }
- }
- }
- if(out)
- {
- if(indent>1)
- sfnputc(out,'\t',indent-1);
- sfputc(out,')');
- }
-}
-
-static char *walk_class(register Namval_t *np, int dlete, struct dcclass *dcp)
-{
- static Sfio_t *out;
- Sfio_t *outfile;
- int savtop = stktell(stkstd);
- char *savptr = stkfreeze(stkstd,0);
- if(dlete)
- outfile = 0;
- else if(!(outfile=out))
- outfile = out = sfnew((Sfio_t*)0,(char*)0,-1,-1,SF_WRITE|SF_STRING);
- else
- sfseek(outfile,0L,SEEK_SET);
- genvalue(outfile,&dcp->sclass,0,np);
- stkset(stkstd,savptr,savtop);
- if(!outfile)
- return((char*)0);
- sfputc(out,0);
- return((char*)out->_data);
-}
-
-static char *get_classval(Namval_t* np, Namfun_t* nfp)
-{
- return(walk_class(np,0,(struct dcclass *)nfp));
-}
-
-static void put_classval(Namval_t* np, const char* val, int flag, Namfun_t* nfp)
-{
- walk_class(np,1,(struct dcclass *)nfp);
- if(nfp = nv_stack(np,(Namfun_t*)0))
- {
- free((void*)nfp);
- if(np->nvalue && !nv_isattr(np,NV_NOFREE))
- free((void*)np->nvalue);
- }
- if(val)
- nv_putval(np,val,flag);
-}
-
-static const Namdisc_t classdisc =
-{
- sizeof(struct dcclass),
- put_classval,
- get_classval,
- 0,
- 0,
- fieldcreate
-};
-
-static int mkclass(Namval_t *np, Shclass_t *sp)
-{
- struct dcclass *tcp = newof(NULL,struct dcclass,1,sp->nelem*sizeof(Namval_t*));
- if(!tcp)
- return(0);
- memset((void*)(tcp+1),0,sp->nelem*sizeof(Namval_t*));
- tcp->fun.disc = &classdisc;
- tcp->sclass = *sp;
- np->nvalue = (char*)calloc(sp->dsize,1);
- nv_stack(np,&tcp->fun);
- return(1);
-}
-
-/*
- * ====================from here down is file class specific
- */
-static struct stat *Sp;
-
-struct filedata
-{
- struct stat statb;
- int fd;
- char *name;
-};
-
-static Shfield_t filefield[] =
-{
- { "atime", NV_INTEGER|NV_RDONLY, offsetof(struct stat,st_atime), sizeof(Sp->st_atime), make_time},
- { "ctime", NV_INTEGER|NV_RDONLY, offsetof(struct stat,st_ctime), sizeof(Sp->st_ctime), make_time},
- { "dev", NV_INTEGER|NV_RDONLY, offsetof(struct stat,st_dev),sizeof(Sp->st_dev)},
- { "fd", NV_INTEGER|NV_RDONLY, offsetof(struct filedata,fd), sizeof(int)},
- { "gid", NV_INTEGER|NV_RDONLY, offsetof(struct stat,st_gid), sizeof(Sp->st_gid)},
- { "ino", NV_LONG|NV_INTEGER|NV_RDONLY, offsetof(struct stat,st_ino), sizeof(Sp->st_ino)},
- { "mode", NV_INTEGER|NV_RDONLY, offsetof(struct stat,st_mode), sizeof(Sp->st_mode), make_mode},
- { "mtime", NV_INTEGER|NV_RDONLY, offsetof(struct stat,st_mtime), sizeof(Sp->st_mtime), make_time},
- { "name", NV_RDONLY, offsetof(struct filedata,name), -1 },
- { "nlink", NV_INTEGER|NV_RDONLY, offsetof(struct stat,st_nlink), sizeof(Sp->st_nlink)},
- { "size", NV_LONG|NV_INTEGER|NV_RDONLY, offsetof(struct stat,st_size), sizeof(Sp->st_size)},
- { "uid", NV_INTEGER|NV_RDONLY, offsetof(struct stat,st_uid), sizeof(Sp->st_uid)}
-};
-
-static Shclass_t Fileclass =
-{
- sizeof(filefield)/sizeof(*filefield),
- sizeof(struct filedata),
- filefield
-};
-
-
-#define letterbit(bit) (1<<((bit)-'a'))
-
-static const char sh_optopen[] =
-"[-?\n@(#)$Id: open (AT&T Labs Research) 2007-03-11 $\n]"
-"[-author?David Korn <dgk@research.att.com>]"
-"[-license?http://www.opensource.org/licenses/cpl1.0.txt]"
-"[+NAME? open - create a shell variable correspnding to a file]"
-"[+DESCRIPTION?\bopen\b creates the compound variable \avar\a correspinding "
- "to the file given by the pathname \afile\a. The elements of \avar\a "
- "are the names of elements in the \astat\a structure with the \bst_\b "
- "prefix removed.]"
-"[+?If the \b-r\b and/or \b-w\b mode is specified, then \afile\a is opened and "
- "the variable \avar\a\b.fd\b is the file descriptor.]"
-"[a:append?Open for append.]"
-"[b:binary?Open in binary mode.]"
-"[c:create?Open for create.]"
-"[i:inherit?Open without the close-on-exec bit set.]"
-"[r:read?Open with read access.]"
-"[w:write?Open with write access.]"
-"[m:mode]:[mode:=rwrwrw?Open with access mode \amode\a.]"
-"[x:exclusive?Open exclusive.]"
-"\n"
-"\nvar file\n"
-"\n"
-"[+EXIT STATUS?]{"
- "[+0?Success.]"
- "[+>0?An error occurred.]"
-"}"
-"[+SEE ALSO?\bstat\b(2)]"
-;
-
-
-extern int b_open(int argc, char *argv[], void *extra)
-{
- register Namval_t *np;
- register int n,oflag=0;
- Shell_t *shp = (Shell_t*)extra;
- struct filedata *fdp;
- struct stat statb;
- mode_t mode = 0666;
- long flags = 0;
- int fd = -1;
- while (n = optget(argv, sh_optopen)) switch (n)
- {
- case 'r':
- case 'i':
- case 'w':
- flags |= letterbit(n);
- break;
- case 'b':
-#ifdef O_BINARY
- oflag |= O_BINARY;
-#endif
- break;
- case 't':
-#ifdef O_TEXT
- oflag |= O_TEXT;
-#endif
- break;
- case 'x':
- oflag |= O_EXCL;
- break;
- case 'c':
- oflag |= O_CREAT;
- break;
- case 'a':
- oflag |= O_APPEND;
- break;
- case 'm':
- break;
- case ':':
- errormsg(SH_DICT,2, "%s", opt_info.arg);
- break;
- case '?':
- errormsg(SH_DICT,ERROR_usage(2), "%s", opt_info.arg);
- break;
- }
- argc -= opt_info.index;
- argv += opt_info.index;
- if(argc!=2)
- errormsg(SH_DICT,ERROR_usage(2),optusage((char*)0));
- if(!(flags&(letterbit('r')|letterbit('w'))))
- {
- if(stat(argv[1],&statb)<0)
- errormsg(SH_DICT,ERROR_system(1),"%s: open failed",argv[1]);
- }
- else
- {
- if(flags&letterbit('r'))
- {
- if(flags&letterbit('w'))
- oflag |= O_RDWR;
- else
- oflag |= O_RDONLY;
- }
- else if(flags&letterbit('w'))
- oflag |= O_WRONLY;
- fd = open(argv[1],oflag,mode);
- if(fd<0)
- errormsg(SH_DICT,ERROR_system(1),"%s: open failed",argv[1]);
- }
- if(!(flags&letterbit('i')))
- fcntl(fd,F_SETFL,0);
- np = nv_open(argv[0],shp->var_tree,NV_ARRAY|NV_VARNAME|NV_NOASSIGN);
- if(!nv_isnull(np))
- nv_unset(np);
- mkclass(np,&Fileclass);
- fdp = (struct filedata*)np->nvalue;
- if(!(flags&(letterbit('r')|letterbit('w'))))
- fdp->statb = statb;
- else
- fstat(fd,&fdp->statb);
- fdp->fd = fd;
- fdp->name = strdup(argv[1]);
- return(0);
-}
diff --git a/usr/src/lib/libshell/common/bltins/sleep.c b/usr/src/lib/libshell/common/bltins/sleep.c
index 2f52ca651c..48af7fe807 100644
--- a/usr/src/lib/libshell/common/bltins/sleep.c
+++ b/usr/src/lib/libshell/common/bltins/sleep.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -23,7 +23,6 @@
*
* David Korn
* AT&T Labs
- * research!dgk
*
*/
@@ -46,8 +45,11 @@ int b_sleep(register int argc,char *argv[],void *extra)
{
register char *cp;
register double d;
- register Shell_t *shp = (Shell_t*)extra;
+ register Shell_t *shp = ((Shbltin_t*)extra)->shp;
time_t tloc = 0;
+ char *last;
+ if(!(shp->sigflag[SIGALRM]&(SH_SIGFAULT|SH_SIGOFF)))
+ sh_sigtrap(SIGALRM);
while((argc = optget(argv,sh_optsleep))) switch(argc)
{
case ':':
@@ -58,11 +60,10 @@ int b_sleep(register int argc,char *argv[],void *extra)
break;
}
argv += opt_info.index;
- if(error_info.errors || !(cp= *argv) || !(strmatch(cp,e_numeric)))
+ if(error_info.errors || !(cp= *argv) || ((d=strtod(cp, (char**)&last)),*last))
errormsg(SH_DICT,ERROR_usage(2),"%s",optusage((char*)0));
- if((d=strtod(cp, (char**)0)) > .10)
+ if(d > .10)
{
- sfsync(shp->outpool);
time(&tloc);
tloc += (time_t)(d+.5);
}
@@ -92,22 +93,23 @@ static void completed(void * handle)
unsigned int sleep(unsigned int sec)
{
+ Shell_t *shp = &sh;
pid_t newpid, curpid=getpid();
void *tp;
char expired = 0;
- sh.lastsig = 0;
+ shp->lastsig = 0;
tp = (void*)sh_timeradd(1000*sec, 0, completed, (void*)&expired);
do
{
- if(!sh.waitevent || (*sh.waitevent)(-1,-1L,0)==0)
+ if(!shp->waitevent || (*shp->waitevent)(-1,-1L,0)==0)
pause();
- if(sh.sigflag[SIGALRM]&SH_SIGTRAP)
+ if(shp->sigflag[SIGALRM]&SH_SIGTRAP)
sh_timetraps();
if((newpid=getpid()) != curpid)
{
curpid = newpid;
- sh.lastsig = 0;
- sh.trapnote &= ~SH_SIGSET;
+ shp->lastsig = 0;
+ shp->trapnote &= ~SH_SIGSET;
if(expired)
expired = 0;
else
@@ -115,7 +117,7 @@ unsigned int sleep(unsigned int sec)
tp = (void*)sh_timeradd(1000*sec, 0, completed, (void*)&expired);
}
}
- while(!expired && sh.lastsig==0);
+ while(!expired && shp->lastsig==0);
if(!expired)
timerdel(tp);
sh_sigcheck();
@@ -129,6 +131,7 @@ unsigned int sleep(unsigned int sec)
void sh_delay(double t)
{
register int n = (int)t;
+ Shell_t *shp = &sh;
#ifdef _lib_poll
struct pollfd fd;
if(t<=0)
@@ -140,7 +143,7 @@ void sh_delay(double t)
}
if(n=(int)(1000*t))
{
- if(!sh.waitevent || (*sh.waitevent)(-1,(long)n,0)==0)
+ if(!shp->waitevent || (*shp->waitevent)(-1,(long)n,0)==0)
poll(&fd,0,n);
}
#else
@@ -148,7 +151,7 @@ void sh_delay(double t)
struct timeval timeloc;
if(t<=0)
return;
- if(n=(int)(1000*t) && sh.waitevent && (*sh.waitevent)(-1,(long)n,0))
+ if(n=(int)(1000*t) && shp->waitevent && (*shp->waitevent)(-1,(long)n,0))
return;
n = (int)t;
timeloc.tv_sec = n;
@@ -166,7 +169,7 @@ void sh_delay(double t)
}
if(n=(int)(1000*t))
{
- if(!sh.waitevent || (*sh.waitevent)(-1,(long)n,0)==0)
+ if(!shp->waitevent || (*shp->waitevent)(-1,(long)n,0)==0)
select(0,(fd_set*)0,(fd_set*)0,n);
}
# else
@@ -180,7 +183,7 @@ void sh_delay(double t)
clock_t begin = times(&tt);
if(begin==0)
return;
- t *= sh.lim.clk_tck;
+ t *= shp->lim.clk_tck;
n += (t+.5);
while((times(&tt)-begin) < n);
}
diff --git a/usr/src/lib/libshell/common/bltins/test.c b/usr/src/lib/libshell/common/bltins/test.c
index f21db8a75c..644f54eb1c 100644
--- a/usr/src/lib/libshell/common/bltins/test.c
+++ b/usr/src/lib/libshell/common/bltins/test.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -113,7 +113,7 @@ int b_test(int argc, char *argv[],void *extra)
struct test tdata;
register char *cp = argv[0];
register int not;
- tdata.sh = (Shell_t*)extra;
+ tdata.sh = ((Shbltin_t*)extra)->shp;
tdata.av = argv;
tdata.ap = 1;
if(c_eq(cp,'['))
@@ -125,6 +125,15 @@ int b_test(int argc, char *argv[],void *extra)
if(argc <= 1)
return(1);
cp = argv[1];
+ if(c_eq(cp,'(') && argc<=6 && c_eq(argv[argc-1],')'))
+ {
+ /* special case ( binop ) to conform with standard */
+ if(!(argc==4 && (not=sh_lookup(cp=argv[2],shtab_testops))))
+ {
+ cp = (++argv)[1];
+ argc -= 2;
+ }
+ }
not = c_eq(cp,'!');
/* posix portion for test */
switch(argc)
@@ -173,8 +182,6 @@ int b_test(int argc, char *argv[],void *extra)
case 2:
return(*cp==0);
}
- if(argc==5)
- argv--;
tdata.ac = argc;
return(!expr(&tdata,0));
}
diff --git a/usr/src/lib/libshell/common/bltins/trap.c b/usr/src/lib/libshell/common/bltins/trap.c
index 7197144d5e..a298a35742 100644
--- a/usr/src/lib/libshell/common/bltins/trap.c
+++ b/usr/src/lib/libshell/common/bltins/trap.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -45,8 +45,8 @@ static void sig_list(Shell_t*,int);
int b_trap(int argc,char *argv[],void *extra)
{
register char *arg = argv[1];
- register int sig, pflag = 0;
- register Shell_t *shp = (Shell_t*)extra;
+ register int sig, clear = 0, dflag = 0, pflag = 0;
+ register Shell_t *shp = ((Shbltin_t*)extra)->shp;
NOT_USED(argc);
while (sig = optget(argv, sh_opttrap)) switch (sig)
{
@@ -66,9 +66,8 @@ int b_trap(int argc,char *argv[],void *extra)
errormsg(SH_DICT,ERROR_usage(2),"%s", optusage((char*)0));
if(arg = *argv)
{
- register int clear;
char *action = arg;
- if(!pflag)
+ if(!dflag && !pflag)
{
/* first argument all digits or - means clear */
while(isdigit(*arg))
@@ -79,8 +78,18 @@ int b_trap(int argc,char *argv[],void *extra)
++argv;
if(*action=='-' && action[1]==0)
clear++;
+ /*
+ * NOTE: 2007-11-26: workaround for tests/signal.sh
+ * if function semantics can be worked out then it
+ * may merit a -d,--default option
+ */
+ else if(*action=='+' && action[1]==0 && sh.st.self == &sh.global)
+ {
+ clear++;
+ dflag++;
+ }
}
- while(!argv[0])
+ if(!argv[0])
errormsg(SH_DICT,ERROR_exit(1),e_condition);
}
while(arg = *argv++)
@@ -132,7 +141,11 @@ int b_trap(int argc,char *argv[],void *extra)
sfputr(sfstdout,arg,'\n');
}
else if(clear)
+ {
sh_sigclear(sig);
+ if(dflag)
+ signal(sig,SIG_DFL);
+ }
else
{
if(sig >= shp->st.trapmax)
@@ -153,7 +166,7 @@ int b_kill(int argc,char *argv[],void *extra)
{
register char *signame;
register int sig=SIGTERM, flag=0, n;
- register Shell_t *shp = (Shell_t*)extra;
+ register Shell_t *shp = ((Shbltin_t*)extra)->shp;
NOT_USED(argc);
while((n = optget(argv,sh_optkill))) switch(n)
{
@@ -222,8 +235,8 @@ endopts:
static int sig_number(const char *string)
{
const Shtable_t *tp;
- register int n,sig=0;
- char *last;
+ register int n,o,sig=0;
+ char *last, *name;
if(isdigit(*string))
{
n = strtol(string,&last,10);
@@ -233,7 +246,7 @@ static int sig_number(const char *string)
else
{
register int c;
- n = staktell();
+ o = staktell();
do
{
c = *string++;
@@ -242,30 +255,92 @@ static int sig_number(const char *string)
stakputc(c);
}
while(c);
- stakseek(n);
- if(memcmp(stakptr(n),"SIG",3)==0)
+ stakseek(o);
+ if(memcmp(stakptr(o),"SIG",3)==0)
{
sig = 1;
- n += 3;
+ o += 3;
}
- tp = sh_locate(stakptr(n),(const Shtable_t*)shtab_signals,sizeof(*shtab_signals));
+ tp = sh_locate(stakptr(o),(const Shtable_t*)shtab_signals,sizeof(*shtab_signals));
n = tp->sh_number;
if(sig==1 && (n>=(SH_TRAP-1) && n < (1<<SH_SIGBITS)))
{
/* sig prefix cannot match internal traps */
n = 0;
tp = (Shtable_t*)((char*)tp + sizeof(*shtab_signals));
- if(strcmp(stakptr(n),tp->sh_name)==0)
+ if(strcmp(stakptr(o),tp->sh_name)==0)
n = tp->sh_number;
}
- n &= (1<<SH_SIGBITS)-1;
- if(n < SH_TRAP)
- n--;
+ if((n>>SH_SIGBITS)&SH_SIGRUNTIME)
+ n = sh.sigruntime[(n&((1<<SH_SIGBITS)-1))-1];
+ else
+ {
+ n &= (1<<SH_SIGBITS)-1;
+ if(n < SH_TRAP)
+ n--;
+ }
+ if(n<0 && (name=stakptr(o)) && *name++=='R' && *name++=='T')
+ {
+ if(name[0]=='M' && name[1]=='I' && name[2]=='N' && name[3]=='+')
+ {
+ if((sig=(int)strtol(name+4,&name,10)) >= 0 && !*name)
+ n = sh.sigruntime[SH_SIGRTMIN] + sig;
+ }
+ else if(name[0]=='M' && name[1]=='A' && name[2]=='X' && name[3]=='-')
+ {
+ if((sig=(int)strtol(name+4,&name,10)) >= 0 && !*name)
+ n = sh.sigruntime[SH_SIGRTMAX] - sig;
+ }
+ else if((sig=(int)strtol(name,&name,10)) > 0 && !*name)
+ n = sh.sigruntime[SH_SIGRTMIN] + sig - 1;
+ if(n<sh.sigruntime[SH_SIGRTMIN] || n>sh.sigruntime[SH_SIGRTMAX])
+ n = -1;
+ }
}
return(n);
}
/*
+ * synthesize signal name for sig in buf
+ * pfx!=0 prepends SIG to default signal number
+ */
+static char* sig_name(int sig, char* buf, int pfx)
+{
+ register int i;
+
+ i = 0;
+ if(sig>sh.sigruntime[SH_SIGRTMIN] && sig<sh.sigruntime[SH_SIGRTMAX])
+ {
+ buf[i++] = 'R';
+ buf[i++] = 'T';
+ buf[i++] = 'M';
+ if(sig>sh.sigruntime[SH_SIGRTMIN]+(sh.sigruntime[SH_SIGRTMAX]-sh.sigruntime[SH_SIGRTMIN])/2)
+ {
+ buf[i++] = 'A';
+ buf[i++] = 'X';
+ buf[i++] = '-';
+ sig = sh.sigruntime[SH_SIGRTMAX]-sig;
+ }
+ else
+ {
+ buf[i++] = 'I';
+ buf[i++] = 'N';
+ buf[i++] = '+';
+ sig = sig-sh.sigruntime[SH_SIGRTMIN];
+ }
+ }
+ else if(pfx)
+ {
+ buf[i++] = 'S';
+ buf[i++] = 'I';
+ buf[i++] = 'G';
+ }
+ i += sfsprintf(buf+i, 8, "%d", sig);
+ buf[i] = 0;
+ return buf;
+}
+
+/*
* if <flag> is positive, then print signal name corresponding to <flag>
* if <flag> is zero, then print all signal names
* if <flag> is negative, then print all traps
@@ -274,10 +349,12 @@ static void sig_list(register Shell_t *shp,register int flag)
{
register const struct shtable2 *tp;
register int sig = shp->sigmax+1;
+ register char *sname;
+ char name[10];
const char *names[SH_TRAP];
const char *traps[SH_DEBUGTRAP+1];
tp=shtab_signals;
- if(flag==0)
+ if(flag<=0)
{
/* not all signals may be defined, so initialize */
while(--sig >= 0)
@@ -287,8 +364,9 @@ static void sig_list(register Shell_t *shp,register int flag)
}
while(*tp->sh_name)
{
- sig = tp->sh_number;
- sig &= ((1<<SH_SIGBITS)-1);
+ sig = tp->sh_number&((1<<SH_SIGBITS)-1);
+ if ((tp->sh_number>>SH_SIGBITS) & SH_SIGRUNTIME)
+ sig = sh.sigruntime[sig-1]+1;
if(sig==flag)
{
sfprintf(sfstdout,"%s\n",tp->sh_name);
@@ -301,12 +379,11 @@ static void sig_list(register Shell_t *shp,register int flag)
tp++;
}
if(flag > 0)
- sfprintf(sfstdout,"%d\n",flag-1);
+ sfputr(sfstdout, sig_name(flag-1,name,0), '\n');
else if(flag<0)
{
/* print the traps */
- register char *trap,*sname,**trapcom;
- char name[6];
+ register char *trap,**trapcom;
sig = shp->st.trapmax;
/* use parent traps if otrapcom is set (for $(trap) */
trapcom = (shp->st.otrapcom?shp->st.otrapcom:shp->st.trapcom);
@@ -315,14 +392,7 @@ static void sig_list(register Shell_t *shp,register int flag)
if(!(trap=trapcom[sig]))
continue;
if(!(sname=(char*)names[sig+1]))
- {
- sname = name;
- sname[0] = 'S';
- sname[1] = 'I';
- sname[2] = 'G';
- sname[3] = (sig/10)+'0';
- sname[4] = (sig%10)+'0';
- }
+ sname = sig_name(sig,name,1);
sfprintf(sfstdout,trapfmt,sh_fmtq(trap),sname);
}
for(sig=SH_DEBUGTRAP; sig>=0; sig--)
@@ -337,11 +407,9 @@ static void sig_list(register Shell_t *shp,register int flag)
/* print all the signal names */
for(sig=2; sig <= shp->sigmax; sig++)
{
- if(names[sig])
- sfputr(sfstdout,names[sig],'\n');
- else
- sfprintf(sfstdout,"SIG%d\n",sig-1);
+ if(!(sname=(char*)names[sig+1]))
+ sname = sig_name(sig,name,1);
+ sfputr(sfstdout,sname,'\n');
}
}
}
-
diff --git a/usr/src/lib/libshell/common/bltins/typeset.c b/usr/src/lib/libshell/common/bltins/typeset.c
index 14b02a6ad3..734651fd3a 100644
--- a/usr/src/lib/libshell/common/bltins/typeset.c
+++ b/usr/src/lib/libshell/common/bltins/typeset.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -40,7 +40,7 @@
#include "history.h"
#include "builtins.h"
#include "variables.h"
-#include <dlldefs.h>
+#include "FEATURE/dynamic"
struct tdata
{
@@ -48,7 +48,10 @@ struct tdata
Namval_t *tp;
Sfio_t *outfile;
char *prefix;
- int aflag;
+ char *tname;
+ char *help;
+ short aflag;
+ short pflag;
int argnum;
int scanmask;
Dt_t *scanroot;
@@ -59,7 +62,7 @@ struct tdata
static int print_namval(Sfio_t*, Namval_t*, int, struct tdata*);
static void print_attribute(Namval_t*,void*);
static void print_all(Sfio_t*, Dt_t*, struct tdata*);
-static void print_scan(Sfio_t*, int, Dt_t*, int, struct tdata*t);
+static void print_scan(Sfio_t*, int, Dt_t*, int, struct tdata*);
static int b_unall(int, char**, Dt_t*, Shell_t*);
static int b_common(char**, int, Dt_t*, struct tdata*);
static void pushname(Namval_t*,void*);
@@ -85,7 +88,7 @@ int b_readonly(int argc,char *argv[],void *extra)
struct tdata tdata;
NOT_USED(argc);
memset((void*)&tdata,0,sizeof(tdata));
- tdata.sh = (Shell_t*)extra;
+ tdata.sh = ((Shbltin_t*)extra)->shp;
tdata.aflag = '-';
while((flag = optget(argv,*command=='e'?sh_optexport:sh_optreadonly))) switch(flag)
{
@@ -120,8 +123,8 @@ int b_readonly(int argc,char *argv[],void *extra)
else
{
flag = (NV_ASSIGN|NV_EXPORT|NV_IDENT);
- if(!sh.prefix)
- sh.prefix = "";
+ if(!tdata.sh->prefix)
+ tdata.sh->prefix = "";
}
return(b_common(argv,flag,tdata.sh->var_tree, &tdata));
}
@@ -135,7 +138,7 @@ int b_alias(int argc,register char *argv[],void *extra)
struct tdata tdata;
NOT_USED(argc);
memset((void*)&tdata,0,sizeof(tdata));
- tdata.sh = (Shell_t*)extra;
+ tdata.sh = ((Shbltin_t*)extra)->shp;
troot = tdata.sh->alias_tree;
if(*argv[0]=='h')
flag = NV_TAGGED;
@@ -169,11 +172,23 @@ int b_alias(int argc,register char *argv[],void *extra)
argv += (opt_info.index-1);
if(flag&NV_TAGGED)
{
- if(argv[1] && strcmp(argv[1],"-r")==0)
+ /* hacks to handle hash -r | -- */
+ if(argv[1] && argv[1][0]=='-')
{
- /* hack to handle hash -r */
- nv_putval(PATHNOD,nv_getval(PATHNOD),NV_RDONLY);
- return(0);
+ if(argv[1][1]=='r' && argv[1][2]==0)
+ {
+ nv_putval(PATHNOD,nv_getval(PATHNOD),NV_RDONLY);
+ argv++;
+ if(!argv[1])
+ return(0);
+ }
+ if(argv[1][0]=='-')
+ {
+ if(argv[1][1]=='-' && argv[1][2]==0)
+ argv++;
+ else
+ errormsg(SH_DICT, ERROR_exit(1), e_option, argv[1]);
+ }
}
troot = tdata.sh->track_tree;
}
@@ -188,28 +203,41 @@ int b_alias(int argc,register char *argv[],void *extra)
#endif
int b_typeset(int argc,register char *argv[],void *extra)
{
- register int flag = NV_VARNAME|NV_ASSIGN;
- register int n;
- struct tdata tdata;
- Namtype_t *ntp = (Namtype_t*)extra;
- Dt_t *troot;
- int isfloat=0, shortint=0;
+ register int n, flag = NV_VARNAME|NV_ASSIGN;
+ struct tdata tdata;
+ const char *optstring = sh_opttypeset;
+ Namdecl_t *ntp = (Namdecl_t*)((Shbltin_t*)extra)->ptr;
+ Dt_t *troot;
+ int isfloat=0, shortint=0, sflag=0;
NOT_USED(argc);
memset((void*)&tdata,0,sizeof(tdata));
- tdata.sh = ntp->shp;
- tdata.tp = ntp->np;
+ tdata.sh = ((Shbltin_t*)extra)->shp;
+ if(ntp)
+ {
+ tdata.tp = ntp->tp;
+ opt_info.disc = (Optdisc_t*)ntp->optinfof;
+ optstring = ntp->optstring;
+ }
troot = tdata.sh->var_tree;
- opt_info.disc = (Optdisc_t*)ntp->optinfof;
- while((n = optget(argv,ntp->optstring)))
+ while((n = optget(argv,optstring)))
{
switch(n)
{
case 'a':
flag |= NV_IARRAY;
+ if(opt_info.arg && *opt_info.arg!='[')
+ {
+ opt_info.index--;
+ goto endargs;
+ }
+ tdata.tname = opt_info.arg;
break;
case 'A':
flag |= NV_ARRAY;
break;
+ case 'C':
+ flag |= NV_COMVAR;
+ break;
case 'E':
/* The following is for ksh88 compatibility */
if(opt_info.offset && !strchr(argv[opt_info.index],'E'))
@@ -218,15 +246,27 @@ int b_typeset(int argc,register char *argv[],void *extra)
break;
}
case 'F':
+ case 'X':
if(!opt_info.arg || (tdata.argnum = opt_info.num) <0)
tdata.argnum = 10;
isfloat = 1;
if(n=='E')
+ {
+ flag &= ~NV_HEXFLOAT;
flag |= NV_EXPNOTE;
+ }
+ else if(n=='X')
+ {
+ flag &= ~NV_EXPNOTE;
+ flag |= NV_HEXFLOAT;
+ }
break;
case 'b':
flag |= NV_BINARY;
break;
+ case 'm':
+ flag |= NV_MOVE;
+ break;
case 'n':
flag &= ~NV_VARNAME;
flag |= (NV_REF|NV_IDENT);
@@ -238,24 +278,18 @@ int b_typeset(int argc,register char *argv[],void *extra)
flag |= NV_TYPE;
tdata.prefix = opt_info.arg;
break;
- case 'L':
- if(tdata.argnum==0)
- tdata.argnum = (int)opt_info.num;
- if(tdata.argnum < 0)
- errormsg(SH_DICT,ERROR_exit(1), e_badfield, tdata.argnum);
- flag &= ~NV_RJUST;
- flag |= NV_LJUST;
- break;
- case 'Z':
- flag |= NV_ZFILL;
- /* FALL THRU*/
- case 'R':
+ case 'L': case 'Z': case 'R':
if(tdata.argnum==0)
tdata.argnum = (int)opt_info.num;
if(tdata.argnum < 0)
errormsg(SH_DICT,ERROR_exit(1), e_badfield, tdata.argnum);
- flag &= ~NV_LJUST;
- flag |= NV_RJUST;
+ if(n=='Z')
+ flag |= NV_ZFILL;
+ else
+ {
+ flag &= ~(NV_LJUST|NV_RJUST);
+ flag |= (n=='L'?NV_LJUST:NV_RJUST);
+ }
break;
case 'f':
flag &= ~(NV_VARNAME|NV_ASSIGN);
@@ -271,10 +305,19 @@ int b_typeset(int argc,register char *argv[],void *extra)
break;
case 'p':
tdata.prefix = argv[0];
- continue;
+ tdata.pflag = 1;
+ break;
case 'r':
flag |= NV_RDONLY;
break;
+#ifdef SHOPT_TYPEDEF
+ case 'S':
+ sflag=1;
+ break;
+ case 'h':
+ tdata.help = opt_info.arg;
+ break;
+#endif /*SHOPT_TYPEDEF*/
case 's':
shortint=1;
break;
@@ -299,6 +342,7 @@ int b_typeset(int argc,register char *argv[],void *extra)
if(tdata.aflag==0)
tdata.aflag = *opt_info.option;
}
+endargs:
argv += opt_info.index;
opt_info.disc = 0;
/* handle argument of + and - specially */
@@ -306,51 +350,95 @@ int b_typeset(int argc,register char *argv[],void *extra)
tdata.aflag = *argv[0];
else
argv--;
+ if((flag&NV_ZFILL) && !(flag&NV_LJUST))
+ flag |= NV_RJUST;
if((flag&NV_INTEGER) && (flag&(NV_LJUST|NV_RJUST|NV_ZFILL)))
error_info.errors++;
if((flag&NV_BINARY) && (flag&(NV_LJUST|NV_UTOL|NV_LTOU)))
error_info.errors++;
+ if((flag&NV_MOVE) && (flag&~(NV_MOVE|NV_VARNAME|NV_ASSIGN)))
+ error_info.errors++;
+ if((flag&NV_REF) && (flag&~(NV_REF|NV_IDENT|NV_ASSIGN)))
+ error_info.errors++;
if(troot==tdata.sh->fun_tree && ((isfloat || flag&~(NV_FUNCT|NV_TAGGED|NV_EXPORT|NV_LTOU))))
error_info.errors++;
if(error_info.errors)
errormsg(SH_DICT,ERROR_usage(2),"%s", optusage(NIL(char*)));
if(isfloat)
- flag |= NV_INTEGER|NV_DOUBLE;
+ flag |= NV_DOUBLE;
if(shortint)
flag |= NV_SHORT|NV_INTEGER;
- if(tdata.sh->fn_depth)
+ if(sflag)
+ {
+ if(tdata.sh->mktype)
+ flag |= NV_REF|NV_TAGGED;
+ else if(!tdata.sh->typeinit)
+ flag |= NV_STATIC|NV_IDENT;
+ }
+ if(tdata.sh->fn_depth && !tdata.pflag)
flag |= NV_NOSCOPE;
if(flag&NV_TYPE)
{
- int offset = staktell();
- stakputs(NV_CLASS);
+ Stk_t *stkp = tdata.sh->stk;
+ int offset = stktell(stkp);
+ sfputr(stkp,NV_CLASS,-1);
if(NV_CLASS[sizeof(NV_CLASS)-2]!='.')
- stakputc('.');
- stakputs(tdata.prefix);
- stakputc(0);
- tdata.tp = nv_open(stakptr(offset),tdata.sh->var_tree,NV_VARNAME|NV_NOARRAY|NV_NOASSIGN);
- stakseek(offset);
+ sfputc(stkp,'.');
+ sfputr(stkp,tdata.prefix,0);
+ tdata.tp = nv_open(stkptr(stkp,offset),tdata.sh->var_tree,NV_VARNAME|NV_NOARRAY|NV_NOASSIGN);
+ stkseek(stkp,offset);
if(!tdata.tp)
errormsg(SH_DICT,ERROR_exit(1),"%s: unknown type",tdata.prefix);
+ tdata.tp->nvenv = tdata.help;
flag &= ~NV_TYPE;
}
- else if(tdata.aflag==0 && ntp->np)
+ else if(tdata.aflag==0 && ntp && ntp->tp)
tdata.aflag = '-';
+ if(!tdata.sh->mktype)
+ tdata.help = 0;
return(b_common(argv,flag,troot,&tdata));
}
+static void print_value(Sfio_t *iop, Namval_t *np, struct tdata *tp)
+{
+ char *name;
+ if(nv_isnull(np))
+ return;
+ sfputr(iop,nv_name(np),tp->aflag=='+'?'\n':'=');
+ if(tp->aflag=='+')
+ return;
+ if(nv_isarray(np) && nv_arrayptr(np))
+ {
+ nv_outnode(np,iop,-1,0);
+ sfwrite(iop,")\n",2);
+ }
+ else
+ {
+ if(nv_isvtree(np))
+ nv_onattr(np,NV_EXPORT);
+ if(!(name = nv_getval(np)))
+ name = Empty;
+ if(!nv_isvtree(np))
+ name = sh_fmtq(name);
+ sfputr(iop,name,'\n');
+ }
+}
+
static int b_common(char **argv,register int flag,Dt_t *troot,struct tdata *tp)
{
register char *name;
char *last = 0;
- int nvflags=(flag&(NV_ARRAY|NV_NOARRAY|NV_VARNAME|NV_IDENT|NV_ASSIGN));
- int r=0, ref=0;
+ int nvflags=(flag&(NV_ARRAY|NV_NOARRAY|NV_VARNAME|NV_IDENT|NV_ASSIGN|NV_STATIC|NV_MOVE));
+ int r=0, ref=0, comvar=(flag&NV_COMVAR),iarray=(flag&NV_IARRAY);
Shell_t *shp =tp->sh;
- if(!sh.prefix)
- nvflags |= NV_NOSCOPE;
- else if(*sh.prefix==0)
- sh.prefix = 0;
- flag &= ~(NV_NOARRAY|NV_NOSCOPE|NV_VARNAME|NV_IDENT);
+ if(!shp->prefix)
+ {
+ if(!tp->pflag)
+ nvflags |= NV_NOSCOPE;
+ }
+ else if(*shp->prefix==0)
+ shp->prefix = 0;
+ flag &= ~(NV_NOARRAY|NV_NOSCOPE|NV_VARNAME|NV_IDENT|NV_STATIC|NV_COMVAR|NV_IARRAY);
if(argv[1])
{
if(flag&NV_REF)
@@ -360,6 +448,8 @@ static int b_common(char **argv,register int flag,Dt_t *troot,struct tdata *
if(tp->aflag!='-')
nvflags |= NV_NOREF;
}
+ if(tp->pflag)
+ nvflags |= NV_NOREF;
while(name = *++argv)
{
register unsigned newflag;
@@ -377,10 +467,10 @@ static int b_common(char **argv,register int flag,Dt_t *troot,struct tdata *
/* Function names cannot be special builtin */
if((np=nv_search(name,shp->bltin_tree,0)) && nv_isattr(np,BLT_SPC))
errormsg(SH_DICT,ERROR_exit(1),e_badfun,name);
- np = nv_open(name,shp->fun_tree,NV_NOARRAY|NV_IDENT|NV_NOSCOPE);
+ np = nv_open(name,sh_subfuntree(1),NV_NOARRAY|NV_IDENT|NV_NOSCOPE);
}
- else
- np = nv_search(name,shp->fun_tree,HASH_NOSCOPE);
+ else if((np=nv_search(name,troot,0)) && !is_afunction(np))
+ np = 0;
if(np && ((flag&NV_LTOU) || !nv_isnull(np) || nv_isattr(np,NV_LTOU)))
{
if(flag==0)
@@ -397,18 +487,29 @@ static int b_common(char **argv,register int flag,Dt_t *troot,struct tdata *
}
else
r++;
+ if(tp->help)
+ {
+ int offset = stktell(shp->stk);
+ sfputr(shp->stk,shp->prefix,'.');
+ sfputr(shp->stk,name,0);
+ if((np=nv_search(stkptr(shp->stk,offset),troot,0)) && np->nvalue.cp)
+ np->nvalue.rp->help = tp->help;
+ stkseek(shp->stk,offset);
+ }
continue;
}
- np = nv_open(name,troot,nvflags);
/* tracked alias */
if(troot==shp->track_tree && tp->aflag=='-')
{
-#ifdef PATH_BFPATH
+ np = nv_search(name,troot,NV_ADD);
path_alias(np,path_absolute(nv_name(np),NIL(Pathcomp_t*)));
-#else
- nv_onattr(np,NV_NOALIAS);
- path_alias(np,path_absolute(nv_name(np),NIL(char*)));
-#endif
+ continue;
+ }
+ np = nv_open(name,troot,nvflags|NV_ARRAY);
+ if(tp->pflag)
+ {
+ nv_attribute(np,sfstdout,tp->prefix,1);
+ print_value(sfstdout,np,tp);
continue;
}
if(flag==NV_ASSIGN && !ref && tp->aflag!='-' && !strchr(name,'='))
@@ -418,6 +519,38 @@ static int b_common(char **argv,register int flag,Dt_t *troot,struct tdata *
sfprintf(sfstderr,sh_translate(e_noalias),name);
r++;
}
+ if(!comvar && !iarray)
+ continue;
+ }
+ if(troot==shp->var_tree && ((tp->tp && !nv_isarray(np)) || !shp->st.real_fun && (nvflags&NV_STATIC)) && !strchr(name,'=') && !(shp->envlist && nv_onlist(shp->envlist,name)))
+ _nv_unset(np,0);
+ if(troot==shp->var_tree)
+ {
+ if(iarray)
+ {
+ if(tp->tname)
+ nv_atypeindex(np,tp->tname+1);
+ else if(nv_isnull(np))
+ nv_onattr(np,NV_ARRAY|(comvar?NV_NOFREE:0));
+ else
+ nv_putsub(np, (char*)0, 0);
+ }
+ else if(nvflags&NV_ARRAY)
+ {
+ if(comvar)
+ {
+ _nv_unset(np,NV_RDONLY);
+ nv_onattr(np,NV_NOFREE);
+ }
+ nv_setarray(np,nv_associative);
+ }
+ else if(comvar && !nv_rename(np,flag|NV_COMVAR))
+ nv_setvtree(np);
+ }
+ if(flag&NV_MOVE)
+ {
+ nv_rename(np, flag);
+ nv_close(np);
continue;
}
if(tp->tp)
@@ -425,16 +558,6 @@ static int b_common(char **argv,register int flag,Dt_t *troot,struct tdata *
nv_settype(np,tp->tp,tp->aflag=='-'?0:NV_APPEND);
flag = (np->nvflag&NV_NOCHANGE);
}
- if(troot==shp->var_tree && (flag&NV_IARRAY))
- {
- flag &= ~NV_IARRAY;
- if(nv_isnull(np))
- nv_onattr(np,NV_ARRAY);
- else
- nv_putsub(np, (char*)0, 0);
- }
- if(troot==shp->var_tree && (nvflags&NV_ARRAY))
- nv_setarray(np,nv_associative);
curflag = np->nvflag;
flag &= ~NV_ASSIGN;
if(last=strchr(name,'='))
@@ -459,10 +582,13 @@ static int b_common(char **argv,register int flag,Dt_t *troot,struct tdata *
else if(!(flag&NV_LJUST))
newflag &= ~NV_LJUST;
}
- if (flag & NV_UTOL)
- newflag &= ~NV_LTOU;
- else if (flag & NV_LTOU)
- newflag &= ~NV_UTOL;
+ if(!(flag&NV_INTEGER))
+ {
+ if (flag & NV_UTOL)
+ newflag &= ~NV_LTOU;
+ else if (flag & NV_LTOU)
+ newflag &= ~NV_UTOL;
+ }
}
else
{
@@ -479,6 +605,7 @@ static int b_common(char **argv,register int flag,Dt_t *troot,struct tdata *
else
{
char *oldname=0;
+ int len=strlen(name);
if(tp->argnum==1 && newflag==NV_INTEGER && nv_isattr(np,NV_INTEGER))
tp->argnum = 10;
/* use reference name for export */
@@ -487,11 +614,18 @@ static int b_common(char **argv,register int flag,Dt_t *troot,struct tdata *
oldname = np->nvname;
np->nvname = name;
}
+ if(np->nvfun && !nv_isarray(np) && name[len-1]=='.')
+ newflag |= NV_NODISC;
nv_newattr (np, newflag&~NV_ASSIGN,tp->argnum);
if(oldname)
np->nvname = oldname;
}
}
+ if(tp->help && !nv_isattr(np,NV_MINIMAL|NV_EXPORT))
+ {
+ np->nvenv = tp->help;
+ nv_onattr(np,NV_EXPORT);
+ }
if(last)
*last = '=';
/* set or unset references */
@@ -505,7 +639,10 @@ static int b_common(char **argv,register int flag,Dt_t *troot,struct tdata *
if(!(hp=(Dt_t*)shp->st.prevst->save_tree))
hp = dtvnext(shp->var_tree);
}
- nv_setref(np,hp,NV_VARNAME);
+ if(tp->sh->mktype)
+ nv_onattr(np,NV_REF|NV_FUNCT);
+ else
+ nv_setref(np,hp,NV_VARNAME);
}
else
nv_unref(np);
@@ -513,8 +650,10 @@ static int b_common(char **argv,register int flag,Dt_t *troot,struct tdata *
nv_close(np);
}
}
- else if(!sh.envlist)
+ else if(!tp->sh->envlist)
{
+ if(shp->prefix)
+ errormsg(SH_DICT,2, "%s: compound assignment requires sub-variable name",shp->prefix);
if(tp->aflag)
{
if(troot==shp->fun_tree)
@@ -523,7 +662,11 @@ static int b_common(char **argv,register int flag,Dt_t *troot,struct tdata *
tp->prefix = 0;
}
else if(troot==shp->var_tree)
+ {
flag |= (nvflags&NV_ARRAY);
+ if(flag&NV_IARRAY)
+ flag |= NV_ARRAY;
+ }
print_scan(sfstdout,flag,troot,tp->aflag=='+',tp);
}
else if(troot==shp->alias_tree)
@@ -535,14 +678,15 @@ static int b_common(char **argv,register int flag,Dt_t *troot,struct tdata *
return(r);
}
-typedef void (*Iptr_t)(int);
+typedef void (*Iptr_t)(int,void*);
typedef int (*Fptr_t)(int, char*[], void*);
#define GROWLIB 4
-static void** liblist;
-static int nlib;
-static int maxlib;
+static void **liblist;
+static unsigned short *libattr;
+static int nlib;
+static int maxlib;
/*
* This allows external routines to load from the same library */
@@ -557,35 +701,54 @@ void **sh_getliblist(void)
* always move to head of search list
* return: 0: already loaded 1: first load
*/
+#if SHOPT_DYNAMIC
int sh_addlib(void* library)
{
register int n;
register int r;
Iptr_t initfn;
+ Shbltin_t *sp = &sh.bltindata;
+ sp->nosfio = 0;
for (n = r = 0; n < nlib; n++)
{
if (r)
+ {
liblist[n-1] = liblist[n];
+ libattr[n-1] = libattr[n];
+ }
else if (liblist[n] == library)
r++;
}
if (r)
nlib--;
else if ((initfn = (Iptr_t)dlllook(library, "lib_init")))
- (*initfn)(0);
+ (*initfn)(0,sp);
if (nlib >= maxlib)
{
maxlib += GROWLIB;
if (liblist)
+ {
liblist = (void**)realloc((void*)liblist, (maxlib+1)*sizeof(void**));
+ libattr = (unsigned short*)realloc((void*)liblist, (maxlib+1)*sizeof(unsigned short*));
+ }
else
+ {
liblist = (void**)malloc((maxlib+1)*sizeof(void**));
+ libattr = (unsigned short*)malloc((maxlib+1)*sizeof(unsigned short*));
+ }
}
+ libattr[nlib] = (sp->nosfio?BLT_NOSFIO:0);
liblist[nlib++] = library;
liblist[nlib] = 0;
return !r;
}
+#else
+int sh_addlib(void* library)
+{
+ return 0;
+}
+#endif /* SHOPT_DYNAMIC */
/*
* add change or list built-ins
@@ -599,10 +762,13 @@ int b_builtin(int argc,char *argv[],void *extra)
long dlete=0;
struct tdata tdata;
Fptr_t addr;
+ Stk_t *stkp;
void *library=0;
char *errmsg;
NOT_USED(argc);
- tdata.sh = (Shell_t*)extra;
+ memset(&tdata,0,sizeof(tdata));
+ tdata.sh = ((Shbltin_t*)extra)->shp;
+ stkp = tdata.sh->stk;
while (n = optget(argv,sh_optbuiltin)) switch (n)
{
case 's':
@@ -638,46 +804,51 @@ int b_builtin(int argc,char *argv[],void *extra)
if(tdata.sh->subshell)
sh_subfork();
}
+#if SHOPT_DYNAMIC
if(arg)
{
-#ifdef _hdr_dlldefs
#if (_AST_VERSION>=20040404)
if(!(library = dllplug(SH_ID,arg,NIL(char*),RTLD_LAZY,NIL(char*),0)))
#else
if(!(library = dllfind(arg,NIL(char*),RTLD_LAZY,NIL(char*),0)))
#endif
-#else
- if(!(library = dlopen(arg,DL_MODE)))
-#endif
{
errormsg(SH_DICT,ERROR_exit(0),"%s: %s",arg,dlerror());
return(1);
}
sh_addlib(library);
}
- else if(*argv==0 && !dlete)
+ else
+#endif /* SHOPT_DYNAMIC */
+ if(*argv==0 && !dlete)
{
print_scan(sfstdout, flag, tdata.sh->bltin_tree, 1, &tdata);
return(0);
}
r = 0;
- flag = staktell();
+ flag = stktell(stkp);
while(arg = *argv)
{
name = path_basename(arg);
- stakputs("b_");
- stakputs(name);
+ sfwrite(stkp,"b_",2);
+ sfputr(stkp,name,0);
errmsg = 0;
addr = 0;
for(n=(nlib?nlib:dlete); --n>=0;)
{
/* (char*) added for some sgi-mips compilers */
- if(dlete || (addr = (Fptr_t)dlllook(liblist[n],stakptr(flag))))
+#if SHOPT_DYNAMIC
+ if(dlete || (addr = (Fptr_t)dlllook(liblist[n],stkptr(stkp,flag))))
+#else
+ if(dlete)
+#endif /* SHOPT_DYNAMIC */
{
if(np = sh_addbuiltin(arg, addr,pointerof(dlete)))
{
if(dlete || nv_isattr(np,BLT_SPC))
errmsg = "restricted name";
+ else
+ nv_onattr(np,libattr[n]);
}
break;
}
@@ -695,7 +866,7 @@ int b_builtin(int argc,char *argv[],void *extra)
errormsg(SH_DICT,ERROR_exit(0),"%s: %s",*argv,errmsg);
r = 1;
}
- stakseek(flag);
+ stkseek(stkp,flag);
argv++;
}
return(r);
@@ -705,11 +876,11 @@ int b_set(int argc,register char *argv[],void *extra)
{
struct tdata tdata;
memset(&tdata,0,sizeof(tdata));
- tdata.sh = (Shell_t*)extra;
+ tdata.sh = ((Shbltin_t*)extra)->shp;
tdata.prefix=0;
if(argv[1])
{
- if(sh_argopts(argc,argv) < 0)
+ if(sh_argopts(argc,argv,tdata.sh) < 0)
return(2);
if(sh_isoption(SH_VERBOSE))
sh_onstate(SH_VERBOSE);
@@ -735,13 +906,13 @@ int b_set(int argc,register char *argv[],void *extra)
int b_unalias(int argc,register char *argv[],void *extra)
{
- Shell_t *shp = (Shell_t*)extra;
+ Shell_t *shp = ((Shbltin_t*)extra)->shp;
return(b_unall(argc,argv,shp->alias_tree,shp));
}
int b_unset(int argc,register char *argv[],void *extra)
{
- Shell_t *shp = (Shell_t*)extra;
+ Shell_t *shp = ((Shbltin_t*)extra)->shp;
return(b_unall(argc,argv,shp->var_tree,shp));
}
@@ -750,6 +921,7 @@ static int b_unall(int argc, char **argv, register Dt_t *troot, Shell_t* shp)
register Namval_t *np;
register const char *name;
register int r;
+ Dt_t *dp;
int nflag=0,all=0,isfun;
NOT_USED(argc);
if(troot==shp->alias_tree)
@@ -763,7 +935,7 @@ static int b_unall(int argc, char **argv, register Dt_t *troot, Shell_t* shp)
while(r = optget(argv,name)) switch(r)
{
case 'f':
- troot = sh_subfuntree(0);
+ troot = sh_subfuntree(1);
break;
case 'a':
all=1;
@@ -794,7 +966,7 @@ static int b_unall(int argc, char **argv, register Dt_t *troot, Shell_t* shp)
dtclear(troot);
else while(name = *argv++)
{
- if(np=nv_open(name,troot,NV_NOADD|nflag))
+ if(np=nv_open(name,troot,NV_NOADD|NV_NOFAIL|nflag))
{
if(is_abuiltin(np))
{
@@ -802,12 +974,23 @@ static int b_unall(int argc, char **argv, register Dt_t *troot, Shell_t* shp)
continue;
}
isfun = is_afunction(np);
- if(shp->subshell && troot==shp->var_tree)
- np=sh_assignok(np,0);
+ if(troot==shp->var_tree)
+ {
+ if(nv_isarray(np) && name[strlen(name)-1]==']' && !nv_getsub(np))
+ {
+ r=1;
+ continue;
+ }
+
+ if(shp->subshell)
+ np=sh_assignok(np,0);
+ }
nv_unset(np);
nv_close(np);
- if(isfun)
- dtdelete(troot,np);
+ if(troot==shp->var_tree && shp->st.real_fun && (dp=shp->var_tree->walk) && dp==shp->st.real_fun->sdict)
+ nv_delete(np,dp,NV_NOFREE);
+ else if(isfun)
+ nv_delete(np,troot,NV_NOFREE);
}
else
r = 1;
@@ -825,14 +1008,19 @@ static int print_namval(Sfio_t *file,register Namval_t *np,register int flag, st
sh_sigcheck();
if(flag)
flag = '\n';
- if(nv_isattr(np,NV_NOPRINT)==NV_NOPRINT)
+ if(nv_isattr(np,NV_NOPRINT|NV_INTEGER)==NV_NOPRINT)
{
if(is_abuiltin(np))
sfputr(file,nv_name(np),'\n');
return(0);
}
if(tp->prefix)
- sfputr(file,tp->prefix,' ');
+ {
+ if(*tp->prefix=='t')
+ nv_attribute(np,tp->outfile,tp->prefix,tp->aflag);
+ else
+ sfputr(file,tp->prefix,' ');
+ }
if(is_afunction(np))
{
Sfio_t *iop=0;
@@ -850,7 +1038,7 @@ static int print_namval(Sfio_t *file,register Namval_t *np,register int flag, st
flag = '\n';
if(flag)
{
- if(np->nvalue.ip && np->nvalue.rp->hoffset>=0)
+ if(tp->pflag && np->nvalue.ip && np->nvalue.rp->hoffset>=0)
sfprintf(file," #line %d %s\n",np->nvalue.rp->lineno,fname?sh_fmtq(fname):"");
else
sfputc(file, '\n');
@@ -875,15 +1063,18 @@ static int print_namval(Sfio_t *file,register Namval_t *np,register int flag, st
}
return(nv_size(np)+1);
}
+ if(nv_arrayptr(np))
+ {
+ print_value(file,np,tp);
+ return(0);
+ }
+ if(nv_isvtree(np))
+ nv_onattr(np,NV_EXPORT);
if(cp=nv_getval(np))
{
sfputr(file,nv_name(np),-1);
if(!flag)
- {
flag = '=';
- if(nv_arrayptr(np))
- sfprintf(file,"[%s]", sh_fmtq(nv_getsub(np)));
- }
sfputc(file,flag);
if(flag != '\n')
{
@@ -893,7 +1084,11 @@ static int print_namval(Sfio_t *file,register Namval_t *np,register int flag, st
sfprintf(file,"[%s]\n", sh_fmtq(nv_refsub(np)));
}
else
+#if SHOPT_TYPEDEF
+ sfputr(file,nv_isvtree(np)?cp:sh_fmtq(cp),'\n');
+#else
sfputr(file,sh_fmtq(cp),'\n');
+#endif /* SHOPT_TYPEDEF */
}
return(1);
}
@@ -931,16 +1126,20 @@ static void print_scan(Sfio_t *file, int flag, Dt_t *root, int option,struct tda
register Namval_t *np;
register int namec;
Namval_t *onp = 0;
- sh.last_table=0;
+ tp->sh->last_table=0;
flag &= ~NV_ASSIGN;
tp->scanmask = flag&~NV_NOSCOPE;
tp->scanroot = root;
tp->outfile = file;
+#if SHOPT_TYPEDEF
+ if(!tp->prefix && tp->tp)
+ tp->prefix = nv_name(tp->tp);
+#endif /* SHOPT_TYPEDEF */
if(flag&NV_INTEGER)
tp->scanmask |= (NV_DOUBLE|NV_EXPNOTE);
namec = nv_scan(root,nullscan,(void*)tp,tp->scanmask,flag);
- argv = tp->argnam = (char**)stakalloc((namec+1)*sizeof(char*));
- namec = nv_scan(root, pushname, (void*)tp, tp->scanmask, flag);
+ argv = tp->argnam = (char**)stkalloc(tp->sh->stk,(namec+1)*sizeof(char*));
+ namec = nv_scan(root, pushname, (void*)tp, tp->scanmask, flag&~NV_IARRAY);
if(mbcoll())
strsort(argv,namec,strcoll);
while(namec--)
@@ -948,21 +1147,18 @@ static void print_scan(Sfio_t *file, int flag, Dt_t *root, int option,struct tda
if((np=nv_search(*argv++,root,0)) && np!=onp && (!nv_isnull(np) || np->nvfun || nv_isattr(np,~NV_NOFREE)))
{
onp = np;
- if((flag&NV_ARRAY) && nv_aindex(np)>=0)
- continue;
- if(!flag && nv_isattr(np,NV_ARRAY))
+ if(flag&NV_ARRAY)
{
- if(array_elem(nv_arrayptr(np))==0)
- continue;
- nv_putsub(np,NIL(char*),ARRAY_SCAN);
- do
+ if(nv_aindex(np)>=0)
{
- print_namval(file,np,option,tp);
+ if(!(flag&NV_IARRAY))
+ continue;
}
- while(!option && nv_nextsub(np));
+ else if((flag&NV_IARRAY))
+ continue;
+
}
- else
- print_namval(file,np,option,tp);
+ print_namval(file,np,option,tp);
}
}
}
diff --git a/usr/src/lib/libshell/common/bltins/ulimit.c b/usr/src/lib/libshell/common/bltins/ulimit.c
index 4f7a2fc844..53fd29def5 100644
--- a/usr/src/lib/libshell/common/bltins/ulimit.c
+++ b/usr/src/lib/libshell/common/bltins/ulimit.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -70,13 +70,13 @@ int b_ulimit(int argc,char *argv[],void *extra)
register char *limit;
register int mode=0, n;
register unsigned long hit = 0;
- Shell_t *shp = (Shell_t*)extra;
+ Shell_t *shp = ((Shbltin_t*)extra)->shp;
#ifdef _lib_getrlimit
struct rlimit rlp;
#endif /* _lib_getrlimit */
const Limit_t* tp;
char* conf;
- int label, unit, noargs, nosupport;
+ int label, unit, nosupport;
rlim_t i;
char tmp[32];
Optdisc_t disc;
@@ -109,9 +109,9 @@ int b_ulimit(int argc,char *argv[],void *extra)
break;
}
opt_info.disc = 0;
- limit = argv[opt_info.index];
/* default to -f */
- if(noargs=(hit==0))
+ limit = argv[opt_info.index];
+ if(hit==0)
for(n=0; shtab_limits[n].option; n++)
if(shtab_limits[n].index == RLIMIT_FSIZE)
{
@@ -196,10 +196,9 @@ int b_ulimit(int argc,char *argv[],void *extra)
conf = (char*)e_nosupport;
sfputr(sfstdout,conf,'\n');
}
- else if(i!=INFINITY || noargs)
+ else if(i!=INFINITY)
{
- if(!noargs)
- i += (unit-1);
+ i += (unit-1);
sfprintf(sfstdout,"%I*d\n",sizeof(i),i/unit);
}
else
diff --git a/usr/src/lib/libshell/common/bltins/umask.c b/usr/src/lib/libshell/common/bltins/umask.c
index a3f0072363..fc5a684016 100644
--- a/usr/src/lib/libshell/common/bltins/umask.c
+++ b/usr/src/lib/libshell/common/bltins/umask.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -75,7 +75,7 @@ int b_umask(int argc,char *argv[],void *extra)
{
char *cp = mask;
flag = umask(0);
- c = strperm(cp,&cp,~flag);
+ c = strperm(cp,&cp,~flag&0777);
if(*cp)
{
umask(flag);
diff --git a/usr/src/lib/libshell/common/bltins/whence.c b/usr/src/lib/libshell/common/bltins/whence.c
index 7d05a741d6..39366f0e68 100644
--- a/usr/src/lib/libshell/common/bltins/whence.c
+++ b/usr/src/lib/libshell/common/bltins/whence.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -40,6 +40,7 @@
#define A_FLAG 4
#define F_FLAG 010
#define X_FLAG 020
+#define Q_FLAG 040
static int whence(Shell_t *,char**, int);
@@ -51,7 +52,7 @@ static int whence(Shell_t *,char**, int);
int b_command(register int argc,char *argv[],void *extra)
{
register int n, flags=0;
- register Shell_t *shp = (Shell_t*)extra;
+ register Shell_t *shp = ((Shbltin_t*)extra)->shp;
opt_info.index = opt_info.offset = 0;
while((n = optget(argv,sh_optcommand))) switch(n)
{
@@ -94,7 +95,7 @@ int b_command(register int argc,char *argv[],void *extra)
int b_whence(int argc,char *argv[],void *extra)
{
register int flags=0, n;
- register Shell_t *shp = (Shell_t*)extra;
+ register Shell_t *shp = ((Shbltin_t*)extra)->shp;
NOT_USED(argc);
if(*argv[0]=='t')
flags = V_FLAG;
@@ -111,6 +112,10 @@ int b_whence(int argc,char *argv[],void *extra)
break;
case 'p':
flags |= P_FLAG;
+ flags &= ~V_FLAG;
+ break;
+ case 'q':
+ flags |= Q_FLAG;
break;
case ':':
errormsg(SH_DICT,2, "%s", opt_info.arg);
@@ -136,21 +141,20 @@ static int whence(Shell_t *shp,char **argv, register int flags)
Dt_t *root;
Namval_t *nq;
char *notused;
-#ifdef PATH_BFPATH
- Pathcomp_t *pp;
-#endif
+ Pathcomp_t *pp=0;
int notrack = 1;
+ if(flags&Q_FLAG)
+ flags &= ~A_FLAG;
while(name= *argv++)
{
tofree=0;
aflag = ((flags&A_FLAG)!=0);
cp = 0;
np = 0;
-#ifdef PATH_BFPATH
- pp = 0;
-#endif
if(flags&P_FLAG)
goto search;
+ if(flags&Q_FLAG)
+ goto bltins;
/* reserved words first */
if(sh_lookup(name,shtab_reserved))
{
@@ -179,6 +183,7 @@ static int whence(Shell_t *shp,char **argv, register int flags)
aflag++;
}
/* built-ins and functions next */
+ bltins:
root = (flags&F_FLAG)?shp->bltin_tree:shp->fun_tree;
if(np= nv_bfsearch(name, root, &nq, &notused))
{
@@ -190,10 +195,17 @@ static int whence(Shell_t *shp,char **argv, register int flags)
if(nv_isnull(np))
cp = sh_translate(is_ufunction);
else if(is_abuiltin(np))
- cp = sh_translate(is_builtin);
+ {
+ if(nv_isattr(np,BLT_SPC))
+ cp = sh_translate(is_spcbuiltin);
+ else
+ cp = sh_translate(is_builtin);
+ }
else
cp = sh_translate(is_function);
}
+ if(flags&Q_FLAG)
+ continue;
sfprintf(sfstdout,"%s%s\n",name,cp);
if(!aflag)
continue;
@@ -206,67 +218,66 @@ static int whence(Shell_t *shp,char **argv, register int flags)
cp=0;
notrack=1;
}
-#ifdef PATH_BFPATH
- if(path_search(name,pp,2))
- cp = name;
- else
+ do
{
- cp = stakptr(PATH_OFFSET);
- if(*cp==0)
- cp = 0;
- else if(*cp!='/')
+ if(path_search(name,&pp,2+(aflag>1)))
+ cp = name;
+ else
{
- cp = path_fullname(cp);
- tofree=1;
+ cp = stakptr(PATH_OFFSET);
+ if(*cp==0)
+ cp = 0;
+ else if(*cp!='/')
+ {
+ cp = path_fullname(cp);
+ tofree=1;
+ }
}
- }
-#else
- if(path_search(name,cp,2))
- cp = name;
- else
- cp = shp->lastpath;
- shp->lastpath = 0;
-#endif
- if(cp)
- {
- if(flags&V_FLAG)
+ if(flags&Q_FLAG)
+ r |= !cp;
+ else if(cp)
{
- if(*cp!= '/')
+ if(flags&V_FLAG)
+ {
+ if(*cp!= '/')
+ {
+ if(!np && (np=nv_search(name,shp->track_tree,0)))
+ sfprintf(sfstdout,"%s %s %s/%s\n",name,sh_translate(is_talias),path_pwd(0),cp);
+ else if(!np || nv_isnull(np))
+ sfprintf(sfstdout,"%s%s\n",name,sh_translate(is_ufunction));
+ continue;
+ }
+ sfputr(sfstdout,sh_fmtq(name),' ');
+ /* built-in version of program */
+ if(*cp=='/' && (np=nv_search(cp,shp->bltin_tree,0)))
+ msg = sh_translate(is_builtver);
+ /* tracked aliases next */
+ else if(aflag>1 || !notrack || strchr(name,'/'))
+ msg = sh_translate("is");
+ else
+ msg = sh_translate(is_talias);
+ sfputr(sfstdout,msg,' ');
+ }
+ sfputr(sfstdout,sh_fmtq(cp),'\n');
+ if(aflag)
{
-#ifdef PATH_BFPATH
- if(!np && (np=nv_search(name,shp->track_tree,0)))
- sfprintf(sfstdout,"%s %s %s/%s\n",name,sh_translate(is_talias),path_pwd(0),cp);
- else if(!np || nv_isnull(np))
-#else
- if(!np || nv_isnull(np))
-#endif
- sfprintf(sfstdout,"%s%s\n",name,sh_translate(is_ufunction));
- continue;
+ if(aflag<=1)
+ aflag++;
+ if (pp)
+ pp = pp->next;
}
- sfputr(sfstdout,sh_fmtq(name),' ');
- /* built-in version of program */
- if(*cp=='/' && (np=nv_search(cp,shp->bltin_tree,0)))
- msg = sh_translate(is_builtver);
- /* tracked aliases next */
- else if(!notrack || strchr(name,'/'))
- msg = sh_translate("is");
else
- msg = sh_translate(is_talias);
- sfputr(sfstdout,msg,' ');
+ pp = 0;
+ if(tofree)
+ free((char*)cp);
}
- sfputr(sfstdout,sh_fmtq(cp),'\n');
- if(tofree)
- free((char*)cp);
- }
- else if(aflag<=1)
- {
- r |= 1;
- if(flags&V_FLAG)
+ else if(aflag<=1)
{
- sfprintf(sfstdout,sh_translate(e_found),sh_fmtq(name));
- sfputc(sfstdout,'\n');
+ r |= 1;
+ if(flags&V_FLAG)
+ errormsg(SH_DICT,ERROR_exit(0),e_found,sh_fmtq(name));
}
- }
+ } while(pp);
}
return(r);
}
diff --git a/usr/src/lib/libshell/common/data/aliases.c b/usr/src/lib/libshell/common/data/aliases.c
index 577f098f1d..8a76dc7e82 100644
--- a/usr/src/lib/libshell/common/data/aliases.c
+++ b/usr/src/lib/libshell/common/data/aliases.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libshell/common/data/bash_pre_rc.sh b/usr/src/lib/libshell/common/data/bash_pre_rc.sh
index 98e6aba833..e8f51f428b 100644
--- a/usr/src/lib/libshell/common/data/bash_pre_rc.sh
+++ b/usr/src/lib/libshell/common/data/bash_pre_rc.sh
@@ -1,10 +1,10 @@
########################################################################
# #
# This software is part of the ast package #
-# Copyright (c) 1982-2007 AT&T Knowledge Ventures #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
-# by AT&T Knowledge Ventures #
+# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# http://www.opensource.org/licenses/cpl1.0.txt #
@@ -102,15 +102,16 @@ function PS1.set
var+="$prefix"
case ${remaining:1:1} in
t) var+="\$(printf '%(%H:%M:%S)T')";;
- d) var+="\$(printf '%(%a %b:%d)T')";;
+ d) var+="\$(printf '%(%a %b:%e)T')";;
n) var+=$'\n';;
s) var+=ksh;;
w) var+="\$(pwd)";;
W) var+="\$(basename \"\$(pwd)\")";;
u) var+=$USER;;
- h) var+=$(hostname);;
+ h) var+=$(hostname -s);;
'#') var+=!;;
!) var+=!;;
+ @) var+="\$(printf '%(%I:%M%p)T')";;
'$') if (( $(id -u) == 0 ))
then var+='#'
else var+='$'
@@ -168,15 +169,47 @@ alias enable=builtin
function help
{
- man=--man
- [[ $1 == -s ]] && man=--short && shift
+ typeset b cmd usage try_cmd man
+ function has_help_option
+ {
+ [[ $1 == @(''|/*|:|echo|false|true|login|test|'[') ]] && return 1
+ return 0
+ }
+ typeset -A short_use=(
+ [echo]='Usage: echo [ options ] [arg]...'
+ [:]='Usage: : ...'
+ [true]='Usage: true ...'
+ [false]='Usage: false ...'
+ [login]='Usage: login [-p] [name]'
+ ['[']='Usage: [ EXPRESSION ] | [ OPTION'
+ [test]='Usage: test EXPRESSION | test'
+ )
b=$(builtin)
- for i
- do
- for j in $b
- do
- [[ $i == $j ]] && $j $man
+ if (( $# == 0))
+ then print 'The following is the current list of built-in commands:'
+ print -r $'Type help *name* for more information about name\n'
+ for cmd in $b
+ do if has_help_option $cmd
+ then usage=$($cmd --short 2>&1)
+ print -r -- "${usage:7}"
+ else print -r -- ${short_use[$cmd]:7}
+ fi
done
+ return
+ fi
+ b=${b/'['/}
+ man=--man
+ [[ $1 == -s ]] && man=--short && shift
+ for try_cmd
+ do if has_help_option $try_cmd
+ then if [[ $try_cmd == @(${b//$'\n'/'|'}) ]]
+ then $try_cmd $man
+ else man $try_cmd
+ fi
+ elif [[ $man == '--short' ]]
+ then print -r -- ${short_use[$try_cmd]}
+ else man $try_cmd
+ fi
done
}
@@ -219,3 +252,4 @@ function cd
typeset BASH=$0
! shopt -qo posix && HISTFILE=~/.bash_history
HOSTNAME=$(hostname)
+nameref BASH_SUBSHELL=.sh.subshell
diff --git a/usr/src/lib/libshell/common/data/builtins.c b/usr/src/lib/libshell/common/data/builtins.c
index ddbe5c74ea..dad24caf31 100644
--- a/usr/src/lib/libshell/common/data/builtins.c
+++ b/usr/src/lib/libshell/common/data/builtins.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -37,14 +37,11 @@
# define bltin(x) 0
#endif
-#ifndef SH_CMDLIB_DIR
-# define SH_CMDLIB_DIR "/opt/ast/bin"
-#endif
#if defined(SHOPT_CMDLIB_DIR) && !defined(SHOPT_CMDLIB_HDR)
# define SHOPT_CMDLIB_HDR <cmdlist.h>
#endif
#define Q(f) #f /* libpp cpp workaround -- fixed 2005-04-11 */
-#define CMDLIST(f) SH_CMDLIB_DIR "/" Q(f), NV_BLTIN|NV_NOFREE, bltin(f),
+#define CMDLIST(f) SH_CMDLIB_DIR "/" Q(f), NV_BLTIN|NV_BLTINOPT|NV_NOFREE, bltin(f),
#undef basename
#undef dirname
@@ -64,25 +61,26 @@ const struct shtable3 shtab_builtins[] =
"break", NV_BLTIN|BLT_ENV|BLT_SPC, bltin(break),
"continue", NV_BLTIN|BLT_ENV|BLT_SPC, bltin(break),
"typeset", NV_BLTIN|BLT_ENV|BLT_SPC|BLT_DCL,bltin(typeset),
- "test", NV_BLTIN|BLT_ENV|NV_NOFREE, bltin(test),
+ "test", NV_BLTIN|BLT_ENV, bltin(test),
"[", NV_BLTIN|BLT_ENV, bltin(test),
"let", NV_BLTIN|BLT_ENV, bltin(let),
- "export", NV_BLTIN|BLT_SPC|BLT_DCL, bltin(readonly),
+ "export", NV_BLTIN|BLT_ENV|BLT_SPC|BLT_DCL,bltin(readonly),
+ ".", NV_BLTIN|BLT_ENV|BLT_SPC, bltin(dot_cmd),
+ "return", NV_BLTIN|BLT_ENV|BLT_SPC, bltin(return),
#if SHOPT_BASH
"local", NV_BLTIN|BLT_ENV|BLT_SPC|BLT_DCL,bltin(typeset),
#endif
#if _bin_newgrp || _usr_bin_newgrp
"newgrp", NV_BLTIN|BLT_ENV|BLT_SPC, Bltin(login),
#endif /* _bin_newgrp || _usr_bin_newgrp */
- ".", NV_BLTIN|BLT_ENV|BLT_SPC, bltin(dot_cmd),
"alias", NV_BLTIN|BLT_SPC|BLT_DCL, bltin(alias),
"hash", NV_BLTIN|BLT_SPC|BLT_DCL, bltin(alias),
- "exit", NV_BLTIN|BLT_ENV|BLT_SPC, bltin(return),
+ "enum", NV_BLTIN|BLT_ENV|BLT_SPC|BLT_DCL,bltin(enum),
"eval", NV_BLTIN|BLT_ENV|BLT_SPC|BLT_EXIT,bltin(eval),
+ "exit", NV_BLTIN|BLT_ENV|BLT_SPC, bltin(return),
"fc", NV_BLTIN|BLT_ENV|BLT_EXIT, bltin(hist),
"hist", NV_BLTIN|BLT_ENV|BLT_EXIT, bltin(hist),
"readonly", NV_BLTIN|BLT_ENV|BLT_SPC|BLT_DCL,bltin(readonly),
- "return", NV_BLTIN|BLT_ENV|BLT_SPC, bltin(return),
"shift", NV_BLTIN|BLT_ENV|BLT_SPC, bltin(shift),
"trap", NV_BLTIN|BLT_ENV|BLT_SPC, bltin(trap),
"unalias", NV_BLTIN|BLT_ENV|BLT_SPC, bltin(unalias),
@@ -98,20 +96,19 @@ const struct shtable3 shtab_builtins[] =
"bg", NV_BLTIN|BLT_ENV, bltin(bg),
"fg", NV_BLTIN|BLT_ENV|BLT_EXIT, bltin(bg),
"disown", NV_BLTIN|BLT_ENV, bltin(bg),
- "kill", NV_BLTIN|BLT_ENV|NV_NOFREE, bltin(kill),
+ "kill", NV_BLTIN|BLT_ENV, bltin(kill),
# else
- "/bin/kill", NV_BLTIN|BLT_ENV|NV_NOFREE, bltin(kill),
+ "/bin/kill", NV_BLTIN|BLT_ENV, bltin(kill),
# endif /* SIGTSTP */
"jobs", NV_BLTIN|BLT_ENV, bltin(jobs),
#endif /* JOBS */
"false", NV_BLTIN|BLT_ENV, bltin(false),
-SH_CMDLIB_DIR "/getconf",NV_BLTIN|BLT_ENV, bltin(getconf),
"getopts", NV_BLTIN|BLT_ENV, bltin(getopts),
"print", NV_BLTIN|BLT_ENV, bltin(print),
- "printf", NV_BLTIN|NV_NOFREE, bltin(printf),
- "pwd", NV_BLTIN|NV_NOFREE, bltin(pwd),
+ "printf", NV_BLTIN|BLT_ENV, bltin(printf),
+ "pwd", NV_BLTIN, bltin(pwd),
"read", NV_BLTIN|BLT_ENV, bltin(read),
- "sleep", NV_BLTIN|NV_NOFREE, bltin(sleep),
+ "sleep", NV_BLTIN, bltin(sleep),
"alarm", NV_BLTIN, bltin(alarm),
"ulimit", NV_BLTIN|BLT_ENV, bltin(ulimit),
"umask", NV_BLTIN|BLT_ENV, bltin(umask),
@@ -131,6 +128,7 @@ SH_CMDLIB_DIR "/getconf",NV_BLTIN|BLT_ENV, bltin(getconf),
CMDLIST(basename)
CMDLIST(chmod)
CMDLIST(dirname)
+ CMDLIST(getconf)
CMDLIST(head)
CMDLIST(mkdir)
CMDLIST(logname)
@@ -159,7 +157,7 @@ const char sh_set[] =
"}"
"[f?Pathname expansion is disabled.]"
"[h?Obsolete. Causes each command whose name has the syntax of an "
- "alias to become a tracked aliase when it is first encountered.]"
+ "alias to become a tracked alias when it is first encountered.]"
"[k?This is obsolete. All arguments of the form \aname\a\b=\b\avalue\a "
"are removed and placed in the variable assignment list for "
"the command. Ordinarily, variable assignments must precede "
@@ -662,7 +660,7 @@ USAGE_LICENSE
"Text between two \\b (backspace) characters indicates "
"that the text should be emboldened when displayed. "
"Text between two \\a (bell) characters indicates that the text should "
- "be emphasised or italicized when displayed. "
+ "be emphasized or italicized when displayed. "
"Text between two \\v (vertical tab) characters indicates "
"that the text should displayed in a fixed width font. "
"Text between two \\f (formfeed) characters will be replaced by the "
@@ -684,6 +682,8 @@ USAGE_LICENSE
"[+i?Ignore this \aoptstring\a when generating help. Used when "
"combining \aoptstring\a values from multiple passes.]"
"[+l?Display only \alongname\a options in help messages.]"
+ "[+n?Associate -\anumber\a and +\anumber\a options with the first "
+ "option with numeric arguments.]"
"[+o?The \b-\b option character prefix is optional (supports "
"obsolete \bps\b(1) option syntax.)]"
"[+p?\anumber\a specifies the number of \b-\b characters that must "
@@ -865,7 +865,7 @@ USAGE_LICENSE
"\n[job ...]\n"
"\n"
"[+EXIT STATUS?]{"
- "[+0?If all jobs are sucessfully disowned.]"
+ "[+0?If all jobs are successfully disowned.]"
"[+>0?If one more \ajob\as does not exist.]"
"}"
@@ -912,7 +912,7 @@ USAGE_LICENSE
;
const char sh_opthist[] =
-"[-1c?@(#)$Id: hist (AT&T Research) 2000-04-02 $\n]"
+"[-1cn?@(#)$Id: hist (AT&T Research) 2000-04-02 $\n]"
USAGE_LICENSE
"[+NAME?\f?\f - process command history list]"
"[+DESCRIPTION?\b\f?\f\b lists, edits, or re-executes, commands "
@@ -1065,7 +1065,7 @@ USAGE_LICENSE
"[+NAME?print - write arguments to standard output]"
"[+DESCRIPTION?By default, \bprint\b writes each \astring\a operand to "
"standard output and appends a newline character.]"
-"[+?Unless, the \b-r\b or \b-f\b option is specifed, each \b\\\b "
+"[+?Unless, the \b-r\b or \b-f\b option is specified, each \b\\\b "
"character in each \astring\a operand is processed specially as "
"follows:]{"
"[+\\a?Alert character.]"
@@ -1100,6 +1100,8 @@ USAGE_LICENSE
"[s?Write the output as an entry in the shell history file instead of "
"standard output.]"
"[u]:[fd:=1?Write to file descriptor number \afd\a instead of standard output.]"
+"[v?Treat each \astring\a as a variable name and write the value in \b%B\b "
+ "format. Cannot be used with \b-f\b.]"
"\n"
"\n[string ...]\n"
"\n"
@@ -1240,7 +1242,7 @@ USAGE_LICENSE
"[+?If there are more variables than fields, the remaining variables are "
"set to empty strings. If there are fewer variables than fields, "
"the leftover fields and their intervening separators are assigned "
- "to the last variable. If no \avar\a is specifed then the variable "
+ "to the last variable. If no \avar\a is specified then the variable "
"\bREPLY\b is used.]"
"[+?When \avar\a has the binary attribute and \b-n\b or \b-N\b is specified, "
"the bytes that are read are stored directly into \bvar\b.]"
@@ -1249,6 +1251,7 @@ USAGE_LICENSE
"is a terminal or pipe.]"
"[A?Unset \avar\a and then create an indexed array containing each field in "
"the line starting at index 0.]"
+"[C?Unset \avar\a and read \avar\a as a compound variable.]"
"[d]:[delim?Read until delimiter \adelim\a instead of to the end of line.]"
"[p?Read from the current co-process instead of standard input. An end of "
"file causes \bread\b to disconnect the co-process so that another "
@@ -1275,7 +1278,7 @@ USAGE_LICENSE
;
const char sh_optreadonly[] =
-"[-1c?\n@(#)$Id: readonly (AT&T Research) 1999-07-07 $\n]"
+"[-1c?\n@(#)$Id: readonly (AT&T Research) 2008-06-16 $\n]"
USAGE_LICENSE
"[+NAME?readonly - set readonly attribute on variables]"
"[+DESCRIPTION?\breadonly\b sets the readonly attribute on each of "
@@ -1283,6 +1286,9 @@ USAGE_LICENSE
"values from being changed. If \b=\b\avalue\a is specified, "
"the variable \aname\a is set to \avalue\a before the variable "
"is made readonly.]"
+"[+?Within a type definition, if the value is not specified, then a "
+ "value must be specified when creating each instance of the type "
+ "and the value is readonly for each instance.]"
"[+?If no \aname\as are specified then the names and values of all "
"readonly variables are written to standard output.]"
"[+?\breadonly\b is built-in to the shell as a declaration command so that "
@@ -1368,14 +1374,19 @@ USAGE_LICENSE
"[D\f:dump-strings\f?Do not execute the script, but output the set of double "
"quoted strings preceded by a \b$\b. These strings are needed for "
"localization of the script to different locales.]"
-"[E?Reads the file \b${ENV-$HOME/.kshrc}\b, if it exists, as a profile. "
+"[E?Reads the file "
+#if SHOPT_SYSRC
+ "\b/etc/ksh.kshrc\b, if it exists, as a profile, followed by "
+#endif
+ "\b${ENV-$HOME/.kshrc}\b, if it exists, as a profile. "
"On by default for interactive shells; use \b+E\b to disable.]"
#if SHOPT_PFSH
"[P?Invoke the shell as a profile shell. See \bpfexec\b(1).]"
#endif
#if SHOPT_KIA
"[R]:[file?Do not execute the script, but create a cross reference database "
- "in \afile\a that can be used a separate shell script browser.]"
+ "in \afile\a that can be used a separate shell script browser. The "
+ "-R option requires a script to be specified as the first operand.]"
#endif /* SHOPT_KIA */
#if SHOPT_BASH
"\fbash2\f"
@@ -1424,6 +1435,9 @@ USAGE_LICENSE
"[A]:[name?Assign the arguments sequentially to the array named by \aname\a "
"starting at subscript 0 rather than to the positional parameters.]"
"\fabc\f"
+"[06:default?Restore all non-command line options to the default settings.]"
+"[07:state?List the current option state in the form of a \bset\b command "
+ "that can be executed to restore the state.]"
"\n"
"\n[arg ...]\n"
"\n"
@@ -1466,7 +1480,7 @@ USAGE_LICENSE
"[+NAME?sleep - suspend execution for an interval]"
"[+DESCRIPTION?\bsleep\b suspends execution for at least the time specified "
"by \aseconds\a or until a \bSIGALRM\b signal is received. "
- "\aseconds\a can be specifed as a floating point number but the "
+ "\aseconds\a can be specified as a floating point number but the "
"actual granularity depends on the underlying system, normally "
"around 1 millisecond.]"
"\n"
@@ -1534,7 +1548,7 @@ USAGE_LICENSE
;
const char sh_opttypeset[] =
-"+[-1c?\n@(#)$Id: typeset (AT&T Research) 2003-01-15 $\n]"
+"+[-1c?\n@(#)$Id: typeset (AT&T Research) 2008-08-04 $\n]"
USAGE_LICENSE
"[+NAME?\f?\f - declare or display variables with attributes]"
"[+DESCRIPTION?Without the \b-f\b option, \b\f?\f\b sets, unsets, "
@@ -1571,10 +1585,12 @@ USAGE_LICENSE
"[+?\b\f?\f\b is built-in to the shell as a declaration command so that "
"field splitting and pathname expansion are not performed on "
"the arguments. Tilde expansion occurs on \avalue\a.]"
-#if SHOPT_BASH
-"[a?Ignored, used for bash compatibility.]"
-#endif
+#if 1
+"[a]:?[type?Indexed array. This is the default. If \b[\b\atype\a\b]]\b is "
+ "specified, each subscript is interpreted as a value of type \atype\a.]"
+#else
"[a?Indexed array. this is the default.]"
+#endif
"[b?Each \aname\a may contain binary data. Its value is the mime "
"base64 encoding of the data. It can be used with \b-Z\b, "
"to specify fixed sized fields.]"
@@ -1583,8 +1599,12 @@ USAGE_LICENSE
"from 2 to 64.]"
"[l?Convert uppercase character to lowercase. Unsets \b-u\b attribute. When "
"used with \b-i\b, \b-E\b, or \b-F\b indicates long variant.]"
+"[m?Move. The value is the name of a variable whose value will be "
+ "moved to \aname\a. The orignal variable will be unset. Cannot be "
+ "used with any other options.]"
"[n?Name reference. The value is the name of a variable that \aname\a "
- "references. \aname\a cannot contain a \b.\b.]"
+ "references. \aname\a cannot contain a \b.\b. Cannot be use with "
+ "any other options.]"
"[p?Causes the output to be in a format that can be used as input to the "
"shell to recreate the attributes for variables.]"
"[r?Enables readonly. Once enabled it cannot be disabled. See "
@@ -1602,6 +1622,9 @@ USAGE_LICENSE
"[A?Associative array. Each \aname\a will converted to an associate "
"array. If a variable already exists, the current value will "
"become index \b0\b.]"
+"[C?Compound variable. Each \aname\a will be a compound variable. If "
+ "\avalue\a names a compound variable it will be copied to \aname\a. "
+ "Otherwise if the variable already exists, it will first be unset.]"
"[E]#?[n:=10?Floating point number represented in scientific notation. "
"\an\a specifies the number of significant figures when the "
"value is expanded.]"
@@ -1617,6 +1640,19 @@ USAGE_LICENSE
"[R]#?[n?Right justify. If \an\a is given it represents the field width. If "
"the \b-Z\b attribute is also specified, then zeros will "
"be used as the fill character. Otherwise, spaces are used.]"
+"[X]#?[n:=10?Floating point number represented in hexadecimal notation. "
+ "\an\a specifies the number of significant figures when the "
+ "value is expanded.]"
+
+#ifdef SHOPT_TYPEDEF
+"[h]:[string?Used within a type definition to provide a help string "
+ "for variable \aname\a. Otherwise, it is ignored.]"
+"[S?Used with a type definition to indicate that the variable is shared by "
+ "each instance of the type. When used inside a function defined "
+ "with the \bfunction\b reserved word, the specified variables "
+ "will have function static scope. Otherwise, the variable is "
+ "unset prior to processing the assignment list.]"
+#endif
"[T]:[tname?\atname\a is the name of a type name given to each \aname\a.]"
"[Z]#?[n?Zero fill. If \an\a is given it represents the field width.]"
"\n"
@@ -1784,7 +1820,7 @@ USAGE_LICENSE
#endif /* SHOPT_FS_3D */
const char sh_optwhence[] =
-"[-1c?\n@(#)$Id: whence (AT&T Research) 1999-07-07 $\n]"
+"[-1c?\n@(#)$Id: whence (AT&T Research) 2007-04-24 $\n]"
USAGE_LICENSE
"[+NAME?whence - locate a command and describe its type]"
"[+DESCRIPTION?Without \b-v\b, \bwhence\b writes on standard output an "
@@ -1792,12 +1828,14 @@ USAGE_LICENSE
"on the complete search order that the shell uses. If \aname\a "
"is not found, then no output is produced.]"
"[+?If \b-v\b is specified, the output will also contain information "
- "that indicates how the given \aname\a would be interpretted by "
+ "that indicates how the given \aname\a would be interpreted by "
"the shell in the current execution environment.]"
"[a?Displays all uses for each \aname\a rather than the first.]"
"[f?Do not check for functions.]"
"[p?Do not check to see if \aname\a is a reserved word, a built-in, "
- "an alias, or a function.]"
+ "an alias, or a function. This turns off the \b-v\b option.]"
+"[q?Quiet mode. Returns 0 if all arguments are built-ins, functions, or are "
+ "programs found on the path.]"
"[v?For each name you specify, the shell displays a line that indicates "
"if that name is one of the following:]{"
"[+?Reserved word]"
@@ -1807,7 +1845,6 @@ USAGE_LICENSE
"[+?Function]"
"[+?Tracked alias]"
"[+?Program]"
- "[+?Not found]"
"}"
"\n"
"\nname ...\n"
@@ -1828,6 +1865,5 @@ const char e_baddisc[] = "%s: invalid discipline function";
const char e_nospace[] = "out of memory";
const char e_nofork[] = "cannot fork";
const char e_nosignal[] = "%s: unknown signal name";
-const char e_numeric[] = "*([0-9])?(.)*([0-9])";
const char e_condition[] = "condition(s) required";
const char e_cneedsarg[] = "-c requires argument";
diff --git a/usr/src/lib/libshell/common/data/keywords.c b/usr/src/lib/libshell/common/data/keywords.c
index 66b3c3cea2..95e4bee1f6 100644
--- a/usr/src/lib/libshell/common/data/keywords.c
+++ b/usr/src/lib/libshell/common/data/keywords.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libshell/common/data/lexstates.c b/usr/src/lib/libshell/common/data/lexstates.c
index 0cedf9a4dc..438d58f568 100644
--- a/usr/src/lib/libshell/common/data/lexstates.c
+++ b/usr/src/lib/libshell/common/data/lexstates.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -56,7 +56,7 @@ static const char sh_lexstate0[256] =
S_NAME, S_RES, S_NAME, S_NAME, S_NAME, S_NAME, S_NAME, S_NAME,
#endif /* SHOPT_NAMESPACE */
S_NAME, S_NAME, S_NAME, S_RES, S_RES, S_RES, S_NAME, S_RES,
- S_NAME, S_NAME, S_NAME, S_REG, S_OP, S_REG, S_TILDE,S_REG,
+ S_NAME, S_NAME, S_NAME, S_BRACE,S_OP, S_BRACE,S_TILDE,S_REG,
S_REG, S_REG, S_REG, S_REG, S_REG, S_REG, S_REG, S_REG,
S_REG, S_REG, S_REG, S_REG, S_REG, S_REG, S_REG, S_REG,
@@ -360,8 +360,8 @@ static const char sh_lexstate9[256] =
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, S_QUOTE,0, S_DOL, 0, S_PAT, S_LIT,
- S_PAT, S_PAT, S_PAT, 0, 0, 0, 0, S_SLASH,
- 0, S_DIG, S_DIG, S_DIG, S_DIG, S_DIG, S_DIG, S_DIG,
+ S_PAT, S_PAT, S_PAT, 0, S_COM, 0, S_DOT, S_SLASH,
+ S_DIG, S_DIG, S_DIG, S_DIG, S_DIG, S_DIG, S_DIG, S_DIG,
S_DIG, S_DIG, S_COLON,0, 0, S_EQ, 0, S_PAT,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -409,3 +409,4 @@ const char e_lexfuture[] = "line %d: \\ in front of %c reserved for future use";
const char e_lexlongquote[] = "line %d: %c quote may be missing";
const char e_lexzerobyte[] = "zero byte";
const char e_lexemptyfor[] = "line %d: empty for list";
+const char e_lextypeset[] = "line %d: %s invalid typeset option order";
diff --git a/usr/src/lib/libshell/common/data/limits.c b/usr/src/lib/libshell/common/data/limits.c
index 9f0a87b3e8..4c743f7050 100644
--- a/usr/src/lib/libshell/common/data/limits.c
+++ b/usr/src/lib/libshell/common/data/limits.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libshell/common/data/math.tab b/usr/src/lib/libshell/common/data/math.tab
index cecfc12a34..281389f105 100644
--- a/usr/src/lib/libshell/common/data/math.tab
+++ b/usr/src/lib/libshell/common/data/math.tab
@@ -1,6 +1,6 @@
# <return type: i:integer f:floating-point> <#floating-point-args> <function-name> [<alias> ...]
# <function-name>l variants are handled by features/math.sh
-# @(#)math.tab (AT&T Research) 2006-10-18
+# @(#)math.tab (AT&T Research) 2008-05-22
f 1 acos
f 1 acosh
f 1 asin
@@ -9,6 +9,7 @@ f 1 atan
f 2 atan2
f 1 atanh
f 1 cbrt
+f 1 ceil
f 2 copysign
f 1 cos
f 1 cosh
diff --git a/usr/src/lib/libshell/common/data/msg.c b/usr/src/lib/libshell/common/data/msg.c
index 498f6558d0..3a06ed3f8d 100644
--- a/usr/src/lib/libshell/common/data/msg.c
+++ b/usr/src/lib/libshell/common/data/msg.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -96,14 +96,19 @@ const char e_aliname[] = "%s: invalid alias name";
const char e_badexport[] = "%s: invalid export name";
const char e_badref[] = "%s: reference variable cannot be an array";
const char e_noarray[] = "%s: cannot be an array";
+const char e_badappend[] = "%s: invalid append to associative array";
const char e_noref[] = "%s: no reference name";
const char e_selfref[] = "%s: invalid self reference";
const char e_noalias[] = "%s: alias not found\n";
const char e_format[] = "%s: bad format";
const char e_redef[] = "%s: type cannot be redefined";
+const char e_required[] = "%s: is a required element of %s";
const char e_badtformat[] = "%c: bad format character in time format";
const char e_nolabels[] = "%s: label not implemented";
const char e_notimp[] = "%s: not implemented";
+const char e_notelem[] = "%.*s: is not an element of %s";
+const char e_notenum[] = "%s: not an enumeration type";
+const char e_unknowntype[] = "%.*s: unknown type";
const char e_nosupport[] = "not supported";
const char e_badrange[] = "%d-%d: invalid range";
const char e_eneedsarg[] = "-e - requires single argument";
@@ -116,6 +121,7 @@ const char e_on [] = "on";
const char e_off[] = "off";
const char is_reserved[] = " is a keyword";
const char is_builtin[] = " is a shell builtin";
+const char is_spcbuiltin[] = " is a special shell builtin";
const char is_builtver[] = "is a shell builtin version of";
const char is_alias[] = "%s is an alias for ";
const char is_xalias[] = "%s is an exported alias for ";
diff --git a/usr/src/lib/libshell/common/data/options.c b/usr/src/lib/libshell/common/data/options.c
index 82ffd82d6c..cd49f6555c 100644
--- a/usr/src/lib/libshell/common/data/options.c
+++ b/usr/src/lib/libshell/common/data/options.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -25,7 +25,7 @@
#include "shtable.h"
#if SHOPT_BASH
-# define bashopt(a,b) a, b|SH_BASHOPT,
+# define bashopt(a,b) a, b|SH_BASHOPT,
# define bashextra(a,b) a, b|SH_BASHEXTRA,
#else
# define bashopt(a,b)
@@ -92,8 +92,15 @@ const Shtable_t shtab_options[] =
bashextra("physical", SH_PHYSICAL)
bashextra("posix", SH_POSIX)
"privileged", SH_PRIVILEGED,
-#if SHOPT_PFSH
+#if SHOPT_BASH
+ "profile", SH_LOGIN_SHELL|SH_COMMANDLINE,
+# if SHOPT_PFSH
+ "pfsh", SH_PFSH|SH_COMMANDLINE,
+# endif
+#else
+# if SHOPT_PFSH
"profile", SH_PFSH|SH_COMMANDLINE,
+# endif
#endif
bashopt("progcomp", SH_PROGCOMP)
bashopt("promptvars", SH_PROMPTVARS)
@@ -115,13 +122,15 @@ const Shtable_t shtab_options[] =
const Shtable_t shtab_attributes[] =
{
+ {"-Sshared", NV_REF|NV_TAGGED},
{"-nnameref", NV_REF},
{"-xexport", NV_EXPORT},
{"-rreadonly", NV_RDONLY},
{"-ttagged", NV_TAGGED},
- {"-llong", (NV_INTEGER|NV_DOUBLE|NV_LONG)},
- {"-Eexponential",(NV_INTEGER|NV_DOUBLE|NV_EXPNOTE)},
- {"-Ffloat", (NV_INTEGER|NV_DOUBLE)},
+ {"-llong", (NV_DOUBLE|NV_LONG)},
+ {"-Eexponential",(NV_DOUBLE|NV_EXPNOTE)},
+ {"-Xhexfloat", (NV_DOUBLE|NV_HEXFLOAT)},
+ {"-Ffloat", NV_DOUBLE},
{"-llong", (NV_INTEGER|NV_LONG)},
{"-sshort", (NV_INTEGER|NV_SHORT)},
{"-uunsigned", (NV_INTEGER|NV_UNSIGN)},
diff --git a/usr/src/lib/libshell/common/data/signals.c b/usr/src/lib/libshell/common/data/signals.c
index cb29d32a1a..7c3df373f9 100644
--- a/usr/src/lib/libshell/common/data/signals.c
+++ b/usr/src/lib/libshell/common/data/signals.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -25,7 +25,7 @@
# define SIGCHLD SIGCLD
#endif
-#define VAL(sig,mode) ((sig+1)|(mode)<<SH_SIGBITS)
+#define VAL(sig,mode) ((sig+1)|((mode)<<SH_SIGBITS))
#define TRAP(n) (((n)|SH_TRAP)-1)
#ifndef ERROR_dictionary
@@ -55,6 +55,9 @@ const struct shtable2 shtab_signals[] =
#ifdef SIGBUS
"BUS", VAL(SIGBUS,SH_SIGDONE), S("Bus error"),
#endif /* SIGBUS */
+#ifdef SIGCANCEL
+ "CANCEL", VAL(SIGCANCEL,SH_SIGIGNORE), S("Thread cancellation"),
+#endif /*SIGCANCEL */
#ifdef SIGCHLD
"CHLD", VAL(SIGCHLD,SH_SIGFAULT), S("Death of Child"),
# ifdef SIGCLD
@@ -71,6 +74,9 @@ const struct shtable2 shtab_signals[] =
"CONT", VAL(SIGCONT,SH_SIGIGNORE), S("Stopped process continued"),
#endif /* SIGCONT */
"DEBUG", VAL(TRAP(SH_DEBUGTRAP),0), "",
+#ifdef SIGDANGER
+ "DANGER", VAL(SIGDANGER,0), S("System crash soon"),
+#endif /* SIGDANGER */
#ifdef SIGDIL
"DIL", VAL(SIGDIL,0), S("DIL signal"),
#endif /* SIGDIL */
@@ -99,6 +105,12 @@ const struct shtable2 shtab_signals[] =
#ifdef SIGIOT
"IOT", VAL(SIGIOT,SH_SIGDONE), S("Abort"),
#endif /* SIGIOT */
+#ifdef SIGJVM1
+ "JVM1", VAL(SIGJVM1,SH_SIGIGNORE), S("Special signal used by Java Virtual Machine"),
+#endif /*SIGJVM1 */
+#ifdef SIGJVM2
+ "JVM2", VAL(SIGJVM2,SH_SIGIGNORE), S("Special signal used by Java Virtual Machine"),
+#endif /*SIGJVM2 */
"KEYBD", VAL(TRAP(SH_KEYTRAP),0), "",
#ifdef SIGKILL
"KILL", VAL(SIGKILL,0), S("Killed"),
@@ -135,31 +147,13 @@ const struct shtable2 shtab_signals[] =
#endif /* SIGPWR */
#ifdef SIGQUIT
"QUIT", VAL(SIGQUIT,SH_SIGDONE|SH_SIGINTERACTIVE), S("Quit"),
-#ifdef __SIGRTMIN
-#undef SIGRTMIN
-#define SIGRTMIN __SIGRTMIN
-#else
-#ifdef _SIGRTMIN
-#undef SIGRTMIN
-#define SIGRTMIN _SIGRTMIN
-#endif
-#endif
+#endif /* SIGQUIT */
#ifdef SIGRTMIN
- "RTMIN", VAL(SIGRTMIN,0), S("Lowest priority realtime signal"),
+ "RTMIN", VAL(SH_SIGRTMIN,SH_SIGRUNTIME), S("Lowest priority realtime signal"),
#endif /* SIGRTMIN */
-#ifdef __SIGRTMAX
-#undef SIGRTMAX
-#define SIGRTMAX __SIGRTMAX
-#else
-#ifdef _SIGRTMAX
-#undef SIGRTMAX
-#define SIGRTMAX _SIGRTMAX
-#endif
-#endif
#ifdef SIGRTMAX
- "RTMAX", VAL(SIGRTMAX,0), S("Highest priority realtime signal"),
+ "RTMAX", VAL(SH_SIGRTMAX,SH_SIGRUNTIME), S("Highest priority realtime signal"),
#endif /* SIGRTMAX */
-#endif /* SIGQUIT */
"SEGV", VAL(SIGSEGV,0), S("Memory fault"),
#ifdef SIGSTOP
"STOP", VAL(SIGSTOP,0), S("Stopped (SIGSTOP)"),
@@ -205,9 +199,6 @@ const struct shtable2 shtab_signals[] =
#ifdef SIGMIGRATE
"MIGRATE", VAL(SIGMIGRATE,0), S("Migrate process"),
#endif /* SIGMIGRATE */
-#ifdef SIGDANGER
- "DANGER", VAL(SIGDANGER,0), S("System crash soon"),
-#endif /* SIGDANGER */
#ifdef SIGSOUND
"SOUND", VAL(SIGSOUND,0), S("Sound completed"),
#endif /* SIGSOUND */
@@ -223,5 +214,8 @@ const struct shtable2 shtab_signals[] =
#ifdef SIGXFSZ
"XFSZ", VAL(SIGXFSZ,SH_SIGDONE|SH_SIGINTERACTIVE), S("Exceeded file size limit"),
#endif /* SIGXFSZ */
+#ifdef SIGXRES
+ "XRES", VAL(SIGXRES,SH_SIGDONE|SH_SIGINTERACTIVE), S("Exceeded resource control"),
+#endif /* SIGRES */
"", 0, 0
};
diff --git a/usr/src/lib/libshell/common/data/solaris_cmdlist.h b/usr/src/lib/libshell/common/data/solaris_cmdlist.h
index d12e2c0ddb..29c75aaa7d 100644
--- a/usr/src/lib/libshell/common/data/solaris_cmdlist.h
+++ b/usr/src/lib/libshell/common/data/solaris_cmdlist.h
@@ -20,14 +20,12 @@
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-#ifndef _SOLARIS_CMDLIST_H
-#define _SOLARIS_CMDLIST_H
-
-#pragma ident "%Z%%M% %I% %E% SMI"
+#ifndef _SOLARIS_KSH_CMDLIST_H
+#define _SOLARIS_KSH_CMDLIST_H
#ifdef __cplusplus
extern "C" {
@@ -42,19 +40,32 @@ extern "C" {
/* POSIX compatible commands */
#ifdef _NOT_YET
-#define XPG6CMDLIST(f) { "/usr/xpg6/bin/" #f, NV_BLTIN|NV_NOFREE, bltin(f) },
-#define XPG4CMDLIST(f) { "/usr/xpg4/bin/" #f, NV_BLTIN|NV_NOFREE, bltin(f) },
+#define XPG6CMDLIST(f) \
+ { "/usr/xpg6/bin/" #f, NV_BLTIN|NV_BLTINOPT|NV_NOFREE, bltin(f) },
+#define XPG4CMDLIST(f) \
+ { "/usr/xpg4/bin/" #f, NV_BLTIN|NV_BLTINOPT|NV_NOFREE, bltin(f) },
#else
#define XPG6CMDLIST(f)
#define XPG4CMDLIST(f)
#endif /* NOT_YET */
/*
* Commands which are 100% compatible with native Solaris versions (/bin is
- * a softlink to ./usr/bin so both need to be listed here)
+ * a softlink to ./usr/bin, ksh93 takes care about the lookup)
+ */
+#define BINCMDLIST(f) \
+ { "/bin/" #f, NV_BLTIN|NV_BLTINOPT|NV_NOFREE, bltin(f) },
+#define USRBINCMDLIST(f) \
+ { "/usr/bin/" #f, NV_BLTIN|NV_BLTINOPT|NV_NOFREE, bltin(f) },
+#define SBINCMDLIST(f) \
+ { "/sbin/" #f, NV_BLTIN|NV_BLTINOPT|NV_NOFREE, bltin(f) },
+#define SUSRBINCMDLIST(f) \
+ { "/usr/sbin/" #f, NV_BLTIN|NV_BLTINOPT|NV_NOFREE, bltin(f) },
+/*
+ * Make all ksh93 builtins accessible when /usr/ast/bin was added to
+ * /usr/xpg6/bin:/usr/xpg4/bin:/usr/ccs/bin:/usr/bin:/bin:/opt/SUNWspro/bin
*/
-#define BINCMDLIST(f) { "/bin/" #f, NV_BLTIN|NV_NOFREE, bltin(f) },
-/* Make all ksh93 builtins accessible when /usr/ast/bin was added to ${PATH} */
-#define ASTCMDLIST(f) { "/usr/ast/bin/" #f, NV_BLTIN|NV_NOFREE, bltin(f) },
+#define ASTCMDLIST(f) \
+ { "/usr/ast/bin/" #f, NV_BLTIN|NV_BLTINOPT|NV_NOFREE, bltin(f) },
/* undo ast_map.h #defines to avoid collision */
#undef basename
@@ -91,14 +102,17 @@ ASTCMDLIST(id)
ASTCMDLIST(join)
XPG4CMDLIST(ln)
ASTCMDLIST(ln)
+BINCMDLIST(logname)
ASTCMDLIST(logname)
BINCMDLIST(mkdir)
ASTCMDLIST(mkdir)
+BINCMDLIST(mkfifo)
ASTCMDLIST(mkfifo)
XPG4CMDLIST(mv)
ASTCMDLIST(mv)
ASTCMDLIST(paste)
ASTCMDLIST(pathchk)
+BINCMDLIST(rev)
ASTCMDLIST(rev)
XPG4CMDLIST(rm)
ASTCMDLIST(rm)
@@ -106,17 +120,23 @@ BINCMDLIST(rmdir)
ASTCMDLIST(rmdir)
XPG4CMDLIST(stty)
ASTCMDLIST(stty)
+BINCMDLIST(sum)
+ASTCMDLIST(sum)
+SUSRBINCMDLIST(sync)
+SBINCMDLIST(sync)
+BINCMDLIST(sync)
+ASTCMDLIST(sync)
XPG4CMDLIST(tail)
ASTCMDLIST(tail)
BINCMDLIST(tee)
ASTCMDLIST(tee)
+BINCMDLIST(tty)
ASTCMDLIST(tty)
ASTCMDLIST(uname)
BINCMDLIST(uniq)
ASTCMDLIST(uniq)
BINCMDLIST(wc)
ASTCMDLIST(wc)
-/* End-of-generated-data. */
/* Mandatory for ksh93 test suite and AST scripts */
BINCMDLIST(getconf)
@@ -125,4 +145,4 @@ BINCMDLIST(getconf)
}
#endif
-#endif /* _SOLARIS_CMDLIST_H */
+#endif /* !_SOLARIS_KSH_CMDLIST_H */
diff --git a/usr/src/lib/libshell/common/data/strdata.c b/usr/src/lib/libshell/common/data/strdata.c
index 57689b68a3..f980c834f3 100644
--- a/usr/src/lib/libshell/common/data/strdata.c
+++ b/usr/src/lib/libshell/common/data/strdata.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libshell/common/data/testops.c b/usr/src/lib/libshell/common/data/testops.c
index 449ca99efb..e00e4857c9 100644
--- a/usr/src/lib/libshell/common/data/testops.c
+++ b/usr/src/lib/libshell/common/data/testops.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libshell/common/data/variables.c b/usr/src/lib/libshell/common/data/variables.c
index 9042e235b0..65b1985d29 100644
--- a/usr/src/lib/libshell/common/data/variables.c
+++ b/usr/src/lib/libshell/common/data/variables.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -26,6 +26,7 @@
#include "shtable.h"
#include "name.h"
#include "defs.h"
+#include "variables.h"
/*
* This is the list of built-in shell variables and default values
@@ -75,6 +76,7 @@ const struct shtable2 shtab_variables[] =
"LC_MESSAGES", 0, (char*)0,
"LC_NUMERIC", 0, (char*)0,
"FIGNORE", 0, (char*)0,
+ "KSH_VERSION", 0, (char*)0,
".sh", NV_TABLE|NV_RDONLY|NV_NOFREE|NV_NOPRINT,(char*)0,
".sh.edchar", 0, (char*)0,
".sh.edcol", 0, (char*)0,
@@ -91,6 +93,9 @@ const struct shtable2 shtab_variables[] =
".sh.fun", 0, (char*)0,
".sh.subshell", NV_INTEGER|NV_SHORT|NV_NOFREE, (char*)0,
".sh.level", 0, (char*)0,
+ ".sh.lineno", NV_INTEGER|NV_RDONLY, (char*)0,
+ ".sh.stats", NV_RDONLY, (char*)0,
+ "SHLVL", NV_INTEGER|NV_NOFREE|NV_EXPORT, (char*)0,
#if SHOPT_FS_3D
"VPATH", 0, (char*)0,
#endif /* SHOPT_FS_3D */
@@ -103,3 +108,25 @@ const struct shtable2 shtab_variables[] =
"", 0, (char*)0
};
+const char *nv_discnames[] = { "get", "set", "append", "unset", 0 };
+
+#ifdef SHOPT_STATS
+const Shtable_t shtab_stats[] =
+{
+ "arg_cachehits", STAT_ARGHITS,
+ "arg_expands", STAT_ARGEXPAND,
+ "comsubs", STAT_COMSUB,
+ "forks", STAT_FORKS,
+ "funcalls", STAT_FUNCT,
+ "globs", STAT_GLOBS,
+ "linesread", STAT_READS,
+ "nv_cachehit", STAT_NVHITS,
+ "nv_opens", STAT_NVOPEN,
+ "pathsearch", STAT_PATHS,
+ "posixfuncall", STAT_SVFUNCT,
+ "simplecmds", STAT_SCMDS,
+ "spawns", STAT_SPAWN,
+ "subshell", STAT_SUBSHELL
+};
+#endif /* SHOPT_STATS */
+
diff --git a/usr/src/lib/libshell/common/edit/completion.c b/usr/src/lib/libshell/common/edit/completion.c
index 050019fbe5..54b4212470 100644
--- a/usr/src/lib/libshell/common/edit/completion.c
+++ b/usr/src/lib/libshell/common/edit/completion.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -68,7 +68,8 @@ static char *overlaid(register char *str,register const char *newstr,int nocase)
static char *find_begin(char outbuff[], char *last, int endchar, int *type)
{
register char *cp=outbuff, *bp, *xp;
- register int c,inquote = 0;
+ register int c,inquote = 0, inassign=0;
+ int mode=*type;
bp = outbuff;
*type = 0;
while(cp < last)
@@ -94,7 +95,7 @@ static char *find_begin(char outbuff[], char *last, int endchar, int *type)
if(inquote == '\'')
break;
c = *(unsigned char*)cp;
- if(isaletter(c) || c=='{')
+ if(mode!='*' && (isaletter(c) || c=='{'))
{
int dot = '.';
if(c=='{')
@@ -112,7 +113,7 @@ static char *find_begin(char outbuff[], char *last, int endchar, int *type)
if((c= mbchar(cp)) , c!=dot && !isaname(c))
break;
}
- if(cp>=last)
+ if(cp>=last && c!= '}')
{
*type='$';
return(++xp);
@@ -120,6 +121,7 @@ static char *find_begin(char outbuff[], char *last, int endchar, int *type)
}
else if(c=='(')
{
+ *type = mode;
xp = find_begin(cp,last,')',type);
if(*(cp=xp)!=')')
bp = xp;
@@ -129,6 +131,13 @@ static char *find_begin(char outbuff[], char *last, int endchar, int *type)
break;
case '=':
if(!inquote)
+ {
+ bp = cp;
+ inassign = 1;
+ }
+ break;
+ case ':':
+ if(!inquote && inassign)
bp = cp;
break;
case '~':
@@ -139,7 +148,10 @@ static char *find_begin(char outbuff[], char *last, int endchar, int *type)
if(c && c==endchar)
return(xp);
if(!inquote && ismeta(c))
+ {
bp = cp;
+ inassign = 0;
+ }
break;
}
}
@@ -172,7 +184,7 @@ int ed_expand(Edit_t *ep, char outbuff[],int *cur,int *eol,int mode, int count)
{
if(count> ep->e_nlist)
return(-1);
- mode = '*';
+ mode = '?';
av[0] = ep->e_clist[count-1];
av[1] = 0;
}
@@ -207,6 +219,7 @@ int ed_expand(Edit_t *ep, char outbuff[],int *cur,int *eol,int mode, int count)
register int c;
char *last = out;
c = *(unsigned char*)out;
+ var = mode;
begin = out = find_begin(outbuff,last,0,&var);
/* addstar set to zero if * should not be added */
if(var=='$')
@@ -234,6 +247,8 @@ int ed_expand(Edit_t *ep, char outbuff[],int *cur,int *eol,int mode, int count)
out++;
}
}
+ if(mode=='?')
+ mode = '*';
if(var!='$' && mode=='\\' && out[-1]!='*')
addstar = '*';
if(*begin=='~' && !strchr(begin,'/'))
@@ -264,7 +279,7 @@ int ed_expand(Edit_t *ep, char outbuff[],int *cur,int *eol,int mode, int count)
}
else
{
- com = sh_argbuild(&narg,comptr,0);
+ com = sh_argbuild(ep->sh,&narg,comptr,0);
/* special handling for leading quotes */
if(begin>outbuff && (begin[-1]=='"' || begin[-1]=='\''))
begin--;
@@ -373,14 +388,9 @@ int ed_expand(Edit_t *ep, char outbuff[],int *cur,int *eol,int mode, int count)
{
Namval_t *np;
/* add as tracked alias */
-#ifdef PATH_BFPATH
Pathcomp_t *pp;
if(*cp=='/' && (pp=path_dirfind(sh.pathlist,cp,'/')) && (np=nv_search(begin,sh.track_tree,NV_ADD)))
path_alias(np,pp);
-#else
- if(*cp=='/' && (np=nv_search(begin,sh.track_tree,NV_ADD)))
- path_alias(np,cp);
-#endif
out = strcopy(begin,cp);
}
/* add quotes if necessary */
diff --git a/usr/src/lib/libshell/common/edit/edit.c b/usr/src/lib/libshell/common/edit/edit.c
index a832a4a965..fbee33ca57 100644
--- a/usr/src/lib/libshell/common/edit/edit.c
+++ b/usr/src/lib/libshell/common/edit/edit.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -53,6 +53,8 @@
static char CURSOR_UP[20] = { ESC, '[', 'A', 0 };
+
+
#if SHOPT_MULTIBYTE
# define is_cntrl(c) ((c<=STRIP) && iscntrl(c))
# define is_print(c) ((c&~STRIP) || isprint(c))
@@ -583,34 +585,39 @@ void ed_crlf(register Edit_t *ep)
void ed_setup(register Edit_t *ep, int fd, int reedit)
{
+ Shell_t *shp = ep->sh;
register char *pp;
- register char *last;
+ register char *last, *prev;
char *ppmax;
int myquote = 0, n;
- register int qlen = 1;
+ register int qlen = 1, qwid;
char inquote = 0;
ep->e_fd = fd;
ep->e_multiline = sh_isoption(SH_MULTILINE)!=0;
#ifdef SIGWINCH
- if(!(sh.sigflag[SIGWINCH]&SH_SIGFAULT))
+ if(!(shp->sigflag[SIGWINCH]&SH_SIGFAULT))
{
signal(SIGWINCH,sh_fault);
- sh.sigflag[SIGWINCH] |= SH_SIGFAULT;
+ shp->sigflag[SIGWINCH] |= SH_SIGFAULT;
}
+ pp = shp->st.trapcom[SIGWINCH];
+ shp->st.trapcom[SIGWINCH] = 0;
sh_fault(SIGWINCH);
+ shp->st.trapcom[SIGWINCH] = pp;
+ ep->sh->winch = 0;
#endif
#if KSHELL
ep->e_stkptr = stakptr(0);
ep->e_stkoff = staktell();
- if(!(last = sh.prompt))
+ if(!(last = shp->prompt))
last = "";
- sh.prompt = 0;
+ shp->prompt = 0;
#else
last = ep->e_prbuff;
#endif /* KSHELL */
- if(sh.hist_ptr)
+ if(shp->hist_ptr)
{
- register History_t *hp = sh.hist_ptr;
+ register History_t *hp = shp->hist_ptr;
ep->e_hismax = hist_max(hp);
ep->e_hismin = hist_min(hp);
}
@@ -631,7 +638,7 @@ void ed_setup(register Edit_t *ep, int fd, int reedit)
*pp++ = '\r';
{
register int c;
- while(c= *last++) switch(c)
+ while(prev = last, c = mbchar(last)) switch(c)
{
case ESC:
{
@@ -642,7 +649,7 @@ void ed_setup(register Edit_t *ep, int fd, int reedit)
{
if(pp < ppmax)
*pp++ = c;
- if(c=='\a')
+ if(c=='\a' || c==ESC || c=='\r')
break;
if(skip || (c>='0' && c<='9'))
continue;
@@ -651,6 +658,8 @@ void ed_setup(register Edit_t *ep, int fd, int reedit)
else if(n>2 || (c!= '[' && c!= ']'))
break;
}
+ if(c==0 || c==ESC || c=='\r')
+ last--;
qlen += (n+1);
break;
}
@@ -693,17 +702,22 @@ void ed_setup(register Edit_t *ep, int fd, int reedit)
}
if(pp < ppmax)
{
- qlen += inquote;
- *pp++ = c;
- if(!inquote && !is_print(c))
+ if(inquote)
+ qlen++;
+ else if(!is_print(c))
ep->e_crlf = 0;
+ if((qwid = last - prev) > 1)
+ qlen += qwid - mbwidth(c);
+ while(prev < last && pp < ppmax)
+ *pp++ = *prev++;
}
+ break;
}
}
if(pp-ep->e_prompt > qlen)
ep->e_plen = pp - ep->e_prompt - qlen;
*pp = 0;
- if((ep->e_wsize -= ep->e_plen) < 7)
+ if(!ep->e_multiline && (ep->e_wsize -= ep->e_plen) < 7)
{
register int shift = 7-ep->e_wsize;
ep->e_wsize = 7;
@@ -736,7 +750,7 @@ void ed_setup(register Edit_t *ep, int fd, int reedit)
#ifdef _cmd_tput
char *term;
if(!ep->e_term)
- ep->e_term = nv_search("TERM",sh.var_tree,0);
+ ep->e_term = nv_search("TERM",shp->var_tree,0);
if(ep->e_term && (term=nv_getval(ep->e_term)) && strlen(term)<sizeof(ep->e_termname) && strcmp(term,ep->e_termname))
{
sh_trap(".sh.subscript=$(tput cuu1 2>/dev/null)",0);
@@ -746,7 +760,7 @@ void ed_setup(register Edit_t *ep, int fd, int reedit)
strcpy(ep->e_termname,term);
}
#endif
- ep->e_wsize = MAXLINE - (ep->e_plen-2);
+ ep->e_wsize = MAXLINE - (ep->e_plen+1);
}
if(ep->e_default && (pp = nv_getval(ep->e_default)))
{
@@ -760,6 +774,19 @@ void ed_setup(register Edit_t *ep, int fd, int reedit)
}
}
+static void ed_putstring(register Edit_t *ep, const char *str)
+{
+ register int c;
+ while(c = *str++)
+ ed_putchar(ep,c);
+}
+
+static void ed_nputchar(register Edit_t *ep, int n, int c)
+{
+ while(n-->0)
+ ed_putchar(ep,c);
+}
+
/*
* Do read, restart on interrupt unless SH_SIGSET or SH_SIGTRAP is set
* Use sfpkrd() to poll() or select() to wait for input if possible
@@ -774,8 +801,9 @@ int ed_read(void *context, int fd, char *buff, int size, int reedit)
register Edit_t *ep = (Edit_t*)context;
register int rv= -1;
register int delim = (ep->e_raw==RAWMODE?'\r':'\n');
+ Shell_t *shp = ep->sh;
int mode = -1;
- int (*waitevent)(int,long,int) = sh.waitevent;
+ int (*waitevent)(int,long,int) = shp->waitevent;
if(ep->e_raw==ALTMODE)
mode = 1;
if(size < 0)
@@ -785,11 +813,53 @@ int ed_read(void *context, int fd, char *buff, int size, int reedit)
}
sh_onstate(SH_TTYWAIT);
errno = EINTR;
- sh.waitevent = 0;
+ shp->waitevent = 0;
while(rv<0 && errno==EINTR)
{
- if(sh.trapnote&(SH_SIGSET|SH_SIGTRAP))
+ if(shp->trapnote&(SH_SIGSET|SH_SIGTRAP))
goto done;
+ if(ep->sh->winch)
+ {
+ Edpos_t lastpos;
+ int n, rows, newsize;
+ /* move cursor to start of first line */
+ ed_putchar(ep,'\r');
+ ed_flush(ep);
+ astwinsize(2,&rows,&newsize);
+ n = (ep->e_plen+ep->e_cur)/++ep->e_winsz;
+ while(n--)
+ ed_putstring(ep,CURSOR_UP);
+ if(ep->e_multiline && newsize>ep->e_winsz && (lastpos.line=(ep->e_plen+ep->e_peol)/ep->e_winsz))
+ {
+ /* clear the current command line */
+ n = lastpos.line;
+ while(lastpos.line--)
+ {
+ ed_nputchar(ep,ep->e_winsz,' ');
+ ed_putchar(ep,'\n');
+ }
+ ed_nputchar(ep,ep->e_winsz,' ');
+ while(n--)
+ ed_putstring(ep,CURSOR_UP);
+ }
+ ep->sh->winch = 0;
+ ed_flush(ep);
+ sh_delay(.05);
+ astwinsize(2,&rows,&newsize);
+ ep->e_winsz = newsize-1;
+ if(!ep->e_multiline && ep->e_wsize < MAXLINE)
+ ep->e_wsize = ep->e_winsz-2;
+ ep->e_nocrnl=1;
+ if(*ep->e_vi_insert)
+ {
+ buff[0] = ESC;
+ buff[1] = cntl('L');
+ buff[2] = 'a';
+ return(3);
+ }
+ buff[0] = cntl('L');
+ return(1);
+ }
/* an interrupt that should be ignored */
errno = 0;
if(!waitevent || (rv=(*waitevent)(fd,-1L,0))>=0)
@@ -824,7 +894,7 @@ int ed_read(void *context, int fd, char *buff, int size, int reedit)
rv = read(fd,buff,size);
if(rv>=0 || errno!=EINTR)
break;
- if(sh.trapnote&(SH_SIGSET|SH_SIGTRAP))
+ if(shp->trapnote&(SH_SIGSET|SH_SIGTRAP))
goto done;
/* an interrupt that should be ignored */
fixtime();
@@ -833,7 +903,7 @@ int ed_read(void *context, int fd, char *buff, int size, int reedit)
else if(rv>=0 && mode>0)
rv = read(fd,buff,rv>0?rv:1);
done:
- sh.waitevent = waitevent;
+ shp->waitevent = waitevent;
sh_offstate(SH_TTYWAIT);
return(rv);
}
@@ -952,15 +1022,17 @@ int ed_getchar(register Edit_t *ep,int mode)
ed_flush(ep);
ep->e_inmacro = 0;
/* The while is necessary for reads of partial multbyte chars */
+ *ep->e_vi_insert = (mode==-2);
if((n=ed_read(ep,ep->e_fd,readin,-LOOKAHEAD,0)) > 0)
n = putstack(ep,readin,n,1);
+ *ep->e_vi_insert = 0;
}
if(ep->e_lookahead)
{
/* check for possible key mapping */
if((c = ep->e_lbuf[--ep->e_lookahead]) < 0)
{
- if(mode<=0 && sh.st.trap[SH_KEYTRAP])
+ if(mode<=0 && ep->sh->st.trap[SH_KEYTRAP])
{
n=1;
if((readin[0]= -c) == ESC)
@@ -1025,6 +1097,8 @@ void ed_putchar(register Edit_t *ep,register int c)
char buf[8];
register char *dp = ep->e_outptr;
register int i,size=1;
+ if(!dp)
+ return;
buf[0] = c;
#if SHOPT_MULTIBYTE
/* check for place holder */
@@ -1075,7 +1149,14 @@ Edpos_t ed_curpos(Edit_t *ep,genchar *phys, int off, int cur, Edpos_t curpos)
col = pos.col;
}
else
+ {
pos.line = 0;
+ while(col > ep->e_winsz)
+ {
+ pos.line++;
+ col -= (ep->e_winsz+1);
+ }
+ }
while(off-->0)
{
if(c)
@@ -1097,60 +1178,69 @@ Edpos_t ed_curpos(Edit_t *ep,genchar *phys, int off, int cur, Edpos_t curpos)
return(pos);
}
-static void ed_putstring(register Edit_t *ep, const char *str)
-{
- register int c;
- while(c = *str++)
- ed_putchar(ep,c);
-}
-
int ed_setcursor(register Edit_t *ep,genchar *physical,register int old,register int new,int first)
{
static int oldline;
register int delta;
+ int clear = 0;
Edpos_t newpos;
delta = new - old;
- if( delta == 0 )
+ if(first < 0)
+ {
+ first = 0;
+ clear = 1;
+ }
+ if( delta == 0 && !clear)
return(new);
if(ep->e_multiline)
{
ep->e_curpos = ed_curpos(ep, physical, old,0,ep->e_curpos);
+ if(clear && old>=ep->e_peol && (clear=ep->e_winsz-ep->e_curpos.col)>0)
+ {
+ ed_nputchar(ep,clear,' ');
+ ed_nputchar(ep,clear,'\b');
+ return(new);
+ }
newpos = ed_curpos(ep, physical, new,old,ep->e_curpos);
if(ep->e_curpos.col==0 && ep->e_curpos.line>0 && oldline<ep->e_curpos.line && delta<0)
ed_putstring(ep,"\r\n");
oldline = newpos.line;
if(ep->e_curpos.line > newpos.line)
{
- int n;
+ int n,pline,plen=ep->e_plen;
for(;ep->e_curpos.line > newpos.line; ep->e_curpos.line--)
ed_putstring(ep,CURSOR_UP);
- if(newpos.line==0 && (n=ep->e_plen- ep->e_curpos.col)>0)
+ pline = plen/(ep->e_winsz+1);
+ if(newpos.line <= pline)
+ plen -= pline*(ep->e_winsz+1);
+ else
+ plen = 0;
+ if((n=plen- ep->e_curpos.col)>0)
{
ep->e_curpos.col += n;
ed_putchar(ep,'\r');
- if(!ep->e_crlf)
+ if(!ep->e_crlf && pline==0)
ed_putstring(ep,ep->e_prompt);
else
{
- int m = ep->e_winsz+1-ep->e_plen;
+ int m = ep->e_winsz+1-plen;
ed_putchar(ep,'\n');
- n = ep->e_plen;
+ n = plen;
if(m < ed_genlen(physical))
{
while(physical[m] && n-->0)
ed_putchar(ep,physical[m++]);
}
- while(n-->0)
- ed_putchar(ep,' ');
+ ed_nputchar(ep,n,' ');
ed_putstring(ep,CURSOR_UP);
}
}
}
else if(ep->e_curpos.line < newpos.line)
{
- for(;ep->e_curpos.line < newpos.line;ep->e_curpos.line++)
- ed_putchar(ep,'\n');
+ ed_nputchar(ep, newpos.line-ep->e_curpos.line,'\n');
+ ep->e_curpos.line = newpos.line;
ed_putchar(ep,'\r');
ep->e_curpos.col = 0;
}
@@ -1161,18 +1251,24 @@ int ed_setcursor(register Edit_t *ep,genchar *physical,register int old,register
newpos.line=0;
if(delta<0)
{
+ int bs= newpos.line && ep->e_plen>ep->e_winsz;
/*** move to left ***/
delta = -delta;
/*** attempt to optimize cursor movement ***/
- if(!ep->e_crlf || (2*delta <= ((old-first)+(newpos.line?0:ep->e_plen))) )
+ if(!ep->e_crlf || bs || (2*delta <= ((old-first)+(newpos.line?0:ep->e_plen))) )
{
- for( ; delta; delta-- )
- ed_putchar(ep,'\b');
+ ed_nputchar(ep,delta,'\b');
+ delta = 0;
}
else
{
if(newpos.line==0)
ed_putstring(ep,ep->e_prompt);
+ else
+ {
+ first = 1+(newpos.line*ep->e_winsz - ep->e_plen);
+ ed_putchar(ep,'\r');
+ }
old = first;
delta = new-first;
}
@@ -1244,6 +1340,7 @@ int ed_virt_to_phys(Edit_t *ep,genchar *virt,genchar *phys,int cur,int voff,int
break;
}
*dp = 0;
+ ep->e_peol = dp-phys;
return(r);
}
@@ -1375,8 +1472,7 @@ static int compare(register const char *a,register const char *b,register int n)
* This version will use termios when possible, otherwise termio
*/
-
-tcgetattr(int fd, struct termios *tt)
+int tcgetattr(int fd, struct termios *tt)
{
register Edit_t *ep = (Edit_t*)(sh_getinterp()->ed_context);
register int r,i;
@@ -1398,7 +1494,7 @@ tcgetattr(int fd, struct termios *tt)
return(r);
}
-tcsetattr(int fd,int mode,struct termios *tt)
+int tcsetattr(int fd,int mode,struct termios *tt)
{
register Edit_t *ep = (Edit_t*)(sh_getinterp()->ed_context);
register int r;
@@ -1446,6 +1542,7 @@ static int keytrap(Edit_t *ep,char *inbuff,register int insize, int bufsize, int
{
register char *cp;
int savexit;
+ Shell_t *shp = ep->sh;
#if SHOPT_MULTIBYTE
char buff[MAXLINE];
ed_external(ep->e_inbuf,cp=buff);
@@ -1465,16 +1562,19 @@ static int keytrap(Edit_t *ep,char *inbuff,register int insize, int bufsize, int
nv_putval(ED_COLNOD,(char*)&ep->e_col,NV_NOFREE|NV_INTEGER);
nv_putval(ED_TXTNOD,(char*)cp,NV_NOFREE);
nv_putval(ED_MODENOD,ep->e_vi_insert,NV_NOFREE);
- savexit = sh.savexit;
- sh_trap(sh.st.trap[SH_KEYTRAP],0);
- sh.savexit = savexit;
+ savexit = shp->savexit;
+ sh_trap(shp->st.trap[SH_KEYTRAP],0);
+ shp->savexit = savexit;
if((cp = nv_getval(ED_CHRNOD)) == inbuff)
nv_unset(ED_CHRNOD);
- else
+ else if(bufsize>0)
{
strncpy(inbuff,cp,bufsize);
+ inbuff[bufsize-1]='\0';
insize = strlen(inbuff);
}
+ else
+ insize = 0;
nv_unset(ED_TXTNOD);
return(insize);
}
diff --git a/usr/src/lib/libshell/common/edit/emacs.c b/usr/src/lib/libshell/common/edit/emacs.c
index 0882693cc9..02842994ab 100644
--- a/usr/src/lib/libshell/common/edit/emacs.c
+++ b/usr/src/lib/libshell/common/edit/emacs.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -108,6 +108,7 @@ typedef struct _emacs_
char CntrlO;
char overflow; /* Screen overflow flag set */
char scvalid; /* Screen is up to date */
+ char lastdraw; /* last update type */
int offset; /* Screen offset */
enum
{
@@ -195,6 +196,7 @@ int ed_emacsread(void *context, int fd,char *buff,int scend, int reedit)
}
Prompt = prompt;
ep->screen = Screen;
+ ep->lastdraw = FINAL;
if(tty_raw(ERRIO,0) < 0)
{
return(reedit?reedit:ed_read(context, fd,buff,scend,0));
@@ -206,7 +208,6 @@ int ed_emacsread(void *context, int fd,char *buff,int scend, int reedit)
out = (genchar*)buff;
#if SHOPT_MULTIBYTE
out = (genchar*)roundof((char*)out-(char*)0,sizeof(genchar));
- ed_internal(buff,out);
#endif /* SHOPT_MULTIBYTE */
if(!kstack)
{
@@ -231,6 +232,12 @@ int ed_emacsread(void *context, int fd,char *buff,int scend, int reedit)
i = sigsetjmp(env,0);
if (i !=0)
{
+ if(ep->ed->e_multiline)
+ {
+ cur = eol;
+ draw(ep,FINAL);
+ ed_flush(ep->ed);
+ }
tty_cooked(ERRIO);
if (i == UEOF)
{
@@ -588,8 +595,10 @@ update:
}
continue;
case cntl('L'):
- ed_crlf(ep->ed);
+ if(!ep->ed->e_nocrnl)
+ ed_crlf(ep->ed);
draw(ep,REFRESH);
+ ep->ed->e_nocrnl = 0;
continue;
case cntl('[') :
do_escape:
@@ -649,6 +658,8 @@ update:
location.hist_command = hline; /* save current position */
location.hist_line = hloff;
#endif
+ cur = 0;
+ draw(ep,UPDATE);
hist_copy((char*)out,MAXLINE, hline,hloff);
#if SHOPT_MULTIBYTE
ed_internal((char*)(out),out);
@@ -1000,6 +1011,26 @@ static int escape(register Emacs_t* ep,register genchar *out,int count)
switch(i=ed_getchar(ep->ed,1))
{
case 'A':
+ if(cur>0 && eol==cur && (cur<(SEARCHSIZE-2) || ep->prevdirection == -2))
+ {
+ if(ep->lastdraw==APPEND && ep->prevdirection != -2)
+ {
+ out[cur] = 0;
+ gencpy(&((genchar*)lstring)[1],out);
+#if SHOPT_MULTIBYTE
+ ed_external(&((genchar*)lstring)[1],lstring+1);
+#endif /* SHOPT_MULTIBYTE */
+ *lstring = '^';
+ ep->prevdirection = -2;
+ }
+ if(*lstring)
+ {
+ ed_ungetchar(ep->ed,'\r');
+ ed_ungetchar(ep->ed,cntl('R'));
+ return(-1);
+ }
+ }
+ *lstring = 0;
ed_ungetchar(ep->ed,cntl('P'));
return(-1);
case 'B':
@@ -1189,6 +1220,8 @@ static void search(Emacs_t* ep,genchar *out,int direction)
}
i = genlen(string);
+ if(ep->prevdirection == -2 && i!=2 || direction!=1)
+ ep->prevdirection = -1;
if (direction < 1)
{
ep->prevdirection = -ep->prevdirection;
@@ -1264,6 +1297,7 @@ static void draw(register Emacs_t *ep,Draw_t option)
sptr = drawbuff;
logcursor = sptr + cur;
longline = NORMAL;
+ ep->lastdraw = option;
if (option == FIRST || option == REFRESH)
{
@@ -1377,6 +1411,9 @@ static void draw(register Emacs_t *ep,Draw_t option)
}
#endif /* SHOPT_MULTIBYTE */
}
+ if(ep->ed->e_multiline && option == REFRESH && ep->ed->e_nocrnl==0)
+ ed_setcursor(ep->ed, ep->screen, ep->cursor-ep->screen, ep->ed->e_peol, -1);
+
/******************
@@ -1407,7 +1444,7 @@ static void draw(register Emacs_t *ep,Draw_t option)
i = (ncursor-nscreen) - ep->offset;
setcursor(ep,i,0);
if(option==FINAL && ep->ed->e_multiline)
- setcursor(ep,nscend-nscreen,0);
+ setcursor(ep,nscend+1-nscreen,0);
ep->scvalid = 1;
return;
}
diff --git a/usr/src/lib/libshell/common/edit/hexpand.c b/usr/src/lib/libshell/common/edit/hexpand.c
index e9dbac5bcb..49444ca464 100644
--- a/usr/src/lib/libshell/common/edit/hexpand.c
+++ b/usr/src/lib/libshell/common/edit/hexpand.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libshell/common/edit/history.c b/usr/src/lib/libshell/common/edit/history.c
index f98140fc0f..da875d70c4 100644
--- a/usr/src/lib/libshell/common/edit/history.c
+++ b/usr/src/lib/libshell/common/edit/history.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -49,13 +49,23 @@
#define HIST_BSIZE 4096 /* size of history file buffer */
#define HIST_DFLT 512 /* default size of history list */
+#if SHOPT_AUDIT
+# define _HIST_AUDIT Sfio_t *auditfp; \
+ char *tty; \
+ int auditmask;
+#else
+# define _HIST_AUDIT
+#endif
+
#define _HIST_PRIVATE \
+ void *histshell; \
off_t histcnt; /* offset into history file */\
off_t histmarker; /* offset of last command marker */ \
int histflush; /* set if flushed outside of hflush() */\
int histmask; /* power of two mask for histcnt */ \
char histbuff[HIST_BSIZE+1]; /* history file buffer */ \
int histwfail; \
+ _HIST_AUDIT \
off_t histcmds[2]; /* offset for recent commands, must be last */
#define hist_ind(hp,c) ((int)((c)&(hp)->histmask))
@@ -96,7 +106,7 @@
int _Hist = 0;
static void hist_marker(char*,long);
-static void hist_trim(History_t*, int);
+static History_t* hist_trim(History_t*, int);
static int hist_nearend(History_t*,Sfio_t*, off_t);
static int hist_check(int);
static int hist_clean(int);
@@ -119,10 +129,10 @@ static History_t *hist_ptr;
static char *logname;
# include <pwd.h>
- int acctinit(void)
+ static int acctinit(History_t *hp)
{
register char *cp, *acctfile;
- Namval_t *np = nv_search("ACCTFILE",sh.var_tree,0);
+ Namval_t *np = nv_search("ACCTFILE",((Shell_t*)hp->histshell)->var_tree,0);
if(!np || !(acctfile=nv_getval(np)))
return(0);
@@ -135,7 +145,6 @@ static History_t *hist_ptr;
cp = "unknown";
}
logname = strdup(cp);
-
if((acctfd=sh_open(acctfile,
O_BINARY|O_WRONLY|O_APPEND|O_CREAT,S_IRUSR|S_IWUSR))>=0 &&
(unsigned)acctfd < 10)
@@ -164,6 +173,42 @@ static History_t *hist_ptr;
}
#endif /* SHOPT_ACCTFILE */
+#if SHOPT_AUDIT
+static int sh_checkaudit(History_t *hp, const char *name, char *logbuf, size_t len)
+{
+ Shell_t *shp = (Shell_t*)hp->histshell;
+ char *buff, *cp, *last;
+ int id1, id2, r=0, n, fd;
+ if((fd=open(name, O_RDONLY)) < 0)
+ return(0);
+ if((n = read(fd, logbuf,len-1)) < 0)
+ goto done;
+ while(logbuf[n-1]=='\n')
+ n--;
+ logbuf[n] = 0;
+ if(!(cp=strchr(logbuf,';')) && !(cp=strchr(logbuf,' ')))
+ goto done;
+ *cp = 0;
+ do
+ {
+ cp++;
+ id1 = id2 = strtol(cp,&last,10);
+ if(*last=='-')
+ id1 = strtol(last+1,&last,10);
+ if(shp->euserid >=id1 && shp->euserid <= id2)
+ r |= 1;
+ if(shp->userid >=id1 && shp->userid <= id2)
+ r |= 2;
+ cp = last;
+ }
+ while(*cp==';' || *cp==' ');
+done:
+ close(fd);
+ return(r);
+
+}
+#endif /*SHOPT_AUDIT*/
+
static const unsigned char hist_stamp[2] = { HIST_UNDO, HIST_VERSION };
static const Sfdisc_t hist_disc = { NULL, hist_write, NULL, hist_exceptf, NULL};
@@ -179,8 +224,9 @@ static void hist_touch(void *handle)
* cleaned up.
* hist_open() returns 1, if history file is open
*/
-int sh_histinit(void)
+int sh_histinit(void *sh_context)
{
+ Shell_t *shp = (Shell_t*)sh_context;
register int fd;
register History_t *hp;
register char *histname;
@@ -189,7 +235,7 @@ int sh_histinit(void)
register char *cp;
register off_t hsize = 0;
- if(sh.hist_ptr=hist_ptr)
+ if(shp->hist_ptr=hist_ptr)
return(1);
if(!(histname = nv_getval(HISTFILE)))
{
@@ -206,7 +252,7 @@ int sh_histinit(void)
{
/* reuse history file if same name */
wasopen = 0;
- sh.hist_ptr = hist_ptr = hp;
+ shp->hist_ptr = hist_ptr = hp;
if(strcmp(histname,hp->histname)==0)
return(1);
else
@@ -243,7 +289,7 @@ retry:
{
#if KSHELL
/* don't allow root a history_file in /tmp */
- if(sh.userid)
+ if(shp->userid)
#endif /* KSHELL */
{
if(!(fname = pathtmp(NIL(char*),0,0,NIL(int*))))
@@ -265,7 +311,8 @@ retry:
close(fd);
return(0);
}
- sh.hist_ptr = hist_ptr = hp;
+ shp->hist_ptr = hist_ptr = hp;
+ hp->histshell = (void*)shp;
hp->histsize = maxlines;
hp->histmask = histmask;
hp->histfp= sfnew(NIL(Sfio_t*),hp->histbuff,HIST_BSIZE,fd,SF_READ|SF_WRITE|SF_APPENDWR|SF_SHARE);
@@ -318,7 +365,7 @@ retry:
sfprintf(sfstderr,"%d: hist_trim hsize=%d\n",getpid(),hsize);
sfsync(sfstderr);
#endif /* DEBUG */
- hist_trim(hp,(int)hp->histind-maxlines);
+ hp = hist_trim(hp,(int)hp->histind-maxlines);
}
sfdisc(hp->histfp,&hp->histdisc);
#if KSHELL
@@ -327,8 +374,31 @@ retry:
sh_timeradd(1000L*(HIST_RECENT-30), 1, hist_touch, (void*)hp->histname);
#if SHOPT_ACCTFILE
if(sh_isstate(SH_INTERACTIVE))
- acctinit();
+ acctinit(hp);
#endif /* SHOPT_ACCTFILE */
+#if SHOPT_AUDIT
+ {
+ char buff[SF_BUFSIZE];
+ hp->auditfp = 0;
+ if(sh_isstate(SH_INTERACTIVE) && (hp->auditmask=sh_checkaudit(hp,SHOPT_AUDITFILE, buff, sizeof(buff))))
+ {
+ if((fd=sh_open(buff,O_BINARY|O_WRONLY|O_APPEND|O_CREAT,S_IRUSR|S_IWUSR))>=0 && fd < 10)
+ {
+ int n;
+ if((n = sh_fcntl(fd,F_DUPFD, 10)) >= 0)
+ {
+ sh_close(fd);
+ fd = n;
+ }
+ }
+ if(fd>=0)
+ {
+ hp->tty = strdup(ttyname(2));
+ hp->auditfp = sfnew((Sfio_t*)0,NULL,-1,fd,SF_WRITE);
+ }
+ }
+ }
+#endif
return(1);
}
@@ -338,10 +408,19 @@ retry:
void hist_close(register History_t *hp)
{
+ Shell_t *shp = (Shell_t*)hp->histshell;
sfclose(hp->histfp);
+#if SHOPT_AUDIT
+ if(hp->auditfp)
+ {
+ if(hp->tty)
+ free((void*)hp->tty);
+ sfclose(hp->auditfp);
+ }
+#endif /* SHOPT_AUDIT */
free((char*)hp);
hist_ptr = 0;
- sh.hist_ptr = 0;
+ shp->hist_ptr = 0;
#if SHOPT_ACCTFILE
if(acctfd)
{
@@ -376,7 +455,7 @@ static int hist_clean(int fd)
* Copy the last <n> commands to a new file and make this the history file
*/
-static void hist_trim(History_t *hp, int n)
+static History_t* hist_trim(History_t *hp, int n)
{
register char *cp;
register int incmd=1, c=0;
@@ -407,17 +486,16 @@ static void hist_trim(History_t *hp, int n)
if(tmpname==name)
tmpname = 0;
}
- hp = hist_ptr = 0;
+ hist_ptr = 0;
if(fstat(sffileno(hist_old->histfp),&statb)>=0)
{
histinit = 1;
histmode = statb.st_mode;
}
- if(!sh_histinit())
+ if(!sh_histinit(hp->histshell))
{
/* use the old history file */
- hist_ptr = hist_old;
- return;
+ return hist_ptr = hist_old;
}
hist_new = hist_ptr;
hist_ptr = hist_old;
@@ -459,8 +537,7 @@ static void hist_trim(History_t *hp, int n)
hist_new->histcnt += c;
sfwrite(hist_new->histfp,buff,c);
}
- hist_ptr = hist_new;
- hist_cancel(hist_ptr);
+ hist_cancel(hist_new);
sfclose(hist_old->histfp);
if(tmpname)
{
@@ -468,6 +545,7 @@ static void hist_trim(History_t *hp, int n)
free(tmpname);
}
free((char*)hist_old);
+ return hist_ptr = hist_new;
}
/*
@@ -668,7 +746,7 @@ void hist_flush(register History_t *hp)
if(sfsync(hp->histfp)<0)
{
hist_close(hp);
- if(!sh_histinit())
+ if(!sh_histinit(hp->histshell))
sh_offoption(SH_HISTORY);
}
hp->histflush = 0;
@@ -718,6 +796,15 @@ static int hist_write(Sfio_t *iop,const void *buff,register int insize,Sfdisc_t*
*bufptr++ = '\n';
*bufptr++ = 0;
size = bufptr - (char*)buff;
+#if SHOPT_AUDIT
+ if(hp->auditfp)
+ {
+ Shell_t *shp = (Shell_t*)hp->histshell;
+ time_t t=time((time_t*)0);
+ sfprintf(hp->auditfp,"%u;%u;%s;%*s%c",sh_isoption(SH_PRIVILEGED)?shp->euserid:shp->userid,t,hp->tty,size,buff,0);
+ sfsync(hp->auditfp);
+ }
+#endif /* SHOPT_AUDIT */
#if SHOPT_ACCTFILE
if(acctfd)
{
@@ -876,7 +963,7 @@ Histloc_t hist_find(register History_t*hp,char *string,register int index1,int f
}
#if KSHELL
/* allow a search to be aborted */
- if(sh.trapnote&SH_SIGSET)
+ if(((Shell_t*)hp->histshell)->trapnote&SH_SIGSET)
break;
#endif /* KSHELL */
}
@@ -986,7 +1073,7 @@ char *hist_word(char *string,int size,int word)
if(!hp)
#if KSHELL
{
- strncpy(string,sh.lastarg,size);
+ strncpy(string,((Shell_t*)hp->histshell)->lastarg,size);
return(string);
}
#else
diff --git a/usr/src/lib/libshell/common/edit/vi.c b/usr/src/lib/libshell/common/edit/vi.c
index 5d6fa8e56f..391999b5e9 100644
--- a/usr/src/lib/libshell/common/edit/vi.c
+++ b/usr/src/lib/libshell/common/edit/vi.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -556,6 +556,11 @@ int ed_viread(void *context, int fd, register char *shbuf, int nchar, int reedit
i = sigsetjmp(editb.e_env,0);
if( i != 0 )
{
+ if(vp->ed->e_multiline)
+ {
+ cur_virt = last_virt;
+ sync_cursor(vp);
+ }
virtual[0] = '\0';
tty_cooked(ERRIO);
@@ -795,7 +800,7 @@ static int cntlmode(Vi_t *vp)
case cntl('L'): /** Redraw line **/
/*** print the prompt and ***/
/* force a total refresh */
- if(vp->nonewline==0)
+ if(vp->nonewline==0 && !vp->ed->e_nocrnl)
putchar('\n');
vp->nonewline = 0;
pr_string(vp,Prompt);
@@ -1472,6 +1477,7 @@ static void getline(register Vi_t* vp,register int mode)
if( mode != SEARCH )
save_last(vp);
refresh(vp,INPUT);
+ last_phys++;
return;
case '\t': /** command completion **/
@@ -1557,7 +1563,21 @@ static int mvcursor(register Vi_t* vp,register int motion)
switch(motion=getcount(vp,ed_getchar(vp->ed,-1)))
{
case 'A':
- ed_ungetchar(vp->ed,'k');
+ if(cur_virt>=0 && cur_virt<(SEARCHSIZE-2) && cur_virt == last_virt)
+ {
+ virtual[last_virt + 1] = '\0';
+ gencpy(&((genchar*)lsearch)[1], virtual);
+#if SHOPT_MULTIBYTE
+ ed_external(&((genchar*)lsearch)[1],lsearch+1);
+#endif /* SHOPT_MULTIBYTE */
+ *lsearch = '^';
+ vp->direction = -2;
+ ed_ungetchar(vp->ed,'n');
+ }
+ else if(cur_virt==0 && vp->direction == -2)
+ ed_ungetchar(vp->ed,'n');
+ else
+ ed_ungetchar(vp->ed,'k');
return(1);
case 'B':
ed_ungetchar(vp->ed,'j');
@@ -1927,6 +1947,9 @@ static void refresh(register Vi_t* vp, int mode)
vp->long_line = vp->long_char;
}
+ if(vp->ed->e_multiline && vp->ofirst_wind==INVALID && !vp->ed->e_nocrnl)
+ ed_setcursor(vp->ed, physical, last_phys+1, last_phys+1, -1);
+ vp->ed->e_nocrnl = 0;
vp->ocur_phys = ncur_phys;
vp->ocur_virt = cur_virt;
vp->ofirst_wind = first_w;
@@ -2103,6 +2126,8 @@ static int search(register Vi_t* vp,register int mode)
register int i;
Histloc_t location;
+ if( vp->direction == -2 && mode != 'n')
+ vp->direction = -1;
if( mode == '/' || mode == '?')
{
/*** new search expression ***/
diff --git a/usr/src/lib/libshell/common/features/dynamic b/usr/src/lib/libshell/common/features/dynamic
index 1835d41282..33f2d138e9 100644
--- a/usr/src/lib/libshell/common/features/dynamic
+++ b/usr/src/lib/libshell/common/features/dynamic
@@ -1,8 +1,8 @@
-hdr,sys dlfcn,dl,ldr,dll
-hdr dlldefs
-lib dlopen,shl_load,loadbind,dllload,dllfind
cat{
- #if !defined(SHOPT_FS_3D) && ( _lib_dllfind || _lib_dlopen || _lib_shl_load || _lib_loadbind )
+ #if SHOPT_DYNAMIC
+ #include <dlldefs.h>
+ #endif
+ #if !defined(SHOPT_FS_3D) && SHOPT_DYNAMIC
# define SHOPT_FS_3D 1
#endif /* !SHOPT_FS_3D */
#if SHOPT_FS_3D
diff --git a/usr/src/lib/libshell/common/features/externs b/usr/src/lib/libshell/common/features/externs
index 58701306be..7d5e48d7c7 100644
--- a/usr/src/lib/libshell/common/features/externs
+++ b/usr/src/lib/libshell/common/features/externs
@@ -1,9 +1,9 @@
set prototyped
hdr nc,exec_attr
mem exception.name,_exception.name math.h
-lib setreuid,setregid,nice,sigflag,fork,spawnveg
+lib setreuid,setregid,nice,sigflag,fork,spawnveg,fchdir
lib pathnative,pathposix,uwin_path,uwin_unpath,fts_notify
-lib fchdir
+lib memcntl sys/mman.h
reference unistd.h
diff --git a/usr/src/lib/libshell/common/features/math.sh b/usr/src/lib/libshell/common/features/math.sh
index 1e407e57f7..4db6d7b3e3 100644
--- a/usr/src/lib/libshell/common/features/math.sh
+++ b/usr/src/lib/libshell/common/features/math.sh
@@ -1,10 +1,10 @@
########################################################################
# #
# This software is part of the ast package #
-# Copyright (c) 1982-2007 AT&T Knowledge Ventures #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
-# by AT&T Knowledge Ventures #
+# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# http://www.opensource.org/licenses/cpl1.0.txt #
@@ -20,7 +20,7 @@
: generate the ksh math builtin table
: include math.tab
-# @(#)math.sh (AT&T Research) 2007-02-02
+# @(#)math.sh (AT&T Research) 2008-08-29
command=$0
iffeflags="-n -v -F ast_standards.h"
@@ -35,13 +35,20 @@ table=$1
names=
tests=
+: check long double
+
+eval `iffe $iffeflags -c "$cc" - typ long.double 2>&$stderr`
+
: read the table
exec < $table
while read type args name aka comment
do case $type in
[fi]) names="$names $name"
- tests="$tests,$name,${name}l"
+ tests="$tests,$name"
+ case $_typ_long_double in
+ 1) tests="$tests,${name}l" ;;
+ esac
eval TYPE_$name=$type ARGS_$name=$args AKA_$name=$aka
;;
esac
@@ -49,7 +56,7 @@ done
: check the math library
-eval `iffe $iffeflags -c "$cc" - typ long.double : lib $tests $iffehdrs $iffelibs 2>&$stderr`
+eval `iffe $iffeflags -c "$cc" - lib $tests $iffehdrs $iffelibs 2>&$stderr`
lib=
for name in $names
do eval x='$'_lib_${name}l y='$'_lib_${name}
@@ -123,7 +130,7 @@ do eval x='$'_lib_${name}l y='$'_lib_${name} r='$'TYPE_${name} a='$'ARGS_${name}
;;
esac
case $local:$m:$n:$d in
- 1:*:*:*|*:1:*:*|*:*::)
+ 1:*:*:*|*:1:*:*|*:*:1:)
args=
code="static $L local_$f("
sep=
diff --git a/usr/src/lib/libshell/common/features/options b/usr/src/lib/libshell/common/features/options
index 9c713d150e..c3f48b64d4 100644
--- a/usr/src/lib/libshell/common/features/options
+++ b/usr/src/lib/libshell/common/features/options
@@ -24,8 +24,9 @@ tst cross{
esac
}
- test -d /dev/fd
+ ls /dev/fd/9 9<&0 >/dev/null 2>&1
option DEVFD $?
+ exec 9<&-
case `echo a | tr a '\012' | wc -l` in
*1*) option MULTIBYTE 0 ;;
esac
diff --git a/usr/src/lib/libshell/common/features/poll b/usr/src/lib/libshell/common/features/poll
index 7211a47806..6fa8fb308c 100644
--- a/usr/src/lib/libshell/common/features/poll
+++ b/usr/src/lib/libshell/common/features/poll
@@ -8,6 +8,12 @@ tst pipe_socketpair note{ use socketpair() for peekable pipe() }end execute{
#include <signal.h>
#include <sys/types.h>
#include <sys/socket.h>
+ #ifndef SHUT_RD
+ #define SHUT_RD 0
+ #endif
+ #ifndef SHUT_WR
+ #define SHUT_WR 1
+ #endif
static void handler(sig)
int sig;
{
@@ -24,8 +30,8 @@ tst pipe_socketpair note{ use socketpair() for peekable pipe() }end execute{
close(0);
if (pipe(pfd) < 0 ||
socketpair(AF_UNIX, SOCK_STREAM, 0, sfd) < 0 ||
- shutdown(sfd[0], 1) < 0 ||
- shutdown(sfd[1], 0) < 0)
+ shutdown(sfd[1], SHUT_RD) < 0 ||
+ shutdown(sfd[0], SHUT_WR) < 0)
return(1);
if ((pid = fork()) < 0)
return(1);
@@ -50,8 +56,8 @@ tst pipe_socketpair note{ use socketpair() for peekable pipe() }end execute{
close(sfd[0]);
signal(SIGPIPE, handler);
if (socketpair(AF_UNIX, SOCK_STREAM, 0, sfd) < 0 ||
- shutdown(sfd[0], 1) < 0 ||
- shutdown(sfd[1], 0) < 0)
+ shutdown(sfd[1], SHUT_RD) < 0 ||
+ shutdown(sfd[0], SHUT_WR) < 0)
return(1);
close(sfd[0]);
write(sfd[1], msg, sizeof(msg) - 1);
diff --git a/usr/src/lib/libshell/common/features/sigfeatures b/usr/src/lib/libshell/common/features/sigfeatures
index 1999dc11bb..58beaf8daa 100644
--- a/usr/src/lib/libshell/common/features/sigfeatures
+++ b/usr/src/lib/libshell/common/features/sigfeatures
@@ -7,8 +7,8 @@ cat{
#endif
#ifdef _lib_sigprocmask
# define sh_sigaction(s,action) do { sigset_t ss;\
- sigemptyset(&ss);\
- sigaddset(&ss,(s));\
+ sigemptyset(&ss); \
+ if(s) sigaddset(&ss,(s)); \
sigprocmask(action,&ss,0); \
}while(0)
# define sigrelease(s) sh_sigaction(s,SIG_UNBLOCK)
diff --git a/usr/src/lib/libshell/common/fun/mandelbrotset1 b/usr/src/lib/libshell/common/fun/mandelbrotset1
deleted file mode 100644
index fd39f387ec..0000000000
--- a/usr/src/lib/libshell/common/fun/mandelbrotset1
+++ /dev/null
@@ -1,234 +0,0 @@
-#!/bin/ksh93
-
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-# ident "%Z%%M% %I% %E% SMI"
-#
-
-#
-# mandelbrotset1 - a simple mandelbrot set generation and
-# parallel execution demo
-#
-
-# Solaris needs /usr/xpg4/bin/ because the tools in /usr/bin are not POSIX-conformant
-export PATH=/usr/xpg4/bin:/bin:/usr/bin:/usr/X11/bin:/usr/X11R6/bin:/usr/openwin/bin
-
-function printmsg
-{
- print -u 2 "$@"
-}
-
-function fatal_error
-{
- print -u 2 "${progname}: $@"
- exit 1
-}
-
-function print_color
-{
- print -n "${symbollist:${1}:1}"
-}
-
-function mandelbrot
-{
- float x=$1
- float y=$2
- float xx
- float yy
- float x1=$3
- float y1=$4
- integer iteration=$5
- integer max_iteration=$6
- float mag
-
- for (( mag=0 ; mag < max_mag && iteration < max_iteration ; iteration++ )) ; do
- (( xx=x*x ))
- (( yy=y*y ))
- (( mag=xx+yy ))
-
- (( y=x*y*2+y1 ))
- (( x=xx-yy+x1 ))
- done
-
- print ${iteration}
-
- return 0
-}
-
-function loop_serial
-{
- for (( y=y_min ; y < y_max ; y+=stepwidth )) ; do
- for (( x=x_min ; x < x_max ; x+=stepwidth )) ; do
- print_color $(mandelbrot ${x} ${y} ${x} ${y} 1 ${symbollistlen})
- done
-
- print
- done
-}
-
-function loop_parallel
-{
- integer numjobs=0
- # the following calculation suffers from rounding errors
- integer lines_per_job=$(( ((m_height+(numcpus-1)) / numcpus) ))
-
- printmsg "# lines_per_job=${lines_per_job}"
- printmsg "# numcpus=${numcpus}"
-
- # "renice" worker jobs
- set -o bgnice
-
- if [ "${TMPDIR}" = "" ] ; then
- TMPDIR="/tmp"
- fi
-
- # try to generate a job identifer prefix which is unique across multiple hosts
- jobident="job_host_$(uname -n)pid_$$_ppid${PPID}"
-
- printmsg $"## prepare..."
- for (( y=y_min ; y < y_max ; y+=(stepwidth*lines_per_job) )) ; do
- rm -f "${TMPDIR}/mandelbrot_${jobident}_child_$y.joboutput"
-
- let numjobs++
- done
-
- printmsg $"## running ${numjobs} children..."
- for (( y=y_min ; y < y_max ; y+=(stepwidth*lines_per_job) )) ; do
- (
- for (( ; y < y_max && lines_per_job-- > 0 ; y+=stepwidth )) ; do
- for (( x=x_min ; x < x_max ; x+=stepwidth )) ; do
- print_color $(mandelbrot ${x} ${y} ${x} ${y} 1 ${symbollistlen})
- done
-
- print
- done >"${TMPDIR}/mandelbrot_${jobident}_child_$y.joboutput"
- ) &
- done
-
- printmsg $"## waiting for ${numjobs} children..."
- wait
-
- printmsg $"## output:"
- for (( y=y_min ; y < y_max ; y+=(stepwidth*lines_per_job) )) ; do
- print "$(cat "${TMPDIR}/mandelbrot_${jobident}_child_$y.joboutput")"
- rm "${TMPDIR}/mandelbrot_${jobident}_child_$y.joboutput"
- done
-}
-
-function usage
-{
- OPTIND=0
- getopts -a "${progname}" "${USAGE}" OPT '-?'
- exit 2
-}
-
-# main
-builtin printf
-builtin cat
-builtin rm
-builtin sleep
-builtin uname # loop_parallel needs the ksh93 builtin version to generate unique job file names
-
-float x_max
-float x_min
-float y_max
-float y_min
-float m_width
-float m_height
-float max_mag
-float stepwidth
-integer numcpus
-
-# make sure ${COLUMN} and ${LINES} are set
-eval $(resize -u)
-
-symbollist=' .:0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ%#'
-symbollistlen=$(( ${#symbollist} - 1))
-mode="parallel"
-progname="${0}"
-max_mag=400
-stepwidth=0.1
-numcpus=16
-
-let m_width=COLUMNS-1 m_height=LINES-2
-
-progname="${0}"
-
-USAGE=$'
-[-?
-@(#)\$Id: mandelbrotset1 (Roland Mainz) 2007-06-05 \$
-]
-[+NAME?mandelbrotset1 - generate mandelbrot set fractals with ksh93]
-[+DESCRIPTION?\bmandelbrotset1\b mandelbrot set fractal generator
- which runs either in serial or parallel mode (using multiple worker jobs).]
-[w:width?Width of fractal.]:[width]
-[h:height?Height of fractal.]:[height]
-[s:symbols?Symbols to build the fractal from.]:[symbolstring]
-[m:mag?Magnification level.]:[magnificationlevel]
-[p:stepwidth?Width per step.]:[widthperstep]
-[S:serial?Run in serial mode.]
-[P:parallel?Run in parallel mode.]
-[M:mode?Execution mode.]:[mode]
-[C:numcpus?Number of processors used for parallel execution.]:[numcpus]
-[+SEE ALSO?\bjuliaset1\b(1), \bksh93\b(1)]
-'
-
-while getopts -a "${progname}" "${USAGE}" OPT ; do
-# printmsg "## OPT=|${OPT}|, OPTARG=|${OPTARG}|"
- case ${OPT} in
- w) m_width="${OPTARG}" ;;
- h) m_height="${OPTARG}" ;;
- s) symbollist="${OPTARG}" ;;
- m) max_mag="${OPTARG}" ;;
- p) stepwidth="${OPTARG}" ;;
- S) mode="serial" ;;
- P) mode="parallel" ;;
- M) mode="${OPTARG}" ;;
- C) numcpus="${OPTARG}" ;;
- *) usage ;;
- esac
-done
-shift ${OPTIND}-1
-
-printmsg "# width=${m_width}"
-printmsg "# height=${m_height}"
-printmsg "# max_mag=${max_mag}"
-printmsg "# stepwidth=${stepwidth}"
-printmsg "# symbollist='${symbollist}'"
-printmsg "# mode=${mode}"
-
-symbollistlen=$(( ${#symbollist} - 1))
-
-let x_max=m_width*stepwidth/2. x_min=-x_max
-let y_max=m_height*stepwidth/2. y_min=-y_max
-
-case "${mode}" in
- parallel) loop_parallel ;;
- serial) loop_serial ;;
- *) fatal_error $"Unknown mode \"${mode}\"."
-esac
-
-# EOF.
diff --git a/usr/src/lib/libshell/common/fun/rssread b/usr/src/lib/libshell/common/fun/rssread
deleted file mode 100644
index e561cb3587..0000000000
--- a/usr/src/lib/libshell/common/fun/rssread
+++ /dev/null
@@ -1,414 +0,0 @@
-#!/bin/ksh93
-
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-# ident "%Z%%M% %I% %E% SMI"
-#
-
-#
-# rssread - a simple RSS2.0 reader with RSS to XHTML to
-# plaintext conversion.
-#
-
-# Solaris needs /usr/xpg4/bin/ because the tools in /usr/bin are not POSIX-conformant
-export PATH=/usr/xpg4/bin:/bin:/usr/bin
-
-function printmsg
-{
- print -u 2 "$@"
-}
-
-function debugmsg
-{
-# printmsg "$@"
-true
-}
-
-function fatal_error
-{
- print -u 2 "${progname}: $@"
- exit 1
-}
-
-function cat_http
-{
-(
- protocol="${1%://*}"
- path1="${1#*://}" # "http://foo.bat.net/x/y.html" ----> "foo.bat.net/x/y.html"
-
- host="${path1%%/*}"
- path="${path1#*/}"
- port="${host##*:}"
-
- # If URL did not contain a port number in the host part then look at the
- # protocol to get the port number
- if [ "${port}" = "${host}" ] ; then
- case "${protocol}" in
- "http") port=80 ;;
- *) port="$(getent services "${protocol}" | sed 's/[^0-9]*//;s/\/.*//')" ;;
- esac
- else
- host="${host%:*}"
- fi
-
- printmsg "protocol=${protocol} port=${port} host=${host} path=${path}"
-
- # prechecks
- [ "${protocol}" = "" ] && fatal_error "protocol not set."
- [ "${port}" = "" ] && fatal_error "port not set."
- [ "${host}" = "" ] && fatal_error "host not set."
- [ "${path}" = "" ] && fatal_error "path not set."
-
- # open TCP channel
- exec 3<>"/dev/tcp/${host}/${port}"
-
- # send HTTP request
- request="GET /${path} HTTP/1.0\n"
- request+="Host: ${host}\n"
- request+="User-Agent: ksh93/rssread (2007-01-16; $(uname -s -r -p))\n"
- print "${request}\n" >&3
-
- # collect response and send it to stdout
- cat <&3
-)
-}
-
-function html_entity_to_ascii
-{
- typeset -A entity_cache
-
- # Todo: Add more HTML/MathML entities here
- entity_cache["nbsp"]=" "
- entity_cache["lt"]="<"
- entity_cache["gt"]=">"
- entity_cache["amp"]="&"
- entity_cache["quot"]="\""
- entity_cache["apos"]="'"
-
- buf=""
- while read -r -N 1 c ; do
- if [ "$c" != "&" ] ; then
- printf "%s" "${c}"
- continue
- fi
-
- entity=""
- while read -r -N 1 c ; do
- case "$c" in
- ";")
- break
- ;;
- ~(Eilr)[a-z0-9#])
- entity+="$c"
- continue
- ;;
- *)
- debugmsg "error &${entity}${c}#"
-
- print -n "${entity}${c}"
- entity=""
- continue 2
- ;;
- esac
- done
-
- value=""
- if [ "${entity_cache["${entity}"]}" != "" ] ; then
- debugmsg "match #${entity}# = #${entity_cache["${entity}"]}#"
- value="${entity_cache["${entity}"]}"
- else
- if [ "${entity:0:1}" = "#" ] ; then
- # decimal literal
- value="$(printf "\u[$(printf "%x" "${entity:1:8}")]")"
- elif [[ "${entity:0:7}" = ~(Eilr)[0-9a-f]* ]] ; then
- # hexadecimal literal
- value="$(printf "\u[${entity:0:7}]")"
- else
- # unknown literal - pass-through
- value="<ENT=${entity}>"
- fi
-
- entity_cache["${entity}"]="${value}"
-
- debugmsg "lookup #${entity}# = #${entity_cache["${entity}"]}#"
- fi
-
- printf "%s" "$value"
- done
-}
-
-# dumb xhtml handler - no CSS, tables, images, iframes or nested
-# structures are supported (and we assume that the input is correct
-# xhtml). The code was written in a trial&&error manner and should be
-# rewritten to parse xhtml correctly.
-function handle_html
-{
- # we can't use global variables here when multiple callbacks use the same
- # callback function - but we can use the callback associative array for
- # variable storage instead
- nameref callbacks=${1}
- tag_type="$2"
- tag_value="$3"
-
- case "${tag_type}" in
- tag_begin)
- case "${tag_value}" in
- br*) printf "\n" ;;
- hr*) printf "\n-------------------------------------\n" ;;
- pre*) callbacks["html_pre"]=1 ;;
- p*) printf "\n" ;;
- esac
- ;;
-
- tag_end)
- case "${tag_value}" in
- pre*) callbacks["html_pre"]=0 ;;
- esac
- ;;
-
- tag_text)
- if [ ${callbacks["html_pre"]} -eq 1 ] ; then
- printf "%s" "${tag_value}"
- else
- # compress spaces/newlines/tabs/etc.
- printf "%s" "${tag_value/+([\n\r\t\v[:space:][:blank:]])/ }"
- fi
- ;;
-
- document_start)
- callbacks["html_pre"]=0
- ;;
- document_end) ;;
- esac
-}
-
-function handle_rss
-{
- # we can't use global variables here when multiple callbacks use the same
- # callback function - but we can use the callback associative array for
- # variable storage instead
- nameref callbacks=${1}
- tag_type="$2"
- tag_value="$3"
-
- case "${tag_type}" in
- tag_begin)
- case "${tag_value}" in
- item*)
- item["title"]=""
- item["link"]=""
- item["tag"]=""
- item["description"]=""
- ;;
- esac
- callbacks["textbuf"]=""
- ;;
- tag_end)
- case "${tag_value}" in
- item*)
- # note that each RSS item needs to be converted seperately from RSS to HTML to plain text
- # to make sure that the state of one RSS item doesn't affect others
- (
- printf $"<br />#### RSS item: title: %s ####" "${item["title"]}"
- printf $"<br />## author: %s" "${item["author"]}"
- printf $"<br />## link: %s" "${item["link"]}"
- printf $"<br />## date: %s" "${item["pubDate"]}"
- printf $"<br />## begin description:"
- printf $"<br />%s<br />" "${item["description"]}"
- printf $"<br />## end description<br />"
- print # extra newline to make sure the sed pipeline gets flushed
- ) |
- html_entity_to_ascii | # convert XML entities (e.g. decode RSS content to HTML code)
- xml_tok "xhtmltok_cb" | # convert HTML to plain text
- html_entity_to_ascii # convert HTML entities
- ;;
- title*) item["title"]="${callbacks["textbuf"]}" ; callbacks["textbuf"]="" ;;
- link*) item["link"]="${callbacks["textbuf"]}" ; callbacks["textbuf"]="" ;;
- dc:creator* | author*) item["author"]="${callbacks["textbuf"]}" ; callbacks["textbuf"]="" ;;
- dc:date* | pubDate*) item["pubDate"]="${callbacks["textbuf"]}" ; callbacks["textbuf"]="" ;;
- description*) item["description"]="${callbacks["textbuf"]}" ; callbacks["textbuf"]="" ;;
- esac
- callbacks["textbuf"]=""
- ;;
- tag_text)
- callbacks["textbuf"]+="${tag_value}"
- ;;
- document_start) ;;
- document_end) ;;
- esac
-}
-
-function xml_tok
-{
- typeset buf=""
- typeset c=""
-
- nameref callbacks=${1}
-
- [ ! -z "${callbacks["document_start"]}" ] && ${callbacks["document_start"]} "${1}" "document_start"
-
- while read -N 1 c -d '\0'; do
- isendtag=false
-
- if [ "$c" = "<" ] ; then
- if [ "$buf" != "" ] ; then
- [ ! -z "${callbacks["tag_text"]}" ] && ${callbacks["tag_text"]} "${1}" "tag_text" "$buf"
- buf=""
- fi
-
- read -N 1 c -d '\0'
- if [ "$c" = "/" ] ; then
- isendtag=true
- else
- buf="$c"
- fi
- read -d '>' c
- buf+="$c"
-
- if ${isendtag} ; then
- [ ! -z "${callbacks["tag_end"]}" ] && ${callbacks["tag_end"]} "${1}" "tag_end" "$buf"
- else
- [ ! -z "${callbacks["tag_begin"]}" ] && ${callbacks["tag_begin"]} "${1}" "tag_begin" "$buf"
-
- # handle tags like <br/> (which are start- and end-tag in one piece)
- if [[ "${buf}" = ~(Er).*/ ]] ; then
- [ ! -z "${callbacks["tag_end"]}" ] && ${callbacks["tag_end"]} "${1}" "tag_end" "$buf"
- fi
- fi
- buf=""
- else
- buf+="$c"
- fi
- done
-
- [ ! -z "${callbacks["document_end"]}" ] && ${callbacks["document_start"]} "${1}" "document_end" "exit_success"
-
- print # final newline to make filters like "sed" happy
-}
-
-# return the value of LC_MESSAGES needed for subprocesses which
-# want to run in a different locale/encoding
-function get_lc_messages
-{
- [ "${LC_ALL}" != "" ] && { print "${LC_ALL}" ; return 0 ; }
- [ "${LC_MESSAGES}" != "" ] && { print "${LC_MESSAGES}" ; return 0 ; }
- [ "${LANG}" != "" ] && { print "${LANG}" ; return 0 ; }
- print "C" ; return 0
-}
-
-function usage
-{
- OPTIND=0
- getopts -a "${progname}" "${USAGE}" OPT '-?'
- exit 2
-}
-
-# make sure we use the ksh93 builtin versions
-builtin cat
-builtin printf
-
-typeset -A rsstok_cb # callbacks for xml_tok
-rsstok_cb["tag_begin"]="handle_rss"
-rsstok_cb["tag_end"]="handle_rss"
-rsstok_cb["tag_text"]="handle_rss"
-rsstok_cb["textbuf"]=""
-
-typeset -A xhtmltok_cb # callbacks for xml_tok
-xhtmltok_cb["tag_begin"]="handle_html"
-xhtmltok_cb["tag_end"]="handle_html"
-xhtmltok_cb["tag_text"]="handle_html"
-xhtmltok_cb["textbuf"]=""
-xhtmltok_cb["html_pre"]=0
-
-typeset -A item
-
-typeset -A bookmark_urls
-
-# "ramdom" urls for testing
-bookmark_urls=(
- ["google_blogs_ksh"]="http://blogsearch.google.com/blogsearch_feeds?hl=en&scoring=d&q=ksh&ie=utf-8&num=100&output=rss"
- ["ksh93_integration"]="http://www.opensolaris.org/rss/os/project/ksh93-integration/announcements/rss2.xml"
- ["blogs_sun_com"]="http://blogs.sun.com/main/feed/entries/rss"
- ["jmcp"]="http://www.jmcp.homeunix.com/roller/rss/jmcp"
- ["katakai"]="http://blogs.sun.com/katakai/feed/entries/rss"
- ["planetsun"]="http://www.planetsun.org/rss20.xml"
- ["planetsolaris"]="http://www.planetsolaris.org/rss20.xml"
- ["planetopensolaris"]="http://planet.opensolaris.org/rss20.xml"
-)
-
-progname="${0}"
-
-USAGE=$'
-[-?
-@(#)\$Id: rssread (Roland Mainz) 2007-06-05 \$
-]
-[+NAME?rssread - fetch RSS messages and convert them to plain text]
-[+DESCRIPTION?\brssread\b RSS to plain text converter
- which fetches RSS streams via HTTP and converts them from RSS to HTML to plain UTF-8 text.]
-
-[ url ]
-
-[+SEE ALSO?\bksh93\b(1)]
-'
-
-while getopts -a "${progname}" "${USAGE}" OPT ; do
-# printmsg "## OPT=|${OPT}|, OPTARG=|${OPTARG}|"
- case ${OPT} in
- *) usage ;;
- esac
-done
-shift ${OPTIND}-1
-
-url="$1"
-
-if [ "$url" = "" ] ; then
- fatal_error $"No url given."
-fi
-
-if [ "${bookmark_urls[${url}]}" != "" ] ; then
- printmsg $"Using bookmark ${url} = ${bookmark_urls[${url}]}"
- url="${bookmark_urls[${url}]}"
-fi
-
-(
- # set unicode locale since RSS is encoded in UTF-8
- # (and make sure $LC_MESSAGES is set to the parent
- # process's locale that all error messages are using
- # the callers locale/encoding)
- export \
- LC_MESSAGES="$(get_lc_messages)" \
- LC_MONETARY="en_US.UTF-8" \
- LC_NUMERIC="en_US.UTF-8" \
- LC_COLLATE="en_US.UTF-8" \
- LC_CTYPE="en_US.UTF-8" \
- LC_TIME="en_US.UTF-8" \
- LANG="en_US.UTF-8"
-
- cat_http "$url" |
- xml_tok "rsstok_cb"
-) # | iconv -f "UTF-8" - -
-
-#EOF.
diff --git a/usr/src/lib/libshell/common/fun/termclock b/usr/src/lib/libshell/common/fun/termclock
deleted file mode 100644
index 9bf0cf6d85..0000000000
--- a/usr/src/lib/libshell/common/fun/termclock
+++ /dev/null
@@ -1,267 +0,0 @@
-#!/bin/ksh93
-
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-# ident "%Z%%M% %I% %E% SMI"
-#
-
-#
-# termclock - a simple analog clock for terminals
-#
-
-# Solaris needs /usr/xpg4/bin/ because the tools in /usr/bin are not POSIX-conformant
-export PATH=/usr/xpg4/bin:/bin:/usr/bin
-
-function fatal_error
-{
- print -u 2 "${progname}: $@"
- exit 1
-}
-
-# cache tput values (to avoid |fork()|'ing a "tput" child every second)
-function tput_cup
-{
- integer y="$1" x="$2"
- nameref c=tput_cup_cache["${y}_${x}"]
-
- if [ "$c" == "" ] ; then
- # fast path for known terminal types
- if [[ ${TERM} = ~(Elr)(vt100|vt220|xterm|xterm-color|dtterm) ]] ; then
- c="$(printf "\E[%d;%dH" $((y+1)) $((x+1)))"
- else
- c="$(tput cup $y $x)"
- fi
- fi
-
- print -n "$c"
-}
-
-function draw_clock
-{
- float angle a
- float x y
-
- for(( angle=0.0 ; angle < 360. ; angle+=6 )) ; do
- (( a=angle/360.*(2*M_PI) ))
-
- (( x=clock.len_x*cos(a) ))
- (( y=clock.len_y*sin(a) ))
- tput_cup $(( y+clock.middle_y )) $(( x+clock.middle_x ))
-
- # add "mark" every 30 degrees
- if (( int(angle)%30 == 0 )) ; then
- print -n "0"
- else
- print -n "x"
- fi
- done
-}
-
-function draw_hand
-{
- float angle="$1" a
- typeset ch="$2"
- float length="$3"
- float x y
-
- (( a=angle/360.*(2*M_PI) ))
-
- for(( s=0.0 ; s < 10. ; s+=0.5 )) ; do
- (( x=(clock.len_x*(s/10.)*(length/100.))*cos(a) ))
- (( y=(clock.len_y*(s/10.)*(length/100.))*sin(a) ))
-
- tput_cup $(( y+clock.middle_y )) $(( x+clock.middle_x ))
- print -n "${ch}"
- done
-}
-
-function draw_clock_hand
-{
- nameref hand=$1
-
- draw_hand $(( 360.*(hand.val/hand.scale)-90. )) "${hand.ch}" ${hand.length}
-}
-
-function clear_clock_hand
-{
- nameref hand=$1
-
- draw_hand $(( 360.*(hand.val/hand.scale)-90. )) " " ${hand.length}
-}
-
-function main_loop
-{
- typeset c
-
- # note: we can't use subshells when writing to the double-buffer file because this
- # will render the tput value cache useless
- while true ; do
- if ${init_screen} ; then
- init_screen="false"
-
- # "resize" is needed because older versions of ksh93 may have
- # trouble with getting the right terminal size at startup
- [ -x "/usr/X11/bin/resize" ] && eval "$(/usr/X11/bin/resize -u)" ||
- [ -x "/usr/X11R6/bin/resize" ] && eval "$(/usr/X11R6/bin/resize -u)" ||
- [ -x "/usr/openwin/bin/resize" ] && eval "$(/usr/openwin/bin/resize -u)" ||
- fatal_error "resize not found."
-
- (( clock.middle_x=COLUMNS/2.-.5 ))
- (( clock.middle_y=LINES/2.-.5 ))
- (( clock.len_x=COLUMNS/2-2 ))
- (( clock.len_y=LINES/2-2 ))
-
- {
- clear
- draw_clock
- } >&6
- fi
-
- {
- (( $(date +"hours.val=%H , minutes.val=%M , seconds.val=%S") ))
-
- # small trick to get a smooth "analog" flair
- (( hours.val+=minutes.val/60. ))
- (( minutes.val+=seconds.val/60. ))
-
- draw_clock_hand seconds
- draw_clock_hand minutes
- draw_clock_hand hours
-
- # move cursor to home position
- tput_cup 0 0
- } >&6
-
- 6<#((0))
- cat <&6
-
- 6<&- ; rm -f "${scratchfile}" ; exec 6<>"${scratchfile}"
-
- c="" ; read -t ${update_interval} -n 1 c
- if [ "$c" != "" ] ; then
- case "$c" in
- ~(Ei)q | $'\E') return 0 ;;
- esac
- fi
-
- {
- clear_clock_hand hours
- clear_clock_hand minutes
- clear_clock_hand seconds
- } >&6
- done
-}
-
-function usage
-{
- OPTIND=0
- getopts -a "${progname}" "${USAGE}" OPT '-?'
- exit 2
-}
-
-# program start
-progname="${0}"
-
-builtin date
-builtin rm
-builtin printf
-
-typeset -A tput_cup_cache
-
-float -r M_PI=3.14159265358979323846
-
-clock=(
- float middle_x
- float middle_y
- integer len_x
- integer len_y
-)
-
-typeset init_screen="true"
-
-# set clock properties
-seconds=( float val
- typeset ch
- float scale
- integer length )
-minutes=( float val
- typeset ch
- float scale
- integer length )
-hours=( float val
- typeset ch
- float scale
- integer length )
-
-seconds.length=90 seconds.scale=60 seconds.ch="s"
-minutes.length=75 minutes.scale=60 minutes.ch="m"
-hours.length=50 hours.scale=12 hours.ch="h"
-
-float update_interval=0.9
-
-USAGE=$'
-[-?
-@(#)\$Id: termclock (Roland Mainz) 2007-06-05 \$
-]
-[+NAME?termclock - analog clock for terminals]
-[+DESCRIPTION?\btermclock\b is an analog clock for terminals.
- The termclock program displays the time in analog or digital
- form. The time is continuously updated at a frequency which
- may be specified by the user.]
-[u:update?Update interval (defaults to 0.9 seconds).]:[interval]
-[+SEE ALSO?\bksh93\b(1), \bxclock\b(1)]
-'
-
-while getopts -a "${progname}" "${USAGE}" OPT ; do
-# printmsg "## OPT=|${OPT}|, OPTARG=|${OPTARG}|"
- case ${OPT} in
- u) update_interval=${OPTARG} ;;
- *) usage ;;
- esac
-done
-shift ${OPTIND}-1
-
-# prechecks
-which tput >/dev/null || fatal_error "tput not found."
-which mktemp >/dev/null || fatal_error "mktemp not found."
-(( update_interval < 0. || update_interval > 7200. )) && fatal_error "invalid update_interval value."
-
-# create temporary file for double-buffering and register an EXIT trap
-# to remove this file when the shell interpreter exits
-scratchfile="$(mktemp /tmp/termclock.pid$$.XXXXXX)"
-if [ -z "${scratchfile}" ]; then exit 1; fi
-trap 'rm -f "${scratchfile}"' EXIT
-rm -f "${scratchfile}" ; exec 6<>"${scratchfile}"
-
-# regiter trap to handle window size changes
-trap 'init_screen="true"' WINCH
-
-main_loop
-
-# exiting - put cursor below clock
-tput_cup $((LINES-2)) 0
-
-# EOF.
diff --git a/usr/src/lib/libshell/common/include/argnod.h b/usr/src/lib/libshell/common/include/argnod.h
index fd93e5b215..7d59fb41f1 100644
--- a/usr/src/lib/libshell/common/include/argnod.h
+++ b/usr/src/lib/libshell/common/include/argnod.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -69,10 +69,10 @@ struct slnod /* struct for link list of stacks */
struct dolnod
{
- short dolrefcnt; /* reference count */
- short dolmax; /* size of dolval array */
- short dolnum; /* number of elements */
- short dolbot; /* current first element */
+ int dolrefcnt; /* reference count */
+ int dolmax; /* size of dolval array */
+ int dolnum; /* number of elements */
+ int dolbot; /* current first element */
struct dolnod *dolnxt; /* used when list are chained */
char *dolval[1]; /* array of value pointers */
};
@@ -123,16 +123,12 @@ struct argnod
#define ARG_OPTIMIZE 0x200 /* try to optimize */
#define ARG_NOGLOB 0x400 /* no file name expansion */
#define ARG_LET 0x800 /* processing let command arguments */
+#define ARG_ARRAYOK 0x1000 /* $x[sub] ==> ${x[sub]} */
-extern char **sh_argbuild(int*,const struct comnod*,int);
extern struct dolnod *sh_argcreate(char*[]);
-extern char *sh_argdolminus(void);
-extern struct dolnod *sh_argfree(struct dolnod*,int);
-extern struct dolnod *sh_argnew(char*[],struct dolnod**);
-extern int sh_argopts(int,char*[]);
-extern void sh_argreset(struct dolnod*,struct dolnod*);
-extern void sh_argset(char*[]);
-extern struct dolnod *sh_arguse(void);
+extern char *sh_argdolminus(void*);
+extern int sh_argopts(int,char*[],void*);
+
extern const char e_heading[];
extern const char e_off[];
diff --git a/usr/src/lib/libshell/common/include/builtins.h b/usr/src/lib/libshell/common/include/builtins.h
index 8c79075fce..9fc32de97d 100644
--- a/usr/src/lib/libshell/common/include/builtins.h
+++ b/usr/src/lib/libshell/common/include/builtins.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -39,8 +39,10 @@
#define SYSBRACKET (sh.bltin_cmds+11)
#define SYSLET (sh.bltin_cmds+12)
#define SYSEXPORT (sh.bltin_cmds+13)
+#define SYSDOT (sh.bltin_cmds+14)
+#define SYSRETURN (sh.bltin_cmds+15)
#if SHOPT_BASH
-# define SYSLOCAL (sh.bltin_cmds+14)
+# define SYSLOCAL (sh.bltin_cmds+16)
#else
# define SYSLOCAL 0
#endif
@@ -54,6 +56,7 @@
extern int b_alias(int, char*[],void*);
extern int b_break(int, char*[],void*);
extern int b_dot_cmd(int, char*[],void*);
+extern int b_enum(int, char*[],void*);
extern int b_exec(int, char*[],void*);
extern int b_eval(int, char*[],void*);
extern int b_return(int, char*[],void*);
@@ -123,7 +126,6 @@ extern const char e_overlimit[];
extern const char e_eneedsarg[];
extern const char e_toodeep[];
extern const char e_badname[];
-extern const char e_badwrite[];
extern const char e_badsyntax[];
#ifdef _cmd_universe
extern const char e_nouniverse[];
@@ -131,7 +133,6 @@ extern const char e_badsyntax[];
extern const char e_histopen[];
extern const char e_condition[];
extern const char e_badrange[];
-extern const char e_numeric[];
extern const char e_trap[];
extern const char e_direct[];
extern const char e_defedit[];
diff --git a/usr/src/lib/libshell/common/include/defs.h b/usr/src/lib/libshell/common/include/defs.h
index 91a3d2c3e1..78263fefb8 100644
--- a/usr/src/lib/libshell/common/include/defs.h
+++ b/usr/src/lib/libshell/common/include/defs.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -25,6 +25,8 @@
* Shell interface private definitions
*
*/
+#ifndef defs_h_defined
+#define defs_h_defined
#include <ast.h>
#include <sfio.h>
@@ -34,11 +36,17 @@
#include <history.h>
#include "fault.h"
#include "argnod.h"
+#include "name.h"
+#define _SH_PRIVATE
+#include <shcmd.h>
+#undef _SH_PRIVATE
#ifndef pointerof
#define pointerof(x) ((void*)((char*)0+(x)))
#endif
+#define Empty ((char*)(e_sptbnl+3))
+
#define env_change() (++ast.env_serial)
#if SHOPT_ENV
# include <env.h>
@@ -52,6 +60,8 @@
* note that the first few fields have to be the same as for
* Shscoped_t in <shell.h>
*/
+
+
struct sh_scoped
{
struct sh_scoped *prevst; /* pointer to previous state */
@@ -59,6 +69,7 @@ struct sh_scoped
char **dolv;
char *cmdname;
char *filename;
+ char *funname;
int lineno;
Dt_t *save_tree; /* var_tree for calling function */
struct sh_scoped *self; /* pointer to copy of this scope*/
@@ -80,6 +91,7 @@ struct sh_scoped
char **trapcom;
char **otrapcom;
void *timetrap;
+ struct Ufunction *real_fun; /* current 'function name' function */
};
struct limits
@@ -97,6 +109,7 @@ struct limits
#define _SH_PRIVATE \
struct sh_scoped st; /* scoped information */ \
struct limits lim; /* run time limits */ \
+ Stk_t *stk; /* stack poiter */ \
Sfio_t *heredocs; /* current here-doc temp file */ \
Sfio_t *funlog; /* for logging function definitions */ \
int **fdptrs; /* pointer to file numbers */ \
@@ -105,18 +118,20 @@ struct limits
char *lastpath; /* last alsolute path found */ \
int path_err; /* last error on path search */ \
Dt_t *track_tree; /* for tracked aliases*/ \
- Namval_t *bltin_nodes; /* pointer to built-in variables */ \
Dt_t *var_base; /* global level variables */ \
Namval_t *namespace; /* current active namespace*/ \
Namval_t *last_table; /* last table used in last nv_open */ \
+ Namval_t *prev_table; /* previous table used in nv_open */ \
Sfio_t *outpool; /* ouput stream pool */ \
long timeout; /* read timeout */ \
short curenv; /* current subshell number */ \
short jobenv; /* subshell number for jobs */ \
+ int infd; /* input file descriptor */ \
int nextprompt; /* next prompt is PS<nextprompt> */ \
+ int bltin_nnodes; /* number of bltins nodes */ \
+ Namval_t *bltin_nodes; /* pointer to built-in variables */ \
Namval_t *bltin_cmds; /* pointer to built-in commands */ \
Namval_t *posix_fun; /* points to last name() function */ \
- int infd; /* input file descriptor */ \
char *outbuff; /* pointer to output buffer */ \
char *errbuff; /* pointer to stderr buffer */ \
char *prompt; /* pointer to prompt string */ \
@@ -133,6 +148,7 @@ struct limits
pid_t pid; /* process id of shell */ \
pid_t bckpid; /* background process id */ \
pid_t cpid; \
+ pid_t spid; /* subshell process id */ \
int32_t ppid; /* parent process id of shell */ \
int topfd; \
int sigmax; /* maximum number of signals */ \
@@ -144,7 +160,11 @@ struct limits
char forked; \
char binscript; \
char deftype; \
+ char funload; \
char used_pos; /* used postional parameter */\
+ char universe; \
+ char winch; \
+ char indebug; /* set when in debug trap */ \
unsigned char lastsig; /* last signal received */ \
char *readscript; /* set before reading a script */ \
int *inpipe; /* input pipe pointer */ \
@@ -155,11 +175,13 @@ struct limits
struct argnod *envlist; \
struct dolnod *arglist; \
int fn_depth; \
+ int fn_reset; \
int dot_depth; \
int hist_depth; \
int xargmin; \
int xargmax; \
int xargexit; \
+ int nenv; \
mode_t mask; \
long nforks; \
Env_t *env; \
@@ -174,27 +196,36 @@ struct limits
void *cdpathlist; \
char **argaddr; \
void *optlist; \
- int optcount ; \
struct sh_scoped global; \
struct checkpt checkbase; \
Shinit_f userinit; \
Shbltin_f bltinfun; \
+ Shbltin_t bltindata; \
Shwait_f waitevent; \
char *cur_line; \
char *rcfile; \
char **login_files; \
- short offsets[10]; \
+ int offsets[10]; \
Sfio_t **sftable; \
unsigned char *fdstatus; \
const char *pwd; \
History_t *hist_ptr; \
- char universe; \
void *jmpbuffer; \
void *mktype; \
Sfio_t *strbuf; \
+ Sfio_t *strbuf2; \
Dt_t *last_root; \
+ Dt_t *prev_root; \
+ Dt_t *fpathdict; \
+ Dt_t *typedict; \
char ifstable[256]; \
- Shopt_t offoptions;
+ unsigned char sigruntime[2]; \
+ unsigned long test; \
+ Shopt_t offoptions; \
+ Shopt_t glob_options; \
+ Namval_t *typeinit; \
+ int *stats; \
+ Namfun_t nvfun;
#include <shell.h>
@@ -302,13 +333,22 @@ struct limits
#define MATCH_MAX 64
+#define SH_READEVAL 0x4000 /* for sh_eval */
+
+extern Shell_t *nv_shell(Namval_t*);
extern int sh_addlib(void*);
+extern void sh_applyopts(Shell_t*,Shopt_t);
+extern char **sh_argbuild(Shell_t*,int*,const struct comnod*,int);
+extern struct dolnod *sh_argfree(Shell_t *, struct dolnod*,int);
+extern struct dolnod *sh_argnew(Shell_t*,char*[],struct dolnod**);
extern void *sh_argopen(Shell_t*);
+extern void sh_argreset(Shell_t*,struct dolnod*,struct dolnod*);
extern Namval_t *sh_assignok(Namval_t*,int);
+extern struct dolnod *sh_arguse(Shell_t*);
extern char *sh_checkid(char*,char*);
-extern int sh_debug(const char*,const char*,const char*,char *const[],int);
+extern int sh_debug(Shell_t *shp,const char*,const char*,const char*,char *const[],int);
extern int sh_echolist(Sfio_t*, int, char**);
-extern struct argnod *sh_endword(int);
+extern struct argnod *sh_endword(Shell_t*,int);
extern char **sh_envgen(void);
#if SHOPT_ENV
extern void sh_envput(Env_t*, Namval_t*);
@@ -318,25 +358,30 @@ extern Sfdouble_t sh_arith(const char*);
extern void *sh_arithcomp(char*);
extern pid_t sh_fork(int,int*);
extern pid_t _sh_fork(pid_t, int ,int*);
-extern char *sh_mactrim(char*,int);
-extern int sh_macexpand(struct argnod*,struct argnod**,int);
-extern void sh_machere(Sfio_t*, Sfio_t*, char*);
+extern char *sh_mactrim(Shell_t*,char*,int);
+extern int sh_macexpand(Shell_t*,struct argnod*,struct argnod**,int);
+extern int sh_macfun(Shell_t*,const char*,int);
+extern void sh_machere(Shell_t*,Sfio_t*, Sfio_t*, char*);
extern void *sh_macopen(Shell_t*);
-extern char *sh_macpat(struct argnod*,int);
-extern char *sh_mactry(char*);
+extern char *sh_macpat(Shell_t*,struct argnod*,int);
+extern char *sh_mactry(Shell_t*,char*);
extern void sh_printopts(Shopt_t,int,Shopt_t*);
extern int sh_readline(Shell_t*,char**,int,int,long);
extern Sfio_t *sh_sfeval(char*[]);
extern void sh_setmatch(const char*,int,int,int[]);
extern Dt_t *sh_subaliastree(int);
+extern void sh_scope(Shell_t*, struct argnod*, int);
+extern Namval_t *sh_scoped(Shell_t*, Namval_t*);
extern Dt_t *sh_subfuntree(int);
+extern void sh_subjobcheck(pid_t);
extern int sh_subsavefd(int);
-extern void sh_subtmpfile(void);
+extern void sh_subtmpfile(int);
extern char *sh_substitute(const char*,const char*,char*);
extern const char *_sh_translate(const char*);
extern int sh_trace(char*[],int);
extern void sh_trim(char*);
extern int sh_type(const char*);
+extern void sh_unscope(Shell_t*);
extern void sh_utol(const char*, char*);
extern int sh_whence(char**,int);
@@ -371,7 +416,32 @@ extern const char e_dict[];
/* sh_printopts() mode flags -- set --[no]option by default */
#define PRINT_VERBOSE 0x01 /* option on|off list */
-#define PRINT_ALL 0x02 /* list unset iptions too */
+#define PRINT_ALL 0x02 /* list unset options too */
#define PRINT_NO_HEADER 0x04 /* omit listing header */
#define PRINT_SHOPT 0x08 /* shopt -s|-u */
#define PRINT_TABLE 0x10 /* table of all options */
+
+#ifdef SHOPT_STATS
+ /* performance statistics */
+# define STAT_ARGHITS 0
+# define STAT_ARGEXPAND 1
+# define STAT_COMSUB 2
+# define STAT_FORKS 3
+# define STAT_FUNCT 4
+# define STAT_GLOBS 5
+# define STAT_READS 6
+# define STAT_NVHITS 7
+# define STAT_NVOPEN 8
+# define STAT_PATHS 9
+# define STAT_SVFUNCT 10
+# define STAT_SCMDS 11
+# define STAT_SPAWN 12
+# define STAT_SUBSHELL 13
+ extern const Shtable_t shtab_stats[];
+# define sh_stats(x) (sh.stats[(x)]++)
+#else
+# define sh_stats(x)
+#endif /* SHOPT_STATS */
+
+
+#endif
diff --git a/usr/src/lib/libshell/common/include/edit.h b/usr/src/lib/libshell/common/include/edit.h
index ddbd45c24b..c477130ed1 100644
--- a/usr/src/lib/libshell/common/include/edit.h
+++ b/usr/src/lib/libshell/common/include/edit.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -78,7 +78,8 @@ typedef struct edit
int e_lnext;
int e_fchar;
int e_plen; /* length of prompt string */
- int e_crlf; /* zero if cannot return to beginning of line */
+ char e_crlf; /* zero if cannot return to beginning of line */
+ char e_nocrnl; /* don't put a new-line with ^L */
int e_llimit; /* line length limit */
int e_hline; /* current history line number */
int e_hloff; /* line number offset for command */
diff --git a/usr/src/lib/libshell/common/include/env.h b/usr/src/lib/libshell/common/include/env.h
index f888913c34..93db7f5c27 100644
--- a/usr/src/lib/libshell/common/include/env.h
+++ b/usr/src/lib/libshell/common/include/env.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libshell/common/include/fault.h b/usr/src/lib/libshell/common/include/fault.h
index 107b337f68..e754ea56eb 100644
--- a/usr/src/lib/libshell/common/include/fault.h
+++ b/usr/src/lib/libshell/common/include/fault.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -33,6 +33,7 @@
#include "FEATURE/setjmp"
#include "FEATURE/sigfeatures"
+
#ifndef SIGWINCH
# ifdef SIGWIND
# define SIGWINCH SIGWIND
@@ -63,6 +64,10 @@ typedef void (*SH_SIGTYPE)(int,void(*)(int));
#define SH_SIGTSTP 0200 /* tstp signal received */
#define SH_SIGALRM 0200 /* timer alarm received */
#define SH_SIGTERM SH_SIGOFF /* term signal received */
+#define SH_SIGRUNTIME 0400 /* runtime value */
+
+#define SH_SIGRTMIN 0 /* sh.sigruntime[] index */
+#define SH_SIGRTMAX 1 /* sh.sigruntime[] index */
/*
* These are longjmp values
@@ -108,11 +113,11 @@ struct checkpt
#define sh_popcontext(bp) (sh.jmplist=(bp)->prev, errorpop(&((bp)->err)))
extern void sh_fault(int);
-extern void sh_done(int);
+extern void sh_done(void*,int);
extern void sh_chktrap(void);
extern void sh_sigclear(int);
extern void sh_sigdone(void);
-extern void sh_siginit(void);
+extern void sh_siginit(void*);
extern void sh_sigtrap(int);
extern void sh_sigreset(int);
extern void sh_timetraps(void);
diff --git a/usr/src/lib/libshell/common/include/fcin.h b/usr/src/lib/libshell/common/include/fcin.h
index c147a8fdef..b498efa7f2 100644
--- a/usr/src/lib/libshell/common/include/fcin.h
+++ b/usr/src/lib/libshell/common/include/fcin.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -36,7 +36,8 @@ typedef struct _fcin
unsigned char *fclast; /* pointer to end of input buffer */
unsigned char *fcptr; /* pointer to next input char */
unsigned char fcchar; /* saved character */
- void (*fcfun)(Sfio_t*,const char*,int); /* advance function */
+ void (*fcfun)(Sfio_t*,const char*,int,void*); /* advance function */
+ void *context; /* context pointer */
int fcleft; /* for multibyte boundary */
Sfoff_t fcoff; /* offset for last read */
} Fcin_t;
@@ -54,7 +55,7 @@ typedef struct _fcin
extern int fcfill(void);
extern int fcfopen(Sfio_t*);
extern int fcclose(void);
-void fcnotify(void(*)(Sfio_t*,const char*,int));
+void fcnotify(void(*)(Sfio_t*,const char*,int,void*),void*);
extern int fcmbstate(const char*,int*,int*);
extern Fcin_t _Fcin; /* used by macros */
diff --git a/usr/src/lib/libshell/common/include/history.h b/usr/src/lib/libshell/common/include/history.h
index f97cd8b4a4..53e2b24964 100644
--- a/usr/src/lib/libshell/common/include/history.h
+++ b/usr/src/lib/libshell/common/include/history.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -56,7 +56,7 @@ extern int _Hist;
#define hist_min(hp) ((_Hist=((int)((hp)->histind-(hp)->histsize)))>=0?_Hist:0)
#define hist_max(hp) ((int)((hp)->histind))
/* these are the history interface routines */
-extern int sh_histinit(void);
+extern int sh_histinit(void *);
extern void hist_cancel(History_t*);
extern void hist_close(History_t*);
extern int hist_copy(char*, int, int, int);
diff --git a/usr/src/lib/libshell/common/include/io.h b/usr/src/lib/libshell/common/include/io.h
index b8881bee84..4f3d280262 100644
--- a/usr/src/lib/libshell/common/include/io.h
+++ b/usr/src/lib/libshell/common/include/io.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -65,19 +65,19 @@
#define sh_inuse(f2) (sh.fdptrs[f2])
-extern int sh_iocheckfd(int);
-extern void sh_ioinit(void);
+extern int sh_iocheckfd(Shell_t*,int);
+extern void sh_ioinit(Shell_t*);
extern int sh_iomovefd(int);
-extern int sh_iorenumber(int,int);
+extern int sh_iorenumber(Shell_t*,int,int);
extern void sh_pclose(int[]);
-extern void sh_iorestore(int,int);
+extern void sh_iorestore(Shell_t*,int,int);
#if defined(__EXPORT__) && defined(_BLD_DLL) && defined(_BLD_shell)
__EXPORT__
#endif
-extern Sfio_t *sh_iostream(int);
-extern int sh_redirect(struct ionod*,int);
-extern void sh_iosave(int,int);
-extern void sh_iounsave(void);
+extern Sfio_t *sh_iostream(Shell_t*,int);
+extern int sh_redirect(Shell_t*,struct ionod*,int);
+extern void sh_iosave(Shell_t *, int,int,char*);
+extern void sh_iounsave(Shell_t*);
extern int sh_chkopen(const char*);
extern int sh_ioaccess(int,int);
extern int sh_devtofd(const char*);
@@ -98,6 +98,7 @@ extern const char e_open[];
extern const char e_notseek[];
extern const char e_noread[];
extern const char e_badseek[];
+extern const char e_badwrite[];
extern const char e_badpattern[];
extern const char e_toomany[];
extern const char e_pipe[];
diff --git a/usr/src/lib/libshell/common/include/jobs.h b/usr/src/lib/libshell/common/include/jobs.h
index c4998eabca..068f0a1abe 100644
--- a/usr/src/lib/libshell/common/include/jobs.h
+++ b/usr/src/lib/libshell/common/include/jobs.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -64,6 +64,7 @@ struct process
pid_t p_fgrp; /* process group when stopped */
short p_job; /* job number of process */
unsigned short p_exit; /* exit value or signal number */
+ unsigned short p_exitmin; /* minimum exit value for xargs */
unsigned short p_flag; /* flags - see below */
int p_env; /* subshell environment number */
#ifdef JOBS
@@ -105,8 +106,19 @@ extern struct jobs job;
#ifdef JOBS
+#if !_std_malloc
+#include <vmalloc.h>
+#if VMALLOC_VERSION >= 20070911L
+#define vmbusy() (vmstat(0,0)!=0)
+#endif
+#endif
+#ifndef vmbusy
+#define vmbusy() 0
+#endif
+
+
#define job_lock() (job.in_critical++)
-#define job_unlock() do{if(!--job.in_critical&&job.savesig)job_reap(job.savesig);}while(0)
+#define job_unlock() do{if(!--job.in_critical&&job.savesig&&!vmbusy())job_reap(job.savesig);}while(0)
extern const char e_jobusage[];
extern const char e_done[];
@@ -137,21 +149,21 @@ extern void job_clear(void);
extern void job_bwait(char**);
extern int job_walk(Sfio_t*,int(*)(struct process*,int),int,char*[]);
extern int job_kill(struct process*,int);
-extern void job_wait(pid_t);
+extern int job_wait(pid_t);
extern int job_post(pid_t,pid_t);
extern void *job_subsave(void);
extern void job_subrestore(void*);
#ifdef JOBS
- extern void job_init(int);
- extern int job_close(void);
+ extern void job_init(Shell_t*,int);
+ extern int job_close(Shell_t*);
extern int job_list(struct process*,int);
extern int job_terminate(struct process*,int);
extern int job_switch(struct process*,int);
extern void job_fork(pid_t);
extern int job_reap(int);
#else
-# define job_init(flag)
-# define job_close() (0)
+# define job_init(s,flag)
+# define job_close(s) (0)
# define job_fork(p)
#endif /* JOBS */
diff --git a/usr/src/lib/libshell/common/include/lexstates.h b/usr/src/lib/libshell/common/include/lexstates.h
index 8e3cdbfef6..77f351c88d 100644
--- a/usr/src/lib/libshell/common/include/lexstates.h
+++ b/usr/src/lib/libshell/common/include/lexstates.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -148,4 +148,5 @@ extern const char e_lexlongquote[];
extern const char e_lexfuture[];
extern const char e_lexzerobyte[];
extern const char e_lexemptyfor[];
+extern const char e_lextypeset[];
#endif
diff --git a/usr/src/lib/libshell/common/include/name.h b/usr/src/lib/libshell/common/include/name.h
index 04ed23e7d0..60821ee706 100644
--- a/usr/src/lib/libshell/common/include/name.h
+++ b/usr/src/lib/libshell/common/include/name.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -43,6 +43,7 @@ union Value
int32_t *lp;
Sflong_t *llp; /* for long long arithmetic */
int16_t s;
+ int16_t *sp;
double *dp; /* for floating point arithmetic */
Sfdouble_t *ldp; /* for long floating point arithmetic */
struct Namarray *array; /* for array node */
@@ -67,6 +68,8 @@ union Value
#define ARRAY_NOCLONE (16L<<ARRAY_BITS) /* do not clone array disc */
#define ARRAY_NOCHILD (32L<<ARRAY_BITS) /* skip compound arrays */
#define ARRAY_SETSUB (64L<<ARRAY_BITS) /* set subscript */
+#define ARRAY_NOSCOPE (128L<<ARRAY_BITS) /* top level scope only */
+#define ARRAY_TREE (256L<<ARRAY_BITS) /* arrays of compound vars */
#define NV_ASETSUB 8 /* set subscript */
/* These flags are used as options to array_get() */
@@ -86,11 +89,15 @@ struct Namref
/* This describes a user shell function node */
struct Ufunction
{
- int *ptree; /* address of parse tree */
- int lineno; /* line number of function start */
- off_t hoffset; /* offset into source or history file */
- Namval_t *nspace; /* pointer to name space */
- char *fname; /* file name where function defined */
+ int *ptree; /* address of parse tree */
+ int lineno; /* line number of function start */
+ off_t hoffset; /* offset into source or history file */
+ Namval_t *nspace; /* pointer to name space */
+ char *fname; /* file name where function defined */
+ char *help; /* help string */
+ Dt_t *sdict; /* dictionary for statics */
+ Dt_t *fdict; /* dictionary node belongs to */
+ Namval_t *np; /* function node pointer */
};
#ifndef ARG_RAW
@@ -101,11 +108,13 @@ struct Ufunction
/* The following attributes are for internal use */
#define NV_NOCHANGE (NV_EXPORT|NV_IMPORT|NV_RDONLY|NV_TAGGED|NV_NOFREE)
-#define NV_ATTRIBUTES (~(NV_NOSCOPE|NV_ARRAY|NV_NOARRAY|NV_IDENT|NV_ASSIGN|NV_REF|NV_VARNAME))
+#define NV_ATTRIBUTES (~(NV_NOSCOPE|NV_ARRAY|NV_NOARRAY|NV_IDENT|NV_ASSIGN|NV_REF|NV_VARNAME|NV_STATIC))
#define NV_PARAM NV_NODISC /* expansion use positional params */
/* This following are for use with nodes which are not name-values */
#define NV_TYPE 0x1000000
+#define NV_STATIC 0x2000000
+#define NV_COMVAR 0x4000000
#define NV_FUNCTION (NV_RJUST|NV_FUNCT) /* value is shell function */
#define NV_FPOSIX NV_LJUST /* posix function semantics */
#define NV_FTMP NV_ZFILL /* function source in tmpfile */
@@ -119,10 +128,12 @@ struct Ufunction
#define BLT_SPC (NV_LJUST) /* special built-ins */
#define BLT_EXIT (NV_RJUST) /* exit value can be > 255 */
#define BLT_DCL (NV_TAGGED) /* declaration command */
-#define nv_isref(n) (nv_isattr((n),NV_REF)==NV_REF)
-#define nv_istable(n) (nv_isattr((n),NV_TABLE|NV_LJUST|NV_RJUST)==NV_TABLE)
-#define is_abuiltin(n) (nv_isattr(n,NV_BLTIN)==NV_BLTIN)
-#define is_afunction(n) (nv_isattr(n,NV_FUNCTION)==NV_FUNCTION)
+#define BLT_NOSFIO (NV_IMPORT) /* doesn't use sfio */
+#define NV_OPTGET (NV_BINARY) /* function calls getopts */
+#define nv_isref(n) (nv_isattr((n),NV_REF|NV_TAGGED|NV_FUNCT)==NV_REF)
+#define nv_istable(n) (nv_isattr((n),NV_TABLE|NV_LJUST|NV_RJUST|NV_INTEGER)==NV_TABLE)
+#define is_abuiltin(n) (nv_isattr(n,NV_BLTIN|NV_INTEGER)==NV_BLTIN)
+#define is_afunction(n) (nv_isattr(n,NV_FUNCTION|NV_REF)==NV_FUNCTION)
#define nv_funtree(n) ((n)->nvalue.rp->ptree)
#define funptr(n) ((n)->nvalue.bfp)
@@ -138,16 +149,13 @@ struct Ufunction
#define nv_reftree(n) ((n)->nvalue.nrp->root)
#define nv_reftable(n) ((n)->nvalue.nrp->table)
#define nv_refsub(n) ((n)->nvalue.nrp->sub)
-#if SHOPT_OO
-# define nv_class(np) (nv_isattr(np,NV_REF|NV_IMPORT)?0:(Namval_t*)((np)->nvenv))
-#endif /* SHOPT_OO */
/* ... etc */
#define nv_setsize(n,s) ((n)->nvsize = (s))
#undef nv_size
#define nv_size(np) ((np)->nvsize)
-#define nv_isnull(np) (!(np)->nvalue.cp && !(np)->nvfun && !nv_isattr(np,NV_SHORT))
+#define nv_isnull(np) (!(np)->nvalue.cp && !((np)->nvfun && (np)->nvfun->disc) && nv_isattr(np,NV_SHORT|NV_INTEGER)!=(NV_SHORT|NV_INTEGER))
/* ... for arrays */
@@ -158,16 +166,21 @@ extern int array_maxindex(Namval_t*);
extern char *nv_endsubscript(Namval_t*, char*, int);
extern Namfun_t *nv_cover(Namval_t*);
extern Namarr_t *nv_arrayptr(Namval_t*);
+extern int nv_arraysettype(Namval_t*, Namval_t*,const char*,int);
+extern int nv_aimax(Namval_t*);
+extern int nv_atypeindex(Namval_t*, const char*);
extern int nv_setnotify(Namval_t*,char **);
extern int nv_unsetnotify(Namval_t*,char **);
extern void nv_setlist(struct argnod*, int);
+extern struct argnod* nv_onlist(struct argnod*, const char*);
extern void nv_optimize(Namval_t*);
extern void nv_outname(Sfio_t*,char*, int);
-extern void nv_scope(struct argnod*);
extern void nv_unref(Namval_t*);
extern void _nv_unset(Namval_t*,int);
extern int nv_clone(Namval_t*, Namval_t*, int);
-extern void *nv_diropen(const char*);
+void clone_all_disc(Namval_t*, Namval_t*, int);
+extern Namfun_t *nv_clone_disc(Namfun_t*, int);
+extern void *nv_diropen(Namval_t*, const char*);
extern char *nv_dirnext(void*);
extern void nv_dirclose(void*);
extern char *nv_getvtree(Namval_t*, Namfun_t*);
@@ -175,20 +188,26 @@ extern void nv_attribute(Namval_t*, Sfio_t*, char*, int);
extern Namval_t *nv_bfsearch(const char*, Dt_t*, Namval_t**, char**);
extern Namval_t *nv_mkclone(Namval_t*);
extern Namval_t *nv_mktype(Namval_t**, int);
-extern void nv_addnode(Namval_t*, int);
+extern Namval_t *nv_addnode(Namval_t*, int);
extern Namval_t *nv_parent(Namval_t*);
extern char *nv_getbuf(size_t);
extern Namval_t *nv_mount(Namval_t*, const char *name, Dt_t*);
extern Namval_t *nv_arraychild(Namval_t*, Namval_t*, int);
extern int nv_compare(Dt_t*, Void_t*, Void_t*, Dtdisc_t*);
+extern void nv_outnode(Namval_t*,Sfio_t*, int, int);
+extern int nv_subsaved(Namval_t*);
+extern void nv_typename(Namval_t*, Sfio_t*);
extern const Namdisc_t RESTRICTED_disc;
+extern const Namdisc_t ENUM_disc;
extern char nv_local;
extern Dtdisc_t _Nvdisc;
+extern const char *nv_discnames[];
extern const char e_subscript[];
extern const char e_nullset[];
extern const char e_notset[];
extern const char e_noparent[];
+extern const char e_notelem[];
extern const char e_readonly[];
extern const char e_badfield[];
extern const char e_restricted[];
@@ -196,6 +215,7 @@ extern const char e_ident[];
extern const char e_varname[];
extern const char e_noalias[];
extern const char e_noarray[];
+extern const char e_notenum[];
extern const char e_aliname[];
extern const char e_badexport[];
extern const char e_badref[];
@@ -205,4 +225,7 @@ extern const char e_envmarker[];
extern const char e_badlocale[];
extern const char e_loop[];
extern const char e_redef[];
+extern const char e_required[];
+extern const char e_badappend[];
+extern const char e_unknowntype[];
#endif /* _NV_PRIVATE */
diff --git a/usr/src/lib/libshell/common/include/national.h b/usr/src/lib/libshell/common/include/national.h
index 837015011a..542bb583d6 100644
--- a/usr/src/lib/libshell/common/include/national.h
+++ b/usr/src/lib/libshell/common/include/national.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libshell/common/include/nval.h b/usr/src/lib/libshell/common/include/nval.h
index 6d02dc0a3b..def26ebb18 100644
--- a/usr/src/lib/libshell/common/include/nval.h
+++ b/usr/src/lib/libshell/common/include/nval.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -31,6 +31,7 @@
#include <ast.h>
#include <cdt.h>
+#include <option.h>
/* for compatibility with old hash library */
#define Hashtab_t Dt_t
@@ -44,8 +45,7 @@ typedef struct Namfun Namfun_t;
typedef struct Namdisc Namdisc_t;
typedef struct Nambfun Nambfun_t;
typedef struct Namarray Namarr_t;
-typedef struct Nambltin Nambltin_t;
-typedef struct Namtype Namtype_t;
+typedef struct Namdecl Namdecl_t;
/*
* This defines the template for nodes that have their own assignment
@@ -64,13 +64,14 @@ struct Namdisc
Namval_t *(*nextf)(Namval_t*, Dt_t*, Namfun_t*);
Namval_t *(*typef)(Namval_t*, Namfun_t*);
int (*readf)(Namval_t*, Sfio_t*, int, Namfun_t*);
+ int (*writef)(Namval_t*, Sfio_t*, int, Namfun_t*);
};
struct Namfun
{
const Namdisc_t *disc;
char nofree;
- char funs;
+ unsigned char subshell;
unsigned short dsize;
Namfun_t *next;
char *last;
@@ -92,22 +93,14 @@ struct Namarray
long nelem; /* number of elements */
void *(*fun)(Namval_t*,const char*,int); /* associative arrays */
Namval_t *parent; /* for multi-dimensional */
+ Dt_t *table; /* for subscripts */
+ void *scope; /* non-zerp when scoped */
};
-/* Passed as third argument to a builtin when NV_BLTINOPT is set on node */
-struct Nambltin
+/* The context pointer for declaration command */
+struct Namdecl
{
- void *shp;
- Namval_t *np;
- void *ptr;
- void *data;
- int flags;
-};
-
-struct Namtype
-{
- void *shp;
- Namval_t *np;
+ Namval_t *tp; /* point to type */
const char *optstring;
void *optinfof;
};
@@ -132,6 +125,7 @@ struct Namval
};
#define NV_CLASS ".sh.type"
+#define NV_DATA "_" /* special class or instance variable */
#define NV_MINSZ (sizeof(struct Namval)-sizeof(Dtlink_t)-sizeof(char*))
#define nv_namptr(p,n) ((Namval_t*)((char*)(p)+(n)*NV_MINSZ-sizeof(Dtlink_t)))
@@ -163,13 +157,14 @@ struct Namval
#define NV_SHORT (NV_RJUST) /* when integers are not long */
#define NV_LONG (NV_UTOL) /* for long long and long double */
#define NV_UNSIGN (NV_LTOU) /* for unsigned quantities */
-#define NV_DOUBLE (NV_ZFILL) /* for floating point */
+#define NV_DOUBLE (NV_INTEGER|NV_ZFILL) /* for floating point */
#define NV_EXPNOTE (NV_LJUST) /* for scientific notation */
+#define NV_HEXFLOAT (NV_LTOU) /* for C99 base16 float notation */
/* options for nv_open */
#define NV_APPEND 0x10000 /* append value */
-#define NV_MOVE 0x20000 /* for use with nv_clone */
+#define NV_MOVE 0x8000000 /* for use with nv_clone */
#define NV_ADD 8
/* add node if not found */
#define NV_ASSIGN NV_NOFREE /* assignment is possible */
@@ -185,19 +180,21 @@ struct Namval
#define NV_NODISC NV_IDENT /* ignore disciplines */
#define NV_FUNCT NV_IDENT /* option for nv_create */
-#define NV_BLTINOPT NV_ZFILL /* save state for optimization*/
+#define NV_BLTINOPT NV_ZFILL /* mark builtins in libcmd */
#define NV_PUBLIC (~(NV_NOSCOPE|NV_ASSIGN|NV_IDENT|NV_VARNAME|NV_NOADD))
/* numeric types */
+#define NV_INT16P (NV_LJUST|NV_SHORT|NV_INTEGER)
#define NV_INT16 (NV_SHORT|NV_INTEGER)
#define NV_UINT16 (NV_UNSIGN|NV_SHORT|NV_INTEGER)
+#define NV_UINT16P (NV_LJUSTNV_UNSIGN|NV_SHORT|NV_INTEGER)
#define NV_INT32 (NV_INTEGER)
#define NV_UNT32 (NV_UNSIGN|NV_INTEGER)
#define NV_INT64 (NV_LONG|NV_INTEGER)
#define NV_UINT64 (NV_UNSIGN|NV_LONG|NV_INTEGER)
-#define NV_FLOAT (NV_SHORT|NV_DOUBLE|NV_INTEGER)
-#define NV_LDOUBLE (NV_LONG|NV_DOUBLE|NV_INTEGER)
+#define NV_FLOAT (NV_SHORT|NV_DOUBLE)
+#define NV_LDOUBLE (NV_LONG|NV_DOUBLE)
/* name-value pair macros */
#define nv_isattr(np,f) ((np)->nvflag & (f))
@@ -213,6 +210,7 @@ struct Namval
#define NV_ADELETE 5 /* delete current subscript */
#define NV_AADD 6 /* add subscript if not found */
#define NV_ACURRENT 7 /* return current subscript Namval_t* */
+#define NV_ASETSUB 8 /* set current subscript */
/* The following are for nv_disc */
#define NV_FIRST 1
@@ -221,7 +219,7 @@ struct Namval
#define NV_CLONE 4
/* The following are operations for nv_putsub() */
-#define ARRAY_BITS 24
+#define ARRAY_BITS 22
#define ARRAY_ADD (1L<<ARRAY_BITS) /* add subscript if not found */
#define ARRAY_SCAN (2L<<ARRAY_BITS) /* For ${array[@]} */
#define ARRAY_UNDEF (4L<<ARRAY_BITS) /* For ${array} */
@@ -239,7 +237,9 @@ struct Namval
# endif /* _BLD_shell */
#endif /* _DLL */
/* prototype for array interface*/
+extern Namarr_t *nv_arrayptr(Namval_t*);
extern Namarr_t *nv_setarray(Namval_t*,void*(*)(Namval_t*,const char*,int));
+extern int nv_arraynsub(Namarr_t*);
extern void *nv_associative(Namval_t*,const char*,int);
extern int nv_aindex(Namval_t*);
extern int nv_nextsub(Namval_t*);
@@ -253,6 +253,7 @@ extern int nv_clone(Namval_t*, Namval_t*, int);
extern void nv_close(Namval_t*);
extern void *nv_context(Namval_t*);
extern Namval_t *nv_create(const char*, Dt_t*, int,Namfun_t*);
+extern void nv_delete(Namval_t*, Dt_t*, int);
extern Dt_t *nv_dict(Namval_t*);
extern Sfdouble_t nv_getn(Namval_t*, Namfun_t*);
extern Sfdouble_t nv_getnum(Namval_t*);
@@ -260,13 +261,15 @@ extern char *nv_getv(Namval_t*, Namfun_t*);
extern char *nv_getval(Namval_t*);
extern Namfun_t *nv_hasdisc(Namval_t*, const Namdisc_t*);
extern int nv_isnull(Namval_t*);
+extern Namfun_t *nv_isvtree(Namval_t*);
extern Namval_t *nv_lastdict(void);
+extern Namval_t *nv_mkinttype(char*, size_t, int, const char*, Namdisc_t*);
extern void nv_newattr(Namval_t*,unsigned,int);
extern Namval_t *nv_open(const char*,Dt_t*,int);
extern void nv_putval(Namval_t*,const char*,int);
extern void nv_putv(Namval_t*,const char*,int,Namfun_t*);
+extern int nv_rename(Namval_t*,int);
extern int nv_scan(Dt_t*,void(*)(Namval_t*,void*),void*,int,int);
-extern Namval_t *nv_scoped(Namval_t*);
extern char *nv_setdisc(Namval_t*,const char*,Namval_t*,Namfun_t*);
extern void nv_setref(Namval_t*, Dt_t*,int);
extern int nv_settype(Namval_t*, Namval_t*, int);
@@ -274,17 +277,19 @@ extern void nv_setvec(Namval_t*,int,int,char*[]);
extern void nv_setvtree(Namval_t*);
extern int nv_setsize(Namval_t*,int);
extern Namfun_t *nv_disc(Namval_t*,Namfun_t*,int);
-extern void nv_unset(Namval_t*);
+extern void nv_unset(Namval_t*); /*obsolete */
+extern void _nv_unset(Namval_t*,int);
extern Namval_t *nv_search(const char *, Dt_t*, int);
-extern void nv_unscope(void);
extern char *nv_name(Namval_t*);
extern Namval_t *nv_type(Namval_t*);
+extern void nv_addtype(Namval_t*,const char*, Optdisc_t*, size_t);
extern const Namdisc_t *nv_discfun(int);
#ifdef _DLL
# undef extern
#endif /* _DLL */
+#define nv_unset(np) _nv_unset(np,0)
#define nv_size(np) nv_setsize((np),-1)
#define nv_stack(np,nf) nv_disc(np,nf,0)
@@ -296,7 +301,7 @@ extern const Namdisc_t *nv_discfun(int);
# define nv_istype(np) nv_isattr(np)
# define nv_newtype(np) nv_newattr(np)
# define nv_namset(np,a,b) nv_open(np,a,b)
-# define nv_free(np) nv_unset(np)
+# define nv_free(np) nv_unset(np,0)
# define nv_settype(np,a,b,c) nv_setdisc(np,a,b,c)
# define nv_search(np,a,b) nv_open(np,a,((b)?0:NV_NOADD))
# define settype setdisc
diff --git a/usr/src/lib/libshell/common/include/path.h b/usr/src/lib/libshell/common/include/path.h
index 2460be3cbf..15c4e9694b 100644
--- a/usr/src/lib/libshell/common/include/path.h
+++ b/usr/src/lib/libshell/common/include/path.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -44,7 +44,7 @@
#define PATH_STD_DIR 0100 /* directory is on $(getconf PATH) */
#define PATH_OFFSET 2 /* path offset for path_join */
-#define MAXDEPTH (sizeof(char*)==2?64:4096) /* maximum recursion depth*/
+#define MAXDEPTH (sizeof(char*)==2?64:2048) /* maximum recursion depth*/
/*
* path component structure for path searching
@@ -55,6 +55,7 @@ typedef struct pathcomp
int refcount;
dev_t dev;
ino_t ino;
+ time_t mtime;
char *name;
char *lib;
char *blib;
@@ -90,7 +91,7 @@ extern Pathcomp_t *path_get(const char*);
#undef extern
extern char *path_pwd(int);
extern Pathcomp_t *path_nextcomp(Pathcomp_t*,const char*,Pathcomp_t*);
-extern int path_search(const char*,Pathcomp_t*,int);
+extern int path_search(const char*,Pathcomp_t**,int);
extern char *path_relative(const char*);
extern int path_complete(const char*, const char*,struct argnod**);
#if SHOPT_BRACEPAT
@@ -115,6 +116,7 @@ extern const char e_crondir[];
#endif /* SHOPT_SUID_EXEC */
extern const char is_alias[];
extern const char is_builtin[];
+extern const char is_spcbuiltin[];
extern const char is_builtver[];
extern const char is_reserved[];
extern const char is_talias[];
diff --git a/usr/src/lib/libshell/common/include/shell.h b/usr/src/lib/libshell/common/include/shell.h
index 66ccd20436..b82e582cfc 100644
--- a/usr/src/lib/libshell/common/include/shell.h
+++ b/usr/src/lib/libshell/common/include/shell.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -27,7 +27,7 @@
*
*/
-#include <cmd.h>
+#include <ast.h>
#include <cdt.h>
#ifdef _SH_PRIVATE
# include "name.h"
@@ -35,7 +35,7 @@
# include <nval.h>
#endif /* _SH_PRIVATE */
-#define SH_VERSION 20060510
+#define SH_VERSION 20071012
#undef NOT_USED
#define NOT_USED(x) (&x,1)
@@ -47,8 +47,9 @@ typedef struct
}
Shopt_t;
-typedef void (*Shinit_f)(int);
-typedef int (*Shbltin_f)(int, char*[], void*);
+typedef struct Shell_s Shell_t;
+
+typedef void (*Shinit_f)(Shell_t*, int);
typedef int (*Shwait_f)(int, long, int);
union Shnode_u;
@@ -115,6 +116,7 @@ typedef struct sh_scope
char **argv;
char *cmdname;
char *filename;
+ char *funname;
int lineno;
Dt_t *var_tree;
struct sh_scope *self;
@@ -124,7 +126,7 @@ typedef struct sh_scope
* Saves the state of the shell
*/
-typedef struct sh_static
+struct Shell_s
{
Shopt_t options; /* set -o options */
Dt_t *var_tree; /* for shell variables */
@@ -136,10 +138,11 @@ typedef struct sh_static
int exitval; /* most recent exit value */
unsigned char trapnote; /* set when trap/signal is pending */
char subshell; /* set for virtual subshell */
+ char shcomp; /* set when runing shcomp */
#ifdef _SH_PRIVATE
_SH_PRIVATE
#endif /* _SH_PRIVATE */
-} Shell_t;
+};
/* flags for sh_parse */
#define SH_NL 1 /* Treat new-lines as ; */
@@ -149,9 +152,13 @@ typedef struct sh_static
#define SH_IOCOPROCESS (-2)
#define SH_IOHISTFILE (-3)
+#include <cmd.h>
+
/* symbolic value for sh_fdnotify */
#define SH_FDCLOSE (-1)
+#undef getenv /* -lshell provides its own */
+
#if defined(__EXPORT__) && defined(_DLL)
# ifdef _BLD_shell
# define extern __EXPORT__
@@ -169,7 +176,8 @@ extern int sh_trap(const char*,int);
extern int sh_fun(Namval_t*,Namval_t*, char*[]);
extern int sh_funscope(int,char*[],int(*)(void*),void*,int);
extern Sfio_t *sh_iogetiop(int,int);
-extern int sh_main(int, char*[], void(*)(int));
+extern int sh_main(int, char*[], Shinit_f);
+extern int sh_run(int, char*[]);
extern void sh_menu(Sfio_t*, int, char*[]);
extern Namval_t *sh_addbuiltin(const char*, int(*)(int, char*[],void*), void*);
extern char *sh_fmtq(const char*);
diff --git a/usr/src/lib/libshell/common/include/shlex.h b/usr/src/lib/libshell/common/include/shlex.h
index 56de279d6c..8f5277c246 100644
--- a/usr/src/lib/libshell/common/include/shlex.h
+++ b/usr/src/lib/libshell/common/include/shlex.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -31,7 +31,8 @@
#include "shtable.h"
#include "lexstates.h"
-struct shlex_t
+
+typedef struct _shlex_
{
Shell_t *sh; /* pointer to the interpreter */
struct argnod *arg; /* current word */
@@ -42,9 +43,12 @@ struct shlex_t
int digits; /* numerical value with word token */
char aliasok; /* on when alias is legal */
char assignok; /* on when name=value is legal */
+ char inexec; /* on when processing exec */
+ char intypeset; /* on when processing typeset */
+ char comp_assign; /* in compound assignment */
+ char comsub; /* parsing command substitution */
int inlineno; /* saved value of sh.inlineno */
int firstline; /* saved value of sh.st.firstline */
- int comsub; /* parsing command substitution */
#if SHOPT_KIA
Sfio_t *kiafile; /* kia output file */
Sfio_t *kiatmp; /* kia reference file */
@@ -56,7 +60,10 @@ struct shlex_t
char *scriptname; /* name of script file */
Dt_t *entity_tree; /* for entity ids */
#endif /* SHOPT_KIA */
-};
+#ifdef _SHLEX_PRIVATE
+ _SHLEX_PRIVATE
+#endif
+} Lex_t;
/* symbols for parsing */
#define NL '\n'
@@ -122,6 +129,7 @@ struct shlex_t
#define SH_COMPASSIGN 010 /* allow compound assignments only */
+#if 0
typedef struct _shlex_
{
struct shlex_t _shlex;
@@ -131,6 +139,7 @@ typedef struct _shlex_
} Lex_t;
#define shlex (((Lex_t*)(sh.lex_context))->_shlex)
+#endif
extern const char e_unexpected[];
extern const char e_unmatched[];
extern const char e_endoffile[];
@@ -144,9 +153,15 @@ extern const char e_newline[];
#define LBRACT '['
#define RBRACT ']'
-extern int sh_lex();
+extern int sh_lex(Lex_t*);
+extern Shnode_t *sh_dolparen(Lex_t*);
extern Lex_t *sh_lexopen(Lex_t*, Shell_t*, int);
-extern void sh_lexskip(int,int,int);
-extern void sh_syntax(void);
+extern void sh_lexskip(Lex_t*,int,int,int);
+extern void sh_syntax(Lex_t*);
+#if SHOPT_KIA
+ extern int kiaclose(Lex_t *);
+ extern unsigned long kiaentity(Lex_t*, const char*,int,int,int,int,unsigned long,int,int,const char*);
+#endif /* SHOPT_KIA */
+
#endif /* !NOTSYM */
diff --git a/usr/src/lib/libshell/common/include/shnodes.h b/usr/src/lib/libshell/common/include/shnodes.h
index b688edb4c5..e55cfc42eb 100644
--- a/usr/src/lib/libshell/common/include/shnodes.h
+++ b/usr/src/lib/libshell/common/include/shnodes.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -40,6 +40,7 @@
#define FSHOWME (0400<<COMBITS) /* set for showme commands */
#define FPOSIX (02<<COMBITS) /* posix semantics function */
#define FLINENO (04<<COMBITS) /* for/case has line number */
+#define FOPTGET (010<<COMBITS) /* function calls getopts */
#define TNEGATE (01<<COMBITS) /* ! inside [[...]] */
#define TBINARY (02<<COMBITS) /* binary operator in [[...]] */
@@ -169,21 +170,22 @@ struct arithnod
/* types of ionodes stored in iofile */
-#define IOUFD 0x3f /* file descriptor number mask */
-#define IOPUT 0x40 /* > redirection operator */
-#define IOAPP 0x80 /* >> redirection operator */
-#define IODOC 0x100 /* << redirection operator */
-#define IOMOV 0x200 /* <& or >& operators */
-#define IOCLOB 0x400 /* noclobber bit */
-#define IORDW 0x800 /* <> redirection operator */
-#define IORAW 0x1000 /* no expansion needed for filename */
-#define IOSTRG 0x2000 /* here-document stored as incore string */
-#define IOSTRIP 0x4000 /* strip leading tabs for here-document */
-#define IOQUOTE 0x8000 /* here-document delimiter was quoted */
-#define IOVNM 0x10000 /* iovname field is non-zero */
-#define IOLSEEK 0x20000 /* seek operators <# or ># */
-#define IOARITH 0x40000 /* arithmetic seek <# ((expr)) */
-#define IOCOPY IOCLOB /* copy skipped lines onto standard output */
+#define IOUFD 0x3f /* file descriptor number mask */
+#define IOPUT 0x40 /* > redirection operator */
+#define IOAPP 0x80 /* >> redirection operator */
+#define IODOC 0x100 /* << redirection operator */
+#define IOMOV 0x200 /* <& or >& operators */
+#define IOCLOB 0x400 /* noclobber bit */
+#define IORDW 0x800 /* <> redirection operator */
+#define IORAW 0x1000 /* no expansion needed for filename */
+#define IOSTRG 0x2000 /* here-document stored as incore string */
+#define IOSTRIP 0x4000 /* strip leading tabs for here-document */
+#define IOQUOTE 0x8000 /* here-document delimiter was quoted */
+#define IOVNM 0x10000 /* iovname field is non-zero */
+#define IOLSEEK 0x20000 /* seek operators <# or ># */
+#define IOARITH 0x40000 /* arithmetic seek <# ((expr)) */
+#define IOREWRITE 0x80000 /* arithmetic seek <# ((expr)) */
+#define IOCOPY IOCLOB /* copy skipped lines onto standard output */
union Shnode_u
{
@@ -205,18 +207,13 @@ union Shnode_u
struct arithnod ar;
};
-extern void sh_freeup(void);
+extern void sh_freeup(Shell_t*);
extern void sh_funstaks(struct slnod*,int);
extern Sfio_t *sh_subshell(Shnode_t*, int, int);
#if defined(__EXPORT__) && defined(_BLD_DLL) && defined(_BLD_shell)
__EXPORT__
#endif
extern int sh_tdump(Sfio_t*, const Shnode_t*);
-extern Shnode_t *sh_dolparen(void);
-extern Shnode_t *sh_trestore(Sfio_t*);
-#if SHOPT_KIA
- extern int kiaclose(void);
- extern unsigned long kiaentity(const char*,int,int,int,int,unsigned long,int,int,const char*);
-#endif /* SHOPT_KIA */
+extern Shnode_t *sh_trestore(Shell_t*, Sfio_t*);
#endif /* _SHNODES_H */
diff --git a/usr/src/lib/libshell/common/include/shtable.h b/usr/src/lib/libshell/common/include/shtable.h
index fc4e8e471f..041372b431 100644
--- a/usr/src/lib/libshell/common/include/shtable.h
+++ b/usr/src/lib/libshell/common/include/shtable.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -33,20 +33,20 @@
typedef struct shtable1
{
const char *sh_name;
- unsigned sh_number;
+ const unsigned sh_number;
} Shtable_t;
struct shtable2
{
const char *sh_name;
- unsigned sh_number;
+ const unsigned sh_number;
const char *sh_value;
};
struct shtable3
{
const char *sh_name;
- unsigned sh_number;
+ const unsigned sh_number;
int (*sh_value)(int, char*[], void*);
};
diff --git a/usr/src/lib/libshell/common/include/streval.h b/usr/src/lib/libshell/common/include/streval.h
index bbf51bd9d7..4ec3181f15 100644
--- a/usr/src/lib/libshell/common/include/streval.h
+++ b/usr/src/lib/libshell/common/include/streval.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libshell/common/include/terminal.h b/usr/src/lib/libshell/common/include/terminal.h
index 1712c12bab..a0e813c935 100644
--- a/usr/src/lib/libshell/common/include/terminal.h
+++ b/usr/src/lib/libshell/common/include/terminal.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libshell/common/include/test.h b/usr/src/lib/libshell/common/include/test.h
index b1ece6fcfa..593bd5852b 100644
--- a/usr/src/lib/libshell/common/include/test.h
+++ b/usr/src/lib/libshell/common/include/test.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libshell/common/include/timeout.h b/usr/src/lib/libshell/common/include/timeout.h
index 3248b562c1..803c6b09d2 100644
--- a/usr/src/lib/libshell/common/include/timeout.h
+++ b/usr/src/lib/libshell/common/include/timeout.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libshell/common/include/ulimit.h b/usr/src/lib/libshell/common/include/ulimit.h
index b31d12b494..d5f3b21391 100644
--- a/usr/src/lib/libshell/common/include/ulimit.h
+++ b/usr/src/lib/libshell/common/include/ulimit.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libshell/common/include/variables.h b/usr/src/lib/libshell/common/include/variables.h
index 2ceefcf9f7..ac9c5a536b 100644
--- a/usr/src/lib/libshell/common/include/variables.h
+++ b/usr/src/lib/libshell/common/include/variables.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -68,37 +68,41 @@
#define LCMSGNOD (sh.bltin_nodes+38)
#define LCNUMNOD (sh.bltin_nodes+39)
#define FIGNORENOD (sh.bltin_nodes+40)
-#define DOTSHNOD (sh.bltin_nodes+41)
-#define ED_CHRNOD (sh.bltin_nodes+42)
-#define ED_COLNOD (sh.bltin_nodes+43)
-#define ED_TXTNOD (sh.bltin_nodes+44)
-#define ED_MODENOD (sh.bltin_nodes+45)
-#define SH_NAMENOD (sh.bltin_nodes+46)
-#define SH_SUBSCRNOD (sh.bltin_nodes+47)
-#define SH_VALNOD (sh.bltin_nodes+48)
-#define SH_VERSIONNOD (sh.bltin_nodes+49)
-#define SH_DOLLARNOD (sh.bltin_nodes+50)
-#define SH_MATCHNOD (sh.bltin_nodes+51)
-#define SH_COMMANDNOD (sh.bltin_nodes+52)
-#define SH_PATHNAMENOD (sh.bltin_nodes+53)
-#define SH_FUNNAMENOD (sh.bltin_nodes+54)
-#define SH_SUBSHELLNOD (sh.bltin_nodes+55)
-#define SH_LEVELNOD (sh.bltin_nodes+56)
+#define VERSIONNOD (sh.bltin_nodes+41)
+#define DOTSHNOD (sh.bltin_nodes+42)
+#define ED_CHRNOD (sh.bltin_nodes+43)
+#define ED_COLNOD (sh.bltin_nodes+44)
+#define ED_TXTNOD (sh.bltin_nodes+45)
+#define ED_MODENOD (sh.bltin_nodes+46)
+#define SH_NAMENOD (sh.bltin_nodes+47)
+#define SH_SUBSCRNOD (sh.bltin_nodes+48)
+#define SH_VALNOD (sh.bltin_nodes+49)
+#define SH_VERSIONNOD (sh.bltin_nodes+50)
+#define SH_DOLLARNOD (sh.bltin_nodes+51)
+#define SH_MATCHNOD (sh.bltin_nodes+52)
+#define SH_COMMANDNOD (sh.bltin_nodes+53)
+#define SH_PATHNAMENOD (sh.bltin_nodes+54)
+#define SH_FUNNAMENOD (sh.bltin_nodes+55)
+#define SH_SUBSHELLNOD (sh.bltin_nodes+56)
+#define SH_LEVELNOD (sh.bltin_nodes+57)
+#define SH_LINENO (sh.bltin_nodes+58)
+#define SH_STATS (sh.bltin_nodes+59)
+#define SHLVL (sh.bltin_nodes+60)
#if SHOPT_FS_3D
-# define VPATHNOD (sh.bltin_nodes+57)
+# define VPATHNOD (sh.bltin_nodes+61)
# define NFS_3D 1
#else
# define NFS_3D 0
#endif /* SHOPT_FS_3D */
#if SHOPT_VPIX
-# define DOSPATHNOD (sh.bltin_nodes+57+NFS_3D)
-# define VPIXNOD (sh.bltin_nodes+58+NFS_3D)
+# define DOSPATHNOD (sh.bltin_nodes+61+NFS_3D)
+# define VPIXNOD (sh.bltin_nodes+62+NFS_3D)
# define NVPIX (NFS_3D+2)
#else
# define NVPIX NFS_3D
#endif /* SHOPT_VPIX */
#ifdef apollo
-# define SYSTYPENOD (sh.bltin_nodes+57+NVPIX)
+# define SYSTYPENOD (sh.bltin_nodes+61+NVPIX)
#endif /* apollo */
#endif /* SH_VALNOD */
diff --git a/usr/src/lib/libshell/common/include/version.h b/usr/src/lib/libshell/common/include/version.h
index dafdfcbd68..8f025169ff 100644
--- a/usr/src/lib/libshell/common/include/version.h
+++ b/usr/src/lib/libshell/common/include/version.h
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -17,4 +17,4 @@
* David Korn <dgk@research.att.com> *
* *
***********************************************************************/
-#define SH_RELEASE "1993-12-28 s+"
+#define SH_RELEASE "93t 2008-11-04"
diff --git a/usr/src/lib/libshell/common/llib-lshell b/usr/src/lib/libshell/common/llib-lshell
index 49bb9889e7..a65fe10ee2 100644
--- a/usr/src/lib/libshell/common/llib-lshell
+++ b/usr/src/lib/libshell/common/llib-lshell
@@ -19,120 +19,15 @@
* CDDL HEADER END
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* lib/libshell/common/llib-lshell
*
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*LINTLIBRARY*/
/*PROTOLIB1*/
#include <shell.h>
#include <nval.h>
-
-/* automatically generated data start here */
-extern const char e_defpath[];
-extern const char e_found[];
-extern const char e_nospace[];
-extern const char e_format[];
-extern const char e_number[];
-extern const char e_restricted[];
-extern const char e_recursive[];
-extern char e_version[];
-extern Dt_t *sh_bltin_tree (void);
-extern void sh_subfork (void);
-extern Shell_t *sh_init (int,char*[],Shinit_f);
-extern int sh_reinit (char*[]);
-extern int sh_eval (Sfio_t*,int);
-extern void sh_delay (double);
-extern void *sh_parse (Shell_t*, Sfio_t*,int);
-extern int sh_trap (const char*,int);
-extern int sh_fun (Namval_t*,Namval_t*, char*[]);
-extern int sh_funscope (int,char*[],int(*)(void*),void*,int);
-extern Sfio_t *sh_iogetiop (int,int);
-extern int sh_main (int, char*[], void(*)(int));
-extern void sh_menu (Sfio_t*, int, char*[]);
-extern Namval_t *sh_addbuiltin (const char*, int(*)(int, char*[],void*), void*);
-extern char *sh_fmtq (const char*);
-extern char *sh_fmtqf (const char*, int, int);
-extern Sfdouble_t sh_strnum (const char*, char**, int);
-extern int sh_access (const char*,int);
-extern int sh_close (int);
-extern int sh_dup (int);
-extern void sh_exit (int);
-extern int sh_fcntl (int, int, ...);
-extern Sfio_t *sh_fd2sfio (int);
-extern Shell_t *sh_getinterp (void);
-extern int sh_open (const char*, int, ...);
-extern int sh_openmax (void);
-extern Sfio_t *sh_pathopen (const char*);
-extern ssize_t sh_read (int, void*, size_t);
-extern ssize_t sh_write (int, const void*, size_t);
-extern off_t sh_seek (int, off_t, int);
-extern int sh_pipe (int[]);
-extern mode_t sh_umask (mode_t);
-extern void *sh_waitnotify (Shwait_f);
-extern Shscope_t *sh_getscope (int,int);
-extern Shscope_t *sh_setscope (Shscope_t*);
-extern void sh_sigcheck (void);
-extern unsigned long sh_isoption (int);
-extern unsigned long sh_onoption (int);
-extern unsigned long sh_offoption (int);
-extern int sh_waitsafe (void);
-extern int sh_exec (const Shnode_t*,int);
-extern int sh_waitsafe(void);
-extern int sh_exec(const Shnode_t*,int);
-extern void **sh_getliblist(void);
-extern Shell_t sh;
-extern Namarr_t *nv_setarray (Namval_t*,void*(*)(Namval_t*,const char*,int));
-extern void *nv_associative (Namval_t*,const char*,int);
-extern int nv_aindex (Namval_t*);
-extern int nv_nextsub (Namval_t*);
-extern char *nv_getsub (Namval_t*);
-extern Namval_t *nv_putsub (Namval_t*, char*, long);
-extern Namval_t *nv_opensub (Namval_t*);
-extern int nv_adddisc (Namval_t*, const char**, Namval_t**);
-extern int nv_clone (Namval_t*, Namval_t*, int);
-extern void nv_close (Namval_t*);
-extern void *nv_context (Namval_t*);
-extern Namval_t *nv_create (const char*, Dt_t*, int,Namfun_t*);
-extern Dt_t *nv_dict (Namval_t*);
-extern Sfdouble_t nv_getn (Namval_t*, Namfun_t*);
-extern Sfdouble_t nv_getnum (Namval_t*);
-extern char *nv_getv (Namval_t*, Namfun_t*);
-extern char *nv_getval (Namval_t*);
-extern Namfun_t *nv_hasdisc (Namval_t*, const Namdisc_t*);
-extern int nv_isnull (Namval_t*);
-extern Namval_t *nv_lastdict (void);
-extern void nv_newattr (Namval_t*,unsigned,int);
-extern Namval_t *nv_open (const char*,Dt_t*,int);
-extern void nv_putval (Namval_t*,const char*,int);
-extern void nv_putv (Namval_t*,const char*,int,Namfun_t*);
-extern int nv_scan (Dt_t*,void(*)(Namval_t*,void*),void*,int,int);
-extern Namval_t *nv_scoped (Namval_t*);
-extern char *nv_setdisc (Namval_t*,const char*,Namval_t*,Namfun_t*);
-extern void nv_setref (Namval_t*, Dt_t*,int);
-extern int nv_settype (Namval_t*, Namval_t*, int);
-extern void nv_setvec (Namval_t*,int,int,char*[]);
-extern void nv_setvtree (Namval_t*);
-extern int nv_setsize (Namval_t*,int);
-extern Namfun_t *nv_disc (Namval_t*,Namfun_t*,int);
-extern void nv_unset (Namval_t*);
-extern Namval_t *nv_search (const char *, Dt_t*, int);
-extern void nv_unscope (void);
-extern char *nv_name (Namval_t*);
-extern Namval_t *nv_type (Namval_t*);
-extern const Namdisc_t *nv_discfun (int);
-/* end of automatically generated data */
-
-/* Manually added based on libshell/common/include/builtins.h */
-extern int b_printf(int, char*[],void*);
-extern int B_echo(int, char*[],void*);
-extern int b_print(int, char*[],void*);
-extern int b_pwd(int, char*[],void*);
-extern int b_sleep(int, char*[],void*);
-extern int b_test(int, char*[],void*);
diff --git a/usr/src/lib/libshell/common/nval.3 b/usr/src/lib/libshell/common/nval.3
index 4acfc70b64..3926ef5b88 100644
--- a/usr/src/lib/libshell/common/nval.3
+++ b/usr/src/lib/libshell/common/nval.3
@@ -28,7 +28,9 @@ Namdisc_t;
.ft 5
Namval_t *nv_open(const char *\fIname\fP, Dt_t *\fIdict\fP, int \fIflags\fP);
Namval_t *nv_create(const char *\fIname\fP, Dt_t *\fIdict\fP, int \fIflags\fP, Namfun_t *\fIfp\fP);
+Namval_t *nv_namptr(void *\fIptr\fP, int \fIindx\fP);
void nv_close(Namval_t *\fInp\fP);
+void nv_delete(Namval_t *\fInp\fP, Dt_t *\fIdict\fP, int \fInofree\fP);
.ft R
.fi
.SS "GETTING AND SETTING VALUES"
@@ -38,7 +40,7 @@ char *nv_getval(Namval_t *\fInp\fP);
Sfdouble_t nv_getnum(Namval_t *\fInp\fP);
char *nv_name(Namval_t *\fInp\fP);
void nv_putval(Namval_t *\fInp\fP, const char *\fIval\fP, int \fIflags\fP);
-void nv_unset(Namval_t *\fInp\fP);
+void nv_unset(Namval_t *\fInp\fP, int \fIflags\fP);
int nv_clone(Namval_t *\fIsrc\fP, Namval_t *\fIdest\fP, int \fIflags\fP);
.ft R
.fi
@@ -49,6 +51,7 @@ int nv_isnull(Namval_t *\fInp\fP);
int nv_setsize(Namval_t *\fInp\fP, int \fIsize\fP);
int nv_size(Namval_t *\fInp\fP);
unsigned nv_isattr(Namval_t *\fInp\fP, unsigned \fIflags\fP);
+Namfun_t *nv_isvtree(Namval_t *\fInp\fP);
unsigned nv_onattr(Namval_t *\fInp\fP, unsigned \fIflags\fP);
unsigned nv_offattr(Namval_t *\fInp\fP, unsigned \fIflags\fP);
void nv_newattr(Namval_t *\fInp\fP, unsigned \fIflags\fP, int \fIsize\fP);
@@ -60,6 +63,7 @@ void nv_newattr(Namval_t *\fInp\fP, unsigned \fIflags\fP, int \fIsize\fP);
.ft 5
unsigned nv_isarray(Namval_t *\fInp\fP);
Namarr_t *nv_setarray(Namval_t *\fInp\fP,void*(*\fIfun\fP)(Namval_t*,const char*,int));
+Namarr_t *nv_arrayptr(Namval_t *\fInp\fP);
Namval_t *nv_putsub(Namval_t *\fInp\fP, char *\fIname\fP, long \fImode\fP);
Namval_t *nv_opensub(Namval_t *\fInp\fP);
void nv_setvec(Namval_t *\fInp\fP, int \fIappend\fP, int \fIargc\fP, char *\fIargv\fP[]);
@@ -81,11 +85,20 @@ char *nv_adddisc(Namval_t *\fInp\fP, const char **\fInames\fP);
const Namdisc_t *nv_discfun(int \fIwhich\fP);
.ft R
.fi
+.SS "TYPES"
+.nf
+.ft 5
+Namval_t *nv_type(Namval_t *\fInp\fP);
+int *nv_settype(Namval_t *\fInp\fP, Namval_t *\fItp\fP, int \fIflags\fP);
+Namval_t *nv_mkinttype(char *\fIname\fP, size_t \fIsz\fP, int \fIus\fP, const char *\fIstr\fP, Namdisc_t *\fIdp\fP);
+void nv_addtype(Namval_t *\fInp\fP, const char *\fIstr\fP, Optdisc_t* *\fIop\fP, size_t \fIsz\fP);
+.ft R
+.fi
.SS "MISCELLANEOUS FUNCTIONS"
.nf
.ft 5
int nv_scan(Dt_t *\fIdict\fP, void(*\fIfn\fP)(Namval_t*,void*), void *\fIdata\fP, int \fImask\fP, int \fIflags\fP);
-Dt_t nv_dict(Namval_t *\fInp\fP);
+Dt_t *nv_dict(Namval_t *\fInp\fP);
void nv_setvtree(Namval_t *\fInp\fP);
void nv_setref(Namval_t *\fInp\fP, Dt_t *\fIdp\fP, int \fIflags\fP);
Namval_t *nv_lastdict(void);
@@ -179,11 +192,25 @@ The \f5nv_lastdict()\fP function returns a pointer the the
name-value pair that contains
the last dictionary searched on the previous \f5nv_open()\fP.
.PP
+Name-value pairs can also be allocated without belonging to
+a dictionary. They will typically be looked by a a \fIcreate\fP
+discipline associated with a parent node. In this case the
+node size will by \f5NV_MINSZ\fP and \fIn\fP nodes can be allocated
+vial \f5calloc(5NV_MINSZ,\fIn\fP)\fP(3).
+The \f5nv_namptr\fP function can be used on the pointer returned by
+\f5calloc\fP along with the element number to return the
+corresponding node.
+Each of these nodes must be given the \f5NV_MINIMAL\fP attributes.
+.PP
The \f5nv_close()\fP indicates that the pointer returned by
\f5nv_open()\fP or \f5nv_opensub()\fP will not be referenced again. If the
name-value pair is unset, and not referenced elsewhere,
the name-value pair may be freed.
.PP
+The \f5nv_delete()\fP function will remove the node \fInp\fP from
+the dictionary \fIdict\fP. Unless \fInofree\fP is non-zero, the
+node \fInp\fP will also be freed.
+.PP
The \f5nv_name()\fP function returns the name of the given name-value
pair \fInp\fP.
The \f5nv_setsize()\fP function returns the size of the field for
@@ -228,6 +255,8 @@ as the value for \fInp\fP.
The \f5nv_unset()\fP function clears out the value and attributes
of the given name-value function but does not free the name-value
pair.
+If called from the \f5putval\fP discipline function, use the \fIflags\fP
+argument as the \fIflags\fP to \f5nv_unset()\fP. Otherwise, use 0.
.PP
The following attributes can be associated with a name-value pair:
.IP
@@ -282,6 +311,11 @@ expanded as a string.
This attribute has an associated number that defines the
the precision of the mantissa.
.IP
+\f5NV_HEXFLOAT\fP:
+Used in conjunction with \f5NV_INTEGER\fP and \f5NV_DOUBLE\fP to
+cause the value to be represented in C99 %a format when expanded as
+a string.
+.IP
\f5NV_BINARY\fP:
The name-value pair contains a buffer of binary data and \f5nv_size()\fP
is the number of bytes for this data. By default the value
@@ -292,6 +326,10 @@ size to be fixed and data either truncated or filled with \f50\fP bytes.
\f5NV_REF\fP:
The name-value pair is a name reference variable.
.IP
+\f5NV_MINIMAL\fP:
+The name-value pair node is not embedded in a dictionary
+and is minimal size, \f5NV_MINSZ\fP.
+.IP
\f5NV_NODISC\fP:
All discipline functions are ignored when performing assignments
and lookups.
@@ -311,6 +349,10 @@ to agree with the new attributes.
For an array variable, the values for each of the
subscripts will be changed.
.PP
+The \f5nv_isvtree()\fP function returns a pointer to the compound
+variable discipline if the node \fInp\fP is a compound variable
+or \f5NULL\fP otherwise.
+.PP
The \f5nv_isarray()\fP function returns a non-zero value if the specified
name-value pair is an array.
.PP
@@ -558,6 +600,15 @@ The name of the current subscript must be returned.
Returns a pointer to a name-value pair corresponding to the
current subscript, or \f5NULL\fP if this array type doesn't
create represent each element as a name-value pair.
+.IP
+\f5NV_ASETSUB\fP:
+Set the current subscript to the name-value pair passed in
+as the second argument.
+.PP
+If \fInp\fP refers to an array,
+\f5nv_arrayptr()\fP returns a pointer to
+the array discipline structure \f5Namarr_t\fP.
+Otherwise \f5nv_arrayptr()\fP returns \f5NULL\fP.
.PP
If \fInp\fP refers to an array,
the \f5nv_getsub()\fP returns a pointer to
@@ -612,8 +663,31 @@ will return a string containing all the names and values of
children nodes in a format that can be used in
a shell compound assignment.
.PP
+The \f5nv_type()\fP function returns a name_value pair pointer
+that contains the type definition for the specified name-value pair.
+The \fInvname\fP field contains the name for the type.
+.PP
+The \f5nv_settype()\fP function converts the name-value pair
+given by \fInp\fP into the type given by \fItp\fP.
+.PP
+The \f5nv_addtype()\fP function adds the name of the type given by
+\fInp\fP to the list of declaration built-ins. The \fIstr\fP
+argument contains the string used by \f5optget\fP(3) to generate
+the man page and process the options. The \fIop\fP argument
+specifies the callback discipline used by \f5optget\fP(3) and
+\fIsz\fP specifies the size of the callback information so
+that the discipline \fBoptget\fP(3) can be extended with private
+data used by the callback function.
+.P
+The \f5nv_mkinttype()\fP function creates named integer types
+of the specified \fIname\fP. The \fIsize\fP parameter is the size
+in bytes of the integer variable and \fIus\fP is non-zero
+for unsigned integer types. If \fIdp\fP is specified then integer
+variables of this type will all use this discipline.
.SH SEE ALSO
+calloc(3)
cdt(3)
shell(3)
+optget(3)
.SH AUTHOR
David G. Korn (dgk@research.att.com).
diff --git a/usr/src/lib/libshell/common/scripts/crawlsrccomments.sh b/usr/src/lib/libshell/common/scripts/crawlsrccomments.sh
new file mode 100644
index 0000000000..520d48f118
--- /dev/null
+++ b/usr/src/lib/libshell/common/scripts/crawlsrccomments.sh
@@ -0,0 +1,1203 @@
+#!/usr/bin/ksh93
+
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+# Solaris needs /usr/xpg6/bin:/usr/xpg4/bin because the tools in /usr/bin are not POSIX-conformant
+export PATH=/usr/xpg6/bin:/usr/xpg4/bin:/bin:/usr/bin
+
+# Make sure all math stuff runs in the "C" locale to avoid problems
+# with alternative # radix point representations (e.g. ',' instead of
+# '.' in de_DE.*-locales). This needs to be set _before_ any
+# floating-point constants are defined in this script).
+if [[ "${LC_ALL}" != "" ]] ; then
+ export \
+ LC_MONETARY="${LC_ALL}" \
+ LC_MESSAGES="${LC_ALL}" \
+ LC_COLLATE="${LC_ALL}" \
+ LC_CTYPE="${LC_ALL}"
+ unset LC_ALL
+fi
+export LC_NUMERIC=C
+
+# constants values for tokenizer/parser stuff
+typeset -r ch=(
+ newline=$'\n'
+ tab=$'\t'
+ formfeed=$'\f'
+)
+
+function fatal_error
+{
+ print -u2 "${progname}: $*"
+ exit 1
+}
+
+function printmsg
+{
+ print -u2 "$*"
+}
+
+
+function attrstrtoattrarray
+{
+#set -o xtrace
+ typeset s="$1"
+ nameref aa=$2 # attribute array
+ integer aa_count=0
+ integer aa_count=0
+ typeset nextattr
+ integer currattrlen=0
+ typeset tagstr
+ typeset tagval
+
+ while (( ${#s} > 0 )) ; do
+ # skip whitespaces
+ while [[ "${s:currattrlen:1}" == ~(E)[[:blank:][:space:]] ]] ; do
+ (( currattrlen++ ))
+ done
+ s="${s:currattrlen:${#s}}"
+
+ # anything left ?
+ (( ${#s} == 0 )) && break
+
+ # Pattern tests:
+ #x="foo=bar huz=123" ; print "${x##~(E)[[:alnum:]_-:]*=[^[:blank:]\"]*}"
+ #x='foo="ba=r o" huz=123' ; print "${x##~(E)[[:alnum:]_-:]*=\"[^\"]*\"}"
+ #x="foo='ba=r o' huz=123" ; print "${x##~(E)[[:alnum:]_-:]*=\'[^\"]*\'}"
+ #x="foox huz=123" ; print "${x##~(E)[[:alnum:]_-:]*}"
+ # All pattern combined via eregex (w|x|y|z):
+ #x='foo="bar=o" huz=123' ; print "${x##~(E)([[:alnum:]_-:]*=[^[:blank:]\"]*|[[:alnum:]_-:]*=\"[^\"]*\"|[[:alnum:]_-:]*=\'[^\"]*\')}"
+ nextattr="${s##~(E)([[:alnum:]_-:]*=[^[:blank:]\"]*|[[:alnum:]_-:]*=\"[^\"]*\"|[[:alnum:]_-:]*=\'[^\"]*\'|[[:alnum:]_-:]*)}"
+ currattrlen=$(( ${#s} - ${#nextattr}))
+
+ # add entry
+ tagstr="${s:0:currattrlen}"
+ if [[ "${tagstr}" == *=* ]] ; then
+ # normal case: attribute with value
+
+ tagval="${tagstr#*=}"
+
+ # strip quotes ('' or "")
+ if [[ "${tagval}" == ~(Elr)(\'.*\'|\".*\") ]] ; then
+ tagval="${tagval:1:${#tagval}-2}"
+ fi
+
+ aa[${aa_count}]=( name="${tagstr%%=*}" value="${tagval}" )
+ else
+ # special case for HTML where you have something like <foo baz>
+ aa[${aa_count}]=( name="${tagstr}" )
+ fi
+ (( aa_count++ ))
+ (( aa_count > 1000 )) && fatal_error "$0: aa_count too large" # assert
+ done
+}
+
+# XML document handler
+function handle_xml_document
+{
+#set -o xtrace
+ nameref callbacks=${1}
+ typeset tag_type="${2}"
+ typeset tag_value="${3}"
+ typeset tag_attributes="${4}"
+ nameref doc=${callbacks["arg_tree"]}
+ nameref nodepath="${stack.items[stack.pos]}"
+ nameref nodesnum="${stack.items[stack.pos]}num"
+
+ case "${tag_type}" in
+ tag_comment)
+ nodepath[${nodesnum}]+=(
+ typeset tagtype="comment"
+ typeset tagvalue="${tag_value}"
+ )
+ (( nodesnum++ ))
+ ;;
+ esac
+
+# print "xmltok: '${tag_type}' = '${tag_value}'"
+}
+
+function xml_tok
+{
+ typeset buf=""
+ typeset namebuf=""
+ typeset attrbuf=""
+ typeset c=""
+ typeset isendtag # bool: true/false
+ typeset issingletag # bool: true/false (used for tags like "<br />")
+ nameref callbacks=${1}
+
+ [[ ! -z "${callbacks["document_start"]}" ]] && ${callbacks["document_start"]} "${1}" "document_start"
+
+ while IFS='' read -r -N 1 c ; do
+ isendtag=false
+
+ if [[ "$c" == "<" ]] ; then
+ # flush any text content
+ if [[ "$buf" != "" ]] ; then
+ [[ ! -z "${callbacks["tag_text"]}" ]] && ${callbacks["tag_text"]} "${1}" "tag_text" "$buf"
+ buf=""
+ fi
+
+ IFS='' read -r -N 1 c
+ if [[ "$c" == "/" ]] ; then
+ isendtag=true
+ else
+ buf="$c"
+ fi
+ IFS='' read -r -d '>' c
+ buf+="$c"
+
+ # handle comments
+ if [[ "$buf" == ~(El)!-- ]] ; then
+ # did we read the comment completely ?
+ if [[ "$buf" != ~(Elr)!--.*-- ]] ; then
+ buf+=">"
+ while [[ "$buf" != ~(Elr)!--.*-- ]] ; do
+ IFS='' read -r -N 1 c || break
+ buf+="$c"
+ done
+ fi
+
+ [[ ! -z "${callbacks["tag_comment"]}" ]] && ${callbacks["tag_comment"]} "${1}" "tag_comment" "${buf:3:${#buf}-5}"
+ buf=""
+ continue
+ fi
+
+ # check if the tag starts and ends at the same time (like "<br />")
+ if [[ "${buf}" == ~(Er).*/ ]] ; then
+ issingletag=true
+ buf="${buf%*/}"
+ else
+ issingletag=false
+ fi
+
+ # check if the tag has attributes (e.g. space after name)
+ if [[ "$buf" == ~(E)[[:space:][:blank:]] ]] ; then
+ namebuf="${buf%%~(E)[[:space:][:blank:]].*}"
+ attrbuf="${buf#~(E).*[[:space:][:blank:]]}"
+ else
+ namebuf="$buf"
+ attrbuf=""
+ fi
+
+ if ${isendtag} ; then
+ [[ ! -z "${callbacks["tag_end"]}" ]] && ${callbacks["tag_end"]} "${1}" "tag_end" "$namebuf"
+ else
+ [[ ! -z "${callbacks["tag_begin"]}" ]] && ${callbacks["tag_begin"]} "${1}" "tag_begin" "$namebuf" "$attrbuf"
+
+ # handle tags like <br/> (which are start- and end-tag in one piece)
+ if ${issingletag} ; then
+ [[ ! -z "${callbacks["tag_end"]}" ]] && ${callbacks["tag_end"]} "${1}" "tag_end" "$namebuf"
+ fi
+ fi
+ buf=""
+ else
+ buf+="$c"
+ fi
+ done
+
+ [[ ! -z "${callbacks["document_end"]}" ]] && ${callbacks["document_end"]} "${1}" "document_end" "exit_success"
+
+ print # final newline to make filters like "sed" happy
+}
+
+# enumerate comments in a shell (or shell-like) script
+function enumerate_comments_shell
+{
+ set -o errexit
+
+ typeset input_file="$1"
+ nameref comment_array="$2"
+ integer max_num_comments="$3"
+ integer ca=0 # index in "comment_array"
+
+ integer res=0
+
+ typeset comment=""
+
+ while (( res == 0 )) ; do
+ IFS='' read -r line
+ (( res=$? ))
+
+ if [[ "${line}" == ~(El)#.* ]] ; then
+ comment+="${line#\#}${ch.newline}"
+ else
+ if [[ "$comment" != "" ]] ; then
+ comment_array[ca++]="${comment}"
+ comment=""
+
+ if (( ca > max_num_comments )) ; then
+ break
+ fi
+ fi
+ fi
+ done <"${input_file}"
+
+ return 0
+}
+
+
+# enumerate comments in a troff document
+function enumerate_comments_troff
+{
+ set -o errexit
+
+ typeset input_file="$1"
+ nameref comment_array="$2"
+ integer max_num_comments="$3"
+ integer ca=0 # index in "comment_array"
+
+ integer res=0
+
+ typeset comment=""
+
+ while (( res == 0 )) ; do
+ IFS='' read -r line
+ (( res=$? ))
+
+ if [[ "${line}" == ~(El)\.*\\\" ]] ; then
+ comment+="${line#~(El)\.*\\\"}${ch.newline}"
+ else
+ if [[ "$comment" != "" ]] ; then
+ comment_array[ca++]="${comment}"
+ comment=""
+
+ if (( ca > max_num_comments )) ; then
+ break
+ fi
+ fi
+ fi
+ done <"${input_file}"
+
+ return 0
+}
+
+
+# enumerate comments in files which are preprocessed by
+# CPP (e.g. C, C++, Imakefile etc.)
+function enumerate_comments_cpp
+{
+ set -o errexit
+# set -o nounset
+
+ integer err=0
+
+ typeset input_file="$1"
+ nameref comment_array="$2"
+ integer max_num_comments="$3"
+ integer max_filesize_for_scan="$4"
+ integer ca=0 # index in "comment_array"
+
+ typeset content
+ integer content_length
+
+ integer file_pos # file position
+ typeset line_pos=(
+ integer x=0 # X position in line
+ integer y=0 # Y position in line (line number)
+ )
+ typeset c c2
+
+ typeset comment
+
+ typeset state=(
+ # C comment state
+ typeset in_c_comment=false
+ # C++ comment state
+ typeset cxx=(
+ typeset in_comment=false
+ typeset comment_continued=false
+ # position of current //-pos
+ typeset comment_pos=(
+ integer x=-1
+ integer y=-1
+ )
+ # position of previous //-pos
+ typeset comment_prev_pos=(
+ integer x=-1
+ integer y=-1
+ )
+ )
+ # literal state
+ typeset in_sq_literal=false # single-quote literal
+ typeset in_dq_literal=false # double-quote literal
+ )
+
+ content="$(< "${input_file}")"
+
+ # Truncate file to "max_filesize_for_scan" charatcters.
+ # This was originally added to work around a performance problem with
+ # the ${str:offset:chunksize} operator which scales badly in ksh93
+ # version 's' with the number of characters
+ if (( ${#content} > max_filesize_for_scan )) ; then
+ print -u2 -f "## WARNING: File '%s' truncated to %d characters\n" \
+ "${input_file}" \
+ max_filesize_for_scan
+ content="${content:0:max_filesize_for_scan}"
+ fi
+ content_length=${#content}
+
+ # Iterate through the source code. The last character
+ # (when file_pos == content_length) will be empty to indicate
+ # EOF (this is needed for cases like when
+ # a C++ comment is not terminated by a newline... ;-/)
+ for (( file_pos=0 ; file_pos <= content_length ; file_pos++ )) ; do
+ c2="${content:file_pos:2}"
+ c="${c2:0:1}"
+
+ if [[ "$c" == "${ch.newline}" ]] ; then
+ (( line_pos.x=0, line_pos.y++ ))
+ else
+ (( line_pos.x++ ))
+ fi
+
+ if ${state.in_c_comment} ; then
+ if [[ "$c2" == "*/" ]] ; then
+ (( file_pos++, line_pos.x++ ))
+ state.in_c_comment=false
+
+ # flush comment text
+ comment_array[ca++]="${comment}"
+ comment=""
+
+ if (( ca > max_num_comments )) ; then
+ break
+ fi
+ else
+ comment+="$c"
+ fi
+ elif ${state.cxx.in_comment} ; then
+ if [[ "$c" == "${ch.newline}" || "$c" == "" ]] ; then
+ state.cxx.in_comment=false
+
+ # flush comment text
+ if ${state.cxx.comment_continued} ; then
+ comment_array[ca-1]+="${ch.newline}${comment}"
+ (( state.cxx.comment_prev_pos.x=state.cxx.comment_pos.x ,
+ state.cxx.comment_prev_pos.y=state.cxx.comment_pos.y ))
+ else
+ comment_array[ca++]="${comment}"
+ (( state.cxx.comment_prev_pos.x=state.cxx.comment_pos.x ,
+ state.cxx.comment_prev_pos.y=state.cxx.comment_pos.y ))
+ fi
+ comment=""
+
+ if (( ca > max_num_comments )) ; then
+ break
+ fi
+ else
+ comment+="$c"
+ fi
+ elif ${state.in_sq_literal} ; then
+ if [[ "$c" == "'" && "${content:file_pos-1:1}" != '\' ]] ; then
+ state.in_sq_literal=false
+ fi
+ elif ${state.in_dq_literal} ; then
+ if [[ "$c" == '"' && "${content:file_pos-1:1}" != '\' ]] ; then
+ state.in_dq_literal=false
+ fi
+ else
+ if [[ "$c2" == "/*" ]] ; then
+ (( file_pos++, line_pos.x++ ))
+ state.in_c_comment=true
+ comment=""
+ elif [[ "$c2" == "//" ]] ; then
+ (( file_pos++, line_pos.x++ ))
+ if (( state.cxx.comment_prev_pos.x == line_pos.x && \
+ state.cxx.comment_prev_pos.y == (line_pos.y-1) )) ; then
+ state.cxx.comment_continued=true
+ else
+ state.cxx.comment_continued=false
+ fi
+ (( state.cxx.comment_pos.x=line_pos.x , state.cxx.comment_pos.y=line_pos.y ))
+ state.cxx.in_comment=true
+ comment=""
+ elif [[ "$c" == "'" && "${content:file_pos-1:1}" != '\' ]] ; then
+ state.in_sq_literal=true
+ elif [[ "$c" == '"' && "${content:file_pos-1:1}" != '\' ]] ; then
+ state.in_dq_literal=true
+ fi
+ fi
+ done
+
+ if [[ "$comment" != "" ]] ; then
+ print -u2 "## ERROR: Comment text buffer not empty at EOF."
+ err=1
+ fi
+
+ if ${state.in_c_comment} ; then
+ print -u2 "## ERROR: C comment did not close before EOF."
+ err=1
+ fi
+
+ if ${state.cxx.in_comment} ; then
+ print -u2 "## ERROR: C++ comment did not close before EOF."
+ err=1
+ fi
+
+ if ${state.in_dq_literal} ; then
+ print -u2 "## ERROR: Double-quoted literal did not close before EOF."
+ err=1
+ fi
+
+ # We treat this one only as warning since things like "foo.html.cpp" may
+ # trigger this condition accidently
+ if ${state.in_sq_literal} ; then
+ print -u2 "## WARNING: Single-quoted literal did not close before EOF."
+ fi
+
+ return $err
+}
+
+# determine file type
+function get_file_format
+{
+ set -o errexit
+
+ typeset filename="$1"
+ nameref file_format="$2"
+
+ typeset fileeval # evaluation result of /usr/bin/file
+
+ # check whether "filename" is a plain, readable file
+ [[ ! -f "$filename" ]] && return 1
+ [[ ! -r "$filename" ]] && return 1
+
+ # In theory this code would exclusively look at the contents of
+ # the file to figure out it's file format - unfortunately
+ # /usr/bin/file is virtually useless (the heuristics, matching
+ # and output unreliable) for many file formats and therefore
+ # we have to do a multi-stage approach which looks
+ # at the file's content if possible and at the filename
+ # otherwise. Fun... ;-(
+
+ # pass one: Find matches for file formats where /usr/bin/file
+ # is known to be unreliable:
+ case "$filename" in
+ *.[ch] | *.cpp | *.cc | *.cxx | *.hxx)
+ file_format="c_source"
+ return 0
+ ;;
+ *Imakefile)
+ file_format="imakefile"
+ return 0
+ ;;
+ *Makefile)
+ file_format="makefile"
+ return 0
+ ;;
+ esac
+
+ # pass two: match by file content via /usr/bin/file
+ fileeval="$(LC_ALL=C /usr/bin/file "$filename")"
+ case "$fileeval" in
+ ~(E)roff)
+ file_format="troff"
+ return 0
+ ;;
+ ~(E)html\ document)
+ file_format="html"
+ return 0
+ ;;
+ ~(E)sgml\ document)
+ file_format="sgml"
+ return 0
+ ;;
+ ~(E)executable.*(shell|(/|/r|/pf)(sh|ksh|ksh93|rksh93|dtksh|tksh|bash))\ script)
+ file_format="shell"
+ return 0
+ ;;
+ ~(E)executable.*/perl\ script)
+ file_format="perl"
+ return 0
+ ;;
+ esac
+
+ # pass three: fallhack to filename matching
+ case "$filename" in
+ *.man)
+ file_format="troff"
+ return 0
+ ;;
+ *.html)
+ file_format="html"
+ return 0
+ ;;
+ *.sgml)
+ file_format="sgml"
+ return 0
+ ;;
+ *.xml)
+ file_format="xml"
+ return 0
+ ;;
+ *.png)
+ file_format="image_png"
+ return 0
+ ;;
+ *.xcf)
+ file_format="image_xcf"
+ return 0
+ ;;
+ *.shar)
+ file_format="archive_shell"
+ return 0
+ ;;
+ *.sh)
+ file_format="shell"
+ return 0
+ ;;
+ *.pcf)
+ file_format="font_pcf"
+ return 0
+ ;;
+ *.bdf)
+ file_format="font_bdf"
+ return 0
+ ;;
+ *.pmf)
+ file_format="font_pmf"
+ return 0
+ ;;
+ *.ttf | *.otf)
+ file_format="font_ttf"
+ return 0
+ ;;
+ *.pfa | *.pfb)
+ file_format="font_postscript"
+ return 0
+ ;;
+ esac
+
+ return 1
+}
+
+function extract_comments
+{
+ set -o errexit
+
+ nameref records="$1"
+ typeset filename="$2"
+ integer max_num_comments="$3"
+ integer max_filesize_for_scan="$4"
+
+ typeset datatype=""
+
+ records[${filename}]=(
+ typeset filename="$filename"
+
+ typeset fileformat_found="false" # "true" or "false"
+ typeset file_format=""
+
+ typeset -A hashsum
+
+ typeset comments_parsed="false" # "true" or "false"
+ typeset -a comments
+ )
+
+ records[${filename}].hashsum["md5"]="$(sum -x md5 < "$filename")"
+ records[${filename}].hashsum["sha1"]="$(sum -x sha1 < "$filename")"
+
+ if get_file_format "$filename" datatype ; then
+ records[${filename}].fileformat_found="true"
+ records[${filename}].file_format="$datatype"
+ else
+ return 1
+ fi
+
+ case "$datatype" in
+ c_source|imakefile)
+ enumerate_comments_cpp "${filename}" "records[${filename}].comments" ${max_num_comments} ${max_filesize_for_scan} && \
+ records[${filename}].comments_parsed=true
+ ;;
+ shell|makefile)
+ enumerate_comments_shell "${filename}" "records[${filename}].comments" ${max_num_comments} ${max_filesize_for_scan} && \
+ records[${filename}].comments_parsed=true
+ ;;
+ troff)
+ enumerate_comments_troff "${filename}" "records[${filename}].comments" ${max_num_comments} ${max_filesize_for_scan} && \
+ records[${filename}].comments_parsed=true
+ ;;
+ # NOTE: Disabled for now
+ #xml|html|sgml)
+ # enumerate_comments_xml "${filename}" "records[${filename}].comments" ${max_num_comments} ${max_filesize_for_scan} && \
+ # records[${filename}].comments_parsed=true
+ # ;;
+ esac
+
+ return 0
+}
+
+# parse HTTP return code, cookies etc.
+function parse_http_response
+{
+ nameref response="$1"
+ typeset h statuscode statusmsg i
+
+ # we use '\r' as additional IFS to filter the final '\r'
+ IFS=$' \t\r' read -r h statuscode statusmsg # read HTTP/1.[01] <code>
+ [[ "$h" != ~(Eil)HTTP/.* ]] && { print -u2 -f $"%s: HTTP/ header missing\n" "$0" ; return 1 ; }
+ [[ "$statuscode" != ~(Elr)[0-9]* ]] && { print -u2 -f $"%s: invalid status code\n" "$0" ; return 1 ; }
+ response.statuscode="$statuscode"
+ response.statusmsg="$statusmsg"
+
+ # skip remaining headers
+ while IFS='' read -r i ; do
+ [[ "$i" == $'\r' ]] && break
+
+ # strip '\r' at the end
+ i="${i/~(Er)$'\r'/}"
+
+ case "$i" in
+ ~(Eli)Content-Type:.*)
+ response.content_type="${i/~(El).*:[[:blank:]]*/}"
+ ;;
+ ~(Eli)Content-Length:[[:blank:]]*[0-9]*)
+ integer response.content_length="${i/~(El).*:[[:blank:]]*/}"
+ ;;
+ ~(Eli)Transfer-Encoding:.*)
+ response.transfer_encoding="${i/~(El).*:[[:blank:]]*/}"
+ ;;
+ esac
+ done
+
+ return 0
+}
+
+function cat_http_body
+{
+ typeset emode="$1"
+ typeset hexchunksize="0"
+ integer chunksize=0
+
+ if [[ "${emode}" == "chunked" ]] ; then
+ while IFS=$'\r' read hexchunksize &&
+ [[ "${hexchunksize}" == ~(Elri)[0-9abcdef]* ]] &&
+ (( chunksize=16#${hexchunksize} )) && (( chunksize > 0 )) ; do
+ dd bs=1 count="${chunksize}" 2>/dev/null
+ done
+ else
+ cat
+ fi
+
+ return 0
+}
+
+function cat_http
+{
+ typeset protocol="${1%://*}"
+ typeset path1="${1#*://}" # "http://foo.bat.net/x/y.html" ----> "foo.bat.net/x/y.html"
+
+ typeset host="${path1%%/*}"
+ typeset path="${path1#*/}"
+ typeset port="${host##*:}"
+
+ integer netfd
+ typeset -C httpresponse # http response
+
+ # If URL did not contain a port number in the host part then look at the
+ # protocol to get the port number
+ if [[ "${port}" == "${host}" ]] ; then
+ case "${protocol}" in
+ "http") port=80 ;;
+ *) port="$(getent services "${protocol}" | sed 's/[^0-9]*//;s/\/.*//')" ;;
+ esac
+ else
+ host="${host%:*}"
+ fi
+
+ printmsg "protocol=${protocol} port=${port} host=${host} path=${path}"
+
+ # prechecks
+ [[ "${protocol}" == "" ]] && { print -u2 -f "%s: protocol not set.\n" "$0" ; return 1 ; }
+ [[ "${port}" == "" ]] && { print -u2 -f "%s: port not set.\n" "$0" ; return 1 ; }
+ [[ "${host}" == "" ]] && { print -u2 -f "%s: host not set.\n" "$0" ; return 1 ; }
+ [[ "${path}" == "" ]] && { print -u2 -f "%s: path not set.\n" "$0" ; return 1 ; }
+
+ # open TCP channel
+ redirect {netfd}<>"/dev/tcp/${host}/${port}"
+ (( $? != 0 )) && { print -u2 -f "%s: Couldn't open %s\n" "$0" "${1}" ; return 1 ; }
+
+ # send HTTP request
+ request="GET /${path} HTTP/1.1\r\n"
+ request+="Host: ${host}\r\n"
+ request+="User-Agent: crawlsrccomments/ksh93 (2008-06-14; $(uname -s -r -p))\r\n"
+ request+="Connection: close\r\n"
+ print -n -- "${request}\r\n" >&${netfd}
+
+ # collect response and send it to stdout
+ parse_http_response httpresponse <&${netfd}
+ cat_http_body "${httpresponse.transfer_encoding}" <&${netfd}
+
+ # close connection
+ redirect {netfd}<&-
+
+ return 0
+}
+
+function print_stats
+{
+ set -o errexit
+
+ # gather some statistics
+ typeset stats=(
+ integer files_with_comments=0
+ integer files_without_comments=0
+
+ integer files_without_known_format=0
+
+ integer files_with_license_info=0
+ integer files_without_license_info=0
+
+ integer total_num_files=0
+ )
+
+ for i in $(printf "%s\n" "${!records[@]}" | sort) ; do
+ if "${records[$i].comments_parsed}" ; then
+ (( stats.files_with_comments++ ))
+ else
+ (( stats.files_without_comments++ ))
+ fi
+
+ if ! "${records[$i].fileformat_found}" ; then
+ (( stats.files_without_known_format++ ))
+ fi
+
+ if "${records[$i].license_info_found}" ; then
+ (( stats.files_with_license_info++ ))
+ else
+ (( stats.files_without_license_info++ ))
+ fi
+
+ (( stats.total_num_files++ ))
+ done
+
+ printf "%B\n" stats
+ return 0
+}
+
+
+function print_comments_plain
+{
+ set -o errexit
+
+ nameref records=$1
+ nameref options=$2
+ typeset i j
+
+ for i in $(printf "%s\n" "${!records[@]}" | sort) ; do
+ nameref node=records[$i]
+
+ if [[ "${options.filepattern.accept}" != "" ]] && \
+ [[ "${node.filename}" != ${options.filepattern.accept} ]] ; then
+ continue
+ fi
+ if [[ "${options.filepattern.reject}" != "" ]] && \
+ [[ "${node.filename}" == ${options.filepattern.reject} ]] ; then
+ continue
+ fi
+
+ node.license_info_found=false
+
+ if ! "${node.comments_parsed}" ; then
+ continue
+ fi
+
+ for j in "${!node.comments[@]}" ; do
+ typeset s="${node.comments[$j]}"
+ typeset match=false
+
+ if [[ "${options.commentpattern.accept}" != "" ]] && \
+ [[ "$s" == ${options.commentpattern.accept} ]] ; then
+ match=true
+ fi
+ if [[ "${options.commentpattern.reject}" != "" ]] && \
+ [[ "$s" == ${options.commentpattern.reject} ]] ; then
+ match=false
+ fi
+
+ if "${match}" ; then
+ printf "\f#### filename='%s',\tcomment=%s\n" "${node.filename}" "$j"
+ printf "%s\n" "$s"
+ node.license_info_found=true
+ fi
+ done
+
+ if ! "${node.license_info_found}" ; then
+ printf "## no match found in '%s'," "${node.filename}"
+ printf "comments_parsed=%s, fileformat_found=%s, file_format=%s\n" \
+ "${node.comments_parsed}" \
+ "${node.fileformat_found}" \
+ "${node.file_format}"
+ fi
+ done
+
+ return 0
+}
+
+function print_comments_duplicates_compressed
+{
+ set -o errexit
+
+ nameref records=$1
+ nameref options=$2
+ typeset i j
+ typeset -A hashed_comments
+ integer num_hashed_comments
+
+ for i in $(printf "%s\n" "${!records[@]}" | sort) ; do
+ nameref node=records[$i]
+
+ if [[ "${options.filepattern.accept}" != "" ]] && \
+ [[ "${node.filename}" != ${options.filepattern.accept} ]] ; then
+ continue
+ fi
+ if [[ "${options.filepattern.reject}" != "" ]] && \
+ [[ "${node.filename}" == ${options.filepattern.reject} ]] ; then
+ continue
+ fi
+
+ node.license_info_found=false
+
+ if ! "${node.comments_parsed}" ; then
+ continue
+ fi
+
+ for j in "${!node.comments[@]}" ; do
+ typeset s="${node.comments[$j]}"
+ typeset match=false
+
+ if [[ "${options.commentpattern.accept}" != "" ]] && \
+ [[ "$s" == ${options.commentpattern.accept} ]] ; then
+ match=true
+ fi
+ if [[ "${options.commentpattern.reject}" != "" ]] && \
+ [[ "$s" == ${options.commentpattern.reject} ]] ; then
+ match=false
+ fi
+
+
+ if "${match}" ; then
+ typeset -l hashstring # lowercase
+
+ # compress the comment (e.g. convert whiteapces and '.,:;()"' to newline characters) ...
+ hashstring="${s//+([\n\r\t\v*#.,:;\(\)\"[:space:][:blank:]])/${ch.newline}}"
+ # ... and then create a MD5 hash from this string
+ hash="$(sum -x md5 <<<"${hashstring}")"
+
+ nameref hc_node=hashed_comments[${hash}]
+
+ if [[ "${hc_node}" == "" ]] ; then
+ # build node if there isn't one yet
+ typeset -a hc_node.fileids
+ typeset hc_node.comment="$s"
+ fi
+
+ hc_node.fileids+=( "$(printf "%s (md5='%s', sha1='%s')\n" "${node.filename}" "${node.hashsum["md5"]}" "${node.hashsum["sha1"]}")" )
+
+ node.license_info_found=true
+ fi
+ done
+
+ if ! "${node.license_info_found}" ; then
+ printf "## no match found in "
+ printf "%s (md5='%s', sha1='%s'), " "${node.filename}" "${node.hashsum["md5"]}" "${node.hashsum["sha1"]}"
+ printf "comments_parsed=%s, fileformat_found=%s, file_format=%s\n" \
+ "${node.comments_parsed}" \
+ "${node.fileformat_found}" \
+ "${node.file_format}"
+ fi
+ done
+
+ # print comments and all fileids (filename+hash sums) which include this comment
+ for i in "${!hashed_comments[@]}" ; do
+ printf "\f## The comment (ID=%s) ..." "${i}"
+ printf "\n-- snip --"
+ printf "\n%s" "${hashed_comments[${i}].comment}"
+ printf "\n-- snip --"
+ printf "\n... applies to the following files:\n"
+ printf "\t%s\n" "${hashed_comments[${i}].fileids[@]}" # printf repeats the format string for each array memeber
+ done
+
+ return 0
+}
+
+function do_crawl
+{
+ set -o errexit
+
+ typeset options=(
+ integer max_filesize_for_scan=$((256*1024))
+ integer max_num_comments=$((2**62)) # FIXME: This should be "+Inf" (=Infinite)
+ )
+
+ shift
+ while getopts -a "${progname}" "${do_crawl_usage}" OPT "$@" ; do
+ printmsg "## OPT=|${OPT}|, OPTARG=|${OPTARG}|"
+ case ${OPT} in
+ S) options.max_filesize_for_scan="${OPTARG}" ;;
+ N) options.max_num_comments="${OPTARG}" ;;
+ *) usage do_crawl_usage ;;
+ esac
+ done
+ shift $((OPTIND-1))
+
+ typeset scan=(
+ typeset -A records
+ )
+
+ # read filenames from stdin
+ while read i ; do
+ printf "## scanning %s ...\n" "$i"
+ extract_comments scan.records "$i" ${options.max_num_comments} ${options.max_filesize_for_scan} || true
+ done
+
+ # print compound variable array (we strip the "typeset -A records" for now)
+ printf "%B\n" scan |
+ sed $'s/^#.*$//;s/^\(//;s/^\)//;s/^\ttypeset -A records=\(//;s/^\t\)//' >"crawlsrccomments_extracted_comments.cpv"
+
+ print "# Wrote results to crawlsrccomments_extracted_comments.cpv"
+
+ return 0
+}
+
+function do_getcomments
+{
+ set -o errexit
+
+ # vars
+ typeset scan=(
+ typeset -A records
+ )
+ typeset database
+ typeset tmp
+
+ typeset options=(
+ typeset database="crawlsrccomments_extracted_comments.cpv"
+
+ typeset print_stats=false
+ typeset zapduplicates=false
+ typeset filepattern=(
+ typeset accept="*"
+ typeset reject=""
+ )
+ typeset commentpattern=(
+ typeset accept="~(Ei)(license|copyright)"
+ typeset reject=""
+ )
+ )
+
+ shift
+ while getopts -a "${progname}" "${do_getcomments_usage}" OPT "$@" ; do
+ # printmsg "## OPT=|${OPT}|, OPTARG=|${OPTARG}|"
+ case ${OPT} in
+ c) options.commentpattern.accept="${OPTARG}" ;;
+ C) options.commentpattern.reject="${OPTARG}" ;;
+ D) options.database="${OPTARG}" ;;
+ l) options.filepattern.accept="${OPTARG}" ;;
+ L) options.filepattern.reject="${OPTARG}" ;;
+ S) options.print_stats=true ;;
+ +S) options.print_stats=false ;;
+ Z) options.zapduplicates=true ;;
+ +Z) options.zapduplicates=false ;;
+ *) usage do_getcomments_usage ;;
+ esac
+ done
+ shift $((OPTIND-1))
+
+ # array of temporary files which should be cleaned-up upon exit
+ typeset -a tmpfiles
+ trap 'set -o errexit ; print -u2 "# Cleaning up..." ; ((${#tmpfiles[@]} > 0)) && rm -- "${tmpfiles[@]}" ; print -u2 "# Done."' EXIT
+
+ # Support for HTTP URLs
+ if [[ "${options.database}" == ~(El)http://.* ]] ; then
+ database="/tmp/extract_license_cat_http_${PPID}_$$.tmp"
+ tmpfiles+=( "${database}" )
+ print -u2 "# Loading URL..."
+ cat_http "${options.database}" >"${database}"
+ print -u2 "# Loading URL done."
+ else
+ database="${options.database}"
+ fi
+
+ if [[ ! -r "${database}" ]] ; then
+ fatal_error "Can't read ${database}."
+ fi
+
+ # Support for compressed database files
+ case "$(LC_ALL=C /usr/bin/file "${database}")" in
+ *bzip2*)
+ tmp="/tmp/extract_license_bzcat_${PPID}_$$.tmp"
+ tmpfiles+=( "${tmp}" )
+ print -u2 "# Uncompressing data (bzip2) ..."
+ bzcat <"${database}" >"${tmp}"
+ print -u2 "# Uncompression done."
+ database="${tmp}"
+ ;;
+ *gzip*)
+ tmp="/tmp/extract_license_bzcat_${PPID}_$$.tmp"
+ tmpfiles+=( "${tmp}" )
+ print -u2 "# Uncompressing data (gzip) ..."
+ gunzip -c <"${database}" >"${tmp}"
+ print -u2 "# Uncompression done."
+ database="${tmp}"
+ ;;
+ esac
+
+ # Read compound variable which contain all recorded comments
+ print -u2 "# reading records..."
+ {
+ printf "("
+ cat "${database}"
+ printf ")\n"
+ } | read -C scan.records || fatal_error 'Error reading data.'
+ print -u2 -f "# reading %d records done.\n" "${#scan.records[@]}"
+
+ # print comments
+ print -u2 "# processing data..."
+ print "## comments start:"
+ if "${options.zapduplicates}" ; then
+ print_comments_duplicates_compressed scan.records options
+ else
+ print_comments_plain scan.records options
+ fi
+ print "## comments end"
+ print -u2 "# processing data done."
+
+ if "${options.print_stats}" ; then
+ print_stats
+ fi
+
+ return 0
+}
+
+function usage
+{
+ nameref usagemsg=$1
+ OPTIND=0
+ getopts -a "${progname}" "${usagemsg}" OPT '-?'
+ exit 2
+}
+
+typeset -r do_getcomments_usage=$'+
+[-?\n@(#)\$Id: getcomments (Roland Mainz) 2008-10-14 \$\n]
+[-author?Roland Mainz <roland.mainz@sun.com>]
+[+NAME?getcomments - extract license information from source files]
+[+DESCRIPTION?\bgetcomments\b is a small utilty script which extracts
+ license information from the "\bgetcomments\b"-database
+ file created by \bcrawl\b. The script allows various
+ filters (see options below) to be applied on the database]
+[+?The license extraction is done in two steps - first a crawler script
+ called \bcrawl\b will scan all source files, extract
+ the comments and stores this information in a "database" file called
+ "crawlsrccomments_extracted_comments.cpv" and then \bextract_license\b allows
+ queries on this database.]
+[D:database?Database file for input (either file or http://-URL).]:[database]
+[l:acceptfilepattern?Process only files which match pattern.]:[pattern]
+[L:rejectfilepattern?Process only files which do not match pattern.]:[pattern]
+[c:acceptcommentpattern?Match comments which match pattern. Defaults to ~(Ei)(license|copyright)]:[pattern]
+[C:rejectcommentpattern?Discard comments which match pattern. Defaults to ""]:[pattern]
+[S:stats?Print statistics.]
+[Z:zapsimilar?Combine similar/duplicate comments in the report.]
+[+SEE ALSO?\bksh93\b(1), \bsvcprop\b(1)]
+'
+
+typeset -r do_crawl_usage=$'+
+[-?\n@(#)\$Id: crawl (Roland Mainz) 2008-10-14 \$\n]
+[-author?Roland Mainz <roland.mainz@sun.com>]
+[+NAME?crawl - crawl comment information from source files]
+[+DESCRIPTION?\bcrawl\b is a small utilty script which reads
+ a list of source code files from stdin, determinates the type of
+ syntax used by these files and then extracts
+ comments from the source code and stores this information into a
+ "database"-like file called "crawlsrccomments_extracted_comments.cpv" which can then
+ be processed by \bextract_license\b or similar processing tools.]
+[S:scanmaxcharacters?Scan a maximum number of numchars characters for comments.
+ Defaults to 256K characters.]:[numchars]
+[N:maxnumcomments?Maximum numbers of comments to crawl. Defaults to "+Infinite"]:[numcomments]
+[+SEE ALSO?\bksh93\b(1), \bsvcprop\b(1)]
+'
+
+typeset -r crawlsrccomments_usage=$'+
+[-?\n@(#)\$Id: crawlsrccomments (Roland Mainz) 2008-10-14 \$\n]
+[-author?Roland Mainz <roland.mainz@sun.com>]
+[+NAME?crawlsrccomments - extract and filter comment information from source files]
+[+DESCRIPTION?\bcrawlsrccomments\b is a small utilty script which reads
+ a list of source code files from stdin, determinates the type of
+ syntax used by these files and then extracts
+ comments from the source code and stores this information into a
+ "database"-like file called "crawlsrccomments_extracted_comments.cpv" which can then
+ be processed by \bextract_license\b or similar processing tools.]
+
+[crawl|getcomments] options
+
+[+SEE ALSO?\bksh93\b(1), \bsvcprop\b(1)]
+'
+
+
+# program start
+builtin basename
+builtin cat
+builtin date
+builtin uname
+builtin rm
+builtin sum || fatal_error "sum builtin not found."
+
+# exit at the first error we hit
+set -o errexit
+
+typeset progname="${ basename "${0}" ; }"
+
+while getopts -a "${progname}" "${crawlsrccomments_usage}" OPT ; do
+ # printmsg "## OPT=|${OPT}|, OPTARG=|${OPTARG}|"
+ case ${OPT} in
+ *) usage crawlsrccomments_usage ;;
+ esac
+done
+shift $((OPTIND-1))
+
+typeset cmd="$1"
+
+case "$cmd" in
+ "crawl")
+ progname+=" ${cmd}"
+ do_crawl "$@"
+ exit $?
+ ;;
+ "getcomments")
+ progname+=" ${cmd}"
+ do_getcomments "$@"
+ exit $?
+ ;;
+ *)
+ usage crawlsrccomments_usage
+ ;;
+esac
+
+fatal_error "not reached."
+# EOF.
diff --git a/usr/src/lib/libshell/common/scripts/filemutexdemo1.sh b/usr/src/lib/libshell/common/scripts/filemutexdemo1.sh
new file mode 100644
index 0000000000..1de54a92fc
--- /dev/null
+++ b/usr/src/lib/libshell/common/scripts/filemutexdemo1.sh
@@ -0,0 +1,267 @@
+#!/usr/bin/ksh93
+
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# filemutexdemo1 - a simple locking demo which supports read/write
+# locks and critical sections (like JAVA's "syncronized" keyword)
+#
+
+# Solaris needs /usr/xpg6/bin:/usr/xpg4/bin because the tools in /usr/bin are not POSIX-conformant
+export PATH=/usr/xpg6/bin:/usr/xpg4/bin:/bin:/usr/bin
+
+# Make sure all math stuff runs in the "C" locale to avoid problems
+# with alternative # radix point representations (e.g. ',' instead of
+# '.' in de_DE.*-locales). This needs to be set _before_ any
+# floating-point constants are defined in this script).
+if [[ "${LC_ALL}" != "" ]] ; then
+ export \
+ LC_MONETARY="${LC_ALL}" \
+ LC_MESSAGES="${LC_ALL}" \
+ LC_COLLATE="${LC_ALL}" \
+ LC_CTYPE="${LC_ALL}"
+ unset LC_ALL
+fi
+export LC_NUMERIC=C
+
+# Definition for a mutex which uses the filesystem for locking
+typeset -T filemutex_t=(
+ typeset name
+
+ typeset lock_dirname
+
+ typeset locked_exclusive="false"
+ typeset locked_shared="false"
+
+ # keep track of subshell level. The problem is that we do not know a
+ # way to figure out whether someone calls "unlock" in a subshell and then
+ # leaves the subshell and calls "unlock" again
+ integer subshell=-1
+
+ typeset lock_dirname
+
+ # create a filemutex instance (including lock directory)
+ function create
+ {
+ # make sure we return an error if the init didn't work
+ set -o errexit
+
+ [[ "$1" == "" ]] && return 1
+
+ _.name="$1"
+ _.lock_dirname="/tmp/filemutex_t_${_.name}.lock"
+
+ mkdir "${_.lock_dirname}"
+
+ # last entry, used to mark the mutex as initalised+valid
+ (( _.subshell=.sh.subshell ))
+ return 0
+ }
+
+ # use a filemutex instance (same as "create" but without creating
+ # the lock directory)
+ function create_child
+ {
+ # make sure we return an error if the init didn't work
+ set -o errexit
+
+ [[ "$1" == "" ]] && return 1
+
+ _.name="$1"
+ _.lock_dirname="/tmp/filemutex_t_${_.name}.lock"
+
+ # last entry, used to mark the mutex as initalised+valid
+ (( _.subshell=.sh.subshell ))
+ return 0
+ }
+
+ function check_subshell
+ {
+ (( _.subshell == .sh.subshell )) && return 0
+ print -u2 -f "filemutex_t.%s(%s): Wrong subshell level\n" "$1" "${_.name}"
+ return 1
+ }
+
+ function try_lock_shared
+ {
+ _.check_subshell "try_lock_shared" || return 1
+
+ mkdir "${_.lock_dirname}/shared_${PPID}_$$" 2>/dev/null || return 1
+ _.locked_shared="true"
+ return 0
+ }
+
+ function lock_shared
+ {
+ float interval=0.2
+
+ _.check_subshell "lock_shared" || return 1
+
+ while ! _.try_lock_shared ; do sleep ${interval} ; (( interval+=interval/10. )) ; done
+ return 0
+ }
+
+ function try_lock_exclusive
+ {
+ _.check_subshell "try_lock_exclusive" || return 1
+
+ rmdir "${_.lock_dirname}" 2>/dev/null || return 1
+ _.locked_exclusive="true"
+ return 0
+ }
+
+ function lock_exclusive
+ {
+ float interval=0.2
+
+ _.check_subshell "lock_exclusive" || return 1
+
+ while ! _.try_lock_exclusive ; do sleep ${interval} ; (( interval+=interval/10. )) ; done
+ return 0
+ }
+
+ # critical section support (like java's "synchronized" keyword)
+ function synchronized
+ {
+ integer retcode
+
+ _.check_subshell "synchronized" || return 1
+
+ _.lock_exclusive
+
+ "$@"
+ (( retcode=$? ))
+
+ _.unlock
+
+ return ${retcode}
+ }
+
+ # critical section support with shared lock
+ function synchronized_shared
+ {
+ integer retcode
+
+ _.check_subshell "synchronized_shared" || return 1
+
+ _.lock_shared
+
+ "$@"
+ (( retcode=$? ))
+
+ _.unlock
+
+ return ${retcode}
+ }
+
+ function unlock
+ {
+ # return an error if rmdir/mkdir/check_subshell fail...
+ set -o errexit
+
+ _.check_subshell "unlock"
+
+ if ${_.locked_shared} ; then
+ rmdir "${_.lock_dirname}/shared_${PPID}_$$"
+ _.locked_shared="false"
+ return 0
+ elif ${_.locked_exclusive} ; then
+ mkdir "${_.lock_dirname}"
+ _.locked_exclusive="false"
+ return 0
+ fi
+
+ print -u2 -f "filemutex_t.unlock(%s): mutex '%s' not locked." "$1" "${_.name}"
+ return 1
+ }
+
+ # destroy mutex if noone is using it anymore (not the same as "unset" !!))
+ function destroy
+ {
+ _.check_subshell "destroy" || return 1
+
+ (${_.locked_exclusive} || ${_.locked_shared}) && _.unlock
+ rmdir "${_.lock_dirname}"
+ return 0
+ }
+)
+
+# main
+builtin mkdir
+builtin rmdir
+
+print "## Start."
+
+typeset -r mymutexname="hello_world"
+
+filemutex_t fs
+
+fs.create "${mymutexname}" || print -u2 "Mutex init failed."
+
+print "# Starting child which keeps an exclusive lock for 10 seconds..."
+(
+ filemutex_t child_fs
+
+ child_fs.create_child "${mymutexname}"
+
+ child_fs.lock_exclusive
+ sleep 10
+ child_fs.unlock
+) &
+
+sleep 1
+
+printf "%T: # Waiting to obtain a shared lock...\n"
+fs.lock_shared
+printf "%T: # Obtained shared lock\n"
+
+printf "fs.locked_exclusive=%s, fs.locked_shared=%s\n" "${fs.locked_exclusive}" "${fs.locked_shared}"
+
+ls -lad /tmp/filemutex*/*
+
+printf "%T: # Executing child which runs printf '|%%s|\\\n' 'hello' 'world' inside a synchronized section\n"
+(
+ filemutex_t child_fs
+
+ child_fs.create_child "${mymutexname}"
+
+ child_fs.synchronized printf '|%s|\n' 'hello' 'world'
+) &
+
+printf "%T: # Sleeping 5 secs while holding the shared lock...\n"
+sleep 5.
+
+printf "%T: # Releasing shared lock...\n"
+fs.unlock
+
+sleep 5.
+print "# Destroying lock..."
+fs.destroy
+
+print "## Done."
+
+exit 0
diff --git a/usr/src/lib/libshell/common/scripts/filetree1.sh b/usr/src/lib/libshell/common/scripts/filetree1.sh
new file mode 100644
index 0000000000..6946fca4fb
--- /dev/null
+++ b/usr/src/lib/libshell/common/scripts/filetree1.sh
@@ -0,0 +1,229 @@
+#!/usr/bin/ksh93
+
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+# Solaris needs /usr/xpg6/bin:/usr/xpg4/bin because the tools in /usr/bin are not POSIX-conformant
+export PATH=/usr/xpg6/bin:/usr/xpg4/bin:/bin:/usr/bin
+
+# Make sure all math stuff runs in the "C" locale to avoid problems
+# with alternative # radix point representations (e.g. ',' instead of
+# '.' in de_DE.*-locales). This needs to be set _before_ any
+# floating-point constants are defined in this script).
+if [[ "${LC_ALL}" != "" ]] ; then
+ export \
+ LC_MONETARY="${LC_ALL}" \
+ LC_MESSAGES="${LC_ALL}" \
+ LC_COLLATE="${LC_ALL}" \
+ LC_CTYPE="${LC_ALL}"
+ unset LC_ALL
+fi
+export LC_NUMERIC=C
+
+function fatal_error
+{
+ print -u2 "${progname}: $*"
+ exit 1
+}
+
+
+function do_directory
+{
+ nameref tree=$1
+ typeset basedir="$2"
+
+ typeset basename
+ typeset dirname
+ typeset i
+ typeset dummy
+
+ typeset -A tree.files
+ typeset -A tree.dirs
+
+ find "${basedir}"/* -prune 2>/dev/null | while read i ; do
+ dirname="$(dirname "$i")"
+ basename="$(basename "$i")"
+
+ # define "node"
+ if [[ -d "$i" ]] ; then
+ typeset -C tree.dirs["${basename}"]
+ nameref node=tree.dirs["${basename}"]
+ typeset -C node.flags
+ node.flags.dir="true"
+ node.flags.file="false"
+ else
+ typeset -C tree.files["${basename}"]
+ nameref node=tree.files["${basename}"]
+ typeset -C node.flags
+
+ node.flags.dir="false"
+ node.flags.file="true"
+ fi
+
+ # basic attributes
+ typeset -C node.paths=(
+ dirname="${dirname}"
+ basename="${basename}"
+ path="${i}"
+ )
+
+ nameref nflags=node.flags
+ [[ -r "$i" ]] && nflags.readable="true" || nflags.readable="false"
+ [[ -w "$i" ]] && nflags.writeable="true" || nflags.writeable="false"
+ [[ -x "$i" ]] && nflags.executable="true" || nflags.executable="false"
+
+ [[ -b "$i" ]] && nflags.blockdevice="true" || nflags.blockdevice="false"
+ [[ -c "$i" ]] && nflags.characterdevice="true" || nflags.characterdevice="false"
+ [[ -S "$i" ]] && nflags.socket="true" || nflags.socket="false"
+
+ [[ -L "$i" ]] && nflags.symlink="true" || nflags.symlink="false"
+
+ integer node.size
+ integer node.links
+ typeset -C node.owner
+ ( [[ -x /usr/bin/runat ]] && ls -@ade "$i" || ls -lade "$i" ) |
+ IFS=' ' read \
+ node.mask \
+ node.links \
+ node.owner.uid \
+ node.owner.gid \
+ node.size \
+ dummy
+
+ typeset -C node.extended_attributes
+ if [[ ${node.mask} == ~(Er)@ ]] ; then
+ node.extended_attributes.hasattrs="true"
+ typeset -a attrlist=(
+ $( runat "$i" "ls -1" )
+ )
+ else
+ node.extended_attributes.hasattrs="false"
+ fi
+
+ if ${nflags.readable} ; then
+ # note that /usr/xpg4/bin/file does not use $'\t' as seperator - we
+ # have to use ':' instead.
+ file -h "$i" | IFS=' ' read dummy node.filetype
+ fi
+
+ if ${nflags.dir} ; then
+ do_directory "${!node}" "$i"
+ fi
+ done
+
+ # remove empty lists
+ (( ${#tree.files[@]} == 0 )) && unset tree.files
+ (( ${#tree.dirs[@]} == 0 )) && unset tree.dirs
+
+ return 0
+}
+
+
+function pathtovartree
+{
+ nameref tree=$1
+ typeset basedir="$2"
+
+ do_directory tree "${basedir}"
+
+ return 0
+}
+
+function usage
+{
+ OPTIND=0
+ getopts -a "${progname}" "${filetree1_usage}" OPT '-?'
+ exit 2
+}
+
+# program start
+builtin basename
+builtin cat
+builtin dirname
+builtin date
+builtin uname
+
+typeset progname="${ basename "${0}" ; }"
+
+typeset -r filetree1_usage=$'+
+[-?\n@(#)\$Id: filetree1 (Roland Mainz) 2008-10-14 \$\n]
+[-author?Roland Mainz <roland.mainz@sun.com>]
+[-author?Roland Mainz <roland.mainz@nrubsig.org>]
+[+NAME?filetree1 - file tree demo]
+[+DESCRIPTION?\bfiletree1\b is a small ksh93 compound variable demo
+ which accepts a directory name as input, and then builds tree
+ nodes for all files+directories and stores all file attributes
+ in these notes and then outputs the tree in the format
+ specified by viewmode (either "list", "namelist" or "tree")..]
+
+viewmode dirs
+
+[+SEE ALSO?\bksh93\b(1), \bfile\b(1)]
+'
+
+while getopts -a "${progname}" "${filetree1_usage}" OPT ; do
+# printmsg "## OPT=|${OPT}|, OPTARG=|${OPTARG}|"
+ case ${OPT} in
+ *) usage ;;
+ esac
+done
+shift $((OPTIND-1))
+
+typeset viewmode="$1"
+shift
+
+if [[ "${viewmode}" != ~(Elr)(list|namelist|tree) ]] ; then
+ fatal_error $"Invalid view mode \"${viewmode}\"."
+fi
+
+typeset -C myfiletree
+
+while (( $# > 0 )) ; do
+ print -u2 -f "# Scanning %s ...\n" "${1}"
+ pathtovartree myfiletree "${1}"
+ shift
+done
+print -u2 $"#parsing completed."
+
+case "${viewmode}" in
+ list)
+ set | egrep "^myfiletree\[" | fgrep -v ']=$'
+ ;;
+ namelist)
+ typeset + | egrep "^myfiletree\["
+ ;;
+ tree)
+ printf "%B\n" myfiletree
+ ;;
+ *)
+ fatal_error $"Invalid view mode \"${viewmode}\"."
+ ;;
+esac
+
+print -u2 $"#done."
+
+exit 0
+# EOF.
diff --git a/usr/src/lib/libshell/common/fun/gnaw b/usr/src/lib/libshell/common/scripts/gnaw.sh
index 159d420207..880e18118b 100644
--- a/usr/src/lib/libshell/common/fun/gnaw
+++ b/usr/src/lib/libshell/common/scripts/gnaw.sh
@@ -1,4 +1,4 @@
-#!/bin/ksh93
+#!/usr/bin/ksh93
#
# CDDL HEADER START
@@ -22,39 +22,65 @@
#
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
#
# gnaw - a simple ksh93 technology demo
#
# Note that this script has been written with the main idea to show
# many of ksh93's new features (comparing to ksh88/bash) and not
-# as an example of efficient&&clean script code.
+# as an example of efficient&&clean script code (much of the code
+# could be done more efficient using compound variables, this script
+# focus is the usage of associative arrays).
#
-# Solaris needs /usr/xpg4/bin/ because the tools in /usr/bin are not POSIX-conformant
-export PATH=/usr/xpg4/bin:/bin:/usr/bin
+# Solaris needs /usr/xpg6/bin:/usr/xpg4/bin because the tools in /usr/bin are not POSIX-conformant
+export PATH=/usr/xpg6/bin:/usr/xpg4/bin:/bin:/usr/bin
+
+# Make sure all math stuff runs in the "C" locale to avoid problems
+# with alternative # radix point representations (e.g. ',' instead of
+# '.' in de_DE.*-locales). This needs to be set _before_ any
+# floating-point constants are defined in this script).
+if [[ "${LC_ALL}" != "" ]] ; then
+ export \
+ LC_MONETARY="${LC_ALL}" \
+ LC_MESSAGES="${LC_ALL}" \
+ LC_COLLATE="${LC_ALL}" \
+ LC_CTYPE="${LC_ALL}"
+ unset LC_ALL
+fi
+export LC_NUMERIC=C
function print_setcursorpos
{
- print -n "${vtcode[cup_${1}_${2}]}"
+ print -n -- "${vtcode[cup_${1}_${2}]}"
}
function beep
{
- ${quiet} || print -n "${vtcode["bel"]}"
+ ${quiet} || print -n -- "${vtcode["bel"]}"
}
function fatal_error
{
- print -u 2 "${progname}: $@"
+ print -u2 "${progname}: $*"
exit 1
}
+# Get terminal size and put values into a compound variable with the integer
+# members "columns" and "lines"
+function get_term_size
+{
+ nameref rect=$1
+
+ rect.columns=${ tput cols ; } || return 1
+ rect.lines=${ tput lines ; } || return 1
+
+ return 0
+}
+
function print_levelmap
{
integer screen_y_offset=$1
@@ -62,7 +88,7 @@ function print_levelmap
integer max_numlines=$3 # maximum lines we're allowed to render
integer x
integer y
- line=""
+ typeset line=""
print_setcursorpos 0 ${screen_y_offset}
@@ -72,21 +98,24 @@ function print_levelmap
line+="${levelmap["${x}_${y}"]}"
done
- print "${line} "
+ print -- "${line} "
done
# print lines filled with spaces for each line not filled
# by the level map
line="${vtcode["spaceline"]:0:${levelmap["max_x"]}}"
for (( ; (y-start_y_pos) < max_numlines ; y++ )) ; do
- print "${line} "
+ print -- "${line} "
done
+ return 0
}
function level_completed
{
- render_buffer="$(
- print -n "${vtcode["clear"]}"
+ integer i
+ typeset dummy
+ typeset render_buffer="$(
+ print -n -- "${vtcode["clear"]}"
cat <<ENDOFTEXT
# ###### # # ###### #
@@ -111,22 +140,24 @@ ENDOFTEXT
printf " SCORE: --> %s <--\n" "${player["score"]}"
printf " LIVES: --> %s <--\n" "${player["lives"]}"
)"
- print "${render_buffer}"
+ print -- "${render_buffer}${end_of_frame}"
# wait five seconds and swallow any user input
for (( i=0 ; i < 50 ; i++ )) ; do
- read -t 0.1 -n 1 dummy
+ read -r -t 0.1 -n 1 dummy
done
- print "Press any key to continue..."
+ print "Press any key to continue...${end_of_frame}"
# wait five secs or for a key
- read -t 5 -n 1 dummy
+ read -r -t 5 -n 1 dummy
+ return 0
}
function game_over
{
- render_buffer="$(
- print -n "${vtcode["clear"]}"
+ typeset dummy
+ typeset render_buffer="$(
+ print -n -- "${vtcode["clear"]}"
cat <<ENDOFTEXT
#### ## # # ######
@@ -149,21 +180,22 @@ ENDOFTEXT
printf "\n SCORE: --> %s <--\n" "${player["score"]}"
)"
- print "${render_buffer}"
+ print -r -- "${render_buffer}${end_of_frame}"
# wait five seconds and swallow any user input
for (( i=0 ; i < 50 ; i++ )) ; do
- read -t 0.1 -n 1 dummy
+ read -r -t 0.1 -n 1 dummy
done
- print "Press any key to continue..."
+ print "Press any key to continue...${end_of_frame}"
# wait five secs or for a key
- read -t 5 -n 1 dummy
+ read -r -t 5 -n 1 dummy
+ return 0
}
function run_logo
{
- render_buffer="$(
+ typeset render_buffer="$(
cat <<ENDOFTEXT
##### # # # # # ###
@@ -175,16 +207,17 @@ function run_logo
##### # # # # ## ## ###
ENDOFTEXT
)"
- print "${vtcode["clear"]}${render_buffer}"
+ print -- "${vtcode["clear"]}${render_buffer}"
# wait two seconds and swallow any user input
for (( i=0 ; i < 20 ; i++ )) ; do
- read -t 0.1 -n 1 dummy
+ read -r -t 0.1 -n 1 dummy
done
print "\n (The KornShell 93 maze game)"
attract_mode
+ return 0
}
function attract_mode
@@ -193,11 +226,13 @@ function attract_mode
# Now present some info, line-by-line in an endless loop
# until the user presses a key (we turn the "magic" return
# code for that)
- magic_return_code=69
- IFS="|" ; # Make sure we do not swallow whitespaces
+ integer -r magic_return_code=69
+ typeset line
+ IFS='' ; # Make sure we do not swallow whitespaces
+
while true ; do
(
- exec 5<&0
+ redirect 5<&0
(cat <<ENDOFTEXT
@@ -270,15 +305,15 @@ function attract_mode
ENDOFTEXT
# clear screen, line-by-line
- for (( i=0 ; i < LINES ; i++ )) ; do print "" ; done
- ) | (while read line ; do
- read -t 0.3 -n 1 c <&5
- [ "$c" != "" ] && exit ${magic_return_code}
- print "${line}"
+ for (( i=0 ; i < termsize.lines ; i++ )) ; do print "" ; done
+ ) | (while read -r line ; do
+ read -r -t 0.3 -n 1 c <&5
+ [[ "$c" != "" ]] && exit ${magic_return_code}
+ print -- "${line}"
done)
- [ $? -eq ${magic_return_code} ] && exit ${magic_return_code}
+ (( $? == magic_return_code )) && exit ${magic_return_code}
)
- [ $? -eq ${magic_return_code} ] && return 0
+ (( $? == magic_return_code )) && return 0
sleep 2
done
@@ -289,22 +324,23 @@ function run_menu
{
integer numlevels=0
integer selected_level=0
+ typeset l
# built list of available levels based on the "function levelmap_.*"
# built into this script
typeset -f | egrep "^function.*levelmap_.*" | sed 's/^function //' |
- while read l ; do
+ while read -r l ; do
levellist[numlevels]="$l"
numlevels+=1
done
# swallow any queued user input (e.g. drain stdin)
- read -t 0.1 -n 100 dummy
+ read -r -t 0.1 -n 100 dummy
while true ; do
# menu loop with timeout (which switches to "attract mode")
while true ; do
- print -n "${vtcode["clear"]}"
+ print -n -- "${vtcode["clear"]}"
cat <<ENDOFTEXT
>======================================\
@@ -321,50 +357,51 @@ ENDOFTEXT
print "\t - [L]evels:"
for (( i=0 ; i < numlevels ; i++ )) ; do
- printf "\t %s %s \n" "$([ $i -eq $selected_level ] && print -n "*" || print -n " ")" "${levellist[i]##levelmap_}"
+ printf "\t %s %s \n" "$( (( i == selected_level )) && print -n "*" || print -n " ")" "${levellist[i]##levelmap_}"
done
print "\t - Rendering options:"
- printf "\t [%s] Use [U]nicode\n" "$([ $game_use_unicode -eq 1 ] && print -n "x" || print -n "_")"
- printf "\t [%s] Use [C]olors\n" "$([ $game_use_colors -eq 1 ] && print -n "x" || print -n "_")"
+ printf "\t [%s] Use [U]nicode\n" "$( (( game_use_unicode == 1 )) && print -n "x" || print -n "_" )"
+ printf "\t [%s] Use [C]olors\n" "$( (( game_use_colors == 1 )) && print -n "x" || print -n "_" )"
print "\t - [S]tart - [Q]uit"
# wait 30 secs (before we switch to "attract mode")
- c="" ; read -t 30 -n 1 c
+ c="" ; read -r -t 30 -n 1 c
case "$c" in
- 'l') selected_level=$(((selected_level+numlevels+1) % numlevels)) ;;
- 'L') selected_level=$(((selected_level+numlevels-1) % numlevels)) ;;
- ~(Ei)s)
- [ ${game_use_colors} -eq 1 ] && print "${vtcode["bg_black"]}"
+ 'l') (( selected_level=(selected_level+numlevels+1) % numlevels )) ;;
+ 'L') (( selected_level=(selected_level+numlevels-1) % numlevels )) ;;
+ ~(Fi)s)
+ (( game_use_colors == 1 )) && print -- "${vtcode["bg_black"]}"
case "${game_use_colors}${game_use_unicode}" in
"00") main_loop "${levellist[selected_level]}" ;;
"01") main_loop "${levellist[selected_level]}" | map_filter 0 1 ;;
"10") main_loop "${levellist[selected_level]}" | map_filter 1 0 ;;
"11") main_loop "${levellist[selected_level]}" | map_filter 1 1 ;;
esac
- print "${vtcode["vtreset"]}"
+ print -- "${vtcode["vtreset"]}"
;;
- ~(Ei)q|$'\E')
+ ~(Fi)q | $'\E')
# make sure we do not exit on a cursor key (e.g. <esc>[A,B,C,D)
- read -t 0.01 -n 1 c
- if [ "$c" = "[" ] ; then
+ read -r -t 0.01 -n 1 c
+ if [[ "$c" == "[" ]] ; then
# this was a cursor key sequence, just eat the 3rd charcater
- read -t 0.01 -n 1 c
+ read -r -t 0.01 -n 1 c
else
exit 0
fi
;;
- ~(Ei)u) game_use_unicode=$(((game_use_unicode+2+1) % 2)) ;;
- ~(Ei)c) game_use_colors=$(((game_use_colors+2+1) % 2)) ;;
+ ~(Fi)u) (( game_use_unicode=(game_use_unicode+2+1) % 2)) ;;
+ ~(Fi)c) (( game_use_colors=(game_use_colors+2+1) % 2)) ;;
"") break ;; # timeout, switch to attract mode
*) beep ;;
esac
done
- print -n "${vtcode["clear"]}"
+ print -n -- "${vtcode["clear"]}"
attract_mode
done
+ return 0
}
function levelmap_stripes
@@ -388,6 +425,7 @@ cat <<ENDOFLEVEL
# #
###################################
ENDOFLEVEL
+ return 0
}
function levelmap_livad
@@ -417,6 +455,7 @@ cat <<ENDOFLEVEL
# #
#####################################################
ENDOFLEVEL
+ return 0
}
function levelmap_classic1
@@ -454,6 +493,7 @@ cat <<ENDOFLEVEL
#.......................#
#########################
ENDOFLEVEL
+ return 0
}
function levelmap_classic2
@@ -481,6 +521,7 @@ cat <<ENDOFLEVEL
#.....................#
#######################
ENDOFLEVEL
+ return 0
}
function levelmap_easy
@@ -499,6 +540,7 @@ cat <<ENDOFLEVEL
# .......... P #
##################
ENDOFLEVEL
+ return 0
}
function levelmap_sunsolaristext
@@ -520,31 +562,34 @@ cat <<ENDOFLEVEL
# #### #### ###### . # ....# # ####. #
################################################
ENDOFLEVEL
+ return 0
}
function read_levelmap
{
- map="$( $1 )"
+ typeset map="$( $1 )"
integer y=0
integer x=0
integer maxx=0
integer numdots=0
+ typeset line
+ typeset c
- print "$map" |
- while read line ; do
- x=0
- while (( x < ${#line} )) ; do
+ while read -r line ; do
+ for (( x=0 ; x < ${#line} ; x++ )) ; do
c="${line:x:1}"
case $c in
".") numdots+=1 ;;
"M")
+ # log start position of monsters
levelmap["monsterstartpos_x"]="$x"
levelmap["monsterstartpos_y"]="$y"
c=" "
;;
"P")
+ # log start position of player
levelmap["playerstartpos_x"]="$x"
levelmap["playerstartpos_y"]="$y"
c=" "
@@ -552,20 +597,19 @@ function read_levelmap
esac
levelmap["${x}_${y}"]="$c"
- let x++
done
- maxx=$x
- let y++
- done
+ (( maxx=x , y++ ))
+ done <<<"${map}"
levelmap["max_x"]=${maxx}
levelmap["max_y"]=${y}
levelmap["numdots"]=${numdots}
- if [ "${levelmap["monsterstartpos_x"]}" = "" ] ; then
+ # consistency checks
+ if [[ "${levelmap["monsterstartpos_x"]}" == "" ]] ; then
fatal_error "read_levelmap: monsterstartpos_x is empty."
fi
- if [ "${levelmap["playerstartpos_x"]}" = "" ] ; then
+ if [[ "${levelmap["playerstartpos_x"]}" == "" ]] ; then
fatal_error "read_levelmap: playerstartpos_x is empty."
fi
@@ -576,26 +620,27 @@ function player.set
{
case "${.sh.subscript}" in
pos_y)
- if [ "${levelmap["${player["pos_x"]}_${.sh.value}"]}" = "#" ] ; then
+ if [[ "${levelmap["${player["pos_x"]}_${.sh.value}"]}" == "#" ]] ; then
.sh.value=${player["pos_y"]}
beep
fi
;;
pos_x)
- if [ "${levelmap["${.sh.value}_${player["pos_y"]}"]}" = "#" ] ; then
+ if [[ "${levelmap["${.sh.value}_${player["pos_y"]}"]}" == "#" ]] ; then
.sh.value=${player["pos_x"]}
beep
fi
;;
esac
+ return 0
}
function monster.set
{
case "${.sh.subscript}" in
*_pos_y)
- if [ "${levelmap["${monster[${currmonster}_"pos_x"]}_${.sh.value}"]}" = "#" ] ; then
+ if [[ "${levelmap["${monster[${currmonster}_"pos_x"]}_${.sh.value}"]}" == "#" ]] ; then
.sh.value=${monster[${currmonster}_"pos_y"]}
# turn homing off when the monster hit a wall
monster[${currmonster}_"homing"]=0
@@ -603,13 +648,14 @@ function monster.set
;;
*_pos_x)
- if [ "${levelmap["${.sh.value}_${monster[${currmonster}_"pos_y"]}"]}" = "#" ] ; then
+ if [[ "${levelmap["${.sh.value}_${monster[${currmonster}_"pos_y"]}"]}" == "#" ]] ; then
.sh.value=${monster[${currmonster}_"pos_x"]}
# turn homing off when the monster hit a wall
monster[${currmonster}_"homing"]=0
fi
;;
esac
+ return 0
}
function render_game
@@ -617,17 +663,17 @@ function render_game
# render_buffer is some kind of "background buffer" to "double buffer"
# all output and combine it in one write to reduce flickering in the
# terminal
- render_buffer="$(
- screen_y_offset=1
- start_y_pos=0
- render_num_lines=${levelmap["max_y"]}
-
- if (( (LINES-3) < levelmap["max_y"] )) ; then
- start_y_pos=$((player["pos_y"] / 2))
- render_num_lines=$((LINES-5))
+ typeset render_buffer="$(
+ integer screen_y_offset=1
+ integer start_y_pos=0
+ integer render_num_lines=${levelmap["max_y"]}
+
+ if (( (termsize.lines-3) < levelmap["max_y"] )) ; then
+ (( start_y_pos=player["pos_y"] / 2))
+ (( render_num_lines=termsize.lines-5))
fi
- #print -n "${vtcode["clear"]}"
+ #print -n -- "${vtcode["clear"]}"
print_setcursorpos 0 0
# print score (note the " " around "%d" are neccesary to clean up cruft
@@ -641,8 +687,8 @@ function render_game
# render monsters
for currmonster in ${monsterlist} ; do
- let m_pos_x=monster[${currmonster}_"pos_x"]
- let m_pos_y=monster[${currmonster}_"pos_y"]+screen_y_offset-start_y_pos
+ (( m_pos_x=monster[${currmonster}_"pos_x"] ))
+ (( m_pos_y=monster[${currmonster}_"pos_y"]+screen_y_offset-start_y_pos ))
if (( m_pos_y >= screen_y_offset && m_pos_y < render_num_lines )) ; then
print_setcursorpos ${m_pos_x} ${m_pos_y}
@@ -655,8 +701,9 @@ function render_game
emptyline=" "
print -n " >> ${player["message"]} <<${emptyline:0:${#emptyline}-${#player["message"]}}"
)"
- print "${render_buffer}"
-# print "renderbuffersize=$(print "${render_buffer}" | wc -c) "
+ print -r -- "${render_buffer}${end_of_frame}"
+# print "renderbuffersize=$(print "${render_buffer}" | wc -c) ${end_of_frame}"
+ return 0
}
function main_loop
@@ -666,7 +713,7 @@ function main_loop
integer num_cycles=0
float rs
- print -n "${vtcode["clear"]}"
+ print -n -- "${vtcode["clear"]}"
read_levelmap "$1"
@@ -692,22 +739,22 @@ function main_loop
while true ; do
num_cycles+=1
seconds_before_read=${SECONDS}
- c="" ; read -t ${sleep_per_cycle} -n 1 c
+ c="" ; read -r -t ${sleep_per_cycle} -n 1 c
- if [ "$c" != "" ] ; then
+ if [[ "$c" != "" ]] ; then
# special case handling for cursor keys which are usually composed
# of three characters (e.g. "<ESC>[D"). If only <ESC> is hit we
# quicky exit
- if [ "$c" = $'\E' ] ; then
- read -t 0.1 -n 1 c
- if [ "$c" != "[" ] ; then
+ if [[ "$c" == $'\E' ]] ; then
+ read -r -t 0.1 -n 1 c
+ if [[ "$c" != "[" ]] ; then
return 0
fi
# we assume the user is using the cursor keys, this |read|
# should fetch the 3rd byte of the three-character sequence
# for the cursor keys
- read -t 0.1 -n 1 c
+ read -r -t 0.1 -n 1 c
fi
# if the user hit a key the "read" above was interrupted
@@ -715,28 +762,28 @@ function main_loop
# We wait here some moments (|rs|="remaining seconds") to
# avoid that the game gets "faster" when more user input
# is given.
- rs=$((sleep_per_cycle-(SECONDS-seconds_before_read)))
+ (( rs=sleep_per_cycle-(SECONDS-seconds_before_read) ))
(( rs > 0.001 )) && sleep ${rs}
player["message"]=""
case "$c" in
- j|D|4) let player["pos_x"]-=1 ;;
- k|C|6) let player["pos_x"]+=1 ;;
- i|A|8) let player["pos_y"]-=1 ;;
- m|B|2) let player["pos_y"]+=1 ;;
+ j|D|4) (( player["pos_x"]-=1 )) ;;
+ k|C|6) (( player["pos_x"]+=1 )) ;;
+ i|A|8) (( player["pos_y"]-=1 )) ;;
+ m|B|2) (( player["pos_y"]+=1 )) ;;
q) return 0 ;;
esac
- if [ "${levelmap["${player["pos_x"]}_${player["pos_y"]}"]}" = "." ] ; then
+ if [[ "${levelmap["${player["pos_x"]}_${player["pos_y"]}"]}" == "." ]] ; then
levelmap["${player["pos_x"]}_${player["pos_y"]}"]=" "
- let levelmap["numdots"]-=1
+ (( levelmap["numdots"]-=1 ))
- let player["score"]+=10
+ (( player["score"]+=10 ))
player["message"]='GNAW!!'
- if [ ${levelmap["numdots"]} -le 0 ] ; then
+ if (( levelmap["numdots"] <= 0 )) ; then
level_completed
return 0
fi
@@ -744,10 +791,10 @@ function main_loop
fi
# generic player status change
- if [ ${player["invulnerable"]} -gt 0 ] ; then
- let player["invulnerable"]-=1
+ if (( player["invulnerable"] > 0 )) ; then
+ (( player["invulnerable"]-=1 ))
fi
- if [ ${player["lives"]} -le 0 ] ; then
+ if (( player["lives"] <= 0 )) ; then
game_over
return 0
fi
@@ -755,98 +802,71 @@ function main_loop
# move monsters
for currmonster in ${monsterlist} ; do
# make monster as half as slow then the others when it is following the user
- if [ ${monster[${currmonster}_"homing"]} -gt 0 ] ; then
- [ $((num_cycles % 2)) -gt 0 ] && continue
+ if (( monster[${currmonster}_"homing"] > 0 )) ; then
+ (( (num_cycles%2) > 0 )) && continue
fi
- if [ ${monster[${currmonster}_"pos_x"]} = ${player["pos_x"]} ] ; then
- if [ $((monster[${currmonster}_"pos_y"]-player["pos_y"])) -gt 0 ] ; then
- let monster[${currmonster}_"xstep"]=+0 monster[${currmonster}_"ystep"]=-1
+ if [[ ${monster[${currmonster}_"pos_x"]} == ${player["pos_x"]} ]] ; then
+ if (( (monster[${currmonster}_"pos_y"]-player["pos_y"]) > 0 )) ; then
+ (( monster[${currmonster}_"xstep"]=+0 , monster[${currmonster}_"ystep"]=-1 ))
else
- let monster[${currmonster}_"xstep"]=+0 monster[${currmonster}_"ystep"]=+1
+ (( monster[${currmonster}_"xstep"]=+0 , monster[${currmonster}_"ystep"]=+1 ))
fi
monster[${currmonster}_"homing"]=1
- if [ ${player["invulnerable"]} -le 0 ] ; then
+ if (( player["invulnerable"] <= 0 )) ; then
player["message"]="Attention: ${currmonster} is chasing you"
fi
- elif [ ${monster[${currmonster}_"pos_y"]} = ${player["pos_y"]} ] ; then
- if [ $((monster[${currmonster}_"pos_x"]-player["pos_x"])) -gt 0 ] ; then
- let monster[${currmonster}_"xstep"]=-1 monster[${currmonster}_"ystep"]=-0
+ elif (( monster[${currmonster}_"pos_y"] == player["pos_y"] )) ; then
+ if (( (monster[${currmonster}_"pos_x"]-player["pos_x"]) > 0 )) ; then
+ (( monster[${currmonster}_"xstep"]=-1 , monster[${currmonster}_"ystep"]=-0 ))
else
- let monster[${currmonster}_"xstep"]=+1 monster[${currmonster}_"ystep"]=+0
+ (( monster[${currmonster}_"xstep"]=+1 , monster[${currmonster}_"ystep"]=+0 ))
fi
monster[${currmonster}_"homing"]=1
- if [ ${player["invulnerable"]} -le 0 ] ; then
+ if (( player["invulnerable"] <= 0 )) ; then
player["message"]="Attention: ${currmonster} is chasing you"
fi
else
- if [ ${monster[${currmonster}_"homing"]} -eq 0 ] ; then
+ if (( monster[${currmonster}_"homing"] == 0 )) ; then
case $((SECONDS % 6 + RANDOM % 4)) in
- 0) let monster[${currmonster}_"xstep"]=+0 monster[${currmonster}_"ystep"]=+0 ;;
- 2) let monster[${currmonster}_"xstep"]=+0 monster[${currmonster}_"ystep"]=+1 ;;
- 3) let monster[${currmonster}_"xstep"]=+1 monster[${currmonster}_"ystep"]=+0 ;;
- 5) let monster[${currmonster}_"xstep"]=+0 monster[${currmonster}_"ystep"]=-1 ;;
- 6) let monster[${currmonster}_"xstep"]=-1 monster[${currmonster}_"ystep"]=+0 ;;
+ 0) (( monster[${currmonster}_"xstep"]=+0 , monster[${currmonster}_"ystep"]=+0 )) ;;
+ 2) (( monster[${currmonster}_"xstep"]=+0 , monster[${currmonster}_"ystep"]=+1 )) ;;
+ 3) (( monster[${currmonster}_"xstep"]=+1 , monster[${currmonster}_"ystep"]=+0 )) ;;
+ 5) (( monster[${currmonster}_"xstep"]=+0 , monster[${currmonster}_"ystep"]=-1 )) ;;
+ 6) (( monster[${currmonster}_"xstep"]=-1 , monster[${currmonster}_"ystep"]=+0 )) ;;
esac
fi
fi
- let monster[${currmonster}_"pos_x"]=monster[${currmonster}_"pos_x"]+monster[${currmonster}_"xstep"]
- let monster[${currmonster}_"pos_y"]=monster[${currmonster}_"pos_y"]+monster[${currmonster}_"ystep"]
+ (( monster[${currmonster}_"pos_x"]=monster[${currmonster}_"pos_x"]+monster[${currmonster}_"xstep"] ))
+ (( monster[${currmonster}_"pos_y"]=monster[${currmonster}_"pos_y"]+monster[${currmonster}_"ystep"] ))
# check if a monster hit the player
- if [ ${player["invulnerable"]} -le 0 ] ; then
- if [ ${monster[${currmonster}_"pos_x"]} -eq ${player["pos_x"]} -a \
- ${monster[${currmonster}_"pos_y"]} -eq ${player["pos_y"]} ] ; then
+ if (( player["invulnerable"] <= 0 )) ; then
+ if (( monster[${currmonster}_"pos_x"] == player["pos_x"] && \
+ monster[${currmonster}_"pos_y"] == player["pos_y"] )) ; then
# if player was hit by a monster take one life and
# make him invulnerable for 10 cycles to avoid that
# the next cycle steals more lives
player["message"]="Ouuuchhhh"
player["invulnerable"]=10
- let player["lives"]-=1
+ (( player["lives"]-=1 ))
- beep ; beep ; sleep 0.3 ; beep ; beep
+ beep ; beep ; sleep 0.2 ; beep ; beep
fi
fi
done
render_game
done
+ return 0
}
-# program start
function map_filter
{
-# Choose between the old "sed"-based codepath and the new ksh93-native one
-# The old codepath no longer used except for the unicode mode because
-# we do not have control over the point where "sed" flushes it's buffer
-# which completely defeats the doube-buffering code. Unfortunately the new
-# codepath has problems in UTF-8 mode (bug in ksh93 ?) which forces us to
-# use the old codepath in this case.
-if [ $2 -eq 1 ] ; then
-(
- filter1=""
- filter2=""
-
- # should we add the color map ?
- if [ $1 -eq 1 ] ; then
- filter1="s/#/${vtcode["fg_blue"]}#/g;\
- s/x/${vtcode["fg_red"]}x/g;\
- s/@/${vtcode["fg_yellow"]}@/g;\
- s/ /${vtcode["fg_grey"]} /g;\
- s/\./${vtcode["fg_lightred"]}./g;"
- fi
+ typeset ch_player ch_monster ch_wall var
- # should we add the unicode map ?
- if [ $2 -eq 1 ] ; then
- filter2="s/@/$(printf '\u[24d2]')/g;s/x/$(printf '\u[2605]')/g;s/#/$(printf '\u[25a6]')/g"
- fi
-
- sed -e "${filter1}" -e "${filter2}"
-)
-else
-(
- if [ $1 -eq 1 ] ; then
+ if (( $1 == 1 )) ; then
ch_player="${vtcode["fg_yellow"]}"
ch_monster="${vtcode["fg_red"]}"
ch_wall="${vtcode["fg_blue"]}"
@@ -856,7 +876,7 @@ else
ch_wall=""
fi
- if [ $2 -eq 1 ] ; then
+ if (( $2 == 1 )) ; then
# unicode map
ch_player+="$(printf '\u[24d2]')"
ch_monster+="$(printf '\u[2605]')"
@@ -868,46 +888,52 @@ else
ch_wall+="#"
fi
- IFS="|" # make sure we don't swallow spaces/tabs
- while read var ; do
+ # note that this filter currently defeats the "double-buffering"
+ while IFS='' read -r -d "${end_of_frame}" var ; do
var="${var// /${vtcode["fg_grey"]} }"
var="${var//\./${vtcode["fg_lightred"]}.}"
var="${var//@/${ch_player}}"
var="${var//x/${ch_monster}}"
var="${var//#/${ch_wall}}"
- print "${var}"
+ print -r -- "${var}"
done
-)
-fi
+ return 0
}
function exit_trap
{
# restore stty settings
- stty ${SAVED_STTY}
+ stty ${saved_stty}
print "bye."
+ return 0
}
function usage
{
OPTIND=0
- getopts -a "${progname}" "${USAGE}" OPT '-?'
+ getopts -a "${progname}" "${gnaw_usage}" OPT '-?'
exit 2
}
# program start
-progname="${0}"
-quiet=false
-
# make sure we use the ksh93 "cat" builtin which supports the "-u" option
+builtin basename
builtin cat
builtin wc
-builtin printf # we need this for positional parameters ('printf "%2\$s %1\$s" hello world' = "world hello")
-builtin sleep
+
+typeset progname="${ basename "${0}" ; }"
+
+# terminal size rect
+typeset -C termsize=(
+ integer columns=-1
+ integer lines=-1
+)
# global variables
+typeset quiet=false
+
typeset -A levelmap
typeset -A player
typeset -A monster
@@ -915,33 +941,33 @@ typeset -A monster
integer game_use_colors=0
integer game_use_unicode=0
-USAGE=$'
-[-?
-@(#)\$Id: gnaw (Roland Mainz) 2007-06-05 \$
-]
+typeset -r gnaw_usage=$'+
+[-?\n@(#)\$Id: gnaw (Roland Mainz) 2008-11-04 \$\n]
+[-author?Roland Mainz <roland.mainz@nrubsig.org>]
[+NAME?gnaw - maze game written in ksh93]
[+DESCRIPTION?\bgnaw\b is a maze game.
- The player maneuvers a yellow '@' sign to navigate a maze while eating
+ The player maneuvers a yellow "@" sign to navigate a maze while eating
small dots. A level is finished when all the dots are eaten. Five monsters
(maw, claw, jitterbug, tentacle and grendel) also wander the maze in an attempt
- to catch the '@'. Each level begins with all ghosts in their home, and '@' near
+ to catch the "@". Each level begins with all ghosts in their home, and "@" near
the bottom of the maze. The monsters are released from the home one by one at the
start of each level and start their rentless hunt after the player.]
[q:quiet?Disable use of terminal bell.]
[+SEE ALSO?\bksh93\b(1)]
'
-while getopts -a "${progname}" "${USAGE}" OPT ; do
+while getopts -a "${progname}" "${gnaw_usage}" OPT ; do
# printmsg "## OPT=|${OPT}|, OPTARG=|${OPTARG}|"
case ${OPT} in
- q) quiet=true ;;
+ q) quiet=true ;;
+ +q) quiet=false ;;
*) usage ;;
esac
done
-shift ${OPTIND}-1
+shift $((OPTIND-1))
# save stty values and register the exit trap which restores these values on exit
-SAVED_STTY="$(stty -g)"
+saved_stty="$(stty -g)"
trap exit_trap EXIT
print "Loading..."
@@ -950,25 +976,10 @@ print "Loading..."
# "-echo" turns the terminal echo off
stty -icanon min 1 time 0 -inpck -echo
-# "resize" cannot fetch the terminal width/height for some terminals
-case ${TERM} in
- sun | sun-color)
- export COLUMNS=80 LINES=25
- ;;
- vt52)
- export COLUMNS=80 LINES=24
- ;;
- *)
- # get width/height from current terminal
- [ -x "/usr/X11/bin/resize" ] && eval "$(/usr/X11/bin/resize -u)" ||
- [ -x "/usr/X11R6/bin/resize" ] && eval "$(/usr/X11R6/bin/resize -u)" ||
- [ -x "/usr/openwin/bin/resize" ] && eval "$(/usr/openwin/bin/resize -u)" ||
- fatal_error "resize not found."
- ;;
-esac
+get_term_size termsize || fatal_error "Could not get terminal size."
# prechecks
-(( COLUMNS < 60 )) && fatal_error "Terminal width must be larger than 60 columns (currently ${COLUMNS})."
+(( termsize.columns < 60 )) && fatal_error "Terminal width must be larger than 60 columns (currently ${termsize.columns})."
typeset -A vtcode
# color values taken from http://frexx.de/xterm-256-notes/, other
@@ -991,9 +1002,14 @@ vtcode=(
["vtreset"]="$(tput reset)"
["clear"]="$(tput clear)"
["bel"]="$(tput bel)"
- ["spaceline"]="$(for (( i=0 ; i < COLUMNS ; i++ )) ; do print -n " " ; done)"
+ ["spaceline"]="$(for (( i=0 ; i < termsize.columns ; i++ )) ; do print -n " " ; done)"
)
+# character used to as marker that a single frame ends at this point - this
+# is used by the "double buffering" code to make sure the "read" builtin
+# can read a whole "frame" instead of reading stuff line-by-line
+typeset -r end_of_frame=$'\t'
+
# get terminal sequence to move cursor to position x,y
# (see http://vt100.net/docs/vt100-ug/chapter3.html#CPR)
case ${TERM} in
@@ -1004,26 +1020,26 @@ case ${TERM} in
-e 's/%[%id]*p1[%id]*/%2\\\$d/g' \
-e 's/%[%id]*p2[%id]*/%1\\\$d/g' \
-e 's/,$//')"
- for (( x=0 ; x < COLUMNS ; x++ )) ; do
- for (( y=0 ; y < LINES ; y++ )) ; do
+ for (( x=0 ; x < termsize.columns ; x++ )) ; do
+ for (( y=0 ; y < termsize.lines ; y++ )) ; do
vtcode[cup_${x}_${y}]="$(printf "${cup}" $((x + 1)) $((y + 1)) )"
done
done
;;
*)
- printf "# Unrecognised terminal type '%s', fetching %dx%d items from terminfo database, please wait...\n" "${TERM}" "${COLUMNS}" "${LINES}"
- for (( x=0 ; x < COLUMNS ; x++ )) ; do
- for (( y=0 ; y < LINES ; y++ )) ; do
+ printf "# Unrecognised terminal type '%s', fetching %dx%d items from terminfo database, please wait...\n" "${TERM}" "${termsize.columns}" "${termsize.lines}"
+ for (( x=0 ; x < termsize.columns ; x++ )) ; do
+ for (( y=0 ; y < termsize.lines ; y++ )) ; do
vtcode[cup_${x}_${y}]="$(tput cup ${y} ${x})"
done
done
;;
esac
-print "${vtcode["vtreset"]}"
+print -- "${vtcode["vtreset"]}"
run_logo
run_menu
+exit 0
# EOF.
-
diff --git a/usr/src/lib/libshell/common/scripts/mandelbrotset1.sh b/usr/src/lib/libshell/common/scripts/mandelbrotset1.sh
new file mode 100644
index 0000000000..2b01d33f4e
--- /dev/null
+++ b/usr/src/lib/libshell/common/scripts/mandelbrotset1.sh
@@ -0,0 +1,281 @@
+#!/usr/bin/ksh93
+
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# mandelbrotset1 - a simple mandelbrot set generation and
+# parallel execution demo
+#
+
+# Solaris needs /usr/xpg6/bin:/usr/xpg4/bin because the tools in /usr/bin are not POSIX-conformant
+export PATH=/usr/xpg6/bin:/usr/xpg4/bin:/bin:/usr/bin
+
+# Make sure all math stuff runs in the "C" locale to avoid problems
+# with alternative # radix point representations (e.g. ',' instead of
+# '.' in de_DE.*-locales). This needs to be set _before_ any
+# floating-point constants are defined in this script).
+if [[ "${LC_ALL}" != "" ]] ; then
+ export \
+ LC_MONETARY="${LC_ALL}" \
+ LC_MESSAGES="${LC_ALL}" \
+ LC_COLLATE="${LC_ALL}" \
+ LC_CTYPE="${LC_ALL}"
+ unset LC_ALL
+fi
+export LC_NUMERIC=C
+
+function printmsg
+{
+ print -u2 "$*"
+}
+
+function fatal_error
+{
+ print -u2 "${progname}: $*"
+ exit 1
+}
+
+# Get terminal size and put values into a compound variable with the integer
+# members "columns" and "lines"
+function get_term_size
+{
+ nameref rect=$1
+
+ rect.columns=${ tput cols ; } || return 1
+ rect.lines=${ tput lines ; } || return 1
+
+ return 0
+}
+
+function print_color
+{
+ print -r -n -- "${symbollist:${1}:1}"
+ return 0
+}
+
+function mandelbrot
+{
+ nameref result=$1
+ float x=$2
+ float y=$3
+ float xx
+ float yy
+ float x1=$4
+ float y1=$5
+ integer iteration=$6
+ integer max_iteration=$7
+ float mag
+
+ for (( mag=0 ; mag < max_mag && iteration < max_iteration ; iteration++ )) ; do
+ ((
+ xx=x*x ,
+ yy=y*y ,
+ mag=xx+yy ,
+ y=x*y*2+y1 ,
+ x=xx-yy+x1
+ ))
+ done
+
+ (( result=iteration ))
+
+ return 0
+}
+
+# build mandelbrot image serially
+function loop_serial
+{
+ integer value
+
+ for (( y=y_min ; y < y_max ; y+=stepwidth )) ; do
+ for (( x=x_min ; x < x_max ; x+=stepwidth )) ; do
+ mandelbrot value ${x} ${y} ${x} ${y} 1 ${symbollistlen}
+ print_color ${value}
+ done
+
+ print
+ done
+
+ return 0
+}
+
+# build mandelbrot image using parallel worker jobs
+function loop_parallel
+{
+ integer numjobs=0
+ # the following calculation suffers from rounding errors
+ integer lines_per_job=$(( ((m_height+(numcpus-1)) / numcpus) ))
+
+ printmsg $"# lines_per_job=${lines_per_job}"
+ printmsg $"# numcpus=${numcpus}"
+
+ # "renice" worker jobs
+ set -o bgnice
+
+ if [[ "${TMPDIR}" == "" ]] ; then
+ TMPDIR="/tmp"
+ fi
+
+ # try to generate a job identifer prefix which is unique across multiple hosts
+ jobident="job_host_$(uname -n)pid_$$_ppid${PPID}"
+
+ printmsg $"## prepare..."
+ for (( y=y_min ; y < y_max ; y+=(stepwidth*lines_per_job) )) ; do
+ rm -f "${TMPDIR}/mandelbrot_${jobident}_child_$y.joboutput"
+
+ (( numjobs++ ))
+ done
+
+ printmsg $"## running ${numjobs} children..."
+ for (( y=y_min ; y < y_max ; y+=(stepwidth*lines_per_job) )) ; do
+ (
+ integer value
+
+ for (( ; y < y_max && lines_per_job-- > 0 ; y+=stepwidth )) ; do
+ for (( x=x_min ; x < x_max ; x+=stepwidth )) ; do
+ mandelbrot value ${x} ${y} ${x} ${y} 1 ${symbollistlen}
+ print_color ${value}
+ done
+
+ print
+ done >"${TMPDIR}/mandelbrot_${jobident}_child_$y.joboutput"
+ ) &
+ done
+
+ printmsg $"## waiting for ${numjobs} children..."
+ wait
+
+ printmsg $"## output:"
+ for (( y=y_min ; y < y_max ; y+=(stepwidth*lines_per_job) )) ; do
+ print -- "$( < "${TMPDIR}/mandelbrot_${jobident}_child_$y.joboutput")"
+ rm "${TMPDIR}/mandelbrot_${jobident}_child_$y.joboutput"
+ done
+
+ return 0
+}
+
+function usage
+{
+ OPTIND=0
+ getopts -a "${progname}" "${mandelbrotset1_usage}" OPT '-?'
+ exit 2
+}
+
+# main
+builtin basename
+builtin cat
+builtin rm
+builtin uname # loop_parallel needs the ksh93 builtin version to generate unique job file names
+
+typeset progname="${ basename "${0}" ; }"
+
+float x_max
+float x_min
+float y_max
+float y_min
+float m_width
+float m_height
+float max_mag
+float stepwidth
+integer numcpus
+
+# terminal size rect
+typeset -C termsize=(
+ integer columns=-1
+ integer lines=-1
+)
+
+get_term_size termsize || fatal_error $"Could not get terminal size."
+
+typeset symbollist=' .:0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ%#'
+typeset symbollistlen=$(( ${#symbollist} - 1))
+typeset mode="parallel"
+
+max_mag=400
+stepwidth=0.1
+numcpus=16
+
+(( m_width=termsize.columns-1 , m_height=termsize.lines-2 ))
+
+typeset -r mandelbrotset1_usage=$'+
+[-?\n@(#)\$Id: mandelbrotset1 (Roland Mainz) 2008-11-04 \$\n]
+[-author?Roland Mainz <roland.mainz@nrubsig.org>]
+[+NAME?mandelbrotset1 - generate mandelbrot set fractals with ksh93]
+[+DESCRIPTION?\bmandelbrotset1\b mandelbrot set fractal generator
+ which runs either in serial or parallel mode (using multiple worker jobs).]
+[w:width?Width of fractal.]:[width]
+[h:height?Height of fractal.]:[height]
+[s:symbols?Symbols to build the fractal from.]:[symbolstring]
+[m:mag?Magnification level.]:[magnificationlevel]
+[p:stepwidth?Width per step.]:[widthperstep]
+[S:serial?Run in serial mode.]
+[P:parallel?Run in parallel mode.]
+[M:mode?Execution mode.]:[mode]
+[C:numcpus?Number of processors used for parallel execution.]:[numcpus]
+[+SEE ALSO?\bjuliaset1\b(1), \bksh93\b(1)]
+'
+
+while getopts -a "${progname}" "${mandelbrotset1_usage}" OPT ; do
+# printmsg "## OPT=|${OPT}|, OPTARG=|${OPTARG}|"
+ case ${OPT} in
+ w) m_width="${OPTARG}" ;;
+ h) m_height="${OPTARG}" ;;
+ s) symbollist="${OPTARG}" ;;
+ m) max_mag="${OPTARG}" ;;
+ p) stepwidth="${OPTARG}" ;;
+ S) mode="serial" ;;
+ P) mode="parallel" ;;
+ M) mode="${OPTARG}" ;;
+ C) numcpus="${OPTARG}" ;;
+ *) usage ;;
+ esac
+done
+shift $((OPTIND-1))
+
+printmsg "# width=${m_width}"
+printmsg "# height=${m_height}"
+printmsg "# max_mag=${max_mag}"
+printmsg "# stepwidth=${stepwidth}"
+printmsg "# symbollist='${symbollist}'"
+printmsg "# mode=${mode}"
+
+(( symbollistlen=${#symbollist}-1 ))
+
+((
+ x_max=m_width*stepwidth/2. ,
+ x_min=-x_max ,
+ y_max=m_height*stepwidth/2. ,
+ y_min=-y_max
+))
+
+case "${mode}" in
+ parallel) loop_parallel ; exit $? ;;
+ serial) loop_serial ; exit $? ;;
+ *) fatal_error $"Unknown mode \"${mode}\"." ;;
+esac
+
+fatal_error "not reached."
+# EOF.
diff --git a/usr/src/lib/libshell/common/scripts/multifollow.sh b/usr/src/lib/libshell/common/scripts/multifollow.sh
new file mode 100644
index 0000000000..d0323ef915
--- /dev/null
+++ b/usr/src/lib/libshell/common/scripts/multifollow.sh
@@ -0,0 +1,148 @@
+#!/usr/bin/ksh93
+
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+# Solaris needs /usr/xpg6/bin:/usr/xpg4/bin because the tools in /usr/bin are not POSIX-conformant
+export PATH=/usr/xpg6/bin:/usr/xpg4/bin:/bin:/usr/bin
+
+# Make sure all math stuff runs in the "C" locale to avoid problems
+# with alternative # radix point representations (e.g. ',' instead of
+# '.' in de_DE.*-locales). This needs to be set _before_ any
+# floating-point constants are defined in this script).
+if [[ "${LC_ALL}" != "" ]] ; then
+ export \
+ LC_MONETARY="${LC_ALL}" \
+ LC_MESSAGES="${LC_ALL}" \
+ LC_COLLATE="${LC_ALL}" \
+ LC_CTYPE="${LC_ALL}"
+ unset LC_ALL
+fi
+export LC_NUMERIC=C
+
+function fatal_error
+{
+ print -u 2 "${progname}: $@"
+ exit 1
+}
+
+
+function usage
+{
+ OPTIND=0
+ getopts -a "${progname}" "${multifollow_usage}" OPT '-?'
+ exit 2
+}
+
+# program start
+builtin basename
+builtin cat
+
+typeset progname="$(basename "${0}")"
+
+typeset -r multifollow_usage=$'+
+[-?\n@(#)\$Id: multifollow (Roland Mainz) 2008-10-14 \$\n]
+[-author?Roland Mainz <roland.mainz@nrubsig.org>]
+[+NAME?multifollow - use tail -f on multiple files]
+[+DESCRIPTION?\bmultifollow\b is a small utilty which can "follow" multiple
+ files similar to tail -f.]
+
+[ file ... ]
+
+[+SEE ALSO?\bksh93\b(1), \btail\b(1)]
+'
+
+while getopts -a "${progname}" "${multifollow_usage}" OPT ; do
+# printmsg "## OPT=|${OPT}|, OPTARG=|${OPTARG}|"
+ case ${OPT} in
+ *) usage ;;
+ esac
+done
+shift $((OPTIND-1))
+
+# expecting at least one more arguments
+(($# >= 1)) || usage
+
+builtin -f libshell.so.1 poll || fatal_error "poll builtin not found."
+
+typeset -a files
+integer numfiles=0
+integer i
+
+# register trap to cleanup child processes
+trap 'for ((i=0 ; i < numfiles ; i++ )) ; do kill -TERM ${files[i].childpid} ; done' EXIT
+
+# setup "tail -f" childs, FIFOs and information for the "poll" builtin
+for (( ; $# > 0 ; numfiles++ )) ; do
+ typeset files[${numfiles}]=(
+ typeset name="$1"
+ typeset pipename="/tmp/multifollow_pipe_${PPID}_$$_${numfiles}"
+ integer childpid=-1
+
+ # poll(1) information
+ integer fd="-1"
+ typeset events="POLLIN"
+ typeset revents=""
+ )
+
+ mkfifo "${files[${numfiles}].pipename}"
+ redirect {files[numfiles].fd}<>"${files[numfiles].pipename}"
+
+ tail -f "${files[${numfiles}].name}" >"${files[${numfiles}].pipename}" &
+ files[${numfiles}].childpid=$!
+
+ rm "${files[${numfiles}].pipename}"
+
+ shift
+done
+
+typeset do_poll=true
+
+# event loop
+while true ; do
+ if ${do_poll} ; then
+ for ((i=0 ; i < numfiles ; i++ )) ; do
+ files[i].revents=""
+ done
+ poll files
+ fi
+ do_poll=true
+
+ for ((i=0 ; i < numfiles ; i++ )) ; do
+ if [[ "${files[i].revents}" != "" ]] ; then
+ # todo: investigate why we have to use "do_poll" at all - AFAIK it
+ # should be sufficient to call "poll" and get "revents" set if there
+ # are any remaining data...
+ if read -t0 -u${files[i].fd} line ; then
+ print -- "#${i}: ${line}"
+ do_poll=false
+ fi
+ fi
+ done
+done
+
+fatal_error "not reached."
+# EOF.
diff --git a/usr/src/lib/libshell/common/scripts/primenumbers1.sh b/usr/src/lib/libshell/common/scripts/primenumbers1.sh
new file mode 100644
index 0000000000..aba6f5aeac
--- /dev/null
+++ b/usr/src/lib/libshell/common/scripts/primenumbers1.sh
@@ -0,0 +1,115 @@
+#!/usr/bin/ksh93
+
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# primenumbers1 - a simple prime number generator
+#
+
+# Solaris needs /usr/xpg6/bin:/usr/xpg4/bin because the tools in /usr/bin are not POSIX-conformant
+export PATH=/usr/xpg6/bin:/usr/xpg4/bin:/bin:/usr/bin
+
+# Make sure all math stuff runs in the "C" locale to avoid problems
+# with alternative # radix point representations (e.g. ',' instead of
+# '.' in de_DE.*-locales). This needs to be set _before_ any
+# floating-point constants are defined in this script).
+if [[ "${LC_ALL}" != "" ]] ; then
+ export \
+ LC_MONETARY="${LC_ALL}" \
+ LC_MESSAGES="${LC_ALL}" \
+ LC_COLLATE="${LC_ALL}" \
+ LC_CTYPE="${LC_ALL}"
+ unset LC_ALL
+fi
+export LC_NUMERIC=C
+
+
+# check whether arg1 is a prime number via comparing it against the "pn" array
+function is_prime
+{
+ integer i
+ integer num=$1
+ float max_pn
+
+ (( max_pn=sqrt(num)+1. ))
+
+ for (( i=0 ; i < num_pn && pn[i] < max_pn ; i++)) ; do
+ (( num % pn[i] == 0 )) && return 1;
+ done
+ return 0
+}
+
+# main
+set -o errexit
+
+# get arguments
+integer max_prime=$1 # maximum prime number
+typeset outputformat=$2
+
+# variables
+integer -a pn # integer array for the prime numbers
+integer num_pn=1 # number of prime numbers
+integer n # current number which should be tested
+pn[0]=2 # start value
+
+# prechecks
+(( max_prime > 1 )) || { print -u2 -f "%s: requires a positive integer as first input.\n" "$0" ; exit 1 ; }
+
+# calculate prime numbers
+printf $"# %s: Calculating prime numbes from 1 to %i\n" "${ date '+%T' ; }" max_prime 1>&2
+
+for (( n=3 ; n < max_prime ; n+=2 )) ; do
+ if is_prime $n ; then
+ (( pn[num_pn++]=n ))
+ fi
+done
+
+# print results
+printf $"# %s: Calculation done, printing results:\n" "${ date '+%T' ; }" 1>&2
+
+for (( n=0 ; n < num_pn ; n++ )) ; do
+ # print prime number
+ case ${outputformat} in
+ block)
+ printf $"%i$( (( n % 8 == 0 )) && print -r '\n' || print -r ',\t')" pn[n]
+ ;;
+ line)
+ printf $"%i\n" pn[n]
+ ;;
+ *)
+ printf $"prime %i:\t%i\n" n pn[n]
+ ;;
+ esac
+done
+
+if [[ ${outputformat} == "block" ]] && (( n % 8 != 1 )); then
+ print
+fi
+
+printf $"# %s: Done.\n" "${ date '+%T' ; }" 1>&2
+
+#EOF.
diff --git a/usr/src/lib/libshell/common/scripts/rssread.sh b/usr/src/lib/libshell/common/scripts/rssread.sh
new file mode 100644
index 0000000000..fea8627178
--- /dev/null
+++ b/usr/src/lib/libshell/common/scripts/rssread.sh
@@ -0,0 +1,554 @@
+#!/usr/bin/ksh93
+
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# rssread - a simple RSS2.0 reader with RSS to XHTML to
+# plaintext conversion.
+#
+
+# Solaris needs /usr/xpg6/bin:/usr/xpg4/bin because the tools in /usr/bin are not POSIX-conformant
+export PATH=/usr/xpg6/bin:/usr/xpg4/bin:/bin:/usr/bin
+
+function printmsg
+{
+ print -u2 "$*"
+}
+
+function debugmsg
+{
+# printmsg "$*"
+true
+}
+
+function fatal_error
+{
+ print -u2 "${progname}: $*"
+ exit 1
+}
+
+# parse HTTP return code, cookies etc.
+function parse_http_response
+{
+ nameref response="$1"
+ typeset h statuscode statusmsg i
+
+ # we use '\r' as additional IFS to filter the final '\r'
+ IFS=$' \t\r' read -r h statuscode statusmsg # read HTTP/1.[01] <code>
+ [[ "$h" != ~(Eil)HTTP/.* ]] && { print -u2 -f $"%s: HTTP/ header missing\n" "$0" ; return 1 ; }
+ [[ "$statuscode" != ~(Elr)[0-9]* ]] && { print -u2 -f $"%s: invalid status code\n" "$0" ; return 1 ; }
+ response.statuscode="$statuscode"
+ response.statusmsg="$statusmsg"
+
+ # skip remaining headers
+ while IFS='' read -r i ; do
+ [[ "$i" == $'\r' ]] && break
+
+ # strip '\r' at the end
+ i="${i/~(Er)$'\r'/}"
+
+ case "$i" in
+ ~(Eli)Content-Type:.*)
+ response.content_type="${i/~(El).*:[[:blank:]]*/}"
+ ;;
+ ~(Eli)Content-Length:[[:blank:]]*[0-9]*)
+ integer response.content_length="${i/~(El).*:[[:blank:]]*/}"
+ ;;
+ ~(Eli)Transfer-Encoding:.*)
+ response.transfer_encoding="${i/~(El).*:[[:blank:]]*/}"
+ ;;
+ esac
+ done
+
+ return 0
+}
+
+function cat_http_body
+{
+ typeset emode="$1"
+ typeset hexchunksize="0"
+ integer chunksize=0
+
+ if [[ "${emode}" == "chunked" ]] ; then
+ while IFS=$'\r' read hexchunksize &&
+ [[ "${hexchunksize}" == ~(Elri)[0-9abcdef]* ]] &&
+ (( chunksize=16#${hexchunksize} )) && (( chunksize > 0 )) ; do
+ dd bs=1 count="${chunksize}" 2>/dev/null
+ done
+ else
+ cat
+ fi
+
+ return 0
+}
+
+function cat_http
+{
+ typeset protocol="${1%://*}"
+ typeset path1="${1#*://}" # "http://foo.bat.net/x/y.html" ----> "foo.bat.net/x/y.html"
+
+ typeset host="${path1%%/*}"
+ typeset path="${path1#*/}"
+ typeset port="${host##*:}"
+
+ integer netfd
+ typeset -C httpresponse # http response
+
+ # If URL did not contain a port number in the host part then look at the
+ # protocol to get the port number
+ if [[ "${port}" == "${host}" ]] ; then
+ case "${protocol}" in
+ "http") port=80 ;;
+ *) port="$(getent services "${protocol}" | sed 's/[^0-9]*//;s/\/.*//')" ;;
+ esac
+ else
+ host="${host%:*}"
+ fi
+
+ printmsg "protocol=${protocol} port=${port} host=${host} path=${path}"
+
+ # prechecks
+ [[ "${protocol}" == "" ]] && { print -u2 -f "%s: protocol not set.\n" "$0" ; return 1 ; }
+ [[ "${port}" == "" ]] && { print -u2 -f "%s: port not set.\n" "$0" ; return 1 ; }
+ [[ "${host}" == "" ]] && { print -u2 -f "%s: host not set.\n" "$0" ; return 1 ; }
+ [[ "${path}" == "" ]] && { print -u2 -f "%s: path not set.\n" "$0" ; return 1 ; }
+
+ # open TCP channel
+ redirect {netfd}<>"/dev/tcp/${host}/${port}"
+ (( $? != 0 )) && { print -u2 -f "%s: Couldn't open %s\n" "$0" "${1}" ; return 1 ; }
+
+ # send HTTP request
+ request="GET /${path} HTTP/1.1\r\n"
+ request+="Host: ${host}\r\n"
+ request+="User-Agent: rssread/ksh93 (2008-10-14; $(uname -s -r -p))\r\n"
+ request+="Connection: close\r\n"
+ print -n -- "${request}\r\n" >&${netfd}
+
+ # collect response and send it to stdout
+ parse_http_response httpresponse <&${netfd}
+ cat_http_body "${httpresponse.transfer_encoding}" <&${netfd}
+
+ # close connection
+ redirect {netfd}<&-
+
+ return 0
+}
+
+function html_entity_to_ascii
+{
+ typeset buf
+ typeset entity
+ typeset c
+ typeset value
+
+ # Todo: Add more HTML/MathML entities here
+ # Note we use a static variable (typeset -S) here to make sure we
+ # don't loose the cache data between calls
+ typeset -S -A entity_cache=(
+ # entity to ascii (fixme: add UTF-8 transliterations)
+ ["nbsp"]=' '
+ ["lt"]='<'
+ ["le"]='<='
+ ["gt"]='>'
+ ["ge"]='>='
+ ["amp"]='&'
+ ["quot"]='"'
+ ["apos"]="'"
+ )
+
+ buf=""
+ while IFS='' read -r -N 1 c ; do
+ if [[ "$c" != "&" ]] ; then
+ print -n -r -- "${c}"
+ continue
+ fi
+
+ entity=""
+ while IFS='' read -r -N 1 c ; do
+ case "$c" in
+ ";")
+ break
+ ;;
+ ~(Eilr)[a-z0-9#])
+ entity+="$c"
+ continue
+ ;;
+ *)
+# debugmsg "error &${entity}${c}#"
+
+ print -n -r -- "${entity}${c}"
+ entity=""
+ continue 2
+ ;;
+ esac
+ done
+
+ value=""
+ if [[ "${entity_cache["${entity}"]}" != "" ]] ; then
+# debugmsg "match #${entity}# = #${entity_cache["${entity}"]}#"
+ value="${entity_cache["${entity}"]}"
+ else
+ if [[ "${entity:0:1}" == "#" ]] ; then
+ # decimal literal
+ value="${ printf "\u[${ printf "%x" "${entity:1:8}" ; }]" ; }"
+ elif [[ "${entity:0:7}" == ~(Eilr)[0-9a-f]* ]] ; then
+ # hexadecimal literal
+ value="${ printf "\u[${entity:0:7}]" ; }"
+ else
+ # unknown literal - pass-through
+ value="ENT=|${entity}|"
+ fi
+
+ entity_cache["${entity}"]="${value}"
+
+# debugmsg "lookup #${entity}# = #${entity_cache["${entity}"]}#"
+ fi
+
+ printf "%s" "${value}"
+ done
+
+ return 0
+}
+
+# dumb xhtml handler - no CSS, tables, images, iframes or nested
+# structures are supported (and we assume that the input is correct
+# xhtml). The code was written in a trial&&error manner and should be
+# rewritten to parse xhtml correctly.
+function handle_html
+{
+ # we can't use global variables here when multiple callbacks use the same
+ # callback function - but we can use the callback associative array for
+ # variable storage instead
+ nameref callbacks=${1}
+ typeset tag_type="$2"
+ typeset tag_value="$3"
+
+ case "${tag_type}" in
+ tag_begin)
+ case "${tag_value}" in
+ br) printf "\n" ;;
+ hr) printf "\n-------------------------------------\n" ;;
+ pre) callbacks["html_pre"]='true' ;;
+ p) printf "\n" ;;
+ esac
+ ;;
+
+ tag_end)
+ case "${tag_value}" in
+ pre) callbacks["html_pre"]='false' ;;
+ esac
+ ;;
+
+ tag_text)
+ if ${callbacks["html_pre"]} ; then
+ printf "%s" "${tag_value}"
+ else
+ # compress spaces/newlines/tabs/etc.
+ printf "%s" "${tag_value//+([\n\r\t\v[:space:][:blank:]])/ }"
+ fi
+ ;;
+
+ document_start)
+ callbacks["html_pre"]='false'
+ ;;
+ document_end) ;;
+ esac
+
+ return 0
+}
+
+function handle_rss
+{
+ # we can't use global variables here when multiple callbacks use the same
+ # callback function - but we can use the callback associative array for
+ # variable storage instead
+ nameref callbacks=${1}
+ typeset tag_type="$2"
+ typeset tag_value="$3"
+
+ case "${tag_type}" in
+ tag_begin)
+ case "${tag_value}" in
+ item)
+ item["title"]=""
+ item["link"]=""
+ item["tag"]=""
+ item["description"]=""
+ ;;
+ esac
+ callbacks["textbuf"]=""
+ ;;
+ tag_end)
+ case "${tag_value}" in
+ item)
+ # note that each RSS item needs to be converted seperately from RSS to HTML to plain text
+ # to make sure that the state of one RSS item doesn't affect others
+ (
+ printf $"<br />#### RSS item: title: %s ####" "${item["title"]}"
+ printf $"<br />## author: %s" "${item["author"]}"
+ printf $"<br />## link: %s" "${item["link"]}"
+ printf $"<br />## date: %s" "${item["pubDate"]}"
+ printf $"<br />## begin description:"
+ printf $"<br />%s<br />" "${item["description"]}"
+ printf $"<br />## end description<br />"
+ print # extra newline to make sure the sed pipeline gets flushed
+ ) |
+ html_entity_to_ascii | # convert XML entities (e.g. decode RSS content to HTML code)
+ xml_tok "xhtmltok_cb" | # convert HTML to plain text
+ html_entity_to_ascii # convert HTML entities
+ ;;
+ title) item["title"]="${callbacks["textbuf"]}" ; callbacks["textbuf"]="" ;;
+ link) item["link"]="${callbacks["textbuf"]}" ; callbacks["textbuf"]="" ;;
+ dc:creator | author) item["author"]="${callbacks["textbuf"]}" ; callbacks["textbuf"]="" ;;
+ dc:date | pubDate) item["pubDate"]="${callbacks["textbuf"]}" ; callbacks["textbuf"]="" ;;
+ description) item["description"]="${callbacks["textbuf"]}" ; callbacks["textbuf"]="" ;;
+ esac
+ callbacks["textbuf"]=""
+ ;;
+ tag_text)
+ callbacks["textbuf"]+="${tag_value}"
+ ;;
+ document_start) ;;
+ document_end) ;;
+ esac
+ return 0
+}
+
+function xml_tok
+{
+ typeset buf=""
+ typeset namebuf=""
+ typeset attrbuf=""
+ typeset c=""
+ typeset isendtag # bool: true/false
+ typeset issingletag # bool: true/false (used for tags like "<br />")
+ nameref callbacks=${1}
+
+ [[ ! -z "${callbacks["document_start"]}" ]] && ${callbacks["document_start"]} "${1}" "document_start"
+
+ while IFS='' read -r -N 1 c ; do
+ isendtag=false
+
+ if [[ "$c" == "<" ]] ; then
+ # flush any text content
+ if [[ "$buf" != "" ]] ; then
+ [[ ! -z "${callbacks["tag_text"]}" ]] && ${callbacks["tag_text"]} "${1}" "tag_text" "$buf"
+ buf=""
+ fi
+
+ IFS='' read -r -N 1 c
+ if [[ "$c" == "/" ]] ; then
+ isendtag=true
+ else
+ buf="$c"
+ fi
+ IFS='' read -r -d '>' c
+ buf+="$c"
+
+ # handle comments
+ if [[ "$buf" == ~(El)!-- ]] ; then
+ # did we read the comment completely ?
+ if [[ "$buf" != ~(Elr)!--.*-- ]] ; then
+ buf+=">"
+ while [[ "$buf" != ~(Elr)!--.*-- ]] ; do
+ IFS='' read -r -N 1 c || break
+ buf+="$c"
+ done
+ fi
+
+ [[ ! -z "${callbacks["tag_comment"]}" ]] && ${callbacks["tag_comment"]} "${1}" "tag_comment" "${buf:3:${#buf}-5}"
+ buf=""
+ continue
+ fi
+
+ # check if the tag starts and ends at the same time (like "<br />")
+ if [[ "${buf}" == ~(Er).*/ ]] ; then
+ issingletag=true
+ buf="${buf%*/}"
+ else
+ issingletag=false
+ fi
+
+ # check if the tag has attributes (e.g. space after name)
+ if [[ "$buf" == ~(E)[[:space:][:blank:]] ]] ; then
+ namebuf="${buf%%~(E)[[:space:][:blank:]].*}"
+ attrbuf="${buf#~(E).*[[:space:][:blank:]]}"
+ else
+ namebuf="$buf"
+ attrbuf=""
+ fi
+
+ if ${isendtag} ; then
+ [[ ! -z "${callbacks["tag_end"]}" ]] && ${callbacks["tag_end"]} "${1}" "tag_end" "$namebuf"
+ else
+ [[ ! -z "${callbacks["tag_begin"]}" ]] && ${callbacks["tag_begin"]} "${1}" "tag_begin" "$namebuf" "$attrbuf"
+
+ # handle tags like <br/> (which are start- and end-tag in one piece)
+ if ${issingletag} ; then
+ [[ ! -z "${callbacks["tag_end"]}" ]] && ${callbacks["tag_end"]} "${1}" "tag_end" "$namebuf"
+ fi
+ fi
+ buf=""
+ else
+ buf+="$c"
+ fi
+ done
+
+ [[ ! -z "${callbacks["document_end"]}" ]] && ${callbacks["document_end"]} "${1}" "document_end" "exit_success"
+
+ print # final newline to make filters like "sed" happy
+}
+
+# return the value of LC_MESSAGES needed for subprocesses which
+# want to run in a different locale/encoding
+function get_lc_messages
+{
+ [[ "${LC_ALL}" != "" ]] && { print "${LC_ALL}" ; return 0 ; }
+ [[ "${LC_MESSAGES}" != "" ]] && { print "${LC_MESSAGES}" ; return 0 ; }
+ [[ "${LANG}" != "" ]] && { print "${LANG}" ; return 0 ; }
+ print "C" ; return 0
+}
+
+function do_rssread
+{
+ # set unicode locale since RSS is encoded in UTF-8
+ # (and make sure $LC_MESSAGES is set to the parent
+ # process's locale that all error messages are using
+ # the callers locale/encoding)
+ export \
+ LC_MESSAGES="${ get_lc_messages ; }" \
+ LC_MONETARY="en_US.UTF-8" \
+ LC_NUMERIC="en_US.UTF-8" \
+ LC_COLLATE="en_US.UTF-8" \
+ LC_CTYPE="en_US.UTF-8" \
+ LC_TIME="en_US.UTF-8" \
+ LANG="en_US.UTF-8"
+
+ # need extra newline after cat_http to terminate line with $'\n'
+ # to make "xml_tok" happy
+ { cat_http "$1" ; print ; } |
+ xml_tok "rsstok_cb"
+ return 0
+}
+
+function usage
+{
+ OPTIND=0
+ getopts -a "${progname}" "${rssread_usage}" OPT '-?'
+ exit 2
+}
+
+# make sure we use the ksh93 builtin versions
+builtin basename
+builtin cat
+
+typeset -A rsstok_cb # callbacks for xml_tok
+rsstok_cb["tag_begin"]="handle_rss"
+rsstok_cb["tag_end"]="handle_rss"
+rsstok_cb["tag_text"]="handle_rss"
+rsstok_cb["textbuf"]=""
+
+typeset -A xhtmltok_cb # callbacks for xml_tok
+xhtmltok_cb["tag_begin"]="handle_html"
+xhtmltok_cb["tag_end"]="handle_html"
+xhtmltok_cb["tag_text"]="handle_html"
+xhtmltok_cb["textbuf"]=""
+xhtmltok_cb["html_pre"]='false'
+
+typeset -A item
+
+typeset -A bookmark_urls
+
+# "ramdom" urls for testing
+bookmark_urls=(
+ ["google_blogs_ksh"]="http://blogsearch.google.com/blogsearch_feeds?hl=en&scoring=d&q=(%22ksh93%22%7C%22ksh+93%22+%7C+%22korn93%22+%7C+%22korn+93%22)&ie=utf-8&num=100&output=rss"
+ # OpenSolaris.org sites
+ ["ksh93_integration"]="http://www.opensolaris.org/rss/os/project/ksh93-integration/announcements/rss2.xml"
+ ["shell"]="http://www.opensolaris.org/rss/os/project/shell/announcements/rss2.xml"
+ ["systemz"]="http://www.opensolaris.org/rss/os/project/systemz/announcements/rss2.xml"
+ # some Sun staff/sites
+ ["blogs_sun_com"]="http://blogs.sun.com/main/feed/entries/rss"
+ ["bigadmin"]="http://www.sun.com/bigadmin/content/rss/motd.xml"
+ ["jmcp"]="http://www.jmcp.homeunix.com/roller/jmcp/feed/entries/rss"
+ ["katakai"]="http://blogs.sun.com/katakai/feed/entries/rss"
+ ["alanc"]="http://blogs.sun.com/alanc/feed/entries/rss"
+ ["planetsun"]="http://www.planetsun.org/rss20.xml"
+ ["planetsolaris"]="http://www.planetsolaris.org/rss20.xml"
+ ["planetopensolaris"]="http://planet.opensolaris.org/rss20.xml"
+ ["theregister_uk"]="http://www.theregister.co.uk/headlines.rss"
+ ["heise"]="http://www.heise.de/newsticker/heise.rdf"
+ ["slashdot"]="http://rss.slashdot.org/Slashdot/slashdot"
+)
+
+typeset progname="${ basename "${0}" ; }"
+
+typeset -r rssread_usage=$'+
+[-?\n@(#)\$Id: rssread (Roland Mainz) 2008-11-10 \$\n]
+[-author?Roland Mainz <roland.mainz@sun.com>]
+[-author?Roland Mainz <roland.mainz@nrubsig.org>]
+[+NAME?rssread - fetch RSS messages and convert them to plain text]
+[+DESCRIPTION?\brssread\b RSS to plain text converter
+ which fetches RSS streams via HTTP and converts them from
+ RSS to HTML to plain text in the current locale/encoding.]
+[I:noiconv?Do not convert data from UTF-8 to current locale/encoding.]
+
+[ url ]
+
+[+SEE ALSO?\bksh93\b(1), \bshnote\b(1)]
+'
+
+typeset noiconv=false
+
+while getopts -a "${progname}" "${rssread_usage}" OPT ; do
+# printmsg "## OPT=|${OPT}|, OPTARG=|${OPTARG}|"
+ case ${OPT} in
+ I) noiconv=true ;;
+ +I) noiconv=false ;;
+ *) usage ;;
+ esac
+done
+shift $((OPTIND-1))
+
+typeset url="$1"
+
+if [[ "${url}" == "" ]] ; then
+ fatal_error $"No url given."
+fi
+
+if [[ "${bookmark_urls[${url}]}" != "" ]] ; then
+ printmsg $"Using bookmark ${url} = ${bookmark_urls[${url}]}"
+ url="${bookmark_urls[${url}]}"
+fi
+
+if ${noiconv} ; then
+ do_rssread "${url}"
+else
+ do_rssread "${url}" | iconv -f "UTF-8" - -
+fi
+
+exit 0
+#EOF.
diff --git a/usr/src/lib/libshell/common/scripts/shcalc.sh b/usr/src/lib/libshell/common/scripts/shcalc.sh
new file mode 100644
index 0000000000..db7149a0bd
--- /dev/null
+++ b/usr/src/lib/libshell/common/scripts/shcalc.sh
@@ -0,0 +1,151 @@
+#!/usr/bin/ksh93
+
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# shcalc - small shell-based calculator
+#
+
+# Solaris needs /usr/xpg6/bin:/usr/xpg4/bin because the tools in /usr/bin are not POSIX-conformant
+export PATH=/usr/xpg6/bin:/usr/xpg4/bin:/bin:/usr/bin
+
+# Make sure all math stuff runs in the "C" locale to avoid problems
+# with alternative # radix point representations (e.g. ',' instead of
+# '.' in de_DE.*-locales). This needs to be set _before_ any
+# floating-point constants are defined in this script).
+if [[ "${LC_ALL}" != "" ]] ; then
+ export \
+ LC_MONETARY="${LC_ALL}" \
+ LC_MESSAGES="${LC_ALL}" \
+ LC_COLLATE="${LC_ALL}" \
+ LC_CTYPE="${LC_ALL}"
+ unset LC_ALL
+fi
+export LC_NUMERIC=C
+
+function fatal_error
+{
+ print -u2 "${progname}: $*"
+ exit 1
+}
+
+function do_calculate
+{
+ typeset calcline="$1"
+ float x=0.0
+
+ printf "(( x=( %s ) ))\n" "${calcline}" | source /dev/stdin
+ if (( $? != 0 )) ; then
+ print -f $"%s: Syntax error in %s\n" "${progname}" "${calcline}"
+ return 1
+ fi
+
+ printf "%s == %.40g\n" "${calcline}" x
+
+ return 0
+}
+
+function usage
+{
+ OPTIND=0
+ getopts -a "${progname}" "${shcalc_usage}" OPT '-?'
+ exit 2
+}
+
+# program start
+# (be carefull with builtins here - they are unconditionally available
+# in the shell's "restricted" mode)
+builtin basename
+builtin sum
+
+typeset progname="${ basename "${0}" ; }"
+
+typeset -r shcalc_usage=$'+
+[-?\n@(#)\$Id: shcalc (Roland Mainz) 2008-11-03 \$\n]
+[-author?Roland Mainz <roland.mainz@nrubsig.org>]
+[+NAME?shcalc - simple shell calculator]
+[+DESCRIPTION?\bsshcalc\b is a small calculator application which
+ prints the results of ISO C99 math expressions read from either
+ arguments or stdin if no arguments are given.]
+[+SEE ALSO?\bksh93\b(1),\bceil\b(3M), \bcopysign\b(3M), \bcos\b(3M),
+ \bcosh\b(3M), \berf\b(3M), \berfc\b(3M), \bexp\b(3M),
+ \bexp2\b(3M), \bexpm1\b(3M), \bfabs abs\b(3M), \bfdim\b(3M),
+ \bfinite\b(3M), \bfloor int\b(3M), \bfma\b(3M), \bfmax\b(3M), \bfmin\b(3M),
+ \bfmod\b(3M), \bfpclassify\b(3M), \bhypot\b(3M), \bilogb\b(3M),
+ \bisfinite\b(3M), \bisgreater\b(3M), \bisgreaterequal\b(3M), \bisinf\b(3M),
+ \bisless\b(3M), \bislessequal\b(3M), \bislessgreater\b(3M), \bisnan\b(3M),
+ \bisnormal\b(3M), \bissubnormal\b(3M), \bisunordered\b(3M), \biszero\b(3M),
+ \blgamma\b(3M), \blog\b(3M), \blog1p\b(3M), \blog2\b(3M),
+ \blogb\b(3M), \bnearbyint\b(3M), \bnextafter\b(3M), \bnexttoward\b(3M),
+ \bpow\b(3M), \bremainder\b(3M), \brint\b(3M), \bround\b(3M),
+ \bscalb\b(3M), \bscalbn\b(3M), \bsignbit\b(3M), \bsin\b(3M),
+ \bsinh\b(3M), \bsqrt\b(3M), \btan\b(3M), \btanh\b(3M),
+ \btgamma\b(3M), \btrunc\b(3M)]
+'
+while getopts -a "${progname}" "${shcalc_usage}" OPT ; do
+# printmsg "## OPT=|${OPT}|, OPTARG=|${OPTARG}|"
+ case ${OPT} in
+ *) usage ;;
+ esac
+done
+shift $((OPTIND-1))
+
+integer res
+
+if (( $# == 0 )) ; then
+ # No arguments ? Switch to interactive mode...
+
+ # make sure "read" below uses "gmacs"-like editor keys and "multiline" mode
+
+ set -o gmacs
+ set -o multiline
+
+ while read "calcline?calc> " ; do
+ # quit ?
+ [[ "${calcline}" == ~(Elri)(exit|quit|eof) ]] && break
+
+ # empty line ?
+ [[ "${calcline}" == ~(Elri)([[:space:]]*) ]] && continue
+
+ do_calculate "$calcline"
+ (( res=$? ))
+ done
+
+ exit ${res}
+else
+ while (( $# > 0 )) ; do
+ do_calculate "$1"
+ (( res=$? ))
+ shift
+ done
+
+ exit ${res}
+fi
+
+# not reached
+
+# EOF.
diff --git a/usr/src/lib/libshell/common/scripts/shircbot.sh b/usr/src/lib/libshell/common/scripts/shircbot.sh
new file mode 100644
index 0000000000..2ce067ad6c
--- /dev/null
+++ b/usr/src/lib/libshell/common/scripts/shircbot.sh
@@ -0,0 +1,429 @@
+#!/usr/bin/ksh93
+
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# shircbot - a simple IRC client/bot demo
+#
+
+# Solaris needs /usr/xpg6/bin:/usr/xpg4/bin because the tools in /usr/bin are not POSIX-conformant
+export PATH=/usr/xpg6/bin:/usr/xpg4/bin:/bin:/usr/bin
+
+# Make sure all math stuff runs in the "C" locale to avoid problems
+# with alternative # radix point representations (e.g. ',' instead of
+# '.' in de_DE.*-locales). This needs to be set _before_ any
+# floating-point constants are defined in this script).
+if [[ "${LC_ALL}" != "" ]] ; then
+ export \
+ LC_MONETARY="${LC_ALL}" \
+ LC_MESSAGES="${LC_ALL}" \
+ LC_COLLATE="${LC_ALL}" \
+ LC_CTYPE="${LC_ALL}"
+ unset LC_ALL
+fi
+export LC_NUMERIC=C
+
+function fatal_error
+{
+ print -u2 "${progname}: $*"
+ exit 1
+}
+
+# Definition for a IRC session class
+typeset -T ircsession_t=(
+ typeset -C server=(
+ typeset name
+ integer port
+ )
+
+ typeset nick="ksh93irc"
+
+ typeset running=true
+
+ integer fd=-1
+
+ function createsession
+ {
+ set -o xtrace
+
+ _.server.name=$1
+ _.server.port=$2
+ _.nick=$3
+
+ redirect {_.fd}<>"/dev/tcp/${_.server.name}/${_.server.port}"
+ (( $? == 0 )) || { print -n2 $"Could not open server connection." ; return 1 ; }
+
+ printf "fd=%d\n" _.fd
+
+ return 0
+ }
+
+ function login
+ {
+ {
+ printf "USER %s %s %s %s\n" "${_.nick}" "${_.nick}" "${_.nick}" "${_.nick}"
+ printf "NICK %s\n" "${_.nick}"
+ } >&${_.fd}
+
+ return 0
+ }
+
+ function join_channel
+ {
+ printf "JOIN %s\n" "$1" >&${_.fd}
+
+ return 0
+ }
+
+ function mainloop
+ {
+ typeset line
+ float -S last_tick=0
+ # We use the linebuf_t class here since network traffic
+ # isn't guranteed to fit a single $'\n'-terminated line
+ # into one TCP package. linebuf_t buffers characters
+ # until it has one complete line. This avoids the need for
+ # async I/O normally used by IRC clients
+ linebuf_t serverbuf
+ linebuf_t clientbuf
+ integer fd=${_.fd}
+
+ set -o xtrace
+
+ _.login
+
+ while ${_.running} ; do
+ while serverbuf.readbuf line <&${fd} ; do
+ _.dispatch_serverevent "$line"
+ done
+
+ while clientbuf.readbuf line </dev/stdin ; do
+ printf "client: %q\n" "${line}"
+ printf "%s\n" "${line}" >&${fd}
+ done
+
+ # call mainloop_tick function in intervals to handle
+ # async events (e.g. automatic /join etc.)
+ if (( (SECONDS-last_tick) > 5. )) ; then
+ (( last_tick=SECONDS ))
+ _.mainloop_tick
+ fi
+ done
+
+ return 0
+ }
+
+ function mainloop_tick
+ {
+ return 0
+ }
+
+ function dispatch_serverevent
+ {
+ typeset line="$1"
+
+ case "${line}" in
+ ~(El)PING)
+ typeset -C ping_args=(
+ line="$line"
+ )
+ _.serverevent_ping "ping_args"
+ ;;
+ ~(El):.*\ PRIVMSG)
+ typeset -C privmsg_args=(
+ typeset line="$line"
+ typeset msguser="${line/~(Elr)([^ ]+) ([^ ]+) ([^ ]+) (.*)/\1}"
+ typeset msgchannel="${line/~(Elr)([^ ]+) ([^ ]+) ([^ ]+) (.*)/\3}"
+ typeset msg="${line/~(Elr)([^ ]+) ([^ ]+) ([^ ]+) (.*)/\4}"
+ )
+ _.serverevent_privmsg "privmsg_args"
+ ;;
+ ~(El):.*\ INVITE)
+ typeset -C invite_args=(
+ typeset line="$line"
+ typeset inviteuser="${line/~(Elr)([^ ]+) ([^ ]+) ([^ ]+) (.*)/\1}"
+ typeset invitenick="${line/~(Elr)([^ ]+) ([^ ]+) ([^ ]+) (.*)/\3}"
+ typeset invitechannel="${line/~(Elr)([^ ]+) ([^ ]+) ([^ ]+) (.*)/\4}"
+ )
+ _.serverevent_invite "invite_args"
+ ;;
+ *)
+ printf "server: %q\n" "${line}"
+ ;;
+ esac
+
+ return 0
+ }
+
+ function serverevent_privmsg
+ {
+ nameref args=$1
+ typeset msguser="${args.msguser}"
+ typeset msgchannel="${args.msgchannel}"
+ typeset msg="${args.msg}"
+
+ printf "#privms: user=%q, channel=%q, msg=%q\n" "$msguser" "$msgchannel" "$msg"
+
+ return 0
+ }
+
+ function serverevent_invite
+ {
+ nameref args=$1
+
+ printf "JOIN %s\n" "${args.invitechannel/:/}" >&${_.fd}
+
+ return 0
+ }
+
+ function send_privmsg
+ {
+ typeset channel="$1"
+ typeset msg="$2"
+
+ # Do we have to escape any characters in "msg" ?
+ printf "PRIVMSG %s :%s\n" "${channel}" "${msg}" >&${_.fd}
+
+ return 0
+ }
+
+ function serverevent_ping
+ {
+ nameref args=$1
+
+ printf "PONG %s\n" "${args.line/~(Elr)([^ ]+) ([^ ]+).*/\2}" >&${_.fd}
+
+ return 0
+ }
+)
+
+# line buffer class
+# The buffer class tries to read characters from the given <fd> until
+# it has read a whole line.
+typeset -T linebuf_t=(
+ typeset buf
+
+ function reset
+ {
+ _.buf=""
+ return 0
+ }
+
+ function readbuf
+ {
+ nameref var=$1
+ typeset ch
+
+ while IFS='' read -t 0.2 -N 1 ch ; do
+ [[ "$ch" == $'\r' ]] && continue
+
+ if [[ "$ch" == $'\n' ]] ; then
+ var="${_.buf}"
+ _.reset
+ return 0
+ fi
+
+ _.buf+="$ch"
+ done
+
+ return 1
+ }
+)
+
+function usage
+{
+ OPTIND=0
+ getopts -a "${progname}" "${shircbot_usage}" OPT '-?'
+ exit 2
+}
+
+# program start
+# (be carefull with builtins here - they are unconditionally available
+# in the shell's "restricted" mode)
+builtin basename
+builtin sum
+
+typeset progname="${ basename "${0}" ; }"
+
+typeset -r shircbot_usage=$'+
+[-?\n@(#)\$Id: shircbot (Roland Mainz) 2008-10-31 \$\n]
+[-author?Roland Mainz <roland.mainz@sun.com>]
+[-author?Roland Mainz <roland.mainz@nrubsig.org>]
+[+NAME?shircbot - simple IRC bot demo]
+[+DESCRIPTION?\bshircbot\b is a small demo IRC bot which provides
+ a simple IRC bot with several subcommands.]
+[n:nickname?IRC nickname for this bot.]:[nick]
+[s:ircserver?IRC servername.]:[servername]
+[j:joinchannel?IRC servername.]:[channelname]
+[+SEE ALSO?\bksh93\b(1)]
+'
+
+typeset -C config=(
+ typeset nickname="${LOGNAME}bot"
+ typeset servername="irc.freenode.net"
+ integer port=6667
+ typeset -a join_channels
+)
+
+while getopts -a "${progname}" "${shircbot_usage}" OPT ; do
+# printmsg "## OPT=|${OPT}|, OPTARG=|${OPTARG}|"
+ case ${OPT} in
+ n) config.nickname="${OPTARG}" ;;
+ s) config.servername="${OPTARG}" ;;
+ j) config.join_channels+=( "${OPTARG}" ) ;;
+ *) usage ;;
+ esac
+done
+shift $((OPTIND-1))
+
+# if no channel was provided we join a predefined set of channels
+if (( ${#config.join_channels[@]} == 0 )) ; then
+ if [[ "${config.servername}" == "irc.freenode.net" ]] ; then
+ config.join_channels+=( "#opensolaris" )
+ config.join_channels+=( "#opensolaris-dev" )
+ config.join_channels+=( "#opensolaris-arc" )
+ config.join_channels+=( "#ksh" )
+ elif [[ "${config.servername}" == ~(E)irc.(sfbay|sweden) ]] ; then
+ config.join_channels+=( "#onnv" )
+ fi
+fi
+
+print "## Start."
+
+ircsession_t mybot
+
+# override ircsession_t::serverevent_privmsg with a new method for our bot
+function mybot.serverevent_privmsg
+{
+ nameref args=$1
+ typeset msguser="${args.msguser}"
+ typeset msgchannel="${args.msgchannel}"
+ typeset msg="${args.msg}"
+
+ printf "#message: user=%q, channel=%q, msg=%q\n" "$msguser" "$msgchannel" "$msg"
+
+ # Check if we get a private message
+ if [[ "${msgchannel}" == "${_.nick}" ]] ; then
+ # ${msgchannel} point to our own nick if we got a private message,
+ # we need to extract the sender's nickname from ${msguser} and put
+ # it into msgchannel
+ msgchannel="${msguser/~(El):(.*)!.*/\1}"
+ else
+ # check if this is a command for this bot
+ [[ "$msg" != ~(Eli):${_.nick}:[[:space:]] ]] && return 0
+ fi
+
+ # strip beginning (e.g. ":<nick>:" or ":") plus extra spaces
+ msg="${msg/~(Eli)(:${_.nick})*:[[:space:]]*/}"
+
+ printf "botmsg=%q\n" "$msg"
+
+ case "$msg" in
+ ~(Eli)date)
+ _.send_privmsg "$msgchannel" "$(
+ ( printf "%(%Y-%m-%d, %Th/%Z)T\n" )
+ )"
+ ;;
+ ~(Eli)echo)
+ _.send_privmsg "$msgchannel" "${msg#*echo}"
+ ;;
+ ~(Eli)exitbot)
+ typeset exitkey="$(print "$msguser" | sum -x sha1)" # this is unwise&&insecure
+ if [[ "$msg" == *${exitkey}* ]] ; then
+ _.running=false
+ fi
+ ;;
+ ~(Eli)help)
+ _.send_privmsg "$msgchannel" "$(
+ printf "Hello, this is shircbot, written in ksh93 (%s). " "${.sh.version}"
+ printf "Subcommands are 'say hello', 'math <math-expr>', 'stocks', 'uuid', 'date' and 'echo'."
+ )"
+ ;;
+ ~(Eli)math)
+ if [[ "${msg}" == ~(E)[\`\$] ]] ; then
+ # "restricted" shell mode would prevent any damage but we try to be carefull...
+ _.send_privmsg "$msgchannel" "Syntax error."
+ else
+ typeset mathexpr="${msg#*math}"
+
+ printf "Calculating '%s'\n" "${mathexpr}"
+ _.send_privmsg "$msgchannel" "$(
+ ( printf 'export PATH=/usr/$RANDOM/foo ; set -o restricted ; printf "%%s = %%.40g\n" "%s" $(( %s ))\n' "${mathexpr}" "${mathexpr}" | source /dev/stdin 2>&1 )
+ )"
+ fi
+ ;;
+ ~(Eli)say\ hello)
+ _.send_privmsg "$msgchannel" "Hello, this is a bot."
+ ;;
+ ~(Eli)stocks)
+ typeset stockmsg tickersymbol
+ for tickersymbol in "JAVA" "IBM" "AAPL" "HPQ" ; do
+ stockmsg="$( /usr/sfw/bin/wget -q -O /dev/stdout "http://quote.yahoo.com/d/quotes.csv?f=sl1d1t1c1ohgv&e=.csv&s=${tickersymbol}" 2>&1 )"
+ _.send_privmsg "$msgchannel" "${tickersymbol}: ${stockmsg//,/ }"
+ done
+ ;;
+ ~(Eli)uuid)
+ _.send_privmsg "$msgchannel" "$(
+ ( print "%(%Y%M%D%S%N)T$((RANDOM))%s\n" "${msguser}" | sum -x sha256 )
+ )"
+ ;;
+ esac
+
+ return 0
+}
+
+# Automatically join the list of channels listed in |config.join_channels|
+# after the client is connected to the server for some time
+function mybot.mainloop_tick
+{
+ integer -S autojoin_done=2
+ integer i
+
+ if (( autojoin_done-- == 0 && ${#config.join_channels[@]} > 0 )) ; then
+ print "# Autojoin channels..."
+
+ for ((i=0 ; i < ${#config.join_channels[@]} ; i++ )) ; do
+ mybot.join_channel "${config.join_channels[i]}"
+ done
+ fi
+
+ return 0
+}
+
+mybot.createsession "${config.servername}" ${config.port} "${config.nickname}"
+
+# This is a network-facing application - once we've set eveything up
+# we set PATH to a random value and switch to the shell's restricted
+# mode to make sure noone can escape the jail.
+#export PATH=/usr/$RANDOM/foo
+#set -o restricted
+
+mybot.mainloop
+
+print "## End."
+
+exit 0
diff --git a/usr/src/lib/libshell/common/scripts/shlint.sh b/usr/src/lib/libshell/common/scripts/shlint.sh
new file mode 100644
index 0000000000..640fb14837
--- /dev/null
+++ b/usr/src/lib/libshell/common/scripts/shlint.sh
@@ -0,0 +1,94 @@
+#!/usr/bin/ksh93
+
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# shlint - a simple lint wrapper around "shcomp"
+#
+
+# Solaris needs /usr/xpg6/bin:/usr/xpg4/bin because the tools in /usr/bin are not POSIX-conformant
+export PATH=/usr/xpg6/bin:/usr/xpg4/bin:/bin:/usr/bin
+
+# Make sure all math stuff runs in the "C" locale to avoid problems
+# with alternative # radix point representations (e.g. ',' instead of
+# '.' in de_DE.*-locales). This needs to be set _before_ any
+# floating-point constants are defined in this script).
+if [[ "${LC_ALL}" != "" ]] ; then
+ export \
+ LC_MONETARY="${LC_ALL}" \
+ LC_MESSAGES="${LC_ALL}" \
+ LC_COLLATE="${LC_ALL}" \
+ LC_CTYPE="${LC_ALL}"
+ unset LC_ALL
+fi
+export LC_NUMERIC=C
+
+function fatal_error
+{
+ print -u2 "${progname}: $*"
+ exit 1
+}
+
+function usage
+{
+ OPTIND=0
+ getopts -a "${progname}" "${shlint_usage}" OPT '-?'
+ exit 2
+}
+
+# program start
+builtin basename
+
+typeset progname="${ basename "${0}" ; }"
+
+typeset -r shlint_usage=$'+
+[-?\n@(#)\$Id: shlint (Roland Mainz) 2008-10-14 \$\n]
+[-author?Roland Mainz <roland.mainz@sun.com>]
+[-author?Roland Mainz <roland.mainz@nrubsig.org>]
+[+NAME?shlint - lint for POSIX shell scripts]
+[+DESCRIPTION?\bshlint\b is a lint for POSIX shell scripts.]
+[+SEE ALSO?\bshcomp\b(1), \bksh93\b(1)]
+'
+
+while getopts -a "${progname}" "${shlint_usage}" OPT ; do
+# printmsg "## OPT=|${OPT}|, OPTARG=|${OPTARG}|"
+ case ${OPT} in
+ *) usage ;;
+ esac
+done
+shift $((OPTIND-1))
+
+file="$1"
+[[ ! -f "$file" ]] && fatal_error $"File ${file} not found."
+[[ ! -r "$file" ]] && fatal_error $"File ${file} not readable."
+
+x="$( /usr/bin/ksh93 -n "${file}" 2>&1 1>/dev/null )"
+
+printf "%s" "$x"
+
+[[ "$x" != "" ]] && exit 1 || exit 0
+# EOF.
diff --git a/usr/src/lib/libshell/common/scripts/shman.sh b/usr/src/lib/libshell/common/scripts/shman.sh
new file mode 100644
index 0000000000..57e57cec23
--- /dev/null
+++ b/usr/src/lib/libshell/common/scripts/shman.sh
@@ -0,0 +1,388 @@
+#!/usr/bin/ksh93
+
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+# Solaris needs /usr/xpg6/bin:/usr/xpg4/bin because the tools in /usr/bin are not POSIX-conformant
+export PATH=/usr/xpg6/bin:/usr/xpg4/bin:/bin:/usr/bin
+
+# Make sure all math stuff runs in the "C" locale to avoid problems
+# with alternative # radix point representations (e.g. ',' instead of
+# '.' in de_DE.*-locales). This needs to be set _before_ any
+# floating-point constants are defined in this script).
+if [[ "${LC_ALL}" != "" ]] ; then
+ export \
+ LC_MONETARY="${LC_ALL}" \
+ LC_MESSAGES="${LC_ALL}" \
+ LC_COLLATE="${LC_ALL}" \
+ LC_CTYPE="${LC_ALL}"
+ unset LC_ALL
+fi
+export LC_NUMERIC=C
+
+function fatal_error
+{
+ print -u2 "${progname}: $*"
+ exit 1
+}
+
+function debug_print
+{
+ # don't use "--" here to allow "-f" for formatting
+# print -u2 "$@"
+ return 0
+}
+
+# Build a list of compound variables calculated from MANPATH and
+# locale which contain...
+# "manpath_element" - the MANPATH element this entry belongs to
+# "dir" - physical directory of "manpath_element"
+# "sect" - section (if "manpath_element" is something like /usr/share/man,1b)
+# ... and put the result in the array named by argv[1]
+function enumerate_mandirs
+{
+ nameref md=$1
+ typeset manpath_element dir sect manlang
+ integer i=0
+
+ if [[ "${LC_MESSAGES}" != "" ]] ; then
+ manlang="${LC_MESSAGES}"
+ else
+ manlang="${LANG}"
+ fi
+
+ print -r -- "${MANPATH//:/$'\n'}" | while read manpath_element ; do
+ # strip section from manpath elements like "/usr/share/man,1b"
+ dir="${manpath_element/~(E)(.*),(.*)/\1}"
+ sect="${manpath_element/~(E)(.*),(.*)/\2}"
+ [[ "${sect}" == "${dir}" ]] && sect=""
+
+ if [[ "${manlang}" != "" && -d "${dir}/${manlang}" ]] ; then
+ md+=(
+ manpath_element="${manpath_element}"
+ dir="${dir}/${manlang}"
+ sect="${sect}"
+ )
+ fi
+ if [[ -d "${dir}" ]] ; then
+ md+=(
+ manpath_element="${manpath_element}"
+ dir="${dir}"
+ sect="${sect}"
+ )
+ fi
+ done
+
+ return 0
+}
+
+function enumerate_mansects
+{
+ nameref ms=$1
+ nameref mandir_node=$2
+ typeset mancf="${mandir_node.dir}/man.cf"
+ typeset x s l
+
+ if [[ "${mandir_node.sect}" != "" ]] ; then
+ x="${mandir_node.sect}"
+ elif [[ "${MANSECTS}" != "" ]] ; then
+ x="${MANSECTS//,/$'\n'}"
+ elif [[ -f "${mancf}" && -r "${mancf}" ]] ; then
+ x="$(egrep -v '^#|^[[:space:]]*$' <"${mancf}" | egrep '^MANSECTS=')"
+ x="${x/MANSECTS=}/"
+ x="${x//,/$'\n'}"
+ else
+ x="$(cd "${mandir_node.dir}" ; \
+ ls -1d ~(El)(sman|man).*/ | \
+ while read s ; do \
+ s="${s/~(El)(sman|man)/}" ; \
+ s="${s/~(Er)\//}" ; \
+ print -r -- "$s" ; \
+ done)"
+ fi
+
+ while read l ; do
+ [[ "${l}" != ~(Elr)[[:blank:]]* ]] && ms+=( "${l}" )
+# print -- "sect=$l"
+ done <<<"${x}"
+
+# printf "enumerate_mansects: found %d entries.\n" ${#ms[@]}
+
+ return 0
+}
+
+# wrapper around more/less
+function browse_manpage
+{
+ typeset tmpdirname
+ typeset doc_filename="$1"
+ typeset doc_title="$2"
+
+ # squish characters in filename which are not allowed in a filesystem
+ # (currently '/')
+ doc_title="${doc_title//\//}"
+
+ # check if we have "less" installed, if not fall back to /usr/xpg4/bin/more
+ if which less >/dev/null 2>&1 ; then
+ # use "cat" here to avoid that "less" may try funny things
+ cat <"${doc_filename}" | less -I -M $"--prompt=MManual\ page\ ${doc_title}\ ?ltline\ %lt?L/%L.:"
+ else
+ tmpdirname="$(mktemp -d "/tmp/shman_${PPID}_$$_XXXXXX")"
+
+ mkdir -p "${tmpdirname}" || { print -u2 -f $"Couldn't create tmp. dir %s\n" "${tmpdirname}" ; return 1 ; }
+
+ (
+ cd "${tmpdirname}"
+
+ # note: we need to support /dev/stdin
+ cat <"${doc_filename}" >"./${doc_title}"
+
+ /usr/xpg4/bin/more "${doc_title}"
+
+ rm -f "${doc_title}"
+ )
+
+ rmdir "${tmpdirname}"
+ fi
+
+ return 0
+}
+
+# /usr/bin/man <keyword>
+function show_manpage
+{
+ typeset -a -C mandirs
+ integer i
+ integer j
+
+ enumerate_mandirs mandirs
+# debug_print -- "${mandirs[@]}"
+
+ integer num_mandirs=${#mandirs[@]}
+
+ for ((i=0 ; i < num_mandirs ; i++ )) ; do
+ typeset mandir="${mandirs[i].dir}"
+
+ typeset -a mansects
+ enumerate_mansects mansects "mandirs[$i]"
+
+ integer num_mansects="${#mansects[@]}"
+# debug_print -- "mansects=${mansects[@]}"
+
+ for ((j=0 ; j < num_mansects ; j++ )) ; do
+ typeset mansect="${mansects[j]}"
+
+ # try 1: SGML manpage
+ typeset match="${mandir}/sman${mansect}/${manname}.${mansect}"
+ if [[ -r "${match}" ]] ; then
+ typeset note nlink
+
+ # follow SGML links if needed (needs rework, including protection against link loops)
+ while true ; do
+ debug_print -f "match: %s\n" "${match}"
+
+ tmp="$(cd "${mandir}" ; LC_MESSAGES=C /usr/lib/sgml/sgml2roff "${match}")"
+ read note nlink <<<"${tmp}"
+
+ if [[ "${note}" == ".so" ]] ; then
+ match="${nlink}"
+ else
+ break
+ fi
+ done
+
+ tbl <<<"${tmp}" | eqn | nroff -u0 -Tlp -man - | col -x | browse_manpage /dev/stdin "${manname}(${mansect})"
+ return 0
+ fi
+
+ # try 2: troff manpage
+ match="${mandir}/man${mansect}/${manname}.${mansect}"
+ if [[ -r "${match}" ]] ; then
+ debug_print -f "match: %s\n" "${match}"
+ tbl <"${match}" | eqn | nroff -u0 -Tlp -man - | col -x | browse_manpage /dev/stdin "${manname}(${mansect})"
+ return 0
+ fi
+ done
+ unset mansects num_mansects
+ done
+
+ printf $"No manual entry for %s.\n" "${manname}"
+ return 0
+}
+
+# /usr/bin/man -l <keyword>
+function list_manpages
+{
+ typeset -a -C mandirs
+
+ enumerate_mandirs mandirs
+ #debug_print -- "${mandirs[@]}"
+
+ integer num_mandirs=${#mandirs[@]}
+
+ for ((i=0 ; i < num_mandirs ; i++ )) ; do
+ typeset mandir="${mandirs[i].dir}"
+
+ typeset -a mansects
+ enumerate_mansects mansects "mandirs[$i]"
+
+ integer num_mansects="${#mansects[@]}"
+# debug_print -- "mansects=${mansects[@]}"
+
+ for ((j=0 ; j < num_mansects ; j++ )) ; do
+ mansect="${mansects[j]}"
+
+ # try 1: SGML manpage
+ match="${mandir}/sman${mansect}/${manname}.${mansect}"
+ if [[ -r "${match}" ]] ; then
+ printf "%s (%s)\t-M %s\n" "${manname}" "${mansect}" "${mandir}"
+ continue
+ fi
+
+ # try 2: troff manpage
+ match="${mandir}/man${mansect}/${manname}.${mansect}"
+ if [[ -r "${match}" ]] ; then
+ printf "%s (%s)\t-M %s\n" "${manname}" "${mansect}" "${mandir}"
+ continue
+ fi
+ done
+ unset mansects num_mansects
+ done
+
+ return 0
+}
+
+# /usr/bin/appropos
+function list_keywords
+{
+ typeset -a mandirs
+ typeset name namesec title
+
+ enumerate_mandirs mandirs
+ #debug_print -- "${mandirs[@]}"
+
+ integer num_mandirs=${#mandirs[@]}
+
+ for ((i=0 ; i < num_mandirs ; i++ )) ; do
+ typeset mandir="${mandirs[i].dir}"
+ typeset windexfile="${mandir}/windex"
+
+ if [[ ! -r "${windexfile}" ]] ; then
+ print -u2 -f $"%s: Can't open %s.\n" "${progname}" "${windexfile}"
+ continue
+ fi
+
+ while IFS=$'\t' read name namesec title ; do
+ if [[ "${name}${namesec}${title}" == ~(Fi)${manname} ]] ; then
+ printf "%s\t%s\t%s\n" "${name}" "${namesec}" "${title}"
+ fi
+ done <"${windexfile}"
+ done
+
+ return 0
+}
+
+function usage
+{
+ OPTIND=0
+ getopts -a "${progname}" "${man_usage}" OPT '-?'
+ exit 2
+}
+
+# program start
+builtin basename
+builtin cat
+builtin date
+
+typeset progname="$(basename "${0}")"
+
+typeset -r man_usage=$'+
+[-?\n@(#)\$Id: shman (Roland Mainz) 2008-10-14 \$\n]
+[-author?Roland Mainz <roland.mainz@nrubsig.org>]
+[-author?Roland Mainz <roland.mainz@sun.com>]
+[+NAME?man - find and display reference manual pages]
+[+DESCRIPTION?The man command displays information from the reference
+ manuals. It displays complete manual pages that you select
+ by name, or one-line summaries selected either by keyword
+ (-k), or by the name of an associated file (-f). If no
+ manual page is located, man prints an error message.]
+[+?write me.]
+[k:keyword?Prints out one-line summaries from the windex database (table of contents) that
+ contain any of the given keywords. The windex database is created using
+ catman(1M).]
+[l:list?Lists all manual pages found matching name within the search path.]
+[M:mpath?Specifies an alternate search path for manual pages. path is a colon-separated
+ list of directories that contain manual page directory subtrees. For example, if
+ path is /usr/share/man:/usr/local/man, man searches for name in the standard
+ location, and then /usr/local/man. When used with the -k or -f options, the -M
+ option must appear first. Each directory in the path is assumed to contain subdirectories of the form man* or sman* ,
+ one for each section. This option overrides the MANPATH environment variable.]:[path]
+[s:section?Specifies sections of the manual for man to search. The directories searched for
+ name are limited to those specified by section. section can be a numerical
+ digit, perhaps followed by one or more letters to match the desired section of
+ the manual, for example, "3libucb". Also, section can be a word, for example,
+ local, new, old, public. section can also be a letter.
+ To specify multiple sections, separate each section with
+ a comma. This option overrides the MANPATH environment variable and the man.cf
+ file.
+ See Search Path below for an explanation of how man conducts its search.]:[section]
+
+name
+
+[+SEE ALSO?\bksh93\b(1), \bman\b(1)]
+'
+
+typeset do_list=false
+typeset do_keyword=false
+
+while getopts -a "${progname}" "${man_usage}" OPT ; do
+# printmsg "## OPT=|${OPT}|, OPTARG=|${OPTARG}|"
+ case ${OPT} in
+ M) MANPATH="${OPTARG}" ;;
+ l) do_list=true ;;
+ k) do_keyword=true ;;
+ s) MANSECTS="${OPTARG}" ;;
+ *) usage ;;
+ esac
+done
+shift $((OPTIND-1))
+
+# cd /usr/man; LC_MESSAGES=C /usr/lib/sgml/sgml2roff /usr/man/sman1as/asadmin-list-timers.1as | tbl | eqn | nroff -u0 -Tlp -man - | col -x > /tmp/mpLQaqac
+
+typeset manname="$1"
+debug_print -f "# searching for %s ...\n" "${manname}"
+
+if ${do_keyword} ; then
+ list_keywords
+elif ${do_list} ; then
+ list_manpages
+else
+ show_manpage
+fi
+
+# todo: better exit codes
+exit 0
+# EOF.
diff --git a/usr/src/lib/libshell/common/scripts/shnote.sh b/usr/src/lib/libshell/common/scripts/shnote.sh
new file mode 100644
index 0000000000..1361feb8a7
--- /dev/null
+++ b/usr/src/lib/libshell/common/scripts/shnote.sh
@@ -0,0 +1,414 @@
+#!/usr/bin/ksh93
+
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+# Solaris needs /usr/xpg6/bin:/usr/xpg4/bin because the tools in /usr/bin are not POSIX-conformant
+export PATH=/usr/xpg6/bin:/usr/xpg4/bin:/bin:/usr/bin
+
+# Make sure all math stuff runs in the "C" locale to avoid problems
+# with alternative # radix point representations (e.g. ',' instead of
+# '.' in de_DE.*-locales). This needs to be set _before_ any
+# floating-point constants are defined in this script).
+if [[ "${LC_ALL}" != "" ]] ; then
+ export \
+ LC_MONETARY="${LC_ALL}" \
+ LC_MESSAGES="${LC_ALL}" \
+ LC_COLLATE="${LC_ALL}" \
+ LC_CTYPE="${LC_ALL}"
+ unset LC_ALL
+fi
+export LC_NUMERIC=C
+
+function fatal_error
+{
+ print -u2 "${progname}: $*"
+ exit 1
+}
+
+function encode_multipart_form_data
+{
+ nameref formdata="$1"
+ nameref content="formdata.content"
+ integer numformelements=${#formdata.form[*]}
+ integer i
+ typeset tmp
+
+ content=""
+
+ # todo: add support to upload files
+ for (( i=0 ; i < numformelements ; i++ )) ; do
+ nameref element="formdata.form[${i}]"
+
+ content+="--${formdata.boundary}\n"
+ content+="Content-Disposition: form-data; name=\"${element.name}\"\n"
+ content+="\n"
+ # make sure we quote the '\' properly since we pass these data to one instance of
+ # "print" when putting the content on the wire.
+ content+="${element.data//\\/\\\\}\n" # fixme: may need encoding for non-ASCII data
+ done
+
+ # we have to de-quote the content before we can count the real numer of bytes in the payload
+ tmp="$(print -- "${content}")"
+ formdata.content_length=${#tmp}
+
+ # add content tail (which MUST not be added to the content length)
+ content+="--${formdata.boundary}--\n"
+
+ return 0
+}
+
+# parse HTTP return code, cookies etc.
+function parse_http_response
+{
+ nameref response="$1"
+ typeset h statuscode statusmsg i
+
+ # we use '\r' as additional IFS to filter the final '\r'
+ IFS=$' \t\r' read -r h statuscode statusmsg # read HTTP/1.[01] <code>
+ [[ "$h" != ~(Eil)HTTP/.* ]] && { print -u2 -f $"%s: HTTP/ header missing\n" "$0" ; return 1 ; }
+ [[ "$statuscode" != ~(Elr)[0-9]* ]] && { print -u2 -f $"%s: invalid status code\n" "$0" ; return 1 ; }
+ response.statuscode="$statuscode"
+ response.statusmsg="$statusmsg"
+
+ # skip remaining headers
+ while IFS='' read -r i ; do
+ [[ "$i" == $'\r' ]] && break
+
+ # strip '\r' at the end
+ i="${i/~(Er)$'\r'/}"
+
+ case "$i" in
+ ~(Eli)Content-Type:.*)
+ response.content_type="${i/~(El).*:[[:blank:]]*/}"
+ ;;
+ ~(Eli)Content-Length:[[:blank:]]*[0-9]*)
+ integer response.content_length="${i/~(El).*:[[:blank:]]*/}"
+ ;;
+ ~(Eli)Transfer-Encoding:.*)
+ response.transfer_encoding="${i/~(El).*:[[:blank:]]*/}"
+ ;;
+ esac
+ done
+
+ return 0
+}
+
+function cat_http_body
+{
+ typeset emode="$1"
+ typeset hexchunksize="0"
+ integer chunksize=0
+
+ if [[ "${emode}" == "chunked" ]] ; then
+ while IFS=$'\r' read hexchunksize &&
+ [[ "${hexchunksize}" == ~(Elri)[0-9abcdef]* ]] &&
+ (( chunksize=16#${hexchunksize} )) && (( chunksize > 0 )) ; do
+ dd bs=1 count="${chunksize}" 2>/dev/null
+ done
+ else
+ cat
+ fi
+
+ return 0
+}
+
+function history_write_record
+{
+ # rec: history record:
+ # rec.title
+ # rec.description
+ # rec.provider
+ # rec.providertoken
+ # rec.url
+ nameref rec="$1"
+ integer histfd
+
+ mkdir -p "${HOME}/.shnote"
+
+ {
+ # write a single-line record which can be read
+ # as a compound variable back into the shell
+ printf "title=%q description=%q date=%q provider=%q providertoken=%q url=%q\n" \
+ "${rec.title}" \
+ "${rec.description}" \
+ "$(date)" \
+ "${rec.provider}" \
+ "${rec.providertoken}" \
+ "${rec.url}"
+ } >>"${history_file}"
+
+ return $?
+}
+
+function print_history
+{
+ integer histfd # http stream number
+ typeset line
+
+ (( $# != 0 && $# != 1 )) && { print -u2 -f $"%s: Wrong number of arguments.\n" "$0" ; return 1 ; }
+
+ # default output format is:
+ # <access url>/<title> <date> <access url>
+ [[ "$1" == "-l" ]] || printf "# %s\t\t\t\t\t%s\t%s\n" "<url>" "<title>" "<date>"
+
+ # no history file ?
+ if [[ ! -f "${history_file}" ]] ; then
+ return 0
+ fi
+
+ # open history file
+ redirect {histfd}<>"${history_file}"
+ (( $? != 0 )) && { print -u2 "Couldn't open history file." ; return 1 ; }
+
+ while read -u${histfd} line ; do
+ typeset -C rec
+
+ printf "( %s )\n" "${line}" | read -C rec
+
+ if [[ "$1" == "-l" ]] ; then
+ print -- "${rec}"
+ else
+ printf "%q\t%q\t%q\n" "${rec.url}" "${rec.title}" "${rec.date}"
+ fi
+
+ unset rec
+ done
+
+ # close history file
+ redirect {histfd}<&-
+
+ return 0
+}
+
+function put_note_pastebin_ca
+{
+ # key to autheticate this script against pastebin.ca
+ typeset -r pastebin_ca_key="9CFXFyeNC3iga/vthok75kTBu5kSSLPD"
+ # site setup
+ typeset url_host="opensolaris.pastebin.ca"
+ typeset url_path="/quiet-paste.php?api=${pastebin_ca_key}"
+ typeset url="http://${url_host}${url_path}"
+ integer netfd # http stream number
+ typeset -C httpresponse
+
+ (( $# != 1 )) && { print -u2 -f $"%s: Wrong number of arguments.\n" "$0" ; return 1 ; }
+ (( ${#1} == 0 )) && { print -u2 -f $"%s: No data.\n" "$0" ; return 1 ; }
+
+ # argument for "encode_multipart_form_data"
+ typeset mimeform=(
+ # input
+ typeset boundary
+ typeset -a form
+ # output
+ typeset content
+ integer content_length
+ )
+
+ typeset request=""
+ typeset content=""
+
+ typeset -r boundary="--------shnote_${RANDOM}_Xfish_${RANDOM}_Yeats_${RANDOM}_Zchicken_${RANDOM}monster_--------"
+
+ mimeform.boundary="${boundary}"
+ mimeform.form=( # we use explicit index numbers since we rely on them below when filling the history
+ [0]=( name="name" data="${LOGNAME}" )
+ [1]=( name="expiry" data="Never" )
+ [2]=( name="type" data="1" )
+ [3]=( name="description" data="logname=${LOGNAME};hostname=$(hostname);date=$(date)" )
+ [4]=( name="content" data="$1" )
+ )
+ encode_multipart_form_data mimeform
+
+ content="${mimeform.content}"
+
+ request="POST ${url_path} HTTP/1.1\r\n"
+ request+="Host: ${url_host}\r\n"
+ request+="User-Agent: ${http_user_agent}\r\n"
+ request+="Connection: close\r\n"
+ request+="Content-Type: multipart/form-data; boundary=${boundary}\r\n"
+ request+="Content-Length: $(( mimeform.content_length ))\r\n"
+
+ redirect {netfd}<>"/dev/tcp/${url_host}/80"
+ (( $? != 0 )) && { print -u2 -f $"$0: Couldn't open connection to %s.\n" "$0" "${url_host}" ; return 1 ; }
+
+ # send http post
+ {
+ print -n -- "${request}\r\n"
+ print -n -- "${content}\r\n"
+ } >&${netfd}
+
+ # process reply
+ parse_http_response httpresponse <&${netfd}
+ response="$(cat_http_body "${httpresponse.transfer_encoding}" <&${netfd})"
+
+ # close connection
+ redirect {netfd}<&-
+
+ if [[ "${response}" == ~(E).*SUCCESS.* ]] ; then
+ typeset response_token="${response/~(E).*SUCCESS:/}"
+
+ printf "SUCCESS: http://opensolaris.pastebin.ca/%s\n" "${response_token}"
+
+ # write history entry
+ typeset histrec=(
+ title="${mimeform.form[0].data}"
+ description="${mimeform.form[3].data}"
+ providertoken="${response_token}"
+ provider="opensolaris.pastebin.ca"
+ url="http://opensolaris.pastebin.ca/${response_token}"
+ )
+
+ history_write_record histrec
+ return 0
+ else
+ printf "ERROR: %s\n" "${response}"
+ return 1
+ fi
+
+ # not reached
+}
+
+function get_note_pastebin_ca
+{
+ typeset recordname="$1"
+ integer netfd # http stream number
+
+ (( $# != 1 )) && { print -u2 -f $"%s: No key or key URL.\n" "$0" ; return 1 ; }
+
+ case "${recordname}" in
+ ~(Elr)[0-9][0-9]*)
+ # pass-through
+ ;;
+ ~(Elr)http://opensolaris.pastebin.ca/raw/[0-9]*)
+ recordname="${recordname/~(El)http:\/\/opensolaris.pastebin.ca\/raw\//}"
+ ;;
+ ~(Elr)http://opensolaris.pastebin.ca/[0-9]*)
+ recordname="${recordname/~(El)http:\/\/opensolaris.pastebin.ca\//}"
+ ;;
+ *)
+ fatal_error $"Unsupported record name ${recordname}."
+ esac
+
+ print -u2 -f "# Record name is '%s'\n" "${recordname}"
+
+ typeset url_host="opensolaris.pastebin.ca"
+ typeset url_path="/raw/${recordname}"
+ typeset url="http://${url_host}${url_path}"
+ # I hereby curse Solaris for not having an entry for "http" in /etc/services
+
+ # open TCP channel
+ redirect {netfd}<>"/dev/tcp/${url_host}/80"
+ (( $? != 0 )) && { print -u2 -f $"%s: Couldn't open connection to %s.\n" "$0" "${url_host}" ; return 1 ; }
+
+ # send HTTP request
+ request="GET ${url_path} HTTP/1.1\r\n"
+ request+="Host: ${url_host}\r\n"
+ request+="User-Agent: ${http_user_agent}\r\n"
+ request+="Connection: close\r\n"
+ print -u${netfd} -- "${request}\r\n"
+
+ # collect response and send it to stdout
+ parse_http_response httpresponse <&${netfd}
+ cat_http_body "${httpresponse.transfer_encoding}" <&${netfd}
+
+ # close connection
+ redirect {netfd}<&-
+
+ print # add newline
+
+ return 0
+}
+
+function usage
+{
+ OPTIND=0
+ getopts -a "${progname}" "${USAGE}" OPT '-?'
+ exit 2
+}
+
+# program start
+builtin basename
+builtin cat
+builtin date
+builtin uname
+
+typeset progname="${ basename "${0}" ; }"
+
+# HTTP protocol client identifer
+typeset -r http_user_agent="shnote/ksh93 (2008-10-14; $(uname -s -r -p))"
+
+# name of history log (the number after "history" is some kind of version
+# counter to handle incompatible changes to the history file format)
+typeset -r history_file="${HOME}/.shnote/history0.txt"
+
+typeset -r shnote_usage=$'+
+[-?\n@(#)\$Id: shnote (Roland Mainz) 2008-10-14 \$\n]
+[-author?Roland Mainz <roland.mainz@nrubsig.org>]
+[+NAME?shnote - read/write text data to internet clipboards]
+[+DESCRIPTION?\bshnote\b is a small utilty which can read and write text
+ data to internet "clipboards" such as opensolaris.pastebin.ca.]
+[+?The first arg \bmethod\b describes one of the methods, "put" saves a string
+ to the internet clipboard, returning an identifer and the full URL
+ where the data are stored. The method "get" retrives the raw
+ information using the identifer from the previous "put" action.
+ The method "hist" prints a history of transactions created with the
+ "put" method and the keys to retrive them again using the "get" method.]
+[+?The second arg \bstring\b contains either the string data which should be
+ stored on the clipboard using the "put" method, the "get" method uses
+ this information as identifer to retrive the raw data from the
+ clipboard.]
+
+method [ string ]
+
+[+SEE ALSO?\bksh93\b(1), \brssread\b(1), \bshtwitter\b(1), \bshtinyurl\b(1), http://opensolaris.pastebin.ca]
+'
+
+while getopts -a "${progname}" "${shnote_usage}" OPT ; do
+# printmsg "## OPT=|${OPT}|, OPTARG=|${OPTARG}|"
+ case ${OPT} in
+ *) usage ;;
+ esac
+done
+shift $((OPTIND-1))
+
+# expecting at least one more argument, the single method below will do
+# the checks for more arguments if needed ("put" and "get" methods need
+# at least one extra argument, "hist" none).
+(($# >= 1)) || usage
+
+typeset method="$1"
+shift
+
+case "${method}" in
+ put) put_note_pastebin_ca "$@" ; exit $? ;;
+ get) get_note_pastebin_ca "$@" ; exit $? ;;
+ hist) print_history "$@" ; exit $? ;;
+ *) usage ;;
+esac
+
+fatal_error $"not reached."
+# EOF.
diff --git a/usr/src/lib/libshell/common/scripts/shpiano.sh b/usr/src/lib/libshell/common/scripts/shpiano.sh
new file mode 100644
index 0000000000..4690fee5ed
--- /dev/null
+++ b/usr/src/lib/libshell/common/scripts/shpiano.sh
@@ -0,0 +1,1386 @@
+#!/usr/bin/ksh93
+
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+# Solaris needs /usr/xpg6/bin:/usr/xpg4/bin because the tools in /usr/bin are not POSIX-conformant
+export PATH=/usr/xpg6/bin:/usr/xpg4/bin:/bin:/usr/bin
+
+# Make sure all math stuff runs in the "C" locale to avoid problems
+# with alternative # radix point representations (e.g. ',' instead of
+# '.' in de_DE.*-locales). This needs to be set _before_ any
+# floating-point constants are defined in this script).
+if [[ "${LC_ALL}" != "" ]] ; then
+ export \
+ LC_MONETARY="${LC_ALL}" \
+ LC_MESSAGES="${LC_ALL}" \
+ LC_COLLATE="${LC_ALL}" \
+ LC_CTYPE="${LC_ALL}"
+ unset LC_ALL
+fi
+export LC_NUMERIC=C
+
+function fatal_error
+{
+ print -u2 "${progname}: $*"
+ exit 1
+}
+
+function beep
+{
+ tput bel
+ return 0
+}
+
+# array which holds frequency and sample data
+# (the data are created on demand, "sample_set" indicates whether the "sample" variable
+# needs to be filled or not)
+typeset -A tones=(
+ ["C3"]=( float freq=261.63 ; typeset sample_set="false" ; typeset -b sample )
+ ["C#3"]=( float freq=277.18 ; typeset sample_set="false" ; typeset -b sample )
+ ["D3"]=( float freq=293.66 ; typeset sample_set="false" ; typeset -b sample )
+ ["D#3"]=( float freq=311.13 ; typeset sample_set="false" ; typeset -b sample )
+ ["E3"]=( float freq=329.63 ; typeset sample_set="false" ; typeset -b sample )
+ ["F3"]=( float freq=349.23 ; typeset sample_set="false" ; typeset -b sample )
+ ["F#3"]=( float freq=369.99 ; typeset sample_set="false" ; typeset -b sample )
+ ["G3"]=( float freq=391.99 ; typeset sample_set="false" ; typeset -b sample )
+ ["G#3"]=( float freq=415.31 ; typeset sample_set="false" ; typeset -b sample )
+ ["A3"]=( float freq=440.00 ; typeset sample_set="false" ; typeset -b sample )
+ ["A#3"]=( float freq=466.16 ; typeset sample_set="false" ; typeset -b sample )
+ ["B3"]=( float freq=493.88 ; typeset sample_set="false" ; typeset -b sample )
+ ["C4"]=( float freq=523.25 ; typeset sample_set="false" ; typeset -b sample )
+ ["C#4"]=( float freq=554.37 ; typeset sample_set="false" ; typeset -b sample )
+ ["D4"]=( float freq=587.33 ; typeset sample_set="false" ; typeset -b sample )
+ ["D#4"]=( float freq=622.25 ; typeset sample_set="false" ; typeset -b sample )
+ ["E4"]=( float freq=659.26 ; typeset sample_set="false" ; typeset -b sample )
+ ["F4"]=( float freq=698.46 ; typeset sample_set="false" ; typeset -b sample )
+ ["F#4"]=( float freq=739.99 ; typeset sample_set="false" ; typeset -b sample )
+ ["G4"]=( float freq=783.99 ; typeset sample_set="false" ; typeset -b sample )
+ ["G#4"]=( float freq=830.61 ; typeset sample_set="false" ; typeset -b sample )
+ ["A4"]=( float freq=880.00 ; typeset sample_set="false" ; typeset -b sample )
+ ["A#4"]=( float freq=932.32 ; typeset sample_set="false" ; typeset -b sample )
+ ["B4"]=( float freq=987.77 ; typeset sample_set="false" ; typeset -b sample )
+ ["C5"]=( float freq=1046.5 ; typeset sample_set="false" ; typeset -b sample )
+
+ # dummy entry for pause
+ ["p"]=( float freq=NaN ; typeset sample_set="false" ; typeset -b sample )
+)
+
+# alias table which translates the various names of "notes" to the matching entry
+# in the "tones" table
+typeset -r -A notes=(
+ ["C3"]=( val=tones["C3"] ) ["key_d"]=( val=tones["C3"] )
+ ["C#3"]=( val=tones["C#3"] ) ["key_r"]=( val=tones["C#3"] )
+ ["D3"]=( val=tones["D3"] ) ["key_f"]=( val=tones["D3"] )
+ ["D#3"]=( val=tones["D#3"] ) ["key_t"]=( val=tones["D#3"] )
+ ["E3"]=( val=tones["E3"] ) ["key_g"]=( val=tones["E3"] )
+ ["F3"]=( val=tones["F3"] ) ["key_h"]=( val=tones["F3"] )
+ ["F#3"]=( val=tones["F#3"] ) ["key_u"]=( val=tones["F#3"] )
+ ["G3"]=( val=tones["G3"] ) ["key_j"]=( val=tones["G3"] )
+ ["G#3"]=( val=tones["G#3"] ) ["key_i"]=( val=tones["G#3"] )
+ ["A3"]=( val=tones["A3"] ) ["key_k"]=( val=tones["A3"] )
+ ["A#3"]=( val=tones["A#3"] ) ["key_o"]=( val=tones["A#3"] )
+ ["B3"]=( val=tones["B3"] ) ["key_l"]=( val=tones["B3"] )
+ ["C4"]=( val=tones["C4"] ) ["key_D"]=( val=tones["C4"] )
+ ["C#4"]=( val=tones["C#4"] ) ["key_R"]=( val=tones["C#4"] )
+ ["D4"]=( val=tones["D4"] ) ["key_F"]=( val=tones["D4"] )
+ ["D#4"]=( val=tones["D#4"] ) ["key_T"]=( val=tones["D#4"] )
+ ["E4"]=( val=tones["E4"] ) ["key_G"]=( val=tones["E4"] )
+ ["F4"]=( val=tones["F4"] ) ["key_H"]=( val=tones["F4"] )
+ ["F#4"]=( val=tones["F#4"] ) ["key_U"]=( val=tones["F#4"] )
+ ["G4"]=( val=tones["G4"] ) ["key_J"]=( val=tones["G4"] )
+ ["G#4"]=( val=tones["G#4"] ) ["key_I"]=( val=tones["G#4"] )
+ ["A4"]=( val=tones["A4"] ) ["key_K"]=( val=tones["A4"] )
+ ["A#4"]=( val=tones["A#4"] ) ["key_O"]=( val=tones["A#4"] )
+ ["B4"]=( val=tones["B4"] ) ["key_L"]=( val=tones["B4"] )
+ ["C5"]=( val=tones["C5"] )
+)
+
+# array used to convert a 14-bit unsigned PCM value to
+# inverted 8-bit u-law
+# (values were "stolen" from usr/src/cmd/audio/utilities/g711.c
+integer -r -a audio_pcmulinear14bittoulaw8bit=(
+ 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+ 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+ 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+ 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+ 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+ 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+ 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+ 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+ 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+ 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+ 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+ 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+ 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+ 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+ 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+ 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+ 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+ 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+ 0x00 0x00 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01
+ 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01
+ 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01
+ 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01
+ 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01
+ 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01
+ 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01
+ 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01
+ 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01
+ 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01
+ 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01
+ 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01
+ 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01
+ 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01
+ 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01
+ 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01
+ 0x01 0x01 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02
+ 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02
+ 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02
+ 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02
+ 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02
+ 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02
+ 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02
+ 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02
+ 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02
+ 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02
+ 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02
+ 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02
+ 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02
+ 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02
+ 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02
+ 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02
+ 0x02 0x02 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03
+ 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03
+ 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03
+ 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03
+ 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03
+ 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03
+ 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03
+ 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03
+ 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03
+ 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03
+ 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03
+ 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03
+ 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03
+ 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03
+ 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03
+ 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03
+ 0x03 0x03 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04
+ 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04
+ 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04
+ 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04
+ 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04
+ 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04
+ 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04
+ 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04
+ 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04
+ 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04
+ 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04
+ 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04
+ 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04
+ 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04
+ 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04
+ 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04
+ 0x04 0x04 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05
+ 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05
+ 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05
+ 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05
+ 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05
+ 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05
+ 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05
+ 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05
+ 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05
+ 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05
+ 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05
+ 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05
+ 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05
+ 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05
+ 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05
+ 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05
+ 0x05 0x05 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06
+ 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06
+ 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06
+ 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06
+ 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06
+ 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06
+ 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06
+ 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06
+ 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06
+ 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06
+ 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06
+ 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06
+ 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06
+ 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06
+ 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06
+ 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06
+ 0x06 0x06 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07
+ 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07
+ 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07
+ 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07
+ 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07
+ 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07
+ 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07
+ 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07
+ 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07
+ 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07
+ 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07
+ 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07
+ 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07
+ 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07
+ 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07
+ 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07
+ 0x07 0x07 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08
+ 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08
+ 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08
+ 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08
+ 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08
+ 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08
+ 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08
+ 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08
+ 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08
+ 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08
+ 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08
+ 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08
+ 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08
+ 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08
+ 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08
+ 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08
+ 0x08 0x08 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09
+ 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09
+ 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09
+ 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09
+ 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09
+ 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09
+ 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09
+ 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09
+ 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09
+ 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09
+ 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09
+ 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09
+ 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09
+ 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09
+ 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09
+ 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09
+ 0x09 0x09 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a
+ 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a
+ 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a
+ 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a
+ 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a
+ 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a
+ 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a
+ 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a
+ 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a
+ 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a
+ 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a
+ 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a
+ 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a
+ 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a
+ 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a
+ 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a
+ 0x0a 0x0a 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b
+ 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b
+ 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b
+ 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b
+ 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b
+ 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b
+ 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b
+ 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b
+ 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b
+ 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b
+ 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b
+ 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b
+ 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b
+ 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b
+ 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b
+ 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b
+ 0x0b 0x0b 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c
+ 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c
+ 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c
+ 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c
+ 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c
+ 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c
+ 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c
+ 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c
+ 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c
+ 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c
+ 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c
+ 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c
+ 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c
+ 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c
+ 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c
+ 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c
+ 0x0c 0x0c 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d
+ 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d
+ 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d
+ 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d
+ 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d
+ 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d
+ 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d
+ 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d
+ 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d
+ 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d
+ 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d
+ 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d
+ 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d
+ 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d
+ 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d
+ 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d 0x0d
+ 0x0d 0x0d 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e
+ 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e
+ 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e
+ 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e
+ 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e
+ 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e
+ 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e
+ 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e
+ 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e
+ 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e
+ 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e
+ 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e
+ 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e
+ 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e
+ 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e
+ 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e 0x0e
+ 0x0e 0x0e 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f
+ 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f
+ 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f
+ 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f
+ 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f
+ 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f
+ 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f
+ 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f
+ 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f
+ 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f
+ 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f
+ 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f
+ 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f
+ 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f
+ 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f
+ 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f 0x0f
+ 0x0f 0x0f 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10
+ 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10
+ 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10
+ 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10
+ 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10
+ 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10
+ 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10
+ 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10
+ 0x10 0x10 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11
+ 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11
+ 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11
+ 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11
+ 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11
+ 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11
+ 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11
+ 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11
+ 0x11 0x11 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12
+ 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12
+ 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12
+ 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12
+ 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12
+ 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12
+ 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12
+ 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x12
+ 0x12 0x12 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13
+ 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13
+ 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13
+ 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13
+ 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13
+ 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13
+ 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13
+ 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0x13
+ 0x13 0x13 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14
+ 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14
+ 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14
+ 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14
+ 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14
+ 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14
+ 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14
+ 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14 0x14
+ 0x14 0x14 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15
+ 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15
+ 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15
+ 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15
+ 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15
+ 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15
+ 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15
+ 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15 0x15
+ 0x15 0x15 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16
+ 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16
+ 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16
+ 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16
+ 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16
+ 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16
+ 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16
+ 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16 0x16
+ 0x16 0x16 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17
+ 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17
+ 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17
+ 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17
+ 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17
+ 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17
+ 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17
+ 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17 0x17
+ 0x17 0x17 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18
+ 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18
+ 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18
+ 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18
+ 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18
+ 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18
+ 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18
+ 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18 0x18
+ 0x18 0x18 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19
+ 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19
+ 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19
+ 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19
+ 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19
+ 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19
+ 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19
+ 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19 0x19
+ 0x19 0x19 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a
+ 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a
+ 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a
+ 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a
+ 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a
+ 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a
+ 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a
+ 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a 0x1a
+ 0x1a 0x1a 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b
+ 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b
+ 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b
+ 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b
+ 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b
+ 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b
+ 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b
+ 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b 0x1b
+ 0x1b 0x1b 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c
+ 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c
+ 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c
+ 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c
+ 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c
+ 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c
+ 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c
+ 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c 0x1c
+ 0x1c 0x1c 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d
+ 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d
+ 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d
+ 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d
+ 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d
+ 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d
+ 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d
+ 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d 0x1d
+ 0x1d 0x1d 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e
+ 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e
+ 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e
+ 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e
+ 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e
+ 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e
+ 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e
+ 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e 0x1e
+ 0x1e 0x1e 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f
+ 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f
+ 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f
+ 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f
+ 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f
+ 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f
+ 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f
+ 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f 0x1f
+ 0x1f 0x1f 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20
+ 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20
+ 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20
+ 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20
+ 0x20 0x20 0x21 0x21 0x21 0x21 0x21 0x21 0x21 0x21 0x21 0x21 0x21 0x21 0x21 0x21
+ 0x21 0x21 0x21 0x21 0x21 0x21 0x21 0x21 0x21 0x21 0x21 0x21 0x21 0x21 0x21 0x21
+ 0x21 0x21 0x21 0x21 0x21 0x21 0x21 0x21 0x21 0x21 0x21 0x21 0x21 0x21 0x21 0x21
+ 0x21 0x21 0x21 0x21 0x21 0x21 0x21 0x21 0x21 0x21 0x21 0x21 0x21 0x21 0x21 0x21
+ 0x21 0x21 0x22 0x22 0x22 0x22 0x22 0x22 0x22 0x22 0x22 0x22 0x22 0x22 0x22 0x22
+ 0x22 0x22 0x22 0x22 0x22 0x22 0x22 0x22 0x22 0x22 0x22 0x22 0x22 0x22 0x22 0x22
+ 0x22 0x22 0x22 0x22 0x22 0x22 0x22 0x22 0x22 0x22 0x22 0x22 0x22 0x22 0x22 0x22
+ 0x22 0x22 0x22 0x22 0x22 0x22 0x22 0x22 0x22 0x22 0x22 0x22 0x22 0x22 0x22 0x22
+ 0x22 0x22 0x23 0x23 0x23 0x23 0x23 0x23 0x23 0x23 0x23 0x23 0x23 0x23 0x23 0x23
+ 0x23 0x23 0x23 0x23 0x23 0x23 0x23 0x23 0x23 0x23 0x23 0x23 0x23 0x23 0x23 0x23
+ 0x23 0x23 0x23 0x23 0x23 0x23 0x23 0x23 0x23 0x23 0x23 0x23 0x23 0x23 0x23 0x23
+ 0x23 0x23 0x23 0x23 0x23 0x23 0x23 0x23 0x23 0x23 0x23 0x23 0x23 0x23 0x23 0x23
+ 0x23 0x23 0x24 0x24 0x24 0x24 0x24 0x24 0x24 0x24 0x24 0x24 0x24 0x24 0x24 0x24
+ 0x24 0x24 0x24 0x24 0x24 0x24 0x24 0x24 0x24 0x24 0x24 0x24 0x24 0x24 0x24 0x24
+ 0x24 0x24 0x24 0x24 0x24 0x24 0x24 0x24 0x24 0x24 0x24 0x24 0x24 0x24 0x24 0x24
+ 0x24 0x24 0x24 0x24 0x24 0x24 0x24 0x24 0x24 0x24 0x24 0x24 0x24 0x24 0x24 0x24
+ 0x24 0x24 0x25 0x25 0x25 0x25 0x25 0x25 0x25 0x25 0x25 0x25 0x25 0x25 0x25 0x25
+ 0x25 0x25 0x25 0x25 0x25 0x25 0x25 0x25 0x25 0x25 0x25 0x25 0x25 0x25 0x25 0x25
+ 0x25 0x25 0x25 0x25 0x25 0x25 0x25 0x25 0x25 0x25 0x25 0x25 0x25 0x25 0x25 0x25
+ 0x25 0x25 0x25 0x25 0x25 0x25 0x25 0x25 0x25 0x25 0x25 0x25 0x25 0x25 0x25 0x25
+ 0x25 0x25 0x26 0x26 0x26 0x26 0x26 0x26 0x26 0x26 0x26 0x26 0x26 0x26 0x26 0x26
+ 0x26 0x26 0x26 0x26 0x26 0x26 0x26 0x26 0x26 0x26 0x26 0x26 0x26 0x26 0x26 0x26
+ 0x26 0x26 0x26 0x26 0x26 0x26 0x26 0x26 0x26 0x26 0x26 0x26 0x26 0x26 0x26 0x26
+ 0x26 0x26 0x26 0x26 0x26 0x26 0x26 0x26 0x26 0x26 0x26 0x26 0x26 0x26 0x26 0x26
+ 0x26 0x26 0x27 0x27 0x27 0x27 0x27 0x27 0x27 0x27 0x27 0x27 0x27 0x27 0x27 0x27
+ 0x27 0x27 0x27 0x27 0x27 0x27 0x27 0x27 0x27 0x27 0x27 0x27 0x27 0x27 0x27 0x27
+ 0x27 0x27 0x27 0x27 0x27 0x27 0x27 0x27 0x27 0x27 0x27 0x27 0x27 0x27 0x27 0x27
+ 0x27 0x27 0x27 0x27 0x27 0x27 0x27 0x27 0x27 0x27 0x27 0x27 0x27 0x27 0x27 0x27
+ 0x27 0x27 0x28 0x28 0x28 0x28 0x28 0x28 0x28 0x28 0x28 0x28 0x28 0x28 0x28 0x28
+ 0x28 0x28 0x28 0x28 0x28 0x28 0x28 0x28 0x28 0x28 0x28 0x28 0x28 0x28 0x28 0x28
+ 0x28 0x28 0x28 0x28 0x28 0x28 0x28 0x28 0x28 0x28 0x28 0x28 0x28 0x28 0x28 0x28
+ 0x28 0x28 0x28 0x28 0x28 0x28 0x28 0x28 0x28 0x28 0x28 0x28 0x28 0x28 0x28 0x28
+ 0x28 0x28 0x29 0x29 0x29 0x29 0x29 0x29 0x29 0x29 0x29 0x29 0x29 0x29 0x29 0x29
+ 0x29 0x29 0x29 0x29 0x29 0x29 0x29 0x29 0x29 0x29 0x29 0x29 0x29 0x29 0x29 0x29
+ 0x29 0x29 0x29 0x29 0x29 0x29 0x29 0x29 0x29 0x29 0x29 0x29 0x29 0x29 0x29 0x29
+ 0x29 0x29 0x29 0x29 0x29 0x29 0x29 0x29 0x29 0x29 0x29 0x29 0x29 0x29 0x29 0x29
+ 0x29 0x29 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a
+ 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a
+ 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a
+ 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a 0x2a
+ 0x2a 0x2a 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b
+ 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b
+ 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b
+ 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b 0x2b
+ 0x2b 0x2b 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c
+ 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c
+ 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c
+ 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c 0x2c
+ 0x2c 0x2c 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d
+ 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d
+ 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d
+ 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d 0x2d
+ 0x2d 0x2d 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e
+ 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e
+ 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e
+ 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e 0x2e
+ 0x2e 0x2e 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f
+ 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f
+ 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f
+ 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f
+ 0x2f 0x2f 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x30
+ 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x30
+ 0x30 0x30 0x31 0x31 0x31 0x31 0x31 0x31 0x31 0x31 0x31 0x31 0x31 0x31 0x31 0x31
+ 0x31 0x31 0x31 0x31 0x31 0x31 0x31 0x31 0x31 0x31 0x31 0x31 0x31 0x31 0x31 0x31
+ 0x31 0x31 0x32 0x32 0x32 0x32 0x32 0x32 0x32 0x32 0x32 0x32 0x32 0x32 0x32 0x32
+ 0x32 0x32 0x32 0x32 0x32 0x32 0x32 0x32 0x32 0x32 0x32 0x32 0x32 0x32 0x32 0x32
+ 0x32 0x32 0x33 0x33 0x33 0x33 0x33 0x33 0x33 0x33 0x33 0x33 0x33 0x33 0x33 0x33
+ 0x33 0x33 0x33 0x33 0x33 0x33 0x33 0x33 0x33 0x33 0x33 0x33 0x33 0x33 0x33 0x33
+ 0x33 0x33 0x34 0x34 0x34 0x34 0x34 0x34 0x34 0x34 0x34 0x34 0x34 0x34 0x34 0x34
+ 0x34 0x34 0x34 0x34 0x34 0x34 0x34 0x34 0x34 0x34 0x34 0x34 0x34 0x34 0x34 0x34
+ 0x34 0x34 0x35 0x35 0x35 0x35 0x35 0x35 0x35 0x35 0x35 0x35 0x35 0x35 0x35 0x35
+ 0x35 0x35 0x35 0x35 0x35 0x35 0x35 0x35 0x35 0x35 0x35 0x35 0x35 0x35 0x35 0x35
+ 0x35 0x35 0x36 0x36 0x36 0x36 0x36 0x36 0x36 0x36 0x36 0x36 0x36 0x36 0x36 0x36
+ 0x36 0x36 0x36 0x36 0x36 0x36 0x36 0x36 0x36 0x36 0x36 0x36 0x36 0x36 0x36 0x36
+ 0x36 0x36 0x37 0x37 0x37 0x37 0x37 0x37 0x37 0x37 0x37 0x37 0x37 0x37 0x37 0x37
+ 0x37 0x37 0x37 0x37 0x37 0x37 0x37 0x37 0x37 0x37 0x37 0x37 0x37 0x37 0x37 0x37
+ 0x37 0x37 0x38 0x38 0x38 0x38 0x38 0x38 0x38 0x38 0x38 0x38 0x38 0x38 0x38 0x38
+ 0x38 0x38 0x38 0x38 0x38 0x38 0x38 0x38 0x38 0x38 0x38 0x38 0x38 0x38 0x38 0x38
+ 0x38 0x38 0x39 0x39 0x39 0x39 0x39 0x39 0x39 0x39 0x39 0x39 0x39 0x39 0x39 0x39
+ 0x39 0x39 0x39 0x39 0x39 0x39 0x39 0x39 0x39 0x39 0x39 0x39 0x39 0x39 0x39 0x39
+ 0x39 0x39 0x3a 0x3a 0x3a 0x3a 0x3a 0x3a 0x3a 0x3a 0x3a 0x3a 0x3a 0x3a 0x3a 0x3a
+ 0x3a 0x3a 0x3a 0x3a 0x3a 0x3a 0x3a 0x3a 0x3a 0x3a 0x3a 0x3a 0x3a 0x3a 0x3a 0x3a
+ 0x3a 0x3a 0x3b 0x3b 0x3b 0x3b 0x3b 0x3b 0x3b 0x3b 0x3b 0x3b 0x3b 0x3b 0x3b 0x3b
+ 0x3b 0x3b 0x3b 0x3b 0x3b 0x3b 0x3b 0x3b 0x3b 0x3b 0x3b 0x3b 0x3b 0x3b 0x3b 0x3b
+ 0x3b 0x3b 0x3c 0x3c 0x3c 0x3c 0x3c 0x3c 0x3c 0x3c 0x3c 0x3c 0x3c 0x3c 0x3c 0x3c
+ 0x3c 0x3c 0x3c 0x3c 0x3c 0x3c 0x3c 0x3c 0x3c 0x3c 0x3c 0x3c 0x3c 0x3c 0x3c 0x3c
+ 0x3c 0x3c 0x3d 0x3d 0x3d 0x3d 0x3d 0x3d 0x3d 0x3d 0x3d 0x3d 0x3d 0x3d 0x3d 0x3d
+ 0x3d 0x3d 0x3d 0x3d 0x3d 0x3d 0x3d 0x3d 0x3d 0x3d 0x3d 0x3d 0x3d 0x3d 0x3d 0x3d
+ 0x3d 0x3d 0x3e 0x3e 0x3e 0x3e 0x3e 0x3e 0x3e 0x3e 0x3e 0x3e 0x3e 0x3e 0x3e 0x3e
+ 0x3e 0x3e 0x3e 0x3e 0x3e 0x3e 0x3e 0x3e 0x3e 0x3e 0x3e 0x3e 0x3e 0x3e 0x3e 0x3e
+ 0x3e 0x3e 0x3f 0x3f 0x3f 0x3f 0x3f 0x3f 0x3f 0x3f 0x3f 0x3f 0x3f 0x3f 0x3f 0x3f
+ 0x3f 0x3f 0x3f 0x3f 0x3f 0x3f 0x3f 0x3f 0x3f 0x3f 0x3f 0x3f 0x3f 0x3f 0x3f 0x3f
+ 0x3f 0x3f 0x40 0x40 0x40 0x40 0x40 0x40 0x40 0x40 0x40 0x40 0x40 0x40 0x40 0x40
+ 0x40 0x40 0x41 0x41 0x41 0x41 0x41 0x41 0x41 0x41 0x41 0x41 0x41 0x41 0x41 0x41
+ 0x41 0x41 0x42 0x42 0x42 0x42 0x42 0x42 0x42 0x42 0x42 0x42 0x42 0x42 0x42 0x42
+ 0x42 0x42 0x43 0x43 0x43 0x43 0x43 0x43 0x43 0x43 0x43 0x43 0x43 0x43 0x43 0x43
+ 0x43 0x43 0x44 0x44 0x44 0x44 0x44 0x44 0x44 0x44 0x44 0x44 0x44 0x44 0x44 0x44
+ 0x44 0x44 0x45 0x45 0x45 0x45 0x45 0x45 0x45 0x45 0x45 0x45 0x45 0x45 0x45 0x45
+ 0x45 0x45 0x46 0x46 0x46 0x46 0x46 0x46 0x46 0x46 0x46 0x46 0x46 0x46 0x46 0x46
+ 0x46 0x46 0x47 0x47 0x47 0x47 0x47 0x47 0x47 0x47 0x47 0x47 0x47 0x47 0x47 0x47
+ 0x47 0x47 0x48 0x48 0x48 0x48 0x48 0x48 0x48 0x48 0x48 0x48 0x48 0x48 0x48 0x48
+ 0x48 0x48 0x49 0x49 0x49 0x49 0x49 0x49 0x49 0x49 0x49 0x49 0x49 0x49 0x49 0x49
+ 0x49 0x49 0x4a 0x4a 0x4a 0x4a 0x4a 0x4a 0x4a 0x4a 0x4a 0x4a 0x4a 0x4a 0x4a 0x4a
+ 0x4a 0x4a 0x4b 0x4b 0x4b 0x4b 0x4b 0x4b 0x4b 0x4b 0x4b 0x4b 0x4b 0x4b 0x4b 0x4b
+ 0x4b 0x4b 0x4c 0x4c 0x4c 0x4c 0x4c 0x4c 0x4c 0x4c 0x4c 0x4c 0x4c 0x4c 0x4c 0x4c
+ 0x4c 0x4c 0x4d 0x4d 0x4d 0x4d 0x4d 0x4d 0x4d 0x4d 0x4d 0x4d 0x4d 0x4d 0x4d 0x4d
+ 0x4d 0x4d 0x4e 0x4e 0x4e 0x4e 0x4e 0x4e 0x4e 0x4e 0x4e 0x4e 0x4e 0x4e 0x4e 0x4e
+ 0x4e 0x4e 0x4f 0x4f 0x4f 0x4f 0x4f 0x4f 0x4f 0x4f 0x4f 0x4f 0x4f 0x4f 0x4f 0x4f
+ 0x4f 0x4f 0x50 0x50 0x50 0x50 0x50 0x50 0x50 0x50 0x51 0x51 0x51 0x51 0x51 0x51
+ 0x51 0x51 0x52 0x52 0x52 0x52 0x52 0x52 0x52 0x52 0x53 0x53 0x53 0x53 0x53 0x53
+ 0x53 0x53 0x54 0x54 0x54 0x54 0x54 0x54 0x54 0x54 0x55 0x55 0x55 0x55 0x55 0x55
+ 0x55 0x55 0x56 0x56 0x56 0x56 0x56 0x56 0x56 0x56 0x57 0x57 0x57 0x57 0x57 0x57
+ 0x57 0x57 0x58 0x58 0x58 0x58 0x58 0x58 0x58 0x58 0x59 0x59 0x59 0x59 0x59 0x59
+ 0x59 0x59 0x5a 0x5a 0x5a 0x5a 0x5a 0x5a 0x5a 0x5a 0x5b 0x5b 0x5b 0x5b 0x5b 0x5b
+ 0x5b 0x5b 0x5c 0x5c 0x5c 0x5c 0x5c 0x5c 0x5c 0x5c 0x5d 0x5d 0x5d 0x5d 0x5d 0x5d
+ 0x5d 0x5d 0x5e 0x5e 0x5e 0x5e 0x5e 0x5e 0x5e 0x5e 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f
+ 0x5f 0x5f 0x60 0x60 0x60 0x60 0x61 0x61 0x61 0x61 0x62 0x62 0x62 0x62 0x63 0x63
+ 0x63 0x63 0x64 0x64 0x64 0x64 0x65 0x65 0x65 0x65 0x66 0x66 0x66 0x66 0x67 0x67
+ 0x67 0x67 0x68 0x68 0x68 0x68 0x69 0x69 0x69 0x69 0x6a 0x6a 0x6a 0x6a 0x6b 0x6b
+ 0x6b 0x6b 0x6c 0x6c 0x6c 0x6c 0x6d 0x6d 0x6d 0x6d 0x6e 0x6e 0x6e 0x6e 0x6f 0x6f
+ 0x6f 0x6f 0x70 0x70 0x71 0x71 0x72 0x72 0x73 0x73 0x74 0x74 0x75 0x75 0x76 0x76
+ 0x77 0x77 0x78 0x78 0x79 0x79 0x7a 0x7a 0x7b 0x7b 0x7c 0x7c 0x7d 0x7d 0x7e 0x7e
+ 0xff 0xfe 0xfe 0xfd 0xfd 0xfc 0xfc 0xfb 0xfb 0xfa 0xfa 0xf9 0xf9 0xf8 0xf8 0xf7
+ 0xf7 0xf6 0xf6 0xf5 0xf5 0xf4 0xf4 0xf3 0xf3 0xf2 0xf2 0xf1 0xf1 0xf0 0xf0 0xef
+ 0xef 0xef 0xef 0xee 0xee 0xee 0xee 0xed 0xed 0xed 0xed 0xec 0xec 0xec 0xec 0xeb
+ 0xeb 0xeb 0xeb 0xea 0xea 0xea 0xea 0xe9 0xe9 0xe9 0xe9 0xe8 0xe8 0xe8 0xe8 0xe7
+ 0xe7 0xe7 0xe7 0xe6 0xe6 0xe6 0xe6 0xe5 0xe5 0xe5 0xe5 0xe4 0xe4 0xe4 0xe4 0xe3
+ 0xe3 0xe3 0xe3 0xe2 0xe2 0xe2 0xe2 0xe1 0xe1 0xe1 0xe1 0xe0 0xe0 0xe0 0xe0 0xdf
+ 0xdf 0xdf 0xdf 0xdf 0xdf 0xdf 0xdf 0xde 0xde 0xde 0xde 0xde 0xde 0xde 0xde 0xdd
+ 0xdd 0xdd 0xdd 0xdd 0xdd 0xdd 0xdd 0xdc 0xdc 0xdc 0xdc 0xdc 0xdc 0xdc 0xdc 0xdb
+ 0xdb 0xdb 0xdb 0xdb 0xdb 0xdb 0xdb 0xda 0xda 0xda 0xda 0xda 0xda 0xda 0xda 0xd9
+ 0xd9 0xd9 0xd9 0xd9 0xd9 0xd9 0xd9 0xd8 0xd8 0xd8 0xd8 0xd8 0xd8 0xd8 0xd8 0xd7
+ 0xd7 0xd7 0xd7 0xd7 0xd7 0xd7 0xd7 0xd6 0xd6 0xd6 0xd6 0xd6 0xd6 0xd6 0xd6 0xd5
+ 0xd5 0xd5 0xd5 0xd5 0xd5 0xd5 0xd5 0xd4 0xd4 0xd4 0xd4 0xd4 0xd4 0xd4 0xd4 0xd3
+ 0xd3 0xd3 0xd3 0xd3 0xd3 0xd3 0xd3 0xd2 0xd2 0xd2 0xd2 0xd2 0xd2 0xd2 0xd2 0xd1
+ 0xd1 0xd1 0xd1 0xd1 0xd1 0xd1 0xd1 0xd0 0xd0 0xd0 0xd0 0xd0 0xd0 0xd0 0xd0 0xcf
+ 0xcf 0xcf 0xcf 0xcf 0xcf 0xcf 0xcf 0xcf 0xcf 0xcf 0xcf 0xcf 0xcf 0xcf 0xcf 0xce
+ 0xce 0xce 0xce 0xce 0xce 0xce 0xce 0xce 0xce 0xce 0xce 0xce 0xce 0xce 0xce 0xcd
+ 0xcd 0xcd 0xcd 0xcd 0xcd 0xcd 0xcd 0xcd 0xcd 0xcd 0xcd 0xcd 0xcd 0xcd 0xcd 0xcc
+ 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcb
+ 0xcb 0xcb 0xcb 0xcb 0xcb 0xcb 0xcb 0xcb 0xcb 0xcb 0xcb 0xcb 0xcb 0xcb 0xcb 0xca
+ 0xca 0xca 0xca 0xca 0xca 0xca 0xca 0xca 0xca 0xca 0xca 0xca 0xca 0xca 0xca 0xc9
+ 0xc9 0xc9 0xc9 0xc9 0xc9 0xc9 0xc9 0xc9 0xc9 0xc9 0xc9 0xc9 0xc9 0xc9 0xc9 0xc8
+ 0xc8 0xc8 0xc8 0xc8 0xc8 0xc8 0xc8 0xc8 0xc8 0xc8 0xc8 0xc8 0xc8 0xc8 0xc8 0xc7
+ 0xc7 0xc7 0xc7 0xc7 0xc7 0xc7 0xc7 0xc7 0xc7 0xc7 0xc7 0xc7 0xc7 0xc7 0xc7 0xc6
+ 0xc6 0xc6 0xc6 0xc6 0xc6 0xc6 0xc6 0xc6 0xc6 0xc6 0xc6 0xc6 0xc6 0xc6 0xc6 0xc5
+ 0xc5 0xc5 0xc5 0xc5 0xc5 0xc5 0xc5 0xc5 0xc5 0xc5 0xc5 0xc5 0xc5 0xc5 0xc5 0xc4
+ 0xc4 0xc4 0xc4 0xc4 0xc4 0xc4 0xc4 0xc4 0xc4 0xc4 0xc4 0xc4 0xc4 0xc4 0xc4 0xc3
+ 0xc3 0xc3 0xc3 0xc3 0xc3 0xc3 0xc3 0xc3 0xc3 0xc3 0xc3 0xc3 0xc3 0xc3 0xc3 0xc2
+ 0xc2 0xc2 0xc2 0xc2 0xc2 0xc2 0xc2 0xc2 0xc2 0xc2 0xc2 0xc2 0xc2 0xc2 0xc2 0xc1
+ 0xc1 0xc1 0xc1 0xc1 0xc1 0xc1 0xc1 0xc1 0xc1 0xc1 0xc1 0xc1 0xc1 0xc1 0xc1 0xc0
+ 0xc0 0xc0 0xc0 0xc0 0xc0 0xc0 0xc0 0xc0 0xc0 0xc0 0xc0 0xc0 0xc0 0xc0 0xc0 0xbf
+ 0xbf 0xbf 0xbf 0xbf 0xbf 0xbf 0xbf 0xbf 0xbf 0xbf 0xbf 0xbf 0xbf 0xbf 0xbf 0xbf
+ 0xbf 0xbf 0xbf 0xbf 0xbf 0xbf 0xbf 0xbf 0xbf 0xbf 0xbf 0xbf 0xbf 0xbf 0xbf 0xbe
+ 0xbe 0xbe 0xbe 0xbe 0xbe 0xbe 0xbe 0xbe 0xbe 0xbe 0xbe 0xbe 0xbe 0xbe 0xbe 0xbe
+ 0xbe 0xbe 0xbe 0xbe 0xbe 0xbe 0xbe 0xbe 0xbe 0xbe 0xbe 0xbe 0xbe 0xbe 0xbe 0xbd
+ 0xbd 0xbd 0xbd 0xbd 0xbd 0xbd 0xbd 0xbd 0xbd 0xbd 0xbd 0xbd 0xbd 0xbd 0xbd 0xbd
+ 0xbd 0xbd 0xbd 0xbd 0xbd 0xbd 0xbd 0xbd 0xbd 0xbd 0xbd 0xbd 0xbd 0xbd 0xbd 0xbc
+ 0xbc 0xbc 0xbc 0xbc 0xbc 0xbc 0xbc 0xbc 0xbc 0xbc 0xbc 0xbc 0xbc 0xbc 0xbc 0xbc
+ 0xbc 0xbc 0xbc 0xbc 0xbc 0xbc 0xbc 0xbc 0xbc 0xbc 0xbc 0xbc 0xbc 0xbc 0xbc 0xbb
+ 0xbb 0xbb 0xbb 0xbb 0xbb 0xbb 0xbb 0xbb 0xbb 0xbb 0xbb 0xbb 0xbb 0xbb 0xbb 0xbb
+ 0xbb 0xbb 0xbb 0xbb 0xbb 0xbb 0xbb 0xbb 0xbb 0xbb 0xbb 0xbb 0xbb 0xbb 0xbb 0xba
+ 0xba 0xba 0xba 0xba 0xba 0xba 0xba 0xba 0xba 0xba 0xba 0xba 0xba 0xba 0xba 0xba
+ 0xba 0xba 0xba 0xba 0xba 0xba 0xba 0xba 0xba 0xba 0xba 0xba 0xba 0xba 0xba 0xb9
+ 0xb9 0xb9 0xb9 0xb9 0xb9 0xb9 0xb9 0xb9 0xb9 0xb9 0xb9 0xb9 0xb9 0xb9 0xb9 0xb9
+ 0xb9 0xb9 0xb9 0xb9 0xb9 0xb9 0xb9 0xb9 0xb9 0xb9 0xb9 0xb9 0xb9 0xb9 0xb9 0xb8
+ 0xb8 0xb8 0xb8 0xb8 0xb8 0xb8 0xb8 0xb8 0xb8 0xb8 0xb8 0xb8 0xb8 0xb8 0xb8 0xb8
+ 0xb8 0xb8 0xb8 0xb8 0xb8 0xb8 0xb8 0xb8 0xb8 0xb8 0xb8 0xb8 0xb8 0xb8 0xb8 0xb7
+ 0xb7 0xb7 0xb7 0xb7 0xb7 0xb7 0xb7 0xb7 0xb7 0xb7 0xb7 0xb7 0xb7 0xb7 0xb7 0xb7
+ 0xb7 0xb7 0xb7 0xb7 0xb7 0xb7 0xb7 0xb7 0xb7 0xb7 0xb7 0xb7 0xb7 0xb7 0xb7 0xb6
+ 0xb6 0xb6 0xb6 0xb6 0xb6 0xb6 0xb6 0xb6 0xb6 0xb6 0xb6 0xb6 0xb6 0xb6 0xb6 0xb6
+ 0xb6 0xb6 0xb6 0xb6 0xb6 0xb6 0xb6 0xb6 0xb6 0xb6 0xb6 0xb6 0xb6 0xb6 0xb6 0xb5
+ 0xb5 0xb5 0xb5 0xb5 0xb5 0xb5 0xb5 0xb5 0xb5 0xb5 0xb5 0xb5 0xb5 0xb5 0xb5 0xb5
+ 0xb5 0xb5 0xb5 0xb5 0xb5 0xb5 0xb5 0xb5 0xb5 0xb5 0xb5 0xb5 0xb5 0xb5 0xb5 0xb4
+ 0xb4 0xb4 0xb4 0xb4 0xb4 0xb4 0xb4 0xb4 0xb4 0xb4 0xb4 0xb4 0xb4 0xb4 0xb4 0xb4
+ 0xb4 0xb4 0xb4 0xb4 0xb4 0xb4 0xb4 0xb4 0xb4 0xb4 0xb4 0xb4 0xb4 0xb4 0xb4 0xb3
+ 0xb3 0xb3 0xb3 0xb3 0xb3 0xb3 0xb3 0xb3 0xb3 0xb3 0xb3 0xb3 0xb3 0xb3 0xb3 0xb3
+ 0xb3 0xb3 0xb3 0xb3 0xb3 0xb3 0xb3 0xb3 0xb3 0xb3 0xb3 0xb3 0xb3 0xb3 0xb3 0xb2
+ 0xb2 0xb2 0xb2 0xb2 0xb2 0xb2 0xb2 0xb2 0xb2 0xb2 0xb2 0xb2 0xb2 0xb2 0xb2 0xb2
+ 0xb2 0xb2 0xb2 0xb2 0xb2 0xb2 0xb2 0xb2 0xb2 0xb2 0xb2 0xb2 0xb2 0xb2 0xb2 0xb1
+ 0xb1 0xb1 0xb1 0xb1 0xb1 0xb1 0xb1 0xb1 0xb1 0xb1 0xb1 0xb1 0xb1 0xb1 0xb1 0xb1
+ 0xb1 0xb1 0xb1 0xb1 0xb1 0xb1 0xb1 0xb1 0xb1 0xb1 0xb1 0xb1 0xb1 0xb1 0xb1 0xb0
+ 0xb0 0xb0 0xb0 0xb0 0xb0 0xb0 0xb0 0xb0 0xb0 0xb0 0xb0 0xb0 0xb0 0xb0 0xb0 0xb0
+ 0xb0 0xb0 0xb0 0xb0 0xb0 0xb0 0xb0 0xb0 0xb0 0xb0 0xb0 0xb0 0xb0 0xb0 0xb0 0xaf
+ 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf
+ 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf
+ 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf
+ 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xaf 0xae
+ 0xae 0xae 0xae 0xae 0xae 0xae 0xae 0xae 0xae 0xae 0xae 0xae 0xae 0xae 0xae 0xae
+ 0xae 0xae 0xae 0xae 0xae 0xae 0xae 0xae 0xae 0xae 0xae 0xae 0xae 0xae 0xae 0xae
+ 0xae 0xae 0xae 0xae 0xae 0xae 0xae 0xae 0xae 0xae 0xae 0xae 0xae 0xae 0xae 0xae
+ 0xae 0xae 0xae 0xae 0xae 0xae 0xae 0xae 0xae 0xae 0xae 0xae 0xae 0xae 0xae 0xad
+ 0xad 0xad 0xad 0xad 0xad 0xad 0xad 0xad 0xad 0xad 0xad 0xad 0xad 0xad 0xad 0xad
+ 0xad 0xad 0xad 0xad 0xad 0xad 0xad 0xad 0xad 0xad 0xad 0xad 0xad 0xad 0xad 0xad
+ 0xad 0xad 0xad 0xad 0xad 0xad 0xad 0xad 0xad 0xad 0xad 0xad 0xad 0xad 0xad 0xad
+ 0xad 0xad 0xad 0xad 0xad 0xad 0xad 0xad 0xad 0xad 0xad 0xad 0xad 0xad 0xad 0xac
+ 0xac 0xac 0xac 0xac 0xac 0xac 0xac 0xac 0xac 0xac 0xac 0xac 0xac 0xac 0xac 0xac
+ 0xac 0xac 0xac 0xac 0xac 0xac 0xac 0xac 0xac 0xac 0xac 0xac 0xac 0xac 0xac 0xac
+ 0xac 0xac 0xac 0xac 0xac 0xac 0xac 0xac 0xac 0xac 0xac 0xac 0xac 0xac 0xac 0xac
+ 0xac 0xac 0xac 0xac 0xac 0xac 0xac 0xac 0xac 0xac 0xac 0xac 0xac 0xac 0xac 0xab
+ 0xab 0xab 0xab 0xab 0xab 0xab 0xab 0xab 0xab 0xab 0xab 0xab 0xab 0xab 0xab 0xab
+ 0xab 0xab 0xab 0xab 0xab 0xab 0xab 0xab 0xab 0xab 0xab 0xab 0xab 0xab 0xab 0xab
+ 0xab 0xab 0xab 0xab 0xab 0xab 0xab 0xab 0xab 0xab 0xab 0xab 0xab 0xab 0xab 0xab
+ 0xab 0xab 0xab 0xab 0xab 0xab 0xab 0xab 0xab 0xab 0xab 0xab 0xab 0xab 0xab 0xaa
+ 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa
+ 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa
+ 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa
+ 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xaa 0xa9
+ 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9
+ 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9
+ 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9
+ 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa9 0xa8
+ 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8
+ 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8
+ 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8
+ 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa8 0xa7
+ 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7
+ 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7
+ 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7
+ 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa7 0xa6
+ 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6
+ 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6
+ 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6
+ 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa6 0xa5
+ 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5
+ 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5
+ 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5
+ 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa5 0xa4
+ 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4
+ 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4
+ 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4
+ 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa4 0xa3
+ 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3
+ 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3
+ 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3
+ 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa3 0xa2
+ 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2
+ 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2
+ 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2
+ 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa2 0xa1
+ 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1
+ 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1
+ 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1
+ 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa1 0xa0
+ 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0
+ 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0
+ 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0
+ 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0xa0 0x9f
+ 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f
+ 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f
+ 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f
+ 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f
+ 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f
+ 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f
+ 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f
+ 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9f 0x9e
+ 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e
+ 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e
+ 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e
+ 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e
+ 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e
+ 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e
+ 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e
+ 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9e 0x9d
+ 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d
+ 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d
+ 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d
+ 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d
+ 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d
+ 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d
+ 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d
+ 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9d 0x9c
+ 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c
+ 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c
+ 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c
+ 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c
+ 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c
+ 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c
+ 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c
+ 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9c 0x9b
+ 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b
+ 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b
+ 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b
+ 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b
+ 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b
+ 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b
+ 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b
+ 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9b 0x9a
+ 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a
+ 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a
+ 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a
+ 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a
+ 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a
+ 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a
+ 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a
+ 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x9a 0x99
+ 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99
+ 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99
+ 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99
+ 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99
+ 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99
+ 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99
+ 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99
+ 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x99 0x98
+ 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98
+ 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98
+ 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98
+ 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98
+ 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98
+ 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98
+ 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98
+ 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x97
+ 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97
+ 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97
+ 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97
+ 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97
+ 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97
+ 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97
+ 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97
+ 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x97 0x96
+ 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96
+ 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96
+ 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96
+ 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96
+ 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96
+ 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96
+ 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96
+ 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x95
+ 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95
+ 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95
+ 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95
+ 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95
+ 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95
+ 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95
+ 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95
+ 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x95 0x94
+ 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94
+ 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94
+ 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94
+ 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94
+ 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94
+ 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94
+ 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94
+ 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x94 0x93
+ 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93
+ 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93
+ 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93
+ 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93
+ 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93
+ 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93
+ 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93
+ 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x93 0x92
+ 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92
+ 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92
+ 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92
+ 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92
+ 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92
+ 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92
+ 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92
+ 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x92 0x91
+ 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91
+ 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91
+ 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91
+ 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91
+ 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91
+ 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91
+ 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91
+ 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x91 0x90
+ 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90
+ 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90
+ 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90
+ 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90
+ 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90
+ 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90
+ 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90
+ 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x8f
+ 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f
+ 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f
+ 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f
+ 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f
+ 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f
+ 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f
+ 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f
+ 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f
+ 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f
+ 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f
+ 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f
+ 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f
+ 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f
+ 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f
+ 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f
+ 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8f 0x8e
+ 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e
+ 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e
+ 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e
+ 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e
+ 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e
+ 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e
+ 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e
+ 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e
+ 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e
+ 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e
+ 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e
+ 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e
+ 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e
+ 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e
+ 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e
+ 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8e 0x8d
+ 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d
+ 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d
+ 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d
+ 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d
+ 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d
+ 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d
+ 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d
+ 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d
+ 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d
+ 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d
+ 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d
+ 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d
+ 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d
+ 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d
+ 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d
+ 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8d 0x8c
+ 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c
+ 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c
+ 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c
+ 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c
+ 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c
+ 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c
+ 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c
+ 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c
+ 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c
+ 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c
+ 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c
+ 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c
+ 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c
+ 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c
+ 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c
+ 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8c 0x8b
+ 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b
+ 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b
+ 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b
+ 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b
+ 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b
+ 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b
+ 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b
+ 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b
+ 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b
+ 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b
+ 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b
+ 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b
+ 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b
+ 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b
+ 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b
+ 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8b 0x8a
+ 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a
+ 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a
+ 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a
+ 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a
+ 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a
+ 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a
+ 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a
+ 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a
+ 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a
+ 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a
+ 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a
+ 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a
+ 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a
+ 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a
+ 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a
+ 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x8a 0x89
+ 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89
+ 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89
+ 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89
+ 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89
+ 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89
+ 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89
+ 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89
+ 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89
+ 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89
+ 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89
+ 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89
+ 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89
+ 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89
+ 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89
+ 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89
+ 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x89 0x88
+ 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88
+ 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88
+ 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88
+ 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88
+ 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88
+ 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88
+ 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88
+ 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88
+ 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88
+ 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88
+ 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88
+ 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88
+ 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88
+ 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88
+ 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88
+ 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x88 0x87
+ 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87
+ 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87
+ 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87
+ 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87
+ 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87
+ 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87
+ 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87
+ 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87
+ 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87
+ 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87
+ 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87
+ 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87
+ 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87
+ 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87
+ 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87
+ 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x87 0x86
+ 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86
+ 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86
+ 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86
+ 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86
+ 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86
+ 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86
+ 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86
+ 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86
+ 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86
+ 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86
+ 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86
+ 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86
+ 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86
+ 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86
+ 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86
+ 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x86 0x85
+ 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85
+ 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85
+ 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85
+ 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85
+ 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85
+ 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85
+ 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85
+ 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85
+ 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85
+ 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85
+ 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85
+ 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85
+ 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85
+ 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85
+ 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85
+ 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x85 0x84
+ 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84
+ 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84
+ 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84
+ 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84
+ 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84
+ 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84
+ 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84
+ 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84
+ 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84
+ 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84
+ 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84
+ 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84
+ 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84
+ 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84
+ 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84
+ 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x84 0x83
+ 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83
+ 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83
+ 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83
+ 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83
+ 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83
+ 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83
+ 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83
+ 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83
+ 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83
+ 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83
+ 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83
+ 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83
+ 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83
+ 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83
+ 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83
+ 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x83 0x82
+ 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82
+ 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82
+ 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82
+ 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82
+ 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82
+ 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82
+ 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82
+ 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82
+ 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82
+ 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82
+ 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82
+ 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82
+ 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82
+ 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82
+ 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82
+ 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x82 0x81
+ 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81
+ 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81
+ 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81
+ 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81
+ 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81
+ 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81
+ 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81
+ 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81
+ 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81
+ 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81
+ 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81
+ 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81
+ 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81
+ 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81
+ 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81
+ 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x81 0x80
+ 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80
+ 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80
+ 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80
+ 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80
+ 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80
+ 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80
+ 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80
+ 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80
+ 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80
+ 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80
+ 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80
+ 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80
+ 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80
+ 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80
+ 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80
+ 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80
+ 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80
+ 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80
+)
+
+# base64 handling stuff
+typeset -r base64chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
+
+function bytearraytobase64
+{
+ nameref bytearray=$1
+ typeset out=""
+ integer len
+ integer i i0 i1 i2
+
+ (( len=${#bytearray[*]}-1 ))
+ for (( i=0 ; i < len ; i+=3 )) ; do
+ (( i0=bytearray[i+0] , i1=bytearray[i+1] , i2=bytearray[i+2] ))
+
+ out+="${base64chars:$(( i0 >> 2 )):1}"
+ out+="${base64chars:$(( ((i0 & 0x03) << 4) | ((i1 & 0xf0) >> 4) )):1}"
+ (( (i+1) < len )) && { out+="${base64chars:$(( ((i1 & 0x0f) << 2) | ((i2 & 0xc0) >> 6) )):1}" ; } || out+="="
+ (( (i+2) < len )) && { out+="${base64chars:$(( i2 & 0x3f )):1}" ; } || out+="="
+ done
+
+ printf "%s" "${out}"
+ return 0
+}
+
+
+# stack layout:
+# stack.currpos = current position
+# stack.data = nameref to integer array
+function stack_init
+{
+ nameref stk=$1
+ stk.currpos=0
+ return 0
+}
+
+function stack_put_byte
+{
+ nameref stk=$1
+ stk.data[stk.currpos++]=$(( $2 & 0xFF ))
+ return 0
+}
+
+function stack_put_uint16
+{
+ integer val=$2
+ stack_put_byte $1 $(( (val >> 8) & 0xFF ))
+ stack_put_byte $1 $(( val & 0xFF ))
+ return 0
+}
+
+# put an au(4) header on a stack variable
+function audio_put_au_header
+{
+ nameref au=$1
+
+ # au_magic: magic number
+ stack_put_byte au $(('.'))
+ stack_put_byte au $(('s'))
+ stack_put_byte au $(('n'))
+ stack_put_byte au $(('d'))
+ # au_offset
+ stack_put_byte au 0x00
+ stack_put_byte au 0x00
+ stack_put_byte au 0x00
+ stack_put_byte au 0x1C
+ # au_data_size (0xFFFFFFFF = AUDIO_AU_UNKNOWN_SIZE ((unsigned)(~0)))
+ stack_put_byte au 0xFF
+ stack_put_byte au 0xFF
+ stack_put_byte au 0xFF
+ stack_put_byte au 0xFF
+ # au_encoding
+ stack_put_byte au 0x00
+ stack_put_byte au 0x00
+ stack_put_byte au 0x00
+ stack_put_byte au 1
+ # au_sample_rate
+ stack_put_byte au 0x00
+ stack_put_byte au 0x00
+ stack_put_byte au 0x1f
+ stack_put_byte au 0x40
+ # au_channels
+ stack_put_byte au 0x00
+ stack_put_byte au 0x00
+ stack_put_byte au 0x00
+ stack_put_byte au 0x01
+ # dummy
+ stack_put_byte au 0
+ stack_put_byte au 0
+ stack_put_byte au 0
+ stack_put_byte au 0
+ return 0
+}
+
+function print_piano_layout
+{
+ cat <<ENDOFTEXT
+----------------------------------------------------
+ | ##### ##### | ##### ##### ##### |
+ | ##### ##### | ##### ##### ##### |
+ | ##### ##### | ##### ##### ##### |
+ | #cis# #dis# | #fis# #gis# #ais# |
+ | #des# # es# | #ges# # as# # b # |
+ | \###/ \###/ | \###/ \###/ \###/ |
+ | | | | | | | |
+ | | | | | | | |
+ | c | d | e | f | g | a | h |
+ | | | | | | | |
+/\-----/\-----/\-----/\-----/\-----/\-----/\-----/\-
+
+Keys:
+ R T U I O
+ D F G H J K L
+ENDOFTEXT
+ return 0
+}
+
+function usage
+{
+ OPTIND=0
+ getopts -a "${progname}" "${shpiano_usage}" OPT '-?'
+ exit 2
+}
+
+# program start
+builtin basename
+
+typeset progname="${ basename "${0}" ; }"
+
+typeset -r shpiano_usage=$'+
+[-?\n@(#)\$Id: shpiano (Roland Mainz) 2008-11-03 \$\n]
+[-author?Roland Mainz <roland.mainz@nrubsig.org>]
+[+NAME?shpiano - simple audio demo]
+[+DESCRIPTION?\bshpiano\b is a small demo application which converts
+ keyboard input into 8bit Mu-law audio samples which are
+ send to /dev/audio.]
+[+SEE ALSO?\bksh93\b(1), \bau\b(4), \baudio\b(7i)]
+'
+
+while getopts -a "${progname}" "${shpiano_usage}" OPT ; do
+# printmsg "## OPT=|${OPT}|, OPTARG=|${OPTARG}|"
+ case ${OPT} in
+ *) usage ;;
+ esac
+done
+shift $((OPTIND-1))
+
+float -r M_PI=3.14159265358979323846
+
+float sample_rate=8000.
+float duration=0.10
+float freq
+float w # temporary "wave" value
+integer i
+integer audiofd # audio device file descriptor
+typeset key
+typeset audio=( typeset -i currpos=0 ; typeset -a -i data=( [0]=0 ) ) # stack object
+
+clear
+print_piano_layout
+
+if [[ "${AUDIODEV}" == "" ]] ; then
+ AUDIODEV="/dev/audio"
+fi
+print -u2 -f $"Playing sound to device\n" "${AUDIODEV}"
+
+# open channel to audio device
+redirect {audiofd}<>"${AUDIODEV}"
+(( $? != 0 )) && fatal_error $"Couldn't open audio device."
+
+# build pause sample
+stack_init audio
+for ((i=0 ; i < ((sample_rate*duration)/2.) ; i++)) ; do
+ stack_put_byte audio 0
+done
+typeset -b pause_sample=${ bytearraytobase64 audio.data ; }
+
+stack_init audio
+audio_put_au_header audio
+typeset -b au_header=${ bytearraytobase64 audio.data ; }
+
+# begin playing
+printf "%B" au_header >&${audiofd}
+
+# warning: the math used here is so wrong that your head may
+# explode when you continue reading this
+while read -r -N 1 key?$'\r > ' ; do
+ if [[ ${key} == ~(E)($'\E'|'q'|'Q') ]] ; then
+ break # quit
+ fi
+
+ printf "\r"
+ if [[ -z "${notes[key_${key}]}" ]] ; then
+ nameref curr_note=tones["p"]
+ (( freq=1.*(1./duration) ))
+ else
+ nameref curr_note="${notes[key_${key}].val}"
+ (( freq=curr_note.freq ))
+ fi
+
+# printf "note=%s sample_rate=%f, freq=%f\n" "${!curr_note}" sample_rate freq >&2
+
+ # Create sample data if they didn't exist yet and
+ # store them in the "tones" array
+ if ! ${curr_note.sample_set} ; then
+ stack_init audio
+
+ for ((i=0 ; i < (sample_rate*duration) ; i++)) ; do
+ # first create the sinus wave...
+ (( w=sin( ((i*freq)/sample_rate) * (2.*M_PI)) ))
+ # ...scale it to 14bit signed PCM linear and...
+ (( w=8192.+w*8191. ))
+ # ...then convert it to 8bit ulaw
+ # ("audio_pcmulinear14bittoulaw8bit" is unsigned but we use
+ # "8192" above as starting point to do the "signed to unsigned"
+ # conversion) ...
+ stack_put_byte audio $(( audio_pcmulinear14bittoulaw8bit[int(w)] ))
+ done
+
+ curr_note.sample=${ bytearraytobase64 audio.data ; }
+ curr_note.sample_set="true"
+ fi
+
+ # output sample
+ {
+ printf "%B" curr_note.sample
+ printf "%B" pause_sample
+ } >&${audiofd}
+done
+
+# close audio device
+redirect {audiofd}<&-
+
+print -u2 $"# done."
+exit 0
+#EOF.
diff --git a/usr/src/lib/libshell/common/scripts/shtinyurl.sh b/usr/src/lib/libshell/common/scripts/shtinyurl.sh
new file mode 100644
index 0000000000..1d3e70bf67
--- /dev/null
+++ b/usr/src/lib/libshell/common/scripts/shtinyurl.sh
@@ -0,0 +1,202 @@
+#!/usr/bin/ksh93
+
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+# Solaris needs /usr/xpg6/bin:/usr/xpg4/bin because the tools in /usr/bin are not POSIX-conformant
+export PATH=/usr/xpg6/bin:/usr/xpg4/bin:/bin:/usr/bin
+
+# Make sure all math stuff runs in the "C" locale to avoid problems
+# with alternative # radix point representations (e.g. ',' instead of
+# '.' in de_DE.*-locales). This needs to be set _before_ any
+# floating-point constants are defined in this script).
+if [[ "${LC_ALL}" != "" ]] ; then
+ export \
+ LC_MONETARY="${LC_ALL}" \
+ LC_MESSAGES="${LC_ALL}" \
+ LC_COLLATE="${LC_ALL}" \
+ LC_CTYPE="${LC_ALL}"
+ unset LC_ALL
+fi
+export LC_NUMERIC=C
+
+function fatal_error
+{
+ print -u2 "${progname}: $*"
+ exit 1
+}
+
+# parse HTTP return code, cookies etc.
+function parse_http_response
+{
+ nameref response="$1"
+ typeset h statuscode statusmsg i
+
+ # we use '\r' as additional IFS to filter the final '\r'
+ IFS=$' \t\r' read -r h statuscode statusmsg # read HTTP/1.[01] <code>
+ [[ "$h" != ~(Eil)HTTP/.* ]] && { print -u2 -f $"%s: HTTP/ header missing\n" "$0" ; return 1 ; }
+ [[ "$statuscode" != ~(Elr)[0-9]* ]] && { print -u2 -f $"%s: invalid status code\n" "$0" ; return 1 ; }
+ response.statuscode="$statuscode"
+ response.statusmsg="$statusmsg"
+
+ # skip remaining headers
+ while IFS='' read -r i ; do
+ [[ "$i" == $'\r' ]] && break
+
+ # strip '\r' at the end
+ i="${i/~(Er)$'\r'/}"
+
+ case "$i" in
+ ~(Eli)Content-Type:.*)
+ response.content_type="${i/~(El).*:[[:blank:]]*/}"
+ ;;
+ ~(Eli)Content-Length:[[:blank:]]*[0-9]*)
+ integer response.content_length="${i/~(El).*:[[:blank:]]*/}"
+ ;;
+ ~(Eli)Transfer-Encoding:.*)
+ response.transfer_encoding="${i/~(El).*:[[:blank:]]*/}"
+ ;;
+ esac
+ done
+
+ return 0
+}
+
+function cat_http_body
+{
+ typeset emode="$1"
+ typeset hexchunksize="0"
+ integer chunksize=0
+
+ if [[ "${emode}" == "chunked" ]] ; then
+ while IFS=$'\r' read hexchunksize &&
+ [[ "${hexchunksize}" == ~(Elri)[0-9abcdef]* ]] &&
+ (( chunksize=16#${hexchunksize} )) && (( chunksize > 0 )) ; do
+ dd bs=1 count="${chunksize}" 2>/dev/null
+ done
+ else
+ cat
+ fi
+
+ return 0
+}
+
+function request_tinyurl
+{
+ # site setup
+ typeset url_host="tinyurl.com"
+ typeset url_path="/api-create.php"
+ typeset url="http://${url_host}${url_path}"
+ integer netfd # http stream number
+ typeset inputurl="$1"
+ typeset -C httpresponse # http response
+ typeset request=""
+
+ # we assume "inputurl" is a correctly encoded URL which doesn't
+ # require any further mangling
+ url_path+="?url=${inputurl}"
+
+ request="GET ${url_path} HTTP/1.1\r\n"
+ request+="Host: ${url_host}\r\n"
+ request+="User-Agent: ${http_user_agent}\r\n"
+ request+="Connection: close\r\n"
+
+ redirect {netfd}<>"/dev/tcp/${url_host}/80"
+ (( $? != 0 )) && { print -u2 -f $"%s: Couldn't open connection to %s.\n" "$0" "${url_host}" ; return 1 ; }
+
+ # send http post
+ {
+ print -n -- "${request}\r\n"
+ } >&${netfd}
+
+ # process reply
+ parse_http_response httpresponse <&${netfd}
+ response="${ cat_http_body "${httpresponse.transfer_encoding}" <&${netfd} ; }"
+
+ # close connection
+ redirect {netfd}<&-
+
+ if (( httpresponse.statuscode >= 200 && httpresponse.statuscode <= 299 )) ; then
+ print -r -- "${response}"
+ return 0
+ else
+ print -u2 -f $"tinyurl response was (%s,%s):\n%s\n" "${httpresponse.statuscode}" "${httpresponse.statusmsg}" "${response}"
+ return 1
+ fi
+
+ # not reached
+}
+
+function usage
+{
+ OPTIND=0
+ getopts -a "${progname}" "${shtinyurl_usage}" OPT '-?'
+ exit 2
+}
+
+# program start
+builtin basename
+builtin cat
+builtin date
+builtin uname
+
+typeset progname="${ basename "${0}" ; }"
+
+# HTTP protocol client identifer
+typeset -r http_user_agent="shtinyurl/ksh93 (2008-10-14; ${ uname -s -r -p ; })"
+
+typeset -r shtinyurl_usage=$'+
+[-?\n@(#)\$Id: shtinyurl (Roland Mainz) 2008-10-14 \$\n]
+[-author?Roland Mainz <roland.mainz@nrubsig.org>]
+[+NAME?shtinyurl - create short tinyurl.com alias URL from long URL]
+[+DESCRIPTION?\bshtinyurl\b is a small utility which passes a given URL
+ to the tinyurl.com service which creates short aliases in the
+ form of http://tinyurl.com/XXXXXXXX to redirect long URLs.]
+[+?The first arg \burl\b describes a long URL which is transformed into
+ a tinyurl.com short alias.]
+
+url
+
+[+SEE ALSO?\bksh93\b(1), \brssread\b(1), \bshtwitter\b(1), http://www.tinyurl.com]
+'
+
+while getopts -a "${progname}" "${shtinyurl_usage}" OPT ; do
+# printmsg "## OPT=|${OPT}|, OPTARG=|${OPTARG}|"
+ case ${OPT} in
+ *) usage ;;
+ esac
+done
+shift $((OPTIND-1))
+
+# expecting at least one more argument
+(($# >= 1)) || usage
+
+typeset url="$1"
+shift
+
+request_tinyurl "${url}"
+exit $?
+# EOF.
diff --git a/usr/src/lib/libshell/common/scripts/shtwitter.sh b/usr/src/lib/libshell/common/scripts/shtwitter.sh
new file mode 100644
index 0000000000..9eca33bcbd
--- /dev/null
+++ b/usr/src/lib/libshell/common/scripts/shtwitter.sh
@@ -0,0 +1,358 @@
+#!/usr/bin/ksh93
+
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+# Solaris needs /usr/xpg6/bin:/usr/xpg4/bin because the tools in /usr/bin are not POSIX-conformant
+export PATH=/usr/xpg6/bin:/usr/xpg4/bin:/bin:/usr/bin
+
+# Make sure all math stuff runs in the "C" locale to avoid problems
+# with alternative # radix point representations (e.g. ',' instead of
+# '.' in de_DE.*-locales). This needs to be set _before_ any
+# floating-point constants are defined in this script).
+if [[ "${LC_ALL}" != "" ]] ; then
+ export \
+ LC_MONETARY="${LC_ALL}" \
+ LC_MESSAGES="${LC_ALL}" \
+ LC_COLLATE="${LC_ALL}" \
+ LC_CTYPE="${LC_ALL}"
+ unset LC_ALL
+fi
+export LC_NUMERIC=C
+
+function fatal_error
+{
+ print -u2 "${progname}: $*"
+ exit 1
+}
+
+function encode_x_www_form_urlencoded
+{
+ nameref formdata=$1
+ nameref content="formdata.content"
+ integer numformelements=${#formdata.form[*]}
+ integer i j
+
+ content=""
+
+ for (( i=0 ; i < numformelements ; i++ )) ; do
+ nameref element="formdata.form[${i}]"
+ typeset data="${element.data}"
+ integer datalen="${#data}"
+ typeset c
+
+ [[ "$content" != "" ]] && content+="&"
+
+ content+="${element.name}="
+
+ for ((j=0 ; j < datalen ; j++)) ; do
+ c="${data:j:1}"
+ case "$c" in
+ ' ') c="+" ;;
+ '!') c="%21" ;;
+ '*') c="%2A" ;;
+ "'") c="%27" ;;
+ '(') c="%28" ;;
+ ')') c="%29" ;;
+ ';') c="%3B" ;;
+ ':') c="%3A" ;;
+ '@') c="%40" ;;
+ '&') c="%26" ;;
+ '=') c="%3D" ;;
+ '+') c="%2B" ;;
+ '$') c="%24" ;;
+ ',') c="%2C" ;;
+ '/') c="%2F" ;;
+ '?') c="%3F" ;;
+ '%') c="%25" ;;
+ '#') c="%23" ;;
+ '[') c="%5B" ;;
+ '\') c="%5C" ;; # we need this to avoid the '\'-quoting hell
+ ']') c="%5D" ;;
+ *) ;;
+ esac
+ content+="$c"
+ done
+ done
+
+ formdata.content_length=${#content}
+
+ return 0
+}
+
+# parse HTTP return code, cookies etc.
+function parse_http_response
+{
+ nameref response="$1"
+ typeset h statuscode statusmsg i
+
+ # we use '\r' as additional IFS to filter the final '\r'
+ IFS=$' \t\r' read -r h statuscode statusmsg # read HTTP/1.[01] <code>
+ [[ "$h" != ~(Eil)HTTP/.* ]] && { print -u2 -f $"%s: HTTP/ header missing\n" "$0" ; return 1 ; }
+ [[ "$statuscode" != ~(Elr)[0-9]* ]] && { print -u2 -f $"%s: invalid status code\n" "$0" ; return 1 ; }
+ response.statuscode="$statuscode"
+ response.statusmsg="$statusmsg"
+
+ # skip remaining headers
+ while IFS='' read -r i ; do
+ [[ "$i" == $'\r' ]] && break
+
+ # strip '\r' at the end
+ i="${i/~(Er)$'\r'/}"
+
+ case "$i" in
+ ~(Eli)Content-Type:.*)
+ response.content_type="${i/~(El).*:[[:blank:]]*/}"
+ ;;
+ ~(Eli)Content-Length:[[:blank:]]*[0-9]*)
+ integer response.content_length="${i/~(El).*:[[:blank:]]*/}"
+ ;;
+ ~(Eli)Transfer-Encoding:.*)
+ response.transfer_encoding="${i/~(El).*:[[:blank:]]*/}"
+ ;;
+ esac
+ done
+
+ return 0
+}
+
+function cat_http_body
+{
+ typeset emode="$1"
+ typeset hexchunksize="0"
+ integer chunksize=0
+
+ if [[ "${emode}" == "chunked" ]] ; then
+ while IFS=$'\r' read hexchunksize &&
+ [[ "${hexchunksize}" == ~(Elri)[0-9abcdef]* ]] &&
+ (( chunksize=16#${hexchunksize} )) && (( chunksize > 0 )) ; do
+ dd bs=1 count="${chunksize}" 2>/dev/null
+ done
+ else
+ cat
+ fi
+
+ return 0
+}
+
+function encode_http_basic_auth
+{
+ typeset user="$1"
+ typeset passwd="$2"
+ typeset s
+ integer s_len
+ typeset -b base64var
+
+ # ksh93 binary variables use base64 encoding, the same as the
+ # HTTP basic authentification. We only have to read the
+ # plaintext user:passwd string into the binary variable "base64var"
+ # and then print this variable as ASCII.
+ s="${user}:${passwd}"
+ s_len="${#s}"
+ print -n "${s}" | read -N${s_len} base64var
+
+ print -- "${base64var}" # print ASCII (base64) representation of binary var
+
+ return 0
+}
+
+function put_twitter_message
+{
+ [[ "$SHTWITTER_USER" == "" ]] && { print -u2 -f $"%s: SHTWITTER_USER not set.\n" "$0" ; return 1 ; }
+ [[ "$SHTWITTER_PASSWD" == "" ]] && { print -u2 -f $"%s: SHTWITTER_PASSWD not set.\n" "$0" ; return 1 ; }
+
+ (( $# != 1 )) && { print -u2 -f $"%s: Wrong number of arguments.\n" "$0" ; return 1 ; }
+
+ # site setup
+ typeset url_host="twitter.com"
+ typeset url_path="/statuses/update.xml"
+ typeset url="http://${url_host}${url_path}"
+ integer netfd # http stream number
+ typeset msgtext="$1"
+ typeset -C httpresponse # http response
+
+ # argument for "encode_x_www_form_urlencoded"
+ typeset urlform=(
+ # input
+ typeset -a form
+ # output
+ typeset content
+ integer content_length
+ )
+
+ typeset request=""
+ typeset content=""
+
+ urlform.form=(
+ ( name="status" data="${msgtext}" )
+ )
+
+ encode_x_www_form_urlencoded urlform
+
+ content="${urlform.content}"
+
+ request="POST ${url_path} HTTP/1.1\r\n"
+ request+="Host: ${url_host}\r\n"
+ request+="Authorization: Basic ${ encode_http_basic_auth "${SHTWITTER_USER}" "${SHTWITTER_PASSWD}" ; }\r\n"
+ request+="User-Agent: ${http_user_agent}\r\n"
+ request+="Connection: close\r\n"
+ request+="Content-Type: application/x-www-form-urlencoded\r\n"
+ request+="Content-Length: $(( urlform.content_length ))\r\n"
+
+ redirect {netfd}<>"/dev/tcp/${url_host}/80"
+ (( $? != 0 )) && { print -u2 -f "%s: Could not open connection to %s\n." "$0" "${url_host}" ; return 1 ; }
+
+ # send http post
+ {
+ print -n -- "${request}\r\n"
+ print -n -- "${content}\r\n"
+ } >&${netfd}
+
+ # process reply
+ parse_http_response httpresponse <&${netfd}
+ response="${ cat_http_body "${httpresponse.transfer_encoding}" <&${netfd} ; }"
+
+ # close connection
+ redirect {netfd}<&-
+
+ printf $"twitter response was (%s,%s): %s\n" "${httpresponse.statuscode}" "${httpresponse.statusmsg}" "${response}"
+
+ if (( httpresponse.statuscode >= 200 && httpresponse.statuscode <= 299 )) ; then
+ return 0
+ else
+ return 1
+ fi
+
+ # not reached
+}
+
+function verify_twitter_credentials
+{
+ [[ "$SHTWITTER_USER" == "" ]] && { print -u2 -f $"%s: SHTWITTER_USER not set.\n" "$0" ; return 1 ; }
+ [[ "$SHTWITTER_PASSWD" == "" ]] && { print -u2 -f $"%s: SHTWITTER_PASSWD not set.\n" "$0" ; return 1 ; }
+
+ (( $# != 0 )) && { print -u2 -f $"%s: Wrong number of arguments.\n" "$0" ; return 1 ; }
+
+ # site setup
+ typeset url_host="twitter.com"
+ typeset url_path="/account/verify_credentials.xml"
+ typeset url="http://${url_host}${url_path}"
+ integer netfd # http stream number
+ typeset -C httpresponse # http response
+
+ typeset request=""
+
+ request="POST ${url_path} HTTP/1.1\r\n"
+ request+="Host: ${url_host}\r\n"
+ request+="Authorization: Basic ${ encode_http_basic_auth "${SHTWITTER_USER}" "${SHTWITTER_PASSWD}" ; }\r\n"
+ request+="User-Agent: ${http_user_agent}\r\n"
+ request+="Connection: close\r\n"
+ request+="Content-Type: application/x-www-form-urlencoded\r\n"
+ request+="Content-Length: 0\r\n" # dummy
+
+ redirect {netfd}<>"/dev/tcp/${url_host}/80"
+ (( $? != 0 )) && { print -u2 -f $"%s: Could not open connection to %s.\n" "$0" "${url_host}" ; return 1 ; }
+
+ # send http post
+ {
+ print -n -- "${request}\r\n"
+ } >&${netfd}
+
+ # process reply
+ parse_http_response httpresponse <&${netfd}
+ response="${ cat_http_body "${httpresponse.transfer_encoding}" <&${netfd} ; }"
+
+ # close connection
+ redirect {netfd}<&-
+
+ printf $"twitter response was (%s,%s): %s\n" "${httpresponse.statuscode}" "${httpresponse.statusmsg}" "${response}"
+
+ if (( httpresponse.statuscode >= 200 && httpresponse.statuscode <= 299 )) ; then
+ return 0
+ else
+ return 1
+ fi
+
+ # not reached
+}
+
+function usage
+{
+ OPTIND=0
+ getopts -a "${progname}" "${shtwitter_usage}" OPT '-?'
+ exit 2
+}
+
+# program start
+builtin basename
+builtin cat
+builtin date
+builtin uname
+
+typeset progname="${ basename "${0}" ; }"
+
+# HTTP protocol client identifer
+typeset -r http_user_agent="shtwitter/ksh93 (2008-10-14; ${ uname -s -r -p ; })"
+
+typeset -r shtwitter_usage=$'+
+[-?\n@(#)\$Id: shtwitter (Roland Mainz) 2008-10-14 \$\n]
+[-author?Roland Mainz <roland.mainz@nrubsig.org>]
+[+NAME?shtwitter - read/write text data to internet clipboards]
+[+DESCRIPTION?\bshtwitter\b is a small utility which can read and write text
+ to the twitter.com microblogging site.]
+[+?The first arg \bmethod\b describes one of the methods, "update" posts a
+ text message to the users twitter blog, returning the raw response
+ message from the twitter server.]
+[+?The second arg \bstring\b contains the string data which should be
+ stored on twitter.com.]
+
+method [ string ]
+
+[+SEE ALSO?\bksh93\b(1), \brssread\b(1), \bshtinyurl\b(1), http://www.twitter.com]
+'
+
+while getopts -a "${progname}" "${shtwitter_usage}" OPT ; do
+# printmsg "## OPT=|${OPT}|, OPTARG=|${OPTARG}|"
+ case ${OPT} in
+ *) usage ;;
+ esac
+done
+shift $((OPTIND-1))
+
+# expecting at least one more argument
+(($# >= 1)) || usage
+
+typeset method="$1"
+shift
+
+case "${method}" in
+ update|blog) put_twitter_message "$@" ; exit $? ;;
+ verify_credentials) verify_twitter_credentials "$@" ; exit $? ;;
+ *) usage ;;
+esac
+
+fatal_error $"not reached."
+# EOF.
diff --git a/usr/src/lib/libshell/common/scripts/svcproptree1.sh b/usr/src/lib/libshell/common/scripts/svcproptree1.sh
new file mode 100644
index 0000000000..e196fb413a
--- /dev/null
+++ b/usr/src/lib/libshell/common/scripts/svcproptree1.sh
@@ -0,0 +1,172 @@
+#!/usr/bin/ksh93
+
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+# Solaris needs /usr/xpg6/bin:/usr/xpg4/bin because the tools in /usr/bin are not POSIX-conformant
+export PATH=/usr/xpg6/bin:/usr/xpg4/bin:/bin:/usr/bin
+
+# Make sure all math stuff runs in the "C" locale to avoid problems
+# with alternative # radix point representations (e.g. ',' instead of
+# '.' in de_DE.*-locales). This needs to be set _before_ any
+# floating-point constants are defined in this script).
+if [[ "${LC_ALL}" != "" ]] ; then
+ export \
+ LC_MONETARY="${LC_ALL}" \
+ LC_MESSAGES="${LC_ALL}" \
+ LC_COLLATE="${LC_ALL}" \
+ LC_CTYPE="${LC_ALL}"
+ unset LC_ALL
+fi
+export LC_NUMERIC=C
+
+function fatal_error
+{
+ print -u2 "${progname}: $*"
+ exit 1
+}
+
+
+function svcproptovartree
+{
+ nameref tree=$1
+
+ typeset name
+ typeset servicename
+ typeset propname
+
+ typeset datatype
+
+ typeset -a fields
+ integer num_fields
+ integer i
+
+ while IFS=' ' read -A fields ; do
+ num_fields=${#fields[*]}
+
+ name="${fields[0]}"
+ datatype="${fields[1]}"
+ # parse service/property name
+ servicename="${name%~(Er):properties/.*}"
+ servicename="${servicename/~(El)svc:\//}" # strip "svc:/"
+ propname="${name#~(El).*:properties/}"
+
+ if [[ "${tree["${servicename}"].properties[*]}" == "" ]] ; then
+ typeset -A tree["${servicename}"].properties=( )
+ fi
+
+ nameref node=tree["${servicename}"].properties["${propname}"]
+
+ node=(
+ typeset datatype="${datatype}"
+ typeset valuelist="true"
+ typeset -a values
+ )
+
+ for (( i=2 ; i < num_fields ; i++ )) ; do
+ node.values+=( "${fields[i]}" )
+ done
+ done
+
+ return 0
+}
+
+function usage
+{
+ OPTIND=0
+ getopts -a "${progname}" "${svcproptree1_usage}" OPT '-?'
+ exit 2
+}
+
+# program start
+builtin basename
+builtin cat
+builtin date
+builtin uname
+
+typeset progname="${ basename "${0}" ; }"
+
+typeset -r svcproptree1_usage=$'+
+[-?\n@(#)\$Id: svcproptree1 (Roland Mainz) 2008-10-14 \$\n]
+[-author?Roland Mainz <roland.mainz@nrubsig.org>]
+[+NAME?svcproptree1 - SMF tree demo]
+[+DESCRIPTION?\bsvcproptree1\b is a small ksh93 compound variable demo
+ which reads accepts a SMF service pattern name input file,
+ reads the matching service properties and converts them into an internal
+ variable tree representation and outputs it in the format
+ specified by viewmode (either "list", "namelist" or "tree")..]
+
+pattern viewmode
+
+[+SEE ALSO?\bksh93\b(1), \bsvcprop\b(1)]
+'
+
+while getopts -a "${progname}" "${svcproptree1_usage}" OPT ; do
+# printmsg "## OPT=|${OPT}|, OPTARG=|${OPTARG}|"
+ case ${OPT} in
+ *) usage ;;
+ esac
+done
+shift $((OPTIND-1))
+
+typeset svcpattern="$1"
+typeset viewmode="$2"
+
+if [[ "${viewmode}" != ~(Elr)(list|namelist|tree) ]] ; then
+ fatal_error $"Invalid view mode \"${viewmode}\"."
+fi
+
+typeset svc=(
+ typeset -A proptree
+)
+
+typeset s
+
+s="$(/usr/bin/svcprop -f "${svcpattern}")" || fatal_error $"svcprop failed with exit code $?."
+print -u2 $"#loading completed."
+
+print -r -- "$s" | svcproptovartree svc.proptree
+print -u2 $"#parsing completed."
+
+case "${viewmode}" in
+ list)
+ set | egrep "^svc.proptree\[" | fgrep -v ']=$'
+ ;;
+ namelist)
+ typeset + | egrep "^svc.proptree\["
+ ;;
+ tree)
+ printf "%B\n" svc
+ ;;
+ *)
+ fatal_error $"Invalid view mode \"${viewmode}\"."
+ ;;
+esac
+
+print -u2 $"#done."
+
+exit 0
+# EOF.
diff --git a/usr/src/lib/libshell/common/scripts/termclock.sh b/usr/src/lib/libshell/common/scripts/termclock.sh
new file mode 100644
index 0000000000..edcadd4e10
--- /dev/null
+++ b/usr/src/lib/libshell/common/scripts/termclock.sh
@@ -0,0 +1,312 @@
+#!/usr/bin/ksh93
+
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# termclock - a simple analog clock for terminals
+#
+
+# Solaris needs /usr/xpg6/bin:/usr/xpg4/bin because the tools in /usr/bin are not POSIX-conformant
+export PATH=/usr/xpg6/bin:/usr/xpg4/bin:/bin:/usr/bin
+
+# Make sure all math stuff runs in the "C" locale to avoid problems
+# with alternative # radix point representations (e.g. ',' instead of
+# '.' in de_DE.*-locales). This needs to be set _before_ any
+# floating-point constants are defined in this script).
+if [[ "${LC_ALL}" != "" ]] ; then
+ export \
+ LC_MONETARY="${LC_ALL}" \
+ LC_MESSAGES="${LC_ALL}" \
+ LC_COLLATE="${LC_ALL}" \
+ LC_CTYPE="${LC_ALL}"
+ unset LC_ALL
+fi
+export LC_NUMERIC=C
+
+function fatal_error
+{
+ print -u2 "${progname}: $*"
+ exit 1
+}
+
+# cache tput values (to avoid |fork()|'ing a "tput" child every second)
+function tput_cup
+{
+ # static variable as cache for "tput_cup"
+ typeset -S -A tput_cup_cache
+
+ integer y="$1" x="$2"
+ nameref c="tput_cup_cache[\"${y}_${x}\"]"
+
+ if [[ "$c" == "" ]] ; then
+ # fast path for known terminal types
+ if [[ ${TERM} == ~(Elr)(vt100|vt220|xterm|xterm-color|dtterm) ]] ; then
+ c="${ printf "\E[%d;%dH" y+1 x+1 ; }"
+ else
+ c="${ tput cup $y $x ; }"
+ fi
+ fi
+
+ print -r -n -- "$c"
+ return 0
+}
+
+# Get terminal size and put values into a compound variable with the integer
+# members "columns" and "lines"
+function get_term_size
+{
+ nameref rect=$1
+
+ rect.columns=${ tput cols ; } || return 1
+ rect.lines=${ tput lines ; } || return 1
+
+ return 0
+}
+
+function draw_clock
+{
+ float angle a
+ float x y
+ integer i=1
+
+ for(( angle=0.0 ; angle < 360. ; angle+=6 )) ; do
+ ((
+ a=angle/360.*(2*M_PI) ,
+
+ x=clock.len_x*cos(a) ,
+ y=clock.len_y*sin(a)
+ ))
+
+ tput_cup $(( y+clock.middle_y )) $(( x+clock.middle_x ))
+
+ # add "mark" every 30 degrees
+ if (( int(angle)%30 == 0 )) ; then
+ print -r -n "$(((++i)%12+1))"
+ else
+ print -r -n "x"
+ fi
+ done
+ return 0
+}
+
+function draw_hand
+{
+ float angle="$1" a
+ typeset ch="$2"
+ float length="$3"
+ float x y
+
+ (( a=angle/360.*(2*M_PI) ))
+
+ for (( s=0.0 ; s < 10. ; s+=0.5 )) ; do
+ ((
+ x=(clock.len_x*(s/10.)*(length/100.))*cos(a) ,
+ y=(clock.len_y*(s/10.)*(length/100.))*sin(a)
+ ))
+
+ tput_cup $(( y+clock.middle_y )) $(( x+clock.middle_x ))
+ print -r -n -- "${ch}"
+ done
+ return 0
+}
+
+function draw_clock_hand
+{
+ nameref hand=$1
+ draw_hand $(( 360.*(hand.val/hand.scale)-90. )) "${hand.ch}" ${hand.length}
+ return 0
+}
+
+function clear_clock_hand
+{
+ nameref hand=$1
+ draw_hand $(( 360.*(hand.val/hand.scale)-90. )) " " ${hand.length}
+ return 0
+}
+
+function main_loop
+{
+ typeset c
+
+ # note: we can't use subshells when writing to the double-buffer file because this
+ # will render the tput value cache useless
+ while true ; do
+ if ${init_screen} ; then
+ init_screen="false"
+
+ get_term_size termsize || fatal_error $"Couldn't get terminal size."
+
+ ((
+ clock.middle_x=termsize.columns/2.-.5 ,
+ clock.middle_y=termsize.lines/2.-.5 ,
+ clock.len_x=termsize.columns/2-2 ,
+ clock.len_y=termsize.lines/2-2 ,
+ ))
+
+ {
+ clear
+ draw_clock
+ } >&6
+ fi
+
+ {
+ (( ${ date +"hours.val=%H , minutes.val=%M , seconds.val=%S" ; } ))
+
+ # small trick to get a smooth "analog" flair
+ ((
+ hours.val+=minutes.val/60. ,
+ minutes.val+=seconds.val/60.
+ ))
+
+ draw_clock_hand seconds
+ draw_clock_hand minutes
+ draw_clock_hand hours
+
+ # move cursor to home position
+ tput_cup 0 0
+ } >&6
+
+ 6<#((0))
+ cat <&6
+
+ redirect 6<&- ; rm -f "${scratchfile}" ; redirect 6<>"${scratchfile}"
+
+ c="" ; read -r -t ${update_interval} -N 1 c
+ if [[ "$c" != "" ]] ; then
+ case "$c" in
+ ~(Fi)q | $'\E') return 0 ;;
+ esac
+ fi
+
+ {
+ clear_clock_hand hours
+ clear_clock_hand minutes
+ clear_clock_hand seconds
+ } >&6
+ done
+}
+
+function usage
+{
+ OPTIND=0
+ getopts -a "${progname}" "${termclock_usage}" OPT '-?'
+ exit 2
+}
+
+# program start
+builtin basename
+builtin cat
+builtin date
+builtin rm
+
+typeset progname="${ basename "${0}" ; }"
+
+float -r M_PI=3.14159265358979323846
+
+# terminal size rect
+typeset -C termsize=(
+ integer columns=-1
+ integer lines=-1
+)
+
+typeset init_screen="true"
+
+typeset -C clock=(
+ float middle_x
+ float middle_y
+ integer len_x
+ integer len_y
+)
+
+
+# set clock properties
+typeset -C seconds=(
+ float val
+ typeset ch
+ float scale
+ integer length )
+typeset -C minutes=(
+ float val
+ typeset ch
+ float scale
+ integer length )
+typeset -C hours=(
+ float val
+ typeset ch
+ float scale
+ integer length )
+
+seconds.length=90 seconds.scale=60 seconds.ch=$"s"
+minutes.length=75 minutes.scale=60 minutes.ch=$"m"
+hours.length=50 hours.scale=12 hours.ch=$"h"
+
+float update_interval=0.9
+
+typeset -r termclock_usage=$'+
+[-?\n@(#)\$Id: termclock (Roland Mainz) 2008-11-04 \$\n]
+[-author?Roland Mainz <roland.mainz@nrubsig.org>]
+[-author?David Korn <dgk@research.att.com>]
+[+NAME?termclock - analog clock for terminals]
+[+DESCRIPTION?\btermclock\b is an analog clock for terminals.
+ The termclock program displays the time in analog or digital
+ form. The time is continuously updated at a frequency which
+ may be specified by the user.]
+[u:update?Update interval (defaults to 0.9 seconds).]:[interval]
+[+SEE ALSO?\bksh93\b(1), \bxclock\b(1)]
+'
+
+while getopts -a "${progname}" "${termclock_usage}" OPT ; do
+# printmsg "## OPT=|${OPT}|, OPTARG=|${OPTARG}|"
+ case ${OPT} in
+ u) update_interval=${OPTARG} ;;
+ *) usage ;;
+ esac
+done
+shift $((OPTIND-1))
+
+# prechecks
+which tput >/dev/null || fatal_error $"tput not found."
+which mktemp >/dev/null || fatal_error $"mktemp not found."
+(( update_interval >= 0. && update_interval <= 7200. )) || fatal_error $"invalid update_interval value."
+
+# create temporary file for double-buffering and register an EXIT trap
+# to remove this file when the shell interpreter exits
+scratchfile="${ mktemp "/tmp/termclock.ppid${PPID}_pid$$.XXXXXX" ; }"
+[[ "${scratchfile}" != "" ]] || fatal_error $"Could not create temporary file name."
+trap 'rm -f "${scratchfile}"' EXIT
+rm -f "${scratchfile}" ; redirect 6<>"${scratchfile}" || fatal_error $"Could not create temporary file."
+
+# register trap to handle window size changes
+trap 'init_screen="true"' WINCH
+
+main_loop
+
+# exiting - put cursor below clock
+tput_cup $((termsize.lines-2)) 0
+
+exit 0
+# EOF.
diff --git a/usr/src/lib/libshell/common/scripts/test_net_sctp.sh b/usr/src/lib/libshell/common/scripts/test_net_sctp.sh
new file mode 100644
index 0000000000..a17aaba62f
--- /dev/null
+++ b/usr/src/lib/libshell/common/scripts/test_net_sctp.sh
@@ -0,0 +1,65 @@
+#!/usr/bin/ksh93
+
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# test_net_sctp - a simple ksh93 SCTP demo
+#
+
+export PATH=/usr/xpg6/bin:/usr/xpg4/bin:/bin:/usr/bin
+
+set -o xtrace
+set -o errexit
+
+# declare variables
+integer netfd
+typeset request
+
+# print intro
+print "# testing SCTP support"
+print "# (via fetching the main page of http://www.sctp.org/ via SCTP)"
+
+# open sctp stream and print it's number
+redirect {netfd}<>/dev/sctp/www.sctp.org/80
+print "sctp fd=${netfd}"
+
+# send HTTP request
+request="GET / HTTP/1.1\r\n"
+request+="Host: www.sctp.org\r\n"
+request+="User-Agent: ksh93/test_net_sctp (2008-10-14; $(uname -s -r -p))\r\n"
+request+="Connection: close\r\n"
+print -u${netfd} -n -- "${request}\r\n"
+
+# print response to stdout
+cat <&${netfd}
+
+# close connection
+redirect {netfd}<&-
+
+print "#done"
+
+#EOF.
diff --git a/usr/src/lib/libshell/common/scripts/xmldocumenttree1.sh b/usr/src/lib/libshell/common/scripts/xmldocumenttree1.sh
new file mode 100644
index 0000000000..ab6517f372
--- /dev/null
+++ b/usr/src/lib/libshell/common/scripts/xmldocumenttree1.sh
@@ -0,0 +1,356 @@
+#!/usr/bin/ksh93
+
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+# Solaris needs /usr/xpg6/bin:/usr/xpg4/bin because the tools in /usr/bin are not POSIX-conformant
+export PATH=/usr/xpg6/bin:/usr/xpg4/bin:/bin:/usr/bin
+
+function fatal_error
+{
+ print -u 2 "${progname}: $*"
+ exit 1
+}
+
+function attrstrtoattrarray
+{
+#set -o xtrace
+ typeset s="$1"
+ nameref aa=$2 # attribute array
+ integer aa_count=0
+ integer aa_count=0
+ typeset nextattr
+ integer currattrlen=0
+ typeset tagstr
+ typeset tagval
+
+ while (( ${#s} > 0 )) ; do
+ # skip whitespaces
+ while [[ "${s:currattrlen:1}" == ~(E)[[:blank:][:space:]] ]] ; do
+ (( currattrlen++ ))
+ done
+ s="${s:currattrlen:${#s}}"
+
+ # anything left ?
+ (( ${#s} == 0 )) && break
+
+ # Pattern tests:
+ #x="foo=bar huz=123" ; print "${x##~(E)[[:alnum:]_-:]*=[^[:blank:]\"]*}"
+ #x='foo="ba=r o" huz=123' ; print "${x##~(E)[[:alnum:]_-:]*=\"[^\"]*\"}"
+ #x="foo='ba=r o' huz=123" ; print "${x##~(E)[[:alnum:]_-:]*=\'[^\"]*\'}"
+ #x="foox huz=123" ; print "${x##~(E)[[:alnum:]_-:]*}"
+ # All pattern combined via eregex (w|x|y|z):
+ #x='foo="bar=o" huz=123' ; print "${x##~(E)([[:alnum:]_-:]*=[^[:blank:]\"]*|[[:alnum:]_-:]*=\"[^\"]*\"|[[:alnum:]_-:]*=\'[^\"]*\')}"
+ nextattr="${s##~(E)([[:alnum:]_-:]*=[^[:blank:]\"]*|[[:alnum:]_-:]*=\"[^\"]*\"|[[:alnum:]_-:]*=\'[^\"]*\'|[[:alnum:]_-:]*)}"
+ currattrlen=$(( ${#s} - ${#nextattr}))
+
+ # add entry
+ tagstr="${s:0:currattrlen}"
+ if [[ "${tagstr}" == *=* ]] ; then
+ # normal case: attribute with value
+
+ tagval="${tagstr#*=}"
+
+ # strip quotes ('' or "")
+ if [[ "${tagval}" == ~(Elr)(\'.*\'|\".*\") ]] ; then
+ tagval="${tagval:1:${#tagval}-2}"
+ fi
+
+ aa[${aa_count}]=( name="${tagstr%%=*}" value="${tagval}" )
+ else
+ # special case for HTML where you have something like <foo baz>
+ aa[${aa_count}]=( name="${tagstr}" )
+ fi
+ (( aa_count++ ))
+ (( aa_count > 1000 )) && fatal_error "$0: aa_count too large" # assert
+ done
+}
+
+
+function handle_document
+{
+#set -o xtrace
+ nameref callbacks=${1}
+ typeset tag_type="${2}"
+ typeset tag_value="${3}"
+ typeset tag_attributes="${4}"
+ nameref doc=${callbacks["arg_tree"]}
+ nameref nodepath="${stack.items[stack.pos]}"
+ nameref nodesnum="${stack.items[stack.pos]}num"
+
+ case "${tag_type}" in
+ tag_begin)
+ nodepath[${nodesnum}]+=(
+ typeset tagtype="element"
+ typeset tagname="${tag_value}"
+ typeset -A tagattributes=( )
+ typeset -A nodes=( )
+ integer nodesnum=0
+ )
+
+ # fill attributes
+ if [[ "${tag_attributes}" != "" ]] ; then
+ attrstrtoattrarray "${tag_attributes}" "nodepath[${nodesnum}].tagattributes"
+ fi
+
+ (( stack.pos++ ))
+ stack.items[stack.pos]="${stack.items[stack.pos-1]}[${nodesnum}].nodes"
+ (( nodesnum++ ))
+ ;;
+ tag_end)
+ (( stack.pos-- ))
+ ;;
+ tag_text)
+ nodepath[${nodesnum}]+=(
+ typeset tagtype="text"
+ typeset tagvalue="${tag_value}"
+ )
+ (( nodesnum++ ))
+ ;;
+ tag_comment)
+ nodepath[${nodesnum}]+=(
+ typeset tagtype="comment"
+ typeset tagvalue="${tag_value}"
+ )
+ (( nodesnum++ ))
+ ;;
+ document_start)
+ ;;
+ document_end)
+ ;;
+ esac
+
+# print "xmltok: '${tag_type}' = '${tag_value}'"
+}
+
+function xml_tok
+{
+ typeset buf=""
+ typeset namebuf=""
+ typeset attrbuf=""
+ typeset c=""
+ typeset isendtag # bool: true/false
+ typeset issingletag # bool: true/false (used for tags like "<br />")
+ nameref callbacks=${1}
+
+ [[ ! -z "${callbacks["document_start"]}" ]] && ${callbacks["document_start"]} "${1}" "document_start"
+
+ while IFS='' read -r -N 1 c ; do
+ isendtag=false
+
+ if [[ "$c" == "<" ]] ; then
+ # flush any text content
+ if [[ "$buf" != "" ]] ; then
+ [[ ! -z "${callbacks["tag_text"]}" ]] && ${callbacks["tag_text"]} "${1}" "tag_text" "$buf"
+ buf=""
+ fi
+
+ IFS='' read -r -N 1 c
+ if [[ "$c" == "/" ]] ; then
+ isendtag=true
+ else
+ buf="$c"
+ fi
+ IFS='' read -r -d '>' c
+ buf+="$c"
+
+ # handle comments
+ if [[ "$buf" == ~(El)!-- ]] ; then
+ # did we read the comment completely ?
+ if [[ "$buf" != ~(Elr)!--.*-- ]] ; then
+ buf+=">"
+ while [[ "$buf" != ~(Elr)!--.*-- ]] ; do
+ IFS='' read -r -N 1 c || break
+ buf+="$c"
+ done
+ fi
+
+ [[ ! -z "${callbacks["tag_comment"]}" ]] && ${callbacks["tag_comment"]} "${1}" "tag_comment" "${buf:3:${#buf}-5}"
+ buf=""
+ continue
+ fi
+
+ # check if the tag starts and ends at the same time (like "<br />")
+ if [[ "${buf}" == ~(Er).*/ ]] ; then
+ issingletag=true
+ buf="${buf%*/}"
+ else
+ issingletag=false
+ fi
+
+ # check if the tag has attributes (e.g. space after name)
+ if [[ "$buf" == ~(E)[[:space:][:blank:]] ]] ; then
+ namebuf="${buf%%~(E)[[:space:][:blank:]].*}"
+ attrbuf="${buf#~(E).*[[:space:][:blank:]]}"
+ else
+ namebuf="$buf"
+ attrbuf=""
+ fi
+
+ if ${isendtag} ; then
+ [[ ! -z "${callbacks["tag_end"]}" ]] && ${callbacks["tag_end"]} "${1}" "tag_end" "$namebuf"
+ else
+ [[ ! -z "${callbacks["tag_begin"]}" ]] && ${callbacks["tag_begin"]} "${1}" "tag_begin" "$namebuf" "$attrbuf"
+
+ # handle tags like <br/> (which are start- and end-tag in one piece)
+ if ${issingletag} ; then
+ [[ ! -z "${callbacks["tag_end"]}" ]] && ${callbacks["tag_end"]} "${1}" "tag_end" "$namebuf"
+ fi
+ fi
+ buf=""
+ else
+ buf+="$c"
+ fi
+ done
+
+ [[ ! -z "${callbacks["document_end"]}" ]] && ${callbacks["document_end"]} "${1}" "document_end" "exit_success"
+
+ print # final newline to make filters like "sed" happy
+}
+
+function print_sample1_xml
+{
+cat <<EOF
+<br />
+<score-partwise instrument="flute1">
+ <identification>
+ <kaiman>nocrocodile</kaiman>
+ </identification>
+ <!-- a comment -->
+ <partlist>
+ <foo>myfootext</foo>
+ <bar>mybartext</bar>
+ <snap />
+ <!-- another
+ comment -->
+ <ttt>myttttext</ttt>
+ </partlist>
+</score-partwise>
+EOF
+}
+
+function usage
+{
+ OPTIND=0
+ getopts -a "${progname}" "${xmldocumenttree1_usage}" OPT '-?'
+ exit 2
+}
+
+# program start
+builtin basename
+builtin cat
+builtin date
+builtin uname
+
+typeset progname="${ basename "${0}" ; }"
+
+typeset -r xmldocumenttree1_usage=$'+
+[-?\n@(#)\$Id: xmldocumenttree1 (Roland Mainz) 2008-10-14 \$\n]
+[-author?Roland Mainz <roland.mainz@nrubsig.org>]
+[+NAME?xmldocumenttree1 - XML tree demo]
+[+DESCRIPTION?\bxmldocumenttree\b is a small ksh93 compound variable demo
+ which reads a XML input file, converts it into an internal
+ variable tree representation and outputs it in the format
+ specified by viewmode (either "list", "namelist" or "tree").]
+
+file viewmode
+
+[+SEE ALSO?\bksh93\b(1)]
+'
+
+while getopts -a "${progname}" "${xmldocumenttree1_usage}" OPT ; do
+# printmsg "## OPT=|${OPT}|, OPTARG=|${OPTARG}|"
+ case ${OPT} in
+ *) usage ;;
+ esac
+done
+shift $((OPTIND-1))
+
+typeset xmlfile="$1"
+typeset viewmode="$2"
+
+if [[ "${xmlfile}" == "" ]] ; then
+ fatal_error $"No file given."
+fi
+
+if [[ "${viewmode}" != ~(Elr)(list|namelist|tree) ]] ; then
+ fatal_error $"Invalid view mode \"${viewmode}\"."
+fi
+
+typeset -C xdoc
+typeset -A xdoc.nodes
+integer xdoc.nodesnum=0
+
+typeset -C stack
+typeset -a stack.items=( [0]="doc.nodes" )
+integer stack.pos=0
+
+# setup callbacks for xml_tok
+typeset -A document_cb # callbacks for xml_tok
+document_cb["document_start"]="handle_document"
+document_cb["document_end"]="handle_document"
+document_cb["tag_begin"]="handle_document"
+document_cb["tag_end"]="handle_document"
+document_cb["tag_text"]="handle_document"
+document_cb["tag_comment"]="handle_document"
+# argument for "handle_document"
+document_cb["arg_tree"]="xdoc"
+
+
+if [[ "${xmlfile}" == "#sample1" ]] ; then
+ print_sample1_xml | xml_tok document_cb
+elif [[ "${xmlfile}" == "#sample2" ]] ; then
+ /usr/sfw/bin/wget \
+ --user-agent='ksh93_xmldocumenttree' \
+ --output-document=- \
+ 'http://www.google.com/custom?q=gummi+bears' |
+ /usr/bin/iconv -f "ISO8859-1" |
+ xml_tok document_cb
+else
+ cat "${xmlfile}" | xml_tok document_cb
+fi
+
+print -u2 "#parsing completed."
+
+case "${viewmode}" in
+ list)
+ set | egrep "xdoc.*(tagname|tagtype|tagval|tagattributes)" | fgrep -v ']=$'
+ ;;
+ namelist)
+ typeset + | egrep "xdoc.*(tagname|tagtype|tagval|tagattributes)"
+ ;;
+ tree)
+ print -- "${xdoc}"
+ ;;
+ *)
+ fatal_error $"Invalid view mode \"${viewmode}\"."
+ ;;
+esac
+
+print -u2 "#done."
+
+exit 0
+# EOF.
diff --git a/usr/src/lib/libshell/common/sh.1 b/usr/src/lib/libshell/common/sh.1
index 61393046b6..4ebbb41a31 100644
--- a/usr/src/lib/libshell/common/sh.1
+++ b/usr/src/lib/libshell/common/sh.1
@@ -23,8 +23,8 @@
sh, rsh, pfsh \- shell, the
.\}
.if \nZ=1 \{\
-.\}
ksh, rksh, pfksh \- KornShell, a
+.\}
.if \nZ=2 \{\
ksh93, rksh93, pfksh93 \- KornShell, a
.\}
@@ -32,8 +32,8 @@ standard/restricted command and programming language
.SH SYNOPSIS
.if \nZ=0 \{\
.B sh
-.if \nZ=1 \{\
.\}
+.if \nZ=1 \{\
.B ksh
.\}
.if \nZ=2 \{\
@@ -296,13 +296,13 @@ of the first
of a
.I list\^
that is a simple command not beginning
-with a redirection, and not occuring within a
+with a redirection, and not occurring within a
.BR while ,
.BR until ,
or
.B if
.IR list ,
-can be prededed by a semicolon.
+can be preceded by a semicolon.
This semicolon
is ignored unless the
.B showme
@@ -628,10 +628,12 @@ and are not quoted:
One or more variable assignments can start a simple command
or can be arguments to the
.BR typeset ,
+.BR enum ,
.BR export ,
or
.B readonly
-special built-in commands.
+special built-in commands as well as
+to other declaration commands created as types.
The syntax for an \f2assignment\^\fP is of the form:
.TP
.PD 0
@@ -672,9 +674,19 @@ a compound variable allowing subsequence child elements to be defined.
Nested variable assignment. Multiple assignments
can be specified by separating each of them with a \f3;\fP.
The previous value is unset before the assignment.
+Other declaration commands such as
+.BR readonly,
+.BR enum ,
+and
+other declaration commands can be used in place of
+.BR typeset .
+.TP
+\f3\|.\fP \f2filename\^\fP
+Include the assignment commands contained in
+.IR filename .
.PD
.RE
-.P
+.PP
In addition, a \f3+=\fP can be used in place of the \f3=\fP
to signify adding to or appending to the previous value.
When \f3+=\fP is applied to an arithmetic type, \f2word\^\fP
@@ -683,6 +695,12 @@ When applied to a string variable, the value defined by \f2word\^\fP
is appended to the value. For compound assignments, the previous
value is not unset and the new values are appended to the
current ones provided that the types are compatible.
+.PP
+The right hand side of a variable assignment undergoes all the expansion
+list below except word splitting, brace expansion, and file name generation.
+When the left hand side is an assignment is a compound variable and
+the right hand is the name of a compound variable, the coumpound variable
+on the right will be copied or appended to the compound variable on the left.
.SS Comments.
.PD 0
A word beginning with
@@ -839,15 +857,20 @@ also terminates a
.B \(ap
login name.
.SS Command Substitution.
-The standard output from a command enclosed in
+The standard output from a command list enclosed in
parentheses preceded by a dollar sign (
-.B $(\|)
-)
-or a pair of grave accents (\^\f3\*`\^\*`\fP\^)
+\f3$(\fP\f2list\^\fP\f3)\fP
+),
+or in a brace group preceded by a dollar sign (
+\f3${ \fP\f2list\^\fP\f3;}\fP
+), or in a pair of grave accents (\^\f3\*`\^\*`\fP\^)
may be used as part or all
of a word;
trailing new-lines are removed.
-In the second (obsolete) form, the string between the quotes is processed
+In the second case, the \f3{\fP and \f3}\fP are treated as a reserved words
+so that \f3{\fP must be followed by a \f2blank\^\fP and \f3}\fP must
+appear at the beginning of the line or follow a \f3;\fP.
+In the third (obsolete) form, the string between the quotes is processed
for special quoting characters before the command is executed (see
.I Quoting\^
below).
@@ -859,6 +882,11 @@ The command substitution
\^\f3$(\^\fP\f2n\^\fP\f3<#\^)\fP
will expand to the current byte offset for file descriptor
.IR n .
+Except for the second form, the command list is run in a subshell so that no
+side effects are possible.
+For the second form, the final
+.B }
+will be recognized as a reserved word after any token.
.SS Arithmetic Substitution.
An arithmetic expression enclosed in double
parentheses preceded by a dollar sign (
@@ -978,11 +1006,18 @@ between a
and a
.BR ] .
To assign values to an indexed array, use
+\f2vname\fP\f3=(\fP\f2value\fP .\|.\|.\f3)\fP or
\f3set \-A\fP \f2vname\fP \f2value\fP .\|.\|. .
-The value of all
+The value of all non-negative
subscripts must be in the
range of
-0 through 1,048,575.
+0 through 4,194,303.
+A negative subscript is treated as an offset from the maximum
+current index +1 so that -1 refers to the last element.
+Indexed arrays can be declared with the
+.B \-a
+option to
+.BR typeset.
Indexed arrays need not be declared.
Any reference to a variable
with a valid subscript is
@@ -1065,10 +1100,11 @@ to be references and assignments to the variable whose
name has been passed to the function.
.sp .5
.PP
-If either of the floating point attributes,
+If any of the floating point attributes,
.BR \-E ,
-or
.BR \-F ,
+or
+.BR \-X ,
or the integer attribute,
.BR \-i ,
is set for
@@ -1107,8 +1143,10 @@ The braces are required when
.I parameter\^
is followed by a letter, digit, or underscore
that is not to be interpreted as part of its name,
-when the variable name contains a \fB\s+2.\s-2\fP,
-or when a variable is subscripted.
+when the variable name contains a \fB\s+2.\s-2\fP.
+The braces are also required when a variable is subscripted
+unless it is part of an Arithmetic Expression
+or a Conditional Expression.
If
.I parameter\^
is one or more digits then it is a positional parameter.
@@ -1129,12 +1167,22 @@ If an array
.I vname\^
with subscript
.B \(**
-or
-.B @
+.BR @ ,
+or of the form
+.I sub1\^
+.B ..
+.IR sub2 .
is used,
then the value
for each of the
-elements
+elements between
+.I sub1\^
+and
+.I sub2\^
+inclusive (or all elments for
+.B \(**
+and
+.BR @ )
is substituted,
separated by
the first character of
@@ -1163,6 +1211,13 @@ The number of elements in the array
.I vname\^
is substituted.
.TP
+.PD 0
+\f3${@\fP\f2vname\^\fP\f3}\fP
+Expands to the type name (See
+.I "Type Variables"\^
+below) or attributes of the variable referred to by
+.IR vname .
+.TP
\f3${!\fP\f2vname\^\fP\f3}\fP
Expands to the name of the variable referred to by
.IR vname .
@@ -1176,9 +1231,12 @@ is a name reference.
Expands to name of the subscript unless
.I subscript\^
is
-.B *
-or
+.BR * ,
.BR @ .
+or of the form
+.I sub1\^
+.B ..
+.IR sub2 .
When
.I subscript\^
is
@@ -1194,6 +1252,19 @@ is
same as above, except that when used in double quotes,
each array subscript yields a separate
argument.
+When
+.I subscript\^
+is of the form
+.I sub1\^
+.B ..
+.I sub2\^
+it expands
+to the list of subscripts between
+.I sub1\^
+and
+.I sub2\^
+inclusive using the same quoting rules as
+.BR @ .
.TP
\f3${!\fP\f2prefix\^\fP\f3*}\fP
Expands to the names of the variables whose names begin with
@@ -1449,6 +1520,19 @@ This parameter is also used to hold the name of the matching
.B
.SM MAIL
file when checking for mail.
+While defining a compound variable or a type,
+.B _
+is initialized as a reference to the compound variable or type.
+When a discipline function is invoked,
+.B _
+is initialized as a reference to the variable associated with
+the call to this function.
+Finally when
+.B _
+is used as the name of the first variable of a type definition,
+the new type is derived from the type of the first variable (See
+.I "Type Variables"\^
+below.).
.TP
.B !
The process number of the last background command invoked or
@@ -1516,6 +1600,15 @@ The pathname of the file than contains the current command.
.B .sh.fun
The name of the current function that is being executed.
.TP
+.B .sh.level
+Set to the current function depth. This can be changed
+inside a DEBUG trap and will set the context to the specified
+level.
+.TP
+.B .sh.lineno
+Set during a DEBUG trap to the line number for the caller of
+each function.
+.TP
.B .sh.match
An indexed array which stores the most recent match and sub-pattern
matches after conditional pattern matches that match and after
@@ -1559,6 +1652,11 @@ discipline function is invoked.
Set to a value that identifies the version of this shell.
.TP
.B
+.SM KSH_VERSION
+A name reference to
+.BR .sh.version .
+.TP
+.B
.SM LINENO
The current line number within the script or
function being executed.
@@ -1616,6 +1714,16 @@ seconds since shell invocation is returned.
If this variable is
assigned a value, then the value returned upon reference will
be the value that was assigned plus the number of seconds since the assignment.
+.TP
+.SM
+.B SHLVL
+An integer variable the is incremented each time the shell
+is invoked and is exported.
+If
+.SM
+.B SHLVL
+is not in the environment when the shell is invoked, it is set
+to 1.
.PD
.RE
.PP
@@ -1663,7 +1771,7 @@ are performed on
the value to generate
the pathname of the script that will be
executed when the shell
-is invoked
+is invoked interactively
(see
.I Invocation\^
below).
@@ -1673,6 +1781,15 @@ and
.B function
definitions.
The default value is \fB$HOME/.kshrc\fP.
+On systems that support a system wide \fB/etc/ksh.kshrc\fP initialization file,
+if the filename generated by the expansion of
+.SM
+.B ENV
+begins with
+.B /./
+or
+.B .\^/.\^/
+the system wide initialization file will not be executed.
.TP
.B
.SM FCEDIT
@@ -1706,7 +1823,7 @@ Unlike
.SM
.BR PATH ,
the current directory must be represented
-explictily by
+explicitly by
.B .
rather than by adjacent
.B :
@@ -2010,7 +2127,7 @@ The CPU percentage, computed as (U + S) / R.
.PD
.RE
.IP
-The braces denote optional portions.
+The brackets denote optional portions.
The optional \fIp\fP is a digit specifying the \fIprecision\fP,
the number of fractional digits after a decimal point.
A value of 0 causes no decimal point or fraction to be output.
@@ -2313,7 +2430,7 @@ will match all files and zero or more directories
and subdirectories.
If followed by a
.B /
-than only directories and subdirectories will match.
+then only directories and subdirectories will match.
.TP
.B ?
Matches any single character.
@@ -2417,7 +2534,7 @@ compound patterns a \f3\-\fP can be inserted in front of the \f3(\fP
to cause the shortest match to the specified \f2pattern-list\^\fP
to be used.
.PP
-When \f2pattern-list\^\fP is contained within parenthesis,
+When \f2pattern-list\^\fP is contained within parentheses,
the backslash character \f3\e\fP is treated specially even
when inside a character class. All ANSI-C character escapes are
recognized and match the specified character. In addition
@@ -2511,9 +2628,9 @@ the \f2n\fP-th. sub-pattern,
matches the same string as the sub-pattern itself.
.PP
Finally a pattern can contain sub-patterns of the form
-\f3\(ap(\fP\f2options\^\fP\f3:\fP\f2pattern-list\^\fP\f3)\fP.
+\f3\(ap(\fP\f2options\^\fP\f3:\fP\f2pattern-list\^\fP\f3)\fP,
where either \f2options\^\fP or \f3:\fP\f2pattern-list\^\fP
-can be omitted. Unlike, the other compound patterns,
+can be omitted. Unlike the other compound patterns,
these sub-patterns are not counted in the numbered sub-patterns.
If \f2options\^\fP is present, it can consist of one or more
of the following:
@@ -2581,26 +2698,6 @@ listed earlier (see
.I Definitions\^
above)
has a special meaning to the shell
-.TP
-.B i
-Treat the match as case insensitive.
-.TP
-.B g
-File the longest match (greedy). This is the default.
-.PD
-.RE
-If both \f2options\^\fP and \f3:\fP\f2pattern-list\^\fP
-are specified, then the options apply only to \f2pattern-list\^\fP.
-Otherwise, these options remain in effect until they are disabled
-by a subsequent \f3\(ap(\fP\f2...\^\fP\f3)\fP or at the end of
-the sub-pattern containing \f3\(ap(\fP\f2...\^\fP\f3)\fP.
-.SS Quoting.
-Each of the
-.I metacharacters\^
-listed earlier (see
-.I Definitions\^
-above)
-has a special meaning to the shell
and causes termination of a word unless quoted.
A character may be
.I quoted\^
@@ -2745,7 +2842,7 @@ that apply to floating point quantities can be used.
In addition, the operator
.B **
can be used for exponentiation.
-It has higher precedence than multiplication as is left associative.
+It has higher precedence than multiplication and is left associative.
In addition, when the value of an arithmetic variable
or sub-expression can be represented as a long integer,
all C language integer arithmetic operations can be performed.
@@ -2760,15 +2857,16 @@ can be used within an arithmetic expression:
.if t .RS
.B
.if n abs acos acosh asin asinh atan atan2 atanh cbrt copysign cos cosh erf erfc exp exp2 expm1 fabs fdim finite floor fma fmax fmod hypot ilogb int isinf isnan lgamma log log2 logb nearbyint nextafter nexttoward pow remainder rint round sin sinh sqrt tan tanh tgamma trunc
-.if t abs acos acosh asin asinh atan atan2 atanh cbrt copysign cos cosh erf erfc exp exp2 expm1 fabs fdim finite floor fma fmax fmod hypot ilogb int isinf isnan lgamma log log2 logb nearbyint nextafter nextroward pow rint round sin sinh sqrt tan tanh tgamma trunc
+.if t abs acos acosh asin asinh atan atan2 atanh cbrt copysign cos cosh erf erfc exp exp2 expm1 fabs fdim finite floor fma fmax fmod hypot ilogb int isinf isnan lgamma log log2 logb nearbyint nextafter nexttoward pow rint round sin sinh sqrt tan tanh tgamma trunc
.if t .RE
.PP
An internal representation of a
.I variable\^
as a double precision floating point can be specified with the
-\f3\-E\fP \*(OK\f2n\^\fP\*(CK
+\f3\-E\fP \*(OK\f2n\^\fP\*(CK,
+\f3\-F\fP \*(OK\f2n\^\fP\*(CK,
or
-\f3\-F\fP \*(OK\f2n\^\fP\*(CK
+\f3\-X\fP \*(OK\f2n\^\fP\*(CK
option of the
.B typeset
special built-in command.
@@ -2783,9 +2881,14 @@ The
.B \-F
option causes the expansion to be represented as a floating decimal number
when it is expanded.
+The
+.B \-X
+option cause the expansion to be represented using the
+.B %a
+format defined by ISO C-99.
The optional option argument
.I n
-defines the number of places after the decimal point in this case.
+defines the number of places after the decimal (or radix) point in this case.
.PP
An internal integer representation of a
.I variable\^
@@ -2804,6 +2907,7 @@ Arithmetic evaluation is performed on the value of each
assignment to a variable with the
.BR \-E ,
.BR \-F ,
+.BR \-X ,
or
.B \-i
attribute.
@@ -3028,7 +3132,7 @@ True, if
.I string\^
does not match
.IR pattern .
-With the
+When the
.I string\^
matches the
.I pattern\^
@@ -3256,7 +3360,7 @@ then leading spaces and tabs will be stripped off the first
line of the document and up to an equivalent indentation will
be stripped from the remaining lines and from
.IR word .
-A tab stop is assumend to occur at every 8 columns for the
+A tab stop is assumed to occur at every 8 columns for the
purposes of determining the indentation.
.TP
\f3<<<\fP\f2word\fP
@@ -3330,7 +3434,7 @@ If one of the above, other than
and the
.B >#
and
-.B >#
+.B <#
forms,
is preceded by
.BI { varname }
@@ -3344,7 +3448,7 @@ If
or the any of the
.B >#
and
-.B >#
+.B <#
forms
is preceded by
.BI { varname }
@@ -3534,7 +3638,7 @@ special built-in command used within a function
defines local variables whose scope includes
the current function.
They can be passed to functions that they call in the
-variable assignment list the precedes the call or as arguments
+variable assignment list that precedes the call or as arguments
passed as name references.
Errors within functions return control to the caller.
.PP
@@ -3591,7 +3695,8 @@ file.
Each variable can have zero or more discipline functions
associated with it.
The shell initially understands the discipline names \f3get\fP,
-\f3set\fP, \f3append\fP, and \f3unset\fP but on most systems
+\f3set\fP, \f3append\fP, and \f3unset\fP but can be added
+when defining new types. On most systems
others can be added at run time via the
C programming interface extension provided by the
.B builtin
@@ -3623,12 +3728,113 @@ contains the name of the variable for which the discipline function is called,
is the subscript of the variable, and
.B .sh.value
will contain the value being assigned inside the
-.B .set
+.B set
discipline function.
+The variable
+.B _
+is a reference to the variable including the subscript if any.
For the \f3set\fP discipline,
changing
.B .sh.value
will change the value that gets assigned.
+Finally, the expansion \f3${\fP\f2var\^\fP\f3.\fP\f2name\^\fP\f3}\fP,
+when \f2name\^\fP is the name of a discipline, and there is
+no variable of this name, is equivalent to the command substitution
+\f3${ \fP\f2var\^\fP\f3.\fP\f2name\^\fP\f3;}\fP.
+
+.SS Type Variables.
+Typed variables provide a way to create data structure and objects.
+A type can be defined either by a shared library, by the
+.B enum
+built-in command described below, or by using the new
+.B \-T
+option of the
+.B typeset
+built-in command.
+With the
+.B \-T
+option of
+.BR typeset ,
+the type name, specified as an option argument to
+.BR \-T ,
+is set with a compound variable assignment that defines the type.
+Function definitions can appear inside the compound variable
+assignment and these become discipline functions for this type and
+can be invoked or redefined by each instance of the type.
+The function name
+.B create
+is treated specially. It is invoked for each instance of
+the type that is created but is not inherited and cannot be
+redefined for each instance.
+.PP
+When a type is defined a special built-in command of that name
+is added. These built-ins are declaration commands and follow the
+same expansion rules as all the special built-in commands defined
+below that are preceded by \(dg\(dg. These commands can subsequently
+be used inside further type definitions. The man page for these commands can
+be generated by using the
+.B \-\-man
+option or any of the other
+.B \-\-
+options described with
+.BR getopts .
+The
+.BR \-r ,
+.BR \-a ,
+.BR \-A ,
+.BR \-h ,
+and
+.B \-S
+options of
+.B typeset
+are permitted with each of these new built-ins.
+.PP
+An instance of a type is created by invoking the type name
+followed by one or more instance names.
+Each instance of the type is initialized with a copy of the sub-variables
+except for sub-variables that are defined with the
+.B \-S
+option. Variables defined with the
+.B \-S
+are shared by all instances of the type.
+Each instance can change the value of any sub-variable and can also
+define new discipline functions of the same names
+as those defined by the type definition as well as any
+standard discipline names.
+No additional sub-variables can be defined for any instance.
+.PP
+When defining a type,
+if the value of a sub-variable is not set and the
+.B \-r
+attribute is specified, it causes the sub-variable
+to be a required sub-variable.
+Whenever an instance of a type is created, all required sub-variables
+must be specified.
+These sub-variables become readonly in each instance.
+.PP
+When
+.B unset
+is invoked on a sub-variable within a type,
+and the
+.B \-r
+attribute has not been specified for this field,
+the value is reset to the default value associative with
+the type.
+Invoking
+.B unset
+on a type instance not contained within another type deletes
+all sub-variables and the variable itself.
+.PP
+A type definition can be derived from another type definition
+by defining the first sub-variable name as
+.B _
+and defining its type as the base type.
+Any remaining definitions will be additions and modifications
+that apply to the new type.
+If the new type name is the same is that of the base type,
+the type will be replaced and the original type will
+no longer be accessible.
+
.SS Jobs.
.PP
If the
@@ -3829,7 +4035,7 @@ and a function of the given name is executed
as described above.
If not found, and the file
.B .paths
-is found, and the this file contains a line of the form
+is found, and this file contains a line of the form
.BI FPATH= path
where
.I path\^
@@ -4244,7 +4450,7 @@ Delete previous character.
(User defined literal next character as defined
by the
.IR stty (1)
-command.
+command,
or
.B ^V
if not defined.)
@@ -4375,7 +4581,13 @@ Moves back one line when not on the first line of a multi-line command.
.PP
.TP 10
.BI M-[A
-Equivalent to
+If the cursor is at the end of the line, it is equivalent to
+.B ^R
+with
+.I string\^
+set to the contents of the current line.
+Otherwise, it is
+equivalent to
.BR ^P.
.PP
.TP 10
@@ -4471,7 +4683,7 @@ alias by the name
.BI _\&_ letter
and if an alias of this name is defined, its
value will be inserted on the input queue.
-The can be used to program functions keys on many terminals.
+This can be used to program function keys on many terminals.
.PP
.TP 10
.B M-.
@@ -4769,7 +4981,12 @@ Equivalent to
.BR k .
.TP 10
[\f2count\fP]\f3[A\fP
-Equivalent to
+If cursor is at the end of the line it is equivalent to
+.B /
+with
+.I string^\
+set to the contents of the current line.
+Otherwise, it is equivalent to
.BR k .
.TP 10
[\f2count\fP]\f3j\fP
@@ -5070,6 +5287,9 @@ tilde substitution is performed after the
.B =
sign and field splitting and file name generation are not
performed.
+These are called
+.I declaration\^
+built-ins.
.PD
.TP
\(dg \f3:\fP \*(OK \f2arg\^\fP .\|.\|. \*(CK
@@ -5425,6 +5645,16 @@ See
.IR echo (1)
for usage and description.
.TP
+\(dg\(dg \f3enum\fP \*(OK \f3\-i\fP \*(CK \f2type\^\fP\*(OK=(\f2value\^\fP .\|.\|.) \*(CK
+Creates a declaration command named \f2type\^\fP that is an
+integer type that allows one of the specifed \f2value\fPs as
+enumeration names. If \f3=(\fP\f2value\^\ .\|.\|.\|\fP\f3)\fP is
+omitted, then \f2type\^\fP must be an indexed array variable with at
+least two elements and the values are taken from this array variable.
+If
+.B -i
+is specified the values are case insensitive.
+.TP
\(dg \f3eval\fP \*(OK \f2arg\^\fP .\|.\|. \*(CK
The arguments are read as input
to the shell
@@ -5891,7 +6121,7 @@ other than
.BR \-n .
The
.B \-e
-causes the above escape conventions to be applied
+causes the above escape conventions to be applied.
This is the default behavior.
It reverses the effect of an earlier
.BR \-r .
@@ -5961,7 +6191,7 @@ format can be used instead of
to cause characters in
.I arg\^
that are special in HTML and XML
-to be output to be output as their entity name.
+to be output as their entity name.
.LI
A
.B %P
@@ -5978,7 +6208,7 @@ format can be used instead of
.B %s
to cause
.I arg\^
-interpreted as a shell pattern
+to be interpreted as a shell pattern
and to be printed as an extended regular expression.
.LI
A
@@ -6008,7 +6238,7 @@ format can be followed by a
and the output base.
In this case, the
.B #
-flag character caues
+flag character causes
.IB base #
to be prepended.
.LI
@@ -6051,7 +6281,7 @@ or
on the command line
determines which method is used.
.TP
-\f3read\fP \*(OK \f3\-Aprs\^\fP \*(CK \*(OK \f3\-d\fP \f2delim\^\fP\*(CK \*(OK \f3\-n\fP \f2n\^\fP\*(CK \*(OK \*(OK \f3\-N\fP \f2n\^\fP\*(CK \*(OK \*(OK \f3\-t\fP \f2timeout\^\fP\*(CK \*(OK \f3\-u\fP \f2unit\^\fP\*(CK \*(OK \f2vname\f3?\f2prompt\^\f1 \*(CK \*(OK \f2vname\^\fP .\|.\|. \*(CK
+\f3read\fP \*(OK \f3\-ACprsv\^\fP \*(CK \*(OK \f3\-d\fP \f2delim\^\fP\*(CK \*(OK \f3\-n\fP \f2n\^\fP\*(CK \*(OK \*(OK \f3\-N\fP \f2n\^\fP\*(CK \*(OK \*(OK \f3\-t\fP \f2timeout\^\fP\*(CK \*(OK \f3\-u\fP \f2unit\^\fP\*(CK \*(OK \f2vname\f3?\f2prompt\^\f1 \*(CK \*(OK \f2vname\^\fP .\|.\|. \*(CK
The shell input mechanism.
One line is read and
is broken up into fields using the characters in
@@ -6117,6 +6347,12 @@ to be unset and each field that is read to be stored in
successive elements of the indexed array
.IR vname.
The
+.B \-C
+option causes the variable
+.I vname\^
+to be read as a compound variable. Blanks will be ignored when
+finding the beginning open parenthesis.
+The
.B \-p
option causes the input line
to be taken from the input pipe
@@ -6184,6 +6420,8 @@ are marked
readonly and these
names cannot be changed
by subsequent assignment.
+When defining a type, if the value of a readonly sub-variable is not defined
+the value is required when creating each instance.
.TP
\(dg \f3return\fP \*(OK \f2n\^\fP \*(CK
Causes a shell
@@ -6208,7 +6446,7 @@ script,
then it behaves the same as
.BR exit .
.TP
-\(dg \f3set\fP \*(OK \f3\(+-CGabefhkmnoprstuvx\fP \*(CK \*(OK \f3\(+-o\fP \*(OK \f2option\^\fP \*(CK \*(CK .\|.\|. \*(OK \f3\(+-A\fP \f2vname\^\fP \*(CK \*(OK \f2arg\^\fP .\|.\|. \*(CK
+\(dg \f3set\fP \*(OK \f3\(+-BCGabefhkmnoprstuvx\fP \*(CK \*(OK \f3\(+-o\fP \*(OK \f2option\^\fP \*(CK \*(CK .\|.\|. \*(OK \f3\(+-A\fP \f2vname\^\fP \*(CK \*(OK \f2arg\^\fP .\|.\|. \*(CK
The options for this command have meaning as follows:
.RS
.PD 0
@@ -6230,6 +6468,9 @@ is not unset first.
Enable brace pattern field generation.
This is the default behavior.
.TP 8
+.B \-B
+Enable brace group expansion. On by default.
+.TP 8
.B \-C
Prevents redirection
.B >
@@ -6256,7 +6497,18 @@ Prints job completion messages as soon as a background job changes
state rather than waiting for the next prompt.
.TP 8
.B \-e
-If a command has a non-zero exit status,
+Unless contained in a
+.B \(bv\(bv
+or
+.B &&
+command, or the command following an
+.B if
+.B while
+or
+.B until
+command or in the pipeline following
+.BR ! ,
+if a command has a non-zero exit status,
execute the
.SM
.B ERR
@@ -6303,8 +6555,8 @@ Same as
All background jobs are run at a lower priority.
This is the default mode.
.TP 8
-.B bracexpand
-Sans as
+.B braceexpand
+Same as
.BR \-B .
.TP 8
.B emacs
@@ -6372,10 +6624,10 @@ Same as
A pipeline will not complete until all components
of the pipeline have completed, and the return value
will be the value of the last non-zero command
-to fail or zero of no command has failed.
+to fail or zero if no command has failed.
.TP 8
.B showme
-When enabled, simple commands or pipelines preceded by a a semicolon
+When enabled, simple commands or pipelines preceded by a semicolon
.RB ( ; )
will be displayed as if the
.B xtrace
@@ -6572,6 +6824,13 @@ will contain the contents of the current command line
when
.I action\^
is running.
+If the exit status of the trap is
+.B 2
+the command will not be executed.
+If the exit status of the trap is
+.B 255
+and inside a function or a dot script,
+the function or dot script will return.
If
.I sig\^
is
@@ -6628,7 +6887,7 @@ Does nothing, and exits 0. Used with
.B while
for infinite loops.
.TP
-\(dg\(dg \f3typeset\fP \*(OK \f3\(+-AHflabnprtux\^\fP \*(CK \*(OK \f3\(+-EFLRZi\*(OK\f2n\^\fP\*(CK \*(CK \*(OK \f2vname\^\fP\*(OK\f3=\fP\f2value\^\fP \*(CK \^ \*(CK .\|.\|.
+\(dg\(dg \f3typeset\fP \*(OK \f3\(+-ACHSflbnprtux\^\fP \*(CK \*(OK \f3\(+-EFLRXZi\*(OK\f2n\^\fP\*(CK \*(CK \*(OK \f3\-T \f2tname\fP=(\f2assign_list\fP) \*(CK \*(OK \f3\-h \f2str\fP \*(CK \*(OK \f3\-a\fP \*(OK\f2type\fP\*(CK \*(CK \*(OK \f2vname\^\fP\*(OK\f3=\fP\f2value\^\fP \*(CK \^ \*(CK .\|.\|.
Sets attributes and values for shell variables and functions.
When invoked inside a function defined with the
.B function
@@ -6650,11 +6909,27 @@ to be an associative array.
Subscripts are strings rather than arithmetic
expressions.
.TP
+.B \-C
+causes each
+.I vname\^
+to be a compound variable.
+.I value\^
+names a compound variable it is copied into
+.IR vname .
+Otherwise, it unsets each
+.IR vname .
+.TP
.B \-a
Declares
.I vname\^
to be an indexed array.
-This is optional unless except for compound variable assignments.
+If
+.I type\^
+is specified, it must be the name of an enumeration
+type created with the
+.B enum
+command and it allows enumeration constants to be used
+as subscripts.
.TP
.B \-E
Declares
@@ -6713,6 +6988,38 @@ The
.B \-L
option is turned off.
.TP
+.B \-S
+When used within the
+.I assign_list\^
+of a type definition, it causes the specified sub-variable
+to be shared by all instances of the type.
+When used inside a function defined with the
+.B function
+reserved word, the specified variables will have
+.I "function static\^"
+scope.
+Otherwise, the variable is unset prior to processing the assignment list.
+.TP
+.B \-T
+Creates a type named by \fItname\^\fP using the compound
+assignment
+.I assign_list\^
+to \f2tname\fP.
+.TP
+.B \-X
+Declares
+.I vname\^
+to be a double precision floating point number
+and expands using the
+.B %a
+format of ISO-C99.
+If
+.I n\^
+is non-zero, it defines the number of hex digits after
+the radix point that is used when expanding
+.IR vname .
+The default is 10.
+.TP
.B \-Z
Right justify and fill with leading zeros if
the first non-blank character is a digit and the
@@ -6778,6 +7085,15 @@ format
can be used to output the actual data in this buffer instead
of the base64 encoding of the data.
.TP
+.B \-h
+Used within type definitions to add information when generating
+information about the sub-variable on the man page.
+It is ignored when used outside of a type definition.
+When used with
+.B \-f
+the information is associated with the corresponding discipline
+function.
+.TP
.B \-i
Declares
.I vname\^
@@ -6805,6 +7121,15 @@ defined by the value of variable
This is usually used to reference a variable inside
a function whose name has been passed as an argument.
.TP
+.B \-p
+The name, attributes and values for the give
+.IR vname s
+are written on standard output in a form that can be
+used as shell input.
+If
+.B +p
+is specified, then the values are not displayed.
+.TP
.B \-r
The given
.IR vname s
@@ -6913,7 +7238,7 @@ If neither the
.B H
nor
.B S
-options is specified, the limit applies to both.
+option is specified, the limit applies to both.
The current resource limit is printed when
.I limit\^
is omitted.
@@ -7001,7 +7326,10 @@ The variables given by the list of
.IR vname s
are unassigned,
i.e.,
+except for sub-variables within a type,
their values and attributes are erased.
+For sub-variables of a type, the values are reset to the
+default value from the type definition.
Readonly variables cannot be unset.
If the
.B \-f
@@ -7078,7 +7406,7 @@ option
produces a more verbose report.
The
.B \-f
-options skips the search for functions.
+option skips the search for functions.
The
.B \-p
option
@@ -7086,6 +7414,11 @@ does a path search for
.I name\^
even if name is an alias, a function, or a reserved word.
The
+.B \-p
+option turns off the
+.B \-v
+option.
+The
.B \-a
option
is similar to the
@@ -7123,7 +7456,7 @@ option is not present and
.I arg\^
and a file by the name of
.I arg\^
-exits, then it reads and executes this script.
+exists, then it reads and executes this script.
Otherwise, if the first
.I arg\^
does not contain a
@@ -7146,6 +7479,19 @@ the following options are interpreted by the shell
when it is invoked:
.PP
.PD 0
+.TP 8
+.B \-D
+Do not execute the script, but output the set of double quoted strings
+preceded by a
+.BR $ .
+These strings are needed for localization of the script to different locales.
+.TP 8
+.B \-E
+Reads the file named by the
+.B ENV
+variable or by
+\s-1$HOME\s+1/\f3.\fPkshrc
+if not defined after the profiles.
.TP 10
.BI \-c
If the
@@ -7451,3 +7797,4 @@ won't be executed until the foreground job terminates.
It is a good idea to leave a space after the comma operator in
arithmetic expressions to prevent the comma from being interpreted
as the decimal point character in certain locales.
+
diff --git a/usr/src/lib/libshell/common/sh/args.c b/usr/src/lib/libshell/common/sh/args.c
index ad1bf46a40..06ae7dbd38 100644
--- a/usr/src/lib/libshell/common/sh/args.c
+++ b/usr/src/lib/libshell/common/sh/args.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -43,7 +43,7 @@
# define PFSHOPT
#endif
#if SHOPT_BASH
-# define BASHOPT "\375\374\373"
+# define BASHOPT "\374"
#else
# define BASHOPT
#endif
@@ -56,10 +56,6 @@
#define SORT 1
#define PRINT 2
-void sh_applyopts(Shopt_t);
-
-static int arg_expand(struct argnod*,struct argnod**,int);
-
static char *null;
/* The following order is determined by sh_optset */
@@ -70,7 +66,7 @@ static const int flagval[] =
SH_PFSH,
#endif
#if SHOPT_BASH
- SH_NOPROFILE, SH_RC, SH_POSIX,
+ SH_POSIX,
#endif
SH_DICTIONARY, SH_INTERACTIVE, SH_RESTRICTED, SH_CFLAG,
SH_ALLEXPORT, SH_NOTIFY, SH_ERREXIT, SH_NOGLOB, SH_TRACKALL,
@@ -87,7 +83,7 @@ static const int flagval[] =
typedef struct _arg_
{
- Shell_t *shp;
+ Shell_t *sh;
struct dolnod *argfor; /* linked list of blocks to be cleaned up */
struct dolnod *dolh;
char flagadr[NUM_OPTS+1];
@@ -96,6 +92,9 @@ typedef struct _arg_
#endif /* SHOPT_KIA */
} Arg_t;
+static int arg_expand(Shell_t*,struct argnod*,struct argnod**,int);
+static void sh_argset(Arg_t*, char *[]);
+
/* ======== option handling ======== */
@@ -103,7 +102,7 @@ void *sh_argopen(Shell_t *shp)
{
void *addr = newof(0,Arg_t,1,0);
Arg_t *ap = (Arg_t*)addr;
- ap->shp = shp;
+ ap->sh = shp;
return(addr);
}
@@ -136,17 +135,19 @@ static int infof(Opt_t* op, Sfio_t* sp, const char* s, Optdisc_t* dp)
* The -o option is used to set option by name
* This routine returns the number of non-option arguments
*/
-int sh_argopts(int argc,register char *argv[])
+int sh_argopts(int argc,register char *argv[], void *context)
{
- register int n,o;
- register Arg_t *ap = (Arg_t*)sh.arg_context;
- Shopt_t newflags;
+ Shell_t *shp = (Shell_t*)context;
+ register int n,o;
+ register Arg_t *ap = (Arg_t*)(shp->arg_context);
+ Lex_t *lp = (Lex_t*)(shp->lex_context);
+ Shopt_t newflags;
int setflag=0, action=0, trace=(int)sh_isoption(SH_XTRACE);
Namval_t *np = NIL(Namval_t*);
const char *cp;
int verbose,f;
Optdisc_t disc;
- newflags=sh.options;
+ newflags=ap->sh->options;
memset(&disc, 0, sizeof(disc));
disc.version = OPT_VERSION;
disc.infof = infof;
@@ -159,11 +160,11 @@ int sh_argopts(int argc,register char *argv[])
while((n = optget(argv,setflag?sh_optset:sh_optksh)))
{
o=0;
- f=*opt_info.option=='-';
+ f=*opt_info.option=='-' && (opt_info.num || opt_info.arg);
switch(n)
{
case 'A':
- np = nv_open(opt_info.arg,sh.var_tree,NV_NOASSIGN|NV_ARRAY|NV_VARNAME);
+ np = nv_open(opt_info.arg,ap->sh->var_tree,NV_NOASSIGN|NV_ARRAY|NV_VARNAME);
if(f)
nv_unset(np);
continue;
@@ -202,34 +203,51 @@ int sh_argopts(int argc,register char *argv[])
break;
#if SHOPT_BASH
case -1: /* --rcfile */
- sh.rcfile = opt_info.arg;
+ ap->sh->rcfile = opt_info.arg;
continue;
- case -6: /* --version */
- sfputr(sfstdout, "ksh bash emulation, version ",-1);
- np = nv_open("BASH_VERSION",sh.var_tree,0);
- sfputr(sfstdout, nv_getval(np),-1);
- np = nv_open("MACHTYPE",sh.var_tree,0);
- sfprintf(sfstdout, " (%s)\n", nv_getval(np));
- sh_exit(0);
-
case -2: /* --noediting */
- off_option(&newflags,SH_VI);
- off_option(&newflags,SH_EMACS);
- off_option(&newflags,SH_GMACS);
+ if (!f)
+ {
+ off_option(&newflags,SH_VI);
+ off_option(&newflags,SH_EMACS);
+ off_option(&newflags,SH_GMACS);
+ }
continue;
-
case -3: /* --profile */
- f = !f;
- /*FALLTHROUGH*/
- case -4: /* --rc */
- case -5: /* --posix */
+ n = 'l';
+ goto skip;
+ case -4: /* --posix */
/* mask lower 8 bits to find char in optksh string */
n&=0xff;
goto skip;
+ case -5: /* --version */
+ sfputr(sfstdout, "ksh bash emulation, version ",-1);
+ np = nv_open("BASH_VERSION",ap->sh->var_tree,0);
+ sfputr(sfstdout, nv_getval(np),-1);
+ np = nv_open("MACHTYPE",ap->sh->var_tree,0);
+ sfprintf(sfstdout, " (%s)\n", nv_getval(np));
+ sh_exit(0);
#endif
+ case -6: /* --default */
+ {
+ register const Shtable_t *tp;
+ for(tp=shtab_options; o = tp->sh_number; tp++)
+ if(!(o&SH_COMMANDLINE) && is_option(&newflags,o&0xff))
+ off_option(&newflags,o&0xff);
+ }
+ continue;
+ case -7:
+ f = 0;
+ goto byname;
case 'D':
on_option(&newflags,SH_NOEXEC);
goto skip;
+ case 'T':
+ if (opt_info.num)
+ ap->sh->test |= opt_info.num;
+ else
+ ap->sh->test = 0;
+ continue;
case 's':
if(setflag)
{
@@ -275,7 +293,7 @@ int sh_argopts(int argc,register char *argv[])
off_option(&newflags,SH_GMACS);
}
on_option(&newflags,o);
- off_option(&sh.offoptions,o);
+ off_option(&ap->sh->offoptions,o);
}
else
{
@@ -283,7 +301,7 @@ int sh_argopts(int argc,register char *argv[])
trace = 0;
off_option(&newflags,o);
if(setflag==0)
- on_option(&sh.offoptions,o);
+ on_option(&ap->sh->offoptions,o);
}
}
if(error_info.errors)
@@ -310,7 +328,7 @@ int sh_argopts(int argc,register char *argv[])
if(argc>0)
strsort(argv,argc,strcoll);
else
- strsort(sh.st.dolv+1,sh.st.dolc,strcoll);
+ strsort(ap->sh->st.dolv+1,ap->sh->st.dolc,strcoll);
}
if(np)
{
@@ -318,11 +336,11 @@ int sh_argopts(int argc,register char *argv[])
nv_close(np);
}
else if(argc>0 || ((cp=argv[-1]) && strcmp(cp,"--")==0))
- sh_argset(argv-1);
+ sh_argset(ap,argv-1);
}
else if(is_option(&newflags,SH_CFLAG))
{
- if(!(sh.comdiv = *argv++))
+ if(!(ap->sh->comdiv = *argv++))
{
errormsg(SH_DICT,2,e_cneedsarg);
errormsg(SH_DICT,ERROR_usage(2),optusage(NIL(char*)));
@@ -332,23 +350,25 @@ int sh_argopts(int argc,register char *argv[])
/* handling SH_INTERACTIVE and SH_PRIVILEGED has been moved to
* sh_applyopts(), so that the code can be reused from b_shopt(), too
*/
- sh_applyopts(newflags);
+ sh_applyopts(ap->sh,newflags);
#if SHOPT_KIA
if(ap->kiafile)
{
- if(!(shlex.kiafile=sfopen(NIL(Sfio_t*),ap->kiafile,"w+")))
+ if(!argv[0])
+ errormsg(SH_DICT,ERROR_usage(2),"-R requires scriptname");
+ if(!(lp->kiafile=sfopen(NIL(Sfio_t*),ap->kiafile,"w+")))
errormsg(SH_DICT,ERROR_system(3),e_create,ap->kiafile);
- if(!(shlex.kiatmp=sftmp(2*SF_BUFSIZE)))
+ if(!(lp->kiatmp=sftmp(2*SF_BUFSIZE)))
errormsg(SH_DICT,ERROR_system(3),e_tmpcreate);
- sfputr(shlex.kiafile,";vdb;CIAO/ksh",'\n');
- shlex.kiabegin = sftell(shlex.kiafile);
- shlex.entity_tree = dtopen(&_Nvdisc,Dtbag);
- shlex.scriptname = strdup(sh_fmtq(argv[0]));
- shlex.script=kiaentity(shlex.scriptname,-1,'p',-1,0,0,'s',0,"");
- shlex.fscript=kiaentity(shlex.scriptname,-1,'f',-1,0,0,'s',0,"");
- shlex.unknown=kiaentity("<unknown>",-1,'p',-1,0,0,'0',0,"");
- kiaentity("<unknown>",-1,'p',0,0,shlex.unknown,'0',0,"");
- shlex.current = shlex.script;
+ sfputr(lp->kiafile,";vdb;CIAO/ksh",'\n');
+ lp->kiabegin = sftell(lp->kiafile);
+ lp->entity_tree = dtopen(&_Nvdisc,Dtbag);
+ lp->scriptname = strdup(sh_fmtq(argv[0]));
+ lp->script=kiaentity(lp,lp->scriptname,-1,'p',-1,0,0,'s',0,"");
+ lp->fscript=kiaentity(lp,lp->scriptname,-1,'f',-1,0,0,'s',0,"");
+ lp->unknown=kiaentity(lp,"<unknown>",-1,'p',-1,0,0,'0',0,"");
+ kiaentity(lp,"<unknown>",-1,'p',0,0,lp->unknown,'0',0,"");
+ lp->current = lp->script;
ap->kiafile = 0;
}
#endif /* SHOPT_KIA */
@@ -357,7 +377,7 @@ int sh_argopts(int argc,register char *argv[])
/* apply new options */
-void sh_applyopts(Shopt_t newflags)
+void sh_applyopts(Shell_t* shp,Shopt_t newflags)
{
/* cannot set -n for interactive shells since there is no way out */
if(sh_isoption(SH_INTERACTIVE))
@@ -368,17 +388,17 @@ void sh_applyopts(Shopt_t newflags)
{
if(sh_isoption(SH_PRIVILEGED))
{
- setuid(sh.userid);
- setgid(sh.groupid);
- if(sh.euserid==0)
+ setuid(shp->userid);
+ setgid(shp->groupid);
+ if(shp->euserid==0)
{
- sh.euserid = sh.userid;
- sh.egroupid = sh.groupid;
+ shp->euserid = shp->userid;
+ shp->egroupid = shp->groupid;
}
}
- else if((sh.userid!=sh.euserid && setuid(sh.euserid)<0) ||
- (sh.groupid!=sh.egroupid && setgid(sh.egroupid)<0) ||
- (sh.userid==sh.euserid && sh.groupid==sh.egroupid))
+ else if((shp->userid!=shp->euserid && setuid(shp->euserid)<0) ||
+ (shp->groupid!=shp->egroupid && setgid(shp->egroupid)<0) ||
+ (shp->userid==shp->euserid && shp->groupid==shp->egroupid))
off_option(&newflags,SH_PRIVILEGED);
}
#if SHOPT_BASH
@@ -410,15 +430,16 @@ void sh_applyopts(Shopt_t newflags)
sh_offoption(SH_HISTORY);
}
#endif
- sh.options = newflags;
+ shp->options = newflags;
}
+
/*
* returns the value of $-
*/
-char *sh_argdolminus(void)
+char *sh_argdolminus(void* context)
{
+ register Arg_t *ap = (Arg_t*)context;
register const char *cp=optksh;
- register Arg_t *ap = (Arg_t*)sh.arg_context;
register char *flagp=ap->flagadr;
while(cp< &optksh[NUM_OPTS])
{
@@ -434,16 +455,15 @@ char *sh_argdolminus(void)
/*
* set up positional parameters
*/
-void sh_argset(char *argv[])
+static void sh_argset(Arg_t *ap,char *argv[])
{
- register Arg_t *ap = (Arg_t*)sh.arg_context;
- sh_argfree(ap->dolh,0);
+ sh_argfree(ap->sh,ap->dolh,0);
ap->dolh = sh_argcreate(argv);
/* link into chain */
ap->dolh->dolnxt = ap->argfor;
ap->argfor = ap->dolh;
- sh.st.dolc = ap->dolh->dolnum-1;
- sh.st.dolv = ap->dolh->dolval;
+ ap->sh->st.dolc = ap->dolh->dolnum-1;
+ ap->sh->st.dolv = ap->dolh->dolval;
}
/*
@@ -453,11 +473,11 @@ void sh_argset(char *argv[])
* Delete the blk from the argfor chain
* If flag is set, then the block dolh is not freed
*/
-struct dolnod *sh_argfree(struct dolnod *blk,int flag)
+struct dolnod *sh_argfree(Shell_t *shp, struct dolnod *blk,int flag)
{
register struct dolnod* argr=blk;
register struct dolnod* argblk;
- register Arg_t *ap = (Arg_t*)sh.arg_context;
+ register Arg_t *ap = (Arg_t*)shp->arg_context;
if(argblk=argr)
{
if((--argblk->dolrefcnt)==0)
@@ -518,39 +538,39 @@ struct dolnod *sh_argcreate(register char *argv[])
/*
* used to set new arguments for functions
*/
-struct dolnod *sh_argnew(char *argi[], struct dolnod **savargfor)
+struct dolnod *sh_argnew(Shell_t *shp,char *argi[], struct dolnod **savargfor)
{
- register Arg_t *ap = (Arg_t*)sh.arg_context;
+ register Arg_t *ap = (Arg_t*)shp->arg_context;
register struct dolnod *olddolh = ap->dolh;
*savargfor = ap->argfor;
ap->dolh = 0;
ap->argfor = 0;
- sh_argset(argi);
+ sh_argset(ap,argi);
return(olddolh);
}
/*
* reset arguments as they were before function
*/
-void sh_argreset(struct dolnod *blk, struct dolnod *afor)
+void sh_argreset(Shell_t *shp,struct dolnod *blk, struct dolnod *afor)
{
- register Arg_t *ap = (Arg_t*)sh.arg_context;
- while(ap->argfor=sh_argfree(ap->argfor,0));
+ register Arg_t *ap = (Arg_t*)shp->arg_context;
+ while(ap->argfor=sh_argfree(shp,ap->argfor,0));
ap->argfor = afor;
if(ap->dolh = blk)
{
- sh.st.dolc = ap->dolh->dolnum-1;
- sh.st.dolv = ap->dolh->dolval;
+ shp->st.dolc = ap->dolh->dolnum-1;
+ shp->st.dolv = ap->dolh->dolval;
}
}
/*
* increase the use count so that an sh_argset will not make it go away
*/
-struct dolnod *sh_arguse(void)
+struct dolnod *sh_arguse(Shell_t* shp)
{
register struct dolnod *dh;
- register Arg_t *ap = (Arg_t*)sh.arg_context;
+ register Arg_t *ap = (Arg_t*)shp->arg_context;
if(dh=ap->dolh)
dh->dolrefcnt++;
return(dh);
@@ -624,7 +644,7 @@ void sh_printopts(Shopt_t oflags,register int mode, Shopt_t *mask)
if(mode&PRINT_SHOPT)
sfwrite(sfstdout,"shopt -s",3);
else
- sfwrite(sfstdout,"set",3);
+ sfwrite(sfstdout,"set --default",13);
}
for(tp=shtab_options; value=tp->sh_number; tp++)
{
@@ -671,11 +691,11 @@ void sh_printopts(Shopt_t oflags,register int mode, Shopt_t *mask)
/*
* build an argument list
*/
-char **sh_argbuild(int *nargs, const struct comnod *comptr,int flag)
+char **sh_argbuild(Shell_t *shp,int *nargs, const struct comnod *comptr,int flag)
{
register struct argnod *argp;
struct argnod *arghead=0;
- sh.xargmin = 0;
+ shp->xargmin = 0;
{
register const struct comnod *ac = comptr;
register int n;
@@ -689,10 +709,9 @@ char **sh_argbuild(int *nargs, const struct comnod *comptr,int flag)
{
register struct dolnod *ap = (struct dolnod*)ac->comarg;
*nargs = ap->dolnum;
- ((struct comnod*)ac)->comtyp |= COMFIXED;
return(ap->dolval+ap->dolbot);
}
- sh.lastpath = 0;
+ shp->lastpath = 0;
*nargs = 0;
if(ac)
{
@@ -701,12 +720,12 @@ char **sh_argbuild(int *nargs, const struct comnod *comptr,int flag)
argp = ac->comarg;
while(argp)
{
- n = arg_expand(argp,&arghead,flag);
+ n = arg_expand(shp,argp,&arghead,flag);
if(n>1)
{
- if(sh.xargmin==0)
- sh.xargmin = *nargs;
- sh.xargmax = *nargs+n;
+ if(shp->xargmin==0)
+ shp->xargmin = *nargs;
+ shp->xargmax = *nargs+n;
}
*nargs += n;
argp = argp->argnxt.ap;
@@ -718,12 +737,11 @@ char **sh_argbuild(int *nargs, const struct comnod *comptr,int flag)
register char **comargn;
register int argn;
register char **comargm;
- int argfixed = COMFIXED;
argn = *nargs;
/* allow room to prepend args */
argn += 1;
- comargn=(char**)stakalloc((unsigned)(argn+1)*sizeof(char*));
+ comargn=(char**)stkalloc(shp->stk,(unsigned)(argn+1)*sizeof(char*));
comargm = comargn += argn;
*comargn = NIL(char*);
if(!argp)
@@ -737,8 +755,6 @@ char **sh_argbuild(int *nargs, const struct comnod *comptr,int flag)
struct argnod *nextarg = argp->argchn.ap;
argp->argchn.ap = 0;
*--comargn = argp->argval;
- if(!(argp->argflag&ARG_RAW) || (argp->argflag&ARG_EXP))
- argfixed = 0;
if(!(argp->argflag&ARG_RAW))
sh_trim(*comargn);
if(!(argp=nextarg) || (argp->argflag&ARG_MAKE))
@@ -748,7 +764,7 @@ char **sh_argbuild(int *nargs, const struct comnod *comptr,int flag)
comargm = comargn;
}
}
- ((struct comnod*)comptr)->comtyp |= argfixed;
+ shp->last_table = 0;
return(comargn);
}
}
@@ -774,7 +790,7 @@ static int arg_pipe(register int pv[])
#endif
/* Argument expansion */
-static int arg_expand(register struct argnod *argp, struct argnod **argchain,int flag)
+static int arg_expand(Shell_t *shp,register struct argnod *argp, struct argnod **argchain,int flag)
{
register int count = 0;
argp->argflag &= ~ARG_MAKE;
@@ -784,34 +800,34 @@ static int arg_expand(register struct argnod *argp, struct argnod **argchain,int
/* argument of the form (cmd) */
register struct argnod *ap;
int monitor, fd, pv[2];
- ap = (struct argnod*)stakseek(ARGVAL);
+ ap = (struct argnod*)stkseek(shp->stk,ARGVAL);
ap->argflag |= ARG_MAKE;
ap->argflag &= ~ARG_RAW;
ap->argchn.ap = *argchain;
*argchain = ap;
count++;
- stakwrite(e_devfdNN,8);
+ sfwrite(shp->stk,e_devfdNN,8);
sh_pipe(pv);
fd = argp->argflag&ARG_RAW;
- stakputs(fmtbase((long)pv[fd],10,0));
- ap = (struct argnod*)stakfreeze(1);
- sh.inpipe = sh.outpipe = 0;
+ sfputr(shp->stk,fmtbase((long)pv[fd],10,0),0);
+ ap = (struct argnod*)stkfreeze(shp->stk,0);
+ shp->inpipe = shp->outpipe = 0;
if(monitor = (sh_isstate(SH_MONITOR)!=0))
sh_offstate(SH_MONITOR);
if(fd)
{
- sh.inpipe = pv;
+ shp->inpipe = pv;
sh_exec((Shnode_t*)argp->argchn.ap,(int)sh_isstate(SH_ERREXIT));
}
else
{
- sh.outpipe = pv;
+ shp->outpipe = pv;
sh_exec((Shnode_t*)argp->argchn.ap,(int)sh_isstate(SH_ERREXIT));
}
if(monitor)
sh_onstate(SH_MONITOR);
close(pv[1-fd]);
- sh_iosave(-pv[fd], sh.topfd);
+ sh_iosave(shp,-pv[fd], shp->topfd, (char*)0);
}
else
#endif /* SHOPT_DEVFD */
@@ -819,11 +835,12 @@ static int arg_expand(register struct argnod *argp, struct argnod **argchain,int
{
#if SHOPT_OPTIMIZE
struct argnod *ap;
+ sh_stats(STAT_ARGEXPAND);
if(flag&ARG_OPTIMIZE)
argp->argchn.ap=0;
if(ap=argp->argchn.ap)
{
- sh.optcount++;
+ sh_stats(STAT_ARGHITS);
count = 1;
ap->argchn.ap = *argchain;
ap->argflag |= ARG_RAW;
@@ -832,7 +849,7 @@ static int arg_expand(register struct argnod *argp, struct argnod **argchain,int
}
else
#endif /* SHOPT_OPTIMIZE */
- count = sh_macexpand(argp,argchain,flag);
+ count = sh_macexpand(shp,argp,argchain,flag);
}
else
{
diff --git a/usr/src/lib/libshell/common/sh/arith.c b/usr/src/lib/libshell/common/sh/arith.c
index b81e798fae..f21b79ad6f 100644
--- a/usr/src/lib/libshell/common/sh/arith.c
+++ b/usr/src/lib/libshell/common/sh/arith.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -35,7 +35,7 @@
#define LLONG_MAX LONG_MAX
#endif
-static Sfdouble_t Zero, NaN, Inf;
+static Sfdouble_t NaN, Inf, Fun;
static Namval_t Infnod =
{
{ 0 },
@@ -50,36 +50,51 @@ static Namval_t NaNnod =
NV_NOFREE|NV_LDOUBLE,NV_RDONLY
};
-static Namval_t *scope(register Namval_t *np,register struct lval *lvalue,int assign)
+static Namval_t FunNode =
+{
+ { 0 },
+ "?",
+ NV_NOFREE|NV_LDOUBLE,NV_RDONLY
+};
+
+static Namval_t *scope(Shell_t *shp,register Namval_t *np,register struct lval *lvalue,int assign)
{
register Namarr_t *ap;
register int flag = lvalue->flag;
- register char *sub=0;
- if(lvalue->emode&ARITH_COMP)
+ register char *sub=0, *cp=(char*)np;
+ register Namval_t *mp;
+ int flags = HASH_NOSCOPE|HASH_SCOPE|HASH_BUCKET;
+ Dt_t *sdict = (shp->st.real_fun? shp->st.real_fun->sdict:0);
+ assign = assign?NV_ASSIGN:NV_NOASSIGN;
+ if(cp>=lvalue->expr && cp < lvalue->expr+lvalue->elen)
{
- char *cp = (char*)np;
- register Namval_t *mp;
- if(cp>=lvalue->expr && cp < lvalue->expr+lvalue->elen)
+ int offset;
+ /* do binding to node now */
+ int c = cp[flag];
+ cp[flag] = 0;
+ if((!(np = nv_open(cp,shp->var_tree,assign|NV_VARNAME|NV_NOADD|NV_NOFAIL)) || nv_isnull(np)) && sh_macfun(shp,cp, offset = staktell()))
{
- /* do bindiing to node now */
- int c = cp[flag];
- cp[flag] = 0;
- np = nv_open(cp,sh.var_tree,NV_NOASSIGN|NV_VARNAME);
+ Fun = sh_arith(sub=stakptr(offset));
+ FunNode.nvalue.ldp = &Fun;
cp[flag] = c;
- if(cp[flag+1]=='[')
- flag++;
- else
- flag = 0;
+ return(&FunNode);
}
- else if(dtvnext(sh.var_tree) && (mp=nv_search((char*)np,sh.var_tree,HASH_NOSCOPE|HASH_SCOPE|HASH_BUCKET)))
+ np = nv_open(cp,shp->var_tree,assign|NV_VARNAME);
+ cp[flag] = c;
+ if(cp[flag+1]=='[')
+ flag++;
+ else
+ flag = 0;
+ cp = (char*)np;
+ }
+ if((lvalue->emode&ARITH_COMP) && dtvnext(shp->var_tree) && ((mp=nv_search(cp,shp->var_tree,flags))||(sdict && (mp=nv_search(cp,sdict,flags)))))
+ {
+ while(nv_isref(mp))
{
- while(nv_isref(mp))
- {
- sub = nv_refsub(mp);
- mp = nv_refnode(mp);
- }
- np = mp;
+ sub = nv_refsub(mp);
+ mp = nv_refnode(mp);
}
+ np = mp;
}
if(flag || sub)
{
@@ -95,14 +110,16 @@ static Namval_t *scope(register Namval_t *np,register struct lval *lvalue,int as
static Sfdouble_t arith(const char **ptr, struct lval *lvalue, int type, Sfdouble_t n)
{
+ Shell_t *shp = &sh;
register Sfdouble_t r= 0;
char *str = (char*)*ptr;
+ register char *cp;
switch(type)
{
case ASSIGN:
{
register Namval_t *np = (Namval_t*)(lvalue->value);
- np = scope(np,lvalue,1);
+ np = scope(shp,np,lvalue,1);
nv_putval(np, (char*)&n, NV_LDOUBLE);
r=nv_getnum(np);
break;
@@ -119,14 +136,18 @@ static Sfdouble_t arith(const char **ptr, struct lval *lvalue, int type, Sfdoubl
{
register Namval_t *np;
int dot=0;
- char *cp;
while(1)
{
while(xp=str, c=mbchar(str), isaname(c));
str = xp;
+ if(c=='[' && dot==NV_NOADD)
+ {
+ str = nv_endsubscript((Namval_t*)0,str,0);
+ c = *str;
+ }
if(c!='.')
break;
- dot=1;
+ dot=NV_NOADD;
if((c = *++str) !='[')
continue;
str = nv_endsubscript((Namval_t*)0,cp=str,NV_SUBQUOTE)-1;
@@ -168,7 +189,7 @@ static Sfdouble_t arith(const char **ptr, struct lval *lvalue, int type, Sfdoubl
{
int offset = staktell();
char *saveptr = stakfreeze(0);
- Dt_t *root = (lvalue->emode&ARITH_COMP)?sh.var_base:sh.var_tree;
+ Dt_t *root = (lvalue->emode&ARITH_COMP)?shp->var_base:shp->var_tree;
*str = c;
while(c=='[' || c=='.')
{
@@ -184,32 +205,39 @@ static Sfdouble_t arith(const char **ptr, struct lval *lvalue, int type, Sfdoubl
}
else
{
+ dot = NV_NOADD|NV_NOFAIL;
str++;
while(xp=str, c=mbchar(str), isaname(c));
str = xp;
}
}
*str = 0;
- if(strcasecmp(*ptr,"Inf")==0)
+ cp = (char*)*ptr;
+ if ((cp[0] == 'i' || cp[0] == 'I') && (cp[1] == 'n' || cp[1] == 'N') && (cp[2] == 'f' || cp[2] == 'F') && cp[3] == 0)
{
- Inf = 1.0/Zero;
+ Inf = strtold("Inf", NiL);
Infnod.nvalue.ldp = &Inf;
np = &Infnod;
}
- else if(strcasecmp(*ptr,"NaN")==0)
+ else if ((cp[0] == 'n' || cp[0] == 'N') && (cp[1] == 'a' || cp[1] == 'A') && (cp[2] == 'n' || cp[2] == 'N') && cp[3] == 0)
{
- NaN = 0.0/Zero;
+ NaN = strtold("NaN", NiL);
NaNnod.nvalue.ldp = &NaN;
np = &NaNnod;
}
- else
- np = nv_open(*ptr,root,NV_NOASSIGN|NV_VARNAME);
+ else if(!(np = nv_open(*ptr,root,NV_NOASSIGN|NV_VARNAME|dot)))
+ {
+ lvalue->value = (char*)*ptr;
+ lvalue->flag = str-lvalue->value;
+ }
if(saveptr != stakptr(0))
stakset(saveptr,offset);
else
stakseek(offset);
}
*str = c;
+ if(!np && lvalue->value)
+ break;
lvalue->value = (char*)np;
if((lvalue->emode&ARITH_COMP) || (nv_isarray(np) && nv_aindex(np)<0))
{
@@ -230,9 +258,7 @@ static Sfdouble_t arith(const char **ptr, struct lval *lvalue, int type, Sfdoubl
str = nv_endsubscript(np,str,NV_ADD|NV_SUBQUOTE);
while((c=*str)=='[');
}
- else if(nv_isarray(np))
- nv_putsub(np,NIL(char*),ARRAY_UNDEF);
- if(nv_isattr(np,NV_INTEGER|NV_DOUBLE)==(NV_INTEGER|NV_DOUBLE))
+ if(nv_isattr(np,NV_DOUBLE)==NV_DOUBLE)
lvalue->isfloat=1;
lvalue->flag = nv_aindex(np);
}
@@ -260,7 +286,8 @@ static Sfdouble_t arith(const char **ptr, struct lval *lvalue, int type, Sfdoubl
c='e';
else
c = *str;
- if(c==GETDECIMAL(0) || c=='e' || c == 'E')
+ if(c==GETDECIMAL(0) || c=='e' || c == 'E' || lastbase ==
+ 16 && (c == 'p' || c == 'P'))
{
lvalue->isfloat=1;
r = strtold(val,&str);
@@ -289,7 +316,7 @@ static Sfdouble_t arith(const char **ptr, struct lval *lvalue, int type, Sfdoubl
register Namval_t *np = (Namval_t*)(lvalue->value);
if(sh_isoption(SH_NOEXEC))
return(0);
- np = scope(np,lvalue,0);
+ np = scope(shp,np,lvalue,0);
if(((lvalue->emode&2) || lvalue->level>1 || sh_isoption(SH_NOUNSET)) && nv_isnull(np) && !nv_isattr(np,NV_INTEGER))
{
*ptr = nv_name(np);
@@ -300,7 +327,7 @@ static Sfdouble_t arith(const char **ptr, struct lval *lvalue, int type, Sfdoubl
r = nv_getnum(np);
if(nv_isattr(np,NV_INTEGER|NV_BINARY)==(NV_INTEGER|NV_BINARY))
lvalue->isfloat= (r!=(Sflong_t)r);
- else if(nv_isattr(np,NV_INTEGER|NV_DOUBLE)==(NV_INTEGER|NV_DOUBLE))
+ else if(nv_isattr(np,NV_DOUBLE)==NV_DOUBLE)
lvalue->isfloat=1;
return(r);
}
@@ -338,10 +365,13 @@ Sfdouble_t sh_strnum(register const char *str, char** ptr, int mode)
d = strtonll(str,&last,&base,-1);
if(*last || errno)
{
- d = strval(str,&last,arith,mode);
+ if(!last || *last!='.' || last[1]!='.')
+ d = strval(str,&last,arith,mode);
if(!ptr && *last && mode>0)
errormsg(SH_DICT,ERROR_exit(1),e_lexbadchar,*last,str);
}
+ else if (!d && *str=='-')
+ d = -0.0;
if(ptr)
*ptr = last;
return(d);
diff --git a/usr/src/lib/libshell/common/sh/array.c b/usr/src/lib/libshell/common/sh/array.c
index 5b33f20e5a..ed46e84738 100644
--- a/usr/src/lib/libshell/common/sh/array.c
+++ b/usr/src/lib/libshell/common/sh/array.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -33,16 +33,17 @@
#define NUMSIZE (4+(ARRAY_MAX>999)+(ARRAY_MAX>9999)+(ARRAY_MAX>99999))
#define is_associative(ap) array_assoc((Namarr_t*)(ap))
-#define array_setbit(cp, n) (cp[(n)/CHAR_BIT] |= 1<<(((n)&(CHAR_BIT-1))))
-#define array_clrbit(cp, n) (cp[(n)/CHAR_BIT] &= ~(1<<(((n)&(CHAR_BIT-1)))))
-#define array_isbit(cp, n) (cp[(n)/CHAR_BIT] & 1<<(((n)&(CHAR_BIT-1))))
+#define array_setbit(cp, n, b) (cp[n] |= (b))
+#define array_clrbit(cp, n, b) (cp[n] &= ~(b))
+#define array_isbit(cp, n, b) (cp[n] & (b))
#define NV_CHILD NV_EXPORT
-
-static char Empty[] = "";
+#define ARRAY_CHILD 1
+#define ARRAY_NOFREE 2
struct index_array
{
Namarr_t header;
+ void *xp; /* if set, subscripts will be converted */
int cur; /* index of current element */
int maxi; /* maximum index for array */
unsigned char *bits; /* bit array for child subscripts */
@@ -52,12 +53,62 @@ struct index_array
struct assoc_array
{
Namarr_t header;
- Dt_t *table;
Namval_t *pos;
Namval_t *nextpos;
Namval_t *cur;
};
+static Namarr_t *array_scope(Namval_t *np, Namarr_t *ap, int flags)
+{
+ Namarr_t *aq;
+ struct index_array *ar;
+ size_t size = ap->hdr.dsize;
+ if(size==0)
+ size = ap->hdr.disc->dsize;
+ if(!(aq=newof(NIL(Namarr_t*),Namarr_t,1,size-sizeof(Namarr_t))))
+ return(0);
+ memcpy(aq,ap,size);
+ aq->hdr.nofree &= ~1;
+ aq->hdr.nofree |= (flags&NV_RDONLY)?1:0;
+ if(is_associative(aq))
+ {
+ aq->scope = (void*)dtopen(&_Nvdisc,Dtoset);
+ dtview((Dt_t*)aq->scope,aq->table);
+ aq->table = (Dt_t*)aq->scope;
+ return(aq);
+ }
+ aq->scope = (void*)ap;
+ ar = (struct index_array*)aq;
+ memset(ar->val, 0, ar->maxi*sizeof(char*));
+ return(aq);
+}
+
+static int array_unscope(Namval_t *np,Namarr_t *ap)
+{
+ Namfun_t *fp;
+ if(!ap->scope)
+ return(0);
+ if(is_associative(ap))
+ (*ap->fun)(np, NIL(char*), NV_AFREE);
+ if((fp = nv_disc(np,(Namfun_t*)ap,NV_POP)) && !(fp->nofree&1))
+ free((void*)fp);
+ nv_delete(np,(Dt_t*)0,0);
+ return(1);
+}
+
+static void array_syncsub(Namarr_t *ap, Namarr_t *aq)
+{
+ ((struct index_array*)ap)->cur = ((struct index_array*)aq)->cur;
+}
+
+static int array_covered(Namval_t *np, struct index_array *ap)
+{
+ struct index_array *aq = (struct index_array*)ap->header.scope;
+ if(!ap->header.fun && aq)
+ return ((ap->cur<aq->maxi) && aq->val[ap->cur].cp);
+ return(0);
+}
+
/*
* replace discipline with new one
*/
@@ -81,10 +132,12 @@ static void array_setptr(register Namval_t *np, struct index_array *old, struct
* but <= ARRAY_MAX) is returned.
*
*/
-static int arsize(register int maxi)
+static int arsize(struct index_array *ap, register int maxi)
{
- register int i = roundof(maxi,ARRAY_INCR);
- return (i>ARRAY_MAX?ARRAY_MAX:i);
+ if(ap && maxi < 2*ap->maxi)
+ maxi = 2*ap->maxi;
+ maxi = roundof(maxi,ARRAY_INCR);
+ return (maxi>ARRAY_MAX?ARRAY_MAX:maxi);
}
static struct index_array *array_grow(Namval_t*, struct index_array*,int);
@@ -100,19 +153,38 @@ int array_maxindex(Namval_t *np)
return(i+1);
}
-static union Value *array_getup(Namval_t *np, Namarr_t *arp)
+static union Value *array_getup(Namval_t *np, Namarr_t *arp, int update)
{
register struct index_array *ap = (struct index_array*)arp;
register union Value *up;
- if(!nv_isarray(np))
+ int nofree;
+ if(!arp)
return(&np->nvalue);
if(is_associative(ap))
- up = (union Value*)((*arp->fun)(np,NIL(char*),0));
+ {
+ Namval_t *mp;
+ mp = (Namval_t*)((*arp->fun)(np,NIL(char*),NV_ACURRENT));
+ if(mp)
+ {
+ nofree = nv_isattr(mp,NV_NOFREE);
+ up = &mp->nvalue;
+ }
+ else
+ return((union Value*)((*arp->fun)(np,NIL(char*),0)));
+ }
else
{
if(ap->cur >= ap->maxi)
errormsg(SH_DICT,ERROR_exit(1),e_subscript,nv_name(np));
up = &(ap->val[ap->cur]);
+ nofree = array_isbit(ap->bits,ap->cur,ARRAY_NOFREE);
+ }
+ if(update)
+ {
+ if(nofree)
+ nv_onattr(np,NV_NOFREE);
+ else
+ nv_offattr(np,NV_NOFREE);
}
return(up);
}
@@ -128,13 +200,17 @@ static Namval_t *array_find(Namval_t *np,Namarr_t *arp, int flag)
register union Value *up;
Namval_t *mp;
int wasundef;
+ if(flag&ARRAY_LOOKUP)
+ ap->header.nelem &= ~ARRAY_NOSCOPE;
+ else
+ ap->header.nelem |= ARRAY_NOSCOPE;
if(wasundef = ap->header.nelem&ARRAY_UNDEF)
{
ap->header.nelem &= ~ARRAY_UNDEF;
/* delete array is the same as delete array[@] */
if(flag&ARRAY_DELETE)
{
- nv_putsub(np, NIL(char*), ARRAY_SCAN);
+ nv_putsub(np, NIL(char*), ARRAY_SCAN|ARRAY_NOSCOPE);
ap->header.nelem |= ARRAY_SCAN;
}
else /* same as array[0] */
@@ -150,14 +226,25 @@ static Namval_t *array_find(Namval_t *np,Namarr_t *arp, int flag)
mp = (Namval_t*)((*arp->fun)(np,NIL(char*),NV_ACURRENT));
if(!mp)
up = (union Value*)&mp;
- else if(nv_isattr(mp,NV_CHILD))
+ else if(nv_isarray(mp))
{
- if(wasundef && nv_isarray(mp->nvalue.np))
- nv_putsub(mp->nvalue.np,NIL(char*),ARRAY_UNDEF);
- return(mp->nvalue.np);
+ if(wasundef)
+ nv_putsub(mp,NIL(char*),ARRAY_UNDEF);
+ return(mp);
}
else
+ {
up = &mp->nvalue;
+ if(nv_isvtree(mp))
+ {
+ if(!up->cp && flag==ARRAY_ASSIGN)
+ {
+ nv_arraychild(np,mp,0);
+ ap->header.nelem++;
+ }
+ return(mp);
+ }
+ }
}
else
{
@@ -166,7 +253,18 @@ static Namval_t *array_find(Namval_t *np,Namarr_t *arp, int flag)
if(ap->cur>=ap->maxi)
errormsg(SH_DICT,ERROR_exit(1),e_subscript,nv_name(np));
up = &(ap->val[ap->cur]);
- if(up->np && array_isbit(ap->bits,ap->cur))
+ if((!up->cp||up->cp==Empty) && nv_type(np) && nv_isvtree(np))
+ {
+ char *cp;
+ if(!ap->header.table)
+ ap->header.table = dtopen(&_Nvdisc,Dtoset);
+ sfprintf(sh.strbuf,"%d",ap->cur);
+ cp = sfstruse(sh.strbuf);
+ mp = nv_search(cp, ap->header.table, NV_ADD);
+ mp->nvenv = (char*)np;
+ nv_arraychild(np,mp,0);
+ }
+ if(up->np && array_isbit(ap->bits,ap->cur,ARRAY_CHILD))
{
if(wasundef && nv_isarray(up->np))
nv_putsub(up->np,NIL(char*),ARRAY_UNDEF);
@@ -178,97 +276,201 @@ static Namval_t *array_find(Namval_t *np,Namarr_t *arp, int flag)
{
if(flag!=ARRAY_ASSIGN)
return(0);
- ap->header.nelem++;
+ if(!array_covered(np,ap))
+ ap->header.nelem++;
}
return(np);
}
+#if SHOPT_TYPEDEF
+int nv_arraysettype(Namval_t *np, Namval_t *tp, const char *sub, int flags)
+{
+ Namval_t *nq;
+ char *av[2];
+ int rdonly = nv_isattr(np,NV_RDONLY);
+ int xtrace = sh_isoption(SH_XTRACE);
+ Namarr_t *ap = nv_arrayptr(np);
+ av[1] = 0;
+ sh.last_table = 0;
+ if(!ap->table)
+ ap->table = dtopen(&_Nvdisc,Dtoset);
+ if(nq = nv_search(sub, ap->table, NV_ADD))
+ {
+ if(!nq->nvfun && nq->nvalue.cp && *nq->nvalue.cp==0)
+ _nv_unset(nq,NV_RDONLY);
+ nv_arraychild(np,nq,0);
+ if(!nv_isattr(tp,NV_BINARY))
+ {
+ sfprintf(sh.strbuf,"%s=%s",nv_name(nq),nv_getval(np));
+ av[0] = strdup(sfstruse(sh.strbuf));
+ }
+ if(!nv_clone(tp,nq,flags|NV_NOFREE))
+ return(0);
+ ap->nelem |= ARRAY_SCAN;
+ if(!rdonly)
+ nv_offattr(nq,NV_RDONLY);
+ if(!nv_isattr(tp,NV_BINARY))
+ {
+ if(xtrace)
+ sh_offoption(SH_XTRACE);
+ ap->nelem &= ~ARRAY_SCAN;
+ sh_eval(sh_sfeval(av),0);
+ ap->nelem |= ARRAY_SCAN;
+ free((void*)av[0]);
+ if(xtrace)
+ sh_onoption(SH_XTRACE);
+ }
+ return(1);
+ }
+ return(0);
+}
+#endif /* SHOPT_TYPEDEF */
+
+
static Namfun_t *array_clone(Namval_t *np, Namval_t *mp, int flags, Namfun_t *fp)
{
Namarr_t *ap = (Namarr_t*)fp;
Namval_t *nq, *mq;
char *name, *sub=0;
- int nelem = ap->nelem,offset=staktell();
- struct index_array *aq, *ar;
+ int nelem, skipped=0;
+ Dt_t *otable=ap->table;
+ struct index_array *aq = (struct index_array*)ap, *ar;
+ Shell_t *shp = sh_getinterp();
+ if(flags&NV_MOVE)
+ {
+ if((flags&NV_COMVAR) && nv_putsub(np,NIL(char*),ARRAY_SCAN))
+ {
+ do
+ {
+ if(nq=nv_opensub(np))
+ nq->nvenv = (void*)mp;
+ }
+ while(nv_nextsub(np));
+ }
+ return(fp);
+ }
+ nelem = ap->nelem;
if(nelem&ARRAY_NOCLONE)
return(0);
- if(array_assoc(ap))
- nv_setarray(mp,ap->fun);
- else
+ if((flags&NV_TYPE) && !ap->scope)
{
- nv_putsub(mp,NIL(char*),ap->nelem);
- if(aq=(struct index_array*)nv_arrayptr(mp))
- aq->bits = (unsigned char*)&aq->val[aq->maxi];
+ ap = array_scope(np,ap,flags);
+ return(&ap->hdr);
}
+ ap = (Namarr_t*)nv_clone_disc(fp,0);
+ if(flags&NV_COMVAR)
+ {
+ ap->scope = 0;
+ ap->nelem = 0;
+ sh.prev_table = sh.last_table;
+ sh.prev_root = sh.last_root;
+ }
+ if(ap->table)
+ {
+ ap->table = dtopen(&_Nvdisc,Dtoset);
+ if(ap->scope && !(flags&NV_COMVAR))
+ {
+ ap->scope = ap->table;
+ dtview(ap->table, otable->view);
+ }
+ }
+ mp->nvfun = (Namfun_t*)ap;
+ mp->nvflag &= NV_MINIMAL;
+ mp->nvflag |= (np->nvflag&~(NV_MINIMAL|NV_NOFREE));
if(!(nelem&(ARRAY_SCAN|ARRAY_UNDEF)) && (sub=nv_getsub(np)))
sub = strdup(sub);
ar = (struct index_array*)ap;
- nv_onattr(mp,nv_isattr(np,NV_INTEGER|NV_UTOL|NV_LTOU|NV_LJUST|NV_RJUST|NV_ZFILL|NV_BINARY));
- nv_putsub(np,NIL(char*),ARRAY_SCAN);
+ if(!is_associative(ap))
+ ar->bits = (unsigned char*)&ar->val[ar->maxi];
+ if(!nv_putsub(np,NIL(char*),ARRAY_SCAN|((flags&NV_COMVAR)?0:ARRAY_NOSCOPE)))
+ {
+ if(ap->fun)
+ (*ap->fun)(np,(char*)np,0);
+ skipped=1;
+ goto skip;
+ }
do
{
- if(array_assoc(ap))
- name = (char*)((*ap->fun)(np,NIL(char*),NV_ANAME));
- else
- name = nv_getsub(np);
- nv_putsub(mp,name,ARRAY_ADD);
- if((!array_assoc(ap) && array_isbit(ar->bits,ar->cur) && (nq=np)) ||
- (array_assoc(ap) && (nq = (Namval_t*)((*ap->fun)(np,NIL(char*),NV_ACURRENT))) && nv_isattr(nq, NV_CHILD)))
- {
- sfprintf(stkstd,"%s[%s]",nv_name(mp),name);
- stakputc(0);
- mq = nv_search(stakptr(offset), sh.var_tree, NV_ADD);
- stakseek(offset);
- if(mq)
+ name = nv_getsub(np);
+ nv_putsub(mp,name,ARRAY_ADD|ARRAY_NOSCOPE);
+ mq = 0;
+ if(nq=nv_opensub(np))
+ mq = nv_search(name,ap->table,NV_ADD);
+ if(nq && (flags&NV_COMVAR) && nv_isvtree(nq))
+ {
+ mq->nvalue.cp = 0;
+ if(!is_associative(ap))
+ ar->val[ar->cur].np = mq;
+ nv_clone(nq,mq,flags);
+ }
+ else if(flags&NV_ARRAY)
+ {
+ if((flags&NV_NOFREE) && !is_associative(ap))
+ array_setbit(aq->bits,aq->cur,ARRAY_NOFREE);
+ else if(nq && (flags&NV_NOFREE))
{
- nv_clone(nq->nvalue.np,mq,0);
- if(array_assoc(ap))
- {
- nq = (Namval_t*)((*ap->fun)(mp,NIL(char*),NV_ACURRENT));
- nq->nvalue.np = mp;
- nv_onattr(nq,NV_CHILD);
- }
- else if(aq)
- {
- array_setbit(aq->bits,aq->cur);
- aq->val[aq->cur].np = mq;
- }
+ mq->nvalue = nq->nvalue;
+ nv_onattr(nq,NV_NOFREE);
}
}
else if(nv_isattr(np,NV_INTEGER))
{
Sfdouble_t d= nv_getnum(np);
+ if(!is_associative(ap))
+ ar->val[ar->cur].cp = 0;
nv_putval(mp,(char*)&d,NV_LDOUBLE);
}
else
+ {
+ if(!is_associative(ap))
+ ar->val[ar->cur].cp = 0;
nv_putval(mp,nv_getval(np),NV_RDONLY);
+ }
+ aq->header.nelem |= ARRAY_NOSCOPE;
}
while(nv_nextsub(np));
+skip:
if(sub)
{
- nv_putsub(np,sub,0L);
+ if(!skipped)
+ nv_putsub(np,sub,0L);
free((void*)sub);
}
- ap->nelem = nelem;
- ((Namarr_t*)mp->nvfun)->nelem = nelem;
- return(nv_stack(mp,(Namfun_t*)0));
+ aq->header.nelem = ap->nelem = nelem;
+ return(&ap->hdr);
}
static char *array_getval(Namval_t *np, Namfun_t *disc)
{
- register Namarr_t *ap = (Namarr_t*)disc;
+ register Namarr_t *aq,*ap = (Namarr_t*)disc;
register Namval_t *mp;
if((mp=array_find(np,ap,ARRAY_LOOKUP))!=np)
+ {
+ if(!mp && !is_associative(ap) && (aq=(Namarr_t*)ap->scope))
+ {
+ array_syncsub(aq,ap);
+ if((mp=array_find(np,aq,ARRAY_LOOKUP))==np)
+ return(nv_getv(np,&aq->hdr));
+ }
return(mp?nv_getval(mp):0);
+ }
return(nv_getv(np,&ap->hdr));
}
static Sfdouble_t array_getnum(Namval_t *np, Namfun_t *disc)
{
- register Namarr_t *ap = (Namarr_t*)disc;
+ register Namarr_t *aq,*ap = (Namarr_t*)disc;
register Namval_t *mp;
if((mp=array_find(np,ap,ARRAY_LOOKUP))!=np)
+ {
+ if(!mp && !is_associative(ap) && (aq=(Namarr_t*)ap->scope))
+ {
+ array_syncsub(aq,ap);
+ if((mp=array_find(np,aq,ARRAY_LOOKUP))==np)
+ return(nv_getn(np,&aq->hdr));
+ }
return(mp?nv_getnum(mp):0);
+ }
return(nv_getn(np,&ap->hdr));
}
@@ -278,52 +480,113 @@ static void array_putval(Namval_t *np, const char *string, int flags, Namfun_t *
register union Value *up;
register Namval_t *mp;
register struct index_array *aq = (struct index_array*)ap;
+ int scan,nofree = nv_isattr(np,NV_NOFREE);
do
{
mp = array_find(np,ap,string?ARRAY_ASSIGN:ARRAY_DELETE);
+ scan = ap->nelem&ARRAY_SCAN;
if(mp && mp!=np)
+ {
+ if(!is_associative(ap) && string && !nv_type(np) && nv_isvtree(mp))
+ {
+ if(!nv_isattr(np,NV_NOFREE))
+ _nv_unset(mp,flags&NV_RDONLY);
+ array_clrbit(aq->bits,aq->cur,ARRAY_CHILD);
+ aq->val[aq->cur].cp = 0;
+ if(!nv_isattr(mp,NV_NOFREE))
+ nv_delete(mp,ap->table,0);
+ goto skip;
+ }
nv_putval(mp, string, flags);
+ if(string)
+ {
+#if SHOPT_TYPEDEF
+ if(ap->hdr.type && ap->hdr.type!=nv_type(mp))
+ nv_arraysettype(np,ap->hdr.type,nv_getsub(np),0);
+#endif /* SHOPT_TYPEDEF */
+ continue;
+ }
+ ap->nelem |= scan;
+ }
if(!string)
{
if(mp)
{
- if(mp!=np)
- {
- dtdelete(sh.var_tree,(void*)mp);
- free((void*)mp);
- }
if(is_associative(ap))
+ {
(*ap->fun)(np,NIL(char*),NV_ADELETE);
- else if(mp!=np)
+ np->nvalue.cp = 0;
+ }
+ else
{
- array_clrbit(aq->bits,aq->cur);
- aq->val[aq->cur].cp = 0;
+ if(mp!=np)
+ {
+ array_clrbit(aq->bits,aq->cur,ARRAY_CHILD);
+ aq->val[aq->cur].cp = 0;
+ nv_delete(mp,ap->table,0);
+ }
+ if(!array_covered(np,(struct index_array*)ap))
+ ap->nelem--;
}
- ap->nelem--;
}
if(array_elem(ap)==0 && ((ap->nelem&ARRAY_SCAN) || !is_associative(ap)))
{
if(is_associative(ap))
(*ap->fun)(np, NIL(char*), NV_AFREE);
+ else if(ap->table)
+ dtclose(ap->table);
nv_offattr(np,NV_ARRAY);
}
- if(!mp || mp!=np)
+ if(!mp || mp!=np || is_associative(ap))
continue;
}
+ skip:
/* prevent empty string from being deleted */
- if(np->nvalue.cp == Empty)
- np->nvalue.cp = 0;
+ up = array_getup(np,ap,!nofree);
+ if(up->cp == Empty)
+ up->cp = 0;
+ if(nv_isarray(np))
+ np->nvalue.up = up;
nv_putv(np,string,flags,&ap->hdr);
- up = array_getup(np,ap);
- up->cp = np->nvalue.cp;
+ if(!is_associative(ap))
+ {
+ if(string)
+ array_clrbit(aq->bits,aq->cur,ARRAY_NOFREE);
+ else if(mp==np)
+ aq->val[aq->cur].cp = 0;
+ }
+#if SHOPT_TYPEDEF
+ if(string && ap->hdr.type && nv_isvtree(np))
+ nv_arraysettype(np,ap->hdr.type,nv_getsub(np),0);
+#endif /* SHOPT_TYPEDEF */
}
while(!string && nv_nextsub(np));
+ if(ap)
+ ap->nelem &= ~ARRAY_NOSCOPE;
+ if(nofree)
+ nv_onattr(np,NV_NOFREE);
+ else
+ nv_offattr(np,NV_NOFREE);
if(!string && !nv_isattr(np,NV_ARRAY))
{
Namfun_t *nfp;
- if(nfp = nv_disc(np,(Namfun_t*)ap,NV_POP))
+ if(!is_associative(ap) && aq->xp)
+ {
+ _nv_unset(nv_namptr(aq->xp,0),NV_RDONLY);
+ free((void*)aq->xp);
+ }
+ if((nfp = nv_disc(np,(Namfun_t*)ap,NV_POP)) && !(nfp->nofree&1))
free((void*)nfp);
+ if(!nv_isnull(np))
+ {
+ nv_onattr(np,NV_NOFREE);
+ _nv_unset(np,flags);
+ }
+ if(np->nvalue.cp==Empty)
+ np->nvalue.cp = 0;
}
+ if(!string && (flags&NV_TYPE))
+ array_unscope(np,ap);
}
static const Namdisc_t array_disc =
@@ -337,6 +600,21 @@ static const Namdisc_t array_disc =
array_clone
};
+static void array_copytree(Namval_t *np, Namval_t *mp)
+{
+ char *val;
+ Namfun_t *fp = nv_disc(np,NULL,NV_POP);
+ nv_offattr(np,NV_ARRAY);
+ nv_clone(np,mp,0);
+ np->nvalue.up = &mp->nvalue;
+ val = sfstruse(sh.strbuf);
+ fp->nofree &= ~1;
+ nv_disc(np,(Namfun_t*)fp, NV_FIRST);
+ fp->nofree |= 1;
+ nv_onattr(np,NV_ARRAY);
+ mp->nvenv = (char*)np;
+}
+
/*
* Increase the size of the indexed array of elements in <arp>
* so that <maxi> is a legal index. If <arp> is 0, an array
@@ -347,61 +625,105 @@ static const Namdisc_t array_disc =
static struct index_array *array_grow(Namval_t *np, register struct index_array *arp,int maxi)
{
register struct index_array *ap;
- register int i=0;
- register int newsize = arsize(maxi+1);
+ register int i;
+ register int newsize = arsize(arp,maxi+1);
if (maxi >= ARRAY_MAX)
errormsg(SH_DICT,ERROR_exit(1),e_subscript, fmtbase((long)maxi,10,0));
- ap = new_of(struct index_array,(newsize-1)*sizeof(union Value*)+newsize/CHAR_BIT);
- memset((void*)ap,0,sizeof(*ap));
+ i = (newsize-1)*sizeof(union Value*)+newsize;
+ ap = new_of(struct index_array,i);
+ memset((void*)ap,0,sizeof(*ap)+i);
ap->maxi = newsize;
ap->cur = maxi;
ap->bits = (unsigned char*)&ap->val[newsize];
- memset(ap->bits, 0, newsize/CHAR_BIT);
+ memset(ap->bits, 0, newsize);
if(arp)
{
ap->header = arp->header;
- for(;i < arp->maxi;i++)
+ ap->header.hdr.dsize = sizeof(*ap) + i;
+ for(i=0;i < arp->maxi;i++)
ap->val[i].cp = arp->val[i].cp;
- memcpy(ap->bits, arp->bits, (arp->maxi/CHAR_BIT));
+ memcpy(ap->bits, arp->bits, arp->maxi);
array_setptr(np,arp,ap);
free((void*)arp);
}
else
{
+ Namval_t *mp=0;
+ ap->header.hdr.dsize = sizeof(*ap) + i;
+ i = 0;
ap->header.fun = 0;
- if((ap->val[0].cp=np->nvalue.cp))
- i++;
- else if(nv_hasdisc(np,&array_disc))
- {
- Namval_t *mp;
- int offset = staktell();
- sfprintf(stkstd,"%s[0]",nv_name(np));
- stakputc(0);
- mp = nv_search(stakptr(offset), sh.var_tree, NV_ADD);
- stakseek(offset);
+ if(nv_isnull(np) && nv_isattr(np,NV_NOFREE))
+ {
+ i = ARRAY_TREE;
+ nv_offattr(np,NV_NOFREE);
+ }
+ if(np->nvalue.cp==Empty)
+ np->nvalue.cp=0;
+ if(nv_hasdisc(np,&array_disc) || nv_isvtree(np))
+ {
+ ap->header.table = dtopen(&_Nvdisc,Dtoset);
+ mp = nv_search("0", ap->header.table, 0);
+
if(mp && nv_isnull(mp))
{
- nv_clone(np,mp,0);
+ Namfun_t *fp;
ap->val[0].np = mp;
- array_setbit(ap->bits,0);
+ array_setbit(ap->bits,0,ARRAY_CHILD);
+ for(fp=np->nvfun; fp && !fp->disc->readf; fp=fp->next);
+ if(fp)
+ (*fp->disc->readf)(mp,(Sfio_t*)0,0,fp);
+ i++;
}
- i++;
}
+ else if((ap->val[0].cp=np->nvalue.cp))
+ i++;
else if(nv_isattr(np,NV_INTEGER))
{
Sfdouble_t d= nv_getnum(np);
i++;
}
ap->header.nelem = i;
- ap->header.hdr.nofree = 1;
ap->header.hdr.disc = &array_disc;
- nv_disc(np,(Namfun_t*)ap, NV_LAST);
+ nv_disc(np,(Namfun_t*)ap, NV_FIRST);
+ nv_onattr(np,NV_ARRAY);
+ if(mp)
+ {
+ array_copytree(np,mp);
+ ap->header.hdr.nofree &= ~1;
+ }
}
for(;i < newsize;i++)
ap->val[i].cp = 0;
return(ap);
}
+int nv_atypeindex(Namval_t *np, const char *tname)
+{
+ Namval_t *tp;
+ int offset = staktell();
+ int n = strlen(tname)-1;
+ sfprintf(stkstd,"%s.%.*s%c",NV_CLASS,n,tname,0);
+ tp = nv_open(stakptr(offset), sh.var_tree, NV_NOADD|NV_VARNAME);
+ stakseek(offset);
+ if(tp)
+ {
+ struct index_array *ap = (struct index_array*)nv_arrayptr(np);
+ if(!nv_hasdisc(tp,&ENUM_disc))
+ errormsg(SH_DICT,ERROR_exit(1),e_notenum,tp->nvname);
+ if(!ap)
+ ap = array_grow(np,ap,1);
+ ap->xp = calloc(NV_MINSZ,1);
+ np = nv_namptr(ap->xp,0);
+ np->nvname = tp->nvname;
+ nv_onattr(np,NV_MINIMAL);
+ nv_clone(tp,np,NV_NOFREE);
+ nv_offattr(np,NV_RDONLY);
+ return(1);
+ }
+ errormsg(SH_DICT,ERROR_exit(1),e_unknowntype, n,tname);
+ return(0);
+}
+
Namarr_t *nv_arrayptr(register Namval_t *np)
{
if(nv_isattr(np,NV_ARRAY))
@@ -446,7 +768,6 @@ static Namarr_t *nv_changearray(Namval_t *np, void *(*fun)(Namval_t*,const char*
}
nv_putsub(np, string_index, ARRAY_ADD);
up = (union Value*)((*ap->fun)(np,NIL(char*),0));
- ap->nelem++;
up->cp = save_ap->val[dot].cp;
save_ap->val[dot].cp = 0;
}
@@ -463,7 +784,9 @@ static Namarr_t *nv_changearray(Namval_t *np, void *(*fun)(Namval_t*,const char*
Namarr_t *nv_setarray(Namval_t *np, void *(*fun)(Namval_t*,const char*,int))
{
register Namarr_t *ap;
- char *value;
+ char *value=0;
+ Namfun_t *fp;
+ int nelem = 0;
if(fun && (ap = nv_arrayptr(np)))
{
/*
@@ -474,17 +797,29 @@ Namarr_t *nv_setarray(Namval_t *np, void *(*fun)(Namval_t*,const char*,int))
ap = nv_changearray(np, fun);
return(ap);
}
- value = nv_getval(np);
+ if(nv_isnull(np) && nv_isattr(np,NV_NOFREE))
+ {
+ nelem = ARRAY_TREE;
+ nv_offattr(np,NV_NOFREE);
+ }
+ if(!(fp=nv_isvtree(np)))
+ value = nv_getval(np);
if(fun && !ap && (ap = (Namarr_t*)((*fun)(np, NIL(char*), NV_AINIT))))
{
/* check for preexisting initialization and save */
- ap->nelem = 0;
+ ap->nelem = nelem;
ap->fun = fun;
nv_onattr(np,NV_ARRAY);
- if(value)
+ if(fp || value)
{
nv_putsub(np, "0", ARRAY_ADD);
- nv_putval(np, value, 0);
+ if(value)
+ nv_putval(np, value, 0);
+ else
+ {
+ Namval_t *mp = (Namval_t*)((*fun)(np,NIL(char*),NV_ACURRENT));
+ array_copytree(np,mp);
+ }
}
return(ap);
}
@@ -496,27 +831,38 @@ Namarr_t *nv_setarray(Namval_t *np, void *(*fun)(Namval_t*,const char*,int))
*/
Namval_t *nv_arraychild(Namval_t *np, Namval_t *nq, int c)
{
- register Namarr_t *ap = nv_arrayptr(np);
- union Value *up;
- if(!(up = array_getup(np,ap)))
- return((Namval_t*)0);
+ Namfun_t *fp;
+ register Namarr_t *ap = nv_arrayptr(np);
+ union Value *up;
+ Namval_t *tp;
if(!nq)
- return(array_find(np,ap, ARRAY_LOOKUP));
+ return(ap?array_find(np,ap, ARRAY_LOOKUP):0);
+ if(!ap)
+ {
+ nv_putsub(np, NIL(char*), ARRAY_FILL);
+ ap = nv_arrayptr(np);
+ }
+ if(!(up = array_getup(np,ap,0)))
+ return((Namval_t*)0);
np->nvalue.cp = up->cp;
- ap->nelem |= ARRAY_NOCLONE;
- nv_clone(np, nq, NV_NODISC);
- nv_offattr(nq,NV_ARRAY);
- ap->nelem &= ~ARRAY_NOCLONE;
- if(ap->fun)
+ if((tp=nv_type(np)) || c)
{
- up->np = (Namval_t*)((*ap->fun)(np,NIL(char*),NV_ACURRENT));
- nv_onattr(up->np, NV_CHILD);
- (up->np)->nvalue.np = nq;
+ ap->nelem |= ARRAY_NOCLONE;
+ nq->nvenv = (char*)np;
+ if(c=='t')
+ nv_clone(tp,nq, 0);
+ else
+ nv_clone(np, nq, NV_NODISC);
+ nv_offattr(nq,NV_ARRAY);
+ ap->nelem &= ~ARRAY_NOCLONE;
}
- else
+ nq->nvenv = (char*)np;
+ if((fp=nq->nvfun) && fp->disc && fp->disc->setdisc && (fp = nv_disc(nq,fp,NV_POP)))
+ free((void*)fp);
+ if(!ap->fun)
{
struct index_array *aq = (struct index_array*)ap;
- array_setbit(aq->bits,aq->cur);
+ array_setbit(aq->bits,aq->cur,ARRAY_CHILD);
up->np = nq;
}
if(c=='.')
@@ -531,33 +877,42 @@ Namval_t *nv_arraychild(Namval_t *np, Namval_t *nq, int c)
*/
int nv_nextsub(Namval_t *np)
{
- register struct index_array *ap = (struct index_array*)nv_arrayptr(np);
- register unsigned dot;
+ register struct index_array *ap = (struct index_array*)nv_arrayptr(np);
+ register unsigned dot;
+ struct index_array *aq=0, *ar=0;
if(!ap || !(ap->header.nelem&ARRAY_SCAN))
return(0);
if(is_associative(ap))
{
- struct assoc_array *aq;
- if(aq=(*ap->header.fun)(np,NIL(char*),NV_ANEXT))
+ Namval_t *nq;
+ if(nq=(*ap->header.fun)(np,NIL(char*),NV_ANEXT))
{
- if(nv_isattr(aq->cur,NV_CHILD))
- nv_putsub(aq->cur->nvalue.np,NIL(char*),ARRAY_UNDEF);
+ if(nv_isattr(nq,NV_CHILD))
+ nv_putsub(nq->nvalue.np,NIL(char*),ARRAY_UNDEF);
return(1);
}
ap->header.nelem &= ~(ARRAY_SCAN|ARRAY_NOCHILD);
return(0);
}
+ if(!(ap->header.nelem&ARRAY_NOSCOPE))
+ ar = (struct index_array*)ap->header.scope;
for(dot=ap->cur+1; dot < (unsigned)ap->maxi; dot++)
{
- if(ap->val[dot].cp)
+ aq = ap;
+ if(!ap->val[dot].cp && !(ap->header.nelem&ARRAY_NOSCOPE))
+ {
+ if(!(aq=ar) || dot>=(unsigned)aq->maxi)
+ continue;
+ }
+ if(aq->val[dot].cp)
{
ap->cur = dot;
- if(array_isbit(ap->bits, dot))
+ if(array_isbit(aq->bits, dot,ARRAY_CHILD))
{
-
- if(ap->header.nelem&ARRAY_NOCHILD)
+ Namval_t *mp = aq->val[dot].np;
+ if((aq->header.nelem&ARRAY_NOCHILD) && nv_isvtree(mp))
continue;
- nv_putsub(ap->val[dot].np,NIL(char*),ARRAY_UNDEF);
+ nv_putsub(mp,NIL(char*),ARRAY_UNDEF);
}
return(1);
}
@@ -585,7 +940,18 @@ Namval_t *nv_putsub(Namval_t *np,register char *sp,register long mode)
if(!ap || !ap->header.fun)
{
if(sp)
- size = (int)sh_arith((char*)sp);
+ {
+ if(ap && ap->xp && !strmatch(sp,"+([0-9])"))
+ {
+ Namval_t *mp = nv_namptr(ap->xp,0);
+ nv_putval(mp, sp,0);
+ size = nv_getnum(mp);
+ }
+ else
+ size = (int)sh_arith((char*)sp);
+ }
+ if(size <0 && ap)
+ size += array_maxindex(np);
if(size >= ARRAY_MAX || (size < 0))
{
errormsg(SH_DICT,ERROR_exit(1),e_subscript, nv_name(np));
@@ -598,24 +964,42 @@ Namval_t *nv_putsub(Namval_t *np,register char *sp,register long mode)
if(sh.subshell)
np = sh_assignok(np,1);
ap = array_grow(np, ap,size);
- nv_onattr(np,NV_ARRAY);
}
ap->header.nelem &= ~ARRAY_UNDEF;
- ap->header.nelem |= (mode&(ARRAY_SCAN|ARRAY_NOCHILD|ARRAY_UNDEF));
+ ap->header.nelem |= (mode&(ARRAY_SCAN|ARRAY_NOCHILD|ARRAY_UNDEF|ARRAY_NOSCOPE));
+#if 0
+ if(array_isbit(ap->bits,oldsize,ARRAY_CHILD))
+ mp = ap->val[oldsize].np;
+ if(size != oldsize && mp->nvalue.cp)
+ {
+ Namfun_t *nfp;
+ for(nfp=np->nvfun; nfp; nfp=nfp->next)
+ {
+ if(nfp->disc && nfp->disc->readf)
+ {
+ (*nfp->disc->readf)(mp,(Sfio_t*)0,0,nfp);
+ break;
+ }
+ }
+ }
+#endif
ap->cur = size;
- if((mode&ARRAY_SCAN) && !ap->val[size].cp && !nv_nextsub(np))
+ if((mode&ARRAY_SCAN) && (ap->cur--,!nv_nextsub(np)))
np = 0;
- if(mode&ARRAY_FILL)
+ if(mode&(ARRAY_FILL|ARRAY_ADD))
{
if(!(mode&ARRAY_ADD))
{
int n;
- for(n=0; n < size; n++)
+ for(n=0; n <= size; n++)
{
if(!ap->val[n].cp)
+ {
ap->val[n].cp = Empty;
+ if(!array_covered(np,ap))
+ ap->header.nelem++;
+ }
}
- ap->header.nelem = n|(ap->header.nelem&(ARRAY_SCAN|ARRAY_UNDEF));
if(n=ap->maxi-ap->maxi)
memset(&ap->val[size],0,n*sizeof(union Value));
}
@@ -624,37 +1008,34 @@ Namval_t *nv_putsub(Namval_t *np,register char *sp,register long mode)
if(sh.subshell)
np = sh_assignok(np,1);
ap->val[size].cp = Empty;
- ap->header.nelem++;
+ if(!array_covered(np,ap))
+ ap->header.nelem++;
}
}
else if(!(mode&ARRAY_SCAN))
{
ap->header.nelem &= ~ARRAY_SCAN;
- if(array_isbit(ap->bits,size))
+ if(array_isbit(ap->bits,size,ARRAY_CHILD))
nv_putsub(ap->val[size].np,NIL(char*),ARRAY_UNDEF);
+ if(sp && !(mode&ARRAY_ADD) && !ap->val[size].cp)
+ np = 0;
}
return((Namval_t*)np);
}
ap->header.nelem &= ~ARRAY_UNDEF;
if(!(mode&ARRAY_FILL))
ap->header.nelem &= ~ARRAY_SCAN;
- ap->header.nelem |= (mode&(ARRAY_SCAN|ARRAY_NOCHILD|ARRAY_UNDEF));
+ ap->header.nelem |= (mode&(ARRAY_SCAN|ARRAY_NOCHILD|ARRAY_UNDEF|ARRAY_NOSCOPE));
if(sp)
{
- union Value *up;
if(mode&ARRAY_SETSUB)
{
(*ap->header.fun)(np, sp, NV_ASETSUB);
return(np);
}
- up = (union Value*)(*ap->header.fun)(np, sp, (mode&ARRAY_ADD)?NV_AADD:0);
- if(up && !up->cp && (mode&ARRAY_ADD) && (mode&ARRAY_FILL))
- {
- if(sh.subshell)
- np = sh_assignok(np,1);
- up->cp = Empty;
- ap->header.nelem++;
- }
+ (*ap->header.fun)(np, sp, (mode&ARRAY_ADD)?NV_AADD:0);
+ if(!(mode&(ARRAY_SCAN|ARRAY_ADD)) && !(*ap->header.fun)(np,NIL(char*),NV_ACURRENT))
+ np = 0;
}
else if(mode&ARRAY_SCAN)
(*ap->header.fun)(np,(char*)np,0);
@@ -695,7 +1076,11 @@ char *nv_endsubscript(Namval_t *np, register char *cp, int mode)
sh_trim(sp=stakptr(count));
}
if(mode && np)
- nv_putsub(np, sp, ARRAY_ADD|(cp[1]?ARRAY_FILL:mode&ARRAY_FILL));
+ {
+ if((mode&NV_ASSIGN) && (cp[1]=='=' || cp[1]=='+'))
+ mode |= NV_ADD;
+ nv_putsub(np, sp, ((mode&NV_ADD)?ARRAY_ADD:0)|(cp[1]&&(mode&NV_ADD)?ARRAY_FILL:mode&ARRAY_FILL));
+ }
if(quoted)
stakseek(count);
*cp++ = c;
@@ -706,8 +1091,13 @@ char *nv_endsubscript(Namval_t *np, register char *cp, int mode)
Namval_t *nv_opensub(Namval_t* np)
{
register struct index_array *ap = (struct index_array*)nv_arrayptr(np);
- if(ap && is_associative(ap))
- return((Namval_t*)((*ap->header.fun)(np,NIL(char*),NV_ACURRENT)));
+ if(ap)
+ {
+ if(is_associative(ap))
+ return((Namval_t*)((*ap->header.fun)(np,NIL(char*),NV_ACURRENT)));
+ else if(array_isbit(ap->bits,ap->cur,ARRAY_CHILD))
+ return(ap->val[ap->cur].np);
+ }
return(NIL(Namval_t*));
}
@@ -721,6 +1111,12 @@ char *nv_getsub(Namval_t* np)
return(NIL(char*));
if(is_associative(ap))
return((char*)((*ap->header.fun)(np,NIL(char*),NV_ANAME)));
+ if(ap->xp)
+ {
+ np = nv_namptr(ap->xp,0);
+ np->nvalue.s = ap->cur;
+ return(nv_getval(np));
+ }
if((dot = ap->cur)==0)
*--cp = '0';
else while(n=dot)
@@ -738,14 +1134,31 @@ char *nv_getsub(Namval_t* np)
int nv_aindex(register Namval_t* np)
{
Namarr_t *ap = nv_arrayptr(np);
- if(!ap || is_associative(ap))
+ if(!ap)
+ return(0);
+ else if(is_associative(ap))
return(-1);
return(((struct index_array*)(ap))->cur&ARRAY_MASK);
}
+int nv_arraynsub(register Namarr_t* ap)
+{
+ return(array_elem(ap));
+}
+
+int nv_aimax(register Namval_t* np)
+{
+ struct index_array *ap = (struct index_array*)nv_arrayptr(np);
+ int sub = -1;
+ if(!ap || is_associative(&ap->header))
+ return(-1);
+ sub = ap->maxi;
+ while(--sub>0 && ap->val[sub].cp==0);
+ return(sub);
+}
/*
- * This is the default implementation for associate arrays
+ * This is the default implementation for associative arrays
*/
void *nv_associative(register Namval_t *np,const char *sp,int mode)
{
@@ -756,42 +1169,52 @@ void *nv_associative(register Namval_t *np,const char *sp,int mode)
case NV_AINIT:
if(ap = (struct assoc_array*)calloc(1,sizeof(struct assoc_array)))
{
- ap->table = dtopen(&_Nvdisc,Dtbag);
+ ap->header.table = dtopen(&_Nvdisc,Dtoset);
ap->cur = 0;
ap->pos = 0;
ap->header.hdr.disc = &array_disc;
- ap->header.hdr.nofree = 1;
- nv_disc(np,(Namfun_t*)ap, NV_LAST);
+ nv_disc(np,(Namfun_t*)ap, NV_FIRST);
+ ap->header.hdr.dsize = sizeof(struct assoc_array);
+ ap->header.hdr.nofree &= ~1;
}
return((void*)ap);
case NV_ADELETE:
if(ap->cur)
{
- if(nv_isattr(ap->cur,NV_NOFREE))
- nv_offattr(ap->cur,NV_NOFREE);
- else
- {
- dtdelete(ap->table,(void*)ap->cur);
- free((void*)ap->cur);
- ap->cur = 0;
- }
+ if(!ap->header.scope || (Dt_t*)ap->header.scope==ap->header.table || !nv_search(ap->cur->nvname,(Dt_t*)ap->header.scope,0))
+ ap->header.nelem--;
+ _nv_unset(ap->cur,NV_RDONLY);
+ nv_delete(ap->cur,ap->header.table,0);
+ ap->cur = 0;
}
return((void*)ap);
case NV_AFREE:
ap->pos = 0;
- dtclose(ap->table);
+ if(ap->header.scope)
+ {
+ ap->header.table = dtview(ap->header.table,(Dt_t*)0);
+ dtclose(ap->header.scope);
+ ap->header.scope = 0;
+ }
+ else
+ dtclose(ap->header.table);
return((void*)ap);
case NV_ANEXT:
if(!ap->pos)
{
+ if((ap->header.nelem&ARRAY_NOSCOPE) && ap->header.scope && dtvnext(ap->header.table))
+ {
+ ap->header.scope = dtvnext(ap->header.table);
+ ap->header.table->view = 0;
+ }
if(!(ap->pos=ap->cur))
- ap->pos = (Namval_t*)dtfirst(ap->table);
+ ap->pos = (Namval_t*)dtfirst(ap->header.table);
}
else
ap->pos = ap->nextpos;
for(;ap->cur=ap->pos; ap->pos=ap->nextpos)
{
- ap->nextpos = (Namval_t*)dtnext(ap->table,ap->pos);
+ ap->nextpos = (Namval_t*)dtnext(ap->header.table,ap->pos);
if(ap->cur->nvalue.cp)
{
if((ap->header.nelem&ARRAY_NOCHILD) && nv_isattr(ap->cur,NV_CHILD))
@@ -799,29 +1222,66 @@ void *nv_associative(register Namval_t *np,const char *sp,int mode)
return((void*)ap);
}
}
+ if((ap->header.nelem&ARRAY_NOSCOPE) && ap->header.scope && !dtvnext(ap->header.table))
+ {
+ ap->header.table->view = (Dt_t*)ap->header.scope;
+ ap->header.scope = ap->header.table;
+ }
return(NIL(void*));
case NV_ASETSUB:
ap->cur = (Namval_t*)sp;
- /* FALL THROUGH*/
+ return((void*)ap->cur);
case NV_ACURRENT:
+ if(ap->cur)
+ ap->cur->nvenv = (char*)np;
return((void*)ap->cur);
case NV_ANAME:
if(ap->cur)
- return((void*)nv_name(ap->cur));
+ return((void*)ap->cur->nvname);
return(NIL(void*));
default:
if(sp)
{
+ Namval_t *mp=0;
+ ap->cur = 0;
if(sp==(char*)np)
- {
- ap->cur = 0;
return(0);
+ type = nv_isattr(np,NV_PUBLIC&~(NV_ARRAY|NV_CHILD|NV_MINIMAL));
+ if(mode)
+ mode = NV_ADD|HASH_NOSCOPE;
+ else if(ap->header.nelem&ARRAY_NOSCOPE)
+ mode = HASH_NOSCOPE;
+ if(*sp==0 && (mode&NV_ADD))
+ sfprintf(sfstderr,"adding empty subscript\n");
+ if(sh.subshell && (mp=nv_search(sp,ap->header.table,0)) && nv_isnull(mp))
+ ap->cur = mp;
+ if((mp || (mp=nv_search(sp,ap->header.table,mode))) && nv_isnull(mp) && (mode&NV_ADD))
+ {
+ nv_onattr(mp,type);
+ mp->nvenv = (char*)np;
+ if((mode&NV_ADD) && nv_type(np))
+ nv_arraychild(np,mp,0);
+ if(sh.subshell)
+ np = sh_assignok(np,1);
+ if(!ap->header.scope || !nv_search(sp,dtvnext(ap->header.table),0))
+ ap->header.nelem++;
+ if(nv_isnull(mp))
+ {
+ if(ap->header.nelem&ARRAY_TREE)
+ nv_setvtree(mp);
+ mp->nvalue.cp = Empty;
+ }
+ }
+ else if(ap->header.nelem&ARRAY_SCAN)
+ {
+ Namval_t fake;
+ fake.nvname = (char*)sp;
+ ap->pos = mp = (Namval_t*)dtprev(ap->header.table,&fake);
+ ap->nextpos = (Namval_t*)dtnext(ap->header.table,mp);
}
- else if(!(ap->header.nelem&ARRAY_SCAN))
+ np = mp;
+ if(ap->pos != np && !(ap->header.nelem&ARRAY_SCAN))
ap->pos = 0;
- type = nv_isattr(np,NV_PUBLIC&~(NV_ARRAY|NV_CHILD));
- if((np=nv_search(sp,ap->table,mode?NV_ADD:0)) && nv_isnull(np))
- nv_onattr(np,type);
ap->cur = np;
}
if(ap->cur)
@@ -837,19 +1297,21 @@ void *nv_associative(register Namval_t *np,const char *sp,int mode)
void nv_setvec(register Namval_t *np,int append,register int argc,register char *argv[])
{
int arg0=0;
- struct index_array *ap=0;
+ struct index_array *ap=0,*aq;
if(nv_isarray(np))
{
ap = (struct index_array*)nv_arrayptr(np);
if(ap && is_associative(ap))
- errormsg(SH_DICT,ERROR_exit(1),"cannot append index array to associate array %s",nv_name(np));
+ errormsg(SH_DICT,ERROR_exit(1),"cannot append index array to associative array %s",nv_name(np));
}
if(append)
{
if(ap)
{
+ if(!(aq = (struct index_array*)ap->header.scope))
+ aq = ap;
arg0 = ap->maxi;
- while(--arg0>0 && ap->val[arg0].cp==0);
+ while(--arg0>0 && ap->val[arg0].cp==0 && aq->val[arg0].cp==0);
arg0++;
}
else if(!nv_isnull(np))
@@ -857,8 +1319,7 @@ void nv_setvec(register Namval_t *np,int append,register int argc,register char
}
while(--argc >= 0)
{
- if((argc+arg0)>0 || nv_isattr(np,NV_ARRAY))
- nv_putsub(np,NIL(char*),(long)argc+arg0);
+ nv_putsub(np,NIL(char*),(long)argc+arg0|ARRAY_FILL|ARRAY_ADD);
nv_putval(np,argv[argc],0);
}
}
diff --git a/usr/src/lib/libshell/common/sh/bash.c b/usr/src/lib/libshell/common/sh/bash.c
index ecb10472b8..4b2def3b22 100644
--- a/usr/src/lib/libshell/common/sh/bash.c
+++ b/usr/src/lib/libshell/common/sh/bash.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -38,8 +38,6 @@
#define BASH_VERSION BASH_MAJOR "." BASH_MINOR "." BASH_PATCH "(" BASH_BUILD ")-" BASH_RELEASE
-void sh_applyopts(Shopt_t);
-
extern const char bash_pre_rc[];
static char *login_files[4];
@@ -50,8 +48,6 @@ const char sh_bash1[] =
"[P?Do not follow symbolic links, use physical directory structure "
"instead. Only available in bash compatibility mode.]";
const char sh_bash2[] =
-"[l:login?Make the shell act as if it had been invoked as a login shell. "
-"Only available if invoked as \bbash\b.]"
"[O]:?[shopt_option?\ashopt_option\a is one of the shell options accepted by "
"the \bshopt\b builtin. If \ashopt_option\a is present, \b-O\b sets "
"the value of that option; \b+O\b unsets it. If \ashopt_option\a is "
@@ -66,12 +62,9 @@ const char sh_bash2[] =
"[03:profile?Read either the system-wide startup file or any of the "
"personal initialization files. On by default for interactive "
"shells. Only available if invoked as \bbash\b.]"
-"[04:rc?Read and execute the personal initialization file "
- "\b$HOME/.bashrc\b. On by default for interactive shells. Only "
- "available if invoked as \bbash\b.]"
-"[05:posix?If invoked as \bbash\b, turn on POSIX compatibility. \bBash\b in "
+"[04:posix?If invoked as \bbash\b, turn on POSIX compatibility. \bBash\b in "
"POSIX mode is not the same as \bksh\b.]"
-"[06:version?Print version number and exit.]";
+"[05:version?Print version number and exit.]";
const char sh_optshopt[] =
"+[-1c?\n@(#)$Id: shopt (AT&T Research) 2003-02-13 $\n]"
@@ -293,7 +286,7 @@ int b_shopt(int argc,register char *argv[],void *extra)
else if(setflag&SET_UNSET)
for(n=0;n<4;n++)
newflags.v[n] &= ~opt.v[n];
- sh_applyopts(newflags);
+ sh_applyopts(shp,newflags);
shp->options = newflags;
if(is_option(&newflags,SH_XTRACE))
sh_trace(argv,1);
@@ -317,6 +310,7 @@ int b_shopt(int argc,register char *argv[],void *extra)
void bash_init(int mode)
{
+ Shell_t *shp = &sh;
Sfio_t *iop;
Namval_t *np;
int n=0,xtrace,verbose;
@@ -326,7 +320,7 @@ void bash_init(int mode)
{
/* termination code */
if(sh_isoption(SH_LOGIN_SHELL) && !sh_isoption(SH_POSIX))
- sh_source(&sh, NiL, sh_mactry((char*)e_bash_logout));
+ sh_source(shp, NiL, sh_mactry(shp,(char*)e_bash_logout));
return;
}
@@ -341,7 +335,7 @@ void bash_init(int mode)
sh_onoption(SH_CMDHIST);
sh_onoption(SH_LITHIST);
sh_onoption(SH_NOEMPTYCMDCOMPL);
- if(sh.login_sh==2)
+ if(shp->login_sh==2)
sh_onoption(SH_LOGIN_SHELL);
if(strcmp(astconf("CONFORMANCE",0,0),"standard")==0)
sh_onoption(SH_POSIX);
@@ -360,13 +354,13 @@ void bash_init(int mode)
/* set up some variables needed for --version
* needs to go here because --version option is parsed before the init script.
*/
- if(np=nv_open("HOSTTYPE",sh.var_tree,0))
+ if(np=nv_open("HOSTTYPE",shp->var_tree,0))
nv_putval(np, BASH_HOSTTYPE, NV_NOFREE);
- if(np=nv_open("MACHTYPE",sh.var_tree,0))
+ if(np=nv_open("MACHTYPE",shp->var_tree,0))
nv_putval(np, BASH_MACHTYPE, NV_NOFREE);
- if(np=nv_open("BASH_VERSION",sh.var_tree,0))
+ if(np=nv_open("BASH_VERSION",shp->var_tree,0))
nv_putval(np, BASH_VERSION, NV_NOFREE);
- if(np=nv_open("BASH_VERSINFO",sh.var_tree,0))
+ if(np=nv_open("BASH_VERSINFO",shp->var_tree,0))
{
char *argv[7];
argv[0] = BASH_MAJOR;
@@ -385,7 +379,7 @@ void bash_init(int mode)
/* rest of init stage */
/* restrict BASH_ENV */
- if(np=nv_open("BASH_ENV",sh.var_tree,0))
+ if(np=nv_open("BASH_ENV",shp->var_tree,0))
{
const Namdisc_t *dp = nv_discfun(NV_DCRESTRICT);
Namfun_t *fp = calloc(dp->dsize,1);
@@ -394,7 +388,7 @@ void bash_init(int mode)
}
/* open GLOBIGNORE node */
- if(np=nv_open("GLOBIGNORE",sh.var_tree,0))
+ if(np=nv_open("GLOBIGNORE",shp->var_tree,0))
{
const Namdisc_t *dp = &SH_GLOBIGNORE_disc;
Namfun_t *fp = calloc(dp->dsize,1);
@@ -404,7 +398,7 @@ void bash_init(int mode)
/* set startup files */
n=0;
- if(!sh_isoption(SH_NOPROFILE))
+ if(sh_isoption(SH_LOGIN_SHELL))
{
if(!sh_isoption(SH_POSIX))
{
@@ -413,13 +407,13 @@ void bash_init(int mode)
}
login_files[n++] = (char*)e_profile;
}
- sh.login_files = login_files;
+ shp->login_files = login_files;
reinit:
xtrace = sh_isoption(SH_XTRACE);
sh_offoption(SH_XTRACE);
verbose = sh_isoption(SH_VERBOSE);
sh_offoption(SH_VERBOSE);
- if(np = nv_open("SHELLOPTS", sh.var_tree, NV_NOADD))
+ if(np = nv_open("SHELLOPTS", shp->var_tree, NV_NOADD))
nv_offattr(np,NV_RDONLY);
iop = sfopen(NULL, bash_pre_rc, "s");
sh_eval(iop,0);
diff --git a/usr/src/lib/libshell/common/sh/defs.c b/usr/src/lib/libshell/common/sh/defs.c
index 8b11839eb4..8b8a6aa323 100644
--- a/usr/src/lib/libshell/common/sh/defs.c
+++ b/usr/src/lib/libshell/common/sh/defs.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -29,9 +29,9 @@
#include "edit.h"
#include "timeout.h"
-struct sh_static sh = {0};
+Shell_t sh = {0};
#ifdef __IMPORT__
- struct sh_static *_imp__sh = &sh;
+ Shell_t *_imp__sh = &sh;
#endif
Dtdisc_t _Nvdisc =
diff --git a/usr/src/lib/libshell/common/sh/deparse.c b/usr/src/lib/libshell/common/sh/deparse.c
index 74457d1092..c5704d2cf9 100644
--- a/usr/src/lib/libshell/common/sh/deparse.c
+++ b/usr/src/lib/libshell/common/sh/deparse.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libshell/common/sh/env.c b/usr/src/lib/libshell/common/sh/env.c
index d7f7b0b6d7..d1f9361975 100644
--- a/usr/src/lib/libshell/common/sh/env.c
+++ b/usr/src/lib/libshell/common/sh/env.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libshell/common/sh/expand.c b/usr/src/lib/libshell/common/sh/expand.c
index 097ed0da66..15004a09be 100644
--- a/usr/src/lib/libshell/common/sh/expand.c
+++ b/usr/src/lib/libshell/common/sh/expand.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -90,6 +90,7 @@ static char *nextdir(glob_t *gp, char *dir)
int path_expand(const char *pattern, struct argnod **arghead)
{
+ Shell_t *shp = &sh;
glob_t gdata;
register struct argnod *ap;
register glob_t *gp= &gdata;
@@ -98,6 +99,7 @@ int path_expand(const char *pattern, struct argnod **arghead)
register int off;
register char *sp, *cp, *cp2;
#endif
+ sh_stats(STAT_GLOBS);
memset(gp,0,sizeof(gdata));
flags = GLOB_AUGMENTED|GLOB_NOCHECK|GLOB_NOSORT|GLOB_STACK|GLOB_LIST|GLOB_DISC;
if(sh_isoption(SH_MARKDIRS))
@@ -117,8 +119,8 @@ int path_expand(const char *pattern, struct argnod **arghead)
if(sh_isstate(SH_COMPLETE))
{
#if KSHELL
- extra += scantree(sh.alias_tree,pattern,arghead);
- extra += scantree(sh.fun_tree,pattern,arghead);
+ extra += scantree(shp->alias_tree,pattern,arghead);
+ extra += scantree(shp->fun_tree,pattern,arghead);
# if GLOB_VERSION >= 20010916L
gp->gl_nextdir = nextdir;
# endif
@@ -139,13 +141,13 @@ int path_expand(const char *pattern, struct argnod **arghead)
* Generate shell patterns out of those here.
*/
if(sh_isstate(SH_FCOMPLETE))
- cp=nv_getval(nv_scoped(FIGNORENOD));
+ cp=nv_getval(sh_scoped(shp,FIGNORENOD));
else
{
static Namval_t *GLOBIGNORENOD;
if(!GLOBIGNORENOD)
- GLOBIGNORENOD = nv_open("GLOBIGNORE",sh.var_tree,0);
- cp=nv_getval(nv_scoped(GLOBIGNORENOD));
+ GLOBIGNORENOD = nv_open("GLOBIGNORE",shp->var_tree,0);
+ cp=nv_getval(sh_scoped(shp,GLOBIGNORENOD));
}
if(cp)
{
@@ -182,10 +184,10 @@ int path_expand(const char *pattern, struct argnod **arghead)
}
else
#endif
- gp->gl_fignore = nv_getval(nv_scoped(FIGNORENOD));
+ gp->gl_fignore = nv_getval(sh_scoped(shp,FIGNORENOD));
if(suflen)
gp->gl_suffix = sufstr;
- gp->gl_intr = &sh.trapnote;
+ gp->gl_intr = &shp->trapnote;
suflen = 0;
if(memcmp(pattern,"~(N",3)==0)
flags &= ~GLOB_NOCHECK;
diff --git a/usr/src/lib/libshell/common/sh/fault.c b/usr/src/lib/libshell/common/sh/fault.c
index 2d71736187..60af63972d 100644
--- a/usr/src/lib/libshell/common/sh/fault.c
+++ b/usr/src/lib/libshell/common/sh/fault.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -30,10 +30,11 @@
#include <fcin.h>
#include "io.h"
#include "history.h"
-#include "shnodes.h"
+#include "shlex.h"
#include "variables.h"
#include "jobs.h"
#include "path.h"
+#include "builtins.h"
#define abortsig(sig) (sig==SIGABRT || sig==SIGBUS || sig==SIGILL || sig==SIGSEGV)
@@ -59,9 +60,10 @@ static char indone;
*/
void sh_fault(register int sig)
{
- register int flag=0;
- register char *trap;
- register struct checkpt *pp = (struct checkpt*)sh.jmplist;
+ register Shell_t *shp = sh_getinterp();
+ register int flag=0;
+ register char *trap;
+ register struct checkpt *pp = (struct checkpt*)shp->jmplist;
int action=0;
/* reset handler */
if(!(sig&SH_TRAP))
@@ -74,37 +76,56 @@ void sh_fault(register int sig)
int32_t v;
astwinsize(2,&rows,&cols);
if(v = cols)
- nv_putval(COLUMNS, (char*)&v, NV_INT32);
+ nv_putval(COLUMNS, (char*)&v, NV_INT32|NV_RDONLY);
if(v = rows)
- nv_putval(LINES, (char*)&v, NV_INT32);
+ nv_putval(LINES, (char*)&v, NV_INT32|NV_RDONLY);
+ shp->winch++;
}
#endif /* SIGWINCH */
- if(sh.savesig)
+ if(shp->savesig)
{
/* critical region, save and process later */
- sh.savesig = sig;
+ shp->savesig = sig;
+ return;
+ }
+ trap = shp->st.trapcom[sig];
+ if(sig==SIGALRM && shp->bltinfun==b_sleep)
+ {
+ if(trap && *trap)
+ {
+ shp->trapnote |= SH_SIGTRAP;
+ shp->sigflag[sig] |= SH_SIGTRAP;
+ }
+ return;
+ }
+ if(shp->subshell && sig!=SIGINT && sig!=SIGQUIT && sig!=SIGWINCH)
+ {
+ shp->exitval = SH_EXITSIG|sig;
+ sh_subfork();
+ shp->exitval = 0;
return;
}
-
/* handle ignored signals */
- if((trap=sh.st.trapcom[sig]) && *trap==0)
+ if(trap && *trap==0)
return;
- flag = sh.sigflag[sig]&~SH_SIGOFF;
+ flag = shp->sigflag[sig]&~SH_SIGOFF;
if(!trap)
{
+ if(sig==SIGINT && (shp->trapnote&SH_SIGIGNORE))
+ return;
if(flag&SH_SIGIGNORE)
return;
if(flag&SH_SIGDONE)
{
void *ptr=0;
- if((flag&SH_SIGINTERACTIVE) && sh_isstate(SH_INTERACTIVE) && !sh_isstate(SH_FORKED) && ! sh.subshell)
+ if((flag&SH_SIGINTERACTIVE) && sh_isstate(SH_INTERACTIVE) && !sh_isstate(SH_FORKED) && ! shp->subshell)
{
/* check for TERM signal between fork/exec */
if(sig==SIGTERM && job.in_critical)
- sh.trapnote |= SH_SIGTERM;
+ shp->trapnote |= SH_SIGTERM;
return;
}
- sh.lastsig = sig;
+ shp->lastsig = sig;
sigrelease(sig);
if(pp->mode < SH_JMPFUN)
pp->mode = SH_JMPFUN;
@@ -114,14 +135,14 @@ void sh_fault(register int sig)
{
if(ptr)
free(ptr);
- if(!sh.subshell)
- sh_done(sig);
+ if(!shp->subshell)
+ sh_done(shp,sig);
sh_exit(SH_EXITSIG);
}
/* mark signal and continue */
- sh.trapnote |= SH_SIGSET;
- if(sig < sh.sigmax)
- sh.sigflag[sig] |= SH_SIGSET;
+ shp->trapnote |= SH_SIGSET;
+ if(sig < shp->sigmax)
+ shp->sigflag[sig] |= SH_SIGSET;
#if defined(VMFL) && (VMALLOC_VERSION>=20031205L)
if(abortsig(sig))
{
@@ -137,7 +158,7 @@ void sh_fault(register int sig)
}
errno = 0;
if(pp->mode==SH_JMPCMD)
- sh.lastsig = sig;
+ shp->lastsig = sig;
if(trap)
{
/*
@@ -149,12 +170,12 @@ void sh_fault(register int sig)
}
else
{
- sh.lastsig = sig;
+ shp->lastsig = sig;
flag = SH_SIGSET;
#ifdef SIGTSTP
if(sig==SIGTSTP)
{
- sh.trapnote |= SH_SIGTSTP;
+ shp->trapnote |= SH_SIGTSTP;
if(pp->mode==SH_JMPCMD && sh_isstate(SH_STOPOK))
{
sigrelease(sig);
@@ -165,14 +186,20 @@ void sh_fault(register int sig)
#endif /* SIGTSTP */
}
#ifdef ERROR_NOTIFY
- if((error_info.flags&ERROR_NOTIFY) && sh.bltinfun)
- action = (*sh.bltinfun)(-sig,(char**)0,(void*)0);
-#endif
+ /* This is obsolete */
+ if((error_info.flags&ERROR_NOTIFY) && shp->bltinfun)
+ action = (*shp->bltinfun)(-sig,(char**)0,(void*)0);
if(action>0)
return;
- sh.trapnote |= flag;
- if(sig < sh.sigmax)
- sh.sigflag[sig] |= flag;
+#endif
+ if(shp->bltinfun && shp->bltindata.notify)
+ {
+ shp->bltindata.sigset = 1;
+ return;
+ }
+ shp->trapnote |= flag;
+ if(sig < shp->sigmax)
+ shp->sigflag[sig] |= flag;
if(pp->mode==SH_JMPCMD && sh_isstate(SH_STOPOK))
{
if(action<0)
@@ -185,45 +212,45 @@ void sh_fault(register int sig)
/*
* initialize signal handling
*/
-void sh_siginit(void)
+void sh_siginit(void *ptr)
{
+ Shell_t *shp = (Shell_t*)ptr;
register int sig, n=SIGTERM+1;
register const struct shtable2 *tp = shtab_signals;
sig_begin();
/* find the largest signal number in the table */
+#ifdef SIGRTMIN
+ shp->sigruntime[SH_SIGRTMIN] = SIGRTMIN;
+#endif /* SIGRTMIN */
+#ifdef SIGRTMAX
+ shp->sigruntime[SH_SIGRTMAX] = SIGRTMAX;
+#endif /* SIGRTMAX */
while(*tp->sh_name)
{
- if((sig=tp->sh_number&((1<<SH_SIGBITS)-1))>n && sig<SH_TRAP)
+ sig = tp->sh_number&((1<<SH_SIGBITS)-1);
+ if ((tp->sh_number>>SH_SIGBITS) & SH_SIGRUNTIME)
+ sig = shp->sigruntime[sig-1];
+ if(sig>n && sig<SH_TRAP)
n = sig;
tp++;
}
-#if defined(_SC_SIGRT_MAX) && defined(_SIGRTMAX)
- if((sig=SIGRTMAX+1)>n && sig<SH_TRAP)
- n = sig;
-#endif
- sh.sigmax = n;
- sh.st.trapcom = (char**)calloc(n,sizeof(char*));
- sh.sigflag = (unsigned char*)calloc(n,1);
- sh.sigmsg = (char**)calloc(n,sizeof(char*));
+ shp->sigmax = n++;
+ shp->st.trapcom = (char**)calloc(n,sizeof(char*));
+ shp->sigflag = (unsigned char*)calloc(n,1);
+ shp->sigmsg = (char**)calloc(n,sizeof(char*));
for(tp=shtab_signals; sig=tp->sh_number; tp++)
{
n = (sig>>SH_SIGBITS);
- if((sig &= ((1<<SH_SIGBITS)-1)) > sh.sigmax)
+ if((sig &= ((1<<SH_SIGBITS)-1)) > shp->sigmax)
continue;
sig--;
-#if defined(_SC_SIGRT_MIN) && defined(_SIGRTMIN)
- if(sig==_SIGRTMIN)
- sig = SIGRTMIN;
-#endif
-#if defined(_SC_SIGRT_MAX) && defined(_SIGRTMAX)
- if(sig==_SIGRTMAX)
- sig = SIGRTMAX;
-#endif
+ if(n&SH_SIGRUNTIME)
+ sig = shp->sigruntime[sig];
if(sig>=0)
{
- sh.sigflag[sig] = n;
+ shp->sigflag[sig] = n;
if(*tp->sh_name)
- sh.sigmsg[sig] = (char*)tp->sh_value;
+ shp->sigmsg[sig] = (char*)tp->sh_value;
}
}
}
@@ -301,7 +328,7 @@ void sh_sigreset(register int mode)
sh.sigflag[sig] = flag;
}
}
- for(sig=SH_DEBUGTRAP;sig>=0;sig--)
+ for(sig=SH_DEBUGTRAP-1;sig>=0;sig--)
{
if(trap=sh.st.trap[sig])
{
@@ -344,7 +371,7 @@ void sh_chktrap(void)
{
register int sig=sh.st.trapmax;
register char *trap;
- if(!sh.trapnote)
+ if(!(sh.trapnote&~SH_SIGIGNORE))
sig=0;
sh.trapnote &= ~SH_SIGTRAP;
/* execute errexit trap first */
@@ -353,7 +380,12 @@ void sh_chktrap(void)
int sav_trapnote = sh.trapnote;
sh.trapnote &= ~SH_SIGSET;
if(sh.st.trap[SH_ERRTRAP])
- sh_trap(sh.st.trap[SH_ERRTRAP],0);
+ {
+ trap = sh.st.trap[SH_ERRTRAP];
+ sh.st.trap[SH_ERRTRAP] = 0;
+ sh_trap(trap,0);
+ sh.st.trap[SH_ERRTRAP] = trap;
+ }
sh.trapnote = sav_trapnote;
if(sh_isoption(SH_ERREXIT))
{
@@ -382,7 +414,8 @@ void sh_chktrap(void)
*/
int sh_trap(const char *trap, int mode)
{
- int jmpval, savxit = sh.exitval;
+ Shell_t *shp = sh_getinterp();
+ int jmpval, savxit = shp->exitval;
int was_history = sh_isstate(SH_HISTORY);
int was_verbose = sh_isstate(SH_VERBOSE);
int staktop = staktell();
@@ -392,7 +425,7 @@ int sh_trap(const char *trap, int mode)
fcsave(&savefc);
sh_offstate(SH_HISTORY);
sh_offstate(SH_VERBOSE);
- sh.intrap++;
+ shp->intrap++;
sh_pushcontext(&buff,SH_JMPTRAP);
jmpval = sigsetjmp(buff.buff,0);
if(jmpval == 0)
@@ -416,15 +449,15 @@ int sh_trap(const char *trap, int mode)
else
{
if(jmpval==SH_JMPEXIT)
- savxit = sh.exitval;
+ savxit = shp->exitval;
jmpval=SH_JMPTRAP;
}
}
sh_popcontext(&buff);
- sh.intrap--;
- sfsync(sh.outpool);
- if(jmpval!=SH_JMPEXIT && jmpval!=SH_JMPFUN)
- sh.exitval=savxit;
+ shp->intrap--;
+ sfsync(shp->outpool);
+ if(!shp->indebug && jmpval!=SH_JMPEXIT && jmpval!=SH_JMPFUN)
+ shp->exitval=savxit;
stakset(savptr,staktop);
fcrestore(&savefc);
if(was_history)
@@ -433,8 +466,8 @@ int sh_trap(const char *trap, int mode)
sh_onstate(SH_VERBOSE);
exitset();
if(jmpval>SH_JMPTRAP)
- siglongjmp(*sh.jmplist,jmpval);
- return(sh.exitval);
+ siglongjmp(*shp->jmplist,jmpval);
+ return(shp->exitval);
}
/*
@@ -442,95 +475,109 @@ int sh_trap(const char *trap, int mode)
*/
void sh_exit(register int xno)
{
- register struct checkpt *pp = (struct checkpt*)sh.jmplist;
+ Shell_t *shp = &sh;
+ register struct checkpt *pp = (struct checkpt*)shp->jmplist;
register int sig=0;
register Sfio_t* pool;
- sh.exitval=xno;
+ shp->exitval=xno;
if(xno==SH_EXITSIG)
- sh.exitval |= (sig=sh.lastsig);
+ shp->exitval |= (sig=shp->lastsig);
#ifdef SIGTSTP
- if(sh.trapnote&SH_SIGTSTP)
+ if(shp->trapnote&SH_SIGTSTP)
{
/* ^Z detected by the shell */
- sh.trapnote = 0;
- sh.sigflag[SIGTSTP] = 0;
- if(!sh.subshell && sh_isstate(SH_MONITOR) && !sh_isstate(SH_STOPOK))
+ shp->trapnote = 0;
+ shp->sigflag[SIGTSTP] = 0;
+ if(!shp->subshell && sh_isstate(SH_MONITOR) && !sh_isstate(SH_STOPOK))
return;
if(sh_isstate(SH_TIMING))
return;
/* Handles ^Z for shell builtins, subshells, and functs */
- sh.lastsig = 0;
+ shp->lastsig = 0;
sh_onstate(SH_MONITOR);
sh_offstate(SH_STOPOK);
- sh.trapnote = 0;
- if(!sh.subshell && (sig=sh_fork(0,NIL(int*))))
+ shp->trapnote = 0;
+ if(!shp->subshell && (sig=sh_fork(0,NIL(int*))))
{
job.curpgid = 0;
job.parent = (pid_t)-1;
job_wait(sig);
job.parent = 0;
- sh.sigflag[SIGTSTP] = 0;
+ shp->sigflag[SIGTSTP] = 0;
/* wait for child to stop */
- sh.exitval = (SH_EXITSIG|SIGTSTP);
+ shp->exitval = (SH_EXITSIG|SIGTSTP);
/* return to prompt mode */
pp->mode = SH_JMPERREXIT;
}
else
{
- if(sh.subshell)
+ if(shp->subshell)
sh_subfork();
/* child process, put to sleep */
sh_offstate(SH_STOPOK);
sh_offstate(SH_MONITOR);
- sh.sigflag[SIGTSTP] = 0;
+ shp->sigflag[SIGTSTP] = 0;
/* stop child job */
killpg(job.curpgid,SIGTSTP);
/* child resumes */
job_clear();
- sh.forked = 1;
- sh.exitval = (xno&SH_EXITMASK);
+ shp->forked = 1;
+ shp->exitval = (xno&SH_EXITMASK);
return;
}
}
#endif /* SIGTSTP */
/* unlock output pool */
sh_offstate(SH_NOTRACK);
- if(!(pool=sfpool(NIL(Sfio_t*),sh.outpool,SF_WRITE)))
- pool = sh.outpool; /* can't happen? */
+ if(!(pool=sfpool(NIL(Sfio_t*),shp->outpool,SF_WRITE)))
+ pool = shp->outpool; /* can't happen? */
sfclrlock(pool);
#ifdef SIGPIPE
- if(sh.lastsig==SIGPIPE)
+ if(shp->lastsig==SIGPIPE)
sfpurge(pool);
#endif /* SIGPIPE */
sfclrlock(sfstdin);
if(!pp)
- sh_done(sig);
- sh.prefix = 0;
+ sh_done(shp,sig);
+ shp->prefix = 0;
+#if SHOPT_TYPEDEF
+ shp->mktype = 0;
+#endif /* SHOPT_TYPEDEF*/
if(pp->mode == SH_JMPSCRIPT && !pp->prev)
- sh_done(sig);
- siglongjmp(pp->buff,pp->mode);
+ sh_done(shp,sig);
+ if(pp->mode)
+ siglongjmp(pp->buff,pp->mode);
+}
+
+static void array_notify(Namval_t *np, void *data)
+{
+ Namarr_t *ap = nv_arrayptr(np);
+ NOT_USED(data);
+ if(ap && ap->fun)
+ (*ap->fun)(np, 0, NV_AFREE);
}
/*
* This is the exit routine for the shell
*/
-void sh_done(register int sig)
+void sh_done(void *ptr, register int sig)
{
+ Shell_t *shp = (Shell_t*)ptr;
register char *t;
- register int savxit = sh.exitval;
- sh.trapnote = 0;
+ register int savxit = shp->exitval;
+ shp->trapnote = 0;
indone=1;
if(sig==0)
- sig = sh.lastsig;
- if(sh.userinit)
- (*sh.userinit)(-1);
- if(t=sh.st.trapcom[0])
+ sig = shp->lastsig;
+ if(shp->userinit)
+ (*shp->userinit)(shp, -1);
+ if(t=shp->st.trapcom[0])
{
- sh.st.trapcom[0]=0; /*should free but not long */
- sh.oldexit = savxit;
+ shp->st.trapcom[0]=0; /*should free but not long */
+ shp->oldexit = savxit;
sh_trap(t,0);
- savxit = sh.exitval;
+ savxit = shp->exitval;
}
else
{
@@ -538,7 +585,8 @@ void sh_done(register int sig)
sh_offstate(SH_ERREXIT);
sh_chktrap();
}
- sh_freeup();
+ nv_scan(shp->var_tree,array_notify,(void*)0,NV_ARRAY,NV_ARRAY);
+ sh_freeup(shp);
#if SHOPT_ACCT
sh_accend();
#endif /* SHOPT_ACCT */
@@ -547,14 +595,14 @@ void sh_done(register int sig)
tty_cooked(-1);
#endif
#ifdef JOBS
- if((sh_isoption(SH_INTERACTIVE) && sh.login_sh) || (!sh_isoption(SH_INTERACTIVE) && (sig==SIGHUP)))
+ if((sh_isoption(SH_INTERACTIVE) && shp->login_sh) || (!sh_isoption(SH_INTERACTIVE) && (sig==SIGHUP)))
job_walk(sfstderr,job_terminate,SIGHUP,NIL(char**));
#endif /* JOBS */
- job_close();
- if(nv_search("VMTRACE", sh.var_tree,0))
+ job_close(shp);
+ if(nv_search("VMTRACE", shp->var_tree,0))
strmatch((char*)0,(char*)0);
sfsync((Sfio_t*)sfstdin);
- sfsync((Sfio_t*)sh.outpool);
+ sfsync((Sfio_t*)shp->outpool);
sfsync((Sfio_t*)sfstdout);
if(sig)
{
@@ -566,7 +614,7 @@ void sh_done(register int sig)
}
#if SHOPT_KIA
if(sh_isoption(SH_NOEXEC))
- kiaclose();
+ kiaclose((Lex_t*)shp->lex_context);
#endif /* SHOPT_KIA */
exit(savxit&SH_EXITMASK);
}
diff --git a/usr/src/lib/libshell/common/sh/fcin.c b/usr/src/lib/libshell/common/sh/fcin.c
index aea98364f5..9618bb9ac0 100644
--- a/usr/src/lib/libshell/common/sh/fcin.c
+++ b/usr/src/lib/libshell/common/sh/fcin.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -97,7 +97,7 @@ int fcfill(void)
_Fcin.fcptr = ptr = last;
}
if((n = ptr-_Fcin.fcbuff) && _Fcin.fcfun)
- (*_Fcin.fcfun)(f,(const char*)_Fcin.fcbuff,n);
+ (*_Fcin.fcfun)(f,(const char*)_Fcin.fcbuff,n,_Fcin.context);
sfread(f, (char*)_Fcin.fcbuff, n);
_Fcin.fcoff +=n;
_Fcin._fcfile = 0;
@@ -128,9 +128,10 @@ int fcclose(void)
/*
* Set the notify function that is called for each fcfill()
*/
-void fcnotify(void (*fun)(Sfio_t*,const char*,int))
+void fcnotify(void (*fun)(Sfio_t*,const char*,int,void*),void* context)
{
_Fcin.fcfun = fun;
+ _Fcin.context = context;
}
#ifdef __EXPORT__
diff --git a/usr/src/lib/libshell/common/sh/init.c b/usr/src/lib/libshell/common/sh/init.c
index fbb6e5c6bc..0bd2f92b79 100644
--- a/usr/src/lib/libshell/common/sh/init.c
+++ b/usr/src/lib/libshell/common/sh/init.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -32,6 +32,7 @@
#include <ctype.h>
#include <ccode.h>
#include <pwd.h>
+#include <tmx.h>
#include "variables.h"
#include "path.h"
#include "fault.h"
@@ -46,17 +47,44 @@
#include "lexstates.h"
#include "version.h"
+char e_version[] = "\n@(#)$Id: Version "
+#if SHOPT_AUDIT
+#define ATTRS 1
+ "A"
+#endif
+#if SHOPT_BASH
+#define ATTRS 1
+ "B"
+#endif
+#if SHOPT_ACCT
+#define ATTRS 1
+ "L"
+#endif
#if SHOPT_MULTIBYTE
- char e_version[] = "\n@(#)$Id: Version M "SH_RELEASE" $\0\n";
-#else
- char e_version[] = "\n@(#)$Id: Version "SH_RELEASE" $\0\n";
-#endif /* SHOPT_MULTIBYTE */
+#define ATTRS 1
+ "M"
+#endif
+#if SHOPT_PFSH && _hdr_exec_attr
+#define ATTRS 1
+ "P"
+#endif
+#if ATTRS
+ " "
+#endif
+ SH_RELEASE " $\0\n";
#if SHOPT_BASH
- extern void bash_init(int);
+ extern void bash_init(Shell_t*,int);
#endif
#define RANDMASK 0x7fff
+
+#ifndef ARG_MAX
+# define ARG_MAX (1*1024*1024)
+#endif
+#ifndef CHILD_MAX
+# define CHILD_MAX (1*1024)
+#endif
#ifndef CLK_TCK
# define CLK_TCK 60
#endif /* CLK_TCK */
@@ -77,23 +105,15 @@ struct seconds
struct rand
{
Namfun_t hdr;
- Shell_t *sh;
int32_t rand_last;
};
struct ifs
{
Namfun_t hdr;
- Shell_t *sh;
Namval_t *ifsnp;
};
-struct shell
-{
- Namfun_t hdr;
- Shell_t *sh;
-};
-
struct match
{
Namfun_t hdr;
@@ -112,31 +132,33 @@ typedef struct _init_
Namfun_t VPATH_init;
#endif /* SHOPT_FS_3D */
struct ifs IFS_init;
- struct shell PATH_init;
-#ifdef PATH_BFPATH
- struct shell FPATH_init;
- struct shell CDPATH_init;
-#endif
- struct shell SHELL_init;
- struct shell ENV_init;
- struct shell VISUAL_init;
- struct shell EDITOR_init;
- struct shell OPTINDEX_init;
+ Namfun_t PATH_init;
+ Namfun_t FPATH_init;
+ Namfun_t CDPATH_init;
+ Namfun_t SHELL_init;
+ Namfun_t ENV_init;
+ Namfun_t VISUAL_init;
+ Namfun_t EDITOR_init;
+ Namfun_t HISTFILE_init;
+ Namfun_t HISTSIZE_init;
+ Namfun_t OPTINDEX_init;
struct seconds SECONDS_init;
struct rand RAND_init;
- struct shell LINENO_init;
- struct shell L_ARG_init;
+ Namfun_t LINENO_init;
+ Namfun_t L_ARG_init;
+ Namfun_t SH_VERSION_init;
struct match SH_MATCH_init;
#ifdef _hdr_locale
- struct shell LC_TYPE_init;
- struct shell LC_NUM_init;
- struct shell LC_COLL_init;
- struct shell LC_MSG_init;
- struct shell LC_ALL_init;
- struct shell LANG_init;
+ Namfun_t LC_TYPE_init;
+ Namfun_t LC_NUM_init;
+ Namfun_t LC_COLL_init;
+ Namfun_t LC_MSG_init;
+ Namfun_t LC_ALL_init;
+ Namfun_t LANG_init;
#endif /* _hdr_locale */
} Init_t;
+static int nbltins;
static void env_init(Shell_t*);
static Init_t *nv_init(Shell_t*);
static Dt_t *inittree(Shell_t*,const struct shtable2*);
@@ -173,12 +195,13 @@ static char *nospace(int unused)
static void put_ed(register Namval_t* np,const char *val,int flags,Namfun_t *fp)
{
register const char *cp, *name=nv_name(np);
- if(*name=='E' && nv_getval(nv_scoped(VISINOD)))
+ Shell_t *shp = nv_shell(np);
+ if(*name=='E' && nv_getval(sh_scoped(shp,VISINOD)))
goto done;
sh_offoption(SH_VI);
sh_offoption(SH_EMACS);
sh_offoption(SH_GMACS);
- if(!(cp=val) && (*name=='E' || !(cp=nv_getval(nv_scoped(EDITNOD)))))
+ if(!(cp=val) && (*name=='E' || !(cp=nv_getval(sh_scoped(shp,EDITNOD)))))
goto done;
/* turn on vi or emacs option if editor name is either*/
cp = path_basename(cp);
@@ -192,12 +215,37 @@ done:
nv_putv(np, val, flags, fp);
}
+/* Trap for HISTFILE and HISTSIZE variables */
+static void put_history(register Namval_t* np,const char *val,int flags,Namfun_t *fp)
+{
+ Shell_t *shp = nv_shell(np);
+ void *histopen = shp->hist_ptr;
+ if(val && histopen)
+ {
+ if(np==HISTFILE && strcmp(val,nv_getval(HISTFILE))==0)
+ return;
+ if(np==HISTSIZE && sh_arith(val)==nv_getnum(HISTSIZE))
+ return;
+ hist_close(shp->hist_ptr);
+ }
+ nv_putv(np, val, flags, fp);
+ if(histopen)
+ {
+ if(val)
+ sh_histinit(shp);
+ else
+ hist_close(histopen);
+ }
+}
+
/* Trap for OPTINDEX */
static void put_optindex(Namval_t* np,const char *val,int flags,Namfun_t *fp)
{
- Shell_t *shp = ((struct shell*)fp)->sh;
+ Shell_t *shp = nv_shell(np);
shp->st.opterror = shp->st.optchar = 0;
nv_putv(np, val, flags, fp);
+ if(!val)
+ nv_disc(np,fp,NV_POP);
}
static Sfdouble_t nget_optindex(register Namval_t* np, Namfun_t *fp)
@@ -205,34 +253,37 @@ static Sfdouble_t nget_optindex(register Namval_t* np, Namfun_t *fp)
return((Sfdouble_t)*np->nvalue.lp);
}
+static Namfun_t *clone_optindex(Namval_t* np, Namval_t *mp, int flags, Namfun_t *fp)
+{
+ Namfun_t *dp = (Namfun_t*)malloc(sizeof(Namfun_t));
+ memcpy((void*)dp,(void*)fp,sizeof(Namfun_t));
+ mp->nvalue.lp = np->nvalue.lp;
+ dp->nofree = 0;
+ return(dp);
+}
+
+
/* Trap for restricted variables FPATH, PATH, SHELL, ENV */
static void put_restricted(register Namval_t* np,const char *val,int flags,Namfun_t *fp)
{
- Shell_t *shp = ((struct shell*)fp)->sh;
- int path_scoped = 0;
-#ifdef PATH_BFPATH
+ Shell_t *shp = nv_shell(np);
+ int path_scoped = 0;
Pathcomp_t *pp;
char *name = nv_name(np);
-#endif
if(!(flags&NV_RDONLY) && sh_isoption(SH_RESTRICTED))
errormsg(SH_DICT,ERROR_exit(1),e_restricted,nv_name(np));
if(np==PATHNOD || (path_scoped=(strcmp(name,PATHNOD->nvname)==0)))
{
-#ifndef PATH_BFPATH
- shp->lastpath = 0;
-#endif
nv_scan(shp->track_tree,rehash,(void*)0,NV_TAGGED,NV_TAGGED);
if(path_scoped && !val)
val = PATHNOD->nvalue.cp;
}
if(val && !(flags&NV_RDONLY) && np->nvalue.cp && strcmp(val,np->nvalue.cp)==0)
return;
-#ifdef PATH_BFPATH
- if(shp->pathlist && np==FPATHNOD)
+ if(np==FPATHNOD)
shp->pathlist = (void*)path_unsetfpath((Pathcomp_t*)shp->pathlist);
-#endif
nv_putv(np, val, flags, fp);
-#ifdef PATH_BFPATH
+ shp->universe = 0;
if(shp->pathlist)
{
val = np->nvalue.cp;
@@ -255,14 +306,12 @@ sfprintf(sfstderr,"%d: name=%s val=%s\n",getpid(),name,val);
path_dump((Pathcomp_t*)shp->pathlist);
#endif
}
-#endif
}
-#ifdef PATH_BFPATH
static void put_cdpath(register Namval_t* np,const char *val,int flags,Namfun_t *fp)
{
Pathcomp_t *pp;
- Shell_t *shp = ((struct shell*)fp)->sh;
+ Shell_t *shp = nv_shell(np);
nv_putv(np, val, flags, fp);
if(!shp->cdpathlist)
return;
@@ -271,7 +320,6 @@ static void put_cdpath(register Namval_t* np,const char *val,int flags,Namfun_t
if(shp->cdpathlist = (void*)pp)
pp->shp = shp;
}
-#endif
#ifdef _hdr_locale
/*
@@ -295,6 +343,7 @@ static void put_cdpath(register Namval_t* np,const char *val,int flags,Namfun_t
/* Trap for LC_ALL, LC_TYPE, LC_MESSAGES, LC_COLLATE and LANG */
static void put_lang(Namval_t* np,const char *val,int flags,Namfun_t *fp)
{
+ Shell_t *shp = nv_shell(np);
int type;
char *lc_all = nv_getval(LCALLNOD);
char *name = nv_name(np);
@@ -314,11 +363,11 @@ static void put_cdpath(register Namval_t* np,const char *val,int flags,Namfun_t
type= -1;
if(sh_isstate(SH_INIT) && type>=0 && type!=LC_ALL && lc_all && *lc_all)
type= -1;
- if(type>=0)
+ if(type>=0 || type==LC_ALL)
{
if(!setlocale(type,val?val:""))
{
- if(!sh_isstate(SH_INIT) || sh.login_sh==0)
+ if(!sh_isstate(SH_INIT) || shp->login_sh==0)
errormsg(SH_DICT,0,e_badlocale,val);
return;
}
@@ -397,7 +446,7 @@ static char* get_ifs(register Namval_t* np, Namfun_t *fp)
register struct ifs *ip = (struct ifs*)fp;
register char *cp, *value;
register int c,n;
- register Shell_t *shp = ip->sh;
+ register Shell_t *shp = nv_shell(np);
value = nv_getv(np,fp);
if(np!=ip->ifsnp)
{
@@ -463,6 +512,7 @@ static void put_seconds(register Namval_t* np,const char *val,int flags,Namfun_t
if(!np->nvalue.dp)
{
nv_setsize(np,3);
+ nv_onattr(np,NV_DOUBLE);
np->nvalue.dp = new_of(double,0);
}
nv_putv(np, val, flags, fp);
@@ -473,14 +523,15 @@ static void put_seconds(register Namval_t* np,const char *val,int flags,Namfun_t
static char* get_seconds(register Namval_t* np, Namfun_t *fp)
{
+ Shell_t *shp = nv_shell(np);
register int places = nv_size(np);
struct tms tp;
double d, offset = (np->nvalue.dp?*np->nvalue.dp:0);
NOT_USED(fp);
timeofday(&tp);
d = dtime(&tp)- offset;
- sfprintf(sh.strbuf,"%.*f",places,d);
- return(sfstruse(sh.strbuf));
+ sfprintf(shp->strbuf,"%.*f",places,d);
+ return(sfstruse(shp->strbuf));
}
static Sfdouble_t nget_seconds(register Namval_t* np, Namfun_t *fp)
@@ -554,7 +605,7 @@ static Sfdouble_t nget_lineno(Namval_t* np, Namfun_t *fp)
static void put_lineno(Namval_t* np,const char *val,int flags,Namfun_t *fp)
{
register long n;
- Shell_t *shp = ((struct shell*)fp)->sh;
+ Shell_t *shp = nv_shell(np);
if(!val)
{
nv_stack(np, NIL(Namfun_t*));
@@ -576,25 +627,27 @@ static char* get_lineno(register Namval_t* np, Namfun_t *fp)
static char* get_lastarg(Namval_t* np, Namfun_t *fp)
{
+ Shell_t *shp = nv_shell(np);
NOT_USED(np);
- return(sh.lastarg);
+ return(shp->lastarg);
}
static void put_lastarg(Namval_t* np,const char *val,int flags,Namfun_t *fp)
{
+ Shell_t *shp = nv_shell(np);
if(flags&NV_INTEGER)
{
- sfprintf(sh.strbuf,"%.*g",12,*((double*)val));
- val = sfstruse(sh.strbuf);
+ sfprintf(shp->strbuf,"%.*g",12,*((double*)val));
+ val = sfstruse(shp->strbuf);
}
- if(sh.lastarg && !nv_isattr(np,NV_NOFREE))
- free((void*)sh.lastarg);
+ if(shp->lastarg && !nv_isattr(np,NV_NOFREE))
+ free((void*)shp->lastarg);
else
nv_offattr(np,NV_NOFREE);
if(val)
- sh.lastarg = strdup(val);
+ shp->lastarg = strdup(val);
else
- sh.lastarg = 0;
+ shp->lastarg = 0;
}
static int hasgetdisc(register Namfun_t *fp)
@@ -635,7 +688,7 @@ void sh_setmatch(const char *v, int vsize, int nmatch, int match[])
}
memcpy(mp->val,v,vsize);
mp->val[vsize] = 0;
- nv_putsub(SH_MATCHNOD, NIL(char*), nmatch|ARRAY_FILL);
+ nv_putsub(SH_MATCHNOD, NIL(char*), (nmatch-1)|ARRAY_FILL);
mp->lastsub = -1;
}
}
@@ -670,7 +723,30 @@ static char* get_match(register Namval_t* np, Namfun_t *fp)
return(mp->rval);
}
-static const Namdisc_t SH_MATCH_disc = { sizeof(struct match), 0, get_match };
+static const Namdisc_t SH_MATCH_disc = { sizeof(struct match), 0, get_match };
+
+static char* get_version(register Namval_t* np, Namfun_t *fp)
+{
+ return(nv_getv(np,fp));
+}
+
+static Sfdouble_t nget_version(register Namval_t* np, Namfun_t *fp)
+{
+ register const char *cp = e_version + strlen(e_version)-10;
+ register int c;
+ Sflong_t t = 0;
+ NOT_USED(fp);
+
+ while (c = *cp++)
+ if (c >= '0' && c <= '9')
+ {
+ t *= 10;
+ t += c - '0';
+ }
+ return((Sfdouble_t)t);
+}
+
+static const Namdisc_t SH_VERSION_disc = { 0, 0, get_version, nget_version };
#if SHOPT_FS_3D
/*
@@ -709,16 +785,15 @@ static const Namdisc_t SH_MATCH_disc = { sizeof(struct match), 0, get_match };
static const Namdisc_t IFS_disc = { sizeof(struct ifs), put_ifs, get_ifs };
-const Namdisc_t RESTRICTED_disc = { sizeof(struct shell), put_restricted };
-#ifdef PATH_BFPATH
-static const Namdisc_t CDPATH_disc = { sizeof(struct shell), put_cdpath };
-#endif
-static const Namdisc_t EDITOR_disc = { sizeof(struct shell), put_ed };
-static const Namdisc_t OPTINDEX_disc = { sizeof(struct shell), put_optindex, 0, nget_optindex };
+const Namdisc_t RESTRICTED_disc = { sizeof(Namfun_t), put_restricted };
+static const Namdisc_t CDPATH_disc = { sizeof(Namfun_t), put_cdpath };
+static const Namdisc_t EDITOR_disc = { sizeof(Namfun_t), put_ed };
+static const Namdisc_t HISTFILE_disc = { sizeof(Namfun_t), put_history };
+static const Namdisc_t OPTINDEX_disc = { sizeof(Namfun_t), put_optindex, 0, nget_optindex, 0, 0, clone_optindex };
static const Namdisc_t SECONDS_disc = { sizeof(struct seconds), put_seconds, get_seconds, nget_seconds };
static const Namdisc_t RAND_disc = { sizeof(struct rand), put_rand, get_rand, nget_rand };
-static const Namdisc_t LINENO_disc = { sizeof(struct shell), put_lineno, get_lineno, nget_lineno };
-static const Namdisc_t L_ARG_disc = { sizeof(struct shell), put_lastarg, get_lastarg };
+static const Namdisc_t LINENO_disc = { sizeof(Namfun_t), put_lineno, get_lineno, nget_lineno };
+static const Namdisc_t L_ARG_disc = { sizeof(Namfun_t), put_lastarg, get_lastarg };
#if SHOPT_NAMESPACE
static char* get_nspace(Namval_t* np, Namfun_t *fp)
@@ -732,7 +807,7 @@ static const Namdisc_t L_ARG_disc = { sizeof(struct shell), put_lastarg, get_la
#endif /* SHOPT_NAMESPACE */
#ifdef _hdr_locale
- static const Namdisc_t LC_disc = { sizeof(struct shell), put_lang };
+ static const Namdisc_t LC_disc = { sizeof(Namfun_t), put_lang };
#endif /* _hdr_locale */
/*
@@ -841,25 +916,66 @@ int sh_type(register const char *path)
}
break;
}
- if (*s++ != 's' || *s++ != 'h')
- return 0;
- t |= SH_TYPE_SH;
- if ((t & SH_TYPE_KSH) && *s == '9' && *(s+1) == '3')
- s += 2;
+ if (*s++ == 's' && (*s == 'h' || *s == 'u'))
+ {
+ s++;
+ t |= SH_TYPE_SH;
+ if ((t & SH_TYPE_KSH) && *s == '9' && *(s+1) == '3')
+ s += 2;
#if _WINIX
- if (*s == '.' && *(s+1) == 'e' && *(s+2) == 'x' && *(s+3) == 'e')
- s += 4;
+ if (*s == '.' && *(s+1) == 'e' && *(s+2) == 'x' && *(s+3) == 'e')
+ s += 4;
#endif
- if (*s)
- t &= ~(SH_TYPE_PROFILE|SH_TYPE_RESTRICTED);
- return t;
+ if (!isalnum(*s))
+ return t;
+ }
+ return t & ~(SH_TYPE_BASH|SH_TYPE_KSH|SH_TYPE_PROFILE|SH_TYPE_RESTRICTED);
+}
+
+
+static char *get_mode(Namval_t* np, Namfun_t* nfp)
+{
+ mode_t mode = nv_getn(np,nfp);
+ return(fmtperm(mode));
+}
+
+static void put_mode(Namval_t* np, const char* val, int flag, Namfun_t* nfp)
+{
+ if(val)
+ {
+ mode_t mode;
+ char *last;
+ if(flag&NV_INTEGER)
+ {
+ if(flag&NV_LONG)
+ mode = *(Sfdouble_t*)val;
+ else
+ mode = *(double*)val;
+ }
+ else
+ mode = strperm(val, &last,0);
+ if(*last)
+ errormsg(SH_DICT,ERROR_exit(1),"%s: invalid mode string",val);
+ nv_putv(np,(char*)&mode,NV_INTEGER,nfp);
+ }
+ else
+ nv_putv(np,val,flag,nfp);
}
+static const Namdisc_t modedisc =
+{
+ 0,
+ put_mode,
+ get_mode,
+};
+
+
/*
* initialize the shell
*/
-Shell_t *sh_init(register int argc,register char *argv[], void(*userinit)(int))
+Shell_t *sh_init(register int argc,register char *argv[], Shinit_f userinit)
{
+ Shell_t *shp = &sh;
register int n;
int type;
static char *login_files[3];
@@ -871,25 +987,26 @@ Shell_t *sh_init(register int argc,register char *argv[], void(*userinit)(int))
#else
init_ebcdic();
#endif
- umask(umask(0));
- sh.mac_context = sh_macopen(&sh);
- sh.arg_context = sh_argopen(&sh);
- sh.lex_context = (void*)sh_lexopen(0,&sh,1);
- sh.ed_context = (void*)ed_open(&sh);
- sh.strbuf = sfstropen();
- sfsetbuf(sh.strbuf,(char*)0,64);
+ umask(shp->mask=umask(0));
+ shp->mac_context = sh_macopen(shp);
+ shp->arg_context = sh_argopen(shp);
+ shp->lex_context = (void*)sh_lexopen(0,shp,1);
+ shp->ed_context = (void*)ed_open(shp);
+ shp->strbuf = sfstropen();
+ shp->stk = stkstd;
+ sfsetbuf(shp->strbuf,(char*)0,64);
sh_onstate(SH_INIT);
error_info.exit = sh_exit;
error_info.id = path_basename(argv[0]);
#if ERROR_VERSION >= 20000102L
error_info.catalog = e_dict;
#endif
- sh.cpipe[0] = -1;
- sh.coutpipe = -1;
- sh.userid=getuid();
- sh.euserid=geteuid();
- sh.groupid=getgid();
- sh.egroupid=getegid();
+ shp->cpipe[0] = -1;
+ shp->coutpipe = -1;
+ shp->userid=getuid();
+ shp->euserid=geteuid();
+ shp->groupid=getgid();
+ shp->egroupid=getegid();
for(n=0;n < 10; n++)
{
/* don't use lower bits when rand() generates large numbers */
@@ -899,41 +1016,42 @@ Shell_t *sh_init(register int argc,register char *argv[], void(*userinit)(int))
break;
}
}
- sh.lim.clk_tck = getconf("CLK_TCK");
- sh.lim.arg_max = getconf("ARG_MAX");
- sh.lim.open_max = getconf("OPEN_MAX");
- sh.lim.child_max = getconf("CHILD_MAX");
- sh.lim.ngroups_max = getconf("NGROUPS_MAX");
- sh.lim.posix_version = getconf("VERSION");
- sh.lim.posix_jobcontrol = getconf("JOB_CONTROL");
- if(sh.lim.arg_max <=0)
- sh.lim.arg_max = ARG_MAX;
- if(sh.lim.child_max <=0)
- sh.lim.child_max = CHILD_MAX;
- if(sh.lim.open_max <0)
- sh.lim.open_max = OPEN_MAX;
- if(sh.lim.open_max > (SHRT_MAX-2))
- sh.lim.open_max = SHRT_MAX-2;
- if(sh.lim.clk_tck <=0)
- sh.lim.clk_tck = CLK_TCK;
+ shp->lim.clk_tck = getconf("CLK_TCK");
+ shp->lim.arg_max = getconf("ARG_MAX");
+ shp->lim.open_max = getconf("OPEN_MAX");
+ shp->lim.child_max = getconf("CHILD_MAX");
+ shp->lim.ngroups_max = getconf("NGROUPS_MAX");
+ shp->lim.posix_version = getconf("VERSION");
+ shp->lim.posix_jobcontrol = getconf("JOB_CONTROL");
+ if(shp->lim.arg_max <=0)
+ shp->lim.arg_max = ARG_MAX;
+ if(shp->lim.child_max <=0)
+ shp->lim.child_max = CHILD_MAX;
+ if(shp->lim.open_max <0)
+ shp->lim.open_max = OPEN_MAX;
+ if(shp->lim.open_max > (SHRT_MAX-2))
+ shp->lim.open_max = SHRT_MAX-2;
+ if(shp->lim.clk_tck <=0)
+ shp->lim.clk_tck = CLK_TCK;
#if SHOPT_FS_3D
if(fs3d(FS3D_TEST))
- sh.lim.fs3d = 1;
+ shp->lim.fs3d = 1;
#endif /* SHOPT_FS_3D */
- sh_ioinit();
+ sh_ioinit(shp);
/* initialize signal handling */
- sh_siginit();
+ sh_siginit(shp);
stakinstall(NIL(Stak_t*),nospace);
/* set up memory for name-value pairs */
- sh.init_context = nv_init(&sh);
+ shp->init_context = nv_init(shp);
/* read the environment */
if(argc>0)
{
type = sh_type(*argv);
if(type&SH_TYPE_LOGIN)
- sh.login_sh = 2;
+ shp->login_sh = 2;
}
- env_init(&sh);
+ env_init(shp);
+ *SHLVL->nvalue.ip +=1;
#if SHOPT_SPAWN
{
/*
@@ -942,17 +1060,17 @@ Shell_t *sh_init(register int argc,register char *argv[], void(*userinit)(int))
*/
char *last, *cp=nv_getval(L_ARGNOD);
char buff[PATH_MAX+1];
- sh.shpath = 0;
- sfprintf(sh.strbuf,"/proc/%d/exe",getpid());
- if((n=readlink(sfstruse(sh.strbuf),buff,sizeof(buff)-1))>0)
+ shp->shpath = 0;
+ sfprintf(shp->strbuf,"/proc/%d/exe",getpid());
+ if((n=readlink(sfstruse(shp->strbuf),buff,sizeof(buff)-1))>0)
{
buff[n] = 0;
- sh.shpath = strdup(buff);
+ shp->shpath = strdup(buff);
}
else if((cp && (sh_type(cp)&SH_TYPE_SH)) || (argc>0 && strchr(cp= *argv,'/')))
{
if(*cp=='/')
- sh.shpath = strdup(cp);
+ shp->shpath = strdup(cp);
else if(cp = nv_getval(PWDNOD))
{
int offset = staktell();
@@ -960,7 +1078,7 @@ Shell_t *sh_init(register int argc,register char *argv[], void(*userinit)(int))
stakputc('/');
stakputs(argv[0]);
pathcanon(stakptr(offset),PATH_DOTDOT);
- sh.shpath = strdup(stakptr(offset));
+ shp->shpath = strdup(stakptr(offset));
stakseek(offset);
}
}
@@ -972,7 +1090,7 @@ Shell_t *sh_init(register int argc,register char *argv[], void(*userinit)(int))
#endif /* SHOPT_FS_3D */
astconfdisc(newconf);
#if SHOPT_TIMEOUT
- sh.st.tmout = SHOPT_TIMEOUT;
+ shp->st.tmout = SHOPT_TIMEOUT;
#endif /* SHOPT_TIMEOUT */
/* initialize jobs table */
job_clear();
@@ -990,33 +1108,33 @@ Shell_t *sh_init(register int argc,register char *argv[], void(*userinit)(int))
/* check for invocation as bash */
if(type&SH_TYPE_BASH)
{
- sh.userinit = userinit = bash_init;
+ shp->userinit = userinit = bash_init;
sh_onoption(SH_BASH);
sh_onstate(SH_PREINIT);
- (*userinit)(0);
+ (*userinit)(shp, 0);
sh_offstate(SH_PREINIT);
}
#endif
/* look for options */
- /* sh.st.dolc is $# */
- if((sh.st.dolc = sh_argopts(-argc,argv)) < 0)
+ /* shp->st.dolc is $# */
+ if((shp->st.dolc = sh_argopts(-argc,argv,shp)) < 0)
{
- sh.exitval = 2;
- sh_done(0);
+ shp->exitval = 2;
+ sh_done(shp,0);
}
opt_info.disc = 0;
- sh.st.dolv=argv+(argc-1)-sh.st.dolc;
- sh.st.dolv[0] = argv[0];
- if(sh.st.dolc < 1)
+ shp->st.dolv=argv+(argc-1)-shp->st.dolc;
+ shp->st.dolv[0] = argv[0];
+ if(shp->st.dolc < 1)
sh_onoption(SH_SFLAG);
if(!sh_isoption(SH_SFLAG))
{
- sh.st.dolc--;
- sh.st.dolv++;
+ shp->st.dolc--;
+ shp->st.dolv++;
#if _WINIX
{
char* name;
- name = sh.st.dolv[0];
+ name = shp->st.dolv[0];
if(name[1]==':' && (name[2]=='/' || name[2]=='\\'))
{
#if _lib_pathposix
@@ -1041,21 +1159,21 @@ Shell_t *sh_init(register int argc,register char *argv[], void(*userinit)(int))
#if SHOPT_PFSH
if (sh_isoption(SH_PFSH))
{
- struct passwd *pw = getpwuid(sh.userid);
+ struct passwd *pw = getpwuid(shp->userid);
if(pw)
- sh.user = strdup(pw->pw_name);
+ shp->user = strdup(pw->pw_name);
}
#endif
/* set[ug]id scripts require the -p flag */
- if(sh.userid!=sh.euserid || sh.groupid!=sh.egroupid)
+ if(shp->userid!=shp->euserid || shp->groupid!=shp->egroupid)
{
#if SHOPT_P_SUID
/* require sh -p to run setuid and/or setgid */
- if(!sh_isoption(SH_PRIVILEGED) && sh.euserid < SHOPT_P_SUID)
+ if(!sh_isoption(SH_PRIVILEGED) && shp->euserid < SHOPT_P_SUID)
{
- setuid(sh.euserid=sh.userid);
- setgid(sh.egroupid=sh.groupid);
+ setuid(shp->euserid=shp->userid);
+ setgid(shp->egroupid=shp->groupid);
}
else
#else
@@ -1063,7 +1181,7 @@ Shell_t *sh_init(register int argc,register char *argv[], void(*userinit)(int))
#endif /* SHOPT_P_SUID */
#ifdef SHELLMAGIC
/* careful of #! setuid scripts with name beginning with - */
- if(sh.login_sh && argv[1] && strcmp(argv[0],argv[1])==0)
+ if(shp->login_sh && argv[1] && strcmp(argv[0],argv[1])==0)
errormsg(SH_DICT,ERROR_exit(1),e_prohibited);
#endif /*SHELLMAGIC*/
}
@@ -1071,25 +1189,52 @@ Shell_t *sh_init(register int argc,register char *argv[], void(*userinit)(int))
sh_offoption(SH_PRIVILEGED);
/* shname for $0 in profiles and . scripts */
if(strmatch(argv[1],e_devfdNN))
- sh.shname = strdup(argv[0]);
+ shp->shname = strdup(argv[0]);
else
- sh.shname = strdup(sh.st.dolv[0]);
+ shp->shname = strdup(shp->st.dolv[0]);
/*
* return here for shell script execution
* but not for parenthesis subshells
*/
- error_info.id = strdup(sh.st.dolv[0]); /* error_info.id is $0 */
- sh.jmpbuffer = (void*)&sh.checkbase;
- sh_pushcontext(&sh.checkbase,SH_JMPSCRIPT);
- sh.st.self = &sh.global;
- sh.topscope = (Shscope_t*)sh.st.self;
+ error_info.id = strdup(shp->st.dolv[0]); /* error_info.id is $0 */
+ shp->jmpbuffer = (void*)&shp->checkbase;
+ sh_pushcontext(&shp->checkbase,SH_JMPSCRIPT);
+ shp->st.self = &shp->global;
+ shp->topscope = (Shscope_t*)shp->st.self;
sh_offstate(SH_INIT);
login_files[0] = (char*)e_profile;
login_files[1] = ".profile";
- sh.login_files = login_files;
- if(sh.userinit=userinit)
- (*userinit)(0);
- return(&sh);
+ shp->login_files = login_files;
+ shp->bltindata.version = SH_VERSION;
+ shp->bltindata.shp = shp;
+ shp->bltindata.shrun = sh_run;
+ shp->bltindata.shtrap = sh_trap;
+ shp->bltindata.shexit = sh_exit;
+ shp->bltindata.shbltin = sh_addbuiltin;
+#if _AST_VERSION >= 20080617L
+ shp->bltindata.shgetenv = getenv;
+ shp->bltindata.shsetenv = setenviron;
+ astintercept(&shp->bltindata,1);
+#endif
+#if 0
+#define NV_MKINTTYPE(x,y,z) nv_mkinttype(#x,sizeof(x),(x)-1<0,(y),(Namdisc_t*)z);
+ NV_MKINTTYPE(pid_t,"process id",0);
+ NV_MKINTTYPE(gid_t,"group id",0);
+ NV_MKINTTYPE(uid_t,"user id",0);
+ NV_MKINTTYPE(size_t,(const char*)0,0);
+ NV_MKINTTYPE(ssize_t,(const char*)0,0);
+ NV_MKINTTYPE(off_t,"offset in bytes",0);
+ NV_MKINTTYPE(ino_t,"\ai-\anode number",0);
+ NV_MKINTTYPE(mode_t,(const char*)0,&modedisc);
+ NV_MKINTTYPE(dev_t,"device id",0);
+ NV_MKINTTYPE(nlink_t,"hard link count",0);
+ NV_MKINTTYPE(blkcnt_t,"block count",0);
+ NV_MKINTTYPE(time_t,"seconds since the epoch",0);
+ nv_mkstat();
+#endif
+ if(shp->userinit=userinit)
+ (*userinit)(shp, 0);
+ return(shp);
}
Shell_t *sh_getinterp(void)
@@ -1102,25 +1247,41 @@ Shell_t *sh_getinterp(void)
*/
int sh_reinit(char *argv[])
{
+ Shell_t *shp = &sh;
Shopt_t opt;
- dtclear(sh.fun_tree);
- dtclose(sh.alias_tree);
- sh.alias_tree = inittree(&sh,shtab_aliases);
- sh.namespace = 0;
- sh.inuse_bits = 0;
- if(sh.userinit)
- (*sh.userinit)(1);
- if(sh.heredocs)
+ Namval_t *np,*npnext;
+ Dt_t *dp;
+ for(np=dtfirst(shp->fun_tree);np;np=npnext)
{
- sfclose(sh.heredocs);
- sh.heredocs = 0;
+ if((dp=shp->fun_tree)->walk)
+ dp = dp->walk;
+ npnext = (Namval_t*)dtnext(shp->fun_tree,np);
+ if(np>= shp->bltin_cmds && np < &shp->bltin_cmds[nbltins])
+ continue;
+ if(is_abuiltin(np) && nv_isattr(np,NV_EXPORT))
+ continue;
+ if(*np->nvname=='/')
+ continue;
+ nv_delete(np,dp,NV_NOFREE);
+ }
+ dtclose(shp->alias_tree);
+ shp->alias_tree = inittree(shp,shtab_aliases);
+ shp->last_root = shp->var_tree;
+ shp->namespace = 0;
+ shp->inuse_bits = 0;
+ if(shp->userinit)
+ (*shp->userinit)(shp, 1);
+ if(shp->heredocs)
+ {
+ sfclose(shp->heredocs);
+ shp->heredocs = 0;
}
/* remove locals */
sh_onstate(SH_INIT);
- nv_scan(sh.var_tree,sh_envnolocal,(void*)0,NV_EXPORT,0);
- nv_scan(sh.var_tree,sh_envnolocal,(void*)0,NV_ARRAY,NV_ARRAY);
+ nv_scan(shp->var_tree,sh_envnolocal,(void*)0,NV_EXPORT,0);
+ nv_scan(shp->var_tree,sh_envnolocal,(void*)0,NV_ARRAY,NV_ARRAY);
sh_offstate(SH_INIT);
- memset(sh.st.trapcom,0,(sh.st.trapmax+1)*sizeof(char*));
+ memset(shp->st.trapcom,0,(shp->st.trapmax+1)*sizeof(char*));
memset((void*)&opt,0,sizeof(opt));
if(sh_isoption(SH_TRACKALL))
on_option(&opt,SH_TRACKALL);
@@ -1132,18 +1293,19 @@ int sh_reinit(char *argv[])
on_option(&opt,SH_VI);
if(sh_isoption(SH_VIRAW))
on_option(&opt,SH_VIRAW);
- sh.options = opt;
+ shp->options = opt;
/* set up new args */
if(argv)
- sh.arglist = sh_argcreate(argv);
- if(sh.arglist)
- sh_argreset(sh.arglist,NIL(struct dolnod*));
- sh.envlist=0;
- sh.curenv = 0;
- sh.shname = error_info.id = strdup(sh.st.dolv[0]);
+ shp->arglist = sh_argcreate(argv);
+ if(shp->arglist)
+ sh_argreset(shp,shp->arglist,NIL(struct dolnod*));
+ shp->envlist=0;
+ shp->curenv = 0;
+ shp->shname = error_info.id = strdup(shp->st.dolv[0]);
sh_offstate(SH_FORKED);
- sh.fn_depth = sh.dot_depth = 0;
+ shp->fn_depth = shp->dot_depth = 0;
sh_sigreset(0);
+ *SHLVL->nvalue.ip +=1;
return(1);
}
@@ -1152,11 +1314,7 @@ int sh_reinit(char *argv[])
*/
Namfun_t *nv_cover(register Namval_t *np)
{
-#ifdef PATH_BFPATH
if(np==IFSNOD || np==PATHNOD || np==SHELLNOD || np==FPATHNOD || np==CDPNOD || np==SECONDS)
-#else
- if(np==IFSNOD || np==PATHNOD || np==SHELLNOD || np==SECONDS)
-#endif
return(np->nvfun);
#ifdef _hdr_locale
if(np==LCALLNOD || np==LCTYPENOD || np==LCMSGNOD || np==LCCOLLNOD || np==LCNUMNOD || np==LANGNOD)
@@ -1165,110 +1323,205 @@ Namfun_t *nv_cover(register Namval_t *np)
return(0);
}
-static Namtype_t typeset;
static const char *shdiscnames[] = { "tilde", 0};
+#ifdef SHOPT_STATS
+struct Stats
+{
+ Namfun_t hdr;
+ Shell_t *sh;
+ char *nodes;
+ int numnodes;
+ int current;
+};
+
+static Namval_t *next_stat(register Namval_t* np, Dt_t *root,Namfun_t *fp)
+{
+ struct Stats *sp = (struct Stats*)fp;
+ if(!root)
+ sp->current = 0;
+ else if(++sp->current>=sp->numnodes)
+ return(0);
+ return(nv_namptr(sp->nodes,sp->current));
+}
+
+static Namval_t *create_stat(Namval_t *np,const char *name,int flag,Namfun_t *fp)
+{
+ struct Stats *sp = (struct Stats*)fp;
+ register const char *cp=name;
+ register int i=0,n;
+ Namval_t *nq=0;
+ Shell_t *shp = sp->sh;
+ if(!name)
+ return(SH_STATS);
+ while((i=*cp++) && i != '=' && i != '+' && i!='[');
+ n = (cp-1) -name;
+ for(i=0; i < sp->numnodes; i++)
+ {
+ nq = nv_namptr(sp->nodes,i);
+ if((n==0||memcmp(name,nq->nvname,n)==0) && nq->nvname[n]==0)
+ goto found;
+ }
+ nq = 0;
+found:
+ if(nq)
+ {
+ fp->last = (char*)&name[n];
+ shp->last_table = SH_STATS;
+ }
+ else
+ errormsg(SH_DICT,ERROR_exit(1),e_notelem,n,name,nv_name(np));
+ return(nq);
+}
+
+static const Namdisc_t stat_disc =
+{
+ 0, 0, 0, 0, 0,
+ create_stat,
+ 0, 0,
+ next_stat
+};
+
+static char *name_stat(Namval_t *np, Namfun_t *fp)
+{
+ Shell_t *shp = sh_getinterp();
+ sfprintf(shp->strbuf,".sh.stats.%s",np->nvname);
+ return(sfstruse(shp->strbuf));
+}
+
+static const Namdisc_t stat_child_disc =
+{
+ 0,0,0,0,0,0,0,
+ name_stat
+};
+
+static Namfun_t stat_child_fun =
+{
+ &stat_child_disc, 1, 0, sizeof(Namfun_t)
+};
+
+static void stat_init(Shell_t *shp)
+{
+ int i,nstat = STAT_SUBSHELL+1;
+ struct Stats *sp = newof(0,struct Stats,1,nstat*NV_MINSZ);
+ Namval_t *np;
+ sp->numnodes = nstat;
+ sp->nodes = (char*)(sp+1);
+ shp->stats = (int*)calloc(sizeof(int*),nstat);
+ sp->sh = shp;
+ for(i=0; i < nstat; i++)
+ {
+ np = nv_namptr(sp->nodes,i);
+ np->nvfun = &stat_child_fun;
+ np->nvname = (char*)shtab_stats[i].sh_name;
+ nv_onattr(np,NV_RDONLY|NV_MINIMAL|NV_NOFREE|NV_INTEGER);
+ nv_setsize(np,10);
+ np->nvalue.ip = &shp->stats[i];
+ }
+ sp->hdr.dsize = sizeof(struct Stats) + nstat*(sizeof(int)+NV_MINSZ);
+ sp->hdr.disc = &stat_disc;
+ nv_stack(SH_STATS,&sp->hdr);
+ sp->hdr.nofree = 1;
+ nv_setvtree(SH_STATS);
+}
+#else
+# define stat_init(x)
+#endif /* SHOPT_STATS */
+
/*
* Initialize the shell name and alias table
*/
static Init_t *nv_init(Shell_t *shp)
{
+ static int shlvl=0;
Namval_t *np;
register Init_t *ip;
double d=0;
ip = newof(0,Init_t,1,0);
if(!ip)
return(0);
+ shp->nvfun.last = (char*)shp;
+ shp->nvfun.nofree = 1;
ip->sh = shp;
shp->var_base = shp->var_tree = inittree(shp,shtab_variables);
+ SHLVL->nvalue.ip = &shlvl;
ip->IFS_init.hdr.disc = &IFS_disc;
ip->IFS_init.hdr.nofree = 1;
- ip->IFS_init.sh = shp;
- ip->PATH_init.hdr.disc = &RESTRICTED_disc;
- ip->PATH_init.hdr.nofree = 1;
- ip->PATH_init.sh = shp;
-#ifdef PATH_BFPATH
- ip->FPATH_init.hdr.disc = &RESTRICTED_disc;
- ip->FPATH_init.hdr.nofree = 1;
- ip->FPATH_init.sh = shp;
- ip->CDPATH_init.hdr.disc = &CDPATH_disc;
- ip->CDPATH_init.hdr.nofree = 1;
- ip->CDPATH_init.sh = shp;
-#endif
- ip->SHELL_init.hdr.disc = &RESTRICTED_disc;
- ip->SHELL_init.sh = shp;
- ip->SHELL_init.hdr.nofree = 1;
- ip->ENV_init.hdr.disc = &RESTRICTED_disc;
- ip->ENV_init.hdr.nofree = 1;
- ip->ENV_init.sh = shp;
- ip->VISUAL_init.hdr.disc = &EDITOR_disc;
- ip->VISUAL_init.hdr.nofree = 1;
- ip->VISUAL_init.sh = shp;
- ip->EDITOR_init.hdr.disc = &EDITOR_disc;
- ip->EDITOR_init.hdr.nofree = 1;
- ip->EDITOR_init.sh = shp;
- ip->OPTINDEX_init.hdr.disc = &OPTINDEX_disc;
- ip->OPTINDEX_init.hdr.nofree = 1;
- ip->OPTINDEX_init.sh = shp;
+ ip->PATH_init.disc = &RESTRICTED_disc;
+ ip->PATH_init.nofree = 1;
+ ip->FPATH_init.disc = &RESTRICTED_disc;
+ ip->FPATH_init.nofree = 1;
+ ip->CDPATH_init.disc = &CDPATH_disc;
+ ip->CDPATH_init.nofree = 1;
+ ip->SHELL_init.disc = &RESTRICTED_disc;
+ ip->SHELL_init.nofree = 1;
+ ip->ENV_init.disc = &RESTRICTED_disc;
+ ip->ENV_init.nofree = 1;
+ ip->VISUAL_init.disc = &EDITOR_disc;
+ ip->VISUAL_init.nofree = 1;
+ ip->EDITOR_init.disc = &EDITOR_disc;
+ ip->EDITOR_init.nofree = 1;
+ ip->HISTFILE_init.disc = &HISTFILE_disc;
+ ip->HISTFILE_init.nofree = 1;
+ ip->HISTSIZE_init.disc = &HISTFILE_disc;
+ ip->HISTSIZE_init.nofree = 1;
+ ip->OPTINDEX_init.disc = &OPTINDEX_disc;
+ ip->OPTINDEX_init.nofree = 1;
ip->SECONDS_init.hdr.disc = &SECONDS_disc;
ip->SECONDS_init.hdr.nofree = 1;
- ip->SECONDS_init.sh = shp;
ip->RAND_init.hdr.disc = &RAND_disc;
ip->RAND_init.hdr.nofree = 1;
ip->SH_MATCH_init.hdr.disc = &SH_MATCH_disc;
ip->SH_MATCH_init.hdr.nofree = 1;
- ip->LINENO_init.hdr.disc = &LINENO_disc;
- ip->LINENO_init.hdr.nofree = 1;
- ip->LINENO_init.sh = shp;
- ip->L_ARG_init.hdr.disc = &L_ARG_disc;
- ip->L_ARG_init.hdr.nofree = 1;
+ ip->SH_VERSION_init.disc = &SH_VERSION_disc;
+ ip->SH_VERSION_init.nofree = 1;
+ ip->LINENO_init.disc = &LINENO_disc;
+ ip->LINENO_init.nofree = 1;
+ ip->L_ARG_init.disc = &L_ARG_disc;
+ ip->L_ARG_init.nofree = 1;
#ifdef _hdr_locale
- ip->LC_TYPE_init.hdr.disc = &LC_disc;
- ip->LC_TYPE_init.hdr.nofree = 1;
- ip->LC_NUM_init.hdr.disc = &LC_disc;
- ip->LC_NUM_init.hdr.nofree = 1;
- ip->LC_COLL_init.hdr.disc = &LC_disc;
- ip->LC_COLL_init.hdr.nofree = 1;
- ip->LC_MSG_init.hdr.disc = &LC_disc;
- ip->LC_MSG_init.hdr.nofree = 1;
- ip->LC_ALL_init.hdr.disc = &LC_disc;
- ip->LC_ALL_init.hdr.nofree = 1;
- ip->LANG_init.hdr.disc = &LC_disc;
- ip->LANG_init.hdr.nofree = 1;
- ip->LC_TYPE_init.sh = shp;
- ip->LC_NUM_init.sh = shp;
- ip->LC_COLL_init.sh = shp;
- ip->LC_MSG_init.sh = shp;
- ip->LANG_init.sh = shp;
+ ip->LC_TYPE_init.disc = &LC_disc;
+ ip->LC_TYPE_init.nofree = 1;
+ ip->LC_NUM_init.disc = &LC_disc;
+ ip->LC_NUM_init.nofree = 1;
+ ip->LC_COLL_init.disc = &LC_disc;
+ ip->LC_COLL_init.nofree = 1;
+ ip->LC_MSG_init.disc = &LC_disc;
+ ip->LC_MSG_init.nofree = 1;
+ ip->LC_ALL_init.disc = &LC_disc;
+ ip->LC_ALL_init.nofree = 1;
+ ip->LANG_init.disc = &LC_disc;
+ ip->LANG_init.nofree = 1;
#endif /* _hdr_locale */
nv_stack(IFSNOD, &ip->IFS_init.hdr);
- nv_stack(PATHNOD, &ip->PATH_init.hdr);
-#ifdef PATH_BFPATH
- nv_stack(FPATHNOD, &ip->FPATH_init.hdr);
- nv_stack(CDPNOD, &ip->CDPATH_init.hdr);
-#endif
- nv_stack(SHELLNOD, &ip->SHELL_init.hdr);
- nv_stack(ENVNOD, &ip->ENV_init.hdr);
- nv_stack(VISINOD, &ip->VISUAL_init.hdr);
- nv_stack(EDITNOD, &ip->EDITOR_init.hdr);
- nv_stack(OPTINDNOD, &ip->OPTINDEX_init.hdr);
+ nv_stack(PATHNOD, &ip->PATH_init);
+ nv_stack(FPATHNOD, &ip->FPATH_init);
+ nv_stack(CDPNOD, &ip->CDPATH_init);
+ nv_stack(SHELLNOD, &ip->SHELL_init);
+ nv_stack(ENVNOD, &ip->ENV_init);
+ nv_stack(VISINOD, &ip->VISUAL_init);
+ nv_stack(EDITNOD, &ip->EDITOR_init);
+ nv_stack(HISTFILE, &ip->HISTFILE_init);
+ nv_stack(HISTSIZE, &ip->HISTSIZE_init);
+ nv_stack(OPTINDNOD, &ip->OPTINDEX_init);
nv_stack(SECONDS, &ip->SECONDS_init.hdr);
- nv_stack(L_ARGNOD, &ip->L_ARG_init.hdr);
- nv_putval(SECONDS, (char*)&d, NV_INTEGER|NV_DOUBLE);
+ nv_stack(L_ARGNOD, &ip->L_ARG_init);
+ nv_putval(SECONDS, (char*)&d, NV_DOUBLE);
nv_stack(RANDNOD, &ip->RAND_init.hdr);
d = (shp->pid&RANDMASK);
- nv_putval(RANDNOD, (char*)&d, NV_INTEGER|NV_DOUBLE);
- nv_stack(LINENO, &ip->LINENO_init.hdr);
+ nv_putval(RANDNOD, (char*)&d, NV_DOUBLE);
+ nv_stack(LINENO, &ip->LINENO_init);
nv_putsub(SH_MATCHNOD,(char*)0,10);
nv_onattr(SH_MATCHNOD,NV_RDONLY);
nv_stack(SH_MATCHNOD, &ip->SH_MATCH_init.hdr);
+ nv_stack(SH_VERSIONNOD, &ip->SH_VERSION_init);
#ifdef _hdr_locale
- nv_stack(LCTYPENOD, &ip->LC_TYPE_init.hdr);
- nv_stack(LCALLNOD, &ip->LC_ALL_init.hdr);
- nv_stack(LCMSGNOD, &ip->LC_MSG_init.hdr);
- nv_stack(LCCOLLNOD, &ip->LC_COLL_init.hdr);
- nv_stack(LCNUMNOD, &ip->LC_NUM_init.hdr);
- nv_stack(LANGNOD, &ip->LANG_init.hdr);
+ nv_stack(LCTYPENOD, &ip->LC_TYPE_init);
+ nv_stack(LCALLNOD, &ip->LC_ALL_init);
+ nv_stack(LCMSGNOD, &ip->LC_MSG_init);
+ nv_stack(LCCOLLNOD, &ip->LC_COLL_init);
+ nv_stack(LCNUMNOD, &ip->LC_NUM_init);
+ nv_stack(LANGNOD, &ip->LANG_init);
#endif /* _hdr_locale */
(PPIDNOD)->nvalue.lp = (&shp->ppid);
(TMOUTNOD)->nvalue.lp = (&shp->st.tmout);
@@ -1278,12 +1531,6 @@ static Init_t *nv_init(Shell_t *shp)
shp->alias_tree = inittree(shp,shtab_aliases);
shp->track_tree = dtopen(&_Nvdisc,Dtset);
shp->bltin_tree = inittree(shp,(const struct shtable2*)shtab_builtins);
- typeset.shp = shp;
- typeset.optstring = sh_opttypeset;
- nv_search("typeset",shp->bltin_tree,0)->nvfun = (void*)&typeset;
-#if SHOPT_BASH
- nv_search("local",shp->bltin_tree,0)->nvfun = (void*)&typeset;
-#endif
shp->fun_tree = dtopen(&_Nvdisc,Dtoset);
dtview(shp->fun_tree,shp->bltin_tree);
#if SHOPT_NAMESPACE
@@ -1293,8 +1540,15 @@ static Init_t *nv_init(Shell_t *shp)
nv_putval(np,".sh.global",NV_RDONLY|NV_NOFREE);
nv_stack(np, &NSPACE_init);
#endif /* SHOPT_NAMESPACE */
- np = nv_mount(DOTSHNOD, "type", dtopen(&_Nvdisc,Dtoset));
+ np = nv_mount(DOTSHNOD, "type", shp->typedict=dtopen(&_Nvdisc,Dtoset));
nv_adddisc(DOTSHNOD, shdiscnames, (Namval_t**)0);
+ SH_LINENO->nvalue.ip = &shp->st.lineno;
+ VERSIONNOD->nvalue.nrp = newof(0,struct Namref,1,0);
+ VERSIONNOD->nvalue.nrp->np = SH_VERSIONNOD;
+ VERSIONNOD->nvalue.nrp->root = nv_dict(DOTSHNOD);
+ VERSIONNOD->nvalue.nrp->table = DOTSHNOD;
+ nv_onattr(VERSIONNOD,NV_RDONLY|NV_REF);
+ stat_init(shp);
return(ip);
}
@@ -1313,10 +1567,17 @@ static Dt_t *inittree(Shell_t *shp,const struct shtable2 *name_vals)
n++;
np = (Namval_t*)calloc(n,sizeof(Namval_t));
if(!shp->bltin_nodes)
+ {
shp->bltin_nodes = np;
+ shp->bltin_nnodes = n;
+ }
else if(name_vals==(const struct shtable2*)shtab_builtins)
+ {
shp->bltin_cmds = np;
+ nbltins = n;
+ }
base_treep = treep = dtopen(&_Nvdisc,Dtoset);
+ treep->user = (void*)shp;
for(tp=name_vals;*tp->sh_name;tp++,np++)
{
if((np->nvname = strrchr(tp->sh_name,'.')) && np->nvname!=((char*)tp->sh_name))
@@ -1330,7 +1591,11 @@ static Dt_t *inittree(Shell_t *shp,const struct shtable2 *name_vals)
if(name_vals==(const struct shtable2*)shtab_builtins)
np->nvalue.bfp = ((struct shtable3*)tp)->sh_value;
else
+ {
+ if(name_vals == shtab_variables)
+ np->nvfun = &sh.nvfun;
np->nvalue.cp = (char*)tp->sh_value;
+ }
nv_setattr(np,tp->sh_number);
if(nv_istable(np))
nv_mount(np,(const char*)0,dict=dtopen(&_Nvdisc,Dtoset));
@@ -1372,6 +1637,11 @@ static void env_init(Shell_t *shp)
np->nvenv = cp;
nv_close(np);
}
+ else /* swap with fron */
+ {
+ ep[-1] = environ[shp->nenv];
+ environ[shp->nenv++] = cp;
+ }
}
while(cp=next)
{
@@ -1412,7 +1682,7 @@ static void env_init(Shell_t *shp)
}
}
#ifdef _ENV_H
- env_delete(sh.env,e_envmarker);
+ env_delete(shp->env,e_envmarker);
#endif
if(nv_isnull(PWDNOD) || nv_isattr(PWDNOD,NV_TAGGED))
{
diff --git a/usr/src/lib/libshell/common/sh/io.c b/usr/src/lib/libshell/common/sh/io.c
index a14a941942..50fa35561f 100644
--- a/usr/src/lib/libshell/common/sh/io.c
+++ b/usr/src/lib/libshell/common/sh/io.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -79,10 +79,16 @@ static int (*fdnotify)(int,int);
# define htonl(x) (x)
# endif
# if _pipe_socketpair
+# ifndef SHUT_RD
+# define SHUT_RD 0
+# endif
+# ifndef SHUT_WR
+# define SHUT_WR 1
+# endif
# if _socketpair_shutdown_mode
-# define pipe(v) ((socketpair(AF_UNIX,SOCK_STREAM,0,v)<0||shutdown((v)[0],1)<0||fchmod((v)[0],S_IRUSR)<0||shutdown((v)[1],0)<0||fchmod((v)[1],S_IWUSR)<0)?(-1):0)
+# define pipe(v) ((socketpair(AF_UNIX,SOCK_STREAM,0,v)<0||shutdown((v)[1],SHUT_RD)<0||fchmod((v)[1],S_IWUSR)<0||shutdown((v)[0],SHUT_WR)<0||fchmod((v)[0],S_IRUSR)<0)?(-1):0)
# else
-# define pipe(v) ((socketpair(AF_UNIX,SOCK_STREAM,0,v)<0||shutdown((v)[0],1)<0||shutdown((v)[1],0)<0)?(-1):0)
+# define pipe(v) ((socketpair(AF_UNIX,SOCK_STREAM,0,v)<0||shutdown((v)[1],SHUT_RD)<0||shutdown((v)[0],SHUT_WR)<0)?(-1):0)
# endif
# endif
@@ -308,6 +314,7 @@ struct fdsave
int orig_fd; /* original file descriptor */
int save_fd; /* saved file descriptor */
int subshell; /* saved for subshell */
+ char *tname; /* name used with >; */
};
static int subexcept(Sfio_t*, int, void*, Sfdisc_t*);
@@ -319,11 +326,11 @@ static ssize_t slowread(Sfio_t*, void*, size_t, Sfdisc_t*);
static ssize_t subread(Sfio_t*, void*, size_t, Sfdisc_t*);
static ssize_t tee_write(Sfio_t*,const void*,size_t,Sfdisc_t*);
static int io_prompt(Sfio_t*,int);
-static int io_heredoc(register struct ionod*, const char*, int);
-static void sftrack(Sfio_t*,int,int);
+static int io_heredoc(Shell_t*,register struct ionod*, const char*, int);
+static void sftrack(Sfio_t*,int,void*);
static const Sfdisc_t eval_disc = { NULL, NULL, NULL, eval_exceptf, NULL};
static Sfdisc_t tee_disc = {NULL,tee_write,NULL,NULL,NULL};
-static Sfio_t *subopen(Sfio_t*, off_t, long);
+static Sfio_t *subopen(Shell_t *,Sfio_t*, off_t, long);
static const Sfdisc_t sub_disc = { subread, 0, 0, subexcept, 0 };
struct subfile
@@ -376,36 +383,80 @@ static short filemapsize;
/* ======== input output and file copying ======== */
-void sh_ioinit(void)
+void sh_ioinit(Shell_t *shp)
{
register int n;
filemapsize = 8;
- filemap = (struct fdsave*)malloc(8*sizeof(struct fdsave));
+ filemap = (struct fdsave*)malloc(filemapsize*sizeof(struct fdsave));
#if SHOPT_FASTPIPE
- n = sh.lim.open_max+2;
+ n = shp->lim.open_max+2;
#else
- n = sh.lim.open_max;
+ n = shp->lim.open_max;
#endif /* SHOPT_FASTPIPE */
- sh.fdstatus = (unsigned char*)malloc((unsigned)n);
- memset((char*)sh.fdstatus,0,n);
- sh.fdptrs = (int**)malloc(n*sizeof(int*));
- memset((char*)sh.fdptrs,0,n*sizeof(int*));
- sh.sftable = (Sfio_t**)malloc(n*sizeof(Sfio_t*));
- memset((char*)sh.sftable,0,n*sizeof(Sfio_t*));
- sh.sftable[0] = sfstdin;
- sh.sftable[1] = sfstdout;
- sh.sftable[2] = sfstderr;
+ shp->fdstatus = (unsigned char*)malloc((unsigned)n);
+ memset((char*)shp->fdstatus,0,n);
+ shp->fdptrs = (int**)malloc(n*sizeof(int*));
+ memset((char*)shp->fdptrs,0,n*sizeof(int*));
+ shp->sftable = (Sfio_t**)malloc(n*sizeof(Sfio_t*));
+ memset((char*)shp->sftable,0,n*sizeof(Sfio_t*));
+ shp->sftable[0] = sfstdin;
+ shp->sftable[1] = sfstdout;
+ shp->sftable[2] = sfstderr;
sfnotify(sftrack);
- sh_iostream(0);
+ sh_iostream(shp,0);
/* all write steams are in the same pool and share outbuff */
- sh.outpool = sfopen(NIL(Sfio_t*),NIL(char*),"sw"); /* pool identifier */
- sh.outbuff = (char*)malloc(IOBSIZE);
- sh.errbuff = (char*)malloc(IOBSIZE/4);
- sfsetbuf(sfstderr,sh.errbuff,IOBSIZE/4);
- sfsetbuf(sfstdout,sh.outbuff,IOBSIZE);
- sfpool(sfstdout,sh.outpool,SF_WRITE);
- sfpool(sfstderr,sh.outpool,SF_WRITE);
+ shp->outpool = sfopen(NIL(Sfio_t*),NIL(char*),"sw"); /* pool identifier */
+ shp->outbuff = (char*)malloc(IOBSIZE);
+ shp->errbuff = (char*)malloc(IOBSIZE/4);
+ sfsetbuf(sfstderr,shp->errbuff,IOBSIZE/4);
+ sfsetbuf(sfstdout,shp->outbuff,IOBSIZE);
+ sfpool(sfstdout,shp->outpool,SF_WRITE);
+ sfpool(sfstderr,shp->outpool,SF_WRITE);
sfset(sfstdout,SF_LINE,0);
+ sfset(sfstderr,SF_LINE,0);
+ sfset(sfstdin,SF_SHARE|SF_PUBLIC,1);
+}
+
+/*
+ * Handle output stream exceptions
+ */
+static int outexcept(register Sfio_t *iop,int type,void *data,Sfdisc_t *handle)
+{
+ static int active = 0;
+
+ NOT_USED(handle);
+ if(type==SF_DPOP || type==SF_FINAL)
+ free((void*)handle);
+ else if(type==SF_WRITE && (*(ssize_t*)data)<0 && sffileno(iop)!=2)
+ switch (errno)
+ {
+ case EINTR:
+ case EPIPE:
+#ifdef ECONNRESET
+ case ECONNRESET:
+#endif
+#ifdef ESHUTDOWN
+ case ESHUTDOWN:
+#endif
+ break;
+ default:
+ if(!active)
+ {
+ int mode = ((struct checkpt*)sh.jmplist)->mode;
+ int save = errno;
+ active = 1;
+ ((struct checkpt*)sh.jmplist)->mode = 0;
+ sfpurge(iop);
+ sfpool(iop,NIL(Sfio_t*),SF_WRITE);
+ errno = save;
+ errormsg(SH_DICT,ERROR_system(1),e_badwrite,sffileno(iop));
+ active = 0;
+ ((struct checkpt*)sh.jmplist)->mode = mode;
+ sh_exit(1);
+ }
+ return(-1);
+ }
+ return(0);
}
/*
@@ -415,15 +466,16 @@ void sh_ioinit(void)
* For output streams, the buffer is set to sh.output and put into
* the sh.outpool synchronization pool
*/
-Sfio_t *sh_iostream(register int fd)
+Sfio_t *sh_iostream(Shell_t *shp, register int fd)
{
register Sfio_t *iop;
- register int status = sh_iocheckfd(fd);
+ register int status = sh_iocheckfd(shp,fd);
register int flags = SF_WRITE;
char *bp;
+ Sfdisc_t *dp;
#if SHOPT_FASTPIPE
- if(fd>=sh.lim.open_max)
- return(sh.sftable[fd]);
+ if(fd>=shp->lim.open_max)
+ return(shp->sftable[fd]);
#endif /* SHOPT_FASTPIPE */
if(status==IOCLOSE)
{
@@ -447,69 +499,71 @@ Sfio_t *sh_iostream(register int fd)
flags &= ~SF_WRITE;
}
else
- bp = sh.outbuff;
+ bp = shp->outbuff;
if(status&IODUP)
flags |= SF_SHARE|SF_PUBLIC;
- if((iop = sh.sftable[fd]) && sffileno(iop)>=0)
+ if((iop = shp->sftable[fd]) && sffileno(iop)>=0)
sfsetbuf(iop, bp, IOBSIZE);
else if(!(iop=sfnew((fd<=2?iop:0),bp,IOBSIZE,fd,flags)))
return(NIL(Sfio_t*));
+ dp = newof(0,Sfdisc_t,1,0);
if(status&IOREAD)
{
- Sfdisc_t *dp;
sfset(iop,SF_MALLOC,1);
+ if(!(status&IOWRITE))
+ sfset(iop,SF_IOCHECK,1);
+ dp->exceptf = slowexcept;
+ if(status&IOTTY)
+ dp->readf = slowread;
+ else if(status&IONOSEEK)
{
- dp = newof(0,Sfdisc_t,1,0);
- dp->exceptf = slowexcept;
- if(status&IOTTY)
- dp->readf = slowread;
- else if(status&IONOSEEK)
- {
- dp->readf = piperead;
- sfset(iop, SF_IOINTR,1);
- }
- else
- dp->readf = 0;
- dp->seekf = 0;
- dp->writef = 0;
- sfdisc(iop,dp);
+ dp->readf = piperead;
+ sfset(iop, SF_IOINTR,1);
}
+ else
+ dp->readf = 0;
+ dp->seekf = 0;
+ dp->writef = 0;
}
else
- sfpool(iop,sh.outpool,SF_WRITE);
- sh.sftable[fd] = iop;
+ {
+ dp->exceptf = outexcept;
+ sfpool(iop,shp->outpool,SF_WRITE);
+ }
+ sfdisc(iop,dp);
+ shp->sftable[fd] = iop;
return(iop);
}
/*
* preserve the file descriptor or stream by moving it
*/
-static void io_preserve(register Sfio_t *sp, register int f2)
+static void io_preserve(Shell_t* shp, register Sfio_t *sp, register int f2)
{
register int fd;
if(sp)
fd = sfsetfd(sp,10);
else
fd = sh_fcntl(f2,F_DUPFD,10);
- if(f2==sh.infd)
- sh.infd = fd;
+ if(f2==shp->infd)
+ shp->infd = fd;
if(fd<0)
errormsg(SH_DICT,ERROR_system(1),e_toomany);
- if(sh.fdptrs[fd]=sh.fdptrs[f2])
+ if(shp->fdptrs[fd]=shp->fdptrs[f2])
{
if(f2==job.fd)
job.fd=fd;
- *sh.fdptrs[fd] = fd;
- sh.fdptrs[f2] = 0;
+ *shp->fdptrs[fd] = fd;
+ shp->fdptrs[f2] = 0;
}
- sh.sftable[fd] = sp;
- sh.fdstatus[fd] = sh.fdstatus[f2];
+ shp->sftable[fd] = sp;
+ shp->fdstatus[fd] = shp->fdstatus[f2];
if(fcntl(f2,F_GETFD,0)&1)
{
fcntl(fd,F_SETFD,FD_CLOEXEC);
- sh.fdstatus[fd] |= IOCLEX;
+ shp->fdstatus[fd] |= IOCLEX;
}
- sh.sftable[f2] = 0;
+ shp->sftable[f2] = 0;
}
/*
@@ -518,39 +572,39 @@ static void io_preserve(register Sfio_t *sp, register int f2)
* The original stream <f1> is closed.
* The new file descriptor <f2> is returned;
*/
-int sh_iorenumber(register int f1,register int f2)
+int sh_iorenumber(Shell_t *shp, register int f1,register int f2)
{
- register Sfio_t *sp = sh.sftable[f2];
+ register Sfio_t *sp = shp->sftable[f2];
if(f1!=f2)
{
/* see whether file descriptor is in use */
if(sh_inuse(f2) || (f2>2 && sp))
{
- if(!(sh.inuse_bits&(1<<f2)))
- io_preserve(sp,f2);
+ if(!(shp->inuse_bits&(1<<f2)))
+ io_preserve(shp,sp,f2);
sp = 0;
}
else if(f2==0)
- sh.st.ioset = 1;
+ shp->st.ioset = 1;
sh_close(f2);
if(f2<=2 && sp)
{
- register Sfio_t *spnew = sh_iostream(f1);
- sh.fdstatus[f2] = (sh.fdstatus[f1]&~IOCLEX);
+ register Sfio_t *spnew = sh_iostream(shp,f1);
+ shp->fdstatus[f2] = (shp->fdstatus[f1]&~IOCLEX);
sfsetfd(spnew,f2);
sfswap(spnew,sp);
sfset(sp,SF_SHARE|SF_PUBLIC,1);
}
else
{
- sh.fdstatus[f2] = (sh.fdstatus[f1]&~IOCLEX);
+ shp->fdstatus[f2] = (shp->fdstatus[f1]&~IOCLEX);
if((f2 = sh_fcntl(f1,F_DUPFD, f2)) < 0)
errormsg(SH_DICT,ERROR_system(1),e_file+4);
else if(f2 <= 2)
- sh_iostream(f2);
+ sh_iostream(shp,f2);
}
if(sp)
- sh.sftable[f1] = 0;
+ shp->sftable[f1] = 0;
sh_close(f1);
}
return(f2);
@@ -582,6 +636,8 @@ int sh_close(register int fd)
return(r);
}
+#ifdef O_SERVICE
+
static int
onintr(struct addrinfo* addr, void* handle)
{
@@ -598,11 +654,14 @@ onintr(struct addrinfo* addr, void* handle)
return 0;
}
+#endif
+
/*
* Mimic open(2) with checks for pseudo /dev/ files.
*/
int sh_open(register const char *path, int flags, ...)
{
+ Shell_t *shp = &sh;
register int fd = -1;
mode_t mode;
char *e;
@@ -658,7 +717,7 @@ int sh_open(register const char *path, int flags, ...)
}
if (fd >= 0)
{
- if((mode=sh_iocheckfd(fd))==IOCLOSE)
+ if((mode=sh_iocheckfd(shp,fd))==IOCLOSE)
return(-1);
flags &= O_ACCMODE;
if(!(mode&IOWRITE) && ((flags==O_WRONLY) || (flags==O_RDWR)))
@@ -748,13 +807,13 @@ static int pat_line(const regex_t* rp, const char *buff, register size_t n)
return(cp-buff);
}
-static int io_patseek(regex_t *rp, Sfio_t* sp, int flags)
+static int io_patseek(Shell_t *shp, regex_t *rp, Sfio_t* sp, int flags)
{
char *cp, *match;
- int r, fd=sffileno(sp), close_exec = sh.fdstatus[fd]&IOCLEX;
+ int r, fd=sffileno(sp), close_exec = shp->fdstatus[fd]&IOCLEX;
int was_share,s=(PIPE_BUF>SF_BUFSIZE?SF_BUFSIZE:PIPE_BUF);
size_t n,m;
- sh.fdstatus[sffileno(sp)] |= IOCLEX;
+ shp->fdstatus[sffileno(sp)] |= IOCLEX;
if(fd==0)
was_share = sfset(sp,SF_SHARE,1);
while((cp=sfreserve(sp, -s, SF_LOCKR)) || (cp=sfreserve(sp,SF_UNBOUND, SF_LOCKR)))
@@ -779,20 +838,20 @@ static int io_patseek(regex_t *rp, Sfio_t* sp, int flags)
break;
}
if(!close_exec)
- sh.fdstatus[sffileno(sp)] &= ~IOCLEX;
+ shp->fdstatus[sffileno(sp)] &= ~IOCLEX;
if(fd==0 && !(was_share&SF_SHARE))
sfset(sp, SF_SHARE,0);
return(0);
}
-static Sfoff_t file_offset(int fn, char *fname)
+static Sfoff_t file_offset(Shell_t *shp, int fn, char *fname)
{
- Sfio_t *sp = sh.sftable[fn];
+ Sfio_t *sp = shp->sftable[fn];
char *cp;
Sfoff_t off;
struct Eof endf;
- Namval_t *mp = nv_open("EOF",sh.var_tree,0);
- Namval_t *pp = nv_open("CUR",sh.var_tree,0);
+ Namval_t *mp = nv_open("EOF",shp->var_tree,0);
+ Namval_t *pp = nv_open("CUR",shp->var_tree,0);
memset(&endf,0,sizeof(struct Eof));
endf.fd = fn;
endf.hdr.disc = &EOF_disc;
@@ -823,6 +882,48 @@ void sh_pclose(register int pv[])
pv[0] = pv[1] = -1;
}
+static char *io_usename(char *name, int *perm, int mode)
+{
+ struct stat statb;
+ char *tname, *sp, *ep;
+ int fd,len,n=0;
+ if(mode==0)
+ {
+ if((fd = sh_open(name,O_RDONLY,0)) > 0)
+ {
+ if(fstat(fd,&statb) < 0)
+ return(0);
+ if(!S_ISREG(statb.st_mode))
+ return(0);
+ *perm = statb.st_mode&(RW_ALL|(S_IXUSR|S_IXGRP|S_IXOTH));
+ }
+ else if(fd < 0 && errno!=ENOENT)
+ return(0);
+ }
+ tname = sp = (char*)stakalloc((len=strlen(name)) + 5);
+ if(ep = strrchr(name,'/'))
+ {
+ memcpy(sp,name,n=++ep-name);
+ len -=n;
+ sp += n;
+ }
+ else
+ ep = name;
+ *sp++ = '.';
+ memcpy(sp,ep,len);
+ strcpy(sp+len,".tmp");
+ switch(mode)
+ {
+ case 1:
+ rename(tname,name);
+ break;
+ case 2:
+ unlink(tname);
+ break;
+ }
+ return(tname);
+}
+
/*
* I/O redirection
* flag = 0 if files are to be restored
@@ -830,7 +931,7 @@ void sh_pclose(register int pv[])
* flag = 3 when called from $( < ...), just open file and return
* flag = SH_SHOWME for trace only
*/
-int sh_redirect(struct ionod *iop, int flag)
+int sh_redirect(Shell_t *shp,struct ionod *iop, int flag)
{
Sfoff_t off;
register char *fname;
@@ -839,8 +940,8 @@ int sh_redirect(struct ionod *iop, int flag)
int o_mode; /* mode flag for open */
static char io_op[7]; /* used for -x trace info */
int clexec=0, fn, traceon;
- int r, indx = sh.topfd;
- char *after="", *trace = sh.st.trap[SH_DEBUGTRAP];
+ int r, indx = shp->topfd, perm= -1;
+ char *tname=0, *after="", *trace = shp->st.trap[SH_DEBUGTRAP];
Namval_t *np=0;
if(flag==2)
clexec = 1;
@@ -850,6 +951,8 @@ int sh_redirect(struct ionod *iop, int flag)
{
iof=iop->iofile;
fn = (iof&IOUFD);
+ if(fn==1 && shp->subshell && (flag==2 || (sfset(sfstdout,0,0)&SF_STRING)))
+ sh_subfork();
io_op[0] = '0'+(iof&IOUFD);
if(iof&IOPUT)
{
@@ -873,19 +976,20 @@ int sh_redirect(struct ionod *iop, int flag)
memset(ap, 0, ARGVAL);
ap->argflag = ARG_MAC;
strcpy(ap->argval,iop->ioname);
- fname=sh_macpat(ap,(iof&IOARITH)?ARG_ARITH:ARG_EXP);
+ fname=sh_macpat(shp,ap,(iof&IOARITH)?ARG_ARITH:ARG_EXP);
}
else
- fname=sh_mactrim(fname,(!sh_isoption(SH_NOGLOB)&&sh_isoption(SH_INTERACTIVE))?2:0);
+ fname=sh_mactrim(shp,fname,(!sh_isoption(SH_NOGLOB)&&sh_isoption(SH_INTERACTIVE))?2:0);
}
errno=0;
+ np = 0;
if(iop->iovname)
{
- np = nv_open(iop->iovname,sh.var_tree,NV_NOASSIGN|NV_VARNAME);
+ np = nv_open(iop->iovname,shp->var_tree,NV_NOASSIGN|NV_VARNAME);
if(nv_isattr(np,NV_RDONLY))
errormsg(SH_DICT,ERROR_exit(1),e_readonly, nv_name(np));
io_op[0] = '}';
- if((iof&IOMOV) && *fname=='-')
+ if((iof&IOLSEEK) || ((iof&IOMOV) && *fname=='-'))
fn = nv_getnum(np);
}
if(iof&IOLSEEK)
@@ -906,7 +1010,7 @@ int sh_redirect(struct ionod *iop, int flag)
{
if(traceon)
sfputr(sfstderr,io_op,'<');
- fd = io_heredoc(iop,fname,traceon);
+ fd = io_heredoc(shp,iop,fname,traceon);
if(traceon && (flag==SH_SHOWME))
sh_close(fd);
fname = 0;
@@ -929,13 +1033,13 @@ int sh_redirect(struct ionod *iop, int flag)
message = e_file;
goto fail;
}
- if(sh.subshell && dupfd==1)
+ if(shp->subshell && dupfd==1)
{
- sh_subtmpfile();
+ sh_subtmpfile(0);
dupfd = sffileno(sfstdout);
}
- else if(sh.sftable[dupfd])
- sfsync(sh.sftable[dupfd]);
+ else if(shp->sftable[dupfd])
+ sfsync(shp->sftable[dupfd]);
}
else if(fd=='-' && fname[1]==0)
{
@@ -945,9 +1049,9 @@ int sh_redirect(struct ionod *iop, int flag)
else if(fd=='p' && fname[1]==0)
{
if(iof&IOPUT)
- dupfd = sh.coutpipe;
+ dupfd = shp->coutpipe;
else
- dupfd = sh.cpipe[0];
+ dupfd = shp->cpipe[0];
if(flag)
toclose = dupfd;
}
@@ -960,16 +1064,16 @@ int sh_redirect(struct ionod *iop, int flag)
goto traceit;
if((fd=sh_fcntl(dupfd,F_DUPFD,3))<0)
goto fail;
- sh_iocheckfd(dupfd);
- sh.fdstatus[fd] = (sh.fdstatus[dupfd]&~IOCLEX);
- if(toclose<0 && sh.fdstatus[fd]&IOREAD)
- sh.fdstatus[fd] |= IODUP;
- else if(dupfd==sh.cpipe[0])
- sh_pclose(sh.cpipe);
+ sh_iocheckfd(shp,dupfd);
+ shp->fdstatus[fd] = (shp->fdstatus[dupfd]&~IOCLEX);
+ if(toclose<0 && shp->fdstatus[fd]&IOREAD)
+ shp->fdstatus[fd] |= IODUP;
+ else if(dupfd==shp->cpipe[0])
+ sh_pclose(shp->cpipe);
else if(toclose>=0)
{
if(flag==0)
- sh_iosave(toclose,indx); /* save file descriptor */
+ sh_iosave(shp,toclose,indx,(char*)0); /* save file descriptor */
sh_close(toclose);
}
}
@@ -996,6 +1100,12 @@ int sh_redirect(struct ionod *iop, int flag)
io_op[2] = '>';
o_mode |= O_APPEND;
}
+ else if((iof&IOREWRITE) && (flag==0 || flag==1 || sh_subsavefd(fn)))
+ {
+ io_op[2] = ';';
+ o_mode |= O_TRUNC;
+ tname = io_usename(fname,&perm,0);
+ }
else
{
o_mode |= O_TRUNC;
@@ -1008,7 +1118,7 @@ int sh_redirect(struct ionod *iop, int flag)
{
#if SHOPT_FS_3D
if(S_ISREG(sb.st_mode)&&
- (!sh.lim.fs3d || iview(&sb)==0))
+ (!shp->lim.fs3d || iview(&sb)==0))
#else
if(S_ISREG(sb.st_mode))
#endif /* SHOPT_FS_3D */
@@ -1024,8 +1134,14 @@ int sh_redirect(struct ionod *iop, int flag)
openit:
if(flag!=SH_SHOWME)
{
- if((fd=sh_open(fname,o_mode,RW_ALL)) <0)
+ if((fd=sh_open(tname?tname:fname,o_mode,RW_ALL)) <0)
errormsg(SH_DICT,ERROR_system(1),((o_mode&O_CREAT)?e_create:e_open),fname);
+ if(perm>0)
+#if _lib_fchmod
+ fchmod(fd,perm);
+#else
+ chmod(tname,perm);
+#endif
}
}
traceit:
@@ -1054,14 +1170,14 @@ int sh_redirect(struct ionod *iop, int flag)
}
else
av +=3;
- sh_debug(trace,(char*)0,(char*)0,av,ARG_NOGLOB);
+ sh_debug(shp,trace,(char*)0,(char*)0,av,ARG_NOGLOB);
}
if(iof&IOLSEEK)
{
- Sfio_t *sp = sh.sftable[fn];
- r = sh.fdstatus[fn];
+ Sfio_t *sp = shp->sftable[fn];
+ r = shp->fdstatus[fn];
if(!(r&(IOSEEK|IONOSEEK)))
- r = sh_iocheckfd(fn);
+ r = sh_iocheckfd(shp,fn);
sfsprintf(io_op,sizeof(io_op),"%d\0",fn);
if(r==IOCLOSE)
{
@@ -1078,12 +1194,14 @@ int sh_redirect(struct ionod *iop, int flag)
goto fail;
}
message = e_badseek;
- if((off = file_offset(fn,fname))<0)
+ if((off = file_offset(shp,fn,fname))<0)
goto fail;
if(sp)
- r=sfseek(sp, off, SEEK_SET);
+ off=sfseek(sp, off, SEEK_SET);
else
- r=lseek(fn, off, SEEK_SET);
+ off=lseek(fn, off, SEEK_SET);
+ if(off<0)
+ r = -1;
}
else
{
@@ -1100,8 +1218,8 @@ int sh_redirect(struct ionod *iop, int flag)
goto fail;
}
if(!sp)
- sp = sh_iostream(fn);
- r=io_patseek(rp,sp,iof);
+ sp = sh_iostream(shp,fn);
+ r=io_patseek(shp,rp,sp,iof);
if(sp && flag==3)
{
/* close stream but not fn */
@@ -1117,7 +1235,7 @@ int sh_redirect(struct ionod *iop, int flag)
}
if(!np)
{
- if(flag==0)
+ if(flag==0 || tname)
{
if(fd==fn)
{
@@ -1127,17 +1245,17 @@ int sh_redirect(struct ionod *iop, int flag)
sh_close(fn);
}
}
- sh_iosave(fn,indx);
+ sh_iosave(shp,fn,indx,tname?fname:0);
}
else if(sh_subsavefd(fn))
- sh_iosave(fn,indx|IOSUBSHELL);
+ sh_iosave(shp,fn,indx|IOSUBSHELL,tname?fname:0);
}
if(fd<0)
{
- if(sh_inuse(fn) || fn==sh.infd)
+ if(sh_inuse(fn) || fn==shp->infd)
{
- if(fn>9 || !(sh.inuse_bits&(1<<fn)))
- io_preserve(sh.sftable[fn],fn);
+ if(fn>9 || !(shp->inuse_bits&(1<<fn)))
+ io_preserve(shp,shp->sftable[fn],fn);
}
sh_close(fn);
}
@@ -1153,7 +1271,7 @@ int sh_redirect(struct ionod *iop, int flag)
{
if((fn=fcntl(fd,F_DUPFD,10)) < 0)
goto fail;
- sh.fdstatus[fn] = sh.fdstatus[fd];
+ shp->fdstatus[fn] = shp->fdstatus[fd];
sh_close(fd);
fd = fn;
}
@@ -1161,19 +1279,19 @@ int sh_redirect(struct ionod *iop, int flag)
nv_onattr(np,NV_INT32);
v = fn;
nv_putval(np,(char*)&v, NV_INT32);
- sh_iocheckfd(fd);
+ sh_iocheckfd(shp,fd);
}
else
{
- fd = sh_iorenumber(sh_iomovefd(fd),fn);
+ fd = sh_iorenumber(shp,sh_iomovefd(fd),fn);
if(fn>2 && fn<10)
- sh.inuse_bits |= (1<<fn);
+ shp->inuse_bits |= (1<<fn);
}
}
if(fd >2 && clexec)
{
fcntl(fd,F_SETFD,FD_CLOEXEC);
- sh.fdstatus[fd] |= IOCLEX;
+ shp->fdstatus[fd] |= IOCLEX;
}
}
else
@@ -1188,11 +1306,11 @@ fail:
/*
* Create a tmp file for the here-document
*/
-static int io_heredoc(register struct ionod *iop, const char *name, int traceon)
+static int io_heredoc(Shell_t *shp,register struct ionod *iop, const char *name, int traceon)
{
register Sfio_t *infile = 0, *outfile;
register int fd;
- if(!(iop->iofile&IOSTRG) && (!sh.heredocs || iop->iosize==0))
+ if(!(iop->iofile&IOSTRG) && (!shp->heredocs || iop->iosize==0))
return(sh_open(e_devnull,O_RDONLY));
/* create an unnamed temporary file */
if(!(outfile=sftmp(0)))
@@ -1205,7 +1323,7 @@ static int io_heredoc(register struct ionod *iop, const char *name, int traceon)
}
else
{
- infile = subopen(sh.heredocs,iop->iooffset,iop->iosize);
+ infile = subopen(shp,shp->heredocs,iop->iooffset,iop->iosize);
if(traceon)
{
char *cp = sh_fmtq(iop->iodelim);
@@ -1221,9 +1339,9 @@ static int io_heredoc(register struct ionod *iop, const char *name, int traceon)
}
else
{
- char *lastpath = sh.lastpath;
- sh_machere(infile,outfile,iop->ioname);
- sh.lastpath = lastpath;
+ char *lastpath = shp->lastpath;
+ sh_machere(shp,infile,outfile,iop->ioname);
+ shp->lastpath = lastpath;
if(infile)
sfclose(infile);
}
@@ -1235,7 +1353,7 @@ static int io_heredoc(register struct ionod *iop, const char *name, int traceon)
if(traceon && !(iop->iofile&IOSTRG))
sfputr(sfstderr,iop->ioname,'\n');
lseek(fd,(off_t)0,SEEK_SET);
- sh.fdstatus[fd] = IOREAD;
+ shp->fdstatus[fd] = IOREAD;
return(fd);
}
@@ -1256,28 +1374,43 @@ static ssize_t tee_write(Sfio_t *iop,const void *buff,size_t n,Sfdisc_t *unused)
* if <origfd> < 0, then -origfd is saved, but not duped so that it
* will be closed with sh_iorestore.
*/
-void sh_iosave(register int origfd, int oldtop)
+void sh_iosave(Shell_t *shp, register int origfd, int oldtop, char *name)
{
/*@
- assume oldtop>=0 && oldtop<sh.lim.open_max;
+ assume oldtop>=0 && oldtop<shp->lim.open_max;
@*/
register int savefd;
int flag = (oldtop&IOSUBSHELL);
oldtop &= ~IOSUBSHELL;
/* see if already saved, only save once */
- for(savefd=sh.topfd; --savefd>=oldtop; )
+ for(savefd=shp->topfd; --savefd>=oldtop; )
{
if(filemap[savefd].orig_fd == origfd)
return;
}
/* make sure table is large enough */
- if(sh.topfd >= filemapsize)
+ if(shp->topfd >= filemapsize)
{
+ char *cp, *oldptr = (char*)filemap;
+ char *oldend = (char*)&filemap[filemapsize];
+ long moved;
filemapsize += 8;
if(!(filemap = (struct fdsave*)realloc(filemap,filemapsize*sizeof(struct fdsave))))
errormsg(SH_DICT,ERROR_exit(4),e_nospace);
-
+ if(moved = (char*)filemap - oldptr)
+ {
+#if SHOPT_FASTPIPE
+ for(savefd=shp->lim.open_max+2; --savefd>=0; )
+#else
+ for(savefd=shp->lim.open_max; --savefd>=0; )
+#endif /* SHOPT_FASTPIPE */
+ {
+ cp = (char*)shp->fdptrs[savefd];
+ if(cp >= oldptr && cp < oldend)
+ shp->fdptrs[savefd] = (int*)(oldptr+moved);
+ }
+ }
}
#if SHOPT_DEVFD
if(origfd <0)
@@ -1291,60 +1424,61 @@ void sh_iosave(register int origfd, int oldtop)
if((savefd = sh_fcntl(origfd, F_DUPFD, 10)) < 0 && errno!=EBADF)
errormsg(SH_DICT,ERROR_system(1),e_toomany);
}
- filemap[sh.topfd].subshell = flag;
- filemap[sh.topfd].orig_fd = origfd;
- filemap[sh.topfd++].save_fd = savefd;
+ filemap[shp->topfd].tname = name;
+ filemap[shp->topfd].subshell = flag;
+ filemap[shp->topfd].orig_fd = origfd;
+ filemap[shp->topfd++].save_fd = savefd;
if(savefd >=0)
{
- register Sfio_t* sp = sh.sftable[origfd];
+ register Sfio_t* sp = shp->sftable[origfd];
/* make saved file close-on-exec */
sh_fcntl(savefd,F_SETFD,FD_CLOEXEC);
if(origfd==job.fd)
job.fd = savefd;
- sh.fdstatus[savefd] = sh.fdstatus[origfd];
- sh.fdptrs[savefd] = &filemap[sh.topfd-1].save_fd;
- if(!(sh.sftable[savefd]=sp))
+ shp->fdstatus[savefd] = shp->fdstatus[origfd];
+ shp->fdptrs[savefd] = &filemap[shp->topfd-1].save_fd;
+ if(!(shp->sftable[savefd]=sp))
return;
sfsync(sp);
if(origfd <=2)
{
/* copy standard stream to new stream */
sp = sfswap(sp,NIL(Sfio_t*));
- sh.sftable[savefd] = sp;
+ shp->sftable[savefd] = sp;
}
else
- sh.sftable[origfd] = 0;
+ shp->sftable[origfd] = 0;
}
}
/*
* close all saved file descriptors
*/
-void sh_iounsave(void)
+void sh_iounsave(Shell_t* shp)
{
register int fd, savefd, newfd;
- for(newfd=fd=0; fd < sh.topfd; fd++)
+ for(newfd=fd=0; fd < shp->topfd; fd++)
{
if((savefd = filemap[fd].save_fd)< 0)
filemap[newfd++] = filemap[fd];
else
{
- sh.sftable[savefd] = 0;
+ shp->sftable[savefd] = 0;
sh_close(savefd);
}
}
- sh.topfd = newfd;
+ shp->topfd = newfd;
}
/*
* restore saved file descriptors from <last> on
*/
-void sh_iorestore(int last, int jmpval)
+void sh_iorestore(Shell_t *shp, int last, int jmpval)
{
register int origfd, savefd, fd;
int flag = (last&IOSUBSHELL);
last &= ~IOSUBSHELL;
- for (fd = sh.topfd - 1; fd >= last; fd--)
+ for (fd = shp->topfd - 1; fd >= last; fd--)
{
if(!flag && filemap[fd].subshell)
continue;
@@ -1352,47 +1486,49 @@ void sh_iorestore(int last, int jmpval)
{
if ((savefd = filemap[fd].save_fd) >= 0)
{
- sh.sftable[savefd] = 0;
+ shp->sftable[savefd] = 0;
sh_close(savefd);
}
continue;
}
origfd = filemap[fd].orig_fd;
+ if(filemap[fd].tname)
+ io_usename(filemap[fd].tname,(int*)0,shp->exitval?2:1);
sh_close(origfd);
if ((savefd = filemap[fd].save_fd) >= 0)
{
sh_fcntl(savefd, F_DUPFD, origfd);
if(savefd==job.fd)
job.fd=origfd;
- sh.fdstatus[origfd] = sh.fdstatus[savefd];
+ shp->fdstatus[origfd] = shp->fdstatus[savefd];
/* turn off close-on-exec if flag if necessary */
- if(sh.fdstatus[origfd]&IOCLEX)
+ if(shp->fdstatus[origfd]&IOCLEX)
fcntl(origfd,F_SETFD,FD_CLOEXEC);
if(origfd<=2)
{
- sfswap(sh.sftable[savefd],sh.sftable[origfd]);
+ sfswap(shp->sftable[savefd],shp->sftable[origfd]);
if(origfd==0)
- sh.st.ioset = 0;
+ shp->st.ioset = 0;
}
else
- sh.sftable[origfd] = sh.sftable[savefd];
- sh.sftable[savefd] = 0;
+ shp->sftable[origfd] = shp->sftable[savefd];
+ shp->sftable[savefd] = 0;
sh_close(savefd);
}
else
- sh.fdstatus[origfd] = IOCLOSE;
+ shp->fdstatus[origfd] = IOCLOSE;
}
if(!flag)
{
/* keep file descriptors for subshell restore */
- for (fd = last ; fd < sh.topfd; fd++)
+ for (fd = last ; fd < shp->topfd; fd++)
{
if(filemap[fd].subshell)
filemap[last++] = filemap[fd];
}
}
- if(last < sh.topfd)
- sh.topfd = last;
+ if(last < shp->topfd)
+ shp->topfd = last;
}
/*
@@ -1402,10 +1538,11 @@ void sh_iorestore(int last, int jmpval)
*/
int sh_ioaccess(int fd,register int mode)
{
+ Shell_t *shp = &sh;
register int flags;
if(mode==X_OK)
return(-1);
- if((flags=sh_iocheckfd(fd))!=IOCLOSE)
+ if((flags=sh_iocheckfd(shp,fd))!=IOCLOSE)
{
if(mode==F_OK)
return(0);
@@ -1455,7 +1592,12 @@ static int slowexcept(register Sfio_t *iop,int type,void *data,Sfdisc_t *handle)
if(errno!=EINTR)
return(0);
n=1;
+ sh_onstate(SH_TTYWAIT);
}
+ else
+ n = 0;
+ if(sh.bltinfun && sh.bltindata.sigset)
+ return(-1);
errno = 0;
if(sh.trapnote&SH_SIGSET)
{
@@ -1495,6 +1637,8 @@ static ssize_t piperead(Sfio_t *iop,void *buff,register size_t size,Sfdisc_t *ha
{
int fd = sffileno(iop);
NOT_USED(handle);
+ if(job.waitsafe && job.savesig)
+ job_reap(job.savesig);
if(sh.trapnote)
{
errno = EINTR;
@@ -1502,10 +1646,12 @@ static ssize_t piperead(Sfio_t *iop,void *buff,register size_t size,Sfdisc_t *ha
}
if(sh_isstate(SH_INTERACTIVE) && io_prompt(iop,sh.nextprompt)<0 && errno==EIO)
return(0);
+ sh_onstate(SH_TTYWAIT);
if(!(sh.fdstatus[sffileno(iop)]&IOCLEX) && (sfset(iop,0,0)&SF_SHARE))
size = ed_read(sh.ed_context, fd, (char*)buff, size,0);
else
size = sfrd(iop,buff,size,handle);
+ sh_offstate(SH_TTYWAIT);
return(size);
}
/*
@@ -1594,7 +1740,7 @@ static ssize_t slowread(Sfio_t *iop,void *buff,register size_t size,Sfdisc_t *ha
* check and return the attributes for a file descriptor
*/
-int sh_iocheckfd(register int fd)
+int sh_iocheckfd(Shell_t *shp, register int fd)
{
register int flags, n;
if((n=sh.fdstatus[fd])&IOCLOSE)
@@ -1661,6 +1807,7 @@ int sh_iocheckfd(register int fd)
static int io_prompt(Sfio_t *iop,register int flag)
{
+ Shell_t *shp = &sh;
register char *cp;
char buff[1];
char *endprompt;
@@ -1691,7 +1838,7 @@ static int io_prompt(Sfio_t *iop,register int flag)
ioctl(sffileno(sfstderr),TIOCLBIC,&mode);
}
#endif /* TIOCLBIC */
- cp = sh_mactry(nv_getval(nv_scoped(PS1NOD)));
+ cp = sh_mactry(shp,nv_getval(sh_scoped(shp,PS1NOD)));
for(;c= *cp;cp++)
{
if(c==HIST_CHAR)
@@ -1711,10 +1858,10 @@ static int io_prompt(Sfio_t *iop,register int flag)
goto done;
}
case 2:
- cp = nv_getval(nv_scoped(PS2NOD));
+ cp = nv_getval(sh_scoped(shp,PS2NOD));
break;
case 3:
- cp = nv_getval(nv_scoped(PS3NOD));
+ cp = nv_getval(sh_scoped(shp,PS3NOD));
break;
default:
goto done;
@@ -1745,11 +1892,13 @@ static int pipeexcept(Sfio_t* iop, int mode, void *data, Sfdisc_t* handle)
/*
* keep track of each stream that is opened and closed
*/
-static void sftrack(Sfio_t* sp,int flag, int newfd)
+static void sftrack(Sfio_t* sp, int flag, void* data)
{
+ Shell_t *shp = &sh;
register int fd = sffileno(sp);
register struct checkpt *pp;
register int mode;
+ int newfd = integralof(data);
if(flag==SF_SETFD || flag==SF_CLOSING)
{
if(newfd<0)
@@ -1772,12 +1921,12 @@ static void sftrack(Sfio_t* sp,int flag, int newfd)
return;
}
#endif
- if((unsigned)fd >= sh.lim.open_max)
+ if((unsigned)fd >= shp->lim.open_max)
return;
if(sh_isstate(SH_NOTRACK))
return;
mode = sfset(sp,0,0);
- if(sp==sh.heredocs && fd < 10 && flag==SF_NEW)
+ if(sp==shp->heredocs && fd < 10 && flag==SF_NEW)
{
fd = sfsetfd(sp,10);
fcntl(fd,F_SETFD,FD_CLOEXEC);
@@ -1786,23 +1935,23 @@ static void sftrack(Sfio_t* sp,int flag, int newfd)
return;
if(flag==SF_NEW)
{
- if(!sh.sftable[fd] && sh.fdstatus[fd]==IOCLOSE)
+ if(!shp->sftable[fd] && shp->fdstatus[fd]==IOCLOSE)
{
- sh.sftable[fd] = sp;
+ shp->sftable[fd] = sp;
flag = (mode&SF_WRITE)?IOWRITE:0;
if(mode&SF_READ)
flag |= IOREAD;
- sh.fdstatus[fd] = flag;
+ shp->fdstatus[fd] = flag;
#if 0
if(flag==IOWRITE)
- sfpool(sp,sh.outpool,SF_WRITE);
+ sfpool(sp,shp->outpool,SF_WRITE);
else
#else
if(flag!=IOWRITE)
#endif
- sh_iostream(fd);
+ sh_iostream(shp,fd);
}
- if((pp=(struct checkpt*)sh.jmplist) && pp->mode==SH_JMPCMD)
+ if((pp=(struct checkpt*)shp->jmplist) && pp->mode==SH_JMPCMD)
{
struct openlist *item;
/*
@@ -1820,9 +1969,9 @@ static void sftrack(Sfio_t* sp,int flag, int newfd)
}
else if(flag==SF_CLOSING || (flag==SF_SETFD && newfd<=2))
{
- sh.sftable[fd] = 0;
- sh.fdstatus[fd]=IOCLOSE;
- if(pp=(struct checkpt*)sh.jmplist)
+ shp->sftable[fd] = 0;
+ shp->fdstatus[fd]=IOCLOSE;
+ if(pp=(struct checkpt*)shp->jmplist)
{
struct openlist *item;
for(item=pp->olist; item; item=item->next)
@@ -1916,7 +2065,7 @@ static int eval_exceptf(Sfio_t *iop,int type, void *data, Sfdisc_t *handle)
* The stream can be read with the normal stream operations
*/
-static Sfio_t *subopen(Sfio_t* sp, off_t offset, long size)
+static Sfio_t *subopen(Shell_t *shp,Sfio_t* sp, off_t offset, long size)
{
register struct subfile *disp;
if(sfseek(sp,offset,SEEK_SET) <0)
@@ -1927,7 +2076,7 @@ static Sfio_t *subopen(Sfio_t* sp, off_t offset, long size)
disp->oldsp = sp;
disp->offset = offset;
disp->size = disp->left = size;
- sp = sfnew(NIL(Sfio_t*),(char*)(disp+1),IOBSIZE,sh.lim.open_max,SF_READ);
+ sp = sfnew(NIL(Sfio_t*),(char*)(disp+1),IOBSIZE,shp->lim.open_max,SF_READ);
sfdisc(sp,&disp->disc);
return(sp);
}
@@ -1982,11 +2131,12 @@ static int subexcept(Sfio_t* sp,register int mode, void *data, Sfdisc_t* handle)
*/
void sh_menu(Sfio_t *outfile,int argn,char *argv[])
{
+ Shell_t *shp = &sh;
register int i,j;
register char **arg;
int nrow, ncol=1, ndigits=1;
int fldsize, wsize = ed_window();
- char *cp = nv_getval(nv_scoped(LINES));
+ char *cp = nv_getval(sh_scoped(shp,LINES));
nrow = (cp?1+2*((int)strtol(cp, (char**)0, 10)/3):NROW);
for(i=argn;i >= 10;i /= 10)
ndigits++;
@@ -2132,6 +2282,7 @@ mode_t sh_umask(mode_t m)
Sfio_t *sh_iogetiop(int fd, int mode)
{
+ Shell_t *shp = &sh;
int n;
Sfio_t *iop=0;
if(mode!=SF_READ && mode!=SF_WRITE)
@@ -2142,18 +2293,18 @@ Sfio_t *sh_iogetiop(int fd, int mode)
switch(fd)
{
case SH_IOHISTFILE:
- if(!sh_histinit())
+ if(!sh_histinit((void*)shp))
return(iop);
- fd = sffileno(sh.hist_ptr->histfp);
+ fd = sffileno(shp->hist_ptr->histfp);
break;
case SH_IOCOPROCESS:
if(mode==SF_WRITE)
- fd = sh.coutpipe;
+ fd = shp->coutpipe;
else
- fd = sh.cpipe[0];
+ fd = shp->cpipe[0];
break;
default:
- if(fd<0 || fd >= sh.lim.open_max)
+ if(fd<0 || fd >= shp->lim.open_max)
fd = -1;
}
if(fd<0)
@@ -2161,14 +2312,14 @@ Sfio_t *sh_iogetiop(int fd, int mode)
errno = EBADF;
return(iop);
}
- if(!(n=sh.fdstatus[fd]))
- n = sh_iocheckfd(fd);
+ if(!(n=shp->fdstatus[fd]))
+ n = sh_iocheckfd(shp,fd);
if(mode==SF_WRITE && !(n&IOWRITE))
return(iop);
if(mode==SF_READ && !(n&IOREAD))
return(iop);
- if(!(iop = sh.sftable[fd]))
- iop=sh_iostream(fd);
+ if(!(iop = shp->sftable[fd]))
+ iop=sh_iostream(shp,fd);
return(iop);
}
@@ -2184,9 +2335,10 @@ Notify_f sh_fdnotify(Notify_f notify)
Sfio_t *sh_fd2sfio(int fd)
{
+ Shell_t *shp = &sh;
register int status;
Sfio_t *sp = sh.sftable[fd];
- if(!sp && (status = sh_iocheckfd(fd))!=IOCLOSE)
+ if(!sp && (status = sh_iocheckfd(shp,fd))!=IOCLOSE)
{
register int flags=0;
if(status&IOREAD)
@@ -2201,6 +2353,7 @@ Sfio_t *sh_fd2sfio(int fd)
Sfio_t *sh_pathopen(const char *cp)
{
+ Shell_t *shp = &sh;
int n;
#ifdef PATH_BFPATH
if((n=path_open(cp,path_get(cp))) < 0)
@@ -2211,5 +2364,5 @@ Sfio_t *sh_pathopen(const char *cp)
#endif
if(n < 0)
errormsg(SH_DICT,ERROR_system(1),e_open,cp);
- return(sh_iostream(n));
+ return(sh_iostream(shp,n));
}
diff --git a/usr/src/lib/libshell/common/sh/jobs.c b/usr/src/lib/libshell/common/sh/jobs.c
index d397810f3d..0c9724ce0f 100644
--- a/usr/src/lib/libshell/common/sh/jobs.c
+++ b/usr/src/lib/libshell/common/sh/jobs.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -63,6 +63,7 @@ struct jobsave
static struct jobsave *job_savelist;
static int njob_savelist;
+static struct process *pwfg;
static void init_savelist(void)
{
@@ -204,11 +205,17 @@ int job_reap(register int sig)
register struct process *pw;
struct process *px;
register int flags;
- struct process dummy;
struct jobsave *jp;
+ struct back_save *bp;
int nochild=0, oerrno, wstat;
Waitevent_f waitevent = sh.waitevent;
static int wcontinued = WCONTINUED;
+ if (vmbusy())
+ {
+ errormsg(SH_DICT,ERROR_warn(0),"vmbusy() inside job_reap() -- should not happen");
+ if (getenv("_AST_KSH_VMBUSY_ABORT"))
+ abort();
+ }
#ifdef DEBUG
if(sfprintf(sfstderr,"ksh: job line %4d: reap pid=%d critical=%d signal=%d\n",__LINE__,getpid(),job.in_critical,sig) <=0)
write(2,"waitsafe\n",9);
@@ -223,12 +230,14 @@ int job_reap(register int sig)
oerrno = errno;
while(1)
{
- if(!(flags&WNOHANG) && !sh.intrap && waitevent && job.pwlist)
+ if(!(flags&WNOHANG) && !sh.intrap && job.pwlist)
{
- if((*waitevent)(-1,-1L,0))
+ sh_onstate(SH_TTYWAIT);
+ if(waitevent && (*waitevent)(-1,-1L,0))
flags |= WNOHANG;
}
pid = waitpid((pid_t)-1,&wstat,flags);
+ sh_offstate(SH_TTYWAIT);
/*
* some systems (linux 2.6) may return EINVAL
@@ -245,17 +254,21 @@ int job_reap(register int sig)
flags |= WNOHANG;
job.waitsafe++;
jp = 0;
+ lastpid = pid;
if(!(pw=job_bypid(pid)))
{
#ifdef DEBUG
sfprintf(sfstderr,"ksh: job line %4d: reap pid=%d critical=%d unknown job pid=%d pw=%x\n",__LINE__,getpid(),job.in_critical,pid,pw);
#endif /* DEBUG */
+ if (WIFCONTINUED(wstat) && wcontinued)
+ continue;
pw = &dummy;
pw->p_exit = 0;
pw->p_pgrp = 0;
+ pw->p_exitmin = 0;
if(job.toclear)
job_clear();
- if(bck.count++ > sh.lim.child_max)
+ if(++bck.count > sh.lim.child_max)
job_chksave(0);
if(jp = jobsave_create(pid))
{
@@ -284,17 +297,14 @@ int job_reap(register int sig)
px->p_nxtjob = job.pwlist;
job.pwlist = px;
}
- pw->p_exit = WSTOPSIG(wstat);
pw->p_flag |= (P_NOTIFY|P_SIGNALLED|P_STOPPED);
+ pw->p_exit = WSTOPSIG(wstat);
if(pw->p_pgrp && pw->p_pgrp==job.curpgid && sh_isstate(SH_STOPOK))
sh_fault(pw->p_exit);
continue;
}
else if (WIFCONTINUED(wstat) && wcontinued)
- {
pw->p_flag &= ~(P_NOTIFY|P_SIGNALLED|P_STOPPED);
- pw->p_exit = 0;
- }
else
#endif /* SIGTSTP */
{
@@ -306,9 +316,12 @@ int job_reap(register int sig)
sh.cpipe[1] = -1;
sh.coutpipe = -1;
}
+ else if(sh.subshell)
+ sh_subjobcheck(pid);
+
+ pw->p_flag &= ~(P_STOPPED|P_SIGNALLED);
if (WIFSIGNALED(wstat))
{
- pw->p_flag &= ~P_STOPPED;
pw->p_flag |= (P_DONE|P_NOTIFY|P_SIGNALLED);
if (WTERMCORE(wstat))
pw->p_flag |= P_COREDUMP;
@@ -327,7 +340,8 @@ int job_reap(register int sig)
else
{
pw->p_flag |= (P_DONE|P_NOTIFY);
- if(WEXITSTATUS(wstat) > pw->p_exit)
+ pw->p_exit = pw->p_exitmin;
+ if(WEXITSTATUS(wstat) > pw->p_exitmin)
pw->p_exit = WEXITSTATUS(wstat);
}
if(pw->p_pgrp==0)
@@ -346,6 +360,18 @@ int job_reap(register int sig)
/* only top-level process in job should have notify set */
if(px && pw != px)
pw->p_flag &= ~P_NOTIFY;
+ if(pid==pw->p_fgrp && pid==tcgetpgrp(JOBTTY))
+ {
+ px = job_byjid((int)pw->p_job);
+ for(; px && (px->p_flag&P_DONE); px=px->p_nxtproc);
+ if(!px)
+ tcsetpgrp(JOBTTY,job.mypid);
+ }
+ if(!sh.intrap && sh.st.trapcom[SIGCHLD] && pid>0 && (pwfg!=job_bypid(pid)))
+ {
+ sh.sigflag[SIGCHLD] |= SH_SIGTRAP;
+ sh.trapnote |= SH_SIGTRAP;
+ }
}
if(errno==ECHILD)
{
@@ -353,11 +379,6 @@ int job_reap(register int sig)
nochild = 1;
}
sh.waitevent = waitevent;
- if(!sh.intrap && sh.st.trapcom[SIGCHLD])
- {
- sh.sigflag[SIGCHLD] |= SH_SIGTRAP;
- sh.trapnote |= SH_SIGTRAP;
- }
if(sh_isoption(SH_NOTIFY) && sh_isstate(SH_TTYWAIT))
{
outfile = sfstderr;
@@ -375,7 +396,7 @@ int job_reap(register int sig)
*/
static void job_waitsafe(int sig)
{
- if(job.in_critical)
+ if(job.in_critical || vmbusy())
{
job.savesig = sig;
job.waitsafe++;
@@ -388,9 +409,9 @@ static void job_waitsafe(int sig)
* initialize job control if possible
* if lflag is set the switching driver message will not print
*/
-void job_init(int lflag)
+void job_init(Shell_t *shp, int lflag)
{
- register int i,ntry=0;
+ register int ntry=0;
job.fd = JOBTTY;
signal(SIGCHLD,job_waitsafe);
# if defined(SIGCLD) && (SIGCLD!=SIGCHLD)
@@ -429,7 +450,7 @@ void job_init(int lflag)
register int fd;
register char *ttynam;
#ifndef SIGTSTP
- setpgid(0,sh.pid);
+ setpgid(0,shp->pid);
#endif /*SIGTSTP */
if(job.mypgid<0 || !(ttynam=ttyname(JOBTTY)))
return;
@@ -437,11 +458,11 @@ void job_init(int lflag)
if((fd = open(ttynam,O_RDWR)) <0)
return;
if(fd!=JOBTTY)
- sh_iorenumber(fd,JOBTTY);
- job.mypgid = sh.pid;
+ sh_iorenumber(shp,fd,JOBTTY);
+ job.mypgid = shp->pid;
#ifdef SIGTSTP
- tcsetpgrp(JOBTTY,sh.pid);
- setpgid(0,sh.pid);
+ tcsetpgrp(JOBTTY,shp->pid);
+ setpgid(0,shp->pid);
#endif /* SIGTSTP */
}
#ifdef SIGTSTP
@@ -454,7 +475,7 @@ void job_init(int lflag)
return;
/* Stop this shell until continued */
signal(SIGTTIN,SIG_DFL);
- kill(sh.pid,SIGTTIN);
+ kill(shp->pid,SIGTTIN);
/* resumes here after continue tries again */
if(ntry++ > IOMAXTRY)
{
@@ -495,7 +516,7 @@ void job_init(int lflag)
#ifdef SIGTSTP
/* make sure that we are a process group leader */
- setpgid(0,sh.pid);
+ setpgid(0,shp->pid);
# if defined(SA_NOCLDWAIT) && defined(_lib_sigflag)
sigflag(SIGCHLD, SA_NOCLDSTOP|SA_NOCLDWAIT, 0);
# endif /* SA_NOCLDWAIT */
@@ -503,7 +524,7 @@ void job_init(int lflag)
signal(SIGTTOU,SIG_IGN);
/* The shell now handles ^Z */
signal(SIGTSTP,sh_fault);
- tcsetpgrp(JOBTTY,sh.pid);
+ tcsetpgrp(JOBTTY,shp->pid);
# ifdef CNSUSP
/* set the switch character */
tty_get(JOBTTY,&my_stty);
@@ -516,7 +537,7 @@ void job_init(int lflag)
# endif /* CNSUSP */
sh_onoption(SH_MONITOR);
job.jobcontrol++;
- job.mypid = sh.pid;
+ job.mypid = shp->pid;
#endif /* SIGTSTP */
return;
}
@@ -526,7 +547,7 @@ void job_init(int lflag)
* see if there are any stopped jobs
* restore tty driver and pgrp
*/
-int job_close(void)
+int job_close(Shell_t* shp)
{
register struct process *pw;
register int count = 0, running = 0;
@@ -558,7 +579,7 @@ int job_close(void)
errormsg(SH_DICT,0,e_terminate);
return(-1);
}
- else if(running && sh.login_sh)
+ else if(running && shp->login_sh)
{
errormsg(SH_DICT,0,e_jobsrunning);
return(-1);
@@ -625,7 +646,7 @@ static void job_reset(register struct process *pw)
/* save the terminal state for current job */
#ifdef SIGTSTP
job_fgrp(pw,tcgetpgrp(job.fd));
- if(tcsetpgrp(job.fd,sh.pid) !=0)
+ if(tcsetpgrp(job.fd,job.mypid) !=0)
return;
#endif /* SIGTSTP */
/* force the following tty_get() to do a tcgetattr() unless fg */
@@ -1043,6 +1064,7 @@ int job_post(pid_t pid, pid_t join)
{
register struct process *pw;
register History_t *hp = sh.hist_ptr;
+ int val;
sh.jobenv = sh.curenv;
if(njob_savelist < NJOB_SAVELIST)
init_savelist();
@@ -1088,8 +1110,8 @@ int job_post(pid_t pid, pid_t join)
pw->p_env = sh.curenv;
pw->p_pid = pid;
pw->p_flag = P_EXITSAVE;
- pw->p_exit = sh.xargexit;
- sh.xargexit = 0;
+ pw->p_exitmin = sh.xargexit;
+ pw->p_exit = 0;
if(sh_isstate(SH_MONITOR))
{
if(killpg(job.curpgid,0)<0 && errno==ESRCH)
@@ -1110,10 +1132,9 @@ int job_post(pid_t pid, pid_t join)
else
pw->p_name = -1;
#endif /* JOBS */
- if(pid==lastpid)
+ if ((val = job_chksave(pid)) >= 0)
{
- int val = job_chksave(pid);
- pw->p_exit = val>0?val:0;
+ pw->p_exit = val;
if(pw->p_exit==SH_STOPSIG)
{
pw->p_flag |= (P_SIGNALLED|P_STOPPED);
@@ -1187,11 +1208,11 @@ static void job_prmsg(register struct process *pw)
* pid=-1 to wait for all runing processes
*/
-void job_wait(register pid_t pid)
+int job_wait(register pid_t pid)
{
register struct process *pw=0,*px;
register int jobid = 0;
- int nochild;
+ int nochild = 1;
char intr = 0;
if(pid <= 0)
{
@@ -1203,6 +1224,8 @@ void job_wait(register pid_t pid)
job_lock();
if(pid > 1)
{
+ if(pid==sh.spid)
+ sh.spid = 0;
if(!(pw=job_bypid(pid)))
{
/* check to see whether job status has been saved */
@@ -1210,13 +1233,13 @@ void job_wait(register pid_t pid)
sh.exitval = ERROR_NOENT;
exitset();
job_unlock();
- return;
+ return(nochild);
}
else if(intr && pw->p_env!=sh.curenv)
{
sh.exitval = ERROR_NOENT;
job_unlock();
- return;
+ return(nochild);
}
jobid = pw->p_job;
if(!intr)
@@ -1224,12 +1247,19 @@ void job_wait(register pid_t pid)
if(pw->p_pgrp && job.parent!= (pid_t)-1)
job_set(job_byjid(jobid));
}
+ pwfg = pw;
#ifdef DEBUG
sfprintf(sfstderr,"ksh: job line %4d: wait pid=%d critical=%d job=%d pid=%d\n",__LINE__,getpid(),job.in_critical,jobid,pid);
if(pw)
sfprintf(sfstderr,"ksh: job line %4d: wait pid=%d critical=%d flags=%o\n",__LINE__,getpid(),job.in_critical,pw->p_flag);
#endif /* DEBUG*/
errno = 0;
+ if(sh.coutpipe>=0 && sh.cpid==lastpid)
+ {
+ sh_close(sh.coutpipe);
+ sh_close(sh.cpipe[1]);
+ sh.cpipe[1] = sh.coutpipe = -1;
+ }
while(1)
{
if(job.waitsafe)
@@ -1328,9 +1358,10 @@ void job_wait(register pid_t pid)
if((intr && sh.trapnote) || (pid==1 && !intr))
break;
}
+ pwfg = 0;
job_unlock();
if(pid==1)
- return;
+ return(nochild);
exitset();
if(pw->p_pgrp)
{
@@ -1347,10 +1378,18 @@ void job_wait(register pid_t pid)
#endif /* SIGTSTP */
}
else
+ {
+ if(pw->p_pid == tcgetpgrp(JOBTTY))
+ {
+ if(pw->p_pgrp==0)
+ pw->p_pgrp = pw->p_pid;
+ job_reset(pw);
+ }
tty_set(-1, 0, NIL(struct termios*));
+ }
done:
if(!job.waitall && sh_isoption(SH_PIPEFAIL))
- return;
+ return(nochild);
if(!sh.intrap)
{
job_lock();
@@ -1361,6 +1400,7 @@ done:
}
job_unlock();
}
+ return(nochild);
}
/*
@@ -1483,7 +1523,7 @@ static struct process *job_unpost(register struct process *pwtop,int notify)
for(pw=pwtop; pw; pw=pw->p_nxtproc)
{
/* save the exit status for background jobs */
- if(pw->p_flag&P_EXITSAVE)
+ if((pw->p_flag&P_EXITSAVE) || pw->p_pid==sh.spid)
{
struct jobsave *jp;
/* save status for future wait */
@@ -1593,10 +1633,13 @@ static char *job_sigmsg(int sig)
if(sig<sh.sigmax && sh.sigmsg[sig])
return(sh.sigmsg[sig]);
#if defined(SIGRTMIN) && defined(SIGRTMAX)
- if(sig>=SIGRTMIN && sig<=SIGRTMAX)
+ if(sig>=sh.sigruntime[SH_SIGRTMIN] && sig<=sh.sigruntime[SH_SIGRTMAX])
{
static char sigrt[20];
- sfsprintf(sigrt,sizeof(sigrt),"SIGRTMIN+%d",sig-SIGRTMIN);
+ if(sig>sh.sigruntime[SH_SIGRTMIN]+(sh.sigruntime[SH_SIGRTMAX]-sig<=sh.sigruntime[SH_SIGRTMIN])/2)
+ sfsprintf(sigrt,sizeof(sigrt),"SIGRTMAX-%d",sh.sigruntime[SH_SIGRTMAX]-sig);
+ else
+ sfsprintf(sigrt,sizeof(sigrt),"SIGRTMIN+%d",sig-sh.sigruntime[SH_SIGRTMIN]);
return(sigrt);
}
#endif
@@ -1657,10 +1700,22 @@ void *job_subsave(void)
void job_subrestore(void* ptr)
{
- register struct jobsave *jp,*jpnext;
+ register struct jobsave *jp;
register struct back_save *bp = (struct back_save*)ptr;
register struct process *pw, *px, *pwnext;
+ struct jobsave *jpnext;
job_lock();
+ for(jp=bck.list; jp; jp=jpnext)
+ {
+ jpnext = jp->next;
+ if(jp->pid==sh.spid)
+ {
+ jp->next = bp->list;
+ bp->list = jp;
+ }
+ else
+ job_chksave(jp->pid);
+ }
for(pw=job.pwlist; pw; pw=pwnext)
{
pwnext = pw->p_nxtjob;
@@ -1670,12 +1725,13 @@ void job_subrestore(void* ptr)
px->p_flag |= P_DONE;
job_unpost(pw,0);
}
- for(jp=bck.list,bck= *bp; jp; jp=jpnext)
- {
- jpnext = jp->next;
- free((void*)jp);
- }
- free(ptr);
+
+ /*
+ * queue up old lists for disposal by job_reap()
+ */
+
+ bck = *bp;
+ free((void*)bp);
job_unlock();
}
diff --git a/usr/src/lib/libshell/common/sh/lex.c b/usr/src/lib/libshell/common/sh/lex.c
index c8502e3b7b..9753ea8074 100644
--- a/usr/src/lib/libshell/common/sh/lex.c
+++ b/usr/src/lib/libshell/common/sh/lex.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -79,7 +79,6 @@ struct lexstate
char reservok; /* >0 for reserved word legal */
char skipword; /* next word can't be reserved */
char last_quote; /* last multi-line quote character */
- char comp_assign; /* inside compound assignment */
};
struct lexdata
@@ -107,24 +106,19 @@ struct lexdata
};
#define _SHLEX_PRIVATE \
- struct lexdata _lexd; \
- struct lexstate _lex;
+ struct lexdata lexd; \
+ struct lexstate lex;
#include "shlex.h"
-#define lexd lp->_lexd
-#define lex lp->_lex
-#undef shlex
-#define shlex lp->_shlex
-
-#define pushlevel(c,s) ((lexd.level>=lexd.lex_max?stack_grow(lp):1) &&\
- ((lexd.lex_match[lexd.level++]=lexd.lastc),\
- lexd.lastc=(((s)<<CHAR_BIT)|(c))))
-#define oldmode() (lexd.lastc>>CHAR_BIT)
-#define endchar() (lexd.lastc&0xff)
-#define setchar(c) (lexd.lastc = ((lexd.lastc&~0xff)|(c)))
-#define poplevel() (lexd.lastc=lexd.lex_match[--lexd.level])
+#define pushlevel(lp,c,s) ((lp->lexd.level>=lp->lexd.lex_max?stack_grow(lp):1) &&\
+ ((lp->lexd.lex_match[lp->lexd.level++]=lp->lexd.lastc),\
+ lp->lexd.lastc=(((s)<<CHAR_BIT)|(c))))
+#define oldmode(lp) (lp->lexd.lastc>>CHAR_BIT)
+#define endchar(lp) (lp->lexd.lastc&0xff)
+#define setchar(lp,c) (lp->lexd.lastc = ((lp->lexd.lastc&~0xff)|(c)))
+#define poplevel(lp) (lp->lexd.lastc=lp->lexd.lex_match[--lp->lexd.level])
static char *fmttoken(Lex_t*, int, char*);
#ifdef SF_BUFCONST
@@ -133,7 +127,7 @@ static char *fmttoken(Lex_t*, int, char*);
static int alias_exceptf(Sfio_t*, int, Sfdisc_t*);
#endif
static void setupalias(Lex_t*,const char*, Namval_t*);
-static int comsub(Lex_t*);
+static int comsub(Lex_t*,int);
static void nested_here(Lex_t*);
static int here_copy(Lex_t*, struct ionod*);
static int stack_grow(Lex_t*);
@@ -141,41 +135,41 @@ static const Sfdisc_t alias_disc = { NULL, NULL, NULL, alias_exceptf, NULL };
#if SHOPT_KIA
-static void refvar(int type)
+static void refvar(Lex_t *lp, int type)
{
- register Shell_t *shp = sh_getinterp();
- register Lex_t *lp = (Lex_t*)shp->lex_context;
- off_t off = (fcseek(0)-(type+1))-(lexd.first?lexd.first:fcfirst());
+ register Shell_t *shp = lp->sh;
+ register Stk_t *stkp = shp->stk;
+ off_t off = (fcseek(0)-(type+1))-(lp->lexd.first?lp->lexd.first:fcfirst());
unsigned long r;
- if(lexd.first)
+ if(lp->lexd.first)
{
- off = (fcseek(0)-(type+1)) - lexd.first;
- r=kiaentity(lexd.first+lexd.kiaoff+type,off-lexd.kiaoff,'v',-1,-1,shlex.current,'v',0,"");
+ off = (fcseek(0)-(type+1)) - lp->lexd.first;
+ r=kiaentity(lp,lp->lexd.first+lp->lexd.kiaoff+type,off-lp->lexd.kiaoff,'v',-1,-1,lp->current,'v',0,"");
}
else
{
- int n,offset = staktell();
+ int n,offset = stktell(stkp);
char *savptr,*begin;
off = offset + (fcseek(0)-(type+1)) - fcfirst();
- if(lexd.kiaoff < offset)
+ if(lp->lexd.kiaoff < offset)
{
/* variable starts on stak, copy remainder */
if(off>offset)
- stakwrite(fcfirst()+type,off-offset);
- n = staktell()-lexd.kiaoff;
- begin = stakptr(lexd.kiaoff);
+ sfwrite(stkp,fcfirst()+type,off-offset);
+ n = stktell(stkp)-lp->lexd.kiaoff;
+ begin = stkptr(stkp,lp->lexd.kiaoff);
}
else
{
/* variable in data buffer */
- begin = fcfirst()+(type+lexd.kiaoff-offset);
- n = off-lexd.kiaoff;
+ begin = fcfirst()+(type+lp->lexd.kiaoff-offset);
+ n = off-lp->lexd.kiaoff;
}
- savptr = stakfreeze(0);
- r=kiaentity(begin,n,'v',-1,-1,shlex.current,'v',0,"");
- stakset(savptr,offset);
+ savptr = stkfreeze(stkp,0);
+ r=kiaentity(lp,begin,n,'v',-1,-1,lp->current,'v',0,"");
+ stkset(stkp,savptr,offset);
}
- sfprintf(shlex.kiatmp,"p;%..64d;v;%..64d;%d;%d;r;\n",shlex.current,r,shp->inlineno,shp->inlineno);
+ sfprintf(lp->kiatmp,"p;%..64d;v;%..64d;%d;%d;r;\n",lp->current,r,shp->inlineno,shp->inlineno);
}
#endif /* SHOPT_KIA */
@@ -183,11 +177,12 @@ static void refvar(int type)
* This routine gets called when reading across a buffer boundary
* If lexd.nocopy is off, then current token is saved on the stack
*/
-static void lex_advance(Sfio_t *iop, const char *buff, register int size)
+static void lex_advance(Sfio_t *iop, const char *buff, register int size, void *context)
{
- register Shell_t *shp = sh_getinterp();
- register Lex_t *lp = (Lex_t*)shp->lex_context;
- register Sfio_t *log= shp->funlog;
+ register Lex_t *lp = (Lex_t*)context;
+ register Shell_t *shp = lp->sh;
+ register Sfio_t *log= shp->funlog;
+ Stk_t *stkp = shp->stk;
#if KSHELL
/* write to history file and to stderr if necessary */
if(iop && !sfstacked(iop))
@@ -199,22 +194,22 @@ static void lex_advance(Sfio_t *iop, const char *buff, register int size)
sfwrite(sfstderr, buff, size);
}
#endif
- if(lexd.nocopy)
+ if(lp->lexd.nocopy)
return;
- if(lexd.first)
+ if(lp->lexd.first)
{
- size -= (lexd.first-(char*)buff);
- buff = lexd.first;
- if(!lexd.noarg)
- shlex.arg = (struct argnod*)stakseek(ARGVAL);
+ size -= (lp->lexd.first-(char*)buff);
+ buff = lp->lexd.first;
+ if(!lp->lexd.noarg)
+ lp->arg = (struct argnod*)stkseek(stkp,ARGVAL);
#if SHOPT_KIA
- lexd.kiaoff += ARGVAL;
+ lp->lexd.kiaoff += ARGVAL;
#endif /* SHOPT_KIA */
}
- if(size>0 && (shlex.arg||lexd.noarg))
+ if(size>0 && (lp->arg||lp->lexd.noarg))
{
- stakwrite(buff,size);
- lexd.first = 0;
+ sfwrite(stkp,buff,size);
+ lp->lexd.first = 0;
}
}
@@ -222,31 +217,26 @@ static void lex_advance(Sfio_t *iop, const char *buff, register int size)
* fill up another input buffer
* preserves lexical state
*/
-static int lexfill(void)
+static int lexfill(Lex_t *lp)
{
- Shell_t *shp = sh_getinterp();
register int c;
- register Lex_t *lp = (Lex_t*)shp->lex_context;
- struct shlex_t savelex;
- struct lexdata savedata;
- struct lexstate savestate;
+ Lex_t savelex;
struct argnod *ap;
int aok;
- savelex = shlex;
- savedata = lexd;
- savestate = lex;
- ap = shlex.arg;
+ savelex = *lp;
+ ap = lp->arg;
c = fcfill();
if(ap)
- shlex.arg = ap;
- lex = savestate;
- lexd = savedata;
- lexd.first = 0;
- aok= shlex.aliasok;
- ap = shlex.arg;
- shlex = savelex;
- shlex.arg = ap;
- shlex.aliasok = aok;
+ lp->arg = ap;
+ lp->lex = savelex.lex;
+ lp->lexd = savelex.lexd;
+ if(fcfile() || c)
+ lp->lexd.first = 0;
+ aok= lp->aliasok;
+ ap = lp->arg;
+ memcpy(lp, &savelex, offsetof(Lex_t,lexd));
+ lp->arg = ap;
+ lp->aliasok = aok;
return(c);
}
@@ -255,38 +245,37 @@ static int lexfill(void)
*/
Lex_t *sh_lexopen(Lex_t *lp, Shell_t *sp, int mode)
{
- fcnotify(lex_advance);
if(!lp)
{
lp = (Lex_t*)newof(0,Lex_t,1,0);
- lp->_shlex.sh = sp;
+ lp->sh = sp;
}
- lex.intest = lex.incase = lex.skipword = lexd.warn = 0;
- lex.comp_assign = 0;
- lex.reservok = 1;
+ fcnotify(lex_advance,lp);
+ lp->lex.intest = lp->lex.incase = lp->lex.skipword = lp->lexd.warn = 0;
+ lp->comp_assign = 0;
+ lp->lex.reservok = 1;
if(!sh_isoption(SH_DICTIONARY) && sh_isoption(SH_NOEXEC))
- lexd.warn=1;
+ lp->lexd.warn=1;
if(!mode)
{
- lexd.noarg = lexd.level= lexd.dolparen = 0;
- lexd.nocopy = lexd.docword = lexd.nest = lexd.paren = 0;
+ lp->lexd.noarg = lp->lexd.level= lp->lexd.dolparen = lp->lexd.balance = 0;
+ lp->lexd.nocopy = lp->lexd.docword = lp->lexd.nest = lp->lexd.paren = 0;
}
- shlex.comsub = 0;
+ lp->comsub = 0;
return(lp);
}
#ifdef DBUG
-extern int lextoken(void);
-int sh_lex(void)
+extern int lextoken(Lex_t*);
+int sh_lex(Lex_t *lp)
{
- Shell_t *shp = sh_getinterp();
- register Lex_t *lp = (Lex_t*)shp->lex_context;
+ Shell_t *shp = lp->sh;
register int flag;
char *quoted, *macro, *split, *expand;
char tokstr[3];
register int tok = lextoken();
quoted = macro = split = expand = "";
- if(tok==0 && (flag=shlex.arg->argflag))
+ if(tok==0 && (flag=lp->arg->argflag))
{
if(flag&ARG_MAC)
macro = "macro:";
@@ -304,62 +293,62 @@ int sh_lex(void)
/*
* Get the next word and put it on the top of the stak
- * A pointer to the current word is stored in shlex.arg
+ * A pointer to the current word is stored in lp->arg
* Returns the token type
*/
-int sh_lex(void)
+int sh_lex(Lex_t* lp)
{
- register Shell_t *shp = sh_getinterp();
+ register Shell_t *shp = lp->sh;
register const char *state;
- register int n, c, mode=ST_BEGIN, wordflags=0;
- register Lex_t *lp = (Lex_t*)shp->lex_context;
- int inlevel=lexd.level, assignment=0, ingrave=0;
+ register int n, c, mode=ST_BEGIN, wordflags=0;
+ Stk_t *stkp = shp->stk;
+ int inlevel=lp->lexd.level, assignment=0, ingrave=0;
Sfio_t *sp;
#if SHOPT_MULTIBYTE
LEN=1;
#endif /* SHOPT_MULTIBYTE */
- if(lexd.paren)
+ if(lp->lexd.paren)
{
- lexd.paren = 0;
- return(shlex.token=LPAREN);
+ lp->lexd.paren = 0;
+ return(lp->token=LPAREN);
}
- if(lex.incase)
- shlex.assignok = 0;
+ if(lp->lex.incase)
+ lp->assignok = 0;
else
- shlex.assignok |= lex.reservok;
- if(lex.comp_assign==2)
- lex.comp_assign = lex.reservok = 0;
- lexd.arith = (lexd.nest==1);
- if(lexd.nest)
+ lp->assignok |= lp->lex.reservok;
+ if(lp->comp_assign==2)
+ lp->comp_assign = lp->lex.reservok = 0;
+ lp->lexd.arith = (lp->lexd.nest==1);
+ if(lp->lexd.nest)
{
- pushlevel(lexd.nest,ST_NONE);
- lexd.nest = 0;
- mode = lexd.lex_state;
+ pushlevel(lp,lp->lexd.nest,ST_NONE);
+ lp->lexd.nest = 0;
+ mode = lp->lexd.lex_state;
}
- else if(lexd.docword)
+ else if(lp->lexd.docword)
{
if(fcgetc(c)=='-' || c=='#')
{
- lexd.docword++;
- shlex.digits=(c=='#'?3:1);
+ lp->lexd.docword++;
+ lp->digits=(c=='#'?3:1);
}
else if(c=='<')
{
- shlex.digits=2;
- lexd.docword=0;
+ lp->digits=2;
+ lp->lexd.docword=0;
}
else if(c>0)
fcseek(-1);
}
- if(!lexd.dolparen)
+ if(!lp->lexd.dolparen)
{
- shlex.arg = 0;
+ lp->arg = 0;
if(mode!=ST_BEGIN)
- lexd.first = fcseek(0);
+ lp->lexd.first = fcseek(0);
else
- lexd.first = 0;
+ lp->lexd.first = 0;
}
- shlex.lastline = sh.inlineno;
+ lp->lastline = lp->sh->inlineno;
while(1)
{
/* skip over characters in the current state */
@@ -372,7 +361,7 @@ int sh_lex(void)
goto breakloop;
case S_EOF:
sp = fcfile();
- if((n=lexfill()) > 0)
+ if((n=lexfill(lp)) > 0)
{
fcseek(-1);
continue;
@@ -389,16 +378,16 @@ int sh_lex(void)
}
else
{
- shlex.token = -1;
- sh_syntax();
+ lp->token = -1;
+ sh_syntax(lp);
}
}
/* end-of-file */
if(mode==ST_BEGIN)
- return(shlex.token=EOFSYM);
- if(mode >ST_NORM && lexd.level>0)
+ return(lp->token=EOFSYM);
+ if(mode >ST_NORM && lp->lexd.level>0)
{
- switch(c=endchar())
+ switch(c=endchar(lp))
{
case '$':
if(mode==ST_LIT)
@@ -406,8 +395,8 @@ int sh_lex(void)
c = '\'';
break;
}
- mode = oldmode();
- poplevel();
+ mode = oldmode(lp);
+ poplevel(lp);
continue;
case RBRACT:
c = LBRACT;
@@ -420,27 +409,27 @@ int sh_lex(void)
c = LBRACE;
break;
case '"': case '`': case '\'':
- lexd.balance = c;
+ lp->lexd.balance = c;
break;
}
if(sp && !(sfset(sp,0,0)&SF_STRING))
{
- shlex.lasttok = c;
- shlex.token = EOFSYM;
- sh_syntax();
+ lp->lasttok = c;
+ lp->token = EOFSYM;
+ sh_syntax(lp);
}
- lexd.balance = c;
+ lp->lexd.balance = c;
}
goto breakloop;
case S_COM:
/* skip one or more comment line(s) */
- lex.reservok = !lex.intest;
- if((n=lexd.nocopy) && lexd.dolparen)
- lexd.nocopy--;
+ lp->lex.reservok = !lp->lex.intest;
+ if((n=lp->lexd.nocopy) && lp->lexd.dolparen)
+ lp->lexd.nocopy--;
do
{
while(fcgetc(c)>0 && c!='\n');
- if(c<=0 || shlex.heredoc)
+ if(c<=0 || lp->heredoc)
break;
while(shp->inlineno++,fcpeek(0)=='\n')
fcseek(1);
@@ -448,50 +437,51 @@ int sh_lex(void)
fcseek(1);
}
while(c=='#');
- lexd.nocopy = n;
+ lp->lexd.nocopy = n;
if(c<0)
- return(shlex.token=EOFSYM);
+ return(lp->token=EOFSYM);
n = S_NLTOK;
shp->inlineno--;
/* FALL THRU */
case S_NLTOK:
/* check for here-document */
- if(shlex.heredoc)
+ if(lp->heredoc)
{
- if(!lexd.dolparen)
- lexd.nocopy++;
+ if(!lp->lexd.dolparen)
+ lp->lexd.nocopy++;
c = shp->inlineno;
- if(here_copy(lp,shlex.heredoc)<=0 && shlex.lasttok)
+ if(here_copy(lp,lp->heredoc)<=0 && lp->lasttok)
{
- shlex.lasttok = IODOCSYM;
- shlex.token = EOFSYM;
- shlex.lastline = c;
- sh_syntax();
+ lp->lasttok = IODOCSYM;
+ lp->token = EOFSYM;
+ lp->lastline = c;
+ sh_syntax(lp);
}
- if(!lexd.dolparen)
- lexd.nocopy--;
- shlex.heredoc = 0;
+ if(!lp->lexd.dolparen)
+ lp->lexd.nocopy--;
+ lp->heredoc = 0;
}
- lex.reservok = !lex.intest;
- lex.skipword = 0;
+ lp->lex.reservok = !lp->lex.intest;
+ lp->lex.skipword = 0;
/* FALL THRU */
case S_NL:
/* skip over new-lines */
- lex.last_quote = 0;
+ lp->lex.last_quote = 0;
while(shp->inlineno++,fcget()=='\n');
fcseek(-1);
if(n==S_NLTOK)
{
- lex.comp_assign = 0;
- return(shlex.token='\n');
+ lp->comp_assign = 0;
+ return(lp->token='\n');
}
case S_BLNK:
- if(lex.incase<=TEST_RE)
+ if(lp->lex.incase<=TEST_RE)
continue;
/* implicit RPAREN for =~ test operator */
- if(inlevel+1==lexd.level)
+ if(inlevel+1==lp->lexd.level)
{
- fcseek(-1);
+ if(lp->lex.intest)
+ fcseek(-1);
c = RPAREN;
goto do_pop;
}
@@ -500,26 +490,26 @@ int sh_lex(void)
/* return operator token */
if(c=='<' || c=='>')
{
- if(lex.testop2)
- lex.testop2 = 0;
+ if(lp->lex.testop2)
+ lp->lex.testop2 = 0;
else
{
- shlex.digits = (c=='>');
- lex.skipword = 1;
- shlex.aliasok = lex.reservok;
- lex.reservok = 0;
+ lp->digits = (c=='>');
+ lp->lex.skipword = 1;
+ lp->aliasok = lp->lex.reservok;
+ lp->lex.reservok = 0;
}
}
else
{
- lex.reservok = !lex.intest;
+ lp->lex.reservok = !lp->lex.intest;
if(c==RPAREN)
{
- if(!lexd.dolparen)
- lex.incase = 0;
- return(shlex.token=c);
+ if(!lp->lexd.dolparen)
+ lp->lex.incase = 0;
+ return(lp->token=c);
}
- lex.testop1 = lex.intest;
+ lp->lex.testop1 = lp->lex.intest;
}
if(fcgetc(n)>0)
fcseek(-1);
@@ -528,25 +518,25 @@ int sh_lex(void)
if(n==c)
{
if(c=='<')
- lexd.docword=1;
+ lp->lexd.docword=1;
else if(n==LPAREN)
{
- lexd.nest=1;
- shlex.lastline = shp->inlineno;
- lexd.lex_state = ST_NESTED;
+ lp->lexd.nest=1;
+ lp->lastline = shp->inlineno;
+ lp->lexd.lex_state = ST_NESTED;
fcseek(1);
- return(sh_lex());
+ return(sh_lex(lp));
}
c |= SYMREP;
}
else if(c=='(' || c==')')
- return(shlex.token=c);
+ return(lp->token=c);
else if(c=='&')
{
#if SHOPT_BASH
if(!sh_isoption(SH_POSIX) && n=='>')
{
- shlex.digits = -1;
+ lp->digits = -1;
c = '>';
}
else
@@ -560,8 +550,8 @@ int sh_lex(void)
else if(n==LPAREN)
{
c |= SYMLPAR;
- lex.reservok = 1;
- lex.skipword = 0;
+ lp->lex.reservok = 1;
+ lp->lex.skipword = 0;
}
else if(n=='|')
c |= SYMPIPE;
@@ -569,24 +559,33 @@ int sh_lex(void)
c = IORDWRSYM;
else if(n=='#' && (c=='<'||c=='>'))
c |= SYMSHARP;
+ else if(n==';' && c=='>')
+ {
+ c |= SYMSEMI;
+ if(lp->inexec)
+ {
+ lp->token = c;
+ sh_syntax(lp);
+ }
+ }
else
n = 0;
if(n)
{
fcseek(1);
- lex.incase = (c==BREAKCASESYM || c==FALLTHRUSYM);
+ lp->lex.incase = (c==BREAKCASESYM || c==FALLTHRUSYM);
}
else
{
- if((n=fcpeek(0))!=RPAREN && n!=LPAREN && lexd.warn)
+ if((n=fcpeek(0))!=RPAREN && n!=LPAREN && lp->lexd.warn)
errormsg(SH_DICT,ERROR_warn(0),e_lexspace,shp->inlineno,c,n);
}
}
- if(c==LPAREN && lex.comp_assign && !lex.intest && !lex.incase)
- lex.comp_assign = 2;
+ if(c==LPAREN && lp->comp_assign && !lp->lex.intest && !lp->lex.incase)
+ lp->comp_assign = 2;
else
- lex.comp_assign = 0;
- return(shlex.token=c);
+ lp->comp_assign = 0;
+ return(lp->token=c);
case S_ESC:
/* check for \<new-line> */
fcgetc(n);
@@ -612,19 +611,19 @@ int sh_lex(void)
if(!(sp=fcfile()))
state=fcseek(0);
fcclose();
- ap = shlex.arg;
+ ap = lp->arg;
if(sp)
fcfopen(sp);
else
fcsopen((char*)state);
/* remove \new-line */
- n = staktell()-c;
- stakseek(n);
- shlex.arg = ap;
+ n = stktell(stkp)-c;
+ stkseek(stkp,n);
+ lp->arg = ap;
if(n<=ARGVAL)
{
mode = 0;
- lexd.first = 0;
+ lp->lexd.first = 0;
}
continue;
}
@@ -632,23 +631,23 @@ int sh_lex(void)
if(mode==ST_DOL)
goto err;
#ifndef STR_MAXIMAL
- else if(mode==ST_NESTED && lexd.warn &&
- endchar()==RBRACE &&
+ else if(mode==ST_NESTED && lp->lexd.warn &&
+ endchar(lp)==RBRACE &&
sh_lexstates[ST_DOL][n]==S_DIG
)
errormsg(SH_DICT,ERROR_warn(0),e_lexfuture,shp->inlineno,n);
#endif /* STR_MAXIMAL */
break;
case S_NAME:
- if(!lex.skipword)
- lex.reservok *= 2;
+ if(!lp->lex.skipword)
+ lp->lex.reservok *= 2;
/* FALL THRU */
case S_TILDE:
case S_RES:
- if(!lexd.dolparen)
- lexd.first = fcseek(0)-LEN;
- else if(lexd.docword)
- lexd.docend = fcseek(0)-LEN;
+ if(!lp->lexd.dolparen)
+ lp->lexd.first = fcseek(0)-LEN;
+ else if(lp->lexd.docword)
+ lp->lexd.docend = fcseek(0)-LEN;
mode = ST_NAME;
if(c=='.')
fcseek(-1);
@@ -656,7 +655,11 @@ int sh_lex(void)
continue;
fcgetc(n);
if(n>0)
+ {
+ if(c=='~' && n==LPAREN && lp->lex.incase)
+ lp->lex.incase = TEST_RE;
fcseek(-1);
+ }
if(n==LPAREN)
goto epat;
wordflags = ARG_MAC;
@@ -665,6 +668,7 @@ int sh_lex(void)
case S_REG:
if(mode==ST_BEGIN)
{
+ do_reg:
/* skip new-line joining */
if(c=='\\' && fcpeek(0)=='\n')
{
@@ -673,11 +677,11 @@ int sh_lex(void)
continue;
}
fcseek(-1);
- if(!lexd.dolparen)
- lexd.first = fcseek(0);
- else if(lexd.docword)
- lexd.docend = fcseek(0);
- if(c=='[' && shlex.assignok>=SH_ASSIGN)
+ if(!lp->lexd.dolparen)
+ lp->lexd.first = fcseek(0);
+ else if(lp->lexd.docword)
+ lp->lexd.docend = fcseek(0);
+ if(c=='[' && lp->assignok>=SH_ASSIGN)
{
mode = ST_NAME;
continue;
@@ -686,7 +690,7 @@ int sh_lex(void)
mode = ST_NORM;
continue;
case S_LIT:
- if(oldmode()==ST_NONE) /* in ((...)) */
+ if(oldmode(lp)==ST_NONE && !lp->lexd.noarg) /* in ((...)) */
{
if((c=fcpeek(0))==LPAREN || c==RPAREN || c=='$' || c==LBRACE || c==RBRACE || c=='[' || c==']')
{
@@ -698,35 +702,35 @@ int sh_lex(void)
wordflags |= ARG_QUOTED;
if(mode==ST_DOL)
{
- if(endchar()!='$')
+ if(endchar(lp)!='$')
goto err;
- if(oldmode()==ST_QUOTE) /* $' within "" or `` */
+ if(oldmode(lp)==ST_QUOTE) /* $' within "" or `` */
{
- if(lexd.warn)
+ if(lp->lexd.warn)
errormsg(SH_DICT,ERROR_warn(0),e_lexslash,shp->inlineno);
mode = ST_LIT;
}
}
if(mode!=ST_LIT)
{
- if(lexd.warn && lex.last_quote && shp->inlineno > shlex.lastline)
- errormsg(SH_DICT,ERROR_warn(0),e_lexlongquote,shlex.lastline,lex.last_quote);
- lex.last_quote = 0;
- shlex.lastline = shp->inlineno;
+ if(lp->lexd.warn && lp->lex.last_quote && shp->inlineno > lp->lastline)
+ errormsg(SH_DICT,ERROR_warn(0),e_lexlongquote,lp->lastline,lp->lex.last_quote);
+ lp->lex.last_quote = 0;
+ lp->lastline = shp->inlineno;
if(mode!=ST_DOL)
- pushlevel('\'',mode);
+ pushlevel(lp,'\'',mode);
mode = ST_LIT;
continue;
}
/* check for multi-line single-quoted string */
- else if(shp->inlineno > shlex.lastline)
- lex.last_quote = '\'';
- mode = oldmode();
- poplevel();
+ else if(shp->inlineno > lp->lastline)
+ lp->lex.last_quote = '\'';
+ mode = oldmode(lp);
+ poplevel(lp);
break;
case S_ESC2:
/* \ inside '' */
- if(endchar()=='$')
+ if(endchar(lp)=='$')
{
fcgetc(n);
if(n=='\n')
@@ -734,37 +738,40 @@ int sh_lex(void)
}
continue;
case S_GRAVE:
- if(lexd.warn && (mode!=ST_QUOTE || endchar()!='`'))
+ if(lp->lexd.warn && (mode!=ST_QUOTE || endchar(lp)!='`'))
errormsg(SH_DICT,ERROR_warn(0),e_lexobsolete1,shp->inlineno);
wordflags |=(ARG_MAC|ARG_EXP);
if(mode==ST_QUOTE)
ingrave = !ingrave;
/* FALL THRU */
case S_QUOTE:
- if(oldmode()==ST_NONE && lexd.arith) /* in ((...)) */
- continue;
+ if(oldmode(lp)==ST_NONE && lp->lexd.arith) /* in ((...)) */
+ {
+ if(n!=S_GRAVE || fcpeek(0)=='\'')
+ continue;
+ }
if(n==S_QUOTE)
wordflags |=ARG_QUOTED;
if(mode!=ST_QUOTE)
{
if(c!='"' || mode!=ST_QNEST)
{
- if(lexd.warn && lex.last_quote && shp->inlineno > shlex.lastline)
- errormsg(SH_DICT,ERROR_warn(0),e_lexlongquote,shlex.lastline,lex.last_quote);
- lex.last_quote=0;
- shlex.lastline = shp->inlineno;
- pushlevel(c,mode);
+ if(lp->lexd.warn && lp->lex.last_quote && shp->inlineno > lp->lastline)
+ errormsg(SH_DICT,ERROR_warn(0),e_lexlongquote,lp->lastline,lp->lex.last_quote);
+ lp->lex.last_quote=0;
+ lp->lastline = shp->inlineno;
+ pushlevel(lp,c,mode);
}
ingrave = (c=='`');
mode = ST_QUOTE;
continue;
}
- else if((n=endchar())==c)
+ else if((n=endchar(lp))==c)
{
- if(shp->inlineno > shlex.lastline)
- lex.last_quote = c;
- mode = oldmode();
- poplevel();
+ if(shp->inlineno > lp->lastline)
+ lp->lex.last_quote = c;
+ mode = oldmode(lp);
+ poplevel(lp);
}
else if(c=='"' && n==RBRACE)
mode = ST_QNEST;
@@ -774,46 +781,52 @@ int sh_lex(void)
if(mode==ST_QUOTE && ingrave)
continue;
#if SHOPT_KIA
- if(lexd.first)
- lexd.kiaoff = fcseek(0)-lexd.first;
+ if(lp->lexd.first)
+ lp->lexd.kiaoff = fcseek(0)-lp->lexd.first;
else
- lexd.kiaoff = staktell()+fcseek(0)-fcfirst();
+ lp->lexd.kiaoff = stktell(stkp)+fcseek(0)-fcfirst();
#endif /* SHOPT_KIA */
- pushlevel('$',mode);
+ pushlevel(lp,'$',mode);
mode = ST_DOL;
continue;
case S_PAR:
+ do_comsub:
wordflags |= ARG_MAC;
- mode = oldmode();
- poplevel();
+ mode = oldmode(lp);
+ poplevel(lp);
fcseek(-1);
- wordflags |= comsub(lp);
+ wordflags |= comsub(lp,c);
continue;
case S_RBRA:
- if((n=endchar()) == '$')
+ if((n=endchar(lp)) == '$')
goto err;
if(mode!=ST_QUOTE || n==RBRACE)
{
- mode = oldmode();
- poplevel();
+ mode = oldmode(lp);
+ poplevel(lp);
}
break;
case S_EDOL:
/* end $identifier */
#if SHOPT_KIA
- if(shlex.kiafile)
- refvar(0);
+ if(lp->kiafile)
+ refvar(lp,0);
#endif /* SHOPT_KIA */
- if(lexd.warn && c==LBRACT)
+ if(lp->lexd.warn && c==LBRACT && !lp->lex.intest && !lp->lexd.arith && oldmode(lp)!= ST_NESTED)
errormsg(SH_DICT,ERROR_warn(0),e_lexusebrace,shp->inlineno);
fcseek(-1);
- mode = oldmode();
- poplevel();
+ mode = oldmode(lp);
+ poplevel(lp);
break;
case S_DOT:
/* make sure next character is alpha */
if(fcgetc(n)>0)
- fcseek(-1);
+ {
+ if(n=='.')
+ fcgetc(n);
+ if(n>0)
+ fcseek(-1);
+ }
if(isaletter(n) || n==LBRACT)
continue;
if(mode==ST_NAME)
@@ -829,27 +842,27 @@ int sh_lex(void)
goto err;
case S_SPC1:
wordflags |= ARG_MAC;
- if(endchar()==RBRACE)
+ if(endchar(lp)==RBRACE)
{
- setchar(c);
+ setchar(lp,c);
continue;
}
/* FALL THRU */
case S_ALP:
- if(c=='.' && endchar()=='$')
+ if(c=='.' && endchar(lp)=='$')
goto err;
case S_SPC2:
case S_DIG:
wordflags |= ARG_MAC;
- switch(endchar())
+ switch(endchar(lp))
{
case '$':
if(n==S_ALP) /* $identifier */
mode = ST_DOLNAME;
else
{
- mode = oldmode();
- poplevel();
+ mode = oldmode(lp);
+ poplevel(lp);
}
break;
#if SHOPT_TYPEDEF
@@ -862,7 +875,7 @@ int sh_lex(void)
case RBRACE:
if(n==S_ALP)
{
- setchar(RBRACE);
+ setchar(lp,RBRACE);
if(c=='.')
fcseek(-1);
mode = ST_BRACE;
@@ -874,9 +887,9 @@ int sh_lex(void)
if(state[c]==S_ALP)
goto err;
if(n==S_DIG)
- setchar('0');
+ setchar(lp,'0');
else
- setchar('!');
+ setchar(lp,'!');
}
break;
case '0':
@@ -888,23 +901,23 @@ int sh_lex(void)
break;
dolerr:
case S_ERR:
- if((n=endchar()) == '$')
+ if((n=endchar(lp)) == '$')
goto err;
if(c=='*' || (n=sh_lexstates[ST_BRACE][c])!=S_MOD1 && n!=S_MOD2)
{
/* see whether inside `...` */
- mode = oldmode();
- poplevel();
- if((n = endchar()) != '`')
+ mode = oldmode(lp);
+ poplevel(lp);
+ if((n = endchar(lp)) != '`')
goto err;
- pushlevel(RBRACE,mode);
+ pushlevel(lp,RBRACE,mode);
}
else
- setchar(RBRACE);
+ setchar(lp,RBRACE);
mode = ST_NESTED;
continue;
case S_MOD1:
- if(oldmode()==ST_QUOTE || oldmode()==ST_NONE)
+ if(oldmode(lp)==ST_QUOTE || oldmode(lp)==ST_NONE)
{
/* allow ' inside "${...}" */
if(c==':' && fcgetc(n)>0)
@@ -921,8 +934,8 @@ int sh_lex(void)
/* FALL THRU */
case S_MOD2:
#if SHOPT_KIA
- if(shlex.kiafile)
- refvar(1);
+ if(lp->kiafile)
+ refvar(lp,1);
#endif /* SHOPT_KIA */
if(c!=':' && fcgetc(n)>0)
{
@@ -935,10 +948,10 @@ int sh_lex(void)
{
if(c!='%')
{
- shlex.token = n;
- sh_syntax();
+ lp->token = n;
+ sh_syntax(lp);
}
- else if(lexd.warn)
+ else if(lp->lexd.warn)
errormsg(SH_DICT,ERROR_warn(0),e_lexquote,shp->inlineno,'%');
}
}
@@ -946,26 +959,31 @@ int sh_lex(void)
mode = ST_NESTED;
continue;
case S_LBRA:
- if((c=endchar()) == '$')
+ if((c=endchar(lp)) == '$')
{
- setchar(RBRACE);
if(fcgetc(c)>0)
fcseek(-1);
+ setchar(lp,RBRACE);
if(state[c]!=S_ERR && c!=RBRACE)
continue;
+ if((n=sh_lexstates[ST_BEGIN][c])==0 || n==S_OP || n==S_NLTOK)
+ {
+ c = LBRACE;
+ goto do_comsub;
+ }
}
err:
- n = endchar();
- mode = oldmode();
- poplevel();
+ n = endchar(lp);
+ mode = oldmode(lp);
+ poplevel(lp);
if(n!='$')
{
- shlex.token = c;
- sh_syntax();
+ lp->token = c;
+ sh_syntax(lp);
}
else
{
- if(lexd.warn && c!='/' && sh_lexstates[ST_NORM][c]!=S_BREAK && (c!='"' || mode==ST_QUOTE))
+ if(lp->lexd.warn && c!='/' && sh_lexstates[ST_NORM][c]!=S_BREAK && (c!='"' || mode==ST_QUOTE))
errormsg(SH_DICT,ERROR_warn(0),e_lexslash,shp->inlineno);
else if(c=='"' && mode!=ST_QUOTE)
wordflags |= ARG_MESSAGE;
@@ -973,18 +991,23 @@ int sh_lex(void)
}
continue;
case S_META:
- if(lexd.warn && endchar()==RBRACE)
+ if(lp->lexd.warn && endchar(lp)==RBRACE)
errormsg(SH_DICT,ERROR_warn(0),e_lexusequote,shp->inlineno,c);
continue;
case S_PUSH:
- pushlevel(RPAREN,mode);
+ pushlevel(lp,RPAREN,mode);
mode = ST_NESTED;
continue;
case S_POP:
do_pop:
- if(lexd.level <= inlevel)
+ if(lp->lexd.level <= inlevel)
break;
- n = endchar();
+ if(lp->lexd.level==inlevel+1 && lp->lex.incase>=TEST_RE && !lp->lex.intest)
+ {
+ fcseek(-1);
+ goto breakloop;
+ }
+ n = endchar(lp);
if(c==RBRACT && !(n==RBRACT || n==RPAREN))
continue;
if((c==RBRACE||c==RPAREN) && n==RPAREN)
@@ -1001,18 +1024,18 @@ int sh_lex(void)
}
if(c==';' && n!=';')
{
- if(lexd.warn && n==RBRACE)
+ if(lp->lexd.warn && n==RBRACE)
errormsg(SH_DICT,ERROR_warn(0),e_lexusequote,shp->inlineno,c);
continue;
}
if(mode==ST_QNEST)
{
- if(lexd.warn)
+ if(lp->lexd.warn)
errormsg(SH_DICT,ERROR_warn(0),e_lexescape,shp->inlineno,c);
continue;
}
- mode = oldmode();
- poplevel();
+ mode = oldmode(lp);
+ poplevel(lp);
/* quotes in subscript need expansion */
if(mode==ST_NAME && (wordflags&ARG_QUOTED))
wordflags |= ARG_MAC;
@@ -1021,43 +1044,43 @@ int sh_lex(void)
{
if(fcgetc(n)==RPAREN)
{
- if(mode==ST_NONE && !lexd.dolparen)
+ if(mode==ST_NONE && !lp->lexd.dolparen)
goto breakloop;
- lex.reservok = 1;
- lex.skipword = 0;
- return(shlex.token=EXPRSYM);
+ lp->lex.reservok = 1;
+ lp->lex.skipword = 0;
+ return(lp->token=EXPRSYM);
}
/* backward compatibility */
- if(lexd.dolparen)
+ if(lp->lexd.dolparen)
fcseek(-1);
else
{
- if(lexd.warn)
+ if(lp->lexd.warn)
errormsg(SH_DICT,ERROR_warn(0),e_lexnested,shp->inlineno);
- if(!(state=lexd.first))
+ if(!(state=lp->lexd.first))
state = fcfirst();
fcseek(state-fcseek(0));
- if(shlex.arg)
+ if(lp->arg)
{
- shlex.arg = (struct argnod*)stakfreeze(1);
- setupalias(lp,shlex.arg->argval,NIL(Namval_t*));
+ lp->arg = (struct argnod*)stkfreeze(stkp,1);
+ setupalias(lp,lp->arg->argval,NIL(Namval_t*));
}
- lexd.paren = 1;
+ lp->lexd.paren = 1;
}
- return(shlex.token=LPAREN);
+ return(lp->token=LPAREN);
}
if(mode==ST_NONE)
return(0);
if(c!=n)
{
- shlex.token = c;
- sh_syntax();
+ lp->token = c;
+ sh_syntax(lp);
}
if(c==RBRACE && (mode==ST_NAME||mode==ST_NORM))
goto epat;
continue;
case S_EQ:
- assignment = shlex.assignok;
+ assignment = lp->assignok;
/* FALL THRU */
case S_COLON:
if(assignment)
@@ -1070,7 +1093,7 @@ int sh_lex(void)
}
break;
case S_LABEL:
- if(lex.reservok && !lex.incase)
+ if(lp->lex.reservok && !lp->lex.incase)
{
c = fcget();
fcseek(-1);
@@ -1083,12 +1106,12 @@ int sh_lex(void)
break;
case S_BRACT:
/* check for possible subscript */
- if((n=endchar())==RBRACT || n==RPAREN ||
+ if((n=endchar(lp))==RBRACT || n==RPAREN ||
(mode==ST_BRACE) ||
- (oldmode()==ST_NONE) ||
- (mode==ST_NAME && (shlex.assignok||lexd.level)))
+ (oldmode(lp)==ST_NONE) ||
+ (mode==ST_NAME && (lp->assignok||lp->lexd.level)))
{
- pushlevel(RBRACT,mode);
+ pushlevel(lp,RBRACT,mode);
wordflags |= ARG_QUOTED;
mode = ST_NESTED;
continue;
@@ -1098,23 +1121,41 @@ int sh_lex(void)
case S_BRACE:
{
int isfirst;
- if(lexd.dolparen)
+ if(lp->lexd.dolparen)
+ {
+ if(mode==ST_BEGIN && (lp->lex.reservok||lp->comsub))
+ {
+ fcgetc(n);
+ if(n>0)
+ fcseek(-1);
+ else
+ n = '\n';
+ if(n==RBRACT || sh_lexstates[ST_NORM][n])
+ return(lp->token=c);
+ }
break;
- isfirst = (lexd.first&&fcseek(0)==lexd.first+1);
+ }
+ else if(mode==ST_BEGIN)
+ {
+ if(lp->comsub && c==RBRACE)
+ return(lp->token=c);
+ goto do_reg;
+ }
+ isfirst = (lp->lexd.first&&fcseek(0)==lp->lexd.first+1);
fcgetc(n);
/* check for {} */
if(c==LBRACE && n==RBRACE)
break;
if(n>0)
fcseek(-1);
- else if(lex.reservok)
+ else if(lp->lex.reservok)
break;
/* check for reserved word { or } */
- if(lex.reservok && state[n]==S_BREAK && isfirst)
+ if(lp->lex.reservok && state[n]==S_BREAK && isfirst)
break;
if(sh_isoption(SH_BRACEEXPAND) && c==LBRACE && !assignment && state[n]!=S_BREAK
- && !lex.incase && !lex.intest
- && !lex.skipword)
+ && !lp->lex.incase && !lp->lex.intest
+ && !lp->lex.skipword)
{
wordflags |= ARG_EXP;
}
@@ -1129,14 +1170,14 @@ int sh_lex(void)
epat:
if(fcgetc(n)==LPAREN)
{
- if(lex.incase==TEST_RE)
+ if(lp->lex.incase==TEST_RE)
{
- lex.incase++;
- pushlevel(RPAREN,ST_NORM);
+ lp->lex.incase++;
+ pushlevel(lp,RPAREN,ST_NORM);
mode = ST_NESTED;
}
wordflags |= ARG_EXP;
- pushlevel(RPAREN,mode);
+ pushlevel(lp,RPAREN,mode);
mode = ST_NESTED;
continue;
}
@@ -1146,64 +1187,71 @@ int sh_lex(void)
continue;
break;
}
- lex.comp_assign = 0;
+ lp->comp_assign = 0;
if(mode==ST_NAME)
mode = ST_NORM;
else if(mode==ST_NONE)
return(0);
}
breakloop:
- if(lexd.dolparen)
+ if(lp->lexd.nocopy)
+ {
+ lp->lexd.balance = 0;
+ return(0);
+ }
+ if(lp->lexd.dolparen)
{
- lexd.balance = 0;
- if(lexd.docword)
+ lp->lexd.balance = 0;
+ if(lp->lexd.docword)
nested_here(lp);
- lexd.message = (wordflags&ARG_MESSAGE);
- return(shlex.token=0);
+ lp->lexd.message = (wordflags&ARG_MESSAGE);
+ return(lp->token=0);
}
- if(!(state=lexd.first))
+ if(!(state=lp->lexd.first))
state = fcfirst();
n = fcseek(0)-(char*)state;
- if(!shlex.arg)
- shlex.arg = (struct argnod*)stakseek(ARGVAL);
+ if(!lp->arg)
+ lp->arg = (struct argnod*)stkseek(stkp,ARGVAL);
if(n>0)
- stakwrite(state,n);
+ sfwrite(stkp,state,n);
/* add balancing character if necessary */
- if(lexd.balance)
+ if(lp->lexd.balance)
{
- stakputc(lexd.balance);
- lexd.balance = 0;
+ sfputc(stkp,lp->lexd.balance);
+ lp->lexd.balance = 0;
}
- stakputc(0);
- stakseek(staktell()-1);
- state = stakptr(ARGVAL);
- n = staktell()-ARGVAL;
- lexd.first=0;
+ sfputc(stkp,0);
+ stkseek(stkp,stktell(stkp)-1);
+ state = stkptr(stkp,ARGVAL);
+ n = stktell(stkp)-ARGVAL;
+ lp->lexd.first=0;
if(n==1)
{
/* check for numbered redirection */
n = state[0];
if((c=='<' || c=='>') && isadigit(n))
{
- c = sh_lex();
- shlex.digits = (n-'0');
+ c = sh_lex(lp);
+ lp->digits = (n-'0');
return(c);
}
if(n==LBRACT)
c = 0;
+ else if(n==RBRACE && lp->comsub)
+ return(lp->token=n);
else if(n=='~')
c = ARG_MAC;
else
c = (wordflags&ARG_EXP);
n = 1;
}
- else if(n>2 && state[0]=='{' && state[n-1]=='}' && !lex.intest && !lex.incase && (c=='<' || c== '>') && sh_isoption(SH_BRACEEXPAND))
+ else if(n>2 && state[0]=='{' && state[n-1]=='}' && !lp->lex.intest && !lp->lex.incase && (c=='<' || c== '>') && sh_isoption(SH_BRACEEXPAND))
{
if(!strchr(state,','))
{
- stakseek(staktell()-1);
- shlex.arg = (struct argnod*)stakfreeze(1);
- return(shlex.token=IOVNAME);
+ stkseek(stkp,stktell(stkp)-1);
+ lp->arg = (struct argnod*)stkfreeze(stkp,1);
+ return(lp->token=IOVNAME);
}
c = wordflags;
}
@@ -1211,151 +1259,151 @@ breakloop:
c = wordflags;
if(assignment<0)
{
- stakseek(staktell()-1);
- shlex.arg = (struct argnod*)stakfreeze(1);
- lex.reservok = 1;
- return(shlex.token=LABLSYM);
+ stkseek(stkp,stktell(stkp)-1);
+ lp->arg = (struct argnod*)stkfreeze(stkp,1);
+ lp->lex.reservok = 1;
+ return(lp->token=LABLSYM);
}
- if(assignment || (lex.intest&&!lex.incase) || mode==ST_NONE)
+ if(assignment || (lp->lex.intest&&!lp->lex.incase) || mode==ST_NONE)
c &= ~ARG_EXP;
if((c&ARG_EXP) && (c&ARG_QUOTED))
c |= ARG_MAC;
if(mode==ST_NONE)
{
/* eliminate trailing )) */
- stakseek(staktell()-2);
+ stkseek(stkp,stktell(stkp)-2);
}
if(c&ARG_MESSAGE)
{
if(sh_isoption(SH_DICTIONARY))
- shlex.arg = sh_endword(2);
+ lp->arg = sh_endword(shp,2);
if(!sh_isoption(SH_NOEXEC))
{
- shlex.arg = sh_endword(1);
+ lp->arg = sh_endword(shp,1);
c &= ~ARG_MESSAGE;
}
}
- if(c==0 || (c&(ARG_MAC|ARG_EXP)) || (lexd.warn && !lexd.docword))
+ if(c==0 || (c&(ARG_MAC|ARG_EXP)) || (lp->lexd.warn && !lp->lexd.docword))
{
- shlex.arg = (struct argnod*)stakfreeze(1);
- shlex.arg->argflag = (c?c:ARG_RAW);
+ lp->arg = (struct argnod*)stkfreeze(stkp,1);
+ lp->arg->argflag = (c?c:ARG_RAW);
}
else if(mode==ST_NONE)
- shlex.arg = sh_endword(-1);
+ lp->arg = sh_endword(shp,-1);
else
- shlex.arg = sh_endword(0);
- state = shlex.arg->argval;
- lex.comp_assign = assignment;
+ lp->arg = sh_endword(shp,0);
+ state = lp->arg->argval;
+ lp->comp_assign = assignment;
if(assignment)
- shlex.arg->argflag |= ARG_ASSIGN;
- else if(!lex.skipword)
- shlex.assignok = 0;
- shlex.arg->argchn.cp = 0;
- shlex.arg->argnxt.ap = 0;
+ lp->arg->argflag |= ARG_ASSIGN;
+ else if(!lp->lex.skipword)
+ lp->assignok = 0;
+ lp->arg->argchn.cp = 0;
+ lp->arg->argnxt.ap = 0;
if(mode==ST_NONE)
- return(shlex.token=EXPRSYM);
- if(lex.intest)
+ return(lp->token=EXPRSYM);
+ if(lp->lex.intest)
{
- if(lex.testop1)
+ if(lp->lex.testop1)
{
- lex.testop1 = 0;
+ lp->lex.testop1 = 0;
if(n==2 && state[0]=='-' && state[2]==0 &&
strchr(test_opchars,state[1]))
{
- if(lexd.warn && state[1]=='a')
+ if(lp->lexd.warn && state[1]=='a')
errormsg(SH_DICT,ERROR_warn(0),e_lexobsolete2,shp->inlineno);
- shlex.digits = state[1];
- shlex.token = TESTUNOP;
+ lp->digits = state[1];
+ lp->token = TESTUNOP;
}
else if(n==1 && state[0]=='!' && state[1]==0)
{
- lex.testop1 = 1;
- shlex.token = '!';
+ lp->lex.testop1 = 1;
+ lp->token = '!';
}
else
{
- lex.testop2 = 1;
- shlex.token = 0;
+ lp->lex.testop2 = 1;
+ lp->token = 0;
}
- return(shlex.token);
+ return(lp->token);
}
- lex.incase = 0;
+ lp->lex.incase = 0;
c = sh_lookup(state,shtab_testops);
switch(c)
{
case TEST_END:
- lex.testop2 = lex.intest = 0;
- lex.reservok = 1;
- shlex.token = ETESTSYM;
- return(shlex.token);
+ lp->lex.testop2 = lp->lex.intest = 0;
+ lp->lex.reservok = 1;
+ lp->token = ETESTSYM;
+ return(lp->token);
case TEST_SEQ:
- if(lexd.warn && state[1]==0)
+ if(lp->lexd.warn && state[1]==0)
errormsg(SH_DICT,ERROR_warn(0),e_lexobsolete3,shp->inlineno);
/* FALL THRU */
default:
- if(lex.testop2)
+ if(lp->lex.testop2)
{
- if(lexd.warn && (c&TEST_ARITH))
+ if(lp->lexd.warn && (c&TEST_ARITH))
errormsg(SH_DICT,ERROR_warn(0),e_lexobsolete4,shp->inlineno,state);
if(c&TEST_PATTERN)
- lex.incase = 1;
+ lp->lex.incase = 1;
else if(c==TEST_REP)
- lex.incase = TEST_RE;
- lex.testop2 = 0;
- shlex.digits = c;
- shlex.token = TESTBINOP;
- return(shlex.token);
+ lp->lex.incase = TEST_RE;
+ lp->lex.testop2 = 0;
+ lp->digits = c;
+ lp->token = TESTBINOP;
+ return(lp->token);
}
case TEST_OR: case TEST_AND:
case 0:
- return(shlex.token=0);
+ return(lp->token=0);
}
}
- if(lex.reservok /* && !lex.incase*/ && n<=2)
+ if(lp->lex.reservok /* && !lp->lex.incase*/ && n<=2)
{
/* check for {, }, ! */
c = state[0];
if(n==1 && (c=='{' || c=='}' || c=='!'))
{
- if(lexd.warn && c=='{' && lex.incase==2)
+ if(lp->lexd.warn && c=='{' && lp->lex.incase==2)
errormsg(SH_DICT,ERROR_warn(0),e_lexobsolete6,shp->inlineno);
- if(lex.incase==1 && c==RBRACE)
- lex.incase = 0;
- return(shlex.token=c);
+ if(lp->lex.incase==1 && c==RBRACE)
+ lp->lex.incase = 0;
+ return(lp->token=c);
}
- else if(!lex.incase && c==LBRACT && state[1]==LBRACT)
+ else if(!lp->lex.incase && c==LBRACT && state[1]==LBRACT)
{
- lex.intest = lex.testop1 = 1;
- lex.testop2 = lex.reservok = 0;
- return(shlex.token=BTESTSYM);
+ lp->lex.intest = lp->lex.testop1 = 1;
+ lp->lex.testop2 = lp->lex.reservok = 0;
+ return(lp->token=BTESTSYM);
}
}
c = 0;
- if(!lex.skipword)
+ if(!lp->lex.skipword)
{
- if(n>1 && lex.reservok==1 && mode==ST_NAME &&
+ if(n>1 && lp->lex.reservok==1 && mode==ST_NAME &&
(c=sh_lookup(state,shtab_reserved)))
{
- if(lex.incase)
+ if(lp->lex.incase)
{
- if(lex.incase >1)
- lex.incase = 1;
+ if(lp->lex.incase >1)
+ lp->lex.incase = 1;
else if(c==ESACSYM)
- lex.incase = 0;
+ lp->lex.incase = 0;
else
c = 0;
}
else if(c==FORSYM || c==CASESYM || c==SELECTSYM || c==FUNCTSYM || c==NSPACESYM)
{
- lex.skipword = 1;
- lex.incase = 2*(c==CASESYM);
+ lp->lex.skipword = 1;
+ lp->lex.incase = 2*(c==CASESYM);
}
else
- lex.skipword = 0;
+ lp->lex.skipword = 0;
if(c==INSYM)
- lex.reservok = 0;
+ lp->lex.reservok = 0;
else if(c==TIMESYM)
{
/* yech - POSIX requires time -p */
@@ -1365,13 +1413,13 @@ breakloop:
if(n=='-')
c=0;
}
- return(shlex.token=c);
+ return(lp->token=c);
}
- if(!(wordflags&ARG_QUOTED) && (lex.reservok||shlex.aliasok))
+ if(!(wordflags&ARG_QUOTED) && (lp->lex.reservok||lp->aliasok))
{
/* check for aliases */
Namval_t* np;
- if(!lex.incase && !assignment && fcpeek(0)!=LPAREN &&
+ if(!lp->lex.incase && !assignment && fcpeek(0)!=LPAREN &&
(np=nv_search(state,shp->alias_tree,HASH_SCOPE))
&& !nv_isattr(np,NV_NOEXPAND)
#if KSHELL
@@ -1381,33 +1429,35 @@ breakloop:
{
setupalias(lp,state,np);
nv_onattr(np,NV_NOEXPAND);
- lex.reservok = 1;
- shlex.assignok |= lex.reservok;
- return(sh_lex());
+ lp->lex.reservok = 1;
+ lp->assignok |= lp->lex.reservok;
+ return(sh_lex(lp));
}
}
- lex.reservok = 0;
+ lp->lex.reservok = 0;
}
- lex.skipword = lexd.docword = 0;
- return(shlex.token=c);
+ lp->lex.skipword = lp->lexd.docword = 0;
+ return(lp->token=c);
}
/*
* read to end of command substitution
*/
-static int comsub(register Lex_t *lp)
+static int comsub(register Lex_t *lp, int endtok)
{
register int n,c,count=1;
- register int line=shlex.sh->inlineno;
+ register int line=lp->sh->inlineno;
char word[5];
- int messages=0, assignok=shlex.assignok;
+ int messages=0, assignok=lp->assignok, csub;
struct lexstate save;
- save = lex;
- sh_lexopen(lp,shlex.sh,1);
- lexd.dolparen++;
- lex.incase=0;
- pushlevel(0,0);
- if(sh_lex()==LPAREN)
+ save = lp->lex;
+ csub = lp->comsub;
+ sh_lexopen(lp,lp->sh,1);
+ lp->lexd.dolparen++;
+ lp->lex.incase=0;
+ pushlevel(lp,0,0);
+ lp->comsub = (endtok==LBRACE);
+ if(sh_lex(lp)==endtok)
{
while(1)
{
@@ -1428,49 +1478,75 @@ static int comsub(register Lex_t *lp)
if(sh_lexstates[ST_NAME][c]==S_BREAK)
{
if(memcmp(word,"case",4)==0)
- lex.incase=1;
+ lp->lex.incase=1;
else if(memcmp(word,"esac",4)==0)
- lex.incase=0;
+ lp->lex.incase=0;
}
skip:
if(c && (c!='#' || n==0))
fcseek(-1);
- if(c==RBRACE && lex.incase)
- lex.incase=0;
- switch(sh_lex())
+ if(c==RBRACE && lp->lex.incase)
+ lp->lex.incase=0;
+ switch(c=sh_lex(lp))
{
- case LPAREN: case IPROCSYM: case OPROCSYM:
- if(!lex.incase)
+ case LBRACE:
+ if(endtok==LBRACE && !lp->lex.incase)
+ {
+ lp->comsub = 0;
+ count++;
+ }
+ break;
+ case RBRACE:
+ rbrace:
+ if(endtok==LBRACE && --count<=0)
+ goto done;
+ lp->comsub = (count==1);
+ break;
+ case IPROCSYM: case OPROCSYM:
+ case LPAREN:
+ if(endtok==LPAREN && !lp->lex.incase)
count++;
break;
case RPAREN:
- if(lex.incase)
- lex.incase=0;
- else if(--count<=0)
+ if(lp->lex.incase)
+ lp->lex.incase=0;
+ else if(endtok==LPAREN && --count<=0)
goto done;
break;
case EOFSYM:
- shlex.lastline = line;
- shlex.lasttok = LPAREN;
- sh_syntax();
+ lp->lastline = line;
+ lp->lasttok = endtok;
+ sh_syntax(lp);
case IOSEEKSYM:
if(fcgetc(c)!='#' && c>0)
fcseek(-1);
break;
case IODOCSYM:
- sh_lex();
+ sh_lex(lp);
break;
case 0:
- messages |= lexd.message;
+ lp->lex.reservok = 0;
+ messages |= lp->lexd.message;
+ break;
+ case ';':
+ fcgetc(c);
+ if(c==RBRACE && endtok==LBRACE)
+ goto rbrace;
+ if(c>0)
+ fcseek(-1);
+ /* fall through*/
+ default:
+ lp->lex.reservok = 1;
}
}
}
done:
- poplevel();
- shlex.lastline = line;
- lexd.dolparen--;
- lex = save;
- shlex.assignok = (endchar()==RBRACT?assignok:0);
+ poplevel(lp);
+ lp->comsub = csub;
+ lp->lastline = line;
+ lp->lexd.dolparen--;
+ lp->lex = save;
+ lp->assignok = (endchar(lp)==RBRACT?assignok:0);
return(messages);
}
@@ -1480,30 +1556,31 @@ done:
*/
static void nested_here(register Lex_t *lp)
{
- register struct ionod *iop;
- register int n,offset;
- struct argnod *arg = shlex.arg;
- char *base;
- if(offset=staktell())
- base = stakfreeze(0);
- n = fcseek(0)-lexd.docend;
+ register struct ionod *iop;
+ register int n,offset;
+ struct argnod *arg = lp->arg;
+ Stk_t *stkp = lp->sh->stk;
+ char *base;
+ if(offset=stktell(stkp))
+ base = stkfreeze(stkp,0);
+ n = fcseek(0)-lp->lexd.docend;
iop = newof(0,struct ionod,1,n+ARGVAL);
- iop->iolst = shlex.heredoc;
- stakseek(ARGVAL);
- stakwrite(lexd.docend,n);
- shlex.arg = sh_endword(0);
+ iop->iolst = lp->heredoc;
+ stkseek(stkp,ARGVAL);
+ sfwrite(stkp,lp->lexd.docend,n);
+ lp->arg = sh_endword(lp->sh,0);
iop->ioname = (char*)(iop+1);
- strcpy(iop->ioname,shlex.arg->argval);
+ strcpy(iop->ioname,lp->arg->argval);
iop->iofile = (IODOC|IORAW);
- if(lexd.docword>1)
+ if(lp->lexd.docword>1)
iop->iofile |= IOSTRIP;
- shlex.heredoc = iop;
- shlex.arg = arg;
- lexd.docword = 0;
+ lp->heredoc = iop;
+ lp->arg = arg;
+ lp->lexd.docword = 0;
if(offset)
- stakset(base,offset);
+ stkset(stkp,base,offset);
else
- stakseek(0);
+ stkseek(stkp,0);
}
/*
@@ -1511,29 +1588,28 @@ static void nested_here(register Lex_t *lp)
* if <copy> is non,zero, then the characters are copied to the stack
* <state> is the initial lexical state
*/
-void sh_lexskip(int close, register int copy, int state)
+void sh_lexskip(Lex_t *lp,int close, register int copy, int state)
{
- register Lex_t *lp = (Lex_t*)sh.lex_context;
register char *cp;
- lexd.nest = close;
- lexd.lex_state = state;
- lexd.noarg = 1;
+ lp->lexd.nest = close;
+ lp->lexd.lex_state = state;
+ lp->lexd.noarg = 1;
if(copy)
- fcnotify(lex_advance);
+ fcnotify(lex_advance,lp);
else
- lexd.nocopy++;
- sh_lex();
- lexd.noarg = 0;
+ lp->lexd.nocopy++;
+ sh_lex(lp);
+ lp->lexd.noarg = 0;
if(copy)
{
- fcnotify(0);
- if(!(cp=lexd.first))
+ fcnotify(0,lp);
+ if(!(cp=lp->lexd.first))
cp = fcfirst();
if((copy = fcseek(0)-cp) > 0)
- stakwrite(cp,copy);
+ sfwrite(lp->sh->stk,cp,copy);
}
else
- lexd.nocopy--;
+ lp->lexd.nocopy--;
}
#if SHOPT_CRNL
@@ -1571,13 +1647,13 @@ static int here_copy(Lex_t *lp,register struct ionod *iop)
register const char *state;
register int c,n;
register char *bufp,*cp;
- register Sfio_t *sp=shlex.sh->heredocs, *funlog;
+ register Sfio_t *sp=lp->sh->heredocs, *funlog;
int stripcol=0,stripflg, nsave, special=0;
- if(funlog=shlex.sh->funlog)
+ if(funlog=lp->sh->funlog)
{
if(fcfill()>0)
fcseek(-1);
- shlex.sh->funlog = 0;
+ lp->sh->funlog = 0;
}
if(iop->iolst)
here_copy(lp,iop->iolst);
@@ -1621,14 +1697,14 @@ static int here_copy(Lex_t *lp,register struct ionod *iop)
}
if(n==S_EOF || !(c=fcget()))
{
- if(!lexd.dolparen && (c=(fcseek(0)-1)-bufp))
+ if(!lp->lexd.dolparen && (c=(fcseek(0)-1)-bufp))
{
if(n==S_ESC)
c--;
if((c=sfwrite(sp,bufp,c))>0)
iop->iosize += c;
}
- if((c=lexfill())<=0)
+ if((c=lexfill(lp))<=0)
break;
if(n==S_ESC)
{
@@ -1648,10 +1724,10 @@ static int here_copy(Lex_t *lp,register struct ionod *iop)
switch(n)
{
case S_NL:
- shlex.sh->inlineno++;
+ lp->sh->inlineno++;
if((stripcol && c==' ') || (stripflg && c=='\t'))
{
- if(!lexd.dolparen)
+ if(!lp->lexd.dolparen)
{
/* write out line */
n = fcseek(0)-bufp;
@@ -1688,13 +1764,13 @@ static int here_copy(Lex_t *lp,register struct ionod *iop)
{
if(!(c=fcget()))
{
- if(!lexd.dolparen && (c=cp-bufp))
+ if(!lp->lexd.dolparen && (c=cp-bufp))
{
if((c=sfwrite(sp,cp=bufp,c))>0)
iop->iosize+=c;
}
nsave = n;
- if((c=lexfill())<=0)
+ if((c=lexfill(lp))<=0)
{
c = iop->iodelim[n]==0;
goto done;
@@ -1709,15 +1785,15 @@ static int here_copy(Lex_t *lp,register struct ionod *iop)
}
#endif /* SHOPT_CRNL */
if(c==NL)
- shlex.sh->inlineno++;
+ lp->sh->inlineno++;
if(iop->iodelim[n]==0 && (c==NL||c==RPAREN))
{
- if(!lexd.dolparen && (n=cp-bufp))
+ if(!lp->lexd.dolparen && (n=cp-bufp))
{
if((n=sfwrite(sp,bufp,n))>0)
iop->iosize += n;
}
- shlex.sh->inlineno--;
+ lp->sh->inlineno--;
if(c==RPAREN)
fcseek(-1);
goto done;
@@ -1730,7 +1806,7 @@ static int here_copy(Lex_t *lp,register struct ionod *iop)
* was crossed while checking the
* delimiter
*/
- if(!lexd.dolparen && nsave>0)
+ if(!lp->lexd.dolparen && nsave>0)
{
if((n=sfwrite(sp,bufp,nsave))>0)
iop->iosize += n;
@@ -1762,8 +1838,8 @@ static int here_copy(Lex_t *lp,register struct ionod *iop)
if(c==NL)
{
/* new-line joining */
- shlex.sh->inlineno++;
- if(!lexd.dolparen && (n=(fcseek(0)-bufp)-n)>0)
+ lp->sh->inlineno++;
+ if(!lp->lexd.dolparen && (n=(fcseek(0)-bufp)-n)>0)
{
if((n=sfwrite(sp,bufp,n))>0)
iop->iosize += n;
@@ -1783,8 +1859,8 @@ static int here_copy(Lex_t *lp,register struct ionod *iop)
n=0;
}
done:
- shlex.sh->funlog = funlog;
- if(lexd.dolparen)
+ lp->sh->funlog = funlog;
+ if(lp->lexd.dolparen)
free((void*)iop);
else if(!special)
iop->iofile |= IOQUOTE;
@@ -1799,9 +1875,9 @@ static char *fmttoken(Lex_t *lp, register int sym, char *tok)
if(sym < 0)
return((char*)sh_translate(e_lexzerobyte));
if(sym==0)
- return(shlex.arg?shlex.arg->argval:"?");
- if(lex.intest && shlex.arg && *shlex.arg->argval)
- return(shlex.arg->argval);
+ return(lp->arg?lp->arg->argval:"?");
+ if(lp->lex.intest && lp->arg && *lp->arg->argval)
+ return(lp->arg->argval);
if(sym&SYMRES)
{
register const Shtable_t *tp=shtab_reserved;
@@ -1835,6 +1911,9 @@ static char *fmttoken(Lex_t *lp, register int sym, char *tok)
case SYMSHARP:
sym = '#';
break;
+ case SYMSEMI:
+ sym = ';';
+ break;
default:
sym = 0;
}
@@ -1848,22 +1927,21 @@ static char *fmttoken(Lex_t *lp, register int sym, char *tok)
* print a bad syntax message
*/
-void sh_syntax(void)
+void sh_syntax(Lex_t *lp)
{
- register Shell_t *shp = sh_getinterp();
+ register Shell_t *shp = lp->sh;
register const char *cp = sh_translate(e_unexpected);
register char *tokstr;
- register Lex_t *lp = (Lex_t*)shp->lex_context;
- register int tok = shlex.token;
+ register int tok = lp->token;
char tokbuf[3];
Sfio_t *sp;
- if((tok==EOFSYM) && shlex.lasttok)
+ if((tok==EOFSYM) && lp->lasttok)
{
- tok = shlex.lasttok;
+ tok = lp->lasttok;
cp = sh_translate(e_unmatched);
}
else
- shlex.lastline = shp->inlineno;
+ lp->lastline = shp->inlineno;
tokstr = fmttoken(lp,tok,tokbuf);
if((sp=fcfile()) || (shp->infd>=0 && (sp=shp->sftable[shp->infd])))
{
@@ -1876,27 +1954,27 @@ void sh_syntax(void)
}
else
fcclose();
- shp->inlineno = shlex.inlineno;
- shp->st.firstline = shlex.firstline;
+ shp->inlineno = lp->inlineno;
+ shp->st.firstline = lp->firstline;
#if KSHELL
if(!sh_isstate(SH_INTERACTIVE) && !sh_isstate(SH_PROFILE))
#else
if(shp->inlineno!=1)
#endif
- errormsg(SH_DICT,ERROR_exit(SYNBAD),e_lexsyntax1,shlex.lastline,tokstr,cp);
+ errormsg(SH_DICT,ERROR_exit(SYNBAD),e_lexsyntax1,lp->lastline,tokstr,cp);
else
errormsg(SH_DICT,ERROR_exit(SYNBAD),e_lexsyntax2,tokstr,cp);
}
-static char *stack_shift(register char *sp,char *dp)
+static char *stack_shift(Stk_t *stkp, register char *sp,char *dp)
{
register char *ep;
- register int offset = staktell();
- register int left = offset-(sp-stakptr(0));
+ register int offset = stktell(stkp);
+ register int left = offset-(sp-stkptr(stkp,0));
register int shift = (dp+1-sp);
offset += shift;
- stakseek(offset);
- sp = stakptr(offset);
+ stkseek(stkp,offset);
+ sp = stkptr(stkp,offset);
ep = sp - shift;
while(left--)
*--sp = *--ep;
@@ -1911,7 +1989,7 @@ static char *stack_shift(register char *sp,char *dp)
* The result is left on the stak
* If mode==2, the each $"" string is printed on standard output
*/
-struct argnod *sh_endword(int mode)
+struct argnod *sh_endword(Shell_t *shp,int mode)
{
register const char *state = sh_lexstates[ST_NESTED];
register int n;
@@ -1920,8 +1998,9 @@ struct argnod *sh_endword(int mode)
struct argnod* argp=0;
char *ep=0, *xp=0;
int bracket=0;
- stakputc(0);
- sp = stakptr(ARGVAL);
+ Stk_t *stkp=shp->stk;
+ sfputc(stkp,0);
+ sp = stkptr(stkp,ARGVAL);
#if SHOPT_MULTIBYTE
if(mbwide())
{
@@ -1961,10 +2040,10 @@ struct argnod *sh_endword(int mode)
switch(n)
{
case S_EOF:
- stakseek(dp-stakptr(0));
+ stkseek(stkp,dp-stkptr(stkp,0));
if(mode<=0)
{
- argp = (struct argnod*)stakfreeze(0);
+ argp = (struct argnod*)stkfreeze(stkp,0);
argp->argflag = ARG_RAW|ARG_QUOTED;
}
return(argp);
@@ -2015,7 +2094,7 @@ struct argnod *sh_endword(int mode)
dp = ep+n;
if(sp-dp <= 1)
{
- sp = stack_shift(sp,dp);
+ sp = stack_shift(stkp,sp,dp);
dp = sp-1;
ep = dp-n;
}
@@ -2064,7 +2143,7 @@ struct argnod *sh_endword(int mode)
{
if(dp>=sp)
{
- sp = stack_shift(sp,dp+1);
+ sp = stack_shift(stkp,sp,dp+1);
dp = sp-2;
}
*dp++ = '\\';
@@ -2104,7 +2183,7 @@ struct argnod *sh_endword(int mode)
dp[-1] = '\\';
if(dp>=sp)
{
- sp = stack_shift(sp,dp);
+ sp = stack_shift(stkp,sp,dp);
dp = sp-1;
}
*dp++ = ']';
@@ -2120,7 +2199,7 @@ struct argnod *sh_endword(int mode)
dp[-1] = '\\';
if(dp>=sp)
{
- sp = stack_shift(sp,dp);
+ sp = stack_shift(stkp,sp,dp);
dp = sp-1;
}
*dp++ = '[';
@@ -2215,7 +2294,7 @@ static int alias_exceptf(Sfio_t *iop,int type,Sfdisc_t *handle)
/* if last character is a blank, then next work can be alias */
register int c = fcpeek(-1);
if(isblank(c))
- shlex.aliasok = 1;
+ lp->aliasok = 1;
*ap->buf = ap->nextc;
ap->nextc = 0;
sfsetbuf(iop,ap->buf,1);
@@ -2238,11 +2317,11 @@ static void setupalias(Lex_t *lp, const char *string,Namval_t *np)
if(ap->np = np)
{
#if SHOPT_KIA
- if(shlex.kiafile)
+ if(lp->kiafile)
{
unsigned long r;
- r=kiaentity(nv_name(np),-1,'p',0,0,shlex.current,'a',0,"");
- sfprintf(shlex.kiatmp,"p;%..64d;p;%..64d;%d;%d;e;\n",shlex.current,r,shlex.sh->inlineno,shlex.sh->inlineno);
+ r=kiaentity(lp,nv_name(np),-1,'p',0,0,lp->current,'a',0,"");
+ sfprintf(lp->kiatmp,"p;%..64d;p;%..64d;%d;%d;e;\n",lp->current,r,lp->sh->inlineno,lp->sh->inlineno);
}
#endif /* SHOPT_KIA */
if((ap->nextc=fcget())==0)
@@ -2252,13 +2331,13 @@ static void setupalias(Lex_t *lp, const char *string,Namval_t *np)
ap->nextc = 0;
iop = sfopen(NIL(Sfio_t*),(char*)string,"s");
sfdisc(iop, &ap->disc);
- lexd.nocopy++;
+ lp->lexd.nocopy++;
if(!(base=fcfile()))
base = sfopen(NIL(Sfio_t*),fcseek(0),"s");
fcclose();
sfstack(base,iop);
fcfopen(base);
- lexd.nocopy--;
+ lp->lexd.nocopy--;
}
/*
@@ -2266,11 +2345,11 @@ static void setupalias(Lex_t *lp, const char *string,Namval_t *np)
*/
static int stack_grow(Lex_t *lp)
{
- lexd.lex_max += STACK_ARRAY;
- if(lexd.lex_match)
- lexd.lex_match = (int*)realloc((char*)lexd.lex_match,sizeof(int)*lexd.lex_max);
+ lp->lexd.lex_max += STACK_ARRAY;
+ if(lp->lexd.lex_match)
+ lp->lexd.lex_match = (int*)realloc((char*)lp->lexd.lex_match,sizeof(int)*lp->lexd.lex_max);
else
- lexd.lex_match = (int*)malloc(sizeof(int)*STACK_ARRAY);
- return(lexd.lex_match!=0);
+ lp->lexd.lex_match = (int*)malloc(sizeof(int)*STACK_ARRAY);
+ return(lp->lexd.lex_match!=0);
}
diff --git a/usr/src/lib/libshell/common/sh/macro.c b/usr/src/lib/libshell/common/sh/macro.c
index 8108050b14..7b1ab77b48 100644
--- a/usr/src/lib/libshell/common/sh/macro.c
+++ b/usr/src/lib/libshell/common/sh/macro.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -71,11 +71,12 @@ typedef struct _mac_
char arith; /* set for ((...)) */
char let; /* set when expanding let arguments */
char zeros; /* strip leading zeros when set */
+ char arrayok; /* $x[] ok for arrays */
+ char subcopy; /* set when copying subscript */
+ int dotdot; /* set for .. in subscript */
void *nvwalk; /* for name space walking*/
} Mac_t;
-#define mac (*((Mac_t*)(sh.mac_context)))
-
#undef ESCAPE
#define ESCAPE '\\'
#define isescchar(s) ((s)>S_QUOTE)
@@ -95,12 +96,12 @@ typedef struct _mac_
static int substring(const char*, const char*, int[], int);
static void copyto(Mac_t*, int, int);
-static void comsubst(Mac_t*,int);
+static void comsubst(Mac_t*, Shnode_t*, int);
static int varsub(Mac_t*);
static void mac_copy(Mac_t*,const char*, int);
-static void tilde_expand2(int);
-static char *sh_tilde(const char*);
-static char *special(int);
+static void tilde_expand2(Shell_t*,int);
+static char *sh_tilde(Shell_t*,const char*);
+static char *special(Shell_t *,int);
static void endfield(Mac_t*,int);
static void mac_error(Namval_t*);
static char *mac_getstring(char*);
@@ -120,19 +121,19 @@ void *sh_macopen(Shell_t *shp)
/*
* perform only parameter substitution and catch failures
*/
-char *sh_mactry(register char *string)
+char *sh_mactry(Shell_t *shp,register char *string)
{
if(string)
{
int jmp_val;
- int savexit = sh.savexit;
+ int savexit = shp->savexit;
struct checkpt buff;
sh_pushcontext(&buff,SH_JMPSUB);
jmp_val = sigsetjmp(buff.buff,0);
if(jmp_val == 0)
- string = sh_mactrim(string,0);
+ string = sh_mactrim(shp,string,0);
sh_popcontext(&buff);
- sh.savexit = savexit;
+ shp->savexit = savexit;
return(string);
}
return("");
@@ -145,28 +146,31 @@ char *sh_mactry(register char *string)
* yields a single pathname.
* If <mode> negative, than expansion rules for assignment are applied.
*/
-char *sh_mactrim(char *str, register int mode)
+char *sh_mactrim(Shell_t *shp, char *str, register int mode)
{
- register Mac_t *mp = (Mac_t*)sh.mac_context;
- Mac_t savemac;
+ register Mac_t *mp = (Mac_t*)shp->mac_context;
+ Stk_t *stkp = shp->stk;
+ Mac_t savemac;
savemac = *mp;
- stakseek(0);
+ stkseek(stkp,0);
mp->arith = (mode==3);
mp->let = 0;
- sh.argaddr = 0;
+ shp->argaddr = 0;
mp->pattern = (mode==1||mode==2);
mp->patfound = 0;
- mp->assign = (mode<0);
+ mp->assign = 0;
+ if(mode<0)
+ mp->assign = -mode;
mp->quoted = mp->lit = mp->split = mp->quote = 0;
mp->sp = 0;
- if(mp->ifsp=nv_getval(nv_scoped(IFSNOD)))
+ if(mp->ifsp=nv_getval(sh_scoped(shp,IFSNOD)))
mp->ifs = *mp->ifsp;
else
mp->ifs = ' ';
- stakseek(0);
+ stkseek(stkp,0);
fcsopen(str);
copyto(mp,0,mp->arith);
- str = stakfreeze(1);
+ str = stkfreeze(stkp,1);
if(mode==2)
{
/* expand only if unique */
@@ -184,23 +188,24 @@ char *sh_mactrim(char *str, register int mode)
/*
* Perform all the expansions on the argument <argp>
*/
-int sh_macexpand(register struct argnod *argp, struct argnod **arghead,int flag)
+int sh_macexpand(Shell_t* shp, register struct argnod *argp, struct argnod **arghead,int flag)
{
- register int flags = argp->argflag;
- register char *str = argp->argval;
- register Mac_t *mp = (Mac_t*)sh.mac_context;
- char **saveargaddr = sh.argaddr;
- Mac_t savemac;
+ register int flags = argp->argflag;
+ register char *str = argp->argval;
+ register Mac_t *mp = (Mac_t*)shp->mac_context;
+ char **saveargaddr = shp->argaddr;
+ Mac_t savemac;
+ Stk_t *stkp = shp->stk;
savemac = *mp;
mp->sp = 0;
- if(mp->ifsp=nv_getval(nv_scoped(IFSNOD)))
+ if(mp->ifsp=nv_getval(sh_scoped(shp,IFSNOD)))
mp->ifs = *mp->ifsp;
else
mp->ifs = ' ';
- if(flag&ARG_OPTIMIZE)
- sh.argaddr = (char**)&argp->argchn.ap;
+ if((flag&ARG_OPTIMIZE) && !shp->indebug)
+ shp->argaddr = (char**)&argp->argchn.ap;
else
- sh.argaddr = 0;
+ shp->argaddr = 0;
mp->arghead = arghead;
mp->quoted = mp->lit = mp->quote = 0;
mp->arith = ((flag&ARG_ARITH)!=0);
@@ -208,6 +213,7 @@ int sh_macexpand(register struct argnod *argp, struct argnod **arghead,int flag)
mp->split = !(flag&ARG_ASSIGN);
mp->assign = !mp->split;
mp->pattern = mp->split && !(flag&ARG_NOGLOB) && !sh_isoption(SH_NOGLOB);
+ mp->arrayok = mp->arith || (flag&ARG_ARRAYOK);
str = argp->argval;
fcsopen(str);
mp->fields = 0;
@@ -215,29 +221,31 @@ int sh_macexpand(register struct argnod *argp, struct argnod **arghead,int flag)
{
mp->split = 0;
mp->pattern = ((flag&ARG_EXP)!=0);
- stakseek(0);
+ stkseek(stkp,0);
}
else
{
- stakseek(ARGVAL);
- *stakptr(ARGVAL-1) = 0;
+ stkseek(stkp,ARGVAL);
+ *stkptr(stkp,ARGVAL-1) = 0;
}
mp->patfound = 0;
+ if(mp->pattern)
+ mp->arrayok = 0;
copyto(mp,0,mp->arith);
if(!arghead)
{
- argp->argchn.cp = stakfreeze(1);
- if(sh.argaddr)
+ argp->argchn.cp = stkfreeze(stkp,1);
+ if(shp->argaddr)
argp->argflag |= ARG_MAKE;
}
else
{
endfield(mp,mp->quoted);
flags = mp->fields;
- if(flags==1 && sh.argaddr)
+ if(flags==1 && shp->argaddr)
argp->argchn.ap = *arghead;
}
- sh.argaddr = saveargaddr;
+ shp->argaddr = saveargaddr;
*mp = savemac;
return(flags);
}
@@ -246,28 +254,30 @@ int sh_macexpand(register struct argnod *argp, struct argnod **arghead,int flag)
* Expand here document which is stored in <infile> or <string>
* The result is written to <outfile>
*/
-void sh_machere(Sfio_t *infile, Sfio_t *outfile, char *string)
+void sh_machere(Shell_t *shp,Sfio_t *infile, Sfio_t *outfile, char *string)
{
register int c,n;
register const char *state = sh_lexstates[ST_QUOTE];
register char *cp;
- register Mac_t *mp = (Mac_t*)sh.mac_context;
+ register Mac_t *mp = (Mac_t*)shp->mac_context;
+ Lex_t *lp = (Lex_t*)mp->shp->lex_context;
Fcin_t save;
Mac_t savemac;
+ Stk_t *stkp = shp->stk;
savemac = *mp;
- stakseek(0);
- sh.argaddr = 0;
+ stkseek(stkp,0);
+ shp->argaddr = 0;
mp->sp = outfile;
mp->split = mp->assign = mp->pattern = mp->patfound = mp->lit = mp->arith = mp->let = 0;
mp->quote = 1;
- mp->ifsp = nv_getval(nv_scoped(IFSNOD));
+ mp->ifsp = nv_getval(sh_scoped(shp,IFSNOD));
mp->ifs = ' ';
fcsave(&save);
if(infile)
fcfopen(infile);
else
fcsopen(string);
- fcnotify(0);
+ fcnotify(0,lp);
cp = fcseek(0);
while(1)
{
@@ -285,7 +295,7 @@ void sh_machere(Sfio_t *infile, Sfio_t *outfile, char *string)
n=state[*(unsigned char*)cp++];
break;
default:
- /* use state of alpah character */
+ /* use state of alpha character */
n=state['a'];
cp += len;
}
@@ -323,7 +333,7 @@ void sh_machere(Sfio_t *infile, Sfio_t *outfile, char *string)
sfputc(outfile,ESCAPE);
continue;
case S_GRAVE:
- comsubst(mp,0);
+ comsubst(mp,(Shnode_t*)0,0);
break;
case S_DOL:
c = fcget();
@@ -336,30 +346,39 @@ void sh_machere(Sfio_t *infile, Sfio_t *outfile, char *string)
case S_DIG: case S_LBRA:
{
Fcin_t save2;
- int offset = staktell();
+ int offset = stktell(stkp);
int offset2;
- stakputc(c);
+ sfputc(stkp,c);
if(n==S_LBRA)
- sh_lexskip(RBRACE,1,ST_BRACE);
+ {
+ c = fcget();
+ fcseek(-1);
+ if(sh_lexstates[ST_NORM][c]==S_BREAK)
+ {
+ comsubst(mp,(Shnode_t*)0,2);
+ break;
+ }
+ sh_lexskip(lp,RBRACE,1,ST_BRACE);
+ }
else if(n==S_ALP)
{
while(fcgetc(c),isaname(c))
- stakputc(c);
+ sfputc(stkp,c);
fcseek(-1);
}
- stakputc(0);
- offset2 = staktell();
+ sfputc(stkp,0);
+ offset2 = stktell(stkp);
fcsave(&save2);
- fcsopen(stakptr(offset));
+ fcsopen(stkptr(stkp,offset));
varsub(mp);
- if(c=staktell()-offset2)
- sfwrite(outfile,(char*)stakptr(offset2),c);
+ if(c=stktell(stkp)-offset2)
+ sfwrite(outfile,(char*)stkptr(stkp,offset2),c);
fcrestore(&save2);
- stakseek(offset);
+ stkseek(stkp,offset);
break;
}
case S_PAR:
- comsubst(mp,1);
+ comsubst(mp,(Shnode_t*)0,1);
break;
case S_EOF:
if((c=fcfill()) > 0)
@@ -379,23 +398,24 @@ void sh_machere(Sfio_t *infile, Sfio_t *outfile, char *string)
/*
* expand argument but do not trim pattern characters
*/
-char *sh_macpat(register struct argnod *arg, int flags)
+char *sh_macpat(Shell_t *shp,register struct argnod *arg, int flags)
{
register char *sp = arg->argval;
if((arg->argflag&ARG_RAW))
return(sp);
+ sh_stats(STAT_ARGEXPAND);
if(flags&ARG_OPTIMIZE)
arg->argchn.ap=0;
if(!(sp=arg->argchn.cp))
{
- sh_macexpand(arg,NIL(struct argnod**),flags);
+ sh_macexpand(shp,arg,NIL(struct argnod**),flags|ARG_ARRAYOK);
sp = arg->argchn.cp;
if(!(flags&ARG_OPTIMIZE) || !(arg->argflag&ARG_MAKE))
arg->argchn.cp = 0;
arg->argflag &= ~ARG_MAKE;
}
else
- sh.optcount++;
+ sh_stats(STAT_ARGHITS);
return(sp);
}
@@ -407,6 +427,7 @@ static void copyto(register Mac_t *mp,int endch, int newquote)
register int c,n;
register const char *state = sh_lexstates[ST_MACRO];
register char *cp,*first;
+ Lex_t *lp = (Lex_t*)mp->shp->lex_context;
int tilde = -1;
int oldquote = mp->quote;
int ansi_c = 0;
@@ -414,11 +435,12 @@ static void copyto(register Mac_t *mp,int endch, int newquote)
int ere = 0;
int brace = 0;
Sfio_t *sp = mp->sp;
+ Stk_t *stkp = mp->shp->stk;
mp->sp = NIL(Sfio_t*);
mp->quote = newquote;
first = cp = fcseek(0);
if(!mp->quote && *cp=='~')
- tilde = staktell();
+ tilde = stktell(stkp);
/* handle // operator specially */
if(mp->pattern==2 && *cp=='/')
cp++;
@@ -461,7 +483,7 @@ static void copyto(register Mac_t *mp,int endch, int newquote)
/* process ANSI-C escape character */
char *addr= --cp;
if(c)
- stakwrite(first,c);
+ sfwrite(stkp,first,c);
c = chresc(cp,&addr);
cp = addr;
first = fcseek(cp-first);
@@ -473,13 +495,13 @@ static void copyto(register Mac_t *mp,int endch, int newquote)
n = wctomb((char*)mb, c);
for(i=0;i<n;i++)
- stakputc(mb[i]);
+ sfputc(stkp,mb[i]);
}
else
#endif /* SHOPT_MULTIBYTE */
- stakputc(c);
+ sfputc(stkp,c);
if(c==ESCAPE && mp->pattern)
- stakputc(ESCAPE);
+ sfputc(stkp,ESCAPE);
break;
}
else if(sh_isoption(SH_BRACEEXPAND) && mp->pattern==4 && (*cp==',' || *cp==LBRACE || *cp==RBRACE || *cp=='.'))
@@ -491,9 +513,9 @@ static void copyto(register Mac_t *mp,int endch, int newquote)
cp = fcseek(c+2);
if(c= cp[-1])
{
- stakputc(c);
+ sfputc(stkp,c);
if(c==ESCAPE)
- stakputc(ESCAPE);
+ sfputc(stkp,ESCAPE);
}
else
cp--;
@@ -514,12 +536,18 @@ static void copyto(register Mac_t *mp,int endch, int newquote)
(n==S_PAT||n==S_ENDCH||n==S_SLASH||n==S_BRACT||*cp=='-'))))
{
cp += (n!=S_EOF);
+ if(ere && n==S_ESC && *cp =='\\' && cp[1]=='$')
+ {
+ /* convert \\\$ into \$' */
+ sfwrite(stkp,first,c+1);
+ cp = first = fcseek(c+3);
+ }
break;
}
- if(mp->lit || (mp->quote && !isqescchar(n) && n!=S_ENDCH))
+ if(!(ere && *cp=='$') && (mp->lit || (mp->quote && !isqescchar(n) && n!=S_ENDCH)))
{
/* add \ for file expansion */
- stakwrite(first,c+1);
+ sfwrite(stkp,first,c+1);
first = fcseek(c);
break;
}
@@ -530,7 +558,7 @@ static void copyto(register Mac_t *mp,int endch, int newquote)
{
/* eliminate \ */
if(c)
- stakwrite(first,c);
+ sfwrite(stkp,first,c);
/* check new-line joining */
first = fcseek(c+1);
}
@@ -544,18 +572,18 @@ static void copyto(register Mac_t *mp,int endch, int newquote)
if(mp->split && !mp->quote && endch)
mac_copy(mp,first,c);
else
- stakwrite(first,c);
+ sfwrite(stkp,first,c);
}
first = fcseek(c+1);
c = mp->pattern;
if(n==S_GRAVE)
- comsubst(mp,0);
+ comsubst(mp,(Shnode_t*)0,0);
else if((n= *cp)==0 || !varsub(mp))
{
if(n=='\'' && !mp->quote)
ansi_c = 1;
else if(mp->quote || n!='"')
- stakputc('$');
+ sfputc(stkp,'$');
}
cp = first = fcseek(0);
if(*cp)
@@ -572,12 +600,12 @@ static void copyto(register Mac_t *mp,int endch, int newquote)
if(mp->split && !mp->quote && !mp->lit && endch)
mac_copy(mp,first,c);
else
- stakwrite(first,c);
+ sfwrite(stkp,first,c);
}
c += (n!=S_EOF);
first = fcseek(c);
if(tilde>=0)
- tilde_expand2(tilde);
+ tilde_expand2(mp->shp,tilde);
goto done;
case S_QUOTE:
if(mp->lit || mp->arith)
@@ -596,7 +624,7 @@ static void copyto(register Mac_t *mp,int endch, int newquote)
if(mp->split && endch && !mp->quote && !mp->lit)
mac_copy(mp,first,c);
else
- stakwrite(first,c);
+ sfwrite(stkp,first,c);
}
first = fcseek(c+1);
if(n==S_LIT)
@@ -613,26 +641,28 @@ static void copyto(register Mac_t *mp,int endch, int newquote)
mp->quoted++;
break;
case S_BRACT:
- if(mp->arith || ((mp->assign==1 || endch==RBRACT) &&
+ if(mp->arith || (((mp->assign&1) || endch==RBRACT) &&
!(mp->quote || mp->lit)))
{
int offset=0,oldpat = mp->pattern;
- int oldarith = mp->arith;
- stakwrite(first,++c);
- if(mp->assign==1 && first[c-2]=='.')
- offset = staktell();
+ int oldarith = mp->arith, oldsub=mp->subcopy;
+ sfwrite(stkp,first,++c);
+ if((mp->assign&1) && first[c-2]=='.')
+ offset = stktell(stkp);
first = fcseek(c);
mp->pattern = 4;
mp->arith = 0;
+ mp->subcopy = 0;
copyto(mp,RBRACT,0);
+ mp->subcopy = oldsub;
mp->arith = oldarith;
mp->pattern = oldpat;
- stakputc(RBRACT);
+ sfputc(stkp,RBRACT);
if(offset)
{
- cp = stakptr(staktell());
- if(sh_checkid(stakptr(offset),cp)!=cp)
- stakseek(staktell()-2);
+ cp = stkptr(stkp,stktell(stkp));
+ if(sh_checkid(stkptr(stkp,offset),cp)!=cp)
+ stkseek(stkp,stktell(stkp)-2);
}
cp = first = fcseek(0);
break;
@@ -655,6 +685,17 @@ static void copyto(register Mac_t *mp,int endch, int newquote)
--paren;
}
goto pattern;
+ case S_COM:
+ if(mp->pattern==4 && (mp->quote || mp->lit))
+ {
+ if(c)
+ {
+ sfwrite(stkp,first,c);
+ first = fcseek(c);
+ }
+ sfputc(stkp,ESCAPE);
+ }
+ break;
case S_BRACE:
if(!(mp->quote || mp->lit))
{
@@ -674,15 +715,15 @@ static void copyto(register Mac_t *mp,int endch, int newquote)
if(mp->pattern==3)
break;
if(c)
- stakwrite(first,c);
+ sfwrite(stkp,first,c);
first = fcseek(c);
- stakputc(ESCAPE);
+ sfputc(stkp,ESCAPE);
break;
case S_EQ:
if(mp->assign==1)
{
if(*cp=='~' && !endch && !mp->quote && !mp->lit)
- tilde = staktell()+(c+1);
+ tilde = stktell(stkp)+(c+1);
mp->assign = 2;
}
break;
@@ -691,14 +732,14 @@ static void copyto(register Mac_t *mp,int endch, int newquote)
if(tilde >=0)
{
if(c)
- stakwrite(first,c);
+ sfwrite(stkp,first,c);
first = fcseek(c);
- tilde_expand2(tilde);
+ tilde_expand2(mp->shp,tilde);
tilde = -1;
c=0;
}
if(n==S_COLON && mp->assign==2 && *cp=='~' && endch==0 && !mp->quote &&!mp->lit)
- tilde = staktell()+(c+1);
+ tilde = stktell(stkp)+(c+1);
else if(n==S_SLASH && mp->pattern==2)
#if 0
goto pattern;
@@ -706,17 +747,26 @@ static void copyto(register Mac_t *mp,int endch, int newquote)
{
if(mp->quote || mp->lit)
goto pattern;
- stakwrite(first,c+1);
+ sfwrite(stkp,first,c+1);
first = fcseek(c+1);
- c = staktell();
- sh_lexskip(RBRACE,0,ST_NESTED);
- stakseek(c);
+ c = stktell(stkp);
+ sh_lexskip(lp,RBRACE,0,ST_NESTED);
+ stkseek(stkp,c);
cp = fcseek(-1);
- stakwrite(first,cp-first);
+ sfwrite(stkp,first,cp-first);
first=cp;
}
#endif
break;
+ case S_DOT:
+ if(*cp=='.' && mp->subcopy==1)
+ {
+ sfwrite(stkp,first,c);
+ sfputc(stkp,0);
+ mp->dotdot = stktell(stkp);
+ cp = first = fcseek(c+2);
+ }
+ break;
}
}
done:
@@ -729,26 +779,23 @@ done:
*/
static void mac_substitute(Mac_t *mp, register char *cp,char *str,register int subexp[],int subsize)
{
- register int c,n;
-#if 0
- register char *first=cp;
-#else
+ register int c,n;
register char *first=fcseek(0);
- char *ptr;
- Mac_t savemac;
- n = staktell();
+ char *ptr;
+ Mac_t savemac;
+ Stk_t *stkp = mp->shp->stk;
+ n = stktell(stkp);
savemac = *mp;
mp->pattern = 3;
mp->split = 0;
fcsopen(cp);
copyto(mp,0,0);
- stakputc(0);
- ptr = cp = strdup(stakptr(n));
- stakseek(n);
+ sfputc(stkp,0);
+ ptr = cp = strdup(stkptr(stkp,n));
+ stkseek(stkp,n);
*mp = savemac;
fcsopen(first);
first = cp;
-#endif
while(1)
{
while((c= *cp++) && c!=ESCAPE);
@@ -776,9 +823,7 @@ static void mac_substitute(Mac_t *mp, register char *cp,char *str,register int s
}
if(n=cp-first-1)
mac_copy(mp,first,n);
-#if 1
free(ptr);
-#endif
}
#if SHOPT_FILESCAN
@@ -844,14 +889,14 @@ static char *getdolarg(Shell_t *shp, int n, int *size)
/*
* get the prefix after name reference resolution
*/
-static char *prefix(char *id)
+static char *prefix(Shell_t *shp, char *id)
{
Namval_t *np;
register char *cp = strchr(id,'.');
if(cp)
{
*cp = 0;
- np = nv_search(id, sh.var_tree,0);
+ np = nv_search(id, shp->var_tree,0);
*cp = '.';
if(isastchar(cp[1]))
cp[1] = 0;
@@ -859,7 +904,7 @@ static char *prefix(char *id)
{
int n;
char *sp;
- sh.argaddr = 0;
+ shp->argaddr = 0;
while(nv_isref(np))
np = nv_refnode(np);
id = (char*)malloc(strlen(cp)+1+(n=strlen(sp=nv_name(np)))+1);
@@ -878,22 +923,58 @@ static int subcopy(Mac_t *mp, int flag)
{
int split = mp->split;
int xpattern = mp->pattern;
- int loc = staktell();
+ int loc = stktell(mp->shp->stk);
int xarith = mp->arith;
+ int arrayok = mp->arrayok;
mp->split = 0;
mp->arith = 0;
mp->pattern = flag?4:0;
+ mp->arrayok=1;
+ mp->subcopy++;
+ mp->dotdot = 0;
copyto(mp,RBRACT,0);
+ mp->subcopy = 0;
mp->pattern = xpattern;
mp->split = split;
mp->arith = xarith;
+ mp->arrayok = arrayok;
return(loc);
}
+/*
+ * if name is a discipline function, run the function and put the results
+ * on the stack so that ${x.foo} behaves like ${ x.foo;}
+ */
+int sh_macfun(Shell_t *shp, const char *name, int offset)
+{
+ Namval_t *np, *nq;
+ np = nv_bfsearch(name,shp->fun_tree,&nq,(char**)0);
+ if(np)
+ {
+ /* treat ${x.foo} as ${x.foo;} */
+ Shnode_t *tp;
+ char buff[sizeof(struct dolnod)+sizeof(char*)];
+ struct comnod node;
+ struct dolnod *dp = (struct dolnod*)buff;
+ memset(&node,0,sizeof(node));
+ memset(&buff,0,sizeof(buff));
+ tp = (Shnode_t*)&node;
+ tp->com.comarg = (struct argnod*)dp;
+ tp->com.comline = shp->inlineno;
+ dp->dolnum = 2;
+ dp->dolval[0] = strdup(name);
+ stkseek(shp->stk,offset);
+ comsubst((Mac_t*)shp->mac_context,tp,2);
+ free(dp->dolval[0]);
+ return(1);
+ }
+ return(0);
+}
+
static int namecount(Mac_t *mp,const char *prefix)
{
int count = 0;
- mp->nvwalk = nv_diropen(prefix);
+ mp->nvwalk = nv_diropen((Namval_t*)0,prefix);
while(nv_dirnext(mp->nvwalk))
count++;
nv_dirclose(mp->nvwalk);
@@ -905,7 +986,7 @@ static char *nextname(Mac_t *mp,const char *prefix, int len)
char *cp;
if(len==0)
{
- mp->nvwalk = nv_diropen(prefix);
+ mp->nvwalk = nv_diropen((Namval_t*)0,prefix);
return((char*)mp->nvwalk);
}
if(!(cp=nv_dirnext(mp->nvwalk)))
@@ -924,10 +1005,12 @@ static int varsub(Mac_t *mp)
register char *v,*argp=0;
register Namval_t *np = NIL(Namval_t*);
register int dolg=0, mode=0;
+ Lex_t *lp = (Lex_t*)mp->shp->lex_context;
Namarr_t *ap=0;
int dolmax=0, vsize= -1, offset= -1, nulflg, replen=0, bysub=0;
- char idbuff[3], *id = idbuff, *pattern=0, *repstr;
- int oldpat=mp->pattern,idnum=0,flag=0,d;
+ char idbuff[3], *id = idbuff, *pattern=0, *repstr, *arrmax=0;
+ int addsub=0,oldpat=mp->pattern,idnum=0,flag=0,d;
+ Stk_t *stkp = mp->shp->stk;
retry1:
mp->zeros = 0;
idbuff[0] = 0;
@@ -971,19 +1054,19 @@ retry1:
/* FALL THRU */
case S_SPC2:
*id = c;
- v = special(c);
+ v = special(mp->shp,c);
if(isastchar(c))
{
mode = c;
#if SHOPT_FILESCAN
- if(sh.cur_line)
+ if(mp->shp->cur_line)
{
v = getdolarg(&sh,1,(int*)0);
dolmax = MAX_ARGN;
}
else
#endif /* SHOPT_FILESCAN */
- dolmax = sh.st.dolc+1;
+ dolmax = mp->shp->st.dolc+1;
dolg = (v!=0);
}
break;
@@ -995,11 +1078,11 @@ retry1:
case S_PAR:
if(type)
goto nosub;
- comsubst(mp,1);
+ comsubst(mp,(Shnode_t*)0,1);
return(1);
case S_DIG:
c -= '0';
- sh.argaddr = 0;
+ mp->shp->argaddr = 0;
if(type)
{
register int d;
@@ -1009,18 +1092,18 @@ retry1:
}
idnum = c;
if(c==0)
- v = special(c);
+ v = special(mp->shp,c);
#if SHOPT_FILESCAN
- else if(sh.cur_line)
+ else if(mp->shp->cur_line)
{
- sh.used_pos = 1;
+ mp->shp->used_pos = 1;
v = getdolarg(&sh,c,&vsize);
}
#endif /* SHOPT_FILESCAN */
- else if(c <= sh.st.dolc)
+ else if(c <= mp->shp->st.dolc)
{
- sh.used_pos = 1;
- v = sh.st.dolv[c];
+ mp->shp->used_pos = 1;
+ v = mp->shp->st.dolv[c];
}
else
v = 0;
@@ -1028,16 +1111,16 @@ retry1:
case S_ALP:
if(c=='.' && type==0)
goto nosub;
- offset = staktell();
+ offset = stktell(stkp);
do
{
np = 0;
do
- stakputc(c);
+ sfputc(stkp,c);
while(((c=fcget()),(c>0x7f||isaname(c)))||type && c=='.');
- while(c==LBRACT && type)
+ while(c==LBRACT && (type||mp->arrayok))
{
- sh.argaddr=0;
+ mp->shp->argaddr=0;
if((c=fcget(),isastchar(c)) && fcpeek(0)==RBRACT)
{
if(type==M_VNAME)
@@ -1047,9 +1130,9 @@ retry1:
c = fcget();
if(c=='.' || c==LBRACT)
{
- stakputc(LBRACT);
- stakputc(mode);
- stakputc(RBRACT);
+ sfputc(stkp,LBRACT);
+ sfputc(stkp,mode);
+ sfputc(stkp,RBRACT);
}
else
flag = NV_ARRAY;
@@ -1058,23 +1141,43 @@ retry1:
else
{
fcseek(-1);
- if(type==M_VNAME)
- type = M_SUBNAME;
- stakputc(LBRACT);
- v = stakptr(subcopy(mp,1));
- stakputc(RBRACT);
+ c = stktell(stkp);
+ sfputc(stkp,LBRACT);
+ v = stkptr(stkp,subcopy(mp,1));
+ if(type && mp->dotdot)
+ {
+ mode = '@';
+ v[-1] = 0;
+ if(type==M_VNAME)
+ type = M_SUBNAME;
+ else if(type==M_SIZE)
+ goto nosub;
+ }
+ else
+ sfputc(stkp,RBRACT);
c = fcget();
+ if(c==0 && type==M_VNAME)
+ type = M_SUBNAME;
}
}
}
while(type && c=='.');
if(c==RBRACE && type && fcpeek(-2)=='.')
{
- stakseek(staktell()-1);
- type = M_TREE;
+ /* ${x.} or ${x..} */
+ if(fcpeek(-3) == '.')
+ {
+ stkseek(stkp,stktell(stkp)-2);
+ nv_local = 1;
+ }
+ else
+ {
+ stkseek(stkp,stktell(stkp)-1);
+ type = M_TREE;
+ }
}
- stakputc(0);
- id=stakptr(offset);
+ sfputc(stkp,0);
+ id=stkptr(stkp,offset);
if(isastchar(c) && type)
{
if(type==M_VNAME || type==M_SIZE)
@@ -1094,20 +1197,48 @@ retry1:
if(c=='=' || c=='?' || (c==':' && ((d=fcpeek(0))=='=' || d=='?')))
flag &= ~NV_NOADD;
#if SHOPT_FILESCAN
- if(sh.cur_line && *id=='R' && strcmp(id,"REPLY")==0)
+ if(mp->shp->cur_line && *id=='R' && strcmp(id,"REPLY")==0)
{
- sh.argaddr=0;
+ mp->shp->argaddr=0;
np = REPLYNOD;
}
else
#endif /* SHOPT_FILESCAN */
- if(sh.argaddr)
+ if(mp->shp->argaddr)
flag &= ~NV_NOADD;
- np = nv_open(id,sh.var_tree,flag|NV_NOFAIL);
+ np = nv_open(id,mp->shp->var_tree,flag|NV_NOFAIL);
+ if((!np || nv_isnull(np)) && type==M_BRACE && c==RBRACE && !(flag&NV_ARRAY))
+ {
+ if(sh_macfun(mp->shp,id,offset))
+ {
+ fcget();
+ return(1);
+ }
+ }
ap = np?nv_arrayptr(np):0;
if(type)
{
- if(ap && isastchar(mode) && !(ap->nelem&ARRAY_SCAN))
+ if(mp->dotdot)
+ {
+ if(ap)
+ {
+ nv_putsub(np,v,ARRAY_SCAN);
+ v = stkptr(stkp,mp->dotdot);
+ dolmax =1;
+ if(array_assoc(ap))
+ arrmax = strdup(v);
+ else if((dolmax = (int)sh_arith(v))<0)
+ dolmax += array_maxindex(np);
+ if(type==M_SUBNAME)
+ bysub = 1;
+ }
+ else
+ {
+ if((int)sh_arith(v))
+ np = 0;
+ }
+ }
+ else if(ap && (isastchar(mode)||type==M_TREE) && !(ap->nelem&ARRAY_SCAN) && type!=M_SIZE)
nv_putsub(np,NIL(char*),ARRAY_SCAN);
if(!isbracechar(c))
goto nosub;
@@ -1116,37 +1247,53 @@ retry1:
}
else
fcseek(-1);
- if((type==M_VNAME||type==M_SUBNAME) && sh.argaddr && strcmp(nv_name(np),id))
- sh.argaddr = 0;
+ if(type<=1 && np && nv_isvtree(np) && mp->pattern==1 && !mp->split)
+ {
+ int peek=1,cc=fcget();
+ if(type && cc=='}')
+ {
+ cc = fcget();
+ peek = 2;
+ }
+ if(mp->quote && cc=='"')
+ {
+ cc = fcget();
+ peek++;
+ }
+ fcseek(-peek);
+ if(cc==0)
+ mp->assign = 1;
+ }
+ if((type==M_VNAME||type==M_SUBNAME) && mp->shp->argaddr && strcmp(nv_name(np),id))
+ mp->shp->argaddr = 0;
c = (type>M_BRACE && isastchar(mode));
- if(np && (!c || !ap))
+ if(np && (type==M_TREE || !c || !ap))
{
- if(type==M_VNAME)
+ char *savptr;
+ c = *((unsigned char*)stkptr(stkp,offset-1));
+ savptr = stkfreeze(stkp,0);
+ if(type==M_VNAME || (type==M_SUBNAME && ap))
{
type = M_BRACE;
v = nv_name(np);
+ if(ap && !mp->dotdot && !(ap->nelem&ARRAY_UNDEF))
+ addsub = 1;
}
#ifdef SHOPT_TYPEDEF
else if(type==M_TYPE)
{
-#if 0
Namval_t *nq = nv_type(np);
-#else
- Namval_t *nq = 0;
-#endif
type = M_BRACE;
if(nq)
- v = nv_name(nq);
+ nv_typename(nq,mp->shp->strbuf);
else
- {
- nv_attribute(np,sh.strbuf,"typeset",1);
- v = sfstruse(sh.strbuf);
- }
+ nv_attribute(np,mp->shp->strbuf,"typeset",1);
+ v = sfstruse(mp->shp->strbuf);
}
#endif /* SHOPT_TYPEDEF */
#if SHOPT_FILESCAN
- else if(sh.cur_line && np==REPLYNOD)
- v = sh.cur_line;
+ else if(mp->shp->cur_line && np==REPLYNOD)
+ v = mp->shp->cur_line;
#endif /* SHOPT_FILESCAN */
else if(type==M_TREE)
v = nv_getvtree(np,(Namfun_t*)0);
@@ -1154,17 +1301,30 @@ retry1:
{
v = nv_getval(np);
/* special case --- ignore leading zeros */
- if( (mp->arith||mp->let) && (np->nvfun || nv_isattr(np,(NV_LJUST|NV_RJUST|NV_ZFILL))) && (offset==0 || !isalnum(*((unsigned char*)stakptr(offset-1)))))
+ if( (mp->arith||mp->let) && (np->nvfun || nv_isattr(np,(NV_LJUST|NV_RJUST|NV_ZFILL))) && (offset==0 || !isalnum(c)))
mp->zeros = 1;
}
+ if(savptr==stakptr(0))
+ stkseek(stkp,offset);
+ else
+ stkset(stkp,savptr,offset);
}
else
+ {
v = 0;
- stakseek(offset);
+ if(type==M_VNAME)
+ {
+ v = id;
+ type = M_BRACE;
+ }
+ else if(type==M_TYPE)
+ type = M_BRACE;
+ }
+ stkseek(stkp,offset);
if(ap)
{
#if SHOPT_OPTIMIZE
- if(sh.argaddr)
+ if(mp->shp->argaddr)
nv_optimize(np);
#endif
if(isastchar(mode) && array_elem(ap)> !c)
@@ -1185,8 +1345,8 @@ retry1:
mac_error(np);
if(type==M_NAMESCAN || type==M_NAMECOUNT)
{
- id = prefix(id);
- stakseek(offset);
+ id = prefix(mp->shp,id);
+ stkseek(stkp,offset);
if(type==M_NAMECOUNT)
{
c = namecount(mp,id);
@@ -1222,14 +1382,14 @@ retry1:
else if(dolg>0)
{
#if SHOPT_FILESCAN
- if(sh.cur_line)
+ if(mp->shp->cur_line)
{
getdolarg(&sh,MAX_ARGN,(int*)0);
- c = sh.offsets[0];
+ c = mp->shp->offsets[0];
}
else
#endif /* SHOPT_FILESCAN */
- c = sh.st.dolc;
+ c = mp->shp->st.dolc;
}
else if(dolg<0)
c = array_elem(ap);
@@ -1264,7 +1424,7 @@ retry1:
if(c!=RBRACE)
{
int newops = (c=='#' || c == '%' || c=='/');
- offset = staktell();
+ offset = stktell(stkp);
if(c=='/' ||c==':' || ((!v || (nulflg && *v==0)) ^ (c=='+'||c=='#'||c=='%')))
{
int newquote = mp->quote;
@@ -1300,15 +1460,15 @@ retry1:
mp->arith = arith;
mp->zeros = zeros;
/* add null byte */
- stakputc(0);
- stakseek(staktell()-1);
+ sfputc(stkp,0);
+ stkseek(stkp,stktell(stkp)-1);
}
else
{
- sh_lexskip(RBRACE,0,(!newops&&mp->quote)?ST_QUOTE:ST_NESTED);
- stakseek(offset);
+ sh_lexskip(lp,RBRACE,0,(!newops&&mp->quote)?ST_QUOTE:ST_NESTED);
+ stkseek(stkp,offset);
}
- argp=stakptr(offset);
+ argp=stkptr(stkp,offset);
}
}
else
@@ -1327,9 +1487,9 @@ retry1:
if(type<0 && (type+= dolmax)<0)
type = 0;
if(type==0)
- v = special(dolg=0);
+ v = special(mp->shp,dolg=0);
#if SHOPT_FILESCAN
- else if(sh.cur_line)
+ else if(mp->shp->cur_line)
{
v = getdolarg(&sh,dolg=type,&vsize);
if(!v)
@@ -1337,7 +1497,7 @@ retry1:
}
#endif /* SHOPT_FILESCAN */
else if(type < dolmax)
- v = sh.st.dolv[dolg=type];
+ v = mp->shp->st.dolv[dolg=type];
else
v = 0;
}
@@ -1426,7 +1586,7 @@ retry1:
}
if(*ptr)
mac_error(np);
- stakseek(offset);
+ stkseek(stkp,offset);
argp = 0;
}
/* check for substring operations */
@@ -1454,7 +1614,7 @@ retry1:
if((type=='/' || c=='/') && (repstr = mac_getstring(pattern)))
replen = strlen(repstr);
if(v || c=='/' && offset>=0)
- stakseek(offset);
+ stkseek(stkp,offset);
}
/* check for quoted @ */
if(mode=='@' && mp->quote && !v && c!='-')
@@ -1463,7 +1623,7 @@ retry2:
if(v && (!nulflg || *v ) && c!='+')
{
register int d = (mode=='@'?' ':mp->ifs);
- int match[2*(MATCH_MAX+1)], nmatch, vsize_last;
+ int match[2*(MATCH_MAX+1)], nmatch, nmatch_prev, vsize_last;
char *vlast;
while(1)
{
@@ -1471,12 +1631,14 @@ retry2:
v= "";
if(c=='/' || c=='#' || c== '%')
{
- flag = (type || c=='/')?STR_GROUP|STR_MAXIMAL:STR_GROUP;
+ flag = (type || c=='/')?(STR_GROUP|STR_MAXIMAL):STR_GROUP;
if(c!='/')
flag |= STR_LEFT;
+ nmatch = 0;
while(1)
{
vsize = strlen(v);
+ nmatch_prev = nmatch;
if(c=='%')
nmatch=substring(v,pattern,match,flag&STR_MAXIMAL);
else
@@ -1493,7 +1655,7 @@ retry2:
vsize = 0;
if(vsize)
mac_copy(mp,v,vsize);
- if(nmatch && replen>0)
+ if(nmatch && replen>0 && (match[1] || !nmatch_prev))
mac_substitute(mp,repstr,v,match,nmatch);
if(nmatch==0)
v += vsize;
@@ -1503,7 +1665,11 @@ retry2:
{
/* avoid infinite loop */
if(nmatch && match[1]==0)
+ {
+ nmatch = 0;
+ mac_copy(mp,v,1);
v++;
+ }
continue;
}
vsize = -1;
@@ -1514,14 +1680,39 @@ retry2:
}
if(vsize)
mac_copy(mp,v,vsize>0?vsize:strlen(v));
+ if(addsub)
+ {
+ sfprintf(mp->shp->strbuf,"[%s]",nv_getsub(np));
+ v = sfstruse(mp->shp->strbuf);
+ mac_copy(mp, v, strlen(v));
+ }
if(dolg==0 && dolmax==0)
break;
- if(dolg>=0)
+ if(mp->dotdot)
+ {
+ if(nv_nextsub(np) == 0)
+ break;
+ if(bysub)
+ v = nv_getsub(np);
+ else
+ v = nv_getval(np);
+ if(array_assoc(ap))
+ {
+ if(strcmp(bysub?v:nv_getsub(np),arrmax)>0)
+ break;
+ }
+ else
+ {
+ if(nv_aindex(np) > dolmax)
+ break;
+ }
+ }
+ else if(dolg>=0)
{
if(++dolg >= dolmax)
break;
#if SHOPT_FILESCAN
- if(sh.cur_line)
+ if(mp->shp->cur_line)
{
if(dolmax==MAX_ARGN && isastchar(mode))
break;
@@ -1533,7 +1724,7 @@ retry2:
}
else
#endif /* SHOPT_FILESCAN */
- v = sh.st.dolv[dolg];
+ v = mp->shp->st.dolv[dolg];
}
else if(!np)
{
@@ -1547,6 +1738,8 @@ retry2:
nv_putsub(np,NIL(char*),ARRAY_UNDEF);
break;
}
+ if(ap)
+ ap->nelem |= ARRAY_SCAN;
if(nv_nextsub(np) == 0)
break;
if(bysub)
@@ -1566,9 +1759,11 @@ retry2:
if(mp->sp)
sfputc(mp->sp,d);
else
- stakputc(d);
+ sfputc(stkp,d);
}
}
+ if(arrmax)
+ free((void*)arrmax);
if(pattern)
free((void*)pattern);
}
@@ -1584,7 +1779,7 @@ retry2:
id = ltos(idnum);
if(*argp)
{
- stakputc(0);
+ sfputc(stkp,0);
errormsg(SH_DICT,ERROR_exit(1),"%s: %s",id,argp);
}
else if(v)
@@ -1596,12 +1791,12 @@ retry2:
{
if(np)
{
- if(sh.subshell)
+ if(mp->shp->subshell)
np = sh_assignok(np,1);
nv_putval(np,argp,0);
v = nv_getval(np);
nulflg = 0;
- stakseek(offset);
+ stkseek(stkp,offset);
goto retry2;
}
else
@@ -1614,9 +1809,8 @@ retry2:
{
if(nv_isarray(np))
{
- sfprintf(sh.strbuf,"%s[%s]\0",nv_name(np),nv_getsub(np));
- id = nv_getsub(np);
- id = sfstruse(sh.strbuf);
+ sfprintf(mp->shp->strbuf,"%s[%s]\0",nv_name(np),nv_getsub(np));
+ id = sfstruse(mp->shp->strbuf);
}
else
id = nv_name(np);
@@ -1628,6 +1822,12 @@ retry2:
nv_close(np);
return(1);
nosub:
+ if(type==M_BRACE && sh_lexstates[ST_NORM][c]==S_BREAK)
+ {
+ fcseek(-1);
+ comsubst(mp,(Shnode_t*)0,2);
+ return(1);
+ }
if(type)
mac_error(np);
fcseek(-1);
@@ -1639,47 +1839,51 @@ nosub:
* This routine handles command substitution
* <type> is 0 for older `...` version
*/
-static void comsubst(Mac_t *mp,int type)
+static void comsubst(Mac_t *mp,register Shnode_t* t, int type)
{
Sfdouble_t num;
register int c;
register char *str;
Sfio_t *sp;
+ Stk_t *stkp = mp->shp->stk;
Fcin_t save;
- struct slnod *saveslp = sh.st.staklist;
+ struct slnod *saveslp = mp->shp->st.staklist;
struct _mac_ savemac;
- int savtop = staktell();
- char lastc, *savptr = stakfreeze(0);
+ int savtop = stktell(stkp);
+ char lastc, *savptr = stkfreeze(stkp,0);
int was_history = sh_isstate(SH_HISTORY);
int was_verbose = sh_isstate(SH_VERBOSE);
- int newlines,bufsize;
- register Shnode_t *t;
+ int was_interactive = sh_isstate(SH_INTERACTIVE);
+ int newlines,bufsize,nextnewlines;
Namval_t *np;
- sh.argaddr = 0;
+ mp->shp->argaddr = 0;
savemac = *mp;
- sh.st.staklist=0;
+ mp->shp->st.staklist=0;
if(type)
{
sp = 0;
fcseek(-1);
- t = sh_dolparen();
+ if(!t)
+ t = sh_dolparen((Lex_t*)mp->shp->lex_context);
if(t && t->tre.tretyp==TARITH)
{
- str = t->ar.arexpr->argval;
fcsave(&save);
- if(!(t->ar.arexpr->argflag&ARG_RAW))
- str = sh_mactrim(str,3);
- num = sh_arith(str);
+ if((t->ar.arexpr->argflag&ARG_RAW))
+ num = arith_exec(t->ar.arcomp);
+ else
+ num = sh_arith(sh_mactrim(mp->shp,t->ar.arexpr->argval,3));
out_offset:
- stakset(savptr,savtop);
+ stkset(stkp,savptr,savtop);
*mp = savemac;
- if((Sflong_t)num==num)
- sfprintf(sh.strbuf,"%lld",(Sflong_t)num);
+ if((Sflong_t)num!=num)
+ sfprintf(mp->shp->strbuf,"%.*Lg",LDBL_DIG,num);
+ else if(num)
+ sfprintf(mp->shp->strbuf,"%lld",(Sflong_t)num);
else
- sfprintf(sh.strbuf,"%.*Lg",LDBL_DIG,num);
- str = sfstruse(sh.strbuf);
+ sfprintf(mp->shp->strbuf,"%Lg",num);
+ str = sfstruse(mp->shp->strbuf);
mac_copy(mp,str,strlen(str));
- sh.st.staklist = saveslp;
+ mp->shp->st.staklist = saveslp;
fcrestore(&save);
return;
}
@@ -1692,30 +1896,31 @@ static void comsubst(Mac_t *mp,int type)
{
fcgetc(c);
if(!(isescchar(sh_lexstates[ST_QUOTE][c]) ||
- (c=='"' && mp->quote)) || (c=='$' && fcpeek(0)=='\''))
- stakputc(ESCAPE);
+ (c=='"' && mp->quote)))
+ sfputc(stkp,ESCAPE);
}
- stakputc(c);
+ sfputc(stkp,c);
}
- c = staktell();
- str=stakfreeze(1);
+ c = stktell(stkp);
+ str=stkfreeze(stkp,1);
/* disable verbose and don't save in history file */
sh_offstate(SH_HISTORY);
sh_offstate(SH_VERBOSE);
if(mp->sp)
sfsync(mp->sp); /* flush before executing command */
sp = sfnew(NIL(Sfio_t*),str,c,-1,SF_STRING|SF_READ);
- c = sh.inlineno;
- sh.inlineno = error_info.line+sh.st.firstline;
+ c = mp->shp->inlineno;
+ mp->shp->inlineno = error_info.line+mp->shp->st.firstline;
t = (Shnode_t*)sh_parse(mp->shp, sp,SH_EOF|SH_NL);
- sh.inlineno = c;
+ mp->shp->inlineno = c;
+ type = 1;
}
#if KSHELL
if(t)
{
fcsave(&save);
sfclose(sp);
- if(t->tre.tretyp==0 && !t->com.comarg)
+ if(t->tre.tretyp==0 && !t->com.comarg && !t->com.comset)
{
/* special case $(<file) and $(<#file) */
register int fd;
@@ -1726,28 +1931,29 @@ static void comsubst(Mac_t *mp,int type)
if((ip=t->tre.treio) &&
((ip->iofile&IOLSEEK) || !(ip->iofile&IOUFD)) &&
(r=sigsetjmp(buff.buff,0))==0)
- fd = sh_redirect(ip,3);
+ fd = sh_redirect(mp->shp,ip,3);
else
fd = sh_chkopen(e_devnull);
sh_popcontext(&buff);
if(r==0 && ip && (ip->iofile&IOLSEEK))
{
- if(sp=sh.sftable[fd])
+ if(sp=mp->shp->sftable[fd])
num = sftell(sp);
else
num = lseek(fd, (off_t)0, SEEK_CUR);
goto out_offset;
}
sp = sfnew(NIL(Sfio_t*),(char*)malloc(IOBSIZE+1),IOBSIZE,fd,SF_READ|SF_MALLOC);
+ type = 3;
}
else
- sp = sh_subshell(t,sh_isstate(SH_ERREXIT),1);
+ sp = sh_subshell(t,sh_isstate(SH_ERREXIT),type);
fcrestore(&save);
}
else
sp = sfopen(NIL(Sfio_t*),"","sr");
- sh_freeup();
- sh.st.staklist = saveslp;
+ sh_freeup(mp->shp);
+ mp->shp->st.staklist = saveslp;
if(was_history)
sh_onstate(SH_HISTORY);
if(was_verbose)
@@ -1756,16 +1962,17 @@ static void comsubst(Mac_t *mp,int type)
sp = sfpopen(NIL(Sfio_t*),str,"r");
#endif
*mp = savemac;
- np = nv_scoped(IFSNOD);
- nv_putval(np,mp->ifsp,0);
+ np = sh_scoped(mp->shp,IFSNOD);
+ nv_putval(np,mp->ifsp,NV_RDONLY);
mp->ifsp = nv_getval(np);
- stakset(savptr,savtop);
+ stkset(stkp,savptr,savtop);
newlines = 0;
lastc = 0;
sfsetbuf(sp,(void*)sp,0);
bufsize = sfvalue(sp);
/* read command substitution output and put on stack or here-doc */
sfpool(sp, NIL(Sfio_t*), SF_WRITE);
+ sh_offstate(SH_INTERACTIVE);
while((str=(char*)sfreserve(sp,SF_UNBOUND,0)) && (c = sfvalue(sp))>0)
{
#if SHOPT_CRNL
@@ -1790,28 +1997,31 @@ static void comsubst(Mac_t *mp,int type)
}
if(c)
*dp++ = *str++;
- *dp = 0;
str = buff;
c = dp-str;
#endif /* SHOPT_CRNL */
+ /* delay appending trailing new-lines */
+ for(nextnewlines=0; c-->0 && str[c]=='\n'; nextnewlines++);
+ if(c < 0)
+ {
+ newlines += nextnewlines;
+ continue;
+ }
if(newlines >0)
{
if(mp->sp)
sfnputc(mp->sp,'\n',newlines);
- else if(!mp->quote && mp->split && sh.ifstable['\n'])
+ else if(!mp->quote && mp->split && mp->shp->ifstable['\n'])
endfield(mp,0);
- else while(newlines--)
- stakputc('\n');
- newlines = 0;
+ else
+ sfnputc(stkp,'\n',newlines);
}
else if(lastc)
{
mac_copy(mp,&lastc,1);
lastc = 0;
}
- /* delay appending trailing new-lines */
- while(str[--c]=='\n')
- newlines++;
+ newlines = nextnewlines;
if(++c < bufsize)
str[c] = 0;
else
@@ -1822,14 +2032,19 @@ static void comsubst(Mac_t *mp,int type)
}
mac_copy(mp,str,c);
}
- if(--newlines>0 && sh.ifstable['\n']==S_DELIM)
+ if(was_interactive)
+ sh_onstate(SH_INTERACTIVE);
+ if(mp->shp->spid)
+ job_wait(mp->shp->spid);
+ if(--newlines>0 && mp->shp->ifstable['\n']==S_DELIM)
{
if(mp->sp)
sfnputc(mp->sp,'\n',newlines);
- else if(!mp->quote && mp->split && sh.ifstable['\n'])
- endfield(mp,0);
- else while(newlines--)
- stakputc('\n');
+ else if(!mp->quote && mp->split)
+ while(newlines--)
+ endfield(mp,1);
+ else
+ sfnputc(stkp,'\n',newlines);
}
if(lastc)
mac_copy(mp,&lastc,1);
@@ -1844,7 +2059,8 @@ static void mac_copy(register Mac_t *mp,register const char *str, register int s
{
register char *state;
register const char *cp=str;
- register int c,n,nopat;
+ register int c,n,nopat,len;
+ Stk_t *stkp=mp->shp->stk;
nopat = (mp->quote||mp->assign==1||mp->arith);
if(mp->zeros)
{
@@ -1862,6 +2078,14 @@ static void mac_copy(register Mac_t *mp,register const char *str, register int s
/* insert \ before file expansion characters */
while(size-->0)
{
+#if SHOPT_MULTIBYTE
+ if(mbwide() && (len=mbsize(cp))>1)
+ {
+ cp += len;
+ size -= (len-1);
+ continue;
+ }
+#endif
c = state[n= *(unsigned char*)cp++];
if(nopat&&(c==S_PAT||c==S_ESC||c==S_BRACT||c==S_ENDCH) && mp->pattern!=3)
c=1;
@@ -1879,18 +2103,18 @@ static void mac_copy(register Mac_t *mp,register const char *str, register int s
if(c)
{
if(c = (cp-1) - str)
- stakwrite(str,c);
- stakputc(ESCAPE);
+ sfwrite(stkp,str,c);
+ sfputc(stkp,ESCAPE);
str = cp-1;
}
}
if(c = cp-str)
- stakwrite(str,c);
+ sfwrite(stkp,str,c);
}
else if(!mp->quote && mp->split && (mp->ifs||mp->pattern))
{
/* split words at ifs characters */
- state = sh.ifstable;
+ state = mp->shp->ifstable;
if(mp->pattern)
{
char *sp = "&|()";
@@ -1910,11 +2134,21 @@ static void mac_copy(register Mac_t *mp,register const char *str, register int s
}
while(size-->0)
{
- if((n=state[c= *(unsigned char*)cp++])==S_ESC || n==S_EPAT)
+ n=state[c= *(unsigned char*)cp++];
+#if SHOPT_MULTIBYTE
+ if(mbwide() && n!=S_MBYTE && (len=mbsize(cp-1))>1)
+ {
+ sfwrite(stkp,cp-1, len);
+ cp += --len;
+ size -= len;
+ continue;
+ }
+#endif
+ if(n==S_ESC || n==S_EPAT)
{
/* don't allow extended patterns in this case */
mp->patfound = mp->pattern;
- stakputc(ESCAPE);
+ sfputc(stkp,ESCAPE);
}
else if(n==S_PAT)
mp->patfound = mp->pattern;
@@ -1963,7 +2197,7 @@ static void mac_copy(register Mac_t *mp,register const char *str, register int s
continue;
}
- stakputc(c);
+ sfputc(stkp,c);
}
if(mp->pattern)
{
@@ -1979,12 +2213,12 @@ static void mac_copy(register Mac_t *mp,register const char *str, register int s
if(state[c]==S_PAT)
state[c] = 0;
}
- if(sh.ifstable[ESCAPE]==S_ESC)
- sh.ifstable[ESCAPE] = 0;
+ if(mp->shp->ifstable[ESCAPE]==S_ESC)
+ mp->shp->ifstable[ESCAPE] = 0;
}
}
else
- stakwrite(str,size);
+ sfwrite(stkp,str,size);
}
/*
@@ -1994,16 +2228,17 @@ static void mac_copy(register Mac_t *mp,register const char *str, register int s
*/
static void endfield(register Mac_t *mp,int split)
{
- register struct argnod *argp;
- register int count=0;
- if(staktell() > ARGVAL || split)
+ register struct argnod *argp;
+ register int count=0;
+ Stk_t *stkp = mp->shp->stk;
+ if(stktell(stkp) > ARGVAL || split)
{
- argp = (struct argnod*)stakfreeze(1);
+ argp = (struct argnod*)stkfreeze(stkp,1);
argp->argnxt.cp = 0;
argp->argflag = 0;
if(mp->patfound)
{
- sh.argaddr = 0;
+ mp->shp->argaddr = 0;
#if SHOPT_BRACEPAT
count = path_generate(argp,mp->arghead);
#else
@@ -2028,7 +2263,7 @@ static void endfield(register Mac_t *mp,int split)
if(mp->assign || sh_isoption(SH_NOGLOB))
argp->argflag |= ARG_RAW|ARG_EXP;
}
- stakseek(ARGVAL);
+ stkseek(stkp,ARGVAL);
}
mp->quoted = mp->quote;
}
@@ -2129,9 +2364,9 @@ static int charlen(const char *string,int len)
*/
static int sh_btilde(int argc, char *argv[], void *context)
{
- char *cp = sh_tilde(argv[1]);
+ Shell_t *shp = ((Shbltin_t*)context)->shp;
+ char *cp = sh_tilde(shp,argv[1]);
NOT_USED(argc);
- NOT_USED(context);
if(!cp)
cp = argv[1];
sfputr(sfstdout, cp, '\n');
@@ -2141,18 +2376,19 @@ static int sh_btilde(int argc, char *argv[], void *context)
/*
* <offset> is byte offset for beginning of tilde string
*/
-static void tilde_expand2(register int offset)
+static void tilde_expand2(Shell_t *shp, register int offset)
{
- char shtilde[10], *av[3], *ptr=stakfreeze(1);
+ char shtilde[10], *av[3], *ptr=stkfreeze(shp->stk,1);
Sfio_t *iop, *save=sfstdout;
Namval_t *np;
static int beenhere=0;
strcpy(shtilde,".sh.tilde");
- np = nv_open(shtilde,sh.fun_tree, NV_VARNAME|NV_NOARRAY|NV_NOASSIGN|NV_NOFAIL);
+ np = nv_open(shtilde,shp->fun_tree, NV_VARNAME|NV_NOARRAY|NV_NOASSIGN|NV_NOFAIL);
if(np && !beenhere)
{
beenhere = 1;
sh_addbuiltin(shtilde,sh_btilde,0);
+ nv_onattr(np,NV_EXPORT);
}
av[0] = ".sh.tilde";
av[1] = &ptr[offset];
@@ -2165,7 +2401,7 @@ static void tilde_expand2(register int offset)
else
sh_btilde(2, av, &sh);
sfstdout = save;
- stakset(ptr, offset);
+ stkset(shp->stk,ptr, offset);
sfseek(iop,(Sfoff_t)0,SEEK_SET);
sfset(iop,SF_READ,1);
if(ptr = sfreserve(iop, SF_UNBOUND, -1))
@@ -2176,10 +2412,10 @@ static void tilde_expand2(register int offset)
if(n==1 && fcpeek(0)=='/' && ptr[n-1])
n--;
if(n)
- stakwrite(ptr,n);
+ sfwrite(shp->stk,ptr,n);
}
else
- stakputs(av[1]);
+ sfputr(shp->stk,av[1],0);
sfclose(iop);
}
@@ -2192,7 +2428,7 @@ static void tilde_expand2(register int offset)
* If string doesn't start with ~ or ~... not found then 0 returned.
*/
-static char *sh_tilde(register const char *string)
+static char *sh_tilde(Shell_t *shp,register const char *string)
{
register char *cp;
register int c;
@@ -2203,16 +2439,16 @@ static char *sh_tilde(register const char *string)
return(NIL(char*));
if((c = *string)==0)
{
- if(!(cp=nv_getval(nv_scoped(HOME))))
+ if(!(cp=nv_getval(sh_scoped(shp,HOME))))
cp = getlogin();
return(cp);
}
if((c=='-' || c=='+') && string[1]==0)
{
if(c=='+')
- cp = nv_getval(nv_scoped(PWDNOD));
+ cp = nv_getval(sh_scoped(shp,PWDNOD));
else
- cp = nv_getval(nv_scoped(OLDPWDNOD));
+ cp = nv_getval(sh_scoped(shp,OLDPWDNOD));
return(cp);
}
if(logins_tree && (np=nv_search(string,logins_tree,0)))
@@ -2229,40 +2465,40 @@ static char *sh_tilde(register const char *string)
/*
* return values for special macros
*/
-static char *special(register int c)
+static char *special(Shell_t *shp,register int c)
{
register Namval_t *np;
if(c!='$')
- sh.argaddr = 0;
+ shp->argaddr = 0;
switch(c)
{
case '@':
case '*':
- return(sh.st.dolc>0?sh.st.dolv[1]:NIL(char*));
+ return(shp->st.dolc>0?shp->st.dolv[1]:NIL(char*));
case '#':
#if SHOPT_FILESCAN
- if(sh.cur_line)
+ if(shp->cur_line)
{
- getdolarg(&sh,MAX_ARGN,(int*)0);
- return(ltos(sh.offsets[0]));
+ getdolarg(shp,MAX_ARGN,(int*)0);
+ return(ltos(shp->offsets[0]));
}
#endif /* SHOPT_FILESCAN */
- return(ltos(sh.st.dolc));
+ return(ltos(shp->st.dolc));
case '!':
- if(sh.bckpid)
- return(ltos(sh.bckpid));
+ if(shp->bckpid)
+ return(ltos(shp->bckpid));
break;
case '$':
if(nv_isnull(SH_DOLLARNOD))
- return(ltos(sh.pid));
+ return(ltos(shp->pid));
return(nv_getval(SH_DOLLARNOD));
case '-':
- return(sh_argdolminus());
+ return(sh_argdolminus(shp->arg_context));
case '?':
- return(ltos(sh.savexit));
+ return(ltos(shp->savexit));
case 0:
- if(sh_isstate(SH_PROFILE) || !error_info.id || ((np=nv_search(error_info.id,sh.bltin_tree,0)) && nv_isattr(np,BLT_SPC)))
- return(sh.shname);
+ if(sh_isstate(SH_PROFILE) || !error_info.id || ((np=nv_search(error_info.id,shp->bltin_tree,0)) && nv_isattr(np,BLT_SPC)))
+ return(shp->shname);
else
return(error_info.id);
}
@@ -2281,21 +2517,29 @@ static void mac_error(Namval_t *np)
/*
* Given pattern/string, replace / with 0 and return pointer to string
- * \ characters are stripped from string.
+ * \ characters are stripped from string. The \ are stripped in the
+ * replacement string unless followed by a digit or \.
*/
static char *mac_getstring(char *pattern)
{
- register char *cp = pattern;
- register int c;
+ register char *cp=pattern, *rep=0, *dp;
+ register int c;
while(c = *cp++)
{
- if(c==ESCAPE)
- cp++;
- else if(c=='/')
+ if(c==ESCAPE && (!rep || (*cp && strchr("&|()[]*?",*cp))))
+ {
+ c = *cp++;
+ }
+ else if(!rep && c=='/')
{
cp[-1] = 0;
- return(cp);
+ rep = dp = cp;
+ continue;
}
+ if(rep)
+ *dp++ = c;
}
- return(NIL(char*));
+ if(rep)
+ *dp = 0;
+ return(rep);
}
diff --git a/usr/src/lib/libshell/common/sh/main.c b/usr/src/lib/libshell/common/sh/main.c
index 0b2f4ac875..793e978b56 100644
--- a/usr/src/lib/libshell/common/sh/main.c
+++ b/usr/src/lib/libshell/common/sh/main.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -130,7 +130,7 @@ int sh_source(Shell_t *shp, Sfio_t *iop, const char *file)
#define REMOTE(m) !(m)
#endif
-int sh_main(int ac, char *av[], void (*userinit)(int))
+int sh_main(int ac, char *av[], Shinit_f userinit)
{
register char *name;
register int fdin;
@@ -140,7 +140,7 @@ int sh_main(int ac, char *av[], void (*userinit)(int))
int i, rshflag; /* set for restricted shell */
char *command;
#ifdef _lib_sigvec
- /* This is to clear mask that my be left on by rlogin */
+ /* This is to clear mask that may be left on by rlogin */
clearsigmask(SIGALRM);
clearsigmask(SIGHUP);
clearsigmask(SIGCHLD);
@@ -160,8 +160,6 @@ int sh_main(int ac, char *av[], void (*userinit)(int))
{
/* begin script execution here */
sh_reinit((char**)0);
- if(rshflag)
- sh_onoption(SH_RESTRICTED);
}
shp->fn_depth = shp->dot_depth = 0;
command = error_info.id;
@@ -184,10 +182,11 @@ int sh_main(int ac, char *av[], void (*userinit)(int))
if(shp->login_sh >= 2)
sh_onoption(SH_LOGIN_SHELL);
/* decide whether shell is interactive */
- if(!sh_isoption(SH_TFLAG) && !sh_isoption(SH_CFLAG) && sh_isoption(SH_SFLAG) &&
- tty_check(0) && tty_check(ERRIO))
- {
+ if(!sh_isoption(SH_INTERACTIVE) && !sh_isoption(SH_TFLAG) && !sh_isoption(SH_CFLAG) &&
+ sh_isoption(SH_SFLAG) && tty_check(0) && tty_check(ERRIO))
sh_onoption(SH_INTERACTIVE);
+ if(sh_isoption(SH_INTERACTIVE))
+ {
sh_onoption(SH_BGNICE);
sh_onoption(SH_RC);
}
@@ -197,8 +196,8 @@ int sh_main(int ac, char *av[], void (*userinit)(int))
#endif
))
sh_onoption(SH_RC);
- for(i=0; i<elementsof(sh.offoptions.v); i++)
- sh.options.v[i] &= ~sh.offoptions.v[i];
+ for(i=0; i<elementsof(shp->offoptions.v); i++)
+ shp->options.v[i] &= ~shp->offoptions.v[i];
if(sh_isoption(SH_INTERACTIVE))
{
#ifdef SIGXCPU
@@ -209,15 +208,15 @@ int sh_main(int ac, char *av[], void (*userinit)(int))
#endif /* SIGXFSZ */
sh_onoption(SH_MONITOR);
}
- job_init(sh_isoption(SH_LOGIN_SHELL));
- if(sh_isoption(SH_LOGIN_SHELL) && !sh_isoption(SH_NOPROFILE))
+ job_init(shp,sh_isoption(SH_LOGIN_SHELL));
+ if(sh_isoption(SH_LOGIN_SHELL))
{
/* system profile */
sh_source(shp, iop, e_sysprofile);
if(!sh_isoption(SH_NOUSRPROFILE) && !sh_isoption(SH_PRIVILEGED))
{
char **files = shp->login_files;
- while ((name = *files++) && !sh_source(shp, iop, sh_mactry(name)));
+ while ((name = *files++) && !sh_source(shp, iop, sh_mactry(shp,name)));
}
}
/* make sure PWD is set up correctly */
@@ -232,15 +231,22 @@ int sh_main(int ac, char *av[], void (*userinit)(int))
#if SHOPT_SYSRC
sh_source(shp, iop, e_bash_sysrc);
#endif
- sh_source(shp, iop, shp->rcfile ? shp->rcfile : sh_mactry((char*)e_bash_rc));
+ sh_source(shp, iop, shp->rcfile ? shp->rcfile : sh_mactry(shp,(char*)e_bash_rc));
}
else
#endif
{
+ if(name = sh_mactry(shp,nv_getval(ENVNOD)))
+ name = *name ? strdup(name) : (char*)0;
#if SHOPT_SYSRC
- sh_source(shp, iop, e_sysrc);
+ if(!strmatch(name, "?(.)/./*"))
+ sh_source(shp, iop, e_sysrc);
#endif
- sh_source(shp, iop, sh_mactry(nv_getval(ENVNOD)));
+ if(name)
+ {
+ sh_source(shp, iop, name);
+ free(name);
+ }
}
}
else if(sh_isoption(SH_INTERACTIVE) && sh_isoption(SH_PRIVILEGED))
@@ -272,7 +278,7 @@ int sh_main(int ac, char *av[], void (*userinit)(int))
int type;
fdin = (int)strtol(name+8, (char**)0, 10);
if(fstat(fdin,&statb)<0)
- errormsg(SH_DICT,ERROR_system(1),e_open,error_info.id);
+ errormsg(SH_DICT,ERROR_system(1),e_open,name);
#if !_WINIX
/*
* try to undo effect of solaris 2.5+
@@ -356,7 +362,7 @@ int sh_main(int ac, char *av[], void (*userinit)(int))
sh_onstate(SH_INTERACTIVE);
nv_putval(IFSNOD,(char*)e_sptbnl,NV_RDONLY);
exfile(shp,iop,fdin);
- sh_done(0);
+ sh_done(shp,0);
/* NOTREACHED */
return(0);
}
@@ -389,7 +395,7 @@ static void exfile(register Shell_t *shp, register Sfio_t *iop,register int fno)
}
fcntl(fno,F_SETFD,FD_CLOEXEC);
shp->fdstatus[fno] |= IOCLEX;
- iop = sh_iostream(fno);
+ iop = sh_iostream((void*)shp,fno);
}
else
iop = sfstdin;
@@ -402,7 +408,7 @@ static void exfile(register Shell_t *shp, register Sfio_t *iop,register int fno)
if(nv_isnull(PS1NOD))
nv_putval(PS1NOD,(shp->euserid?e_stdprompt:e_supprompt),NV_RDONLY);
sh_sigdone();
- if(sh_histinit())
+ if(sh_histinit((void*)shp))
sh_onoption(SH_HISTORY);
}
else
@@ -423,14 +429,14 @@ static void exfile(register Shell_t *shp, register Sfio_t *iop,register int fno)
if(jmpval)
{
Sfio_t *top;
- sh_iorestore(0,jmpval);
+ sh_iorestore((void*)shp,0,jmpval);
hist_flush(shp->hist_ptr);
sfsync(shp->outpool);
shp->st.execbrk = shp->st.breakcnt = 0;
/* check for return from profile or env file */
if(sh_isstate(SH_PROFILE) && (jmpval==SH_JMPFUN || jmpval==SH_JMPEXIT))
goto done;
- if(!sh_isoption(SH_INTERACTIVE) || sh_isstate(SH_FORKED) || (jmpval > SH_JMPERREXIT && job_close() >=0))
+ if(!sh_isoption(SH_INTERACTIVE) || sh_isstate(SH_FORKED) || (jmpval > SH_JMPERREXIT && job_close(shp) >=0))
{
sh_offstate(SH_INTERACTIVE);
sh_offstate(SH_MONITOR);
@@ -466,7 +472,7 @@ static void exfile(register Shell_t *shp, register Sfio_t *iop,register int fno)
while(1)
{
shp->nextprompt = 1;
- sh_freeup();
+ sh_freeup(shp);
stakset(NIL(char*),0);
exitset();
sh_offstate(SH_STOPOK);
@@ -540,7 +546,7 @@ static void exfile(register Shell_t *shp, register Sfio_t *iop,register int fno)
errormsg(SH_DICT,0,e_logout);
continue;
}
- else if(job_close()<0)
+ else if(job_close(shp)<0)
continue;
}
if(errno==0 && sferror(iop) && --maxtry>0)
@@ -596,12 +602,12 @@ done:
if(sh_isstate(SH_INTERACTIVE))
{
sfputc(sfstderr,'\n');
- job_close();
+ job_close(shp);
}
if(jmpval == SH_JMPSCRIPT)
siglongjmp(*shp->jmplist,jmpval);
else if(jmpval == SH_JMPEXIT)
- sh_done(0);
+ sh_done(shp,0);
if(fno>0)
sh_close(fno);
if(shp->st.filename)
@@ -662,7 +668,7 @@ static void chkmail(Shell_t *shp, char *files)
/* save and restore $_ */
char *save = shp->lastarg;
shp->lastarg = cp;
- errormsg(SH_DICT,0,sh_mactry(qp?qp+1:(char*)e_mailmsg));
+ errormsg(SH_DICT,0,sh_mactry(shp,qp?qp+1:(char*)e_mailmsg));
shp->lastarg = save;
}
lastmail = statb;
diff --git a/usr/src/lib/libshell/common/sh/name.c b/usr/src/lib/libshell/common/sh/name.c
index b9d5cbe9eb..bbdeeb83dd 100644
--- a/usr/src/lib/libshell/common/sh/name.c
+++ b/usr/src/lib/libshell/common/sh/name.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -34,6 +34,8 @@
#include "FEATURE/externs"
#include "streval.h"
+#define NVCACHE 8 /* must be a power of 2 */
+#define Empty ((char*)(e_sptbnl+3))
static char *savesub = 0;
#if !_lib_pathnative && _lib_uwin_path
@@ -55,16 +57,50 @@ static void attstore(Namval_t*,void*);
static void pushnam(Namval_t*,void*);
static char *staknam(Namval_t*, char*);
#endif
-static void ltou(const char*,char*);
+static void ltou(char*);
+static void utol(char*);
static void rightjust(char*, int, int);
+static char *lastdot(char*, int);
struct adata
{
- char **argnam;
- int attsize;
- char *attval;
+ Shell_t *sh;
+ Namval_t *tp;
+ char **argnam;
+ int attsize;
+ char *attval;
};
+#if SHOPT_TYPEDEF
+ struct sh_type
+ {
+ void *previous;
+ Namval_t **nodes;
+ Namval_t *rp;
+ short numnodes;
+ short maxnodes;
+ };
+#endif /*SHOPT_TYPEDEF */
+
+#if NVCACHE
+ struct Namcache
+ {
+ struct Cache_entry
+ {
+ Dt_t *root;
+ char *name;
+ Namval_t *np;
+ Namval_t *last_table;
+ int flags;
+ short size;
+ short len;
+ } entries[NVCACHE];
+ short index;
+ short ok;
+ };
+ static struct Namcache nvcache;
+#endif
+
char nv_local = 0;
#ifndef _ENV_H
static void(*nullscan)(Namval_t*,void*);
@@ -134,7 +170,7 @@ void nv_outname(Sfio_t *out, char *name, int len)
break;
sfwrite(out,cp,++sp-cp);
stakseek(offset);
- for(; c= *sp; sp++)
+ while(c= *sp++)
{
if(c==']')
break;
@@ -152,7 +188,7 @@ void nv_outname(Sfio_t *out, char *name, int len)
sfputc(out,']');
return;
}
- cp = sp;
+ cp = sp-1;
}
if(*cp)
{
@@ -164,56 +200,156 @@ void nv_outname(Sfio_t *out, char *name, int len)
stakseek(offset);
}
+#if SHOPT_TYPEDEF
+Namval_t *nv_addnode(Namval_t* np, int remove)
+{
+ register struct sh_type *sp = (struct sh_type*)sh.mktype;
+ register int i;
+ register char *name=0;
+ if(sp->numnodes==0 && !nv_isnull(np) && sh.last_table)
+ {
+ /* could be an redefine */
+ Dt_t *root = nv_dict(sh.last_table);
+ sp->rp = np;
+ nv_delete(np,root,NV_NOFREE);
+ np = nv_search(sp->rp->nvname,root,NV_ADD);
+ }
+ if(sp->numnodes && memcmp(np->nvname,NV_CLASS,sizeof(NV_CLASS)-1))
+ {
+ name = (sp->nodes[0])->nvname;
+ i = strlen(name);
+ if(memcmp(np->nvname,name,i))
+ return(np);
+ }
+ if(sp->rp && sp->numnodes)
+ {
+ /* check for a redefine */
+ if(name && np->nvname[i]=='.' && np->nvname[i+1]=='_' && np->nvname[i+2]==0)
+ sp->rp = 0;
+ else
+ {
+ Dt_t *root = nv_dict(sh.last_table);
+ nv_delete(sp->nodes[0],root,NV_NOFREE);
+ dtinsert(root,sp->rp);
+ errormsg(SH_DICT,ERROR_exit(1),e_redef,sp->nodes[0]->nvname);
+ }
+ }
+ for(i=0; i < sp->numnodes; i++)
+ {
+ if(np == sp->nodes[i])
+ {
+ if(remove)
+ {
+ while(++i < sp->numnodes)
+ sp->nodes[i-1] = sp->nodes[i];
+ sp->numnodes--;
+ }
+ return(np);
+ }
+ }
+ if(remove)
+ return(np);
+ if(sp->numnodes==sp->maxnodes)
+ {
+ sp->maxnodes += 20;
+ sp->nodes = (Namval_t**)realloc(sp->nodes,sizeof(Namval_t*)*sp->maxnodes);
+ }
+ sp->nodes[sp->numnodes++] = np;
+ return(np);
+}
+#endif /* SHOPT_TYPEDEF */
+
+/*
+ * given a list of assignments, determine <name> is on the list
+ returns a pointer to the argnod on the list or NULL
+ */
+struct argnod *nv_onlist(struct argnod *arg, const char *name)
+{
+ char *cp;
+ int len = strlen(name);
+ for(;arg; arg=arg->argnxt.ap)
+ {
+ if(*arg->argval==0 && arg->argchn.ap && !(arg->argflag&~(ARG_APPEND|ARG_QUOTED|ARG_MESSAGE)))
+ cp = ((struct fornod*)arg->argchn.ap)->fornam;
+ else
+ cp = arg->argval;
+ if(memcmp(cp,name,len)==0 && (cp[len]==0 || cp[len]=='='))
+ return(arg);
+ }
+ return(0);
+}
+
/*
* Perform parameter assignment for a linked list of parameters
* <flags> contains attributes for the parameters
*/
void nv_setlist(register struct argnod *arg,register int flags)
{
+ Shell_t *shp = &sh;
register char *cp;
- register Namval_t *np;
- char *trap=sh.st.trap[SH_DEBUGTRAP];
+ register Namval_t *np, *mp;
+ char *trap=shp->st.trap[SH_DEBUGTRAP];
+ char *prefix = shp->prefix;
int traceon = (sh_isoption(SH_XTRACE)!=0);
int array = (flags&(NV_ARRAY|NV_IARRAY));
- flags &= ~(NV_TYPE|NV_ARRAY);
+ Namarr_t *ap;
+ Namval_t node;
+ struct Namref nr;
+#if SHOPT_TYPEDEF
+ int maketype = flags&NV_TYPE;
+ struct sh_type shtp;
+ if(maketype)
+ {
+ shtp.previous = shp->mktype;
+ shp->mktype=(void*)&shtp;
+ shtp.numnodes=0;
+ shtp.maxnodes = 20;
+ shtp.rp = 0;
+ shtp.nodes =(Namval_t**)malloc(shtp.maxnodes*sizeof(Namval_t*));
+ }
+#endif /* SHOPT_TYPEDEF*/
+ flags &= ~(NV_TYPE|NV_ARRAY|NV_IARRAY);
if(sh_isoption(SH_ALLEXPORT))
flags |= NV_EXPORT;
- if(sh.prefix)
+ if(shp->prefix)
{
flags &= ~(NV_IDENT|NV_EXPORT);
flags |= NV_VARNAME;
}
for(;arg; arg=arg->argnxt.ap)
{
- sh.used_pos = 0;
+ shp->used_pos = 0;
if(arg->argflag&ARG_MAC)
- cp = sh_mactrim(arg->argval,-1);
+ {
+ shp->prefix = 0;
+ cp = sh_mactrim(shp,arg->argval,(flags&NV_NOREF)?-3:-1);
+ shp->prefix = prefix;
+ }
else
{
- Namval_t *mp;
stakseek(0);
- if(*arg->argval==0 && arg->argchn.ap && !(arg->argflag&~(ARG_APPEND|ARG_QUOTED)))
+ if(*arg->argval==0 && arg->argchn.ap && !(arg->argflag&~(ARG_APPEND|ARG_QUOTED|ARG_MESSAGE)))
{
int flag = (NV_VARNAME|NV_ARRAY|NV_ASSIGN);
+ int sub=0;
struct fornod *fp=(struct fornod*)arg->argchn.ap;
register Shnode_t *tp=fp->fortre;
- char *prefix = sh.prefix;
- flag |= (flags&NV_NOSCOPE);
+ flag |= (flags&(NV_NOSCOPE|NV_STATIC));
if(arg->argflag&ARG_QUOTED)
- cp = sh_mactrim(fp->fornam,-1);
+ cp = sh_mactrim(shp,fp->fornam,-1);
else
cp = fp->fornam;
- error_info.line = fp->fortyp-sh.st.firstline;
- if(sh.fn_depth && (Namval_t*)tp->com.comnamp==SYSTYPESET)
+ error_info.line = fp->fortyp-shp->st.firstline;
+ if(shp->fn_depth && (Namval_t*)tp->com.comnamp==SYSTYPESET)
flag |= NV_NOSCOPE;
if(prefix && tp->com.comset && *cp=='[')
{
- sh.prefix = 0;
- np = nv_open(prefix,sh.var_tree,flag);
- sh.prefix = prefix;
+ shp->prefix = 0;
+ np = nv_open(prefix,shp->var_tree,flag);
+ shp->prefix = prefix;
if(np)
{
- if(!nv_isarray(np))
+ if(nv_isvtree(np) && !nv_isarray(np))
{
stakputc('.');
stakputs(cp);
@@ -222,10 +358,16 @@ void nv_setlist(register struct argnod *arg,register int flags)
nv_close(np);
}
}
- np = nv_open(cp,sh.var_tree,flag);
+ np = nv_open(cp,shp->var_tree,flag|NV_ASSIGN);
+ if((flags&NV_STATIC) && !nv_isnull(np))
+#if SHOPT_TYPEDEF
+ goto check_type;
+#else
+ continue;
+#endif /* SHOPT_TYPEDEF */
if(array)
{
- if(!(flags&NV_APPEND))
+ if(!(arg->argflag&ARG_APPEND))
nv_unset(np);
if(array&NV_ARRAY)
{
@@ -235,15 +377,31 @@ void nv_setlist(register struct argnod *arg,register int flags)
{
nv_onattr(np,NV_ARRAY);
}
+ if(tp->tre.tretyp!=TLST && !tp->com.comset && !tp->com.comarg)
+#if SHOPT_TYPEDEF
+ goto check_type;
+#else
+ continue;
+#endif /* SHOPT_TYPEDEF */
}
/* check for array assignment */
if(tp->tre.tretyp!=TLST && tp->com.comarg && !tp->com.comset && !((mp=tp->com.comnamp) && nv_isattr(mp,BLT_DCL)))
{
int argc;
- char **argv = sh_argbuild(&argc,&tp->com,0);
+ Dt_t *last_root = shp->last_root;
+ char **argv = sh_argbuild(shp,&argc,&tp->com,0);
+ shp->last_root = last_root;
+#if SHOPT_TYPEDEF
+ if(shp->mktype && shp->dot_depth==0 && np==((struct sh_type*)shp->mktype)->nodes[0])
+ {
+ shp->mktype = 0;
+ errormsg(SH_DICT,ERROR_exit(1),"%s: not a known type name",argv[0]);
+ }
+#endif /* SHOPT_TYPEDEF */
if(!(arg->argflag&ARG_APPEND))
{
- nv_unset(np);
+ if(!nv_isarray(np) || ((ap=nv_arrayptr(np)) && (ap->nelem&ARRAY_MASK)))
+ nv_unset(np);
}
nv_setvec(np,(arg->argflag&ARG_APPEND),argc,argv);
if(traceon || trap)
@@ -253,7 +411,7 @@ void nv_setlist(register struct argnod *arg,register int flags)
if(arg->argflag&ARG_APPEND)
n = '+';
if(trap)
- sh_debug(trap,name,(char*)0,argv,(arg->argflag&ARG_APPEND)|ARG_ASSIGN);
+ sh_debug(shp,trap,name,(char*)0,argv,(arg->argflag&ARG_APPEND)|ARG_ASSIGN);
if(traceon)
{
sh_trace(NIL(char**),0);
@@ -264,51 +422,122 @@ void nv_setlist(register struct argnod *arg,register int flags)
sfwrite(sfstderr,")\n",2);
}
}
+#if SHOPT_TYPEDEF
+ goto check_type;
+#else
continue;
+#endif /* SHOPT_TYPEDEF */
}
+ if((tp->tre.tretyp&COMMSK)==TFUN)
+ goto skip;
if(tp->tre.tretyp==TLST || !tp->com.comset || tp->com.comset->argval[0]!='[')
{
+ if(tp->tre.tretyp!=TLST && !tp->com.comnamp && tp->com.comset && tp->com.comset->argval[0]==0 && tp->com.comset->argchn.ap)
+ {
+ if(prefix)
+ cp = stakcopy(nv_name(np));
+ shp->prefix = cp;
+ if(tp->com.comset->argval[1]=='[')
+ {
+ if((arg->argflag&ARG_APPEND) && (!nv_isarray(np) || (nv_aindex(np)>=0)))
+ nv_unset(np);
+ if(!(array&NV_IARRAY) && !(tp->com.comset->argflag&ARG_MESSAGE))
+ nv_setarray(np,nv_associative);
+ }
+ nv_setlist(tp->com.comset,flags);
+ shp->prefix = prefix;
+ if(tp->com.comset->argval[1]!='[')
+ nv_setvtree(np);
+ nv_close(np);
+#if SHOPT_TYPEDEF
+ goto check_type;
+#else
+ continue;
+#endif /* SHOPT_TYPEDEF */
+ }
if(*cp!='.' && *cp!='[' && strchr(cp,'['))
{
nv_close(np);
- np = nv_open(cp,sh.var_tree,flag);
+ np = nv_open(cp,shp->var_tree,flag);
}
- if((arg->argflag&ARG_APPEND) && !nv_isarray(np))
- nv_unset(np);
- }
- else
- {
- if(sh_isoption(SH_BASH) || (array&NV_IARRAY))
+ if(arg->argflag&ARG_APPEND)
{
- if(!(arg->argflag&ARG_APPEND))
- nv_unset(np);
+ if(nv_isarray(np))
+ {
+ if((sub=nv_aimax(np)) < 0 && nv_arrayptr(np))
+ errormsg(SH_DICT,ERROR_exit(1),e_badappend,nv_name(np));
+ if(sub>=0)
+ sub++;
+ }
+ if(!nv_isnull(np) && np->nvalue.cp!=Empty && !nv_isvtree(np))
+ sub=1;
}
- else if((arg->argflag&ARG_APPEND) && (!nv_isarray(np) || (nv_aindex(np)>=0)))
+ else if(np->nvalue.cp && np->nvalue.cp!=Empty && !nv_type(np))
{
- nv_unset(np);
- nv_setarray(np,nv_associative);
+ _nv_unset(np,NV_EXPORT);
}
- else
+ }
+ else
+ {
+ if(!(arg->argflag&ARG_APPEND))
+ _nv_unset(np,NV_EXPORT);
+ if(!sh_isoption(SH_BASH) && !(array&NV_IARRAY) && !nv_isarray(np))
nv_setarray(np,nv_associative);
}
- if(prefix)
- cp = stakcopy(nv_name(np));
- sh.prefix = cp;
+ skip:
+ if(sub>0)
+ {
+ sfprintf(stkstd,"%s[%d]",prefix?nv_name(np):cp,sub);
+ shp->prefix = stakfreeze(1);
+ nv_putsub(np,(char*)0,ARRAY_ADD|ARRAY_FILL|sub);
+ }
+ else if(prefix)
+ shp->prefix = stakcopy(nv_name(np));
+ else
+ shp->prefix = cp;
+ shp->last_table = 0;
+ memset(&nr,0,sizeof(nr));
+ memcpy(&node,L_ARGNOD,sizeof(node));
+ L_ARGNOD->nvalue.nrp = &nr;
+ nr.np = np;
+ nr.root = shp->last_root;
+ nr.table = shp->last_table;
+ L_ARGNOD->nvflag = NV_REF|NV_NOFREE;
+ L_ARGNOD->nvfun = 0;
sh_exec(tp,sh_isstate(SH_ERREXIT));
- sh.prefix = prefix;
+#if SHOPT_TYPEDEF
+ if(!maketype)
+#endif
+ {
+ L_ARGNOD->nvalue.nrp = node.nvalue.nrp;
+ L_ARGNOD->nvflag = node.nvflag;
+ L_ARGNOD->nvfun = node.nvfun;
+ }
+ shp->prefix = prefix;
if(nv_isarray(np) && (mp=nv_opensub(np)))
np = mp;
- nv_setvtree(np);
+ while(tp->tre.tretyp==TLST)
+ {
+ if(!tp->lst.lstlef || !tp->lst.lstlef->tre.tretyp==TCOM || tp->lst.lstlef->com.comarg || tp->lst.lstlef->com.comset && tp->lst.lstlef->com.comset->argval[0]!='[')
+ break;
+ tp = tp->lst.lstrit;
+
+ }
+ if(!nv_isarray(np) && (tp->com.comarg || !tp->com.comset || tp->com.comset->argval[0]!='['))
+ nv_setvtree(np);
+#if SHOPT_TYPEDEF
+ goto check_type;
+#else
continue;
+#endif /* SHOPT_TYPEDEF */
}
cp = arg->argval;
+ mp = 0;
}
- if(sh.prefix && *cp=='.' && cp[1]=='=')
- cp++;
- np = nv_open(cp,sh.var_tree,flags);
- if(!np->nvfun)
+ np = nv_open(cp,shp->var_tree,flags);
+ if(!np->nvfun && (flags&NV_NOREF))
{
- if(sh.used_pos)
+ if(shp->used_pos)
nv_onattr(np,NV_PARAM);
else
nv_offattr(np,NV_PARAM);
@@ -321,7 +550,7 @@ void nv_setlist(register struct argnod *arg,register int flags)
int append = 0;
if(nv_isarray(np))
sub = savesub;
- if(cp=strchr(sp,'='))
+ if(cp=lastdot(sp,'='))
{
if(cp[-1]=='+')
append = ARG_APPEND;
@@ -345,9 +574,27 @@ void nv_setlist(register struct argnod *arg,register int flags)
char *av[2];
av[0] = cp;
av[1] = 0;
- sh_debug(trap,name,sub,av,append);
+ sh_debug(shp,trap,name,sub,av,append);
}
}
+#if SHOPT_TYPEDEF
+ check_type:
+ if(maketype)
+ {
+ nv_open(shtp.nodes[0]->nvname,shp->var_tree,NV_ASSIGN|NV_VARNAME|NV_NOADD|NV_NOFAIL);
+ np = nv_mktype(shtp.nodes,shtp.numnodes);
+ free((void*)shtp.nodes);
+ shp->mktype = shtp.previous;
+ maketype = 0;
+ shp->prefix = 0;
+ if(nr.np == np)
+ {
+ L_ARGNOD->nvalue.nrp = node.nvalue.nrp;
+ L_ARGNOD->nvflag = node.nvflag;
+ L_ARGNOD->nvfun = node.nvfun;
+ }
+ }
+#endif /* SHOPT_TYPEDEF */
}
}
@@ -380,7 +627,9 @@ static char *copystack(const char *prefix, register const char *name, const char
stakseek(staktell()-1);
if(*name=='.' && name[1]=='[')
last = staktell()+2;
- if(*name!='[' && *name!='.' && *name!='=' && *name!='+')
+ if(*name!='[' && *name!='.' && *name!='=' && *name!='+')
+ stakputc('.');
+ if(*name=='.' && (name[1]=='=' || name[1]==0))
stakputc('.');
}
if(last)
@@ -415,15 +664,16 @@ static char *stack_extend(const char *cname, char *cp, int n)
return((char*)name);
}
-Namval_t *nv_create(const char *name, Dt_t *root, int flags, Namfun_t *dp)
+Namval_t *nv_create(const char *name, Dt_t *root, int flags, Namfun_t *dp)
{
+ Shell_t *shp = &sh;
char *cp=(char*)name, *sp, *xp;
register int c;
register Namval_t *np=0, *nq=0;
Namfun_t *fp=0;
long mode, add=0;
int copy=1,isref,top=0,noscope=(flags&NV_NOSCOPE);
- if(root==sh.var_tree)
+ if(root==shp->var_tree)
{
if(dtvnext(root))
top = 1;
@@ -431,7 +681,7 @@ Namval_t *nv_create(const char *name, Dt_t *root, int flags, Namfun_t *dp)
flags &= ~NV_NOSCOPE;
}
if(!dp->disc)
- copy = dp->nofree;
+ copy = dp->nofree&1;
if(*cp=='.')
cp++;
while(1)
@@ -451,13 +701,13 @@ Namval_t *nv_create(const char *name, Dt_t *root, int flags, Namfun_t *dp)
case '.':
if(flags&NV_IDENT)
return(0);
- if(root==sh.var_tree)
+ if(root==shp->var_tree)
flags &= ~NV_EXPORT;
if(!copy && !(flags&NV_NOREF))
{
c = sp-name;
copy = cp-name;
- dp->nofree = 1;
+ dp->nofree |= 1;
name = copystack((const char*)0, name,(const char*)0);
cp = (char*)name+copy;
sp = (char*)name+c;
@@ -471,11 +721,56 @@ Namval_t *nv_create(const char *name, Dt_t *root, int flags, Namfun_t *dp)
isref = 0;
dp->last = cp;
mode = (c=='.' || (flags&NV_NOADD))?add:NV_ADD;
- if(flags&NV_NOSCOPE)
+ if((flags&NV_NOSCOPE) && c!='.')
mode |= HASH_NOSCOPE;
+ np=0;
if(top)
- nq = nv_search(name,sh.var_base,0);
- if(np = nv_search(name,root,mode))
+ {
+ struct Ufunction *rp;
+ if((rp=shp->st.real_fun) && !rp->sdict && (flags&NV_STATIC))
+ {
+ Dt_t *dp = dtview(shp->var_tree,(Dt_t*)0);
+ rp->sdict = dtopen(&_Nvdisc,Dtoset);
+ dtview(rp->sdict,shp->var_base);
+ dtview(shp->var_tree,rp->sdict);
+ }
+ if(np = nv_search(name,shp->var_tree,0))
+ {
+ if(shp->var_tree->walk == shp->var_base)
+ {
+ nq = np;
+ if(flags&NV_NOSCOPE)
+ {
+ if(mode==0)
+ root = shp->var_base;
+ else
+ {
+ nv_delete(np,(Dt_t*)0,0);
+ np = 0;
+ }
+ }
+ }
+ else
+ {
+ root = shp->var_tree->walk;
+ flags |= NV_NOSCOPE;
+ noscope = 1;
+ }
+ }
+ if(rp && rp->sdict && (flags&NV_STATIC))
+ {
+ root = rp->sdict;
+ if(np && shp->var_tree->walk==shp->var_tree)
+ {
+ _nv_unset(np,0);
+ nv_delete(np,shp->var_tree,0);
+ np = 0;
+ }
+ if(!np || shp->var_tree->walk!=root)
+ np = nv_search(name,root,HASH_NOSCOPE|NV_ADD);
+ }
+ }
+ if(np || (np = nv_search(name,root,mode)))
{
isref = nv_isref(np);
if(top)
@@ -489,7 +784,7 @@ Namval_t *nv_create(const char *name, Dt_t *root, int flags, Namfun_t *dp)
flags |= NV_NOSCOPE;
}
}
- else if(add && nv_isnull(np) && c=='.')
+ else if(add && nv_isnull(np) && c=='.' && cp[1]!='.')
nv_setvtree(np);
}
if(c)
@@ -498,24 +793,31 @@ Namval_t *nv_create(const char *name, Dt_t *root, int flags, Namfun_t *dp)
if(isref)
{
char *sub=0;
+#if NVCACHE
+ nvcache.ok = 0;
+#endif
if(c=='.') /* don't optimize */
- sh.argaddr = 0;
- else if(flags&NV_NOREF)
+ shp->argaddr = 0;
+ else if((flags&NV_NOREF) && (c!='[' || *cp!='.'))
{
- if(c)
+ if(c && !(flags&NV_NOADD))
nv_unref(np);
return(np);
}
- while(nv_isref(np))
+ while(nv_isref(np) && np->nvalue.cp)
{
root = nv_reftree(np);
- sh.last_table = nv_reftable(np);
+ shp->last_root = root;
+ shp->last_table = nv_reftable(np);
sub = nv_refsub(np);
np = nv_refnode(np);
if(sub && c!='.')
nv_putsub(np,sub,0L);
flags |= NV_NOSCOPE;
+ noscope = 1;
}
+ if(nv_isref(np) && (c=='[' || c=='.' || !(flags&NV_ASSIGN)))
+ errormsg(SH_DICT,ERROR_exit(1),e_noref,nv_name(np));
if(sub && c==0)
return(np);
if(np==nq)
@@ -524,7 +826,7 @@ Namval_t *nv_create(const char *name, Dt_t *root, int flags, Namfun_t *dp)
{
c = (cp-sp);
copy = strlen(cp=nv_name(np));
- dp->nofree = 1;
+ dp->nofree |= 1;
name = copystack(cp,sp,sub);
sp = (char*)name + copy;
cp = sp+c;
@@ -534,12 +836,21 @@ Namval_t *nv_create(const char *name, Dt_t *root, int flags, Namfun_t *dp)
}
flags |= NV_NOREF;
}
- sh.last_root = root;
+ shp->last_root = root;
+ if(cp[1]=='.')
+ cp++;
+ if(c=='.' && (cp[1]==0 || cp[1]=='=' || cp[1]=='+'))
+ {
+ nv_local = 1;
+ return(np);
+ }
+ if(cp[-1]=='.')
+ cp--;
do
{
if(!np)
{
- if(*sp=='[' && *cp==0 && cp[-1]==']')
+ if(!nq && *sp=='[' && *cp==0 && cp[-1]==']')
{
/*
* for backward compatibility
@@ -554,6 +865,7 @@ Namval_t *nv_create(const char *name, Dt_t *root, int flags, Namfun_t *dp)
}
if(c=='[' || (c=='.' && nv_isarray(np)))
{
+ char *sub=0;
int n = 0;
if(c=='[')
{
@@ -564,24 +876,30 @@ Namval_t *nv_create(const char *name, Dt_t *root, int flags, Namfun_t *dp)
dp->last = cp;
return(np);
}
- if(n&&(flags&NV_ARRAY))
+ if((n&NV_ADD)&&(flags&NV_ARRAY))
n |= ARRAY_FILL;
- cp = nv_endsubscript(np,sp,n);
+ if(flags&NV_ASSIGN)
+ n |= NV_ADD;
+ cp = nv_endsubscript(np,sp,n|(flags&NV_ASSIGN));
}
else
cp = sp;
- if((c = *cp)=='.' || c=='[' || (n&ARRAY_FILL))
+ if((c = *cp)=='.' || (c=='[' && nv_isarray(np)) || (n&ARRAY_FILL) || (flags&NV_ARRAY))
{
int m = cp-sp;
- char *sub = m?nv_getsub(np):0;
+ sub = m?nv_getsub(np):0;
if(!sub)
+ {
+ if(m && !(n&NV_ADD))
+ return(0);
sub = "0";
+ }
n = strlen(sub)+2;
if(!copy)
{
copy = cp-name;
- dp->nofree = 1;
+ dp->nofree |= 1;
name = copystack((const char*)0, name,(const char*)0);
cp = (char*)name+copy;
sp = cp-m;
@@ -610,30 +928,66 @@ Namval_t *nv_create(const char *name, Dt_t *root, int flags, Namfun_t *dp)
}
}
else if(c==0 && mode && (n=nv_aindex(np))>0)
- nv_putsub(np,(char*)0,n|ARRAY_FILL);
- else if(n==0 && c==0)
+ nv_putsub(np,(char*)0,n);
+ else if(n==0 && (c==0 || (c=='[' && !nv_isarray(np))))
{
/* subscript must be 0*/
cp[-1] = 0;
- c = sh_arith(sp+1);
+ n = sh_arith(sp+1);
cp[-1] = ']';
- if(c)
+ if(n)
return(0);
+ if(c)
+ sp = cp;
}
dp->last = cp;
if(nv_isarray(np) && (c=='[' || c=='.' || (flags&NV_ARRAY)))
{
- *(sp=cp) = 0;
- nq = nv_search(name,root,mode);
- *sp = c;
- if(nq && nv_isnull(nq))
- nq = nv_arraychild(np,nq,c);
- if(!(np=nq))
- return(np);
+ sp = cp;
+ if(!(nq = nv_opensub(np)))
+ {
+ Namarr_t *ap = nv_arrayptr(np);
+ if(!sub && (flags&NV_NOADD))
+ return(0);
+ n = mode|((flags&NV_NOADD)?0:NV_ADD);
+ if(!ap && (n&NV_ADD))
+ {
+ nv_putsub(np,sub,ARRAY_FILL);
+ ap = nv_arrayptr(np);
+ }
+ if(n && ap && !ap->table)
+ ap->table = dtopen(&_Nvdisc,Dtoset);
+ if(ap && ap->table && (nq=nv_search(sub,ap->table,n)))
+ nq->nvenv = (char*)np;
+ if(nq && nv_isnull(nq))
+ nq = nv_arraychild(np,nq,c);
+ }
+ if(nq)
+ {
+ if(c=='.' && !nv_isvtree(nq))
+ {
+ if(flags&NV_NOADD)
+ return(0);
+ nv_setvtree(nq);
+ }
+ np = nq;
+ }
+ else if(memcmp(cp,"[0]",3))
+ return(nq);
+ else
+ {
+ /* ignore [0] */
+ dp->last = cp += 3;
+ c = *cp;
+ }
}
}
else if(nv_isarray(np))
+ {
+ if(c==0 && (flags&NV_MOVE))
+ return(np);
nv_putsub(np,NIL(char*),ARRAY_UNDEF);
+ }
if(c=='.' && (fp=np->nvfun))
{
for(; fp; fp=fp->next)
@@ -648,13 +1002,20 @@ Namval_t *nv_create(const char *name, Dt_t *root, int flags, Namfun_t *dp)
add = NV_ADD;
break;
}
- else if((np=nq) && (c = *(cp=dp->last=fp->last))==0)
- return(np);
+ else if(np=nq)
+ {
+ if((c = *(sp=cp=dp->last=fp->last))==0)
+ {
+ if(nv_isarray(np) && sp[-1]!=']')
+ nv_putsub(np,NIL(char*),ARRAY_UNDEF);
+ return(np);
+ }
+ }
}
}
}
while(c=='[');
- if(c!='.')
+ if(c!='.' || cp[1]=='.')
return(np);
cp++;
break;
@@ -670,6 +1031,39 @@ Namval_t *nv_create(const char *name, Dt_t *root, int flags, Namfun_t *dp)
}
/*
+ * delete the node <np> from the dictionary <root> and clear from the cache
+ * if <root> is NULL, only the cache is cleared
+ * if flags does not contain NV_NOFREE, the node is freed
+ */
+void nv_delete(Namval_t* np, Dt_t *root, int flags)
+{
+#if NVCACHE
+ register int c;
+ struct Cache_entry *xp;
+ for(c=0,xp=nvcache.entries ; c < NVCACHE; xp= &nvcache.entries[++c])
+ {
+ if(xp->np==np)
+ xp->root = 0;
+ }
+#endif
+ if(root)
+ {
+ if(dtdelete(root,np))
+ {
+ if(!(flags&NV_NOFREE) && ((flags&NV_FUNCTION) || !nv_subsaved(np)))
+ free((void*)np);
+ }
+#if 0
+ else
+ {
+ sfprintf(sfstderr,"%s not deleted\n",nv_name(np));
+ sfsync(sfstderr);
+ }
+#endif
+ }
+}
+
+/*
* Put <arg> into associative memory.
* If <flags> & NV_ARRAY then follow array to next subscript
* If <flags> & NV_NOARRAY then subscript is not allowed
@@ -680,10 +1074,12 @@ Namval_t *nv_create(const char *name, Dt_t *root, int flags, Namfun_t *dp)
* If <flags> & NV_NOADD then node will not be added if not found
* If <flags> & NV_NOREF then don't follow reference
* If <flags> & NV_NOFAIL then don't generate an error message on failure
+ * If <flags> & NV_STATIC then unset before an assignment
* SH_INIT is only set while initializing the environment
*/
Namval_t *nv_open(const char *name, Dt_t *root, int flags)
{
+ Shell_t *shp = &sh;
register char *cp=(char*)name;
register int c;
register Namval_t *np;
@@ -693,25 +1089,29 @@ Namval_t *nv_open(const char *name, Dt_t *root, int flags)
char *fname = 0;
int offset = staktell();
Dt_t *funroot;
-
+#if NVCACHE
+ struct Cache_entry *xp;
+#endif
+
+ sh_stats(STAT_NVOPEN);
memset(&fun,0,sizeof(fun));
- sh.last_table = sh.namespace;
+ shp->last_table = shp->namespace;
if(!root)
- root = sh.var_tree;
- sh.last_root = root;
- if(root==sh_subfuntree(1))
+ root = shp->var_tree;
+ shp->last_root = root;
+ if(root==shp->fun_tree)
{
flags |= NV_NOREF;
msg = e_badfun;
- if((np=sh.namespace) || strchr(name,'.'))
+ if((np=shp->namespace) || strchr(name,'.'))
{
name = cp = copystack(np?nv_name(np):0,name,(const char*)0);
fname = strrchr(cp,'.');
*fname = 0;
- fun.nofree = 1;
+ fun.nofree |= 1;
flags &= ~NV_IDENT;
funroot = root;
- root = sh.var_tree;
+ root = shp->var_tree;
}
}
else if(!(flags&(NV_IDENT|NV_VARNAME|NV_ASSIGN)))
@@ -724,24 +1124,24 @@ Namval_t *nv_open(const char *name, Dt_t *root, int flags)
{
while(nv_isref(np))
{
- sh.last_table = nv_reftable(np);
+ shp->last_table = nv_reftable(np);
np = nv_refnode(np);
}
}
return(np);
}
- else if(sh.prefix && /**name!='.' &&*/ (flags&NV_ASSIGN))
+ else if(shp->prefix && (flags&NV_ASSIGN))
{
- name = cp = copystack(sh.prefix,name,(const char*)0);
- fun.nofree = 1;
+ name = cp = copystack(shp->prefix,name,(const char*)0);
+ fun.nofree |= 1;
}
c = *(unsigned char*)cp;
- if(root==sh.alias_tree)
+ if(root==shp->alias_tree)
{
msg = e_aliname;
while((c= *(unsigned char*)cp++) && (c!='=') && (c!='/') &&
- (c>=0x200 || !(c=sh_lexstates[ST_NORM][c]) || c==S_EPAT));
- if(sh.subshell && c=='=')
+ (c>=0x200 || !(c=sh_lexstates[ST_NORM][c]) || c==S_EPAT || c==S_COLON));
+ if(shp->subshell && c=='=')
root = sh_subaliastree(1);
if(c= *--cp)
*cp = 0;
@@ -756,14 +1156,65 @@ Namval_t *nv_open(const char *name, Dt_t *root, int flags)
{
c = *++cp;
flags |= NV_NOREF;
- if(root==sh.var_tree)
- root = sh.var_base;
- sh.last_table = 0;
+ if(root==shp->var_tree)
+ root = shp->var_base;
+ shp->last_table = 0;
}
if(c= !isaletter(c))
goto skip;
+#if NVCACHE
+ for(c=0,xp=nvcache.entries ; c < NVCACHE; xp= &nvcache.entries[++c])
+ {
+ if(xp->root!=root)
+ continue;
+ if(*name==*xp->name && (flags&(NV_ARRAY|NV_NOSCOPE))==xp->flags && memcmp(xp->name,name,xp->len)==0 && (name[xp->len]==0 || name[xp->len]=='=' || name[xp->len]=='+'))
+ {
+ sh_stats(STAT_NVHITS);
+ np = xp->np;
+ cp = (char*)name+xp->len;
+ if(nv_isarray(np))
+ nv_putsub(np,NIL(char*),ARRAY_UNDEF);
+ shp->last_table = xp->last_table;
+ goto nocache;
+ }
+ }
+ nvcache.ok = 1;
+#endif
np = nv_create(name, root, flags, &fun);
cp = fun.last;
+#if NVCACHE
+ if(np && nvcache.ok && cp[-1]!=']')
+ {
+ xp = &nvcache.entries[nvcache.index];
+ if(*cp)
+ {
+ char *sp = strchr(name,*cp);
+ if(!sp)
+ goto nocache;
+ xp->len = sp-name;
+ }
+ else
+ xp->len = strlen(name);
+ c = roundof(xp->len+1,32);
+ if(c > xp->size)
+ {
+ if(xp->size==0)
+ xp->name = malloc(c);
+ else
+ xp->name = realloc(xp->name,c);
+ xp->size = c;
+ }
+ memcpy(xp->name,name,xp->len);
+ xp->name[xp->len] = 0;
+ xp->root = root;
+ xp->np = np;
+ xp->last_table = shp->last_table;
+ xp->flags = (flags&(NV_ARRAY|NV_NOSCOPE));
+ nvcache.index = (nvcache.index+1)&(NVCACHE-1);
+ }
+nocache:
+ nvcache.ok = 0;
+#endif
if(fname)
{
c = ((flags&NV_NOSCOPE)?HASH_NOSCOPE:0)|((flags&NV_NOADD)?0:NV_ADD);
@@ -771,13 +1222,26 @@ Namval_t *nv_open(const char *name, Dt_t *root, int flags)
np = nv_search(name, funroot, c);
*fname = 0;
}
- else if(*cp=='+' && cp[1]=='=')
+ else
{
- append=NV_APPEND;
- cp++;
+ if(*cp=='.' && cp[1]=='.')
+ {
+ append |= NV_NODISC;
+ cp+=2;
+ }
+ if(*cp=='+' && cp[1]=='=')
+ {
+ append |= NV_APPEND;
+ cp++;
+ }
}
c = *cp;
skip:
+#if SHOPT_TYPEDEF
+ if(np && shp->mktype)
+ np = nv_addnode(np,0);
+#endif /* SHOPT_TYPEDEF */
+
if(c=='=' && np && (flags&NV_ASSIGN))
{
cp++;
@@ -789,12 +1253,25 @@ skip:
}
else
{
- char *sub=0;
+ char *sub=0, *prefix= shp->prefix;
+ int isref;
+ shp->prefix = 0;
+ if((flags&NV_STATIC) && !shp->mktype)
+ {
+ if(!nv_isnull(np))
+ return(np);
+ }
+ isref = nv_isref(np);
if(sh_isoption(SH_XTRACE) && nv_isarray(np))
sub = nv_getsub(np);
c = msg==e_aliname? 0: (append | (flags&NV_EXPORT));
+ if(isref)
+ nv_offattr(np,NV_REF);
nv_putval(np, cp, c);
+ if(isref)
+ nv_setref(np,(Dt_t*)0,NV_VARNAME);
savesub = sub;
+ shp->prefix = prefix;
}
nv_onattr(np, flags&NV_ATTRIBUTES);
}
@@ -808,7 +1285,7 @@ skip:
msg = e_noarray;
errormsg(SH_DICT,ERROR_exit(1),msg,name);
}
- if(fun.nofree)
+ if(fun.nofree&1)
stakseek(offset);
return(np);
}
@@ -836,7 +1313,10 @@ void nv_putval(register Namval_t *np, const char *string, int flags)
register char *cp;
register int size = 0;
register int dot;
+#ifdef _ENV_H
int was_local = nv_local;
+#endif
+ union Value u;
if(!(flags&NV_RDONLY) && nv_isattr (np, NV_RDONLY))
errormsg(SH_DICT,ERROR_exit(1),e_readonly, nv_name(np));
/* The following could cause the shell to fork if assignment
@@ -845,40 +1325,49 @@ void nv_putval(register Namval_t *np, const char *string, int flags)
sh.argaddr = 0;
if(sh.subshell && !nv_local)
np = sh_assignok(np,1);
- if(np->nvfun && !nv_isattr(np,NV_REF))
+ if(np->nvfun && np->nvfun->disc && !(flags&NV_NODISC) && !nv_isattr(np,NV_REF))
{
/* This function contains disc */
if(!nv_local)
{
nv_local=1;
nv_putv(np,sp,flags,np->nvfun);
+#ifdef _ENV_H
if(sp && ((flags&NV_EXPORT) || nv_isattr(np,NV_EXPORT)))
sh_envput(sh.env,np);
+#endif
return;
}
/* called from disc, assign the actual value */
}
flags &= ~NV_NODISC;
+ nv_local=0;
if(flags&(NV_NOREF|NV_NOFREE))
{
- if(!nv_isnull(np) && np->nvalue.cp!=sp)
- nv_unset(np);
- nv_local=0;
+ if(np->nvalue.cp && np->nvalue.cp!=sp && !nv_isattr(np,NV_NOFREE))
+ free((void*)np->nvalue.cp);
np->nvalue.cp = (char*)sp;
nv_setattr(np,(flags&~NV_RDONLY)|NV_NOFREE);
return;
}
- nv_local=0;
up= &np->nvalue;
-#if !SHOPT_BSH
+ if(nv_isattr(np,NV_INT16P) == NV_INT16)
+ {
+ if(!np->nvalue.up || !nv_isarray(np))
+ {
+ up = &u;
+ up->up = &np->nvalue;
+ }
+ }
+ else if(np->nvalue.up && nv_isarray(np) && nv_arrayptr(np))
+ up = np->nvalue.up;
+ if(up && up->cp==Empty)
+ up->cp = 0;
if(nv_isattr(np,NV_EXPORT))
nv_offattr(np,NV_IMPORT);
- else if(!nv_isattr(np,NV_MINIMAL))
- np->nvenv = 0;
-#endif /* SHOPT_BSH */
if(nv_isattr (np, NV_INTEGER))
{
- if(nv_isattr(np, NV_DOUBLE))
+ if(nv_isattr(np, NV_DOUBLE) == NV_DOUBLE)
{
if(nv_isattr(np, NV_LONG) && sizeof(double)<sizeof(Sfdouble_t))
{
@@ -928,7 +1417,7 @@ void nv_putval(register Namval_t *np, const char *string, int flags)
Sflong_t ll=0,oll=0;
if(flags&NV_INTEGER)
{
- if(flags&NV_DOUBLE)
+ if((flags&NV_DOUBLE) == NV_DOUBLE)
{
if(flags&NV_LONG)
ll = *((Sfdouble_t*)sp);
@@ -969,7 +1458,7 @@ void nv_putval(register Namval_t *np, const char *string, int flags)
int32_t l=0,ol=0;
if(flags&NV_INTEGER)
{
- if(flags&NV_DOUBLE)
+ if((flags&NV_DOUBLE) == NV_DOUBLE)
{
Sflong_t ll;
if(flags&NV_LONG)
@@ -1013,8 +1502,8 @@ void nv_putval(register Namval_t *np, const char *string, int flags)
{
int16_t s=0;
if(flags&NV_APPEND)
- s = up->s;
- up->s = s+(int16_t)l;
+ s = *up->sp;
+ *(up->sp) = s+(int16_t)l;
nv_onattr(np,NV_NOFREE);
}
else
@@ -1037,20 +1526,30 @@ void nv_putval(register Namval_t *np, const char *string, int flags)
#endif /* _lib_pathnative */
if(flags&NV_INTEGER)
{
- if(flags&NV_DOUBLE)
+ if((flags&NV_DOUBLE)==NV_DOUBLE)
{
if(flags&NV_LONG)
sfprintf(sh.strbuf,"%.*Lg",LDBL_DIG,*((Sfdouble_t*)sp));
else
sfprintf(sh.strbuf,"%.*g",DBL_DIG,*((double*)sp));
}
- else if(flags&NV_LONG)
- sfprintf(sh.strbuf,"%lld\0",*((Sflong_t*)sp));
+ else if(flags&NV_UNSIGN)
+ {
+ if(flags&NV_LONG)
+ sfprintf(sh.strbuf,"%I*lu",sizeof(Sfulong_t),*((Sfulong_t*)sp));
+ else
+ sfprintf(sh.strbuf,"%lu",(unsigned long)((flags&NV_SHORT)?*((uint16_t*)sp):*((uint32_t*)sp)));
+ }
else
- sfprintf(sh.strbuf,"%ld\0",*((int32_t*)sp));
+ {
+ if(flags&NV_LONG)
+ sfprintf(sh.strbuf,"%I*ld",sizeof(Sflong_t),*((Sflong_t*)sp));
+ else
+ sfprintf(sh.strbuf,"%ld",(long)((flags&NV_SHORT)?*((int16_t*)sp):*((int32_t*)sp)));
+ }
sp = sfstruse(sh.strbuf);
}
- if(nv_isattr(np, NV_HOST)==NV_HOST && sp)
+ if(nv_isattr(np, NV_HOST|NV_INTEGER)==NV_HOST && sp)
{
#ifdef _lib_pathnative
/*
@@ -1094,7 +1593,10 @@ void nv_putval(register Namval_t *np, const char *string, int flags)
/* delay free in case <sp> points into free region */
tofree = up->cp;
}
- nv_offattr(np,NV_NOFREE);
+ if(nv_isattr(np,NV_BINARY) && !(flags&NV_RAW))
+ tofree = 0;
+ if(nv_isattr(np,NV_LJUST|NV_RJUST))
+ tofree = 0;
if (sp)
{
dot = strlen(sp);
@@ -1105,7 +1607,10 @@ void nv_putval(register Namval_t *np, const char *string, int flags)
if(flags&NV_RAW)
{
if(tofree)
+ {
free((void*)tofree);
+ nv_offattr(np,NV_NOFREE);
+ }
up->cp = sp;
return;
}
@@ -1115,6 +1620,7 @@ void nv_putval(register Namval_t *np, const char *string, int flags)
if(size==0)
size = oldsize + (3*dot/4);
cp = (char*)malloc(size+1);
+ nv_offattr(np,NV_NOFREE);
if(oldsize)
memcpy((void*)cp,(void*)up->cp,oldsize);
up->cp = cp;
@@ -1134,19 +1640,29 @@ void nv_putval(register Namval_t *np, const char *string, int flags)
nv_setsize(np,size=dot);
else if(size > dot)
dot = size;
- cp = (char*)malloc(((unsigned)dot+1));
+ else if(nv_isattr(np,NV_LJUST) && dot>size)
+ dot = size;
+ if(size==0 || tofree || !(cp=(char*)up->cp))
+ {
+ cp = (char*)malloc(((unsigned)dot+1));
+ cp[dot] = 0;
+ nv_offattr(np,NV_NOFREE);
+ }
+
}
else
cp = 0;
up->cp = cp;
if(sp)
{
+ int c = cp[dot];
+ memcpy(cp,sp,dot);
+ cp[dot]=0;
if(nv_isattr(np, NV_LTOU))
- ltou(sp,cp);
+ ltou(cp);
else if(nv_isattr (np, NV_UTOL))
- sh_utol(sp,cp);
- else
- strcpy(cp, sp);
+ utol(cp);
+ cp[dot] = c;
if(nv_isattr(np, NV_RJUST) && nv_isattr(np, NV_ZFILL))
rightjust(cp,size,'0');
else if(nv_isattr(np, NV_RJUST))
@@ -1155,7 +1671,7 @@ void nv_putval(register Namval_t *np, const char *string, int flags)
{
register char *dp;
dp = strlen (cp) + cp;
- *(cp = (cp + size)) = 0;
+ cp = cp+size;
for (; dp < cp; *dp++ = ' ');
}
#if SHOPT_MULTIBYTE
@@ -1166,11 +1682,13 @@ void nv_putval(register Namval_t *np, const char *string, int flags)
}
if(flags&NV_APPEND)
stakseek(offset);
- if(tofree)
+ if(tofree && tofree!=Empty)
free((void*)tofree);
}
+#ifdef _ENV_H
if(!was_local && ((flags&NV_EXPORT) || nv_isattr(np,NV_EXPORT)))
sh_envput(sh.env,np);
+#endif
return;
}
@@ -1308,10 +1826,10 @@ static void attstore(register Namval_t *np, void *data)
return;
flag = nv_isattr(np,NV_RDONLY|NV_UTOL|NV_LTOU|NV_RJUST|NV_LJUST|NV_ZFILL|NV_INTEGER);
stakputc('=');
- if((flag&NV_DOUBLE) && (flag&NV_INTEGER))
+ if((flag&NV_DOUBLE) == NV_DOUBLE)
{
/* export doubles as integers for ksh88 compatibility */
- stakputc(c+(flag&~(NV_DOUBLE|NV_EXPNOTE)));
+ stakputc(c+NV_INTEGER|(flag&~(NV_DOUBLE|NV_EXPNOTE)));
}
else
{
@@ -1327,14 +1845,16 @@ static void attstore(register Namval_t *np, void *data)
{
register int flag = np->nvflag;
register struct adata *ap = (struct adata*)data;
+ ap->sh = &sh;
+ ap->tp = 0;
if(!(flag&NV_EXPORT) || (flag&NV_FUNCT))
return;
flag &= (NV_RDONLY|NV_UTOL|NV_LTOU|NV_RJUST|NV_LJUST|NV_ZFILL|NV_INTEGER);
*ap->attval++ = '=';
- if((flag&NV_DOUBLE) && (flag&NV_INTEGER))
+ if((flag&NV_DOUBLE) == NV_DOUBLE)
{
/* export doubles as integers for ksh88 compatibility */
- *ap->attval++ = ' '+(flag&~(NV_DOUBLE|NV_EXPNOTE));
+ *ap->attval++ = ' '+ NV_INTEGER|(flag&~(NV_DOUBLE|NV_EXPNOTE));
*ap->attval = ' ';
}
else
@@ -1354,6 +1874,8 @@ static void pushnam(Namval_t *np, void *data)
{
register char *value;
register struct adata *ap = (struct adata*)data;
+ ap->sh = &sh;
+ ap->tp = 0;
if(nv_isattr(np,NV_IMPORT))
{
if(np->nvenv)
@@ -1394,16 +1916,22 @@ char **sh_envgen(void)
register int namec;
register char *cp;
struct adata data;
+ Shell_t *shp = sh_getinterp();
+ data.sh = shp;
+ data.tp = 0;
/* L_ARGNOD gets generated automatically as full path name of command */
nv_offattr(L_ARGNOD,NV_EXPORT);
data.attsize = 6;
- namec = nv_scan(sh.var_tree,nullscan,(void*)0,NV_EXPORT,NV_EXPORT);
+ namec = nv_scan(shp->var_tree,nullscan,(void*)0,NV_EXPORT,NV_EXPORT);
+ namec += shp->nenv;
er = (char**)stakalloc((namec+4)*sizeof(char*));
- data.argnam = (er+=2);
- nv_scan(sh.var_tree, pushnam,&data,NV_EXPORT, NV_EXPORT);
+ data.argnam = (er+=2) + shp->nenv;
+ if(shp->nenv)
+ memcpy((void*)er,environ,shp->nenv*sizeof(char*));
+ nv_scan(shp->var_tree, pushnam,&data,NV_EXPORT, NV_EXPORT);
*data.argnam = (char*)stakalloc(data.attsize);
cp = data.attval = strcopy(*data.argnam,e_envmarker);
- nv_scan(sh.var_tree, attstore,&data,0,(NV_RDONLY|NV_UTOL|NV_LTOU|NV_RJUST|NV_LJUST|NV_ZFILL|NV_INTEGER));
+ nv_scan(shp->var_tree, attstore,&data,0,(NV_RDONLY|NV_UTOL|NV_LTOU|NV_RJUST|NV_LJUST|NV_ZFILL|NV_INTEGER));
*data.attval = 0;
if(cp!=data.attval)
data.argnam++;
@@ -1421,16 +1949,20 @@ struct scan
void *scandata;
};
-
static int scanfilter(Dt_t *dict, void *arg, void *data)
{
register Namval_t *np = (Namval_t*)arg;
register int k=np->nvflag;
register struct scan *sp = (struct scan*)data;
+ register struct adata *tp = (struct adata*)sp->scandata;
NOT_USED(dict);
+#if SHOPT_TYPEDEF
+ if(tp && tp->tp && nv_type(np)!=tp->tp)
+ return(0);
+#endif /*SHOPT_TYPEDEF */
if(sp->scanmask?(k&sp->scanmask)==sp->scanflags:(!sp->scanflags || (k&sp->scanflags)))
{
- if(!np->nvalue.cp && !nv_isattr(np,~NV_DEFAULT))
+ if(!np->nvalue.cp && !np->nvfun && !nv_isattr(np,~NV_DEFAULT))
return(0);
if(sp->scanfn)
{
@@ -1473,14 +2005,28 @@ int nv_scan(Dt_t *root, void (*fn)(Namval_t*,void*), void *data,int mask, int fl
/*
* create a new environment scope
*/
-void nv_scope(struct argnod *envlist)
+void sh_scope(Shell_t *shp, struct argnod *envlist, int fun)
{
- register Dt_t *newscope;
+ register Dt_t *newscope, *newroot=shp->var_base;
+ struct Ufunction *rp;
newscope = dtopen(&_Nvdisc,Dtoset);
- dtview(newscope,(Dt_t*)sh.var_tree);
- sh.var_tree = (Dt_t*)newscope;
if(envlist)
+ {
+ dtview(newscope,(Dt_t*)shp->var_tree);
+ shp->var_tree = newscope;
nv_setlist(envlist,NV_EXPORT|NV_NOSCOPE|NV_IDENT|NV_ASSIGN);
+ if(!fun)
+ return;
+ shp->var_tree = dtview(newscope,0);
+ }
+ if((rp=shp->st.real_fun) && rp->sdict)
+ {
+ dtview(rp->sdict,newroot);
+ newroot = rp->sdict;
+
+ }
+ dtview(newscope,(Dt_t*)newroot);
+ shp->var_tree = newscope;
}
/*
@@ -1530,17 +2076,50 @@ void nv_close(Namval_t *np)
NOT_USED(np);
}
-static void table_unset(register Dt_t *root, int flags, Dt_t *oroot)
+static void table_unset(Shell_t *shp, register Dt_t *root, int flags, Dt_t *oroot)
{
- register Namval_t *np,*nq;
- for(np=(Namval_t*)dtfirst(root);np;np=nq)
+ register Namval_t *np,*nq, *npnext;
+ for(np=(Namval_t*)dtfirst(root);np;np=npnext)
{
+ if(nv_isref(np))
+ nv_unref(np);
+ if(nq=dtsearch(oroot,np))
+ {
+ if(nv_cover(nq))
+ {
+ int subshell = shp->subshell;
+ shp->subshell = 0;
+ if(nv_isattr(nq, NV_INTEGER))
+ {
+ Sfdouble_t d = nv_getnum(nq);
+ nv_putval(nq,(char*)&d,NV_LDOUBLE);
+ }
+ else
+ nv_putval(nq, nv_getval(nq), NV_RDONLY);
+ shp->subshell = subshell;
+ np->nvfun = 0;
+ }
+#ifdef _ENV_H
+ if(nv_isattr(nq,NV_EXPORT))
+ sh_envput(shp->env,nq);
+#endif
+ }
+ npnext = (Namval_t*)dtnext(root,np);
+ shp->last_root = root;
+ shp->last_table = 0;
+ if(nv_isvtree(np))
+ {
+ int len = strlen(np->nvname);
+ while((nq=npnext) && memcmp(np->nvname,nq->nvname,len)==0 && nq->nvname[len]=='.')
+
+ {
+ npnext = (Namval_t*)dtnext(root,nq);
+ _nv_unset(nq,flags);
+ nv_delete(nq,root,0);
+ }
+ }
_nv_unset(np,flags);
- if(oroot && (nq=nv_search(nv_name(np),oroot,0)) && nv_isattr(nq,NV_EXPORT))
- sh_envput(sh.env,nq);
- nq = (Namval_t*)dtnext(root,np);
- dtdelete(root,np);
- free((void*)np);
+ nv_delete(np,root,0);
}
}
@@ -1552,9 +2131,11 @@ static void table_unset(register Dt_t *root, int flags, Dt_t *oroot)
* will retain its attributes.
* <flags> can contain NV_RDONLY to override the readonly attribute
* being cleared.
+ * <flags> can contain NV_EXPORT to override preserve nvenv
*/
void _nv_unset(register Namval_t *np,int flags)
{
+ Shell_t *shp = &sh;
register union Value *up;
if(!(flags&NV_RDONLY) && nv_isattr (np,NV_RDONLY))
errormsg(SH_DICT,ERROR_exit(1),e_readonly, nv_name(np));
@@ -1563,24 +2144,47 @@ void _nv_unset(register Namval_t *np,int flags)
register struct slnod *slp = (struct slnod*)(np->nvenv);
if(slp && !nv_isattr(np,NV_NOFREE))
{
+ struct Ufunction *rq,*rp = np->nvalue.rp;
/* free function definition */
register char *name=nv_name(np),*cp= strrchr(name,'.');
if(cp)
{
Namval_t *npv;
*cp = 0;
- npv = nv_open(name,sh.var_tree,NV_NOARRAY|NV_VARNAME|NV_NOADD);
+ npv = nv_open(name,shp->var_tree,NV_NOARRAY|NV_VARNAME|NV_NOADD);
*cp++ = '.';
if(npv)
nv_setdisc(npv,cp,NIL(Namval_t*),(Namfun_t*)npv);
}
+ if(rp->fname && shp->fpathdict && (rq = (struct Ufunction*)nv_search(rp->fname,shp->fpathdict,0)))
+ {
+ do
+ {
+ if(rq->np != np)
+ continue;
+ dtdelete(shp->fpathdict,rq);
+ break;
+ }
+ while(rq = (struct Ufunction*)dtnext(shp->fpathdict,rq));
+ }
+ if(rp->sdict)
+ {
+ Namval_t *mp, *nq;
+ for(mp=(Namval_t*)dtfirst(rp->sdict);mp;mp=nq)
+ {
+ nq = dtnext(rp->sdict,mp);
+ _nv_unset(mp,NV_RDONLY);
+ nv_delete(mp,rp->sdict,0);
+ }
+ dtclose(rp->sdict);
+ }
stakdelete(slp->slptr);
free((void*)np->nvalue.ip);
np->nvalue.ip = 0;
}
goto done;
}
- if(sh.subshell && !nv_isnull(np))
+ if(shp->subshell && !nv_isnull(np))
np = sh_assignok(np,0);
nv_offattr(np,NV_NODISC);
if(np->nvfun && !nv_isref(np))
@@ -1590,49 +2194,52 @@ void _nv_unset(register Namval_t *np,int flags)
{
nv_local=1;
nv_putv(np,NIL(char*),flags,np->nvfun);
+ nv_local=0;
return;
}
/* called from disc, assign the actual value */
nv_local=0;
}
- up = &np->nvalue;
- if(up->cp)
+ if(nv_isarray(np) && np->nvalue.cp!=Empty && np->nvfun)
+ up = np->nvalue.up;
+ else
+ up = &np->nvalue;
+ if(up && up->cp)
{
- if(!nv_isattr (np, NV_NOFREE))
+ if(up->cp!=Empty && !nv_isattr(np, NV_NOFREE))
free((void*)up->cp);
up->cp = 0;
}
done:
if(!nv_isarray(np) || !nv_arrayptr(np))
{
- if(nv_isref(np))
+ if(nv_isref(np) && !nv_isattr(np,NV_EXPORT))
free((void*)np->nvalue.nrp);
nv_setsize(np,0);
if(!nv_isattr(np,NV_MINIMAL) || nv_isattr(np,NV_EXPORT))
{
if(nv_isattr(np,NV_EXPORT) && !strchr(np->nvname,'['))
- env_delete(sh.env,nv_name(np));
- np->nvenv = 0;
+ env_delete(shp->env,nv_name(np));
+ if(!(flags&NV_EXPORT) || nv_isattr(np,NV_IMPORT|NV_EXPORT)==(NV_IMPORT|NV_EXPORT))
+ np->nvenv = 0;
nv_setattr(np,0);
}
else
+ {
nv_setattr(np,NV_MINIMAL);
+ nv_delete(np,(Dt_t*)0,0);
+ }
}
}
-void nv_unset(register Namval_t *np)
-{
- _nv_unset(np,0);
-}
-
/*
* return the node pointer in the highest level scope
*/
-Namval_t *nv_scoped(register Namval_t *np)
+Namval_t *sh_scoped(Shell_t *shp, register Namval_t *np)
{
- if(!dtvnext(sh.var_tree))
+ if(!dtvnext(shp->var_tree))
return(np);
- return(dtsearch(sh.var_tree,np));
+ return(dtsearch(shp->var_tree,np));
}
#if 1
@@ -1671,6 +2278,7 @@ static char *tableval(Dt_t *root)
struct optimize
{
Namfun_t hdr;
+ Shell_t *sh;
char **ptr;
struct optimize *next;
Namval_t *np;
@@ -1699,7 +2307,12 @@ static void put_optimize(Namval_t* np,const char *val,int flags,Namfun_t *fp)
optimize_clear(np,fp);
}
-static const Namdisc_t optimize_disc = {sizeof(struct optimize),put_optimize};
+static Namfun_t *clone_optimize(Namval_t* np, Namval_t *mp, int flags, Namfun_t *fp)
+{
+ return((Namfun_t*)0);
+}
+
+static const Namdisc_t optimize_disc = {sizeof(struct optimize),put_optimize,0,0,0,0,clone_optimize};
void nv_optimize(Namval_t *np)
{
@@ -1707,9 +2320,14 @@ void nv_optimize(Namval_t *np)
register struct optimize *op, *xp;
if(sh.argaddr)
{
+ if(np==SH_LINENO)
+ {
+ sh.argaddr = 0;
+ return;
+ }
for(fp=np->nvfun; fp; fp = fp->next)
{
- if(fp->disc->getnum || fp->disc->getval)
+ if(fp->disc && (fp->disc->getnum || fp->disc->getval))
{
sh.argaddr = 0;
return;
@@ -1781,14 +2399,16 @@ char *nv_getval(register Namval_t *np)
if(!nv_local && sh.argaddr)
nv_optimize(np);
#endif /* SHOPT_OPTIMIZE */
- if(!np->nvfun && !nv_isattr(np,NV_ARRAY|NV_INTEGER|NV_FUNCT|NV_REF|NV_TABLE))
+ if((!np->nvfun || !np->nvfun->disc) && !nv_isattr(np,NV_ARRAY|NV_INTEGER|NV_FUNCT|NV_REF|NV_TABLE))
goto done;
if(nv_isref(np))
{
+ if(!np->nvalue.cp)
+ return(0);
sh.last_table = nv_reftable(np);
return(nv_name(nv_refnode(np)));
}
- if(np->nvfun)
+ if(np->nvfun && np->nvfun->disc)
{
if(!nv_local)
{
@@ -1803,7 +2423,7 @@ char *nv_getval(register Namval_t *np)
Sflong_t ll;
if(!up->cp)
return("0");
- if(nv_isattr (np,NV_DOUBLE))
+ if(nv_isattr (np,NV_DOUBLE)==NV_DOUBLE)
{
Sfdouble_t ld;
double d;
@@ -1813,6 +2433,8 @@ char *nv_getval(register Namval_t *np)
ld = *up->ldp;
if(nv_isattr (np,NV_EXPNOTE))
format = "%.*Lg";
+ else if(nv_isattr (np,NV_HEXFLOAT))
+ format = "%.*La";
else
format = "%.*Lf";
sfprintf(sh.strbuf,format,nv_size(np),ld);
@@ -1822,6 +2444,8 @@ char *nv_getval(register Namval_t *np)
d = *up->dp;
if(nv_isattr (np,NV_EXPNOTE))
format = "%.*g";
+ else if(nv_isattr (np,NV_HEXFLOAT))
+ format = "%.*a";
else
format = "%.*f";
sfprintf(sh.strbuf,format,nv_size(np),d);
@@ -1833,14 +2457,24 @@ char *nv_getval(register Namval_t *np)
if(nv_isattr (np,NV_LONG))
ll = *(Sfulong_t*)up->llp;
else if(nv_isattr (np,NV_SHORT))
- ll = (uint16_t)up->s;
+ {
+ if(nv_isattr(np,NV_INT16P)==NV_INT16P)
+ ll = *(uint16_t*)(up->sp);
+ else
+ ll = (uint16_t)up->s;
+ }
else
ll = *(uint32_t*)(up->lp);
}
else if(nv_isattr (np,NV_LONG))
ll = *up->llp;
else if(nv_isattr (np,NV_SHORT))
- ll = up->s;
+ {
+ if(nv_isattr(np,NV_INT16P)==NV_INT16P)
+ ll = *up->sp;
+ else
+ ll = up->s;
+ }
else
ll = *(up->lp);
if((numeric=nv_size(np))==10)
@@ -1889,7 +2523,7 @@ Sfdouble_t nv_getnum(register Namval_t *np)
#endif /* SHOPT_OPTIMIZE */
if(nv_istable(np))
errormsg(SH_DICT,ERROR_exit(1),e_number,nv_name(np));
- if(np->nvfun)
+ if(np->nvfun && np->nvfun->disc)
{
if(!nv_local)
{
@@ -1898,12 +2532,19 @@ Sfdouble_t nv_getnum(register Namval_t *np)
}
nv_local=0;
}
+ if(nv_isref(np))
+ {
+ str = nv_refsub(np);
+ np = nv_refnode(np);
+ if(str)
+ nv_putsub(np,str,0L);
+ }
if(nv_isattr (np, NV_INTEGER))
{
up= &np->nvalue;
- if(!up->lp)
+ if(!up->lp || up->cp==Empty)
r = 0;
- else if(nv_isattr(np, NV_DOUBLE))
+ else if(nv_isattr(np, NV_DOUBLE)==NV_DOUBLE)
{
if(nv_isattr(np, NV_LONG))
r = *up->ldp;
@@ -1915,7 +2556,12 @@ Sfdouble_t nv_getnum(register Namval_t *np)
if(nv_isattr(np, NV_LONG))
r = (Sflong_t)*((Sfulong_t*)up->llp);
else if(nv_isattr(np, NV_SHORT))
- r = (Sflong_t)((uint16_t)up->s);
+ {
+ if(nv_isattr(np,NV_INT16P)==NV_INT16P)
+ r = (Sflong_t)(*(uint16_t*)up->sp);
+ else
+ r = (Sflong_t)((uint16_t)up->s);
+ }
else
r = *((uint32_t*)up->lp);
}
@@ -1924,7 +2570,12 @@ Sfdouble_t nv_getnum(register Namval_t *np)
if(nv_isattr(np, NV_LONG))
r = *up->llp;
else if(nv_isattr(np, NV_SHORT))
- r = up->s;
+ {
+ if(nv_isattr(np,NV_INT16P)==NV_INT16P)
+ r = *up->sp;
+ else
+ r = up->s;
+ }
else
r = *up->lp;
}
@@ -1952,16 +2603,17 @@ void nv_newattr (register Namval_t *np, unsigned newatts, int size)
register unsigned int n;
Namarr_t *ap = 0;
int oldsize,oldatts;
+ Namfun_t *fp= (newatts&NV_NODISC)?np->nvfun:0;
+ newatts &= ~NV_NODISC;
/* check for restrictions */
if(sh_isoption(SH_RESTRICTED) && ((sp=nv_name(np))==nv_name(PATHNOD) || sp==nv_name(SHELLNOD) || sp==nv_name(ENVNOD) || sp==nv_name(FPATHNOD)))
errormsg(SH_DICT,ERROR_exit(1),e_restricted,nv_name(np));
/* handle attributes that do not change data separately */
n = np->nvflag;
-#if SHOPT_BSH
if(newatts&NV_EXPORT)
nv_offattr(np,NV_IMPORT);
-#endif /* SHOPT_BSH */
+#ifdef _ENV_H
if(((n^newatts)&NV_EXPORT))
{
/* record changes to the environment */
@@ -1970,6 +2622,7 @@ void nv_newattr (register Namval_t *np, unsigned newatts, int size)
else
sh_envput(sh.env,np);
}
+#endif
if((size==0||(n&NV_INTEGER)) && ((n^newatts)&~NV_NOCHANGE)==0)
{
if(size)
@@ -1983,6 +2636,8 @@ void nv_newattr (register Namval_t *np, unsigned newatts, int size)
nv_putsub(np,NIL(char*),ARRAY_SCAN);
oldsize = nv_size(np);
oldatts = np->nvflag;
+ if(fp)
+ np->nvfun = 0;
if(ap) /* add element to prevent array deletion */
ap->nelem++;
do
@@ -2000,11 +2655,16 @@ void nv_newattr (register Namval_t *np, unsigned newatts, int size)
Namval_t *mp;
ap->nelem &= ~ARRAY_SCAN;
if(mp=nv_opensub(np))
- nv_onattr(mp,NV_NOFREE);
- }
- nv_unset(np);
- if(ap)
+ {
+ nv_unset(mp);
+ mp->nvalue.cp = Empty;
+ }
+ else
+ nv_unset(np);
ap->nelem |= ARRAY_SCAN;
+ }
+ else
+ nv_unset(np);
if(size==0 && (newatts&(NV_LJUST|NV_RJUST|NV_ZFILL)))
size = n;
}
@@ -2020,6 +2680,8 @@ void nv_newattr (register Namval_t *np, unsigned newatts, int size)
}
}
while(ap && nv_nextsub(np));
+ if(fp)
+ np->nvfun = fp;
if(ap)
ap->nelem--;
return;
@@ -2100,55 +2762,127 @@ char* setenviron(const char *name)
}
/*
- * copy <str1> to <str2> changing lower case to upper case
- * <str2> must be big enough to hold <str1>
- * <str1> and <str2> may point to the same place.
+ * convert <str> to upper case
*/
-
-static void ltou(register char const *str1,register char *str2)
-/*@
- assume str1!=0 && str2!=0;
- return x satisfying strlen(in str1)==strlen(in str2);
-@*/
+static void ltou(register char *str)
{
register int c;
- for(; c= *((unsigned char*)str1); str1++,str2++)
+ for(; c= *((unsigned char*)str); str++)
{
if(islower(c))
- *str2 = toupper(c);
- else
- *str2 = c;
+ *str = toupper(c);
+ }
+}
+
+/*
+ * convert <str> to lower case
+ */
+static void utol(register char *str)
+{
+ register int c;
+ for(; c= *((unsigned char*)str); str++)
+ {
+ if(isupper(c))
+ *str = tolower(c);
}
- *str2 = 0;
}
/*
* normalize <cp> and return pointer to subscript if any
+ * if <eq> is specified, return pointer to first = not in a subscript
*/
-static char *lastdot(register char *cp)
+static char *lastdot(register char *cp, int eq)
{
- register char *dp=cp, *ep=0;
+ register char *ep=0;
register int c;
+ if(eq)
+ cp++;
while(c= *cp++)
{
- *dp++ = c;
if(c=='[')
- ep = cp;
+ cp = nv_endsubscript((Namval_t*)0,ep=cp,0);
else if(c=='.')
{
if(*cp=='[')
- {
- ep = nv_endsubscript((Namval_t*)0,cp,0);
- c = ep-cp;
- memcpy(dp,cp,c);
- dp = sh_checkid(dp+1,dp+c);
- cp = ep;
- }
+ cp = nv_endsubscript((Namval_t*)0,cp,0);
ep = 0;
}
+ else if(eq && c == '=')
+ return(cp-1);
}
- *dp = 0;
- return(ep);
+ return(eq?0:ep);
+}
+
+int nv_rename(register Namval_t *np, int flags)
+{
+ Shell_t *shp = &sh;
+ register Namval_t *mp=0,*nr=0;
+ register char *cp;
+ int index= -1;
+ Namval_t *last_table = shp->last_table;
+ Dt_t *last_root = shp->last_root;
+ Dt_t *hp = 0;
+ if(nv_isattr(np,NV_PARAM) && shp->st.prevst)
+ {
+ if(!(hp=(Dt_t*)shp->st.prevst->save_tree))
+ hp = dtvnext(shp->var_tree);
+ }
+ if(!(cp=nv_getval(np)))
+ {
+ if(flags&NV_MOVE)
+ errormsg(SH_DICT,ERROR_exit(1),e_varname,"");
+ return(0);
+ }
+ if(lastdot(cp,0) && nv_isattr(np,NV_MINIMAL))
+ errormsg(SH_DICT,ERROR_exit(1),e_varname,nv_name(np));
+ if(nv_isarray(np) && !(mp=nv_opensub(np)))
+ index=nv_aindex(np);
+ if(!hp)
+ hp = shp->var_tree;
+ if(!(nr = nv_open(cp, hp, flags|NV_ARRAY|NV_NOREF|NV_NOSCOPE|NV_NOADD|NV_NOFAIL)))
+ hp = shp->var_base;
+ else if(shp->last_root)
+ hp = shp->last_root;
+ if(!nr)
+ nr= nv_open(cp, hp, flags|NV_NOREF|((flags&NV_MOVE)?0:NV_NOFAIL));
+ if(!nr)
+ {
+ if(!nv_isvtree(np))
+ _nv_unset(np,0);
+ return(0);
+ }
+ if(!mp && index>=0 && nv_isvtree(nr))
+ {
+ sfprintf(shp->strbuf,"%s[%d]%c",nv_name(np),index,0);
+ /* create a virtual node */
+ if(mp = nv_open(sfstruse(shp->strbuf),shp->var_tree,NV_VARNAME|NV_ADD|NV_ARRAY))
+ mp->nvenv = (void*)np;
+ }
+ if(mp)
+ np = mp;
+ if(nr==np)
+ {
+ if(index<0)
+ return(0);
+ if(cp = nv_getval(np))
+ cp = strdup(cp);
+ }
+ _nv_unset(np,0);
+ if(nr==np)
+ {
+ nv_putsub(np,(char*)0, index);
+ nv_putval(np,cp,0);
+ free((void*)cp);
+ return(1);
+ }
+ shp->prev_table = shp->last_table;
+ shp->prev_root = shp->last_root;
+ shp->last_table = last_table;
+ shp->last_root = last_root;
+ nv_clone(nr,np,(flags&NV_MOVE)|NV_COMVAR);
+ if(flags&NV_MOVE)
+ nv_delete(nr,(Dt_t*)0,NV_NOFREE);
+ return(1);
}
/*
@@ -2156,28 +2890,34 @@ static char *lastdot(register char *cp)
*/
void nv_setref(register Namval_t *np, Dt_t *hp, int flags)
{
- register Namval_t *nq, *nr;
+ Shell_t *shp = &sh;
+ register Namval_t *nq, *nr=0;
register char *ep,*cp;
if(nv_isref(np))
return;
if(nv_isarray(np))
errormsg(SH_DICT,ERROR_exit(1),e_badref,nv_name(np));
if(!(cp=nv_getval(np)))
- errormsg(SH_DICT,ERROR_exit(1),e_noref,nv_name(np));
- if((ep = lastdot(cp)) && nv_isattr(np,NV_MINIMAL))
- errormsg(SH_DICT,ERROR_exit(1),e_badref,nv_name(np));
- if(!hp)
- hp = sh.var_tree;
- nr= nq = nv_open(cp, hp, flags|NV_NOREF);
- while(nv_isref(nr))
{
- sh.last_table = nv_reftable(nr);
- hp = nv_reftree(nr);
- nr = nv_refnode(nr);
+ nv_unset(np);
+ nv_onattr(np,NV_REF);
+ return;
}
+ if((ep = lastdot(cp,0)) && nv_isattr(np,NV_MINIMAL))
+ errormsg(SH_DICT,ERROR_exit(1),e_badref,nv_name(np));
+ if(!hp)
+ hp = shp->var_tree;
+ if(!(nr = nq = nv_open(cp, hp, flags|NV_NOSCOPE|NV_NOADD|NV_NOFAIL)))
+ hp = shp->var_base;
+ else if(shp->last_root)
+ hp = shp->last_root;
+ if(nq && ep && nv_isarray(nq) && !nv_getsub(nq))
+ nv_endsubscript(nq,ep-1,NV_ADD);
+ if(!nr)
+ nr= nq = nv_open(cp, hp, flags);
if(nr==np)
{
- if(sh.namespace && nv_dict(sh.namespace)==hp)
+ if(shp->namespace && nv_dict(shp->namespace)==hp)
errormsg(SH_DICT,ERROR_exit(1),e_selfref,nv_name(np));
/* bind to earlier scope, or add to global scope */
if(!(hp=dtvnext(hp)) || (nq=nv_search((char*)np,hp,NV_ADD|HASH_BUCKET))==np)
@@ -2186,18 +2926,27 @@ void nv_setref(register Namval_t *np, Dt_t *hp, int flags)
if(ep)
{
/* cause subscript evaluation and return result */
-#if 0
- nv_endsubscript(nq,ep,NV_ADD);
-#endif
- ep = nv_getsub(nq);
+ if(nv_isarray(nq))
+ ep = nv_getsub(nq);
+ else
+ {
+ ep[strlen(ep)-1] = 0;
+ nv_putsub(nr, ep, 0);
+ ep[strlen(ep)-1] = ']';
+ if(nq = nv_opensub(nr))
+ ep = 0;
+ else
+ nq = nr;
+ }
}
nv_unset(np);
+ nv_delete(np,(Dt_t*)0,0);
np->nvalue.nrp = newof(0,struct Namref,1,0);
np->nvalue.nrp->np = nq;
np->nvalue.nrp->root = hp;
if(ep)
np->nvalue.nrp->sub = strdup(ep);
- np->nvalue.nrp->table = sh.last_table;
+ np->nvalue.nrp->table = shp->last_table;
nv_onattr(np,NV_REF|NV_NOFREE);
}
@@ -2241,15 +2990,22 @@ Shscope_t *sh_setscope(Shscope_t *scope)
*sh.st.self = sh.st;
sh.st = *((struct sh_scoped*)scope);
sh.var_tree = scope->var_tree;
+ SH_PATHNAMENOD->nvalue.cp = sh.st.filename;
+ SH_FUNNAMENOD->nvalue.cp = sh.st.funname;
return(old);
}
-void nv_unscope(void)
+void sh_unscope(Shell_t *shp)
{
- register Dt_t *root = sh.var_tree;
+ register Dt_t *root = shp->var_tree;
register Dt_t *dp = dtview(root,(Dt_t*)0);
- table_unset(root,NV_RDONLY|NV_NOSCOPE,dp);
- sh.var_tree=dp;
+ table_unset(shp,root,NV_RDONLY|NV_NOSCOPE,dp);
+ if(shp->st.real_fun && dp==shp->st.real_fun->sdict)
+ {
+ dp = dtview(dp,(Dt_t*)0);
+ shp->st.real_fun->sdict->view = dp;
+ }
+ shp->var_tree=dp;
dtclose(root);
}
@@ -2328,6 +3084,18 @@ char *nv_name(register Namval_t *np)
char *cp;
if(is_abuiltin(np) || is_afunction(np))
return(np->nvname);
+ if(!nv_isattr(np,NV_MINIMAL|NV_EXPORT) && np->nvenv)
+ {
+ Namval_t *nq= sh.last_table, *mp= (Namval_t*)np->nvenv;
+ if(np==sh.last_table)
+ sh.last_table = 0;
+ if(nv_isarray(mp))
+ sfprintf(sh.strbuf,"%s[%s]",nv_name(mp),np->nvname);
+ else
+ sfprintf(sh.strbuf,"%s.%s",nv_name(mp),np->nvname);
+ sh.last_table = nq;
+ return(sfstruse(sh.strbuf));
+ }
if(nv_istable(np))
#if 1
sh.last_table = nv_parent(np);
@@ -2380,3 +3148,22 @@ int nv_setsize(register Namval_t *np, int size)
np->nvsize = size;
return(oldsize);
}
+
+Shell_t *nv_shell(Namval_t *np)
+{
+ Namfun_t *fp;
+ for(fp=np->nvfun;fp;fp=fp->next)
+ {
+ if(!fp->disc)
+ return((Shell_t*)fp->last);
+ }
+ return(0);
+}
+
+#undef nv_unset
+
+void nv_unset(register Namval_t *np)
+{
+ _nv_unset(np,0);
+ return;
+}
diff --git a/usr/src/lib/libshell/common/sh/nvdisc.c b/usr/src/lib/libshell/common/sh/nvdisc.c
index 533f5f7f5c..bcf987b9a6 100644
--- a/usr/src/lib/libshell/common/sh/nvdisc.c
+++ b/usr/src/lib/libshell/common/sh/nvdisc.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -28,8 +28,6 @@
#include "builtins.h"
#include "path.h"
-static const char *discnames[] = { "get", "set", "append", "unset", 0 };
-
int nv_compare(Dt_t* dict, Void_t *sp, Void_t *dp, Dtdisc_t *disc)
{
if(sp==dp)
@@ -82,14 +80,14 @@ Sfdouble_t nv_getn(Namval_t *np, register Namfun_t *nfp)
nv_local=0;
for(; fp; fp=fp->next)
{
- if(!fp->disc->getnum && !fp->disc->getval)
+ if(!fp->disc || (!fp->disc->getnum && !fp->disc->getval))
continue;
if(!fp->disc->getnum && nv_isattr(np,NV_INTEGER))
continue;
if(!nv_isattr(np,NV_NODISC) || fp==(Namfun_t*)nv_arrayptr(np))
break;
}
- if(fp && fp->disc->getnum)
+ if(fp && fp->disc && fp->disc->getnum)
d = (*fp->disc->getnum)(np,fp);
else if(nv_isattr(np,NV_INTEGER))
{
@@ -98,7 +96,7 @@ Sfdouble_t nv_getn(Namval_t *np, register Namfun_t *nfp)
}
else
{
- if(fp && fp->disc->getval)
+ if(fp && fp->disc && fp->disc->getval)
str = (*fp->disc->getval)(np,fp);
else
str = nv_getv(np,fp?fp:nfp);
@@ -121,15 +119,18 @@ void nv_putv(Namval_t *np, const char *value, int flags, register Namfun_t *nfp)
if((fp=nfp) != NIL(Namfun_t*) && !nv_local)
fp = nfp = nfp->next;
nv_local=0;
+ if(flags&NV_NODISC)
+ fp = 0;
for(; fp; fp=fpnext)
{
fpnext = fp->next;
- if(!fp->disc->putval)
+ if(!fp->disc || !fp->disc->putval)
{
if(!value)
{
- nv_disc(np,fp,NV_POP);
- if(!fp->nofree)
+ if(fp->disc || !(fp->nofree&1))
+ nv_disc(np,fp,NV_POP);
+ if(!(fp->nofree&1))
free((void*)fp);
}
continue;
@@ -145,25 +146,10 @@ void nv_putv(Namval_t *np, const char *value, int flags, register Namfun_t *nfp)
if(value)
nv_putval(np, value, flags);
else
- _nv_unset(np, flags&NV_RDONLY);
+ _nv_unset(np, flags&(NV_RDONLY|NV_EXPORT));
}
}
-#if 0
-/*
- * node creation discipline
- */
-Namval_t *nv_create(register Namval_t* np,const char *name,int flag,register Namfun_t *fp)
-{
- fp = fp?fp->next:np->nvfun;
- while(fp && fp->disc && !fp->disc->createf)
- fp = fp->next;
- if(fp && fp->disc->createf)
- return((*fp->disc->createf)(np,name,flag,fp));
- return(NIL(Namval_t*));
-}
-#endif
-
#define LOOKUP 0
#define ASSIGN 1
#define APPEND 2
@@ -240,7 +226,7 @@ static void chktfree(register Namval_t *np, register struct vardisc *vp)
{
/* no disc left so pop */
Namfun_t *fp;
- if((fp=nv_stack(np, NIL(Namfun_t*))) && !fp->nofree)
+ if((fp=nv_stack(np, NIL(Namfun_t*))) && !(fp->nofree&1))
free((void*)fp);
}
}
@@ -255,6 +241,23 @@ static void assign(Namval_t *np,const char* val,int flags,Namfun_t *handle)
register Namval_t *nq = vp->disc[type];
struct blocked block, *bp = block_info(np, &block);
Namval_t node;
+ union Value *up = np->nvalue.up;
+#if SHOPT_TYPEDEF
+ Namval_t *tp, *nr;
+ if(val && (tp=nv_type(np)) && (nr=nv_open(val,sh.var_tree,NV_VARNAME|NV_ARRAY|NV_NOADD|NV_NOFAIL)) && tp==nv_type(nr))
+ {
+ char *sub = nv_getsub(np);
+ nv_unset(np);
+ if(sub)
+ {
+ nv_putsub(np, sub, ARRAY_ADD);
+ nv_putval(np,nv_getval(nr), 0);
+ }
+ else
+ nv_clone(nr,np,0);
+ goto done;
+ }
+#endif /* SHOPT_TYPEDEF */
if(val || isblocked(bp,type))
{
if(!nq || isblocked(bp,type))
@@ -269,7 +272,7 @@ static void assign(Namval_t *np,const char* val,int flags,Namfun_t *handle)
nv_unset(SH_VALNOD);
}
if(flags&NV_INTEGER)
- nv_onattr(SH_VALNOD,(flags&(NV_INTEGER|NV_LONG|NV_DOUBLE|NV_EXPNOTE|NV_SHORT)));
+ nv_onattr(SH_VALNOD,(flags&(NV_LONG|NV_DOUBLE|NV_EXPNOTE|NV_HEXFLOAT|NV_SHORT)));
nv_putval(SH_VALNOD, val, (flags&NV_INTEGER)?flags:NV_NOFREE);
}
else
@@ -287,6 +290,8 @@ static void assign(Namval_t *np,const char* val,int flags,Namfun_t *handle)
if(!vp->disc[type])
chktfree(np,vp);
}
+ if(nv_isarray(np))
+ np->nvalue.up = up;
if(val)
{
register char *cp;
@@ -320,6 +325,8 @@ static void assign(Namval_t *np,const char* val,int flags,Namfun_t *handle)
Namarr_t *ap;
block(bp,type);
nv_putv(np, val, flags, handle);
+ if(sh.subshell)
+ goto done;
if(nv_isarray(np) && (ap=nv_arrayptr(np)) && ap->nelem>0)
goto done;
for(n=0; n < sizeof(vp->disc)/sizeof(*vp->disc); n++)
@@ -332,7 +339,7 @@ static void assign(Namval_t *np,const char* val,int flags,Namfun_t *handle)
}
unblock(bp,type);
nv_disc(np,handle,NV_POP);
- if(!handle->nofree)
+ if(!(handle->nofree&1))
free(handle);
}
done:
@@ -351,6 +358,7 @@ static char* lookup(Namval_t *np, Namfun_t *handle)
register Namval_t *nq = vp->disc[LOOKUP];
register char *cp=0;
Namval_t node;
+ union Value *up = np->nvalue.up;
if(nq && !isblocked(bp,LOOKUP))
{
node = *SH_VALNOD;
@@ -364,15 +372,19 @@ static char* lookup(Namval_t *np, Namfun_t *handle)
unblock(bp,LOOKUP);
if(!vp->disc[LOOKUP])
chktfree(np,vp);
- cp = nv_getval(SH_VALNOD);
+ if(cp = nv_getval(SH_VALNOD))
+ {
+ cp = stkcopy(stkstd,cp);
+ _nv_unset(SH_VALNOD,NV_RDONLY);
+ }
if(!nv_isnull(&node))
{
- if(cp)
- cp = strdup(cp);
/* restore everything but the nvlink field */
memcpy(&SH_VALNOD->nvname, &node.nvname, sizeof(node)-sizeof(node.nvlink));
}
}
+ if(nv_isarray(np))
+ np->nvalue.up = up;
if(!cp)
cp = nv_getv(np,handle);
if(bp== &block)
@@ -380,6 +392,7 @@ static char* lookup(Namval_t *np, Namfun_t *handle)
return(cp);
}
+
static const Namdisc_t shdisc =
{
sizeof(struct vardisc),
@@ -399,6 +412,8 @@ char *nv_setdisc(register Namval_t* np,register const char *event,Namval_t *acti
register struct vardisc *vp = (struct vardisc*)np->nvfun;
register int type;
char *empty = "";
+ if(vp && !vp->fun.disc)
+ vp = 0;
if(np == (Namval_t*)fp)
{
register const char *name;
@@ -407,11 +422,11 @@ char *nv_setdisc(register Namval_t* np,register const char *event,Namval_t *acti
if(!event)
{
if(!action)
- return((char*)discnames[0]);
+ return((char*)nv_discnames[0]);
getname=1;
event = (char*)action;
}
- for(type=0; name=discnames[type]; type++)
+ for(type=0; name=nv_discnames[type]; type++)
{
if(strcmp(event,name)==0)
break;
@@ -419,13 +434,16 @@ char *nv_setdisc(register Namval_t* np,register const char *event,Namval_t *acti
if(getname)
{
event = 0;
- if(name && !(name = discnames[++type]))
+ if(name && !(name = nv_discnames[++type]))
action = 0;
}
if(!name)
{
- if((fp=(Namfun_t*)vp) && fp->disc->setdisc)
- return((*fp->disc->setdisc)(np,event,action,fp));
+ for(fp=(Namfun_t*)vp; fp; fp=fp->next)
+ {
+ if(fp->disc && fp->disc->setdisc)
+ return((*fp->disc->setdisc)(np,event,action,fp));
+ }
}
else if(getname)
return((char*)name);
@@ -437,7 +455,7 @@ char *nv_setdisc(register Namval_t* np,register const char *event,Namval_t *acti
/* not the top level */
while(fp = fp->next)
{
- if(fp->disc->setdisc)
+ if(fp->disc && fp->disc->setdisc)
return((*fp->disc->setdisc)(np,event,action,fp));
}
return(NIL(char*));
@@ -472,7 +490,6 @@ char *nv_setdisc(register Namval_t* np,register const char *event,Namval_t *acti
return(action?(char*)action:empty);
}
-
/*
* Set disc on given <event> to <action>
* If action==np, the current disc is returned
@@ -525,7 +542,7 @@ static char *setdisc(register Namval_t* np,register const char *event,Namval_t *
static void putdisc(Namval_t* np, const char* val, int flag, Namfun_t* fp)
{
nv_putv(np,val,flag,fp);
- if(!val)
+ if(!val && !(flag&NV_NOFREE))
{
register Nambfun_t *vp = (Nambfun_t*)fp;
register int i;
@@ -544,7 +561,7 @@ static void putdisc(Namval_t* np, const char* val, int flag, Namfun_t* fp)
}
}
nv_disc(np,fp,NV_POP);
- if(!fp->nofree)
+ if(!(fp->nofree&1))
free((void*)fp);
}
@@ -552,7 +569,7 @@ static void putdisc(Namval_t* np, const char* val, int flag, Namfun_t* fp)
static const Namdisc_t Nv_bdisc = { 0, putdisc, 0, 0, setdisc };
-static Namfun_t *nv_clone_disc(register Namfun_t *fp)
+Namfun_t *nv_clone_disc(register Namfun_t *fp, int flags)
{
register Namfun_t *nfp;
register int size;
@@ -561,7 +578,9 @@ static Namfun_t *nv_clone_disc(register Namfun_t *fp)
if(!(nfp=newof(NIL(Namfun_t*),Namfun_t,1,size-sizeof(Namfun_t))))
return(0);
memcpy(nfp,fp,size);
- nfp->nofree = 0;
+ if(flags&NV_COMVAR)
+ nfp->nofree &= ~1;
+ nfp->nofree |= (flags&NV_RDONLY)?1:0;
return(nfp);
}
@@ -578,7 +597,8 @@ int nv_adddisc(Namval_t *np, const char **names, Namval_t **funs)
if(!(vp = newof(NIL(Nambfun_t*),Nambfun_t,1,n*sizeof(Namval_t*))))
return(0);
vp->fun.dsize = sizeof(Nambfun_t)+n*sizeof(Namval_t*);
- vp->fun.funs = 1;
+ vp->fun.nofree |= 2;
+ vp->num = n;
if(funs)
memcpy((void*)vp->bltins, (void*)funs,n*sizeof(Namval_t*));
else while(n>=0)
@@ -590,7 +610,7 @@ int nv_adddisc(Namval_t *np, const char **names, Namval_t **funs)
}
/*
- * push, pop, clone, or reorder disciplines onto node <np>
+ * push, pop, clne, or reorder disciplines onto node <np>
* mode can be one of
* NV_FIRST: Move or push <fp> to top of the stack or delete top
* NV_LAST: Move or push <fp> to bottom of stack or delete last
@@ -606,11 +626,12 @@ Namfun_t *nv_disc(register Namval_t *np, register Namfun_t* fp, int mode)
return(0);
if(fp)
{
+ fp->subshell = sh.subshell;
if((lp=np->nvfun)==fp)
{
if(mode==NV_CLONE)
{
- lp = nv_clone_disc(fp);
+ lp = nv_clone_disc(fp,0);
return(np->nvfun=lp);
}
if(mode==NV_FIRST || mode==0)
@@ -618,18 +639,22 @@ Namfun_t *nv_disc(register Namval_t *np, register Namfun_t* fp, int mode)
np->nvfun = lp->next;
if(mode==NV_POP)
return(fp);
+ if(mode==NV_LAST && (lp->next==0 || lp->next->disc==0))
+ return(fp);
}
/* see if <fp> is on the list already */
lpp = &np->nvfun;
if(lp)
{
- while(lp->next)
+ while(lp->next && lp->next->disc)
{
if(lp->next==fp)
{
+ if(mode==NV_LAST && fp->next==0)
+ return(fp);
if(mode==NV_CLONE)
{
- fp = nv_clone_disc(fp);
+ fp = nv_clone_disc(fp,0);
lp->next = fp;
return(fp);
}
@@ -652,8 +677,8 @@ Namfun_t *nv_disc(register Namval_t *np, register Namfun_t* fp, int mode)
fp->next = 0;
else
{
- if(fp->nofree && *lpp)
- fp = nv_clone_disc(fp);
+ if((fp->nofree&1) && *lpp)
+ fp = nv_clone_disc(fp,0);
fp->next = *lpp;
}
*lpp = fp;
@@ -698,7 +723,7 @@ static void put_notify(Namval_t* np,const char *val,int flags,Namfun_t *fp)
nv_stack(np,fp);
nv_stack(np,(Namfun_t*)0);
*pp->ptr = 0;
- if(!fp->nofree)
+ if(!(fp->nofree&1))
free((void*)fp);
}
@@ -713,7 +738,7 @@ int nv_unsetnotify(Namval_t *np, char **addr)
{
nv_stack(np,fp);
nv_stack(np,(Namfun_t*)0);
- if(!fp->nofree)
+ if(!(fp->nofree&1))
free((void*)fp);
return(1);
}
@@ -754,7 +779,7 @@ static void *num_clone(register Namval_t *np, void *val)
void *nval;
if(!val)
return(0);
- if(nv_isattr(np,NV_DOUBLE))
+ if(nv_isattr(np,NV_DOUBLE)==NV_DOUBLE)
{
if(nv_isattr(np,NV_LONG))
size = sizeof(Sfdouble_t);
@@ -768,7 +793,12 @@ static void *num_clone(register Namval_t *np, void *val)
if(nv_isattr(np,NV_LONG))
size = sizeof(Sflong_t);
else if(nv_isattr(np,NV_SHORT))
- size = sizeof(int16_t);
+ {
+ if(nv_isattr(np,NV_INT16P)==NV_INT16P)
+ size = sizeof(short);
+ else
+ return((void*)np->nvalue.ip);
+ }
else
size = sizeof(int32_t);
}
@@ -778,17 +808,22 @@ static void *num_clone(register Namval_t *np, void *val)
return(nval);
}
-static void clone_all_disc( Namval_t *np, Namval_t *mp, int flags)
+void clone_all_disc( Namval_t *np, Namval_t *mp, int flags)
{
- register Namfun_t *fp, **mfp = &mp->nvfun, *nfp;
- for(fp=np->nvfun; fp;fp=fp->next)
+ register Namfun_t *fp, **mfp = &mp->nvfun, *nfp, *fpnext;
+ for(fp=np->nvfun; fp;fp=fpnext)
{
- if(fp->funs && (flags&NV_NODISC))
+ fpnext = fp->next;
+ if(!fpnext && (flags&NV_COMVAR) && fp->disc && fp->disc->namef)
+ return;
+ if((fp->nofree&2) && (flags&NV_NODISC))
nfp = 0;
if(fp->disc && fp->disc->clonef)
nfp = (*fp->disc->clonef)(np,mp,flags,fp);
+ else if(flags&NV_MOVE)
+ nfp = fp;
else
- nfp = nv_clone_disc(fp);
+ nfp = nv_clone_disc(fp,flags);
if(!nfp)
continue;
nfp->next = 0;
@@ -803,38 +838,69 @@ static void clone_all_disc( Namval_t *np, Namval_t *mp, int flags)
* NV_MOVE - move <np> to <mp>
* NV_NOFREE - mark the new node as nofree
* NV_NODISC - discplines with funs non-zero will not be copied
+ * NV_COMVAR - cloning a compound variable
*/
int nv_clone(Namval_t *np, Namval_t *mp, int flags)
{
- Namfun_t *fp;
+ Namfun_t *fp, *fpnext;
+ const char *val = mp->nvalue.cp;
+ unsigned short flag = mp->nvflag;
+ unsigned short size = mp->nvsize;
+ for(fp=mp->nvfun; fp; fp=fpnext)
+ {
+ fpnext = fp->next;
+ if(!fpnext && (flags&NV_COMVAR) && fp->disc && fp->disc->namef)
+ break;
+ if(!(fp->nofree&1))
+ free((void*)fp);
+ }
+ mp->nvfun = fp;
if(fp=np->nvfun)
{
- if(flags&NV_MOVE)
+ if(nv_isattr(mp,NV_EXPORT|NV_MINIMAL) == (NV_EXPORT|NV_MINIMAL))
{
- mp->nvfun = fp;
- goto skip;
+ mp->nvenv = 0;
+ nv_offattr(mp,NV_MINIMAL);
}
+ if(!(flags&NV_COMVAR) && !nv_isattr(np,NV_MINIMAL) && np->nvenv && !(nv_isattr(mp,NV_MINIMAL)))
+ mp->nvenv = np->nvenv;
+ mp->nvflag &= NV_MINIMAL;
+ mp->nvflag |= np->nvflag&~(NV_ARRAY|NV_MINIMAL|NV_NOFREE);
+ flag = mp->nvflag;
clone_all_disc(np, mp, flags);
}
if(flags&NV_APPEND)
return(1);
-skip:
- nv_setsize(mp,nv_size(np));
- if(!nv_isattr(mp,NV_MINIMAL) || nv_isattr(mp,NV_EXPORT))
- mp->nvenv = (!nv_isattr(np,NV_MINIMAL)||nv_isattr(np,NV_EXPORT))?np->nvenv:0;
- mp->nvalue.cp = np->nvalue.cp;
- mp->nvflag = np->nvflag;
+ if(mp->nvsize == size)
+ nv_setsize(mp,nv_size(np));
+ if(mp->nvflag == flag)
+ mp->nvflag = (np->nvflag&~(NV_MINIMAL))|(mp->nvflag&NV_MINIMAL);
+ if(mp->nvalue.cp==val && !nv_isattr(np,NV_INTEGER))
+ {
+ if(np->nvalue.cp && np->nvalue.cp!=Empty && (flags&NV_COMVAR) && !(flags&NV_MOVE))
+ {
+ if(size)
+ mp->nvalue.cp = (char*)memdup(np->nvalue.cp,size);
+ else
+ mp->nvalue.cp = strdup(np->nvalue.cp);
+ nv_offattr(mp,NV_NOFREE);
+ }
+ else if(!(mp->nvalue.cp = np->nvalue.cp))
+ nv_offattr(mp,NV_NOFREE);
+ }
if(flags&NV_MOVE)
{
+ if(nv_isattr(np,NV_INTEGER))
+ mp->nvalue.ip = np->nvalue.ip;
np->nvfun = 0;
np->nvalue.cp = 0;
if(!nv_isattr(np,NV_MINIMAL) || nv_isattr(mp,NV_EXPORT))
np->nvenv = 0;
- np->nvflag = 0;
+ np->nvflag &= NV_MINIMAL;
nv_setsize(np,0);
return(1);
}
- if(nv_isattr(np,NV_INTEGER))
+ if(nv_isattr(np,NV_INTEGER) && mp->nvalue.ip!=np->nvalue.ip)
mp->nvalue.ip = (int*)num_clone(np,(void*)np->nvalue.ip);
else if(flags&NV_NOFREE)
nv_onattr(np,NV_NOFREE);
@@ -912,7 +978,6 @@ Namval_t *nv_search(const char *name, Dt_t *root, int mode)
}
if(!np && (mode&NV_ADD))
{
-
if(sh.namespace && !(mode&HASH_NOSCOPE) && root==sh.var_tree)
root = nv_dict(sh.namespace);
else if(!dp && !(mode&HASH_NOSCOPE))
@@ -939,9 +1004,10 @@ Namval_t *nv_search(const char *name, Dt_t *root, int mode)
*/
Namval_t *nv_bfsearch(const char *name, Dt_t *root, Namval_t **var, char **last)
{
- int offset = staktell();
+ int c,offset = staktell();
register char *sp, *cp=0;
Namval_t *np, *nq;
+ char *dname=0;
if(var)
*var = 0;
/* check for . in the name before = */
@@ -949,19 +1015,42 @@ Namval_t *nv_bfsearch(const char *name, Dt_t *root, Namval_t **var, char **last)
{
if(*sp=='=')
return(0);
- if(*sp=='.')
+ if(*sp=='[')
+ {
+ if(sp[-1]!='.')
+ dname = sp;
+ while(*sp=='[')
+ {
+ sp = nv_endsubscript((Namval_t*)0,(char*)sp,0);
+ if(sp[-1]!=']')
+ return(0);
+ }
+ if(*sp==0)
+ break;
+ if(*sp!='.')
+ return(0);
+ if(dname)
+ {
+ cp = dname;
+ dname = sp+1;
+ }
+ }
+ else if(*sp=='.')
cp = sp;
}
if(!cp)
return(var?nv_search(name,root,0):0);
stakputs(name);
stakputc(0);
+ if(!dname)
+ dname = cp+1;
cp = stakptr(offset) + (cp-name);
if(last)
*last = cp;
+ c = *cp;
*cp = 0;
- nq=nv_open(stakptr(offset),0,NV_VARNAME|NV_NOASSIGN|NV_NOADD|NV_NOFAIL);
- *cp = '.';
+ nq=nv_open(stakptr(offset),0,NV_VARNAME|NV_ARRAY|NV_NOASSIGN|NV_NOADD|NV_NOFAIL);
+ *cp = c;
if(!nq)
{
np = 0;
@@ -973,14 +1062,16 @@ Namval_t *nv_bfsearch(const char *name, Dt_t *root, Namval_t **var, char **last)
goto done;
}
*var = nq;
- return((Namval_t*)nv_setdisc(nq,cp+1,nq,(Namfun_t*)nq));
+ if(c=='[')
+ nv_endsubscript(nq, cp,NV_NOADD);
+ return((Namval_t*)nv_setdisc(nq,dname,nq,(Namfun_t*)nq));
done:
stakseek(offset);
return(np);
}
/*
- * add or replace built-in version of command commresponding to <path>
+ * add or replace built-in version of command corresponding to <path>
* The <bltin> argument is a pointer to the built-in
* if <extra>==1, the built-in will be deleted
* Special builtins cannot be added or deleted return failure
@@ -990,10 +1081,10 @@ done:
*/
Namval_t *sh_addbuiltin(const char *path, int (*bltin)(int, char*[],void*),void *extra)
{
- register const char *name = path_basename(path);
- char *cp;
- register Namval_t *np, *nq=0;
- int offset = staktell();
+ register const char *name = path_basename(path);
+ char *cp;
+ register Namval_t *np, *nq=0;
+ int offset=staktell();
if(name==path && (nq=nv_bfsearch(name,sh.bltin_tree,(Namval_t**)0,&cp)))
path = name = stakptr(offset);
if(np = nv_search(path,sh.bltin_tree,0))
@@ -1031,10 +1122,13 @@ Namval_t *sh_addbuiltin(const char *path, int (*bltin)(int, char*[],void*),void
if(!np && !(np = nv_search(path,sh.bltin_tree,bltin?NV_ADD:0)))
return(0);
if(nv_isattr(np,BLT_SPC))
+ {
+ if(extra)
+ np->nvfun = (Namfun_t*)extra;
return(np);
+ }
np->nvenv = 0;
np->nvfun = 0;
- nv_setattr(np,0);
if(bltin)
{
np->nvalue.bfp = bltin;
@@ -1067,13 +1161,6 @@ struct table
Dt_t *dict;
};
-Namval_t *nv_parent(Namval_t *np)
-{
- if(!nv_istable(np))
- return(0);
- return(((struct table*)(np->nvfun))->parent);
-}
-
static Namval_t *next_table(register Namval_t* np, Dt_t *root,Namfun_t *fp)
{
struct table *tp = (struct table *)fp;
@@ -1093,7 +1180,7 @@ static Namval_t *create_table(Namval_t *np,const char *name,int flags,Namfun_t *
static Namfun_t *clone_table(Namval_t* np, Namval_t *mp, int flags, Namfun_t *fp)
{
struct table *tp = (struct table*)fp;
- struct table *ntp = (struct table*)nv_clone_disc(fp);
+ struct table *ntp = (struct table*)nv_clone_disc(fp,0);
Dt_t *oroot=tp->dict,*nroot=dtopen(&_Nvdisc,Dtoset);
if(!nroot)
return(0);
@@ -1126,7 +1213,7 @@ static void put_table(register Namval_t* np, const char* val, int flags, Namfun_
free((void*)mp);
}
dtclose(root);
- if(!fp->nofree)
+ if(!(fp->nofree&1))
free((void*)fp);
}
@@ -1173,6 +1260,14 @@ static const Namdisc_t table_disc =
next_table,
};
+Namval_t *nv_parent(Namval_t *np)
+{
+ struct table *tp = (struct table *)nv_hasdisc(np,&table_disc);
+ if(tp)
+ return(tp->parent);
+ return(0);
+}
+
Dt_t *nv_dict(Namval_t* np)
{
struct table *tp = (struct table*)nv_hasdisc(np,&table_disc);
@@ -1185,6 +1280,8 @@ Dt_t *nv_dict(Namval_t* np)
return(tp->dict);
#if 0
np = nv_create(np,(const char*)0, NV_FIRST, (Namfun_t*)0);
+#else
+ break;
#endif
}
return(sh.var_tree);
@@ -1220,7 +1317,7 @@ Namval_t *nv_mount(Namval_t *np, const char *name, Dt_t *dict)
tp->parent = pp;
tp->fun.disc = &table_disc;
nv_onattr(mp,NV_TABLE);
- nv_disc(mp, &tp->fun, NV_LAST);
+ nv_disc(mp, &tp->fun, NV_FIRST);
return(mp);
}
@@ -1236,28 +1333,3 @@ const Namdisc_t *nv_discfun(int which)
return(0);
}
-/*
- * This function turns variable <np> to the type <tp>
- */
-int nv_settype(Namval_t* np, Namval_t *tp, int flags)
-{
- int isnull = nv_isnull(np);
- char *val=0;
- if(isnull)
- flags &= ~NV_APPEND;
- else
- {
- val = strdup(nv_getval(np));
- if(!(flags&NV_APPEND))
- _nv_unset(np, NV_RDONLY);
- }
- if(!nv_clone(tp,np,flags|NV_NOFREE))
- return(0);
- if(val)
- {
- nv_putval(np,val,NV_RDONLY);
- free((void*)val);
- }
- return(0);
-}
-
diff --git a/usr/src/lib/libshell/common/sh/nvtree.c b/usr/src/lib/libshell/common/sh/nvtree.c
index 82657e3a0c..d493b5d602 100644
--- a/usr/src/lib/libshell/common/sh/nvtree.c
+++ b/usr/src/lib/libshell/common/sh/nvtree.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -30,22 +30,41 @@
#include "defs.h"
#include "name.h"
#include "argnod.h"
+#include "lexstates.h"
struct nvdir
{
Dt_t *root;
Namval_t *hp;
Namval_t *table;
+ Namval_t *otable;
Namval_t *(*nextnode)(Namval_t*,Dt_t*,Namfun_t*);
Namfun_t *fun;
struct nvdir *prev;
int len;
- int offset;
char data[1];
};
char *nv_getvtree(Namval_t*, Namfun_t *);
static void put_tree(Namval_t*, const char*, int,Namfun_t*);
+static char *walk_tree(Namval_t*, Namval_t*, int);
+
+static int read_tree(Namval_t* np, Sfio_t *iop, int n, Namfun_t *dp)
+{
+ Sfio_t *sp;
+ char *cp;
+ int c;
+ if(n>=0)
+ return(-1);
+ while((c = sfgetc(iop)) && isblank(c));
+ sfungetc(iop,c);
+ sfprintf(sh.strbuf,"%s=%c",nv_name(np),0);
+ cp = sfstruse(sh.strbuf);
+ sp = sfopen((Sfio_t*)0,cp,"s");
+ sfstack(iop,sp);
+ c=sh_eval(iop,SH_READEVAL);
+ return(c);
+}
static Namval_t *create_tree(Namval_t *np,const char *name,int flag,Namfun_t *dp)
{
@@ -62,6 +81,20 @@ static Namval_t *create_tree(Namval_t *np,const char *name,int flag,Namfun_t *dp
return((flag&NV_NOADD)?0:np);
}
+static Namfun_t *clone_tree(Namval_t *np, Namval_t *mp, int flags, Namfun_t *fp){
+ Namfun_t *dp;
+ if ((flags&NV_MOVE) && nv_type(np))
+ return(fp);
+ dp = nv_clone_disc(fp,flags);
+ if((flags&NV_COMVAR) && !(flags&NV_RAW))
+ {
+ walk_tree(np,mp,flags);
+ if((flags&NV_MOVE) && !(fp->nofree&1))
+ free((void*)fp);
+ }
+ return(dp);
+}
+
static const Namdisc_t treedisc =
{
0,
@@ -69,21 +102,29 @@ static const Namdisc_t treedisc =
nv_getvtree,
0,
0,
- create_tree
+ create_tree,
+ clone_tree
+ ,0,0,0,
+ read_tree
};
static char *nextdot(const char *str)
{
register char *cp;
+ register int c;
if(*str=='.')
str++;
- if(*str =='[')
+ for(cp=(char*)str;c= *cp; cp++)
{
- cp = nv_endsubscript((Namval_t*)0,(char*)str,0);
- return(*cp=='.'?cp:0);
+ if(c=='[')
+ {
+ cp = nv_endsubscript((Namval_t*)0,(char*)cp,0);
+ return(*cp=='.'?cp:0);
+ }
+ if(c=='.')
+ return(cp);
}
- else
- return(strchr(str,'.'));
+ return(0);
}
static Namfun_t *nextdisc(Namval_t *np)
@@ -99,38 +140,90 @@ static Namfun_t *nextdisc(Namval_t *np)
return(0);
}
-void *nv_diropen(const char *name)
+void *nv_diropen(Namval_t *np,const char *name)
{
char *next,*last;
int c,len=strlen(name);
struct nvdir *save, *dp = new_of(struct nvdir,len);
- Namval_t *np, fake;
- Namfun_t *nfp;
+ Namval_t *nq=0,fake;
+ Namfun_t *nfp=0;
if(!dp)
return(0);
memset((void*)dp, 0, sizeof(*dp));
- last=dp->data;
if(name[len-1]=='*' || name[len-1]=='@')
len -= 1;
- name = memcpy(last,name,len);
- last[len] = 0;
+ name = memcpy(dp->data,name,len);
+ dp->data[len] = 0;
dp->len = len;
- dp->root = sh.var_tree;
+ dp->root = sh.last_root?sh.last_root:sh.var_tree;
+#if 1
+ while(1)
+ {
+ dp->table = sh.last_table;
+ sh.last_table = 0;
+ if(*(last=(char*)name)==0)
+ break;
+ if(!(next=nextdot(last)))
+ break;
+ *next = 0;
+ np = nv_open(name, dp->root, NV_NOFAIL);
+ *next = '.';
+ if(!np || !nv_istable(np))
+ break;
+ dp->root = nv_dict(np);
+ name = next+1;
+ }
+#else
dp->table = sh.last_table;
+ sh.last_table = 0;
+ last = dp->data;
+#endif
if(*name)
{
fake.nvname = (char*)name;
- dp->hp = (Namval_t*)dtprev(dp->root,&fake);
- dp->hp = (Namval_t*)dtnext(dp->root,dp->hp);
+ if(dp->hp = (Namval_t*)dtprev(dp->root,&fake))
+ {
+ char *cp = nv_name(dp->hp);
+ c = strlen(cp);
+ if(memcmp(name,cp,c) || name[c]!='[')
+ dp->hp = (Namval_t*)dtnext(dp->root,dp->hp);
+ else
+ {
+ np = dp->hp;
+ last = 0;
+ }
+ }
}
else
dp->hp = (Namval_t*)dtfirst(dp->root);
- while(next= nextdot(last))
+ while(1)
{
- c = *next;
- *next = 0;
- np = nv_search(last,dp->root,0);
- *next = c;
+ if(!last)
+ next = 0;
+ else if(next= nextdot(last))
+ {
+ c = *next;
+ *next = 0;
+ }
+ if(!np)
+ {
+ if(nfp && nfp->disc && nfp->disc->createf)
+ {
+ np = (*nfp->disc->createf)(nq,last,0,nfp);
+ if(*nfp->last == '[')
+ {
+ nv_endsubscript(np,nfp->last,NV_NOADD);
+ if(nq = nv_opensub(np))
+ np = nq;
+ }
+ }
+ else
+ np = nv_search(last,dp->root,0);
+ }
+ if(next)
+ *next = c;
+ if(np==dp->hp && !next)
+ dp->hp = (Namval_t*)dtnext(dp->root,dp->hp);
if(np && ((nfp=nextdisc(np)) || nv_istable(np)))
{
if(!(save = new_of(struct nvdir,0)))
@@ -140,16 +233,12 @@ void *nv_diropen(const char *name)
if(nv_istable(np))
dp->root = nv_dict(np);
else
- dp->root = (Dt_t*)dp;
- dp->offset = last-(char*)name;
- if(dp->offset<len)
- dp->len = len-dp->offset;
- else
- dp->len = 0;
+ dp->root = (Dt_t*)np;
if(nfp)
{
dp->nextnode = nfp->disc->nextf;
dp->table = np;
+ dp->otable = sh.last_table;
dp->fun = nfp;
dp->hp = (*dp->nextnode)(np,(Dt_t*)0,nfp);
}
@@ -158,7 +247,11 @@ void *nv_diropen(const char *name)
}
else
break;
+ if(!next || next[1]==0)
+ break;
last = next+1;
+ nq = np;
+ np = 0;
}
return((void*)dp);
}
@@ -179,26 +272,51 @@ char *nv_dirnext(void *dir)
register Namval_t *np, *last_table;
register char *cp;
Namfun_t *nfp;
+ Namval_t *nq;
while(1)
{
while(np=dp->hp)
{
+#if 0
+ char *sptr;
+#endif
+ if(nv_isarray(np))
+ nv_putsub(np,(char*)0, ARRAY_UNDEF);
dp->hp = nextnode(dp);
- if(nv_isnull(np))
+ if(nv_isnull(np) && !nv_isarray(np))
continue;
last_table = sh.last_table;
+#if 0
+ if(dp->table && dp->otable && !nv_isattr(dp->table,NV_MINIMAL))
+ {
+ sptr = dp->table->nvenv;
+ dp->table->nvenv = (char*)dp->otable;
+ }
+#endif
sh.last_table = dp->table;
cp = nv_name(np);
+#if 0
+ if(dp->table && dp->otable && !nv_isattr(dp->table,NV_MINIMAL))
+ dp->table->nvenv = sptr;
+#endif
+ if(dp->nextnode && !dp->hp && (nq = (Namval_t*)dp->table))
+ {
+ Namarr_t *ap = nv_arrayptr(nq);
+ if(ap && (ap->nelem&ARRAY_SCAN) && nv_nextsub(nq))
+ dp->hp = (*dp->nextnode)(np,(Dt_t*)0,dp->fun);
+ }
sh.last_table = last_table;
- if(!dp->len || memcmp(cp+dp->offset,dp->data,dp->len)==0)
+ if(!dp->len || memcmp(cp,dp->data,dp->len)==0)
{
- if((nfp=nextdisc(np)) || nv_istable(np))
+ if((nfp=nextdisc(np)) && (nfp->disc->getval||nfp->disc->getnum) && nv_isvtree(np) && strcmp(cp,dp->data))
+ nfp = 0;
+ if(nfp || nv_istable(np))
{
Dt_t *root;
if(nv_istable(np))
root = nv_dict(np);
else
- root = (Dt_t*)dp;
+ root = (Dt_t*)np;
/* check for recursive walk */
for(save=dp; save; save=save->prev)
{
@@ -206,7 +324,7 @@ char *nv_dirnext(void *dir)
break;
}
if(save)
- continue;
+ return(cp);
if(!(save = new_of(struct nvdir,0)))
return(0);
*save = *dp;
@@ -215,7 +333,13 @@ char *nv_dirnext(void *dir)
dp->len = 0;
if(nfp && np->nvfun)
{
+#if 0
+ Namarr_t *ap = nv_arrayptr(np);
+ if(ap && (ap->nelem&ARRAY_UNDEF))
+ nv_putsub(np,(char*)0,ARRAY_SCAN);
+#endif
dp->nextnode = nfp->disc->nextf;
+ dp->otable = dp->table;
dp->table = np;
dp->fun = nfp;
dp->hp = (*dp->nextnode)(np,(Dt_t*)0,nfp);
@@ -228,9 +352,6 @@ char *nv_dirnext(void *dir)
}
if(!(save=dp->prev))
break;
-#if 0
- sh.last_table = dp->table;
-#endif
*dp = *save;
free((void*)save);
}
@@ -264,7 +385,14 @@ static void outtype(Namval_t *np, Namfun_t *fp, Sfio_t* out, const char *prefix)
else if(!prefix)
type = "type";
if(type)
- sfprintf(out,"%s %s ",type,tp->nvname);
+ {
+ char *cp=tp->nvname;
+ if(cp=strrchr(cp,'.'))
+ cp++;
+ else
+ cp = tp->nvname;
+ sfprintf(out,"%s %s ",type,cp);
+ }
}
/*
@@ -274,33 +402,51 @@ void nv_attribute(register Namval_t *np,Sfio_t *out,char *prefix,int noname)
{
register const Shtable_t *tp;
register char *cp;
- register unsigned val;
- register unsigned mask;
- register unsigned attr;
+ register unsigned val,mask,attr;
+ char *ip=0;
Namfun_t *fp=0;
+ Namval_t *typep=0;
for(fp=np->nvfun;fp;fp=fp->next)
{
- if(fp->type || (fp->disc && fp->disc->typef &&(*fp->disc->typef)(np,fp)))
+ if((typep=fp->type) || (fp->disc && fp->disc->typef && (typep=(*fp->disc->typef)(np,fp))))
break;
}
-#if 0
- if(!fp && !nv_isattr(np,~NV_ARRAY))
+ if(!fp && !nv_isattr(np,~(NV_MINIMAL|NV_NOFREE)))
{
- if(!nv_isattr(np,NV_ARRAY) || nv_aindex(np)>=0)
- return;
- }
-#else
- if(!fp && !nv_isattr(np,~NV_MINIMAL))
+ if(prefix && *prefix)
+ {
+ if(nv_isvtree(np))
+ sfprintf(out,"%s -C ",prefix);
+ else if(!np->nvalue.cp && nv_isattr(np,~NV_NOFREE)==NV_MINIMAL && strcmp(np->nvname,"_"))
+ sfputr(out,prefix,' ');
+ }
return;
-#endif
+ }
if ((attr=nv_isattr(np,~NV_NOFREE)) || fp)
{
- if((attr&NV_NOPRINT)==NV_NOPRINT)
+ if((attr&NV_NOPRINT|NV_INTEGER)==NV_NOPRINT)
attr &= ~NV_NOPRINT;
if(!attr && !fp)
return;
- if(prefix)
+ if(fp)
+ {
+ prefix = Empty;
+ attr &= NV_RDONLY|NV_ARRAY;
+ if(nv_isattr(np,NV_REF|NV_TAGGED)==(NV_REF|NV_TAGGED))
+ attr |= (NV_REF|NV_TAGGED);
+ if(typep)
+ {
+ char *cp = typep->nvname;
+ if(cp = strrchr(cp,'.'))
+ cp++;
+ else
+ cp = typep->nvname;
+ sfputr(out,cp,' ');
+ fp = 0;
+ }
+ }
+ else if(prefix && *prefix)
sfputr(out,prefix,' ');
for(tp = shtab_attributes; *tp->sh_name;tp++)
{
@@ -313,7 +459,7 @@ void nv_attribute(register Namval_t *np,Sfio_t *out,char *prefix,int noname)
* with E attribute from being given the F
* attribute as well
*/
- if(val==(NV_INTEGER|NV_DOUBLE) && (attr&NV_EXPNOTE))
+ if(val==NV_DOUBLE && (attr&(NV_EXPNOTE|NV_HEXFLOAT)))
continue;
if(val&NV_INTEGER)
mask |= NV_DOUBLE;
@@ -324,38 +470,44 @@ void nv_attribute(register Namval_t *np,Sfio_t *out,char *prefix,int noname)
if(val==NV_ARRAY)
{
Namarr_t *ap = nv_arrayptr(np);
- if(array_assoc(ap))
+ char **xp=0;
+ if(ap && array_assoc(ap))
{
if(tp->sh_name[1]!='A')
continue;
}
else if(tp->sh_name[1]=='A')
continue;
-#if 0
- cp = "associative";
- else
- cp = "indexed";
- if(!prefix)
- sfputr(out,cp,' ');
- else if(*cp=='i')
- tp++;
-#endif
+ if(ap && (ap->nelem&ARRAY_TREE))
+ {
+ if(prefix && *prefix)
+ sfwrite(out,"-C ",3);
+ }
+ if(ap && !array_assoc(ap) && (xp=(char**)(ap+1)) && *xp)
+ ip = nv_namptr(*xp,0)->nvname;
}
if(prefix)
{
if(*tp->sh_name=='-')
sfprintf(out,"%.2s ",tp->sh_name);
+ if(ip)
+ {
+ sfprintf(out,"[%s] ",ip);
+ ip = 0;
+ }
}
else
sfputr(out,tp->sh_name+2,' ');
if ((val&(NV_LJUST|NV_RJUST|NV_ZFILL)) && !(val&NV_INTEGER) && val!=NV_HOST)
sfprintf(out,"%d ",nv_size(np));
+ if(val==(NV_REF|NV_TAGGED))
+ attr &= ~(NV_REF|NV_TAGGED);
}
if(val==NV_INTEGER && nv_isattr(np,NV_INTEGER))
{
if(nv_size(np) != 10)
{
- if(nv_isattr(np, NV_DOUBLE))
+ if(nv_isattr(np, NV_DOUBLE)== NV_DOUBLE)
cp = "precision";
else
cp = "base";
@@ -380,34 +532,160 @@ struct Walk
Dt_t *root;
int noscope;
int indent;
+ int nofollow;
+ int array;
+ int flags;
};
+void nv_outnode(Namval_t *np, Sfio_t* out, int indent, int special)
+{
+ char *fmtq,*ep,*xp;
+ Namval_t *mp;
+ Namarr_t *ap = nv_arrayptr(np);
+ int tabs=0,c,more,associative = 0;
+ if(ap)
+ {
+ if(!(ap->nelem&ARRAY_SCAN))
+ nv_putsub(np,NIL(char*),ARRAY_SCAN);
+ sfputc(out,'(');
+ if(indent>=0)
+ {
+ sfputc(out,'\n');
+ tabs=1;
+ }
+ if(!(associative =(array_assoc(ap)!=0)))
+ {
+ if(array_elem(ap) < nv_aimax(np)+1)
+ associative=1;
+ }
+ }
+ mp = nv_opensub(np);
+ while(1)
+ {
+ if(mp && special && nv_isvtree(mp))
+ {
+ if(!nv_nextsub(np))
+ break;
+ mp = nv_opensub(np);
+ continue;
+ }
+ if(tabs)
+ sfnputc(out,'\t',++indent);
+ tabs=0;
+ if(associative||special)
+ {
+ if(!(fmtq = nv_getsub(np)))
+ break;
+ sfprintf(out,"[%s]",sh_fmtq(fmtq));
+ sfputc(out,'=');
+ }
+ if(mp && nv_isarray(mp))
+ {
+ nv_outnode(mp, out, indent+(indent>=0),0);
+ if(indent>0)
+ sfnputc(out,'\t',indent);
+ sfputc(out,')');
+ sfputc(out,indent>=0?'\n':' ');
+ more = nv_nextsub(np);
+ goto skip;
+ }
+ if(mp && nv_isvtree(mp))
+ nv_onattr(mp,NV_EXPORT);
+ ep = nv_getval(mp?mp:np);
+ xp = 0;
+ if(!ap && nv_isattr(np,NV_INTEGER|NV_LJUST)==NV_LJUST)
+ {
+ xp = ep+nv_size(np);
+ while(--xp>ep && *xp==' ');
+ if(xp>ep || *xp!=' ')
+ xp++;
+ if(xp < (ep+nv_size(np)))
+ *xp = 0;
+ else
+ xp = 0;
+ }
+ if(mp && nv_isvtree(mp))
+ fmtq = ep;
+ else if(!(fmtq = sh_fmtq(ep)))
+ fmtq = "";
+ else if(!associative && (ep=strchr(fmtq,'=')))
+ {
+ char *qp = strchr(fmtq,'\'');
+ if(!qp || qp>ep)
+ {
+ sfwrite(out,fmtq,ep-fmtq);
+ sfputc(out,'\\');
+ fmtq = ep;
+ }
+ }
+ more = nv_nextsub(np);
+ c = '\n';
+ if(indent<0)
+ {
+ c = ';';
+ if(ap)
+ c = more?' ':-1;
+ }
+ sfputr(out,fmtq,c);
+ if(xp)
+ *xp = ' ';
+ skip:
+ if(!more)
+ return;
+ mp = nv_opensub(np);
+ if(indent>0 && !(mp && special && nv_isvtree(mp)))
+ sfnputc(out,'\t',indent);
+ }
+}
+
static void outval(char *name, const char *vname, struct Walk *wp)
{
register Namval_t *np, *nq;
register Namfun_t *fp;
- int isarray=0, associative=0, special=0;
- if(!(np=nv_open(vname,wp->root,NV_ARRAY|NV_VARNAME|NV_NOADD|NV_NOASSIGN|wp->noscope)))
+ int isarray=0, special=0,mode=0;
+ if(*name!='.' || vname[strlen(vname)-1]==']')
+ mode = NV_ARRAY;
+ if(!(np=nv_open(vname,wp->root,mode|NV_VARNAME|NV_NOADD|NV_NOASSIGN|NV_NOFAIL|wp->noscope)))
return;
- if(nv_isarray(np) && *name=='.')
- special = 1;
- if(!special && (fp=nv_hasdisc(np,&treedisc)))
+ fp = nv_hasdisc(np,&treedisc);
+ if(*name=='.')
{
+ if(nv_isattr(np,NV_BINARY))
+ return;
+ if(fp && np->nvalue.cp && np->nvalue.cp!=Empty)
+ {
+ nv_local = 1;
+ fp = 0;
+ }
+ if(fp)
+ return;
+ if(nv_isarray(np))
+ return;
+ }
+ if(!special && fp && !nv_isarray(np))
+ {
+ Namfun_t *xp;
if(!wp->out)
{
fp = nv_stack(np,fp);
if(fp = nv_stack(np,NIL(Namfun_t*)))
free((void*)fp);
np->nvfun = 0;
+ return;
}
- return;
+ for(xp=fp->next; xp; xp = xp->next)
+ {
+ if(xp->disc && (xp->disc->getval || xp->disc->getnum))
+ break;
+ }
+ if(!xp)
+ return;
}
- if(nv_isnull(np))
+ if((nv_isnull(np) || np->nvalue.cp==Empty) && !nv_isarray(np))
return;
- if(special || nv_isarray(np))
+ if(special || (nv_isarray(np) && nv_arrayptr(np)))
{
isarray=1;
- associative= nv_aindex(np)<0;
if(array_elem(nv_arrayptr(np))==0)
isarray=2;
else
@@ -417,63 +695,49 @@ static void outval(char *name, const char *vname, struct Walk *wp)
{
_nv_unset(np,NV_RDONLY);
nv_close(np);
+#if 0
+ if(sh.subshell==0 && !(wp->flags&NV_RDONLY) && !nv_isattr(np,NV_MINIMAL|NV_NOFREE))
+ nv_delete(np,wp->root,0);
+#endif
return;
}
if(isarray==1 && !nq)
- return;
- if(special)
{
- associative = 1;
- sfnputc(wp->out,'\t',wp->indent);
+ sfputc(wp->out,'(');
+ if(wp->indent>=0)
+ sfputc(wp->out,'\n');
+ return;
}
- else
- {
+ if(isarray==0 && nv_isarray(np) && nv_isnull(np)) /* empty array */
+ isarray = 2;
+ special |= wp->nofollow;
+ if(!wp->array && wp->indent>0)
sfnputc(wp->out,'\t',wp->indent);
- nv_attribute(np,wp->out,"typeset",'=');
+ if(!special)
+ {
+ if(*name!='.')
+ nv_attribute(np,wp->out,"typeset",'=');
nv_outname(wp->out,name,-1);
- sfputc(wp->out,(isarray==2?'\n':'='));
- if(isarray)
- {
- if(isarray==2)
- return;
- sfwrite(wp->out,"(\n",2);
- sfnputc(wp->out,'\t',++wp->indent);
- }
+ if(np->nvalue.cp || nv_isattr(np,~(NV_MINIMAL|NV_NOFREE)) || nv_isvtree(np))
+ sfputc(wp->out,(isarray==2?'\n':'='));
+ if(isarray==2)
+ return;
}
- while(1)
+ fp = np->nvfun;
+ if(*name=='.' && !isarray)
+ np->nvfun = 0;
+ nv_outnode(np, wp->out, wp->indent, special);
+ if(*name=='.' && !isarray)
+ np->nvfun = fp;
+ if(isarray && !special)
{
- char *fmtq,*ep;
- if(isarray && associative)
+ if(wp->indent>0)
{
- if(!(fmtq = nv_getsub(np)))
- break;
- sfprintf(wp->out,"[%s]",sh_fmtq(fmtq));
- sfputc(wp->out,'=');
+ sfnputc(wp->out,'\t',wp->indent);
+ sfwrite(wp->out,")\n",2);
}
- if(!(fmtq = sh_fmtq(nv_getval(np))))
- fmtq = "";
- else if(!associative && (ep=strchr(fmtq,'=')))
- {
- char *qp = strchr(fmtq,'\'');
- if(!qp || qp>ep)
- {
- sfwrite(wp->out,fmtq,ep-fmtq);
- sfputc(wp->out,'\\');
- fmtq = ep;
- }
- }
- if(*name=='[' && !isarray)
- sfprintf(wp->out,"(%s)\n",fmtq);
else
- sfputr(wp->out,fmtq,'\n');
- if(!nv_nextsub(np))
- break;
- sfnputc(wp->out,'\t',wp->indent);
- }
- if(isarray && !special)
- {
- sfnputc(wp->out,'\t',--wp->indent);
- sfwrite(wp->out,")\n",2);
+ sfwrite(wp->out,");",2);
}
}
@@ -483,8 +747,8 @@ static void outval(char *name, const char *vname, struct Walk *wp)
static char **genvalue(char **argv, const char *prefix, int n, struct Walk *wp)
{
register char *cp,*nextcp,*arg;
- register int m,r;
register Sfio_t *outfile = wp->out;
+ register int m,r,l;
if(n==0)
m = strlen(prefix);
else if(cp=nextdot(prefix))
@@ -492,10 +756,14 @@ static char **genvalue(char **argv, const char *prefix, int n, struct Walk *wp)
else
m = strlen(prefix)-1;
m++;
- if(outfile)
+ if(outfile && !wp->array)
{
- sfwrite(outfile,"(\n",2);
- wp->indent++;
+ sfputc(outfile,'(');
+ if(wp->indent>=0)
+ {
+ wp->indent++;
+ sfputc(outfile,'\n');
+ }
}
for(; arg= *argv; argv++)
{
@@ -514,42 +782,82 @@ static char **genvalue(char **argv, const char *prefix, int n, struct Walk *wp)
{
if(outfile)
{
- sfnputc(outfile,'\t',wp->indent);
+ Namval_t *np,*tp;
+ *nextcp = 0;
+ np=nv_open(arg,wp->root,NV_VARNAME|NV_NOADD|NV_NOASSIGN|NV_NOFAIL|wp->noscope);
+ if(!np || (nv_isarray(np) && (!(tp=nv_opensub(np)) || !nv_isvtree(tp))))
+ {
+ *nextcp = '.';
+ continue;
+ }
+ if(wp->indent>=0)
+ sfnputc(outfile,'\t',wp->indent);
+ if(*cp!='[' && (tp = nv_type(np)))
+ {
+ char *sp;
+ if(sp = strrchr(tp->nvname,'.'))
+ sp++;
+ else
+ sp = tp->nvname;
+ sfputr(outfile,sp,' ');
+ }
nv_outname(outfile,cp,nextcp-cp);
sfputc(outfile,'=');
+ *nextcp = '.';
+ }
+ else
+ {
+ outval(cp,arg,wp);
+ continue;
}
argv = genvalue(argv,cp,n+m+r,wp);
- if(outfile)
+ if(wp->indent>=0)
sfputc(outfile,'\n');
if(*argv)
continue;
break;
}
- else if(outfile && argv[1] && memcmp(arg,argv[1],r=strlen(arg))==0 && argv[1][r]=='[')
+ else if(outfile && !wp->nofollow && argv[1] && memcmp(arg,argv[1],l=strlen(arg))==0 && argv[1][l]=='[')
{
Namval_t *np = nv_open(arg,wp->root,NV_VARNAME|NV_NOADD|NV_NOASSIGN|wp->noscope);
if(!np)
continue;
- sfnputc(outfile,'\t',wp->indent);
+ wp->array = nv_isarray(np);
+ if(wp->indent>0)
+ sfnputc(outfile,'\t',wp->indent);
nv_attribute(np,outfile,"typeset",1);
nv_close(np);
- sfputr(outfile,arg+m+(n?n+1:0),'=');
- argv = genvalue(++argv,cp,cp-arg ,wp);
- sfputc(outfile,'\n');
+ sfputr(outfile,arg+m+r+(n?n:0),'=');
+ wp->nofollow=1;
+ argv = genvalue(argv,cp,cp-arg ,wp);
+ sfputc(outfile,wp->indent<0?';':'\n');
}
else if(outfile && *cp=='[')
{
- sfnputc(outfile,'\t',wp->indent);
+ if(wp->indent)
+ sfnputc(outfile,'\t',wp->indent);
sfputr(outfile,cp,'=');
argv = genvalue(++argv,cp,cp-arg ,wp);
sfputc(outfile,'\n');
}
else
+ {
outval(cp,arg,wp);
+ if(wp->array)
+ {
+ if(wp->indent>=0)
+ wp->indent++;
+ else
+ sfputc(outfile,' ');
+ wp->array = 0;
+ }
+ }
}
else
break;
+ wp->nofollow = 0;
}
+ wp->array = 0;
if(outfile)
{
int c = prefix[m-1];
@@ -559,7 +867,8 @@ static char **genvalue(char **argv, const char *prefix, int n, struct Walk *wp)
outval(".",prefix-n,wp);
if(c=='.')
cp[m-1] = c;
- sfnputc(outfile,'\t',wp->indent-1);
+ if(wp->indent>0)
+ sfnputc(outfile,'\t',--wp->indent);
sfputc(outfile,')');
}
return(--argv);
@@ -568,33 +877,79 @@ static char **genvalue(char **argv, const char *prefix, int n, struct Walk *wp)
/*
* walk the virtual tree and print or delete name-value pairs
*/
-static char *walk_tree(register Namval_t *np, int dlete)
+static char *walk_tree(register Namval_t *np, Namval_t *xp, int flags)
{
static Sfio_t *out;
struct Walk walk;
Sfio_t *outfile;
- int savtop = staktell();
+ int len, savtop = staktell();
char *savptr = stakfreeze(0);
register struct argnod *ap=0;
struct argnod *arglist=0;
char *name,*cp, **argv;
char *subscript=0;
void *dir;
- int n=0, noscope=(dlete&NV_NOSCOPE);
+ int n=0, noscope=(flags&NV_NOSCOPE);
+ Namarr_t *arp = nv_arrayptr(np);
+ Dt_t *save_tree = sh.var_tree;
+ Namval_t *mp=0;
+ Shell_t *shp = sh_getinterp();
+ char *xpname = xp?stakcopy(nv_name(xp)):0;
+ if(xp)
+ {
+ shp->last_root = shp->prev_root;
+ shp->last_table = shp->prev_table;
+ }
+ if(shp->last_table)
+ shp->last_root = nv_dict(shp->last_table);
+ if(shp->last_root)
+ shp->var_tree = shp->last_root;
stakputs(nv_name(np));
- if(subscript = nv_getsub(np))
+ if(arp && !(arp->nelem&ARRAY_SCAN) && (subscript = nv_getsub(np)))
{
+ mp = nv_opensub(np);
stakputc('[');
stakputs(subscript);
stakputc(']');
stakputc('.');
}
+ else if(*stakptr(staktell()-1) == ']')
+ mp = np;
name = stakfreeze(1);
- dir = nv_diropen(name);
+ len = strlen(name);
+ shp->last_root = 0;
+ dir = nv_diropen(mp,name);
+ walk.root = shp->last_root?shp->last_root:shp->var_tree;
if(subscript)
name[strlen(name)-1] = 0;
while(cp = nv_dirnext(dir))
{
+ if(cp[len]!='.')
+ continue;
+ if(xp)
+ {
+ Dt_t *dp = shp->var_tree;
+ Namval_t *nq, *mq;
+ if(strlen(cp)<=len)
+ continue;
+ nq = nv_open(cp,walk.root,NV_VARNAME|NV_NOADD|NV_NOASSIGN|NV_NOFAIL);
+ if(!nq && (flags&NV_MOVE))
+ nq = nv_search(cp,walk.root,NV_NOADD);
+ stakseek(0);
+ stakputs(xpname);
+ stakputs(cp+len);
+ stakputc(0);
+ shp->var_tree = save_tree;
+ mq = nv_open(stakptr(0),save_tree,NV_VARNAME|NV_NOASSIGN|NV_NOFAIL);
+ shp->var_tree = dp;
+ if(nq && mq)
+ {
+ nv_clone(nq,mq,flags|NV_RAW);
+ if(flags&NV_MOVE)
+ nv_delete(nq,walk.root,0);
+ }
+ continue;
+ }
stakseek(ARGVAL);
stakputs(cp);
ap = (struct argnod*)stakfreeze(1);
@@ -603,41 +958,63 @@ static char *walk_tree(register Namval_t *np, int dlete)
n++;
arglist = ap;
}
+ nv_dirclose(dir);
+ if(xp)
+ {
+ shp->var_tree = save_tree;
+ return((char*)0);
+ }
argv = (char**)stakalloc((n+1)*sizeof(char*));
argv += n;
*argv = 0;
for(; ap; ap=ap->argchn.ap)
*--argv = ap->argval;
- nv_dirclose(dir);
- if(dlete&1)
+ if(flags&1)
outfile = 0;
else if(!(outfile=out))
outfile = out = sfnew((Sfio_t*)0,(char*)0,-1,-1,SF_WRITE|SF_STRING);
else
sfseek(outfile,0L,SEEK_SET);
walk.out = outfile;
- walk.root = sh.last_root;
- walk.indent = 0;
+ walk.indent = (flags&NV_EXPORT)?-1:0;
+ walk.nofollow = 0;
walk.noscope = noscope;
+ walk.array = 0;
+ walk.flags = flags;
genvalue(argv,name,0,&walk);
stakset(savptr,savtop);
+ shp->var_tree = save_tree;
if(!outfile)
return((char*)0);
sfputc(out,0);
return((char*)out->_data);
}
+Namfun_t *nv_isvtree(Namval_t *np)
+{
+ if(np)
+ return(nv_hasdisc(np,&treedisc));
+ return(0);
+}
+
/*
* get discipline for compound initializations
*/
char *nv_getvtree(register Namval_t *np, Namfun_t *fp)
{
- NOT_USED(fp);
- if(nv_isattr(np,NV_BINARY) && nv_isattr(np,NV_RAW))
+ int flags=0;
+ for(; fp && fp->next; fp=fp->next)
+ {
+ if(fp->next->disc && (fp->next->disc->getnum || fp->next->disc->getval))
+ return(nv_getv(np,fp));
+ }
+ if(nv_isattr(np,NV_BINARY) && !nv_isattr(np,NV_RAW))
return(nv_getv(np,fp));
- if(nv_isattr(np,NV_ARRAY) && nv_arraychild(np,(Namval_t*)0,0)==np)
+ if(nv_isattr(np,NV_ARRAY) && !nv_type(np) && nv_arraychild(np,(Namval_t*)0,0)==np)
return(nv_getv(np,fp));
- return(walk_tree(np,0));
+ if(flags = nv_isattr(np,NV_EXPORT))
+ nv_offattr(np,NV_EXPORT);
+ return(walk_tree(np,(Namval_t*)0,flags));
}
/*
@@ -647,10 +1024,29 @@ static void put_tree(register Namval_t *np, const char *val, int flags,Namfun_t
{
struct Namarray *ap;
int nleft = 0;
- if(!nv_isattr(np,NV_INTEGER))
- walk_tree(np,(flags&NV_NOSCOPE)|1);
+ if(!val && !fp->next && nv_isattr(np,NV_NOFREE))
+ return;
+ if(!nv_isattr(np,(NV_INTEGER|NV_BINARY)))
+ {
+ Shell_t *shp = sh_getinterp();
+ Namval_t *last_table = shp->last_table;
+ Dt_t *last_root = shp->last_root;
+ Namval_t *mp = val?nv_open(val,shp->var_tree,NV_VARNAME|NV_NOADD|NV_NOASSIGN|NV_NOFAIL):0;
+ if(mp && nv_isvtree(mp))
+ {
+ shp->prev_table = shp->last_table;
+ shp->prev_root = shp->last_root;
+ shp->last_table = last_table;
+ shp->last_root = last_root;
+ if(!(flags&NV_APPEND))
+ walk_tree(np,(Namval_t*)0,(flags&NV_NOSCOPE)|1);
+ nv_clone(mp,np,NV_COMVAR);
+ return;
+ }
+ walk_tree(np,(Namval_t*)0,(flags&NV_NOSCOPE)|1);
+ }
nv_putv(np, val, flags,fp);
- if(nv_isattr(np,NV_INTEGER))
+ if(val && nv_isattr(np,(NV_INTEGER|NV_BINARY)))
return;
if(ap= nv_arrayptr(np))
nleft = array_elem(ap);
@@ -658,9 +1054,7 @@ static void put_tree(register Namval_t *np, const char *val, int flags,Namfun_t
{
fp = nv_stack(np,fp);
if(fp = nv_stack(np,NIL(Namfun_t*)))
- {
free((void*)fp);
- }
}
}
@@ -670,6 +1064,8 @@ static void put_tree(register Namval_t *np, const char *val, int flags,Namfun_t
void nv_setvtree(register Namval_t *np)
{
register Namfun_t *nfp;
+ if(sh.subshell)
+ sh_assignok(np,1);
if(nv_hasdisc(np, &treedisc))
return;
nfp = newof(NIL(void*),Namfun_t,1,0);
diff --git a/usr/src/lib/libshell/common/sh/nvtype.c b/usr/src/lib/libshell/common/sh/nvtype.c
new file mode 100644
index 0000000000..a17bc99fda
--- /dev/null
+++ b/usr/src/lib/libshell/common/sh/nvtype.c
@@ -0,0 +1,1533 @@
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* David Korn <dgk@research.att.com> *
+* *
+***********************************************************************/
+#pragma prototyped
+/*
+ * David Korn
+ * AT&T Labs
+ *
+ */
+
+#include "defs.h"
+
+static const char sh_opttype[] =
+"[-1c?\n@(#)$Id: type (AT&T Labs Research) 2008-07-01 $\n]"
+USAGE_LICENSE
+"[+NAME?\f?\f - set the type of variables to \b\f?\f\b]"
+"[+DESCRIPTION?\b\f?\f\b sets the type on each of the variables specified "
+ "by \aname\a to \b\f?\f\b. If \b=\b\avalue\a is specified, "
+ "the variable \aname\a is set to \avalue\a before the variable "
+ "is converted to \b\f?\f\b.]"
+"[+?If no \aname\as are specified then the names and values of all "
+ "variables of this type are written to standard output.]"
+"[+?\b\f?\f\b is built-in to the shell as a declaration command so that "
+ "field splitting and pathname expansion are not performed on "
+ "the arguments. Tilde expansion occurs on \avalue\a.]"
+"[r?Enables readonly. Once enabled, the value cannot be changed or unset.]"
+"[a]:?[type?Indexed array. Each \aname\a will converted to an index "
+ "array of type \b\f?\f\b. If a variable already exists, the current "
+ "value will become index \b0\b. If \b[\b\atype\a\b]]\b is "
+ "specified, each subscript is interpreted as a value of enumeration "
+ "type \atype\a.]"
+"[A?Associative array. Each \aname\a will converted to an associate "
+ "array of type \b\f?\f\b. If a variable already exists, the current "
+ "value will become subscript \b0\b.]"
+"[h]:[string?Used within a type definition to provide a help string "
+ "for variable \aname\a. Otherwise, it is ignored.]"
+"[S?Used with a type definition to indicate that the variable is shared by "
+ "each instance of the type. When used inside a function defined "
+ "with the \bfunction\b reserved word, the specified variables "
+ "will have function static scope. Otherwise, the variable is "
+ "unset prior to processing the assignment list.]"
+"[+DETAILS]\ftypes\f"
+"\n"
+"\n[name[=value]...]\n"
+"\n"
+"[+EXIT STATUS?]{"
+ "[+0?Successful completion.]"
+ "[+>0?An error occurred.]"
+"}"
+
+"[+SEE ALSO?\fother\f \breadonly\b(1), \btypeset\b(1)]"
+;
+
+typedef struct Namtype Namtype_t;
+typedef struct Namchld
+{
+ Namfun_t fun;
+ Namtype_t *ptype;
+ Namtype_t *ttype;
+} Namchld_t;
+
+struct Namtype
+{
+ Namfun_t fun;
+ Shell_t *sh;
+ Namval_t *np;
+ Namval_t *parent;
+ Namval_t *bp;
+ Namval_t *cp;
+ char *nodes;
+ char *data;
+ Namchld_t childfun;
+ int numnodes;
+ char **names;
+ size_t dsize;
+ short strsize;
+ unsigned short ndisc;
+ unsigned short current;
+ unsigned short nref;
+};
+
+#if 0
+struct type
+{
+ Namtype_t hdr;
+ unsigned short ndisc;
+ unsigned short current;
+ unsigned short nref;
+};
+#endif
+
+typedef struct
+{
+ char _cSfdouble_t;
+ Sfdouble_t _dSfdouble_t;
+ char _cdouble;
+ double _ddouble;
+ char _cfloat;
+ float _dfloat;
+ char _cSflong_t;
+ Sflong_t _dSflong_t;
+ char _clong;
+ long _dlong;
+ char _cshort;
+ short _dshort;
+ char _cpointer;
+ char *_dpointer;
+} _Align_;
+
+#define alignof(t) ((char*)&((_Align_*)0)->_d##t-(char*)&((_Align_*)0)->_c##t)
+
+static void put_type(Namval_t*, const char*, int, Namfun_t*);
+static Namval_t* create_type(Namval_t*, const char*, int, Namfun_t*);
+static Namfun_t* clone_type(Namval_t*, Namval_t*, int, Namfun_t*);
+static Namval_t* next_type(Namval_t*, Dt_t*, Namfun_t*);
+
+static const Namdisc_t type_disc =
+{
+ sizeof(Namtype_t),
+ put_type,
+ 0,
+ 0,
+ 0,
+ create_type,
+ clone_type,
+ 0,
+ next_type,
+ 0,
+#if 0
+ read_type
+#endif
+};
+
+static size_t datasize(Namval_t *np, size_t *offset)
+{
+ size_t s=0, a=0;
+ Namarr_t *ap;
+ if(nv_isattr(np,NV_INTEGER))
+ {
+ if(nv_isattr(np,NV_DOUBLE)==NV_DOUBLE)
+ {
+ if(nv_isattr(np, NV_LONG))
+ {
+ a = alignof(Sfdouble_t);
+ s = sizeof(Sfdouble_t);
+ }
+ else if(nv_isattr(np, NV_SHORT))
+ {
+ a = alignof(float);
+ s = sizeof(float);
+ }
+ else
+ {
+ a = alignof(double);
+ s = sizeof(double);
+ }
+ }
+ else
+ {
+ if(nv_isattr(np, NV_LONG))
+ {
+ a = alignof(Sflong_t);
+ s = sizeof(Sflong_t);
+ }
+ else if(nv_isattr(np, NV_SHORT))
+ {
+ a = alignof(short);
+ s = sizeof(short);
+ }
+ else
+ {
+ a = alignof(long);
+ s = sizeof(long);
+ }
+ }
+ }
+ else if(nv_isattr(np, NV_BINARY) || nv_isattr(np,NV_LJUST|NV_RJUST|NV_ZFILL))
+ s = nv_size(np);
+ else
+ {
+ a = alignof(pointer);
+ s = nv_size(np);
+ }
+ if(a>1 && offset)
+ *offset = a*((*offset +a-1)/a);
+ if(nv_isarray(np) && (ap = nv_arrayptr(np)))
+ s *= array_elem(ap);
+ return(s);
+}
+
+static char *name_chtype(Namval_t *np, Namfun_t *fp)
+{
+ Namchld_t *pp = (Namchld_t*)fp;
+ char *cp, *sub;
+ Namval_t *tp = sh.last_table;
+ Namval_t *nq = pp->ptype->np;
+ Namarr_t *ap;
+ if(nv_isattr(np,NV_REF|NV_TAGGED)==(NV_REF|NV_TAGGED))
+ sh.last_table = 0;
+ cp = nv_name(nq);
+ if((ap = nv_arrayptr(nq)) && !(ap->nelem&ARRAY_UNDEF) && (sub= nv_getsub(nq)))
+ sfprintf(sh.strbuf,"%s[%s].%s",cp,sub,np->nvname);
+ else
+ sfprintf(sh.strbuf,"%s.%s",cp,np->nvname);
+ sh.last_table = tp;
+ return(sfstruse(sh.strbuf));
+}
+
+static void put_chtype(Namval_t* np, const char* val, int flag, Namfun_t* fp)
+{
+ if(!val && nv_isattr(np,NV_REF))
+ return;
+ nv_putv(np,val,flag,fp);
+ if(!val)
+ {
+ Namchld_t *pp = (Namchld_t*)fp;
+ size_t dsize=0,offset = (char*)np-(char*)pp->ptype;
+ Namval_t *mp = (Namval_t*)((char*)pp->ttype+offset);
+ dsize = datasize(mp,&dsize);
+ if(mp->nvalue.cp >= pp->ttype->data && mp->nvalue.cp < (char*)pp+pp->ttype->fun.dsize)
+ {
+ np->nvalue.cp = pp->ptype->data + (mp->nvalue.cp-pp->ptype->data);
+ memcpy((char*)np->nvalue.cp,mp->nvalue.cp,dsize);
+ }
+ else if(!nv_isarray(mp) && mp->nvalue.cp)
+ {
+ np->nvalue.cp = mp->nvalue.cp;
+ nv_onattr(np,NV_NOFREE);
+ }
+ np->nvsize = mp->nvsize;
+ np->nvflag = mp->nvflag&~NV_RDONLY;
+ }
+}
+
+static const Namdisc_t chtype_disc =
+{
+ sizeof(Namchld_t),
+ put_chtype,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ name_chtype
+};
+
+static Namval_t *findref(void *nodes, int n)
+{
+ Namval_t *tp,*np = nv_namptr(nodes,n);
+ char *name = np->nvname;
+ int i=n, len= strrchr(name,'.')-name;
+ Namtype_t *pp;
+ while(--i>0)
+ {
+ np = nv_namptr(nodes,i);
+ if(np->nvname[len]==0)
+ {
+ tp = nv_type(np);
+ pp = (Namtype_t*)nv_hasdisc(tp,&type_disc);
+ return(nv_namptr(pp->nodes,n-i-1));
+ }
+ }
+ return(0);
+}
+
+static int fixnode(Namtype_t *dp, Namtype_t *pp, int i, struct Namref *nrp,int flag)
+{
+ Namval_t *nq = nv_namptr(dp->nodes,i);
+ Namfun_t *fp;
+ if(fp=nv_hasdisc(nq,&chtype_disc))
+ nv_disc(nq, fp, NV_POP);
+ if(nv_isattr(nq,NV_REF))
+ {
+ nq->nvalue.nrp = nrp++;
+ nv_setsize(nq,0);
+ if(strchr(nq->nvname,'.'))
+ nq->nvalue.nrp->np = findref(dp->nodes,i);
+ else
+ nq->nvalue.nrp->np = nv_namptr(pp->childfun.ttype->nodes,i);
+ nq->nvalue.nrp->root = sh.last_root;
+ nq->nvalue.nrp->table = pp->np;
+ nq ->nvflag = NV_REF|NV_NOFREE|NV_MINIMAL;
+ return(1);
+ }
+ if(nq->nvalue.cp || nq->nvfun)
+ {
+ const char *data = nq->nvalue.cp;
+ if(nq->nvfun)
+ {
+ Namval_t *np = nv_namptr(pp->nodes,i);
+ if(nv_isarray(nq))
+ nq->nvalue.cp = 0;
+ nq->nvfun = 0;
+ if(nv_isarray(nq) && nv_type(np))
+ clone_all_disc(np,nq,flag&~NV_TYPE);
+ else
+ clone_all_disc(np,nq,flag);
+ if(fp)
+ nv_disc(np, fp, NV_LAST);
+ }
+#if 0
+ if(nq->nvalue.cp >= pp->data && nq->nvalue.cp < (char*)pp +pp->fun.dsize)
+ nq->nvalue.cp = dp->data + (nq->nvalue.cp-pp->data);
+#else
+ if(data >= pp->data && data < (char*)pp +pp->fun.dsize)
+ nq->nvalue.cp = dp->data + (data-pp->data);
+#endif
+ else if(!nq->nvfun && pp->childfun.ttype!=pp->childfun.ptype)
+ {
+ Namval_t *nr = nv_namptr( pp->childfun.ttype->nodes,i);
+ if(nr->nvalue.cp!=nq->nvalue.cp)
+ {
+ if(i=nv_size(nq))
+ {
+ const char *cp = nq->nvalue.cp;
+ nq->nvalue.cp = (char*)malloc(i);
+ memcpy((char*)nq->nvalue.cp,cp,i);
+ }
+ else
+ nq->nvalue.cp = strdup(nq->nvalue.cp);
+ nv_offattr(nq,NV_NOFREE);
+ }
+ }
+
+ }
+ if(fp)
+ nv_disc(nq, &dp->childfun.fun, NV_LAST);
+ return(0);
+}
+
+static Namfun_t *clone_type(Namval_t* np, Namval_t *mp, int flags, Namfun_t *fp)
+{
+ Namtype_t *dp, *pp=(Namtype_t*)fp;
+ register int i;
+ register Namval_t *nq, *nr;
+ size_t size = fp->dsize;
+ int save, offset=staktell();
+ char *cp;
+ Dt_t *root = sh.last_root;
+ Namval_t *last_table = sh.last_table;
+ struct Namref *nrp = 0;
+ Namarr_t *ap;
+ if(flags&NV_MOVE)
+ {
+ pp->np = mp;
+ pp->childfun.ptype = pp;
+ return(fp);
+ }
+ if(flags&NV_TYPE)
+ return(nv_clone_disc(fp,flags));
+ if(size==0 && (!fp->disc || (size=fp->disc->dsize)==0))
+ size = sizeof(Namfun_t);
+ dp = (Namtype_t*)malloc(size+pp->nref*sizeof(struct Namref));
+ if(pp->nref)
+ {
+ nrp = (struct Namref*)((char*)dp + size);
+ memset((void*)nrp,0,pp->nref*sizeof(struct Namref));
+ }
+ memcpy((void*)dp,(void*)pp,size);
+#if 0
+ dp->parent = nv_lastdict();
+#else
+ dp->parent = mp;
+#endif
+ dp->fun.nofree = (flags&NV_RDONLY?1:0);
+ dp->np = mp;
+ dp->childfun.ptype = dp;
+#if 0
+ dp->childfun.ttype = (Namtype_t*)nv_hasdisc(dp->fun.type,&type_disc);
+#endif
+ dp->nodes = (char*)(dp+1);
+ dp->data = (char*)dp + (pp->data - (char*)pp);
+ for(i=dp->numnodes; --i >= 0; )
+ {
+ nq = nv_namptr(dp->nodes,i);
+ if(fixnode(dp,pp,i,nrp,NV_TYPE))
+ {
+ nrp++;
+ nq = nq->nvalue.nrp->np;
+ }
+ if(nq->nvalue.cp || nv_isarray(nq) || nv_isattr(nq,NV_RDONLY))
+ {
+ /* see if default value has been overwritten */
+ if(!mp->nvname)
+ continue;
+ sh.last_table = last_table;
+ if(pp->strsize<0)
+ cp = nv_name(np);
+ else
+ cp = nv_name(mp);
+ stakputs(cp);
+ stakputc('.');
+ stakputs(nq->nvname);
+ stakputc(0);
+ root = nv_dict(mp);
+ save = fp->nofree;
+ fp->nofree = 1;
+ nr = nv_create(stakptr(offset),root,NV_VARNAME|NV_NOADD,fp);
+ fp->nofree = save;
+ stakseek(offset);
+ if(nr)
+ {
+ if(nv_isattr(nq,NV_RDONLY) && (nq->nvalue.cp || nv_isattr(nq,NV_INTEGER)))
+ errormsg(SH_DICT,ERROR_exit(1),e_readonly, nq->nvname);
+ if(nv_isref(nq))
+ nq = nv_refnode(nq);
+ if((size = datasize(nr,(size_t*)0)) && size==datasize(nq,(size_t*)0))
+ memcpy((char*)nq->nvalue.cp,nr->nvalue.cp,size);
+ else if(ap=nv_arrayptr(nr))
+ {
+ nv_putsub(nr,NIL(char*),ARRAY_SCAN|ARRAY_NOSCOPE);
+ do
+ {
+ if(array_assoc(ap))
+ cp = (char*)((*ap->fun)(nr,NIL(char*),NV_ANAME));
+ else
+ cp = nv_getsub(nr);
+ nv_putsub(nq,cp,ARRAY_ADD|ARRAY_NOSCOPE);
+ if(array_assoc(ap))
+ {
+ Namval_t *mp = (Namval_t*)((*ap->fun)(nr,NIL(char*),NV_ACURRENT));
+ Namval_t *mq = (Namval_t*)((*ap->fun)(nq,NIL(char*),NV_ACURRENT));
+ nv_clone(mp,mq,NV_MOVE);
+ ap->nelem--;
+ nv_delete(mp,ap->table,0);
+ }
+ else
+ {
+ cp = nv_getval(nr);
+ nv_putval(nq,cp,0);
+ }
+ }
+ while(nv_nextsub(nr));
+ }
+ else
+ nv_putval(nq,nv_getval(nr),NV_RDONLY);
+#if SHOPT_TYPEDEF
+ if(sh.mktype)
+ nv_addnode(nr,1);
+#endif /* SHOPT_TYPEDEF */
+ if(pp->strsize<0)
+ continue;
+ _nv_unset(nr,0);
+ if(!nv_isattr(nr,NV_MINIMAL))
+ nv_delete(nr,sh.last_root,0);
+ }
+ else if(nv_isattr(nq,NV_RDONLY) && !nq->nvalue.cp && !nv_isattr(nq,NV_INTEGER))
+ errormsg(SH_DICT,ERROR_exit(1),e_required,nq->nvname,nv_name(mp));
+ }
+ }
+ if(nv_isattr(mp,NV_BINARY))
+ mp->nvalue.cp = dp->data;
+ if(pp->strsize<0)
+ dp->strsize = -pp->strsize;
+ return(&dp->fun);
+}
+
+
+/*
+ * return Namval_t* corresponding to child <name> in <np>
+ */
+static Namval_t *create_type(Namval_t *np,const char *name,int flag,Namfun_t *fp)
+{
+ Namtype_t *dp = (Namtype_t*)fp;
+ register const char *cp=name;
+ register int i=0,n;
+ Namval_t *nq=0;
+ if(!name)
+ return(dp->parent);
+ while((n=*cp++) && n != '=' && n != '+' && n!='[');
+ n = (cp-1) -name;
+ if(dp->numnodes && dp->strsize<0)
+ {
+ char *base = (char*)np-sizeof(Dtlink_t);
+ int m=strlen(np->nvname);
+ while((nq=nv_namptr(base,++i)) && memcmp(nq->nvname,np->nvname,m)==0)
+ {
+ if(nq->nvname[m]=='.' && memcmp(name,&nq->nvname[m+1],n)==0 && nq->nvname[m+n+1]==0)
+ goto found;
+ }
+ nq = 0;
+ }
+ else for(i=0; i < dp->numnodes; i++)
+ {
+ nq = nv_namptr(dp->nodes,i);
+ if((n==0||memcmp(name,nq->nvname,n)==0) && nq->nvname[n]==0)
+ {
+ while(nv_isref(nq))
+ nq = nq->nvalue.nrp->np;
+ goto found;
+ }
+ }
+ nq = 0;
+found:
+ if(nq)
+ {
+ fp->last = (char*)&name[n];
+ sh.last_table = dp->parent;
+ }
+ else
+ {
+ if(name[n]!='=') for(i=0; i < dp->ndisc; i++)
+ {
+ if((memcmp(name,dp->names[i],n)==0) && dp->names[i][n]==0)
+ return(nq);
+ }
+ errormsg(SH_DICT,ERROR_exit(1),e_notelem,n,name,nv_name(np));
+ }
+ return(nq);
+}
+
+static void put_type(Namval_t* np, const char* val, int flag, Namfun_t* fp)
+{
+ Namval_t *nq;
+ if(val && (nq=nv_open(val,sh.var_tree,NV_VARNAME|NV_ARRAY|NV_NOADD|NV_NOFAIL)))
+ {
+ Namfun_t *pp;
+ if((pp=nv_hasdisc(nq,fp->disc)) && pp->type==fp->type)
+
+ {
+ _nv_unset(np, flag);
+ nv_clone(nq,np,0);
+ return;
+ }
+ }
+ nv_putv(np,val,flag,fp);
+ if(!val)
+ {
+ Namtype_t *dp = (Namtype_t*)fp;
+ Namval_t *nq;
+ Namarr_t *ap;
+ int i;
+ if(nv_isarray(np) && (ap=nv_arrayptr(np)) && ap->nelem>0)
+ return;
+ for(i=0; i < dp->numnodes; i++)
+ {
+ nq = nv_namptr(dp->nodes,i);
+ if(ap=nv_arrayptr(nq))
+ ap->nelem |= ARRAY_UNDEF;
+ if(!nv_hasdisc(nq,&type_disc))
+ _nv_unset(nq,flag|NV_TYPE|nv_isattr(nq,NV_RDONLY));
+ }
+ nv_disc(np,fp,NV_POP);
+ if(!(fp->nofree&1))
+ free((void*)fp);
+ }
+}
+
+static Namval_t *next_type(register Namval_t* np, Dt_t *root,Namfun_t *fp)
+{
+ Namtype_t *dp = (Namtype_t*)fp;
+ if(!root)
+ {
+ Namarr_t *ap = nv_arrayptr(np);
+ if(ap && (ap->nelem&ARRAY_UNDEF))
+ nv_putsub(np,(char*)0,ARRAY_SCAN);
+ dp->current = 0;
+ }
+ else if(++dp->current>=dp->numnodes)
+ return(0);
+ return(nv_namptr(dp->nodes,dp->current));
+}
+
+static Namfun_t *clone_inttype(Namval_t* np, Namval_t *mp, int flags, Namfun_t *fp)
+{
+ Namfun_t *pp= (Namfun_t*)malloc(fp->dsize);
+ memcpy((void*)pp, (void*)fp, fp->dsize);
+ fp->nofree &= ~1;
+ if(nv_isattr(mp,NV_NOFREE) && mp->nvalue.cp)
+ memcpy((void*)mp->nvalue.cp,np->nvalue.cp, fp->dsize-sizeof(*fp));
+ else
+ mp->nvalue.cp = (char*)(fp+1);
+ if(!nv_isattr(mp,NV_MINIMAL))
+ mp->nvenv = 0;
+ nv_offattr(mp,NV_RDONLY);
+ return(pp);
+}
+
+static int typeinfo(Opt_t* op, Sfio_t *out, const char *str, Optdisc_t *fp)
+{
+ char *cp,**help,buffer[256];
+ Namtype_t *dp;
+ Namval_t *np,*nq,*tp;
+ int n, i, offset=staktell();
+ Sfio_t *sp;
+
+ np = *(Namval_t**)(fp+1);
+ stakputs(NV_CLASS);
+ stakputc('.');
+ stakputs(np->nvname);
+ stakputc(0);
+ np = nv_open(stakptr(offset), sh.var_tree, NV_NOADD|NV_VARNAME);
+ stakseek(offset);
+ if(!np)
+ {
+ sfprintf(sfstderr,"%s: no such variable\n",np->nvname);
+ return(-1);
+ }
+ if(!(dp=(Namtype_t*)nv_hasdisc(np,&type_disc)))
+ {
+ Namfun_t *fp;
+ for(fp=np->nvfun;fp;fp=fp->next)
+ {
+ if(fp->disc && fp->disc->clonef==clone_inttype)
+ break;
+ }
+ if(!fp)
+ {
+ sfprintf(sfstderr,"%s: not a type\n",np->nvname);
+ return(-1);
+ }
+ if(strcmp(str,"other")==0)
+ return(0);
+ tp = fp->type;
+ nv_offattr(np,NV_RDONLY);
+ fp->type = 0;
+ if(np->nvenv)
+ sfprintf(out,"[+?\b%s\b is a %s.]\n", tp->nvname, np->nvenv);
+ cp = (char*)out->_next;
+ sfprintf(out,"[+?\b%s\b is a %n ", tp->nvname, &i);
+ nv_attribute(np,out,(char*)0, 1);
+ if(cp[i+1]=='i')
+ cp[i-1]='n';
+ fp->type = tp;
+ nv_onattr(np,NV_RDONLY);
+ sfprintf(out," with default value \b%s\b.]",nv_getval(np));
+ return(0);
+ }
+ if(strcmp(str,"other")==0)
+ {
+ Nambfun_t *bp;
+ if(bp=(Nambfun_t*)nv_hasdisc(np,nv_discfun(NV_DCADD)))
+ {
+ for(i=0; i < bp->num; i++)
+ {
+ if(nv_isattr(bp->bltins[i],NV_OPTGET))
+ sfprintf(out,"\b%s.%s\b(3), ",np->nvname,bp->bnames[i]);
+ }
+ }
+ return(0);
+ }
+ help = &dp->names[dp->ndisc];
+ sp = sfnew((Sfio_t*)0,buffer,sizeof(buffer),-1,SF_STRING|SF_WRITE);
+ sfprintf(out,"[+?\b%s\b defines the following fields:]{\n",np->nvname);
+ for(i=0; i < dp->numnodes; i++)
+ {
+ nq = nv_namptr(dp->nodes,i);
+ if(tp=nv_type(nq))
+ {
+ Namfun_t *pp = nv_hasdisc(nq,&type_disc);
+ sfprintf(out,"\t[+%s?%s.\n",nq->nvname,tp->nvname);
+ n = strlen(nq->nvname);
+ while((cp=nv_namptr(dp->nodes,i+1)->nvname) && memcmp(cp,nq->nvname,n)==0 && cp[n]=='.')
+ i++;
+ }
+ else
+ {
+ sfseek(sp,(Sfoff_t)0, SEEK_SET);
+ nv_attribute(nq,sp,(char*)0,1);
+ cp = 0;
+ if(!nv_isattr(nq,NV_REF))
+ cp = sh_fmtq(nv_getval(nq));
+ sfputc(sp,0);
+ for(n=strlen(buffer); n>0 && buffer[n-1]==' '; n--);
+ buffer[n] = 0;
+ if(cp)
+ sfprintf(out,"\t[+%s?%s, default value is %s.\n",nq->nvname,*buffer?buffer:"string",cp);
+ else
+ sfprintf(out,"\t[+%s?%s.\n",nq->nvname,*buffer?buffer:"string");
+ }
+ if(help[i])
+ sfprintf(out," %s.",help[i]);
+ sfputc(out,']');
+ }
+ sfprintf(out,"}\n");
+ if(dp->ndisc>0)
+ {
+ stakseek(offset);
+ stakputs(NV_CLASS);
+ stakputc('.');
+ stakputs(np->nvname);
+ stakputc('.');
+ n = staktell();
+ sfprintf(out,"[+?\b%s\b defines the following discipline functions:]{\n",np->nvname);
+ for(i=0; i < dp->ndisc; i++)
+ {
+ stakputs(dp->names[i]);
+ stakputc(0);
+ cp = 0;
+ if((nq = nv_search(stakptr(offset),sh.fun_tree,0)) && nq->nvalue.cp)
+ cp = nq->nvalue.rp->help;
+ sfprintf(out,"\t[+%s?%s]\n",dp->names[i],cp?cp:Empty);
+ if(cp)
+ sfputc(out,'.');
+ stakseek(n);
+ }
+ sfprintf(out,"}\n");
+ }
+ stakseek(offset);
+ sfclose(sp);
+ return(0);
+}
+
+static int std_disc(Namval_t *mp, Namtype_t *pp)
+{
+ register const char *sp, *cp = strrchr(mp->nvname,'.');
+ register const char **argv;
+ register int i;
+ Namval_t *np=0,*nq;
+ if(cp)
+ cp++;
+ else
+ cp = mp->nvname;
+ if(strcmp(cp,"create")==0)
+ {
+ if(pp)
+ pp->cp = mp;
+ return(0);
+ }
+ for(argv=nv_discnames; sp=*argv; argv++)
+ {
+ if(strcmp(cp,sp)==0)
+ {
+ if(!pp)
+ return(1);
+ goto found;
+ }
+ }
+ return(0);
+found:
+ if(memcmp(sp=mp->nvname,NV_CLASS,sizeof(NV_CLASS)-1)==0)
+ sp += sizeof(NV_CLASS);
+ sp += strlen(pp->fun.type->nvname)+1;
+ if(sp == cp)
+ np = pp->fun.type;
+ else for(i=1; i < pp->numnodes; i++)
+ {
+ nq = nv_namptr(pp->nodes,i);
+ if(memcmp(nq->nvname, sp, cp-sp-1)==0)
+ {
+ np = nq;
+ break;
+ }
+ }
+ if(np)
+ {
+ nv_onattr(mp,NV_NOFREE);
+ if(!nv_setdisc(np,cp, mp, (Namfun_t*)np))
+ sfprintf(sfstderr," nvsetdisc failed name=%s sp=%s cp=%s\n",np->nvname,sp,cp);
+ }
+ else
+ sfprintf(sfstderr,"can't set discipline %s cp=%s \n",sp,cp);
+ return(1);
+}
+
+
+void nv_addtype(Namval_t *np, const char *optstr, Optdisc_t *op, size_t optsz)
+{
+ Namdecl_t *cp = newof((Namdecl_t*)0,Namdecl_t,1,optsz);
+ Optdisc_t *dp = (Optdisc_t*)(cp+1);
+ Shell_t *shp = sh_getinterp();
+ Namval_t *mp,*bp;
+ char *name;
+ if(optstr)
+ cp->optstring = optstr;
+ else
+ cp->optstring = sh_opttype;
+ memcpy((void*)dp,(void*)op, optsz);
+ cp->optinfof = (void*)dp;
+ cp->tp = np;
+ mp = nv_search("typeset",shp->bltin_tree,0);
+ if(name=strrchr(np->nvname,'.'))
+ name++;
+ else
+ name = np->nvname;
+ if((bp=nv_search(name,shp->fun_tree,NV_NOSCOPE)) && !bp->nvalue.ip)
+ nv_delete(bp,shp->fun_tree,0);
+ bp = sh_addbuiltin(name, mp->nvalue.bfp, (void*)cp);
+ nv_onattr(bp,nv_isattr(mp,NV_PUBLIC));
+ nv_onattr(np, NV_RDONLY);
+}
+
+static void addtype(Namval_t *mp)
+{
+ struct {
+ Optdisc_t opt;
+ Namval_t *np;
+ } optdisc;
+ memset(&optdisc,0,sizeof(optdisc));
+ optdisc.opt.infof = typeinfo;
+ optdisc.np = mp;
+ nv_addtype(mp,sh_opttype, &optdisc.opt, sizeof(optdisc));
+}
+
+/*
+ * This function creates a type out of the <numnodes> nodes in the
+ * array <nodes>. The first node is the name for the type
+ */
+Namval_t *nv_mktype(Namval_t **nodes, int numnodes)
+{
+ Namval_t *mp=nodes[0], *bp=0, *np, *nq, **mnodes=nodes;
+ int i,j,k,m,n,nd=0,nref=0,iref=0,inherit=0;
+ int size=sizeof(NV_DATA), dsize=0, nnodes;
+ size_t offset=0;
+ char *name=0, *cp, *sp, **help;
+ Namtype_t *pp,*qp=0,*dp,*tp;
+ Dt_t *root = nv_dict(mp);
+ struct Namref *nrp = 0;
+ Namfun_t *fp;
+ m = strlen(mp->nvname)+1;
+ for(nnodes=1,i=1; i <numnodes; i++)
+ {
+ np=nodes[i];
+ if(is_afunction(np))
+ {
+ if(!std_disc(np, (Namtype_t*)0))
+ {
+ size += strlen(np->nvname+m)+1;
+ if(memcmp(np->nvname,NV_CLASS,sizeof(NV_CLASS)-1)==0)
+ size -= sizeof(NV_CLASS);
+ nd++;
+ }
+ continue;
+ }
+ if(nv_isattr(np,NV_REF))
+ iref++;
+ if(np->nvenv)
+ size += strlen((char*)np->nvenv)+1;
+ if(strcmp(&np->nvname[m],NV_DATA)==0 && !nv_type(np))
+ continue;
+ if(qp)
+ { /* delete duplicates */
+ for(j=0; j < qp->numnodes;j++)
+ {
+ nq = nv_namptr(qp->nodes,j);
+ if(strcmp(nq->nvname,&np->nvname[m])==0)
+ break;
+ }
+ if(j < qp->numnodes)
+ continue;
+ }
+ nnodes++;
+ if(name && memcmp(&name[m],&np->nvname[m],n)==0 && np->nvname[m+n]=='.')
+ offset -= sizeof(char*);
+ dsize = datasize(np,&offset);
+ if(!nv_isarray(np) && (dp=(Namtype_t*)nv_hasdisc(np, &type_disc)))
+ {
+ nnodes += dp->numnodes;
+ if((n=dp->strsize)<0)
+ n = -n;
+ iref = nref += dp->nref;
+ if(np->nvname[m]=='_' && np->nvname[m+1]==0 && (bp=nv_type(np)))
+ {
+ qp = dp;
+ nd = dp->ndisc;
+ nnodes = dp->numnodes;
+ offset = 0;
+ dsize = nv_size(np);
+ size += n;
+ }
+ else
+ size += n + dp->numnodes*(strlen(&np->nvname[m])+1);
+ n = strlen(np->nvname);
+ while((i+1) < numnodes && (cp=nodes[i+1]->nvname) && memcmp(cp,np->nvname,n)==0 && cp[n]=='.')
+ i++;
+ }
+ else if(nv_isattr(np,NV_REF))
+ nref++;
+ offset += (dsize?dsize:4);
+ size += (n=strlen(name=np->nvname)-m+1);
+ }
+ offset = roundof(offset,sizeof(char*));
+ nv_setsize(mp,offset);
+ if(nd)
+ nd++;
+ k = roundof(sizeof(Namtype_t),sizeof(Sfdouble_t)) - sizeof(Namtype_t);
+ pp = newof(NiL, Namtype_t, 1, nnodes*NV_MINSZ + offset + size + (nnodes+nd)*sizeof(char*) + iref*sizeof(struct Namref)+k);
+ pp->fun.dsize = sizeof(Namtype_t)+nnodes*NV_MINSZ +offset+k;
+ pp->fun.type = mp;
+ pp->parent = nv_lastdict();
+ pp->np = mp;
+ pp->bp = bp;
+ pp->childfun.fun.disc = &chtype_disc;
+ pp->childfun.fun.nofree = 1;
+ pp->childfun.ttype = pp;
+ pp->childfun.ptype = pp;
+ pp->fun.disc = &type_disc;
+ pp->nodes = (char*)(pp+1);
+ pp->numnodes = nnodes;
+ pp->data = pp->nodes + nnodes*NV_MINSZ +k;
+ pp->dsize = offset;
+ nrp = (struct Namref*)(pp->data+offset);
+ pp->names = (char**)(nrp+iref);
+ help = &pp->names[nd];
+ pp->strsize = size;
+ cp = (char*)&pp->names[nd+nnodes];
+ if(qp)
+ mnodes = newof(NiL, Namval_t*, nd+1, 0);
+ nd = 0;
+ nq = nv_namptr(pp->nodes,0);
+ nq->nvname = cp;
+ nv_onattr(nq,NV_MINIMAL);
+ cp = strcopy(cp,NV_DATA);
+ *cp++ = 0;
+ for(name=0, offset=0, k=i=1; i < numnodes; i++)
+ {
+ np=nodes[i];
+ if(is_afunction(np))
+ {
+ sp = np->nvname+m;
+ if(memcmp(np->nvname,NV_CLASS,sizeof(NV_CLASS)-1)==0)
+ sp += sizeof(NV_CLASS);
+ if(!std_disc(np, pp))
+ {
+ /* see if discipline already defined */
+ for(j=0; j< nd; j++)
+ {
+ if(strcmp(sp,pp->names[j])==0)
+ {
+ mnodes[j] = nodes[i];
+ break;
+ }
+ }
+ if(j>=nd)
+ {
+ pp->names[nd] = cp;
+ mnodes[nd++] = nodes[i];
+ cp = strcopy(cp,sp);
+ *cp++ = 0;
+ }
+ nv_onattr(mnodes[j],NV_NOFREE);
+ }
+ continue;
+ }
+ if(inherit)
+ {
+ for(j=0; j < k ; j++)
+ {
+ nq = nv_namptr(pp->nodes,j);
+ if(strcmp(nq->nvname,&np->nvname[m])==0)
+ break;
+ }
+ if(j < k)
+ {
+ sp = nv_getval(np);
+ if(nv_isvtree(np))
+ sfprintf(sfstderr,"initialization not implemented\n");
+ else if(sp)
+ nv_putval(nq,sp,0);
+ goto skip;
+ }
+ }
+ if(strcmp(&np->nvname[m],NV_DATA)==0 && !nv_type(np))
+ {
+ char *val=nv_getval(np);
+ nq = nv_namptr(pp->nodes,0);
+ nq->nvfun = 0;
+ nv_putval(nq,(val?val:0),nv_isattr(np,~(NV_IMPORT|NV_EXPORT|NV_ARRAY)));
+ nq->nvflag = np->nvflag|NV_NOFREE|NV_MINIMAL;
+ goto skip;
+ }
+ if(qp)
+ {
+ Nambfun_t *bp;
+ dp = (Namtype_t*)nv_hasdisc(nv_type(np), &type_disc);
+ memcpy(pp->nodes,dp->nodes,dp->numnodes*NV_MINSZ);
+ offset = nv_size(np);
+ memcpy(pp->data,dp->data,offset);
+ for(k=0;k < dp->numnodes; k++)
+ {
+ Namval_t *nr = nv_namptr(qp->nodes,k);
+ nq = nv_namptr(pp->nodes,k);
+ if(fixnode(pp,dp,k,nrp,0))
+ {
+ nrp++;
+ nq = nq->nvalue.nrp->np;
+ }
+ if(!nv_isattr(nr,NV_REF) && !nv_hasdisc(nr,&type_disc))
+ {
+ if(nr->nvsize)
+ memcpy((char*)nq->nvalue.cp,nr->nvalue.cp,size=datasize(nr,(size_t*)0));
+ else
+ {
+ nq->nvalue.cp = nr->nvalue.cp;
+ nv_onattr(nq,NV_NOFREE);
+ }
+ }
+ }
+ if(bp=(Nambfun_t*)nv_hasdisc(np,nv_discfun(NV_DCADD)))
+ {
+ for(j=0; j < bp->num; j++)
+ {
+ pp->names[nd++] = (char*)bp->bnames[j];
+ mnodes[j] = bp->bltins[j];
+ }
+ }
+ qp = 0;
+ inherit=1;
+ goto skip;
+ }
+ nq = nv_namptr(pp->nodes,k);
+ if(np->nvenv)
+ {
+ /* need to save the string pointer */
+ nv_offattr(np,NV_EXPORT);
+ help[k] = cp;
+ cp = strcopy(cp,np->nvenv);
+ j = *help[k];
+ if(islower(j))
+ *help[k] = toupper(j);
+ *cp++ = 0;
+ np->nvenv = 0;
+ }
+ nq->nvname = cp;
+ if(name && memcmp(name,&np->nvname[m],n)==0 && np->nvname[m+n]=='.')
+ offset -= sizeof(char*);
+ dsize = datasize(np,&offset);
+ cp = strcopy(name=cp, &np->nvname[m]);
+ n = cp-name;
+ *cp++ = 0;
+ nq->nvsize = np->nvsize;
+ nq->nvflag = (np->nvflag&~(NV_IMPORT|NV_EXPORT))|NV_NOFREE|NV_MINIMAL;
+ if(dp = (Namtype_t*)nv_hasdisc(np, &type_disc))
+ {
+ int r,kfirst=k;
+ char *cname = &np->nvname[m];
+ /*
+ * If field is a type, mark the type by setting
+ * strsize<0. This changes create_type()
+ */
+ clone_all_disc(np,nq,NV_RDONLY);
+ if(nv_isarray(np))
+ {
+ nv_disc(nq, &pp->childfun.fun, NV_LAST);
+ k++;
+ goto skip;
+ }
+ if(fp=nv_hasdisc(nq,&chtype_disc))
+ nv_disc(nq, &pp->childfun.fun, NV_LAST);
+ if(tp = (Namtype_t*)nv_hasdisc(nq, &type_disc))
+ tp->strsize = -tp->strsize;
+else sfprintf(sfstderr,"tp==NULL\n");
+ for(r=0; r < dp->numnodes; r++)
+ {
+ Namval_t *nr = nv_namptr(dp->nodes,r);
+ nq = nv_namptr(pp->nodes,++k);
+ nq->nvname = cp;
+ dsize = datasize(nr,&offset);
+ nq->nvflag = nr->nvflag;
+ if(nr->nvalue.cp)
+ {
+ Namchld_t *xp = (Namchld_t*)nv_hasdisc(nr,&chtype_disc);
+ if(xp && nr->nvalue.cp >= xp->ptype->data && nr->nvalue.cp < xp->ptype->data+xp->ptype->fun.dsize)
+ {
+ nq->nvalue.cp = pp->data+offset;
+ memcpy((char*)nq->nvalue.cp,nr->nvalue.cp,dsize);
+ nv_onattr(nq,NV_NOFREE);
+ }
+ else
+ nq->nvalue.cp = strdup(nr->nvalue.cp);
+ nv_disc(nq, &pp->childfun.fun, NV_LAST);
+ }
+ nq->nvsize = nr->nvsize;
+ offset += dsize;
+ if(*cname!='_' || cname[1])
+ {
+ cp = strcopy(cp,cname);
+ *cp++ = '.';
+ }
+ cp = strcopy(cp,nr->nvname);
+ *cp++ = 0;
+ }
+ while((i+1) < numnodes && (cname=&nodes[i+1]->nvname[m]) && memcmp(cname,&np->nvname[m],n)==0 && cname[n]=='.')
+ {
+ int j=kfirst;
+ nv_unset(np);
+ nv_delete(np,root,0);
+ np = nodes[++i];
+ while(j < k)
+ {
+ nq = nv_namptr(pp->nodes,++j);
+ if(strcmp(nq->nvname,cname)==0)
+ {
+ sfprintf(sfstderr,"%s found at k=%d\n",nq->nvname,k);
+ if(nq->nvalue.cp>=pp->data && nq->nvalue.cp< (char*)pp->names)
+ memcpy((char*)nq->nvalue.cp,np->nvalue.cp,datasize(np,0));
+ break;
+ }
+ }
+ }
+ }
+ else
+ {
+ j = nv_isattr(np,NV_NOFREE);
+ nq->nvfun = np->nvfun;
+ np->nvfun = 0;
+ if(nv_isarray(nq) && !nq->nvfun)
+ {
+ nv_putsub(nq, (char*)0, ARRAY_FILL);
+ ((Namarr_t*)nq->nvfun)->nelem--;
+
+ }
+ nv_disc(nq, &pp->childfun.fun, NV_LAST);
+ if(nq->nvfun)
+ {
+ for(fp=nq->nvfun; fp; fp = fp->next)
+ fp->nofree |= 1;
+ }
+ nq->nvalue.cp = np->nvalue.cp;
+ if(dsize)
+ {
+ nq->nvalue.cp = pp->data+offset;
+ sp = (char*)np->nvalue.cp;
+ if(nv_isattr(np,NV_INT16P) ==NV_INT16)
+ {
+ sp= (char*)&np->nvalue;
+ nv_onattr(nq,NV_INT16P);
+ }
+ if(sp)
+ memcpy((char*)nq->nvalue.cp,sp,dsize);
+ else if(nv_isattr(np,NV_LJUST|NV_RJUST))
+ memset((char*)nq->nvalue.cp,' ',dsize);
+ if(!j)
+ free((void*)np->nvalue.cp);
+ }
+ np->nvalue.cp = 0;
+#if 0
+ offset += dsize;
+#else
+ offset += (dsize?dsize:4);
+#endif
+ }
+ k++;
+ skip:
+ if(!nv_isnull(np))
+ _nv_unset(np,0);
+ nv_delete(np,root,0);
+ }
+ pp->ndisc = nd;
+ pp->nref = nref;
+ if(k>1)
+ {
+ nv_setsize(mp,offset);
+ mp->nvalue.cp = pp->data;
+ nv_onattr(mp,NV_NOFREE|NV_BINARY|NV_RAW);
+ }
+ else if(!mp->nvalue.cp)
+ mp->nvalue.cp = Empty;
+ nv_disc(mp, &pp->fun, NV_LAST);
+ if(nd>0)
+ {
+ pp->names[nd] = 0;
+ nv_adddisc(mp, (const char**)pp->names, mnodes);
+ }
+ if(mnodes!=nodes)
+ free((void*)mnodes);
+ addtype(mp);
+ return(mp);
+}
+
+Namval_t *nv_mkinttype(char *name, size_t size, int sign, const char *help, Namdisc_t *ep)
+{
+ Namval_t *mp;
+ Namfun_t *fp;
+ Namdisc_t *dp;
+ int offset=staktell();
+ stakputs(NV_CLASS);
+ stakputc('.');
+ stakputs(name);
+ stakputc(0);
+ mp = nv_open(stakptr(offset), sh.var_tree, NV_VARNAME);
+ stakseek(offset);
+ offset = size + sizeof(Namdisc_t);
+ fp = newof(NiL, Namfun_t, 1, offset);
+ fp->type = mp;
+ fp->nofree |= 1;
+ fp->dsize = sizeof(Namfun_t)+size;
+ dp = (Namdisc_t*)(fp+1);
+ if(ep)
+ *dp = *ep;
+ dp->clonef = clone_inttype;
+ fp->disc = dp;
+ mp->nvalue.cp = (char*)(fp+1) + sizeof(Namdisc_t);
+ nv_setsize(mp,10);
+ mp->nvenv = (char*)help;
+ nv_onattr(mp,NV_NOFREE|NV_RDONLY|NV_INTEGER|NV_EXPORT);
+ if(size==16)
+ nv_onattr(mp,NV_INT16P);
+ else if(size==64)
+ nv_onattr(mp,NV_INT64);
+ if(!sign)
+ nv_onattr(mp,NV_UNSIGN);
+ nv_disc(mp, fp, NV_LAST);
+ addtype(mp);
+ return(mp);
+}
+
+void nv_typename(Namval_t *tp, Sfio_t *out)
+{
+ char *v,*cp;
+ Namtype_t *dp;
+ cp = nv_name(tp);
+ if(v=strrchr(cp,'.'))
+ cp = v+1;
+ if((dp = (Namtype_t*)nv_hasdisc(tp,&type_disc)) && dp->bp)
+ {
+ nv_typename(dp->bp,out);
+ sfprintf(out,"%s.%s",sfstruse(out),cp);
+ }
+ else
+ sfputr(out,cp,-1);
+}
+
+Namval_t *nv_type(Namval_t *np)
+{
+ Namfun_t *fp;
+ for(fp=np->nvfun; fp; fp=fp->next)
+ {
+ if(fp->type)
+ return(fp->type);
+ if(fp->disc && fp->disc->typef && (np= (*fp->disc->typef)(np,fp)))
+ return(np);
+ }
+ return(0);
+}
+
+/*
+ * call any and all create functions
+ */
+static void type_init(Namval_t *np)
+{
+ int i;
+ Namtype_t *dp, *pp=(Namtype_t*)nv_hasdisc(np,&type_disc);
+ Namval_t *nq;
+ if(!pp)
+ return;
+ for(i=0; i < pp->numnodes; i++)
+ {
+ nq = nv_namptr(pp->nodes,i);
+ if((dp=(Namtype_t*)nv_hasdisc(nq,&type_disc)) && dp->cp)
+ sh_fun(dp->cp,nq, (char**)0);
+ }
+ if(pp->cp)
+ sh_fun(pp->cp, np, (char**)0);
+}
+
+/*
+ * This function turns variable <np> to the type <tp>
+ */
+int nv_settype(Namval_t* np, Namval_t *tp, int flags)
+{
+ int isnull = nv_isnull(np);
+ int rdonly = nv_isattr(np,NV_RDONLY);
+ char *val=0;
+ Namarr_t *ap=0;
+ int nelem=0;
+#if SHOPT_TYPEDEF
+ Namval_t *tq;
+ if(nv_type(np)==tp)
+ return(0);
+ if(nv_isarray(np) && (tq=nv_type(np)))
+ {
+ if(tp==tq)
+ return(0);
+ errormsg(SH_DICT,ERROR_exit(1),e_redef,nv_name(np));
+ }
+ if((ap=nv_arrayptr(np)) && ap->nelem>0)
+ {
+ nv_putsub(np,NIL(char*),ARRAY_SCAN);
+ ap->hdr.type = tp;
+ do
+ {
+ nv_arraysettype(np, tp, nv_getsub(np),flags);
+ }
+ while(nv_nextsub(np));
+ }
+ else if(ap || nv_isarray(np))
+ {
+ flags &= ~NV_APPEND;
+ if(!ap)
+ {
+ nv_putsub(np,"0",ARRAY_FILL);
+ ap = nv_arrayptr(np);
+ nelem = 1;
+
+ }
+ }
+ else
+#endif /*SHOPT_TYPEDEF */
+ {
+ if(isnull)
+ flags &= ~NV_APPEND;
+ else if(!nv_isvtree(np))
+ {
+ val = strdup(nv_getval(np));
+ if(!(flags&NV_APPEND))
+ _nv_unset(np, NV_RDONLY);
+ }
+ if(!nv_clone(tp,np,flags|NV_NOFREE))
+ return(0);
+ }
+ if(ap)
+ {
+ int nofree;
+ nv_disc(np,&ap->hdr,NV_POP);
+ np->nvalue.up = 0;
+ nv_clone(tp,np,flags|NV_NOFREE);
+ if(np->nvalue.cp && !nv_isattr(np,NV_NOFREE))
+ free((void*)np->nvalue.cp);
+ np->nvalue.up = 0;
+ nofree = ap->hdr.nofree;
+ ap->hdr.nofree = 0;
+ nv_disc(np, &ap->hdr, NV_FIRST);
+ ap->hdr.nofree = nofree;
+ nv_onattr(np,NV_ARRAY);
+ if(nelem)
+ {
+ ap->nelem++;
+ nv_putsub(np,"0",0);
+ _nv_unset(np,NV_RDONLY);
+ ap->nelem--;
+ }
+ }
+ type_init(np);
+ if(!rdonly)
+ nv_offattr(np,NV_RDONLY);
+ if(val)
+ {
+ nv_putval(np,val,NV_RDONLY);
+ free((void*)val);
+ }
+ return(0);
+}
+
+#define S(x) #x
+#define FIELD(x,y) { S(y##x), S(x##_t), offsetof(struct stat,st_##y##x) }
+typedef struct _field_
+{
+ char *name;
+ char *type;
+ int offset;
+} Fields_t;
+
+Fields_t foo[]=
+{
+ FIELD(dev,),
+ FIELD(ino,),
+ FIELD(nlink,),
+ FIELD(mode,),
+ FIELD(uid,),
+ FIELD(gid,),
+ FIELD(size,),
+ FIELD(time,a),
+ FIELD(time,m),
+ FIELD(time,c),
+#if 0
+ FIELD(blksize,),
+ FIELD(blocks,),
+#endif
+ 0
+};
+
+
+Namval_t *nv_mkstruct(const char *name, int rsize, Fields_t *fields)
+{
+ Namval_t *mp, *nq, *nr, *tp;
+ Fields_t *fp;
+ Namtype_t *dp, *pp;
+ char *cp, *sp;
+ int nnodes=0, offset=staktell(), n, r, i, j;
+ size_t m, size=0;
+ stakputs(NV_CLASS);
+ stakputc('.');
+ r = staktell();
+ stakputs(name);
+ stakputc(0);
+ mp = nv_open(stakptr(offset), sh.var_tree, NV_VARNAME);
+ stakseek(r);
+
+ for(fp=fields; fp->name; fp++)
+ {
+ m = strlen(fp->name)+1;
+ size += m;
+ nnodes++;
+ if(memcmp(fp->type,"typeset",7))
+ {
+ stakputs(fp->type);
+ stakputc(0);
+ tp = nv_open(stakptr(offset), sh.var_tree, NV_VARNAME|NV_NOADD|NV_NOFAIL);
+ stakseek(r);
+ if(!tp)
+ errormsg(SH_DICT,ERROR_exit(1),e_unknowntype,strlen(fp->type),fp->type);
+ if(dp = (Namtype_t*)nv_hasdisc(tp,&type_disc))
+ {
+ nnodes += dp->numnodes;
+ if((i=dp->strsize) < 0)
+ i = -i;
+ size += i + dp->numnodes*m;
+ }
+ }
+ }
+ pp = newof(NiL,Namtype_t, 1, nnodes*NV_MINSZ + rsize + size);
+ pp->fun.dsize = sizeof(Namtype_t)+nnodes*NV_MINSZ +rsize;
+ pp->fun.type = mp;
+ pp->np = mp;
+ pp->childfun.fun.disc = &chtype_disc;
+ pp->childfun.fun.nofree = 1;
+ pp->childfun.ttype = pp;
+ pp->childfun.ptype = pp;
+ pp->fun.disc = &type_disc;
+ pp->nodes = (char*)(pp+1);
+ pp->numnodes = nnodes;
+ pp->strsize = size;
+ pp->data = pp->nodes + nnodes*NV_MINSZ;
+ cp = pp->data + rsize;
+ for(i=0,fp=fields; fp->name; fp++)
+ {
+ nq = nv_namptr(pp->nodes,i++);
+ nq->nvname = cp;
+ nq->nvalue.cp = pp->data + fp->offset;
+ nv_onattr(nq,NV_MINIMAL|NV_NOFREE);
+ m = strlen(fp->name)+1;
+ memcpy(cp, fp->name, m);
+ cp += m;
+ if(memcmp(fp->type,"typeset",7))
+ {
+ stakputs(fp->type);
+ stakputc(0);
+ tp = nv_open(stakptr(offset), sh.var_tree, NV_VARNAME);
+ stakseek(r);
+ clone_all_disc(tp,nq,NV_RDONLY);
+ nq->nvflag = tp->nvflag|NV_MINIMAL|NV_NOFREE;
+ nq->nvsize = tp->nvsize;
+ if(dp = (Namtype_t*)nv_hasdisc(nq,&type_disc))
+ dp->strsize = -dp->strsize;
+ if(dp = (Namtype_t*)nv_hasdisc(tp,&type_disc))
+ {
+ if(nv_hasdisc(nq,&chtype_disc))
+ nv_disc(nq, &pp->childfun.fun, NV_LAST);
+ sp = (char*)nq->nvalue.cp;
+ memcpy(sp, dp->data, nv_size(tp));
+ for(j=0; j < dp->numnodes; j++)
+ {
+ nr = nv_namptr(dp->nodes,j);
+ nq = nv_namptr(pp->nodes,i++);
+ nq->nvname = cp;
+ memcpy(cp,fp->name,m);
+ cp[m-1] = '.';
+ cp += m;
+ n = strlen(nr->nvname)+1;
+ memcpy(cp,nr->nvname,n);
+ cp += n;
+ if(nr->nvalue.cp>=dp->data && nr->nvalue.cp < (char*)pp + pp->fun.dsize)
+ {
+ nq->nvalue.cp = sp + (nr->nvalue.cp-dp->data);
+ }
+ nq->nvflag = nr->nvflag;
+ nq->nvsize = nr->nvsize;
+ }
+ }
+ }
+ else if(strmatch(fp->type+7,"*-*i*")==0)
+ {
+ nv_onattr(nq,NV_NOFREE|NV_RDONLY|NV_INTEGER);
+ if(strmatch(fp->type+7,"*-*s*")==0)
+ nv_onattr(nq,NV_INT16P);
+ else if(strmatch(fp->type+7,"*-*l*")==0)
+ nv_onattr(nq,NV_INT64);
+ if(strmatch(fp->type+7,"*-*u*")==0)
+ nv_onattr(nq,NV_UNSIGN);
+ }
+
+ }
+ stakseek(offset);
+ nv_onattr(mp,NV_RDONLY|NV_NOFREE|NV_BINARY);
+ nv_setsize(mp,rsize);
+ nv_disc(mp, &pp->fun, NV_LAST);
+ mp->nvalue.cp = pp->data;
+ addtype(mp);
+ return(mp);
+}
+
+static void put_stat(Namval_t* np, const char* val, int flag, Namfun_t* nfp)
+{
+ if(val)
+ {
+ if(stat(val,(struct stat*)np->nvalue.cp)<0)
+ sfprintf(sfstderr,"stat of %s failed\n",val);
+ return;
+ }
+ nv_putv(np,val,flag,nfp);
+ nv_disc(np,nfp,NV_POP);
+ if(!(nfp->nofree&1))
+ free((void*)nfp);
+}
+
+static const Namdisc_t stat_disc =
+{
+ 0,
+ put_stat
+};
+
+
+void nv_mkstat(void)
+{
+ Namval_t *tp;
+ Namfun_t *fp;
+ tp = nv_mkstruct("stat_t", sizeof(struct stat), foo);
+ nv_offattr(tp,NV_RDONLY);
+ nv_setvtree(tp);
+ fp = newof(NiL,Namfun_t,1,0);
+ fp->type = tp;
+ fp->disc = &stat_disc;
+ nv_disc(tp,fp,NV_FIRST);
+ nv_putval(tp,"/dev/null",0);
+ nv_onattr(tp,NV_RDONLY);
+}
diff --git a/usr/src/lib/libshell/common/sh/parse.c b/usr/src/lib/libshell/common/sh/parse.c
index 1cacd79e57..bccbd49d50 100644
--- a/usr/src/lib/libshell/common/sh/parse.c
+++ b/usr/src/lib/libshell/common/sh/parse.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -48,23 +48,23 @@
/* These routines are local to this module */
-static Shnode_t *makeparent(int, Shnode_t*);
-static Shnode_t *makelist(int, Shnode_t*, Shnode_t*);
+static Shnode_t *makeparent(Lex_t*, int, Shnode_t*);
+static Shnode_t *makelist(Lex_t*, int, Shnode_t*, Shnode_t*);
static struct argnod *qscan(struct comnod*, int);
-static struct ionod *inout(struct ionod*, int);
-static Shnode_t *sh_cmd(int,int);
-static Shnode_t *term(int);
-static Shnode_t *list(int);
-static struct regnod *syncase(int);
-static Shnode_t *item(int);
-static Shnode_t *simple(int, struct ionod*);
-static int skipnl(int);
-static Shnode_t *test_expr(int);
-static Shnode_t *test_and(void);
-static Shnode_t *test_or(void);
-static Shnode_t *test_primary(void);
+static struct ionod *inout(Lex_t*,struct ionod*, int);
+static Shnode_t *sh_cmd(Lex_t*,int,int);
+static Shnode_t *term(Lex_t*,int);
+static Shnode_t *list(Lex_t*,int);
+static struct regnod *syncase(Lex_t*,int);
+static Shnode_t *item(Lex_t*,int);
+static Shnode_t *simple(Lex_t*,int, struct ionod*);
+static int skipnl(Lex_t*,int);
+static Shnode_t *test_expr(Lex_t*,int);
+static Shnode_t *test_and(Lex_t*);
+static Shnode_t *test_or(Lex_t*);
+static Shnode_t *test_primary(Lex_t*);
-#define sh_getlineno() (shlex.lastline)
+#define sh_getlineno(lp) (lp->lastline)
#ifndef NIL
# define NIL(type) ((type)0)
@@ -80,6 +80,7 @@ static struct stdata
} st;
#endif
+static int opt_get;
static int loop_level;
static struct argnod *label_list;
static struct argnod *label_last;
@@ -92,7 +93,7 @@ static struct argnod *label_last;
* write out entities for each item in the list
* type=='V' for variable assignment lists
* Otherwise type is determined by the command */
-static unsigned long writedefs(struct argnod *arglist, int line, int type, struct argnod *cmd)
+static unsigned long writedefs(Lex_t *lexp,struct argnod *arglist, int line, int type, struct argnod *cmd)
{
register struct argnod *argp = arglist;
register char *cp;
@@ -102,10 +103,10 @@ static unsigned long writedefs(struct argnod *arglist, int line, int type, struc
static char atbuff[20];
int justify=0;
char *attribute = atbuff;
- unsigned long parent=shlex.script;
+ unsigned long parent=lexp->script;
if(type==0)
{
- parent = shlex.current;
+ parent = lexp->current;
type = 'v';
switch(*argp->argval)
{
@@ -140,7 +141,7 @@ static unsigned long writedefs(struct argnod *arglist, int line, int type, struc
}
}
else if(cmd)
- parent=kiaentity(sh_argstr(cmd),-1,'p',-1,-1,shlex.unknown,'b',0,"");
+ parent=kiaentity(lexp,sh_argstr(cmd),-1,'p',-1,-1,lexp->unknown,'b',0,"");
*attribute = 0;
while(argp)
{
@@ -148,32 +149,109 @@ static unsigned long writedefs(struct argnod *arglist, int line, int type, struc
n = cp-argp->argval;
else
n = strlen(argp->argval);
- eline = sh.inlineno-(shlex.token==NL);
- r=kiaentity(argp->argval,n,type,line,eline,parent,justify,width,atbuff);
- sfprintf(shlex.kiatmp,"p;%..64d;v;%..64d;%d;%d;s;\n",shlex.current,r,line,eline);
+ eline = lexp->sh->inlineno-(lexp->token==NL);
+ r=kiaentity(lexp,argp->argval,n,type,line,eline,parent,justify,width,atbuff);
+ sfprintf(lexp->kiatmp,"p;%..64d;v;%..64d;%d;%d;s;\n",lexp->current,r,line,eline);
argp = argp->argnxt.ap;
}
return(r);
}
#endif /* SHOPT_KIA */
+
+static void typeset_order(const char *str,int line)
+{
+ register int c,n=0;
+ unsigned const char *cp=(unsigned char*)str;
+ static unsigned char *table;
+ if(*cp!='+' && *cp!='-')
+ return;
+ if(!table)
+ {
+ table = calloc(1,256);
+ for(cp=(unsigned char*)"bflmnprstuxACHS";c = *cp; cp++)
+ table[c] = 1;
+ for(cp=(unsigned char*)"aiEFLRXhTZ";c = *cp; cp++)
+ table[c] = 2;
+ for(c='0'; c <='9'; c++)
+ table[c] = 3;
+ }
+ for(cp=(unsigned char*)str; c= *cp++; n=table[c])
+ {
+ if(table[c] < n)
+ errormsg(SH_DICT,ERROR_warn(0),e_lextypeset,line,str);
+ }
+}
+
+/*
+ * add type definitions when compiling with -n
+ */
+static void check_typedef(struct comnod *tp)
+{
+ char *cp=0;
+ if(tp->comtyp&COMSCAN)
+ {
+ struct argnod *ap = tp->comarg;
+ while(ap = ap->argnxt.ap)
+ {
+ if(!(ap->argflag&ARG_RAW) || memcmp(ap->argval,"--",2))
+ break;
+ if(sh_isoption(SH_NOEXEC))
+ typeset_order(ap->argval,tp->comline);
+ if(memcmp(ap->argval,"-T",2)==0)
+ {
+ if(ap->argval[2])
+ cp = ap->argval+2;
+ else if((ap->argnxt.ap)->argflag&ARG_RAW)
+ cp = (ap->argnxt.ap)->argval;
+ if(cp)
+ break;
+ }
+ }
+ }
+ else
+ {
+ struct dolnod *dp = (struct dolnod*)tp->comarg;
+ char **argv = dp->dolval + dp->dolbot+1;
+ while((cp= *argv++) && memcmp(cp,"--",2))
+ {
+ if(sh_isoption(SH_NOEXEC))
+ typeset_order(cp,tp->comline);
+ if(memcmp(cp,"-T",2)==0)
+ {
+ if(cp[2])
+ cp = cp+2;
+ else
+ cp = *argv;
+ break;
+ }
+ }
+ }
+ if(cp)
+ {
+ Namval_t *mp=(Namval_t*)tp->comnamp ,*bp;
+ bp = sh_addbuiltin(cp,mp->nvalue.bfp, (void*)0);
+ nv_onattr(bp,nv_isattr(mp,NV_PUBLIC));
+ }
+}
+
/*
* Make a parent node for fork() or io-redirection
*/
-static Shnode_t *makeparent(int flag, Shnode_t *child)
+static Shnode_t *makeparent(Lex_t *lp, int flag, Shnode_t *child)
{
register Shnode_t *par = getnode(forknod);
par->fork.forktyp = flag;
par->fork.forktre = child;
par->fork.forkio = 0;
- par->fork.forkline = sh_getlineno()-1;
+ par->fork.forkline = sh_getlineno(lp)-1;
return(par);
}
-static Shnode_t *getanode(struct argnod *ap)
+static Shnode_t *getanode(Lex_t *lp, struct argnod *ap)
{
register Shnode_t *t = getnode(arithnod);
t->ar.artyp = TARITH;
- t->ar.arline = sh_getlineno();
+ t->ar.arline = sh_getlineno(lp);
t->ar.arexpr = ap;
if(ap->argflag&ARG_RAW)
t->ar.arcomp = sh_arithcomp(ap->argval);
@@ -185,11 +263,11 @@ static Shnode_t *getanode(struct argnod *ap)
/*
* Make a node corresponding to a command list
*/
-static Shnode_t *makelist(int type, Shnode_t *l, Shnode_t *r)
+static Shnode_t *makelist(Lex_t *lexp, int type, Shnode_t *l, Shnode_t *r)
{
register Shnode_t *t;
if(!l || !r)
- sh_syntax();
+ sh_syntax(lexp);
else
{
if((type&COMMSK) == TTST)
@@ -211,16 +289,17 @@ static Shnode_t *makelist(int type, Shnode_t *l, Shnode_t *r)
void *sh_parse(Shell_t *shp, Sfio_t *iop, int flag)
{
register Shnode_t *t;
+ Lex_t *lexp = (Lex_t*)shp->lex_context;
Fcin_t sav_input;
- struct argnod *sav_arg = shlex.arg;
+ struct argnod *sav_arg = lexp->arg;
int sav_prompt = shp->nextprompt;
if(shp->binscript && sffileno(iop)==shp->infd)
- return((void*)sh_trestore(iop));
+ return((void*)sh_trestore(shp,iop));
fcsave(&sav_input);
shp->st.staklist = 0;
- shlex.heredoc = 0;
- shlex.inlineno = shp->inlineno;
- shlex.firstline = shp->st.firstline;
+ lexp->heredoc = 0;
+ lexp->inlineno = shp->inlineno;
+ lexp->firstline = shp->st.firstline;
shp->nextprompt = 1;
loop_level = 0;
label_list = label_last = 0;
@@ -228,7 +307,7 @@ void *sh_parse(Shell_t *shp, Sfio_t *iop, int flag)
sh_onstate(SH_INTERACTIVE);
if(sh_isoption(SH_VERBOSE))
sh_onstate(SH_VERBOSE);
- sh_lexopen((Lex_t*)shp->lex_context,shp,0);
+ sh_lexopen(lexp,shp,0);
if(fcfopen(iop) < 0)
return(NIL(void*));
if(fcfile())
@@ -241,13 +320,13 @@ void *sh_parse(Shell_t *shp, Sfio_t *iop, int flag)
fcgetc(version);
fcclose();
fcrestore(&sav_input);
- shlex.arg = sav_arg;
+ lexp->arg = sav_arg;
if(version > 3)
errormsg(SH_DICT,ERROR_exit(1),e_lexversion);
if(sffileno(iop)==shp->infd)
shp->binscript = 1;
sfgetc(iop);
- return((void*)sh_trestore(iop));
+ return((void*)sh_trestore(shp,iop));
}
}
if((flag&SH_NL) && (shp->inlineno=error_info.line+shp->st.firstline)==0)
@@ -255,10 +334,10 @@ void *sh_parse(Shell_t *shp, Sfio_t *iop, int flag)
#if KSHELL
shp->nextprompt = 2;
#endif
- t = sh_cmd((flag&SH_EOF)?EOFSYM:'\n',SH_SEMI|SH_EMPTY|(flag&SH_NL));
+ t = sh_cmd(lexp,(flag&SH_EOF)?EOFSYM:'\n',SH_SEMI|SH_EMPTY|(flag&SH_NL));
fcclose();
fcrestore(&sav_input);
- shlex.arg = sav_arg;
+ lexp->arg = sav_arg;
/* unstack any completed alias expansions */
if((sfset(iop,0,0)&SF_STRING) && !sfreserve(iop,0,-1))
{
@@ -269,10 +348,10 @@ void *sh_parse(Shell_t *shp, Sfio_t *iop, int flag)
shp->nextprompt = sav_prompt;
if(flag&SH_NL)
{
- shp->st.firstline = shlex.firstline;
- shp->inlineno = shlex.inlineno;
+ shp->st.firstline = lexp->firstline;
+ shp->inlineno = lexp->inlineno;
}
- stakseek(0);
+ stkseek(shp->stk,0);
return((void*)t);
}
@@ -280,26 +359,28 @@ void *sh_parse(Shell_t *shp, Sfio_t *iop, int flag)
* This routine parses up the matching right parenthesis and returns
* the parse tree
*/
-Shnode_t *sh_dolparen(void)
+Shnode_t *sh_dolparen(Lex_t* lp)
{
register Shnode_t *t=0;
- register Lex_t *lp = (Lex_t*)sh.lex_context;
Sfio_t *sp = fcfile();
- int line = sh.inlineno;
- sh.inlineno = error_info.line+sh.st.firstline;
- sh_lexopen(lp,&sh,1);
- shlex.comsub = 1;
- switch(sh_lex())
+ int line = lp->sh->inlineno;
+ lp->sh->inlineno = error_info.line+lp->sh->st.firstline;
+ sh_lexopen(lp,lp->sh,1);
+ lp->comsub = 1;
+ switch(sh_lex(lp))
{
/* ((...)) arithmetic expression */
case EXPRSYM:
- t = getanode(shlex.arg);
+ t = getanode(lp,lp->arg);
break;
case LPAREN:
- t = sh_cmd(RPAREN,SH_NL|SH_EMPTY);
+ t = sh_cmd(lp,RPAREN,SH_NL|SH_EMPTY);
+ break;
+ case LBRACE:
+ t = sh_cmd(lp,RBRACE,SH_NL|SH_EMPTY);
break;
}
- shlex.comsub = 0;
+ lp->comsub = 0;
if(!sp && (sp=fcfile()))
{
/*
@@ -315,7 +396,7 @@ Shnode_t *sh_dolparen(void)
fcsopen(cp);
sfclose(sp);
}
- sh.inlineno = line;
+ lp->sh->inlineno = line;
return(t);
}
@@ -323,11 +404,11 @@ Shnode_t *sh_dolparen(void)
* remove temporary files and stacks
*/
-void sh_freeup(void)
+void sh_freeup(Shell_t *shp)
{
- if(sh.st.staklist)
- sh_funstaks(sh.st.staklist,-1);
- sh.st.staklist = 0;
+ if(shp->st.staklist)
+ sh_funstaks(shp->st.staklist,-1);
+ shp->st.staklist = 0;
}
/*
@@ -358,21 +439,21 @@ void sh_funstaks(register struct slnod *slp,int flag)
* list [ ; cmd ]
*/
-static Shnode_t *sh_cmd(register int sym, int flag)
+static Shnode_t *sh_cmd(Lex_t *lexp, register int sym, int flag)
{
register Shnode_t *left, *right;
register int type = FINT|FAMP;
if(sym==NL)
- shlex.lasttok = 0;
- left = list(flag);
- if(shlex.token==NL)
+ lexp->lasttok = 0;
+ left = list(lexp,flag);
+ if(lexp->token==NL)
{
if(flag&SH_NL)
- shlex.token=';';
+ lexp->token=';';
}
else if(!left && !(flag&SH_EMPTY))
- sh_syntax();
- switch(shlex.token)
+ sh_syntax(lexp);
+ switch(lexp->token)
{
case COOPSYM: /* set up a cooperating process */
type |= (FPIN|FPOU|FPCL|FCOOP);
@@ -383,23 +464,23 @@ static Shnode_t *sh_cmd(register int sym, int flag)
/* (...)& -> {...;} & */
if(left->tre.tretyp==TPAR)
left = left->par.partre;
- left = makeparent(TFORK|type, left);
+ left = makeparent(lexp,TFORK|type, left);
}
/* FALL THRU */
case ';':
if(!left)
- sh_syntax();
- if(right=sh_cmd(sym,flag|SH_EMPTY))
- left=makelist(TLST, left, right);
+ sh_syntax(lexp);
+ if(right=sh_cmd(lexp,sym,flag|SH_EMPTY))
+ left=makelist(lexp,TLST, left, right);
break;
case EOFSYM:
if(sym==NL)
break;
default:
- if(sym && sym!=shlex.token)
+ if(sym && sym!=lexp->token)
{
- if(sym!=ELSESYM || (shlex.token!=ELIFSYM && shlex.token!=FISYM))
- sh_syntax();
+ if(sym!=ELSESYM || (lexp->token!=ELIFSYM && lexp->token!=FISYM))
+ sh_syntax(lexp);
}
}
return(left);
@@ -412,12 +493,12 @@ static Shnode_t *sh_cmd(register int sym, int flag)
* list || term
* unfortunately, these are equal precedence
*/
-static Shnode_t *list(register int flag)
+static Shnode_t *list(Lex_t *lexp, register int flag)
{
- register Shnode_t *t = term(flag);
+ register Shnode_t *t = term(lexp,flag);
register int token;
- while(t && ((token=shlex.token)==ANDFSYM || token==ORFSYM))
- t = makelist((token==ANDFSYM?TAND:TORF), t, term(SH_NL|SH_SEMI));
+ while(t && ((token=lexp->token)==ANDFSYM || token==ORFSYM))
+ t = makelist(lexp,(token==ANDFSYM?TAND:TORF), t, term(lexp,SH_NL|SH_SEMI));
return(t);
}
@@ -426,29 +507,29 @@ static Shnode_t *list(register int flag)
* item
* item | term
*/
-static Shnode_t *term(register int flag)
+static Shnode_t *term(Lex_t *lexp,register int flag)
{
register Shnode_t *t;
register int token;
if(flag&SH_NL)
- token = skipnl(flag);
+ token = skipnl(lexp,flag);
else
- token = sh_lex();
+ token = sh_lex(lexp);
/* check to see if pipeline is to be timed */
if(token==TIMESYM || token==NOTSYM)
{
t = getnode(parnod);
t->par.partyp=TTIME;
- if(shlex.token==NOTSYM)
+ if(lexp->token==NOTSYM)
t->par.partyp |= COMSCAN;
- t->par.partre = term(0);
+ t->par.partre = term(lexp,0);
}
- else if((t=item(SH_NL|SH_EMPTY|(flag&SH_SEMI))) && shlex.token=='|')
+ else if((t=item(lexp,SH_NL|SH_EMPTY|(flag&SH_SEMI))) && lexp->token=='|')
{
register Shnode_t *tt;
int showme = t->tre.tretyp&FSHOWME;
- t = makeparent(TFORK|FPOU,t);
- if(tt=term(SH_NL))
+ t = makeparent(lexp,TFORK|FPOU,t);
+ if(tt=term(lexp,SH_NL))
{
switch(tt->tre.tretyp&COMMSK)
{
@@ -459,13 +540,13 @@ static Shnode_t *term(register int flag)
tt->lst.lstlef->tre.tretyp |= FPIN|FPCL;
break;
default:
- tt= makeparent(TSETIO|FPIN|FPCL,tt);
+ tt= makeparent(lexp,TSETIO|FPIN|FPCL,tt);
}
- t=makelist(TFIL,t,tt);
+ t=makelist(lexp,TFIL,t,tt);
t->tre.tretyp |= showme;
}
- else if(shlex.token)
- sh_syntax();
+ else if(lexp->token)
+ sh_syntax(lexp);
}
return(t);
}
@@ -473,9 +554,9 @@ static Shnode_t *term(register int flag)
/*
* case statement
*/
-static struct regnod* syncase(register int esym)
+static struct regnod* syncase(Lex_t *lexp,register int esym)
{
- register int tok = skipnl(0);
+ register int tok = skipnl(lexp,0);
register struct regnod *r;
if(tok==esym)
return(NIL(struct regnod*));
@@ -483,35 +564,35 @@ static struct regnod* syncase(register int esym)
r->regptr=0;
r->regflag=0;
if(tok==LPAREN)
- skipnl(0);
+ skipnl(lexp,0);
while(1)
{
- if(!shlex.arg)
- sh_syntax();
- shlex.arg->argnxt.ap=r->regptr;
- r->regptr = shlex.arg;
- if((tok=sh_lex())==RPAREN)
+ if(!lexp->arg)
+ sh_syntax(lexp);
+ lexp->arg->argnxt.ap=r->regptr;
+ r->regptr = lexp->arg;
+ if((tok=sh_lex(lexp))==RPAREN)
break;
else if(tok=='|')
- sh_lex();
+ sh_lex(lexp);
else
- sh_syntax();
+ sh_syntax(lexp);
}
- r->regcom=sh_cmd(0,SH_NL|SH_EMPTY|SH_SEMI);
- if((tok=shlex.token)==BREAKCASESYM)
- r->regnxt=syncase(esym);
+ r->regcom=sh_cmd(lexp,0,SH_NL|SH_EMPTY|SH_SEMI);
+ if((tok=lexp->token)==BREAKCASESYM)
+ r->regnxt=syncase(lexp,esym);
else if(tok==FALLTHRUSYM)
{
r->regflag++;
- r->regnxt=syncase(esym);
+ r->regnxt=syncase(lexp,esym);
}
else
{
if(tok!=esym && tok!=EOFSYM)
- sh_syntax();
+ sh_syntax(lexp);
r->regnxt=0;
}
- if(shlex.token==EOFSYM)
+ if(lexp->token==EOFSYM)
return(NIL(struct regnod*));
return(r);
}
@@ -523,46 +604,47 @@ static struct regnod* syncase(register int esym)
* Otherise a list containing an arithmetic command and a while
* is returned.
*/
-static Shnode_t *arithfor(register Shnode_t *tf)
+static Shnode_t *arithfor(Lex_t *lexp,register Shnode_t *tf)
{
register Shnode_t *t, *tw = tf;
register int offset;
register struct argnod *argp;
register int n;
- int argflag = shlex.arg->argflag;
+ Stk_t *stkp = lexp->sh->stk;
+ int argflag = lexp->arg->argflag;
/* save current input */
Fcin_t sav_input;
fcsave(&sav_input);
- fcsopen(shlex.arg->argval);
+ fcsopen(lexp->arg->argval);
/* split ((...)) into three expressions */
for(n=0; ; n++)
{
register int c;
- argp = (struct argnod*)stakseek(ARGVAL);
+ argp = (struct argnod*)stkseek(stkp,ARGVAL);
argp->argnxt.ap = 0;
argp->argchn.cp = 0;
argp->argflag = argflag;
if(n==2)
break;
/* copy up to ; onto the stack */
- sh_lexskip(';',1,ST_NESTED);
- offset = staktell()-1;
+ sh_lexskip(lexp,';',1,ST_NESTED);
+ offset = stktell(stkp)-1;
if((c=fcpeek(-1))!=';')
break;
/* remove trailing white space */
- while(offset>ARGVAL && ((c= *stakptr(offset-1)),isspace(c)))
+ while(offset>ARGVAL && ((c= *stkptr(stkp,offset-1)),isspace(c)))
offset--;
/* check for empty initialization expression */
if(offset==ARGVAL && n==0)
continue;
- stakseek(offset);
+ stkseek(stkp,offset);
/* check for empty condition and treat as while((1)) */
if(offset==ARGVAL)
- stakputc('1');
- argp = (struct argnod*)stakfreeze(1);
- t = getanode(argp);
+ sfputc(stkp,'1');
+ argp = (struct argnod*)stkfreeze(stkp,1);
+ t = getanode(lexp,argp);
if(n==0)
- tf = makelist(TLST,t,tw);
+ tf = makelist(lexp,TLST,t,tw);
else
tw->wh.whtre = t;
}
@@ -573,53 +655,58 @@ static Shnode_t *arithfor(register Shnode_t *tf)
fcrestore(&sav_input);
if(n<2)
{
- shlex.token = RPAREN|SYMREP;
- sh_syntax();
+ lexp->token = RPAREN|SYMREP;
+ sh_syntax(lexp);
}
/* check whether the increment is present */
if(*argp->argval)
{
- t = getanode(argp);
+ t = getanode(lexp,argp);
tw->wh.whinc = (struct arithnod*)t;
}
else
tw->wh.whinc = 0;
- sh_lexopen((Lex_t*)sh.lex_context, &sh,1);
- if((n=sh_lex())==NL)
- n = skipnl(0);
+ sh_lexopen(lexp, lexp->sh,1);
+ if((n=sh_lex(lexp))==NL)
+ n = skipnl(lexp,0);
else if(n==';')
- n = sh_lex();
+ n = sh_lex(lexp);
if(n!=DOSYM && n!=LBRACE)
- sh_syntax();
- tw->wh.dotre = sh_cmd(n==DOSYM?DONESYM:RBRACE,SH_NL);
+ sh_syntax(lexp);
+ tw->wh.dotre = sh_cmd(lexp,n==DOSYM?DONESYM:RBRACE,SH_NL);
tw->wh.whtyp = TWH;
return(tf);
}
-static Shnode_t *funct(void)
+static Shnode_t *funct(Lex_t *lexp)
{
+ Shell_t *shp = lexp->sh;
register Shnode_t *t;
register int flag;
struct slnod *volatile slp=0;
Stak_t *savstak;
Sfoff_t first, last;
- struct functnod *fp;
+ struct functnod *volatile fp;
Sfio_t *iop;
#if SHOPT_KIA
- unsigned long current = shlex.current;
+ unsigned long current = lexp->current;
#endif /* SHOPT_KIA */
int jmpval, saveloop=loop_level;
struct argnod *savelabel = label_last;
struct checkpt buff;
+ int save_optget = opt_get;
+ void *in_mktype = shp->mktype;
+ shp->mktype = 0;
+ opt_get = 0;
t = getnode(functnod);
- t->funct.functline = sh.inlineno;
+ t->funct.functline = shp->inlineno;
t->funct.functtyp=TFUN;
t->funct.functargs = 0;
- if(!(flag = (shlex.token==FUNCTSYM)))
+ if(!(flag = (lexp->token==FUNCTSYM)))
t->funct.functtyp |= FPOSIX;
- else if(sh_lex())
- sh_syntax();
+ else if(sh_lex(lexp))
+ sh_syntax(lexp);
if(!(iop=fcfile()))
{
iop = sfopen(NIL(Sfio_t*),fcseek(0),"s");
@@ -627,53 +714,53 @@ static Shnode_t *funct(void)
fcfopen(iop);
}
t->funct.functloc = first = fctell();
- if(!sh.st.filename || sffileno(iop)<0)
+ if(!shp->st.filename || sffileno(iop)<0)
{
if(fcfill() >= 0)
fcseek(-1);
if(sh_isstate(SH_HISTORY))
- t->funct.functloc = sfseek(sh.hist_ptr->histfp,(off_t)0,SEEK_CUR);
+ t->funct.functloc = sfseek(shp->hist_ptr->histfp,(off_t)0,SEEK_CUR);
else
{
/* copy source to temporary file */
t->funct.functloc = 0;
- if(shlex.sh->heredocs)
- t->funct.functloc = sfseek(shlex.sh->heredocs,(Sfoff_t)0, SEEK_END);
+ if(lexp->sh->heredocs)
+ t->funct.functloc = sfseek(lexp->sh->heredocs,(Sfoff_t)0, SEEK_END);
else
- shlex.sh->heredocs = sftmp(HERE_MEM);
- shlex.sh->funlog = shlex.sh->heredocs;
+ lexp->sh->heredocs = sftmp(HERE_MEM);
+ lexp->sh->funlog = lexp->sh->heredocs;
t->funct.functtyp |= FPIN;
}
}
- t->funct.functnam= (char*)shlex.arg->argval;
+ t->funct.functnam= (char*)lexp->arg->argval;
#if SHOPT_KIA
- if(shlex.kiafile)
- shlex.current = kiaentity(t->funct.functnam,-1,'p',-1,-1,shlex.script,'p',0,"");
+ if(lexp->kiafile)
+ lexp->current = kiaentity(lexp,t->funct.functnam,-1,'p',-1,-1,lexp->script,'p',0,"");
#endif /* SHOPT_KIA */
if(flag)
{
- shlex.token = sh_lex();
+ lexp->token = sh_lex(lexp);
#if SHOPT_BASH
- if(shlex.token == LPAREN)
+ if(lexp->token == LPAREN)
{
- if((shlex.token = sh_lex()) == RPAREN)
+ if((lexp->token = sh_lex(lexp)) == RPAREN)
t->funct.functtyp |= FPOSIX;
else
- sh_syntax();
+ sh_syntax(lexp);
}
#endif
}
if(t->funct.functtyp&FPOSIX)
- skipnl(0);
+ skipnl(lexp,0);
else
{
- if(shlex.token==0)
- t->funct.functargs = (struct comnod*)simple(SH_NOIO|SH_FUNDEF,NIL(struct ionod*));
- while(shlex.token==NL)
- shlex.token = sh_lex();
+ if(lexp->token==0)
+ t->funct.functargs = (struct comnod*)simple(lexp,SH_NOIO|SH_FUNDEF,NIL(struct ionod*));
+ while(lexp->token==NL)
+ lexp->token = sh_lex(lexp);
}
- if((flag && shlex.token!=LBRACE) || shlex.token==EOFSYM)
- sh_syntax();
+ if((flag && lexp->token!=LBRACE) || lexp->token==EOFSYM)
+ sh_syntax(lexp);
sh_pushcontext(&buff,1);
jmpval = sigsetjmp(buff.buff,0);
if(jmpval == 0)
@@ -683,8 +770,8 @@ static Shnode_t *funct(void)
savstak = stakinstall(savstak, 0);
slp = (struct slnod*)stakalloc(sizeof(struct slnod)+sizeof(struct functnod));
slp->slchild = 0;
- slp->slnext = sh.st.staklist;
- sh.st.staklist = 0;
+ slp->slnext = shp->st.staklist;
+ shp->st.staklist = 0;
t->funct.functstak = (struct slnod*)slp;
/*
* store the pathname of function definition file on stack
@@ -694,20 +781,20 @@ static Shnode_t *funct(void)
fp->functtyp = TFUN|FAMP;
fp->functnam = 0;
fp->functline = t->funct.functline;
- if(sh.st.filename)
- fp->functnam = stakcopy(sh.st.filename);
+ if(shp->st.filename)
+ fp->functnam = stakcopy(shp->st.filename);
loop_level = 0;
label_last = label_list;
- if(!flag && shlex.token==0)
+ if(!flag && lexp->token==0)
{
/* copy current word token to current stak frame */
struct argnod *ap;
- flag = ARGVAL + strlen(shlex.arg->argval);
+ flag = ARGVAL + strlen(lexp->arg->argval);
ap = (struct argnod*)stakalloc(flag);
- memcpy(ap,shlex.arg,flag);
- shlex.arg = ap;
+ memcpy(ap,lexp->arg,flag);
+ lexp->arg = ap;
}
- t->funct.functtre = item(SH_NOIO);
+ t->funct.functtre = item(lexp,SH_NOIO);
}
sh_popcontext(&buff);
loop_level = saveloop;
@@ -716,50 +803,54 @@ static Shnode_t *funct(void)
if(slp)
{
slp->slptr = stakinstall(savstak,0);
- slp->slchild = sh.st.staklist;
+ slp->slchild = shp->st.staklist;
}
#if SHOPT_KIA
- shlex.current = current;
+ lexp->current = current;
#endif /* SHOPT_KIA */
if(jmpval)
{
if(slp && slp->slptr)
{
- sh.st.staklist = slp->slnext;
+ shp->st.staklist = slp->slnext;
stakdelete(slp->slptr);
}
- siglongjmp(*sh.jmplist,jmpval);
+ siglongjmp(*shp->jmplist,jmpval);
}
- sh.st.staklist = (struct slnod*)slp;
+ shp->st.staklist = (struct slnod*)slp;
last = fctell();
fp->functline = (last-first);
fp->functtre = t;
- if(shlex.sh->funlog)
+ shp->mktype = in_mktype;
+ if(lexp->sh->funlog)
{
if(fcfill()>0)
fcseek(-1);
- shlex.sh->funlog = 0;
+ lexp->sh->funlog = 0;
}
#if SHOPT_KIA
- if(shlex.kiafile)
- kiaentity(t->funct.functnam,-1,'p',t->funct.functline,sh.inlineno-1,shlex.current,'p',0,"");
+ if(lexp->kiafile)
+ kiaentity(lexp,t->funct.functnam,-1,'p',t->funct.functline,shp->inlineno-1,lexp->current,'p',0,"");
#endif /* SHOPT_KIA */
+ t->funct.functtyp |= opt_get;
+ opt_get = save_optget;
return(t);
}
/*
* Compound assignment
*/
-static struct argnod *assign(register struct argnod *ap)
+static struct argnod *assign(Lex_t *lexp, register struct argnod *ap, int tdef)
{
register int n;
register Shnode_t *t, **tp;
register struct comnod *ac;
+ Stk_t *stkp = lexp->sh->stk;
int array=0;
Namval_t *np;
n = strlen(ap->argval)-1;
if(ap->argval[n]!='=')
- sh_syntax();
+ sh_syntax(lexp);
if(ap->argval[n-1]=='+')
{
ap->argval[n--]=0;
@@ -774,81 +865,110 @@ static struct argnod *assign(register struct argnod *ap)
*ap->argval=0;
t = getnode(fornod);
t->for_.fornam = (char*)(ap->argval+1);
- t->for_.fortyp = sh_getlineno();
+ t->for_.fortyp = sh_getlineno(lexp);
tp = &t->for_.fortre;
ap->argchn.ap = (struct argnod*)t;
ap->argflag &= ARG_QUOTED;
ap->argflag |= array;
- shlex.assignok = SH_ASSIGN;
+ lexp->assignok = SH_ASSIGN;
+ lexp->aliasok = 1;
array=0;
- if((n=skipnl(0))==RPAREN || n==LPAREN)
+ if((n=skipnl(lexp,0))==RPAREN || n==LPAREN)
{
int index= 0;
struct argnod **settail;
ac = (struct comnod*)getnode(comnod);
settail= &ac->comset;
memset((void*)ac,0,sizeof(*ac));
- ac->comline = sh_getlineno();
+ ac->comline = sh_getlineno(lexp);
while(n==LPAREN)
{
struct argnod *ap;
- ap = (struct argnod*)stakseek(ARGVAL);
+ ap = (struct argnod*)stkseek(stkp,ARGVAL);
ap->argflag= ARG_ASSIGN;
- sfprintf(stkstd,"[%d]=",index++);
- ap = (struct argnod*)stakfreeze(1);
+ sfprintf(stkp,"[%d]=",index++);
+ ap = (struct argnod*)stkfreeze(stkp,1);
ap->argnxt.ap = 0;
- ap = assign(ap);
+ ap = assign(lexp,ap,0);
ap->argflag |= ARG_MESSAGE;
*settail = ap;
settail = &(ap->argnxt.ap);
- n = skipnl(0);
+ while((n = skipnl(lexp,0))==0)
+ {
+ ap = (struct argnod*)stkseek(stkp,ARGVAL);
+ ap->argflag= ARG_ASSIGN;
+ sfprintf(stkp,"[%d]=",index++);
+ stakputs(lexp->arg->argval);
+ ap = (struct argnod*)stkfreeze(stkp,1);
+ ap->argnxt.ap = 0;
+ ap->argflag = lexp->arg->argflag;
+ *settail = ap;
+ settail = &(ap->argnxt.ap);
+ }
}
}
- else if(n)
- sh_syntax();
- else if(!(shlex.arg->argflag&ARG_ASSIGN) && !((np=nv_search(shlex.arg->argval,sh.fun_tree,0)) && nv_isattr(np,BLT_DCL)))
+ else if(n && n!=FUNCTSYM)
+ sh_syntax(lexp);
+ else if(n!=FUNCTSYM && !(lexp->arg->argflag&ARG_ASSIGN) && !((np=nv_search(lexp->arg->argval,lexp->sh->fun_tree,0)) && (nv_isattr(np,BLT_DCL)|| np==SYSDOT)))
+ {
array=SH_ARRAY;
+ if(fcgetc(n)==LPAREN)
+ {
+ int c;
+ if(fcgetc(c)==RPAREN)
+ {
+ lexp->token = SYMRES;
+ array = 0;
+ }
+ else
+ fcseek(-2);
+ }
+ else if(n>0)
+ fcseek(-1);
+ if(array && tdef)
+ sh_syntax(lexp);
+ }
while(1)
{
- if((n=shlex.token)==RPAREN)
+ if((n=lexp->token)==RPAREN)
break;
if(n==FUNCTSYM || n==SYMRES)
- ac = (struct comnod*)funct();
+ ac = (struct comnod*)funct(lexp);
else
- ac = (struct comnod*)simple(SH_NOIO|SH_ASSIGN|array,NIL(struct ionod*));
- if((n=shlex.token)==RPAREN)
+ ac = (struct comnod*)simple(lexp,SH_NOIO|SH_ASSIGN|array,NIL(struct ionod*));
+ if((n=lexp->token)==RPAREN)
break;
if(n!=NL && n!=';')
- sh_syntax();
- shlex.assignok = SH_ASSIGN;
- if((n=skipnl(0)) || array)
+ sh_syntax(lexp);
+ lexp->assignok = SH_ASSIGN;
+ if((n=skipnl(lexp,0)) || array)
{
if(n==RPAREN)
break;
if(array || n!=FUNCTSYM)
- sh_syntax();
+ sh_syntax(lexp);
}
- if((n!=FUNCTSYM) && !(shlex.arg->argflag&ARG_ASSIGN) && !((np=nv_search(shlex.arg->argval,sh.fun_tree,0)) && nv_isattr(np,BLT_DCL)))
+ if((n!=FUNCTSYM) && !(lexp->arg->argflag&ARG_ASSIGN) && !((np=nv_search(lexp->arg->argval,lexp->sh->fun_tree,0)) && (nv_isattr(np,BLT_DCL)||np==SYSDOT)))
{
- struct argnod *arg = shlex.arg;
+ struct argnod *arg = lexp->arg;
if(n!=0)
- sh_syntax();
+ sh_syntax(lexp);
/* check for sys5 style function */
- if(sh_lex()!=LPAREN || sh_lex()!=RPAREN)
+ if(sh_lex(lexp)!=LPAREN || sh_lex(lexp)!=RPAREN)
{
- shlex.arg = arg;
- shlex.token = 0;
- sh_syntax();
+ lexp->arg = arg;
+ lexp->token = 0;
+ sh_syntax(lexp);
}
- shlex.arg = arg;
- shlex.token = SYMRES;
+ lexp->arg = arg;
+ lexp->token = SYMRES;
}
- t = makelist(TLST,(Shnode_t*)ac,t);
+ t = makelist(lexp,TLST,(Shnode_t*)ac,t);
*tp = t;
tp = &t->lst.lstrit;
}
*tp = (Shnode_t*)ac;
- shlex.assignok = 0;
+ lexp->assignok = 0;
return(ap);
}
@@ -863,56 +983,56 @@ static struct argnod *assign(register struct argnod *ap)
* begin ... end
*/
-static Shnode_t *item(int flag)
+static Shnode_t *item(Lex_t *lexp,int flag)
{
register Shnode_t *t;
register struct ionod *io;
- register int tok = (shlex.token&0xff);
- int savwdval = shlex.lasttok;
- int savline = shlex.lastline;
- int showme=0;
- if(!(flag&SH_NOIO) && (tok=='<' || tok=='>'))
- io=inout(NIL(struct ionod*),1);
+ register int tok = (lexp->token&0xff);
+ int savwdval = lexp->lasttok;
+ int savline = lexp->lastline;
+ int showme=0, comsub;
+ if(!(flag&SH_NOIO) && (tok=='<' || tok=='>' || lexp->token==IOVNAME))
+ io=inout(lexp,NIL(struct ionod*),1);
else
io=0;
- if((tok=shlex.token) && tok!=EOFSYM && tok!=FUNCTSYM)
+ if((tok=lexp->token) && tok!=EOFSYM && tok!=FUNCTSYM)
{
- shlex.lastline = sh_getlineno();
- shlex.lasttok = shlex.token;
+ lexp->lastline = sh_getlineno(lexp);
+ lexp->lasttok = lexp->token;
}
switch(tok)
{
/* [[ ... ]] test expression */
case BTESTSYM:
- t = test_expr(ETESTSYM);
+ t = test_expr(lexp,ETESTSYM);
t->tre.tretyp &= ~TTEST;
break;
/* ((...)) arithmetic expression */
case EXPRSYM:
- t = getanode(shlex.arg);
- sh_lex();
+ t = getanode(lexp,lexp->arg);
+ sh_lex(lexp);
goto done;
/* case statement */
case CASESYM:
{
- int savetok = shlex.lasttok;
- int saveline = shlex.lastline;
+ int savetok = lexp->lasttok;
+ int saveline = lexp->lastline;
t = getnode(swnod);
- if(sh_lex())
- sh_syntax();
- t->sw.swarg=shlex.arg;
+ if(sh_lex(lexp))
+ sh_syntax(lexp);
+ t->sw.swarg=lexp->arg;
t->sw.swtyp=TSW;
t->sw.swio = 0;
t->sw.swtyp |= FLINENO;
- t->sw.swline = sh.inlineno;
- if((tok=skipnl(0))!=INSYM && tok!=LBRACE)
- sh_syntax();
- if(!(t->sw.swlst=syncase(tok==INSYM?ESACSYM:RBRACE)) && shlex.token==EOFSYM)
+ t->sw.swline = lexp->sh->inlineno;
+ if((tok=skipnl(lexp,0))!=INSYM && tok!=LBRACE)
+ sh_syntax(lexp);
+ if(!(t->sw.swlst=syncase(lexp,tok==INSYM?ESACSYM:RBRACE)) && lexp->token==EOFSYM)
{
- shlex.lasttok = savetok;
- shlex.lastline = saveline;
- sh_syntax();
+ lexp->lasttok = savetok;
+ lexp->lastline = saveline;
+ sh_syntax(lexp);
}
break;
}
@@ -923,11 +1043,11 @@ static Shnode_t *item(int flag)
register Shnode_t *tt;
t = getnode(ifnod);
t->if_.iftyp=TIF;
- t->if_.iftre=sh_cmd(THENSYM,SH_NL);
- t->if_.thtre=sh_cmd(ELSESYM,SH_NL|SH_SEMI);
- tok = shlex.token;
- t->if_.eltre=(tok==ELSESYM?sh_cmd(FISYM,SH_NL|SH_SEMI):
- (tok==ELIFSYM?(shlex.token=IFSYM, tt=item(SH_NOIO)):0));
+ t->if_.iftre=sh_cmd(lexp,THENSYM,SH_NL);
+ t->if_.thtre=sh_cmd(lexp,ELSESYM,SH_NL|SH_SEMI);
+ tok = lexp->token;
+ t->if_.eltre=(tok==ELSESYM?sh_cmd(lexp,FISYM,SH_NL|SH_SEMI):
+ (tok==ELIFSYM?(lexp->token=IFSYM, tt=item(lexp,SH_NOIO)):0));
if(tok==ELIFSYM)
{
if(!tt || tt->tre.tretyp!=TSETIO)
@@ -945,33 +1065,33 @@ static Shnode_t *item(int flag)
case SELECTSYM:
{
t = getnode(fornod);
- t->for_.fortyp=(shlex.token==FORSYM?TFOR:TSELECT);
+ t->for_.fortyp=(lexp->token==FORSYM?TFOR:TSELECT);
t->for_.forlst=0;
- t->for_.forline = sh.inlineno;
- if(sh_lex())
+ t->for_.forline = lexp->sh->inlineno;
+ if(sh_lex(lexp))
{
- if(shlex.token!=EXPRSYM || t->for_.fortyp!=TFOR)
- sh_syntax();
+ if(lexp->token!=EXPRSYM || t->for_.fortyp!=TFOR)
+ sh_syntax(lexp);
/* arithmetic for */
- t = arithfor(t);
+ t = arithfor(lexp,t);
break;
}
- t->for_.fornam=(char*) shlex.arg->argval;
+ t->for_.fornam=(char*) lexp->arg->argval;
t->for_.fortyp |= FLINENO;
#if SHOPT_KIA
- if(shlex.kiafile)
- writedefs(shlex.arg,sh.inlineno,'v',NIL(struct argnod*));
+ if(lexp->kiafile)
+ writedefs(lexp,lexp->arg,lexp->sh->inlineno,'v',NIL(struct argnod*));
#endif /* SHOPT_KIA */
- while((tok=sh_lex())==NL);
+ while((tok=sh_lex(lexp))==NL);
if(tok==INSYM)
{
- if(sh_lex())
+ if(sh_lex(lexp))
{
- if(shlex.token != NL && shlex.token !=';')
- sh_syntax();
+ if(lexp->token != NL && lexp->token !=';')
+ sh_syntax(lexp);
/* some Linux scripts assume this */
if(sh_isoption(SH_NOEXEC))
- errormsg(SH_DICT,ERROR_warn(0),e_lexemptyfor,sh.inlineno-(shlex.token=='\n'));
+ errormsg(SH_DICT,ERROR_warn(0),e_lexemptyfor,lexp->sh->inlineno-(lexp->token=='\n'));
t->for_.forlst = (struct comnod*)getnode(comnod);
(t->for_.forlst)->comarg = 0;
(t->for_.forlst)->comset = 0;
@@ -982,18 +1102,18 @@ static Shnode_t *item(int flag)
(t->for_.forlst)->comtyp = 0;
}
else
- t->for_.forlst=(struct comnod*)simple(SH_NOIO,NIL(struct ionod*));
- if(shlex.token != NL && shlex.token !=';')
- sh_syntax();
- tok = skipnl(0);
+ t->for_.forlst=(struct comnod*)simple(lexp,SH_NOIO,NIL(struct ionod*));
+ if(lexp->token != NL && lexp->token !=';')
+ sh_syntax(lexp);
+ tok = skipnl(lexp,0);
}
/* 'for i;do cmd' is valid syntax */
else if(tok==';')
- tok=sh_lex();
+ tok=sh_lex(lexp);
if(tok!=DOSYM && tok!=LBRACE)
- sh_syntax();
+ sh_syntax(lexp);
loop_level++;
- t->for_.fortre=sh_cmd(tok==DOSYM?DONESYM:RBRACE,SH_NL|SH_SEMI);
+ t->for_.fortre=sh_cmd(lexp,tok==DOSYM?DONESYM:RBRACE,SH_NL|SH_SEMI);
if(--loop_level==0)
label_last = label_list;
break;
@@ -1001,20 +1121,20 @@ static Shnode_t *item(int flag)
/* This is the code for parsing function definitions */
case FUNCTSYM:
- return(funct());
+ return(funct(lexp));
#if SHOPT_NAMESPACE
case NSPACESYM:
t = getnode(fornod);
t->for_.fortyp=TNSPACE;
t->for_.forlst=0;
- if(sh_lex())
- sh_syntax();
- t->for_.fornam=(char*) shlex.arg->argval;
- while((tok=sh_lex())==NL);
+ if(sh_lex(lexp))
+ sh_syntax(lexp);
+ t->for_.fornam=(char*) lexp->arg->argval;
+ while((tok=sh_lex(lexp))==NL);
if(tok!=LBRACE)
- sh_syntax();
- t->for_.fortre = sh_cmd(RBRACE,SH_NL);
+ sh_syntax(lexp);
+ t->for_.fortre = sh_cmd(lexp,RBRACE,SH_NL);
break;
#endif /* SHOPT_NAMESPACE */
@@ -1022,10 +1142,10 @@ static Shnode_t *item(int flag)
case WHILESYM:
case UNTILSYM:
t = getnode(whnod);
- t->wh.whtyp=(shlex.token==WHILESYM ? TWH : TUN);
+ t->wh.whtyp=(lexp->token==WHILESYM ? TWH : TUN);
loop_level++;
- t->wh.whtre = sh_cmd(DOSYM,SH_NL);
- t->wh.dotre = sh_cmd(DONESYM,SH_NL|SH_SEMI);
+ t->wh.whtre = sh_cmd(lexp,DOSYM,SH_NL);
+ t->wh.dotre = sh_cmd(lexp,DONESYM,SH_NL|SH_SEMI);
if(--loop_level==0)
label_last = label_list;
t->wh.whinc = 0;
@@ -1036,17 +1156,17 @@ static Shnode_t *item(int flag)
register struct argnod *argp = label_list;
while(argp)
{
- if(strcmp(argp->argval,shlex.arg->argval)==0)
- errormsg(SH_DICT,ERROR_exit(3),e_lexsyntax3,sh.inlineno,argp->argval);
+ if(strcmp(argp->argval,lexp->arg->argval)==0)
+ errormsg(SH_DICT,ERROR_exit(3),e_lexsyntax3,lexp->sh->inlineno,argp->argval);
argp = argp->argnxt.ap;
}
- shlex.arg->argnxt.ap = label_list;
- label_list = shlex.arg;
- label_list->argchn.len = sh_getlineno();
+ lexp->arg->argnxt.ap = label_list;
+ label_list = lexp->arg;
+ label_list->argchn.len = sh_getlineno(lexp);
label_list->argflag = loop_level;
- skipnl(flag);
- if(!(t = item(SH_NL)))
- sh_syntax();
+ skipnl(lexp,flag);
+ if(!(t = item(lexp,SH_NL)))
+ sh_syntax(lexp);
tok = (t->tre.tretyp&(COMSCAN|COMSCAN-1));
if(sh_isoption(SH_NOEXEC) && tok!=TWH && tok!=TUN && tok!=TFOR && tok!=TSELECT)
errormsg(SH_DICT,ERROR_warn(0),e_lexlabignore,label_list->argchn.len,label_list->argval);
@@ -1055,12 +1175,15 @@ static Shnode_t *item(int flag)
/* command group with {...} */
case LBRACE:
- t = sh_cmd(RBRACE,SH_NL);
+ comsub = lexp->comsub;
+ lexp->comsub = 0;
+ t = sh_cmd(lexp,RBRACE,SH_NL);
+ lexp->comsub = comsub;
break;
case LPAREN:
t = getnode(parnod);
- t->par.partre=sh_cmd(RPAREN,SH_NL);
+ t->par.partre=sh_cmd(lexp,RPAREN,SH_NL);
t->par.partyp=TPAR;
break;
@@ -1073,45 +1196,51 @@ static Shnode_t *item(int flag)
{
if(!(flag&SH_SEMI))
return(0);
- if(sh_lex()==';')
- sh_syntax();
+ if(sh_lex(lexp)==';')
+ sh_syntax(lexp);
showme = FSHOWME;
}
/* simple command */
case 0:
- t = (Shnode_t*)simple(flag,io);
+ t = (Shnode_t*)simple(lexp,flag,io);
+ if(t->com.comarg && lexp->intypeset && (lexp->sh->shcomp || sh_isoption(SH_NOEXEC) || sh.dot_depth))
+ check_typedef(&t->com);
+ lexp->intypeset = 0;
+ lexp->inexec = 0;
t->tre.tretyp |= showme;
return(t);
}
- sh_lex();
- if(io=inout(io,0))
+ sh_lex(lexp);
+ if(io=inout(lexp,io,0))
{
if((tok=t->tre.tretyp&COMMSK) != TFORK)
tok = TSETIO;
- t=makeparent(tok,t);
+ t=makeparent(lexp,tok,t);
t->tre.treio=io;
}
done:
- shlex.lasttok = savwdval;
- shlex.lastline = savline;
+ lexp->lasttok = savwdval;
+ lexp->lastline = savline;
return(t);
}
/*
* This is for a simple command, for list, or compound assignment
*/
-static Shnode_t *simple(int flag, struct ionod *io)
+static Shnode_t *simple(Lex_t *lexp,int flag, struct ionod *io)
{
register struct comnod *t;
register struct argnod *argp;
register int tok;
+ Stk_t *stkp = lexp->sh->stk;
struct argnod **argtail;
struct argnod **settail;
- int argno = 0;
+ int cmdarg=0;
+ int argno = 0, argmax=0;
int assignment = 0;
int key_on = (!(flag&SH_NOIO) && sh_isoption(SH_KEYWORD));
int associative=0;
- if((argp=shlex.arg) && (argp->argflag&ARG_ASSIGN) && argp->argval[0]=='[')
+ if((argp=lexp->arg) && (argp->argflag&ARG_ASSIGN) && argp->argval[0]=='[')
{
flag |= SH_ARRAY;
associative = 1;
@@ -1119,29 +1248,29 @@ static Shnode_t *simple(int flag, struct ionod *io)
t = (struct comnod*)getnode(comnod);
t->comio=io; /*initial io chain*/
/* set command line number for error messages */
- t->comline = sh_getlineno();
+ t->comline = sh_getlineno(lexp);
argtail = &(t->comarg);
t->comset = 0;
t->comnamp = 0;
t->comnamq = 0;
t->comstate = 0;
settail = &(t->comset);
- while(shlex.token==0)
+ while(lexp->token==0)
{
- argp = shlex.arg;
+ argp = lexp->arg;
if(*argp->argval==LBRACE && (flag&SH_FUNDEF) && argp->argval[1]==0)
{
- shlex.token = LBRACE;
+ lexp->token = LBRACE;
break;
}
if(associative && argp->argval[0]!='[')
- sh_syntax();
+ sh_syntax(lexp);
/* check for assignment argument */
if((argp->argflag&ARG_ASSIGN) && assignment!=2)
{
*settail = argp;
settail = &(argp->argnxt.ap);
- shlex.assignok = (flag&SH_ASSIGN)?SH_ASSIGN:1;
+ lexp->assignok = (flag&SH_ASSIGN)?SH_ASSIGN:1;
if(assignment)
{
struct argnod *ap=argp;
@@ -1151,9 +1280,9 @@ static Shnode_t *simple(int flag, struct ionod *io)
last = strchr(argp->argval,'=');
if((cp=strchr(argp->argval,'[')) && (cp < last))
last = cp;
- stakseek(ARGVAL);
- stakwrite(argp->argval,last-argp->argval);
- ap=(struct argnod*)stakfreeze(1);
+ stkseek(stkp,ARGVAL);
+ sfwrite(stkp,argp->argval,last-argp->argval);
+ ap=(struct argnod*)stkfreeze(stkp,1);
ap->argflag = ARG_RAW;
ap->argchn.ap = 0;
}
@@ -1163,43 +1292,62 @@ static Shnode_t *simple(int flag, struct ionod *io)
argno++;
}
else /* alias substitutions allowed */
- shlex.aliasok = 1;
+ lexp->aliasok = 1;
}
else
{
if(!(argp->argflag&ARG_RAW))
+ {
+ if(argno>0)
+ argmax = argno;
argno = -1;
- if(argno>=0 && argno++==0 && !(flag&SH_ARRAY) && *argp->argval!='/')
+ }
+ if(argno>=0 && argno++==cmdarg && !(flag&SH_ARRAY) && *argp->argval!='/')
{
/* check for builtin command */
- Namval_t *np=nv_bfsearch(argp->argval,sh.fun_tree, (Namval_t**)&t->comnamq,(char**)0);
- if((t->comnamp=(void*)np) && is_abuiltin(np) &&
- nv_isattr(np,BLT_DCL))
+ Namval_t *np=nv_bfsearch(argp->argval,lexp->sh->fun_tree, (Namval_t**)&t->comnamq,(char**)0);
+ if(cmdarg==0)
+ t->comnamp = (void*)np;
+ if(np && is_abuiltin(np))
{
- assignment = 1+(*argp->argval=='a');
- key_on = 1;
+ if(nv_isattr(np,BLT_DCL))
+ {
+ assignment = 1+(*argp->argval=='a');
+ if(np==SYSTYPESET)
+ lexp->intypeset = 1;
+ key_on = 1;
+ }
+ else if(np==SYSCOMMAND)
+ cmdarg++;
+ else if(np==SYSEXEC)
+ lexp->inexec = 1;
+ else if(np->nvalue.bfp==b_getopts)
+ opt_get |= FOPTGET;
}
}
*argtail = argp;
argtail = &(argp->argnxt.ap);
- if(!(shlex.assignok=key_on) && !(flag&SH_NOIO))
- shlex.assignok = SH_COMPASSIGN;
- shlex.aliasok = 0;
+ if(!(lexp->assignok=key_on) && !(flag&SH_NOIO) && sh_isoption(SH_NOEXEC))
+ lexp->assignok = SH_COMPASSIGN;
+ lexp->aliasok = 0;
}
retry:
- tok = sh_lex();
+ tok = sh_lex(lexp);
+ if(tok==LABLSYM && (flag&SH_ASSIGN))
+ lexp->token = tok = 0;
#if SHOPT_DEVFD
if((tok==IPROCSYM || tok==OPROCSYM))
{
Shnode_t *t;
int mode = (tok==OPROCSYM);
- t = sh_cmd(RPAREN,SH_NL);
- argp = (struct argnod*)stakalloc(sizeof(struct argnod));
+ t = sh_cmd(lexp,RPAREN,SH_NL);
+ argp = (struct argnod*)stkalloc(stkp,sizeof(struct argnod));
*argp->argval = 0;
+ argmax = 0;
argno = -1;
*argtail = argp;
argtail = &(argp->argnxt.ap);
- argp->argchn.ap = (struct argnod*)makeparent(mode?TFORK|FPIN|FAMP|FPCL:TFORK|FPOU,t);
+ argp->argchn.ap = (struct argnod*)makeparent(lexp,mode?TFORK|FPIN|FAMP|FPCL:TFORK|FPOU,t);
argp->argflag = (ARG_EXP|mode);
goto retry;
}
@@ -1208,20 +1356,26 @@ static Shnode_t *simple(int flag, struct ionod *io)
{
if(argp->argflag&ARG_ASSIGN)
{
- argp = assign(argp);
+ int intypeset = lexp->intypeset;
+ int tdef = 0;
+ lexp->intypeset = 0;
+ if(t->comnamp==SYSTYPESET && t->comarg->argnxt.ap && strcmp(t->comarg->argnxt.ap->argval,"-T")==0)
+ tdef = 1;
+ argp = assign(lexp,argp,tdef);
+ lexp->intypeset = intypeset;
if(associative)
- shlex.assignok |= SH_ASSIGN;
+ lexp->assignok |= SH_ASSIGN;
goto retry;
}
else if(argno==1 && !t->comset)
{
/* SVR2 style function */
- if(sh_lex() == RPAREN)
+ if(sh_lex(lexp) == RPAREN)
{
- shlex.arg = argp;
- return(funct());
+ lexp->arg = argp;
+ return(funct(lexp));
}
- shlex.token = LPAREN;
+ lexp->token = LPAREN;
}
}
else if(flag&SH_ASSIGN)
@@ -1229,7 +1383,11 @@ static Shnode_t *simple(int flag, struct ionod *io)
if(tok==RPAREN)
break;
else if(tok==NL && (flag&SH_ARRAY))
+ {
+ lexp->comp_assign = 2;
goto retry;
+ }
+
}
if(!(flag&SH_NOIO))
{
@@ -1237,41 +1395,43 @@ static Shnode_t *simple(int flag, struct ionod *io)
{
while(io->ionxt)
io = io->ionxt;
- io->ionxt = inout((struct ionod*)0,0);
+ io->ionxt = inout(lexp,(struct ionod*)0,0);
}
else
- t->comio = io = inout((struct ionod*)0,0);
+ t->comio = io = inout(lexp,(struct ionod*)0,0);
}
}
*argtail = 0;
- t->comtyp = TCOM;
+ if(argno>0)
+ argmax = argno;
+ t->comtyp = TCOM | (argmax<<(COMBITS+2));
#if SHOPT_KIA
- if(shlex.kiafile && !(flag&SH_NOIO))
+ if(lexp->kiafile && !(flag&SH_NOIO))
{
register Namval_t *np=(Namval_t*)t->comnamp;
unsigned long r=0;
int line = t->comline;
argp = t->comarg;
if(np)
- r = kiaentity(nv_name(np),-1,'p',-1,0,shlex.unknown,'b',0,"");
+ r = kiaentity(lexp,nv_name(np),-1,'p',-1,0,lexp->unknown,'b',0,"");
else if(argp)
- r = kiaentity(sh_argstr(argp),-1,'p',-1,0,shlex.unknown,'c',0,"");
+ r = kiaentity(lexp,sh_argstr(argp),-1,'p',-1,0,lexp->unknown,'c',0,"");
if(r>0)
- sfprintf(shlex.kiatmp,"p;%..64d;p;%..64d;%d;%d;c;\n",shlex.current,r,line,line);
+ sfprintf(lexp->kiatmp,"p;%..64d;p;%..64d;%d;%d;c;\n",lexp->current,r,line,line);
if(t->comset && argno==0)
- writedefs(t->comset,line,'v',t->comarg);
+ writedefs(lexp,t->comset,line,'v',t->comarg);
else if(np && nv_isattr(np,BLT_DCL))
- writedefs(argp,line,0,NIL(struct argnod*));
+ writedefs(lexp,argp,line,0,NIL(struct argnod*));
else if(argp && strcmp(argp->argval,"read")==0)
- writedefs(argp,line,0,NIL(struct argnod*));
+ writedefs(lexp,argp,line,0,NIL(struct argnod*));
#if 0
else if(argp && strcmp(argp->argval,"unset")==0)
- writedefs(argp,line,'u',NIL(struct argnod*));
+ writedefs(lexp,argp,line,'u',NIL(struct argnod*));
#endif
else if(argp && *argp->argval=='.' && argp->argval[1]==0 && (argp=argp->argnxt.ap))
{
- r = kiaentity(sh_argstr(argp),-1,'p',0,0,shlex.script,'d',0,"");
- sfprintf(shlex.kiatmp,"p;%..64d;p;%..64d;%d;%d;d;\n",shlex.current,r,line,line);
+ r = kiaentity(lexp,sh_argstr(argp),-1,'p',0,0,lexp->script,'d',0,"");
+ sfprintf(lexp->kiatmp,"p;%..64d;p;%..64d;%d;%d;d;\n",lexp->current,r,line,line);
}
}
#endif /* SHOPT_KIA */
@@ -1304,30 +1464,30 @@ static Shnode_t *simple(int flag, struct ionod *io)
break;
}
if(sh_isoption(SH_NOEXEC) && tok==0)
- errormsg(SH_DICT,ERROR_warn(0),e_lexlabunknown,sh.inlineno-(shlex.token=='\n'),cp);
+ errormsg(SH_DICT,ERROR_warn(0),e_lexlabunknown,lexp->sh->inlineno-(lexp->token=='\n'),cp);
}
else if(sh_isoption(SH_NOEXEC) && np==SYSSET && ((tok= *argp->argval)=='-'||tok=='+') &&
(argp->argval[1]==0||strchr(argp->argval,'k')))
- errormsg(SH_DICT,ERROR_warn(0),e_lexobsolete5,sh.inlineno-(shlex.token=='\n'),argp->argval);
+ errormsg(SH_DICT,ERROR_warn(0),e_lexobsolete5,lexp->sh->inlineno-(lexp->token=='\n'),argp->argval);
}
/* expand argument list if possible */
if(argno>0)
t->comarg = qscan(t,argno);
else if(t->comarg)
t->comtyp |= COMSCAN;
- shlex.aliasok = 0;
+ lexp->aliasok = 0;
return((Shnode_t*)t);
}
/*
* skip past newlines but issue prompt if interactive
*/
-static int skipnl(int flag)
+static int skipnl(Lex_t *lexp,int flag)
{
register int token;
- while((token=sh_lex())==NL);
+ while((token=sh_lex(lexp))==NL);
if(token==';' && !(flag&SH_SEMI))
- sh_syntax();
+ sh_syntax(lexp);
return(token);
}
@@ -1336,18 +1496,19 @@ static int skipnl(int flag)
* if flag>0 then an alias can be in the next word
* if flag<0 only one redirection will be processed
*/
-static struct ionod *inout(struct ionod *lastio,int flag)
+static struct ionod *inout(Lex_t *lexp,struct ionod *lastio,int flag)
{
- register int iof = shlex.digits, token=shlex.token;
+ register int iof = lexp->digits, token=lexp->token;
register struct ionod *iop;
+ Stk_t *stkp = lexp->sh->stk;
char *iovname=0;
#if SHOPT_BASH
register int errout=0;
#endif
if(token==IOVNAME)
{
- iovname=shlex.arg->argval+1;
- token= sh_lex();
+ iovname=lexp->arg->argval+1;
+ token= sh_lex(lexp);
iof = 0;
}
switch(token&0xff)
@@ -1387,83 +1548,85 @@ static struct ionod *inout(struct ionod *lastio,int flag)
iof |= IOCLOB;
else if((token&SYMSHARP) == SYMSHARP)
iof |= IOLSEEK;
+ else if((token&SYMSEMI) == SYMSEMI)
+ iof |= IOREWRITE;
break;
default:
return(lastio);
}
- shlex.digits=0;
- iop=(struct ionod*) stakalloc(sizeof(struct ionod));
+ lexp->digits=0;
+ iop=(struct ionod*) stkalloc(stkp,sizeof(struct ionod));
iop->iodelim = 0;
- if(token=sh_lex())
+ if(token=sh_lex(lexp))
{
- if(token==RPAREN && (iof&IOLSEEK) && shlex.comsub)
+ if(token==RPAREN && (iof&IOLSEEK) && lexp->comsub)
{
- shlex.arg = (struct argnod*)stakalloc(sizeof(struct argnod)+3);
- strcpy(shlex.arg->argval,"CUR");
- shlex.arg->argflag = ARG_RAW;
+ lexp->arg = (struct argnod*)stkalloc(stkp,sizeof(struct argnod)+3);
+ strcpy(lexp->arg->argval,"CUR");
+ lexp->arg->argflag = ARG_RAW;
iof |= IOARITH;
fcseek(-1);
}
else if(token==EXPRSYM && (iof&IOLSEEK))
iof |= IOARITH;
else
- sh_syntax();
+ sh_syntax(lexp);
}
- iop->ioname=shlex.arg->argval;
+ iop->ioname=lexp->arg->argval;
iop->iovname = iovname;
if(iof&IODOC)
{
- if(shlex.digits==2)
+ if(lexp->digits==2)
{
iof |= IOSTRG;
- if(!(shlex.arg->argflag&ARG_RAW))
+ if(!(lexp->arg->argflag&ARG_RAW))
iof &= ~IORAW;
}
else
{
- if(!shlex.sh->heredocs)
- shlex.sh->heredocs = sftmp(HERE_MEM);
- iop->iolst=shlex.heredoc;
- shlex.heredoc=iop;
- if(shlex.arg->argflag&ARG_QUOTED)
+ if(!lexp->sh->heredocs)
+ lexp->sh->heredocs = sftmp(HERE_MEM);
+ iop->iolst=lexp->heredoc;
+ lexp->heredoc=iop;
+ if(lexp->arg->argflag&ARG_QUOTED)
iof |= IOQUOTE;
- if(shlex.digits==3)
+ if(lexp->digits==3)
iof |= IOLSEEK;
- if(shlex.digits)
+ if(lexp->digits)
iof |= IOSTRIP;
}
}
else
{
iop->iolst = 0;
- if(shlex.arg->argflag&ARG_RAW)
+ if(lexp->arg->argflag&ARG_RAW)
iof |= IORAW;
}
iop->iofile=iof;
if(flag>0)
/* allow alias substitutions and parameter assignments */
- shlex.aliasok = shlex.assignok = 1;
+ lexp->aliasok = lexp->assignok = 1;
#if SHOPT_KIA
- if(shlex.kiafile)
+ if(lexp->kiafile)
{
- int n = sh.inlineno-(shlex.token=='\n');
+ int n = lexp->sh->inlineno-(lexp->token=='\n');
if(!(iof&IOMOV))
{
- unsigned long r=kiaentity((iof&IORAW)?sh_fmtq(iop->ioname):iop->ioname,-1,'f',0,0,shlex.script,'f',0,"");
- sfprintf(shlex.kiatmp,"p;%..64d;f;%..64d;%d;%d;%c;%d\n",shlex.current,r,n,n,(iof&IOPUT)?((iof&IOAPP)?'a':'w'):((iof&IODOC)?'h':'r'),iof&IOUFD);
+ unsigned long r=kiaentity(lexp,(iof&IORAW)?sh_fmtq(iop->ioname):iop->ioname,-1,'f',0,0,lexp->script,'f',0,"");
+ sfprintf(lexp->kiatmp,"p;%..64d;f;%..64d;%d;%d;%c;%d\n",lexp->current,r,n,n,(iof&IOPUT)?((iof&IOAPP)?'a':'w'):((iof&IODOC)?'h':'r'),iof&IOUFD);
}
}
#endif /* SHOPT_KIA */
if(flag>=0)
{
struct ionod *ioq=iop;
- sh_lex();
+ sh_lex(lexp);
#if SHOPT_BASH
if(errout)
{
/* redirect standard output to standard error */
- ioq = (struct ionod*)stakalloc(sizeof(struct ionod));
+ ioq = (struct ionod*)stkalloc(stkp,sizeof(struct ionod));
ioq->ioname = "1";
ioq->iolst = 0;
ioq->iodelim = 0;
@@ -1471,7 +1634,7 @@ static struct ionod *inout(struct ionod *lastio,int flag)
iop->ionxt=ioq;
}
#endif
- ioq->ionxt=inout(lastio,flag);
+ ioq->ionxt=inout(lexp,lastio,flag);
}
else
iop->ionxt=0;
@@ -1540,27 +1703,27 @@ static struct argnod *qscan(struct comnod *ac,int argn)
return((struct argnod*)dp);
}
-static Shnode_t *test_expr(int sym)
+static Shnode_t *test_expr(Lex_t *lp,int sym)
{
- register Shnode_t *t = test_or();
- if(shlex.token!=sym)
- sh_syntax();
+ register Shnode_t *t = test_or(lp);
+ if(lp->token!=sym)
+ sh_syntax(lp);
return(t);
}
-static Shnode_t *test_or(void)
+static Shnode_t *test_or(Lex_t *lp)
{
- register Shnode_t *t = test_and();
- while(shlex.token==ORFSYM)
- t = makelist(TORF|TTEST,t,test_and());
+ register Shnode_t *t = test_and(lp);
+ while(lp->token==ORFSYM)
+ t = makelist(lp,TORF|TTEST,t,test_and(lp));
return(t);
}
-static Shnode_t *test_and(void)
+static Shnode_t *test_and(Lex_t *lp)
{
- register Shnode_t *t = test_primary();
- while(shlex.token==ANDFSYM)
- t = makelist(TAND|TTEST,t,test_primary());
+ register Shnode_t *t = test_primary(lp);
+ while(lp->token==ANDFSYM)
+ t = makelist(lp,TAND|TTEST,t,test_primary(lp));
return(t);
}
@@ -1581,46 +1744,46 @@ static void ere_match(void)
fcfopen(base);
}
-static Shnode_t *test_primary(void)
+static Shnode_t *test_primary(Lex_t *lexp)
{
register struct argnod *arg;
register Shnode_t *t;
register int num,token;
- token = skipnl(0);
- num = shlex.digits;
+ token = skipnl(lexp,0);
+ num = lexp->digits;
switch(token)
{
case '(':
- t = test_expr(')');
- t = makelist(TTST|TTEST|TPAREN ,t, (Shnode_t*)pointerof(sh.inlineno));
+ t = test_expr(lexp,')');
+ t = makelist(lexp,TTST|TTEST|TPAREN ,t, (Shnode_t*)pointerof(lexp->sh->inlineno));
break;
case '!':
- if(!(t = test_primary()))
- sh_syntax();
+ if(!(t = test_primary(lexp)))
+ sh_syntax(lexp);
t->tre.tretyp |= TNEGATE;
return(t);
case TESTUNOP:
- if(sh_lex())
- sh_syntax();
+ if(sh_lex(lexp))
+ sh_syntax(lexp);
#if SHOPT_KIA
- if(shlex.kiafile && !strchr("sntzoOG",num))
+ if(lexp->kiafile && !strchr("sntzoOG",num))
{
- int line = sh.inlineno- (shlex.token==NL);
+ int line = lexp->sh->inlineno- (lexp->token==NL);
unsigned long r;
- r=kiaentity(sh_argstr(shlex.arg),-1,'f',0,0,shlex.script,'t',0,"");
- sfprintf(shlex.kiatmp,"p;%..64d;f;%..64d;%d;%d;t;\n",shlex.current,r,line,line);
+ r=kiaentity(lexp,sh_argstr(lexp->arg),-1,'f',0,0,lexp->script,'t',0,"");
+ sfprintf(lexp->kiatmp,"p;%..64d;f;%..64d;%d;%d;t;\n",lexp->current,r,line,line);
}
#endif /* SHOPT_KIA */
- t = makelist(TTST|TTEST|TUNARY|(num<<TSHIFT),
- (Shnode_t*)shlex.arg,(Shnode_t*)shlex.arg);
- t->tst.tstline = sh.inlineno;
+ t = makelist(lexp,TTST|TTEST|TUNARY|(num<<TSHIFT),
+ (Shnode_t*)lexp->arg,(Shnode_t*)lexp->arg);
+ t->tst.tstline = lexp->sh->inlineno;
break;
/* binary test operators */
case 0:
- arg = shlex.arg;
- if((token=sh_lex())==TESTBINOP)
+ arg = lexp->arg;
+ if((token=sh_lex(lexp))==TESTBINOP)
{
- num = shlex.digits;
+ num = lexp->digits;
if(num==TEST_REP)
{
ere_match();
@@ -1633,48 +1796,48 @@ static Shnode_t *test_primary(void)
num = TEST_SGT;
else if(token==ANDFSYM||token==ORFSYM||token==ETESTSYM||token==RPAREN)
{
- t = makelist(TTST|TTEST|TUNARY|('n'<<TSHIFT),
+ t = makelist(lexp,TTST|TTEST|TUNARY|('n'<<TSHIFT),
(Shnode_t*)arg,(Shnode_t*)arg);
- t->tst.tstline = sh.inlineno;
+ t->tst.tstline = lexp->sh->inlineno;
return(t);
}
else
- sh_syntax();
+ sh_syntax(lexp);
#if SHOPT_KIA
- if(shlex.kiafile && (num==TEST_EF||num==TEST_NT||num==TEST_OT))
+ if(lexp->kiafile && (num==TEST_EF||num==TEST_NT||num==TEST_OT))
{
- int line = sh.inlineno- (shlex.token==NL);
+ int line = lexp->sh->inlineno- (lexp->token==NL);
unsigned long r;
- r=kiaentity(sh_argstr(shlex.arg),-1,'f',0,0,shlex.current,'t',0,"");
- sfprintf(shlex.kiatmp,"p;%..64d;f;%..64d;%d;%d;t;\n",shlex.current,r,line,line);
+ r=kiaentity(lexp,sh_argstr(lexp->arg),-1,'f',0,0,lexp->current,'t',0,"");
+ sfprintf(lexp->kiatmp,"p;%..64d;f;%..64d;%d;%d;t;\n",lexp->current,r,line,line);
}
#endif /* SHOPT_KIA */
- if(sh_lex())
- sh_syntax();
+ if(sh_lex(lexp))
+ sh_syntax(lexp);
if(num&TEST_PATTERN)
{
- if(shlex.arg->argflag&(ARG_EXP|ARG_MAC))
+ if(lexp->arg->argflag&(ARG_EXP|ARG_MAC))
num &= ~TEST_PATTERN;
}
t = getnode(tstnod);
t->lst.lsttyp = TTST|TTEST|TBINARY|(num<<TSHIFT);
t->lst.lstlef = (Shnode_t*)arg;
- t->lst.lstrit = (Shnode_t*)shlex.arg;
- t->tst.tstline = sh.inlineno;
+ t->lst.lstrit = (Shnode_t*)lexp->arg;
+ t->tst.tstline = lexp->sh->inlineno;
#if SHOPT_KIA
- if(shlex.kiafile && (num==TEST_EF||num==TEST_NT||num==TEST_OT))
+ if(lexp->kiafile && (num==TEST_EF||num==TEST_NT||num==TEST_OT))
{
- int line = sh.inlineno-(shlex.token==NL);
+ int line = lexp->sh->inlineno-(lexp->token==NL);
unsigned long r;
- r=kiaentity(sh_argstr(shlex.arg),-1,'f',0,0,shlex.current,'t',0,"");
- sfprintf(shlex.kiatmp,"p;%..64d;f;%..64d;%d;%d;t;\n",shlex.current,r,line,line);
+ r=kiaentity(lexp,sh_argstr(lexp->arg),-1,'f',0,0,lexp->current,'t',0,"");
+ sfprintf(lexp->kiatmp,"p;%..64d;f;%..64d;%d;%d;t;\n",lexp->current,r,line,line);
}
#endif /* SHOPT_KIA */
break;
default:
return(0);
}
- skipnl(0);
+ skipnl(lexp,0);
return(t);
}
@@ -1683,23 +1846,23 @@ static Shnode_t *test_primary(void)
* return an entity checksum
* The entity is created if it doesn't exist
*/
-unsigned long kiaentity(const char *name,int len,int type,int first,int last,unsigned long parent, int pkind, int width, const char *attr)
+unsigned long kiaentity(Lex_t *lexp,const char *name,int len,int type,int first,int last,unsigned long parent, int pkind, int width, const char *attr)
{
+ Stk_t *stkp = lexp->sh->stk;
Namval_t *np;
- long offset = staktell();
- stakputc(type);
+ long offset = stktell(stkp);
+ sfputc(stkp,type);
if(len>0)
- stakwrite(name,len);
+ sfwrite(stkp,name,len);
else
{
if(type=='p')
- stakputs(path_basename(name));
+ sfputr(stkp,path_basename(name),0);
else
- stakputs(name);
+ sfputr(stkp,name,0);
}
- stakputc(0);
- np = nv_search(stakptr(offset),shlex.entity_tree,NV_ADD);
- stakseek(offset);
+ np = nv_search(stakptr(offset),lexp->entity_tree,NV_ADD);
+ stkseek(stkp,offset);
np->nvalue.i = pkind;
nv_setsize(np,width);
if(!nv_isattr(np,NV_TAGGED) && first>=0)
@@ -1708,9 +1871,9 @@ unsigned long kiaentity(const char *name,int len,int type,int first,int last,uns
if(!pkind)
pkind = '0';
if(len>0)
- sfprintf(shlex.kiafile,"%..64d;%c;%.*s;%d;%d;%..64d;%..64d;%c;%d;%s\n",np->hash,type,len,name,first,last,parent,shlex.fscript,pkind,width,attr);
+ sfprintf(lexp->kiafile,"%..64d;%c;%.*s;%d;%d;%..64d;%..64d;%c;%d;%s\n",np->hash,type,len,name,first,last,parent,lexp->fscript,pkind,width,attr);
else
- sfprintf(shlex.kiafile,"%..64d;%c;%s;%d;%d;%..64d;%..64d;%c;%d;%s\n",np->hash,type,name,first,last,parent,shlex.fscript,pkind,width,attr);
+ sfprintf(lexp->kiafile,"%..64d;%c;%s;%d;%d;%..64d;%..64d;%c;%d;%s\n",np->hash,type,name,first,last,parent,lexp->fscript,pkind,width,attr);
}
return(np->hash);
}
@@ -1718,40 +1881,41 @@ unsigned long kiaentity(const char *name,int len,int type,int first,int last,uns
static void kia_add(register Namval_t *np, void *data)
{
char *name = nv_name(np);
+ Lex_t *lp = (Lex_t*)data;
NOT_USED(data);
- kiaentity(name+1,-1,*name,0,-1,(*name=='p'?shlex.unknown:shlex.script),np->nvalue.i,nv_size(np),"");
+ kiaentity(lp,name+1,-1,*name,0,-1,(*name=='p'?lp->unknown:lp->script),np->nvalue.i,nv_size(np),"");
}
-int kiaclose(void)
+int kiaclose(Lex_t *lexp)
{
register off_t off1,off2;
register int n;
- if(shlex.kiafile)
+ if(lexp->kiafile)
{
- unsigned long r = kiaentity(shlex.scriptname,-1,'p',-1,sh.inlineno-1,0,'s',0,"");
- kiaentity(shlex.scriptname,-1,'p',1,sh.inlineno-1,r,'s',0,"");
- kiaentity(shlex.scriptname,-1,'f',1,sh.inlineno-1,r,'s',0,"");
- nv_scan(shlex.entity_tree,kia_add,(void*)0,NV_TAGGED,0);
- off1 = sfseek(shlex.kiafile,(off_t)0,SEEK_END);
- sfseek(shlex.kiatmp,(off_t)0,SEEK_SET);
- sfmove(shlex.kiatmp,shlex.kiafile,SF_UNBOUND,-1);
- off2 = sfseek(shlex.kiafile,(off_t)0,SEEK_END);
+ unsigned long r = kiaentity(lexp,lexp->scriptname,-1,'p',-1,lexp->sh->inlineno-1,0,'s',0,"");
+ kiaentity(lexp,lexp->scriptname,-1,'p',1,lexp->sh->inlineno-1,r,'s',0,"");
+ kiaentity(lexp,lexp->scriptname,-1,'f',1,lexp->sh->inlineno-1,r,'s',0,"");
+ nv_scan(lexp->entity_tree,kia_add,(void*)lexp,NV_TAGGED,0);
+ off1 = sfseek(lexp->kiafile,(off_t)0,SEEK_END);
+ sfseek(lexp->kiatmp,(off_t)0,SEEK_SET);
+ sfmove(lexp->kiatmp,lexp->kiafile,SF_UNBOUND,-1);
+ off2 = sfseek(lexp->kiafile,(off_t)0,SEEK_END);
#ifdef SF_BUFCONST
if(off2==off1)
- n= sfprintf(shlex.kiafile,"DIRECTORY\nENTITY;%lld;%d\nDIRECTORY;",(Sflong_t)shlex.kiabegin,(size_t)(off1-shlex.kiabegin));
+ n= sfprintf(lexp->kiafile,"DIRECTORY\nENTITY;%lld;%d\nDIRECTORY;",(Sflong_t)lexp->kiabegin,(size_t)(off1-lexp->kiabegin));
else
- n= sfprintf(shlex.kiafile,"DIRECTORY\nENTITY;%lld;%d\nRELATIONSHIP;%lld;%d\nDIRECTORY;",(Sflong_t)shlex.kiabegin,(size_t)(off1-shlex.kiabegin),(Sflong_t)off1,(size_t)(off2-off1));
+ n= sfprintf(lexp->kiafile,"DIRECTORY\nENTITY;%lld;%d\nRELATIONSHIP;%lld;%d\nDIRECTORY;",(Sflong_t)lexp->kiabegin,(size_t)(off1-lexp->kiabegin),(Sflong_t)off1,(size_t)(off2-off1));
if(off2 >= INT_MAX)
off2 = -(n+12);
- sfprintf(shlex.kiafile,"%010.10lld;%010d\n",(Sflong_t)off2+10, n+12);
+ sfprintf(lexp->kiafile,"%010.10lld;%010d\n",(Sflong_t)off2+10, n+12);
#else
if(off2==off1)
- n= sfprintf(shlex.kiafile,"DIRECTORY\nENTITY;%d;%d\nDIRECTORY;",shlex.kiabegin,off1-shlex.kiabegin);
+ n= sfprintf(lexp->kiafile,"DIRECTORY\nENTITY;%d;%d\nDIRECTORY;",lexp->kiabegin,off1-lexp->kiabegin);
else
- n= sfprintf(shlex.kiafile,"DIRECTORY\nENTITY;%d;%d\nRELATIONSHIP;%d;%d\nDIRECTORY;",shlex.kiabegin,off1-shlex.kiabegin,off1,off2-off1);
- sfprintf(shlex.kiafile,"%010d;%010d\n",off2+10, n+12);
+ n= sfprintf(lexp->kiafile,"DIRECTORY\nENTITY;%d;%d\nRELATIONSHIP;%d;%d\nDIRECTORY;",lexp->kiabegin,off1-lexp->kiabegin,off1,off2-off1);
+ sfprintf(lexp->kiafile,"%010d;%010d\n",off2+10, n+12);
#endif
}
- return(sfclose(shlex.kiafile));
+ return(sfclose(lexp->kiafile));
}
#endif /* SHOPT_KIA */
diff --git a/usr/src/lib/libshell/common/sh/path.c b/usr/src/lib/libshell/common/sh/path.c
index a07a9d6e00..fc91fb34e4 100644
--- a/usr/src/lib/libshell/common/sh/path.c
+++ b/usr/src/lib/libshell/common/sh/path.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -28,13 +28,13 @@
#include <fcin.h>
#include <ls.h>
#include <nval.h>
-#include <dlldefs.h>
#include "variables.h"
#include "path.h"
#include "io.h"
#include "jobs.h"
#include "history.h"
#include "test.h"
+#include "FEATURE/dynamic"
#include "FEATURE/externs"
#if SHOPT_PFSH
# ifdef _hdr_exec_attr
@@ -42,6 +42,11 @@
# else
# undef SHOPT_PFSH
# endif
+# if _lib_vfork
+# include <ast_vfork.h>
+# else
+# define vfork() fork()
+# endif
#endif
#define RW_ALL (S_IRUSR|S_IRGRP|S_IROTH|S_IWUSR|S_IWGRP|S_IWOTH)
@@ -69,10 +74,18 @@ static int onstdpath(const char *name)
return(0);
}
-static int path_pfexecve(const char *path, char *argv[],char *const envp[])
+static pid_t path_pfexecve(const char *path, char *argv[],char *const envp[],int spawn)
{
#if SHOPT_PFSH
+ pid_t pid;
char resolvedpath[PATH_MAX + 1];
+ if(spawn)
+ {
+ while((pid = vfork()) < 0)
+ _sh_fork(pid, 0, (int*)0);
+ if(pid)
+ return(pid);
+ }
if(!sh_isoption(SH_PFSH))
return(execve(path, argv, envp));
/* Solaris implements realpath(3C) using the resolvepath(2) */
@@ -111,11 +124,19 @@ static int path_pfexecve(const char *path, char *argv[],char *const envp[])
}
-static pid_t _spawnveg(const char *path, char* const argv[], char* const envp[], pid_t pid)
+static pid_t _spawnveg(const char *path, char* const argv[], char* const envp[], pid_t pgid)
{
int waitsafe = job.waitsafe;
+ pid_t pid;
job_lock();
- pid = spawnveg(path,argv,envp,pid);
+ while(1)
+ {
+ sh_stats(STAT_SPAWN);
+ pid = spawnveg(path,argv,envp,pgid);
+ if(pid>=0 || errno!=EAGAIN)
+ break;
+ _sh_fork(pid, 0, (int*)0);
+ }
job.waitsafe = waitsafe;
job_unlock();
return(pid);
@@ -189,7 +210,7 @@ static pid_t path_xargs(const char *path, char *argv[],char *const envp[], int s
return(_spawnveg(path,argv,envp,spawn>>1));
}
else
- return((pid_t)path_pfexecve(path,argv,envp));
+ return(path_pfexecve(path,argv,envp,spawn));
}
if(!spawn)
exit(exitval);
@@ -273,7 +294,7 @@ static void free_bltin(Namval_t *np,void *data)
return;
}
if((void*)np->nvenv==pp->bltin_lib)
- dtdelete(sh_bltin_tree(),np);
+ nv_delete(np,sh_bltin_tree(),NV_NOFREE);
}
/*
@@ -294,8 +315,10 @@ void path_delete(Pathcomp_t *first)
if(pp->bltin_lib || (pp->flags&PATH_STD_DIR))
{
nv_scan(sh_bltin_tree(),free_bltin,pp,0,0);
+#if SHOPT_DYNAMIC
if(pp->bltin_lib)
dlclose(pp->bltin_lib);
+#endif /* SHOPT_DYNAMIC */
}
free((void*)pp);
if(old)
@@ -329,7 +352,7 @@ static char *path_lib(Pathcomp_t *pp, char *path)
char save[8];
for( ;pp; pp=pp->next)
{
- if(pp->ino==statb.st_ino && pp->dev==statb.st_dev)
+ if(pp->ino==statb.st_ino && pp->dev==statb.st_dev && pp->mtime==statb.st_mtime)
return(pp->lib);
}
pcomp.len = 0;
@@ -414,7 +437,7 @@ static void path_init(Shell_t *shp)
Pathcomp_t *pp;
if(!std_path && !(std_path=astconf("PATH",NIL(char*),NIL(char*))))
std_path = e_defpath;
- if(val=nv_scoped((PATHNOD))->nvalue.cp)
+ if(val=sh_scoped(shp,(PATHNOD))->nvalue.cp)
{
pp = (void*)path_addpath((Pathcomp_t*)shp->pathlist,val,PATH_PATH);
if(shp->pathlist = (void*)pp)
@@ -426,7 +449,7 @@ static void path_init(Shell_t *shp)
pp = defpath_init(shp);
shp->pathlist = (void*)path_dup(pp);
}
- if(val=nv_scoped((FPATHNOD))->nvalue.cp)
+ if(val=sh_scoped(shp,(FPATHNOD))->nvalue.cp)
{
pp = (void*)path_addpath((Pathcomp_t*)shp->pathlist,val,PATH_FPATH);
if(shp->pathlist = (void*)pp)
@@ -551,16 +574,37 @@ char *path_fullname(const char *name)
*/
static void funload(Shell_t *shp,int fno, const char *name)
{
- char *oldname=shp->st.filename, buff[IOBSIZE+1];
- int savestates = sh_getstate();
+ char *pname,*oldname=shp->st.filename, buff[IOBSIZE+1];
+ Namval_t *np;
+ struct Ufunction *rp;
+ int savestates = sh_getstate(), oldload=shp->funload;
+ pname = path_fullname(stakptr(PATH_OFFSET));
+ if(shp->fpathdict && (rp = dtmatch(shp->fpathdict,(void*)pname)))
+ {
+ do
+ {
+ if((np = dtsearch(shp->fun_tree,rp->np)) && is_afunction(np))
+ {
+ if(np->nvalue.rp)
+ np->nvalue.rp->fdict = 0;
+ nv_delete(np,shp->fun_tree,NV_NOFREE);
+ }
+ dtinsert(shp->fun_tree,rp->np);
+ rp->fdict = shp->fun_tree;
+ }
+ while((rp=dtnext(shp->fpathdict,rp)) && strcmp(pname,rp->fname)==0);
+ return;
+ }
sh_onstate(SH_NOLOG);
sh_onstate(SH_NOALIAS);
shp->readscript = (char*)name;
- shp->st.filename = path_fullname(stakptr(PATH_OFFSET));
+ shp->st.filename = pname;
+ shp->funload = 1;
error_info.line = 0;
sh_eval(sfnew(NIL(Sfio_t*),buff,IOBSIZE,fno,SF_READ),0);
shp->readscript = 0;
free((void*)shp->st.filename);
+ shp->funload = oldload;
shp->st.filename = oldname;
sh_setstate(savestates);
}
@@ -568,12 +612,14 @@ static void funload(Shell_t *shp,int fno, const char *name)
/*
* do a path search and track alias if requested
* if flag is 0, or if name not found, then try autoloading function
- * if flag==2, returns 1 if name found on FPATH
+ * if flag==2 or 3, returns 1 if name found on FPATH
+ * if flag==3 no tracked alias will be set
* returns 1, if function was autoloaded.
- * If endpath!=NULL, Path search ends when path matches endpath.
+ * If oldpp is not NULL, it will contain a pointer to the path component
+ * where it was found.
*/
-int path_search(register const char *name,Pathcomp_t *endpath, int flag)
+int path_search(register const char *name,Pathcomp_t **oldpp, int flag)
{
register Namval_t *np;
register int fno;
@@ -606,8 +652,9 @@ int path_search(register const char *name,Pathcomp_t *endpath, int flag)
path_init(shp);
if(flag)
{
- if(!(pp=path_absolute(name,endpath)) && endpath)
- pp = path_absolute(name,NIL(Pathcomp_t*));
+ pp = path_absolute(name,oldpp?*oldpp:NIL(Pathcomp_t*));
+ if(oldpp)
+ *oldpp = pp;
if(!pp && (np=nv_search(name,sh.fun_tree,HASH_NOSCOPE))&&np->nvalue.ip)
return(1);
if(!pp)
@@ -630,7 +677,7 @@ int path_search(register const char *name,Pathcomp_t *endpath, int flag)
*stakptr(PATH_OFFSET) = 0;
return(0);
}
- else if(pp && !sh_isstate(SH_DEFPATH) && *name!='/')
+ else if(pp && !sh_isstate(SH_DEFPATH) && *name!='/' && flag<3)
{
if(np=nv_search(name,shp->track_tree,NV_ADD))
path_alias(np,pp);
@@ -641,18 +688,17 @@ int path_search(register const char *name,Pathcomp_t *endpath, int flag)
/*
* do a path search and find the full pathname of file name
- * end search of path matches endpath without checking execute permission
*/
-Pathcomp_t *path_absolute(register const char *name, Pathcomp_t *endpath)
+Pathcomp_t *path_absolute(register const char *name, Pathcomp_t *pp)
{
register int f,isfun;
int noexec=0;
- Pathcomp_t *pp,*oldpp;
+ Pathcomp_t *oldpp;
Shell_t *shp = &sh;
Namval_t *np;
shp->path_err = ENOENT;
- if(!(pp=path_get("")))
+ if(!pp && !(pp=path_get("")))
return(0);
shp->path_err = 0;
while(1)
@@ -661,12 +707,11 @@ Pathcomp_t *path_absolute(register const char *name, Pathcomp_t *endpath)
isfun = (pp->flags&PATH_FPATH);
if(oldpp=pp)
pp = path_nextcomp(pp,name,0);
- if(endpath)
- return(endpath);
if(!isfun && !sh_isoption(SH_RESTRICTED))
{
- if(nv_search(stakptr(PATH_OFFSET),sh.bltin_tree,0))
+ if(*stakptr(PATH_OFFSET)=='/' && nv_search(stakptr(PATH_OFFSET),sh.bltin_tree,0))
return(oldpp);
+#if SHOPT_DYNAMIC
if(oldpp->blib)
{
typedef int (*Fptr_t)(int, char*[], void*);
@@ -684,9 +729,8 @@ Pathcomp_t *path_absolute(register const char *name, Pathcomp_t *endpath)
cp = oldpp->blib;
if(strcmp(cp,LIBCMD)==0 && (addr=(Fptr_t)dlllook((void*)0,stakptr(n))))
{
- np = sh_addbuiltin(stakptr(PATH_OFFSET),addr,NiL);
- np->nvfun = (Namfun_t*)np->nvname;
- return(oldpp);
+ if((np = sh_addbuiltin(stakptr(PATH_OFFSET),addr,NiL)) && nv_isattr(np,NV_BLTINOPT))
+ return(oldpp);
}
#if (_AST_VERSION>=20040404)
if (oldpp->bltin_lib = dllplug(SH_ID, oldpp->blib, NiL, RTLD_LAZY, NiL, 0))
@@ -703,7 +747,9 @@ Pathcomp_t *path_absolute(register const char *name, Pathcomp_t *endpath)
return(oldpp);
}
}
+#endif /* SHOPT_DYNAMIC */
}
+ sh_stats(STAT_PATHS);
f = canexecute(stakptr(PATH_OFFSET),isfun);
if(isfun && f>=0)
{
@@ -714,16 +760,17 @@ Pathcomp_t *path_absolute(register const char *name, Pathcomp_t *endpath)
}
else if(f>=0 && (oldpp->flags & PATH_STD_DIR))
{
- int offset = staktell();
+ int n = staktell();
stakputs("/bin/");
stakputs(name);
stakputc(0);
- np = nv_search(stakptr(offset),sh.bltin_tree,0);
- stakseek(offset);
+ np = nv_search(stakptr(n),sh.bltin_tree,0);
+ stakseek(n);
if(np)
{
- np = sh_addbuiltin(stakptr(PATH_OFFSET),np->nvalue.bfp,NiL);
- np->nvfun = (Namfun_t*)np->nvname;
+ n = np->nvflag;
+ np = sh_addbuiltin(stakptr(PATH_OFFSET),np->nvalue.bfp,nv_context(np));
+ np->nvflag = n;
}
}
if(!pp || f>=0)
@@ -733,8 +780,7 @@ Pathcomp_t *path_absolute(register const char *name, Pathcomp_t *endpath)
}
if(f<0)
{
- if(!endpath)
- shp->path_err = (noexec?noexec:ENOENT);
+ shp->path_err = (noexec?noexec:ENOENT);
return(0);
}
stakputc(0);
@@ -947,7 +993,7 @@ pid_t path_spawn(const char *opath,register char **argv, char **envp, Pathcomp_t
}
v = stakfreeze(1);
r = 1;
- xp = envp + 2;
+ xp = envp + 1;
while (s = *xp++)
{
if (strneq(s, v, n) && s[n] == '=')
@@ -986,28 +1032,10 @@ pid_t path_spawn(const char *opath,register char **argv, char **envp, Pathcomp_t
path = sp;
}
#endif /* SHELLMAGIC */
- if(sh_isoption(SH_RESTRICTED))
- {
- int fd;
- if((fd = sh_open(opath,O_RDONLY,0)) >= 0)
- {
- char buff[PATH_MAX];
- n = read(fd,buff,sizeof(buff));
- close(fd);
- if(n>2 && buff[0]=='#' && buff[1]=='!')
- {
- for(s=buff; n>0 && *s!='\n'; n--,s++)
- {
- if(*s=='/')
- errormsg(SH_DICT,ERROR_exit(1),e_restricted,opath);
- }
- }
- }
- }
if(spawn && !sh_isoption(SH_PFSH))
pid = _spawnveg(opath, &argv[0],envp, spawn>>1);
else
- path_pfexecve(opath, &argv[0] ,envp);
+ pid = path_pfexecve(opath, &argv[0] ,envp,spawn);
if(xp)
*xp = xval;
#ifdef SHELLMAGIC
@@ -1048,6 +1076,7 @@ retry:
return(pid);
}
while(_sh_fork(pid,0,(int*)0) < 0);
+ ((struct checkpt*)shp->jmplist)->mode = SH_JMPEXIT;
#else
return(-1);
#endif
@@ -1159,20 +1188,21 @@ static void exscript(Shell_t *shp,register char *path,register char *argv[],char
}
savet = *--argv;
*argv = path;
- path_pfexecve(e_suidexec,argv,envp);
+ path_pfexecve(e_suidexec,argv,envp,0);
fail:
/*
* The following code is just for compatibility
*/
if((n=open(path,O_RDONLY,0)) < 0)
- errormsg(SH_DICT,ERROR_system(1),e_open,path);
+ errormsg(SH_DICT,ERROR_system(ERROR_NOEXEC),e_exec,path);
if(savet)
*argv++ = savet;
openok:
shp->infd = n;
}
#else
- shp->infd = sh_chkopen(path);
+ if((shp->infd = sh_open(path,O_RDONLY,0)) < 0)
+ errormsg(SH_DICT,ERROR_system(ERROR_NOEXEC),e_exec,path);
#endif
shp->infd = sh_iomovefd(shp->infd);
#if SHOPT_ACCT
@@ -1210,7 +1240,7 @@ static void exscript(Shell_t *shp,register char *path,register char *argv[],char
SHACCT = getenv("SHACCT");
}
/*
- * suspend accounting unitl turned on by sh_accbegin()
+ * suspend accounting until turned on by sh_accbegin()
*/
void sh_accsusp(void)
{
@@ -1318,6 +1348,7 @@ static Pathcomp_t *path_addcomp(Pathcomp_t *first, Pathcomp_t *old,const char *n
{
statb.st_ino = old->ino;
statb.st_dev = old->dev;
+ statb.st_mtime = old->mtime;
if(old->ino==0 && old->dev==0)
flag |= PATH_SKIP;
}
@@ -1335,12 +1366,13 @@ static Pathcomp_t *path_addcomp(Pathcomp_t *first, Pathcomp_t *old,const char *n
statb.st_dev = 0;
}
statb.st_ino = 0;
+ statb.st_mtime = 0;
}
if(*name=='/' && onstdpath(name))
flag |= PATH_STD_DIR;
for(pp=first, oldpp=0; pp; oldpp=pp, pp=pp->next)
{
- if(pp->ino==statb.st_ino && pp->dev==statb.st_dev)
+ if(pp->ino==statb.st_ino && pp->dev==statb.st_dev && pp->mtime==statb.st_mtime)
{
/* if both absolute paths, eliminate second */
pp->flags |= flag;
@@ -1357,6 +1389,7 @@ static Pathcomp_t *path_addcomp(Pathcomp_t *first, Pathcomp_t *old,const char *n
pp->len = len;
pp->dev = statb.st_dev;
pp->ino = statb.st_ino;
+ pp->mtime = statb.st_mtime;
if(oldpp)
oldpp->next = pp;
else
@@ -1568,6 +1601,7 @@ void path_newdir(Pathcomp_t *first)
}
pp->dev = statb.st_dev;
pp->ino = statb.st_ino;
+ pp->mtime = statb.st_mtime;
for(pq=first;pq!=pp;pq=pq->next)
{
if(pp->ino==pq->ino && pp->dev==pq->dev)
@@ -1600,6 +1634,18 @@ void path_newdir(Pathcomp_t *first)
Pathcomp_t *path_unsetfpath(Pathcomp_t *first)
{
register Pathcomp_t *pp=first, *old=0;
+ Shell_t *shp = &sh;
+ if(shp->fpathdict)
+ {
+ struct Ufunction *rp, *rpnext;
+ for(rp=(struct Ufunction*)dtfirst(shp->fpathdict);rp;rp=rpnext)
+ {
+ rpnext = (struct Ufunction*)dtnext(shp->fpathdict,rp);
+ if(rp->fdict)
+ nv_delete(rp->np,rp->fdict,NV_NOFREE);
+ rp->fdict = 0;
+ }
+ }
while(pp)
{
if((pp->flags&PATH_FPATH) && !(pp->flags&PATH_BFPATH))
diff --git a/usr/src/lib/libshell/common/sh/pmain.c b/usr/src/lib/libshell/common/sh/pmain.c
index 9cf8a886f9..5c61ce4107 100644
--- a/usr/src/lib/libshell/common/sh/pmain.c
+++ b/usr/src/lib/libshell/common/sh/pmain.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -21,10 +21,27 @@
#include <shell.h>
+#include "FEATURE/externs"
+
+#if defined(__sun) && _sys_mman && _lib_memcntl && defined(MHA_MAPSIZE_STACK) && defined(MC_HAT_ADVISE)
+# undef VM_FLAGS /* solaris vs vmalloc.h symbol clash */
+# include <sys/mman.h>
+#else
+# undef _lib_memcntl
+#endif
+
typedef int (*Shnote_f)(int, long, int);
int main(int argc, char *argv[])
{
+#if _lib_memcntl
+ /* advise larger stack size */
+ struct memcntl_mha mha;
+ mha.mha_cmd = MHA_MAPSIZE_STACK;
+ mha.mha_flags = 0;
+ mha.mha_pagesize = 64 * 1024;
+ (void)memcntl(NULL, 0, MC_HAT_ADVISE, (caddr_t)&mha, 0, 0);
+#endif
sh_waitnotify((Shnote_f)0);
- return(sh_main(argc, argv, 0));
+ return(sh_main(argc, argv, (Shinit_f)0));
}
diff --git a/usr/src/lib/libshell/common/sh/shcomp.c b/usr/src/lib/libshell/common/sh/shcomp.c
index 454ac3e5be..a1b717f3e7 100644
--- a/usr/src/lib/libshell/common/sh/shcomp.c
+++ b/usr/src/lib/libshell/common/sh/shcomp.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -59,6 +59,7 @@ USAGE_LICENSE
;
#include <shell.h>
+#include "defs.h"
#include "shnodes.h"
#include "sys/stat.h"
@@ -94,6 +95,7 @@ int main(int argc, char *argv[])
break;
}
shp = sh_init(argc,argv,(Shinit_f)0);
+ shp->shcomp = 1;
argv += opt_info.index;
argc -= opt_info.index;
if(error_info.errors || argc>2)
@@ -127,12 +129,15 @@ int main(int argc, char *argv[])
if(!dflag)
sfwrite(out,header,sizeof(header));
shp->inlineno = 1;
+#if SHOPT_BRACEPAT
+ sh_onoption(SH_BRACEEXPAND);
+#endif
while(1)
{
stakset((char*)0,0);
if(t = (Shnode_t*)sh_parse(shp,in,0))
{
- if(t->tre.tretyp==0 && t->com.comnamp && strcmp(nv_name((Namval_t*)t->com.comnamp),"alias")==0)
+ if((t->tre.tretyp&(COMMSK|COMSCAN))==0 && t->com.comnamp && strcmp(nv_name((Namval_t*)t->com.comnamp),"alias")==0)
sh_exec(t,0);
if(!dflag && sh_tdump(out,t) < 0)
errormsg(SH_DICT,ERROR_exit(1),"dump failed");
diff --git a/usr/src/lib/libshell/common/sh/streval.c b/usr/src/lib/libshell/common/sh/streval.c
index fd74d47cd6..f39cc24e9b 100644
--- a/usr/src/lib/libshell/common/sh/streval.c
+++ b/usr/src/lib/libshell/common/sh/streval.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -486,7 +486,7 @@ again:
case A_PLUS:
goto again;
case A_EOF:
- if(precedence>5)
+ if(precedence>2)
ERROR(vp,e_moretokens);
return(1);
case A_MINUS:
diff --git a/usr/src/lib/libshell/common/sh/string.c b/usr/src/lib/libshell/common/sh/string.c
index 2d5fcaaac3..b7c9c7d63c 100644
--- a/usr/src/lib/libshell/common/sh/string.c
+++ b/usr/src/lib/libshell/common/sh/string.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -256,6 +256,7 @@ void sh_trim(register char *sp)
int len;
if(mbwide() && (len=mbsize(sp))>1)
{
+ memmove(dp, sp, len);
dp += len;
sp += len;
continue;
@@ -300,7 +301,7 @@ void sh_utol(register char const *str1,register char *str2)
*/
char *sh_fmtq(const char *string)
{
- register const char *cp = string;
+ register const char *cp = string, *op;
register int c, state;
int offset;
if(!cp)
@@ -343,14 +344,12 @@ char *sh_fmtq(const char *string)
#endif
{
#if SHOPT_MULTIBYTE
- if(c>=0x200)
- continue;
if(c=='\'' || !iswprint(c))
#else
if(c=='\'' || !isprint(c))
#endif /* SHOPT_MULTIBYTE */
state = 2;
- else if(c==']' || (c!=':' && (c=sh_lexstates[ST_NORM][c]) && c!=S_EPAT))
+ else if(c==']' || (c!=':' && c<=0xff && (c=sh_lexstates[ST_NORM][c]) && c!=S_EPAT))
state |=1;
}
if(state<2)
@@ -367,9 +366,9 @@ char *sh_fmtq(const char *string)
stakwrite("$'",2);
cp = string;
#if SHOPT_MULTIBYTE
- while(c= mbchar(cp))
+ while(op = cp, c= mbchar(cp))
#else
- while(c= *(unsigned char*)cp++)
+ while(op = cp, c= *(unsigned char*)cp++)
#endif
{
state=1;
@@ -401,19 +400,28 @@ char *sh_fmtq(const char *string)
default:
#if SHOPT_MULTIBYTE
if(!iswprint(c))
+ {
+ while(op<cp)
+ sfprintf(staksp,"\\%.3o",*(unsigned char*)op++);
+ continue;
+ }
#else
if(!isprint(c))
-#endif
{
sfprintf(staksp,"\\%.3o",c);
continue;
}
+#endif
state=0;
break;
}
if(state)
+ {
stakputc('\\');
- stakputc(c);
+ stakputc(c);
+ }
+ else
+ stakwrite(op, cp-op);
}
stakputc('\'');
}
diff --git a/usr/src/lib/libshell/common/sh/subshell.c b/usr/src/lib/libshell/common/sh/subshell.c
index 550e299d42..75dfc1f97d 100644
--- a/usr/src/lib/libshell/common/sh/subshell.c
+++ b/usr/src/lib/libshell/common/sh/subshell.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -47,6 +47,8 @@
struct Link
{
struct Link *next;
+ Namval_t *child;
+ Dt_t *dict;
Namval_t *node;
};
@@ -55,15 +57,14 @@ struct Link
*/
static struct subshell
{
+ Shell_t *shp; /* shell interpreter */
struct subshell *prev; /* previous subshell data */
struct subshell *pipe; /* subshell where output goes to pipe on fork */
Dt_t *var; /* variable table at time of subshell */
struct Link *svar; /* save shell variable table */
Dt_t *sfun; /* function scope for subshell */
Dt_t *salias;/* alias scope for subshell */
-#ifdef PATH_BFPATH
Pathcomp_t *pathlist; /* for PATH variable */
-#endif
#if (ERROR_VERSION >= 20030214L)
struct Error_context_s *errcontext;
#else
@@ -82,65 +83,73 @@ static struct subshell
char monitor;
unsigned char fdstatus;
int fdsaved; /* bit make for saved files */
- int bckpid;
+ int sig; /* signal for $$ */
+ pid_t bckpid;
+ pid_t cpid;
+ int coutpipe;
+ int cpipe;
+ int nofork;
} *subshell_data;
static int subenv;
/*
* This routine will turn the sftmp() file into a real /tmp file or pipe
- * if the /tmp file create fails
*/
-void sh_subtmpfile(void)
+void sh_subtmpfile(int pflag)
{
+ Shell_t *shp = &sh;
+ int fds[2];
+ Sfoff_t off;
if(sfset(sfstdout,0,0)&SF_STRING)
{
register int fd;
- register struct checkpt *pp = (struct checkpt*)sh.jmplist;
+ register struct checkpt *pp = (struct checkpt*)shp->jmplist;
register struct subshell *sp = subshell_data->pipe;
/* save file descriptor 1 if open */
if((sp->tmpfd = fd = fcntl(1,F_DUPFD,10)) >= 0)
{
fcntl(fd,F_SETFD,FD_CLOEXEC);
- sh.fdstatus[fd] = sh.fdstatus[1]|IOCLEX;
+ shp->fdstatus[fd] = shp->fdstatus[1]|IOCLEX;
close(1);
}
else if(errno!=EBADF)
errormsg(SH_DICT,ERROR_system(1),e_toomany);
- /* popping a discipline forces a /tmp file create */
- sfdisc(sfstdout,SF_POPDISC);
- if((fd=sffileno(sfstdout))<0)
- {
- /* unable to create the /tmp file so use a pipe */
- int fds[2];
- Sfoff_t off;
- sh_pipe(fds);
- sp->pipefd = fds[0];
- sh_fcntl(sp->pipefd,F_SETFD,FD_CLOEXEC);
- /* write the data to the pipe */
- if(off = sftell(sfstdout))
- write(fds[1],sfsetbuf(sfstdout,(Void_t*)sfstdout,0),(size_t)off);
- sfclose(sfstdout);
- if((sh_fcntl(fds[1],F_DUPFD, 1)) != 1)
- errormsg(SH_DICT,ERROR_system(1),e_file+4);
- sh_close(fds[1]);
- }
- else
+ if(!pflag)
{
- sh.fdstatus[fd] = IOREAD|IOWRITE;
- sfsync(sfstdout);
- if(fd==1)
- fcntl(1,F_SETFD,0);
- else
+ sfdisc(sfstdout,SF_POPDISC);
+ if((fd=sffileno(sfstdout))>=0)
{
- sfsetfd(sfstdout,1);
- sh.fdstatus[1] = sh.fdstatus[fd];
- sh.fdstatus[fd] = IOCLOSE;
+ sh.fdstatus[fd] = IOREAD|IOWRITE;
+ sfsync(sfstdout);
+ if(fd==1)
+ fcntl(1,F_SETFD,0);
+ else
+ {
+ sfsetfd(sfstdout,1);
+ sh.fdstatus[1] = sh.fdstatus[fd];
+ sh.fdstatus[fd] = IOCLOSE;
+ }
+ goto skip;
}
}
- sh_iostream(1);
+ sh_pipe(fds);
+ sp->pipefd = fds[0];
+ sh_fcntl(sp->pipefd,F_SETFD,FD_CLOEXEC);
+ /* write the data to the pipe */
+ if(off = sftell(sfstdout))
+ {
+ write(fds[1],sfsetbuf(sfstdout,(Void_t*)sfstdout,0),(size_t)off);
+ sfpurge(sfstdout);
+ }
+ sfclose(sfstdout);
+ if((sh_fcntl(fds[1],F_DUPFD, 1)) != 1)
+ errormsg(SH_DICT,ERROR_system(1),e_file+4);
+ sh_close(fds[1]);
+ skip:
+ sh_iostream(shp,1);
sfset(sfstdout,SF_SHARE|SF_PUBLIC,1);
- sfpool(sfstdout,sh.outpool,SF_WRITE);
+ sfpool(sfstdout,shp->outpool,SF_WRITE);
if(pp && pp->olist && pp->olist->strm == sfstdout)
pp->olist->strm = 0;
}
@@ -154,32 +163,50 @@ void sh_subtmpfile(void)
void sh_subfork(void)
{
register struct subshell *sp = subshell_data;
+ Shell_t *shp = sp->shp;
+ int curenv = shp->curenv;
pid_t pid;
/* see whether inside $(...) */
if(sp->pipe)
- sh_subtmpfile();
+ sh_subtmpfile(1);
+ shp->curenv = 0;
if(pid = sh_fork(0,NIL(int*)))
{
+ shp->curenv = curenv;
/* this is the parent part of the fork */
if(sp->subpid==0)
sp->subpid = pid;
- siglongjmp(*sh.jmplist,SH_JMPSUB);
+ siglongjmp(*shp->jmplist,SH_JMPSUB);
}
else
{
- int16_t subshell;
/* this is the child part of the fork */
/* setting subpid to 1 causes subshell to exit when reached */
sh_onstate(SH_FORKED);
sh_onstate(SH_NOLOG);
sh_offstate(SH_MONITOR);
subshell_data = 0;
- subshell = sh.subshell = 0;
- nv_putval(SH_SUBSHELLNOD, (char*)&subshell, NV_INT16);
+ shp->subshell = 0;
+ SH_SUBSHELLNOD->nvalue.s = 0;
sp->subpid=0;
}
}
+int nv_subsaved(register Namval_t *np)
+{
+ register struct subshell *sp;
+ register struct Link *lp;
+ for(sp = (struct subshell*)subshell_data; sp; sp=sp->prev)
+ {
+ for(lp=sp->svar; lp; lp = lp->next)
+ {
+ if(lp->node==np)
+ return(1);
+ }
+ }
+ return(0);
+}
+
/*
* This routine will make a copy of the given node in the
* layer created by the most recent subshell_fork if the
@@ -187,30 +214,74 @@ void sh_subfork(void)
*/
Namval_t *sh_assignok(register Namval_t *np,int add)
{
- register Namval_t *mp;
- register struct Link *lp;
+ register Namval_t *mp;
+ register struct Link *lp;
register struct subshell *sp = (struct subshell*)subshell_data;
- int save;
+ struct Ufunction *rp;
+ Shell_t *shp = sp->shp;
+ Dt_t *dp;
+ Namval_t *mpnext;
+ Namarr_t *ap;
+ int save;
/* don't bother with this */
if(!sp->shpwd || (nv_isnull(np) && !add))
return(np);
/* don't bother to save if in newer scope */
- if(nv_search((char*)np,sp->var,HASH_BUCKET)!=np)
- return(np);
+ if(!(rp=shp->st.real_fun) || !(dp=rp->sdict))
+ dp = sp->var;
+ if(np->nvenv && !nv_isattr(np,NV_MINIMAL|NV_EXPORT) && shp->last_root)
+ dp = shp->last_root;
+ if((mp=nv_search((char*)np,dp,HASH_BUCKET))!=np)
+ {
+ if(mp || !np->nvfun || np->nvfun->subshell>=sh.subshell)
+ return(np);
+ }
+ if((ap=nv_arrayptr(np)) && (mp=nv_opensub(np)))
+ {
+ shp->last_root = ap->table;
+ sh_assignok(mp,add);
+ if(!add || array_assoc(ap))
+ return(np);
+ }
for(lp=subshell_data->svar; lp; lp = lp->next)
{
if(lp->node==np)
return(np);
}
- mp = newof(0,Namval_t,1,0);
- lp = (struct Link*)mp;
+ /* first two pointers use linkage from np */
+ lp = (struct Link*)malloc(sizeof(*np)+2*sizeof(void*));
+ memset(lp,0, sizeof(*mp)+2*sizeof(void*));
lp->node = np;
+ if(!add && nv_isvtree(np))
+ {
+ Namval_t fake;
+ Dt_t *walk, *root=shp->var_tree;
+ char *name = nv_name(np);
+ int len = strlen(name);
+ fake.nvname = name;
+ mpnext = dtnext(root,&fake);
+ dp = root->walk?root->walk:root;
+ while(mp=mpnext)
+ {
+ walk = root->walk?root->walk:root;
+ mpnext = dtnext(root,mp);
+ if(memcmp(name,mp->nvname,len) || mp->nvname[len]!='.')
+ break;
+ nv_delete(mp,walk,NV_NOFREE);
+ *((Namval_t**)mp) = lp->child;
+ lp->child = mp;
+
+ }
+ }
+ lp->dict = dp;
+ mp = (Namval_t*)&lp->dict;
lp->next = subshell_data->svar;
subshell_data->svar = lp;
- save = sh.subshell;
- sh.subshell = 0;;
- nv_clone(np,mp,NV_NOFREE);
- sh.subshell = save;
+ save = shp->subshell;
+ shp->subshell = 0;
+ mp->nvname = np->nvname;
+ nv_clone(np,mp,(add?(nv_isnull(np)?0:NV_NOFREE)|NV_ARRAY:NV_MOVE));
+ shp->subshell = save;
return(np);
}
@@ -222,21 +293,29 @@ static void nv_restore(struct subshell *sp)
register struct Link *lp, *lq;
register Namval_t *mp, *np;
const char *save = sp->shpwd;
+ Namval_t *mpnext;
sp->shpwd = 0; /* make sure sh_assignok doesn't save with nv_unset() */
for(lp=sp->svar; lp; lp=lq)
{
- np = (Namval_t*)lp;
- mp = lp->node;
+ np = (Namval_t*)&lp->dict;
lq = lp->next;
+ mp = lp->node;
+ if(!mp->nvname)
+ continue;
if(nv_isarray(mp))
nv_putsub(mp,NIL(char*),ARRAY_SCAN);
_nv_unset(mp,NV_RDONLY);
+ if(nv_isarray(np))
+ {
+ nv_clone(np,mp,NV_MOVE);
+ goto skip;
+ }
nv_setsize(mp,nv_size(np));
if(!nv_isattr(np,NV_MINIMAL) || nv_isattr(np,NV_EXPORT))
mp->nvenv = np->nvenv;
mp->nvfun = np->nvfun;
mp->nvflag = np->nvflag;
- if((mp==nv_scoped(PATHNOD)) || (mp==nv_scoped(IFSNOD)))
+ if(nv_cover(mp))
nv_putval(mp, np->nvalue.cp,0);
else
mp->nvalue.cp = np->nvalue.cp;
@@ -250,7 +329,14 @@ static void nv_restore(struct subshell *sp)
}
else if(nv_isattr(np,NV_EXPORT))
env_delete(sh.env,nv_name(mp));
- free((void*)np);
+ skip:
+ for(mp=lp->child; mp; mp=mpnext)
+ {
+ mpnext = *((Namval_t**)mp);
+ dtinsert(lp->dict,mp);
+ }
+ free((void*)lp);
+ sp->svar = lq;
}
sp->shpwd=save;
}
@@ -288,18 +374,25 @@ Dt_t *sh_subfuntree(int create)
dtview(sp->sfun,sh.fun_tree);
sh.fun_tree = sp->sfun;
}
- return(sp->sfun);
+ return(sh.fun_tree);
}
-static void table_unset(register Dt_t *root)
+static void table_unset(register Dt_t *root,int fun)
{
register Namval_t *np,*nq;
+ int flag;
for(np=(Namval_t*)dtfirst(root);np;np=nq)
{
- _nv_unset(np,NV_RDONLY);
nq = (Namval_t*)dtnext(root,np);
- dtdelete(root,np);
- free((void*)np);
+ flag=0;
+ if(fun && np->nvalue.rp->fname && *np->nvalue.rp->fname=='/')
+ {
+ np->nvalue.rp->fdict = 0;
+ flag = NV_NOFREE;
+ }
+ else
+ _nv_unset(np,NV_RDONLY);
+ nv_delete(np,root,flag|NV_FUNCTION);
}
}
@@ -315,6 +408,22 @@ int sh_subsavefd(register int fd)
return(old);
}
+void sh_subjobcheck(pid_t pid)
+{
+ register struct subshell *sp = subshell_data;
+ while(sp)
+ {
+ if(sp->cpid==pid)
+ {
+ sh_close(sp->coutpipe);
+ sh_close(sp->cpipe);
+ sp->coutpipe = sp->cpipe = -1;
+ return;
+ }
+ sp = sp->prev;
+ }
+}
+
/*
* Run command tree <t> in a virtual sub-shell
* If comsub is not null, then output will be placed in temp file (or buffer)
@@ -327,8 +436,9 @@ Sfio_t *sh_subshell(Shnode_t *t, int flags, int comsub)
Shell_t *shp = &sh;
struct subshell sub_data;
register struct subshell *sp = &sub_data;
- int jmpval,nsig;
+ int jmpval,nsig=0;
int savecurenv = shp->curenv;
+ int savejobpgid = job.curpgid;
int16_t subshell;
char *savsig;
Sfio_t *iop=0;
@@ -337,38 +447,42 @@ Sfio_t *sh_subshell(Shnode_t *t, int flags, int comsub)
struct dolnod *argsav=0;
memset((char*)sp, 0, sizeof(*sp));
sfsync(shp->outpool);
- argsav = sh_arguse();
+ argsav = sh_arguse(shp);
if(shp->curenv==0)
{
subshell_data=0;
subenv = 0;
}
shp->curenv = ++subenv;
+ job.curpgid = 0;
savst = shp->st;
sh_pushcontext(&buff,SH_JMPSUB);
subshell = shp->subshell+1;
- nv_putval(SH_SUBSHELLNOD, (char*)&subshell, NV_INT16);
+ SH_SUBSHELLNOD->nvalue.s = subshell;
shp->subshell = subshell;
sp->prev = subshell_data;
+ sp->shp = shp;
+ sp->sig = 0;
subshell_data = sp;
sp->errcontext = &buff.err;
sp->var = shp->var_tree;
sp->options = shp->options;
sp->jobs = job_subsave();
-#ifdef PATH_BFPATH
/* make sure initialization has occurred */
if(!shp->pathlist)
path_get(".");
sp->pathlist = path_dup((Pathcomp_t*)shp->pathlist);
-#endif
if(!shp->pwd)
path_pwd(0);
sp->bckpid = shp->bckpid;
- if(!comsub || !sh_isoption(SH_SUBSHARE))
+ if(comsub)
+ sh_stats(STAT_COMSUB);
+ if(!comsub || (comsub==1 && !sh_isoption(SH_SUBSHARE)))
{
sp->shpwd = shp->pwd;
sp->pwd = (shp->pwd?strdup(shp->pwd):0);
sp->mask = shp->mask;
+ sh_stats(STAT_SUBSHELL);
/* save trap table */
shp->st.otrapcom = 0;
if((nsig=shp->st.trapmax*sizeof(char*))>0 || shp->st.trapcom[0])
@@ -378,6 +492,11 @@ Sfio_t *sh_subshell(Shnode_t *t, int flags, int comsub)
/* this nonsense needed for $(trap) */
shp->st.otrapcom = (char**)savsig;
}
+ sp->cpid = shp->cpid;
+ sp->coutpipe = shp->coutpipe;
+ sp->cpipe = shp->cpipe[1];
+ shp->coutpipe = shp->cpipe[1] = -1;
+ shp->cpid = 0;
sh_sigreset(0);
}
jmpval = sigsetjmp(buff.buff,0);
@@ -386,6 +505,7 @@ Sfio_t *sh_subshell(Shnode_t *t, int flags, int comsub)
if(comsub)
{
/* disable job control */
+ shp->spid = 0;
sp->jobcontrol = job.jobcontrol;
sp->monitor = (sh_isstate(SH_MONITOR)!=0);
job.jobcontrol=0;
@@ -405,6 +525,9 @@ Sfio_t *sh_subshell(Shnode_t *t, int flags, int comsub)
sfswap(iop,sfstdout);
sfset(sfstdout,SF_READ,0);
shp->fdstatus[1] = IOWRITE;
+ if(!(sp->nofork = sh_state(SH_NOFORK)))
+ sh_onstate(SH_NOFORK);
+ flags |= sh_state(SH_NOFORK);
}
else if(sp->prev)
{
@@ -413,7 +536,7 @@ Sfio_t *sh_subshell(Shnode_t *t, int flags, int comsub)
}
sh_exec(t,flags);
}
- if(jmpval!=SH_JMPSUB && shp->st.trapcom[0] && shp->subshell)
+ if(comsub!=2 && jmpval!=SH_JMPSUB && shp->st.trapcom[0] && shp->subshell)
{
/* trap on EXIT not handled by child */
char *trap=shp->st.trapcom[0];
@@ -428,19 +551,20 @@ Sfio_t *sh_subshell(Shnode_t *t, int flags, int comsub)
subshell_data = sp->prev;
if(jmpval==SH_JMPSCRIPT)
siglongjmp(*shp->jmplist,jmpval);
- sh_done(0);
+ sh_done(shp,0);
}
if(comsub)
{
/* re-enable job control */
+ if(!sp->nofork)
+ sh_offstate(SH_NOFORK);
job.jobcontrol = sp->jobcontrol;
if(sp->monitor)
sh_onstate(SH_MONITOR);
if(sp->pipefd>=0)
{
/* sftmp() file has been returned into pipe */
- iop = sh_iostream(sp->pipefd);
- sfdisc(iop,SF_POPDISC);
+ iop = sh_iostream(shp,sp->pipefd);
sfclose(sfstdout);
}
else
@@ -476,37 +600,44 @@ Sfio_t *sh_subshell(Shnode_t *t, int flags, int comsub)
shp->fdstatus[1] = sp->fdstatus;
}
if(sp->subpid)
- job_wait(sp->subpid);
- if(comsub && iop)
+ {
+ if(shp->exitval > SH_EXITSIG)
+ sp->sig = (shp->exitval&SH_EXITMASK);
+ shp->exitval = 0;
+ if(comsub)
+ shp->spid = sp->subpid;
+ else
+ job_wait(sp->subpid);
+ }
+ if(comsub && iop && sp->pipefd<0)
sfseek(iop,(off_t)0,SEEK_SET);
- if(shp->subshell)
- shp->subshell--;
- subshell = shp->subshell;
- nv_putval(SH_SUBSHELLNOD, (char*)&subshell, NV_INT16);
-#ifdef PATH_BFPATH
path_delete((Pathcomp_t*)shp->pathlist);
shp->pathlist = (void*)sp->pathlist;
-#endif
job_subrestore(sp->jobs);
shp->jobenv = savecurenv;
+ job.curpgid = savejobpgid;
shp->bckpid = sp->bckpid;
if(sp->shpwd) /* restore environment if saved */
{
+ int n;
shp->options = sp->options;
nv_restore(sp);
if(sp->salias)
{
shp->alias_tree = dtview(sp->salias,0);
- table_unset(sp->salias);
+ table_unset(sp->salias,0);
dtclose(sp->salias);
}
if(sp->sfun)
{
shp->fun_tree = dtview(sp->sfun,0);
- table_unset(sp->sfun);
+ table_unset(sp->sfun,1);
dtclose(sp->sfun);
}
+ n = shp->st.trapmax-savst.trapmax;
sh_sigreset(1);
+ if(n>0)
+ memset(&shp->st.trapcom[savst.trapmax],0,n*sizeof(char*));
shp->st = savst;
shp->curenv = savecurenv;
if(nsig)
@@ -518,13 +649,11 @@ Sfio_t *sh_subshell(Shnode_t *t, int flags, int comsub)
if(!shp->pwd || strcmp(sp->pwd,shp->pwd))
{
/* restore PWDNOD */
- Namval_t *pwdnod = nv_scoped(PWDNOD);
+ Namval_t *pwdnod = sh_scoped(shp,PWDNOD);
if(shp->pwd)
{
chdir(shp->pwd=sp->pwd);
-#ifdef PATH_BFPATH
path_newdir(shp->pathlist);
-#endif
}
if(nv_isattr(pwdnod,NV_NOFREE))
pwdnod->nvalue.cp = (const char*)sp->pwd;
@@ -538,13 +667,34 @@ Sfio_t *sh_subshell(Shnode_t *t, int flags, int comsub)
else
free((void*)sp->pwd);
if(sp->mask!=shp->mask)
- umask(shp->mask);
+ umask(shp->mask=sp->mask);
+ if(shp->coutpipe>=0)
+ {
+ sh_close(shp->coutpipe);
+ sh_close(shp->cpipe[1]);
+ }
+ shp->cpid = sp->cpid;
+ shp->cpipe[1] = sp->cpipe;
+ shp->coutpipe = sp->coutpipe;
}
+ if(shp->subshell)
+ SH_SUBSHELLNOD->nvalue.s = --shp->subshell;
+ if(sp->sig)
+ {
+ if(sp->prev)
+ sp->prev->sig = sp->sig;
+ else
+ {
+ sh_fault(sp->sig);
+ sh_chktrap();
+ }
+ }
+ subshell = shp->subshell;
subshell_data = sp->prev;
- sh_argfree(argsav,0);
+ sh_argfree(shp,argsav,0);
shp->trapnote = 0;
if(shp->topfd != buff.topfd)
- sh_iorestore(buff.topfd|IOSUBSHELL,jmpval);
+ sh_iorestore(shp,buff.topfd|IOSUBSHELL,jmpval);
if(shp->exitval > SH_EXITSIG)
{
int sig = shp->exitval&SH_EXITMASK;
diff --git a/usr/src/lib/libshell/common/sh/suid_exec.c b/usr/src/lib/libshell/common/sh/suid_exec.c
index 0495d29890..461dc7879a 100644
--- a/usr/src/lib/libshell/common/sh/suid_exec.c
+++ b/usr/src/lib/libshell/common/sh/suid_exec.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libshell/common/sh/tdump.c b/usr/src/lib/libshell/common/sh/tdump.c
index 80ef55a9aa..c5d6b25c99 100644
--- a/usr/src/lib/libshell/common/sh/tdump.c
+++ b/usr/src/lib/libshell/common/sh/tdump.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -160,7 +160,7 @@ static int p_arg(register const struct argnod *arg)
struct fornod *fp;
while(arg)
{
- if((n = strlen(arg->argval)) || (arg->argflag&~ARG_APPEND))
+ if((n = strlen(arg->argval)) || (arg->argflag&~(ARG_APPEND|ARG_MESSAGE|ARG_QUOTED)))
fp=0;
else
{
diff --git a/usr/src/lib/libshell/common/sh/timers.c b/usr/src/lib/libshell/common/sh/timers.c
index ae57a3336f..796b43cf5a 100644
--- a/usr/src/lib/libshell/common/sh/timers.c
+++ b/usr/src/lib/libshell/common/sh/timers.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libshell/common/sh/trestore.c b/usr/src/lib/libshell/common/sh/trestore.c
index d866ca712f..b9fc63d82f 100644
--- a/usr/src/lib/libshell/common/sh/trestore.c
+++ b/usr/src/lib/libshell/common/sh/trestore.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -32,29 +32,29 @@
#include "path.h"
#include "io.h"
-static struct dolnod *r_comlist(void);
-static struct argnod *r_arg(void);
-static struct ionod *r_redirect(void);
-static struct regnod *r_switch(void);
-static Shnode_t *r_tree(void);
-static char *r_string(void);
-static void r_comarg(struct comnod*);
+static struct dolnod *r_comlist(Shell_t*);
+static struct argnod *r_arg(Shell_t*);
+static struct ionod *r_redirect(Shell_t*);
+static struct regnod *r_switch(Shell_t*);
+static Shnode_t *r_tree(Shell_t*);
+static char *r_string(Stk_t*);
+static void r_comarg(Shell_t*,struct comnod*);
static Sfio_t *infile;
-#define getnode(type) ((Shnode_t*)stakalloc(sizeof(struct type)))
+#define getnode(s,type) ((Shnode_t*)stkalloc((s),sizeof(struct type)))
-Shnode_t *sh_trestore(Sfio_t *in)
+Shnode_t *sh_trestore(Shell_t *shp,Sfio_t *in)
{
Shnode_t *t;
infile = in;
- t = r_tree();
+ t = r_tree(shp);
return(t);
}
/*
* read in a shell tree
*/
-static Shnode_t *r_tree()
+static Shnode_t *r_tree(Shell_t *shp)
{
long l = sfgetl(infile);
register int type;
@@ -66,101 +66,101 @@ static Shnode_t *r_tree()
{
case TTIME:
case TPAR:
- t = getnode(parnod);
- t->par.partre = r_tree();
+ t = getnode(shp->stk,parnod);
+ t->par.partre = r_tree(shp);
break;
case TCOM:
- t = getnode(comnod);
+ t = getnode(shp->stk,comnod);
t->tre.tretyp = type;
- r_comarg((struct comnod*)t);
+ r_comarg(shp,(struct comnod*)t);
break;
case TSETIO:
case TFORK:
- t = getnode(forknod);
+ t = getnode(shp->stk,forknod);
t->fork.forkline = sfgetu(infile);
- t->fork.forktre = r_tree();
- t->fork.forkio = r_redirect();
+ t->fork.forktre = r_tree(shp);
+ t->fork.forkio = r_redirect(shp);
break;
case TIF:
- t = getnode(ifnod);
- t->if_.iftre = r_tree();
- t->if_.thtre = r_tree();
- t->if_.eltre = r_tree();
+ t = getnode(shp->stk,ifnod);
+ t->if_.iftre = r_tree(shp);
+ t->if_.thtre = r_tree(shp);
+ t->if_.eltre = r_tree(shp);
break;
case TWH:
- t = getnode(whnod);
- t->wh.whinc = (struct arithnod*)r_tree();
- t->wh.whtre = r_tree();
- t->wh.dotre = r_tree();
+ t = getnode(shp->stk,whnod);
+ t->wh.whinc = (struct arithnod*)r_tree(shp);
+ t->wh.whtre = r_tree(shp);
+ t->wh.dotre = r_tree(shp);
break;
case TLST:
case TAND:
case TORF:
case TFIL:
- t = getnode(lstnod);
- t->lst.lstlef = r_tree();
- t->lst.lstrit = r_tree();
+ t = getnode(shp->stk,lstnod);
+ t->lst.lstlef = r_tree(shp);
+ t->lst.lstrit = r_tree(shp);
break;
case TARITH:
- t = getnode(arithnod);
+ t = getnode(shp->stk,arithnod);
t->ar.arline = sfgetu(infile);
- t->ar.arexpr = r_arg();
+ t->ar.arexpr = r_arg(shp);
t->ar.arcomp = 0;
if((t->ar.arexpr)->argflag&ARG_RAW)
t->ar.arcomp = sh_arithcomp((t->ar.arexpr)->argval);
break;
case TFOR:
- t = getnode(fornod);
+ t = getnode(shp->stk,fornod);
t->for_.forline = 0;
if(type&FLINENO)
t->for_.forline = sfgetu(infile);
- t->for_.fortre = r_tree();
- t->for_.fornam = r_string();
- t->for_.forlst = (struct comnod*)r_tree();
+ t->for_.fortre = r_tree(shp);
+ t->for_.fornam = r_string(shp->stk);
+ t->for_.forlst = (struct comnod*)r_tree(shp);
break;
case TSW:
- t = getnode(swnod);
+ t = getnode(shp->stk,swnod);
t->sw.swline = 0;
if(type&FLINENO)
t->sw.swline = sfgetu(infile);
- t->sw.swarg = r_arg();
+ t->sw.swarg = r_arg(shp);
if(type&COMSCAN)
- t->sw.swio = r_redirect();
+ t->sw.swio = r_redirect(shp);
else
t->sw.swio = 0;
- t->sw.swlst = r_switch();
+ t->sw.swlst = r_switch(shp);
break;
case TFUN:
{
Stak_t *savstak;
struct slnod *slp;
- t = getnode(functnod);
+ t = getnode(shp->stk,functnod);
t->funct.functloc = -1;
t->funct.functline = sfgetu(infile);
- t->funct.functnam = r_string();
+ t->funct.functnam = r_string(shp->stk);
savstak = stakcreate(STAK_SMALL);
savstak = stakinstall(savstak, 0);
- slp = (struct slnod*)stakalloc(sizeof(struct slnod));
+ slp = (struct slnod*)stkalloc(shp->stk,sizeof(struct slnod));
slp->slchild = 0;
- slp->slnext = sh.st.staklist;
- sh.st.staklist = 0;
- t->funct.functtre = r_tree();
+ slp->slnext = shp->st.staklist;
+ shp->st.staklist = 0;
+ t->funct.functtre = r_tree(shp);
t->funct.functstak = slp;
slp->slptr = stakinstall(savstak,0);
- slp->slchild = sh.st.staklist;
- t->funct.functargs = (struct comnod*)r_tree();
+ slp->slchild = shp->st.staklist;
+ t->funct.functargs = (struct comnod*)r_tree(shp);
break;
}
case TTST:
- t = getnode(tstnod);
+ t = getnode(shp->stk,tstnod);
t->tst.tstline = sfgetu(infile);
if((type&TPAREN)==TPAREN)
- t->lst.lstlef = r_tree();
+ t->lst.lstlef = r_tree(shp);
else
{
- t->lst.lstlef = (Shnode_t*)r_arg();
+ t->lst.lstlef = (Shnode_t*)r_arg(shp);
if((type&TBINARY))
- t->lst.lstrit = (Shnode_t*)r_arg();
+ t->lst.lstrit = (Shnode_t*)r_arg(shp);
}
}
if(t)
@@ -168,13 +168,14 @@ static Shnode_t *r_tree()
return(t);
}
-static struct argnod *r_arg(void)
+static struct argnod *r_arg(Shell_t *shp)
{
register struct argnod *ap=0, *apold, *aptop=0;
register long l;
+ Stk_t *stkp=shp->stk;
while((l=sfgetu(infile))>0)
{
- ap = (struct argnod*)stakseek((unsigned)l+ARGVAL);
+ ap = (struct argnod*)stkseek(stkp,(unsigned)l+ARGVAL);
if(!aptop)
aptop = ap;
else
@@ -187,27 +188,27 @@ static struct argnod *r_arg(void)
ap->argval[l] = 0;
ap->argchn.cp = 0;
ap->argflag = sfgetc(infile);
- if(ap->argflag&ARG_MESSAGE)
+ if((ap->argflag&ARG_MESSAGE) && *ap->argval)
{
/* replace international messages */
- ap = sh_endword(1);
+ ap = sh_endword(shp,1);
ap->argflag &= ~ARG_MESSAGE;
if(!(ap->argflag&(ARG_MAC|ARG_EXP)))
- ap = sh_endword(0);
+ ap = sh_endword(shp,0);
else
{
- ap = (struct argnod*)stakfreeze(0);
+ ap = (struct argnod*)stkfreeze(stkp,0);
if(ap->argflag==0)
ap->argflag = ARG_RAW;
}
}
else
- ap = (struct argnod*)stakfreeze(0);
- if(*ap->argval==0 && (ap->argflag&~ARG_APPEND)==0)
+ ap = (struct argnod*)stkfreeze(stkp,0);
+ if(*ap->argval==0 && (ap->argflag&~(ARG_APPEND|ARG_MESSAGE|ARG_QUOTED))==0)
{
- struct fornod *fp = (struct fornod*)getnode(fornod);
+ struct fornod *fp = (struct fornod*)getnode(shp->stk,fornod);
fp->fortyp = sfgetu(infile);
- fp->fortre = r_tree();
+ fp->fortre = r_tree(shp);
fp->fornam = ap->argval+1;
ap->argchn.ap = (struct argnod*)fp;
}
@@ -218,34 +219,34 @@ static struct argnod *r_arg(void)
return(aptop);
}
-static struct ionod *r_redirect(void)
+static struct ionod *r_redirect(Shell_t* shp)
{
register long l;
register struct ionod *iop=0, *iopold, *ioptop=0;
while((l=sfgetl(infile))>=0)
{
- iop = (struct ionod*)getnode(ionod);
+ iop = (struct ionod*)getnode(shp->stk,ionod);
if(!ioptop)
ioptop = iop;
else
iopold->ionxt = iop;
iop->iofile = l;
- iop->ioname = r_string();
- if(iop->iodelim = r_string())
+ iop->ioname = r_string(shp->stk);
+ if(iop->iodelim = r_string(shp->stk))
{
iop->iosize = sfgetl(infile);
- if(sh.heredocs)
- iop->iooffset = sfseek(sh.heredocs,(off_t)0,SEEK_END);
+ if(shp->heredocs)
+ iop->iooffset = sfseek(shp->heredocs,(off_t)0,SEEK_END);
else
{
- sh.heredocs = sftmp(512);
+ shp->heredocs = sftmp(512);
iop->iooffset = 0;
}
- sfmove(infile,sh.heredocs, iop->iosize, -1);
+ sfmove(infile,shp->heredocs, iop->iosize, -1);
}
iopold = iop;
if(iop->iofile&IOVNM)
- iop->iovname = r_string();
+ iop->iovname = r_string(shp->stk);
else
iop->iovname = 0;
iop->iofile &= ~IOVNM;
@@ -255,30 +256,30 @@ static struct ionod *r_redirect(void)
return(ioptop);
}
-static void r_comarg(struct comnod *com)
+static void r_comarg(Shell_t *shp,struct comnod *com)
{
char *cmdname=0;
- com->comio = r_redirect();
- com->comset = r_arg();
+ com->comio = r_redirect(shp);
+ com->comset = r_arg(shp);
com->comstate = 0;
if(com->comtyp&COMSCAN)
{
- com->comarg = r_arg();
+ com->comarg = r_arg(shp);
if(com->comarg->argflag==ARG_RAW)
cmdname = com->comarg->argval;
}
- else if(com->comarg = (struct argnod*)r_comlist())
+ else if(com->comarg = (struct argnod*)r_comlist(shp))
cmdname = ((struct dolnod*)(com->comarg))->dolval[ARG_SPARE];
com->comline = sfgetu(infile);
com->comnamq = 0;
if(cmdname)
{
char *cp;
- com->comnamp = (void*)nv_search(cmdname,sh.fun_tree,0);
+ com->comnamp = (void*)nv_search(cmdname,shp->fun_tree,0);
if(com->comnamp && (cp =strrchr(cmdname+1,'.')))
{
*cp = 0;
- com->comnamp = (void*)nv_open(cmdname,sh.var_tree,NV_VARNAME|NV_NOADD|NV_NOARRAY);
+ com->comnamp = (void*)nv_open(cmdname,shp->var_tree,NV_VARNAME|NV_NOADD|NV_NOARRAY);
*cp = '.';
}
}
@@ -286,36 +287,36 @@ static void r_comarg(struct comnod *com)
com->comnamp = 0;
}
-static struct dolnod *r_comlist(void)
+static struct dolnod *r_comlist(Shell_t *shp)
{
register struct dolnod *dol=0;
register long l;
register char **argv;
if((l=sfgetl(infile))>0)
{
- dol = (struct dolnod*)stakalloc(sizeof(struct dolnod) + sizeof(char*)*(l+ARG_SPARE));
+ dol = (struct dolnod*)stkalloc(shp->stk,sizeof(struct dolnod) + sizeof(char*)*(l+ARG_SPARE));
dol->dolnum = l;
dol->dolbot = ARG_SPARE;
argv = dol->dolval+ARG_SPARE;
- while(*argv++ = r_string());
+ while(*argv++ = r_string(shp->stk));
}
return(dol);
}
-static struct regnod *r_switch(void)
+static struct regnod *r_switch(Shell_t *shp)
{
register long l;
struct regnod *reg=0,*regold,*regtop=0;
while((l=sfgetl(infile))>=0)
{
- reg = (struct regnod*)getnode(regnod);
+ reg = (struct regnod*)getnode(shp->stk,regnod);
if(!regtop)
regtop = reg;
else
regold->regnxt = reg;
reg->regflag = l;
- reg->regptr = r_arg();
- reg->regcom = r_tree();
+ reg->regptr = r_arg(shp);
+ reg->regcom = r_tree(shp);
regold = reg;
}
if(reg)
@@ -323,14 +324,14 @@ static struct regnod *r_switch(void)
return(regtop);
}
-static char *r_string(void)
+static char *r_string(Stk_t *stkp)
{
register Sfio_t *in = infile;
register unsigned long l = sfgetu(in);
register char *ptr;
if(l == 0)
return(NIL(char*));
- ptr = stakalloc((unsigned)l);
+ ptr = stkalloc(stkp,(unsigned)l);
if(--l > 0)
{
if(sfread(in,ptr,(size_t)l)!=(size_t)l)
diff --git a/usr/src/lib/libshell/common/sh/waitevent.c b/usr/src/lib/libshell/common/sh/waitevent.c
index fb7329f471..f187a3085d 100644
--- a/usr/src/lib/libshell/common/sh/waitevent.c
+++ b/usr/src/lib/libshell/common/sh/waitevent.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
diff --git a/usr/src/lib/libshell/common/sh/xec.c b/usr/src/lib/libshell/common/sh/xec.c
index 378492256e..a930c18460 100644
--- a/usr/src/lib/libshell/common/sh/xec.c
+++ b/usr/src/lib/libshell/common/sh/xec.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -45,6 +45,12 @@
# include <vmalloc.h>
#endif
+#if _lib_vfork
+# include <ast_vfork.h>
+#else
+# define vfork() fork()
+#endif
+
#define SH_NTFORK SH_TIMING
#if _lib_nice
@@ -54,12 +60,12 @@
# define spawnveg(a,b,c,d) spawnve(a,b,c)
#endif /* !_lib_spawnveg */
#if SHOPT_SPAWN
- static pid_t sh_ntfork(const Shnode_t*,char*[],int*,int);
+ static pid_t sh_ntfork(Shell_t*,const Shnode_t*,char*[],int*,int);
#endif /* SHOPT_SPAWN */
-static void sh_funct(Namval_t*, int, char*[], struct argnod*,int);
+static void sh_funct(Shell_t *,Namval_t*, int, char*[], struct argnod*,int);
static int trim_eq(const char*, const char*);
-static void coproc_init(int pipes[]);
+static void coproc_init(Shell_t*, int pipes[]);
static void *timeout;
static char pipejob;
@@ -96,16 +102,17 @@ static void l_time(Sfio_t *outfile,register clock_t t,int p)
sfprintf(outfile,"%dm%ds",min,sec);
}
-static int p_time(Sfio_t *out, const char *format, clock_t *tm)
+static int p_time(Shell_t *shp, Sfio_t *out, const char *format, clock_t *tm)
{
- int c,p,l,n,offset = staktell();
- const char *first;
- double d;
+ int c,p,l,n,offset = staktell();
+ const char *first;
+ double d;
+ Stk_t *stkp = shp->stk;
for(first=format ; c= *format; format++)
{
if(c!='%')
continue;
- stakwrite(first, format-first);
+ sfwrite(stkp, first, format-first);
n = l = 0;
p = 3;
if((c= *++format) == '%')
@@ -136,24 +143,24 @@ static int p_time(Sfio_t *out, const char *format, clock_t *tm)
n = 2;
else if(c!='R')
{
- stakseek(offset);
+ stkseek(stkp,offset);
errormsg(SH_DICT,ERROR_exit(0),e_badtformat,c);
return(0);
}
d = (double)tm[n]/sh.lim.clk_tck;
skip:
if(l)
- l_time(stkstd, tm[n], p);
+ l_time(stkp, tm[n], p);
else
- sfprintf(stkstd,"%.*f",p, d);
+ sfprintf(stkp,"%.*f",p, d);
first = format+1;
}
if(format>first)
- stakwrite(first, format-first);
- stakputc('\n');
- n = staktell()-offset;
- sfwrite(out,stakptr(offset),n);
- stakseek(offset);
+ sfwrite(stkp,first, format-first);
+ sfputc(stkp,'\n');
+ n = stktell(stkp)-offset;
+ sfwrite(out,stkptr(stkp,offset),n);
+ stkseek(stkp,offset);
return(n);
}
@@ -172,13 +179,17 @@ static int p_comarg(register struct comnod *com)
if(com->comstate && np)
{
/* call builtin to cleanup state */
- Nambltin_t bdata;
- bdata.shp = &sh;
- bdata.np = com->comnamq;
- bdata.ptr =nv_context(np);
- bdata.data = com->comstate;
- bdata.flags = SH_END_OPTIM;
- (*funptr(np))(0,(char**)0, &bdata);
+ Shbltin_t *bp = &sh.bltindata;
+ void *save_ptr = bp->ptr;
+ void *save_data = bp->data;
+ bp->bnode = np;
+ bp->vnode = com->comnamq;
+ bp->ptr = nv_context(np);
+ bp->data = com->comstate;
+ bp->flags = SH_END_OPTIM;
+ (*funptr(np))(0,(char**)0, bp);
+ bp->ptr = save_ptr;
+ bp->data = save_data;
}
com->comstate = 0;
if(com->comarg && !np)
@@ -312,7 +323,7 @@ static void out_string(Sfio_t *iop, register const char *cp, int c, int quoted)
{
if(quoted)
{
- int n = staktell();
+ int n = stktell(stkstd);
cp = sh_fmtq(cp);
if(iop==stkstd && cp==stkptr(stkstd,n))
{
@@ -340,10 +351,12 @@ static void put_level(Namval_t* np,const char *val,int flags,Namfun_t *fp)
struct Level *lp = (struct Level*)fp;
int16_t level, oldlevel = (int16_t)nv_getnum(np);
nv_putv(np,val,flags,fp);
+ if(!val)
+ return;
level = nv_getnum(np);
if(level<0 || level > lp->maxlevel)
{
- nv_putv(np, (char*)&oldlevel, flags, fp);
+ nv_putv(np, (char*)&oldlevel, NV_INT16, fp);
/* perhaps this should be an error */
return;
}
@@ -351,28 +364,42 @@ static void put_level(Namval_t* np,const char *val,int flags,Namfun_t *fp)
return;
if(sp = sh_getscope(level,SEEK_SET))
{
- sh_setscope(sp);
- error_info.line = sp->lineno;
+ sh_setscope(sp);
+ error_info.id = sp->cmdname;
+
}
- nv_putval(SH_PATHNAMENOD, sh.st.filename ,NV_NOFREE);
}
-static const Namdisc_t level_disc = { 0, put_level };
+static const Namdisc_t level_disc = { sizeof(struct Level), put_level };
+
+static struct Level *init_level(int level)
+{
+ struct Level *lp = newof(NiL,struct Level,1,0);
+ lp->maxlevel = level;
+ _nv_unset(SH_LEVELNOD,0);
+ nv_onattr(SH_LEVELNOD,NV_INT16|NV_NOFREE);
+ nv_putval(SH_LEVELNOD,(char*)&lp->maxlevel,NV_INT16);
+ lp->hdr.disc = &level_disc;
+ nv_disc(SH_LEVELNOD,&lp->hdr,NV_FIRST);
+ return(lp);
+}
/*
* write the current common on the stack and make it available as .sh.command
*/
-int sh_debug(const char *trap, const char *name, const char *subscript, char *const argv[], int flags)
+int sh_debug(Shell_t *shp, const char *trap, const char *name, const char *subscript, char *const argv[], int flags)
{
+ Stk_t *stkp=shp->stk;
struct sh_scoped savst;
- Shscope_t *sp, *topmost;
Namval_t *np = SH_COMMANDNOD;
- struct Level lev;
- char *sav = stakptr(0);
- int n=4, offset=staktell();
+ char *sav = stkptr(stkp,0);
+ int n=4, offset=stktell(stkp);
const char *cp = "+=( ";
Sfio_t *iop = stkstd;
- int16_t level;
+ short level;
+ if(shp->indebug)
+ return(0);
+ shp->indebug = 1;
if(name)
{
sfputr(iop,name,-1);
@@ -400,33 +427,29 @@ int sh_debug(const char *trap, const char *name, const char *subscript, char *co
if(flags&ARG_ASSIGN)
sfputc(iop,')');
else if(iop==stkstd)
- *stakptr(staktell()-1) = 0;
- np->nvalue.cp = stakfreeze(1);
- sh.st.lineno = error_info.line;
+ *stkptr(stkp,stktell(stkp)-1) = 0;
+ np->nvalue.cp = stkfreeze(stkp,1);
/* now setup .sh.level variable */
- topmost = sh_getscope(0,SEEK_END);
- for(level=0, sp=topmost; sp; sp=sp->par_scope)
- level++;
- memset((void*)&lev,0,sizeof(lev));
- lev.hdr.disc = &level_disc;
- lev.maxlevel = --level;
- nv_unset(SH_LEVELNOD);
- nv_onattr(SH_LEVELNOD,NV_INT16|NV_NOFREE);
- nv_putval(SH_LEVELNOD,(char*)&level,NV_INT16);
- nv_disc(SH_LEVELNOD,&lev.hdr,NV_FIRST);
- savst = sh.st;
- sh.st.trap[SH_DEBUGTRAP] = 0;
+ shp->st.lineno = error_info.line;
+ level = shp->fn_depth+shp->dot_depth;
+ if(!SH_LEVELNOD->nvfun || !SH_LEVELNOD->nvfun->disc || nv_isattr(SH_LEVELNOD,NV_INT16|NV_NOFREE)!=(NV_INT16|NV_NOFREE))
+ init_level(level);
+ else
+ nv_putval(SH_LEVELNOD,(char*)&level,NV_INT16);
+ savst = shp->st;
+ shp->st.trap[SH_DEBUGTRAP] = 0;
n = sh_trap(trap,0);
np->nvalue.cp = 0;
- nv_putval(SH_LEVELNOD,(char*)&level,NV_INT16);
- nv_disc(SH_LEVELNOD,&lev.hdr,NV_POP);
- nv_unset(SH_LEVELNOD);
- nv_putval(SH_PATHNAMENOD, sh.st.filename ,NV_NOFREE);
- sh.st = savst;
- if(sav != stakptr(0))
- stakset(sav,0);
+ shp->indebug = 0;
+ if(shp->st.cmdname)
+ error_info.id = shp->st.cmdname;
+ nv_putval(SH_PATHNAMENOD,shp->st.filename,NV_NOFREE);
+ nv_putval(SH_FUNNAMENOD,shp->st.funname,NV_NOFREE);
+ shp->st = savst;
+ if(sav != stkptr(stkp,0))
+ stkset(stkp,sav,0);
else
- stakseek(offset);
+ stkseek(stkp,offset);
return(n);
}
@@ -442,14 +465,30 @@ int sh_eval(register Sfio_t *iop, int mode)
struct checkpt *pp = (struct checkpt*)shp->jmplist;
struct checkpt buff;
static Sfio_t *io_save;
+ volatile int traceon=0, lineno=0;
io_save = iop; /* preserve correct value across longjmp */
+#define SH_TOPFUN 0x8000 /* this is a temporary tksh hack */
+ if (mode & SH_TOPFUN)
+ {
+ mode ^= SH_TOPFUN;
+ shp->fn_reset = 1;
+ }
sh_pushcontext(&buff,SH_JMPEVAL);
buff.olist = pp->olist;
jmpval = sigsetjmp(buff.buff,0);
if(jmpval==0)
{
- t = (Shnode_t*)sh_parse(shp,iop,SH_NL);
- sfclose(iop);
+ if(mode&SH_READEVAL)
+ {
+ lineno = shp->inlineno;
+ if(traceon=sh_isoption(SH_XTRACE))
+ sh_offoption(SH_XTRACE);
+ }
+ t = (Shnode_t*)sh_parse(shp,iop,(mode&SH_READEVAL)?0:SH_NL);
+ if(mode&SH_READEVAL)
+ mode &= SH_READEVAL;
+ else
+ sfclose(iop);
io_save = 0;
if(!sh_isoption(SH_VERBOSE))
sh_offstate(SH_VERBOSE);
@@ -461,57 +500,63 @@ int sh_eval(register Sfio_t *iop, int mode)
sh_exec(t,sh_isstate(SH_ERREXIT)|mode);
}
sh_popcontext(&buff);
+ if(traceon)
+ sh_onoption(SH_XTRACE);
+ if(lineno)
+ shp->inlineno = lineno;
if(io_save)
sfclose(io_save);
- sh_freeup();
+ sh_freeup(shp);
shp->st.staklist = saveslp;
+ shp->fn_reset = 0;
if(jmpval>SH_JMPEVAL)
siglongjmp(*shp->jmplist,jmpval);
- return(sh.exitval);
+ return(shp->exitval);
}
#if SHOPT_FASTPIPE
-static int pipe_exec(int pv[], Shnode_t *t, int errorflg)
+static int pipe_exec(Shell_t* shp,int pv[], Shnode_t *t, int errorflg)
{
struct checkpt buff;
register Shnode_t *tchild = t->fork.forktre;
Namval_t *np;
- Sfio_t *iop;
- int jmpval,r;
+ int jmpval;
+ volatile Sfio_t *iop;
+ volatile int r;
if((tchild->tre.tretyp&COMMSK)!=TCOM || !(np=(Namval_t*)(tchild->com.comnamp)))
{
sh_pipe(pv);
return(sh_exec(t,errorflg));
}
- pv[0] = sh.lim.open_max;
- sh.fdstatus[pv[0]] = IOREAD|IODUP|IOSEEK;
- pv[1] = sh.lim.open_max+1;
- sh.fdstatus[pv[1]] = IOWRITE|IOSEEK;
+ pv[0] = shp->lim.open_max;
+ shp->fdstatus[pv[0]] = IOREAD|IODUP|IOSEEK;
+ pv[1] = shp->lim.open_max+1;
+ shp->fdstatus[pv[1]] = IOWRITE|IOSEEK;
iop = sftmp(IOBSIZE+1);
- sh.sftable[sh.lim.open_max+1] = iop;
+ shp->sftable[shp->lim.open_max+1] = iop;
sh_pushcontext(&buff,SH_JMPIO);
if(t->tre.tretyp&FPIN)
- sh_iosave(0,sh.topfd);
- sh_iosave(1,sh.topfd);
+ sh_iosave(shp,0,shp->topfd,(char*)0);
+ sh_iosave(shp,1,shp->topfd,(char*)0);
jmpval = sigsetjmp(buff.buff,0);
if(jmpval==0)
{
if(t->tre.tretyp&FPIN)
- sh_iorenumber(sh.inpipe[0],0);
- sh_iorenumber(sh.lim.open_max+1,1);
+ sh_iorenumber(shp,shp->inpipe[0],0);
+ sh_iorenumber(shp,shp->lim.open_max+1,1);
r = sh_exec(tchild,errorflg);
if(sffileno(sfstdout)>=0)
pv[0] = sfsetfd(sfstdout,10);
iop = sfswap(sfstdout,0);
}
sh_popcontext(&buff);
- sh.sftable[pv[0]] = iop;
- sh.fdstatus[pv[0]] = IOREAD|IODUP|IOSEEK;
+ shp->sftable[pv[0]] = iop;
+ shp->fdstatus[pv[0]] = IOREAD|IODUP|IOSEEK;
sfset(iop,SF_WRITE,0);
sfseek(iop,0L,SEEK_SET);
- sh_iorestore(buff.topfd,jmpval);
+ sh_iorestore(shp,buff.topfd,jmpval);
if(jmpval>SH_JMPIO)
- siglongjmp(*sh.jmplist,jmpval);
+ siglongjmp(*shp->jmplist,jmpval);
return(r);
}
#endif /* SHOPT_FASTPIPE */
@@ -528,8 +573,10 @@ static int checkopt(char *argv[], int c)
continue;
if(*cp!='-' || cp[1]=='-')
break;
- if(strchr(cp,c))
+ if(strchr(++cp,c))
return(1);
+ if(*cp=='h' && cp[1]==0 && *++argv==0)
+ break;
}
return(0);
}
@@ -544,23 +591,66 @@ static void free_list(struct openlist *olist)
}
}
+/*
+ * set ${.sh.name} and ${.sh.subscript}
+ * set _ to reference for ${.sh.name}[$.sh.subscript]
+ */
+static int set_instance(Namval_t *nq, Namval_t *node, struct Namref *nr)
+{
+ char *cp = nv_name(nq);
+ Namarr_t *ap;
+ memset(nr,0,sizeof(*nr));
+ nr->np = nq;
+ nr->root = sh.var_tree;
+ nr->table = sh.last_table;
+ if(sh.var_tree!=sh.var_base && !nv_open(cp,nr->root,NV_VARNAME|NV_NOREF|NV_NOSCOPE|NV_NOADD|NV_NOFAIL))
+ nr->root = sh.var_base;
+ nv_putval(SH_NAMENOD, cp, NV_NOFREE);
+ memcpy(node,L_ARGNOD,sizeof(*node));
+ L_ARGNOD->nvalue.nrp = nr;
+ L_ARGNOD->nvflag = NV_REF|NV_NOFREE;
+ L_ARGNOD->nvfun = 0;
+ L_ARGNOD->nvenv = 0;
+ if((ap=nv_arrayptr(nq)) && (cp = nv_getsub(nq)) && (cp = strdup(cp)))
+ {
+ nv_putval(SH_SUBSCRNOD,nr->sub=cp,NV_NOFREE);
+ return(ap->nelem&ARRAY_SCAN);
+ }
+ return(0);
+}
+
+static void unset_instance(Namval_t *nq, Namval_t *node, struct Namref *nr,long mode)
+{
+ L_ARGNOD->nvalue.nrp = node->nvalue.nrp;
+ L_ARGNOD->nvflag = node->nvflag;
+ L_ARGNOD->nvfun = node->nvfun;
+ if(nr->sub)
+ {
+ nv_putsub(nq, nr->sub, mode);
+ free((void*)nr->sub);
+ }
+ nv_unset(SH_NAMENOD);
+ nv_unset(SH_SUBSCRNOD);
+}
int sh_exec(register const Shnode_t *t, int flags)
{
+ register Shell_t *shp = &sh;
+ Stk_t *stkp = shp->stk;
sh_sigcheck();
- if(t && !sh.st.execbrk && !sh_isoption(SH_NOEXEC))
+ if(t && !shp->st.execbrk && !sh_isoption(SH_NOEXEC))
{
register int type = flags;
register char *com0 = 0;
int errorflg = (type&sh_state(SH_ERREXIT))|OPTIMIZE;
int execflg = (type&sh_state(SH_NOFORK));
int mainloop = (type&sh_state(SH_INTERACTIVE));
-#if SHOPT_SPAWN
+#if SHOPT_AMP || SHOPT_SPAWN
int ntflag = (type&sh_state(SH_NTFORK));
#endif
- int topfd = sh.topfd;
- char *sav=stakptr(0);
- char *cp=0, **com=0;
+ int topfd = shp->topfd;
+ char *sav=stkptr(stkp,0);
+ char *cp=0, **com=0, *comn;
int argn;
int skipexitset = 0;
int was_interactive = 0;
@@ -580,11 +670,11 @@ int sh_exec(register const Shnode_t *t, int flags)
if(was_monitor&flags)
sh_onstate(SH_MONITOR);
type = t->tre.tretyp;
- if(!sh.intrap)
- sh.oldexit=sh.exitval;
- sh.exitval=0;
- sh.lastsig = 0;
- sh.lastpath = 0;
+ if(!shp->intrap)
+ shp->oldexit=shp->exitval;
+ shp->exitval=0;
+ shp->lastsig = 0;
+ shp->lastpath = 0;
switch(type&COMMSK)
{
case TCOM:
@@ -593,9 +683,12 @@ int sh_exec(register const Shnode_t *t, int flags)
char *trap;
Namval_t *np, *nq, *last_table;
struct ionod *io;
- int command=0;
- error_info.line = t->com.comline-sh.st.firstline;
- com = sh_argbuild(&argn,&(t->com),OPTIMIZE);
+ int command=0, flgs=NV_ASSIGN;
+ shp->bltindata.invariant = type>>(COMBITS+2);
+ type &= (COMMSK|COMSCAN);
+ sh_stats(STAT_SCMDS);
+ error_info.line = t->com.comline-shp->st.firstline;
+ com = sh_argbuild(shp,&argn,&(t->com),OPTIMIZE);
echeck = 1;
if(t->tre.tretyp&COMSCAN)
{
@@ -606,157 +699,196 @@ int sh_exec(register const Shnode_t *t, int flags)
np = (Namval_t*)(t->com.comnamp);
nq = (Namval_t*)(t->com.comnamq);
com0 = com[0];
- sh.xargexit = 0;
+ shp->xargexit = 0;
while(np==SYSCOMMAND)
{
- register int n = b_command(0,com,&sh);
+ register int n = b_command(0,com,&shp->bltindata);
if(n==0)
break;
command += n;
np = 0;
if(!(com0= *(com+=n)))
break;
- np = nv_bfsearch(com0, sh.bltin_tree, &nq, &cp);
+ np = nv_bfsearch(com0, shp->bltin_tree, &nq, &cp);
}
- if(sh.xargexit)
+ if(shp->xargexit)
{
- sh.xargmin -= command;
- sh.xargmax -= command;
+ shp->xargmin -= command;
+ shp->xargmax -= command;
}
else
- sh.xargmin = 0;
+ shp->xargmin = 0;
argn -= command;
if(!command && np && is_abuiltin(np))
- np = dtsearch(sh.fun_tree,np);
- if(com0 && !np && !strchr(com0,'/'))
+ np = dtsearch(shp->fun_tree,np);
+ if(com0)
{
- Dt_t *root = command?sh.bltin_tree:sh.fun_tree;
- np = nv_bfsearch(com0, root, &nq, &cp);
-#if SHOPT_NAMESPACE
- if(sh.namespace && !nq && !cp)
+ if(!np && !strchr(com0,'/'))
{
- int offset = staktell();
- stakputs(nv_name(sh.namespace));
- stakputc('.');
- stakputs(com0);
- stakseek(offset);
- np = nv_bfsearch(stakptr(offset), root, &nq, &cp);
- }
+ Dt_t *root = command?shp->bltin_tree:shp->fun_tree;
+ np = nv_bfsearch(com0, root, &nq, &cp);
+#if SHOPT_NAMESPACE
+ if(shp->namespace && !nq && !cp)
+ {
+ int offset = stktell(stkp);
+ sfputr(stkp,nv_name(shp->namespace),-1);
+ sfputc(stkp,'.');
+ sfputr(stkp,com0,0);
+ stkseek(stkp,offset);
+ np = nv_bfsearch(stkptr(stkp,offset), root, &nq, &cp);
+ }
#endif /* SHOPT_NAMESPACE */
+ }
+ comn = com[argn-1];
}
io = t->tre.treio;
- if(sh.envlist = argp = t->com.comset)
+ if(shp->envlist = argp = t->com.comset)
{
- if(argn==0 || (np && !command && nv_isattr(np,BLT_SPC)))
+ if(argn==0 || (np && nv_isattr(np,BLT_SPC)))
{
- register int flgs=NV_VARNAME|NV_ASSIGN;
+ if(argn)
+ {
+ if(checkopt(com,'A'))
+ flgs |= NV_ARRAY;
+ else if(checkopt(com,'a'))
+ flgs |= NV_IARRAY;
+ }
#if SHOPT_BASH
if(np==SYSLOCAL)
{
if(!nv_getval(SH_FUNNAMENOD))
errormsg(SH_DICT,ERROR_exit(1),"%s: can only be used in a function",com0);
- if(!sh.st.var_local)
+ if(!shp->st.var_local)
{
- nv_scope((struct argnod*)0);
- sh.st.var_local = sh.var_tree;
+ sh_scope(shp,(struct argnod*)0,0);
+ shp->st.var_local = shp->var_tree;
}
}
if(np==SYSTYPESET || np==SYSLOCAL)
#else
- if(np==SYSTYPESET)
+ if(np==SYSTYPESET || (np && np->nvalue.bfp==SYSTYPESET->nvalue.bfp))
#endif
{
+ if(np!=SYSTYPESET)
+ shp->typeinit = np;
+ if(checkopt(com,'C'))
+ flgs |= NV_COMVAR;
+ if(checkopt(com,'S'))
+ flgs |= NV_STATIC;
if(checkopt(com,'n'))
flgs |= NV_NOREF;
#if SHOPT_TYPEDEF
- else if(checkopt(com,'T'))
+ else if(argn>=3 && checkopt(com,'T'))
{
- sh.prefix = NV_CLASS;
+ shp->prefix = NV_CLASS;
flgs |= NV_TYPE;
}
#endif /* SHOPT_TYPEDEF */
- if(checkopt(com,'A'))
- flgs |= NV_ARRAY;
- else if(checkopt(com,'a'))
- flgs |= NV_IARRAY;
- if((sh.fn_depth && !sh.prefix) || np==SYSLOCAL)
+ if((shp->fn_depth && !shp->prefix) || np==SYSLOCAL)
flgs |= NV_NOSCOPE;
}
else if(np==SYSEXPORT)
flgs |= NV_EXPORT;
- else if(np)
- flgs = NV_IDENT|NV_ASSIGN;
+ if(flgs&(NV_EXPORT|NV_NOREF))
+ flgs |= NV_IDENT;
+ else
+ flgs |= NV_VARNAME;
#if 0
if(OPTIMIZE)
flgs |= NV_TAGGED;
#endif
nv_setlist(argp,flgs);
+ if(np==shp->typeinit)
+ shp->typeinit = 0;
+ shp->envlist = argp;
argp = NULL;
}
}
- last_table = sh.last_table;
- sh.last_table = 0;
+ last_table = shp->last_table;
+ shp->last_table = 0;
if((io||argn))
{
+ Shbltin_t *bp=0;
static char *argv[1];
+ int tflags = 1;
+ if(np && nv_isattr(np,BLT_DCL))
+ tflags |= 2;
if(argn==0)
{
/* fake 'true' built-in */
- argn=1;
np = SYSTRUE;
*argv = nv_name(np);
com = argv;
}
/* set +x doesn't echo */
else if((np!=SYSSET) && sh_isoption(SH_XTRACE))
- sh_trace(com-command,1);
+ sh_trace(com-command,tflags);
else if((t->tre.tretyp&FSHOWME) && sh_isoption(SH_SHOWME))
{
int ison = sh_isoption(SH_XTRACE);
if(!ison)
sh_onoption(SH_XTRACE);
- sh_trace(com-command,1);
+ sh_trace(com-command,tflags);
if(io)
- sh_redirect(io,SH_SHOWME);
+ sh_redirect(shp,io,SH_SHOWME);
if(!ison)
sh_offoption(SH_XTRACE);
break;
}
- if(trap=sh.st.trap[SH_DEBUGTRAP])
- sh_debug(trap,(char*)0, (char*)0, com, ARG_RAW);
+ if(trap=shp->st.trap[SH_DEBUGTRAP])
+ {
+ int n = sh_debug(shp,trap,(char*)0,(char*)0, com, ARG_RAW);
+ if(n==255 && shp->fn_depth+shp->dot_depth)
+ {
+ np = SYSRETURN;
+ argn = 1;
+ com[0] = np->nvname;
+ com[1] = 0;
+ io = 0;
+ argp = 0;
+ }
+ else if(n==2)
+ break;
+ }
if(io)
- sfsync(sh.outpool);
- sh.lastpath = 0;
+ sfsync(shp->outpool);
+ shp->lastpath = 0;
if(!np && !strchr(com0,'/'))
{
-#ifdef PATH_BFPATH
- if(path_search(com0,NIL(Pathcomp_t*),1))
- np=nv_search(com0,sh.fun_tree,0);
+ if(path_search(com0,NIL(Pathcomp_t**),1))
+ {
+ error_info.line = t->com.comline-shp->st.firstline;
+ if((np=nv_search(com0,shp->fun_tree,0)) && !np->nvalue.ip)
+ {
+ Namval_t *mp=nv_search(com0,shp->bltin_tree,0);
+ if(mp)
+ np = mp;
+ }
+ }
else
{
- if((np=nv_search(com0,sh.track_tree,0)) && !nv_isattr(np,NV_NOALIAS) && np->nvalue.cp)
- np=nv_search(nv_getval(np),sh.bltin_tree,0);
+ if((np=nv_search(com0,shp->track_tree,0)) && !nv_isattr(np,NV_NOALIAS) && np->nvalue.cp)
+ np=nv_search(nv_getval(np),shp->bltin_tree,0);
else
np = 0;
}
-#else
- if(path_search(com0,NIL(char*),1))
- np=nv_search(com0,sh.fun_tree,0);
- if(sh.lastpath)
- np=nv_search(sh.lastpath,sh.bltin_tree,0);
-#endif
}
/* check for builtins */
if(np && is_abuiltin(np))
{
- Nambltin_t bdata;
- void *context;
- int scope=0, jmpval, save_prompt,share;
+ volatile int scope=0, share=0;
+ volatile void *save_ptr;
+ volatile void *save_data;
+ int jmpval, save_prompt;
struct checkpt buff;
unsigned long was_vi=0, was_emacs=0, was_gmacs=0;
struct stat statb;
+ bp = &shp->bltindata;
+ save_ptr = bp->ptr;
+ save_data = bp->data;
+ memset(&statb, 0, sizeof(struct stat));
if(strchr(nv_name(np),'/'))
{
/*
@@ -785,61 +917,65 @@ int sh_exec(register const Shnode_t *t, int flags)
else if(np==SYSEXEC)
type=1+!com[1];
else
- type = (execflg && !sh.subshell && !sh.st.trapcom[0]);
- sh_redirect(io,type);
+ type = (execflg && !shp->subshell && !shp->st.trapcom[0]);
+ sh_redirect(shp,io,type);
for(item=buff.olist;item;item=item->next)
item->strm=0;
}
if(!(nv_isattr(np,BLT_ENV)))
{
- if(!sh.pwd)
- path_pwd(0);
- if(sh.pwd)
- stat(".",&statb);
+ if(bp->nosfio)
+ {
+ if(!shp->pwd)
+ path_pwd(0);
+ if(shp->pwd)
+ stat(".",&statb);
+ }
+ sfsync(NULL);
share = sfset(sfstdin,SF_SHARE,0);
sh_onstate(SH_STOPOK);
sfpool(sfstderr,NIL(Sfio_t*),SF_WRITE);
sfset(sfstderr,SF_LINE,1);
- save_prompt = sh.nextprompt;
- sh.nextprompt = 0;
+ save_prompt = shp->nextprompt;
+ shp->nextprompt = 0;
}
if(argp)
{
scope++;
- nv_scope(argp);
+ sh_scope(shp,argp,0);
}
opt_info.index = opt_info.offset = 0;
opt_info.disc = 0;
error_info.id = *com;
- sh.exitval = 0;
- if(!(context=nv_context(np)))
- context = (void*)&sh;
- sh.bltinfun = funptr(np);
- if(nv_isattr(np,NV_BLTINOPT))
- {
- bdata.shp = &sh;
- bdata.np = nq;
- bdata.ptr = context;
- bdata.data = t->com.comstate;
- bdata.flags = (OPTIMIZE!=0);
- context = (void*)&bdata;
- }
- if(execflg && !sh.subshell &&
- !sh.st.trapcom[0] && !sh.st.trap[SH_ERRTRAP] && sh.fn_depth==0 && !nv_isattr(np,BLT_ENV))
+ if(argn)
+ shp->exitval = 0;
+ shp->bltinfun = funptr(np);
+ bp->bnode = np;
+ bp->vnode = nq;
+ bp->ptr = nv_context(np);
+ bp->data = t->com.comstate;
+ bp->sigset = 0;
+ bp->notify = 0;
+ bp->flags = (OPTIMIZE!=0);
+ if(shp->subshell && nv_isattr(np,BLT_NOSFIO))
+ sh_subtmpfile(0);
+ if(execflg && !shp->subshell &&
+ !shp->st.trapcom[0] && !shp->st.trap[SH_ERRTRAP] && shp->fn_depth==0 && !nv_isattr(np,BLT_ENV))
{
/* do close-on-exec */
int fd;
- for(fd=0; fd < sh.lim.open_max; fd++)
- if((sh.fdstatus[fd]&IOCLEX)&&fd!=sh.infd)
+ for(fd=0; fd < shp->lim.open_max; fd++)
+ if((shp->fdstatus[fd]&IOCLEX)&&fd!=shp->infd)
sh_close(fd);
}
- sh.exitval = (*sh.bltinfun)(argn,com,context);
+ if(argn)
+ shp->exitval = (*shp->bltinfun)(argn,com,(void*)bp);
if(error_info.flags&ERROR_INTERACTIVE)
tty_check(ERRIO);
- if(nv_isattr(np,NV_BLTINOPT))
- ((Shnode_t*)t)->com.comstate = bdata.data;
- if(!nv_isattr(np,BLT_EXIT) && sh.exitval!=SH_RUNPROG)
- sh.exitval &= SH_EXITMASK;
+ ((Shnode_t*)t)->com.comstate = shp->bltindata.data;
+ bp->data = (void*)save_data;
+ if(!nv_isattr(np,BLT_EXIT) && shp->exitval!=SH_RUNPROG)
+ shp->exitval &= SH_EXITMASK;
}
else
{
@@ -849,38 +985,42 @@ int sh_exec(register const Shnode_t *t, int flags)
if(item->strm)
{
sfclrlock(item->strm);
- if(sh.hist_ptr && item->strm == sh.hist_ptr->histfp)
- hist_close(sh.hist_ptr);
+ if(shp->hist_ptr && item->strm == shp->hist_ptr->histfp)
+ hist_close(shp->hist_ptr);
else
sfclose(item->strm);
}
}
+ if(shp->bltinfun && (error_info.flags&ERROR_NOTIFY))
+ (*shp->bltinfun)(-2,com,(void*)bp);
/* failure on special built-ins fatal */
if(jmpval<=SH_JMPCMD && (!nv_isattr(np,BLT_SPC) || command))
jmpval=0;
}
+ if(bp && bp->ptr!= nv_context(np))
+ np->nvfun = (Namfun_t*)bp->ptr;
if(!(nv_isattr(np,BLT_ENV)))
{
- if(sh.pwd)
+ if(bp->nosfio && shp->pwd)
{
struct stat stata;
stat(".",&stata);
/* restore directory changed */
if(statb.st_ino!=stata.st_ino || statb.st_dev!=stata.st_dev)
- chdir(sh.pwd);
+ chdir(shp->pwd);
}
sh_offstate(SH_STOPOK);
if(share&SF_SHARE)
sfset(sfstdin,SF_PUBLIC|SF_SHARE,1);
sfset(sfstderr,SF_LINE,0);
- sfpool(sfstderr,sh.outpool,SF_WRITE);
+ sfpool(sfstderr,shp->outpool,SF_WRITE);
sfpool(sfstdin,NIL(Sfio_t*),SF_WRITE);
- sh.nextprompt = save_prompt;
+ shp->nextprompt = save_prompt;
}
sh_popcontext(&buff);
errorpop(&buff.err);
error_info.flags &= ~ERROR_SILENT;
- sh.bltinfun = 0;
+ shp->bltinfun = 0;
if(buff.olist)
free_list(buff.olist);
if(was_vi)
@@ -890,13 +1030,19 @@ int sh_exec(register const Shnode_t *t, int flags)
else if(was_gmacs)
sh_onoption(SH_GMACS);
if(scope)
- nv_unscope();
+ sh_unscope(shp);
+ bp->ptr = (void*)save_ptr;
+ bp->data = (void*)save_data;
/* don't restore for subshell exec */
- if((sh.topfd>topfd) && !(sh.subshell && np==SYSEXEC))
- sh_iorestore(topfd,jmpval);
+ if((shp->topfd>topfd) && !(shp->subshell && np==SYSEXEC))
+ sh_iorestore(shp,topfd,jmpval);
if(jmpval)
- siglongjmp(*sh.jmplist,jmpval);
- if(sh.exitval >=0)
+ siglongjmp(*shp->jmplist,jmpval);
+#if 0
+ if(flgs&NV_STATIC)
+ ((Shnode_t*)t)->com.comset = 0;
+#endif
+ if(shp->exitval >=0)
goto setexit;
np = 0;
type=0;
@@ -904,30 +1050,30 @@ int sh_exec(register const Shnode_t *t, int flags)
/* check for functions */
if(!command && np && nv_isattr(np,NV_FUNCTION))
{
- int indx,jmpval=0;
+ volatile int indx;
+ int jmpval=0;
struct checkpt buff;
Namval_t node;
+ struct Namref nr;
+ long mode;
register struct slnod *slp;
if(!np->nvalue.ip)
{
-#ifdef PATH_BFPATH
- indx = path_search(com0,NIL(Pathcomp_t*),0);
-#else
- indx = path_search(com0,NIL(char*),0);
-#endif
+ indx = path_search(com0,NIL(Pathcomp_t**),0);
if(indx==1)
- np = nv_search(com0,sh.fun_tree,HASH_NOSCOPE);
+ np = nv_search(com0,shp->fun_tree,HASH_NOSCOPE);
+
if(!np->nvalue.ip)
{
if(indx==1)
{
errormsg(SH_DICT,ERROR_exit(0),e_defined,com0);
- sh.exitval = ERROR_NOEXEC;
+ shp->exitval = ERROR_NOEXEC;
}
else
{
errormsg(SH_DICT,ERROR_exit(0),e_found,"function");
- sh.exitval = ERROR_NOENT;
+ shp->exitval = ERROR_NOENT;
}
goto setexit;
}
@@ -938,54 +1084,34 @@ int sh_exec(register const Shnode_t *t, int flags)
staklink(slp->slptr);
if(nq)
{
- struct Namref nr;
- sh.last_table = last_table;
- memset(&nr,0,sizeof(nr));
- nr.np = nq;
- nv_putval(SH_NAMENOD, nv_name(nq), NV_NOFREE);
- memcpy(&node,L_ARGNOD,sizeof(node));
- L_ARGNOD->nvalue.nrp = &nr;
- L_ARGNOD->nvenv = 0;
- L_ARGNOD->nvfun = (Namfun_t*)sh.last_table;
- L_ARGNOD->nvflag = NV_REF|NV_NOFREE;
- if(nv_arrayptr(nq))
- {
- nv_putval(SH_SUBSCRNOD,nv_getsub(nq),NV_NOFREE);
- L_ARGNOD->nvenv = (char*)SH_SUBSCRNOD->nvalue.cp;
- }
+ shp->last_table = last_table;
+ mode = set_instance(nq,&node,&nr);
}
if(io)
{
- indx = sh.topfd;
+ indx = shp->topfd;
sh_pushcontext(&buff,SH_JMPCMD);
jmpval = sigsetjmp(buff.buff,0);
}
if(jmpval == 0)
{
if(io)
- indx = sh_redirect(io,execflg);
- sh_funct(np,argn,com,t->com.comset,(flags&~OPTIMIZE_FLAG));
+ indx = sh_redirect(shp,io,execflg);
+ sh_funct(shp,np,argn,com,t->com.comset,(flags&~OPTIMIZE_FLAG));
}
if(io)
{
if(buff.olist)
free_list(buff.olist);
sh_popcontext(&buff);
- sh_iorestore(indx,jmpval);
+ sh_iorestore(shp,indx,jmpval);
}
if(nq)
- {
- L_ARGNOD->nvalue.np = node.nvalue.np;
- L_ARGNOD->nvenv = node.nvenv;
- L_ARGNOD->nvflag = node.nvflag;
- L_ARGNOD->nvfun = node.nvfun;
- nv_unset(SH_NAMENOD);
- nv_unset(SH_SUBSCRNOD);
- }
+ unset_instance(nq,&node,&nr,mode);
sh_funstaks(slp->slchild,-1);
stakdelete(slp->slptr);
if(jmpval > SH_JMPFUN)
- siglongjmp(*sh.jmplist,jmpval);
+ siglongjmp(*shp->jmplist,jmpval);
goto setexit;
}
}
@@ -1002,11 +1128,15 @@ int sh_exec(register const Shnode_t *t, int flags)
int no_fork,jobid;
int pipes[2];
no_fork = (execflg && !(type&(FAMP|FPOU)) &&
- !sh.subshell && !sh.st.trapcom[0] &&
- !sh.st.trap[SH_ERRTRAP] && sh.fn_depth==0);
- if(sh.subshell)
- sh_subtmpfile();
- if(sh_isstate(SH_PROFILE) || sh.dot_depth)
+#if SHOPT_AMP || SHOPT_SPAWN
+ !ntflag &&
+#endif
+ !shp->subshell && !shp->st.trapcom[0] &&
+ !shp->st.trap[SH_ERRTRAP] && shp->fn_depth==0 &&
+ !(pipejob && sh_isoption(SH_PIPEFAIL)));
+ if(shp->subshell)
+ sh_subtmpfile(1);
+ if(sh_isstate(SH_PROFILE) || shp->dot_depth)
{
/* disable foreground job monitor */
if(!(type&FAMP))
@@ -1021,11 +1151,11 @@ int sh_exec(register const Shnode_t *t, int flags)
else
{
if(type&FCOOP)
- coproc_init(pipes);
+ coproc_init(shp,pipes);
nv_getval(RANDNOD);
#if SHOPT_AMP
if((type&(FAMP|FINT)) == (FAMP|FINT))
- parent = sh_ntfork(t,com,&jobid,ntflag);
+ parent = sh_ntfork(shp,t,com,&jobid,ntflag);
else
parent = sh_fork(type,&jobid);
if(parent<0)
@@ -1034,11 +1164,11 @@ int sh_exec(register const Shnode_t *t, int flags)
#if SHOPT_SPAWN
# ifdef _lib_fork
if(com)
- parent = sh_ntfork(t,com,&jobid,ntflag);
+ parent = sh_ntfork(shp,t,com,&jobid,ntflag);
else
parent = sh_fork(type,&jobid);
# else
- if((parent = sh_ntfork(t,com,&jobid,ntflag))<=0)
+ if((parent = sh_ntfork(shp,t,com,&jobid,ntflag))<=0)
break;
# endif /* _lib_fork */
if(parent<0)
@@ -1054,14 +1184,32 @@ int sh_exec(register const Shnode_t *t, int flags)
*/
{
if(type&FPCL)
- sh_close(sh.inpipe[0]);
+ sh_close(shp->inpipe[0]);
if(type&(FCOOP|FAMP))
- sh.bckpid = parent;
- if(!(type&(FAMP|FPOU)))
+ shp->bckpid = parent;
+ else if(!(type&(FAMP|FPOU)))
{
- if(sh.topfd > topfd)
- sh_iorestore(topfd,0);
- job_wait(parent);
+ if(shp->topfd > topfd)
+ sh_iorestore(shp,topfd,0);
+ if(!sh_isoption(SH_MONITOR))
+ {
+ if(!(shp->sigflag[SIGINT]&(SH_SIGFAULT|SH_SIGOFF)))
+ sh_sigtrap(SIGINT);
+ shp->trapnote |= SH_SIGIGNORE;
+ }
+ if(execflg && shp->subshell)
+ {
+ shp->spid = parent;
+ job.pwlist->p_env--;
+ }
+ else
+ job_wait(parent);
+ if(!sh_isoption(SH_MONITOR))
+ {
+ shp->trapnote &= ~SH_SIGIGNORE;
+ if(shp->exitval == (SH_EXITSIG|SIGINT))
+ sh_fault(SIGINT);
+ }
}
if(type&FAMP)
{
@@ -1082,7 +1230,7 @@ int sh_exec(register const Shnode_t *t, int flags)
* this is the FORKED branch (child) of execute
*/
{
- int jmpval;
+ volatile int jmpval;
struct checkpt buff;
if(no_fork)
sh_sigreset(2);
@@ -1095,7 +1243,7 @@ int sh_exec(register const Shnode_t *t, int flags)
/* default std input for & */
signal(SIGINT,SIG_IGN);
signal(SIGQUIT,SIG_IGN);
- if(!sh.st.ioset)
+ if(!shp->st.ioset)
{
if(sh_close(0)>=0)
sh_chkopen(e_devnull);
@@ -1109,20 +1257,35 @@ int sh_exec(register const Shnode_t *t, int flags)
#endif /* _lib_nice */
if(type&FPIN)
{
- sh_iorenumber(sh.inpipe[0],0);
+ sh_iorenumber(shp,shp->inpipe[0],0);
if(!(type&FPOU) || (type&FCOOP))
- sh_close(sh.inpipe[1]);
+ sh_close(shp->inpipe[1]);
}
if(type&FPOU)
{
- sh_iorenumber(sh.outpipe[1],1);
- sh_pclose(sh.outpipe);
+ sh_iorenumber(shp,shp->outpipe[1],1);
+ sh_pclose(shp->outpipe);
}
if((type&COMMSK)!=TCOM)
- error_info.line = t->fork.forkline-sh.st.firstline;
- sh_redirect(t->tre.treio,1);
- if(sh.topfd)
- sh_iounsave();
+ error_info.line = t->fork.forkline-shp->st.firstline;
+ if(shp->topfd)
+ sh_iounsave(shp);
+ topfd = shp->topfd;
+ sh_redirect(shp,t->tre.treio,1);
+ if(shp->topfd > topfd)
+ {
+ while((parent = vfork()) < 0)
+ _sh_fork(parent, 0, (int*)0);
+ if(parent)
+ {
+ job_clear();
+ job_post(parent,0);
+ job_wait(parent);
+ sh_iorestore(shp,topfd,SH_JMPCMD);
+ sh_done(shp,(shp->exitval&SH_EXITSIG)?(shp->exitval&SH_EXITMASK):0);
+
+ }
+ }
if((type&COMMSK)!=TCOM)
{
/* don't clear job table for out
@@ -1136,14 +1299,14 @@ int sh_exec(register const Shnode_t *t, int flags)
else if(com0)
{
sh_offoption(SH_ERREXIT);
- sh_freeup();
+ sh_freeup(shp);
path_exec(com0,com,t->com.comset);
}
done:
sh_popcontext(&buff);
if(jmpval>SH_JMPEXIT)
- siglongjmp(*sh.jmplist,jmpval);
- sh_done(0);
+ siglongjmp(*shp->jmplist,jmpval);
+ sh_done(shp,0);
}
}
@@ -1156,19 +1319,16 @@ int sh_exec(register const Shnode_t *t, int flags)
pid_t pid;
int jmpval, waitall;
struct checkpt buff;
- if(sh.subshell)
- {
- flags &= ~sh_state(SH_NOFORK);
+ if(shp->subshell)
execflg = 0;
- }
sh_pushcontext(&buff,SH_JMPIO);
if(type&FPIN)
{
was_interactive = sh_isstate(SH_INTERACTIVE);
sh_offstate(SH_INTERACTIVE);
if(!execflg)
- sh_iosave(0,sh.topfd);
- sh_iorenumber(sh.inpipe[0],0);
+ sh_iosave(shp,0,shp->topfd,(char*)0);
+ sh_iorenumber(shp,shp->inpipe[0],0);
/*
* if read end of pipe is a simple command
* treat as non-sharable to improve performance
@@ -1180,40 +1340,42 @@ int sh_exec(register const Shnode_t *t, int flags)
pid = job.parent;
}
else
- error_info.line = t->fork.forkline-sh.st.firstline;
+ error_info.line = t->fork.forkline-shp->st.firstline;
jmpval = sigsetjmp(buff.buff,0);
if(jmpval==0)
{
- sh_redirect(t->fork.forkio,execflg);
+ sh_redirect(shp,t->fork.forkio,execflg);
(t->fork.forktre)->tre.tretyp |= t->tre.tretyp&FSHOWME;
sh_exec(t->fork.forktre,flags);
}
+ else
+ sfsync(shp->outpool);
sh_popcontext(&buff);
- sh_iorestore(buff.topfd,jmpval);
+ sh_iorestore(shp,buff.topfd,jmpval);
if(buff.olist)
free_list(buff.olist);
if(type&FPIN)
{
job.waitall = waitall;
- type = sh.exitval;
+ type = shp->exitval;
if(!(type&SH_EXITSIG))
{
/* wait for remainder of pipline */
job_wait(waitall?pid:0);
if(type || !sh_isoption(SH_PIPEFAIL))
- sh.exitval = type;
+ shp->exitval = type;
}
- sh.st.ioset = 0;
+ shp->st.ioset = 0;
}
if(jmpval>SH_JMPIO)
- siglongjmp(*sh.jmplist,jmpval);
+ siglongjmp(*shp->jmplist,jmpval);
break;
}
case TPAR:
echeck = 1;
flags &= ~OPTIMIZE_FLAG;
- if(!sh.subshell && !sh.st.trapcom[0] && !sh.st.trap[SH_ERRTRAP] && (flags&sh_state(SH_NOFORK)))
+ if(!shp->subshell && !shp->st.trapcom[0] && !shp->st.trap[SH_ERRTRAP] && (flags&sh_state(SH_NOFORK)))
{
int jmpval;
struct checkpt buff;
@@ -1223,8 +1385,8 @@ int sh_exec(register const Shnode_t *t, int flags)
sh_exec(t->par.partre,flags);
sh_popcontext(&buff);
if(jmpval > SH_JMPEXIT)
- siglongjmp(*sh.jmplist,jmpval);
- sh_done(0);
+ siglongjmp(*shp->jmplist,jmpval);
+ sh_done(shp,0);
}
else
sh_subshell(t->par.partre,flags,0);
@@ -1242,10 +1404,11 @@ int sh_exec(register const Shnode_t *t, int flags)
int savepipe = pipejob;
int showme = t->tre.tretyp&FSHOWME;
pid_t savepgid = job.curpgid;
- if(sh.subshell)
- sh_subtmpfile();
- sh.inpipe = pvo;
- sh.outpipe = pvn;
+ job.curpgid = 0;
+ if(shp->subshell)
+ sh_subtmpfile(1);
+ shp->inpipe = pvo;
+ shp->outpipe = pvn;
pvo[1] = -1;
if(sh_isoption(SH_PIPEFAIL))
job.waitall = 1;
@@ -1254,7 +1417,7 @@ int sh_exec(register const Shnode_t *t, int flags)
do
{
#if SHOPT_FASTPIPE
- type = pipe_exec(pvn,t->lst.lstlef, errorflg);
+ type = pipe_exec(shp,pvn,t->lst.lstlef, errorflg);
#else
/* create the pipe */
sh_pipe(pvn);
@@ -1272,8 +1435,8 @@ int sh_exec(register const Shnode_t *t, int flags)
}
/* repeat until end of pipeline */
while(!type && t->tre.tretyp==TFIL);
- sh.inpipe = pvn;
- sh.outpipe = 0;
+ shp->inpipe = pvn;
+ shp->outpipe = 0;
if(type == 0)
{
/*
@@ -1289,7 +1452,7 @@ int sh_exec(register const Shnode_t *t, int flags)
pipejob = savepipe;
#ifdef SIGTSTP
if(!pipejob && sh_isstate(SH_MONITOR))
- tcsetpgrp(JOBTTY,sh.pid);
+ tcsetpgrp(JOBTTY,shp->pid);
#endif /*SIGTSTP */
job.curpgid = savepgid;
break;
@@ -1332,35 +1495,35 @@ int sh_exec(register const Shnode_t *t, int flags)
struct comnod *tp;
char *cp, *trap, *nullptr = 0;
int nameref, refresh=1;
- static char *av[5] = { "for", 0, "in" };
+ char *av[5];
#if SHOPT_OPTIMIZE
- int jmpval = ((struct checkpt*)sh.jmplist)->mode;
+ int jmpval = ((struct checkpt*)shp->jmplist)->mode;
struct checkpt buff;
- void *optlist = sh.optlist;
- sh.optlist = 0;
+ void *optlist = shp->optlist;
+ shp->optlist = 0;
sh_tclear(t->for_.fortre);
sh_pushcontext(&buff,jmpval);
jmpval = sigsetjmp(buff.buff,0);
if(jmpval)
goto endfor;
#endif /* SHOPT_OPTIMIZE */
- error_info.line = t->for_.forline-sh.st.firstline;
+ error_info.line = t->for_.forline-shp->st.firstline;
if(!(tp=t->for_.forlst))
{
- args=sh.st.dolv+1;
- nargs = sh.st.dolc;
- argsav=sh_arguse();
+ args=shp->st.dolv+1;
+ nargs = shp->st.dolc;
+ argsav=sh_arguse(shp);
}
else
{
- args=sh_argbuild(&argn,tp,0);
+ args=sh_argbuild(shp,&argn,tp,0);
nargs = argn;
}
- np = nv_open(t->for_.fornam, sh.var_tree,NV_NOASSIGN|NV_NOARRAY|NV_VARNAME|NV_NOREF);
+ np = nv_open(t->for_.fornam, shp->var_tree,NV_NOASSIGN|NV_NOARRAY|NV_VARNAME|NV_NOREF);
nameref = nv_isref(np)!=0;
- sh.st.loopcnt++;
+ shp->st.loopcnt++;
cp = *args;
- while(cp && sh.st.execbrk==0)
+ while(cp && shp->st.execbrk==0)
{
if(t->tre.tretyp&COMSCAN)
{
@@ -1372,17 +1535,17 @@ int sh_exec(register const Shnode_t *t, int flags)
sh_menu(sfstderr,nargs,args);
refresh = 0;
}
- save_prompt = sh.nextprompt;
- sh.nextprompt = 3;
- sh.timeout = 0;
- sh.exitval=sh_readline(&sh,&nullptr,0,1,1000*sh.st.tmout);
- sh.nextprompt = save_prompt;
- if(sh.exitval||sfeof(sfstdin)||sferror(sfstdin))
+ save_prompt = shp->nextprompt;
+ shp->nextprompt = 3;
+ shp->timeout = 0;
+ shp->exitval=sh_readline(shp,&nullptr,0,1,1000*shp->st.tmout);
+ shp->nextprompt = save_prompt;
+ if(shp->exitval||sfeof(sfstdin)||sferror(sfstdin))
{
- sh.exitval = 1;
+ shp->exitval = 1;
break;
}
- if(!(val=nv_getval(nv_scoped(REPLYNOD))))
+ if(!(val=nv_getval(sh_scoped(shp,REPLYNOD))))
continue;
else
{
@@ -1411,45 +1574,47 @@ int sh_exec(register const Shnode_t *t, int flags)
nv_putval(np,cp,0);
if(nameref)
nv_setref(np,(Dt_t*)0,NV_VARNAME);
- if(trap=sh.st.trap[SH_DEBUGTRAP])
+ if(trap=shp->st.trap[SH_DEBUGTRAP])
{
av[0] = (t->tre.tretyp&COMSCAN)?"select":"for";
av[1] = t->for_.fornam;
+ av[2] = "in";
av[3] = cp;
- sh_debug(trap,(char*)0,(char*)0,av,0);
+ av[4] = 0;
+ sh_debug(shp,trap,(char*)0,(char*)0,av,0);
}
sh_exec(t->for_.fortre,flag);
flag &= ~OPTIMIZE_FLAG;
if(t->tre.tretyp&COMSCAN)
{
- if((cp=nv_getval(nv_scoped(REPLYNOD))) && *cp==0)
+ if((cp=nv_getval(sh_scoped(shp,REPLYNOD))) && *cp==0)
refresh++;
}
else
cp = *++args;
check:
- if(sh.st.breakcnt<0)
- sh.st.execbrk = (++sh.st.breakcnt !=0);
+ if(shp->st.breakcnt<0)
+ shp->st.execbrk = (++shp->st.breakcnt !=0);
}
#if SHOPT_OPTIMIZE
endfor:
sh_popcontext(&buff);
sh_tclear(t->for_.fortre);
- sh_optclear(&sh,optlist);
+ sh_optclear(shp,optlist);
if(jmpval)
- siglongjmp(*sh.jmplist,jmpval);
+ siglongjmp(*shp->jmplist,jmpval);
#endif /*SHOPT_OPTIMIZE */
- if(sh.st.breakcnt>0)
- sh.st.execbrk = (--sh.st.breakcnt !=0);
- sh.st.loopcnt--;
- sh_argfree(argsav,0);
+ if(shp->st.breakcnt>0)
+ shp->st.execbrk = (--shp->st.breakcnt !=0);
+ shp->st.loopcnt--;
+ sh_argfree(shp,argsav,0);
nv_close(np);
break;
}
case TWH: /* while and until */
{
- register int r=0;
+ volatile int r=0;
int first = OPTIMIZE_FLAG;
Shnode_t *tt = t->wh.whtre;
#if SHOPT_FILESCAN
@@ -1457,10 +1622,10 @@ int sh_exec(register const Shnode_t *t, int flags)
int savein,fd;
#endif /*SHOPT_FILESCAN*/
#if SHOPT_OPTIMIZE
- int jmpval = ((struct checkpt*)sh.jmplist)->mode;
+ int jmpval = ((struct checkpt*)shp->jmplist)->mode;
struct checkpt buff;
- void *optlist = sh.optlist;
- sh.optlist = 0;
+ void *optlist = shp->optlist;
+ shp->optlist = 0;
sh_tclear(t->wh.whtre);
sh_tclear(t->wh.dotre);
sh_pushcontext(&buff,jmpval);
@@ -1471,26 +1636,26 @@ int sh_exec(register const Shnode_t *t, int flags)
#if SHOPT_FILESCAN
if(type==TWH && tt->tre.tretyp==TCOM && !tt->com.comarg && tt->com.comio)
{
- fd = sh_redirect(tt->com.comio,3);
+ fd = sh_redirect(shp,tt->com.comio,3);
savein = dup(0);
if(fd==0)
fd = savein;
iop = sfnew(NULL,NULL,SF_UNBOUND,fd,SF_READ);
close(0);
open("/dev/null",O_RDONLY);
- sh.offsets[0] = -1;
- sh.offsets[1] = 0;
+ shp->offsets[0] = -1;
+ shp->offsets[1] = 0;
if(tt->com.comset)
nv_setlist(tt->com.comset,NV_IDENT|NV_ASSIGN);
}
#endif /*SHOPT_FILESCAN */
- sh.st.loopcnt++;
- while(sh.st.execbrk==0)
+ shp->st.loopcnt++;
+ while(shp->st.execbrk==0)
{
#if SHOPT_FILESCAN
if(iop)
{
- if(!(sh.cur_line=sfgetr(iop,'\n',SF_STRING)))
+ if(!(shp->cur_line=sfgetr(iop,'\n',SF_STRING)))
break;
}
else
@@ -1498,16 +1663,16 @@ int sh_exec(register const Shnode_t *t, int flags)
if((sh_exec(tt,first)==0)!=(type==TWH))
break;
r = sh_exec(t->wh.dotre,first|errorflg);
- if(sh.st.breakcnt<0)
- sh.st.execbrk = (++sh.st.breakcnt !=0);
+ if(shp->st.breakcnt<0)
+ shp->st.execbrk = (++shp->st.breakcnt !=0);
/* This is for the arithmetic for */
- if(sh.st.execbrk==0 && t->wh.whinc)
+ if(shp->st.execbrk==0 && t->wh.whinc)
sh_exec((Shnode_t*)t->wh.whinc,first);
first = 0;
errorflg &= ~OPTIMIZE_FLAG;
#if SHOPT_FILESCAN
- sh.offsets[0] = -1;
- sh.offsets[1] = 0;
+ shp->offsets[0] = -1;
+ shp->offsets[1] = 0;
#endif /*SHOPT_FILESCAN */
}
#if SHOPT_OPTIMIZE
@@ -1515,21 +1680,21 @@ int sh_exec(register const Shnode_t *t, int flags)
sh_popcontext(&buff);
sh_tclear(t->wh.whtre);
sh_tclear(t->wh.dotre);
- sh_optclear(&sh,optlist);
+ sh_optclear(shp,optlist);
if(jmpval)
- siglongjmp(*sh.jmplist,jmpval);
+ siglongjmp(*shp->jmplist,jmpval);
#endif /*SHOPT_OPTIMIZE */
- if(sh.st.breakcnt>0)
- sh.st.execbrk = (--sh.st.breakcnt !=0);
- sh.st.loopcnt--;
- sh.exitval= r;
+ if(shp->st.breakcnt>0)
+ shp->st.execbrk = (--shp->st.breakcnt !=0);
+ shp->st.loopcnt--;
+ shp->exitval= r;
#if SHOPT_FILESCAN
if(iop)
{
sfclose(iop);
close(0);
dup(savein);
- sh.cur_line = 0;
+ shp->cur_line = 0;
}
#endif /*SHOPT_FILESCAN */
break;
@@ -1537,23 +1702,26 @@ int sh_exec(register const Shnode_t *t, int flags)
case TARITH: /* (( expression )) */
{
register char *trap;
- static char *arg[4]= {"((", 0, "))"};
- error_info.line = t->ar.arline-sh.st.firstline;
+ char *arg[4];
+ error_info.line = t->ar.arline-shp->st.firstline;
+ arg[0] = "((";
if(!(t->ar.arexpr->argflag&ARG_RAW))
- arg[1] = sh_macpat(t->ar.arexpr,OPTIMIZE|ARG_ARITH);
+ arg[1] = sh_macpat(shp,t->ar.arexpr,OPTIMIZE|ARG_ARITH);
else
arg[1] = t->ar.arexpr->argval;
- if(trap=sh.st.trap[SH_DEBUGTRAP])
- sh_debug(trap,(char*)0, (char*)0, arg, ARG_ARITH);
+ arg[2] = "))";
+ arg[3] = 0;
+ if(trap=shp->st.trap[SH_DEBUGTRAP])
+ sh_debug(shp,trap,(char*)0, (char*)0, arg, ARG_ARITH);
if(sh_isoption(SH_XTRACE))
{
sh_trace(NIL(char**),0);
sfprintf(sfstderr,"((%s))\n",arg[1]);
}
if(t->ar.arcomp)
- sh.exitval = !arith_exec((Arith_t*)t->ar.arcomp);
+ shp->exitval = !arith_exec((Arith_t*)t->ar.arcomp);
else
- sh.exitval = !sh_arith(arg[1]);
+ shp->exitval = !sh_arith(arg[1]);
break;
}
@@ -1563,20 +1731,23 @@ int sh_exec(register const Shnode_t *t, int flags)
else if(t->if_.eltre)
sh_exec(t->if_.eltre, flags);
else
- sh.exitval=0; /* force zero exit for if-then-fi */
+ shp->exitval=0; /* force zero exit for if-then-fi */
break;
case TSW:
{
Shnode_t *tt = (Shnode_t*)t;
- char *trap, *r = sh_macpat(tt->sw.swarg,OPTIMIZE);
- error_info.line = t->sw.swline-sh.st.firstline;
+ char *trap, *r = sh_macpat(shp,tt->sw.swarg,OPTIMIZE);
+ error_info.line = t->sw.swline-shp->st.firstline;
t= (Shnode_t*)(tt->sw.swlst);
- if(trap=sh.st.trap[SH_DEBUGTRAP])
+ if(trap=shp->st.trap[SH_DEBUGTRAP])
{
- static char *av[4] = {"case", 0, "in" };
+ char *av[4];
+ av[0] = "case";
av[1] = r;
- sh_debug(trap, (char*)0, (char*)0, av, 0);
+ av[2] = "in";
+ av[3] = 0;
+ sh_debug(shp,trap, (char*)0, (char*)0, av, 0);
}
while(t)
{
@@ -1586,7 +1757,7 @@ int sh_exec(register const Shnode_t *t, int flags)
register char *s;
if(rex->argflag&ARG_MAC)
{
- s = sh_macpat(rex,OPTIMIZE|ARG_EXP);
+ s = sh_macpat(shp,rex,OPTIMIZE|ARG_EXP);
while(*s=='\\' && s[1]==0)
s+=2;
}
@@ -1626,7 +1797,7 @@ int sh_exec(register const Shnode_t *t, int flags)
if(type!=TTIME)
{
sh_exec(t->par.partre,OPTIMIZE);
- sh.exitval = !sh.exitval;
+ shp->exitval = !shp->exitval;
break;
}
if(t->par.partre)
@@ -1657,15 +1828,15 @@ int sh_exec(register const Shnode_t *t, int flags)
#ifdef timeofday
times(&after);
timeofday(&ta);
- at = sh.lim.clk_tck*(ta.tv_sec-tb.tv_sec);
- at += ((sh.lim.clk_tck*(((1000000L/2)/sh.lim.clk_tck)+(ta.tv_usec-tb.tv_usec)))/1000000L);
+ at = shp->lim.clk_tck*(ta.tv_sec-tb.tv_sec);
+ at += ((shp->lim.clk_tck*(((1000000L/2)/shp->lim.clk_tck)+(ta.tv_usec-tb.tv_usec)))/1000000L);
#else
at = times(&after) - bt;
#endif /* timeofday */
tm[0] = at;
if(t->par.partre)
{
- Namval_t *np = nv_open("TIMEFORMAT",sh.var_tree,NV_NOADD);
+ Namval_t *np = nv_open("TIMEFORMAT",shp->var_tree,NV_NOADD);
if(np)
{
format = nv_getval(np);
@@ -1675,19 +1846,13 @@ int sh_exec(register const Shnode_t *t, int flags)
format = e_timeformat;
}
else
- {
format = strchr(format+1,'\n')+1;
-#if 0
- if(sh.optcount)
- sfprintf(sfstderr,"%d optimizations\n",sh.optcount);
-#endif
- }
tm[1] = after.tms_utime - before.tms_utime;
tm[1] += after.tms_cutime - before.tms_cutime;
tm[2] = after.tms_stime - before.tms_stime;
tm[2] += after.tms_cstime - before.tms_cstime;
if(format && *format)
- p_time(sfstderr,sh_translate(format),tm);
+ p_time(shp,sfstderr,sh_translate(format),tm);
break;
}
case TFUN:
@@ -1701,90 +1866,94 @@ int sh_exec(register const Shnode_t *t, int flags)
if(t->tre.tretyp==TNSPACE)
{
Dt_t *root,*oldroot, *top=0;
- Namval_t *oldnspace = sh.namespace;
- int offset = staktell();
- long optindex = sh.st.optindex;
+ Namval_t *oldnspace = shp->namespace;
+ int offset = stktell(stkp);
+ long optindex = shp->st.optindex;
if(cp)
errormsg(SH_DICT,ERROR_exit(1),e_ident,fname);
- stakputc('.');
- stakputs(fname);
- stakputc(0);
- np = nv_open(stakptr(offset),sh.var_base,NV_NOASSIGN|NV_NOARRAY|NV_VARNAME);
- offset = staktell();
- sh.namespace = np;
+ sfputc(stkp,'.');
+ sfputr(stkp,fname,0);
+ np = nv_open(stkptr(stkp,offset),shp->var_base,NV_NOASSIGN|NV_NOARRAY|NV_VARNAME);
+ offset = stktell(stkp);
+ shp->namespace = np;
if(!(root=nv_dict(np)))
{
root = dtopen(&_Nvdisc,Dtoset);
nv_putval(np,(char*)root,NV_TABLE|NV_NOFREE);
- sh.st.optindex = 1;
+ shp->st.optindex = 1;
}
- if(oldnspace && dtvnext(dtvnext(sh.var_tree)))
- top = dtview(sh.var_tree,0);
- else if(dtvnext(sh.var_tree))
- top = dtview(sh.var_tree,0);
- oldroot = sh.var_tree;
- dtview(root,sh.var_base);
- sh.var_tree = root;
+ if(oldnspace && dtvnext(dtvnext(shp->var_tree)))
+ top = dtview(shp->var_tree,0);
+ else if(dtvnext(shp->var_tree))
+ top = dtview(shp->var_tree,0);
+ oldroot = shp->var_tree;
+ dtview(root,shp->var_base);
+ shp->var_tree = root;
if(top)
- dtview(sh.var_tree,top);
+ dtview(shp->var_tree,top);
sh_exec(t->for_.fortre,flags);
- if(dtvnext(sh.var_tree))
- top = dtview(sh.var_tree,0);
- sh.var_tree = oldroot;
+ if(dtvnext(shp->var_tree))
+ top = dtview(shp->var_tree,0);
+ shp->var_tree = oldroot;
if(top)
- dtview(top,sh.var_tree);
- sh.namespace = oldnspace;
- sh.st.optindex = optindex;
+ dtview(top,shp->var_tree);
+ shp->namespace = oldnspace;
+ shp->st.optindex = optindex;
break;
}
#endif /* SHOPT_NAMESPACE */
/* look for discipline functions */
- error_info.line = t->funct.functline-sh.st.firstline;
+ error_info.line = t->funct.functline-shp->st.firstline;
/* Function names cannot be special builtin */
- if(cp || sh.prefix)
+ if(cp || shp->prefix)
{
- int offset = staktell();
- if(sh.prefix)
+ int offset = stktell(stkp);
+ if(shp->prefix)
{
- cp = sh.prefix;
- sh.prefix = 0;
- npv = nv_open(cp,sh.var_tree,NV_NOASSIGN|NV_NOARRAY|NV_VARNAME);
- sh.prefix = cp;
+ cp = shp->prefix;
+ shp->prefix = 0;
+ npv = nv_open(cp,shp->var_tree,NV_NOASSIGN|NV_NOARRAY|NV_VARNAME);
+ shp->prefix = cp;
cp = fname;
}
else
{
- stakwrite(fname,cp-fname);
- stakputc(0);
- npv = nv_open(stakptr(offset),sh.var_tree,NV_NOASSIGN|NV_NOARRAY|NV_VARNAME);
+ sfwrite(stkp,fname,cp++-fname);
+ sfputc(stkp,0);
+ npv = nv_open(stkptr(stkp,offset),shp->var_tree,NV_NOASSIGN|NV_NOARRAY|NV_VARNAME);
}
- offset = staktell();
- stakputs(nv_name(npv));
- if(*cp!='.')
- stakputc('.');
- stakputs(cp);
- stakputc(0);
- fname = stakptr(offset);
+ offset = stktell(stkp);
+ sfprintf(stkp,"%s.%s%c",nv_name(npv),cp,0);
+ fname = stkptr(stkp,offset);
}
- else if((np=nv_search(fname,sh.bltin_tree,0)) && nv_isattr(np,BLT_SPC))
+ else if((np=nv_search(fname,shp->bltin_tree,0)) && nv_isattr(np,BLT_SPC))
errormsg(SH_DICT,ERROR_exit(1),e_badfun,fname);
#if SHOPT_NAMESPACE
- else if(sh.namespace)
+ else if(shp->namespace)
{
- int offset = staktell();
- stakputs(nv_name(sh.namespace));
- stakputc('.');
- stakputs(fname);
- stakputc(0);
- fname = stakptr(offset);
+ int offset = stktell(stkp);
+ sfputr(stkp,nv_name(shp->namespace),-1);
+ sfputc(stkp,'.');
+ sfputr(stkp,fname,0);
+ fname = stkptr(stkp,offset);
}
#endif /* SHOPT_NAMESPACE */
np = nv_open(fname,sh_subfuntree(1),NV_NOASSIGN|NV_NOARRAY|NV_VARNAME|NV_NOSCOPE);
if(npv)
{
- if(!sh.mktype)
- cp = nv_setdisc(npv,cp+1,np,(Namfun_t*)npv);
- nv_close(npv);
+ Namval_t *tp = npv;
+ if(!shp->mktype)
+ {
+ if(shp->typeinit)
+ {
+ if(tp=nv_open(shp->typeinit->nvname,shp->typedict,NV_IDENT|NV_NOFAIL))
+ nv_close(npv);
+ else
+ tp = npv;
+ }
+ cp = nv_setdisc(tp,cp,np,(Namfun_t*)tp);
+ }
+ nv_close(tp);
if(!cp)
errormsg(SH_DICT,ERROR_exit(1),e_baddisc,fname);
}
@@ -1793,11 +1962,24 @@ int sh_exec(register const Shnode_t *t, int flags)
slp = (struct slnod*)np->nvenv;
sh_funstaks(slp->slchild,-1);
stakdelete(slp->slptr);
+ if(shp->funload)
+ {
+ free((void*)np->nvalue.rp);
+ np->nvalue.rp = 0;
+ }
+
+ }
+ if(!np->nvalue.rp)
+ {
+ np->nvalue.rp = new_of(struct Ufunction,shp->funload?sizeof(Dtlink_t):0);
+ memset((void*)np->nvalue.rp,0,sizeof(struct Ufunction));
}
- else
- np->nvalue.rp = new_of(struct Ufunction,0);
if(t->funct.functstak)
{
+ static Dtdisc_t _Rpdisc =
+ {
+ offsetof(struct Ufunction,fname), -1, sizeof(struct Ufunction)
+ };
struct functnod *fp;
slp = t->funct.functstak;
sh_funstaks(slp->slchild,1);
@@ -1806,13 +1988,23 @@ int sh_exec(register const Shnode_t *t, int flags)
nv_funtree(np) = (int*)(t->funct.functtre);
np->nvalue.rp->hoffset = t->funct.functloc;
np->nvalue.rp->lineno = t->funct.functline;
- np->nvalue.rp->nspace = sh.namespace;
+ np->nvalue.rp->nspace = shp->namespace;
np->nvalue.rp->fname = 0;
+ np->nvalue.rp->fdict = shp->fun_tree;
fp = (struct functnod*)(slp+1);
if(fp->functtyp==(TFUN|FAMP))
np->nvalue.rp->fname = fp->functnam;
nv_setsize(np,fp->functline);
nv_offattr(np,NV_FPOSIX);
+ if(shp->funload)
+ {
+ struct Ufunction *rp = np->nvalue.rp;
+ rp->np = np;
+ if(!shp->fpathdict)
+ shp->fpathdict = dtopen(&_Rpdisc,Dtbag);
+ if(shp->fpathdict)
+ dtinsert(shp->fpathdict,rp);
+ }
}
else
nv_unset(np);
@@ -1822,6 +2014,8 @@ int sh_exec(register const Shnode_t *t, int flags)
nv_onattr(np,NV_FUNCTION);
if(type&FPIN)
nv_onattr(np,NV_FTMP);
+ if(type&FOPTGET)
+ nv_onattr(np,NV_OPTGET);
break;
}
@@ -1833,12 +2027,12 @@ int sh_exec(register const Shnode_t *t, int flags)
int negate = (type&TNEGATE)!=0;
if(type&TTEST)
skipexitset++;
- error_info.line = t->tst.tstline-sh.st.firstline;
+ error_info.line = t->tst.tstline-shp->st.firstline;
echeck = 1;
if((type&TPAREN)==TPAREN)
{
sh_exec(t->lst.lstlef,OPTIMIZE);
- n = !sh.exitval;
+ n = !shp->exitval;
}
else
{
@@ -1847,10 +2041,10 @@ int sh_exec(register const Shnode_t *t, int flags)
register char *trap;
char *argv[6];
n = type>>TSHIFT;
- left = sh_macpat(&(t->lst.lstlef->arg),OPTIMIZE);
+ left = sh_macpat(shp,&(t->lst.lstlef->arg),OPTIMIZE);
if(type&TBINARY)
- right = sh_macpat(&(t->lst.lstrit->arg),((n==TEST_PEQ||n==TEST_PNE)?ARG_EXP:0)|OPTIMIZE);
- if(trap=sh.st.trap[SH_DEBUGTRAP])
+ right = sh_macpat(shp,&(t->lst.lstrit->arg),((n==TEST_PEQ||n==TEST_PNE)?ARG_EXP:0)|OPTIMIZE);
+ if(trap=shp->st.trap[SH_DEBUGTRAP])
argv[0] = (type&TNEGATE)?((char*)e_tstbegin):"[[";
if(sh_isoption(SH_XTRACE))
{
@@ -1871,7 +2065,7 @@ int sh_exec(register const Shnode_t *t, int flags)
argv[2] = left;
argv[3] = "]]";
argv[4] = 0;
- sh_debug(trap,(char*)0,(char*)0,argv, 0);
+ sh_debug(shp,trap,(char*)0,(char*)0,argv, 0);
}
n = test_unop(n,left);
}
@@ -1891,7 +2085,7 @@ int sh_exec(register const Shnode_t *t, int flags)
argv[3] = right;
argv[4] = "]]";
argv[5] = 0;
- sh_debug(trap,(char*)0,(char*)0,argv, pattern);
+ sh_debug(shp,trap,(char*)0,(char*)0,argv, pattern);
}
n = test_binop(n,left,right);
if(traceon)
@@ -1906,13 +2100,13 @@ int sh_exec(register const Shnode_t *t, int flags)
if(traceon)
sfwrite(sfstderr,e_tstend,4);
}
- sh.exitval = ((!n)^negate);
+ shp->exitval = ((!n)^negate);
if(!skipexitset)
exitset();
break;
}
}
- if(sh.trapnote || (sh.exitval && sh_isstate(SH_ERREXIT)) &&
+ if(shp->trapnote || (shp->exitval && sh_isstate(SH_ERREXIT)) &&
t && echeck)
sh_chktrap();
/* set $_ */
@@ -1921,31 +2115,31 @@ int sh_exec(register const Shnode_t *t, int flags)
/* store last argument here if it fits */
static char lastarg[32];
if(sh_isstate(SH_FORKED))
- sh_done(0);
- if(sh.lastarg!= lastarg && sh.lastarg)
- free(sh.lastarg);
- if(strlen(com[argn-1]) < sizeof(lastarg))
+ sh_done(shp,0);
+ if(shp->lastarg!= lastarg && shp->lastarg)
+ free(shp->lastarg);
+ if(strlen(comn) < sizeof(lastarg))
{
nv_onattr(L_ARGNOD,NV_NOFREE);
- sh.lastarg = strcpy(lastarg,com[argn-1]);
+ shp->lastarg = strcpy(lastarg,comn);
}
else
{
nv_offattr(L_ARGNOD,NV_NOFREE);
- sh.lastarg = strdup(com[argn-1]);
+ shp->lastarg = strdup(comn);
}
}
if(!skipexitset)
exitset();
if(!(OPTIMIZE))
{
- if(sav != stakptr(0))
- stakset(sav,0);
- else if(staktell())
- stakseek(0);
+ if(sav != stkptr(stkp,0))
+ stkset(stkp,sav,0);
+ else if(stktell(stkp))
+ stkseek(stkp,0);
}
- if(sh.trapnote&SH_SIGSET)
- sh_exit(SH_EXITSIG|sh.lastsig);
+ if(shp->trapnote&SH_SIGSET)
+ sh_exit(SH_EXITSIG|shp->lastsig);
if(was_interactive)
sh_onstate(SH_INTERACTIVE);
if(was_monitor && sh_isoption(SH_MONITOR))
@@ -1953,7 +2147,35 @@ int sh_exec(register const Shnode_t *t, int flags)
if(was_errexit)
sh_onstate(SH_ERREXIT);
}
- return(sh.exitval);
+ return(shp->exitval);
+}
+
+int sh_run(int argn, char *argv[])
+{
+ register struct dolnod *dp;
+ register struct comnod *t = (struct comnod*)stakalloc(sizeof(struct comnod));
+ int savtop = staktell();
+ char *savptr = stakfreeze(0);
+ Opt_t *op, *np = optctx(0, 0);
+ Shbltin_t bltindata;
+ bltindata = sh.bltindata;
+ op = optctx(np, 0);
+ memset(t, 0, sizeof(struct comnod));
+ dp = (struct dolnod*)stakalloc((unsigned)sizeof(struct dolnod) + ARG_SPARE*sizeof(char*) + argn*sizeof(char*));
+ dp->dolnum = argn;
+ dp->dolbot = ARG_SPARE;
+ memcpy(dp->dolval+ARG_SPARE, argv, (argn+1)*sizeof(char*));
+ t->comarg = (struct argnod*)dp;
+ if(!strchr(argv[0],'/'))
+ t->comnamp = (void*)nv_bfsearch(argv[0],sh.fun_tree,(Namval_t**)&t->comnamq,(char**)0);
+ argn=sh_exec((Shnode_t*)t,sh_isstate(SH_ERREXIT));
+ optctx(op,np);
+ sh.bltindata = bltindata;
+ if(savptr!=stakptr(0))
+ stakset(savptr,savtop);
+ else
+ stakseek(savtop);
+ return(argn);
}
/*
@@ -1980,18 +2202,21 @@ static int trim_eq(register const char *r,register const char *s)
int sh_trace(register char *argv[], register int nl)
{
+ Shell_t *shp = &sh;
register char *cp;
register int bracket = 0;
+ int decl = (nl&2);
+ nl &= ~2;
if(sh_isoption(SH_XTRACE))
{
/* make this trace atomic */
sfset(sfstderr,SF_SHARE|SF_PUBLIC,0);
- if(!(cp=nv_getval(nv_scoped(PS4NOD))))
+ if(!(cp=nv_getval(sh_scoped(shp,PS4NOD))))
cp = "+ ";
else
{
sh_offoption(SH_XTRACE);
- cp = sh_mactry(cp);
+ cp = sh_mactry(shp,cp);
sh_onoption(SH_XTRACE);
}
if(*cp)
@@ -2010,12 +2235,12 @@ int sh_trace(register char *argv[], register int nl)
{
if(bracket==0 || *argv || *cp!=']')
cp = sh_fmtq(cp);
- if(sh.prefix && cp!=argv0 && *cp!='-')
+ if(decl && shp->prefix && cp!=argv0 && *cp!='-')
{
if(*cp=='.' && cp[1]==0)
- cp = sh.prefix;
+ cp = shp->prefix;
else
- sfputr(sfstderr,sh.prefix,'.');
+ sfputr(sfstderr,shp->prefix,'.');
}
sfputr(sfstderr,cp,*argv?' ':nl);
}
@@ -2052,33 +2277,39 @@ static void timed_out(void *handle)
pid_t _sh_fork(register pid_t parent,int flags,int *jobid)
{
static long forkcnt = 1000L;
+ Shell_t *shp = &sh;
pid_t curpgid = job.curpgid;
pid_t postid = (flags&FAMP)?0:curpgid;
- int sig;
+ int sig,nochild;
if(parent<0)
{
+ sh_sigcheck();
if((forkcnt *= 2) > 1000L*SH_FORKLIM)
{
forkcnt=1000L;
errormsg(SH_DICT,ERROR_system(ERROR_NOEXEC),e_nofork);
}
- sh_sigcheck();
timeout = (void*)sh_timeradd(forkcnt, 0, timed_out, NIL(void*));
- job_wait((pid_t)1);
+ nochild = job_wait((pid_t)1);
if(timeout)
{
+ if(nochild)
+ pause();
+ else if(forkcnt>1000L)
+ forkcnt /= 2;
timerdel(timeout);
- forkcnt /= 2;
+ timeout = 0;
}
return(-1);
}
- forkcnt=1000L;
+ forkcnt = 1000L;
if(parent)
{
- int myjob;
- sh.nforks++;
+ int myjob,waitall=job.waitall;
+ shp->nforks++;
if(job.toclear)
job_clear();
+ job.waitall = waitall;
#ifdef JOBS
/* first process defines process group */
if(sh_isstate(SH_MONITOR))
@@ -2099,7 +2330,7 @@ pid_t _sh_fork(register pid_t parent,int flags,int *jobid)
if(!sh_isstate(SH_MONITOR) && job.waitall && postid==0)
job.curpgid = parent;
if(flags&FCOOP)
- sh.cpid = parent;
+ shp->cpid = parent;
myjob = job_post(parent,postid);
if(flags&FAMP)
job.curpgid = curpgid;
@@ -2111,9 +2342,9 @@ pid_t _sh_fork(register pid_t parent,int flags,int *jobid)
vmtrace(-1);
#endif
/* This is the child process */
- if(sh.trapnote&SH_SIGTERM)
+ if(shp->trapnote&SH_SIGTERM)
sh_exit(SH_EXITSIG|SIGTERM);
- sh.nforks=0;
+ shp->nforks=0;
timerdel(NIL(void*));
#ifdef JOBS
if(!job.jobcontrol && !(flags&FAMP))
@@ -2141,22 +2372,23 @@ pid_t _sh_fork(register pid_t parent,int flags,int *jobid)
job.jobcontrol = 0;
#endif /* JOBS */
job.toclear = 1;
- sh.login_sh = 0;
+ shp->login_sh = 0;
sh_offoption(SH_LOGIN_SHELL);
sh_onstate(SH_FORKED);
sh_onstate(SH_NOLOG);
- sh.fn_depth = 0;
+ if (shp->fn_reset)
+ shp->fn_depth = shp->fn_reset = 0;
#if SHOPT_ACCT
sh_accsusp();
#endif /* SHOPT_ACCT */
/* Reset remaining signals to parent */
/* except for those `lost' by trap */
sh_sigreset(2);
- sh.subshell = 0;
- if((flags&FAMP) && sh.coutpipe>1)
- sh_close(sh.coutpipe);
- sig = sh.savesig;
- sh.savesig = 0;
+ shp->subshell = 0;
+ if((flags&FAMP) && shp->coutpipe>1)
+ sh_close(shp->coutpipe);
+ sig = shp->savesig;
+ shp->savesig = 0;
if(sig>0)
sh_fault(sig);
sh_sigcheck();
@@ -2185,6 +2417,7 @@ pid_t sh_fork(int flags, int *jobid)
job_fork(-1);
sh.savesig = -1;
while(_sh_fork(parent=fork(),flags,jobid) < 0);
+ sh_stats(STAT_FORKS);
sig = sh.savesig;
sh.savesig = 0;
if(sig>0)
@@ -2213,43 +2446,47 @@ static void local_exports(register Namval_t *np, void *data)
*/
int sh_funscope(int argn, char *argv[],int(*fun)(void*),void *arg,int execflg)
{
- register char *trap;
- register int nsig;
- struct dolnod *argsav=0,*saveargfor;
- struct sh_scoped savst, *prevscope = sh.st.self;
- struct argnod *envlist=0;
- Shopt_t savopt;
- int jmpval;
- int r = 0;
- char *savstak;
- struct funenv *fp;
- struct checkpt buff;
- Namval_t *nspace = sh.namespace;
- savopt = sh.options;
- sh.st.lineno = error_info.line;
- *prevscope = sh.st;
+ register char *trap;
+ register int nsig;
+ register Shell_t *shp = &sh;
+ struct dolnod *argsav=0,*saveargfor;
+ struct sh_scoped savst, *prevscope = shp->st.self;
+ struct argnod *envlist=0;
+ int jmpval;
+ volatile int r = 0;
+ char *savstak;
+ struct funenv *fp;
+ struct checkpt buff;
+ Namval_t *nspace = shp->namespace;
+ if(shp->fn_depth==0)
+ shp->glob_options = shp->options;
+ else
+ shp->options = shp->glob_options;
+#if 0
+ shp->st.lineno = error_info.line;
+#endif
+ *prevscope = shp->st;
sh_offoption(SH_ERREXIT);
- sh.st.prevst = prevscope;
- sh.st.self = &savst;
- sh.topscope = (Shscope_t*)sh.st.self;
- sh.st.opterror = sh.st.optchar = 0;
- sh.st.optindex = 1;
- sh.st.loopcnt = 0;
+ shp->st.prevst = prevscope;
+ shp->st.self = &savst;
+ shp->topscope = (Shscope_t*)shp->st.self;
+ shp->st.opterror = shp->st.optchar = 0;
+ shp->st.optindex = 1;
+ shp->st.loopcnt = 0;
if(!fun)
{
fp = (struct funenv*)arg;
+ shp->st.real_fun = (fp->node)->nvalue.rp;
envlist = fp->env;
}
- prevscope->save_tree = sh.var_tree;
- nv_scope(envlist);
- if(dtvnext(prevscope->save_tree)!= (sh.namespace?sh.var_base:0))
+ prevscope->save_tree = shp->var_tree;
+ sh_scope(shp,envlist,1);
+ if(dtvnext(prevscope->save_tree)!= (shp->namespace?shp->var_base:0))
{
/* eliminate parent scope */
- Dt_t *dt = dtview(sh.var_tree,0);
- dtview(sh.var_tree,dtvnext(prevscope->save_tree));
nv_scan(prevscope->save_tree, local_exports,(void*)0, NV_EXPORT, NV_EXPORT|NV_NOSCOPE);
}
- sh.st.save_tree = sh.var_tree;
+ shp->st.save_tree = shp->var_tree;
if(!fun)
{
Namval_t *np;
@@ -2258,104 +2495,117 @@ int sh_funscope(int argn, char *argv[],int(*fun)(void*),void *arg,int execflg)
else
sh_offoption(SH_XTRACE);
#if SHOPT_NAMESPACE
- if((np=(fp->node)->nvalue.rp->nspace) && np!=sh.namespace)
+ if((np=(fp->node)->nvalue.rp->nspace) && np!=shp->namespace)
{
- Dt_t *dt = sh.var_tree;
+ Dt_t *dt = shp->var_tree;
dtview(dt,0);
dtview(dt,nv_dict(np));
- sh.var_tree = nv_dict(np);
- sh.namespace = np;
+ shp->var_tree = nv_dict(np);
+ shp->namespace = np;
}
#endif /* SHOPT_NAMESPACE */
}
- sh.st.cmdname = argv[0];
+ shp->st.cmdname = argv[0];
/* save trap table */
- if((nsig=sh.st.trapmax*sizeof(char*))>0 || sh.st.trapcom[0])
+ if((nsig=shp->st.trapmax*sizeof(char*))>0 || shp->st.trapcom[0])
{
nsig += sizeof(char*);
- memcpy(savstak=stakalloc(nsig),(char*)&sh.st.trapcom[0],nsig);
+ memcpy(savstak=stakalloc(nsig),(char*)&shp->st.trapcom[0],nsig);
}
sh_sigreset(0);
- argsav = sh_argnew(argv,&saveargfor);
+ argsav = sh_argnew(shp,argv,&saveargfor);
sh_pushcontext(&buff,SH_JMPFUN);
errorpush(&buff.err,0);
error_info.id = argv[0];
- sh.st.var_local = sh.var_tree;
+ shp->st.var_local = shp->var_tree;
jmpval = sigsetjmp(buff.buff,0);
if(!fun)
{
- sh.st.filename = fp->node->nvalue.rp->fname;
- nv_putval(SH_PATHNAMENOD, sh.st.filename ,NV_NOFREE);
- nv_putval(SH_FUNNAMENOD,nv_name(fp->node),NV_NOFREE);
+ shp->st.filename = fp->node->nvalue.rp->fname;
+ shp->st.funname = nv_name(fp->node);
+ nv_putval(SH_PATHNAMENOD,shp->st.filename,NV_NOFREE);
+ nv_putval(SH_FUNNAMENOD,shp->st.funname,NV_NOFREE);
}
if(jmpval == 0)
{
- if(sh.fn_depth++ > MAXDEPTH)
- siglongjmp(*sh.jmplist,SH_JMPERRFN);
+ if(shp->fn_depth++ > MAXDEPTH)
+ siglongjmp(*shp->jmplist,SH_JMPERRFN);
else if(fun)
r= (*fun)(arg);
else
{
sh_exec((Shnode_t*)(nv_funtree((fp->node))),execflg|SH_ERREXIT);
- r = sh.exitval;
+ r = shp->exitval;
}
}
- if(--sh.fn_depth==1 && jmpval==SH_JMPERRFN)
+ if(--shp->fn_depth==1 && jmpval==SH_JMPERRFN)
errormsg(SH_DICT,ERROR_exit(1),e_toodeep,argv[0]);
sh_popcontext(&buff);
- if (sh.st.self != &savst)
- sh.var_tree = (Dt_t*)savst.save_tree;
- nv_unscope();
- sh.namespace = nspace;
- sh.var_tree = (Dt_t*)prevscope->save_tree;
- sh_argreset(argsav,saveargfor);
- trap = sh.st.trapcom[0];
- sh.st.trapcom[0] = 0;
+ if (shp->st.self != &savst)
+ shp->var_tree = (Dt_t*)savst.save_tree;
+ sh_unscope(shp);
+ shp->namespace = nspace;
+ shp->var_tree = (Dt_t*)prevscope->save_tree;
+ if(shp->topscope != (Shscope_t*)shp->st.self)
+ sh_setscope(shp->topscope);
+ sh_argreset(shp,argsav,saveargfor);
+ trap = shp->st.trapcom[0];
+ shp->st.trapcom[0] = 0;
sh_sigreset(1);
- if (sh.st.self != &savst)
- *sh.st.self = sh.st;
- sh.st = *prevscope;
- sh.topscope = (Shscope_t*)prevscope;
- nv_getval(nv_scoped(IFSNOD));
+ if (shp->st.self != &savst)
+ *shp->st.self = shp->st;
+ shp->st = *prevscope;
+ shp->topscope = (Shscope_t*)prevscope;
+ nv_getval(sh_scoped(shp,IFSNOD));
if(nsig)
- memcpy((char*)&sh.st.trapcom[0],savstak,nsig);
- sh.trapnote=0;
+ memcpy((char*)&shp->st.trapcom[0],savstak,nsig);
+ shp->trapnote=0;
if(nsig)
stakset(savstak,0);
- sh.options = savopt;
+ shp->options = shp->glob_options;
if(trap)
{
sh_trap(trap,0);
free(trap);
}
- if(sh.exitval > SH_EXITSIG)
- sh_fault(sh.exitval&SH_EXITMASK);
+ if(shp->exitval > SH_EXITSIG)
+ sh_fault(shp->exitval&SH_EXITMASK);
if(jmpval > SH_JMPFUN)
{
sh_chktrap();
- siglongjmp(*sh.jmplist,jmpval);
+ siglongjmp(*shp->jmplist,jmpval);
}
return(r);
}
-
-static void sh_funct(Namval_t *np,int argn, char *argv[],struct argnod *envlist,int execflg)
+static void sh_funct(Shell_t *shp,Namval_t *np,int argn, char *argv[],struct argnod *envlist,int execflg)
{
struct funenv fun;
char *fname = nv_getval(SH_FUNNAMENOD);
+ struct Level *lp =(struct Level*)(SH_LEVELNOD->nvfun);
+ int level;
+ sh_stats(STAT_FUNCT);
+ if(!lp->hdr.disc)
+ lp = init_level(0);
+ if((struct sh_scoped*)shp->topscope != shp->st.self)
+ sh_setscope(shp->topscope);
+ level = lp->maxlevel = shp->dot_depth + shp->fn_depth+1;
+ SH_LEVELNOD->nvalue.s = lp->maxlevel;
+ shp->st.lineno = error_info.line;
if(nv_isattr(np,NV_FPOSIX))
{
char *save;
- int loopcnt = sh.st.loopcnt;
- sh.posix_fun = np;
- opt_info.index = opt_info.offset = 0;
- error_info.errors = 0;
+ int loopcnt = shp->st.loopcnt;
+ shp->posix_fun = np;
save = argv[-1];
argv[-1] = 0;
+ shp->st.funname = nv_name(np);
nv_putval(SH_FUNNAMENOD, nv_name(np),NV_NOFREE);
- sh.st.loopcnt = 0;
- b_dot_cmd(argn+1,argv-1,&sh);
- sh.st.loopcnt = loopcnt;
+ opt_info.index = opt_info.offset = 0;
+ error_info.errors = 0;
+ shp->st.loopcnt = 0;
+ b_dot_cmd(argn+1,argv-1,&shp->bltindata);
+ shp->st.loopcnt = loopcnt;
argv[-1] = save;
}
else
@@ -2364,8 +2614,19 @@ static void sh_funct(Namval_t *np,int argn, char *argv[],struct argnod *envlist,
fun.node = np;
sh_funscope(argn,argv,0,&fun,execflg);
}
+ if(level-- != nv_getnum(SH_LEVELNOD))
+ {
+ Shscope_t *sp = sh_getscope(0,SEEK_END);
+ sh_setscope(sp);
+ }
+ lp->maxlevel = level;
+ SH_LEVELNOD->nvalue.s = lp->maxlevel;
+#if 0
+ nv_putval(SH_FUNNAMENOD,shp->st.funname,NV_NOFREE);
+#else
nv_putval(SH_FUNNAMENOD,fname,NV_NOFREE);
- nv_putval(SH_PATHNAMENOD, sh.st.filename ,0);
+#endif
+ nv_putval(SH_PATHNAMENOD,shp->st.filename,NV_NOFREE);
}
/*
@@ -2375,15 +2636,20 @@ static void sh_funct(Namval_t *np,int argn, char *argv[],struct argnod *envlist,
*/
int sh_fun(Namval_t *np, Namval_t *nq, char *argv[])
{
+ Shell_t *shp = &sh;
register int offset;
register char *base;
Namval_t node;
+ struct Namref nr;
+ long mode;
+ char *prefix = shp->prefix;
int n=0;
char *av[2];
Fcin_t save;
fcsave(&save);
if((offset=staktell())>0)
base=stakfreeze(0);
+ shp->prefix = 0;
if(!argv)
{
argv = av;
@@ -2393,62 +2659,37 @@ int sh_fun(Namval_t *np, Namval_t *nq, char *argv[])
while(argv[n])
n++;
if(nq)
- {
- /*
- * set ${.sh.name} and ${.sh.subscript}
- * set _ to reference for ${.sh.name}[$.sh.subscript]
- */
- struct Namref nr;
- memset(&nr,0,sizeof(nr));
- nr.np = nq;
- nv_putval(SH_NAMENOD, nv_name(nq), NV_NOFREE);
- memcpy(&node,L_ARGNOD,sizeof(node));
- L_ARGNOD->nvalue.nrp = &nr;
- L_ARGNOD->nvenv = 0;
- L_ARGNOD->nvfun = (Namfun_t*)sh.last_table;
- L_ARGNOD->nvflag = NV_REF|NV_NOFREE;
- if(nv_arrayptr(nq))
- {
- nv_putval(SH_SUBSCRNOD,nv_getsub(nq),NV_NOFREE);
- L_ARGNOD->nvenv = (char*)SH_SUBSCRNOD->nvalue.cp;
- }
- }
+ mode = set_instance(nq,&node, &nr);
if(is_abuiltin(np))
{
int jmpval;
struct checkpt buff;
+ Shbltin_t *bp = &sh.bltindata;
sh_pushcontext(&buff,SH_JMPCMD);
jmpval = sigsetjmp(buff.buff,1);
if(jmpval == 0)
{
- void *context = nv_context(np);
+ bp->bnode = np;
+ bp->ptr = nv_context(np);
errorpush(&buff.err,0);
error_info.id = argv[0];
opt_info.index = opt_info.offset = 0;
opt_info.disc = 0;
sh.exitval = 0;
- if(!context)
- context = (void*)&sh;
- sh.exitval = (*funptr(np))(n,argv,context);
+ sh.exitval = (*funptr(np))(n,argv,(void*)bp);
}
sh_popcontext(&buff);
if(jmpval>SH_JMPCMD)
siglongjmp(*sh.jmplist,jmpval);
}
else
- sh_funct(np,n,argv,(struct argnod*)0,sh_isstate(SH_ERREXIT));
+ sh_funct(shp,np,n,argv,(struct argnod*)0,sh_isstate(SH_ERREXIT));
if(nq)
- {
- L_ARGNOD->nvalue.np = node.nvalue.np;
- L_ARGNOD->nvenv = node.nvenv;
- L_ARGNOD->nvflag = node.nvflag;
- L_ARGNOD->nvfun = node.nvfun;
- nv_unset(SH_NAMENOD);
- nv_unset(SH_SUBSCRNOD);
- }
+ unset_instance(nq, &node, &nr, mode);
fcrestore(&save);
if(offset>0)
stakset(base,offset);
+ shp->prefix = prefix;
return(sh.exitval);
}
@@ -2469,41 +2710,41 @@ int cmdrecurse(int argc, char* argv[], int ac, char* av[])
/*
* set up pipe for cooperating process
*/
-static void coproc_init(int pipes[])
+static void coproc_init(Shell_t *shp, int pipes[])
{
int outfd;
- if(sh.coutpipe>=0 && sh.cpid)
+ if(shp->coutpipe>=0 && shp->cpid)
errormsg(SH_DICT,ERROR_exit(1),e_pexists);
- sh.cpid = 0;
- if(sh.cpipe[0]<=0 || sh.cpipe[1]<=0)
+ shp->cpid = 0;
+ if(shp->cpipe[0]<=0 || shp->cpipe[1]<=0)
{
/* first co-process */
- sh_pclose(sh.cpipe);
- sh_pipe(sh.cpipe);
- if((outfd=sh.cpipe[1]) < 10)
+ sh_pclose(shp->cpipe);
+ sh_pipe(shp->cpipe);
+ if((outfd=shp->cpipe[1]) < 10)
{
- int fd=fcntl(sh.cpipe[1],F_DUPFD,10);
+ int fd=fcntl(shp->cpipe[1],F_DUPFD,10);
if(fd>=10)
{
- sh.fdstatus[fd] = (sh.fdstatus[outfd]&~IOCLEX);
+ shp->fdstatus[fd] = (shp->fdstatus[outfd]&~IOCLEX);
close(outfd);
- sh.fdstatus[outfd] = IOCLOSE;
- sh.cpipe[1] = fd;
+ shp->fdstatus[outfd] = IOCLOSE;
+ shp->cpipe[1] = fd;
}
}
- if(fcntl(*sh.cpipe,F_SETFD,FD_CLOEXEC)>=0)
- sh.fdstatus[sh.cpipe[0]] |= IOCLEX;
- sh.fdptrs[sh.cpipe[0]] = sh.cpipe;
+ if(fcntl(*shp->cpipe,F_SETFD,FD_CLOEXEC)>=0)
+ shp->fdstatus[shp->cpipe[0]] |= IOCLEX;
+ shp->fdptrs[shp->cpipe[0]] = shp->cpipe;
- if(fcntl(sh.cpipe[1],F_SETFD,FD_CLOEXEC) >=0)
- sh.fdstatus[sh.cpipe[1]] |= IOCLEX;
+ if(fcntl(shp->cpipe[1],F_SETFD,FD_CLOEXEC) >=0)
+ shp->fdstatus[shp->cpipe[1]] |= IOCLEX;
}
- sh.outpipe = sh.cpipe;
- sh_pipe(sh.inpipe=pipes);
- sh.coutpipe = sh.inpipe[1];
- sh.fdptrs[sh.coutpipe] = &sh.coutpipe;
- if(fcntl(sh.outpipe[0],F_SETFD,FD_CLOEXEC)>=0)
- sh.fdstatus[sh.outpipe[0]] |= IOCLEX;
+ shp->outpipe = shp->cpipe;
+ sh_pipe(shp->inpipe=pipes);
+ shp->coutpipe = shp->inpipe[1];
+ shp->fdptrs[shp->coutpipe] = &shp->coutpipe;
+ if(fcntl(shp->outpipe[0],F_SETFD,FD_CLOEXEC)>=0)
+ shp->fdstatus[shp->outpipe[0]] |= IOCLEX;
}
#if SHOPT_SPAWN
@@ -2533,7 +2774,7 @@ static void print_fun(register Namval_t* np, void *data)
*/
static int run_subshell(const Shnode_t *t,pid_t grp)
{
- static char prolog[] = "(print $(typeset +A);set; typeset -p; print .sh.dollar=$$;set +o)";
+ static const char prolog[] = "(print $(typeset +A);set; typeset -p; print .sh.dollar=$$;set +o)";
register int i, fd, trace = sh_isoption(SH_XTRACE);
int pin,pout;
pid_t pid;
@@ -2618,18 +2859,17 @@ static void sigreset(int mode)
/*
* A combined fork/exec for systems with slow or non-existent fork()
*/
-static pid_t sh_ntfork(const Shnode_t *t,char *argv[],int *jobid,int flag)
+static pid_t sh_ntfork(Shell_t *shp,const Shnode_t *t,char *argv[],int *jobid,int flag)
{
static pid_t spawnpid;
static int savetype;
static int savejobid;
- Shell_t *shp = sh_getinterp();
- struct checkpt buff;
- int otype=0, scope=0, jmpval;
- int jobwasset=0, sigwasset=0;
- char **arge, *path;
- pid_t grp = 0;
- Pathcomp_t *pp;
+ struct checkpt buff;
+ int otype=0, jmpval;
+ volatile int jobwasset=0, scope=0, sigwasset=0;
+ char **arge, *path;
+ volatile pid_t grp = 0;
+ Pathcomp_t *pp;
if(flag)
{
otype = savetype;
@@ -2679,28 +2919,28 @@ static pid_t sh_ntfork(const Shnode_t *t,char *argv[],int *jobid,int flag)
signal(SIGINT,SIG_IGN);
if(!shp->st.ioset)
{
- sh_iosave(0,buff.topfd);
- sh_iorenumber(sh_chkopen(e_devnull),0);
+ sh_iosave(shp,0,buff.topfd,(char*)0);
+ sh_iorenumber(shp,sh_chkopen(e_devnull),0);
}
}
if(otype&FPIN)
{
int fd = shp->inpipe[1];
- sh_iosave(0,buff.topfd);
- sh_iorenumber(shp->inpipe[0],0);
+ sh_iosave(shp,0,buff.topfd,(char*)0);
+ sh_iorenumber(shp,shp->inpipe[0],0);
if(fd>=0 && (!(otype&FPOU) || (otype&FCOOP)) && fcntl(fd,F_SETFD,FD_CLOEXEC)>=0)
shp->fdstatus[fd] |= IOCLEX;
}
if(otype&FPOU)
{
- sh_iosave(1,buff.topfd);
- sh_iorenumber(sh_dup(shp->outpipe[1]),1);
+ sh_iosave(shp,1,buff.topfd,(char*)0);
+ sh_iorenumber(shp,sh_dup(shp->outpipe[1]),1);
if(fcntl(shp->outpipe[0],F_SETFD,FD_CLOEXEC)>=0)
shp->fdstatus[shp->outpipe[0]] |= IOCLEX;
}
if(t->fork.forkio)
- sh_redirect(t->fork.forkio,0);
+ sh_redirect(shp,t->fork.forkio,0);
if(optimize==0)
{
#ifdef SIGTSTP
@@ -2737,7 +2977,7 @@ static pid_t sh_ntfork(const Shnode_t *t,char *argv[],int *jobid,int flag)
if((otype&FPIN) && (!(otype&FPOU) || (otype&FCOOP)) && fcntl(shp->inpipe[1],F_SETFD,FD_CLOEXEC)>=0)
shp->fdstatus[shp->inpipe[1]] &= ~IOCLEX;
if(t->fork.forkio || otype)
- sh_iorestore(buff.topfd,jmpval);
+ sh_iorestore(shp,buff.topfd,jmpval);
if(optimize==0)
{
#ifdef SIGTSTP
@@ -2781,49 +3021,45 @@ static pid_t sh_ntfork(const Shnode_t *t,char *argv[],int *jobid,int flag)
}
spawnpid = -1;
if(t->com.comio)
- sh_redirect(t->com.comio,0);
+ sh_redirect(shp,t->com.comio,0);
error_info.id = *argv;
if(t->com.comset)
{
scope++;
- nv_scope(t->com.comset);
+ sh_scope(shp,t->com.comset,0);
}
if(!strchr(path=argv[0],'/'))
{
-#ifdef PATH_BFPATH
Namval_t *np;
if((np=nv_search(path,shp->track_tree,0)) && !nv_isattr(np,NV_NOALIAS) && np->nvalue.cp)
path = nv_getval(np);
else if(path_absolute(path,NIL(Pathcomp_t*)))
{
- path = stakptr(PATH_OFFSET);
- stakfreeze(0);
- }
- else
- {
- pp=path_get(path);
- while(pp)
- {
- if(pp->len==1 && *pp->name=='.')
- break;
- pp = pp->next;
- }
- if(!pp)
- path = 0;
- }
-#else
- path = shp->lastpath;
-#endif
+ path = stkptr(shp->stk,PATH_OFFSET);
+ stkfreeze(shp->stk,0);
}
- else if(sh_isoption(SH_RESTRICTED))
- errormsg(SH_DICT,ERROR_exit(1),e_restricted,path);
- if(!path)
+ else
{
- spawnpid = -1;
- goto fail;
+ pp=path_get(path);
+ while(pp)
+ {
+ if(pp->len==1 && *pp->name=='.')
+ break;
+ pp = pp->next;
+ }
+ if(!pp)
+ path = 0;
}
- arge = sh_envgen();
- shp->exitval = 0;
+ }
+ else if(sh_isoption(SH_RESTRICTED))
+ errormsg(SH_DICT,ERROR_exit(1),e_restricted,path);
+ if(!path)
+ {
+ spawnpid = -1;
+ goto fail;
+ }
+ arge = sh_envgen();
+ shp->exitval = 0;
#ifdef SIGTSTP
if(job.jobcontrol)
{
@@ -2893,12 +3129,12 @@ static pid_t sh_ntfork(const Shnode_t *t,char *argv[],int *jobid,int flag)
sigreset(1); /* restore ignored signals */
if(scope)
{
- nv_unscope();
+ sh_unscope(shp);
if(jmpval==SH_JMPSCRIPT)
nv_setlist(t->com.comset,NV_EXPORT|NV_IDENT|NV_ASSIGN);
}
if(t->com.comio)
- sh_iorestore(buff.topfd,jmpval);
+ sh_iorestore(shp,buff.topfd,jmpval);
if(jmpval>SH_JMPCMD)
siglongjmp(*shp->jmplist,jmpval);
if(spawnpid>0)
@@ -2933,15 +3169,3 @@ static pid_t sh_ntfork(const Shnode_t *t,char *argv[],int *jobid,int flag)
}
# endif /* _lib_fork */
#endif /* SHOPT_SPAWN */
-
-/*
- * override procrun() since it is used in libcmd
- */
-#include <proc.h>
-int procrun(const char *path, char *argv[])
-{
- if(sh.subshell)
- sh_subtmpfile();
- return(procclose(procopen(path, argv, NiL, NiL, PROC_FOREGROUND|PROC_GID
-|PROC_UID)));
-}
diff --git a/usr/src/lib/libshell/common/shell.3 b/usr/src/lib/libshell/common/shell.3
index e6fbbf026e..7d7394bbc4 100644
--- a/usr/src/lib/libshell/common/shell.3
+++ b/usr/src/lib/libshell/common/shell.3
@@ -20,6 +20,7 @@ libshell.a -lshell
Shell_t;
Shopt_t;
Shscope_t;
+Shbltin_t;
Shbltin_f;
Shinit_f;
Shwait_f;
@@ -29,7 +30,7 @@ Shwait_f;
.nf
.ft 5
int sh_main(int \fIargc\fP, char *\fIargv\fP[], Sh_init \fIfn\fP);
-Shell_t *sh_init(int \fIargc\fP, char *\fIargv\fP);
+Shell_t *sh_init(int \fIargc\fP, char *\fIargv\fP[]);
Shell_t *sh_getinterp(void);
Namval_t *sh_addbuiltin(const char *\fIname\fP,Sh_bltin_f \fIfn\fP,void *\fIarg\fP);
@@ -40,6 +41,7 @@ unsigned int sh_offoption(int \fIoption\fP);
void *sh_parse(Shell_t *\fIshp\fP, Sfio_t *\fIsp\fP, int \fIflags\fP);
int sh_trap(const char *\fIstring\fP, int \fImode\fP);
+int sh_run(int \fIargc\fP, char *\fIargv\fP[]);
int sh_eval(Sfio_t *\fIsp\fP,int \fImode\fP);
int sh_fun(Namval_t *\fIfunnode\fP, Namval_t *\fIvarnode\fP, char *\fIargv\fP[]);
int sh_funscope(int \fIargc\fP,char *\fIargv\fP[],int(*\fIfn\fP)(void*),void *\fIarg\fP,int \fIflags\fP);
@@ -103,7 +105,10 @@ into the shell by loading dynamic libraries
at run time using the \f5builtin\fP(1) command.
In this case the shell will look for a function named \f5lib_init\fP
in your library and, if found, will execute this function with
-argument \f50\fP when the library is loaded.
+two arguments. The first
+argument will be an \f5int\P with value \f50\fP when the library is loaded.
+The second argument will contain a pointer to a structure of type
+\f5Shbltin_t\fP.
In addition, for each argument named on the \f5builtin\fP
command line, it will look for a function named \f5b_\fP\fIname\fP\f5()\fP
in your library and will \fIname\fP as a built-in.
@@ -157,17 +162,20 @@ All built-in commands to the shell are invoked with
three arguments. The first two arguments give the
number of arguments and the argument list
and uses the same conventions as the \f5main()\fP function
-of a program. The third argument is a pointer that
+of a program. The third argument is a pointer to a structure
+of type \f5Shbltin_t\fP. This structure contains \f5shp\P which is a pointer
+to the shell interpreter, and \f5ptr\fP which is a pointer that
can be associated with each built-in.
The \f5sh_addbuiltin()\fP function is used to add, replace or delete
built-in commands.
It takes the name of the built-in, \fIname\fP, a pointer
to the function that implements the built-in, \fIfn\fP, and
-a pointer that will be passed to the function when
+a pointer that will be passed to the function in the \f5ptr\fP field when
it is invoked.
If, \fIfn\fP is non-\f5NULL\fP the built-in command
-is added or replaced. Otherwise, the given
-built-in command will be deleted.
+is added or replaced. Otherwise, \f5sh_addbuiltin()\fP will
+return a pointer to the built-in if it exists or \f5NULL\fP otherwise.
+If \fIarg\fP is \f5(void*)1\fP the built-in will be deleted.
The \fIname\fP argument can be in the format of a pathname.
It cannot be the name of any of the special built-in commands.
If \fIname\fP contains a \f5/\fP, the built-in is the basename of
@@ -268,6 +276,12 @@ is compiled and then executed so that aliases defined
within the string or file will not take effect until
the next command is executed.
.PP
+The \f5sh_run()\fP function will run the command given by
+by the argument list \fIargv\fP containing \fIargc\fP elements.
+If \fIargv\fP\f5[0]\fP does not contain a \f5/\fP, it will
+be checked to see if it is a built-in or function before
+performing a path search.
+.PP
The \f5sh_eval()\fP function executes a string or file
stream \fIsp\fP.
If \fImode\fP is non-zero and the history file has
diff --git a/usr/src/lib/libshell/common/tests/alias.sh b/usr/src/lib/libshell/common/tests/alias.sh
index bf7f17f5f6..e001668ef7 100644
--- a/usr/src/lib/libshell/common/tests/alias.sh
+++ b/usr/src/lib/libshell/common/tests/alias.sh
@@ -1,10 +1,10 @@
########################################################################
# #
# This software is part of the ast package #
-# Copyright (c) 1982-2007 AT&T Knowledge Ventures #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
-# by AT&T Knowledge Ventures #
+# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# http://www.opensource.org/licenses/cpl1.0.txt #
@@ -78,6 +78,20 @@ builtin -d rm 2> /dev/null
if whence rm > /dev/null
then [[ ! $(alias -t | grep rm= ) ]] && err_exit 'tracked alias not set'
PATH=$PATH
- [[ $(alias -t | grep rm= ) ]] && err_exit 'tracked alias not cleared'
+ [[ $(alias -t | grep rm= ) ]] && err_exit 'tracked alias not cleared'
fi
+if hash -r 2>/dev/null && [[ ! $(hash) ]]
+then mkdir /tmp/ksh$$ || err_exit "mkdir /tmp/ksh$$ failed"
+ trap "cd /; rm -rf /tmp/ksh$$" EXIT
+ PATH=/tmp/ksh$$:/bin:/usr/bin
+ for i in foo -foo --
+ do print ':' > /tmp/ksh$$/$i
+ chmod +x /tmp/ksh$$/$i
+ hash -r -- $i 2>/dev/null || err_exit "hash -r -- $i failed"
+ [[ $(hash) == $i=/tmp/ksh$$/$i ]] || err_exit "hash -r -- $i failed, expected $i=/tmp/ksh$$/$i, got $(hash)"
+ done
+else err_exit 'hash -r failed'
+fi
+( alias :pr=print) 2> /dev/null || err_exit 'alias beginning with : fails'
+( alias p:r=print) 2> /dev/null || err_exit 'alias with : in name fails'
exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/append.sh b/usr/src/lib/libshell/common/tests/append.sh
index 7f3cad6021..00c432520a 100644
--- a/usr/src/lib/libshell/common/tests/append.sh
+++ b/usr/src/lib/libshell/common/tests/append.sh
@@ -1,10 +1,10 @@
########################################################################
# #
# This software is part of the ast package #
-# Copyright (c) 1982-2007 AT&T Knowledge Ventures #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
-# by AT&T Knowledge Ventures #
+# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# http://www.opensource.org/licenses/cpl1.0.txt #
@@ -63,10 +63,18 @@ point+=( y=3 z=4)
if [[ ${point.y} != 3 ]]
then err_exit 'compound append fails'
fi
+if [[ ${point.x} != 1 ]]
+then err_exit 'compound append to compound variable unsets existing variables'
+fi
unset foo
foo=one
foo+=(two)
if [[ ${foo[@]} != 'one two' ]]
then err_exit 'array append to non array variable fails'
fi
+unset foo
+foo[0]=(x=3)
+foo+=(x=4)
+[[ ${foo[1].x} == 4 ]] || err_exit 'compound append to index array not working'
+[[ ${foo[0].x} == 3 ]] || err_exit 'compound append to index array unsets existing variables'
exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/arith.sh b/usr/src/lib/libshell/common/tests/arith.sh
index ec3ada5df1..c330abce90 100644
--- a/usr/src/lib/libshell/common/tests/arith.sh
+++ b/usr/src/lib/libshell/common/tests/arith.sh
@@ -1,10 +1,10 @@
########################################################################
# #
# This software is part of the ast package #
-# Copyright (c) 1982-2007 AT&T Knowledge Ventures #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
-# by AT&T Knowledge Ventures #
+# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# http://www.opensource.org/licenses/cpl1.0.txt #
@@ -308,7 +308,6 @@ if [[ $x != 42#18 ]]
then err_exit 'display of unsigned integers in non-decimal bases wrong'
fi
$SHELL -c 'i=0;(( ofiles[i] != -1 && (ofiles[i] < mins || mins == -1) ));exit 0' 2> /dev/null || err_exit 'lexical error with arithemtic expression'
-rm -f core
$SHELL -c '(( +1 == 1))' 2> /dev/null || err_exit 'unary + not working'
typeset -E20 val=123.01234567890
[[ $val == 123.0123456789 ]] || err_exit "rounding error val=$val"
@@ -328,7 +327,7 @@ do let "x = $x+1"
done
(( x == n )) || err_exit 'let with zero filled fields not working'
(( y == n )) || err_exit '((...)) with zero filled fields not working'
-typeset -LZ3 x=10
+typeset -RZ3 x=10
[[ $(($x)) == 10 && $((1$x)) == 1010 ]] || err_exit 'zero filled fields not preserving leading zeros'
unset y
[[ $(let y=$x;print $y) == 10 && $(let y=1$x;print $y) == 1010 ]] || err_exit 'zero filled fields not preserving leading zeros with let'
@@ -357,7 +356,7 @@ typeset -i i=x
(( ${x:0:1} == 0 )) || err_exit 'leading zero should not be stripped for x:a:b'
c010=3
(( c$x == 3 )) || err_exit 'leading zero with variable should not be stripped'
-[[ $( ($SHELL -c '((++1))' 2>&1)2>/dev/null ) == *lvalue* ]] || err_exit "((--1)) not generating error message"
+[[ $( ($SHELL -c '((++1))' 2>&1)2>/dev/null ) == *lvalue* ]] || err_exit "((++1)) not generating error message"
i=2
(( "22" == 22 )) || err_exit "double quoted constants fail"
(( "2$i" == 22 )) || err_exit "double quoted variables fail"
@@ -442,25 +441,46 @@ unset x
[[ $x == "$((x))" ]] || err_exit '$x !- $((x)) when x is pi'
$SHELL -c "[[ ${x//./} == {14,100}(\d) ]]" 2> /dev/null || err_exit 'pi has less than 14 significant places'
if (( Inf+1 == Inf ))
-then [[ $(printf "%g\n" $((Inf))) == inf ]] || err_exit 'printf "%g\n" $((Inf)) fails'
-# [[ $(printf "%g\n" $((Nan))) == inf ]] || err_exit 'printf "%g\n" $((Nan)) fails'
- [[ $(printf "%g\n" Inf) == inf ]] || err_exit 'printf "%g\n" Inf fails'
- [[ $(printf "%g\n" NaN) == nan ]] || err_exit 'printf "%g\n" NaN fails'
- [[ $(print -- $((Inf))) == inf ]] || err_exit 'print -- $((Inf)) fails'
+then set \
+ Inf inf \
+ -Inf -inf \
+ Nan nan \
+ -Nan -nan \
+ 1.0/0.0 inf
+ while (( $# >= 2 ))
+ do x=$(printf "%g\n" $(($1)))
+ [[ $x == $2 ]] || err_exit "printf '%g\\n' \$(($1)) failed -- expected $2, got $x"
+ x=$(printf "%g\n" $1)
+ [[ $x == $2 ]] || err_exit "printf '%g\\n' $1 failed -- expected $2, got $x"
+ x=$(printf -- $(($1)))
+ [[ $x == $2 ]] || err_exit "print -- \$(($1)) failed -- expected $2, got $x"
+ shift 2
+ done
(( 1.0/0.0 == Inf )) || err_exit '1.0/0.0 != Inf'
- [[ $(print -- $((0.0/0.0))) == nan ]] || err_exit '0.0/0.0 != NaN'
+ [[ $(print -- $((0.0/0.0))) == ?(-)nan ]] || err_exit '0.0/0.0 != NaN'
(( Inf*Inf == Inf )) || err_exit 'Inf*Inf != Inf'
(( NaN != NaN )) || err_exit 'NaN == NaN'
(( -5*Inf == -Inf )) || err_exit '-5*Inf != -Inf'
- [[ $(print -- $((sqrt(-1.0)))) == nan ]]|| err_exit 'sqrt(-1.0) != NaN'
+ [[ $(print -- $((sqrt(-1.0)))) == ?(-)nan ]]|| err_exit 'sqrt(-1.0) != NaN'
(( pow(1.0,Inf) == 1.0 )) || err_exit 'pow(1.0,Inf) != 1.0'
(( pow(Inf,0.0) == 1.0 )) || err_exit 'pow(Inf,0.0) != 1.0'
- [[ $(print -- $((NaN/Inf))) == nan ]] || err_exit 'NaN/Inf != NaN'
+ [[ $(print -- $((NaN/Inf))) == ?(-)nan ]] || err_exit 'NaN/Inf != NaN'
(( 4.0/Inf == 0.0 )) || err_exit '4.0/Inf != 0.0'
else err_exit 'Inf and NaN not working'
fi
-unset x y
-float x=14.555 y
+unset x y n r
+n=14.555
+float x=$n y
y=$(printf "%a" x)
-(( x == y )) || err_exit "output of printf %a not self preserving -- expected $x, got $y"
+r=$y
+[[ $r == $n ]] || err_exit "output of printf %a not self preserving -- expected $x, got $y"
+unset x y r
+x=-0
+y=$(printf "%g %g %g %g %g %g\n" -0. -0 $((-0)) x $x $((x)))
+r="-0 -0 -0 -0 -0 -0"
+[[ $y == "$r" ]] || err_exit "-0 vs -0.0 inconsistency -- expected '$r', got '$y'"
+$SHELL -c '(( x=));:' 2> /dev/null && err_exit '((x=)) should be an error'
+$SHELL -c '(( x+=));:' 2> /dev/null && err_exit '((x+=)) should be an error'
+$SHELL -c '(( x=+));:' 2> /dev/null && err_exit '((x=+)) should be an error'
+$SHELL -c 'x=();x.arr[0]=(z=3); ((x.arr[0].z=2))' 2> /dev/null || err_exit '(((x.arr[0].z=2)) should not be an error'
exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/arrays.sh b/usr/src/lib/libshell/common/tests/arrays.sh
index 7dd09fca0f..14504edc00 100644
--- a/usr/src/lib/libshell/common/tests/arrays.sh
+++ b/usr/src/lib/libshell/common/tests/arrays.sh
@@ -1,10 +1,10 @@
########################################################################
# #
# This software is part of the ast package #
-# Copyright (c) 1982-2007 AT&T Knowledge Ventures #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
-# by AT&T Knowledge Ventures #
+# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# http://www.opensource.org/licenses/cpl1.0.txt #
@@ -155,7 +155,6 @@ fi
if (( s[$y] != 4 ))
then err_exit '(( s[$y] != 4 ))'
fi
-unset y
set -A y 2 4 6
typeset -i y
z=${y[@]}
@@ -378,4 +377,91 @@ set -- "${foo[@]:1}"
unset bar
: ${_foo[bar=4]}
(( bar == 4 )) || err_exit 'subscript of unset variable not evaluated'
+unset foo bar
+foo[5]=4
+bar[4]=3
+bar[0]=foo
+foo[0]=bam
+foo[4]=5
+[[ ${!foo[2+2]} == 'foo[4]' ]] || err_exit '${!var[sub]} should be var[sub]'
+[[ ${bar[${foo[5]}]} == 3 ]] || err_exit 'array subscript cannot be an array instance'
+[[ $bar[4] == 3 ]] || err_exit '$bar[x] != ${bar[x]} inside [[ ]]'
+(( $bar[4] == 3 )) || err_exit '$bar[x] != ${bar[x]} inside (( ))'
+[[ $bar[$foo[5]] == 3 ]] || err_exit '$bar[foo[x]] != ${bar[foo[x]]} inside [[ ]]'
+(( $bar[$foo[5]] == 3 )) || err_exit '$bar[foo[x]] != ${bar[foo[x]]} inside (( ))'
+x=$bar[4]
+[[ $x == 4 ]] && err_exit '$bar[4] should not be an array in an assignment'
+x=${bar[$foo[5]]}
+(( $x == 3 )) || err_exit '${bar[$foo[sub]]} not working'
+[[ $($SHELL <<- \++EOF+++
+ typeset -i test_variable=0
+ typeset -A test_array
+ test_array[1]=100
+ read test_array[2] <<-!
+ 2
+ !
+ read test_array[3] <<-!
+ 3
+ !
+ test_array[3]=4
+ print "val=${test_array[3]}"
+++EOF+++
+) == val=4 ]] 2> /dev/null || err_exit 'after reading array[j] and assign array[j] fails'
+[[ $($SHELL <<- \+++EOF+++
+ pastebin=( typeset -a form)
+ pastebin.form+=( name="name" data="clueless" )
+ print -r -- ${pastebin.form[0].name}
++++EOF+++
+) == name ]] 2> /dev/null || err_exit 'indexed array in compound variable not working'
+unset foo bar
+: ${foo[bar=2]}
+[[ $bar == 2 ]] || err_exit 'subscript not evaluated for unset variable'
+unset foo bar
+bar=1
+typeset -a foo=([1]=ok [2]=no)
+[[ $foo[bar] == ok ]] || err_exit 'typeset -a not working for simple assignment'
+unset foo
+typeset -a foo=([1]=(x=ok) [2]=(x=no))
+[[ $(typeset | grep 'foo$') == *index* ]] || err_exit 'typeset -a not creating an indexed array'
+foo+=([5]=good)
+[[ $(typeset | grep 'foo$') == *index* ]] || err_exit 'append to indexed array not preserving array type'
+unset foo
+typeset -A foo=([1]=ok [2]=no)
+[[ $foo[bar] == ok ]] && err_exit 'typeset -A not working for simple assignment'
+unset foo
+typeset -A foo=([1]=(x=ok) [2]=(x=no))
+[[ ${foo[bar].x} == ok ]] && err_exit 'typeset -A not working for compound assignment'
+[[ $($SHELL -c 'typeset -a foo;typeset | grep "foo$"' 2> /dev/null) == *index* ]] || err_exit 'typeset fails for indexed array with no elements'
+xxxxx=(one)
+[[ $(typeset | grep xxxxx$) == *'indexed array'* ]] || err_exit 'array of one element not an indexed array'
+unset foo
+foo[1]=(x=3 y=4)
+{ [[ ${!foo[1].*} == 'foo[1].x foo[1].y' ]] ;} 2> /dev/null || err_exit '${!foo[sub].*} not expanding correctly'
+unset x
+x=( typeset -a foo=( [0]="a" [1]="b" [2]="c" ))
+[[ ${@x.foo} == 'typeset -a'* ]] || err_exit 'x.foo is not an indexed array'
+x=( typeset -A foo=( [0]="a" [1]="b" [2]="c" ))
+[[ ${@x.foo} == 'typeset -A'* ]] || err_exit 'x.foo is not an associative array'
+$SHELL -c $'x=(foo\n\tbar\nbam\n)' 2> /dev/null || err_exit 'compound array assignment with new-lines not working'
+$SHELL -c $'x=(foo\n\tbar:\nbam\n)' 2> /dev/null || err_exit 'compound array assignment with labels not working'
+$SHELL -c $'x=(foo\n\tdone\nbam\n)' 2> /dev/null || err_exit 'compound array assignment with reserved words not working'
+[[ $($SHELL -c 'typeset -A A; print $(( A[foo].bar ))' 2> /dev/null) == 0 ]] || err_exit 'unset variable not evaluating to 0'
+unset a
+typeset -A a
+a[a].z=1
+a[z].z=2
+unset a[a]
+[[ ${!a[@]} == z ]] || err_exit '"unset a[a]" unsets entire array'
+unset a
+a=([x]=1 [y]=2 [z]=(foo=3 bar=4))
+eval "b=$(printf "%B\n" a)"
+eval "c=$(printf "%#B\n" a)"
+[[ ${a[*]} == "${b[*]}" ]] || err_exit 'printf %B not preserving values for arrays'
+[[ ${a[*]} == "${c[*]}" ]] || err_exit 'printf %#B not preserving values for arrays'
+unset a
+a=(zero one two three four)
+a[6]=six
+[[ ${a[-1]} == six ]] || err_exit 'a[-1] should be six'
+[[ ${a[-3]} == four ]] || err_exit 'a[-3] should be four'
+[[ ${a[-3..-1]} == 'four six' ]] || err_exit "a[-3,-1] should be 'four six'"
exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/arrays2.sh b/usr/src/lib/libshell/common/tests/arrays2.sh
new file mode 100644
index 0000000000..56bce796ae
--- /dev/null
+++ b/usr/src/lib/libshell/common/tests/arrays2.sh
@@ -0,0 +1,123 @@
+########################################################################
+# #
+# This software is part of the ast package #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
+# and is licensed under the #
+# Common Public License, Version 1.0 #
+# by AT&T Intellectual Property #
+# #
+# A copy of the License is available at #
+# http://www.opensource.org/licenses/cpl1.0.txt #
+# (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) #
+# #
+# Information and Software Systems Research #
+# AT&T Research #
+# Florham Park NJ #
+# #
+# David Korn <dgk@research.att.com> #
+# #
+########################################################################
+function err_exit
+{
+ print -u2 -n "\t"
+ print -u2 -r ${Command}[$1]: "${@:2}"
+ let Errors+=1
+}
+alias err_exit='err_exit $LINENO'
+
+Command=${0##*/}
+integer Errors=0
+for ((i=0; i < 4; i++ ))
+do for ((j=0; j < 5; j++ ))
+ do a[i][j]=$i$j
+ done
+done
+for ((i=0; i < 4; i++ ))
+do for ((j=0; j < 5; j++ ))
+ do [[ ${a[i][j]} == "$i$j" ]] || err_exit "\${a[$i][$j]} != $i$j"
+ done
+done
+for ((i=0; i < 4; i++ ))
+do j=0;for k in ${a[i][@]}
+ do [[ $k == "$i$j" ]] || err_exit "\${a[i][@]} != $i$j"
+ (( j++ ))
+ done
+done
+unset a
+a=(
+ ( 00 01 02 03 04 )
+ ( 10 11 12 13 14 15)
+ ( 20 21 22 23 24 )
+ ( 30 31 32 33 34 )
+)
+
+function check
+{
+ nameref a=$1
+ nameref b=a[2]
+ typeset c=$1
+ integer i j
+ for ((i=0; i < 4; i++ ))
+ do for ((j=0; j < 5; j++ ))
+ do [[ ${a[$i][$j]} == "$i$j" ]] || err_exit "\${$c[$i][$j]} != $i$j"
+ done
+ done
+ (( ${#a[@]} == 4 )) || err_exit "\${#$c[@]} not 4"
+ (( ${#a[0][@]} == 5 )) || err_exit "\${#$c[0][@]} not 5"
+ (( ${#a[1][@]} == 6 )) || err_exit "\${#$c[1][@]} not 6"
+ set -s -- ${!a[@]}
+ [[ ${@} == '0 1 2 3' ]] || err_exit "\${!$c[@]} not 0 1 2 3"
+ set -s -- ${!a[0][@]}
+ [[ ${@} == '0 1 2 3 4' ]] || err_exit "\${!$c[0][@]} not 0 1 2 3 4"
+ set -s -- ${!a[1][@]}
+ [[ ${@} == '0 1 2 3 4 5' ]] || err_exit "\${!$c[1][@]} not 0 1 2 3 4 5"
+ [[ $a == 00 ]] || err_exit "\$$c is not 00"
+ [[ ${a[0]} == 00 ]] || err_exit "\${$a[0]} is not 00"
+ [[ ${a[0][0]} == 00 ]] || err_exit "${a[0][0]} is not 00"
+ [[ ${a[0][0][0]} == 00 ]] || err_exit "\${$c[0][0][0]} is not 00"
+ [[ ${a[0][0][1]} == '' ]] || err_exit "\${$c[0][0][1]} is not empty"
+ [[ ${b[3]} == 23 ]] || err_exit "${!b}[3] not = 23"
+}
+
+check a
+
+unset a
+typeset -A a
+for ((i=0; i < 4; i++ ))
+do for ((j=0; j < 5; j++ ))
+ do a[$i][j]=$i$j
+ done
+done
+for ((i=0; i < 4; i++ ))
+do for ((j=0; j < 5; j++ ))
+ do [[ ${a[$i][j]} == "$i$j" ]] || err_exit "\${a[$i][$j]} == $i$j"
+ done
+done
+a[1][5]=15
+b=(
+ [0]=( 00 01 02 03 04 )
+ [1]=( 10 11 12 13 14 15)
+ [2]=( 20 21 22 23 24 )
+ [3]=( 30 31 32 33 34 )
+)
+check b
+[[ ${a[1][@]} == "${b[1][@]}" ]] || err_exit "a[1] not equal to b[1]"
+c=(
+ [0]=( [0]=00 [1]=01 [2]=02 [3]=03 [4]=04 )
+ [1]=( [0]=10 [1]=11 [2]=12 [3]=13 [4]=14 [5]=15)
+ [2]=( [0]=20 [1]=21 [2]=22 [3]=23 [4]=24 )
+ [3]=( [0]=30 [1]=31 [2]=32 [3]=33 [4]=34 )
+)
+check c
+typeset -A d
+d[0]=( [0]=00 [1]=01 [2]=02 [3]=03 [4]=04 )
+d[1]=( [0]=10 [1]=11 [2]=12 [3]=13 [4]=14 [5]=15)
+d[2]=( [0]=20 [1]=21 [2]=22 [3]=23 [4]=24 )
+d[3]=( [0]=30 [1]=31 [2]=32 [3]=33 [4]=34 )
+check d
+unset a b c d
+[[ ${a-set} ]] || err_exit "a is set after unset"
+[[ ${b-set} ]] || err_exit "b is set after unset"
+[[ ${c-set} ]] || err_exit "c is set after unset"
+[[ ${d-set} ]] || err_exit "c is set after unset"
+exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/attributes.sh b/usr/src/lib/libshell/common/tests/attributes.sh
index 8be16f1d42..2d4f1e3d21 100644
--- a/usr/src/lib/libshell/common/tests/attributes.sh
+++ b/usr/src/lib/libshell/common/tests/attributes.sh
@@ -1,10 +1,10 @@
########################################################################
# #
# This software is part of the ast package #
-# Copyright (c) 1982-2007 AT&T Knowledge Ventures #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
-# by AT&T Knowledge Ventures #
+# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# http://www.opensource.org/licenses/cpl1.0.txt #
@@ -123,6 +123,10 @@ typeset -Z2 m
if [[ $(/tmp/ksh$$) != 13 ]]
then err_exit 'attributes not cleared for script execution'
fi
+print 'print VAR=$VAR' > /tmp/ksh$$
+typeset -L70 VAR=var
+/tmp/ksh$$ > /tmp/ksh$$.1
+[[ $(< /tmp/ksh$$.1) == VAR= ]] || err_exit 'typeset -L should not be inherited'
typeset -Z LAST=00
unset -f foo
function foo
@@ -140,7 +144,8 @@ foo
if (( ${#LAST} != 2 ))
then err_exit 'LAST!=2'
fi
-rm -rf /tmp/ksh$$
+[[ $(set | grep LAST) == LAST=02 ]] || err_exit "LAST not correct in set list"
+rm -rf /tmp/ksh$$*
set -a
unset foo
foo=bar
@@ -190,7 +195,7 @@ hello worldhello worldhello world
!
[[ $v1 == "$b1" ]] || err_exit "v1=$v1 should be $b1"
[[ $v2 == "$x" ]] || err_exit "v1=$v2 should be $x"
-[[ $(env '!=1' $SHELL -c 'echo ok' 2>/dev/null) == ok ]] || err_exit 'malformed environment terminates shell'
+[[ $(env - '!=1' $SHELL -c 'echo ok' 2>/dev/null) == ok ]] || err_exit 'malformed environment terminates shell'
unset var
typeset -b var
printf '12%Z34' | read -r -N 5 var
@@ -213,4 +218,66 @@ function fun
fun
[[ $(export | grep foo) == 'foo=hello' ]] || err_exit 'export not working in functions'
[[ $(export | grep bar) ]] && err_exit 'typeset -x not local'
+[[ $($SHELL -c 'typeset -r IFS=;print -r $(pwd)' 2> /dev/null) == "$(pwd)" ]] || err_exit 'readonly IFS causes command substitution to fail'
+fred[66]=88
+[[ $(typeset -pa) == *fred* ]] || err_exit 'typeset -pa not working'
+unset x y z
+typeset -LZ3 x=abcd y z=00abcd
+y=03
+[[ $y == "3 " ]] || err_exit '-LZ3 not working for value 03'
+[[ $x == "abc" ]] || err_exit '-LZ3 not working for value abcd'
+[[ $x == "abc" ]] || err_exit '-LZ3 not working for value 00abcd'
+unset x z
+set +a
+[[ $(typeset -p z) ]] && err_exit "typeset -p for z undefined failed"
+unset z
+x='typeset -i z=45'
+eval "$x"
+[[ $(typeset -p z) == "$x" ]] || err_exit "typeset -p for '$x' failed"
+[[ $(typeset +p z) == "${x%=*}" ]] || err_exit "typeset +p for '$x' failed"
+unset z
+x='typeset -a z=(a b c)'
+eval "$x"
+[[ $(typeset -p z) == "$x" ]] || err_exit "typeset -p for '$x' failed"
+[[ $(typeset +p z) == "${x%=*}" ]] || err_exit "typeset +p for '$x' failed"
+unset z
+x='typeset -C z=(
+ foo=bar
+ xxx=bam
+)'
+eval "$x"
+x=${x//$'\t'}
+x=${x//$'(\n'/'('}
+x=${x//$'\n'/';'}
+[[ $(typeset -p z) == "$x" ]] || err_exit "typeset -p for '$x' failed"
+[[ $(typeset +p z) == "${x%%=*}" ]] || err_exit "typeset +p for '$x' failed"
+unset z
+x='typeset -A z=([bar]=bam [xyz]=bar)'
+eval "$x"
+[[ $(typeset -p z) == "$x" ]] || err_exit "typeset -p for '$x' failed"
+[[ $(typeset +p z) == "${x%%=*}" ]] || err_exit "typeset +p for '$x' failed"
+unset z
+foo=abc
+x='typeset -n z=foo'
+eval "$x"
+[[ $(typeset -p z) == "$x" ]] || err_exit "typeset -p for '$x' failed"
+[[ $(typeset +p z) == "${x%%=*}" ]] || err_exit "typeset +p for '$x' failed"
+typeset +n z
+unset foo z
+typeset -T Pt_t=(
+ float x=1 y=2
+)
+Pt_t z
+x=${z//$'\t'}
+x=${x//$'(\n'/'('}
+x=${x//$'\n'/';'}
+[[ $(typeset -p z) == "Pt_t z=$x" ]] || err_exit "typeset -p for type failed"
+[[ $(typeset +p z) == "Pt_t z" ]] || err_exit "typeset +p for type failed"
+unset z
+function foo
+{
+ typeset -p bar
+}
+bar=xxx
+[[ $(foo) == bar=xxx ]] || err_exit 'typeset -p not working inside a function'
exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/basic.sh b/usr/src/lib/libshell/common/tests/basic.sh
index 28755da226..3911f9c472 100644
--- a/usr/src/lib/libshell/common/tests/basic.sh
+++ b/usr/src/lib/libshell/common/tests/basic.sh
@@ -1,10 +1,10 @@
########################################################################
# #
# This software is part of the ast package #
-# Copyright (c) 1982-2007 AT&T Knowledge Ventures #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
-# by AT&T Knowledge Ventures #
+# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# http://www.opensource.org/licenses/cpl1.0.txt #
@@ -28,6 +28,27 @@ alias err_exit='err_exit $LINENO'
# test basic file operations like redirection, pipes, file expansion
Command=${0##*/}
integer Errors=0
+set -- \
+ go+r 0000 \
+ go-r 0044 \
+ ug=r 0330 \
+ go+w 0000 \
+ go-w 0022 \
+ ug=w 0550 \
+ go+x 0000 \
+ go-x 0011 \
+ ug=x 0660 \
+ go-rx 0055 \
+ uo-wx 0303 \
+ ug-rw 0660 \
+ o= 0007
+while (( $# >= 2 ))
+do umask 0
+ umask $1
+ g=$(umask)
+ [[ $g == $2 ]] || err_exit "umask 0; umask $1 failed -- expected $2, got $g"
+ shift 2
+done
umask u=rwx,go=rx || err_exit "umask u=rws,go=rx failed"
if [[ $(umask -S) != u=rwx,g=rx,o=rx ]]
then err_exit 'umask -S incorrect'
@@ -37,6 +58,13 @@ trap "cd /; rm -rf /tmp/ksh$$" EXIT
pwd=$PWD
[[ $SHELL != /* ]] && SHELL=$pwd/$SHELL
cd /tmp/ksh$$ || err_exit "cd /tmp/ksh$$ failed"
+um=$(umask -S)
+( umask 0777; > foobar )
+rm -f foobar
+> foobar
+[[ -r foobar ]] || err_exit 'umask not being restored after subshell'
+umask "$um"
+rm -f foobar
# optimizer bug test
> foobar
for i in 1 2
@@ -272,20 +300,24 @@ optbug()
return 1
}
optbug || err_exit 'array size optimzation bug'
-wait # not running --pipefile which would interfere with subsequent tests
+wait # not running --pipefail which would interfere with subsequent tests
: $(jobs -p) # required to clear jobs for next jobs -p (interactive side effect)
sleep 20 &
+pids=$!
if [[ $(jobs -p) != $! ]]
then err_exit 'jobs -p not reporting a background job'
fi
sleep 20 &
+pids="$pids $!"
foo()
{
set -- $(jobs -p)
(( $# == 2 )) || err_exit "$# jobs not reported -- 2 expected"
}
foo
-[[ $( (trap 'print alarm' ALRM; sleep 4) & sleep 2; kill -ALRM $!) == alarm ]] || err_exit 'ALRM signal not working'
+kill $pids
+
+[[ $( (trap 'print alarm' ALRM; sleep 4) & sleep 2; kill -ALRM $!; sleep 2; wait) == alarm ]] || err_exit 'ALRM signal not working'
[[ $($SHELL -c 'trap "" HUP; $SHELL -c "(sleep 2;kill -HUP $$)& sleep 4;print done"') != done ]] && err_exit 'ignored traps not being ignored'
[[ $($SHELL -c 'o=foobar; for x in foo bar; do (o=save);print $o;done' 2> /dev/null ) == $'foobar\nfoobar' ]] || err_exit 'for loop optimization subshell bug'
command exec 3<> /dev/null
@@ -319,6 +351,7 @@ chmod +x /tmp/ksh$$x
[[ $($SHELL -c "print foo | /tmp/ksh$$x ;:" 2> /dev/null ) == foo ]] || err_exit 'piping into script fails'
[[ $($SHELL -c 'X=1;print -r -- ${X:=$(expr "a(0)" : '"'a*(\([^)]\))')}'" 2> /dev/null) == 1 ]] || err_exit 'x=1;${x:=$(..."...")} failure'
[[ $($SHELL -c 'print -r -- ${X:=$(expr "a(0)" : '"'a*(\([^)]\))')}'" 2> /dev/null) == 0 ]] || err_exit '${x:=$(..."...")} failure'
+exec 3<&-
if [[ -d /dev/fd && -w /dev/fd/3 ]]
then [[ $(cat <(print hello) ) == hello ]] || err_exit "process substitution not working outside for or while loop"
$SHELL -c '[[ $(for i in 1;do cat <(print hello);done ) == hello ]]' 2> /dev/null|| err_exit "process substitution not working in for or while loop"
@@ -330,7 +363,68 @@ print "#! $SHELL" > /tmp/ksh$$x
print 'print -- $0' >> /tmp/ksh$$x
chmod +x /tmp/ksh$$x
[[ $(/tmp/ksh$$x) == /tmp/ksh$$x ]] || err_exit "\$0 is $0 instead of /tmp/ksh$$x"
+cat > /tmp/ksh$$x <<- \EOF
+ myfilter() { x=$(print ok | cat); print -r -- $SECONDS;}
+ set -o pipefail
+ sleep 3 | myfilter
+EOF
+(( $($SHELL /tmp/ksh$$x) > 2.0 )) && err_exit 'command substitution causes pipefail option to hang'
rm -f /tmp/ksh$$x
exec 3<&-
( typeset -r foo=bar) 2> /dev/null || err_exit 'readonly variables set in a subshell cannot unset'
+$SHELL -c 'x=${ print hello;}; [[ $x == hello ]]' 2> /dev/null || err_exit '${ command;} not supported'
+$SHELL 2> /dev/null <<- \EOF || err_exit 'multiline ${...} command substitution not supported'
+ x=${
+ print hello
+ }
+ [[ $x == hello ]]
+EOF
+$SHELL 2> /dev/null <<- \EOF || err_exit '${...} command substitution with side effects not supported '
+ y=bye
+ x=${
+ y=hello
+ print hello
+ }
+ [[ $y == $x ]]
+EOF
+$SHELL 2> /dev/null <<- \EOF || err_exit 'nested ${...} command substitution not supported'
+ x=${
+ print ${ print hello;} $(print world)
+ }
+ [[ $x == 'hello world' ]]
+EOF
+$SHELL 2> /dev/null <<- \EOF || err_exit 'terminating } is not a reserved word with ${ command }'
+ x=${ { print -n } ; print -n hello ; } ; print ' world' }
+ [[ $x == '}hello world' ]]
+EOF
+$SHELL 2> /dev/null <<- \EOF || err_exit '${ command;}xxx not working'
+ f()
+ {
+ print foo
+ }
+ [[ ${ f;}bar == foobar ]]
+EOF
+
+unset foo
+function foo
+{
+ print bar
+}
+[[ ${foo} == bar ]] || err_exit '${foo} is not command substitution when foo unset'
+[[ ! ${foo[@]} ]] || err_exit '${foo[@]} is not empty when foo is unset'
+[[ ! ${foo[3]} ]] || err_exit '${foo[3]} is not empty when foo is unset'
+[[ $(print "[${ print foo }]") == '[foo]' ]] || err_exit '${...} not working when } is followed by ]'
+[[ $(print "${ print "[${ print foo }]" }") == '[foo]' ]] || err_exit 'nested ${...} not working when } is followed by ]'
+unset foo
+foo=$(false) > /dev/null && err_exit 'failed command substitution with redirection not returning false'
+expected=foreback
+got=$(print -n fore;(sleep 2;print back)&)
+[[ $got == $expected ]] || err_exit "command substitution background process output error -- got '$got', expected '$expected'"
+
+for false in false $(whence -p false)
+do x=$($false) && err_exit "x=\$($false) should fail"
+ $($false) && err_exit "\$($false) should fail"
+ $($false) > /dev/null && err_exit "\$($false) > /dev/null should fail"
+done
+[[ $(env 'x-a=y' $SHELL -c 'env | grep x-a') == *x-a=y* ]] || err_exit 'invalid environment variables not preserved'
exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/bracket.sh b/usr/src/lib/libshell/common/tests/bracket.sh
index 25daf72c32..0b36806fbf 100644
--- a/usr/src/lib/libshell/common/tests/bracket.sh
+++ b/usr/src/lib/libshell/common/tests/bracket.sh
@@ -1,10 +1,10 @@
########################################################################
# #
# This software is part of the ast package #
-# Copyright (c) 1982-2007 AT&T Knowledge Ventures #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
-# by AT&T Knowledge Ventures #
+# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# http://www.opensource.org/licenses/cpl1.0.txt #
@@ -31,11 +31,12 @@ null=''
if [[ ! -z $null ]]
then err_exit "-z: null string should be of zero length"
fi
-file=/tmp/regress$$
+file=/tmp/regresso$$
+newer_file=/tmp/regressn$$
if [[ -z $file ]]
then err_exit "-z: $file string should not be of zero length"
fi
-trap "rm -f $file" EXIT
+trap "rm -f $file $newer_file" EXIT
rm -f $file
if [[ -a $file ]]
then err_exit "-a: $file shouldn't exist"
@@ -111,11 +112,12 @@ if [[ ! -w /dev/fd/2 ]]
then err_exit "/dev/fd/2 not open for writing"
fi
sleep 1
-if [[ ! . -ot $file ]]
-then err_exit ". should be older than $file"
+> $newer_file
+if [[ ! $file -ot $newer_file ]]
+then err_exit "$file should be older than $newer_file"
fi
-if [[ /bin -nt $file ]]
-then err_exit "$file should be newer than /bin"
+if [[ $file -nt $newer_file ]]
+then err_exit "$newer_file should be newer than $file"
fi
if [[ $file != /tmp/* ]]
then err_exit "$file should match /tmp/*"
@@ -176,6 +178,8 @@ test -d . -a '(' ! -f . ')' || err_exit 'test not working'
if [[ '!' != ! ]]
then err_exit 'quoting unary operator not working'
fi
+test \( -n x \) -o \( -n y \) 2> /dev/null || err_exit 'test ( -n x ) -o ( -n y) not working'
+test \( -n x \) -o -n y 2> /dev/null || err_exit 'test ( -n x ) -o -n y not working'
chmod 600 $file
exec 4> $file
print -u4 foobar
@@ -230,4 +234,12 @@ $SHELL -c '[[ abc =~ a(b)c ]]' 2> /dev/null || err_exit '[[ abc =~ a(b)c ]] fail
$SHELL -xc '[[ abc =~ \babc\b ]]' 2> /dev/null || err_exit '[[ abc =~ \babc\b ]] fails'
[[ abc == ~(E)\babc\b ]] || err_exit '\b not preserved for ere when not in ()'
[[ abc == ~(iEi)\babc\b ]] || err_exit '\b not preserved for ~(iEi) when not in ()'
+
+e=$($SHELL -c '[ -z "" -a -z "" ]' 2>&1)
+[[ $e ]] && err_exit "[ ... ] compatibility check failed -- $e"
+i=hell
+[[ hell0 == $i[0] ]] || err_exit 'pattern $i[0] interpreded as array ref'
+test '(' = ')' && err_exit '"test ( = )" should not be true'
+[[ $($SHELL -c 'case F in ~(Eilr)[a-z0-9#]) print ok;;esac' 2> /dev/null) == ok ]] || err_exit '~(Eilr) not working in case command'
+[[ $($SHELL -c "case Q in ~(Fi)q | \$'\E') print ok;;esac" 2> /dev/null) == ok ]] || err_exit '~(Fi)q | \E not working in case command'
exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/builtins.sh b/usr/src/lib/libshell/common/tests/builtins.sh
index 1d2dfe9157..08dac83a4e 100644
--- a/usr/src/lib/libshell/common/tests/builtins.sh
+++ b/usr/src/lib/libshell/common/tests/builtins.sh
@@ -1,10 +1,10 @@
########################################################################
# #
# This software is part of the ast package #
-# Copyright (c) 1982-2007 AT&T Knowledge Ventures #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
-# by AT&T Knowledge Ventures #
+# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# http://www.opensource.org/licenses/cpl1.0.txt #
@@ -43,9 +43,9 @@ if [[ $var != : || $OPTARG != r ]]
then err_exit "'getopts :r:s var -r' not working"
fi
OPTIND=1
-getopts :d#u var -d 100
-if [[ $var != d || $OPTARG != 100 ]]
-then err_exit "'getopts :d#u var -d 100' not working var=$var"
+getopts :d#u OPT -d 16177
+if [[ $OPT != d || $OPTARG != 16177 ]]
+then err_exit "'getopts :d#u OPT=d OPTARG=16177' failed -- OPT=$OPT OPTARG=$OPTARG"
fi
OPTIND=1
while getopts 'ab' option -a -b
@@ -128,6 +128,8 @@ x=$0
if [[ $(eval 'print $0') != $x ]]
then err_exit '$0 not correct for eval'
fi
+$SHELL -c 'read x <<< hello' 2> /dev/null || err_exit 'syntax <<< not recognized'
+($SHELL -c 'read x[1] <<< hello') 2> /dev/null || err_exit 'read x[1] not working'
unset x
readonly x
set -- $(readonly)
@@ -159,7 +161,7 @@ done
if [[ $(print -f "%b" "\a\n\v\b\r\f\E\03\\oo") != $'\a\n\v\b\r\f\E\03\\oo' ]]
then err_exit 'print -f "%b" not working'
fi
-if [[ $(print -f "%P" "[^x].*b$") != '*[!x]*b' ]]
+if [[ $(print -f "%P" "[^x].*b\$") != '*[!x]*b' ]]
then err_exit 'print -f "%P" not working'
fi
if [[ $(abc: for i in foo bar;do print $i;break abc;done) != foo ]]
@@ -184,10 +186,9 @@ fi
if [[ $(trap -p HUP) != 'print HUP' ]]
then err_exit '$(trap -p HUP) not working'
fi
-[[ $($SHELL -c 'trap "print ok" SIGTERM; kill -s SIGTERM $$' 2> /dev/null) == ok
- ]] || err_exit 'SIGTERM not recognized'
-[[ $($SHELL -c 'trap "print ok" sigterm; kill -s sigterm $$' 2> /dev/null) == ok
- ]] || err_exit 'SIGTERM not recognized'
+[[ $($SHELL -c 'trap "print ok" SIGTERM; kill -s SIGTERM $$' 2> /dev/null) == ok ]] || err_exit 'SIGTERM not recognized'
+[[ $($SHELL -c 'trap "print ok" sigterm; kill -s sigterm $$' 2> /dev/null) == ok ]] || err_exit 'SIGTERM not recognized'
+[[ $($SHELL -c '( trap "" TERM);kill $$;print bad' == bad) ]] 2> /dev/null && err_exit 'trap ignored in subshell causes it to be ignored by parent'
${SHELL} -c 'kill -1 -$$' 2> /dev/null
[[ $(kill -l $?) == HUP ]] || err_exit 'kill -1 -pid not working'
${SHELL} -c 'kill -1 -$$' 2> /dev/null
@@ -297,12 +298,6 @@ print $'line1\nline2' | behead
if [[ $left != line2 ]]
then err_exit "read reading ahead on a pipe"
fi
-read -n1 y <<!
-abc
-!
-if [[ $y != a ]]
-then err_exit 'read -n1 not working'
-fi
print -n $'{ read -r line;print $line;}\nhello' > /tmp/ksh$$
chmod 755 /tmp/ksh$$
trap 'rm -rf /tmp/ksh$$' EXIT
@@ -349,6 +344,34 @@ getopts 'n#num' opt -n 3
if [[ $($SHELL -c $'printf \'%2$s %1$s\n\' world hello') != 'hello world' ]]
then err_exit 'printf %2$s %1$s not working'
fi
+val=$(( 'C' ))
+set -- \
+ "'C" $val 0 \
+ "'C'" $val 0 \
+ '"C' $val 0 \
+ '"C"' $val 0 \
+ "'CX" $val 1 \
+ "'CX'" $val 1 \
+ "'C'X" $val 1 \
+ '"CX' $val 1 \
+ '"CX"' $val 1 \
+ '"C"X' $val 1
+while (( $# >= 3 ))
+do arg=$1 val=$2 code=$3
+ shift 3
+ for fmt in '%d' '%g'
+ do out=$(printf "$fmt" "$arg" 2>/dev/null)
+ err=$(printf "$fmt" "$arg" 2>&1 >/dev/null)
+ printf "$fmt" "$arg" >/dev/null 2>&1
+ ret=$?
+ [[ $out == $val ]] || err_exit "printf $fmt $arg failed -- expected $val, got $out"
+ if (( $code ))
+ then [[ $err ]] || err_exit "printf $fmt $arg failed, error message expected"
+ else [[ $err ]] && err_exit "$err: printf $fmt $arg failed, error message not expected -- got '$err'"
+ fi
+ (( $ret == $code )) || err_exit "printf $fmt $arg failed -- expected exit code $code, got $ret"
+ done
+done
((n=0))
((n++)); ARGC[$n]=1 ARGV[$n]=""
((n++)); ARGC[$n]=2 ARGV[$n]="-a"
@@ -362,43 +385,19 @@ do set -- ${ARGV[$i]}
do :
done
if [[ $OPTIND != ${ARGC[$i]} ]]
- then err_exit "\$OPTIND after getopts loop incorrect -- got $OPTIND, expected ${ARGC[$i]}"
+ then err_exit "\$OPTIND after getopts loop incorrect -- expected ${ARGC[$i]}, got $OPTIND"
fi
done
-unset a
-{ read -N3 a; read -N1 b;} <<!
-abcdefg
-!
-[[ $a == abc ]] || err_exit 'read -N3 here-document not working'
-[[ $b == d ]] || err_exit 'read -N1 here-document not working'
-read -n3 a <<!
-abcdefg
-!
-[[ $a == abc ]] || err_exit 'read -n3 here-document not working'
-(print -n a;sleep 1; print -n bcde) | { read -N3 a; read -N1 b;}
-[[ $a == abc ]] || err_exit 'read -N3 from pipe not working'
-[[ $b == d ]] || err_exit 'read -N1 from pipe not working'
-(print -n a;sleep 1; print -n bcde) |read -n3 a
-[[ $a == a ]] || err_exit 'read -n3 from pipe not working'
-rm -f /tmp/fifo$$
-if mkfifo /tmp/fifo$$ 2> /dev/null
-then (print -n a; sleep 1;print -n bcde) > /tmp/fifo$$ &
- {
- read -u5 -n3 -t2 a || err_exit 'read -n3 from fifo timedout'
- read -u5 -n1 -t2 b || err_exit 'read -n1 from fifo timedout'
- } 5< /tmp/fifo$$
- [[ $a == a ]] || err_exit 'read -n3 from fifo not working'
- rm -f /tmp/fifo$$
- mkfifo /tmp/fifo$$ 2> /dev/null
- (print -n a; sleep 1;print -n bcde) > /tmp/fifo$$ &
- {
- read -u5 -N3 -t2 a || err_exit 'read -N3 from fifo timed out'
- read -u5 -N1 -t2 b || err_exit 'read -N1 from fifo timedout'
- } 5< /tmp/fifo$$
- [[ $a == abc ]] || err_exit 'read -N3 from fifo not working'
- [[ $b == d ]] || err_exit 'read -N1 from fifo not working'
-fi
-rm -f /tmp/fifo$$
+options=ab:c
+optarg=foo
+set -- -a -b $optarg -c bar
+while getopts $options opt
+do case $opt in
+ a|c) [[ $OPTARG ]] && err_exit "getopts $options \$OPTARG for flag $opt failed, expected \"\", got \"$OPTARG\"" ;;
+ b) [[ $OPTARG == $optarg ]] || err_exit "getopts $options \$OPTARG failed -- \"$optarg\" expected, got \"$OPTARG\"" ;;
+ *) err_exit "getopts $options failed -- got flag $opt" ;;
+ esac
+done
function longline
{
integer i
@@ -448,4 +447,23 @@ then err_exit "read -t in pipe taking $total_t secs - $(( reps * delay )) minimu
elif (( total_t < reps * delay ))
then err_exit "read -t in pipe taking $total_t secs - $(( reps * delay )) minimum - too fast"
fi
+$SHELL -c 'sleep $(printf "%a" .95)' 2> /dev/null || err_exit "sleep doesn't except %a format constants"
+$SHELL -c 'test \( ! -e \)' 2> /dev/null ; [[ $? == 1 ]] || err_exit 'test \( ! -e \) not working'
+[[ $(ulimit) == "$(ulimit -fS)" ]] || err_exit 'ulimit is not the same as ulimit -fS'
+tmpfile=${TMP-/tmp}/ksh$$.2
+trap 'rm -f /tmp/ksh$$ "$tmpfile"' EXIT
+print $'\nprint -r -- "${.sh.file} ${LINENO} ${.sh.lineno}"' > $tmpfile
+[[ $( . "$tmpfile") == "$tmpfile 2 1" ]] || err_exit 'dot command not working'
+print -r -- "'xxx" > $tmpfile
+[[ $($SHELL -c ". $tmpfile"$'\n print ok' 2> /dev/null) == ok ]] || err_exit 'syntax error in dot command affects next command'
+
+float sec=$SECONDS del=4
+exec 3>&2 2>/dev/null
+$SHELL -c "( sleep 1; kill -ALRM \$\$ ) & sleep $del" 2> /dev/null
+exitval=$?
+(( sec = SECONDS - sec ))
+exec 2>&3-
+(( exitval )) && err_exit "sleep doesn't exit 0 with ALRM interupt"
+(( sec > (del - 1) )) || err_exit "ALRM signal causes sleep to terminate prematurely -- expected 3 sec, got $sec"
+
exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/case.sh b/usr/src/lib/libshell/common/tests/case.sh
index 4090d30103..cca84686bd 100644
--- a/usr/src/lib/libshell/common/tests/case.sh
+++ b/usr/src/lib/libshell/common/tests/case.sh
@@ -1,10 +1,10 @@
########################################################################
# #
# This software is part of the ast package #
-# Copyright (c) 1982-2007 AT&T Knowledge Ventures #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
-# by AT&T Knowledge Ventures #
+# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# http://www.opensource.org/licenses/cpl1.0.txt #
diff --git a/usr/src/lib/libshell/common/tests/comvar.sh b/usr/src/lib/libshell/common/tests/comvar.sh
index 5dc5c59a1c..dfc9d9acfd 100644
--- a/usr/src/lib/libshell/common/tests/comvar.sh
+++ b/usr/src/lib/libshell/common/tests/comvar.sh
@@ -1,10 +1,10 @@
########################################################################
# #
# This software is part of the ast package #
-# Copyright (c) 1982-2007 AT&T Knowledge Ventures #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
-# by AT&T Knowledge Ventures #
+# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# http://www.opensource.org/licenses/cpl1.0.txt #
@@ -73,6 +73,7 @@ if [[ ${!x.@} != foo.x ]]
then err_exit 'name references not expanded on prefix matching'
fi
unset x
+unset -n x
(
x=()
x.foo.bar=7
@@ -191,7 +192,235 @@ point=(integer x=6 y=8)
localvar
(( (point.x*point.x + point.y*point.y) == 100 )) || err_exit "global compound variable not preserved"
[[ $($SHELL -c 'foo=();foo.[x]=(y z); print ${foo.x[@]}') == 'y z' ]] 2> /dev/null || err_exit 'foo=( [x]=(y z) not working'
+function staticvar
+{
+ if [[ $1 ]]
+ then print -r -- "$point"
+ return
+ fi
+ typeset -S point=(typeset -i x=3 y=4)
+ (( (point.x*point.x + point.y*point.y) == 25 )) || err_exit "local compound variable not working"
+ point.y=5
+ point.z=foobar
+}
+staticvar
+ (( (point.x*point.x + point.y*point.y) == 100 )) || err_exit "global compound variable not preserved"
+[[ $(staticvar x) == $'(\n\ttypeset -i x=3\n\ttypeset -i y=5\n\tz=foobar\n)' ]] || err_exit 'static variables in function not working'
+integer x=3
+( typeset -S x=+++)2> /dev/null || err_exit "typeset -S doesn't unset first"
+
unset z
( [[ ${z.foo.bar:-abc} == abc ]] 2> /dev/null) || err_exit ':- not working with compound variables'
-exit $((Errors))
+stack=()
+typeset -a stack.items=([0]=foo [1]=bar)
+[[ ${stack.items[0]} == foo ]] || err_exit 'typeset -a variable not expanding correctly'
+$SHELL -c 'typeset -a info=( [1]=( passwd=( since=2005-07-20) ))' || err_exit 'problem with embedded index array in compound variable'
+x=(foo=([1]=(y=([2]=(z=4)))))
+[[ $x == *'.y'=* ]] && err_exit 'expansion with bogus leading . in name'
+unset z
+z=1
+function foo
+{
+ z=3
+ [[ ${a.z} == 3 ]] && err_exit "\${a.z} should not be 3"
+ print hi
+}
+a=( b=$(foo) )
+[[ ${a.z} == 3 ]] && err_exit 'a.z should not be set to 3'
+function a.b.get
+{
+ .sh.value=foo
+}
+{ b=( b1=${a.b} ) ;} 2> /dev/null
+[[ ${b.b1} == foo ]] || err_exit '${b.b1} should be foo'
+function dcl1
+{
+ eval 'a=1
+ function a.set
+ { print ${.sh.name}=${.sh.value}; }'
+}
+function dcl2
+{
+ eval 'b=(typeset x=0; typeset y=0 )
+ function b.x.set
+ { print ${.sh.name}=${.sh.value}; }'
+}
+dcl1
+[[ ${ a=123;} == 'a=123' ]] || err_exit 'should be a=123'
+dcl2
+[[ ${ b.x=456;} == 'b.x=456' ]] || err_exit 'should be b.x=456'
+eval 'b=(typeset x=0; typeset y=0 )
+function b.x.set
+{ print ${.sh.name}=${.sh.value}; }' > /dev/null
+[[ ${ b.x=789;} == 'b.x=789' ]] || err_exit 'should be b.x=789'
+unset a b
+function func
+{
+ typeset X
+ X=( bar=2 )
+}
+
+X=( foo=1 )
+func
+[[ $X == $'(\n\tfoo=1\n)' ]] || err_exit 'scoping problem with compound variables'
+unset foo
+typeset -A foo=([a]=aa;[b]=bb;[c]=cc)
+[[ ${foo[c]} == cc ]] || err_exit 'associative array assignment with; not working'
+[[ $({ $SHELL -c 'x=(); typeset -a x.foo; x.foo=bar; print -r -- "$x"' ;} 2> /dev/null) == $'(\n\ttypeset -a foo=bar\n)' ]] || err_exit 'indexed array in compound variable with only element 0 defined fails'
+unset foo
+foo=(typeset -a bar)
+[[ $foo == *'typeset -a bar'* ]] || err_exit 'array attribute -a not preserved in compound variable'
+unset s
+typeset -A s=( [foo]=(y=2 z=3) [bar]=(y=4 z=5))
+[[ ${s[@]} == *z=*z=* ]] || err_exit 'missing elements in compound associative array'
+unset nodes
+typeset -A nodes
+nodes[0]+=( integer x=5)
+[[ ${nodes[0].x} == 5 ]] || err_exit '${nodes[0].x} should be 5'
+unset foo
+typeset -C foo
+foo.bar=abc
+[[ $foo == $'(\n\tbar=abc\n)' ]] || err_exit 'typeset -C not working for foo'
+typeset -C foo=(bar=def)
+[[ $foo == $'(\n\tbar=def\n)' ]] || err_exit 'typeset -C not working when initialized'
+foo=(
+ hello=ok
+ yes=( bam=2 yes=4)
+ typeset -A array=([one]=one [two]=2)
+ last=me
+)
+eval foo2="$foo"
+foo2.hello=notok foo2.yes.yex=no foo2.extra=yes.
+typeset -C bar bam
+{
+ read -Cu3 bar
+ read -Cu3 bam
+ read -ru3
+} 3<<- ++++
+ "$foo"
+ "$foo2"
+ last line
+++++
+[[ $? == 0 ]] || err_exit ' read -C failed'
+[[ $bar == "$foo" ]] || err_exit '$foo != $bar'
+[[ $bam == "$foo2" ]] || err_exit '$foo2 != $bmr'
+[[ $REPLY == 'last line' ]] || err_exit "\$REPLY=$REPLY should be 'last line"
+typeset x=( typeset -a foo=( [1][3]=hello [9][2]="world" ) )
+eval y="(typeset -a foo=$(printf "%B\n" x.foo) )"
+[[ $x == "$y" ]] || err_exit '$x.foo != $y.foo with %B'
+eval y="(typeset -a foo=$(printf "%#B\n" x.foo) )"
+[[ $x == "$y" ]] || err_exit '$x.foo != $y.foo with %#B'
+eval y="$(printf "%B\n" x)"
+[[ $x == "$y" ]] || err_exit '$x != $y with %B'
+eval y="$(printf "%#B\n" x)"
+[[ $x == "$y" ]] || err_exit '$x != $y with %#B'
+y=$(set | grep ^x=) 2> /dev/null
+eval "${y/#x/y}"
+[[ $x == "$y" ]] || err_exit '$x != $y with set | grep'
+unset x y z
+x=( float x=0 y=1; z=([foo]=abc [bar]=def))
+typeset -C y=x
+[[ $x == "$y" ]] || err_exit '$x != $y with typeset -C'
+unset y
+y=()
+y=x
+[[ $x == "$y" ]] || err_exit '$x != $y when x=y and x and y are -C '
+function foobar
+{
+ typeset -C z
+ z=x
+ [[ $x == "$z" ]] || err_exit '$x != $z when x=z and x and z are -C '
+ y=z
+}
+[[ $x == "$y" ]] || err_exit '$x != $y when x=y -C copied in a function '
+z=(foo=abc)
+y+=z
+[[ $y == *foo=abc* ]] || err_exit 'z not appended to y'
+unset y.foo
+[[ $x == "$y" ]] || err_exit '$x != $y when y.foo deleted'
+unset x y
+x=( foo=(z=abc d=ghi) bar=abc; typeset -A r=([x]=3 [y]=4))
+unset x
+x=()
+[[ $x == $'(\n)' ]] || err_exit 'unset compound variable is not empty'
+unset z
+z=()
+z.foo=( [one]=hello [two]=(x=3 y=4) [three]=hi)
+z.bar[0]=hello
+z.bar[2]=world
+z.bar[1]=(x=4 y=5)
+exp='(
+ typeset -a bar=(
+ [0]=hello
+ [2]=world
+ [1]=(
+ x=4
+ y=5
+ )
+ )
+ typeset -A foo=(
+ [one]=hello
+ [three]=hi
+ [two]=(
+ x=3
+ y=4
+ )
+ )
+)'
+got=$z
+[[ $got == "$exp" ]] || {
+ exp=$(printf %q "$exp")
+ got=$(printf %q "$got")
+ err_exit "compound indexed array pretty print failed -- expected $exp, got $got"
+}
+
+typeset -A record
+record[a]=(
+ typeset -a x=(
+ [1]=(
+ X=1
+ )
+ )
+)
+exp=$'(\n\ttypeset -a x=(\n\t\t[1]=(\n\t\t\tX=1\n\t\t)\n\t)\n)'
+got=${record[a]}
+[[ $got == "$exp" ]] || {
+ exp=$(printf %q "$exp")
+ got=$(printf %q "$got")
+ err_exit "compound indexed array pretty print failed -- expected $exp, got $got"
+}
+
+unset r
+r=(
+ typeset -a x=(
+ [1]=(
+ X=1
+ )
+ )
+)
+exp=$'(\n\ttypeset -a x=(\n\t\t[1]=(\n\t\t\tX=1\n\t\t)\n\t)\n)'
+got=$r
+[[ $got == "$exp" ]] || {
+ exp=$(printf %q "$exp")
+ got=$(printf %q "$got")
+ err_exit "compound indexed array pretty print failed -- expected $exp, got $got"
+}
+
+# array of compund variables
+typeset -C data=(
+ typeset -a samples
+)
+data.samples+=(
+ type1="greeting1"
+ timestamp1="now1"
+ command1="grrrr1"
+)
+data.samples+=(
+ type2="greeting2"
+ timestamp2="now2"
+ command2="grrrr2"
+)
+
+[[ $data == %(()) ]] || err_exit "unbalanced parenthesis with compound variable containing array of compound variables"
+exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/coprocess.sh b/usr/src/lib/libshell/common/tests/coprocess.sh
index 5bbbdf759a..feff0bace2 100644
--- a/usr/src/lib/libshell/common/tests/coprocess.sh
+++ b/usr/src/lib/libshell/common/tests/coprocess.sh
@@ -1,10 +1,10 @@
########################################################################
# #
# This software is part of the ast package #
-# Copyright (c) 1982-2007 AT&T Knowledge Ventures #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
-# by AT&T Knowledge Ventures #
+# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# http://www.opensource.org/licenses/cpl1.0.txt #
@@ -37,7 +37,7 @@ fi
function ping # id
{
integer x=0
- while ((x < 5))
+ while ((x++ < 5))
do read -r
print -r "$1 $REPLY"
done
@@ -52,6 +52,7 @@ print -u5 'hello again' || err_exit 'write on u5 fails'
read -u6 line
[[ $line == 'hello again' ]] || err_exit 'coprocess after moving fds fails'
exec 5<&- 6<&-
+wait $!
ping three |&
exec 3>&p
@@ -66,25 +67,25 @@ do case $i in
four) to=-u4;;
pipe) to=-p;;
esac
- count=count+1
- print $to $i $count
+ (( count++ ))
+ print $to $i $count
done
while ((count > 0))
-do count=count-1
+do (( count-- ))
read -p
-# print -r - "$REPLY"
set -- $REPLY
if [[ $1 != $2 ]]
- then err_exit "$1 does not match 2"
+ then err_exit "$1 does not match $2"
fi
case $1 in
- three);;
- four) ;;
- pipe) ;;
- *) err_exit "unknown message +|$REPLY|+"
+ three) ;;
+ four) ;;
+ pipe) ;;
+ *) err_exit "unknown message +|$REPLY|+" ;;
esac
done
+kill $(jobs -p) 2>/dev/null
file=/tmp/regress$$
trap "rm -f $file" EXIT
@@ -92,60 +93,72 @@ cat > $file <<\!
/bin/cat |&
!
chmod +x $file
-$file 2> /dev/null || err_exit "parent coprocess prevents script coprocess"
+sleep 10 |&
+$file 2> /dev/null || err_exit "parent coprocess prevents script coprocess"
exec 5<&p 6>&p
exec 5<&- 6>&-
+kill $(jobs -p) 2>/dev/null
+
${SHELL-ksh} |&
print -p $'print hello | cat\nprint Done'
read -t 5 -p
read -t 5 -p
if [[ $REPLY != Done ]]
-then err_exit "${SHELL-ksh} coprocess not working"
+then err_exit "${SHELL-ksh} coprocess not working"
fi
exec 5<&p 6>&p
exec 5<&- 6>&-
-count=0
+wait $!
+
{
echo line1 | grep 'line2'
echo line2 | grep 'line1'
} |&
-SECONDS=0
-while
- read -p -t 10 line
-do
- ((count = count + 1))
- echo "Line $count: $line"
+SECONDS=0 count=0
+while read -p -t 10 line
+do ((count++))
done
if (( SECONDS > 8 ))
-then err_exit 'read -p hanging'
+then err_exit "read -p hanging (SECONDS=$SECONDS count=$count)"
fi
+wait $!
+
( sleep 3 |& sleep 1 && kill $!; sleep 1; sleep 3 |& sleep 1 && kill $! ) ||
err_exit "coprocess cleanup not working correctly"
-unset line
+{ : |& } 2>/dev/null ||
+ err_exit "subshell coprocess lingers in parent"
+wait $!
+
+unset N r e
+integer N=5
+e=12345
(
- integer n=0
- while read line
- do echo $line |&
- if cat <&p
- then ((n++))
- wait $!
- fi
- done > /dev/null 2>&1 <<- !
- line1
- line2
- line3
- line4
- line5
- line6
- line7
- !
- (( n==7 )) && print ok
-) | read -t 10 line
-if [[ $line != ok ]]
-then err_exit 'coprocess timing bug'
-fi
+ integer i
+ for ((i = 1; i <= N; i++))
+ do print $i |&
+ read -p r
+ print -n $r
+ wait $!
+ done
+ print
+) 2>/dev/null | read -t 10 r
+[[ $r == $e ]] || err_exit "coprocess timing bug -- expected $e, got '$r'"
+r=
+(
+ integer i
+ for ((i = 1; i <= N; i++))
+ do print $i |&
+ sleep 0.01
+ r=$r$(cat <&p)
+ wait $!
+ done
+ print $r
+) 2>/dev/null | read -t 10 r
+[[ $r == $e ]] || err_exit "coprocess command substitution bug -- expected $e, got '$r'"
+
(
/bin/cat |&
+ sleep 0.01
exec 6>&p
print -u6 ok
exec 6>&-
@@ -154,7 +167,7 @@ fi
) && err_exit 'coprocess with subshell would hang'
for sig in IOT ABRT
do if ( trap - $sig ) 2> /dev/null
- then if [[ $(
+ then if [[ $( { sig=$sig $SHELL 2> /dev/null <<- '++EOF++'
cat |&
pid=$!
trap "print TRAP" $sig
@@ -164,9 +177,12 @@ do if ( trap - $sig ) 2> /dev/null
sleep 2
kill -$sig $$
kill $pid
- ) 2> /dev/null &
+ sleep 2
+ kill $$
+ ) &
read -p
- ) != $'TRAP\nTRAP' ]]
+ ++EOF++
+ } ) != $'TRAP\nTRAP' ]] 2> /dev/null
then err_exit 'traps when reading from coprocess not working'
fi
break
diff --git a/usr/src/lib/libshell/common/tests/cubetype.sh b/usr/src/lib/libshell/common/tests/cubetype.sh
new file mode 100644
index 0000000000..f3597d258d
--- /dev/null
+++ b/usr/src/lib/libshell/common/tests/cubetype.sh
@@ -0,0 +1,210 @@
+########################################################################
+# #
+# This software is part of the ast package #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
+# and is licensed under the #
+# Common Public License, Version 1.0 #
+# by AT&T Intellectual Property #
+# #
+# A copy of the License is available at #
+# http://www.opensource.org/licenses/cpl1.0.txt #
+# (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) #
+# #
+# Information and Software Systems Research #
+# AT&T Research #
+# Florham Park NJ #
+# #
+# David Korn <dgk@research.att.com> #
+# #
+########################################################################
+function err_exit
+{
+ print -u2 -n "\t"
+ print -u2 -r ${Command}[$1]: "${@:2}"
+ (( Errors+=1 ))
+}
+alias err_exit='err_exit $LINENO'
+
+Command=${0##*/}
+integer Errors=0
+integer n=2
+
+typeset -T Box_t=(
+ float -h 'height in inches' x=2
+ float -h 'width in inches' y=4
+ comvar=(top=8 bottom=9)
+ integer -S count=0
+ items=(foo bar)
+ colors=([wall]=blue [floor]=red)
+ typeset name=unknown
+ typeset -L6 status=INIT
+ len()
+ {
+ print -r $((sqrt(_.x*_.x + _.y*_.y)))
+ (( _.count++))
+ }
+ typeset -fh 'distance from the origin' len
+ depth()
+ {
+ print 0
+ }
+ float x=3
+)
+
+for ((i=0; i < n; i++))
+do
+Box_t b=(name=box1)
+exp=3 got=${b.x}
+[[ "$got" == "$exp" ]] || err_exit "\${b.x} incorrect for iteration $i -- expected $exp, got '$got'"
+exp=5 got=$(( b.len ))
+(( got == exp )) || err_exit "b.len incorrect for iteration $i -- expected $exp, got '$got = sqrt(${b.x}*${b.x}+${b.y}*${b.y})'"
+exp=5 got=${b.len}
+[[ "$got" == "$exp" ]] || err_exit "\${b.len} incorrect for iteration $i -- expected $exp, got '$got = sqrt(${b.x}*${b.x}+${b.y}*${b.y})'"
+exp=box1 got=${b.name}
+[[ "$got" == "${exp}" ]] || err_exit "\${b.name} incorrect for iteration $i -- expected $exp, got '$got'"
+exp=2 got=$(( b.count ))
+(( got == exp )) || err_exit "b.count incorrect for iteration $i -- expected $exp, got '$got'"
+exp=2 got=${b.count}
+[[ "$got" == "$exp" ]] || err_exit "\${b.ccount} incorrect for iteration $i -- expected $exp, got '$got'"
+b.colors[wall]=green
+b.colors[door]=white
+exp=3 got=${#b.colors[@]}
+[[ "$got" == "$exp" ]] || err_exit "\${#b.colors[@]} incorrect for iteration $i -- expected $exp, got '$got'"
+b.comvar.bottom=11
+b.items[1]=bam
+b.items[2]=extra
+exp=3 got=${#b.items[@]}
+[[ ${#b.items[@]} == 3 ]] || err_exit "\${#b.items[@]} incorrect for iteration $i -- expected $exp, got '$got'"
+Box_t bb=b
+bb.colors[desk]=orange
+exp=4 got=${#b.colors[@]}
+[[ ${#bb.colors[@]} == 4 ]] || err_exit "\${#bb.colors[@]} incorrect for iteration $i -- expected $exp, got '$got'"
+unset b.colors
+exp=2 got=${#b.colors[@]}
+[[ ${#b.colors[@]} == 2 ]] || err_exit "\${#b.colors[@]} incorrect for iteration $i -- expected $exp, got '$got'"
+unset b.items
+exp=2 got=${#b.items[@]}
+[[ ${#b.items[@]} == 2 ]] || err_exit "\${#b.items[@]} incorrect for iteration $i -- expected $exp, got '$got'"
+unset bb.colors
+exp=2 got=${#bb.colors[@]}
+[[ ${#bb.colors[@]} == 2 ]] || err_exit "\${#bb.colors[@]} incorrect for iteration $i -- expected $exp, got '$got'"
+unset bb.items
+exp=2 got=${#bb.items[@]}
+[[ ${#bb.items[@]} == 2 ]] || err_exit "\${#bb.items[@]} incorrect for iteration $i -- expected $exp, got '$got'"
+[[ $b == "$bb" ]] || err_exit "\$b='$b' != \$bb='$bb'"
+b.count=0
+false
+unset b bb
+done
+
+typeset -T Cube_t=(
+ Box_t _=(y=5)
+ float z=1
+ depth()
+ {
+ print -r -- $((_.z))
+ }
+ len()
+ {
+ print -r $((sqrt(_.x*_.x + _.y*_.y + _.z*_.z)))
+ (( _.count++))
+ }
+ float x=8
+ fun()
+ {
+ print 'hello world'
+ }
+)
+
+
+for ((i=0; i < n; i++))
+do
+Box_t b=(name=box2)
+[[ ${b.name} == box2 ]] || err_exit "\${b.name} incorrect -- expected box2, got '${b.name}'"
+(( b.len == 5 )) || err_exit "b.len incorrect for box2 -- expected 5, got '$(( b.len ))'"
+(( b.count == 1 )) || err_exit "b.count incorrect -- expected 1, got '$(( b.count ))'"
+Cube_t c=(name=cube1)
+[[ $c == $'(\n\ttypeset -l -E x=8\n\ttypeset -l -E y=5\n\tcomvar=(\n\t\ttop=8\n\t\tbottom=9\n\t)\n\ttypeset -S -l -i count=1\n\ttypeset -a items=(\n\t\tfoo\n\t\tbar\n\t)\n\ttypeset -A colors=(\n\t\t[floor]=red\n\t\t[wall]=blue\n\t)\n\tname=cube1\n\ttypeset -L 6 status=INIT\n\ttypeset -l -E z=1\n)' ]] || err_exit '$c not correct'
+[[ ${c.x} == 8 ]] || err_exit '${c.x} != 8'
+[[ ${c.depth} == 1 ]] || err_exit '${c.depth} != 1'
+[[ ${c.name} == cube1 ]] || err_exit '${c.name} != cube1 '
+[[ $(c.fun) == 'hello world' ]] || err_exit '$(c.fun) != "hello world"'
+[[ ${c.fun} == 'hello world' ]] || err_exit '${c.fun} != "hello world"'
+(( abs(c.len - sqrt(90)) < 1e-10 )) || err_exit 'c.len != sqrt(90)'
+(( c.count == 2 )) || err_exit 'c.count != 2'
+(( c.count == b.count )) || err_exit 'c.count != b.count'
+c.count=0
+Cube_t d=c
+[[ $d == "$c" ]] || err_exit '$d != $c'
+eval "Cube_t zzz=$c"
+[[ $zzz == "$c" ]] || err_exit '$zzz != $c'
+Cube_t zzz=c
+[[ $zzz == "$c" ]] || err_exit '$zzz != $c without eval'
+xxx=$(typeset -p c)
+eval "${xxx/c=/ccc=}"
+[[ $ccc == "$c" ]] || err_exit '$ccc != $c'
+unset b c d zzz xxx ccc
+done
+for ((i=0; i < n; i++))
+do
+Cube_t cc
+cc[2]=(x=2 y=3 name=two colors+=([table]=white) items+=(pencil) z=6)
+[[ ${cc[2].y} == 3 ]] || err_exit '${cc[2].y} != 3'
+(( cc[2].y == 3 )) || err_exit '(( cc[2].y != 3))'
+[[ ${cc[2].colors[table]} == white ]] || err_exit '${cc[2].colors[table]} != white'
+[[ ${cc[2].items[2]} == pencil ]] || err_exit '${cc[2].items[2]} != pencil'
+(( cc[2].len == 7 )) || err_exit '(( cc[2].len != 7 ))'
+[[ $(cc[2].len) == 7 ]] || err_exit '$(cc[2].len) != 7 ))'
+[[ ${cc[2].len} == 7 ]] || err_exit '${cc[2].len} != 7 ))'
+(( cc[2].count == 2 )) || err_exit 'cc[2].count != 2'
+unset cc[2].x cc[2].y cc[2].z
+(( cc[2].len == cc[0].len )) || err_exit 'cc[2].len != cc[0].len'
+(( cc[2].len == cc.len )) || err_exit 'cc[2].len != cc.len'
+(( cc[2].count == 6 )) || err_exit 'cc[2].count != 6'
+unset cc[2].name cc[2].colors cc[2].items
+[[ $cc == "${cc[2]}" ]] || err_exit '$cc != ${cc[2]}'
+cc.count=0
+unset cc
+Cube_t -A cc
+cc[two]=(x=2 y=3 name=two colors+=([table]=white) items+=(pencil) z=6)
+Cube_t cc[one]
+[[ ${#cc[@]} == 2 ]] || err_exit '${#cc[@]} != 2'
+[[ ${cc[two].y} == 3 ]] || err_exit '${cc[two].y} != 3'
+(( cc[two].y == 3 )) || err_exit '(( cc[two].y != 3))'
+[[ ${cc[two].colors[table]} == white ]] || err_exit '${cc[two].colors[table]} != white'
+[[ ${cc[two].items[2]} == pencil ]] || err_exit '${cc[two].items[2]} != pencil'
+(( cc[two].len == 7 )) || err_exit '(( cc[two].len != 7 ))'
+[[ $(cc[two].len) == 7 ]] || err_exit '$(cc[two].len) != 7 ))'
+[[ ${cc[two].len} == 7 ]] || err_exit '${cc[two].len} != 7 ))'
+(( cc[two].count == 2 )) || err_exit 'cc[two].count != 2'
+unset cc[two].x cc[two].y cc[two].z
+(( cc[two].len == cc[one].len )) || err_exit 'cc[two].len != cc[one].len'
+(( cc[two].count == 4 )) || err_exit 'cc[two].count != 4'
+unset cc[two].name unset cc[two].colors cc[two].items
+[[ ${cc[one]} == "${cc[two]}" ]] || err_exit '${cc[one]} != ${cc[two]}'
+cc[two].count=0
+unset cc
+Cube_t cc=(
+ [one]=
+ [two]=(x=2 y=3 name=two colors+=([table]=white) z=6)
+)
+[[ ${#cc[@]} == 2 ]] || err_exit '${#cc[@]} != 2'
+[[ ${cc[two].y} == 3 ]] || err_exit '${cc[two].y} != 3'
+(( cc[two].y == 3 )) || err_exit '(( cc[two].y != 3))'
+[[ ${cc[two].colors[table]} == white ]] || err_exit '${cc[two].colors[table]} != white'
+(( cc[two].len == 7 )) || err_exit '(( cc[two].len != 7 ))'
+[[ $(cc[two].len) == 7 ]] || err_exit '$(cc[two].len) != 7 ))'
+[[ ${cc[two].len} == 7 ]] || err_exit '${cc[two].len} != 7 ))'
+(( cc[two].count == 2 )) || err_exit 'cc[two].count != 2'
+unset cc[two].x cc[two].y cc[two].z
+(( cc[two].len == cc[one].len )) || err_exit 'cc[two].len != cc[one].len'
+(( cc[two].count == 4 )) || err_exit 'cc[two].count != 4'
+cc[three]=cc[two]
+[[ ${cc[two]} == "${cc[three]}" ]] || err_exit ' ${cc[two]} != ${cc[three]}'
+[[ $cc[two] == "${cc[three]}" ]] || err_exit ' $cc[two] != $cc[three]'
+[[ ${#cc[@]} == 3 ]] || err_exit '${#cc[@]} != 3'
+unset cc[two].name unset cc[two].colors
+cc[two].count=0
+unset cc
+done
+exit $Errors
diff --git a/usr/src/lib/libshell/common/tests/enum.sh b/usr/src/lib/libshell/common/tests/enum.sh
new file mode 100644
index 0000000000..35d2a27952
--- /dev/null
+++ b/usr/src/lib/libshell/common/tests/enum.sh
@@ -0,0 +1,67 @@
+########################################################################
+# #
+# This software is part of the ast package #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
+# and is licensed under the #
+# Common Public License, Version 1.0 #
+# by AT&T Intellectual Property #
+# #
+# A copy of the License is available at #
+# http://www.opensource.org/licenses/cpl1.0.txt #
+# (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) #
+# #
+# Information and Software Systems Research #
+# AT&T Research #
+# Florham Park NJ #
+# #
+# David Korn <dgk@research.att.com> #
+# #
+########################################################################
+function err_exit
+{
+ print -u2 -n "\t"
+ print -u2 -r ${Command}[$1]: "${@:2}"
+ (( Errors+=1 ))
+}
+alias err_exit='err_exit $LINENO'
+
+Command=${0##*/}
+integer Errors=0
+enum Color_t=(red green blue orange yellow)
+enum -i Sex_t=(Male Female)
+for ((i=0; i < 1000; i++))
+do
+Color_t x
+[[ $x == red ]] || err_exit 'Color_t does not default to red'
+x=orange
+[[ $x == orange ]] || err_exit '$x should be orange'
+( x=violet) 2> /dev/null && err_exit 'x=violet should fail'
+x[2]=green
+[[ ${x[2]} == green ]] || err_exit '${x[2]} should be green'
+(( x[2] == 1 )) || err_exit '((x[2]!=1))'
+[[ $((x[2])) == 1 ]] || err_exit '$((x[2]))!=1'
+[[ $x == orange ]] || err_exit '$x is no longer orange'
+Color_t -A y
+y[foo]=yellow
+[[ ${y[foo]} == yellow ]] || err_exit '${y[foo]} != yellow'
+(( y[foo] == 4 )) || err_exit '(( y[foo] != 4))'
+unset y
+typeset -a [Color_t] z
+z[green]=xyz
+[[ ${z[green]} == xyz ]] || err_exit '${z[green]} should be xyz'
+[[ ${z[1]} == xyz ]] || err_exit '${z[1]} should be xyz'
+z[orange]=bam
+[[ ${!z[@]} == 'green orange' ]] || err_exit '${!z[@]} == "green orange"'
+unset x
+Sex_t x
+[[ $x == Male ]] || err_exit 'Sex_t not defaulting to Male'
+x=female
+[[ $x == Female ]] || err_exit 'Sex_t not case sensitive'
+unset x y z
+done
+(
+typeset -T X_t=( typeset name=aha )
+typeset -a[X_t] arr
+) 2> /dev/null
+[[ $? == 1 ]] || err_exit 'typeset -a[X_t] should generate an error message when X-t is not an enumeriation type'
+exit $Errors
diff --git a/usr/src/lib/libshell/common/tests/exit.sh b/usr/src/lib/libshell/common/tests/exit.sh
index b099ccfecc..01c407bf18 100644
--- a/usr/src/lib/libshell/common/tests/exit.sh
+++ b/usr/src/lib/libshell/common/tests/exit.sh
@@ -1,10 +1,10 @@
########################################################################
# #
# This software is part of the ast package #
-# Copyright (c) 1982-2007 AT&T Knowledge Ventures #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
-# by AT&T Knowledge Ventures #
+# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# http://www.opensource.org/licenses/cpl1.0.txt #
@@ -78,4 +78,5 @@ then err_exit 'subshell trap on exit overwrites parent trap'
fi
cd ~- || err_exit "cd back failed"
rm -r /tmp/ksh$$ || err_exit "rm -r /tmp/ksh$$ failed"
+$SHELL -c 'builtin -f cmd getconf; getconf --"?-version"; exit 0' >/dev/null 2>&1 || err_exit 'ksh plugin exit failed -- was ksh built with CCFLAGS+=$(CC.EXPORT.DYNAMIC)?'
exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/expand.sh b/usr/src/lib/libshell/common/tests/expand.sh
index 70018b1feb..5dd46bdd8f 100644
--- a/usr/src/lib/libshell/common/tests/expand.sh
+++ b/usr/src/lib/libshell/common/tests/expand.sh
@@ -1,10 +1,10 @@
########################################################################
# #
# This software is part of the ast package #
-# Copyright (c) 1982-2007 AT&T Knowledge Ventures #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
-# by AT&T Knowledge Ventures #
+# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# http://www.opensource.org/licenses/cpl1.0.txt #
@@ -37,6 +37,8 @@ set -- \
'f{d,e,f}g' 'fdg feg ffg' \
'{l,n,m}xyz' 'lxyz nxyz mxyz' \
'{abc\,def}' '{abc,def}' \
+ '{"abc,def"}' '{abc,def}' \
+ "{'abc,def'}" '{abc,def}' \
'{abc}' '{abc}' \
'\{a,b,c,d,e}' '{a,b,c,d,e}' \
'{x,y,\{a,b,c}}' 'x} y} {a} b} c}' \
diff --git a/usr/src/lib/libshell/common/tests/functions.sh b/usr/src/lib/libshell/common/tests/functions.sh
index fd45cd1767..0eaa17c688 100644
--- a/usr/src/lib/libshell/common/tests/functions.sh
+++ b/usr/src/lib/libshell/common/tests/functions.sh
@@ -1,10 +1,10 @@
########################################################################
# #
# This software is part of the ast package #
-# Copyright (c) 1982-2007 AT&T Knowledge Ventures #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
-# by AT&T Knowledge Ventures #
+# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# http://www.opensource.org/licenses/cpl1.0.txt #
@@ -27,6 +27,14 @@ alias err_exit='err_exit $LINENO'
integer Errors=0
Command=${0##*/}
+
+tmp=/tmp/kshtf$$
+function cleanup
+{
+ rm -rf $tmp
+}
+mkdir $tmp || err_exit "mkdir $tmp failed"
+
integer foo=33
bar=bye
# check for global variables and $0
@@ -81,11 +89,11 @@ function foobar
{
(return 0)
}
-> /tmp/shtests$$.1
+> $tmp/shtests$$.1
{
foobar
-if [ -r /tmp/shtests$$.1 ]
-then rm -r /tmp/shtests$$.1
+if [ -r $tmp/shtests$$.1 ]
+then rm -r $tmp/shtests$$.1
else err_exit 'return within subshell inside function error'
fi
}
@@ -111,7 +119,7 @@ function foo
x=2
(
x=3
- cd /tmp
+ cd $tmp
print bar
)
if [[ $x != 2 ]]
@@ -130,19 +138,19 @@ fun() /bin/echo hello
if [[ $(fun) != hello ]]
then err_exit one line functions not working
fi
-trap 'rm -f /tmp/script$$ /tmp/data$$.[12]' EXIT
-cat > /tmp/script$$ <<-\!
+trap cleanup EXIT
+cat > $tmp/script$$ <<-\!
print -r -- "$1"
!
-chmod +x /tmp/script$$
+chmod +x $tmp/script$$
function passargs
{
- /tmp/script$$ "$@"
+ $tmp/script$$ "$@"
}
if [[ $(passargs one) != one ]]
then err_exit 'passing args from functions to scripts not working'
fi
-cat > /tmp/script$$ <<-\!
+cat > $tmp/script$$ <<-\!
trap 'exit 0' EXIT
function foo
{
@@ -150,17 +158,17 @@ cat > /tmp/script$$ <<-\!
}
foo
!
-if ! /tmp/script$$
+if ! $tmp/script$$
then err_exit 'exit trap incorrectly triggered'
fi
-if ! $SHELL -c /tmp/script$$
+if ! $SHELL -c $tmp/script$$
then err_exit 'exit trap incorrectly triggered when invoked with -c'
fi
-$SHELL -c "trap 'rm /tmp/script$$' EXIT"
-if [[ -f /tmp/script$$ ]]
+$SHELL -c "trap 'rm $tmp/script$$' EXIT"
+if [[ -f $tmp/script$$ ]]
then err_exit 'exit trap not triggered when invoked with -c'
fi
-cat > /tmp/script$$ <<- \EOF
+cat > $tmp/script$$ <<- \EOF
foobar()
{
return
@@ -169,8 +177,8 @@ cat > /tmp/script$$ <<- \EOF
foobar
print -r -- "$1"
EOF
-chmod +x /tmp/script$$
-if [[ $( $SHELL /tmp/script$$ arg1 arg2) != arg2 ]]
+chmod +x $tmp/script$$
+if [[ $( $SHELL $tmp/script$$ arg1 arg2) != arg2 ]]
then err_exit 'arguments not restored by posix functions'
fi
function foo
@@ -205,15 +213,15 @@ if [[ $(foo) != 3 ]]
then err_exit 'variable assignment list not using parent scope'
fi
unset -f foo$$
-trap "rm -f /tmp/foo$$" EXIT INT
-cat > /tmp/foo$$ <<!
+#trap "rm -f $tmp/foo$$" EXIT INT
+cat > $tmp/foo$$ <<!
function foo$$
{
print foo
}
!
-chmod +x /tmp/foo$$
-FPATH=/tmp
+chmod +x $tmp/foo$$
+FPATH=$tmp
autoload foo$$
if [[ $(foo$$ 2>/dev/null) != foo ]]
then err_exit 'autoload not working'
@@ -286,6 +294,8 @@ bad
if [[ $val != false ]]
then err_exit 'set -e not inherited for posix functions'
fi
+trap - ERR
+
function myexport
{
nameref var=$1
@@ -302,34 +312,40 @@ function myexport
}
export dgk=base
-if [[ $(myexport dgk fun) != fun ]]
-then err_exit 'export inside function not working'
+val=$(myexport dgk fun)
+if [[ $val != fun ]]
+then err_exit "export inside function not working -- expected 'fun', got '$val'"
fi
-val=$(export | grep "^dgk=")
-if [[ ${val#dgk=} != base ]]
-then err_exit 'export not restored after function call'
+val=$(export | sed -e '/^dgk=/!d' -e 's/^dgk=//')
+if [[ $val != base ]]
+then err_exit "export not restored after function call -- expected 'base', got '$val'"
fi
-if [[ $(myexport dgk fun fun2) != fun2 ]]
-then err_exit 'export inside function not working with recursive function'
+val=$(myexport dgk fun fun2)
+if [[ $val != fun2 ]]
+then err_exit "export inside function not working with recursive function -- expected 'fun2', got '$val'"
fi
-val=$(export | grep "^dgk=")
-if [[ ${val#dgk=} != base ]]
-then err_exit 'export not restored after recursive function call'
+val=$(export | sed -e '/^dgk=/!d' -e 's/^dgk=//')
+if [[ $val != base ]]
+then err_exit "export not restored after recursive function call -- expected 'base', got '$val'"
fi
-if [[ $(dgk=try3 myexport dgk) != try3 ]]
-then err_exit 'name=value not added to export list with function call'
+val=$(dgk=try3 myexport dgk)
+if [[ $val != try3 ]]
+then err_exit "name=value not added to export list with function call -- expected 'try3', got '$val'"
fi
-val=$(export | grep "^dgk=")
-if [[ ${val#dgk=} != base ]]
-then err_exit 'export not restored name=value function call'
+val=$(export | sed -e '/^dgk=/!d' -e 's/^dgk=//')
+if [[ $val != base ]]
+then err_exit "export not restored name=value function call -- expected 'base', got '$val'"
fi
unset zzz
-if [[ $(myexport zzz fun) != fun ]]
-then err_exit 'export inside function not working for zzz'
+val=$(myexport zzz fun)
+if [[ $val != fun ]]
+then err_exit "export inside function not working -- expected 'fun', got '$val'"
fi
-if [[ $(export | grep "zzz=") ]]
-then err_exit 'zzz exported after function call'
+val=$(export | sed -e '/^zzz=/!d' -e 's/^zzz=//')
+if [[ $val ]]
+then err_exit "unset varaible exported after function call -- expected '', got '$val'"
fi
+
unset zzz
typeset -u zzz
function foo
@@ -368,8 +384,8 @@ function closure
return $r
}
closure 0 || err_exit -u2 'for loop function optimization bug2'
-mkdir /tmp/ksh$$ || err_exit "mkdir /tmp/ksh$$ failed"
-cd /tmp/ksh$$ || err_exit "cd /tmp/ksh$$ failed"
+mkdir $tmp/ksh$$ || err_exit "mkdir $tmp/ksh$$ failed"
+cd $tmp/ksh$$ || err_exit "cd $tmp/ksh$$ failed"
print 'false' > try
chmod +x try
cat > tst <<- EOF
@@ -384,9 +400,9 @@ EOF
if [[ $($SHELL < tst) == error ]]
then err_exit 'ERR trap not cleared'
fi
-FPATH=/tmp/ksh$$
-print ': This does nothing' > /tmp/ksh$$/foobar
-chmod +x /tmp/ksh$$/foobar
+FPATH=$tmp/ksh$$
+print ': This does nothing' > $tmp/ksh$$/foobar
+chmod +x $tmp/ksh$$/foobar
unset -f foobar
{ foobar;} 2> /dev/null
if [[ $? != 126 ]]
@@ -395,7 +411,7 @@ fi
print 'set a b c' > dotscript
[[ $(PATH=$PATH: $SHELL -c '. dotscript;print $#') == 3 ]] || err_exit 'positional parameters not preserved with . script without arguments'
cd ~- || err_exit "cd back failed"
-cd /; rm -r /tmp/ksh$$ || err_exit "rm -r /tmp/ksh$$ failed"
+cd /; rm -r $tmp/ksh$$ || err_exit "rm -r $tmp/ksh$$ failed"
function errcheck
{
trap 'print ERR; return 1' ERR
@@ -423,7 +439,7 @@ a()
b() { : ;}
[[ $(a) == a ]] || err_exit '.sh.fun not set correctly in a function'
print $'a(){\ndate\n}' | $SHELL 2> /dev/null || err_exit 'parser error in a(){;date;}'
-cat > /tmp/data$$.1 << '++EOF'
+cat > $tmp/data$$.1 << '++EOF'
1 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
2 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
3 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
@@ -445,7 +461,7 @@ cat > /tmp/data$$.1 << '++EOF'
19 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
20 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
++EOF
-cat > /tmp/script$$ << '++EOF'
+cat > $tmp/script$$ << '++EOF'
# XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
# XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
# XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
@@ -711,11 +727,10 @@ f()
{
cat <<\M
++EOF
-cat /tmp/data$$.1 >> /tmp/script$$
-printf 'M\n}\n\nf\n\n' >> /tmp/script$$
-$SHELL -c /tmp/script$$ > /tmp/data$$.2
-cmp -s /tmp/data$$.[12] || err_exit 'error with long functions'
-rm -f /tmp/script$$ /tmp/data$$.[12]
+cat $tmp/data$$.1 >> $tmp/script$$
+printf 'M\n}\n\nf\n\n' >> $tmp/script$$
+$SHELL -c $tmp/script$$ > $tmp/data$$.2
+cmp -s $tmp/data$$.[12] || err_exit 'error with long functions'
v=1
function f
{
@@ -755,4 +770,212 @@ function foo
done
}
[[ $(foo 'NUMBERED RECORDSIZE') == ok ]] || err_exit 'optimization error with undefined variable'
+unset x
+x=$(
+ set -e
+ integer count=0
+ function err_f
+ {
+ if ((count++==3))
+ then print failed
+ else false
+ fi
+ }
+ trap 'err_f' ERR
+ false
+)
+[[ $x == failed ]] && err_exit 'ERR trap executed multiple times'
+trap cleanup EXIT
+export environment
+typeset global
+function f
+{
+ typeset i t local
+
+ for i
+ do case $i in
+ [-+]*) set "$@"
+ continue
+ ;;
+ local) local=f
+ t=$(typeset +f $local)
+ ;;
+ global) global=f
+ t=$(typeset +f $global)
+ ;;
+ environment)
+ environment=f
+ t=$(typeset +f $environment)
+ ;;
+ literal)t=$(typeset +f f)
+ ;;
+ positional)
+ set -- f
+ t=$(typeset +f $1)
+ ;;
+ esac
+ [[ $t ]] || err_exit "typeset +f \$$i failed"
+ done
+}
+f local global environment literal positional
+$SHELL -c '
+ print exit 0 > '$tmp'/script$$
+ chmod +x '$tmp'/script$$
+ unset var
+ var=( ident=1 )
+ function fun
+ {
+ PATH='$tmp' script$$
+ }
+ fun
+' || err_exit "compound variable cleanup before script exec failed"
+( $SHELL << \++EOF++
+function main
+{
+ typeset key
+ typeset -A entry
+ entry[a]=( value=aaa )
+}
+main
+++EOF++
+) 2> /dev/null || err_exit 'function main fails'
+optind=$OPTIND
+sub()
+{
+ (
+ OPTIND=1
+ while getopts :abc OPTION "$@"
+ do print OPTIND=$OPTIND
+ done
+ )
+}
+[[ $(sub -a) == OPTIND=2 ]] || err_exit 'OPTIND should be 2'
+[[ $(sub -a) == OPTIND=2 ]] || err_exit 'OPTIND should be 2 again'
+[[ $OPTIND == "$optind" ]] || err_exit 'OPTIND should be 1'
+
+function bar
+{
+ [[ -o nounset ]] && err_exit 'nounset option should not be inherited'
+}
+function foo
+{
+ set -o nounset
+ bar
+}
+set +o nounset
+foo
+function red
+{
+ integer -S d=0
+ printf 'red_one %d\n' d
+ (( d++ ))
+ return 0
+}
+[[ ${ red } != 'red_one 0' ]] && err_exit 'expected red_one 0'
+[[ ${ red } != 'red_one 1' ]] && err_exit 'expected red_one 1'
+xyz=$0
+function traceback
+{
+ integer .level=.sh.level
+ while((--.level>=0))
+ do
+ ((.sh.level = .level))
+ [[ $xyz == "$0" ]] || err_exit "\$xyz=$xyz does not match $0 on level ${.level}"
+ [[ ${.sh.lineno} == "$1" ]] || err_exit "\${.sh.lineno}=${.sh.lineno} does not match $1 on level ${.level}"
+ done
+}
+
+function foo
+{
+ typeset xyz=foo
+ set -- $((LINENO+1))
+ bar $LINENO "$1"
+}
+
+function bar
+{
+ typeset xyz=bar
+ set -- $((LINENO+2))
+ trap 'traceback $LINENO' DEBUG
+ : $LINENO "$1"
+}
+
+set -- $((LINENO+1))
+foo $LINENO
+function .sh.fun.set
+{
+ print -r -- "${.sh.value}"
+}
+function abc
+{
+ :
+}
+def()
+{
+ :
+}
+[[ $(abc) == abc ]] || err_exit '.sh.fun.set not capturing function name'
+[[ $(def) == def ]] || err_exit '.sh.fun.set not capturing name()'
+unset -f .sh.fun.set
+
+# tests for debug functions
+basefile=${.sh.file}
+integer baseline
+cleanup
+trap 'rm $tmp' EXIT
+tmp=${TMPDIR:-/tmp}/ksh$$.1
+cat > $tmp << \+++
+ : line 1
+
+ : line 3
++++
+# Print one line in a call stack
+function _Dbg_print_frame
+{
+ typeset -i pos=$1
+ typeset fn=$2
+ typeset filename="$3"
+ typeset -i line=$4
+ typeset arg=$5
+ shift 5
+ if ((pos==0))
+ then [[ $filename == "$basefile" ]] || err_exit "filename for level 0 is $filename not $basename"
+ [[ $arg == DEBUG ]] && ((baseline++))
+ [[ $line == "$baseline" ]] || err_exit "line number for level 0 is $line not $baseline"
+ elif ((pos==1))
+ then [[ $filename == "$tmp" ]] || err_exit "filename for level 1 is $filename not $tmp"
+ [[ $* == 'foo bar' ]] || err_exit "args are '$*', not 'foo bar'"
+ [[ $line == $arg ]] || err_exit "line number for level 1 is $line not $arg"
+ else err_exit "level should be 0 or 1 but is $pos"
+ fi
+}
+
+function _Dbg_debug_trap_handler
+{
+
+ integer .level=.sh.level .max=.sh.level-1
+ while((--.level>=0))
+ do
+ ((.sh.level = .level))
+ _Dbg_print_frame "${.level}" "$0" "${.sh.file}" "${.sh.lineno}" "${.sh.command##* }" "$@"
+ done
+}
+
+((baseline=LINENO+2))
+trap '_Dbg_debug_trap_handler' DEBUG
+. $tmp foo bar
+trap '' DEBUG
+
+caller() {
+ integer .level=.sh.level .max=.sh.level-1
+ while((--.level>=0))
+ do
+ ((.sh.level = .level))
+ print -r -- "${.sh.lineno}"
+ done
+}
+bar() { caller;}
+set -- $(bar)
+[[ $1 == $2 ]] && err_exit ".sh.inline optimization bug"
+( $SHELL -c ' function foo { typeset x=$1;print $1;};z=();z=($(foo bar)) ') 2> /dev/null || err_exit 'using a function to set an array in a command sub fails'
exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/glob.sh b/usr/src/lib/libshell/common/tests/glob.sh
index 4d5fa0b519..2c3ccd09d3 100644
--- a/usr/src/lib/libshell/common/tests/glob.sh
+++ b/usr/src/lib/libshell/common/tests/glob.sh
@@ -1,10 +1,10 @@
########################################################################
# #
# This software is part of the ast package #
-# Copyright (c) 1982-2007 AT&T Knowledge Ventures #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
-# by AT&T Knowledge Ventures #
+# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# http://www.opensource.org/licenses/cpl1.0.txt #
@@ -19,8 +19,7 @@
########################################################################
function err_exit
{
- print -u2 -n "\t"
- print -u2 -r ${Command}[$1]: "${@:2}"
+ print -u2 -r $'\t'"${Command}[$1] ${@:2}"
((errors++))
}
alias err_exit='err_exit $LINENO'
@@ -30,6 +29,8 @@ integer aware=0 contrary=0 ignorant=0
function test_glob
{
typeset lineno expected drop arg got sep op val add del
+ lineno=$1
+ shift
if [[ $1 == --* ]]
then del=${1#--}
shift
@@ -38,8 +39,8 @@ function test_glob
then add=${1#++}
shift
fi
- lineno=$1 expected=$2
- shift 2
+ expected=$1
+ shift
if (( contrary ))
then if [[ $expected == "<Beware> "* ]]
then expected=${expected#"<Beware> "}
@@ -62,9 +63,10 @@ function test_glob
fi
fi
if [[ $got != "$expected" ]]
- then err_exit $lineno "glob: got '$got' expected '$expected'"
+ then 'err_exit' $lineno "glob -- expected '$expected', got '$got'"
fi
}
+alias test_glob='test_glob $LINENO'
function test_case
{
@@ -77,9 +79,10 @@ function test_case
esac
"
if [[ $got != "$expected" ]]
- then err_exit $lineno "case $subject in $pattern) got '$got' expected '$expected'"
+ then 'err_exit' $lineno "case $subject in $pattern) -- expected '$expected', got '$got'"
fi
}
+alias test_case='test_case $LINENO'
Command=${0##*/}
tmp=/tmp/ksh$$
@@ -88,9 +91,9 @@ unset undefined
export LC_COLLATE=C
-mkdir $tmp || err_exit $LINENO "mkdir $tmp failed"
+mkdir $tmp || err_exit "mkdir $tmp failed"
trap "cd /; rm -rf $tmp" EXIT
-cd $tmp || err_exit $LINENO "cd $tmp failed"
+cd $tmp || err_exit "cd $tmp failed"
rm -rf *
touch B b
@@ -108,14 +111,14 @@ rm -rf *
touch a b c d abc abd abe bb bcd ca cb dd de Beware
mkdir bdir
-test_glob $LINENO '<a> <abc> <abd> <abe> <X*>' a* X*
-test_glob $LINENO '<a> <abc> <abd> <abe>' \a*
+test_glob '<a> <abc> <abd> <abe> <X*>' a* X*
+test_glob '<a> <abc> <abd> <abe>' \a*
if ( set --nullglob ) 2>/dev/null
then
set --nullglob
- test_glob $LINENO '<a> <abc> <abd> <abe>' a* X*
+ test_glob '<a> <abc> <abd> <abe>' a* X*
set --nonullglob
fi
@@ -126,54 +129,54 @@ then
mkdir tmp
touch tmp/l1 tmp/l2 tmp/l3
- test_glob $LINENO '' tmp/l[12] tmp/*4 tmp/*3
- test_glob $LINENO '' tmp/l[12] tmp/*4 tmp/*3
+ test_glob '' tmp/l[12] tmp/*4 tmp/*3
+ test_glob '' tmp/l[12] tmp/*4 tmp/*3
rm -r tmp
set --nofailglob
fi
-test_glob $LINENO '<bdir/>' b*/
-test_glob $LINENO '<*>' \*
-test_glob $LINENO '<a*>' 'a*'
-test_glob $LINENO '<a*>' a\*
-test_glob $LINENO '<c> <ca> <cb> <a*> <*q*>' c* a\* *q*
-test_glob $LINENO '<**>' "*"*
-test_glob $LINENO '<**>' \**
-test_glob $LINENO '<\.\./*/>' "\.\./*/"
-test_glob $LINENO '<s/\..*//>' 's/\..*//'
-test_glob $LINENO '</^root:/{s/^[!:]*:[!:]*:\([!:]*\).*$/\1/>' "/^root:/{s/^[!:]*:[!:]*:\([!:]*\).*"'$'"/\1/"
-test_glob $LINENO '<abc> <abd> <abe> <bb> <cb>' [a-c]b*
-test_glob ++Beware $LINENO '<abd> <abe> <bb> <bcd> <bdir> <ca> <cb> <dd> <de>' [a-y]*[!c]
-test_glob $LINENO '<abd> <abe>' a*[!c]
+test_glob '<bdir/>' b*/
+test_glob '<*>' \*
+test_glob '<a*>' 'a*'
+test_glob '<a*>' a\*
+test_glob '<c> <ca> <cb> <a*> <*q*>' c* a\* *q*
+test_glob '<**>' "*"*
+test_glob '<**>' \**
+test_glob '<\.\./*/>' "\.\./*/"
+test_glob '<s/\..*//>' 's/\..*//'
+test_glob '</^root:/{s/^[!:]*:[!:]*:\([!:]*\).*$/\1/>' "/^root:/{s/^[!:]*:[!:]*:\([!:]*\).*"'$'"/\1/"
+test_glob '<abc> <abd> <abe> <bb> <cb>' [a-c]b*
+test_glob ++Beware '<abd> <abe> <bb> <bcd> <bdir> <ca> <cb> <dd> <de>' [a-y]*[!c]
+test_glob '<abd> <abe>' a*[!c]
touch a-b aXb
-test_glob $LINENO '<a-b> <aXb>' a[X-]b
+test_glob '<a-b> <aXb>' a[X-]b
touch .x .y
-test_glob --Beware $LINENO '<Beware> <d> <dd> <de>' [!a-c]*
+test_glob --Beware '<Beware> <d> <dd> <de>' [!a-c]*
if mkdir a\*b 2>/dev/null
then
touch a\*b/ooo
- test_glob $LINENO '<a*b/ooo>' a\*b/*
- test_glob $LINENO '<a*b/ooo>' a\*?/*
- test_case $LINENO '<match>' '!7' '*\!*'
- test_case $LINENO '<match>' 'r.*' '*.\*'
- test_glob $LINENO '<abc>' a[b]c
- test_glob $LINENO '<abc>' a["b"]c
- test_glob $LINENO '<abc>' a[\b]c
- test_glob $LINENO '<abc>' a?c
- test_case $LINENO '<match>' 'abc' 'a"b"c'
- test_case $LINENO '<match>' 'abc' 'a*c'
- test_case $LINENO '<nomatch>' 'abc' '"a?c"'
- test_case $LINENO '<nomatch>' 'abc' 'a\*c'
- test_case $LINENO '<nomatch>' 'abc' 'a\[b]c'
- test_case $LINENO '<match>' '"$undefined"' '""'
- test_case $LINENO '<match>' 'abc' 'a["\b"]c'
+ test_glob '<a*b/ooo>' a\*b/*
+ test_glob '<a*b/ooo>' a\*?/*
+ test_case '<match>' '!7' '*\!*'
+ test_case '<match>' 'r.*' '*.\*'
+ test_glob '<abc>' a[b]c
+ test_glob '<abc>' a["b"]c
+ test_glob '<abc>' a[\b]c
+ test_glob '<abc>' a?c
+ test_case '<match>' 'abc' 'a"b"c'
+ test_case '<match>' 'abc' 'a*c'
+ test_case '<nomatch>' 'abc' '"a?c"'
+ test_case '<nomatch>' 'abc' 'a\*c'
+ test_case '<nomatch>' 'abc' 'a\[b]c'
+ test_case '<match>' '"$undefined"' '""'
+ test_case '<match>' 'abc' 'a["\b"]c'
rm -rf mkdir a\*b
fi
@@ -182,68 +185,68 @@ mkdir man
mkdir man/man1
touch man/man1/sh.1
-test_glob $LINENO '<man/man1/sh.1>' */man*/sh.*
-test_glob $LINENO '<man/man1/sh.1>' $(echo */man*/sh.*)
-test_glob $LINENO '<man/man1/sh.1>' "$(echo */man*/sh.*)"
-
-test_case $LINENO '<match>' 'abc' 'a***c'
-test_case $LINENO '<match>' 'abc' 'a*****?c'
-test_case $LINENO '<match>' 'abc' '?*****??'
-test_case $LINENO '<match>' 'abc' '*****??'
-test_case $LINENO '<match>' 'abc' '*****??c'
-test_case $LINENO '<match>' 'abc' '?*****?c'
-test_case $LINENO '<match>' 'abc' '?***?****c'
-test_case $LINENO '<match>' 'abc' '?***?****?'
-test_case $LINENO '<match>' 'abc' '?***?****'
-test_case $LINENO '<match>' 'abc' '*******c'
-test_case $LINENO '<match>' 'abc' '*******?'
-test_case $LINENO '<match>' 'abcdecdhjk' 'a*cd**?**??k'
-test_case $LINENO '<match>' 'abcdecdhjk' 'a**?**cd**?**??k'
-test_case $LINENO '<match>' 'abcdecdhjk' 'a**?**cd**?**??k***'
-test_case $LINENO '<match>' 'abcdecdhjk' 'a**?**cd**?**??***k'
-test_case $LINENO '<match>' 'abcdecdhjk' 'a**?**cd**?**??***k**'
-test_case $LINENO '<match>' 'abcdecdhjk' 'a****c**?**??*****'
-test_case $LINENO '<match>' "'-'" '[-abc]'
-test_case $LINENO '<match>' "'-'" '[abc-]'
-test_case $LINENO '<match>' "'\\'" '\\'
-test_case $LINENO '<match>' "'\\'" '[\\]'
-test_case $LINENO '<match>' "'\\'" "'\\'"
-test_case $LINENO '<match>' "'['" '[[]'
-test_case $LINENO '<match>' '[' '[[]'
-test_case $LINENO '<match>' "'['" '['
-test_case $LINENO '<match>' '[' '['
-test_case $LINENO '<match>' "'[abc'" "'['*"
-test_case $LINENO '<nomatch>' "'[abc'" '[*'
-test_case $LINENO '<match>' '[abc' "'['*"
-test_case $LINENO '<nomatch>' '[abc' '[*'
-test_case $LINENO '<match>' 'abd' "a[b/c]d"
-test_case $LINENO '<match>' 'a/d' "a[b/c]d"
-test_case $LINENO '<match>' 'acd' "a[b/c]d"
-test_case $LINENO '<match>' "']'" '[]]'
-test_case $LINENO '<match>' "'-'" '[]-]'
-test_case $LINENO '<match>' 'p' '[a-\z]'
-test_case $LINENO '<match>' '"/tmp"' '[/\\]*'
-test_case $LINENO '<nomatch>' 'abc' '??**********?****?'
-test_case $LINENO '<nomatch>' 'abc' '??**********?****c'
-test_case $LINENO '<nomatch>' 'abc' '?************c****?****'
-test_case $LINENO '<nomatch>' 'abc' '*c*?**'
-test_case $LINENO '<nomatch>' 'abc' 'a*****c*?**'
-test_case $LINENO '<nomatch>' 'abc' 'a********???*******'
-test_case $LINENO '<nomatch>' "'a'" '[]'
-test_case $LINENO '<nomatch>' 'a' '[]'
-test_case $LINENO '<nomatch>' "'['" '[abc'
-test_case $LINENO '<nomatch>' '[' '[abc'
-
-test_glob ++Beware $LINENO '<b> <bb> <bcd> <bdir>' b*
-test_glob $LINENO '<Beware> <b> <bb> <bcd> <bdir>' [bB]*
+test_glob '<man/man1/sh.1>' */man*/sh.*
+test_glob '<man/man1/sh.1>' $(echo */man*/sh.*)
+test_glob '<man/man1/sh.1>' "$(echo */man*/sh.*)"
+
+test_case '<match>' 'abc' 'a***c'
+test_case '<match>' 'abc' 'a*****?c'
+test_case '<match>' 'abc' '?*****??'
+test_case '<match>' 'abc' '*****??'
+test_case '<match>' 'abc' '*****??c'
+test_case '<match>' 'abc' '?*****?c'
+test_case '<match>' 'abc' '?***?****c'
+test_case '<match>' 'abc' '?***?****?'
+test_case '<match>' 'abc' '?***?****'
+test_case '<match>' 'abc' '*******c'
+test_case '<match>' 'abc' '*******?'
+test_case '<match>' 'abcdecdhjk' 'a*cd**?**??k'
+test_case '<match>' 'abcdecdhjk' 'a**?**cd**?**??k'
+test_case '<match>' 'abcdecdhjk' 'a**?**cd**?**??k***'
+test_case '<match>' 'abcdecdhjk' 'a**?**cd**?**??***k'
+test_case '<match>' 'abcdecdhjk' 'a**?**cd**?**??***k**'
+test_case '<match>' 'abcdecdhjk' 'a****c**?**??*****'
+test_case '<match>' "'-'" '[-abc]'
+test_case '<match>' "'-'" '[abc-]'
+test_case '<match>' "'\\'" '\\'
+test_case '<match>' "'\\'" '[\\]'
+test_case '<match>' "'\\'" "'\\'"
+test_case '<match>' "'['" '[[]'
+test_case '<match>' '[' '[[]'
+test_case '<match>' "'['" '['
+test_case '<match>' '[' '['
+test_case '<match>' "'[abc'" "'['*"
+test_case '<nomatch>' "'[abc'" '[*'
+test_case '<match>' '[abc' "'['*"
+test_case '<nomatch>' '[abc' '[*'
+test_case '<match>' 'abd' "a[b/c]d"
+test_case '<match>' 'a/d' "a[b/c]d"
+test_case '<match>' 'acd' "a[b/c]d"
+test_case '<match>' "']'" '[]]'
+test_case '<match>' "'-'" '[]-]'
+test_case '<match>' 'p' '[a-\z]'
+test_case '<match>' '"/tmp"' '[/\\]*'
+test_case '<nomatch>' 'abc' '??**********?****?'
+test_case '<nomatch>' 'abc' '??**********?****c'
+test_case '<nomatch>' 'abc' '?************c****?****'
+test_case '<nomatch>' 'abc' '*c*?**'
+test_case '<nomatch>' 'abc' 'a*****c*?**'
+test_case '<nomatch>' 'abc' 'a********???*******'
+test_case '<nomatch>' "'a'" '[]'
+test_case '<nomatch>' 'a' '[]'
+test_case '<nomatch>' "'['" '[abc'
+test_case '<nomatch>' '[' '[abc'
+
+test_glob ++Beware '<b> <bb> <bcd> <bdir>' b*
+test_glob '<Beware> <b> <bb> <bcd> <bdir>' [bB]*
if ( set --nocaseglob ) 2>/dev/null
then
set --nocaseglob
- test_glob $LINENO '<Beware> <b> <bb> <bcd> <bdir>' b*
- test_glob $LINENO '<Beware> <b> <bb> <bcd> <bdir>' [b]*
- test_glob $LINENO '<Beware> <b> <bb> <bcd> <bdir>' [bB]*
+ test_glob '<Beware> <b> <bb> <bcd> <bdir>' b*
+ test_glob '<Beware> <b> <bb> <bcd> <bdir>' [b]*
+ test_glob '<Beware> <b> <bb> <bcd> <bdir>' [bB]*
set --nonocaseglob
fi
@@ -252,7 +255,7 @@ if ( set -f ) 2>/dev/null
then
set -f
- test_glob $LINENO '<*>' *
+ test_glob '<*>' *
set +f
fi
@@ -261,43 +264,114 @@ if ( set --noglob ) 2>/dev/null
then
set --noglob
- test_glob $LINENO '<*>' *
+ test_glob '<*>' *
set --glob
fi
FIGNORE='.*|*'
-test_glob $LINENO '<*>' *
+test_glob '<*>' *
FIGNORE='.*|*c|*e|?'
-test_glob $LINENO '<a-b> <aXb> <abd> <bb> <bcd> <bdir> <ca> <cb> <dd> <man>' *
+test_glob '<a-b> <aXb> <abd> <bb> <bcd> <bdir> <ca> <cb> <dd> <man>' *
FIGNORE='.*|*b|*d|?'
-test_glob $LINENO '<Beware> <abc> <abe> <bdir> <ca> <de> <man>' *
+test_glob '<Beware> <abc> <abe> <bdir> <ca> <de> <man>' *
FIGNORE=
-test_glob $LINENO '<man/man1/sh.1>' */man*/sh.*
+test_glob '<man/man1/sh.1>' */man*/sh.*
unset FIGNORE
-test_glob $LINENO '<bb> <ca> <cb> <dd> <de>' ??
-test_glob $LINENO '<man/man1/sh.1>' */man*/sh.*
+test_glob '<bb> <ca> <cb> <dd> <de>' ??
+test_glob '<man/man1/sh.1>' */man*/sh.*
GLOBIGNORE='.*:*'
set -- *
if [[ $1 == '*' ]]
then
GLOBIGNORE='.*:*c:*e:?'
- test_glob $LINENO '<>' *
+ test_glob '<>' *
GLOBIGNORE='.*:*b:*d:?'
- test_glob $LINENO '<>' *
+ test_glob '<>' *
unset GLOBIGNORE
- test_glob $LINENO '<>' *
- test_glob $LINENO '<man/man1/sh.1>' */man*/sh.*
+ test_glob '<>' *
+ test_glob '<man/man1/sh.1>' */man*/sh.*
GLOBIGNORE=
- test_glob $LINENO '<man/man1/sh.1>' */man*/sh.*
+ test_glob '<man/man1/sh.1>' */man*/sh.*
fi
+unset GLOBIGNORE
+
+function test_sub
+{
+ x='${subject'$2'}'
+ eval g=$x
+ if [[ "$g" != "$3" ]]
+ then 'err_exit' $1 subject="'$subject' $x failed, expected '$3', got '$g'"
+ fi
+}
+alias test_sub='test_sub $LINENO'
+
+set --noglob --nobraceexpand
+
+subject='A regular expressions test'
+
+test_sub '/e/#' 'A r#gular expressions test'
+test_sub '//e/#' 'A r#gular #xpr#ssions t#st'
+test_sub '/[^e]/#' '# regular expressions test'
+test_sub '//[^e]/#' '###e######e###e########e##'
+test_sub '/+(e)/#' 'A r#gular expressions test'
+test_sub '//+(e)/#' 'A r#gular #xpr#ssions t#st'
+test_sub '/@-(e)/#' 'A r#gular expressions test'
+test_sub '//@-(e)/#' 'A r#gular #xpr#ssions t#st'
+test_sub '/?(e)/#' '#A regular expressions test'
+test_sub '//?(e)/#' '#A# #r#g#u#l#a#r# #x#p#r#s#s#i#o#n#s# #t#s#t#'
+test_sub '/*(e)/#' '#A regular expressions test'
+test_sub '//*(e)/#' '#A# #r#g#u#l#a#r# #x#p#r#s#s#i#o#n#s# #t#s#t#'
+test_sub '//@(e)/[\1]' 'A r[e]gular [e]xpr[e]ssions t[e]st'
+test_sub '//@-(e)/[\1]' 'A r[e]gular [e]xpr[e]ssions t[e]st'
+test_sub '//+(e)/[\1]' 'A r[e]gular [e]xpr[e]ssions t[e]st'
+test_sub '//+-(e)/[\1]' 'A r[e]gular [e]xpr[e]ssions t[e]st'
+test_sub '//@(+(e))/[\1]' 'A r[e]gular [e]xpr[e]ssions t[e]st'
+test_sub '//@(+-(e))/[\1]' 'A r[e]gular [e]xpr[e]ssions t[e]st'
+test_sub '//-(e)/#' 'A regular expressions test'
+test_sub '//--(e)/#' 'A regular expressions test'
+test_sub '//?(e)/[\1]' '[]A[] []r[e]g[]u[]l[]a[]r[] [e]x[]p[]r[e]s[]s[]i[]o[]n[]s[] []t[e]s[]t[]'
+test_sub '//{0,1}(e)/[\1]' '[]A[] []r[e]g[]u[]l[]a[]r[] [e]x[]p[]r[e]s[]s[]i[]o[]n[]s[] []t[e]s[]t[]'
+test_sub '//*(e)/[\1]' '[]A[] []r[e]g[]u[]l[]a[]r[] [e]x[]p[]r[e]s[]s[]i[]o[]n[]s[] []t[e]s[]t[]'
+test_sub '//{0,}(e)/[\1]' '[]A[] []r[e]g[]u[]l[]a[]r[] [e]x[]p[]r[e]s[]s[]i[]o[]n[]s[] []t[e]s[]t[]'
+test_sub '//@(?(e))/[\1]' '[]A[] []r[e]g[]u[]l[]a[]r[] [e]x[]p[]r[e]s[]s[]i[]o[]n[]s[] []t[e]s[]t[]'
+test_sub '//@({0,1}(e))/[\1]' '[]A[] []r[e]g[]u[]l[]a[]r[] [e]x[]p[]r[e]s[]s[]i[]o[]n[]s[] []t[e]s[]t[]'
+test_sub '//@(*(e))/[\1]' '[]A[] []r[e]g[]u[]l[]a[]r[] [e]x[]p[]r[e]s[]s[]i[]o[]n[]s[] []t[e]s[]t[]'
+test_sub '//@({0,}(e))/[\1]' '[]A[] []r[e]g[]u[]l[]a[]r[] [e]x[]p[]r[e]s[]s[]i[]o[]n[]s[] []t[e]s[]t[]'
+test_sub '/?-(e)/#' '#A regular expressions test'
+test_sub '/@(?-(e))/[\1]' '[]A regular expressions test'
+test_sub '/!(e)/#' '#'
+test_sub '//!(e)/#' '#'
+test_sub '/@(!(e))/[\1]' '[A regular expressions test]'
+test_sub '//@(!(e))/[\1]' '[A regular expressions test]'
+
+subject='e'
+
+test_sub '/!(e)/#' '#e'
+test_sub '//!(e)/#' '#e#'
+test_sub '/!(e)/[\1]' '[]e'
+test_sub '//!(e)/[\1]' '[]e[]'
+test_sub '/@(!(e))/[\1]' '[]e'
+test_sub '//@(!(e))/[\1]' '[]e[]'
+
+subject='a'
+
+test_sub '/@(!(a))/[\1]' '[]a'
+test_sub '//@(!(a))/[\1]' '[]a[]'
+
+subject='aha'
+
+test_sub '/@(!(a))/[\1]' '[aha]'
+test_sub '//@(!(a))/[\1]' '[aha]'
+test_sub '/@(!(aha))/[\1]' '[ah]a'
+test_sub '//@(!(aha))/[\1]' '[ah][a]'
exit $errors
diff --git a/usr/src/lib/libshell/common/tests/grep.sh b/usr/src/lib/libshell/common/tests/grep.sh
index db20206dbf..82c0e13cac 100644
--- a/usr/src/lib/libshell/common/tests/grep.sh
+++ b/usr/src/lib/libshell/common/tests/grep.sh
@@ -1,10 +1,10 @@
########################################################################
# #
# This software is part of the ast package #
-# Copyright (c) 1982-2007 AT&T Knowledge Ventures #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
-# by AT&T Knowledge Ventures #
+# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# http://www.opensource.org/licenses/cpl1.0.txt #
diff --git a/usr/src/lib/libshell/common/tests/heredoc.sh b/usr/src/lib/libshell/common/tests/heredoc.sh
index 53835f2007..aadc9cdeec 100644
--- a/usr/src/lib/libshell/common/tests/heredoc.sh
+++ b/usr/src/lib/libshell/common/tests/heredoc.sh
@@ -1,10 +1,10 @@
########################################################################
# #
# This software is part of the ast package #
-# Copyright (c) 1982-2007 AT&T Knowledge Ventures #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
-# by AT&T Knowledge Ventures #
+# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# http://www.opensource.org/licenses/cpl1.0.txt #
@@ -210,4 +210,20 @@ printf $'cat <<# \\!!!\n\thello\n\t\tworld\n!!!' > $f
[[ $($SHELL "$f") == $'hello\n\tworld' ]] || err_exit "<<# not working for quoted here documents"
printf $'w=world;cat <<# !!!\n\thello\n\t\t$w\n!!!' > $f
[[ $($SHELL "$f") == $'hello\n\tworld' ]] || err_exit "<<# not working for non-quoted here documents"
+[[ $( $SHELL <<- \++++
+ S=( typeset a )
+ function S.a.get
+ {
+ .sh.value=$__a
+ }
+ __a=1234
+ cat <<-EOF
+ ${S.a}
+ EOF
+++++
+) == 1234 ]] 2> /dev/null || err_exit 'here document with get discipline failed'
+[[ $($SHELL -c 'g(){ print ok;}; cat <<- EOF
+ ${ g;}
+ EOF
+ ' 2> /dev/null) == ok ]] || err_exit '${ command;} not working in heredoc'
exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/io.sh b/usr/src/lib/libshell/common/tests/io.sh
index 649520482a..a8b1b8a030 100644
--- a/usr/src/lib/libshell/common/tests/io.sh
+++ b/usr/src/lib/libshell/common/tests/io.sh
@@ -1,10 +1,10 @@
########################################################################
# #
# This software is part of the ast package #
-# Copyright (c) 1982-2007 AT&T Knowledge Ventures #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
-# by AT&T Knowledge Ventures #
+# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# http://www.opensource.org/licenses/cpl1.0.txt #
@@ -27,7 +27,9 @@ alias err_exit='err_exit $LINENO'
Command=${0##*/}
integer Errors=0
-# cut here
+
+unset HISTFILE
+
function fun
{
while command exec 3>&1
@@ -227,8 +229,20 @@ then (( $(3<#) == 0 )) || err_exit "not at position 0"
read -u3 && err_exit "not found pattern not positioning at eof"
cat /tmp/seek$$ | read -r <# *WWW*
[[ $REPLY == *WWWWW* ]] || err_exit '<# not working for pipes'
+ { < /tmp/seek$$ <# ((2358336120)) ;} 2> /dev/null || err_exit 'long seek not working'
else err_exit "/tmp/seek$$: cannot open for reading"
fi
+command exec 3<&- || 'cannot close 3'
+for ((i=0; i < 62; i++))
+do printf "%.39c\n" ${x:i:1}
+done > /tmp/seek$$
+if command exec {n}<> /tmp/seek$$
+then { command exec {n}<#((EOF)) ;} 2> /dev/null || err_exit '{n}<# not working'
+ if $SHELL -c '{n}</dev/null' 2> /dev/null
+ then (( $({n}<#) == 40*62)) || err_exit '$({n}<#) not working'
+ else err_exit 'not able to parse {n}</dev/null'
+ fi
+fi
trap "" EXIT
rm -f /tmp/seek$$
$SHELL -ic '
@@ -248,4 +262,112 @@ trap 'rm -rf /tmp/io.sh$$*' EXIT
$SHELL -c "{ > /tmp/io.sh$$.1 ; date;} >&- 2> /dev/null" > /tmp/io.sh$$.2
[[ -s /tmp/io.sh$$.1 || -s /tmp/io.sh$$.2 ]] && err_exit 'commands with standard output closed produce output'
$SHELL -c "$SHELL -c ': 3>&1' 1>&- 2>/dev/null" && err_exit 'closed standard output not passed to subshell'
+[[ $(cat <<- \EOF | $SHELL
+ do_it_all()
+ {
+ dd 2>/dev/null # not a ksh93 buildin
+ return $?
+ }
+ do_it_all ; exit $?
+ hello world
+EOF) == 'hello world' ]] || err_exit 'invalid readahead on stdin'
+$SHELL -c 'exec 3>; /dev/null' 2> /dev/null && err_exit '>; with exec should be an error'
+$SHELL -c ': 3>; /dev/null' 2> /dev/null || err_exit '>; not working with at all'
+print hello > /tmp/io.sh$$.1
+if ! $SHELL -c "false >; /tmp/io.sh$$.1" 2> /dev/null
+then [[ $(</tmp/io.sh$$.1) == hello ]] || err_exit '>; not preserving file on failure'
+fi
+if ! $SHELL -c "sed -e 's/hello/hello world/' /tmp/io.sh$$.1" >; /tmp/io.sh$$.1 2> /dev/null
+then [[ $(</tmp/io.sh$$.1) == 'hello world' ]] || err_exit '>; not updating file on success'
+fi
+
+unset y
+read -n1 y <<!
+abc
+!
+if [[ $y != a ]]
+then err_exit 'read -n1 not working'
+fi
+unset a
+{ read -N3 a; read -N1 b;} <<!
+abcdefg
+!
+[[ $a == abc ]] || err_exit 'read -N3 here-document not working'
+[[ $b == d ]] || err_exit 'read -N1 here-document not working'
+read -n3 a <<!
+abcdefg
+!
+[[ $a == abc ]] || err_exit 'read -n3 here-document not working'
+(print -n a;sleep 1; print -n bcde) | { read -N3 a; read -N1 b;}
+[[ $a == abc ]] || err_exit 'read -N3 from pipe not working'
+[[ $b == d ]] || err_exit 'read -N1 from pipe not working'
+(print -n a;sleep 1; print -n bcde) |read -n3 a
+[[ $a == a ]] || err_exit 'read -n3 from pipe not working'
+rm -f /tmp/fifo$$
+if mkfifo /tmp/fifo$$ 2> /dev/null
+then (print -n a; sleep 1;print -n bcde) > /tmp/fifo$$ &
+ {
+ read -u5 -n3 -t2 a || err_exit 'read -n3 from fifo timedout'
+ read -u5 -n1 -t2 b || err_exit 'read -n1 from fifo timedout'
+ } 5< /tmp/fifo$$
+ [[ $a == a ]] || err_exit 'read -n3 from fifo not working'
+ rm -f /tmp/fifo$$
+ mkfifo /tmp/fifo$$ 2> /dev/null
+ (print -n a; sleep 1;print -n bcde) > /tmp/fifo$$ &
+ {
+ read -u5 -N3 -t2 a || err_exit 'read -N3 from fifo timed out'
+ read -u5 -N1 -t2 b || err_exit 'read -N1 from fifo timedout'
+ } 5< /tmp/fifo$$
+ [[ $a == abc ]] || err_exit 'read -N3 from fifo not working'
+ [[ $b == d ]] || err_exit 'read -N1 from fifo not working'
+fi
+rm -f /tmp/fifo$$
+
+if $SHELL -c "export LC_ALL=en_US.UTF-8; c=$'\342\202\254'; [[ \${#c} == 1 ]]" 2>/dev/null
+then lc_utf8=en_US.UTF-8
+else lc_utf8=''
+fi
+
+typeset -a e o=(-n2 -N2)
+integer i
+set -- \
+ 'a' 'bcd' 'a bcd' 'ab cd' \
+ 'ab' 'cd' 'ab cd' 'ab cd' \
+ 'abc' 'd' 'ab cd' 'ab cd' \
+ 'abcd' '' 'ab cd' 'ab cd'
+while (( $# >= 3 ))
+do a=$1
+ b=$2
+ e[0]=$3
+ e[1]=$4
+ shift 4
+ for ((i = 0; i < 2; i++))
+ do for lc_all in C $lc_utf8
+ do g=$(LC_ALL=$lc_all $SHELL -c "{ print -n '$a'; sleep 0.2; print -n '$b'; sleep 0.2; } | { read ${o[i]} a; print -n \$a; read a; print -n \ \$a; }")
+ [[ $g == "${e[i]}" ]] || err_exit "LC_ALL=$lc_all read ${o[i]} from pipe '$a $b' failed -- expected '${e[i]}', got '$g'"
+ done
+ done
+done
+
+if [[ $lc_utf8 ]]
+then export LC_ALL=en_US.UTF-8
+ typeset -a c=( '' 'A' $'\303\274' $'\342\202\254' )
+ integer i w
+ typeset o
+ if (( ${#c[2]} == 1 && ${#c[3]} == 1 ))
+ then for i in 1 2 3
+ do for o in n N
+ do for w in 1 2 3
+ do print -nr "${c[w]}" | read -${o}${i} g
+ if [[ $o == N ]] && (( i > 1 ))
+ then e=''
+ else e=${c[w]}
+ fi
+ [[ $g == "$e" ]] || err_exit "read -${o}${i} failed for '${c[w]}' -- expected '$e', got '$g'"
+ done
+ done
+ done
+ fi
+fi
+
exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/locale.sh b/usr/src/lib/libshell/common/tests/locale.sh
new file mode 100644
index 0000000000..ab94722e2d
--- /dev/null
+++ b/usr/src/lib/libshell/common/tests/locale.sh
@@ -0,0 +1,104 @@
+########################################################################
+# #
+# This software is part of the ast package #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
+# and is licensed under the #
+# Common Public License, Version 1.0 #
+# by AT&T Intellectual Property #
+# #
+# A copy of the License is available at #
+# http://www.opensource.org/licenses/cpl1.0.txt #
+# (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) #
+# #
+# Information and Software Systems Research #
+# AT&T Research #
+# Florham Park NJ #
+# #
+# David Korn <dgk@research.att.com> #
+# #
+########################################################################
+function err_exit
+{
+ print -u2 -n "\t"
+ print -u2 -r ${Command}[$1]: "${@:2}"
+ let Errors+=1
+}
+alias err_exit='err_exit $LINENO'
+
+Command=${0##*/}
+integer Errors=0
+
+# LC_ALL=debug is an ast specific debug/test locale
+
+if [[ "$(LC_ALL=debug $SHELL <<- \+EOF+
+ x=a<1z>b<2yx>c
+ print ${#x}
+ +EOF+)" != 5
+ ]]
+then err_exit '${#x} not working with multibyte locales'
+fi
+
+export LC_ALL=C
+if (( $($SHELL -c $'export LC_ALL=en_US.UTF-8; print -r "\342\202\254\342\202\254\342\202\254\342\202\254w\342\202\254\342\202\254\342\202\254\342\202\254" | wc -m' 2>/dev/null) == 10 ))
+then LC_ALL=en_US.UTF-8 $SHELL -c b1=$'"\342\202\254\342\202\254\342\202\254\342\202\254w\342\202\254\342\202\254\342\202\254\342\202\254"; [[ ${b1:4:1} == w ]]' || err_exit 'Multibyte ${var:offset:len} not working correctly'
+fi
+
+export LC_ALL=C
+a=$($SHELL -c '/' 2>&1 | sed -e "s,.*: *,," -e "s, *\[.*,,")
+b=$($SHELL -c '(LC_ALL=debug / 2>/dev/null); /' 2>&1 | sed -e "s,.*: *,," -e "s, *\[.*,,")
+[[ "$b" == "$a" ]] || err_exit "locale not restored after subshell -- expected '$a', got '$b'"
+b=$($SHELL -c '(LC_ALL=debug; / 2>/dev/null); /' 2>&1 | sed -e "s,.*: *,," -e "s, *\[.*,,")
+[[ "$b" == "$a" ]] || err_exit "locale not restored after subshell -- expected '$a', got '$b'"
+
+# test shift-jis \x81\x40 ... \x81\x7E encodings
+# (shift char followed by 7 bit ascii)
+
+typeset -i16 chr
+for lc_all in $(PATH=/bin:/usr/bin locale -a 2>/dev/null | grep -i jis)
+do export LC_ALL=$lc_all
+ for ((chr=0x40; chr<=0x7E; chr++))
+ do c=${chr#16#}
+ for s in \\x81\\x$c \\x$c
+ do b="$(printf "$s")"
+ eval n=\$\'$s\'
+ [[ $b == "$n" ]] || err_exit "LC_ALL=$lc_all printf difference for \"$s\" -- expected '$n', got '$b'"
+ u=$(print -- $b)
+ q=$(print -- "$b")
+ [[ $u == "$q" ]] || err_exit "LC_ALL=$lc_all quoted print difference for \"$s\" -- $b => '$u' vs \"$b\" => '$q'"
+ done
+ done
+done
+
+# test multibyte value/trace format -- $'\303\274' is UTF-8 u-umlaut
+
+LC_ALL=C
+lc_all=de_DE.UTF-8
+c=$(LC_ALL=C $SHELL -c "printf $':%2s:\n' $'\303\274'")
+u=$(LC_ALL=$lc_all $SHELL -c "printf $':%2s:\n' $'\303\274'" 2>/dev/null)
+if [[ "$c" != "$u" ]]
+then LC_ALL=$lc_all
+ x=$'+2+ typeset item.text\
++3+ item.text=\303\274\
++4+ print -- \303\274\
+\303\274\
++5+ eval $\'arr[0]=(\\n\\ttext=\\303\\274\\n)\'
++2+ arr[0].text=ü\
++6+ print -- \303\274\
+ü\
++7+ eval txt=$\'(\\n\\ttext=\\303\\274\\n)\'
++2+ txt.text=\303\274\
++8+ print -- \'(\' text=$\'\\303\\274\' \')\'\
+( text=\303\274 )'
+ u=$(LC_ALL=$lc_all PS4='+$LINENO+ ' $SHELL -x -c "
+ item=(typeset text)
+ item.text=$'\303\274'
+ print -- \"\${item.text}\"
+ eval \"arr[0]=\$item\"
+ print -- \"\${arr[0].text}\"
+ eval \"txt=\${arr[0]}\"
+ print -- \$txt
+ " 2>&1)
+ [[ "$u" == "$x" ]] || err_exit LC_ALL=$lc_all multibyte value/trace format failed
+fi
+
+exit $Errors
diff --git a/usr/src/lib/libshell/common/tests/nameref.sh b/usr/src/lib/libshell/common/tests/nameref.sh
index a6c52ddaa8..21a672db14 100644
--- a/usr/src/lib/libshell/common/tests/nameref.sh
+++ b/usr/src/lib/libshell/common/tests/nameref.sh
@@ -1,10 +1,10 @@
########################################################################
# #
# This software is part of the ast package #
-# Copyright (c) 1982-2007 AT&T Knowledge Ventures #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
-# by AT&T Knowledge Ventures #
+# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# http://www.opensource.org/licenses/cpl1.0.txt #
@@ -226,4 +226,75 @@ function fun
}
i=foo
[[ $(fun $i) == hi ]] || err_exit 'nameref for compound variable with in function name of caller fails'
+unset -n foo bar
+typeset -A foo
+foo[x.y]=(x=3 y=4)
+nameref bar=foo[x.y]
+[[ ${bar.x} == 3 ]] || err_exit 'nameref to subscript containing . fails'
+[[ ${!bar} == 'foo[x.y]' ]] || err_exit '${!var} not correct for nameref to an array instance'
+typeset +n bar
+nameref bar=foo
+[[ ${!bar} == foo ]] || err_exit '${!var} not correct for nameref to array variable'
+$SHELL -c 'function bar { nameref x=foo[++];};typeset -A foo;bar' 2> /dev/null ||err_exit 'nameref of associative array tries to evaluate subscript'
+i=$($SHELL -c 'nameref foo=bar; bar[2]=(x=3 y=4); nameref x=foo[2].y;print -r -- $x' 2> /dev/null)
+[[ $i == 4 ]] || err_exit 'creating reference from subscripted variable whose name is a reference failed'
+[[ $($SHELL 2> /dev/null <<- '+++EOF'
+ function bar
+ {
+ nameref x=$1
+ print -r -- "$x"
+ }
+ function foo
+ {
+ typeset var=( foo=hello)
+ bar var
+ }
+ foo
++++EOF
+) == *foo=hello* ]] || err_exit 'unable to display compound variable from name reference of local variable'
+#set -x
+for c in '=' '[' ']' '\' "'" '"' '<' '=' '('
+do [[ $($SHELL 2> /dev/null <<- ++EOF++
+ x;i=\\$c;typeset -A a; a[\$i]=foo;typeset -n x=a[\$i]; print "\$x"
+ ++EOF++
+) != foo ]] && err_exit 'nameref x=[$c] '"not working for c=$c"
+done
+unset -n foo x
+unset foo x
+typeset -A foo
+nameref x=foo[xyz]
+foo[xyz]=ok
+[[ $x == ok ]] || err_exit 'nameref to unset subscript not working'
+function function2
+{
+ nameref v=$1
+ v.x=19 v.y=20
+}
+function function1
+{
+ typeset compound_var=()
+ function2 compound_var
+ printf "x=%d, y=%d\n" compound_var.x compound_var.y
+}
+x="$(function1)"
+[[ "$x" != 'x=19, y=20' ]] && err_exit "expected 'x=19, y=20', got '${x}'"
+typeset +n bar
+unset foo bar
+[[ $(function a
+{
+ for i in foo bar
+ do typeset -n v=$i
+ print $v
+ done | cat
+}
+foo=1 bar=2;a) == $'1\n2' ]] 2> /dev/null || err_exit 'nameref in pipeline broken'
+function a
+{
+ typeset -n v=vars.data._1
+ print "${v.a} ${v.b}"
+}
+vars=(data=())
+vars.data._1.a=a.1
+vars.data._1.b=b.1
+[[ $(a) == 'a.1 b.1' ]] || err_exit 'nameref choosing wrong scope -- '
exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/options.sh b/usr/src/lib/libshell/common/tests/options.sh
index 2520cb2a2e..07608efa1e 100644
--- a/usr/src/lib/libshell/common/tests/options.sh
+++ b/usr/src/lib/libshell/common/tests/options.sh
@@ -1,10 +1,10 @@
########################################################################
# #
# This software is part of the ast package #
-# Copyright (c) 1982-2007 AT&T Knowledge Ventures #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
-# by AT&T Knowledge Ventures #
+# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# http://www.opensource.org/licenses/cpl1.0.txt #
@@ -27,6 +27,9 @@ alias err_exit='err_exit $LINENO'
Command=${0##*/}
integer Errors=0
+
+unset HISTFILE
+
if [[ $( ${SHELL-ksh} -s hello<<-\!
print $1
!
@@ -46,83 +49,85 @@ fi
tmp=/tmp/ksh$$
mkdir $tmp
rc=$tmp/.kshrc
-print $'function env_hit\n{\n\tprint OK\n}' > $rc
+print $'PS1=""\nfunction env_hit\n{\n\tprint OK\n}' > $rc
-export ENV=$rc
+export ENV='${nosysrc}'$rc
if [[ -o privileged ]]
then
- [[ $(print env_hit | $SHELL 2>&1) == "OK" ]] &&
+ [[ $(print env_hit | $SHELL 2>/dev/null) == "OK" ]] &&
err_exit 'privileged nointeractive shell reads $ENV file'
- [[ $(print env_hit | $SHELL -E 2>&1) == "OK" ]] &&
+ [[ $(print env_hit | $SHELL -E 2>/dev/null) == "OK" ]] &&
err_exit 'privileged -E reads $ENV file'
- [[ $(print env_hit | $SHELL +E 2>&1) == "OK" ]] &&
+ [[ $(print env_hit | $SHELL +E 2>/dev/null) == "OK" ]] &&
err_exit 'privileged +E reads $ENV file'
- [[ $(print env_hit | $SHELL --rc 2>&1) == "OK" ]] &&
+ [[ $(print env_hit | $SHELL --rc 2>/dev/null) == "OK" ]] &&
err_exit 'privileged --rc reads $ENV file'
- [[ $(print env_hit | $SHELL --norc 2>&1) == "OK" ]] &&
+ [[ $(print env_hit | $SHELL --norc 2>/dev/null) == "OK" ]] &&
err_exit 'privileged --norc reads $ENV file'
else
- [[ $(print env_hit | $SHELL 2>&1) == "OK" ]] &&
+ [[ $(print env_hit | $SHELL 2>/dev/null) == "OK" ]] &&
err_exit 'nointeractive shell reads $ENV file'
- [[ $(print env_hit | $SHELL -E 2>&1) == "OK" ]] ||
+ [[ $(print env_hit | $SHELL -E 2>/dev/null) == "OK" ]] ||
err_exit '-E ignores $ENV file'
- [[ $(print env_hit | $SHELL +E 2>&1) == "OK" ]] &&
+ [[ $(print env_hit | $SHELL +E 2>/dev/null) == "OK" ]] &&
err_exit '+E reads $ENV file'
- [[ $(print env_hit | $SHELL --rc 2>&1) == "OK" ]] ||
+ [[ $(print env_hit | $SHELL --rc 2>/dev/null) == "OK" ]] ||
err_exit '--rc ignores $ENV file'
- [[ $(print env_hit | $SHELL --norc 2>&1) == "OK" ]] &&
+ [[ $(print env_hit | $SHELL --norc 2>/dev/null) == "OK" ]] &&
err_exit '--norc reads $ENV file'
+ [[ $(print env_hit | $SHELL -i 2>/dev/null) == "OK" ]] ||
+ err_exit '-i ignores $ENV file'
fi
export ENV=
if [[ -o privileged ]]
then
- [[ $(print env_hit | HOME=$tmp $SHELL 2>&1) == "OK" ]] &&
+ [[ $(print env_hit | HOME=$tmp $SHELL 2>/dev/null) == "OK" ]] &&
err_exit 'privileged nointeractive shell reads $HOME/.kshrc file'
- [[ $(print env_hit | HOME=$tmp $SHELL -E 2>&1) == "OK" ]] &&
+ [[ $(print env_hit | HOME=$tmp $SHELL -E 2>/dev/null) == "OK" ]] &&
err_exit 'privileged -E ignores empty $ENV'
- [[ $(print env_hit | HOME=$tmp $SHELL +E 2>&1) == "OK" ]] &&
+ [[ $(print env_hit | HOME=$tmp $SHELL +E 2>/dev/null) == "OK" ]] &&
err_exit 'privileged +E reads $HOME/.kshrc file'
- [[ $(print env_hit | HOME=$tmp $SHELL --rc 2>&1) == "OK" ]] &&
+ [[ $(print env_hit | HOME=$tmp $SHELL --rc 2>/dev/null) == "OK" ]] &&
err_exit 'privileged --rc ignores empty $ENV'
- [[ $(print env_hit | HOME=$tmp $SHELL --norc 2>&1) == "OK" ]] &&
+ [[ $(print env_hit | HOME=$tmp $SHELL --norc 2>/dev/null) == "OK" ]] &&
err_exit 'privileged --norc reads $HOME/.kshrc file'
else
- [[ $(print env_hit | HOME=$tmp $SHELL 2>&1) == "OK" ]] &&
+ [[ $(print env_hit | HOME=$tmp $SHELL 2>/dev/null) == "OK" ]] &&
err_exit 'nointeractive shell reads $HOME/.kshrc file'
- [[ $(print env_hit | HOME=$tmp $SHELL -E 2>&1) == "OK" ]] &&
+ [[ $(print env_hit | HOME=$tmp $SHELL -E 2>/dev/null) == "OK" ]] &&
err_exit '-E ignores empty $ENV'
- [[ $(print env_hit | HOME=$tmp $SHELL +E 2>&1) == "OK" ]] &&
+ [[ $(print env_hit | HOME=$tmp $SHELL +E 2>/dev/null) == "OK" ]] &&
err_exit '+E reads $HOME/.kshrc file'
- [[ $(print env_hit | HOME=$tmp $SHELL --rc 2>&1) == "OK" ]] &&
+ [[ $(print env_hit | HOME=$tmp $SHELL --rc 2>/dev/null) == "OK" ]] &&
err_exit '--rc ignores empty $ENV'
- [[ $(print env_hit | HOME=$tmp $SHELL --norc 2>&1) == "OK" ]] &&
+ [[ $(print env_hit | HOME=$tmp $SHELL --norc 2>/dev/null) == "OK" ]] &&
err_exit '--norc reads $HOME/.kshrc file'
fi
unset ENV
if [[ -o privileged ]]
then
- [[ $(print env_hit | HOME=$tmp $SHELL 2>&1) == "OK" ]] &&
+ [[ $(print env_hit | HOME=$tmp $SHELL 2>/dev/null) == "OK" ]] &&
err_exit 'privileged nointeractive shell reads $HOME/.kshrc file'
- [[ $(print env_hit | HOME=$tmp $SHELL -E 2>&1) == "OK" ]] &&
+ [[ $(print env_hit | HOME=$tmp $SHELL -E 2>/dev/null) == "OK" ]] &&
err_exit 'privileged -E reads $HOME/.kshrc file'
- [[ $(print env_hit | HOME=$tmp $SHELL +E 2>&1) == "OK" ]] &&
+ [[ $(print env_hit | HOME=$tmp $SHELL +E 2>/dev/null) == "OK" ]] &&
err_exit 'privileged +E reads $HOME/.kshrc file'
- [[ $(print env_hit | HOME=$tmp $SHELL --rc 2>&1) == "OK" ]] &&
+ [[ $(print env_hit | HOME=$tmp $SHELL --rc 2>/dev/null) == "OK" ]] &&
err_exit 'privileged --rc reads $HOME/.kshrc file'
- [[ $(print env_hit | HOME=$tmp $SHELL --norc 2>&1) == "OK" ]] &&
+ [[ $(print env_hit | HOME=$tmp $SHELL --norc 2>/dev/null) == "OK" ]] &&
err_exit 'privileged --norc reads $HOME/.kshrc file'
else
- [[ $(print env_hit | HOME=$tmp $SHELL 2>&1) == "OK" ]] &&
+ [[ $(print env_hit | HOME=$tmp $SHELL 2>/dev/null) == "OK" ]] &&
err_exit 'nointeractive shell reads $HOME/.kshrc file'
- [[ $(print env_hit | HOME=$tmp $SHELL -E 2>&1) == "OK" ]] ||
+ [[ $(print env_hit | HOME=$tmp $SHELL -E 2>/dev/null) == "OK" ]] ||
err_exit '-E ignores $HOME/.kshrc file'
- [[ $(print env_hit | HOME=$tmp $SHELL +E 2>&1) == "OK" ]] &&
+ [[ $(print env_hit | HOME=$tmp $SHELL +E 2>/dev/null) == "OK" ]] &&
err_exit '+E reads $HOME/.kshrc file'
- [[ $(print env_hit | HOME=$tmp $SHELL --rc 2>&1) == "OK" ]] ||
+ [[ $(print env_hit | HOME=$tmp $SHELL --rc 2>/dev/null) == "OK" ]] ||
err_exit '--rc ignores $HOME/.kshrc file'
- [[ $(print env_hit | HOME=$tmp $SHELL --norc 2>&1) == "OK" ]] &&
+ [[ $(print env_hit | HOME=$tmp $SHELL --norc 2>/dev/null) == "OK" ]] &&
err_exit '--norc reads $HOME/.kshrc file'
fi
@@ -162,34 +167,34 @@ echo "echo '$t'" > .profile
cp $SHELL ./-ksh
if [[ -o privileged ]]
then
- [[ $(HOME=$PWD $SHELL -l </dev/null 2>&1) == *$t* ]] &&
+ [[ $(HOME=$PWD $SHELL -l </dev/null 2>/dev/null) == *$t* ]] &&
err_exit 'privileged -l reads .profile'
- [[ $(HOME=$PWD $SHELL --login </dev/null 2>&1) == *$t* ]] &&
+ [[ $(HOME=$PWD $SHELL --login </dev/null 2>/dev/null) == *$t* ]] &&
err_exit 'privileged --login reads .profile'
- [[ $(HOME=$PWD $SHELL --login-shell </dev/null 2>&1) == *$t* ]] &&
+ [[ $(HOME=$PWD $SHELL --login-shell </dev/null 2>/dev/null) == *$t* ]] &&
err_exit 'privileged --login-shell reads .profile'
- [[ $(HOME=$PWD $SHELL --login_shell </dev/null 2>&1) == *$t* ]] &&
+ [[ $(HOME=$PWD $SHELL --login_shell </dev/null 2>/dev/null) == *$t* ]] &&
err_exit 'privileged --login_shell reads .profile'
- [[ $(HOME=$PWD exec -a -ksh $SHELL </dev/null 2>&1) == *$t* ]] &&
+ [[ $(HOME=$PWD exec -a -ksh $SHELL </dev/null 2>/dev/null) == *$t* ]] &&
err_exit 'privileged exec -a -ksh ksh reads .profile'
- [[ $(HOME=$PWD ./-ksh -i </dev/null 2>&1) == *$t* ]] &&
+ [[ $(HOME=$PWD ./-ksh -i </dev/null 2>/dev/null) == *$t* ]] &&
err_exit 'privileged ./-ksh reads .profile'
- [[ $(HOME=$PWD ./-ksh -ip </dev/null 2>&1) == *$t* ]] &&
+ [[ $(HOME=$PWD ./-ksh -ip </dev/null 2>/dev/null) == *$t* ]] &&
err_exit 'privileged ./-ksh -p reads .profile'
else
- [[ $(HOME=$PWD $SHELL -l </dev/null 2>&1) == *$t* ]] ||
+ [[ $(HOME=$PWD $SHELL -l </dev/null 2>/dev/null) == *$t* ]] ||
err_exit '-l ignores .profile'
- [[ $(HOME=$PWD $SHELL --login </dev/null 2>&1) == *$t* ]] ||
+ [[ $(HOME=$PWD $SHELL --login </dev/null 2>/dev/null) == *$t* ]] ||
err_exit '--login ignores .profile'
- [[ $(HOME=$PWD $SHELL --login-shell </dev/null 2>&1) == *$t* ]] ||
+ [[ $(HOME=$PWD $SHELL --login-shell </dev/null 2>/dev/null) == *$t* ]] ||
err_exit '--login-shell ignores .profile'
- [[ $(HOME=$PWD $SHELL --login_shell </dev/null 2>&1) == *$t* ]] ||
+ [[ $(HOME=$PWD $SHELL --login_shell </dev/null 2>/dev/null) == *$t* ]] ||
err_exit '--login_shell ignores .profile'
- [[ $(HOME=$PWD exec -a -ksh $SHELL </dev/null 2>&1) == *$t* ]] ||
+ [[ $(HOME=$PWD exec -a -ksh $SHELL </dev/null 2>/dev/null) == *$t* ]] ||
err_exit 'exec -a -ksh ksh ignores .profile'
- [[ $(HOME=$PWD ./-ksh -i </dev/null 2>&1) == *$t* ]] ||
+ [[ $(HOME=$PWD ./-ksh -i </dev/null 2>/dev/null) == *$t* ]] ||
err_exit './-ksh ignores .profile'
- [[ $(HOME=$PWD ./-ksh -ip </dev/null 2>&1) == *$t* ]] &&
+ [[ $(HOME=$PWD ./-ksh -ip </dev/null 2>/dev/null) == *$t* ]] &&
err_exit './-ksh -p does not ignore .profile'
fi
cd ~-
@@ -304,10 +309,68 @@ do if [[ -o ?$opt ]]
then err_exit "[[ -o ?no$opt ]] should fail"
fi
done
+
+[[ $(set +o) == $(set --state) ]] || err_exit "set --state different from set +o"
+set -- $(set --state)
+[[ $1 == set && $2 == --default ]] || err_exit "set --state failed -- expected 'set --default *', got '$1 $2 *'"
+shift
+restore=$*
+shift
+off=
+for opt
+do case $opt in
+ --not*) opt=${opt/--/--no} ;;
+ --no*) opt=${opt/--no/--} ;;
+ --*) opt=${opt/--/--no} ;;
+ esac
+ off="$off $opt"
+done
+set $off
+state=$(set --state)
+default=$(set --default --state)
+[[ $state == $default ]] || err_exit "set --state for default options failed: expected '$default', got '$state'"
+set $restore
+state=$(set --state)
+[[ $state == "set $restore" ]] || err_exit "set --state after restore failed: expected 'set $restore', got '$state'"
+
false | true | true || err_exit 'pipe not exiting exit value of last element'
true | true | false && err_exit 'pipe not exiting false'
set -o pipefail
false | true | true && err_exit 'pipe with first not failing with pipefail'
true | false | true && err_exit 'pipe middle not failing with pipefail'
true | true | false && err_exit 'pipe last not failing with pipefail'
+print hi | (sleep 1;/bin/cat) > /dev/null || err_exit 'pipeline fails with pipefail'
+(
+ set -o pipefail
+ false | true
+ (( $? )) || err_exit 'pipe not failing in subshell with pipefail'
+) | wc >/dev/null
+$SHELL -c 'set -o pipefail; false | $(whence -p true);' && err_exit 'pipefail not returning failure with sh -c'
+[[ $( set -o pipefail
+ pipe() { date | cat > /dev/null ;}
+ print $'1\n2' |
+ while read i
+ do if pipe /tmp
+ then { print enter $i; sleep 2; print leave $i; } &
+ fi
+ done
+ wait) == $'enter 1\nenter 2'* ]] || err_exit '& job delayed by pipefail'
+$SHELL -c '[[ $- == *c* ]]' || err_exit 'option c not in $-'
+trap 'rm -f /tmp/.profile' EXIT
+> /tmp/.profile
+for i in i l r s D E a b e f h k n r t u v x B C G H
+do HOME=/tmp ENV= $SHELL -$i 2> /dev/null <<- ++EOF++ || err_exit "option $i not in \$-"
+ [[ \$- == *$i* ]] || exit 1
+ ++EOF++
+done
+letters=ilrabefhknuvxBCGE
+integer j=0
+for i in interactive login restricted allexport notify errexit \
+ noglob trackall keyword noexec nounset verbose xtrace braceexpand \
+ noclobber globstar rc
+do HOME=/tmp ENV= $SHELL -o $i 2> /dev/null <<- ++EOF++ || err_exit "option $i not equivalent to ${letters:j:1}"
+ [[ \$- == *${letters:j:1}* ]] || exit 1
+ ++EOF++
+ ((j++))
+done
exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/path.sh b/usr/src/lib/libshell/common/tests/path.sh
index 7083aca713..2e46e2bd48 100644
--- a/usr/src/lib/libshell/common/tests/path.sh
+++ b/usr/src/lib/libshell/common/tests/path.sh
@@ -1,10 +1,10 @@
########################################################################
# #
# This software is part of the ast package #
-# Copyright (c) 1982-2007 AT&T Knowledge Ventures #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
-# by AT&T Knowledge Ventures #
+# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# http://www.opensource.org/licenses/cpl1.0.txt #
@@ -24,12 +24,49 @@ function err_exit
let Errors+=1
}
alias err_exit='err_exit $LINENO'
-
Command=${0##*/}
integer Errors=0
+
mkdir /tmp/ksh$$
cd /tmp/ksh$$
trap "PATH=$PATH; cd /; rm -rf /tmp/ksh$$" EXIT
+type /xxxxxx > out1 2> out2
+[[ -s out1 ]] && err_exit 'type should not write on stdout for not found case'
+[[ -s out2 ]] || err_exit 'type should write on stderr for not found case'
+mkdir dir1 dir2
+cat > dir1/foobar << '+++'
+foobar() { print foobar1;}
+function dir1 { print dir1;}
++++
+cat > dir2/foobar << '+++'
+foobar() { print foobar2;}
+function dir2 { print dir2;}
++++
+chmod +x dir[12]/foobar
+p=$PATH
+FPATH=$PWD/dir1
+PATH=$FPATH:$p
+[[ $( foobar) == foobar1 ]] || err_exit 'foobar should output foobar1'
+FPATH=$PWD/dir2
+PATH=$FPATH:$p
+[[ $(foobar) == foobar2 ]] || err_exit 'foobar should output foobar2'
+FPATH=$PWD/dir1
+PATH=$FPATH:$p
+[[ $(foobar) == foobar1 ]] || err_exit 'foobar should output foobar1 again'
+FPATH=$PWD/dir2
+PATH=$FPATH:$p
+[[ ${ foobar;} == foobar2 ]] || err_exit 'foobar should output foobar2 with ${}'
+[[ ${ dir2;} == dir2 ]] || err_exit 'should be dir2'
+[[ ${ dir1;} == dir1 ]] 2> /dev/null && err_exit 'should not be be dir1'
+FPATH=$PWD/dir1
+PATH=$FPATH:$p
+[[ ${ foobar;} == foobar1 ]] || err_exit 'foobar should output foobar1 with ${}'
+[[ ${ dir1;} == dir1 ]] || err_exit 'should be dir1'
+[[ ${ dir2;} == dir2 ]] 2> /dev/null && err_exit 'should not be be dir2'
+FPATH=$PWD/dir2
+PATH=$FPATH:$p
+[[ ${ foobar;} == foobar2 ]] || err_exit 'foobar should output foobar2 with ${} again'
+PATH=$p
(PATH="/bin")
[[ $($SHELL -c 'print -r -- "$PATH"') == "$PATH" ]] || err_exit 'export PATH lost in subshell'
cat > bug1 <<- \EOF
@@ -183,4 +220,45 @@ status=$($SHELL -c $'trap \'print $?\' ERR;/a/b/c/d/e 2> /dev/null')
[[ $status == 127 ]] || err_exit "not found command with ERR trap exit status $status -- expected 127"
status=$($SHELL -c $'trap \'print $?\' ERR;/dev/null 2> /dev/null')
[[ $status == 126 ]] || err_exit "non executable command ERR trap exit status $status -- expected 126"
+
+# universe via PATH
+
+builtin getconf
+getconf UNIVERSE - att # override sticky default 'UNIVERSE = foo'
+
+[[ $(PATH=/usr/ucb/bin:/usr/bin echo -n ucb) == 'ucb' ]] || err_exit "ucb universe echo ignores -n option"
+[[ $(PATH=/usr/xpg/bin:/usr/bin echo -n att) == '-n att' ]] || err_exit "att universe echo does not ignore -n option"
+
+PATH=$path
+
+scr=/tmp/ksh$$/foo
+exp=126
+
+: > $scr
+chmod a=x $scr
+{ got=$($scr; print $?); } 2>/dev/null
+[[ "$got" == "$exp" ]] || err_exit "unreadable empty script should fail -- expected $exp, got $got"
+{ got=$(command $scr; print $?); } 2>/dev/null
+[[ "$got" == "$exp" ]] || err_exit "command of unreadable empty script should fail -- expected $exp, got $got"
+[[ "$(:; $scr; print $?)" == "$exp" ]] 2>/dev/null || err_exit "unreadable empty script in [[ ... ]] should fail -- expected $exp"
+[[ "$(:; command $scr; print $?)" == "$exp" ]] 2>/dev/null || err_exit "command unreadable empty script in [[ ... ]] should fail -- expected $exp"
+got=$($SHELL -c "$scr; print \$?" 2>/dev/null)
+[[ "$got" == "$exp" ]] || err_exit "\$SHELL -c of unreadable empty script should fail -- expected $exp, got" $got
+got=$($SHELL -c "command $scr; print \$?" 2>/dev/null)
+[[ "$got" == "$exp" ]] || err_exit "\$SHELL -c of command of unreadable empty script should fail -- expected $exp, got" $got
+
+rm -f $scr
+print : > $scr
+chmod a=x $scr
+{ got=$($scr; print $?); } 2>/dev/null
+[[ "$got" == "$exp" ]] || err_exit "unreadable non-empty script should fail -- expected $exp, got $got"
+{ got=$(command $scr; print $?); } 2>/dev/null
+[[ "$got" == "$exp" ]] || err_exit "command of unreadable non-empty script should fail -- expected $exp, got $got"
+[[ "$(:; $scr; print $?)" == "$exp" ]] 2>/dev/null || err_exit "unreadable non-empty script in [[ ... ]] should fail -- expected $exp"
+[[ "$(:; command $scr; print $?)" == "$exp" ]] 2>/dev/null || err_exit "command unreadable non-empty script in [[ ... ]] should fail -- expected $exp"
+got=$($SHELL -c "$scr; print \$?" 2>/dev/null)
+[[ "$got" == "$exp" ]] || err_exit "\$SHELL -c of unreadable non-empty script should fail -- expected $exp, got" $got
+got=$($SHELL -c "command $scr; print \$?" 2>/dev/null)
+[[ "$got" == "$exp" ]] || err_exit "\$SHELL -c of command of unreadable non-empty script should fail -- expected $exp, got" $got
+
exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/pointtype.sh b/usr/src/lib/libshell/common/tests/pointtype.sh
new file mode 100644
index 0000000000..25b9f5fbc5
--- /dev/null
+++ b/usr/src/lib/libshell/common/tests/pointtype.sh
@@ -0,0 +1,145 @@
+########################################################################
+# #
+# This software is part of the ast package #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
+# and is licensed under the #
+# Common Public License, Version 1.0 #
+# by AT&T Intellectual Property #
+# #
+# A copy of the License is available at #
+# http://www.opensource.org/licenses/cpl1.0.txt #
+# (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) #
+# #
+# Information and Software Systems Research #
+# AT&T Research #
+# Florham Park NJ #
+# #
+# David Korn <dgk@research.att.com> #
+# #
+########################################################################
+function err_exit
+{
+ print -u2 -n "\t"
+ print -u2 -r ${Command}[$1]: "${@:2}"
+ (( Errors+=1 ))
+}
+alias err_exit='err_exit $LINENO'
+
+Command=${0##*/}
+integer Errors=0
+
+typeset -T Pt_t=(
+ float x=1
+ float y=0
+ len()
+ {
+ print -r $((sqrt(_.x*_.x + _.y*_.y)))
+ }
+)
+
+for ((i=0; i < 100; i++))
+do
+Pt_t p
+[[ ${p.x} == 1 ]] || err_exit '${p[x]} is not 1'
+(( p.x == 1 )) || err_ext 'p[x] is not 1'
+[[ $(p.len) == 1 ]] || err_exit '$(p.len) != 1'
+[[ ${p.len} == 1 ]] || err_exit '${p.len} != 1'
+(( p.len == 1 )) || err_exit '((p.len != 1))'
+Pt_t q=(y=2)
+(( q.x == 1 )) || err_exit 'q.x is not 1'
+(( (q.len - sqrt(5)) < 10e-10 )) || err_exit 'q.len != sqrt(5)'
+q.len()
+{
+ print -r $((abs(_.x)+abs(_.y) ))
+}
+(( q.len == 3 )) || err_exit 'q.len is not 3'
+p=q
+[[ ${p.y} == 2 ]] || err_exit '${p[y]} is not 2'
+[[ ${@p} == Pt_t ]] || err_exit 'type of p is not Pt_t'
+[[ ${@q} == Pt_t ]] || err_exit 'type of q is not Pt_t'
+(( p.len == 3 )) || err_exit 'p.len is not 3'
+unset p q
+Pt_t pp=( ( x=3 y=4) ( x=5 y=12) (y=2) )
+(( pp[0].len == 5 )) || err_exit 'pp[0].len != 5'
+(( pp[1].len == 13 )) || err_exit 'pp[0].len != 12'
+(( (pp[2].len - sqrt(5)) < 10e-10 )) || err_exit 'pp[2].len != sqrt(5)'
+[[ ${pp[1]} == $'(\n\ttypeset -l -E x=5\n\ttypeset -l -E y=12\n)' ]] || err_exit '${pp[1] is not correct'
+[[ ${!pp[@]} == '0 1 2' ]] || err_exit '${pp[@] != "0 1 2"'
+pp+=( x=6 y=8)
+(( pp[3].len == 10 )) || err_exit 'pp[3].len != 10'
+[[ ${!pp[@]} == '0 1 2 3' ]] || err_exit '${pp[@] != "0 1 2 3"'
+pp[4]=pp[1]
+[[ ${pp[4]} == $'(\n\ttypeset -l -E x=5\n\ttypeset -l -E y=12\n)' ]] || err_exit '${pp[4] is not correct'
+unset pp
+Pt_t pp=( [one]=( x=3 y=4) [two]=( x=5 y=12) [three]=(y=2) )
+(( pp[one].len == 5 )) || err_exit 'pp[one].len != 5'
+(( pp[two].len == 13 )) || err_exit 'pp[two].len != 12'
+[[ ${pp[two]} == $'(\n\ttypeset -l -E x=5\n\ttypeset -l -E y=12\n)' ]] || err_exit '${pp[two] is not correct'
+[[ ${!pp[@]} == 'one three two' ]] || err_exit '${pp[@] != "one three two"'
+[[ ${@pp[1]} == Pt_t ]] || err_exit 'type of pp[1] is not Pt_t'
+unset pp
+done
+# redefinition of point
+typeset -T Pt_t=(
+ Pt_t _=(x=3 y=6)
+ float z=2
+ len()
+ {
+ print -r $((sqrt(_.x*_.x + _.y*_.y + _.z*_.z)))
+ }
+)
+Pt_t p
+[[ ${p.y} == 6 ]] || err_exit '${p.y} != 6'
+(( p.len == 7 )) || err_exit '((p.len !=7))'
+
+z=()
+Pt_t -a z.p
+z.p[1]=(y=2)
+z.p[2]=(y=5)
+z.p[3]=(x=6 y=4)
+eval y="$z"
+[[ $y == "$z" ]] || err_exit 'expansion of indexed array of types is incorrect'
+eval "$(typeset -p y)"
+[[ $y == "$z" ]] || err_exit 'typeset -p z for indexed array of types is incorrect'
+unset z y
+z=()
+Pt_t -A z.p
+z.p[1]=(y=2)
+z.p[2]=(y=5)
+z.p[3]=(x=6 y=4)
+eval y="$z"
+[[ $y == "$z" ]] || err_exit 'expansion of associative array of types is incorrect'
+eval "$(typeset -p y)"
+[[ $y == "$z" ]] || err_exit 'typeset -p z for associative of types is incorrect'
+unset z y
+
+typeset -T A_t=(
+ Pt_t -a b
+)
+typeset -T B_t=(
+ Pt_t -A b
+)
+A_t r
+r.b[1]=(y=2)
+r.b[2]=(y=5)
+eval s="$r"
+[[ $r == "$s" ]] || err_exit 'expansion of type containing index array of types is incorrect'
+eval "$(typeset -p s)"
+[[ $y == "$z" ]] || err_exit 'typeset -p z for type containing index of types is incorrect'
+unset r s
+B_t r
+r.b[1]=(y=2)
+r.b[2]=(y=5)
+eval s="$r"
+[[ $r == "$s" ]] || err_exit 'expansion of type containing index array of types is incorrect'
+eval "$(typeset -p s)"
+[[ $y == "$z" ]] || err_exit 'typeset -p z for type containing index of types is incorrect'
+unset r s
+exit
+
+
+
+typeset -C z=(Pt_t -A p=( [1]=(typeset -l -E x=1;typeset -l -E y=2;)[2]=(typeset -l -E x=1;typeset -l -E y=5;)[3]=(typeset -l -E x=6;typeset -l -E y=4;));)
+
+print z="$z"
+exit $Errors
diff --git a/usr/src/lib/libshell/common/tests/quoting.sh b/usr/src/lib/libshell/common/tests/quoting.sh
index 9a9e23bd55..b15739da08 100644
--- a/usr/src/lib/libshell/common/tests/quoting.sh
+++ b/usr/src/lib/libshell/common/tests/quoting.sh
@@ -1,10 +1,10 @@
########################################################################
# #
# This software is part of the ast package #
-# Copyright (c) 1982-2007 AT&T Knowledge Ventures #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
-# by AT&T Knowledge Ventures #
+# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# http://www.opensource.org/licenses/cpl1.0.txt #
@@ -328,4 +328,10 @@ x=x
x=${x:-`id | sed 's/^[^(]*(\([^)]*\)).*/\1/'`}
} 2> /dev/null || err_exit 'skipping over `` failed'
[[ $x == x ]] || err_exit 'assignment ${x:=`...`} failed'
+[[ $($SHELL -c 'print a[') == 'a[' ]] || err_exit "unbalanced '[' in command arg fails"
+$SHELL -c $'false && (( `wc -l /dev/null | nawk \'{print $1}\'` > 2 )) && true;:' 2> /dev/null || err_exit 'syntax error with ` in arithmetic expression'
+{ $SHELL -c '(( 1`: "{ }"` ))' ;} 2> /dev/null || err_exit 'problem with ` inside (())'
+varname=foobarx
+x=`print '"\$'${varname}'"'`
+[[ $x == '"$foobarx"' ]] || err_exit $'\\$\' not handled correctly inside ``'
exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/quoting2.sh b/usr/src/lib/libshell/common/tests/quoting2.sh
index 0532f72d7a..334ed40e7c 100644
--- a/usr/src/lib/libshell/common/tests/quoting2.sh
+++ b/usr/src/lib/libshell/common/tests/quoting2.sh
@@ -1,10 +1,10 @@
########################################################################
# #
# This software is part of the ast package #
-# Copyright (c) 1982-2007 AT&T Knowledge Ventures #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
-# by AT&T Knowledge Ventures #
+# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# http://www.opensource.org/licenses/cpl1.0.txt #
@@ -197,4 +197,11 @@ foo=foo
[[ "$" == '$' ]] || err_exit '"$" != $'
[[ "${foo}$" == 'foo$' ]] || err_exit 'foo=foo;"${foo}$" != foo$'
[[ "${foo}${foo}$" == 'foofoo$' ]] || err_exit 'foo=foo;"${foo}${foo}$" != foofoo$'
+foo='$ '
+[[ "$foo" == ~(Elr)(\\\$|#)\ ]] || err_exit $'\'$ \' not matching RE \\\\\\$|#\''
+[[ "$foo" == ~(Elr)('\$'|#)\ ]] || err_exit $'\'$ \' not matching RE \'\\$\'|#\''
+foo='# '
+[[ "$foo" == ~(Elr)(\\\$|#)\ ]] || err_exit $'\'# \' not matching RE \\'\$|#\''
+[[ "$foo" == ~(Elr)('\$'|#)\ ]] || err_exit $'\'# \' not matching RE \'\\$\'|#\''
+[[ '\$' == '\$'* ]] || err_exit $'\'\\$\' not matching \'\\$\'*'
exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/recttype.sh b/usr/src/lib/libshell/common/tests/recttype.sh
new file mode 100644
index 0000000000..8fe1f3d4ff
--- /dev/null
+++ b/usr/src/lib/libshell/common/tests/recttype.sh
@@ -0,0 +1,69 @@
+########################################################################
+# #
+# This software is part of the ast package #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
+# and is licensed under the #
+# Common Public License, Version 1.0 #
+# by AT&T Intellectual Property #
+# #
+# A copy of the License is available at #
+# http://www.opensource.org/licenses/cpl1.0.txt #
+# (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) #
+# #
+# Information and Software Systems Research #
+# AT&T Research #
+# Florham Park NJ #
+# #
+# David Korn <dgk@research.att.com> #
+# #
+########################################################################
+function err_exit
+{
+ print -u2 -n "\t"
+ print -u2 -r ${Command}[$1]: "${@:2}"
+ (( Errors+=1 ))
+}
+alias err_exit='err_exit $LINENO'
+
+Command=${0##*/}
+integer Errors=0
+
+typeset -T Pt_t=(
+ float x=1
+ float y=0
+ len()
+ {
+ print -r $((sqrt(_.x*_.x + _.y*_.y)))
+ }
+)
+
+typeset -T Rect_t=(
+ Pt_t ll=(x=0 y=0)
+ Pt_t ur=(x=1 y=1)
+ area()
+ {
+ print -r $(( abs((_.ur.x-_.ll.x)*(_.ur.y-_.ll.y)) ))
+ }
+)
+
+for ((i=0; i < 100; i++))
+do
+Rect_t r
+[[ ${r.area} == 1 ]] || err_exit '${r.area} != 1'
+Rect_t s=(
+ Pt_t ur=(x=9 y=9)
+ Pt_t ll=(x=7 y=7)
+)
+[[ ${s.ur.x} == 9 ]] || err_exit ' ${s.ur.x} != 9'
+(( s.ur.x == 9 ))|| err_exit ' ((s.ur.x)) != 9'
+[[ ${s.ll.y} == 7 ]] || err_exit '${s.ll.y} != 7'
+(( s.area == 4 )) || err_exit 'area of s should be 4'
+[[ ${s.area} == 4 ]] || err_exit '${s.area} != 4'
+unset r s
+done
+Rect_t -A r
+r[one]=(ur=(x=4 y=4))
+(( r[one].area == 16 )) || err_exit 'area of r[one] should be 16'
+[[ ${r[one].area} == 16 ]] || err_exit '${r[one].area} should be 16'
+unset r
+exit $Errors
diff --git a/usr/src/lib/libshell/common/tests/restricted.sh b/usr/src/lib/libshell/common/tests/restricted.sh
new file mode 100644
index 0000000000..9cc28c7303
--- /dev/null
+++ b/usr/src/lib/libshell/common/tests/restricted.sh
@@ -0,0 +1,77 @@
+########################################################################
+# #
+# This software is part of the ast package #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
+# and is licensed under the #
+# Common Public License, Version 1.0 #
+# by AT&T Intellectual Property #
+# #
+# A copy of the License is available at #
+# http://www.opensource.org/licenses/cpl1.0.txt #
+# (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) #
+# #
+# Information and Software Systems Research #
+# AT&T Research #
+# Florham Park NJ #
+# #
+# David Korn <dgk@research.att.com> #
+# #
+########################################################################
+function err_exit
+{
+ print -u2 -n "\t"
+ print -u2 -r ${Command}[$1]: "${@:2}"
+ let Errors+=1
+}
+alias err_exit='err_exit $LINENO'
+
+# test restricted shell
+Command=${0##*/}
+integer Errors=0
+mkdir /tmp/ksh$$ || err_exit "mkdir /tmp/ksh$$ failed"
+trap "cd /; rm -rf /tmp/ksh$$" EXIT
+pwd=$PWD
+case $SHELL in
+/*) ;;
+*/*) SHELL=$pwd/$SHELL;;
+*) SHELL=$(whence "$SHELL");;
+esac
+function check_restricted
+{
+ rm -f out
+ rksh -c "$@" 2> out > /dev/null
+ grep restricted out > /dev/null 2>&1
+}
+
+[[ $SHELL != /* ]] && SHELL=$pwd/$SHELL
+cd /tmp/ksh$$ || err_exit "cd /tmp/ksh$$ failed"
+ln -s $SHELL rksh
+PATH=$PWD:$PATH
+rksh -c '[[ -o restricted ]]' || err_exit 'restricted option not set'
+[[ $(rksh -c 'print hello') == hello ]] || err_exit 'unable to run print'
+check_restricted /bin/echo || err_exit '/bin/echo not resticted'
+check_restricted ./echo || err_exit './echo not resticted'
+check_restricted 'SHELL=ksh' || err_exit 'SHELL asignment not resticted'
+check_restricted 'PATH=/bin' || err_exit 'PATH asignment not resticted'
+check_restricted 'FPATH=/bin' || err_exit 'FPATH asignment not resticted'
+check_restricted 'ENV=/bin' || err_exit 'ENV asignment not resticted'
+check_restricted 'print > file' || err_exit '> file not restricted'
+> empty
+check_restricted 'print <> empty' || err_exit '<> file not restricted'
+print 'echo hello' > script
+chmod +x ./script
+! check_restricted script || err_exit 'script without builtins should run in restricted mode'
+check_restricted ./script || err_exit 'script with / in name should not run in restricted mode'
+print '/bin/echo hello' > script
+! check_restricted script || err_exit 'script with pathnames should run in restricted mode'
+print 'echo hello> file' > script
+! check_restricted script || err_exit 'script with output redirection should run in restricted mode'
+print 'PATH=/bin' > script
+! check_restricted script || err_exit 'script with PATH assignment should run in restricted mode'
+cat > script <<!
+#! $SHELL
+print hello
+!
+! check_restricted 'script;:' || err_exit 'script with #! pathname should run in restricted mode'
+! check_restricted 'script' || err_exit 'script with #! pathname should run in restricted mode even if last command in script'
+exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/return.sh b/usr/src/lib/libshell/common/tests/return.sh
index b3ee5b11ff..ac9d2761c0 100644
--- a/usr/src/lib/libshell/common/tests/return.sh
+++ b/usr/src/lib/libshell/common/tests/return.sh
@@ -1,10 +1,10 @@
########################################################################
# #
# This software is part of the ast package #
-# Copyright (c) 1982-2007 AT&T Knowledge Ventures #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
-# by AT&T Knowledge Ventures #
+# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# http://www.opensource.org/licenses/cpl1.0.txt #
@@ -26,9 +26,11 @@ function err_exit
let Errors+=1
}
alias err_exit='err_exit $LINENO'
-
Command=${0##*/}
integer Errors=0
+
+unset HISTFILE
+
foo=NOVAL bar=NOVAL
file=/tmp/shtest$$
trap "rm -f $file" EXIT INT
@@ -144,7 +146,7 @@ x=$( . $file)
if [[ $x != $0 ]]
then err_exit "\$0 in a dot script is $x. Should be $0"
fi
-x=$($SHELL -i 2> /dev/null <<\!
+x=$($SHELL -i --norc 2> /dev/null <<\!
typeset -i x=1/0
print hello
!
diff --git a/usr/src/lib/libshell/common/tests/select.sh b/usr/src/lib/libshell/common/tests/select.sh
index aec1903fb7..578fca2e11 100644
--- a/usr/src/lib/libshell/common/tests/select.sh
+++ b/usr/src/lib/libshell/common/tests/select.sh
@@ -1,10 +1,10 @@
########################################################################
# #
# This software is part of the ast package #
-# Copyright (c) 1982-2007 AT&T Knowledge Ventures #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
-# by AT&T Knowledge Ventures #
+# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# http://www.opensource.org/licenses/cpl1.0.txt #
diff --git a/usr/src/lib/libshell/common/tests/shtests b/usr/src/lib/libshell/common/tests/shtests
index a094d8ed20..63b8db0462 100644
--- a/usr/src/lib/libshell/common/tests/shtests
+++ b/usr/src/lib/libshell/common/tests/shtests
@@ -1,24 +1,46 @@
# This program runs ksh regression tests
-# shtests [ name=value ... ] a.sh b.sh ...
+# shtests [ name=value ... ] [ --all | --compile ] [ --time ] [ a.sh b.sh ... ]
unset DISPLAY ENV FIGNORE
LANG=C
LC_ALL=C
+compile=1
+script=1
time=1
+vmdebug=1
while :
do case $1 in
+ -a|--a*)compile=2
+ script=2
+ ;;
+ -c|--c*)compile=2
+ script=
+ ;;
+ -s|--s*)compile=
+ script=2
+ ;;
+ -t|--not*)time=
+ ;;
+ -v|--nov*)vmdebug=
+ ;;
+ -*) echo $0: $1: invalid option >&2
+ exit 2
+ ;;
*=*) n=${1%%=*}
v=${1#*=}
eval $n=\'$v\'
export $n
;;
- -t|--t*)time=
- ;;
*) break
;;
esac
shift
done
+if [[ ! $vmdebug ]]
+then unset VMDEBUG
+elif [[ ! $VMDEBUG ]]
+then export VMDEBUG=a
+fi
export LANG LC_ALL PATH PWD SHELL
PWD=`pwd`
SHELL=${SHELL-ksh}
@@ -37,27 +59,77 @@ if [[ -d /usr/ucb ]]
then PATH=$PATH:/usr/ucb
fi
PATH=$PATH:$d
-if [[ $INSTALLROOT && -r $INSTALLROOT/bin/.paths ]]
+if [[ $INSTALLROOT && -r $INSTALLROOT/bin/.paths ]]
then PATH=$INSTALLROOT/bin:$PATH
fi
+if [[ $compile ]]
+then SHCOMP=${SHCOMP:-shcomp}
+ if whence $SHCOMP > /dev/null
+ then tmp=/tmp/ksh-$$
+ trap 'rm -rf $tmp' EXIT
+ mkdir $tmp || exit
+ elif [[ $compile != 1 ]]
+ then echo $0: --compile: $SHCOMP not found >&2
+ exit 1
+ else compile=
+ fi
+fi
+typeset -A tests
for i in ${*-*.sh}
-do echo test $i begins ${time:+"at $(date +%Y-%m-%d+%H:%M:%S)"}
- t=$(grep -c err_exit $i)
- if (( $t ))
- then (( t = $t - 1 ))
+do t=$(grep -c err_exit $i)
+ if (( $t > 2 ))
+ then (( t = $t - 2 ))
fi
+ tests[$i]=$t
T=test
if (( $t != 1 ))
then T=${T}s
fi
E=error
- if $SHELL $i
- then echo test $i passed ${time:+"at $(date +%Y-%m-%d+%H:%M:%S)"} "[ $t $T 0 ${E}s ]"
- else e=$?
- E=error
- if (( $e != 1 ))
- then E=${E}s
+ if [[ $script ]]
+ then echo test $i begins ${time:+"at $(date +%Y-%m-%d+%H:%M:%S)"}
+ if $SHELL $i
+ then echo test $i passed ${time:+"at $(date +%Y-%m-%d+%H:%M:%S)"} "[ $t $T 0 ${E}s ]"
+ else e=$?
+ if (( e > 256 ))
+ then e=1
+ E=signal
+ fi
+ if (( $e != 1 ))
+ then E=${E}s
+ fi
+ echo test $i failed ${time:+"at $(date +%Y-%m-%d+%H:%M:%S)"} with exit code $e "[ $t $T $e $E ]"
fi
- echo test $i failed ${time:+"at $(date +%Y-%m-%d+%H:%M:%S)"} with exit code $e "[ $t $T $e $E ]"
fi
done
+if [[ $compile ]]
+then for i in ${*-*.sh}
+ do t=${tests[$i]}
+ T=test
+ if (( $t != 1 ))
+ then T=${T}s
+ fi
+ o=${i##*/}
+ o=shcomp-${o%.sh}.ksh
+ echo test $o begins ${time:+"at $(date +%Y-%m-%d+%H:%M:%S)"}
+ E=error
+ if $SHCOMP $i > $tmp/$o
+ then if $SHELL $tmp/$o
+ then echo test $o passed ${time:+"at $(date +%Y-%m-%d+%H:%M:%S)"} "[ $t $T 0 ${E}s ]"
+ else e=$?
+ if (( e > 256 ))
+ then e=1
+ E=signal
+ fi
+ if (( $e != 1 ))
+ then E=${E}s
+ fi
+ echo test $o failed ${time:+"at $(date +%Y-%m-%d+%H:%M:%S)"} with exit code $e "[ $t $T $e $E ]"
+ fi
+ else e=$?
+ t=1
+ T=test
+ echo test $o failed to compile ${time:+"at $(date +%Y-%m-%d+%H:%M:%S)"} with exit code $e "[ $t $T 1 $E ]"
+ fi
+ done
+fi
diff --git a/usr/src/lib/libshell/common/tests/sigchld.sh b/usr/src/lib/libshell/common/tests/sigchld.sh
new file mode 100644
index 0000000000..018eb9fbc0
--- /dev/null
+++ b/usr/src/lib/libshell/common/tests/sigchld.sh
@@ -0,0 +1,65 @@
+########################################################################
+# #
+# This software is part of the ast package #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
+# and is licensed under the #
+# Common Public License, Version 1.0 #
+# by AT&T Intellectual Property #
+# #
+# A copy of the License is available at #
+# http://www.opensource.org/licenses/cpl1.0.txt #
+# (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) #
+# #
+# Information and Software Systems Research #
+# AT&T Research #
+# Florham Park NJ #
+# #
+# David Korn <dgk@research.att.com> #
+# #
+########################################################################
+function err_exit
+{
+ print -u2 -n "\t"
+ print -u2 -r ${Command}[$1]: "${@:2}"
+ (( Errors+=1 ))
+}
+
+alias err_exit='err_exit $LINENO'
+
+float DELAY=${1:-0.5}
+integer FOREGROUND=10 BACKGROUND=2 Errors=0
+
+s=$($SHELL -c '
+integer i foreground=0 background=0
+float delay='$DELAY' d=0 s=0
+
+set --errexit
+
+trap "(( background++ ))" CHLD
+
+(( d = delay ))
+for ((i = 0; i < '$BACKGROUND'; i++))
+do sleep $d &
+ (( d *= 4 ))
+ (( s += d ))
+done
+for ((i = 0; i < '$FOREGROUND'; i++))
+do (( foreground++ ))
+ sleep $delay
+ (( s -= delay ))
+ $SHELL -c : > /dev/null # foreground does not generate SIGCHLD
+done
+if (( (s += delay) < 1 ))
+then (( s = 1 ))
+fi
+sleep $s
+wait
+print foreground=$foreground background=$background
+') || err_exit "test loop failed"
+
+eval $s
+
+(( foreground == FOREGROUND )) || err_exit "expected $FOREGROUND foreground -- got $foreground (DELAY=$DELAY)"
+(( background == BACKGROUND )) || err_exit "expected $BACKGROUND background -- got $background (DELAY=$DELAY)"
+
+exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/signal.sh b/usr/src/lib/libshell/common/tests/signal.sh
new file mode 100644
index 0000000000..12b06d6fca
--- /dev/null
+++ b/usr/src/lib/libshell/common/tests/signal.sh
@@ -0,0 +1,226 @@
+########################################################################
+# #
+# This software is part of the ast package #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
+# and is licensed under the #
+# Common Public License, Version 1.0 #
+# by AT&T Intellectual Property #
+# #
+# A copy of the License is available at #
+# http://www.opensource.org/licenses/cpl1.0.txt #
+# (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) #
+# #
+# Information and Software Systems Research #
+# AT&T Research #
+# Florham Park NJ #
+# #
+# David Korn <dgk@research.att.com> #
+# #
+########################################################################
+function err_exit
+{
+ print -u2 -n "\t"
+ print -u2 -r ${Command}[$1]: "${@:2}"
+ (( Errors++ ))
+}
+alias err_exit='err_exit $LINENO'
+
+Command=${0##*/}
+integer Errors=0
+
+mkdir /tmp/ksh$$ || err_exit "mkdir /tmp/ksh$$ failed"
+trap 'cd /; rm -rf /tmp/ksh$$' EXIT
+cd /tmp/ksh$$ || err_exit "cd /tmp/ksh$$ failed"
+
+[[ $( trap 'print -n got_child' SIGCHLD
+ sleep 2 &
+ for ((i=0; i < 4; i++))
+ do sleep .9
+ print -n $i
+ done) == 01got_child23 ]] || err_exit 'SIGCHLD not working'
+
+# begin standalone SIGINT test generation
+
+cat > tst <<'!'
+# shell trap tests
+#
+# tst control script that calls tst-1, must be run by ksh
+# tst-1 calls tst-2
+# tst-2 calls tst-3
+# tst-3 defaults or handles and discards/propagates SIGINT
+#
+# initial -v option lists script entry and SIGINT delivery
+#
+# three test options
+#
+# d call next script directly, otherwise via $SHELL -c
+# t trap, echo, and kill self on SIGINT, otherwise x or SIGINT default if no x
+# x trap, echo on SIGINT, and exit 0, otherwise SIGINT default
+#
+# Usage: tst [-v] [-options] shell-to-test ...
+
+# "trap + sig" is an unadvertized extension for this test
+# if run from nmake SIGINT is set to SIG_IGN
+# this call sets it back to SIG_DFL
+# semantics w.r.t. function scope must be worked out before
+# making it public
+trap + INT
+
+set -o monitor
+
+function gen
+{
+ typeset o t x d
+ for x in - x
+ do case $x in
+ [$1]) for t in - t
+ do case $t in
+ [$1]) for d in - d
+ do case $d in
+ [$1]) o="$o $x$t$d"
+ esac
+ done
+ esac
+ done
+ esac
+ done
+ echo '' $o
+}
+
+case $1 in
+-v) v=v; shift ;;
+-*v*) v=v ;;
+*) v= ;;
+esac
+case $1 in
+*' '*) o=$1; shift ;;
+-*) o=$(gen $1); shift ;;
+*) o=$(gen -txd) ;;
+esac
+case $# in
+0) set ksh bash ksh88 pdksh ash zsh ;;
+esac
+for f in $o
+do case $# in
+ 1) ;;
+ *) echo ;;
+ esac
+ for sh
+ do if $sh -c 'exit 0' > /dev/null 2>&1
+ then case $# in
+ 1) printf '%3s ' "$f" ;;
+ *) printf '%16s %3s ' "$sh" "$f" ;;
+ esac
+ $sh tst-1 $v$f $sh > tst.out &
+ wait
+ echo $(cat tst.out)
+ fi
+ done
+done
+case $# in
+1) ;;
+*) echo ;;
+esac
+!
+cat > tst-1 <<'!'
+exec 2>/dev/null
+case $1 in
+*v*) echo 1-main ;;
+esac
+{
+ sleep 2
+ case $1 in
+ *v*) echo "SIGINT" ;;
+ esac
+ kill -s INT 0
+} &
+case $1 in
+*t*) trap '
+ echo 1-intr
+ trap - INT
+ # omitting the self kill exposes shells that deliver
+ # the SIGINT trap but exit 0 for -xt
+ # kill -s INT $$
+ ' INT
+ ;;
+esac
+case $1 in
+*d*) tst-2 $1 $2; status=$? ;;
+*) $2 -c "tst-2 $1 $2"; status=$? ;;
+esac
+printf '1-%04d\n' $status
+sleep 2
+!
+cat > tst-2 <<'!'
+case $1 in
+*x*) trap '
+ echo 2-intr
+ exit
+ ' INT
+ ;;
+*t*) trap '
+ echo 2-intr
+ trap - INT
+ kill -s INT $$
+ ' INT
+ ;;
+esac
+case $1 in
+*v*) echo 2-main ;;
+esac
+case $1 in
+*d*) tst-3 $1 $2; status=$? ;;
+*) $2 -c "tst-3 $1 $2"; status=$? ;;
+esac
+printf '2-%04d\n' $status
+!
+cat > tst-3 <<'!'
+case $1 in
+*x*) trap '
+ sleep 2
+ echo 3-intr
+ exit 0
+ ' INT
+ ;;
+*) trap '
+ sleep 2
+ echo 3-intr
+ trap - INT
+ kill -s INT $$
+ ' INT
+ ;;
+esac
+case $1 in
+*v*) echo 3-main ;;
+esac
+sleep 5
+printf '3-%04d\n' $?
+!
+chmod +x tst tst-?
+
+# end standalone test generation
+
+export PATH=$PATH:
+typeset -A expected
+expected[---]="3-intr"
+expected[--d]="3-intr"
+expected[-t-]="3-intr 2-intr 1-intr 1-0258"
+expected[-td]="3-intr 2-intr 1-intr 1-0258"
+expected[x--]="3-intr 2-intr 1-0000"
+expected[x-d]="3-intr 2-intr 1-0000"
+expected[xt-]="3-intr 2-intr 1-intr 1-0000"
+expected[xtd]="3-intr 2-intr 1-intr 1-0000"
+
+tst $SHELL > tst.got
+
+while read ops out
+do [[ $out == ${expected[$ops]} ]] || err_exit "interrupt $ops test failed -- expected '${expected[$ops]}', got '$out'"
+done < tst.got
+
+float s=$SECONDS
+[[ $($SHELL -c 'trap "print SIGUSR1 ; exit 0" USR1; (trap "" USR1 ; exec kill -USR1 $$ & sleep 5); print done') == SIGUSR1 ]] || err_exit 'subshell ignoring signal does not send signal to parent'
+(( (SECONDS-s) < 4 )) && err_exit 'parent does not wait for child to complete before handling signal'
+((s = SECONDS))
+[[ $($SHELL -c 'trap "print SIGUSR1 ; exit 0" USR1; (trap "exit" USR1 ; exec kill -USR1 $$ & sleep 5); print done') == SIGUSR1 ]] || err_exit 'subshell catching signal does not send signal to parent'
+(( SECONDS-s < 4 )) && err_exit 'parent completes early'
+exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/statics.sh b/usr/src/lib/libshell/common/tests/statics.sh
new file mode 100644
index 0000000000..d6af9c7c91
--- /dev/null
+++ b/usr/src/lib/libshell/common/tests/statics.sh
@@ -0,0 +1,106 @@
+########################################################################
+# #
+# This software is part of the ast package #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
+# and is licensed under the #
+# Common Public License, Version 1.0 #
+# by AT&T Intellectual Property #
+# #
+# A copy of the License is available at #
+# http://www.opensource.org/licenses/cpl1.0.txt #
+# (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) #
+# #
+# Information and Software Systems Research #
+# AT&T Research #
+# Florham Park NJ #
+# #
+# David Korn <dgk@research.att.com> #
+# #
+########################################################################
+function err_exit2
+{
+ print -u2 -n "\t"
+ print -u2 -r ${Command}[$1]: "${@:2}"
+ (( Errors+=1 ))
+}
+
+function testfunc
+{
+ integer line_number=$1
+ typeset cmd="$2"
+ typeset expected_output="$3"
+ typeset output
+
+ output="$($SHELL -c "${cmd}" 2>&1 )"
+
+ [[ "${output}" != "${expected_output}" ]] && err_exit2 ${line_number} "${output} != ${expected_output}"
+}
+alias testfunc='testfunc $LINENO'
+alias err_exit='err_exit2 $LINENO'
+
+Command=${0##*/}
+integer Errors=0
+
+# string
+testfunc '(function l { typeset -S x ; x+="#" ; $1 && print "$x" ; } ; l false ; l false ; l true)' "###"
+testfunc 'function l { typeset -S x=">" ; x+="#" ; $1 && print "$x" ; } ; l false ; l false ; l true' ">###"
+testfunc 'function l { typeset -S x=">" ; x+="#" ; $1 && print "$x" ; } ; l false ; (l false) ; l true' ">##"
+testfunc 'function l { typeset -S x=">" ; x+="#" ; $1 && print "$x" ; } ; l false; ( ulimit -c 0 ; l false) ; l true' ">##"
+
+# integer
+testfunc '(function l { typeset -S -i x ; x+=1 ; $1 && print "$x" ; } ; l false ; l false ; l true )' "3"
+testfunc '(function l { typeset -S -i x ; x+=1 ; $1 && print "$x" ; } ; l false ; (l false) ; l true )' "2"
+
+# float
+testfunc '(function l { float -S x=0.5 ; (( x+=.5 )) ; $1 && print "$x" ; } ; l false ; l false ; l true )' "2"
+testfunc '(function l { float -S x=0.5 ; (( x+=.5 )) ; $1 && print "$x" ; } ; l false ; (l false) ; l true )' "1.5"
+
+# compound variable
+[[ "${
+ function l
+ {
+ typeset -S s=( a=0 b=0 )
+
+ (( s.a++, s.b++ ))
+
+ $1 && printf 'a=%d, b=%d\n' s.a s.b
+ }
+ l false ; l false ; l true
+}" != "a=3, b=3" ]] && err_exit "static compound var failed"
+
+
+# array variable
+expected="helloan elementan elementan element"
+got=$(
+ function ar
+ {
+ typeset -a -S s=( "hello" )
+
+ s+=( "an element" )
+
+ $1 && { printf '%s' "${s[@]}" ; printf '\n' ; }
+ }
+ ar false ; ar false ; ar true
+)
+[[ $got != $expected ]] && err_exit "static array var failed -- expected '$expected', got '$got'"
+
+
+# Test visibilty of "global" vs. "static" variables. if we have a "static" variable in a
+# function and "unset" it we should see a global variable with the same
+# name, right ?
+integer hx=5
+function test_hx_scope
+{
+ integer -S hx=9
+ $2 && unset hx
+ $1 && printf "hx=%d\n" hx
+}
+test_hx_scope false false
+test_hx_scope false false
+# first test the "unset" call in a $(...) subshell...
+[[ "$( test_hx_scope true true )" != "hx=5" ]] && err_exit "can't see global variable hx after unsetting static variable hx"
+# ... end then test whether the value has changed.
+[[ "${ test_hx_scope true false }" != "hx=9" ]] && err_exit "hx variable somehow changed"
+
+exit $((Errors))
+
diff --git a/usr/src/lib/libshell/common/tests/subshell.sh b/usr/src/lib/libshell/common/tests/subshell.sh
new file mode 100644
index 0000000000..985aba6eaa
--- /dev/null
+++ b/usr/src/lib/libshell/common/tests/subshell.sh
@@ -0,0 +1,223 @@
+########################################################################
+# #
+# This software is part of the ast package #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
+# and is licensed under the #
+# Common Public License, Version 1.0 #
+# by AT&T Intellectual Property #
+# #
+# A copy of the License is available at #
+# http://www.opensource.org/licenses/cpl1.0.txt #
+# (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) #
+# #
+# Information and Software Systems Research #
+# AT&T Research #
+# Florham Park NJ #
+# #
+# David Korn <dgk@research.att.com> #
+# #
+########################################################################
+function err_exit
+{
+ print -u$Error_fd -n "\t"
+ print -u$Error_fd -r ${Command}[$1]: "${@:2}"
+ (( Errors+=1 ))
+}
+alias err_exit='err_exit $LINENO'
+Command=${0##*/}
+integer Errors=0 Error_fd=2
+
+z=()
+z.foo=( [one]=hello [two]=(x=3 y=4) [three]=hi)
+z.bar[0]=hello
+z.bar[2]=world
+z.bar[1]=(x=4 y=5)
+val='(
+ typeset -a bar=(
+ [0]=hello
+ [2]=world
+ [1]=(
+ x=4
+ y=5
+ )
+ )
+ typeset -A foo=(
+ [one]=hello
+ [three]=hi
+ [two]=(
+ x=3
+ y=4
+ )
+ )
+)'
+[[ $z == "$val" ]] || err_exit 'compound variable with mixed arrays not working'
+z.bar[1]=yesyes
+[[ ${z.bar[1]} == yesyes ]] || err_exit 'reassign of index array compound variable fails'
+z.bar[1]=(x=12 y=5)
+[[ ${z.bar[1]} == $'(\n\tx=12\n\ty=5\n)' ]] || err_exit 'reassign array simple to compound variable fails'
+eval val="$z"
+(
+ z.foo[three]=good
+ [[ ${z.foo[three]} == good ]] || err_exit 'associative array assignment in subshell not working'
+)
+[[ $z == "$val" ]] || err_exit 'compound variable changes after associative array assignment'
+eval val="$z"
+(
+false
+ z.foo[two]=ok
+ [[ ${z.foo[two]} == ok ]] || err_exit 'associative array assignment to compound variable in subshell not working'
+ z.bar[1]=yes
+ [[ ${z.bar[1]} == yes ]] || err_exit 'index array assignment to compound variable in subshell not working'
+)
+[[ $z == "$val" ]] || err_exit 'compound variable changes after associative array assignment'
+
+x=(
+ foo=( qqq=abc rrr=def)
+ bar=( zzz=no rst=fed)
+)
+eval val="$x"
+(
+ unset x.foo
+ [[ ${x.foo.qqq} ]] && err_exit 'x.foo.qqq should be unset'
+ x.foo=good
+ [[ ${x.foo} == good ]] || err_exit 'x.foo should be good'
+)
+[[ $x == "$val" ]] || err_exit 'compound variable changes after unset leaves'
+unset l
+(
+ l=( a=1 b="BE" )
+)
+[[ ${l+foo} != foo ]] || err_exit 'l should be unset'
+
+Error_fd=9
+eval "exec $Error_fd>&2 2>/dev/null"
+
+TEST_notfound=notfound
+while whence $TEST_notfound >/dev/null 2>&1
+do TEST_notfound=notfound-$RANDOM
+done
+
+tmp=/tmp/kshsubsh$$
+trap "rm -f $tmp" EXIT
+integer BS=1024 nb=64 ss=60 bs no
+for bs in $BS 1
+do $SHELL -c '
+ {
+ sleep '$ss'
+ kill -KILL $$
+ } &
+ set -- $(printf %.'$(($BS*$nb))'c x | dd bs='$bs')
+ print ${#1}
+ kill $!
+ ' > $tmp 2>/dev/null
+ no=$(<$tmp)
+ (( no == (BS * nb) )) || err_exit "shell hangs on command substitution output size >= $BS*$nb with write size $bs -- expected $((BS*nb)), got ${no:-0}"
+done
+# this time with redirection on the trailing command
+for bs in $BS 1
+do $SHELL -c '
+ {
+ sleep 2
+ sleep '$ss'
+ kill -KILL $$
+ } &
+ set -- $(printf %.'$(($BS*$nb))'c x | dd bs='$bs' 2>/dev/null)
+ print ${#1}
+ kill $!
+ ' > $tmp 2>/dev/null
+ no=$(<$tmp)
+ (( no == (BS * nb) )) || err_exit "shell hangs on command substitution output size >= $BS*$nb with write size $bs and trailing redirection -- expected $((BS*nb)), got ${no:-0}"
+done
+
+# exercise command substitutuion trailing newline logic w.r.t. pipe vs. tmp file io
+
+set -- \
+ 'post-line print' \
+ '$TEST_unset; ($TEST_fork; print 1); print' \
+ 1 \
+ 'pre-line print' \
+ '$TEST_unset; ($TEST_fork; print); print 1' \
+ $'\n1' \
+ 'multiple pre-line print' \
+ '$TEST_unset; ($TEST_fork; print); print; ($TEST_fork; print 1); print' \
+ $'\n\n1' \
+ 'multiple post-line print' \
+ '$TEST_unset; ($TEST_fork; print 1); print; ($TEST_fork; print); print' \
+ 1 \
+ 'intermediate print' \
+ '$TEST_unset; ($TEST_fork; print 1); print; ($TEST_fork; print 2); print' \
+ $'1\n\n2' \
+ 'simple variable' \
+ '$TEST_unset; ($TEST_fork; l=2; print "$l"); print $l' \
+ 2 \
+ 'compound variable' \
+ '$TEST_unset; ($TEST_fork; l=(a=2 b="BE"); print "$l"); print $l' \
+ $'(\n\ta=2\n\tb=BE\n)' \
+
+export TEST_fork TEST_unset
+
+while (( $# >= 3 ))
+do txt=$1
+ cmd=$2
+ exp=$3
+ shift 3
+ for TEST_unset in '' 'unset var'
+ do for TEST_fork in '' 'ulimit -c 0'
+ do for TEST_shell in "eval" "$SHELL -c"
+ do if ! got=$($TEST_shell "$cmd")
+ then err_exit "${TEST_shell/*-c/\$SHELL -c} ${TEST_unset:+unset }${TEST_fork:+fork }$txt print failed"
+ elif [[ "$got" != "$exp" ]]
+ then EXP=$(printf %q "$exp")
+ GOT=$(printf %q "$got")
+ err_exit "${TEST_shell/*-c/\$SHELL -c} ${TEST_unset:+unset }${TEST_fork:+fork }$txt command substitution failed -- expected $EXP, got $GOT"
+ fi
+ done
+ done
+ done
+done
+
+r=$( ($SHELL -c '
+ {
+ sleep 32
+ kill -KILL $$
+ } &
+ for v in $(set | sed "s/=.*//")
+ do command unset $v
+ done
+ typeset -Z5 I
+ for ((I = 0; I < 1024; I++))
+ do eval A$I=1234567890
+ done
+ a=$(set 2>&1)
+ print ok
+ kill -KILL $!
+') 2>/dev/null)
+[[ $r == ok ]] || err_exit "large subshell command substitution hangs"
+
+for TEST_command in '' $TEST_notfound
+do for TEST_exec in '' 'exec'
+ do for TEST_fork in '' 'ulimit -c 0;'
+ do for TEST_redirect in '' '>/dev/null'
+ do for TEST_substitute in '' ': $'
+ do
+
+ TEST_test="$TEST_substitute($TEST_fork $TEST_exec $TEST_command $TEST_redirect)"
+ [[ $TEST_test == '('*([[:space:]])')' ]] && continue
+ r=$($SHELL -c '
+ {
+ sleep 2
+ kill -KILL $$
+ } &
+ '"$TEST_test"'
+ kill $!
+ print ok
+ ')
+ [[ $r == ok ]] || err_exit "shell hangs on $TEST_test"
+
+ done
+ done
+ done
+ done
+done
+
+exit $Errors
diff --git a/usr/src/lib/libshell/common/tests/substring.sh b/usr/src/lib/libshell/common/tests/substring.sh
index 2859d65671..8d283c6a29 100644
--- a/usr/src/lib/libshell/common/tests/substring.sh
+++ b/usr/src/lib/libshell/common/tests/substring.sh
@@ -1,10 +1,10 @@
########################################################################
# #
# This software is part of the ast package #
-# Copyright (c) 1982-2007 AT&T Knowledge Ventures #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
-# by AT&T Knowledge Ventures #
+# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# http://www.opensource.org/licenses/cpl1.0.txt #
@@ -166,6 +166,21 @@ x=[123]def
if [[ "${x//\[(*)\]/\{\1\}}" != {123}def ]]
then err_exit 'closing brace escape not working'
fi
+xx=%28text%29
+if [[ ${xx//%28/abc\)} != 'abc)text%29' ]]
+then err_exit '${xx//%28/abc\)} not working'
+fi
+xx='a:b'
+str='(){}[]*?|&^%$#@l'
+for ((i=0 ; i < ${#str}; i++))
+do [[ $(eval print -r -- \"\${xx//:/\\${str:i:1}}\") == "a${str:i:1}b" ]] || err_exit "substitution of \\${str:i:1}} failed"
+ [[ $(eval print -rn -- \"\${xx//:/\'${str:i:1}\'}\") == "a${str:i:1}b" ]] || err_exit "substitution of '${str:i:1}' failed"
+ [[ $(eval print -r -- \"\${xx//:/\"${str:i:1}\"}\") == "a${str:i:1}b" ]] || err_exit "substitution of \"${str:i:1}\" failed"
+done
+[[ ${xx//:/\\n} == 'a\nb' ]] || err_exit "substituion of \\\\n failed"
+[[ ${xx//:/'\n'} == 'a\nb' ]] || err_exit "substituion of '\\n' failed"
+[[ ${xx//:/"\n"} == 'a\nb' ]] || err_exit "substituion of \"\\n\" failed"
+[[ ${xx//:/$'\n'} == $'a\nb' ]] || err_exit "substituion of \$'\\n' failed"
unset foo
foo=one/two/three
if [[ ${foo//'/'/_} != one_two_three ]]
@@ -245,13 +260,6 @@ fi
if [[ ${var//+(\S)/Q} != 'Q Q' ]]
then err_exit '${var//+(\S)/Q} not workding'
fi
-if [[ "$(LC_ALL=debug $SHELL <<- \+EOF+
- x=a<2bc><3xyz>g
- print ${#x}
- +EOF+)" != 4
- ]]
-then err_exit '${#x} not working with multibyte locales'
-fi
foo='foo+bar+'
[[ $(print -r -- ${foo//+/'|'}) != 'foo|bar|' ]] && err_exit "\${foobar//+/'|'}"
[[ $(print -r -- ${foo//+/"|"}) != 'foo|bar|' ]] && err_exit '${foobar//+/"|"}'
@@ -270,6 +278,10 @@ unset a b
a='\[abc @(*) def\]'
b='[abc 123 def]'
[[ ${b//$a/\1} == 123 ]] || err_exit "\${var/pattern} not working with \[ in pattern"
+unset foo
+foo='(win32.i386) '
+[[ ${foo/'('/'(x11-'} == '(x11-win32.i386) ' ]] || err_exit "\${var/pattern} not working with ' in pattern"
+$SHELL -c $'v=\'$(hello)\'; [[ ${v//\'$(\'/-I\'$(\'} == -I"$v" ]]' 2> /dev/null || err_exit "\${var/pattern} not working with \$( as pattern"
unset X
$SHELL -c '[[ ! ${X[@]:0:300} ]]' 2> /dev/null || err_exit '${X[@]:0:300} with X undefined fails'
$SHELL -c '[[ ${@:0:300} == "$0" ]]' 2> /dev/null || err_exit '${@:0:300} with no arguments fails'
@@ -501,4 +513,56 @@ then LC_ALL=en_US.UTF-8 $SHELL -c b1=$'"\342\202\254\342\202\254\342\202\254\342
fi
{ $SHELL -c 'unset x;[[ ${SHELL:$x} == $SHELL ]]';} 2> /dev/null || err_exit '${var:$x} fails when x is not set'
{ $SHELL -c 'x=;[[ ${SHELL:$x} == $SHELL ]]';} 2> /dev/null || err_exit '${var:$x} fails when x is null'
+
+# subject mode pattern result #
+set -- \
+ 'a$z' 'E' '[$]|#' 'a($)z' \
+ 'a#z' 'E' '[$]|#' 'a(#)z' \
+ 'a$z' 'Elr' '[$]|#' 'a$z' \
+ 'a#z' 'Elr' '[$]|#' 'a#z' \
+ 'a$' 'E' '[$]|#' 'a($)' \
+ 'a#' 'E' '[$]|#' 'a(#)' \
+ 'a$' 'Elr' '[$]|#' 'a$' \
+ 'a#' 'Elr' '[$]|#' 'a#' \
+ '$z' 'E' '[$]|#' '($)z' \
+ '#z' 'E' '[$]|#' '(#)z' \
+ '$z' 'Elr' '[$]|#' '$z' \
+ '#z' 'Elr' '[$]|#' '#z' \
+ '$' 'E' '[$]|#' '($)' \
+ '#' 'E' '[$]|#' '(#)' \
+ '$' 'Elr' '[$]|#' '($)' \
+ '#' 'Elr' '[$]|#' '(#)' \
+ 'a$z' 'E' '\$|#' 'a$z()' \
+ 'a$z' 'E' '\\$|#' 'a$z' \
+ 'a$z' 'E' '\\\$|#' 'a($)z' \
+ 'a#z' 'E' '\\\$|#' 'a(#)z' \
+ 'a$z' 'Elr' '\\\$|#' 'a$z' \
+ 'a#z' 'Elr' '\\\$|#' 'a#z' \
+ 'a$' 'E' '\\\$|#' 'a($)' \
+ 'a#' 'E' '\\\$|#' 'a(#)' \
+ 'a$' 'Elr' '\\\$|#' 'a$' \
+ 'a#' 'Elr' '\\\$|#' 'a#' \
+ '$z' 'E' '\\\$|#' '($)z' \
+ '#z' 'E' '\\\$|#' '(#)z' \
+ '$z' 'Elr' '\\\$|#' '$z' \
+ '#z' 'Elr' '\\\$|#' '#z' \
+ '$' 'E' '\\\$|#' '($)' \
+ '#' 'E' '\\\$|#' '(#)' \
+ '$' 'Elr' '\\\$|#' '($)' \
+ '#' 'Elr' '\\\$|#' '(#)' \
+# do not delete this line #
+unset i o
+while (( $# >= 4 ))
+do i=$1
+ eval o="\${i/~($2)$3/\\(\\0\\)}"
+ if [[ "$o" != "$4" ]]
+ then err_exit "i='$1'; \${i/~($2)$3/\\(\\0\\)} failed -- expected '$4', got '$o'"
+ fi
+ eval o="\${i/~($2)($3)/\\(\\1\\)}"
+ if [[ "$o" != "$4" ]]
+ then err_exit "i='$1'; \${i/~($2)($3)/\\(\\1\\)} failed -- expected '$4', got '$o'"
+ fi
+ shift 4
+done
+
exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/sun_solaris_builtin_sum.sh b/usr/src/lib/libshell/common/tests/sun_solaris_builtin_sum.sh
new file mode 100644
index 0000000000..d2dc6db883
--- /dev/null
+++ b/usr/src/lib/libshell/common/tests/sun_solaris_builtin_sum.sh
@@ -0,0 +1,108 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Test whether the ksh93/libcmd sum builtin is compatible to
+# Solaris/SystemV /usr/bin/sum
+#
+
+function err_exit
+{
+ print -u2 -n "\t"
+ print -u2 -r ${Command}[$1]: "${@:2}"
+ (( Errors++ ))
+}
+alias err_exit='err_exit $LINENO'
+
+Command=${0##*/}
+integer Errors=0
+
+typeset x
+
+builtin sum || err_exit "sum builtin not found"
+
+# Basic tests
+x="$(print 'hello' | /usr/bin/sum)" || err_exit "/usr/bin/sum pipe failed."
+[[ "$x" == "542 1" ]] || err_exit "print 'hello' | /usr/bin/sum did not return 542 1, got $x"
+x="$(print 'hello' | sum)" || err_exit "sum builtin pipe failed."
+[[ "$x" == "542 1" ]] || err_exit "print 'hello' | sum builtin did not return 542 1, got $x"
+x="$(print 'hello' | sum -x md5)" || err_exit "sum md5 builtin pipe failed."
+[[ "$x" == "b1946ac92492d2347c6235b4d2611184" ]] || err_exit "print 'hello' | sum md5 builtin did not return b1946ac92492d2347c6235b4d2611184, got $x"
+x="$(print 'hello' | sum -x sha1)" || err_exit "sum sha1 builtin pipe failed."
+[[ "$x" == "f572d396fae9206628714fb2ce00f72e94f2258f" ]] || err_exit "print 'hello' | sum sha1 builtin did not return f572d396fae9206628714fb2ce00f72e94f2258f, got $x"
+x="$(print 'hello' | sum -x sha256)" || err_exit "sum sha256 builtin pipe failed."
+[[ "$x" == "5891b5b522d5df086d0ff0b110fbd9d21bb4fc7163af34d08286a2e846f6be03" ]] || err_exit "print 'hello' | sum sha256 builtin did not return 5891b5b522d5df086d0ff0b110fbd9d21bb4fc7163af34d08286a2e846f6be03, got $x"
+x="$(print 'hello' | sum -x sha512)" || err_exit "sum sha512 builtin pipe failed."
+[[ "$x" == "e7c22b994c59d9cf2b48e549b1e24666636045930d3da7c1acb299d1c3b7f931f94aae41edda2c2b207a36e10f8bcb8d45223e54878f5b316e7ce3b6bc019629" ]] || err_exit "print 'hello' | sum sha512 builtin did not return e7c22b994c59d9cf2b48e549b1e24666636045930d3da7c1acb299d1c3b7f931f94aae41edda2c2b207a36e10f8bcb8d45223e54878f5b316e7ce3b6bc019629, got $x"
+# note that Solaris /usr/bin/cksum outputs $'3015617425\t6' (which may be a bug in Solaris /usr/bin/cksum)
+x="$(print 'hello' | sum -x cksum)" || err_exit "sum cksum builtin pipe failed."
+[[ "$x" == $'3015617425 6' ]] || err_exit "print 'hello' | sum cksum builtin did not return \$'3015617425 6', got $(printf "%q\n" "$x")"
+
+[[ "$(print 'hello' | /usr/bin/sum)" == "$(print 'hello' | sum)" ]] || err_exit "sum hello != /usr/bin/sum hello"
+[[ "$(print 'fish' | /usr/bin/sum)" == "$(print 'fish' | sum)" ]] || err_exit "sum fish != /usr/bin/sum fish"
+[[ "$(print '12345' | /usr/bin/sum)" == "$(print '12345' | sum)" ]] || err_exit "sum 12345 != /usr/bin/sum 12345"
+[[ "$(print '\n\r\n \v' | /usr/bin/sum)" == "$(print '\n\r\n \v' | sum)" ]] || err_exit "sum spaces != /usr/bin/sum spaces"
+
+# Test some binary files...
+x="/usr/bin/ls"
+[[ "$(cat "$x" | /usr/bin/sum)" == "$(cat "$x" | sum)" ]] || err_exit "pipe: /usr/bin/sum $x != sum $x"
+[[ "$(/usr/bin/sum "$x")" == "$(sum "$x")" ]] || err_exit "file: /usr/bin/sum $x != sum $x"
+
+x="/usr/bin/chmod"
+[[ "$(cat "$x" | /usr/bin/sum)" == "$(cat "$x" | sum)" ]] || err_exit "pipe: /usr/bin/sum $x != sum $x"
+[[ "$(/usr/bin/sum "$x")" == "$(sum "$x")" ]] || err_exit "file: /usr/bin/sum $x != sum $x"
+
+x="/usr/bin/tee"
+[[ "$(cat "$x" | /usr/bin/sum)" == "$(cat "$x" | sum)" ]] || err_exit "pipe: /usr/bin/sum $x != sum $x"
+[[ "$(/usr/bin/sum "$x")" == "$(sum "$x")" ]] || err_exit "file: /usr/bin/sum $x != sum $x"
+
+x="/usr/bin/grep"
+[[ "$(cat "$x" | /usr/bin/sum)" == "$(cat "$x" | sum)" ]] || err_exit "pipe: /usr/bin/sum $x != sum $x"
+[[ "$(/usr/bin/sum "$x")" == "$(sum "$x")" ]] || err_exit "file: /usr/bin/sum $x != sum $x"
+
+x="/usr/bin/egrep"
+[[ "$(cat "$x" | /usr/bin/sum)" == "$(cat "$x" | sum)" ]] || err_exit "pipe: /usr/bin/sum $x != sum $x"
+[[ "$(/usr/bin/sum "$x")" == "$(sum "$x")" ]] || err_exit "file: /usr/bin/sum $x != sum $x"
+
+x="/usr/bin/awk"
+[[ "$(cat "$x" | /usr/bin/sum)" == "$(cat "$x" | sum)" ]] || err_exit "pipe: /usr/bin/sum $x != sum $x"
+[[ "$(/usr/bin/sum "$x")" == "$(sum "$x")" ]] || err_exit "file: /usr/bin/sum $x != sum $x"
+
+x="/usr/bin/nawk"
+[[ "$(cat "$x" | /usr/bin/sum)" == "$(cat "$x" | sum)" ]] || err_exit "pipe: /usr/bin/sum $x != sum $x"
+[[ "$(/usr/bin/sum "$x")" == "$(sum "$x")" ]] || err_exit "file: /usr/bin/sum $x != sum $x"
+
+x="/usr/bin/ksh"
+[[ "$(cat "$x" | /usr/bin/sum)" == "$(cat "$x" | sum)" ]] || err_exit "pipe: /usr/bin/sum $x != sum $x"
+[[ "$(/usr/bin/sum "$x")" == "$(sum "$x")" ]] || err_exit "file: /usr/bin/sum $x != sum $x"
+
+x="/usr/bin/sh"
+[[ "$(cat "$x" | /usr/bin/sum)" == "$(cat "$x" | sum)" ]] || err_exit "pipe: /usr/bin/sum $x != sum $x"
+[[ "$(/usr/bin/sum "$x")" == "$(sum "$x")" ]] || err_exit "file: /usr/bin/sum $x != sum $x"
+
+
+# tests done
+exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/sun_solaris_compoundvario.sh b/usr/src/lib/libshell/common/tests/sun_solaris_compoundvario.sh
new file mode 100644
index 0000000000..18aed2aa7a
--- /dev/null
+++ b/usr/src/lib/libshell/common/tests/sun_solaris_compoundvario.sh
@@ -0,0 +1,251 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+function err_exit
+{
+ print -u2 -n "\t"
+ print -u2 -r ${Command}[$1]: "${@:2}"
+ (( Errors+=1 ))
+}
+
+alias err_exit='err_exit $LINENO'
+
+typeset -C bracketstat=(
+ integer bopen=0
+ integer bclose=0
+)
+
+function count_brackets
+{
+ typeset x="$1"
+ typeset c
+
+ integer i
+ (( bracketstat.bopen=0 , bracketstat.bclose=0 ))
+
+ for (( i=0 ; i < ${#x} ; i++ )) ; do
+ c="${x:i:1}"
+ [[ "$c" == "(" ]] && (( bracketstat.bopen++ ))
+ [[ "$c" == ")" ]] && (( bracketstat.bclose++ ))
+ done
+
+ (( bracketstat.bopen != bracketstat.bclose )) && return 1
+
+ return 0
+}
+
+integer Errors=0
+
+typeset s
+
+# Test 1:
+# Check whether "read -C" leaves the file pointer at the next line
+# (and does not read beyond that point).
+# Data layout is:
+# -- snip --
+# <compound var>
+# hello
+# -- snip --
+# (additionally we test some extra stuff like bracket count)
+s=${
+ typeset -C x=(
+ a=1 b=2
+ typeset -a myarray=( 1 2 3 4 5 6 7 8 9 10 )
+ typeset -A myarray2=( [a]=1 [b]=2 ["c d"]=3 [e]=4 ["f"]=5 [g]=6 [h]=7 [i]=8 [j]=9 [k]=10 )
+ typeset -A myarray3=(
+ [a]=(
+ float m1=0.5
+ float m2=0.6
+ foo="hello"
+ )
+ [b]=(
+ foo="bar"
+ )
+ ["c d"]=(
+ integer at=90
+ )
+ [e]=(
+ typeset -C nested_cpv=(
+ typeset -a myarray=( 1 2 3 4 5 6 7 8 9 10 )
+ typeset str=$'a \'string'
+ )
+ )
+ [f]=(
+ typeset g="f"
+ )
+ )
+ )
+
+ {
+ printf "%B\n" x
+ print "hello"
+ } | {
+ read -C y
+ read s
+ }
+ print "x${s}x"
+} || err_exit "test returned exit code $?"
+
+[[ "${s}" == "xhellox" ]] || err_exit "Expected 'xhellox', got ${s}"
+count_brackets "$y" || err_exit "y: bracket open ${bracketstat.bopen} != bracket close ${bracketstat.bclose}"
+
+# cleanup
+unset x y || err_exit "unset failed"
+[[ "$x" == "" ]] || err_exit "cleanup failed for x"
+[[ "$y" == "" ]] || err_exit "cleanup failed for y"
+
+
+# Test 2:
+# Same as test 1 except one more compound var following the "hello"
+# line.
+# Data layout is:
+# -- snip --
+# <compound var>
+# hello
+# <compound var>
+# -- snip --
+s=${
+ typeset -C x=(
+ a=1 b=2
+ typeset -a myarray=( 1 2 3 4 5 6 7 8 9 10 )
+ typeset -A myarray2=( [a]=1 [b]=2 ["c d"]=3 [e]=4 ["f"]=5 [g]=6 [h]=7 [i]=8 [j]=9 [k]=10 )
+ typeset -A myarray3=(
+ [a]=(
+ float m1=0.5
+ float m2=0.6
+ foo="hello"
+ )
+ [b]=(
+ foo="bar"
+ )
+ ["c d"]=(
+ integer at=90
+ )
+ [e]=(
+ typeset -C nested_cpv=(
+ typeset -a myarray=( 1 2 3 4 5 6 7 8 9 10 )
+ typeset str=$'a \'string'
+ )
+ )
+ [f]=(
+ typeset g="f"
+ )
+ )
+ )
+
+ {
+ printf "%B\n" x
+ print "hello"
+ printf "%B\n" x
+ } | {
+ read -C y1
+ read s
+ read -C y2
+ }
+
+ print "x${s}x"
+} || err_exit "test returned exit code $?"
+
+[[ "${s}" == "xhellox" ]] || err_exit "Expected 'xhellox', got ${s}."
+[[ "$y1" != "" ]] || err_exit "y1 is empty"
+[[ "$y2" != "" ]] || err_exit "y2 is empty"
+count_brackets "$y1" || err_exit "y1: bracket open ${bracketstat.bopen} != bracket close ${bracketstat.bclose}"
+count_brackets "$y2" || err_exit "y2: bracket open ${bracketstat.bopen} != bracket close ${bracketstat.bclose}"
+[[ "$y1" == "$y2" ]] || err_exit "Expected $(printf "%q\n" "${y1}") == $(printf "%q\n" "${y2}")."
+[[ "$x" == "$y1" ]] || err_exit "Expected $(printf "%q\n" "${x}") == $(printf "%q\n" "${y}")."
+
+# cleanup
+unset x y1 y2 || err_exit "unset failed"
+[[ "$x" == "" ]] || err_exit "cleanup failed for x"
+[[ "$y1" == "" ]] || err_exit "cleanup failed for y1"
+[[ "$y2" == "" ]] || err_exit "cleanup failed for y2"
+
+
+# Test 3: Test compound variable copy operator vs. "read -C"
+typeset -C x=(
+ a=1 b=2
+ typeset -a myarray=( 1 2 3 4 5 6 7 8 9 10 )
+ typeset -A myarray2=( [a]=1 [b]=2 ["c d"]=3 [e]=4 ["f"]=5 [g]=6 [h]=7 [i]=8 [j]=9 [k]=10 )
+ typeset -A myarray3=(
+ [a]=(
+ float m1=0.5
+ float m2=0.6
+ foo="hello"
+ )
+ [b]=(
+ foo="bar"
+ )
+ ["c d"]=(
+ integer at=90
+ )
+ [e]=(
+ typeset -C nested_cpv=(
+ typeset -a myarray=( 1 2 3 4 5 6 7 8 9 10 )
+ typeset str=$'a \'string'
+ )
+ )
+ [f]=(
+ typeset g="f"
+ )
+ )
+)
+
+typeset -C x_copy=x || err_exit "x_copy copy failed"
+[[ "${x_copy}" != "" ]] || err_exit "x_copy should not be empty"
+count_brackets "${x_copy}" || err_exit "x_copy: bracket open ${bracketstat.bopen} != bracket close ${bracketstat.bclose}"
+
+typeset -C nested_cpv_copy
+
+nested_cpv_copy=x.myarray3[e].nested_cpv || err_exit "x.myarray3[e].nested_cpv copy failed"
+
+# unset branch "x.myarray3[e].nested_cpv" of the variable tree "x" ...
+unset x.myarray3[e].nested_cpv || err_exit "unset x.myarray3[e].nested_cpv failed"
+[[ "${x.myarray3[e].nested_cpv}" == "" ]] || err_exit "x.myarray3[e].nested_cpv still has a value"
+
+# ... and restore it from the saved copy
+printf "%B\n" nested_cpv_copy | read -C x.myarray3[e].nested_cpv || err_exit "read failed"
+
+# compare copy of the original tree and the modified one
+[[ "${x}" == "${x_copy}" ]] || err_exit "x != x_copy"
+count_brackets "${x}" || err_exit "x: bracket open ${bracketstat.bopen} != bracket close ${bracketstat.bclose}"
+
+# cleanup
+unset x x_copy nested_cpv_copy || err_exit "unset failed"
+
+
+# Test 4: Test "read -C" failure for missing bracket at the end
+typeset s
+s=$($SHELL -c 'typeset -C myvar ; print "( unfinished=1" | read -C myvar 2>/dev/null || print "error $?"') || err_exit "shell failed"
+[[ "$s" == "error 3" ]] || err_exit "compound_read: expected error 3, got ${s}"
+
+
+# Test 5: Test "read -C" failure for missing bracket at the beginning
+typeset s
+s=$($SHELL -c 'typeset -C myvar ; print " unfinished=1 )" | read -C myvar 2>/dev/null || print "error $?"') || err_exit "shell failed"
+[[ "$s" == "error 3" ]] || err_exit "compound_read: expected error 3, got ${s}"
+
+# tests done
+exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/sun_solaris_cr_6687139_command_substitution_exec_redirection_allocation_loop.sh b/usr/src/lib/libshell/common/tests/sun_solaris_cr_6687139_command_substitution_exec_redirection_allocation_loop.sh
new file mode 100644
index 0000000000..335470aa79
--- /dev/null
+++ b/usr/src/lib/libshell/common/tests/sun_solaris_cr_6687139_command_substitution_exec_redirection_allocation_loop.sh
@@ -0,0 +1,212 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# This test checks whether the issue described in CR #6687139
+# ("command substitution, exec, and stdout redirection cause
+# allocation loop") has been fixed:
+# -- snip --
+# The following one-liner (including back ticks) causes ksh93 to spin
+# out of control consuming all memory at a *very* rapid pace:
+#
+# `exec program > file`
+#
+# If "file" is a real file (as opposed to /dev/null), the file will
+# also grow without bound. "program" need not exist, i.e.
+#
+# `exec > file`
+#
+# has the same result. Using $() instead of `` also has the same
+# effect.
+#
+# This works fine under all other bourne-compatible shells.
+# -- snip --
+#
+
+function err_exit
+{
+ print -u2 -n "\t"
+ print -u2 -r ${Command}[$1]: "${@:2}"
+ (( Errors++ ))
+}
+alias err_exit='err_exit $LINENO'
+
+function isvalidpid
+{
+ kill -0 ${1} 2>/dev/null && return 0
+ return 1
+}
+
+Command=${0##*/}
+integer Errors=0
+
+integer childpid
+typeset testdir
+integer childretval
+
+testdir="/tmp/sun_solaris_cr_6687139_pid$$_${PPID}"
+mkdir -p "${testdir}" || err_exit "Cannot create test dirctory"
+cd "${testdir}" || { err_exit "Cannot cd to test dirctory" ; exit $Errors ; }
+
+##############################################################################
+##
+## test variant 1a: Use command substitution $( ... )
+##
+
+# Run testcase with "nice" to make sure a "runaway" process can
+# still be caught&&terminated by the current shell
+nice -n 10 ${SHELL} -c 'touch z ; $(exec nosuchprogram_for_cr_6687139 > z) ; rm z' 2>/dev/null &
+childpid=$!
+
+sleep 5
+
+if isvalidpid ${childpid} ; then
+ # First _stop_, then log error since the child may eat up memory
+ # VERY VERY quickly
+ kill -STOP ${childpid}
+
+ err_exit "Child still active after 5 seconds (hang ?)"
+
+ # Get sample stack trace
+ pstack ${childpid}
+ kill -KILL ${childpid}
+fi
+
+# collect child's return status
+wait ${childpid}
+childretval=$?
+
+(( childretval == 0 )) || err_exit "Child returned non-zero exit code ${childretval}."
+
+[[ ! -f "z" ]] || { rm "z" ; err_exit "Child did not remove test file" ; }
+
+
+##############################################################################
+##
+## test variant 1b: Same as test 1a but forces the shell to |fork()| for the
+## subshell
+##
+
+# Run testcase with "nice" to make sure a "runaway" process can
+# still be caught&&terminated by the current shell
+nice -n 10 ${SHELL} -c 'touch z ; $(ulimit -c 0 ; exec nosuchprogram_for_cr_6687139 > z) ; rm z' 2>/dev/null &
+childpid=$!
+
+sleep 5
+
+if isvalidpid ${childpid} ; then
+ # First _stop_, then log error since the child may eat up memory
+ # VERY VERY quickly
+ kill -STOP ${childpid}
+
+ err_exit "Child still active after 5 seconds (hang ?)"
+
+ # Get sample stack trace
+ pstack ${childpid}
+ kill -KILL ${childpid}
+fi
+
+# collect child's return status
+wait ${childpid}
+childretval=$?
+
+(( childretval == 0 )) || err_exit "Child returned non-zero exit code ${childretval}."
+
+[[ ! -f "z" ]] || { rm "z" ; err_exit "Child did not remove test file" ; }
+
+
+##############################################################################
+##
+## test variant 2a: Use plain subshell ( ... )
+##
+
+# Run testcase with "nice" to make sure a "runaway" process can
+# still be caught&&terminated by the current shell
+nice -n 10 ${SHELL} -c 'touch z ; (exec nosuchprogram_for_cr_6687139 > z) ; rm z' 2>/dev/null &
+childpid=$!
+
+sleep 5
+
+if isvalidpid ${childpid} ; then
+ # First _stop_, then log error since the child may eat up memory
+ # VERY VERY quickly
+ kill -STOP ${childpid}
+
+ err_exit "Child still active after 5 seconds (hang ?)"
+
+ # Get sample stack trace
+ pstack ${childpid}
+ kill -KILL ${childpid}
+fi
+
+# collect child's return status
+wait ${childpid}
+childretval=$?
+
+(( childretval == 0 )) || err_exit "Child returned non-zero exit code ${childretval}."
+
+[[ ! -f "z" ]] || { rm "z" ; err_exit "Child did not remove test file" ; }
+
+
+##############################################################################
+##
+## test variant 2b: Same as test 2a but forces the shell to |fork()| for the
+## subshell
+##
+
+# Run testcase with "nice" to make sure a "runaway" process can
+# still be caught&&terminated by the current shell
+nice -n 10 ${SHELL} -c 'touch z ; (ulimit -c 0 ; exec nosuchprogram_for_cr_6687139 > z) ; rm z' 2>/dev/null &
+childpid=$!
+
+sleep 5
+
+if isvalidpid ${childpid} ; then
+ # First _stop_, then log error since the child may eat up memory
+ # VERY VERY quickly
+ kill -STOP ${childpid}
+
+ err_exit "Child still active after 5 seconds (hang ?)"
+
+ # Get sample stack trace
+ pstack ${childpid}
+ kill -KILL ${childpid}
+fi
+
+# collect child's return status
+wait ${childpid}
+childretval=$?
+
+(( childretval == 0 )) || err_exit "Child returned non-zero exit code ${childretval}."
+
+[[ ! -f "z" ]] || { rm "z" ; err_exit "Child did not remove test file" ; }
+
+# tests done, remove temporary test subdir
+cd /tmp
+rmdir "${testdir}" || err_exit "Could not remove temporary test directory ${testdir}"
+
+# tests done
+exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/sun_solaris_cr_6713682_compound_var_bleeds_through_subshell.sh b/usr/src/lib/libshell/common/tests/sun_solaris_cr_6713682_compound_var_bleeds_through_subshell.sh
new file mode 100644
index 0000000000..4f03984951
--- /dev/null
+++ b/usr/src/lib/libshell/common/tests/sun_solaris_cr_6713682_compound_var_bleeds_through_subshell.sh
@@ -0,0 +1,108 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Test whether CR #6713682 has been fixed.
+#
+# Creating a compound variable in s subshell "bleeds through" to the calling subshell in some conditions.
+# Example:
+# -- snip --
+# $ ksh93 -c 'unset l ; ( l=( a=1 b="BE" ) ; print "$l" ) ; print $l'
+# (
+# a=1
+# b=BE
+# )
+# ( )
+# -- snip --
+# The first bracket pair is Ok since it's coming from $ print "$l" # , however the 2nd pair comes from the print $l _outside_ the subshell where the variable "l" should no longer exist.
+#
+# Workaround:
+# Force ksh93 to call |fork()| for the matching subshell using $ ulimit -c #, e.g. ...
+# -- snip --
+# $ ksh93 -c 'unset l ; ( ulimit -c 0 ; l=( a=1 b="BE" ) ; print "$l" ) ; print $l'
+# (
+# a=1
+# b=BE
+# )
+# -- snip --
+# ... provides the correct output.
+#
+
+function err_exit
+{
+ print -u2 -n "\t"
+ print -u2 -r ${Command}[$1]: "${@:2}"
+ (( Errors+=1 ))
+}
+
+alias err_exit='err_exit $LINENO'
+
+integer Errors=0
+
+typeset var1 var2
+
+# use unset, l=() compound syntax and print
+var1="$(${SHELL} -c 'unset l ; ( l=( a=1 b="BE" ) ; print "$l" ) ; print $l')" || err_exit "Non-zero exit code."
+var2="$(${SHELL} -c 'unset l ; ( ulimit -c 0 ; l=( a=1 b="BE" ) ; print "$l" ) ; print $l')" || err_exit "Non-zero exit code."
+[[ "${var1}" == "${var2}" ]] || err_exit "Non-fork()'ed subshell output differes from fork()'ed subshell output (with unset)."
+
+# do not use unset, l=() compound syntax and print
+var1="$(${SHELL} -c '( l=( a=1 b="BE" ) ; print "$l" ) ; print $l')" || err_exit "Non-zero exit code."
+var2="$(${SHELL} -c '( ulimit -c 0 ; l=( a=1 b="BE" ) ; print "$l" ) ; print $l')" || err_exit "Non-zero exit code."
+[[ "${var1}" == "${var2}" ]] || err_exit "Non-fork()'ed subshell output differes from fork()'ed subshell output (without unset)."
+
+# use unset, typeset -C compound syntax and print
+var1="$(${SHELL} -c 'unset l ; ( typeset -C l ; l.a=1 ; l.b="BE" ; print "$l" ) ; print $l')" || err_exit "Non-zero exit code."
+var2="$(${SHELL} -c 'unset l ; ( ulimit -c 0 ; typeset -C l ; l.a=1 ; l.b="BE" ; print "$l" ) ; print $l')" || err_exit "Non-zero exit code."
+[[ "${var1}" == "${var2}" ]] || err_exit "Non-fork()'ed subshell output differes from fork()'ed subshell output (with unset)."
+
+# do not use unset, typeset -C compound syntax and print
+var1="$(${SHELL} -c '( typeset -C l ; l.a=1 ; l.b="BE" ; print "$l" ) ; print $l')" || err_exit "Non-zero exit code."
+var2="$(${SHELL} -c '( ulimit -c 0 ; typeset -C l ; l.a=1 ; l.b="BE" ; print "$l" ) ; print $l')" || err_exit "Non-zero exit code."
+[[ "${var1}" == "${var2}" ]] || err_exit "Non-fork()'ed subshell output differes from fork()'ed subshell output (with unset)."
+
+# use unset, l=() compound syntax and printf "%B\n"
+var1="$(${SHELL} -c 'unset l ; ( l=( a=1 b="BE" ) ; printf "%B\n" l ) ; printf "%B\n" l')" || err_exit "Non-zero exit code."
+var2="$(${SHELL} -c 'unset l ; ( ulimit -c 0 ; l=( a=1 b="BE" ) ; printf "%B\n" l ) ; printf "%B\n" l')" || err_exit "Non-zero exit code."
+[[ "${var1}" == "${var2}" ]] || err_exit "Non-fork()'ed subshell output differes from fork()'ed subshell output (with unset)."
+
+# do not use unset, l=() compound syntax and printf "%B\n"
+var1="$(${SHELL} -c '( l=( a=1 b="BE" ) ; printf "%B\n" l) ; printf "%B\n" l')" || err_exit "Non-zero exit code."
+var2="$(${SHELL} -c '( ulimit -c 0 ; l=( a=1 b="BE" ) ; printf "%B\n" l) ; printf "%B\n" l')" || err_exit "Non-zero exit code."
+[[ "${var1}" == "${var2}" ]] || err_exit "Non-fork()'ed subshell output differes from fork()'ed subshell output (without unset)."
+
+# use unset, typeset -C compound syntax and printf "%B\n"
+var1="$(${SHELL} -c 'unset l ; ( typeset -C l ; l.a=1 ; l.b="BE" ; printf "%B\n" l) ; printf "%B\n" l')" || err_exit "Non-zero exit code."
+var2="$(${SHELL} -c 'unset l ; ( ulimit -c 0 ; typeset -C l ; l.a=1 ; l.b="BE" ; printf "%B\n" l) ; printf "%B\n" l')" || err_exit "Non-zero exit code."
+[[ "${var1}" == "${var2}" ]] || err_exit "Non-fork()'ed subshell output differes from fork()'ed subshell output (with unset)."
+
+# do not use unset, typeset -C compound syntax and printf "%B\n"
+var1="$(${SHELL} -c '( typeset -C l ; l.a=1 ; l.b="BE" ; printf "%B\n" l) ; printf "%B\n" l')" || err_exit "Non-zero exit code."
+var2="$(${SHELL} -c '( ulimit -c 0 ; typeset -C l ; l.a=1 ; l.b="BE" ; printf "%B\n" l) ; printf "%B\n" l')" || err_exit "Non-zero exit code."
+[[ "${var1}" == "${var2}" ]] || err_exit "Non-fork()'ed subshell output differes from fork()'ed subshell output (with unset)."
+
+# tests done
+exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/sun_solaris_cr_6722134_background_CHLD_trap.sh b/usr/src/lib/libshell/common/tests/sun_solaris_cr_6722134_background_CHLD_trap.sh
new file mode 100644
index 0000000000..333f5cc1a0
--- /dev/null
+++ b/usr/src/lib/libshell/common/tests/sun_solaris_cr_6722134_background_CHLD_trap.sh
@@ -0,0 +1,119 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# This test checks whether ksh93 (like ksh88) generates calls a
+# CHLD/SIGCHLD trap for background jobs and _not_ for foreground jobs.
+#
+# This was reported as CR #6722134 ("*ksh93* (20080624_snapshot)
+# doesn't execute CHLD trap"):
+# -- snip --
+# With "set -o monitor" on and "set -o notify" off, ksh88 executes the CHLD
+# trap while waiting for interactive input when a background job completes.
+# ksh93 appears not to execute the CHLD trap when a background job terminates.
+# Probably related: I noticed that with no CHLD trap set, but -o monitor and
+# -o notify set, there should be a similar asynchronous job completion notice.
+# It works in ksh88 but not in this ksh93 build.
+# -- snip --
+#
+
+function err_exit
+{
+ print -u2 -n "\t"
+ print -u2 -r ${Command}[$1]: "${@:2}"
+ (( Errors+=1 ))
+}
+
+alias err_exit='err_exit $LINENO'
+
+integer Errors=0
+
+##
+## test one:
+##
+s="$($SHELL -c '
+set -o errexit
+integer i
+
+trap "print got_child" SIGCHLD
+
+sleep 5 &
+sleep 7 &
+for ((i=0 ; i < 15 ; i++)) ; do
+ print $i
+ sleep 1
+
+ # external, non-background command for which a SIGCHLD should
+ # _not_ be fired
+ /bin/true >/dev/null
+done
+print "loop finished"
+wait
+print "done"
+' 2>&1 )" || err_exit "test loop failed."
+
+[[ "$s" == ~(Er)$'14\nloop finished\ndone' ]] || err_exit "Expected '14\nloop finished\ndone' at the end of the output, got ${s}."
+[[ "$s" == ~(El)$'0\n1\n2' ]] || err_exit "Expected '0\n1\n2' as at the beginning of the output, got ${s}."
+
+integer count
+(( count=$(fgrep "got_child" <<< "$s" | wc -l) )) || err_exit "counting failed."
+(( count == 2 )) || err_exit "Expected count==2, got count==${count}."
+
+
+##
+## test two:
+## (same as test "one" except that this test has one more "sleep" child)
+##
+s="$($SHELL -c '
+set -o errexit
+integer i
+
+trap "print got_child" SIGCHLD
+
+sleep 5 &
+sleep 7 &
+sleep 9 &
+for ((i=0 ; i < 15 ; i++)) ; do
+ print $i
+ sleep 1
+
+ # external, non-background command for which a SIGCHLD should
+ # _not_ be fired
+ /bin/true >/dev/null
+done
+print "loop finished"
+wait
+print "done"
+' 2>&1 )" || err_exit "test loop failed."
+
+[[ "$s" == ~(Er)$'14\nloop finished\ndone' ]] || err_exit "Expected '14\nloop finished\ndone' at the end of the output, got ${s}."
+[[ "$s" == ~(El)$'0\n1\n2' ]] || err_exit "Expected '0\n1\n2' as at the beginning of the output, got ${s}."
+
+(( count=$(fgrep "got_child" <<< "$s" | wc -l) )) || err_exit "counting failed."
+(( count == 3 )) || err_exit "Expected count==3, got count==${count}."
+
+# tests done
+exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/sun_solaris_cr_6753538_subshell_leaks_umask.sh b/usr/src/lib/libshell/common/tests/sun_solaris_cr_6753538_subshell_leaks_umask.sh
new file mode 100644
index 0000000000..c755f86c87
--- /dev/null
+++ b/usr/src/lib/libshell/common/tests/sun_solaris_cr_6753538_subshell_leaks_umask.sh
@@ -0,0 +1,97 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Test whether CR #6753538 ("umask modification leaks out of a ksh93
+# subshell") has been fixed.
+#
+# Quote from CR #6753538:
+# -- snip --
+# I discovered that Solaris 11's /bin/sh exhibits the following
+# surprising behavior:
+#
+# $ /bin/sh -c 'umask 22; (umask 0); umask'
+# 0000
+#
+# All other shells I tried print 22.
+# -- snip --
+
+
+function err_exit
+{
+ print -u2 -n "\t"
+ print -u2 -r ${Command}[$1]: "${@:2}"
+ (( Errors+=1 ))
+}
+
+alias err_exit='err_exit $LINENO'
+
+integer Errors=0
+
+#
+# test set 1: Simple umask in subshell
+#
+x=$(${SHELL} -c 'umask 22; (umask 0); umask')
+[[ "$x" == "0022" ]] || err_exit "expected umask 0022, got $x"
+
+x=$(${SHELL} -c 'umask 20; (umask 0); umask')
+[[ "$x" == "0020" ]] || err_exit "expected umask 0020, got $x"
+
+x=$(${SHELL} -c 'umask 0; (umask 22); umask')
+[[ "$x" == "0000" ]] || err_exit "expected umask 0000, got $x"
+
+
+#
+# test set 2: Simple umask in two subshells
+#
+x=$(${SHELL} -c 'umask 22; ( (umask 10); umask 0); umask')
+[[ "$x" == "0022" ]] || err_exit "expected umask 0022, got $x"
+
+x=$(${SHELL} -c 'umask 20; ( (umask 10); umask 0); umask')
+[[ "$x" == "0020" ]] || err_exit "expected umas k 0020, got $x"
+
+x=$(${SHELL} -c 'umask 0; ( (umask 10); umask 22); umask')
+[[ "$x" == "0000" ]] || err_exit "expected umask 0000, got $x"
+
+
+#
+# test set 3: Compare normal subshell vs. subshell in seperate process
+# ($ ulimit -c 0 # forced the subshell to |fork()|
+#
+x=$(${SHELL} -c 'umask 22; ( umask 0); umask') || err_exit "shell failed."
+y=$(${SHELL} -c 'umask 22; (ulimit -c 0 ; umask 0); umask') || err_exit "shell failed."
+[[ "$x" == "$y" ]] || err_exit "$x != $y"
+
+x=$(${SHELL} -c 'umask 20; ( umask 0); umask') || err_exit "shell failed."
+y=$(${SHELL} -c 'umask 20; (ulimit -c 0 ; umask 0); umask') || err_exit "shell failed."
+[[ "$x" == "$y" ]] || err_exit "$x != $y"
+
+x=$(${SHELL} -c 'umask 0; ( umask 20); umask') || err_exit "shell failed."
+y=$(${SHELL} -c 'umask 0; (ulimit -c 0 ; umask 20); umask') || err_exit "shell failed."
+[[ "$x" == "$y" ]] || err_exit "$x != $y"
+
+# tests done
+exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/sun_solaris_cr_6754020_weird_square_bracket_expansion.sh b/usr/src/lib/libshell/common/tests/sun_solaris_cr_6754020_weird_square_bracket_expansion.sh
new file mode 100644
index 0000000000..d4bd345833
--- /dev/null
+++ b/usr/src/lib/libshell/common/tests/sun_solaris_cr_6754020_weird_square_bracket_expansion.sh
@@ -0,0 +1,78 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Test whether CR #6754020 ("ksh93 does weird '[' expansion") has
+# been fixed.
+#
+# Quote from CR #6754020:
+# ---- snip ----
+# The problem is that subprocess uses /bin/sh as the shell when it
+# spins off the process. As Brad demonstrated:
+# /bin/sh -c 'echo F[[O]'
+# F[[O][
+#
+# In short, this bug only appears when run through the test suite,
+# or by people running /bin/sh who don't understand how their shell
+# treats special characters.
+# -- snip --
+#
+# In this case ksh93 has a bug which causes "F[[O]" to be expanded
+# in a wrong way.
+# ---- snip ----
+
+
+function err_exit
+{
+ print -u2 -n "\t"
+ print -u2 -r ${Command}[$1]: "${@:2}"
+ (( Errors+=1 ))
+}
+
+alias err_exit='err_exit $LINENO'
+
+integer Errors=0
+
+typeset s
+
+# test using "echo"
+s="$(${SHELL} -c 'echo F[[O]')"
+[[ "$s" == 'F[[O]' ]] || err_exit "Expected 'F[[O]', got $s"
+
+s="$(${SHELL} -c 'echo F[[[O]]')"
+[[ "$s" == 'F[[[O]]' ]] || err_exit "Expected 'F[[[O]]', got $s"
+
+
+# test using "print"
+s="$(${SHELL} -c 'print F[[O]')"
+[[ "$s" == 'F[[O]' ]] || err_exit "Expected 'F[[O]', got $s"
+
+s="$(${SHELL} -c 'print F[[[O]]')"
+[[ "$s" == 'F[[[O]]' ]] || err_exit "Expected 'F[[[O]]', got $s"
+
+
+# tests done
+exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/sun_solaris_cr_6763594_command_failure_execs_twice.sh b/usr/src/lib/libshell/common/tests/sun_solaris_cr_6763594_command_failure_execs_twice.sh
new file mode 100644
index 0000000000..f3ffae5e84
--- /dev/null
+++ b/usr/src/lib/libshell/common/tests/sun_solaris_cr_6763594_command_failure_execs_twice.sh
@@ -0,0 +1,95 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Test whether CR #6763594 ('ksh93 executes command after "command"
+# builtin twice on failure') has been fixed.
+#
+# Quote from CR #6763594:
+# ---- snip ----
+# ksh93 has a bug which causes shell to execute the command after the
+# "command" builtin to be executed twice if "command" fails:
+# -- snip --
+# $ ksh93 -x -c 'print "true" >myfoo ; chmod a+x,a-r myfoo ; command ./myfoo ;
+# print $?'
+# + print true
+# + 1> myfoo
+# + chmod a+x,a-r myfoo
+# + command ./myfoo
+# ksh93[1]: ./myfoo: ./myfoo: cannot open [Permission denied]
+# + print 1
+# 1
+# + print 0
+# 0
+# -- snip --
+# The "print" command at the end is executed twice in this case since
+# the shell jumps to the wrong position in the execution sequence.
+#
+# The correct output should be:
+# -- snip --
+# $ ksh93 -x -c 'print "true" >myfoo ; chmod a+x,a-r myfoo ; command ./myfoo ;
+# print $?'
+# + print true
+# + 1> myfoo
+# + chmod a+x,a-r myfoo
+# + command ./myfoo
+# ksh93[1]: ./myfoo: ./myfoo: cannot open [Permission denied]
+# + print 1
+# 1
+# -- snip --
+# ---- snip ----
+
+
+function err_exit
+{
+ print -u2 -n "\t"
+ print -u2 -r ${Command}[$1]: "${@:2}"
+ (( Errors+=1 ))
+}
+
+alias err_exit='err_exit $LINENO'
+
+integer Errors=0
+
+typeset testtmpdir=/tmp/ksh93_test_cr_6763594_${PPID}_$$
+mkdir "${testtmpdir}" || { err_exit "Could not create temporary directory ${testtmpdir}." ; exit ${Errors} ; }
+
+cd "${testtmpdir}" || { err_exit "Cannot cd to temporary directory ${testtmpdir}." ; exit ${Errors} ; }
+
+typeset s
+
+${SHELL} -c 'print "true" >myfoo ; chmod a+x,a-r myfoo ; command ./myfoo ; print $?' 1>out_stdout 2>out_stderr
+(( $? == 0 )) || err_exit "Return code $?, expected 0"
+
+s=$( < out_stdout ) ; [[ "$s" == '126' ]] || err_exit "Expected '126', got $(printf "%q\n" "$s")."
+s=$( < out_stderr ) ; [[ "$s" == ~(Elr)(.*:\ \./myfoo:\ \./myfoo:\ .*\[.*\]) ]] || err_exit "Output $(printf "%q\n" "$s") does not match pattern '~(Elr)(.*:\ \./myfoo:\ \./myfoo:\ .*\[.*\])'."
+
+rm "myfoo" "out_stdout" "out_stderr" || err_exit "rm failed."
+cd ..
+rmdir "${testtmpdir}" || err_exit "Failed to remove temporary directory ${testtmpdir}."
+
+# tests done
+exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/sun_solaris_cr_6766246_pattern_matching_bug.sh b/usr/src/lib/libshell/common/tests/sun_solaris_cr_6766246_pattern_matching_bug.sh
new file mode 100644
index 0000000000..fc83db0e8a
--- /dev/null
+++ b/usr/src/lib/libshell/common/tests/sun_solaris_cr_6766246_pattern_matching_bug.sh
@@ -0,0 +1,172 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Test whether CR #6766246 ("bug in pattern matching") has been fixed.
+#
+# Quote from CR #6766246:
+# ---- snip ----
+# The bootstrap script of pkgsrc contains this code
+# checkarg_sane_absolute_path() {
+# case "$1" in
+# "") ;; # the default value will be used.
+# *[!-A-Za-z0-9_./]*)
+# die "ERROR: Invalid characters in path $1 (from $2)." ;;
+# /*) ;;
+# *) die "ERROR: The argument to $2 must be an absolute path." ;;
+# esac
+# }
+# It turns out, the leading "!" in the pattern is not interpreted
+# as negation, and the first "-" not as a literal. Instead the
+# character range "! to A" is constructed. Paths containing "%"
+# or "@" are accepted, but paths containing "-" are rejected.
+# Note that this interpretation makes the whole pattern
+# syntactically wrong, which isn't noticed either.
+#
+# Test case:
+# -- snip --
+# !/bin/sh
+# case "$1" in
+# *[!-A-Za-z0-9_./]*)
+# echo invalid characters used in $1
+# ;;
+# *)
+# echo only valid characters used in $1
+# ;;
+# esac
+# -- snip --
+# Expected Result:
+# strings containing a "-" should be accepted, strings containing
+# a "@" should be rejected
+# Actual Result:
+# strings containing a "-" are rejected, strings containing a
+# "@" are accepted
+# Workaround
+# The pattern "*[!A-Za-z0-9_./-]*" (i.e. shifting the dash to
+# the end) works as expected.
+# ---- snip ----
+
+
+function err_exit
+{
+ print -u2 -n "\t"
+ print -u2 -r ${Command}[$1]: "${@:2}"
+ (( Errors+=1 ))
+}
+
+alias err_exit='err_exit $LINENO'
+
+integer Errors=0
+
+
+## test 1 (based on the bug report):
+
+function do_match
+{
+ case "$1" in
+ *[!-A-Za-z0-9_./]*)
+ print "match"
+ ;;
+ *)
+ print "nomatch"
+ ;;
+ esac
+ return 0
+}
+
+typeset pat
+
+pat="foo-bar" ; [[ "$(do_match "${pat}")" == "nomatch" ]] || err_exit "${pat} matched."
+pat="foo+bar" ; [[ "$(do_match "${pat}")" == "match" ]] || err_exit "${pat} not matched."
+pat="foo/bar" ; [[ "$(do_match "${pat}")" == "nomatch" ]] || err_exit "${pat} matched."
+pat="foo_bar" ; [[ "$(do_match "${pat}")" == "nomatch" ]] || err_exit "${pat} matched."
+pat="foo@bar" ; [[ "$(do_match "${pat}")" == "match" ]] || err_exit "${pat} not matched."
+pat="foobar-" ; [[ "$(do_match "${pat}")" == "nomatch" ]] || err_exit "${pat} matched."
+pat="foobar+" ; [[ "$(do_match "${pat}")" == "match" ]] || err_exit "${pat} not matched."
+pat="foobar/" ; [[ "$(do_match "${pat}")" == "nomatch" ]] || err_exit "${pat} matched."
+pat="foobar_" ; [[ "$(do_match "${pat}")" == "nomatch" ]] || err_exit "${pat} matched."
+pat="foobar@" ; [[ "$(do_match "${pat}")" == "match" ]] || err_exit "${pat} not matched."
+pat="-foobar" ; [[ "$(do_match "${pat}")" == "nomatch" ]] || err_exit "${pat} matched."
+pat="+foobar" ; [[ "$(do_match "${pat}")" == "match" ]] || err_exit "${pat} not matched."
+pat="/foobar" ; [[ "$(do_match "${pat}")" == "nomatch" ]] || err_exit "${pat} matched."
+pat="_foobar" ; [[ "$(do_match "${pat}")" == "nomatch" ]] || err_exit "${pat} matched."
+pat="@foobar" ; [[ "$(do_match "${pat}")" == "match" ]] || err_exit "${pat} not matched."
+
+
+## test 2 (gsf's test chain):
+
+# Make sure LC_COLLATE has a value
+if [[ "${LC_COLLATE}" == "" ]] ; then
+ if [[ ${LANG} != "" && "${LC_ALL}" == "" ]] ; then
+ LC_COLLATE="${LANG}"
+ fi
+fi
+
+if [[ "${LC_ALL}" != "" ]] ; then
+ LC_COLLATE="${LC_ALL}"
+fi
+
+[[ "${LC_COLLATE}" != "" ]] || err_exit "LC_COLLATE empty."
+
+set -- \
+ 'A' 0 1 1 0 1 1 1 0 0 1 0 0 \
+ 'Z' 0 1 1 0 1 1 1 0 0 1 0 0 \
+ '/' 0 0 0 0 0 0 1 1 1 1 1 1 \
+ '.' 0 0 0 0 0 0 1 1 1 1 1 1 \
+ '_' 0 0 0 0 0 0 1 1 1 1 1 1 \
+ '-' 1 1 1 1 1 1 0 0 0 0 0 0 \
+ '%' 0 0 0 0 0 0 1 1 1 1 1 1 \
+ '@' 0 0 0 0 0 0 1 1 1 1 1 1 \
+ '!' 0 0 0 0 0 0 1 1 1 1 1 1 \
+ '^' 0 0 0 0 0 0 1 1 1 1 1 1 \
+ # retain this line #
+while (( $# >= 13 )) ; do
+ c=$1
+ shift
+ for p in \
+ '[![.-.]]' \
+ '[![.-.][:upper:]]' \
+ '[![.-.]A-Z]' \
+ '[!-]' \
+ '[!-[:upper:]]' \
+ '[!-A-Z]' \
+ '[[.-.]]' \
+ '[[.-.][:upper:]]' \
+ '[[.-.]A-Z]' \
+ '[-]' \
+ '[-[:upper:]]' \
+ '[-A-Z]' \
+ # retain this line #
+ do e=$1
+ shift
+ [[ $c == $p ]]
+ g=$?
+ [[ $g == $e ]] || err_exit "[[ '$c' == $p ]] for LC_COLLATE=$l failed -- expected $e, got $g"
+ done
+done
+
+# tests done
+exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/sun_solaris_getconf.sh b/usr/src/lib/libshell/common/tests/sun_solaris_getconf.sh
index a8eaeb75f6..2089ad184c 100644
--- a/usr/src/lib/libshell/common/tests/sun_solaris_getconf.sh
+++ b/usr/src/lib/libshell/common/tests/sun_solaris_getconf.sh
@@ -1,5 +1,3 @@
-#!/bin/ksh93
-
#
# CDDL HEADER START
#
@@ -22,11 +20,9 @@
#
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
#
# sun_solaris_getconf.sh - test the ksh93 getconf builtin for compatibility
@@ -38,7 +34,7 @@ function err_exit
{
print -u2 -n "\t"
print -u2 -r ${Command}[$1]: "${@:2}"
- let Errors+=1
+ (( Errors++ ))
}
alias err_exit='err_exit $LINENO'
@@ -52,24 +48,29 @@ integer getconf_keys # counts tests (paranoid check to make sure the test loop w
export PATH=/usr/bin:/bin
# prechecks
-[ ! -f "/bin/getconf" ] && err_exit '/bin/getconf not found.'
-[ ! -x "/bin/getconf" ] && err_exit '/bin/getconf not executable.'
-
+[[ ! -f "/bin/getconf" ]] && err_exit '/bin/getconf not found.'
+[[ ! -x "/bin/getconf" ]] && err_exit '/bin/getconf not executable.'
+
+# Define test functions and store them in a string for repeated usagae
+# (we can't use "functions" (alias "typeset -f") since this does not
+# work in compiled shell scripts)
+typeset -r getconf_test_functions="$(
+cat <<EOF
# compare builtin getconf output with /usr/bin/getconf
function compare_normal
{
mismach=0 getconf_keys=0
/usr/bin/getconf -a |
while read i ; do
- let getconf_keys++
+ (( getconf_keys++ ))
t="${i%:*}"
a="$(getconf "$t" 2>/dev/null)"
b="$(/usr/bin/getconf "$t" 2>/dev/null)"
- if [ "$a" != "$b" ] ; then
+ if [[ "$a" != "$b" ]] ; then
print -u2 "getconf/normal built mismatch: |$t|:|$a| != |$b|"
- let mismatch++
+ (( mismatch++ ))
fi
done
}
@@ -80,49 +81,54 @@ function compare_path
mismach=0 getconf_keys=0
/usr/bin/getconf -a |
while read i ; do
- let getconf_keys++
+ (( getconf_keys++ ))
t="${i%:*}"
a="$(getconf "$t" "/tmp" 2>/dev/null)"
b="$(/usr/bin/getconf "$t" "/tmp" 2>/dev/null)"
- if [ "$a" != "$b" ] ; then
+ if [[ "$a" != "$b" ]] ; then
print -u2 "getconf/path built mismatch: |$t|:|$a| != |$b|"
- let mismatch++
+ (( mismatch++ ))
fi
done
}
+EOF
+)"
+
+print -r -- "$getconf_test_functions" | source /dev/stdin
# future versions of this test should test the following ${PATH}s, too:
# "/usr/xpg6/bin:/usr/xpg4/bin:/bin:/usr/bin" \
#"/usr/xpg4/bin:/bin:/usr/bin" \
for i in \
+ "/usr/bin:/bin" \
"/bin:/usr/bin"
do
export PATH="${i}"
## test whether the getconf builtin is available
- if [ "$(builtin | fgrep "/bin/getconf")" = "" ] ; then
+ if [[ "$(builtin | fgrep "/bin/getconf")" = "" ]] ; then
err_exit '/bin/getconf not found in the list of builtins.'
fi
## compare "getconf -a" output
- if [ "$(getconf -a)" != "$(/usr/bin/getconf -a)" ] ; then
+ if [[ "$(getconf -a)" != "$(/usr/bin/getconf -a)" ]] ; then
err_exit 'getconf -a output mismatch.'
fi
## check for a key which is only supported by the AST builtin version of getconf:
- if [ "$(getconf LIBPREFIX)" != "lib" ] ; then
+ if [[ "$(getconf LIBPREFIX)" != "lib" ]] ; then
err_exit 'getconf LIBPREFIX did not return "lib".'
fi
## run normal test
compare_normal
- [ ${getconf_keys} -eq 0 ] && err_exit "getconf/normal not working (PATH=${PATH})."
- [ ${mismatch} -gt 0 ] && err_exit "getconf/normal test found ${mismatch} differences (PATH=${PATH})."
+ (( getconf_keys == 0 )) && err_exit "getconf/normal not working (PATH=${PATH})."
+ (( mismatch > 0 )) && err_exit "getconf/normal test found ${mismatch} differences (PATH=${PATH})."
# run the same test in a seperate shell
# (we explicitly test this because ast-ksh.2007-01-11 picks up /usr/xpg6/bin/getconf
@@ -130,31 +136,30 @@ do
# contains /usr/xpg6/bin before ksh93 is started)).
${SHELL} -c "integer mismatch ; \
integer getconf_keys ; \
- $(functions) ; \
+ ${getconf_test_functions} ; \
compare_normal ;
- [ \${getconf_keys} -eq 0 ] && err_exit \"getconf/normal not working (PATH=\${PATH}).\" ; \
- [ \${mismatch} -gt 0 ] && err_exit \"getconf/normal test found \${mismatch} differences (PATH=\${PATH}).\" ; \
+ (( getconf_keys == 0 )) && err_exit \"getconf/normal not working (PATH=\${PATH}).\" ; \
+ (( mismatch > 0 )) && err_exit \"getconf/normal test found \${mismatch} differences (PATH=\${PATH}).\" ; \
exit $((Errors))"
- let Errors+=$?
+ (( Errors+=$? ))
## run test with path argument
compare_path
- [ ${getconf_keys} -eq 0 ] && err_exit "getconf/path not working."
- [ ${mismatch} -gt 0 ] && err_exit "getconf/path test found ${mismatch} differences."
+ (( getconf_keys == 0 )) && err_exit "getconf/path not working."
+ (( mismatch > 0 )) && err_exit "getconf/path test found ${mismatch} differences."
# run the same test in a seperate shell
# (see comment above)
${SHELL} -c "integer mismatch ; \
integer getconf_keys ; \
- $(functions) ; \
+ ${getconf_test_functions} ; \
compare_path ;
- [ \${getconf_keys} -eq 0 ] && err_exit \"getconf/normal not working (PATH=\${PATH}).\" ; \
- [ \${mismatch} -gt 0 ] && err_exit \"getconf/normal test found \${mismatch} differences (PATH=\${PATH}).\" ; \
+ (( getconf_keys == 0 )) && err_exit \"getconf/normal not working (PATH=\${PATH}).\" ; \
+ (( mismatch > 0 )) && err_exit \"getconf/normal test found \${mismatch} differences (PATH=\${PATH}).\" ; \
exit $((Errors))"
- let Errors+=$?
+ (( Errors+=$? ))
done
-# test done
+# tests done
exit $((Errors))
-
diff --git a/usr/src/lib/libshell/common/tests/sun_solaris_local_compound_nameref001.sh b/usr/src/lib/libshell/common/tests/sun_solaris_local_compound_nameref001.sh
new file mode 100644
index 0000000000..30a2deb314
--- /dev/null
+++ b/usr/src/lib/libshell/common/tests/sun_solaris_local_compound_nameref001.sh
@@ -0,0 +1,64 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# name reference test #001
+#
+
+function err_exit
+{
+ print -u2 -n "\t"
+ print -u2 -r ${Command}[$1]: "${@:2}"
+ (( Errors+=1 ))
+}
+
+alias err_exit='err_exit $LINENO'
+
+integer Errors=0
+
+function function2
+{
+ nameref v=$1
+
+ v.x=19
+ v.y=20
+}
+
+function function1
+{
+ typeset compound_var=()
+
+ function2 compound_var
+
+ printf "x=%d, y=%d\n" compound_var.x compound_var.y
+}
+
+x="$(function1)"
+
+[[ "$x" != 'x=19, y=20' ]] && err_exit "expected 'x=19, y=20', got '${x}'"
+
+# tests done
+exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/sun_solaris_staticvariables.sh b/usr/src/lib/libshell/common/tests/sun_solaris_staticvariables.sh
new file mode 100644
index 0000000000..9230c9925f
--- /dev/null
+++ b/usr/src/lib/libshell/common/tests/sun_solaris_staticvariables.sh
@@ -0,0 +1,111 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+function err_exit2
+{
+ print -u2 -n "\t"
+ print -u2 -r ${Command}[$1]: "${@:2}"
+ (( Errors+=1 ))
+}
+
+function testfunc
+{
+ integer line_number=$1
+ typeset cmd="$2"
+ typeset expected_output="$3"
+ typeset output
+
+ output="$($SHELL -c "${cmd}" 2>&1 )"
+
+ [[ "${output}" != "${expected_output}" ]] && err_exit2 ${line_number} "${output} != ${expected_output}"
+}
+alias testfunc='testfunc $LINENO'
+alias err_exit='err_exit2 $LINENO'
+
+integer Errors=0
+
+# string
+testfunc '(function l { typeset -S x ; x+="#" ; $1 && print "$x" ; } ; l false ; l false ; l true)' "###"
+testfunc 'function l { typeset -S x=">" ; x+="#" ; $1 && print "$x" ; } ; l false ; l false ; l true' ">###"
+testfunc 'function l { typeset -S x=">" ; x+="#" ; $1 && print "$x" ; } ; l false ; (l false) ; l true' ">##"
+testfunc 'function l { typeset -S x=">" ; x+="#" ; $1 && print "$x" ; } ; l false; ( ulimit -c 0 ; l false) ; l true' ">##"
+
+# integer
+testfunc '(function l { typeset -S -i x ; x+=1 ; $1 && print "$x" ; } ; l false ; l false ; l true )' "3"
+testfunc '(function l { typeset -S -i x ; x+=1 ; $1 && print "$x" ; } ; l false ; (l false) ; l true )' "2"
+
+# float
+testfunc '(function l { float -S x=0.5 ; (( x+=.5 )) ; $1 && print "$x" ; } ; l false ; l false ; l true )' "2"
+testfunc '(function l { float -S x=0.5 ; (( x+=.5 )) ; $1 && print "$x" ; } ; l false ; (l false) ; l true )' "1.5"
+
+# compound variable
+[[ "${
+ function l
+ {
+ typeset -S s=( a=0 b=0 )
+
+ (( s.a++, s.b++ ))
+
+ $1 && printf 'a=%d, b=%d\n' s.a s.b
+ }
+ l false ; l false ; l true
+}" != "a=3, b=3" ]] && err_exit "static compound var failed"
+
+
+# array variable
+[[ "$(
+ function ar
+ {
+ typeset -a -S s=( "hello" )
+
+ s+=( "an element" )
+
+ $1 && { printf '%s' "${s[@]}" ; printf '\n' ; }
+ }
+ ar false ; ar false ; ar true
+)" != "helloan elementan elementan element" ]] && err_exit "static array var failed"
+
+
+# Test visibilty of "global" vs. "static" variables. if we have a "static" variable in a
+# function and "unset" it we should see a global variable with the same
+# name, right ?
+integer hx=5
+function test_hx_scope
+{
+ integer -S hx=9
+ $2 && unset hx
+ $1 && printf "hx=%d\n" hx
+}
+test_hx_scope false false
+test_hx_scope false false
+# first test the "unset" call in a $(...) subshell...
+[[ "$( test_hx_scope true true )" != "hx=5" ]] && err_exit "can't see global variable hx after unsetting static variable hx"
+# ... end then test whether the value has changed.
+[[ "${ test_hx_scope true false }" != "hx=9" ]] && err_exit "hx variable somehow changed"
+
+
+# tests done
+exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/sun_solaris_vartree001.sh b/usr/src/lib/libshell/common/tests/sun_solaris_vartree001.sh
new file mode 100644
index 0000000000..74783e6ff7
--- /dev/null
+++ b/usr/src/lib/libshell/common/tests/sun_solaris_vartree001.sh
@@ -0,0 +1,191 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# variable tree test #001
+# Propose of this test is whether ksh93 crashes or not - ast-ksh.2008-05-14
+# crashes like this when running this test:
+#
+# program terminated by signal ILL (illegal opcode)
+# 0xffffffffffffffff: <bad address 0xffffffffffffffff>
+# Current function is nv_diropen
+# 123 dp->hp = (Namval_t*)dtprev(dp->root,&fake);
+# (dbx) where
+# [1] 0x100381e80(0x100381e80, 0xffffffff7fffe690, 0x10, 0x61, 0x0, 0x100381ec9), at 0x100381e80
+# =>[2] nv_diropen(np = (nil), name = 0x100381ebc "mysrcdata"), line 123 in "nvtree.c"
+# [3] walk_tree(np = 0x1003809e0, dlete = 524289), line 743 in "nvtree.c"
+# [4] put_tree(np = 0x1003809e0, val = (nil), flags = 524289, fp = 0x100381db0), line 814 in "nvtree.c"
+# [5] nv_putv(np = 0x1003809e0, value = (nil), flags = 524289, nfp = 0x100381db0), line 141 in "nvdisc.c"
+# [6] _nv_unset(np = 0x1003809e0, flags = 524289), line 1976 in "name.c"
+# [7] table_unset(shp = 0x10033e900, root = 0x100380900, flags = 524289, oroot = 0x100360980), line 1902 in "name.c"
+# [8] sh_unscope(shp = 0x10033e900), line 2711 in "name.c"
+# [9] sh_funscope(argn = 1, argv = 0x10035e680, fun = (nil), arg = 0xffffffff7ffff118, execflg = 4), line 2470 in "xec.c"
+# [10] sh_funct(np = 0x100380860, argn = 1, argv = 0x10035e680, envlist = (nil), execflg = 4), line 2528 in "xec.c"
+# [11] sh_exec(t = 0x10035e620, flags = 4), line 1032 in "xec.c"
+# [12] exfile(shp = 0x10033e900, iop = 0x100379a20, fno = 10), line 589 in "main.c"
+# [13] sh_main(ac = 2, av = 0xffffffff7ffffa08, userinit = (nil)), line 364 in "main.c"
+# [14] main(argc = 2, argv = 0xffffffff7ffffa08), line 46 in "pmain.c"
+#
+
+function err_exit
+{
+ print -u2 -n "\t"
+ print -u2 -r ${Command}[$1]: "${@:2}"
+ (( Errors+=1 ))
+}
+
+alias err_exit='err_exit $LINENO'
+
+integer Errors=0
+
+
+function build_tree
+{
+#set -o errexit -o xtrace
+ typeset index
+ typeset s
+ typeset i
+ typeset dummy
+ typeset a b c d e f
+
+ nameref dest_tree="$1" # destination tree
+ nameref srcdata="$2" # source data
+ typeset tree_mode="$3" # mode to define the type of leads
+
+ typeset -A dest_tree.l1
+
+ for index in "${!srcdata.hashnodes[@]}" ; do
+ nameref node=srcdata.hashnodes["${index}"]
+
+ for i in "${node.xlfd[@]}" ; do
+ IFS='-' read dummy a b c d e f <<<"$i"
+
+ if [[ "$a" == "" ]] ; then
+ a="$dummy"
+ fi
+
+ [[ "$a" == "" ]] && a='-'
+ [[ "$b" == "" ]] && b='-'
+ [[ "$c" == "" ]] && c='-'
+
+ if [[ "${dest_tree.l1["$a"]}" == "" ]] ; then
+ #if ! (unset dest_tree.l1["$a"]) ; then
+ typeset -A dest_tree.l1["$a"].l2
+ fi
+
+ if [[ "${dest_tree.l1["$a"].l2["$b"]}" == "" ]] ; then
+ #if ! (unset dest_tree.l1["$a"].l2["$b"]) ; then
+ typeset -A dest_tree.l1["$a"].l2["$b"].l3
+ fi
+
+ if [[ "${!dest_tree.l1["$a"].l2["$b"].l3["$c"].entries[*]}" == "" ]] ; then
+ typeset -A dest_tree.l1["$a"].l2["$b"].l3["$c"].entries
+ fi
+
+ #dest_tree.l1["$a"].l2["$b"].l3["$c"].entries+=( "$index" )
+ typeset new_index
+ if [[ "${tree_mode}" == "leaf_name" ]] ; then
+ new_index=$(( ${#dest_tree.l1["$a"].l2["$b"].l3["$c"].entries[@]}+1 ))
+ else
+ new_index="${node.name}"
+
+ # skip if the leaf node already exists
+ if [[ "${dest_tree.l1["$a"].l2["$b"].l3["$c"].entries[${new_index}]}" != "" ]] ; then
+ continue
+ fi
+ fi
+
+ add_tree_leaf dest_tree.l1["$a"].l2["$b"].l3["$c"].entries[${new_index}] "${index}" "${tree_mode}"
+ done
+ done
+
+ return 0
+}
+
+function add_tree_leaf
+{
+ nameref tree_leafnode="$1"
+ nameref data_node=srcdata.hashnodes["$2"]
+ typeset add_mode="$3"
+
+ case "${add_mode}" in
+ "leaf_name")
+ tree_leafnode="${data_node.name}"
+ return 0
+ ;;
+ "leaf_compound")
+ tree_leafnode=(
+ typeset name="${data_node.name}"
+ typeset -a filenames=( "${data_node.filenames[@]}" )
+ typeset -a comments=( "${data_node.comments[@]}" )
+ typeset -a xlfd=( "${data_node.xlfd[@]}" )
+ )
+ return 0
+ ;;
+ *)
+ print -u2 -f "ERROR: Unknown mode %s in add_tree_leaf\n" "${add_mode}"
+ return 1
+ ;;
+ esac
+
+ # not reached
+ return 1
+}
+
+function main
+{
+ typeset mysrcdata=(
+ typeset -A hashnodes=(
+ [abcd]=(
+ name='abcd'
+ typeset -a xlfd=(
+ '-urw-itc zapfchancery-medium-i-normal--0-0-0-0-p-0-iso8859-1'
+ '-urw-itc zapfdingbats-medium-r-normal--0-0-0-0-p-0-adobe-fontspecific'
+ '-urw-itc zapfdingbats-medium-r-normal--0-0-0-0-p-0-sun-fontspecific'
+ )
+ typeset -a comments=(
+ 'comment 1'
+ 'comment 2'
+ 'comment 3'
+ )
+ typeset -a filenames=(
+ '/home/foo/abcd_1'
+ '/home/foo/abcd_2'
+ '/home/foo/abcd_3'
+ )
+ )
+ )
+ )
+
+ mytree=()
+ build_tree mytree mysrcdata leaf_compound
+# (( $(print -r -- "$mytree" | wc -l) > 10 )) || err_exit "Compound tree too small."
+}
+
+main
+
+# tests done
+exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/sun_solaris_vartree002.sh b/usr/src/lib/libshell/common/tests/sun_solaris_vartree002.sh
new file mode 100644
index 0000000000..e233f596e3
--- /dev/null
+++ b/usr/src/lib/libshell/common/tests/sun_solaris_vartree002.sh
@@ -0,0 +1,353 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# variable tree test #002
+# Propose of this test is whether ksh93 handles global variable trees
+# and function-local variable trees the same way, including "nameref"
+# and "unset" handling.
+#
+
+function err_exit
+{
+ print -u2 -n "\t"
+ print -u2 -r ${Command}[$1]: "${@:2}"
+ (( Errors+=1 ))
+}
+
+alias err_exit='err_exit $LINENO'
+
+integer Errors=0
+
+# "built_tree1" and "built_tree2" are identical except the way how they test
+# whether a variable exists:
+# - "built_tree1" uses "${varname}" != "", e.g. looking whether the variable
+# as non-zero length content
+# - "built_tree2" uses "! (unset varname)", e.g. "unset" in a subshell
+function build_tree1
+{
+#set -o errexit -o xtrace
+ typeset index
+ typeset s
+ typeset i
+ typeset dummy
+ typeset a b c d e f
+
+ nameref dest_tree="$1" # destination tree
+ nameref srcdata="$2" # source data
+ typeset tree_mode="$3" # mode to define the type of leads
+
+ typeset -A dest_tree.l1
+
+ for index in "${!srcdata.hashnodes[@]}" ; do
+ nameref node=srcdata.hashnodes["${index}"]
+
+ for i in "${node.xlfd[@]}" ; do
+ IFS='-' read dummy a b c d e f <<<"$i"
+
+ if [[ "$a" == "" ]] ; then
+ a="$dummy"
+ fi
+
+ [[ "$a" == "" ]] && a='-'
+ [[ "$b" == "" ]] && b='-'
+ [[ "$c" == "" ]] && c='-'
+
+ if [[ "${dest_tree.l1["$a"]}" == "" ]] ; then
+ #if ! (unset dest_tree.l1["$a"]) ; then
+ typeset -A dest_tree.l1["$a"].l2
+ fi
+
+ if [[ "${dest_tree.l1["$a"].l2["$b"]}" == "" ]] ; then
+ #if ! (unset dest_tree.l1["$a"].l2["$b"]) ; then
+ typeset -A dest_tree.l1["$a"].l2["$b"].l3
+ fi
+
+ if [[ "${!dest_tree.l1["$a"].l2["$b"].l3["$c"].entries[*]}" == "" ]] ; then
+ typeset -A dest_tree.l1["$a"].l2["$b"].l3["$c"].entries
+ fi
+
+ typeset new_index
+ if [[ "${tree_mode}" == "leaf_name" ]] ; then
+ new_index=$(( ${#dest_tree.l1["$a"].l2["$b"].l3["$c"].entries[@]}+1 ))
+ else
+ new_index="${node.name}"
+
+ # skip if the leaf node already exists
+ if [[ "${dest_tree.l1["$a"].l2["$b"].l3["$c"].entries[${new_index}]}" != "" ]] ; then
+ continue
+ fi
+ fi
+
+ add_tree_leaf dest_tree.l1["$a"].l2["$b"].l3["$c"].entries[${new_index}] "${index}" "${tree_mode}"
+ done
+ done
+
+ return 0
+}
+
+# "built_tree1" and "built_tree2" are identical except the way how they test
+# whether a variable exists:
+# - "built_tree1" uses "${varname}" != "", e.g. looking whether the variable
+# as non-zero length content
+# - "built_tree2" uses "! (unset varname)", e.g. "unset" in a subshell
+function build_tree2
+{
+#set -o errexit -o xtrace
+ typeset index
+ typeset s
+ typeset i
+ typeset dummy
+ typeset a b c d e f
+
+ nameref dest_tree="$1" # destination tree
+ nameref srcdata="$2" # source data
+ typeset tree_mode="$3" # mode to define the type of leads
+
+ typeset -A dest_tree.l1
+
+ for index in "${!srcdata.hashnodes[@]}" ; do
+ nameref node=srcdata.hashnodes["${index}"]
+
+ for i in "${node.xlfd[@]}" ; do
+ IFS='-' read dummy a b c d e f <<<"$i"
+
+ if [[ "$a" == "" ]] ; then
+ a="$dummy"
+ fi
+
+ [[ "$a" == "" ]] && a='-'
+ [[ "$b" == "" ]] && b='-'
+ [[ "$c" == "" ]] && c='-'
+
+ #if [[ "${dest_tree.l1["$a"]}" == "" ]] ; then
+ if ! (unset dest_tree.l1["$a"]) ; then
+ typeset -A dest_tree.l1["$a"].l2
+ fi
+
+ #if [[ "${dest_tree.l1["$a"].l2["$b"]}" == "" ]] ; then
+ if ! (unset dest_tree.l1["$a"].l2["$b"]) ; then
+ typeset -A dest_tree.l1["$a"].l2["$b"].l3
+ fi
+
+ if [[ "${!dest_tree.l1["$a"].l2["$b"].l3["$c"].entries[*]}" == "" ]] ; then
+ typeset -A dest_tree.l1["$a"].l2["$b"].l3["$c"].entries
+ fi
+
+ typeset new_index
+ if [[ "${tree_mode}" == "leaf_name" ]] ; then
+ new_index=$(( ${#dest_tree.l1["$a"].l2["$b"].l3["$c"].entries[@]}+1 ))
+ else
+ new_index="${node.name}"
+
+ # skip if the leaf node already exists
+ if [[ "${dest_tree.l1["$a"].l2["$b"].l3["$c"].entries[${new_index}]}" != "" ]] ; then
+ continue
+ fi
+ fi
+
+ add_tree_leaf dest_tree.l1["$a"].l2["$b"].l3["$c"].entries[${new_index}] "${index}" "${tree_mode}"
+ done
+ done
+
+ return 0
+}
+
+
+function add_tree_leaf
+{
+ nameref tree_leafnode="$1"
+ nameref data_node=srcdata.hashnodes["$2"]
+ typeset add_mode="$3"
+
+ case "${add_mode}" in
+ "leaf_name")
+ tree_leafnode="${data_node.name}"
+ return 0
+ ;;
+ "leaf_compound")
+ tree_leafnode=(
+ typeset name="${data_node.name}"
+ typeset -a filenames=( "${data_node.filenames[@]}" )
+ typeset -a comments=( "${data_node.comments[@]}" )
+ typeset -a xlfd=( "${data_node.xlfd[@]}" )
+ )
+ return 0
+ ;;
+ *)
+ print -u2 -f "ERROR: Unknown mode %s in add_tree_leaf\n" "${add_mode}"
+ return 1
+ ;;
+ esac
+
+ # not reached
+ return 1
+}
+
+# "mysrcdata_local" and "mysrcdata_global" must be identical
+typeset mysrcdata_global=(
+ typeset -A hashnodes=(
+ [abcd]=(
+ name='abcd'
+ typeset -a xlfd=(
+ '-urw-itc zapfchancery-medium-i-normal--0-0-0-0-p-0-iso8859-1'
+ '-urw-itc zapfdingbats-medium-r-normal--0-0-0-0-p-0-adobe-fontspecific'
+ '-urw-itc zapfdingbats-medium-r-normal--0-0-0-0-p-0-sun-fontspecific'
+ )
+ typeset -a comments=(
+ 'comment 1'
+ 'comment 2'
+ 'comment 3'
+ )
+ typeset -a filenames=(
+ '/home/foo/abcd_1'
+ '/home/foo/abcd_2'
+ '/home/foo/abcd_3'
+ )
+ )
+ )
+)
+
+mytree_global1=()
+mytree_global2=()
+
+function main
+{
+ # "mysrcdata_local" and "mysrcdata_global" must be identical
+ typeset mysrcdata_local=(
+ typeset -A hashnodes=(
+ [abcd]=(
+ name='abcd'
+ typeset -a xlfd=(
+ '-urw-itc zapfchancery-medium-i-normal--0-0-0-0-p-0-iso8859-1'
+ '-urw-itc zapfdingbats-medium-r-normal--0-0-0-0-p-0-adobe-fontspecific'
+ '-urw-itc zapfdingbats-medium-r-normal--0-0-0-0-p-0-sun-fontspecific'
+ )
+ typeset -a comments=(
+ 'comment 1'
+ 'comment 2'
+ 'comment 3'
+ )
+ typeset -a filenames=(
+ '/home/foo/abcd_1'
+ '/home/foo/abcd_2'
+ '/home/foo/abcd_3'
+ )
+ )
+ )
+ )
+
+ #### Build tree using global tree variables
+ build_tree1 mytree_global1 mysrcdata_global leaf_compound || \
+ err_exit 'build_tree1 mytree_global1 mysrcdata_global leaf_compound returned an error'
+ (( $(print -r -- "${mytree_global1}" | wc -l) > 10 )) || err_exit "Compound tree 'mytree_global1' too small."
+
+ build_tree2 mytree_global2 mysrcdata_global leaf_compound || \
+ err_exit 'build_tree2 mytree_global2 mysrcdata_global leaf_compound returned an error'
+ (( $(print -r -- "${mytree_global2}" | wc -l) > 10 )) || err_exit "Compound tree 'mytree_global2' too small."
+
+
+ #### build tree using local tree variables
+ mytree_local1=()
+ mytree_local2=()
+
+ build_tree1 mytree_local1 mysrcdata_local leaf_compound || \
+ err_exit 'build_tree1 mytree_local1 mysrcdata_local leaf_compound returned an error'
+ (( $(print -r -- "${mytree_local1}" | wc -l) > 10 )) || err_exit "Compound tree 'mytree_local1' too small."
+
+ build_tree2 mytree_local2 mysrcdata_local leaf_compound || \
+ err_exit 'build_tree2 mytree_local2 mysrcdata_local leaf_compound returned an error'
+ (( $(print -r -- "${mytree_local2}" | wc -l) > 10 )) || err_exit "Compound tree 'mytree_local2' too small."
+
+
+ #### Compare treess
+ if [[ "${mytree_global1}" != "${mytree_local1}" ]] ; then
+ err_exit "Compound trees 'mytree_global1' and 'mytree_local1' not identical"
+ diff -u <( printf "%s\n" "${mytree_global1}" ) <( printf "%s\n" "${mytree_local1}" )
+ fi
+
+ if [[ "${mytree_global1}" != "${mytree_global2}" ]] ; then
+ err_exit "Compound trees 'mytree_global1' and 'mytree_global2' not identical"
+ diff -u <( printf "%s\n" "${mytree_global1}" ) <( printf "%s\n" "${mytree_global2}" )
+ fi
+
+ if [[ "${mytree_local1}" != "${mytree_local2}" ]] ; then
+ err_exit "Compound trees 'mytree_local1' and 'mytree_local2' not identical"
+ diff -u <( printf "%s\n" "${mytree_local1}" ) <( printf "%s\n" "${mytree_local2}" )
+ fi
+
+
+ #### test "unset" in a subshell
+ ( unset 'mytree_global1.l1[urw].l2[itc zapfdingbats]' ) || \
+ err_exit "Try 1: Variable 'mytree_global1.l1[urw].l2[itc zapfdingbats]' not found."
+ ( unset 'mytree_global1.l1[urw].l2[itc zapfdingbats]' ) || \
+ err_exit "Try 2: Variable 'mytree_global1.l1[urw].l2[itc zapfdingbats]' not found."
+
+ # remove parent node (array element) and then check whether the child is gone, too:
+ (
+ set -o errexit
+ unset 'mytree_global1.l1[urw].l2[itc zapfdingbats]'
+ ! unset 'mytree_global1.l1[urw].l2[itc zapfdingbats].l3[medium].entries[abcd].filenames[0]'
+ ) || err_exit "Global: Parent node removed (array element), child still exists"
+ (
+ set -o errexit
+ unset 'mytree_local1.l1[urw].l2[itc zapfdingbats]'
+ ! unset 'mytree_local1.l1[urw].l2[itc zapfdingbats].l3[medium].entries[abcd].filenames[0]'
+ ) || err_exit "Local: Parent node removed (array element), child still exists"
+
+ # remove parent node (array variable) and then check whether the child is gone, too:
+ (
+ set -o errexit
+ unset 'mytree_local1.l1[urw].l2'
+ ! unset 'mytree_local1.l1[urw].l2[itc zapfdingbats].l3[medium].entries[abcd].filenames[0]'
+ ) || err_exit "Global: Parent node removed (array variable), child still exists"
+ (
+ set -o errexit
+ unset 'mytree_local1.l1[urw].l2'
+ ! unset 'mytree_local1.l1[urw].l2[itc zapfdingbats].l3[medium].entries[abcd].filenames[0]'
+ ) || err_exit "Local: Parent node removed (array variable), child still exists"
+
+
+ #### test "unset" and compare trees
+ unset 'mytree_global1.l1[urw].l2[itc zapfdingbats].l3[medium].entries[abcd].filenames[0]' ||
+ err_exit "Variable 'mytree_global1.l1[urw].l2[itc zapfdingbats].l3[medium].entries[abcd].filenames[0]' not found."
+
+ [[ "${mytree_global1}" != "${mytree_local1}" ]] || err_exit "mytree_global1 and mytree_local1 should differ"
+
+ unset 'mytree_local1.l1[urw].l2[itc zapfdingbats].l3[medium].entries[abcd].filenames[0]' ||
+ err_exit "Variable 'mytree_local1.l1[urw].l2[itc zapfdingbats].l3[medium].entries[abcd].filenames[0]' not found."
+
+ # Compare trees (after "unset")
+ if [[ "${mytree_global1}" != "${mytree_local1}" ]] ; then
+ err_exit "Compound trees 'mytree_local1' and 'mytree_global1' not identical after unset"
+ diff -u <( printf "%s\n" "${mytree_global1}" ) <( printf "%s\n" "${mytree_local1}" )
+ fi
+}
+
+main
+
+# tests done
+exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/sun_solaris_vartree003.sh b/usr/src/lib/libshell/common/tests/sun_solaris_vartree003.sh
new file mode 100644
index 0000000000..89bc9e7541
--- /dev/null
+++ b/usr/src/lib/libshell/common/tests/sun_solaris_vartree003.sh
@@ -0,0 +1,198 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# variable tree test #003
+# Propose of this test is whether ksh93 handles global variable trees
+# and function-local variable trees the same way, including "nameref"
+# and "unset" handling.
+#
+
+function err_exit
+{
+ print -u2 -n "\t"
+ print -u2 -r ${Command}[$1]: "${@:2}"
+ (( Errors+=1 ))
+}
+
+alias err_exit='err_exit $LINENO'
+
+integer Errors=0
+
+function example_tree
+{
+cat <<EOF
+(
+ typeset -A l1=(
+ [adobe]=(
+ typeset -A l2=(
+ [avantgarde]=(
+ typeset -A l3=(
+ [demi]=(
+ typeset -A entries=(
+ [182c069a485316b1bc7ae001c04c7835]=(
+ typeset -a comments=(
+ FONT
+ -adobe-avantgarde-demi-r-normal--199-120-1200-1200-p-1130-iso8859-1
+ COPYRIGHT
+ 'Copyright Notice not available'
+ RAW_PIXELSIZE
+ RAW_POINTSIZE
+ --
+ section
+ diaeresis
+ copyright
+ ordfeminine
+ guillemotleft
+ )
+ typeset -a filenames=(
+ X11Rx/R6.4/xc/programs/Xserver/XpConfig/C/print/models/SPSPARC2/fonts/AvantGarde-Demi.pmf
+ )
+ md5sum=182c069a485316b1bc7ae001c04c7835
+ typeset -a xlfd=(
+ -adobe-avantgarde-demi-r-normal--199-120-1200-1200-p-1130-iso8859-1
+ )
+ )
+ [7db15b51965d8fe1f1c55fcb101d7616]=(
+ typeset -a comments=(
+ FONT
+ -adobe-avantgarde-demi-i-normal--199-120-1200-1200-p-1130-iso8859-1
+ COPYRIGHT
+ 'Copyright Notice not available'
+ RAW_PIXELSIZE
+ RAW_POINTSIZE
+ --
+ section
+ diaeresis
+ copyright
+ ordfeminine
+ guillemotleft
+ )
+ typeset -a filenames=(
+ X11Rx/R6.4/xc/programs/Xserver/XpConfig/C/print/models/SPSPARC2/fonts/AvantGarde-DemiOblique.pmf
+ )
+ md5sum=7db15b51965d8fe1f1c55fcb101d7616
+ typeset -a xlfd=(
+ -adobe-avantgarde-demi-i-normal--199-120-1200-1200-p-1130-iso8859-1
+ )
+ )
+ [a37e4a4a5035abf6f294d830fbd9e775]=(
+ typeset -a comments=(
+ FONT
+ -adobe-avantgarde-demi-r-normal--422-120-2540-2540-p-2395-iso8859-1
+ COPYRIGHT
+ 'Copyright (c) 1985, 1987, 1989, 1990, 1991 Adobe Systems Incorporated. All Rights Reserved.ITC Avant Garde Gothic is a registered trademark of International Typeface Corporation.'
+ RAW_PIXELSIZE
+ RAW_POINTSIZE
+ --
+ section
+ diaeresis
+ copyright
+ ordfeminine
+ guillemotleft
+ )
+ typeset -a filenames=(
+ fox-gate/XW_NV/open-src/tarballs/xorg-server-1.3.0.0/hw/xprint/config/C/print/models/PSdefault/fonts/AvantGarde-Demi.pmf
+ )
+ md5sum=a37e4a4a5035abf6f294d830fbd9e775
+ typeset -a xlfd=(
+ -adobe-avantgarde-demi-r-normal--422-120-2540-2540-p-2395-iso8859-1
+ )
+ )
+ [da3d6d94fcf759b95c7f829ce5619374]=(
+ typeset -a comments=(
+ FONT
+ -adobe-avantgarde-demi-i-normal--422-120-2540-2540-p-2395-iso8859-1
+ COPYRIGHT
+ 'Copyright (c) 1985, 1987, 1989, 1990, 1991 Adobe Systems Incorporated. All Rights Reserved.ITC Avant Garde Gothic is a registered trademark of International Typeface Corporation.'
+ RAW_PIXELSIZE
+ RAW_POINTSIZE
+ --
+ section
+ diaeresis
+ copyright
+ ordfeminine
+ guillemotleft
+ )
+ typeset -a filenames=(
+ fox-gate/XW_NV/open-src/tarballs/xorg-server-1.3.0.0/hw/xprint/config/C/print/models/PSdefault/fonts/AvantGarde-DemiOblique.pmf
+ )
+ md5sum=da3d6d94fcf759b95c7f829ce5619374
+ typeset -a xlfd=(
+ -adobe-avantgarde-demi-i-normal--422-120-2540-2540-p-2395-iso8859-1
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+)
+EOF
+}
+
+function main
+{
+ set -o errexit
+
+ typeset xlfd_tree=()
+ typeset -A xlfd_tree.l1
+
+ eval "xlfd_tree=$( example_tree )"
+
+ typeset i j k l fn
+
+ # filter chain begin
+ for i in "${!xlfd_tree.l1[@]}" ; do
+ for j in "${!xlfd_tree.l1["$i"].l2[@]}" ; do
+ for k in "${!xlfd_tree.l1["$i"].l2["$j"].l3[@]}" ; do
+ nameref vndnode=xlfd_tree.l1["$i"].l2["$j"].l3["$k"]
+
+ for l in "${!vndnode.entries[@]}" ; do
+ nameref node=vndnode.entries["$l"]
+
+ for fn in "${node.filenames[@]}" ; do
+ if [[ "${fn}" != ~(E)x-re_gate_XW_NV_MWS ]] ; then
+ unset "${!node}"
+ break
+ fi
+ done
+ done
+ done
+ done
+ done
+
+ # filter chain end
+
+ return 0
+}
+
+main || ((Errors++))
+
+# tests done
+exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/tilde.sh b/usr/src/lib/libshell/common/tests/tilde.sh
index 6ebfd8504c..60a2de0aa8 100644
--- a/usr/src/lib/libshell/common/tests/tilde.sh
+++ b/usr/src/lib/libshell/common/tests/tilde.sh
@@ -1,10 +1,10 @@
########################################################################
# #
# This software is part of the ast package #
-# Copyright (c) 1982-2007 AT&T Knowledge Ventures #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
-# by AT&T Knowledge Ventures #
+# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# http://www.opensource.org/licenses/cpl1.0.txt #
@@ -83,5 +83,10 @@ then err_exit x=~:~ not $HOME:$HOME
fi
HOME=/
[[ ~ == / ]] || err_exit '~ should be /'
+trap 'rm -rf /tmp/kshtilde$$' EXIT
[[ ~/foo == /foo ]] || err_exit '~/foo should be /foo when ~==/'
+print $'print ~+\n[[ $1 ]] && $0' > /tmp/kshtilde$$
+chmod +x /tmp/kshtilde$$
+nl=$'\n'
+[[ $(/tmp/kshtilde$$ foo) == "$PWD$nl$PWD" ]] 2> /dev/null || err_exit 'tilde fails inside a script run by name'
exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/timetype.sh b/usr/src/lib/libshell/common/tests/timetype.sh
new file mode 100644
index 0000000000..c2046d5272
--- /dev/null
+++ b/usr/src/lib/libshell/common/tests/timetype.sh
@@ -0,0 +1,80 @@
+########################################################################
+# #
+# This software is part of the ast package #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
+# and is licensed under the #
+# Common Public License, Version 1.0 #
+# by AT&T Intellectual Property #
+# #
+# A copy of the License is available at #
+# http://www.opensource.org/licenses/cpl1.0.txt #
+# (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) #
+# #
+# Information and Software Systems Research #
+# AT&T Research #
+# Florham Park NJ #
+# #
+# David Korn <dgk@research.att.com> #
+# #
+########################################################################
+function err_exit
+{
+ print -u2 -n "\t"
+ print -u2 -r ${Command}[$1]: "${@:2}"
+ (( Errors+=1 ))
+}
+alias err_exit='err_exit $LINENO'
+
+Command=${0##*/}
+integer Errors=0
+
+typeset -T Time_t=(
+ integer .=-1
+ _='%F+%H:%M'
+ get()
+ {
+ if (( _ < 0 ))
+ then .sh.value=${ printf "%(${_._})T" now ;}
+ else .sh.value=${ printf "%(${_._})T" "#$((_))" ;}
+ fi
+ }
+ set()
+ {
+ .sh.value=${ printf "%(%#)T" "${.sh.value}";}
+ }
+)
+
+d=$(printf "%(%F+%H:%M)T" now)
+integer s=$(printf "%(%#)T" "$d")
+Time_t t=$d
+[[ $t == "$d" ]] || err_exit 'printf %T and Time_t are different'
+(( t == s )) || err_exit 'numerical Time_t not correct'
+t._='%#'
+[[ $t == $s ]] || err_exit 'setting _ to %# not getting correct results'
+unset t
+Time_t tt=(yesterday today tomorrow)
+tt[3]=2pm
+[[ ${!tt[@]} == '0 1 2 3' ]] || err_exit 'indexed array subscript names not correct'
+[[ ${tt[0]} == *+00:00 ]] || err_exit 'tt[0] is not yesterday'
+[[ ${tt[1]} == *+00:00 ]] || err_exit 'tt[1] is not today'
+[[ ${tt[2]} == *+00:00 ]] || err_exit 'tt[2] is not tomorrow'
+[[ ${tt[3]} == *+14:00 ]] || err_exit 'tt[0] is not 2pm'
+unset tt
+Time_t tt=('2008-08-11+00:00:00,yesterday' '2008-08-11+00:00:00,today' '2008-08-11+00:00:00,tomorrow')
+tt[3]=9am
+tt[4]=5pm
+(( (tt[1] - tt[0] ) == 24*3600 )) || err_exit 'today-yesterday not one day'
+(( (tt[2] - tt[1] ) == 24*3600 )) || err_exit 'tomorrow-today not one day'
+(( (tt[4] - tt[3] ) == 8*3600 )) || err_exit '9am .. 5pm is not 8 hours'
+unset tt
+Time_t tt=([yesterday]='2008-08-11+00:00:00,yesterday' [today]='2008-08-11+00:00:00,today' [tomorrow]='2008-08-11+00:00:00,tomorrow')
+tt[2pm]='2008-08-11+00:00:00,2pm'
+[[ ${tt[yesterday]} == *+00:00 ]] || err_exit 'tt[yesterday] is not yesterday'
+[[ ${tt[today]} == *+00:00 ]] || err_exit 'tt[today] is not today'
+[[ ${tt[tomorrow]} == *+00:00 ]] || err_exit 'tt[tomorrow] is not tomorrow'
+[[ ${tt[2pm]} == *+14:00 ]] || err_exit 'tt[2pm] is not 2pm'
+(( (tt[today] - tt[yesterday] ) == 24*3600 )) || err_exit 'today-yesterday not one day'
+(( (tt[tomorrow] - tt[today] ) == 24*3600 )) || err_exit 'tomorrow-today not one day'
+(( (tt[2pm] - tt[today] ) == 14*3600 )) || err_exit '2pm is not 14 hours'
+unset tt
+exit $Errors
diff --git a/usr/src/lib/libshell/common/tests/types.sh b/usr/src/lib/libshell/common/tests/types.sh
new file mode 100644
index 0000000000..24be9e9863
--- /dev/null
+++ b/usr/src/lib/libshell/common/tests/types.sh
@@ -0,0 +1,268 @@
+########################################################################
+# #
+# This software is part of the ast package #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
+# and is licensed under the #
+# Common Public License, Version 1.0 #
+# by AT&T Intellectual Property #
+# #
+# A copy of the License is available at #
+# http://www.opensource.org/licenses/cpl1.0.txt #
+# (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) #
+# #
+# Information and Software Systems Research #
+# AT&T Research #
+# Florham Park NJ #
+# #
+# David Korn <dgk@research.att.com> #
+# #
+########################################################################
+function err_exit
+{
+ print -u2 -n "\t"
+ print -u2 -r ${Command}[$1]: "${@:2}"
+ (( Errors+=1 ))
+}
+alias err_exit='err_exit $LINENO'
+
+Command=${0##*/}
+integer Errors=0
+integer n=2
+
+typeset -T Type_t=(
+ typeset name=foobar
+ typeset x=(hi=ok bar=yes)
+ typeset y=(xa=xx xq=89)
+ typeset -A aa=([one]=abc [two]=def)
+ typeset -a ia=(abc def)
+ typeset -i z=5
+)
+for ((i=0; i < 10; i++))
+do
+ Type_t r s
+ [[ $r == "$s" ]] || err_exit 'r is not equal to s'
+ typeset -C x=r.x
+ y=(xa=bb xq=cc)
+ y2=xyz
+ z2=xyz
+ typeset -C z=y
+ [[ $y == "$z" ]] || err_exit 'y is not equal to z'
+ typeset -C s.y=z
+ [[ $y == "${s.y}" ]] || err_exit 'y is not equal to s.y'
+ .sh.q=$y
+ typeset -C www=.sh.q
+ [[ $www == "$z" ]] || err_exit 'www is not equal to z'
+ typeset -C s.x=r.x
+ [[ ${s.x} == "${r.x}" ]] || err_exit 's.x is not equal to r.x'
+
+ function foo
+ {
+ nameref x=$1 y=$2
+ typeset z=$x
+ y=$x
+ [[ $x == "$y" ]] || err_exit "x is not equal to y with ${!x}"
+ }
+ foo r.y y
+ [[ $y == "${r.y}" ]] || err_exit 'y is not equal to r.y'
+ typeset -C y=z
+ foo y r.y
+ [[ $y == "${r.y}" ]] || err_exit 'y is not equal to r.y again'
+ typeset -C y=z
+ (
+ q=${z}
+ [[ $q == "$z" ]] || err_exit 'q is not equal to z'
+ z=abc
+ )
+ [[ $z == "$y" ]] || err_exit 'value of z not preserved after subshell'
+ unset z y r s x z2 y2 www .sh.q
+done
+typeset -T Frame_t=( typeset file lineno )
+Frame_t frame
+[[ $(typeset -p frame) == 'Frame_t frame=(typeset file;typeset lineno;)' ]] || err_exit 'empty fields in type not displayed'
+x=( typeset -a arr=([2]=abc [4]=(x=1 y=def));zz=abc)
+typeset -C y=x
+[[ "$x" == "$y" ]] || print -u2 'y is not equal to x'
+Type_t z=(y=(xa=bb xq=cc))
+typeset -A arr=([foo]=one [bar]=2)
+typeset -A brr=([foo]=one [bar]=2)
+[[ "${arr[@]}" == "${brr[@]}" ]] || err_exit 'arr is not brr'
+for ((i=0; i < 1; i++))
+do typeset -m zzz=x
+ [[ $zzz == "$y" ]] || err_exit 'zzz is not equal to y'
+ typeset -m x=zzz
+ [[ $x == "$y" ]] || err_exit 'x is not equal to y'
+ Type_t t=(y=(xa=bb xq=cc))
+ typeset -m r=t
+ [[ $r == "$z" ]] || err_exit 'r is not equal to z'
+ typeset -m t=r
+ [[ $t == "$z" ]] || err_exit 't is not equal to z'
+ typeset -m crr=arr
+ [[ "${crr[@]}" == "${brr[@]}" ]] || err_exit 'crr is not brr'
+ typeset -m arr=crr
+ [[ "${arr[@]}" == "${brr[@]}" ]] || err_exit 'brr is not arr'
+done
+typeset -m brr[foo]=brr[bar]
+[[ ${brr[foo]} == 2 ]] || err_exit 'move an associative array element fails'
+[[ ${brr[bar]} ]] && err_exit 'brr[bar] should be unset after move'
+unset x y zzz
+x=(a b c)
+typeset -m x[1]=x[2]
+[[ ${x[1]} == c ]] || err_exit 'move an indexed array element fails'
+[[ ${x[2]} ]] && err_exit 'x[2] should be unset after move'
+trap 'rm -f /tmp/kshtype$$' EXIT
+cat > /tmp/kshtype$$ <<- \+++
+ typeset -T Pt_t=(float x=1. y=0.)
+ Pt_t p=(y=2)
+ print -r -- ${p.y}
++++
+expected=2
+got=$(. /tmp/kshtype$$) 2>/dev/null
+[[ "$got" == "$expected" ]] || err_exit "typedefs in dot script failed -- expected '$expected', got '$got'"
+typeset -T X_t=(
+ typeset x=foo y=bar
+ typeset s=${_.x}
+ create()
+ {
+ _.y=bam
+ }
+)
+X_t x
+[[ ${x.x} == foo ]] || err_exit 'x.x should be foo'
+[[ ${x.y} == bam ]] || err_exit 'x.y should be bam'
+[[ ${x.s} == ${x.x} ]] || err_exit 'x.s should be x.x'
+typeset -T Y_t=( X_t r )
+Y_t z
+[[ ${z.r.x} == foo ]] || err_exit 'z.r.x should be foo'
+[[ ${z.r.y} == bam ]] || err_exit 'z.r.y should be bam'
+[[ ${z.r.s} == ${z.r.x} ]] || err_exit 'z.r.s should be z.r.x'
+
+unset xx yy
+typeset -T xx=(typeset yy=zz)
+xx=yy
+{ typeset -T xx=(typeset yy=zz) ;} 2>/dev/null && err_exit 'type redefinition should fail'
+$SHELL 2> /dev/null <<- +++ || err_exit 'typedef with only f(){} fails'
+ typeset -T X_t=(
+ f()
+ {
+ print ok
+ }
+ )
++++
+$SHELL 2> /dev/null <<- +++ || err_exit 'unable to redefine f discipline function'
+ typeset -T X_t=(
+ x=1
+ f()
+ {
+ print ok
+ }
+ )
+ X_t z=(
+ function f
+ {
+ print override f
+ }
+ )
++++
+$SHELL 2> /dev/null <<- +++ && err_exit 'invalid discipline name should be an error'
+ typeset -T X_t=(
+ x=1
+ f()
+ {
+ print ok
+ }
+ )
+ X_t z=(
+ function g
+ {
+ print override f
+ }
+ )
++++
+# compound variables containing type variables
+Type_t r
+var=(
+ typeset x=foobar
+ Type_t r
+ integer z=5
+)
+[[ ${var.r} == "$r" ]] || err_exit 'var.r != r'
+(( var.z == 5)) || err_exit 'var.z !=5'
+[[ "$var" == *x=foobar* ]] || err_exit '$var does not contain x=foobar'
+
+typeset -T A_t=(
+ typeset x=aha
+ typeset b=${_.x}
+)
+unset x
+A_t x
+expected=aha
+got=${x.b}
+[[ "$got" == "$expected" ]] || err_exit "type '_' reference failed -- expected '$expected', got '$got'"
+
+typeset -T Tst_t=(
+ function f
+ {
+ A_t a
+ print ${ _.g ${a.x}; }
+ }
+ function g
+ {
+ print foo
+ }
+)
+Tst_t tst
+expected=foo
+got=${ tst.f;}
+[[ "$got" == "$expected" ]] || err_exit "_.g where g is a function in type discipline method failed -- expected '$expected', got '$got'"
+
+typeset -T B_t=(
+ integer -a arr
+ function f
+ {
+ (( _.arr[0] = 0 ))
+ (( _.arr[1] = 1 ))
+ print ${_.arr[*]}
+ }
+)
+unset x
+B_t x
+expected='0 1'
+got=${ x.f;}
+[[ "$got" == "$expected" ]] || err_exit "array assignment of subscripts in type discipline arithmetic failed -- expected '$expected', got '$got'"
+
+typeset -T Fileinfo_t=(
+ size=-1
+ typeset -a text=()
+ integer mtime=-1
+)
+Fileinfo_t -A _Dbg_filenames
+Fileinfo_t finfo
+function bar
+{
+ finfo.text=(line1 line2 line3)
+ finfo.size=${#finfo.text[@]}
+ _Dbg_filenames[foo]=finfo
+}
+bar
+
+expected='Fileinfo_t -A _Dbg_filenames=([foo]=(size=2;typeset -C -a text=([0]=line1 [1]=line2 [2]=line3);typeset -l -i mtime=-1;))'
+got=$(typeset -p _Dbg_filenames)
+[[ "$got" == "$expected" ]] || {
+ got=$(printf %q "$got")
+ err_exit "copy to associative array of types in function failed -- expected '$expected', got '$got'"
+}
+
+$SHELL > /dev/null <<- '+++++' || err_exit 'passing _ as nameref arg not working'
+ function f1
+ {
+ typeset -n v=$1
+ print -r -- "$v"
+ }
+ typeset -T A_t=(
+ typeset blah=xxx
+ function f { f1 _ ;}
+ )
+ A_t a
+ [[ ${ a.f ./t1;} == "$a" ]]
++++++
+exit $Errors
diff --git a/usr/src/lib/libshell/common/tests/variables.sh b/usr/src/lib/libshell/common/tests/variables.sh
index bc499c890c..1808d2fbcf 100644
--- a/usr/src/lib/libshell/common/tests/variables.sh
+++ b/usr/src/lib/libshell/common/tests/variables.sh
@@ -1,10 +1,10 @@
########################################################################
# #
# This software is part of the ast package #
-# Copyright (c) 1982-2007 AT&T Knowledge Ventures #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
-# by AT&T Knowledge Ventures #
+# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# http://www.opensource.org/licenses/cpl1.0.txt #
@@ -27,6 +27,12 @@ alias err_exit='err_exit $LINENO'
Command=${0##*/}
integer Errors=0
+
+[[ ${.sh.version} == "$KSH_VERSION" ]] || err_exit '.sh.version != KSH_VERSION'
+unset ss
+[[ ${@ss} ]] && err_exit '${@ss} should be empty string when ss is unset'
+[[ ${!ss} == ss ]] || err_exit '${!ss} should be ss when ss is unset'
+[[ ${#ss} == 0 ]] || err_exit '${#ss} should be 0 when ss is unset'
# RANDOM
if (( RANDOM==RANDOM || $RANDOM==$RANDOM ))
then err_exit RANDOM variable not working
@@ -97,8 +103,8 @@ fi
# check for attributes across subshells
typeset -i x=3
y=1/0
-if ( typeset x=y) 2> /dev/null
-then print -u2 "attributes not passed to subshells"
+if ( typeset x=y ) 2> /dev/null
+then err_exit "attributes not passed to subshells"
fi
unset x
function x.set
@@ -249,7 +255,7 @@ set -- "${@-}"
if (( $# !=1 ))
then err_exit '"${@-}" not expanding to null string'
fi
-for i in : % + / 3b '**' '***' '@@' '{' '[' '}' !! '*a' '@a' '$foo'
+for i in : % + / 3b '**' '***' '@@' '{' '[' '}' !! '*a' '$foo'
do (eval : \${"$i"} 2> /dev/null) && err_exit "\${$i} not an syntax error"
done
unset IFS
@@ -467,7 +473,7 @@ TIMEFORMAT='this is a test'
: ${.sh.version}
[[ $(whence rm) == *.sh.* ]] && err_exit '.sh. prefixed to tracked alias name'
: ${.sh.version}
-[[ $(cd /bin;env | grep PWD) == *.sh.* ]] && err_exit '.sh. prefixed to PWD'
+[[ $(cd /bin;env | grep PWD=) == *.sh.* ]] && err_exit '.sh. prefixed to PWD'
# unset discipline bug fix
dave=dave
function dave.unset
@@ -476,9 +482,26 @@ function dave.unset
}
unset dave
[[ $(typeset +f) == *dave.* ]] && err_exit 'unset discipline not removed'
-print 'print ${VAR}' > /tmp/script$$
-VAR=foo /tmp/script$$ > /tmp/out$$
-[[ $(</tmp/out$$) == foo ]] || err_exit 'environment variables not passed to scripts'
+
+print 'print ${VAR}' > /tmp/script$$
+unset VAR
+VAR=new /tmp/script$$ > /tmp/out$$
+got=$(</tmp/out$$)
+[[ $got == new ]] || err_exit "previously unset environment variable not passed to script, expected 'new', got '$got'"
+[[ ! $VAR ]] || err_exit "previously unset environment variable set after script, expected '', got '$VAR'"
+unset VAR
+VAR=old
+VAR=new /tmp/script$$ > /tmp/out$$
+got=$(</tmp/out$$)
+[[ $got == new ]] || err_exit "environment variable covering local variable not passed to script, expected 'new', got '$got'"
+[[ $VAR == old ]] || err_exit "previously set local variable changed after script, expected 'old', got '$VAR'"
+unset VAR
+export VAR=old
+VAR=new /tmp/script$$ > /tmp/out$$
+got=$(</tmp/out$$)
+[[ $got == new ]] || err_exit "environment variable covering environment variable not passed to script, expected 'new', got '$got'"
+[[ $VAR == old ]] || err_exit "previously set environment variable changed after script, expected 'old', got '$VAR'"
+
(
unset dave
function dave.append
@@ -555,4 +578,48 @@ x[0]=0 x[1]=1 x[2]=2 x[3]=3
[[ ${x[@]} == '12 8 5 3' ]] || err_exit 'set discipline for indexed array not working correctly'
((SECONDS=3*4))
(( SECONDS < 12 || SECONDS > 12.1 )) && err_exit "SECONDS is $SECONDS and should be close to 12"
+unset a
+function a.set
+{
+ print -r -- "${.sh.name}=${.sh.value}"
+}
+[[ $(a=1) == a=1 ]] || err_exit 'set discipline not working in subshell assignment'
+[[ $(a=1 :) == a=1 ]] || err_exit 'set discipline not working in subshell command'
+
+[[ ${.sh.subshell} == 0 ]] || err_exit '${.sh.subshell} should be 0'
+(
+ [[ ${.sh.subshell} == 1 ]] || err_exit '${.sh.subshell} should be 1'
+ (
+ [[ ${.sh.subshell} == 2 ]] || err_exit '${.sh.subshell} should be 2'
+ )
+)
+
+set -- {1..32768}
+(( $# == 32768 )) || err_exit "\$# failed -- expected 32768, got $#"
+set --
+
+unset r v x
+path=$PATH
+x=foo
+for v in EDITOR VISUAL OPTIND CDPATH FPATH PATH ENV LINENO RANDOM SECONDS _
+do nameref r=$v
+ unset $v
+ if ( $SHELL -c "unset $v; : \$$v" ) 2>/dev/null
+ then [[ $r ]] && err_exit "unset $v failed -- expected '', got '$r'"
+ r=$x
+ [[ $r == $x ]] || err_exit "$v=$x failed -- expected '$x', got '$r'"
+ else err_exit "unset $v; : \$$v failed"
+ fi
+done
+for v in LC_ALL LC_CTYPE LC_MESSAGES LC_COLLATE LC_NUMERIC
+do nameref r=$v
+ unset $v
+ [[ $r ]] && err_exit "unset $v failed -- expected '', got '$r'"
+ d=$($SHELL -c "$v=$x" 2>&1)
+ [[ $d ]] || err_exit "$v=$x failed -- expected locale diagnostic"
+ ( r=$x; [[ ! $r ]] ) 2>/dev/null || err_exit "$v=$x failed -- expected ''"
+ ( r=C; r=$x; [[ $r == C ]] ) 2>/dev/null || err_exit "$v=C; $v=$x failed -- expected 'C'"
+done
+PATH=$path
+
exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/vartree1.sh b/usr/src/lib/libshell/common/tests/vartree1.sh
new file mode 100644
index 0000000000..88116a24c3
--- /dev/null
+++ b/usr/src/lib/libshell/common/tests/vartree1.sh
@@ -0,0 +1,214 @@
+########################################################################
+# #
+# This software is part of the ast package #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
+# and is licensed under the #
+# Common Public License, Version 1.0 #
+# by AT&T Intellectual Property #
+# #
+# A copy of the License is available at #
+# http://www.opensource.org/licenses/cpl1.0.txt #
+# (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) #
+# #
+# Information and Software Systems Research #
+# AT&T Research #
+# Florham Park NJ #
+# #
+# David Korn <dgk@research.att.com> #
+# #
+########################################################################
+#
+# variable tree test #001
+# Propose of this test is whether ksh93 handles global variable trees
+# and function-local variable trees the same way, including "nameref"
+# and "unset" handling.
+#
+
+function err_exit
+{
+ print -u2 -n "\t"
+ print -u2 -r ${Command}[$1]: "${@:2}"
+ (( Errors+=1 ))
+}
+
+alias err_exit='err_exit $LINENO'
+
+function build_tree
+{
+#set -o errexit -o xtrace
+ typeset index
+ typeset s
+ typeset i
+ typeset dummy
+ typeset a b c d e f
+
+ nameref dest_tree="$1" # destination tree
+ nameref srcdata="$2" # source data
+ typeset tree_mode="$3" # mode to define the type of leads
+
+ typeset -A dest_tree.l1
+
+ for index in "${!srcdata.hashnodes[@]}" ; do
+ nameref node=srcdata.hashnodes["${index}"]
+
+ for i in "${node.xlfd[@]}" ; do
+ IFS='-' read dummy a b c d e f <<<"$i"
+
+ if [[ "$a" == "" ]] ; then
+ a="$dummy"
+ fi
+
+ [[ "$a" == "" ]] && a='-'
+ [[ "$b" == "" ]] && b='-'
+ [[ "$c" == "" ]] && c='-'
+
+ if [[ "${dest_tree.l1["$a"]}" == "" ]] ; then
+ #if ! (unset dest_tree.l1["$a"]) ; then
+ typeset -A dest_tree.l1["$a"].l2
+ fi
+
+ if [[ "${dest_tree.l1["$a"].l2["$b"]}" == "" ]] ; then
+ #if ! (unset dest_tree.l1["$a"].l2["$b"]) ; then
+ typeset -A dest_tree.l1["$a"].l2["$b"].l3
+ fi
+
+ if [[ "${!dest_tree.l1["$a"].l2["$b"].l3["$c"].entries[*]}" == "" ]] ; then
+ typeset -A dest_tree.l1["$a"].l2["$b"].l3["$c"].entries
+ fi
+
+ #dest_tree.l1["$a"].l2["$b"].l3["$c"].entries+=( "$index" )
+ typeset new_index
+ if [[ "${tree_mode}" == "leaf_name" ]] ; then
+ new_index=$(( ${#dest_tree.l1["$a"].l2["$b"].l3["$c"].entries[@]}+1 ))
+ else
+ new_index="${node.name}"
+
+ # skip if the leaf node already exists
+ if [[ "${dest_tree.l1["$a"].l2["$b"].l3["$c"].entries[${new_index}]}" != "" ]] ; then
+ continue
+ fi
+ fi
+
+ add_tree_leaf dest_tree.l1["$a"].l2["$b"].l3["$c"].entries[${new_index}] "${index}" "${tree_mode}"
+ done
+ done
+
+ return 0
+}
+
+function add_tree_leaf
+{
+ nameref tree_leafnode="$1"
+ nameref data_node=srcdata.hashnodes["$2"]
+ typeset add_mode="$3"
+
+ case "${add_mode}" in
+ "leaf_name")
+ tree_leafnode="${data_node.name}"
+ return 0
+ ;;
+ "leaf_compound")
+ tree_leafnode=(
+ typeset name="${data_node.name}"
+ typeset -a filenames=( "${data_node.filenames[@]}" )
+ typeset -a comments=( "${data_node.comments[@]}" )
+ typeset -a xlfd=( "${data_node.xlfd[@]}" )
+ )
+ return 0
+ ;;
+ *)
+ print -u2 -f "ERROR: Unknown mode %s in add_tree_leaf\n" "${add_mode}"
+ return 1
+ ;;
+ esac
+
+ # not reached
+ return 1
+}
+
+# "mysrcdata_local" and "mysrcdata_global" must be identical
+typeset mysrcdata_global=(
+ typeset -A hashnodes=(
+ [abcd]=(
+ name='abcd'
+ typeset -a xlfd=(
+ '-urw-itc zapfchancery-medium-i-normal--0-0-0-0-p-0-iso8859-1'
+ '-urw-itc zapfdingbats-medium-r-normal--0-0-0-0-p-0-adobe-fontspecific'
+ '-urw-itc zapfdingbats-medium-r-normal--0-0-0-0-p-0-sun-fontspecific'
+ )
+ typeset -a comments=(
+ 'comment 1'
+ 'comment 2'
+ 'comment 3'
+ )
+ typeset -a filenames=(
+ '/home/foo/abcd_1'
+ '/home/foo/abcd_2'
+ '/home/foo/abcd_3'
+ )
+ )
+ )
+)
+
+mytree_global=()
+
+function main
+{
+ # "mysrcdata_local" and "mysrcdata_global" must be identical
+ typeset mysrcdata_local=(
+ typeset -A hashnodes=(
+ [abcd]=(
+ name='abcd'
+ typeset -a xlfd=(
+ '-urw-itc zapfchancery-medium-i-normal--0-0-0-0-p-0-iso8859-1'
+ '-urw-itc zapfdingbats-medium-r-normal--0-0-0-0-p-0-adobe-fontspecific'
+ '-urw-itc zapfdingbats-medium-r-normal--0-0-0-0-p-0-sun-fontspecific'
+ )
+ typeset -a comments=(
+ 'comment 1'
+ 'comment 2'
+ 'comment 3'
+ )
+ typeset -a filenames=(
+ '/home/foo/abcd_1'
+ '/home/foo/abcd_2'
+ '/home/foo/abcd_3'
+ )
+ )
+ )
+ )
+
+ # build tree using global tree variables
+ build_tree mytree_global mysrcdata_global leaf_compound || \
+ err_exit 'build_tree mytree_global mysrcdata_global leaf_compound returned an error'
+
+ (( $(print -r -- "${mytree_global}" | wc -l) > 10 )) || err_exit "Compound tree 'mytree_global' too small."
+
+ # build tree using local tree variables
+ mytree_local=()
+ build_tree mytree_local mysrcdata_local leaf_compound || \
+ err_exit 'build_tree mytree_local mysrcdata_local leaf_compound returned an error'
+
+ (( $(print -r -- "${mytree_local}" | wc -l) > 10 )) || err_exit "Compound tree 'mytree_local' too small."
+
+ # Compare trees
+ if [[ "${mytree_global}" != "${mytree_local}" ]] ; then
+ err_exit "Compound trees 'mytree_local' and 'mytree_global' not identical"
+ fi
+
+ unset 'mytree_global.l1[urw].l2[itc zapfdingbats].l3[medium].entries[abcd].filenames[0]' ||
+ err_exit "Variable 'mytree_global.l1[urw].l2[itc zapfdingbats].l3[medium].entries[abcd].filenames[0]' not found."
+
+ [[ "${mytree_global}" != "${mytree_local}" ]] || err_exit "mytree_global and mytree_local should differ"
+
+ unset 'mytree_local.l1[urw].l2[itc zapfdingbats].l3[medium].entries[abcd].filenames[0]' ||
+ err_exit "Variable 'mytree_local.l1[urw].l2[itc zapfdingbats].l3[medium].entries[abcd].filenames[0]' not found."
+
+ # Compare trees (after "unset")
+ if [[ "${mytree_global}" != "${mytree_local}" ]] ; then
+ err_exit "Compound trees 'mytree_local' and 'mytree_global' not identical after unset"
+ fi
+}
+
+main
+exit $((Errors))
diff --git a/usr/src/lib/libshell/common/tests/vartree2.sh b/usr/src/lib/libshell/common/tests/vartree2.sh
new file mode 100644
index 0000000000..38512d5a42
--- /dev/null
+++ b/usr/src/lib/libshell/common/tests/vartree2.sh
@@ -0,0 +1,334 @@
+########################################################################
+# #
+# This software is part of the ast package #
+# Copyright (c) 1982-2008 AT&T Intellectual Property #
+# and is licensed under the #
+# Common Public License, Version 1.0 #
+# by AT&T Intellectual Property #
+# #
+# A copy of the License is available at #
+# http://www.opensource.org/licenses/cpl1.0.txt #
+# (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) #
+# #
+# Information and Software Systems Research #
+# AT&T Research #
+# Florham Park NJ #
+# #
+# David Korn <dgk@research.att.com> #
+# #
+########################################################################
+#
+# variable tree test #002
+# Propose of this test is whether ksh93 handles global variable trees
+# and function-local variable trees the same way, including "nameref"
+# and "unset" handling.
+#
+
+function err_exit
+{
+ print -u2 -n "\t"
+ print -u2 -r ${Command}[$1]: "${@:2}"
+ (( Errors+=1 ))
+}
+
+alias err_exit='err_exit $LINENO'
+
+# "built_tree1" and "built_tree2" are identical except the way how they test
+# whether a variable exists:
+# - "built_tree1" uses "${varname}" != "", e.g. looking whether the variable
+# as non-zero length content
+# - "built_tree2" uses "! (unset varname)", e.g. "unset" in a subshell
+function build_tree1
+{
+#set -o errexit -o xtrace
+ typeset index
+ typeset s
+ typeset i
+ typeset dummy
+ typeset a b c d e f
+
+ nameref dest_tree="$1" # destination tree
+ nameref srcdata="$2" # source data
+ typeset tree_mode="$3" # mode to define the type of leads
+
+ typeset -A dest_tree.l1
+
+ for index in "${!srcdata.hashnodes[@]}" ; do
+ nameref node=srcdata.hashnodes["${index}"]
+
+ for i in "${node.xlfd[@]}" ; do
+ IFS='-' read dummy a b c d e f <<<"$i"
+
+ if [[ "$a" == "" ]] ; then
+ a="$dummy"
+ fi
+
+ [[ "$a" == "" ]] && a='-'
+ [[ "$b" == "" ]] && b='-'
+ [[ "$c" == "" ]] && c='-'
+
+ if [[ "${dest_tree.l1["$a"]}" == "" ]] ; then
+ #if ! (unset dest_tree.l1["$a"]) ; then
+ typeset -A dest_tree.l1["$a"].l2
+ fi
+
+ if [[ "${dest_tree.l1["$a"].l2["$b"]}" == "" ]] ; then
+ #if ! (unset dest_tree.l1["$a"].l2["$b"]) ; then
+ typeset -A dest_tree.l1["$a"].l2["$b"].l3
+ fi
+
+ if [[ "${!dest_tree.l1["$a"].l2["$b"].l3["$c"].entries[*]}" == "" ]] ; then
+ typeset -A dest_tree.l1["$a"].l2["$b"].l3["$c"].entries
+ fi
+
+ typeset new_index
+ if [[ "${tree_mode}" == "leaf_name" ]] ; then
+ new_index=$(( ${#dest_tree.l1["$a"].l2["$b"].l3["$c"].entries[@]}+1 ))
+ else
+ new_index="${node.name}"
+
+ # skip if the leaf node already exists
+ if [[ "${dest_tree.l1["$a"].l2["$b"].l3["$c"].entries[${new_index}]}" != "" ]] ; then
+ continue
+ fi
+ fi
+
+ add_tree_leaf dest_tree.l1["$a"].l2["$b"].l3["$c"].entries[${new_index}] "${index}" "${tree_mode}"
+ done
+ done
+
+ return 0
+}
+
+# "built_tree1" and "built_tree2" are identical except the way how they test
+# whether a variable exists:
+# - "built_tree1" uses "${varname}" != "", e.g. looking whether the variable
+# as non-zero length content
+# - "built_tree2" uses "! (unset varname)", e.g. "unset" in a subshell
+function build_tree2
+{
+#set -o errexit -o xtrace
+ typeset index
+ typeset s
+ typeset i
+ typeset dummy
+ typeset a b c d e f
+
+ nameref dest_tree="$1" # destination tree
+ nameref srcdata="$2" # source data
+ typeset tree_mode="$3" # mode to define the type of leads
+
+ typeset -A dest_tree.l1
+
+ for index in "${!srcdata.hashnodes[@]}" ; do
+ nameref node=srcdata.hashnodes["${index}"]
+
+ for i in "${node.xlfd[@]}" ; do
+ IFS='-' read dummy a b c d e f <<<"$i"
+
+ if [[ "$a" == "" ]] ; then
+ a="$dummy"
+ fi
+
+ [[ "$a" == "" ]] && a='-'
+ [[ "$b" == "" ]] && b='-'
+ [[ "$c" == "" ]] && c='-'
+
+ #if [[ "${dest_tree.l1["$a"]}" == "" ]] ; then
+ if ! (unset dest_tree.l1["$a"]) ; then
+ typeset -A dest_tree.l1["$a"].l2
+ fi
+
+ #if [[ "${dest_tree.l1["$a"].l2["$b"]}" == "" ]] ; then
+ if ! (unset dest_tree.l1["$a"].l2["$b"]) ; then
+ typeset -A dest_tree.l1["$a"].l2["$b"].l3
+ fi
+
+ if [[ "${!dest_tree.l1["$a"].l2["$b"].l3["$c"].entries[*]}" == "" ]] ; then
+ typeset -A dest_tree.l1["$a"].l2["$b"].l3["$c"].entries
+ fi
+
+ typeset new_index
+ if [[ "${tree_mode}" == "leaf_name" ]] ; then
+ new_index=$(( ${#dest_tree.l1["$a"].l2["$b"].l3["$c"].entries[@]}+1 ))
+ else
+ new_index="${node.name}"
+
+ # skip if the leaf node already exists
+ if [[ "${dest_tree.l1["$a"].l2["$b"].l3["$c"].entries[${new_index}]}" != "" ]] ; then
+ continue
+ fi
+ fi
+
+ add_tree_leaf dest_tree.l1["$a"].l2["$b"].l3["$c"].entries[${new_index}] "${index}" "${tree_mode}"
+ done
+ done
+
+ return 0
+}
+
+
+function add_tree_leaf
+{
+ nameref tree_leafnode="$1"
+ nameref data_node=srcdata.hashnodes["$2"]
+ typeset add_mode="$3"
+
+ case "${add_mode}" in
+ "leaf_name")
+ tree_leafnode="${data_node.name}"
+ return 0
+ ;;
+ "leaf_compound")
+ tree_leafnode=(
+ typeset name="${data_node.name}"
+ typeset -a filenames=( "${data_node.filenames[@]}" )
+ typeset -a comments=( "${data_node.comments[@]}" )
+ typeset -a xlfd=( "${data_node.xlfd[@]}" )
+ )
+ return 0
+ ;;
+ *)
+ print -u2 -f "ERROR: Unknown mode %s in add_tree_leaf\n" "${add_mode}"
+ return 1
+ ;;
+ esac
+
+ # not reached
+ return 1
+}
+
+# "mysrcdata_local" and "mysrcdata_global" must be identical
+typeset mysrcdata_global=(
+ typeset -A hashnodes=(
+ [abcd]=(
+ name='abcd'
+ typeset -a xlfd=(
+ '-urw-itc zapfchancery-medium-i-normal--0-0-0-0-p-0-iso8859-1'
+ '-urw-itc zapfdingbats-medium-r-normal--0-0-0-0-p-0-adobe-fontspecific'
+ '-urw-itc zapfdingbats-medium-r-normal--0-0-0-0-p-0-sun-fontspecific'
+ )
+ typeset -a comments=(
+ 'comment 1'
+ 'comment 2'
+ 'comment 3'
+ )
+ typeset -a filenames=(
+ '/home/foo/abcd_1'
+ '/home/foo/abcd_2'
+ '/home/foo/abcd_3'
+ )
+ )
+ )
+)
+
+mytree_global1=()
+mytree_global2=()
+
+function main
+{
+ # "mysrcdata_local" and "mysrcdata_global" must be identical
+ typeset mysrcdata_local=(
+ typeset -A hashnodes=(
+ [abcd]=(
+ name='abcd'
+ typeset -a xlfd=(
+ '-urw-itc zapfchancery-medium-i-normal--0-0-0-0-p-0-iso8859-1'
+ '-urw-itc zapfdingbats-medium-r-normal--0-0-0-0-p-0-adobe-fontspecific'
+ '-urw-itc zapfdingbats-medium-r-normal--0-0-0-0-p-0-sun-fontspecific'
+ )
+ typeset -a comments=(
+ 'comment 1'
+ 'comment 2'
+ 'comment 3'
+ )
+ typeset -a filenames=(
+ '/home/foo/abcd_1'
+ '/home/foo/abcd_2'
+ '/home/foo/abcd_3'
+ )
+ )
+ )
+ )
+
+ #### Build tree using global tree variables
+ build_tree1 mytree_global1 mysrcdata_global leaf_compound || \
+ err_exit 'build_tree1 mytree_global1 mysrcdata_global leaf_compound returned an error'
+ (( $(print -r -- "${mytree_global1}" | wc -l) > 10 )) || err_exit "Compound tree 'mytree_global1' too small."
+
+ build_tree2 mytree_global2 mysrcdata_global leaf_compound || \
+ err_exit 'build_tree2 mytree_global2 mysrcdata_global leaf_compound returned an error'
+ (( $(print -r -- "${mytree_global2}" | wc -l) > 10 )) || err_exit "Compound tree 'mytree_global2' too small."
+
+
+ #### build tree using local tree variables
+ mytree_local1=()
+ mytree_local2=()
+
+ build_tree1 mytree_local1 mysrcdata_local leaf_compound || \
+ err_exit 'build_tree1 mytree_local1 mysrcdata_local leaf_compound returned an error'
+ (( $(print -r -- "${mytree_local1}" | wc -l) > 10 )) || err_exit "Compound tree 'mytree_local1' too small."
+
+ build_tree2 mytree_local2 mysrcdata_local leaf_compound || \
+ err_exit 'build_tree2 mytree_local2 mysrcdata_local leaf_compound returned an error'
+ (( $(print -r -- "${mytree_local2}" | wc -l) > 10 )) || err_exit "Compound tree 'mytree_local2' too small."
+
+
+ #### Compare treess
+ if [[ "${mytree_global1}" != "${mytree_local1}" ]] ; then
+ err_exit "Compound trees 'mytree_global1' and 'mytree_local1' not identical"
+ fi
+
+ if [[ "${mytree_global1}" != "${mytree_global2}" ]] ; then
+ err_exit "Compound trees 'mytree_global1' and 'mytree_global2' not identical"
+ fi
+
+ if [[ "${mytree_local1}" != "${mytree_local2}" ]] ; then
+ err_exit "Compound trees 'mytree_local1' and 'mytree_local2' not identical"
+ fi
+
+
+ #### test "unset" in a subshell
+ ( unset 'mytree_global1.l1[urw].l2[itc zapfdingbats]' ) || \
+ err_exit "Try 1: Variable 'mytree_global1.l1[urw].l2[itc zapfdingbats]' not found."
+ ( unset 'mytree_global1.l1[urw].l2[itc zapfdingbats]' ) || \
+ err_exit "Try 2: Variable 'mytree_global1.l1[urw].l2[itc zapfdingbats]' not found."
+
+ # remove parent node (array element) and then check whether the child is gone, too:
+ (
+ unset 'mytree_global1.l1[urw].l2[itc zapfdingbats]'
+ unset 'mytree_global1.l1[urw].l2[itc zapfdingbats].l3[medium].entries[abcd].filenames[0]'
+ ) && err_exit "Global: Parent node removed (array element), child still exists"
+ (
+ unset 'mytree_local1.l1[urw].l2[itc zapfdingbats]'
+ unset 'mytree_local1.l1[urw].l2[itc zapfdingbats].l3[medium].entries[abcd].filenames[0]'
+ ) && err_exit "Local: Parent node removed (array element), child still exists"
+
+ # remove parent node (array variable) and then check whether the child is gone, too:
+ (
+ unset 'mytree_local1.l1[urw].l2'
+ unset 'mytree_local1.l1[urw].l2[itc zapfdingbats].l3[medium].entries[abcd].filenames[0]'
+ ) && err_exit "Global: Parent node removed (array variable), child still exists"
+ (
+ unset 'mytree_local1.l1[urw].l2'
+ unset 'mytree_local1.l1[urw].l2[itc zapfdingbats].l3[medium].entries[abcd].filenames[0]'
+ ) && err_exit "Local: Parent node removed (array variable), child still exists"
+
+
+ #### test "unset" and compare trees
+ unset 'mytree_global1.l1[urw].l2[itc zapfdingbats].l3[medium].entries[abcd].filenames[0]' ||
+ err_exit "Variable 'mytree_global1.l1[urw].l2[itc zapfdingbats].l3[medium].entries[abcd].filenames[0]' not found."
+
+ [[ "${mytree_global1}" != "${mytree_local1}" ]] || err_exit "mytree_global1 and mytree_local1 should differ"
+
+ unset 'mytree_local1.l1[urw].l2[itc zapfdingbats].l3[medium].entries[abcd].filenames[0]' ||
+ err_exit "Variable 'mytree_local1.l1[urw].l2[itc zapfdingbats].l3[medium].entries[abcd].filenames[0]' not found."
+
+ # Compare trees (after "unset")
+ if [[ "${mytree_global1}" != "${mytree_local1}" ]] ; then
+ err_exit "Compound trees 'mytree_local1' and 'mytree_global1' not identical after unset"
+ fi
+}
+
+main
+exit $((Errors))
diff --git a/usr/src/lib/libshell/i386/Makefile b/usr/src/lib/libshell/i386/Makefile
index f91f0270e9..79cb51eae6 100644
--- a/usr/src/lib/libshell/i386/Makefile
+++ b/usr/src/lib/libshell/i386/Makefile
@@ -18,12 +18,11 @@
#
# CDDL HEADER END
#
+
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
include ../Makefile.com
diff --git a/usr/src/lib/libshell/i386/include/ast/history.h b/usr/src/lib/libshell/i386/include/ast/history.h
index 55ead66f9e..bfac5d3b35 100644
--- a/usr/src/lib/libshell/i386/include/ast/history.h
+++ b/usr/src/lib/libshell/i386/include/ast/history.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -65,7 +65,7 @@ extern __MANGLE__ int _Hist;
#define hist_min(hp) ((_Hist=((int)((hp)->histind-(hp)->histsize)))>=0?_Hist:0)
#define hist_max(hp) ((int)((hp)->histind))
/* these are the history interface routines */
-extern __MANGLE__ int sh_histinit __PROTO__((void));
+extern __MANGLE__ int sh_histinit __PROTO__((__V_ *));
extern __MANGLE__ void hist_cancel __PROTO__((History_t*));
extern __MANGLE__ void hist_close __PROTO__((History_t*));
extern __MANGLE__ int hist_copy __PROTO__((char*, int, int, int));
diff --git a/usr/src/lib/libshell/i386/include/ast/nval.h b/usr/src/lib/libshell/i386/include/ast/nval.h
index 06b18217b7..c11fd66143 100644
--- a/usr/src/lib/libshell/i386/include/ast/nval.h
+++ b/usr/src/lib/libshell/i386/include/ast/nval.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -40,6 +40,7 @@
#include <ast.h>
#include <cdt.h>
+#include <option.h>
/* for compatibility with old hash library */
#define Hashtab_t Dt_t
@@ -53,8 +54,7 @@ typedef struct Namfun Namfun_t;
typedef struct Namdisc Namdisc_t;
typedef struct Nambfun Nambfun_t;
typedef struct Namarray Namarr_t;
-typedef struct Nambltin Nambltin_t;
-typedef struct Namtype Namtype_t;
+typedef struct Namdecl Namdecl_t;
/*
* This defines the template for nodes that have their own assignment
@@ -73,13 +73,14 @@ struct Namdisc
Namval_t *(*nextf) __PROTO__((Namval_t*, Dt_t*, Namfun_t*));
Namval_t *(*typef) __PROTO__((Namval_t*, Namfun_t*));
int (*readf) __PROTO__((Namval_t*, Sfio_t*, int, Namfun_t*));
+ int (*writef) __PROTO__((Namval_t*, Sfio_t*, int, Namfun_t*));
};
struct Namfun
{
const Namdisc_t *disc;
char nofree;
- char funs;
+ unsigned char subshell;
unsigned short dsize;
Namfun_t *next;
char *last;
@@ -101,22 +102,14 @@ struct Namarray
long nelem; /* number of elements */
__V_ *(*fun) __PROTO__((Namval_t*,const char*,int)); /* associative arrays */
Namval_t *parent; /* for multi-dimensional */
+ Dt_t *table; /* for subscripts */
+ __V_ *scope; /* non-zerp when scoped */
};
-/* Passed as third argument to a builtin when NV_BLTINOPT is set on node */
-struct Nambltin
+/* The context pointer for declaration command */
+struct Namdecl
{
- __V_ *shp;
- Namval_t *np;
- __V_ *ptr;
- __V_ *data;
- int flags;
-};
-
-struct Namtype
-{
- __V_ *shp;
- Namval_t *np;
+ Namval_t *tp; /* point to type */
const char *optstring;
__V_ *optinfof;
};
@@ -141,6 +134,7 @@ struct Namval
};
#define NV_CLASS ".sh.type"
+#define NV_DATA "_" /* special class or instance variable */
#define NV_MINSZ (sizeof(struct Namval)-sizeof(Dtlink_t)-sizeof(char*))
#define nv_namptr(p,n) ((Namval_t*)((char*)(p)+(n)*NV_MINSZ-sizeof(Dtlink_t)))
@@ -172,13 +166,14 @@ struct Namval
#define NV_SHORT (NV_RJUST) /* when integers are not long */
#define NV_LONG (NV_UTOL) /* for long long and long double */
#define NV_UNSIGN (NV_LTOU) /* for unsigned quantities */
-#define NV_DOUBLE (NV_ZFILL) /* for floating point */
+#define NV_DOUBLE (NV_INTEGER|NV_ZFILL) /* for floating point */
#define NV_EXPNOTE (NV_LJUST) /* for scientific notation */
+#define NV_HEXFLOAT (NV_LTOU) /* for C99 base16 float notation */
/* options for nv_open */
#define NV_APPEND 0x10000 /* append value */
-#define NV_MOVE 0x20000 /* for use with nv_clone */
+#define NV_MOVE 0x8000000 /* for use with nv_clone */
#define NV_ADD 8
/* add node if not found */
#define NV_ASSIGN NV_NOFREE /* assignment is possible */
@@ -194,19 +189,21 @@ struct Namval
#define NV_NODISC NV_IDENT /* ignore disciplines */
#define NV_FUNCT NV_IDENT /* option for nv_create */
-#define NV_BLTINOPT NV_ZFILL /* save state for optimization*/
+#define NV_BLTINOPT NV_ZFILL /* mark builtins in libcmd */
#define NV_PUBLIC (~(NV_NOSCOPE|NV_ASSIGN|NV_IDENT|NV_VARNAME|NV_NOADD))
/* numeric types */
+#define NV_INT16P (NV_LJUST|NV_SHORT|NV_INTEGER)
#define NV_INT16 (NV_SHORT|NV_INTEGER)
#define NV_UINT16 (NV_UNSIGN|NV_SHORT|NV_INTEGER)
+#define NV_UINT16P (NV_LJUSTNV_UNSIGN|NV_SHORT|NV_INTEGER)
#define NV_INT32 (NV_INTEGER)
#define NV_UNT32 (NV_UNSIGN|NV_INTEGER)
#define NV_INT64 (NV_LONG|NV_INTEGER)
#define NV_UINT64 (NV_UNSIGN|NV_LONG|NV_INTEGER)
-#define NV_FLOAT (NV_SHORT|NV_DOUBLE|NV_INTEGER)
-#define NV_LDOUBLE (NV_LONG|NV_DOUBLE|NV_INTEGER)
+#define NV_FLOAT (NV_SHORT|NV_DOUBLE)
+#define NV_LDOUBLE (NV_LONG|NV_DOUBLE)
/* name-value pair macros */
#define nv_isattr(np,f) ((np)->nvflag & (f))
@@ -222,6 +219,7 @@ struct Namval
#define NV_ADELETE 5 /* delete current subscript */
#define NV_AADD 6 /* add subscript if not found */
#define NV_ACURRENT 7 /* return current subscript Namval_t* */
+#define NV_ASETSUB 8 /* set current subscript */
/* The following are for nv_disc */
#define NV_FIRST 1
@@ -230,7 +228,7 @@ struct Namval
#define NV_CLONE 4
/* The following are operations for nv_putsub() */
-#define ARRAY_BITS 24
+#define ARRAY_BITS 22
#define ARRAY_ADD (1L<<ARRAY_BITS) /* add subscript if not found */
#define ARRAY_SCAN (2L<<ARRAY_BITS) /* For ${array[@]} */
#define ARRAY_UNDEF (4L<<ARRAY_BITS) /* For ${array} */
@@ -250,7 +248,9 @@ struct Namval
# endif /* _BLD_shell */
#endif /* _DLL */
/* prototype for array interface*/
+extern __MANGLE__ Namarr_t *nv_arrayptr __PROTO__((Namval_t*));
extern __MANGLE__ Namarr_t *nv_setarray __PROTO__((Namval_t*,__V_*(*)(Namval_t*,const char*,int)));
+extern __MANGLE__ int nv_arraynsub __PROTO__((Namarr_t*));
extern __MANGLE__ __V_ *nv_associative __PROTO__((Namval_t*,const char*,int));
extern __MANGLE__ int nv_aindex __PROTO__((Namval_t*));
extern __MANGLE__ int nv_nextsub __PROTO__((Namval_t*));
@@ -264,6 +264,7 @@ extern __MANGLE__ int nv_clone __PROTO__((Namval_t*, Namval_t*, int));
extern __MANGLE__ void nv_close __PROTO__((Namval_t*));
extern __MANGLE__ __V_ *nv_context __PROTO__((Namval_t*));
extern __MANGLE__ Namval_t *nv_create __PROTO__((const char*, Dt_t*, int,Namfun_t*));
+extern __MANGLE__ void nv_delete __PROTO__((Namval_t*, Dt_t*, int));
extern __MANGLE__ Dt_t *nv_dict __PROTO__((Namval_t*));
extern __MANGLE__ Sfdouble_t nv_getn __PROTO__((Namval_t*, Namfun_t*));
extern __MANGLE__ Sfdouble_t nv_getnum __PROTO__((Namval_t*));
@@ -271,13 +272,15 @@ extern __MANGLE__ char *nv_getv __PROTO__((Namval_t*, Namfun_t*));
extern __MANGLE__ char *nv_getval __PROTO__((Namval_t*));
extern __MANGLE__ Namfun_t *nv_hasdisc __PROTO__((Namval_t*, const Namdisc_t*));
extern __MANGLE__ int nv_isnull __PROTO__((Namval_t*));
+extern __MANGLE__ Namfun_t *nv_isvtree __PROTO__((Namval_t*));
extern __MANGLE__ Namval_t *nv_lastdict __PROTO__((void));
+extern __MANGLE__ Namval_t *nv_mkinttype __PROTO__((char*, size_t, int, const char*, Namdisc_t*));
extern __MANGLE__ void nv_newattr __PROTO__((Namval_t*,unsigned,int));
extern __MANGLE__ Namval_t *nv_open __PROTO__((const char*,Dt_t*,int));
extern __MANGLE__ void nv_putval __PROTO__((Namval_t*,const char*,int));
extern __MANGLE__ void nv_putv __PROTO__((Namval_t*,const char*,int,Namfun_t*));
+extern __MANGLE__ int nv_rename __PROTO__((Namval_t*,int));
extern __MANGLE__ int nv_scan __PROTO__((Dt_t*,void(*)(Namval_t*,__V_*),__V_*,int,int));
-extern __MANGLE__ Namval_t *nv_scoped __PROTO__((Namval_t*));
extern __MANGLE__ char *nv_setdisc __PROTO__((Namval_t*,const char*,Namval_t*,Namfun_t*));
extern __MANGLE__ void nv_setref __PROTO__((Namval_t*, Dt_t*,int));
extern __MANGLE__ int nv_settype __PROTO__((Namval_t*, Namval_t*, int));
@@ -285,11 +288,12 @@ extern __MANGLE__ void nv_setvec __PROTO__((Namval_t*,int,int,char*[]));
extern __MANGLE__ void nv_setvtree __PROTO__((Namval_t*));
extern __MANGLE__ int nv_setsize __PROTO__((Namval_t*,int));
extern __MANGLE__ Namfun_t *nv_disc __PROTO__((Namval_t*,Namfun_t*,int));
-extern __MANGLE__ void nv_unset __PROTO__((Namval_t*));
+extern __MANGLE__ void nv_unset __PROTO__((Namval_t*)); /*obsolete */
+extern __MANGLE__ void _nv_unset __PROTO__((Namval_t*,int));
extern __MANGLE__ Namval_t *nv_search __PROTO__((const char *, Dt_t*, int));
-extern __MANGLE__ void nv_unscope __PROTO__((void));
extern __MANGLE__ char *nv_name __PROTO__((Namval_t*));
extern __MANGLE__ Namval_t *nv_type __PROTO__((Namval_t*));
+extern __MANGLE__ void nv_addtype __PROTO__((Namval_t*,const char*, Optdisc_t*, size_t));
extern __MANGLE__ const Namdisc_t *nv_discfun __PROTO__((int));
#ifdef _DLL
@@ -297,6 +301,7 @@ extern __MANGLE__ const Namdisc_t *nv_discfun __PROTO__((int));
#define __MANGLE__ __LINKAGE__
#endif /* _DLL */
+#define nv_unset(np) _nv_unset(np,0)
#define nv_size(np) nv_setsize((np),-1)
#define nv_stack(np,nf) nv_disc(np,nf,0)
@@ -308,7 +313,7 @@ extern __MANGLE__ const Namdisc_t *nv_discfun __PROTO__((int));
# define nv_istype(np) nv_isattr(np)
# define nv_newtype(np) nv_newattr(np)
# define nv_namset(np,a,b) nv_open(np,a,b)
-# define nv_free(np) nv_unset(np)
+# define nv_free(np) nv_unset(np,0)
# define nv_settype(np,a,b,c) nv_setdisc(np,a,b,c)
# define nv_search(np,a,b) nv_open(np,a,((b)?0:NV_NOADD))
# define settype setdisc
diff --git a/usr/src/lib/libshell/i386/include/ast/shell.h b/usr/src/lib/libshell/i386/include/ast/shell.h
index 37cafa932b..adcefac221 100644
--- a/usr/src/lib/libshell/i386/include/ast/shell.h
+++ b/usr/src/lib/libshell/i386/include/ast/shell.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -36,7 +36,7 @@
*
*/
-#include <cmd.h>
+#include <ast.h>
#include <cdt.h>
#ifdef _SH_PRIVATE
# include "name.h"
@@ -44,7 +44,7 @@
# include <nval.h>
#endif /* _SH_PRIVATE */
-#define SH_VERSION 20060510
+#define SH_VERSION 20071012
#undef NOT_USED
#define NOT_USED(x) (&x,1)
@@ -56,8 +56,9 @@ typedef struct
}
Shopt_t;
-typedef void (*Shinit_f) __PROTO__((int));
-typedef int (*Shbltin_f) __PROTO__((int, char*[], __V_*));
+typedef struct Shell_s Shell_t;
+
+typedef void (*Shinit_f) __PROTO__((Shell_t*, int));
typedef int (*Shwait_f) __PROTO__((int, long, int));
union Shnode_u;
@@ -124,6 +125,7 @@ typedef struct sh_scope
char **argv;
char *cmdname;
char *filename;
+ char *funname;
int lineno;
Dt_t *var_tree;
struct sh_scope *self;
@@ -133,7 +135,7 @@ typedef struct sh_scope
* Saves the state of the shell
*/
-typedef struct sh_static
+struct Shell_s
{
Shopt_t options; /* set -o options */
Dt_t *var_tree; /* for shell variables */
@@ -145,10 +147,11 @@ typedef struct sh_static
int exitval; /* most recent exit value */
unsigned char trapnote; /* set when trap/signal is pending */
char subshell; /* set for virtual subshell */
+ char shcomp; /* set when runing shcomp */
#ifdef _SH_PRIVATE
_SH_PRIVATE
#endif /* _SH_PRIVATE */
-} Shell_t;
+};
/* flags for sh_parse */
#define SH_NL 1 /* Treat new-lines as ; */
@@ -158,9 +161,13 @@ typedef struct sh_static
#define SH_IOCOPROCESS (-2)
#define SH_IOHISTFILE (-3)
+#include <cmd.h>
+
/* symbolic value for sh_fdnotify */
#define SH_FDCLOSE (-1)
+#undef getenv /* -lshell provides its own */
+
#if defined(__EXPORT__) && defined(_DLL)
# ifdef _BLD_shell
#undef __MANGLE__
@@ -179,7 +186,8 @@ extern __MANGLE__ int sh_trap __PROTO__((const char*,int));
extern __MANGLE__ int sh_fun __PROTO__((Namval_t*,Namval_t*, char*[]));
extern __MANGLE__ int sh_funscope __PROTO__((int,char*[],int(*)(__V_*),__V_*,int));
extern __MANGLE__ Sfio_t *sh_iogetiop __PROTO__((int,int));
-extern __MANGLE__ int sh_main __PROTO__((int, char*[], void(*)(int)));
+extern __MANGLE__ int sh_main __PROTO__((int, char*[], Shinit_f));
+extern __MANGLE__ int sh_run __PROTO__((int, char*[]));
extern __MANGLE__ void sh_menu __PROTO__((Sfio_t*, int, char*[]));
extern __MANGLE__ Namval_t *sh_addbuiltin __PROTO__((const char*, int(*)(int, char*[],__V_*), __V_*));
extern __MANGLE__ char *sh_fmtq __PROTO__((const char*));
diff --git a/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/acct b/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/acct
index 9d3441e51c..669b1a6ff4 100644
--- a/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/acct
+++ b/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/acct
@@ -1,11 +1,12 @@
-/* : : generated by iffe version 2007-04-04 : : */
+/* : : generated by iffe version 2008-01-31 : : */
#ifndef _def_acct_ksh93
#define _def_acct_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _lib_acct 1 /* acct() in default lib(s) */
#define _sys_acct 1 /* #include <sys/acct.h> ok */
diff --git a/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/cmds b/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/cmds
index 3ae7ddd4c9..fed6a62efa 100644
--- a/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/cmds
+++ b/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/cmds
@@ -1,11 +1,12 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/cmd/ksh93/features/cmds by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/cmd/ksh93/features/cmds by iffe version 2008-01-31 : : */
#ifndef _def_cmds_ksh93
#define _def_cmds_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _cmd_newgrp 1 /* newgrp in ?(/usr)/(bin|etc|ucb) */
#define _bin_newgrp 1 /* /bin/newgrp found */
diff --git a/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/dynamic b/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/dynamic
index 8c50aac603..c9391e8add 100644
--- a/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/dynamic
+++ b/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/dynamic
@@ -1,18 +1,17 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/cmd/ksh93/features/dynamic by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/cmd/ksh93/features/dynamic by iffe version 2008-01-31 : : */
#ifndef _def_dynamic_ksh93
#define _def_dynamic_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
-#define _hdr_dlfcn 1 /* #include <dlfcn.h> ok */
-#define _sys_dl 1 /* #include <sys/dl.h> ok */
-#define _hdr_dlldefs 1 /* #include <dlldefs.h> ok */
-#define _lib_dlopen 1 /* dlopen() in default lib(s) */
-#define _lib_dllfind 1 /* dllfind() in default lib(s) */
-#if !defined(SHOPT_FS_3D) && ( _lib_dllfind || _lib_dlopen || _lib_shl_load || _lib_loadbind )
+#if SHOPT_DYNAMIC
+#include <dlldefs.h>
+#endif
+#if !defined(SHOPT_FS_3D) && SHOPT_DYNAMIC
# define SHOPT_FS_3D 1
#endif /* !SHOPT_FS_3D */
#if SHOPT_FS_3D
diff --git a/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/execargs b/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/execargs
index b368713166..a6b30d067b 100644
--- a/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/execargs
+++ b/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/execargs
@@ -1,10 +1,11 @@
-/* : : generated by iffe version 2007-04-04 : : */
+/* : : generated by iffe version 2008-01-31 : : */
#ifndef _def_execargs_ksh93
#define _def_execargs_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#endif
diff --git a/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/externs b/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/externs
index 311028856f..9b0d8ab634 100644
--- a/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/externs
+++ b/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/externs
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/cmd/ksh93/features/externs by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/cmd/ksh93/features/externs by iffe version 2008-01-31 : : */
#ifndef _def_externs_ksh93
#if !defined(__PROTO__)
@@ -63,10 +63,11 @@
#define _def_externs_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _hdr_exec_attr 1 /* #include <exec_attr.h> ok */
#define _hdr_math 1 /* #include <math.h> ok */
@@ -78,4 +79,6 @@
#define _lib_fork 1 /* fork() in default lib(s) */
#define _lib_spawnveg 1 /* spawnveg() in default lib(s) */
#define _lib_fchdir 1 /* fchdir() in default lib(s) */
+#define _sys_mman 1 /* #include <sys/mman.h> ok */
+#define _lib_memcntl 1 /* memcntl() in default lib(s) */
#endif
diff --git a/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/locale b/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/locale
index cda3b9fcbf..9cb639e493 100644
--- a/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/locale
+++ b/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/locale
@@ -1,11 +1,12 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/cmd/ksh93/features/locale by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/cmd/ksh93/features/locale by iffe version 2008-01-31 : : */
#ifndef _def_locale_ksh93
#define _def_locale_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _hdr_locale 1 /* #include <locale.h> ok */
#define _hdr_wchar 1 /* #include <wchar.h> ok */
diff --git a/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/math b/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/math
index bba6bce5ff..f2c3e045fe 100644
--- a/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/math
+++ b/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/math
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/cmd/ksh93/features/math.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/cmd/ksh93/features/math.sh by iffe version 2008-01-31 : : */
#ifndef _def_math_ksh93
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
@@ -62,14 +62,15 @@
#define _def_math_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
-/* : : generated by iffe from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/cmd/ksh93/data/math.tab : : */
+/* : : generated by iffe from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/cmd/ksh93/data/math.tab : : */
typedef Sfdouble_t (*Math_f) __PROTO__((Sfdouble_t,...));
@@ -104,6 +105,7 @@ const struct mathtab shtab_math[] =
"\002atan2", (Math_f)atan2l,
"\001atanh", (Math_f)atanhl,
"\001cbrt", (Math_f)cbrtl,
+ "\001ceil", (Math_f)ceill,
"\002copysign", (Math_f)copysignl,
"\001cos", (Math_f)cosl,
"\001cosh", (Math_f)coshl,
diff --git a/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/options b/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/options
index 35a00af11e..b2a1e6c5bf 100644
--- a/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/options
+++ b/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/options
@@ -1,11 +1,12 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/cmd/ksh93/features/options by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/cmd/ksh93/features/options by iffe version 2008-01-31 : : */
#ifndef _def_options_ksh93
#define _def_options_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define SHELLMAGIC 1
#ifndef SHOPT_DEVFD
@@ -15,6 +16,9 @@
# define SHOPT_PFSH 1
#endif
#undef SHOPT_TEST_L
+#ifndef SHOPT_SYSRC
+# define SHOPT_SYSRC 1
+#endif
#undef SHOPT_UCB
#if !_PACKAGE_ast && ( (MB_LEN_MAX-1)<=0 || !defined(_lib_mbtowc) )
# undef SHOPT_MULTIBYTE
diff --git a/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/poll b/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/poll
index 418f251f69..82aebe8515 100644
--- a/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/poll
+++ b/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/poll
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/cmd/ksh93/features/poll by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/cmd/ksh93/features/poll by iffe version 2008-01-31 : : */
#ifndef _def_poll_ksh93
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
@@ -62,10 +62,11 @@
#define _def_poll_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _hdr_poll 1 /* #include <poll.h> ok */
#define _hdr_netinet_in 1 /* #include <netinet/in.h> ok */
diff --git a/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/pstat b/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/pstat
index 480e62028b..928d40dee8 100644
--- a/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/pstat
+++ b/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/pstat
@@ -1,10 +1,11 @@
-/* : : generated by iffe version 2007-04-04 : : */
+/* : : generated by iffe version 2008-01-31 : : */
#ifndef _def_pstat_ksh93
#define _def_pstat_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#endif
diff --git a/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/rlimits b/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/rlimits
index d61331c9a1..6d4eb8151d 100644
--- a/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/rlimits
+++ b/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/rlimits
@@ -1,11 +1,12 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/cmd/ksh93/features/rlimits by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/cmd/ksh93/features/rlimits by iffe version 2008-01-31 : : */
#ifndef _def_rlimits_ksh93
#define _def_rlimits_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _sys_resource 1 /* #include <sys/resource.h> ok */
#define _lib_getrlimit 1 /* getrlimit() in default lib(s) */
diff --git a/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/setjmp b/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/setjmp
index 0d7edb2e3e..cca67f87c3 100644
--- a/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/setjmp
+++ b/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/setjmp
@@ -1,11 +1,12 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/cmd/ksh93/features/setjmp by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/cmd/ksh93/features/setjmp by iffe version 2008-01-31 : : */
#ifndef _def_setjmp_ksh93
#define _def_setjmp_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _lib_sigsetjmp 1 /* sigsetjmp() in default lib(s) */
#define _lib__setjmp 1 /* _setjmp() in default lib(s) */
diff --git a/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/sigfeatures b/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/sigfeatures
index 517ccfbc1f..2f57c095e7 100644
--- a/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/sigfeatures
+++ b/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/sigfeatures
@@ -1,11 +1,12 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/cmd/ksh93/features/sigfeatures by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/cmd/ksh93/features/sigfeatures by iffe version 2008-01-31 : : */
#ifndef _def_sigfeatures_ksh93
#define _def_sigfeatures_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _lib_sigrelse 1 /* sigrelse() in default lib(s) */
#define _lib_sigprocmask 1 /* sigprocmask() in default lib(s) */
@@ -22,8 +23,8 @@
#endif
#ifdef _lib_sigprocmask
# define sh_sigaction(s,action) do { sigset_t ss;\
- sigemptyset(&ss);\
- sigaddset(&ss,(s));\
+ sigemptyset(&ss); \
+ if(s) sigaddset(&ss,(s)); \
sigprocmask(action,&ss,0); \
}while(0)
# define sigrelease(s) sh_sigaction(s,SIG_UNBLOCK)
diff --git a/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/time b/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/time
index f29ed94f58..7ef065b723 100644
--- a/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/time
+++ b/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/time
@@ -1,11 +1,12 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/cmd/ksh93/features/time by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/cmd/ksh93/features/time by iffe version 2008-01-31 : : */
#ifndef _def_time_ksh93
#define _def_time_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _hdr_utime 1 /* #include <utime.h> ok */
#define _lib_gettimeofday 1 /* gettimeofday() in default lib(s) */
diff --git a/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/ttys b/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/ttys
index d558d9e668..f1aeeb5023 100644
--- a/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/ttys
+++ b/usr/src/lib/libshell/i386/src/cmd/ksh93/FEATURE/ttys
@@ -1,11 +1,12 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/src/cmd/ksh93/features/ttys by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/cmd/ksh93/features/ttys by iffe version 2008-01-31 : : */
#ifndef _def_ttys_ksh93
#define _def_ttys_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_i386_32bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _hdr_termios 1 /* #include <termios.h> ok */
#define _hdr_termio 1 /* #include <termio.h> ok */
diff --git a/usr/src/lib/libshell/mapfile-vers b/usr/src/lib/libshell/mapfile-vers
index 503d8fe439..9ea1f5c911 100644
--- a/usr/src/lib/libshell/mapfile-vers
+++ b/usr/src/lib/libshell/mapfile-vers
@@ -20,11 +20,9 @@
#
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
SUNWprivate_1.1 {
global:
@@ -68,7 +66,7 @@ SUNWprivate_1.1 {
sh_waitsafe;
sh_exec;
sh_getliblist;
-
+
nv_setarray;
nv_associative;
nv_aindex;
@@ -94,7 +92,6 @@ SUNWprivate_1.1 {
nv_putval;
nv_putv;
nv_scan;
- nv_scoped;
nv_setdisc;
nv_setref;
nv_settype;
@@ -104,12 +101,13 @@ SUNWprivate_1.1 {
nv_disc;
nv_unset;
nv_search;
- nv_unscope;
nv_name;
nv_discfun;
- # libshell overrides libast's |_ast_procrun()| (see sh/xec.c)
- _ast_procrun;
+ # semi-private, needed for shcomp
+ sh;
+ e_dict;
+
local:
*;
};
diff --git a/usr/src/lib/libshell/misc/ERRATA.txt b/usr/src/lib/libshell/misc/ERRATA.txt
index 8ef83974ff..f94d327dd3 100644
--- a/usr/src/lib/libshell/misc/ERRATA.txt
+++ b/usr/src/lib/libshell/misc/ERRATA.txt
@@ -18,10 +18,10 @@
#
# CDDL HEADER END
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
+
#
-# ident "%Z%%M% %I% %E% SMI"
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
#
#
@@ -31,297 +31,212 @@
#
######## Errata #001: ########
-Some constants which are larger than 2^32 seem to
-require either "LL" or "ULL" as suffix to get the build compiling - at least in
-OS/Net with it's very strict build flags the problem is that worse that I had
-to use "-Wno-error" in usr/src/lib/libast/Makefile.com for the gcc build to get
-it compiling:
--- snip --
-pics/$(MACH)/src/lib/libast/conftab.o := CERRWARN +=
--erroff=E_C99_INTEGER_PROMOTION
-pics/$(MACH)/src/lib/libast/conftab.o \
-pics/$(MACH64)/src/lib/libast/conftab.o := CERRWARN +=
--erroff=E_INTEGRAL_CONSTANT_TOO_LARGE
-pics/$(MACH)/src/lib/libast/conftab.o \
-pics/$(MACH64)/src/lib/libast/conftab.o := CERRWARN +=
--erroff=E_INTEGER_OVERFLOW_DETECTED
-pics/$(MACH)/src/lib/libast/conftab.o \
-pics/$(MACH64)/src/lib/libast/conftab.o := CERRWARN += -_gcc=-Wno-error
-pics/common/hash/
--- snip --
-
-The following diff has been used to (temporarily work around the problem:
+The usage of |posix_spawn()| has been manually disabled because there seems to be a
+race condition which cases sporadic failures like this:
+-- snip --.
+$ builtin | fgrep sum | fgrep sum
+/usr/ast/bin/sum
+/usr/bin/sum
+$ builtin | fgrep sum | fgrep sum
+fgrep: fgrep: cannot execute [Exec format error]
+-- snip --.
+The following files have been changed:
-- snip --
-Index: src/lib/libast/sparcv9/src/lib/libast/conftab.c
+Index: src/lib/libast/sparcv9/include/ast/ast_lib.h
+===================================================================
+--- src/lib/libast/sparcv9/include/ast/ast_lib.h (revision 888)
++++ src/lib/libast/sparcv9/include/ast/ast_lib.h (working copy)
+@@ -160,7 +160,7 @@
+ #define _hdr_unistd 1 /* #include <unistd.h> ok */
+ #define _lib_vfork 1 /* vfork exists and it works */
+ #define _real_vfork 1 /* vfork child shares data with parent */
+-#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */
++#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */
+ #define _stream_peek 1 /* ioctl(I_PEEK) works */
+ #define _socket_peek 1 /* recv(MSG_PEEK) works */
+ #define _hdr_string 1 /* #include <string.h> ok */
+Index: src/lib/libast/sparcv9/src/lib/libast/ast_lib.h
+===================================================================
+--- src/lib/libast/sparcv9/src/lib/libast/ast_lib.h (revision 888)
++++ src/lib/libast/sparcv9/src/lib/libast/ast_lib.h (working copy)
+@@ -139,7 +139,7 @@
+ #define _hdr_unistd 1 /* #include <unistd.h> ok */
+ #define _lib_vfork 1 /* vfork exists and it works */
+ #define _real_vfork 1 /* vfork child shares data with parent */
+-#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */
++#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */
+ #define _stream_peek 1 /* ioctl(I_PEEK) works */
+ #define _socket_peek 1 /* recv(MSG_PEEK) works */
+ #define _hdr_string 1 /* #include <string.h> ok */
+Index: src/lib/libast/sparcv9/src/lib/libast/FEATURE/lib
+===================================================================
+--- src/lib/libast/sparcv9/src/lib/libast/FEATURE/lib (revision 888)
++++ src/lib/libast/sparcv9/src/lib/libast/FEATURE/lib (working copy)
+@@ -139,7 +139,7 @@
+ #define _hdr_unistd 1 /* #include <unistd.h> ok */
+ #define _lib_vfork 1 /* vfork exists and it works */
+ #define _real_vfork 1 /* vfork child shares data with parent */
+-#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */
++#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */
+ #define _stream_peek 1 /* ioctl(I_PEEK) works */
+ #define _socket_peek 1 /* recv(MSG_PEEK) works */
+ #define _hdr_string 1 /* #include <string.h> ok */
+Index: src/lib/libast/sparc/include/ast/ast_lib.h
+===================================================================
+--- src/lib/libast/sparc/include/ast/ast_lib.h (revision 888)
++++ src/lib/libast/sparc/include/ast/ast_lib.h (working copy)
+@@ -171,7 +171,7 @@
+ #define _hdr_unistd 1 /* #include <unistd.h> ok */
+ #define _lib_vfork 1 /* vfork exists and it works */
+ #define _real_vfork 1 /* vfork child shares data with parent */
+-#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */
++#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */
+ #define _stream_peek 1 /* ioctl(I_PEEK) works */
+ #define _socket_peek 1 /* recv(MSG_PEEK) works */
+ #define _hdr_string 1 /* #include <string.h> ok */
+Index: src/lib/libast/sparc/src/lib/libast/ast_lib.h
+===================================================================
+--- src/lib/libast/sparc/src/lib/libast/ast_lib.h (revision 888)
++++ src/lib/libast/sparc/src/lib/libast/ast_lib.h (working copy)
+@@ -150,7 +150,7 @@
+ #define _hdr_unistd 1 /* #include <unistd.h> ok */
+ #define _lib_vfork 1 /* vfork exists and it works */
+ #define _real_vfork 1 /* vfork child shares data with parent */
+-#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */
++#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */
+ #define _stream_peek 1 /* ioctl(I_PEEK) works */
+ #define _socket_peek 1 /* recv(MSG_PEEK) works */
+ #define _hdr_string 1 /* #include <string.h> ok */
+Index: src/lib/libast/sparc/src/lib/libast/FEATURE/lib
===================================================================
---- src/lib/libast/sparcv9/src/lib/libast/conftab.c (revision 664)
-+++ src/lib/libast/sparcv9/src/lib/libast/conftab.c (working copy)
-@@ -220,8 +220,8 @@
- { "LFS_LINTFLAGS", { 0, 0 }, { 0, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING, CONF_POSIX, 1, CONF_confstr, _CS_LFS_LINTFLAGS },
- { "LINE_MAX", { 0, 0 }, { _POSIX2_LINE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_LINE_MAX },
- { "LINK_MAX", { 0, 0 }, { _POSIX_LINK_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_LINK_MAX },
--{ "LLONG_MAX", { 9223372036854775807, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
--{ "LLONG_MIN", { -9223372036854775808, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-+{ "LLONG_MAX", { 9223372036854775807LL, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-+{ "LLONG_MIN", { (-9223372036854775807LL-1LL), 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
- { "LOCALEDEF", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_LOCALEDEF },
- { "LOGIN_NAME_MAX", { 0, 0 }, { _POSIX_LOGIN_NAME_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_LOGIN_NAME_MAX },
- { "LOGNAME_MAX", { 0, 0 }, { 8, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, _SC_LOGNAME_MAX },
-@@ -407,7 +407,7 @@
- { "UID_MAX", { 0, 0 }, { 60002, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
- { "UINT_MAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
- { "UIO_MAXIOV", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
--{ "ULLONG_MAX", { 18446744073709551615, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-+{ "ULLONG_MAX", { 18446744073709551615ULL, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
- { "ULONG_MAX", { 4294967295, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
- { "UNIX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_UNIX },
- { "UPE", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_UPE },
-Index: src/lib/libast/sparc/src/lib/libast/conftab.c
+--- src/lib/libast/sparc/src/lib/libast/FEATURE/lib (revision 888)
++++ src/lib/libast/sparc/src/lib/libast/FEATURE/lib (working copy)
+@@ -150,7 +150,7 @@
+ #define _hdr_unistd 1 /* #include <unistd.h> ok */
+ #define _lib_vfork 1 /* vfork exists and it works */
+ #define _real_vfork 1 /* vfork child shares data with parent */
+-#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */
++#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */
+ #define _stream_peek 1 /* ioctl(I_PEEK) works */
+ #define _socket_peek 1 /* recv(MSG_PEEK) works */
+ #define _hdr_string 1 /* #include <string.h> ok */
+Index: src/lib/libast/i386/include/ast/ast_lib.h
===================================================================
---- src/lib/libast/sparc/src/lib/libast/conftab.c (revision 664)
-+++ src/lib/libast/sparc/src/lib/libast/conftab.c (working copy)
-@@ -220,8 +220,8 @@
- { "LFS_LINTFLAGS", { 0, 0 }, { 0, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING, CONF_POSIX, 1, CONF_confstr, _CS_LFS_LINTFLAGS },
- { "LINE_MAX", { 0, 0 }, { _POSIX2_LINE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_LINE_MAX },
- { "LINK_MAX", { 0, 0 }, { _POSIX_LINK_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_LINK_MAX },
--{ "LLONG_MAX", { 9223372036854775807, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
--{ "LLONG_MIN", { -9223372036854775808, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-+{ "LLONG_MAX", { 9223372036854775807LL, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-+{ "LLONG_MIN", { (-9223372036854775807LL-1LL), 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
- { "LOCALEDEF", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_LOCALEDEF },
- { "LOGIN_NAME_MAX", { 0, 0 }, { _POSIX_LOGIN_NAME_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_LOGIN_NAME_MAX },
- { "LOGNAME_MAX", { 0, 0 }, { 8, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, _SC_LOGNAME_MAX },
-@@ -407,7 +407,7 @@
- { "UID_MAX", { 0, 0 }, { 60002, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
- { "UINT_MAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
- { "UIO_MAXIOV", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
--{ "ULLONG_MAX", { 18446744073709551615, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-+{ "ULLONG_MAX", { 18446744073709551615ULL, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
- { "ULONG_MAX", { 4294967295, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
- { "UNIX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_UNIX },
- { "UPE", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_UPE },
-Index: src/lib/libast/i386/src/lib/libast/conftab.c
+--- src/lib/libast/i386/include/ast/ast_lib.h (revision 888)
++++ src/lib/libast/i386/include/ast/ast_lib.h (working copy)
+@@ -171,7 +171,7 @@
+ #define _hdr_unistd 1 /* #include <unistd.h> ok */
+ #define _lib_vfork 1 /* vfork exists and it works */
+ #define _real_vfork 1 /* vfork child shares data with parent */
+-#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */
++#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */
+ #define _stream_peek 1 /* ioctl(I_PEEK) works */
+ #define _socket_peek 1 /* recv(MSG_PEEK) works */
+ #define _hdr_string 1 /* #include <string.h> ok */
+Index: src/lib/libast/i386/src/lib/libast/ast_lib.h
===================================================================
---- src/lib/libast/i386/src/lib/libast/conftab.c (revision 664)
-+++ src/lib/libast/i386/src/lib/libast/conftab.c (working copy)
-@@ -220,8 +220,8 @@
- { "LFS_LINTFLAGS", { 0, 0 }, { 0, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING, CONF_POSIX, 1, CONF_confstr, _CS_LFS_LINTFLAGS },
- { "LINE_MAX", { 0, 0 }, { _POSIX2_LINE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_LINE_MAX },
- { "LINK_MAX", { 0, 0 }, { _POSIX_LINK_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_LINK_MAX },
--{ "LLONG_MAX", { 9223372036854775807, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
--{ "LLONG_MIN", { -9223372036854775808, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-+{ "LLONG_MAX", { 9223372036854775807LL, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-+{ "LLONG_MIN", { (-9223372036854775807LL-1LL), 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
- { "LOCALEDEF", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_LOCALEDEF },
- { "LOGIN_NAME_MAX", { 0, 0 }, { _POSIX_LOGIN_NAME_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_LOGIN_NAME_MAX },
- { "LOGNAME_MAX", { 0, 0 }, { 8, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, _SC_LOGNAME_MAX },
-@@ -407,7 +407,7 @@
- { "UID_MAX", { 0, 0 }, { 60002, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
- { "UINT_MAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
- { "UIO_MAXIOV", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
--{ "ULLONG_MAX", { 18446744073709551615, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-+{ "ULLONG_MAX", { 18446744073709551615ULL, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
- { "ULONG_MAX", { 4294967295, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
- { "UNIX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_UNIX },
- { "UPE", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_UPE },
-Index: src/lib/libast/Makefile.com
+--- src/lib/libast/i386/src/lib/libast/ast_lib.h (revision 888)
++++ src/lib/libast/i386/src/lib/libast/ast_lib.h (working copy)
+@@ -150,7 +150,7 @@
+ #define _hdr_unistd 1 /* #include <unistd.h> ok */
+ #define _lib_vfork 1 /* vfork exists and it works */
+ #define _real_vfork 1 /* vfork child shares data with parent */
+-#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */
++#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */
+ #define _stream_peek 1 /* ioctl(I_PEEK) works */
+ #define _socket_peek 1 /* recv(MSG_PEEK) works */
+ #define _hdr_string 1 /* #include <string.h> ok */
+Index: src/lib/libast/i386/src/lib/libast/FEATURE/lib
===================================================================
---- src/lib/libast/Makefile.com (revision 664)
-+++ src/lib/libast/Makefile.com (working copy)
-@@ -706,11 +706,7 @@
- CERRWARN += -erroff=E_UNRECOGNIZED_PRAGMA_IGNORED
- pics/$(MACH)/src/lib/libast/conftab.o := CERRWARN += -erroff=E_C99_INTEGER_PROMOTION
- pics/$(MACH)/src/lib/libast/conftab.o \
--pics/$(MACH64)/src/lib/libast/conftab.o := CERRWARN += -erroff=E_INTEGRAL_CONSTANT_TOO_LARGE
--pics/$(MACH)/src/lib/libast/conftab.o \
--pics/$(MACH64)/src/lib/libast/conftab.o := CERRWARN += -erroff=E_INTEGER_OVERFLOW_DETECTED
--pics/$(MACH)/src/lib/libast/conftab.o \
--pics/$(MACH64)/src/lib/libast/conftab.o := CERRWARN += -_gcc=-Wno-error
-+pics/$(MACH64)/src/lib/libast/conftab.o := CERRWARN += -erroff=E_INIT_DOES_NOT_FIT
- pics/common/hash/hashlook.o := CERRWARN += -erroff=E_CONST_PROMOTED_UNSIGNED_LONG
- pics/common/hash/memhash.o := CERRWARN += -erroff=E_CONST_PROMOTED_UNSIGNED_LONG
- pics/common/hash/memsum.o := CERRWARN += -erroff=E_CONST_PROMOTED_UNSIGNED_LONG
-Index: src/lib/libast/amd64/src/lib/libast/conftab.c
+--- src/lib/libast/i386/src/lib/libast/FEATURE/lib (revision 888)
++++ src/lib/libast/i386/src/lib/libast/FEATURE/lib (working copy)
+@@ -150,7 +150,7 @@
+ #define _hdr_unistd 1 /* #include <unistd.h> ok */
+ #define _lib_vfork 1 /* vfork exists and it works */
+ #define _real_vfork 1 /* vfork child shares data with parent */
+-#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */
++#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */
+ #define _stream_peek 1 /* ioctl(I_PEEK) works */
+ #define _socket_peek 1 /* recv(MSG_PEEK) works */
+ #define _hdr_string 1 /* #include <string.h> ok */
+Index: src/lib/libast/amd64/include/ast/ast_lib.h
===================================================================
---- src/lib/libast/amd64/src/lib/libast/conftab.c (revision 664)
-+++ src/lib/libast/amd64/src/lib/libast/conftab.c (working copy)
-@@ -220,8 +220,8 @@
- { "LFS_LINTFLAGS", { 0, 0 }, { 0, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_STRING, CONF_POSIX, 1, CONF_confstr, _CS_LFS_LINTFLAGS },
- { "LINE_MAX", { 0, 0 }, { _POSIX2_LINE_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_NOSECTION|CONF_MINMAX_DEF, CONF_POSIX, 2, CONF_sysconf, _SC_LINE_MAX },
- { "LINK_MAX", { 0, 0 }, { _POSIX_LINK_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_pathconf, _PC_LINK_MAX },
--{ "LLONG_MAX", { 9223372036854775807, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
--{ "LLONG_MIN", { -9223372036854775808, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-+{ "LLONG_MAX", { 9223372036854775807LL, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-+{ "LLONG_MIN", { (-9223372036854775807LL-1LL), 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
- { "LOCALEDEF", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_LOCALEDEF },
- { "LOGIN_NAME_MAX", { 0, 0 }, { _POSIX_LOGIN_NAME_MAX, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_POSIX, 1, CONF_sysconf, _SC_LOGIN_NAME_MAX },
- { "LOGNAME_MAX", { 0, 0 }, { 8, 0 }, CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, _SC_LOGNAME_MAX },
-@@ -407,7 +407,7 @@
- { "UID_MAX", { 0, 0 }, { 60002, 0 }, CONF_LIMIT|CONF_MINMAX|CONF_UNDERSCORE|CONF_MINMAX_DEF, CONF_SVID, 1, CONF_sysconf, -1 },
- { "UINT_MAX", { 0, 0 }, { 0, 0 }, CONF_LIMIT, CONF_C, 1, CONF_nop, -1 },
- { "UIO_MAXIOV", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE, CONF_POSIX, 1, CONF_nop, -1 },
--{ "ULLONG_MAX", { 18446744073709551615, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
-+{ "ULLONG_MAX", { 18446744073709551615ULL, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
- { "ULONG_MAX", { 4294967295, 0 }, { 0, 0 }, CONF_LIMIT|CONF_LIMIT_DEF, CONF_C, 1, CONF_nop, -1 },
- { "UNIX", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_STANDARD|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_XOPEN, 1, CONF_sysconf, _SC_XOPEN_UNIX },
- { "UPE", { 0, 0 }, { 0, 0 }, CONF_FEATURE|CONF_UNDERSCORE|CONF_PREFIX_ONLY, CONF_POSIX, 2, CONF_sysconf, _SC_2_UPE },
+--- src/lib/libast/amd64/include/ast/ast_lib.h (revision 888)
++++ src/lib/libast/amd64/include/ast/ast_lib.h (working copy)
+@@ -160,7 +160,7 @@
+ #define _hdr_unistd 1 /* #include <unistd.h> ok */
+ #define _lib_vfork 1 /* vfork exists and it works */
+ #define _real_vfork 1 /* vfork child shares data with parent */
+-#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */
++#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */
+ #define _stream_peek 1 /* ioctl(I_PEEK) works */
+ #define _socket_peek 1 /* recv(MSG_PEEK) works */
+ #define _hdr_string 1 /* #include <string.h> ok */
+Index: src/lib/libast/amd64/src/lib/libast/ast_lib.h
+===================================================================
+--- src/lib/libast/amd64/src/lib/libast/ast_lib.h (revision 888)
++++ src/lib/libast/amd64/src/lib/libast/ast_lib.h (working copy)
+@@ -139,7 +139,7 @@
+ #define _hdr_unistd 1 /* #include <unistd.h> ok */
+ #define _lib_vfork 1 /* vfork exists and it works */
+ #define _real_vfork 1 /* vfork child shares data with parent */
+-#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */
++#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */
+ #define _stream_peek 1 /* ioctl(I_PEEK) works */
+ #define _socket_peek 1 /* recv(MSG_PEEK) works */
+ #define _hdr_string 1 /* #include <string.h> ok */
+Index: src/lib/libast/amd64/src/lib/libast/FEATURE/lib
+===================================================================
+--- src/lib/libast/amd64/src/lib/libast/FEATURE/lib (revision 888)
++++ src/lib/libast/amd64/src/lib/libast/FEATURE/lib (working copy)
+@@ -139,7 +139,7 @@
+ #define _hdr_unistd 1 /* #include <unistd.h> ok */
+ #define _lib_vfork 1 /* vfork exists and it works */
+ #define _real_vfork 1 /* vfork child shares data with parent */
+-#define _lib_posix_spawn 2 /* posix_spawn exists and it works and its worth using */
++#define _lib_posix_spawn 1 /* posix_spawn exists and it works and its worth using */
+ #define _stream_peek 1 /* ioctl(I_PEEK) works */
+ #define _socket_peek 1 /* recv(MSG_PEEK) works */
+ #define _hdr_string 1 /* #include <string.h> ok */
-- snip --
-This change works around the problems in the generated "conftab.c" ; I'll file a patch against
-"libast/common/comp/conf.sh" later to fix the problem in the upstream sources...
######## Errata #002: ########
-A change to usr/src/lib/libcmd/common/date.c has been applied to prevent
-the string literals (backslashes added to prevent expansion) "%M\%" and "%Y\%"
-from being expanded by the SCCS version control software:
+A workaround was added for a problem with the "multiline" editor mode which
+occurs when the edit line becomes longer than the terminal's width and the
+terminal cursor is not at position 0 when PS1 is send to the terminal.
--- snip --
-Index: src/lib/libcmd/common/date.c
-===================================================================
---- src/lib/libcmd/common/date.c (revision 694)
-+++ src/lib/libcmd/common/date.c (working copy)
-@@ -222,13 +222,13 @@
- *argv++ = s;
- if (streq(astconf("UNIVERSE", NiL, NiL), "att"))
- {
-- tmxfmt(buf, sizeof(buf), "%m%d%H" "%M%Y.%S", now);
-+ tmxfmt(buf, sizeof(buf), "%m%d%H" "%M" "%Y.%S", now);
- if (adjust)
- *argv++ = "-a";
- }
- else
- {
-- tmxfmt(buf, sizeof(buf), "%Y%m%d%H" "%M.%S", now);
-+ tmxfmt(buf, sizeof(buf), "%Y" "%m%d%H" "%M.%S", now);
- if (network)
- *argv++ = "-n";
- if (tm_info.flags & TM_UTC)
--- snip --
+For example: The user executes a $ printf "foo"<enter> # the prompt will start
+at position 3 instead of 0. If the user enters a command which is longer than
+the terminal width and then removes enougth characters that the edit line fits
+again into one line the "foo" at the beginning will be overwritten with the
+prompt.
+
+The workaround is to add $(printf "%*s\r%s" COLUMNS "") at the beginning of
+PS1 set by /etc/ksh.kshrc, this causes the shell to move to the beginning
+of the next line if the terminal cursor is not at position 0.
######## Errata #003: ########
-A change to usr/src/lib/libshell/common/sh/jobs.c has been applied to handle
-a memory corruption condition caused by a call to |_ast_malloc()| from within
-a signal handler.
+A fix was backported to cure sporadic VSC test suite failures. The failures are
+generated when command substitutions+functions are executed in a nested manner
+- sometimes the return code is non-zero even if the called function explicitly
+contains a "return 0"-statement.
+The following files have been changed:
-- snip --
Index: src/lib/libshell/common/sh/jobs.c
===================================================================
---- src/lib/libshell/common/sh/jobs.c (revision 743)
+--- src/lib/libshell/common/sh/jobs.c (revision 1284)
+++ src/lib/libshell/common/sh/jobs.c (working copy)
-@@ -43,6 +24,8 @@
- # define WIFCONTINUED(wstat) (0)
- #endif
-
-+#define NJOB_SAVELIST 4
-+
- /*
- * temporary hack to get W* macros to work
- */
-@@ -59,13 +42,35 @@
- unsigned short exitval;
- };
-
-+static struct jobsave *job_savelist;
-+static int njob_savelist;
-+
-+static void init_savelist(void)
-+{
-+ register struct jobsave *jp;
-+ while(njob_savelist < NJOB_SAVELIST)
-+ {
-+ jp = newof(0,struct jobsave,1,0);
-+ jp->next = job_savelist;
-+ job_savelist = jp;
-+ njob_savelist++;
-+ }
-+}
-+
- /*
- * return next on link list of jobsave free list
- */
- static struct jobsave *jobsave_create(pid_t pid)
- {
-- struct jobsave *jp;
-- if(jp = newof(0,struct jobsave,1,0))
-+ register struct jobsave *jp = job_savelist;
-+ if(jp)
-+ {
-+ njob_savelist--;
-+ job_savelist = jp->next;
-+ }
-+ else
-+ jp = newof(0,struct jobsave,1,0);
-+ if(jp)
- jp->pid = pid;
- return(jp);
- }
-@@ -372,6 +377,8 @@
- # if defined(SIGCLD) && (SIGCLD!=SIGCHLD)
- signal(SIGCLD,job_waitsafe);
- # endif
-+ if(njob_savelist < NJOB_SAVELIST)
-+ init_savelist();
- if(!sh_isoption(SH_INTERACTIVE))
- return;
- /* use new line discipline when available */
-@@ -994,6 +1001,8 @@
- free((void*)jp);
- }
- bck.list = 0;
-+ if(njob_savelist < NJOB_SAVELIST)
-+ init_savelist();
- job.pwlist = NIL(struct process*);
- job.numpost=0;
- job.waitall = 0;
-@@ -1016,6 +1025,8 @@
- register struct process *pw;
- register History_t *hp = sh.hist_ptr;
- sh.jobenv = sh.curenv;
-+ if(njob_savelist < NJOB_SAVELIST)
-+ init_savelist();
- if(job.toclear)
+@@ -1224,6 +1224,8 @@
+ job_lock();
+ if(pid > 1)
{
- job_clear();
-@@ -1274,8 +1285,14 @@
- px->p_flag &= ~P_EXITSAVE;
- }
- }
-- if(!(px=job_unpost(pw,1)) || !job.waitall)
-+ if(!job.waitall)
-+ {
-+ if(!sh_isoption(SH_PIPEFAIL))
-+ job_unpost(pw,1);
- break;
-+ }
-+ else if(!(px=job_unpost(pw,1)))
-+ break;
- pw = px;
- continue;
- }
-@@ -1313,6 +1330,8 @@
- else
- tty_set(-1, 0, NIL(struct termios*));
- done:
-+ if(!job.waitall && sh_isoption(SH_PIPEFAIL))
-+ return;
- if(!sh.intrap)
- {
- job_lock();
-@@ -1594,7 +1613,14 @@
- else
- bck.list = jp->next;
- bck.count--;
-- free((void*)jp);
-+ if(njob_savelist < NJOB_SAVELIST)
-+ {
-+ njob_savelist++;
-+ jp->next = job_savelist;
-+ job_savelist = jp;
-+ }
-+ else
-+ free((void*)jp);
- }
- return(r);
- }
++ if(pid==sh.spid)
++ sh.spid = 0;
+ if(!(pw=job_bypid(pid)))
+ {
+ /* check to see whether job status has been saved */
-- snip --
-# EOF.
+
+#EOF.
diff --git a/usr/src/lib/libshell/misc/buildksh93.ksh b/usr/src/lib/libshell/misc/buildksh93.ksh
deleted file mode 100644
index c463a1a815..0000000000
--- a/usr/src/lib/libshell/misc/buildksh93.ksh
+++ /dev/null
@@ -1,373 +0,0 @@
-#!/bin/ksh
-
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-# ident "%Z%%M% %I% %E% SMI"
-#
-
-#
-# buildksh93.ksh - ast-ksh standalone build script for the
-# OpenSolaris ksh93-integration project
-#
-
-# ksh93s+ beta sources can be downloaded like this from the AT&T site:
-# wget --http-user="I accept www.opensource.org/licenses/cpl" --http-passwd="." 'http://www.research.att.com/sw/download/beta/INIT.2007-04-18.tgz'
-# wget --http-user="I accept www.opensource.org/licenses/cpl" --http-passwd="." 'http://www.research.att.com/sw/download/beta/ast-ksh.2007-04-18.tgz'
-
-function fatal_error
-{
- printf "${0}: %s\n" "${1}" >&2
- exit 1
-}
-
-buildmode="$1"
-
-if [ "${buildmode}" = "" ] ; then
- fatal_error "buildmode required."
-fi
-
-set -e -x
-
-# make sure we use the C locale during building to avoid any unintended
-# side-effects
-export LANG=C
-export LC_ALL=$LANG LC_MONETARY=$LANG LC_NUMERIC=$LANG LC_MESSAGES=$LANG LC_COLLATE=$LANG LC_CTYPE=$LANG
-
-function print_solaris_builtin_header
-{
-cat <<ENDOFTEXT
-/* POSIX compatible commands */
-#ifdef _NOT_YET
-#define XPG6CMDLIST(f) { "/usr/xpg6/bin/" #f, NV_BLTIN|NV_NOFREE, bltin(f) },
-#define XPG4CMDLIST(f) { "/usr/xpg4/bin/" #f, NV_BLTIN|NV_NOFREE, bltin(f) },
-#else
-#define XPG6CMDLIST(f)
-#define XPG4CMDLIST(f)
-#endif /* NOT_YET */
-/* Commands which are 100% compatible with native Solaris versions (/bin is
- * a softlink to ./usr/bin so both need to be listed here) */
-#define BINCMDLIST(f) { "/bin/" #f, NV_BLTIN|NV_NOFREE, bltin(f) },
-/* Make all ksh93 builtins accessible when /usr/ast/bin was added to ${PATH} */
-#define ASTCMDLIST(f) { "/usr/ast/bin/" #f, NV_BLTIN|NV_NOFREE, bltin(f) },
-
-/* undo ast_map.h #defines to avoid collision */
-#undef basename
-#undef dirname
-
-/* Generated data, do not edit. */
-XPG4CMDLIST(basename)
-ASTCMDLIST(basename)
-BINCMDLIST(cat)
-ASTCMDLIST(cat)
-XPG4CMDLIST(chgrp)
-ASTCMDLIST(chgrp)
-ASTCMDLIST(chmod)
-XPG4CMDLIST(chown)
-BINCMDLIST(chown)
-ASTCMDLIST(chown)
-ASTCMDLIST(cmp)
-ASTCMDLIST(comm)
-XPG4CMDLIST(cp)
-ASTCMDLIST(cp)
-ASTCMDLIST(cut)
-XPG4CMDLIST(date)
-ASTCMDLIST(date)
-ASTCMDLIST(dirname)
-XPG4CMDLIST(expr)
-ASTCMDLIST(expr)
-ASTCMDLIST(fds)
-ASTCMDLIST(fmt)
-ASTCMDLIST(fold)
-BINCMDLIST(head)
-ASTCMDLIST(head)
-XPG4CMDLIST(id)
-ASTCMDLIST(id)
-ASTCMDLIST(join)
-XPG4CMDLIST(ln)
-ASTCMDLIST(ln)
-ASTCMDLIST(logname)
-BINCMDLIST(mkdir)
-ASTCMDLIST(mkdir)
-ASTCMDLIST(mkfifo)
-XPG4CMDLIST(mv)
-ASTCMDLIST(mv)
-ASTCMDLIST(paste)
-ASTCMDLIST(pathchk)
-ASTCMDLIST(rev)
-XPG4CMDLIST(rm)
-ASTCMDLIST(rm)
-BINCMDLIST(rmdir)
-ASTCMDLIST(rmdir)
-XPG4CMDLIST(stty)
-ASTCMDLIST(stty)
-XPG4CMDLIST(tail)
-ASTCMDLIST(tail)
-BINCMDLIST(tee)
-ASTCMDLIST(tee)
-ASTCMDLIST(tty)
-ASTCMDLIST(uname)
-BINCMDLIST(uniq)
-ASTCMDLIST(uniq)
-BINCMDLIST(wc)
-ASTCMDLIST(wc)
-
-/* Mandatory for ksh93 test suite and AST scripts */
-BINCMDLIST(getconf)
-
-ENDOFTEXT
-}
-
-function build_shell
-{
- set -e -x
-
- # OS.cputype.XXbit.compiler
- case "${buildmode}" in
- *.linux.*)
- # ksh93+AST config flags
- BAST_FLAGS="-DSHOPT_CMDLIB_BLTIN=0 -DSH_CMDLIB_DIR=\\\"/usr/ast/bin\\\" -DSHOPT_SYSRC -D_map_libc=1"
-
- # gcc flags
- BGCC99="gcc -std=gnu99"
- BGCC_CCFLAGS="${BON_FLAGS} ${BAST_FLAGS}"
-
- case "${buildmode}" in
- # Linux i386
- *.i386.32bit.gcc*) HOSTTYPE="linux.i386" CC="${BGCC99} -fPIC" CC_SHAREDLIB="-shared" CCFLAGS="${BGCC_CCFLAGS}"
- ;;
- *)
- fatal_error "build_shell: Illegal Linux type/compiler build mode \"${buildmode}\"."
- ;;
- esac
- ;;
- *.solaris.*)
- # Notes:
- # 1. Do not remove/modify these flags or their order before either
- # asking the project leads at
- # http://www.opensolaris.org/os/project/ksh93-integration/
- # These flags all have a purpose, even if they look
- # weird/redundant/etc. at the first look.
- #
- # 2. We use -KPIC here since -Kpic is too small on 64bit sparc and
- # on 32bit it's close to the barrier so we use it for both 32bit and
- # 64bit to avoid later suprises when people update libast in the
- # future
- #
- # 3. "-D_map_libc=1" is needed to force map.c to add a "_ast_" prefix to all
- # AST symbol names which may otherwise collide with Solaris/Linux libc
- #
- # 4. "-DSHOPT_SYSRC" enables /etc/ksh.kshrc support (AST default is currently
- # to enable it if /etc/ksh.kshrc or /etc/bash.bashrc are available on the
- # build machine).
- #
- # 5. -D_lib_socket=1 -lsocket -lnsl" was added to make sure ksh93 is compiled
- # with networking support enabled, the current AST build infratructure has
- # problems with detecting networking support in Solaris.
- #
- # 6. "-xc99=%all -D_XOPEN_SOURCE=600 -D__EXTENSIONS__=1" is used to force
- # the compiler into C99 mode. Otherwise ksh93 will be much slower and lacks
- # lots of arithmethic functions.
- #
- # 7. "-D_TS_ERRNO -D_REENTRANT" are flags taken from the default OS/Net
- # build system.
- #
- # 8. "-xpagesize_stack=64K -xpagesize_heap=64K" is used on SPARC to
- # enhance the performace
- #
- # 9. -DSHOPT_CMDLIB_BLTIN=0 -DSH_CMDLIB_DIR=\\\"/usr/ast/bin\\\" -DSHOPT_CMDLIB_HDR=\\\"/home/test001/ksh93/ast_ksh_20070322/solaris_cmdlist.h\\\"
- # is used to bind all ksh93 builtins to a "virtual" directory
- # called "/usr/ast/bin/" and to adjust the list of builtins
- # enabled by default to those defined by PSARC 2006/550
-
- solaris_builtin_header="$PWD/tmp_solaris_builtin_header.h"
- print_solaris_builtin_header >"${solaris_builtin_header}"
-
- # OS/Net build flags
- BON_FLAGS="-D_TS_ERRNO -D_REENTRANT"
-
- # ksh93+AST config flags
- BAST_FLAGS="-DSHOPT_CMDLIB_BLTIN=0 -DSH_CMDLIB_DIR=\\\"/usr/ast/bin\\\" -DSHOPT_CMDLIB_HDR=\\\"${solaris_builtin_header}\\\" -DSHOPT_SYSRC -D_map_libc=1"
-
- # Sun Studio flags
- BSUNCC99="/opt/SUNWspro/bin/cc -xc99=%all -D_XOPEN_SOURCE=600 -D__EXTENSIONS__=1"
- BSUNCC_APP_CCFLAGS_SPARC="-xpagesize_stack=64K -xpagesize_heap=64K" # use BSUNCC_APP_CCFLAGS_SPARC only for final executables
- BSUNCC_CCFLAGS="${BON_FLAGS} -KPIC -g -xs -xspace -Xa -xstrconst -z combreloc -xildoff -errtags=yes ${BAST_FLAGS} -D_lib_socket=1 -lsocket -lnsl"
-
- # gcc flags
- BGCC99="/usr/sfw/bin/gcc -std=gnu99 -D_XOPEN_SOURCE=600 -D__EXTENSIONS__=1"
- BGCC_CCFLAGS="${BON_FLAGS} ${BAST_FLAGS} -D_lib_socket=1 -lsocket -lnsl"
-
-
- case "${buildmode}" in
- *.i386.32bit.suncc*) HOSTTYPE="sol11.i386" CC="${BSUNCC99}" CC_SHAREDLIB="-G" CCFLAGS="${BSUNCC_CCFLAGS}" ;;
- *.i386.64bit.suncc*) HOSTTYPE="sol11.i386" CC="${BSUNCC99} -xarch=amd64 -KPIC" CC_SHAREDLIB="-G" CCFLAGS="${BSUNCC_CCFLAGS}" ;;
- *.sparc.32bit.suncc*) HOSTTYPE="sol11.sun4" CC="${BSUNCC99}" CC_SHAREDLIB="-G" CCFLAGS="${BSUNCC_CCFLAGS}" BSUNCC_APP_CCFLAGS="${BSUNCC_APP_CCFLAGS_SPARC}" ;;
- *.sparc.64bit.suncc*) HOSTTYPE="sol11.sun4" CC="${BSUNCC99} -xarch=v9 -KPIC" CC_SHAREDLIB="-G" CCFLAGS="${BSUNCC_CCFLAGS}" BSUNCC_APP_CCFLAGS="${BSUNCC_APP_CCFLAGS_SPARC}" ;;
-
- *.i386.32bit.gcc*) HOSTTYPE="sol11.i386" CC="${BGCC99} -fPIC" CC_SHAREDLIB="-shared" CCFLAGS="${BGCC_CCFLAGS}" ;;
- *.i386.64bit.gcc*) HOSTTYPE="sol11.i386" CC="${BGCC99} -m64 -mtune=opteron -Ui386 -U__i386 -fPIC" CC_SHAREDLIB="-shared" CCFLAGS="${BGCC_CCFLAGS}" ;;
- *.sparc.32bit.gcc*) HOSTTYPE="sol11.sun4" CC="${BGCC99} -m32 -mcpu=v8 -fPIC " CC_SHAREDLIB="-shared" CCFLAGS="${BGCC_CCFLAGS}" ;;
- *.sparc.64bit.gcc*) HOSTTYPE="sol11.sun4" CC="${BGCC99} -m64 -mcpu=v9 -fPIC" CC_SHAREDLIB="-shared" CCFLAGS="${BGCC_CCFLAGS}" ;;
-
- *)
- fatal_error "build_shell: Illegal Solaris type/compiler build mode \"${buildmode}\"."
- ;;
- esac
- ;;
- *)
- fatal_error "Illegal OS build mode \"${buildmode}\"."
- ;;
- esac
-
- # some prechecks
- [ -z "${CCFLAGS}" ] && fatal_error "build_shell: CCFLAGS is empty."
- [ -z "${CC}" ] && fatal_error "build_shell: CC is empty."
- [ -z "${HOSTTYPE}" ] && fatal_error "build_shell: HOSTTYPE is empty."
- [ ! -f "bin/package" ] && fatal_error "build_shell: bin/package missing."
- [ ! -x "bin/package" ] && fatal_error "build_shell: bin/package not executable."
-
- export CCFLAGS CC HOSTTYPE
-
- # build ksh93
- bin/package make CCFLAGS="${CCFLAGS}" CC="${CC}" HOSTTYPE="${HOSTTYPE}"
-
- root="${PWD}/arch/${HOSTTYPE}"
- test -d "$root" || fatal_error "build_shell: directory ${root} not found."
- log="${root}/lib/package/gen/make.out"
-
- test -s $log || fatal_error "build_shell: no make.out log found."
-
- if [[ "${buildmode}" != *.staticshell* ]] ; then
- # libcmd causes some trouble since there is a squatter in solaris
- # This has been fixed in Solaris 11/B48 but may require adjustments
- # for older Solaris releases
- for lib in libast libdll libcmd libshell ; do
- test $? -eq 0 || exit 1
- case "$lib" in
- libshell)
- base="lib/"
- vers=1
- link="-L${root}/lib/ -lcmd -ldll -last -lm"
- ;;
- libdll)
- base="src/lib/${lib}"
- vers=1
- link="-ldl"
- ;;
- libast)
- base="src/lib/${lib}"
- vers=1
- link="-lm"
- ;;
- *)
- base="src/lib/${lib}"
- vers=1
- link="-L${root}/lib/ -last -lm"
- ;;
- esac
-
- (
- cd "${root}/${base}"
- if [[ "${buildmode}" = *solaris* ]] ; then
- ${CC} ${CC_SHAREDLIB} ${CCFLAGS} -Wl,-zallextract -Wl,-zmuldefs -o "${root}/lib/${lib}.so.${vers}" "${lib}.a" $link
- else
- ${CC} ${CC_SHAREDLIB} ${CCFLAGS} -Wl,--whole-archive -Wl,-zmuldefs "${lib}.a" -Wl,--no-whole-archive -o "${root}/lib/${lib}.so.${vers}" $link
- fi
-
- #rm ${lib}.a
- mv "${lib}.a" "disabled_${lib}.a_"
-
- cd "${root}/lib"
- ln -sf "${lib}.so.${vers}" "${lib}.so"
- )
- done
-
- (
- base=src/cmd/ksh93
- cd ${root}/${base}
- rm -f ${root}/lib/libshell.a
- rm -f ${root}/lib/libdll.a
- rm -f ${root}/lib/libast.a
-
- if [[ "${buildmode}" = *solaris* ]] ; then
- ${CC} ${CCFLAGS} ${BSUNCC_APP_CCFLAGS} -L${root}/lib/ -o ksh pmain.o -lshell -Bstatic -lcmd -Bdynamic -ldll -last -lm -lsecdb
- else
- ${CC} ${CCFLAGS} ${BSUNCC_APP_CCFLAGS} -L${root}/lib/ -o ksh pmain.o -lshell -lcmd -ldll -last -lm
- fi
-
- ldd ksh
- )
- fi
-}
-
-function test_shell
-{
- set -e -x
-
- export SHELL="$(ls -1 $PWD/arch/*/src/cmd/ksh93/ksh)"
- export LD_LIBRARY_PATH="$(ls -1ad $PWD/arch/*/lib):${LD_LIBRARY_PATH}"
- export LD_LIBRARY_PATH_32="$(ls -1ad $PWD/arch/*/lib):${LD_LIBRARY_PATH_32}"
- export LD_LIBRARY_PATH_64="$(ls -1ad $PWD/arch/*/lib):${LD_LIBRARY_PATH_64}"
- print "## SHELL is |${SHELL}|"
- print "## LD_LIBRARY_PATH is |${LD_LIBRARY_PATH}|"
-
- [ ! -f "${SHELL}" ] && fatal_error "test_shell: |${SHELL}| is not a file."
- [ ! -x "${SHELL}" ] && fatal_error "test_shell: |${SHELL}| is not executable."
-
- case "${buildmode}" in
- testshell.bcheck*)
- for i in ./src/cmd/ksh93/tests/*.sh ; do
- bc_logfile="$(basename "$i").$$.bcheck"
- rm -f "${bc_logfile}"
- /opt/SUNWspro/bin/bcheck -q -access -o "${bc_logfile}" ${SHELL} ./src/cmd/ksh93/tests/shtests \
- LD_LIBRARY_PATH_64="$LD_LIBRARY_PATH_64" \
- LD_LIBRARY_PATH="$LD_LIBRARY_PATH" \
- LD_LIBRARY_PATH_32="$LD_LIBRARY_PATH_32"\
- LANG=C LC_ALL=C \
- "$i"
- cat "${bc_logfile}"
- done
- ;;
- testshell)
- for i in ./src/cmd/ksh93/tests/*.sh ; do
- ${SHELL} ./src/cmd/ksh93/tests/shtests \
- LD_LIBRARY_PATH_64="$LD_LIBRARY_PATH_64" \
- LD_LIBRARY_PATH="$LD_LIBRARY_PATH" \
- LD_LIBRARY_PATH_32="$LD_LIBRARY_PATH_32"\
- LANG=C LC_ALL=C \
- "$i"
- done
- ;;
- esac
-}
-
-# main
-case "${buildmode}" in
- build.*) build_shell ;;
- testshell*) test_shell ;;
- *) fatal_error "Illegal build mode \"${buildmode}\"." ;;
-esac
-# EOF.
diff --git a/usr/src/lib/libshell/misc/buildksh93.readme b/usr/src/lib/libshell/misc/buildksh93.readme
index f221b17a4e..861292b649 100644
--- a/usr/src/lib/libshell/misc/buildksh93.readme
+++ b/usr/src/lib/libshell/misc/buildksh93.readme
@@ -17,26 +17,26 @@
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
+
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
#
# buildksh93.readme
#
* Intro:
-"buildksh93.ksh" is a small build script used to build the AT&T "ast-ksh"
+"buildksh93.sh" is a small build script used to build the AT&T "ast-ksh"
and "ast-open" packages using its native (nmake-based) build system
which is needed to build the iffe-generated (header) files (each time
for { 32bit SPARC, 64bit SPARC, 32bit i386, 64bit AMD64 }) which are
moved later to their matching OS/Net build directories.
+THIS SCRIPT IS NOT INTENDED FOR NORMAL USAGE.
-* Note that buildksh93.ksh modifies the build behaviour of the AST build
+* Note that buildksh93.sh modifies the build behaviour of the AST build
system, including enforcing C99/XPG6 semantics (which is MANDATORY!!)
and feeding additional libraries (like libnsl, libsocket, librt etc.)
to the feature look system (called "iffe" (="if feature exists")) to
@@ -47,25 +47,28 @@ properly found.
* Example usage of the script (more information can be found in the
script itself):
## Download AT&T ksh93 sources
-$ wget --http-user="I accept www.opensource.org/licenses/cpl" --http-passwd="." 'http://www.research.att.com/sw/download/beta/INIT.2007-04-18.tgz'
-$ wget --http-user="I accept www.opensource.org/licenses/cpl" --http-passwd="." 'http://www.research.att.com/sw/download/beta/ast-ksh.2007-04-18.tgz'
+$ wget --http-user="I accept www.opensource.org/licenses/cpl" --http-passwd="." 'http://www.research.att.com/~gsf/download/tgz/INIT.2008-11-04.tgz'
+$ wget --http-user="I accept www.opensource.org/licenses/cpl" --http-passwd="." 'http://www.research.att.com/~gsf/download/tgz/ast-ksh.2008-11-04.tgz'
## Unpack the sources (32bit SPARC):
-$ mkdir build32_sparc
-$ cd build32_sparc
-$ gunzip -c ../INIT.2007-03-28.tgz | tar -xf -
-$ gunzip -c ../ast-ksh.2007-03-28.tgz | tar -xf -
+$ mkdir build_sparc_32bit
+$ cd build_sparc_32bit
+$ gunzip -c <../INIT.2008-11-04.tgz | tar -xf -
+$ gunzip -c <../ast-ksh.2008-11-04.tgz | tar -xf -
-## Build ast-ksh for 32bit SPARC (build other build flags are:
-# - "build.solaris.sparc.32bit.suncc" - 32bit SPARC
-# - "build.solaris.sparc.64bit.suncc" - 64bit SPARC
-# - "build.solaris.i386.32bit.suncc" - 32bit x86/i386
-# - "build.solaris.i386.64bit.suncc" - 64bit x86/AMD64
+## Build ast-ksh for 32bit SPARC
+# (build other build flags are:
+# - "build.solaris.sparc.32bit.suncc" - 32bit SPARC
+# - "build.solaris.sparc.64bit.suncc" - 64bit SPARC
+# - "build.solaris.i386.32bit.suncc" - 32bit x86/i386
+# - "build.solaris.i386.64bit.suncc" - 64bit x86/AMD64
+# - "build.solaris.s390.32bit.gcc" - 32bit SystemZ/S390
+# - "build.solaris.s390.64bit.gcc" - 64bit SystemZ/S390x
# )
-$ time nice ksh ../buildksh93.ksh "build.solaris.sparc.32bit.suncc" 2>&1 | tee -a buildlog.log
+$ time nice ksh ../buildksh93.sh "build.solaris.sparc.32bit.suncc" 2>&1 | tee -a buildlog.log
-## Test ksh93
-$ time nice ksh ../buildksh93.ksh "testshell" 2>&1 | tee -a buildlog.log
+## Test ksh93:
+$ time nice ksh ../buildksh93.sh "testshell" 2>&1 | tee -a buildlog.log
## Generated binaries and headers can be found in the arch/$(PLATFORM)/
## subdirectory.
diff --git a/usr/src/lib/libshell/misc/buildksh93.sh b/usr/src/lib/libshell/misc/buildksh93.sh
new file mode 100644
index 0000000000..bc9c3c79a2
--- /dev/null
+++ b/usr/src/lib/libshell/misc/buildksh93.sh
@@ -0,0 +1,511 @@
+#!/bin/ksh -p
+# (note we use "/bin/ksh -p" for Linux/pdksh support in this script)
+
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# buildksh93.ksh - ast-ksh standalone build script for the
+# OpenSolaris ksh93-integration project
+#
+
+# ksh93t sources can be downloaded like this from the AT&T site:
+# wget --http-user="I accept www.opensource.org/licenses/cpl" --http-passwd="." 'http://www.research.att.com/~gsf/download/tgz/INIT.2008-11-04.tgz'
+# wget --http-user="I accept www.opensource.org/licenses/cpl" --http-passwd="." 'http://www.research.att.com/~gsf/download/tgz/ast-ksh.2008-11-04.tgz'
+
+function fatal_error
+{
+ print -u2 "${progname}: $*"
+ exit 1
+}
+
+set -o errexit
+set -o xtrace
+
+typeset progname="$(basename "${0}")"
+typeset buildmode="$1"
+
+if [[ "${buildmode}" == "" ]] ; then
+ fatal_error "buildmode required."
+fi
+
+# Make sure we use the C locale during building to avoid any unintended
+# side-effects
+export LANG=C
+export LC_ALL=$LANG LC_MONETARY=$LANG LC_NUMERIC=$LANG LC_MESSAGES=$LANG LC_COLLATE=$LANG LC_CTYPE=$LANG
+# Make sure the POSIX/XPG6 tools are in front of /usr/bin (/bin is needed for Linux after /usr/bin)
+export PATH=/usr/xpg6/bin:/usr/xpg4/bin:/usr/ccs/bin:/usr/bin:/bin:/opt/SUNWspro/bin
+
+# Make sure the POSIX/XPG6 packages are installed (mandatory for building
+# our version of ksh93 correctly).
+if [[ "$(uname -s)" == "SunOS" ]] ; then
+ if [[ ! -x "/usr/xpg6/bin/tr" ]] ; then
+ fatal_error "XPG6/4 packages (SUNWxcu6,SUNWxcu4) not installed."
+ fi
+fi
+
+function print_solaris_builtin_header
+{
+# Make sure to use \\ instead of \ for continuations
+cat <<ENDOFTEXT
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#ifndef _SOLARIS_KSH_CMDLIST_H
+#define _SOLARIS_KSH_CMDLIST_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * List builtins for Solaris.
+ * The list here is partially autogenerated and partially hand-picked
+ * based on compatibility with the native Solaris versions of these
+ * tools
+ */
+
+/* POSIX compatible commands */
+#ifdef _NOT_YET
+#define XPG6CMDLIST(f) \\
+ { "/usr/xpg6/bin/" #f, NV_BLTIN|NV_BLTINOPT|NV_NOFREE, bltin(f) },
+#define XPG4CMDLIST(f) \\
+ { "/usr/xpg4/bin/" #f, NV_BLTIN|NV_BLTINOPT|NV_NOFREE, bltin(f) },
+#else
+#define XPG6CMDLIST(f)
+#define XPG4CMDLIST(f)
+#endif /* NOT_YET */
+/*
+ * Commands which are 100% compatible with native Solaris versions (/bin is
+ * a softlink to ./usr/bin, ksh93 takes care about the lookup)
+ */
+#define BINCMDLIST(f) \\
+ { "/bin/" #f, NV_BLTIN|NV_BLTINOPT|NV_NOFREE, bltin(f) },
+#define USRBINCMDLIST(f) \\
+ { "/usr/bin/" #f, NV_BLTIN|NV_BLTINOPT|NV_NOFREE, bltin(f) },
+#define SBINCMDLIST(f) \\
+ { "/sbin/" #f, NV_BLTIN|NV_BLTINOPT|NV_NOFREE, bltin(f) },
+#define SUSRBINCMDLIST(f) \\
+ { "/usr/sbin/" #f, NV_BLTIN|NV_BLTINOPT|NV_NOFREE, bltin(f) },
+/*
+ * Make all ksh93 builtins accessible when /usr/ast/bin was added to
+ * /usr/xpg6/bin:/usr/xpg4/bin:/usr/ccs/bin:/usr/bin:/bin:/opt/SUNWspro/bin
+ */
+#define ASTCMDLIST(f) \\
+ { "/usr/ast/bin/" #f, NV_BLTIN|NV_BLTINOPT|NV_NOFREE, bltin(f) },
+
+/* undo ast_map.h #defines to avoid collision */
+#undef basename
+#undef dirname
+
+/* Generated data, do not edit. */
+XPG4CMDLIST(basename)
+ASTCMDLIST(basename)
+BINCMDLIST(cat)
+ASTCMDLIST(cat)
+XPG4CMDLIST(chgrp)
+ASTCMDLIST(chgrp)
+ASTCMDLIST(chmod)
+XPG4CMDLIST(chown)
+BINCMDLIST(chown)
+ASTCMDLIST(chown)
+BINCMDLIST(cksum)
+ASTCMDLIST(cksum)
+BINCMDLIST(cmp)
+ASTCMDLIST(cmp)
+ASTCMDLIST(comm)
+XPG4CMDLIST(cp)
+ASTCMDLIST(cp)
+BINCMDLIST(cut)
+ASTCMDLIST(cut)
+XPG4CMDLIST(date)
+ASTCMDLIST(date)
+ASTCMDLIST(dirname)
+XPG4CMDLIST(expr)
+ASTCMDLIST(expr)
+ASTCMDLIST(fds)
+ASTCMDLIST(fmt)
+ASTCMDLIST(fold)
+BINCMDLIST(head)
+ASTCMDLIST(head)
+XPG4CMDLIST(id)
+ASTCMDLIST(id)
+ASTCMDLIST(join)
+XPG4CMDLIST(ln)
+ASTCMDLIST(ln)
+BINCMDLIST(logname)
+ASTCMDLIST(logname)
+BINCMDLIST(mkdir)
+ASTCMDLIST(mkdir)
+BINCMDLIST(mkfifo)
+ASTCMDLIST(mkfifo)
+XPG4CMDLIST(mv)
+ASTCMDLIST(mv)
+BINCMDLIST(paste)
+ASTCMDLIST(paste)
+ASTCMDLIST(pathchk)
+BINCMDLIST(rev)
+ASTCMDLIST(rev)
+XPG4CMDLIST(rm)
+ASTCMDLIST(rm)
+BINCMDLIST(rmdir)
+ASTCMDLIST(rmdir)
+XPG4CMDLIST(stty)
+ASTCMDLIST(stty)
+BINCMDLIST(sum)
+ASTCMDLIST(sum)
+SUSRBINCMDLIST(sync)
+SBINCMDLIST(sync)
+BINCMDLIST(sync)
+ASTCMDLIST(sync)
+XPG4CMDLIST(tail)
+ASTCMDLIST(tail)
+BINCMDLIST(tee)
+ASTCMDLIST(tee)
+BINCMDLIST(tty)
+ASTCMDLIST(tty)
+ASTCMDLIST(uname)
+BINCMDLIST(uniq)
+ASTCMDLIST(uniq)
+BINCMDLIST(wc)
+ASTCMDLIST(wc)
+
+/* Mandatory for ksh93 test suite and AST scripts */
+BINCMDLIST(getconf)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !_SOLARIS_KSH_CMDLIST_H */
+ENDOFTEXT
+}
+
+function build_shell
+{
+ set -o errexit
+ set -o xtrace
+
+ # OS.cputype.XXbit.compiler
+ case "${buildmode}" in
+ *.linux.*)
+ # ksh93+AST config flags
+ bast_flags="-DSHOPT_CMDLIB_BLTIN=0 -DSH_CMDLIB_DIR=\\\"/usr/ast/bin\\\" -DSHOPT_SYSRC -D_map_libc=1"
+
+ # gcc flags
+ bgcc99="gcc -std=gnu99 "
+ bgcc_ccflags="${bon_flags} ${bast_flags} -g"
+
+ case "${buildmode}" in
+ # Linux i386
+ *.i386.32bit.gcc*) HOSTTYPE="linux.i386" CC="${bgcc99} -fPIC" cc_sharedlib="-shared" CCFLAGS="${bgcc_ccflags}"
+ ;;
+ *)
+ fatal_error "build_shell: Illegal Linux type/compiler build mode \"${buildmode}\"."
+ ;;
+ esac
+ ;;
+ *.solaris.*)
+ # Notes:
+ # 1. Do not remove/modify these flags or their order before either
+ # asking the project leads at
+ # http://www.opensolaris.org/os/project/ksh93-integration/
+ # These flags all have a purpose, even if they look
+ # weird/redundant/etc. at the first look.
+ #
+ # 2. We use -KPIC here since -Kpic is too small on 64bit sparc and
+ # on 32bit it's close to the barrier so we use it for both 32bit and
+ # 64bit to avoid later suprises when people update libast in the
+ # future
+ #
+ # 3. "-D_map_libc=1" is needed to force map.c to add a "_ast_" prefix to all
+ # AST symbol names which may otherwise collide with Solaris/Linux libc
+ #
+ # 4. "-DSHOPT_SYSRC" enables /etc/ksh.kshrc support (AST default is currently
+ # to enable it if /etc/ksh.kshrc or /etc/bash.bashrc are available on the
+ # build machine).
+ #
+ # 5. -D_lib_socket=1 -lsocket -lnsl" was added to make sure ksh93 is compiled
+ # with networking support enabled, the current AST build infratructure has
+ # problems with detecting networking support in Solaris.
+ #
+ # 6. "-xc99=%all -D_XOPEN_SOURCE=600 -D__EXTENSIONS__=1" is used to force
+ # the compiler into C99 mode. Otherwise ksh93 will be much slower and lacks
+ # lots of arithmethic functions.
+ #
+ # 7. "-D_TS_ERRNO -D_REENTRANT" are flags taken from the default OS/Net
+ # build system.
+ #
+ # 8. "-xpagesize_stack=64K is used on SPARC to enhance the performace
+ #
+ # 9. -DSHOPT_CMDLIB_BLTIN=0 -DSH_CMDLIB_DIR=\\\"/usr/ast/bin\\\" -DSHOPT_CMDLIB_HDR=\\\"/home/test001/ksh93/ast_ksh_20070322/solaris_cmdlist.h\\\"
+ # is used to bind all ksh93 builtins to a "virtual" directory
+ # called "/usr/ast/bin/" and to adjust the list of builtins
+ # enabled by default to those defined by PSARC 2006/550
+
+ solaris_builtin_header="${PWD}/tmp_solaris_builtin_header.h"
+ print_solaris_builtin_header >"${solaris_builtin_header}"
+
+ # OS/Net build flags
+ bon_flags="-D_TS_ERRNO -D_REENTRANT"
+
+ # ksh93+AST config flags
+ bast_flags="-DSHOPT_CMDLIB_BLTIN=0 -DSH_CMDLIB_DIR=\\\"/usr/ast/bin\\\" -DSHOPT_CMDLIB_HDR=\\\"${solaris_builtin_header}\\\" -DSHOPT_SYSRC -D_map_libc=1"
+
+ # Sun Studio flags
+ bsunc99="/opt/SUNWspro/bin/cc -xc99=%all -D_XOPEN_SOURCE=600 -D__EXTENSIONS__=1"
+ bsuncc_app_ccflags_sparc="-xpagesize_stack=64K" # use bsuncc_app_ccflags_sparc only for final executables
+ bsuncc_ccflags="${bon_flags} -KPIC -g -xs -xspace -Xa -xstrconst -z combreloc -xildoff -xcsi -errtags=yes ${bast_flags} -D_lib_socket=1 -lsocket -lnsl"
+
+ # gcc flags
+ bgcc99="/usr/sfw/bin/gcc -std=gnu99 -D_XOPEN_SOURCE=600 -D__EXTENSIONS__=1"
+ bgcc_ccflags="${bon_flags} ${bast_flags} -D_lib_socket=1 -lsocket -lnsl"
+
+
+ case "${buildmode}" in
+ *.i386.32bit.suncc*) HOSTTYPE="sol11.i386" CC="${bsunc99}" cc_sharedlib="-G" CCFLAGS="${bsuncc_ccflags}" ;;
+ *.i386.64bit.suncc*) HOSTTYPE="sol11.i386" CC="${bsunc99} -xarch=amd64 -KPIC" cc_sharedlib="-G" CCFLAGS="${bsuncc_ccflags}" ;;
+ *.sparc.32bit.suncc*) HOSTTYPE="sol11.sun4" CC="${bsunc99}" cc_sharedlib="-G" CCFLAGS="${bsuncc_ccflags}" bsuncc_app_ccflags="${bsuncc_app_ccflags_sparc}" ;;
+ *.sparc.64bit.suncc*) HOSTTYPE="sol11.sun4" CC="${bsunc99} -xarch=v9 -dalign -KPIC" cc_sharedlib="-G" CCFLAGS="${bsuncc_ccflags}" bsuncc_app_ccflags="${bsuncc_app_ccflags_sparc}" ;;
+
+ *.i386.32bit.gcc*) HOSTTYPE="sol11.i386" CC="${bgcc99} -fPIC" cc_sharedlib="-shared" CCFLAGS="${bgcc_ccflags}" ;;
+ *.i386.64bit.gcc*) HOSTTYPE="sol11.i386" CC="${bgcc99} -m64 -mtune=opteron -Ui386 -U__i386 -fPIC" cc_sharedlib="-shared" CCFLAGS="${bgcc_ccflags}" ;;
+ *.sparc.32bit.gcc*) HOSTTYPE="sol11.sun4" CC="${bgcc99} -m32 -mcpu=v8 -fPIC" cc_sharedlib="-shared" CCFLAGS="${bgcc_ccflags}" ;;
+ *.sparc.64bit.gcc*) HOSTTYPE="sol11.sun4" CC="${bgcc99} -m64 -mcpu=v9 -fPIC" cc_sharedlib="-shared" CCFLAGS="${bgcc_ccflags}" ;;
+ *.s390.32bit.gcc*) HOSTTYPE="sol11.s390" CC="${bgcc99} -m32 -fPIC" cc_sharedlib="-shared" CCFLAGS="${bgcc_ccflags}" ;;
+ *.s390.64bit.gcc*) HOSTTYPE="sol11.s390" CC="${bgcc99} -m64 -fPIC" cc_sharedlib="-shared" CCFLAGS="${bgcc_ccflags}" ;;
+
+ *)
+ fatal_error "build_shell: Illegal Solaris type/compiler build mode \"${buildmode}\"."
+ ;;
+ esac
+ ;;
+ *)
+ fatal_error "Illegal OS build mode \"${buildmode}\"."
+ ;;
+ esac
+
+ # some prechecks
+ [[ -z "${CCFLAGS}" ]] && fatal_error "build_shell: CCFLAGS is empty."
+ [[ -z "${CC}" ]] && fatal_error "build_shell: CC is empty."
+ [[ -z "${HOSTTYPE}" ]] && fatal_error "build_shell: HOSTTYPE is empty."
+ [[ ! -f "bin/package" ]] && fatal_error "build_shell: bin/package missing."
+ [[ ! -x "bin/package" ]] && fatal_error "build_shell: bin/package not executable."
+
+ export CCFLAGS CC HOSTTYPE
+
+ # build ksh93
+ bin/package make CCFLAGS="${CCFLAGS}" CC="${CC}" HOSTTYPE="${HOSTTYPE}"
+
+ root="${PWD}/arch/${HOSTTYPE}"
+ [[ -d "$root" ]] || fatal_error "build_shell: directory ${root} not found."
+ log="${root}/lib/package/gen/make.out"
+
+ [[ -s $log ]] || fatal_error "build_shell: no make.out log found."
+
+ if [[ "${buildmode}" != *.staticshell* ]] ; then
+ # libcmd causes some trouble since there is a squatter in solaris
+ # This has been fixed in Solaris 11/B48 but may require adjustments
+ # for older Solaris releases
+ for lib in libast libdll libsum libcmd libshell ; do
+ (( $? == 0 )) || exit 1
+ case "$lib" in
+ libshell)
+ base="lib/"
+ vers=1
+ link="-L${root}/lib/ -lcmd -lsum -ldll -last -lm"
+ ;;
+ libdll)
+ base="src/lib/${lib}"
+ vers=1
+ link="-ldl"
+ ;;
+ libast)
+ base="src/lib/${lib}"
+ vers=1
+ link="-lm"
+ ;;
+ *)
+ base="src/lib/${lib}"
+ vers=1
+ link="-L${root}/lib/ -last -lm"
+ ;;
+ esac
+
+ (
+ cd "${root}/${base}"
+ if [[ "${buildmode}" == *solaris* ]] ; then
+ ${CC} ${cc_sharedlib} ${CCFLAGS} -Bdirect -Wl,-zallextract -Wl,-zmuldefs -o "${root}/lib/${lib}.so.${vers}" "${lib}.a" $link
+ else
+ ${CC} ${cc_sharedlib} ${CCFLAGS} -Wl,--whole-archive -Wl,-zmuldefs "${lib}.a" -Wl,--no-whole-archive -o "${root}/lib/${lib}.so.${vers}" $link
+ fi
+
+ #rm ${lib}.a
+ mv "${lib}.a" "disabled_${lib}.a_"
+
+ cd "${root}/lib"
+ ln -sf "${lib}.so.${vers}" "${lib}.so"
+ )
+ done
+
+ (
+ base=src/cmd/ksh93
+ cd "${root}/${base}"
+ rm -f \
+ "${root}/lib/libshell.a" \
+ "${root}/lib/libsum.a" \
+ "${root}/lib/libdll.a" \
+ "${root}/lib/libast.a"
+
+ if [[ "${buildmode}" == *solaris* ]] ; then
+ ${CC} ${CCFLAGS} ${bsuncc_app_ccflags} -L${root}/lib/ -Bdirect -o ksh pmain.o -lshell -Bstatic -lcmd -Bdynamic -lsum -ldll -last -lm -lmd -lsecdb
+ else
+ ${CC} ${CCFLAGS} ${bsuncc_app_ccflags} -L${root}/lib/ -o ksh pmain.o -lshell -lcmd -lsum -ldll -last -lm
+ fi
+
+ file ksh
+ file shcomp
+
+ export LD_LIBRARY_PATH="${root}/lib:${LD_LIBRARY_PATH}"
+ export LD_LIBRARY_PATH_32="${root}/lib:${LD_LIBRARY_PATH_32}"
+ export LD_LIBRARY_PATH_64="${root}/lib:${LD_LIBRARY_PATH_64}"
+ ldd ksh
+ )
+ fi
+}
+
+function test_builtin_getconf
+{
+(
+ print "# testing getconf builtin..."
+ set +o errexit
+ export PATH=/bin:/usr/bin
+ for lang in ${TEST_LANG} ; do
+ (
+ printf "## testing LANG=%s\n" "${lang}"
+ export LC_ALL="${lang}" LANG="${lang}"
+ ${SHELL} -c '/usr/bin/getconf -a |
+ while read i ; do
+ t="${i%:*}" ; a="$(getconf "$t" 2>/dev/null)" ;
+ b="$(/usr/bin/getconf "$t" 2>/dev/null)" ; [ "$a" != "$b" ] && print "# |$t|:|$a| != |$b|" ;
+ done'
+ )
+ done
+ print "# testing getconf done."
+)
+}
+
+function test_shell
+{
+ set -o errexit
+ set -o xtrace
+
+ export SHELL="$(ls -1 $PWD/arch/*/src/cmd/ksh93/ksh)"
+ export LD_LIBRARY_PATH="$(ls -1ad $PWD/arch/*/lib):${LD_LIBRARY_PATH}"
+ export LD_LIBRARY_PATH_32="$(ls -1ad $PWD/arch/*/lib):${LD_LIBRARY_PATH_32}"
+ export LD_LIBRARY_PATH_64="$(ls -1ad $PWD/arch/*/lib):${LD_LIBRARY_PATH_64}"
+ printf "## SHELL is |%s|\n" "${SHELL}"
+ printf "## LD_LIBRARY_PATH is |%s|\n" "${LD_LIBRARY_PATH}"
+
+ [[ ! -f "${SHELL}" ]] && fatal_error "test_shell: |${SHELL}| is not a file."
+ [[ ! -x "${SHELL}" ]] && fatal_error "test_shell: |${SHELL}| is not executable."
+
+ [[ "${TEST_LANG}" == "" ]] && TEST_LANG="C"
+
+ case "${buildmode}" in
+ testshell.bcheck*)
+ for lang in ${TEST_LANG} ; do
+ (
+ export LC_ALL="${lang}" LANG="${lang}"
+ for i in ./src/cmd/ksh93/tests/*.sh ; do
+ bc_logfile="$(basename "$i").$$.bcheck"
+ rm -f "${bc_logfile}"
+ /opt/SUNWspro/bin/bcheck -q -access -o "${bc_logfile}" ${SHELL} ./src/cmd/ksh93/tests/shtests \
+ LD_LIBRARY_PATH_64="$LD_LIBRARY_PATH_64" \
+ LD_LIBRARY_PATH="$LD_LIBRARY_PATH" \
+ LD_LIBRARY_PATH_32="$LD_LIBRARY_PATH_32"\
+ LC_ALL="${lang}" LANG="${lang}" \
+ VMDEBUG=a \
+ "$i"
+ cat "${bc_logfile}"
+ done
+ )
+ done
+ ;;
+ testshell.builtin.getconf)
+ test_builtin_getconf
+ ;;
+ testshell)
+ for lang in ${TEST_LANG} ; do
+ (
+ export LC_ALL="${lang}" LANG="${lang}"
+ for i in ./src/cmd/ksh93/tests/*.sh ; do
+ ${SHELL} ./src/cmd/ksh93/tests/shtests -a \
+ LD_LIBRARY_PATH_64="$LD_LIBRARY_PATH_64" \
+ LD_LIBRARY_PATH="$LD_LIBRARY_PATH" \
+ LD_LIBRARY_PATH_32="$LD_LIBRARY_PATH_32" \
+ LC_ALL="${lang}" LANG="${lang}" \
+ VMDEBUG=a \
+ SHCOMP=$PWD/arch/*/bin/shcomp \
+ "$i"
+ done
+ )
+ done
+ test_builtin_getconf
+ ;;
+ esac
+}
+
+# main
+case "${buildmode}" in
+ build.*) build_shell ;;
+ testshell*) test_shell ;;
+ *) fatal_error "Illegal build mode \"${buildmode}\"." ;;
+esac
+# EOF.
diff --git a/usr/src/lib/libshell/misc/filelist.txt b/usr/src/lib/libshell/misc/filelist.txt
index c5e55fd4d5..5a2c7cc9dd 100644
--- a/usr/src/lib/libshell/misc/filelist.txt
+++ b/usr/src/lib/libshell/misc/filelist.txt
@@ -18,10 +18,10 @@
#
# CDDL HEADER END
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
+
#
-# ident "%Z%%M% %I% %E% SMI"
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
#
#
diff --git a/usr/src/lib/libshell/sparc/Makefile b/usr/src/lib/libshell/sparc/Makefile
index f91f0270e9..8c5c13a9b9 100644
--- a/usr/src/lib/libshell/sparc/Makefile
+++ b/usr/src/lib/libshell/sparc/Makefile
@@ -18,13 +18,16 @@
#
# CDDL HEADER END
#
+
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
include ../Makefile.com
+# Use -KPIC since libshell is too big for -Kpic on 64bit
+# (and on 32bit it is close to the barrier)
+sparc_C_PICFLAGS = $(C_BIGPICFLAGS)
+
install: all $(ROOTLIBS) $(ROOTLINKS) $(ROOTLINT)
diff --git a/usr/src/lib/libshell/sparc/include/ast/history.h b/usr/src/lib/libshell/sparc/include/ast/history.h
index 55ead66f9e..bfac5d3b35 100644
--- a/usr/src/lib/libshell/sparc/include/ast/history.h
+++ b/usr/src/lib/libshell/sparc/include/ast/history.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -65,7 +65,7 @@ extern __MANGLE__ int _Hist;
#define hist_min(hp) ((_Hist=((int)((hp)->histind-(hp)->histsize)))>=0?_Hist:0)
#define hist_max(hp) ((int)((hp)->histind))
/* these are the history interface routines */
-extern __MANGLE__ int sh_histinit __PROTO__((void));
+extern __MANGLE__ int sh_histinit __PROTO__((__V_ *));
extern __MANGLE__ void hist_cancel __PROTO__((History_t*));
extern __MANGLE__ void hist_close __PROTO__((History_t*));
extern __MANGLE__ int hist_copy __PROTO__((char*, int, int, int));
diff --git a/usr/src/lib/libshell/sparc/include/ast/nval.h b/usr/src/lib/libshell/sparc/include/ast/nval.h
index 06b18217b7..c11fd66143 100644
--- a/usr/src/lib/libshell/sparc/include/ast/nval.h
+++ b/usr/src/lib/libshell/sparc/include/ast/nval.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -40,6 +40,7 @@
#include <ast.h>
#include <cdt.h>
+#include <option.h>
/* for compatibility with old hash library */
#define Hashtab_t Dt_t
@@ -53,8 +54,7 @@ typedef struct Namfun Namfun_t;
typedef struct Namdisc Namdisc_t;
typedef struct Nambfun Nambfun_t;
typedef struct Namarray Namarr_t;
-typedef struct Nambltin Nambltin_t;
-typedef struct Namtype Namtype_t;
+typedef struct Namdecl Namdecl_t;
/*
* This defines the template for nodes that have their own assignment
@@ -73,13 +73,14 @@ struct Namdisc
Namval_t *(*nextf) __PROTO__((Namval_t*, Dt_t*, Namfun_t*));
Namval_t *(*typef) __PROTO__((Namval_t*, Namfun_t*));
int (*readf) __PROTO__((Namval_t*, Sfio_t*, int, Namfun_t*));
+ int (*writef) __PROTO__((Namval_t*, Sfio_t*, int, Namfun_t*));
};
struct Namfun
{
const Namdisc_t *disc;
char nofree;
- char funs;
+ unsigned char subshell;
unsigned short dsize;
Namfun_t *next;
char *last;
@@ -101,22 +102,14 @@ struct Namarray
long nelem; /* number of elements */
__V_ *(*fun) __PROTO__((Namval_t*,const char*,int)); /* associative arrays */
Namval_t *parent; /* for multi-dimensional */
+ Dt_t *table; /* for subscripts */
+ __V_ *scope; /* non-zerp when scoped */
};
-/* Passed as third argument to a builtin when NV_BLTINOPT is set on node */
-struct Nambltin
+/* The context pointer for declaration command */
+struct Namdecl
{
- __V_ *shp;
- Namval_t *np;
- __V_ *ptr;
- __V_ *data;
- int flags;
-};
-
-struct Namtype
-{
- __V_ *shp;
- Namval_t *np;
+ Namval_t *tp; /* point to type */
const char *optstring;
__V_ *optinfof;
};
@@ -141,6 +134,7 @@ struct Namval
};
#define NV_CLASS ".sh.type"
+#define NV_DATA "_" /* special class or instance variable */
#define NV_MINSZ (sizeof(struct Namval)-sizeof(Dtlink_t)-sizeof(char*))
#define nv_namptr(p,n) ((Namval_t*)((char*)(p)+(n)*NV_MINSZ-sizeof(Dtlink_t)))
@@ -172,13 +166,14 @@ struct Namval
#define NV_SHORT (NV_RJUST) /* when integers are not long */
#define NV_LONG (NV_UTOL) /* for long long and long double */
#define NV_UNSIGN (NV_LTOU) /* for unsigned quantities */
-#define NV_DOUBLE (NV_ZFILL) /* for floating point */
+#define NV_DOUBLE (NV_INTEGER|NV_ZFILL) /* for floating point */
#define NV_EXPNOTE (NV_LJUST) /* for scientific notation */
+#define NV_HEXFLOAT (NV_LTOU) /* for C99 base16 float notation */
/* options for nv_open */
#define NV_APPEND 0x10000 /* append value */
-#define NV_MOVE 0x20000 /* for use with nv_clone */
+#define NV_MOVE 0x8000000 /* for use with nv_clone */
#define NV_ADD 8
/* add node if not found */
#define NV_ASSIGN NV_NOFREE /* assignment is possible */
@@ -194,19 +189,21 @@ struct Namval
#define NV_NODISC NV_IDENT /* ignore disciplines */
#define NV_FUNCT NV_IDENT /* option for nv_create */
-#define NV_BLTINOPT NV_ZFILL /* save state for optimization*/
+#define NV_BLTINOPT NV_ZFILL /* mark builtins in libcmd */
#define NV_PUBLIC (~(NV_NOSCOPE|NV_ASSIGN|NV_IDENT|NV_VARNAME|NV_NOADD))
/* numeric types */
+#define NV_INT16P (NV_LJUST|NV_SHORT|NV_INTEGER)
#define NV_INT16 (NV_SHORT|NV_INTEGER)
#define NV_UINT16 (NV_UNSIGN|NV_SHORT|NV_INTEGER)
+#define NV_UINT16P (NV_LJUSTNV_UNSIGN|NV_SHORT|NV_INTEGER)
#define NV_INT32 (NV_INTEGER)
#define NV_UNT32 (NV_UNSIGN|NV_INTEGER)
#define NV_INT64 (NV_LONG|NV_INTEGER)
#define NV_UINT64 (NV_UNSIGN|NV_LONG|NV_INTEGER)
-#define NV_FLOAT (NV_SHORT|NV_DOUBLE|NV_INTEGER)
-#define NV_LDOUBLE (NV_LONG|NV_DOUBLE|NV_INTEGER)
+#define NV_FLOAT (NV_SHORT|NV_DOUBLE)
+#define NV_LDOUBLE (NV_LONG|NV_DOUBLE)
/* name-value pair macros */
#define nv_isattr(np,f) ((np)->nvflag & (f))
@@ -222,6 +219,7 @@ struct Namval
#define NV_ADELETE 5 /* delete current subscript */
#define NV_AADD 6 /* add subscript if not found */
#define NV_ACURRENT 7 /* return current subscript Namval_t* */
+#define NV_ASETSUB 8 /* set current subscript */
/* The following are for nv_disc */
#define NV_FIRST 1
@@ -230,7 +228,7 @@ struct Namval
#define NV_CLONE 4
/* The following are operations for nv_putsub() */
-#define ARRAY_BITS 24
+#define ARRAY_BITS 22
#define ARRAY_ADD (1L<<ARRAY_BITS) /* add subscript if not found */
#define ARRAY_SCAN (2L<<ARRAY_BITS) /* For ${array[@]} */
#define ARRAY_UNDEF (4L<<ARRAY_BITS) /* For ${array} */
@@ -250,7 +248,9 @@ struct Namval
# endif /* _BLD_shell */
#endif /* _DLL */
/* prototype for array interface*/
+extern __MANGLE__ Namarr_t *nv_arrayptr __PROTO__((Namval_t*));
extern __MANGLE__ Namarr_t *nv_setarray __PROTO__((Namval_t*,__V_*(*)(Namval_t*,const char*,int)));
+extern __MANGLE__ int nv_arraynsub __PROTO__((Namarr_t*));
extern __MANGLE__ __V_ *nv_associative __PROTO__((Namval_t*,const char*,int));
extern __MANGLE__ int nv_aindex __PROTO__((Namval_t*));
extern __MANGLE__ int nv_nextsub __PROTO__((Namval_t*));
@@ -264,6 +264,7 @@ extern __MANGLE__ int nv_clone __PROTO__((Namval_t*, Namval_t*, int));
extern __MANGLE__ void nv_close __PROTO__((Namval_t*));
extern __MANGLE__ __V_ *nv_context __PROTO__((Namval_t*));
extern __MANGLE__ Namval_t *nv_create __PROTO__((const char*, Dt_t*, int,Namfun_t*));
+extern __MANGLE__ void nv_delete __PROTO__((Namval_t*, Dt_t*, int));
extern __MANGLE__ Dt_t *nv_dict __PROTO__((Namval_t*));
extern __MANGLE__ Sfdouble_t nv_getn __PROTO__((Namval_t*, Namfun_t*));
extern __MANGLE__ Sfdouble_t nv_getnum __PROTO__((Namval_t*));
@@ -271,13 +272,15 @@ extern __MANGLE__ char *nv_getv __PROTO__((Namval_t*, Namfun_t*));
extern __MANGLE__ char *nv_getval __PROTO__((Namval_t*));
extern __MANGLE__ Namfun_t *nv_hasdisc __PROTO__((Namval_t*, const Namdisc_t*));
extern __MANGLE__ int nv_isnull __PROTO__((Namval_t*));
+extern __MANGLE__ Namfun_t *nv_isvtree __PROTO__((Namval_t*));
extern __MANGLE__ Namval_t *nv_lastdict __PROTO__((void));
+extern __MANGLE__ Namval_t *nv_mkinttype __PROTO__((char*, size_t, int, const char*, Namdisc_t*));
extern __MANGLE__ void nv_newattr __PROTO__((Namval_t*,unsigned,int));
extern __MANGLE__ Namval_t *nv_open __PROTO__((const char*,Dt_t*,int));
extern __MANGLE__ void nv_putval __PROTO__((Namval_t*,const char*,int));
extern __MANGLE__ void nv_putv __PROTO__((Namval_t*,const char*,int,Namfun_t*));
+extern __MANGLE__ int nv_rename __PROTO__((Namval_t*,int));
extern __MANGLE__ int nv_scan __PROTO__((Dt_t*,void(*)(Namval_t*,__V_*),__V_*,int,int));
-extern __MANGLE__ Namval_t *nv_scoped __PROTO__((Namval_t*));
extern __MANGLE__ char *nv_setdisc __PROTO__((Namval_t*,const char*,Namval_t*,Namfun_t*));
extern __MANGLE__ void nv_setref __PROTO__((Namval_t*, Dt_t*,int));
extern __MANGLE__ int nv_settype __PROTO__((Namval_t*, Namval_t*, int));
@@ -285,11 +288,12 @@ extern __MANGLE__ void nv_setvec __PROTO__((Namval_t*,int,int,char*[]));
extern __MANGLE__ void nv_setvtree __PROTO__((Namval_t*));
extern __MANGLE__ int nv_setsize __PROTO__((Namval_t*,int));
extern __MANGLE__ Namfun_t *nv_disc __PROTO__((Namval_t*,Namfun_t*,int));
-extern __MANGLE__ void nv_unset __PROTO__((Namval_t*));
+extern __MANGLE__ void nv_unset __PROTO__((Namval_t*)); /*obsolete */
+extern __MANGLE__ void _nv_unset __PROTO__((Namval_t*,int));
extern __MANGLE__ Namval_t *nv_search __PROTO__((const char *, Dt_t*, int));
-extern __MANGLE__ void nv_unscope __PROTO__((void));
extern __MANGLE__ char *nv_name __PROTO__((Namval_t*));
extern __MANGLE__ Namval_t *nv_type __PROTO__((Namval_t*));
+extern __MANGLE__ void nv_addtype __PROTO__((Namval_t*,const char*, Optdisc_t*, size_t));
extern __MANGLE__ const Namdisc_t *nv_discfun __PROTO__((int));
#ifdef _DLL
@@ -297,6 +301,7 @@ extern __MANGLE__ const Namdisc_t *nv_discfun __PROTO__((int));
#define __MANGLE__ __LINKAGE__
#endif /* _DLL */
+#define nv_unset(np) _nv_unset(np,0)
#define nv_size(np) nv_setsize((np),-1)
#define nv_stack(np,nf) nv_disc(np,nf,0)
@@ -308,7 +313,7 @@ extern __MANGLE__ const Namdisc_t *nv_discfun __PROTO__((int));
# define nv_istype(np) nv_isattr(np)
# define nv_newtype(np) nv_newattr(np)
# define nv_namset(np,a,b) nv_open(np,a,b)
-# define nv_free(np) nv_unset(np)
+# define nv_free(np) nv_unset(np,0)
# define nv_settype(np,a,b,c) nv_setdisc(np,a,b,c)
# define nv_search(np,a,b) nv_open(np,a,((b)?0:NV_NOADD))
# define settype setdisc
diff --git a/usr/src/lib/libshell/sparc/include/ast/shell.h b/usr/src/lib/libshell/sparc/include/ast/shell.h
index 37cafa932b..adcefac221 100644
--- a/usr/src/lib/libshell/sparc/include/ast/shell.h
+++ b/usr/src/lib/libshell/sparc/include/ast/shell.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -36,7 +36,7 @@
*
*/
-#include <cmd.h>
+#include <ast.h>
#include <cdt.h>
#ifdef _SH_PRIVATE
# include "name.h"
@@ -44,7 +44,7 @@
# include <nval.h>
#endif /* _SH_PRIVATE */
-#define SH_VERSION 20060510
+#define SH_VERSION 20071012
#undef NOT_USED
#define NOT_USED(x) (&x,1)
@@ -56,8 +56,9 @@ typedef struct
}
Shopt_t;
-typedef void (*Shinit_f) __PROTO__((int));
-typedef int (*Shbltin_f) __PROTO__((int, char*[], __V_*));
+typedef struct Shell_s Shell_t;
+
+typedef void (*Shinit_f) __PROTO__((Shell_t*, int));
typedef int (*Shwait_f) __PROTO__((int, long, int));
union Shnode_u;
@@ -124,6 +125,7 @@ typedef struct sh_scope
char **argv;
char *cmdname;
char *filename;
+ char *funname;
int lineno;
Dt_t *var_tree;
struct sh_scope *self;
@@ -133,7 +135,7 @@ typedef struct sh_scope
* Saves the state of the shell
*/
-typedef struct sh_static
+struct Shell_s
{
Shopt_t options; /* set -o options */
Dt_t *var_tree; /* for shell variables */
@@ -145,10 +147,11 @@ typedef struct sh_static
int exitval; /* most recent exit value */
unsigned char trapnote; /* set when trap/signal is pending */
char subshell; /* set for virtual subshell */
+ char shcomp; /* set when runing shcomp */
#ifdef _SH_PRIVATE
_SH_PRIVATE
#endif /* _SH_PRIVATE */
-} Shell_t;
+};
/* flags for sh_parse */
#define SH_NL 1 /* Treat new-lines as ; */
@@ -158,9 +161,13 @@ typedef struct sh_static
#define SH_IOCOPROCESS (-2)
#define SH_IOHISTFILE (-3)
+#include <cmd.h>
+
/* symbolic value for sh_fdnotify */
#define SH_FDCLOSE (-1)
+#undef getenv /* -lshell provides its own */
+
#if defined(__EXPORT__) && defined(_DLL)
# ifdef _BLD_shell
#undef __MANGLE__
@@ -179,7 +186,8 @@ extern __MANGLE__ int sh_trap __PROTO__((const char*,int));
extern __MANGLE__ int sh_fun __PROTO__((Namval_t*,Namval_t*, char*[]));
extern __MANGLE__ int sh_funscope __PROTO__((int,char*[],int(*)(__V_*),__V_*,int));
extern __MANGLE__ Sfio_t *sh_iogetiop __PROTO__((int,int));
-extern __MANGLE__ int sh_main __PROTO__((int, char*[], void(*)(int)));
+extern __MANGLE__ int sh_main __PROTO__((int, char*[], Shinit_f));
+extern __MANGLE__ int sh_run __PROTO__((int, char*[]));
extern __MANGLE__ void sh_menu __PROTO__((Sfio_t*, int, char*[]));
extern __MANGLE__ Namval_t *sh_addbuiltin __PROTO__((const char*, int(*)(int, char*[],__V_*), __V_*));
extern __MANGLE__ char *sh_fmtq __PROTO__((const char*));
diff --git a/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/acct b/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/acct
index 3224ea4e85..db7a5ef4e3 100644
--- a/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/acct
+++ b/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/acct
@@ -1,11 +1,12 @@
-/* : : generated by iffe version 2007-04-04 : : */
+/* : : generated by iffe version 2008-01-31 : : */
#ifndef _def_acct_ksh93
#define _def_acct_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _lib_acct 1 /* acct() in default lib(s) */
#define _sys_acct 1 /* #include <sys/acct.h> ok */
diff --git a/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/cmds b/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/cmds
index eb6f529a3d..58913335d0 100644
--- a/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/cmds
+++ b/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/cmds
@@ -1,11 +1,12 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/cmd/ksh93/features/cmds by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/cmd/ksh93/features/cmds by iffe version 2008-01-31 : : */
#ifndef _def_cmds_ksh93
#define _def_cmds_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _cmd_newgrp 1 /* newgrp in ?(/usr)/(bin|etc|ucb) */
#define _bin_newgrp 1 /* /bin/newgrp found */
diff --git a/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/dynamic b/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/dynamic
index 5bc10f4878..ffded1c777 100644
--- a/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/dynamic
+++ b/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/dynamic
@@ -1,18 +1,17 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/cmd/ksh93/features/dynamic by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/cmd/ksh93/features/dynamic by iffe version 2008-01-31 : : */
#ifndef _def_dynamic_ksh93
#define _def_dynamic_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
-#define _hdr_dlfcn 1 /* #include <dlfcn.h> ok */
-#define _sys_dl 1 /* #include <sys/dl.h> ok */
-#define _hdr_dlldefs 1 /* #include <dlldefs.h> ok */
-#define _lib_dlopen 1 /* dlopen() in default lib(s) */
-#define _lib_dllfind 1 /* dllfind() in default lib(s) */
-#if !defined(SHOPT_FS_3D) && ( _lib_dllfind || _lib_dlopen || _lib_shl_load || _lib_loadbind )
+#if SHOPT_DYNAMIC
+#include <dlldefs.h>
+#endif
+#if !defined(SHOPT_FS_3D) && SHOPT_DYNAMIC
# define SHOPT_FS_3D 1
#endif /* !SHOPT_FS_3D */
#if SHOPT_FS_3D
diff --git a/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/execargs b/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/execargs
index bcb8d730d9..c77d192bc7 100644
--- a/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/execargs
+++ b/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/execargs
@@ -1,10 +1,11 @@
-/* : : generated by iffe version 2007-04-04 : : */
+/* : : generated by iffe version 2008-01-31 : : */
#ifndef _def_execargs_ksh93
#define _def_execargs_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#endif
diff --git a/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/externs b/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/externs
index 989fc9ca71..0997552edf 100644
--- a/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/externs
+++ b/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/externs
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/cmd/ksh93/features/externs by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/cmd/ksh93/features/externs by iffe version 2008-01-31 : : */
#ifndef _def_externs_ksh93
#if !defined(__PROTO__)
@@ -63,10 +63,11 @@
#define _def_externs_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _hdr_exec_attr 1 /* #include <exec_attr.h> ok */
#define _hdr_math 1 /* #include <math.h> ok */
@@ -78,4 +79,6 @@
#define _lib_fork 1 /* fork() in default lib(s) */
#define _lib_spawnveg 1 /* spawnveg() in default lib(s) */
#define _lib_fchdir 1 /* fchdir() in default lib(s) */
+#define _sys_mman 1 /* #include <sys/mman.h> ok */
+#define _lib_memcntl 1 /* memcntl() in default lib(s) */
#endif
diff --git a/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/locale b/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/locale
index 787bb2740e..6091864d6f 100644
--- a/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/locale
+++ b/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/locale
@@ -1,11 +1,12 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/cmd/ksh93/features/locale by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/cmd/ksh93/features/locale by iffe version 2008-01-31 : : */
#ifndef _def_locale_ksh93
#define _def_locale_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _hdr_locale 1 /* #include <locale.h> ok */
#define _hdr_wchar 1 /* #include <wchar.h> ok */
diff --git a/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/math b/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/math
index 44f582aa7a..0816686537 100644
--- a/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/math
+++ b/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/math
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/cmd/ksh93/features/math.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/cmd/ksh93/features/math.sh by iffe version 2008-01-31 : : */
#ifndef _def_math_ksh93
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
@@ -62,14 +62,15 @@
#define _def_math_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
-/* : : generated by iffe from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/cmd/ksh93/data/math.tab : : */
+/* : : generated by iffe from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/cmd/ksh93/data/math.tab : : */
typedef Sfdouble_t (*Math_f) __PROTO__((Sfdouble_t,...));
@@ -104,6 +105,7 @@ const struct mathtab shtab_math[] =
"\002atan2", (Math_f)atan2l,
"\001atanh", (Math_f)atanhl,
"\001cbrt", (Math_f)cbrtl,
+ "\001ceil", (Math_f)ceill,
"\002copysign", (Math_f)copysignl,
"\001cos", (Math_f)cosl,
"\001cosh", (Math_f)coshl,
diff --git a/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/options b/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/options
index 2ef857884d..19ee01050f 100644
--- a/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/options
+++ b/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/options
@@ -1,11 +1,12 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/cmd/ksh93/features/options by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/cmd/ksh93/features/options by iffe version 2008-01-31 : : */
#ifndef _def_options_ksh93
#define _def_options_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define SHELLMAGIC 1
#ifndef SHOPT_DEVFD
diff --git a/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/poll b/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/poll
index 35c699486f..ef49345725 100644
--- a/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/poll
+++ b/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/poll
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/cmd/ksh93/features/poll by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/cmd/ksh93/features/poll by iffe version 2008-01-31 : : */
#ifndef _def_poll_ksh93
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
@@ -62,10 +62,11 @@
#define _def_poll_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _hdr_poll 1 /* #include <poll.h> ok */
#define _hdr_netinet_in 1 /* #include <netinet/in.h> ok */
diff --git a/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/pstat b/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/pstat
index ce6e94896f..b04c6ac21f 100644
--- a/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/pstat
+++ b/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/pstat
@@ -1,10 +1,11 @@
-/* : : generated by iffe version 2007-04-04 : : */
+/* : : generated by iffe version 2008-01-31 : : */
#ifndef _def_pstat_ksh93
#define _def_pstat_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#endif
diff --git a/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/rlimits b/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/rlimits
index 41eb6091a6..db357e7d9f 100644
--- a/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/rlimits
+++ b/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/rlimits
@@ -1,11 +1,12 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/cmd/ksh93/features/rlimits by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/cmd/ksh93/features/rlimits by iffe version 2008-01-31 : : */
#ifndef _def_rlimits_ksh93
#define _def_rlimits_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _sys_resource 1 /* #include <sys/resource.h> ok */
#define _lib_getrlimit 1 /* getrlimit() in default lib(s) */
diff --git a/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/setjmp b/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/setjmp
index 76daa91aca..75e0552ad8 100644
--- a/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/setjmp
+++ b/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/setjmp
@@ -1,11 +1,12 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/cmd/ksh93/features/setjmp by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/cmd/ksh93/features/setjmp by iffe version 2008-01-31 : : */
#ifndef _def_setjmp_ksh93
#define _def_setjmp_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _lib_sigsetjmp 1 /* sigsetjmp() in default lib(s) */
#define _lib__setjmp 1 /* _setjmp() in default lib(s) */
diff --git a/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/sigfeatures b/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/sigfeatures
index b862dffb5e..367e2b702d 100644
--- a/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/sigfeatures
+++ b/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/sigfeatures
@@ -1,11 +1,12 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/cmd/ksh93/features/sigfeatures by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/cmd/ksh93/features/sigfeatures by iffe version 2008-01-31 : : */
#ifndef _def_sigfeatures_ksh93
#define _def_sigfeatures_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _lib_sigrelse 1 /* sigrelse() in default lib(s) */
#define _lib_sigprocmask 1 /* sigprocmask() in default lib(s) */
@@ -22,8 +23,8 @@
#endif
#ifdef _lib_sigprocmask
# define sh_sigaction(s,action) do { sigset_t ss;\
- sigemptyset(&ss);\
- sigaddset(&ss,(s));\
+ sigemptyset(&ss); \
+ if(s) sigaddset(&ss,(s)); \
sigprocmask(action,&ss,0); \
}while(0)
# define sigrelease(s) sh_sigaction(s,SIG_UNBLOCK)
diff --git a/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/time b/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/time
index 5117dbe7c8..d1b9f741f9 100644
--- a/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/time
+++ b/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/time
@@ -1,11 +1,12 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/cmd/ksh93/features/time by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/cmd/ksh93/features/time by iffe version 2008-01-31 : : */
#ifndef _def_time_ksh93
#define _def_time_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _hdr_utime 1 /* #include <utime.h> ok */
#define _lib_gettimeofday 1 /* gettimeofday() in default lib(s) */
diff --git a/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/ttys b/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/ttys
index 39d165bbf9..008f07c346 100644
--- a/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/ttys
+++ b/usr/src/lib/libshell/sparc/src/cmd/ksh93/FEATURE/ttys
@@ -1,11 +1,12 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/src/cmd/ksh93/features/ttys by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/cmd/ksh93/features/ttys by iffe version 2008-01-31 : : */
#ifndef _def_ttys_ksh93
#define _def_ttys_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _hdr_termios 1 /* #include <termios.h> ok */
#define _hdr_termio 1 /* #include <termio.h> ok */
diff --git a/usr/src/lib/libshell/sparcv9/Makefile b/usr/src/lib/libshell/sparcv9/Makefile
index 600ff73f12..929761d138 100644
--- a/usr/src/lib/libshell/sparcv9/Makefile
+++ b/usr/src/lib/libshell/sparcv9/Makefile
@@ -18,14 +18,17 @@
#
# CDDL HEADER END
#
+
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
include ../Makefile.com
include ../../Makefile.lib.64
+# Use -KPIC since libshell is too big for -Kpic on 64bit
+# (and on 32bit it is close to the barrier)
+sparcv9_C_PICFLAGS = $(C_BIGPICFLAGS)
+
install: all $(ROOTLIBS64) $(ROOTLINKS64)
diff --git a/usr/src/lib/libshell/sparcv9/include/ast/history.h b/usr/src/lib/libshell/sparcv9/include/ast/history.h
index 55ead66f9e..bfac5d3b35 100644
--- a/usr/src/lib/libshell/sparcv9/include/ast/history.h
+++ b/usr/src/lib/libshell/sparcv9/include/ast/history.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -65,7 +65,7 @@ extern __MANGLE__ int _Hist;
#define hist_min(hp) ((_Hist=((int)((hp)->histind-(hp)->histsize)))>=0?_Hist:0)
#define hist_max(hp) ((int)((hp)->histind))
/* these are the history interface routines */
-extern __MANGLE__ int sh_histinit __PROTO__((void));
+extern __MANGLE__ int sh_histinit __PROTO__((__V_ *));
extern __MANGLE__ void hist_cancel __PROTO__((History_t*));
extern __MANGLE__ void hist_close __PROTO__((History_t*));
extern __MANGLE__ int hist_copy __PROTO__((char*, int, int, int));
diff --git a/usr/src/lib/libshell/sparcv9/include/ast/nval.h b/usr/src/lib/libshell/sparcv9/include/ast/nval.h
index 06b18217b7..c11fd66143 100644
--- a/usr/src/lib/libshell/sparcv9/include/ast/nval.h
+++ b/usr/src/lib/libshell/sparcv9/include/ast/nval.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -40,6 +40,7 @@
#include <ast.h>
#include <cdt.h>
+#include <option.h>
/* for compatibility with old hash library */
#define Hashtab_t Dt_t
@@ -53,8 +54,7 @@ typedef struct Namfun Namfun_t;
typedef struct Namdisc Namdisc_t;
typedef struct Nambfun Nambfun_t;
typedef struct Namarray Namarr_t;
-typedef struct Nambltin Nambltin_t;
-typedef struct Namtype Namtype_t;
+typedef struct Namdecl Namdecl_t;
/*
* This defines the template for nodes that have their own assignment
@@ -73,13 +73,14 @@ struct Namdisc
Namval_t *(*nextf) __PROTO__((Namval_t*, Dt_t*, Namfun_t*));
Namval_t *(*typef) __PROTO__((Namval_t*, Namfun_t*));
int (*readf) __PROTO__((Namval_t*, Sfio_t*, int, Namfun_t*));
+ int (*writef) __PROTO__((Namval_t*, Sfio_t*, int, Namfun_t*));
};
struct Namfun
{
const Namdisc_t *disc;
char nofree;
- char funs;
+ unsigned char subshell;
unsigned short dsize;
Namfun_t *next;
char *last;
@@ -101,22 +102,14 @@ struct Namarray
long nelem; /* number of elements */
__V_ *(*fun) __PROTO__((Namval_t*,const char*,int)); /* associative arrays */
Namval_t *parent; /* for multi-dimensional */
+ Dt_t *table; /* for subscripts */
+ __V_ *scope; /* non-zerp when scoped */
};
-/* Passed as third argument to a builtin when NV_BLTINOPT is set on node */
-struct Nambltin
+/* The context pointer for declaration command */
+struct Namdecl
{
- __V_ *shp;
- Namval_t *np;
- __V_ *ptr;
- __V_ *data;
- int flags;
-};
-
-struct Namtype
-{
- __V_ *shp;
- Namval_t *np;
+ Namval_t *tp; /* point to type */
const char *optstring;
__V_ *optinfof;
};
@@ -141,6 +134,7 @@ struct Namval
};
#define NV_CLASS ".sh.type"
+#define NV_DATA "_" /* special class or instance variable */
#define NV_MINSZ (sizeof(struct Namval)-sizeof(Dtlink_t)-sizeof(char*))
#define nv_namptr(p,n) ((Namval_t*)((char*)(p)+(n)*NV_MINSZ-sizeof(Dtlink_t)))
@@ -172,13 +166,14 @@ struct Namval
#define NV_SHORT (NV_RJUST) /* when integers are not long */
#define NV_LONG (NV_UTOL) /* for long long and long double */
#define NV_UNSIGN (NV_LTOU) /* for unsigned quantities */
-#define NV_DOUBLE (NV_ZFILL) /* for floating point */
+#define NV_DOUBLE (NV_INTEGER|NV_ZFILL) /* for floating point */
#define NV_EXPNOTE (NV_LJUST) /* for scientific notation */
+#define NV_HEXFLOAT (NV_LTOU) /* for C99 base16 float notation */
/* options for nv_open */
#define NV_APPEND 0x10000 /* append value */
-#define NV_MOVE 0x20000 /* for use with nv_clone */
+#define NV_MOVE 0x8000000 /* for use with nv_clone */
#define NV_ADD 8
/* add node if not found */
#define NV_ASSIGN NV_NOFREE /* assignment is possible */
@@ -194,19 +189,21 @@ struct Namval
#define NV_NODISC NV_IDENT /* ignore disciplines */
#define NV_FUNCT NV_IDENT /* option for nv_create */
-#define NV_BLTINOPT NV_ZFILL /* save state for optimization*/
+#define NV_BLTINOPT NV_ZFILL /* mark builtins in libcmd */
#define NV_PUBLIC (~(NV_NOSCOPE|NV_ASSIGN|NV_IDENT|NV_VARNAME|NV_NOADD))
/* numeric types */
+#define NV_INT16P (NV_LJUST|NV_SHORT|NV_INTEGER)
#define NV_INT16 (NV_SHORT|NV_INTEGER)
#define NV_UINT16 (NV_UNSIGN|NV_SHORT|NV_INTEGER)
+#define NV_UINT16P (NV_LJUSTNV_UNSIGN|NV_SHORT|NV_INTEGER)
#define NV_INT32 (NV_INTEGER)
#define NV_UNT32 (NV_UNSIGN|NV_INTEGER)
#define NV_INT64 (NV_LONG|NV_INTEGER)
#define NV_UINT64 (NV_UNSIGN|NV_LONG|NV_INTEGER)
-#define NV_FLOAT (NV_SHORT|NV_DOUBLE|NV_INTEGER)
-#define NV_LDOUBLE (NV_LONG|NV_DOUBLE|NV_INTEGER)
+#define NV_FLOAT (NV_SHORT|NV_DOUBLE)
+#define NV_LDOUBLE (NV_LONG|NV_DOUBLE)
/* name-value pair macros */
#define nv_isattr(np,f) ((np)->nvflag & (f))
@@ -222,6 +219,7 @@ struct Namval
#define NV_ADELETE 5 /* delete current subscript */
#define NV_AADD 6 /* add subscript if not found */
#define NV_ACURRENT 7 /* return current subscript Namval_t* */
+#define NV_ASETSUB 8 /* set current subscript */
/* The following are for nv_disc */
#define NV_FIRST 1
@@ -230,7 +228,7 @@ struct Namval
#define NV_CLONE 4
/* The following are operations for nv_putsub() */
-#define ARRAY_BITS 24
+#define ARRAY_BITS 22
#define ARRAY_ADD (1L<<ARRAY_BITS) /* add subscript if not found */
#define ARRAY_SCAN (2L<<ARRAY_BITS) /* For ${array[@]} */
#define ARRAY_UNDEF (4L<<ARRAY_BITS) /* For ${array} */
@@ -250,7 +248,9 @@ struct Namval
# endif /* _BLD_shell */
#endif /* _DLL */
/* prototype for array interface*/
+extern __MANGLE__ Namarr_t *nv_arrayptr __PROTO__((Namval_t*));
extern __MANGLE__ Namarr_t *nv_setarray __PROTO__((Namval_t*,__V_*(*)(Namval_t*,const char*,int)));
+extern __MANGLE__ int nv_arraynsub __PROTO__((Namarr_t*));
extern __MANGLE__ __V_ *nv_associative __PROTO__((Namval_t*,const char*,int));
extern __MANGLE__ int nv_aindex __PROTO__((Namval_t*));
extern __MANGLE__ int nv_nextsub __PROTO__((Namval_t*));
@@ -264,6 +264,7 @@ extern __MANGLE__ int nv_clone __PROTO__((Namval_t*, Namval_t*, int));
extern __MANGLE__ void nv_close __PROTO__((Namval_t*));
extern __MANGLE__ __V_ *nv_context __PROTO__((Namval_t*));
extern __MANGLE__ Namval_t *nv_create __PROTO__((const char*, Dt_t*, int,Namfun_t*));
+extern __MANGLE__ void nv_delete __PROTO__((Namval_t*, Dt_t*, int));
extern __MANGLE__ Dt_t *nv_dict __PROTO__((Namval_t*));
extern __MANGLE__ Sfdouble_t nv_getn __PROTO__((Namval_t*, Namfun_t*));
extern __MANGLE__ Sfdouble_t nv_getnum __PROTO__((Namval_t*));
@@ -271,13 +272,15 @@ extern __MANGLE__ char *nv_getv __PROTO__((Namval_t*, Namfun_t*));
extern __MANGLE__ char *nv_getval __PROTO__((Namval_t*));
extern __MANGLE__ Namfun_t *nv_hasdisc __PROTO__((Namval_t*, const Namdisc_t*));
extern __MANGLE__ int nv_isnull __PROTO__((Namval_t*));
+extern __MANGLE__ Namfun_t *nv_isvtree __PROTO__((Namval_t*));
extern __MANGLE__ Namval_t *nv_lastdict __PROTO__((void));
+extern __MANGLE__ Namval_t *nv_mkinttype __PROTO__((char*, size_t, int, const char*, Namdisc_t*));
extern __MANGLE__ void nv_newattr __PROTO__((Namval_t*,unsigned,int));
extern __MANGLE__ Namval_t *nv_open __PROTO__((const char*,Dt_t*,int));
extern __MANGLE__ void nv_putval __PROTO__((Namval_t*,const char*,int));
extern __MANGLE__ void nv_putv __PROTO__((Namval_t*,const char*,int,Namfun_t*));
+extern __MANGLE__ int nv_rename __PROTO__((Namval_t*,int));
extern __MANGLE__ int nv_scan __PROTO__((Dt_t*,void(*)(Namval_t*,__V_*),__V_*,int,int));
-extern __MANGLE__ Namval_t *nv_scoped __PROTO__((Namval_t*));
extern __MANGLE__ char *nv_setdisc __PROTO__((Namval_t*,const char*,Namval_t*,Namfun_t*));
extern __MANGLE__ void nv_setref __PROTO__((Namval_t*, Dt_t*,int));
extern __MANGLE__ int nv_settype __PROTO__((Namval_t*, Namval_t*, int));
@@ -285,11 +288,12 @@ extern __MANGLE__ void nv_setvec __PROTO__((Namval_t*,int,int,char*[]));
extern __MANGLE__ void nv_setvtree __PROTO__((Namval_t*));
extern __MANGLE__ int nv_setsize __PROTO__((Namval_t*,int));
extern __MANGLE__ Namfun_t *nv_disc __PROTO__((Namval_t*,Namfun_t*,int));
-extern __MANGLE__ void nv_unset __PROTO__((Namval_t*));
+extern __MANGLE__ void nv_unset __PROTO__((Namval_t*)); /*obsolete */
+extern __MANGLE__ void _nv_unset __PROTO__((Namval_t*,int));
extern __MANGLE__ Namval_t *nv_search __PROTO__((const char *, Dt_t*, int));
-extern __MANGLE__ void nv_unscope __PROTO__((void));
extern __MANGLE__ char *nv_name __PROTO__((Namval_t*));
extern __MANGLE__ Namval_t *nv_type __PROTO__((Namval_t*));
+extern __MANGLE__ void nv_addtype __PROTO__((Namval_t*,const char*, Optdisc_t*, size_t));
extern __MANGLE__ const Namdisc_t *nv_discfun __PROTO__((int));
#ifdef _DLL
@@ -297,6 +301,7 @@ extern __MANGLE__ const Namdisc_t *nv_discfun __PROTO__((int));
#define __MANGLE__ __LINKAGE__
#endif /* _DLL */
+#define nv_unset(np) _nv_unset(np,0)
#define nv_size(np) nv_setsize((np),-1)
#define nv_stack(np,nf) nv_disc(np,nf,0)
@@ -308,7 +313,7 @@ extern __MANGLE__ const Namdisc_t *nv_discfun __PROTO__((int));
# define nv_istype(np) nv_isattr(np)
# define nv_newtype(np) nv_newattr(np)
# define nv_namset(np,a,b) nv_open(np,a,b)
-# define nv_free(np) nv_unset(np)
+# define nv_free(np) nv_unset(np,0)
# define nv_settype(np,a,b,c) nv_setdisc(np,a,b,c)
# define nv_search(np,a,b) nv_open(np,a,((b)?0:NV_NOADD))
# define settype setdisc
diff --git a/usr/src/lib/libshell/sparcv9/include/ast/shell.h b/usr/src/lib/libshell/sparcv9/include/ast/shell.h
index 37cafa932b..adcefac221 100644
--- a/usr/src/lib/libshell/sparcv9/include/ast/shell.h
+++ b/usr/src/lib/libshell/sparcv9/include/ast/shell.h
@@ -3,10 +3,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -36,7 +36,7 @@
*
*/
-#include <cmd.h>
+#include <ast.h>
#include <cdt.h>
#ifdef _SH_PRIVATE
# include "name.h"
@@ -44,7 +44,7 @@
# include <nval.h>
#endif /* _SH_PRIVATE */
-#define SH_VERSION 20060510
+#define SH_VERSION 20071012
#undef NOT_USED
#define NOT_USED(x) (&x,1)
@@ -56,8 +56,9 @@ typedef struct
}
Shopt_t;
-typedef void (*Shinit_f) __PROTO__((int));
-typedef int (*Shbltin_f) __PROTO__((int, char*[], __V_*));
+typedef struct Shell_s Shell_t;
+
+typedef void (*Shinit_f) __PROTO__((Shell_t*, int));
typedef int (*Shwait_f) __PROTO__((int, long, int));
union Shnode_u;
@@ -124,6 +125,7 @@ typedef struct sh_scope
char **argv;
char *cmdname;
char *filename;
+ char *funname;
int lineno;
Dt_t *var_tree;
struct sh_scope *self;
@@ -133,7 +135,7 @@ typedef struct sh_scope
* Saves the state of the shell
*/
-typedef struct sh_static
+struct Shell_s
{
Shopt_t options; /* set -o options */
Dt_t *var_tree; /* for shell variables */
@@ -145,10 +147,11 @@ typedef struct sh_static
int exitval; /* most recent exit value */
unsigned char trapnote; /* set when trap/signal is pending */
char subshell; /* set for virtual subshell */
+ char shcomp; /* set when runing shcomp */
#ifdef _SH_PRIVATE
_SH_PRIVATE
#endif /* _SH_PRIVATE */
-} Shell_t;
+};
/* flags for sh_parse */
#define SH_NL 1 /* Treat new-lines as ; */
@@ -158,9 +161,13 @@ typedef struct sh_static
#define SH_IOCOPROCESS (-2)
#define SH_IOHISTFILE (-3)
+#include <cmd.h>
+
/* symbolic value for sh_fdnotify */
#define SH_FDCLOSE (-1)
+#undef getenv /* -lshell provides its own */
+
#if defined(__EXPORT__) && defined(_DLL)
# ifdef _BLD_shell
#undef __MANGLE__
@@ -179,7 +186,8 @@ extern __MANGLE__ int sh_trap __PROTO__((const char*,int));
extern __MANGLE__ int sh_fun __PROTO__((Namval_t*,Namval_t*, char*[]));
extern __MANGLE__ int sh_funscope __PROTO__((int,char*[],int(*)(__V_*),__V_*,int));
extern __MANGLE__ Sfio_t *sh_iogetiop __PROTO__((int,int));
-extern __MANGLE__ int sh_main __PROTO__((int, char*[], void(*)(int)));
+extern __MANGLE__ int sh_main __PROTO__((int, char*[], Shinit_f));
+extern __MANGLE__ int sh_run __PROTO__((int, char*[]));
extern __MANGLE__ void sh_menu __PROTO__((Sfio_t*, int, char*[]));
extern __MANGLE__ Namval_t *sh_addbuiltin __PROTO__((const char*, int(*)(int, char*[],__V_*), __V_*));
extern __MANGLE__ char *sh_fmtq __PROTO__((const char*));
diff --git a/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/acct b/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/acct
index 2cd67703ae..26be28c619 100644
--- a/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/acct
+++ b/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/acct
@@ -1,11 +1,12 @@
-/* : : generated by iffe version 2007-04-04 : : */
+/* : : generated by iffe version 2008-01-31 : : */
#ifndef _def_acct_ksh93
#define _def_acct_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _lib_acct 1 /* acct() in default lib(s) */
#define _sys_acct 1 /* #include <sys/acct.h> ok */
diff --git a/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/cmds b/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/cmds
index fa6d8ed96f..ec93f3beb3 100644
--- a/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/cmds
+++ b/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/cmds
@@ -1,11 +1,12 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/cmd/ksh93/features/cmds by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/cmd/ksh93/features/cmds by iffe version 2008-01-31 : : */
#ifndef _def_cmds_ksh93
#define _def_cmds_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _cmd_newgrp 1 /* newgrp in ?(/usr)/(bin|etc|ucb) */
#define _bin_newgrp 1 /* /bin/newgrp found */
diff --git a/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/dynamic b/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/dynamic
index 8b12ce4b17..78de14485c 100644
--- a/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/dynamic
+++ b/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/dynamic
@@ -1,18 +1,17 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/cmd/ksh93/features/dynamic by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/cmd/ksh93/features/dynamic by iffe version 2008-01-31 : : */
#ifndef _def_dynamic_ksh93
#define _def_dynamic_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
-#define _hdr_dlfcn 1 /* #include <dlfcn.h> ok */
-#define _sys_dl 1 /* #include <sys/dl.h> ok */
-#define _hdr_dlldefs 1 /* #include <dlldefs.h> ok */
-#define _lib_dlopen 1 /* dlopen() in default lib(s) */
-#define _lib_dllfind 1 /* dllfind() in default lib(s) */
-#if !defined(SHOPT_FS_3D) && ( _lib_dllfind || _lib_dlopen || _lib_shl_load || _lib_loadbind )
+#if SHOPT_DYNAMIC
+#include <dlldefs.h>
+#endif
+#if !defined(SHOPT_FS_3D) && SHOPT_DYNAMIC
# define SHOPT_FS_3D 1
#endif /* !SHOPT_FS_3D */
#if SHOPT_FS_3D
diff --git a/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/execargs b/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/execargs
index 01f0d04e1f..fd6d18258b 100644
--- a/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/execargs
+++ b/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/execargs
@@ -1,10 +1,11 @@
-/* : : generated by iffe version 2007-04-04 : : */
+/* : : generated by iffe version 2008-01-31 : : */
#ifndef _def_execargs_ksh93
#define _def_execargs_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#endif
diff --git a/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/externs b/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/externs
index f0d91c6237..355b5bc61e 100644
--- a/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/externs
+++ b/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/externs
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/cmd/ksh93/features/externs by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/cmd/ksh93/features/externs by iffe version 2008-01-31 : : */
#ifndef _def_externs_ksh93
#if !defined(__PROTO__)
@@ -63,10 +63,11 @@
#define _def_externs_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _hdr_exec_attr 1 /* #include <exec_attr.h> ok */
#define _hdr_math 1 /* #include <math.h> ok */
@@ -78,4 +79,6 @@
#define _lib_fork 1 /* fork() in default lib(s) */
#define _lib_spawnveg 1 /* spawnveg() in default lib(s) */
#define _lib_fchdir 1 /* fchdir() in default lib(s) */
+#define _sys_mman 1 /* #include <sys/mman.h> ok */
+#define _lib_memcntl 1 /* memcntl() in default lib(s) */
#endif
diff --git a/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/locale b/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/locale
index 69712f8ea0..038eb19ad1 100644
--- a/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/locale
+++ b/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/locale
@@ -1,11 +1,12 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/cmd/ksh93/features/locale by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/cmd/ksh93/features/locale by iffe version 2008-01-31 : : */
#ifndef _def_locale_ksh93
#define _def_locale_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _hdr_locale 1 /* #include <locale.h> ok */
#define _hdr_wchar 1 /* #include <wchar.h> ok */
diff --git a/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/math b/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/math
index efa9b09631..d2e608d39b 100644
--- a/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/math
+++ b/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/math
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/cmd/ksh93/features/math.sh by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/cmd/ksh93/features/math.sh by iffe version 2008-01-31 : : */
#ifndef _def_math_ksh93
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
@@ -62,14 +62,15 @@
#define _def_math_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
-/* : : generated by iffe from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/cmd/ksh93/data/math.tab : : */
+/* : : generated by iffe from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/cmd/ksh93/data/math.tab : : */
typedef Sfdouble_t (*Math_f) __PROTO__((Sfdouble_t,...));
@@ -104,6 +105,7 @@ const struct mathtab shtab_math[] =
"\002atan2", (Math_f)atan2l,
"\001atanh", (Math_f)atanhl,
"\001cbrt", (Math_f)cbrtl,
+ "\001ceil", (Math_f)ceill,
"\002copysign", (Math_f)copysignl,
"\001cos", (Math_f)cosl,
"\001cosh", (Math_f)coshl,
diff --git a/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/options b/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/options
index 5ed6b7ba57..678224e395 100644
--- a/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/options
+++ b/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/options
@@ -1,11 +1,12 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/cmd/ksh93/features/options by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/cmd/ksh93/features/options by iffe version 2008-01-31 : : */
#ifndef _def_options_ksh93
#define _def_options_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define SHELLMAGIC 1
#ifndef SHOPT_DEVFD
diff --git a/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/poll b/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/poll
index d0ed361519..237841c166 100644
--- a/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/poll
+++ b/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/poll
@@ -1,6 +1,6 @@
/* : : generated by proto : : */
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/cmd/ksh93/features/poll by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/cmd/ksh93/features/poll by iffe version 2008-01-31 : : */
#ifndef _def_poll_ksh93
#if !defined(__PROTO__)
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
@@ -62,10 +62,11 @@
#define _def_poll_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _hdr_poll 1 /* #include <poll.h> ok */
#define _hdr_netinet_in 1 /* #include <netinet/in.h> ok */
diff --git a/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/pstat b/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/pstat
index b051334549..6085602c35 100644
--- a/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/pstat
+++ b/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/pstat
@@ -1,10 +1,11 @@
-/* : : generated by iffe version 2007-04-04 : : */
+/* : : generated by iffe version 2008-01-31 : : */
#ifndef _def_pstat_ksh93
#define _def_pstat_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#endif
diff --git a/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/rlimits b/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/rlimits
index 0dad9c0146..605656a721 100644
--- a/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/rlimits
+++ b/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/rlimits
@@ -1,11 +1,12 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/cmd/ksh93/features/rlimits by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/cmd/ksh93/features/rlimits by iffe version 2008-01-31 : : */
#ifndef _def_rlimits_ksh93
#define _def_rlimits_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _sys_resource 1 /* #include <sys/resource.h> ok */
#define _lib_getrlimit 1 /* getrlimit() in default lib(s) */
diff --git a/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/setjmp b/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/setjmp
index d1975c45ac..23a2ab49e8 100644
--- a/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/setjmp
+++ b/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/setjmp
@@ -1,11 +1,12 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/cmd/ksh93/features/setjmp by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/cmd/ksh93/features/setjmp by iffe version 2008-01-31 : : */
#ifndef _def_setjmp_ksh93
#define _def_setjmp_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _lib_sigsetjmp 1 /* sigsetjmp() in default lib(s) */
#define _lib__setjmp 1 /* _setjmp() in default lib(s) */
diff --git a/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/sigfeatures b/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/sigfeatures
index 37a2d05160..d6ea238d56 100644
--- a/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/sigfeatures
+++ b/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/sigfeatures
@@ -1,11 +1,12 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/cmd/ksh93/features/sigfeatures by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/cmd/ksh93/features/sigfeatures by iffe version 2008-01-31 : : */
#ifndef _def_sigfeatures_ksh93
#define _def_sigfeatures_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _lib_sigrelse 1 /* sigrelse() in default lib(s) */
#define _lib_sigprocmask 1 /* sigprocmask() in default lib(s) */
@@ -22,8 +23,8 @@
#endif
#ifdef _lib_sigprocmask
# define sh_sigaction(s,action) do { sigset_t ss;\
- sigemptyset(&ss);\
- sigaddset(&ss,(s));\
+ sigemptyset(&ss); \
+ if(s) sigaddset(&ss,(s)); \
sigprocmask(action,&ss,0); \
}while(0)
# define sigrelease(s) sh_sigaction(s,SIG_UNBLOCK)
diff --git a/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/time b/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/time
index 10e253c2a6..ac12845b45 100644
--- a/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/time
+++ b/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/time
@@ -1,11 +1,12 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/cmd/ksh93/features/time by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/cmd/ksh93/features/time by iffe version 2008-01-31 : : */
#ifndef _def_time_ksh93
#define _def_time_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _hdr_utime 1 /* #include <utime.h> ok */
#define _lib_gettimeofday 1 /* gettimeofday() in default lib(s) */
diff --git a/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/ttys b/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/ttys
index 283a83c773..ed431f57a7 100644
--- a/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/ttys
+++ b/usr/src/lib/libshell/sparcv9/src/cmd/ksh93/FEATURE/ttys
@@ -1,11 +1,12 @@
-/* : : generated from /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/src/cmd/ksh93/features/ttys by iffe version 2007-04-04 : : */
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/cmd/ksh93/features/ttys by iffe version 2008-01-31 : : */
#ifndef _def_ttys_ksh93
#define _def_ttys_ksh93 1
#define _sys_types 1 /* #include <sys/types.h> ok */
-#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a is a library */
-#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_dll 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libdll.a is a library */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
#define _LIB_m 1 /* -lm is a library */
-#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20070418/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_cmd 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libcmd.a is a library */
+#define _LIB_md 1 /* -lmd is a library */
#define _LIB_nsl 1 /* -lnsl is a library */
#define _hdr_termios 1 /* #include <termios.h> ok */
#define _hdr_termio 1 /* #include <termio.h> ok */
diff --git a/usr/src/lib/libsum/Makefile b/usr/src/lib/libsum/Makefile
new file mode 100644
index 0000000000..33dbb5c65e
--- /dev/null
+++ b/usr/src/lib/libsum/Makefile
@@ -0,0 +1,64 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+SHELL=/usr/bin/ksh93
+
+include ../Makefile.lib
+
+SUBDIRS = $(MACH)
+$(BUILD64)SUBDIRS += $(MACH64)
+
+all := TARGET= all
+clean := TARGET= clean
+clobber := TARGET= clobber
+install := TARGET= install
+lint := TARGET= lint
+_msg := TARGET= _msg
+
+.KEEP_STATE:
+
+all clean clobber install lint _msg: $(SUBDIRS)
+
+LIBRARY= libsum.a
+
+HDRS= \
+ sum.h
+
+HDRDIR32= $(MACH)/include/ast
+HDRDIR64= $(MACH64)/include/ast
+include ../Makefile.asthdr
+
+install_h: $(ROOTHDRS)
+
+# We don't check these header files because they're owned by AT&T/AST
+check:
+
+$(SUBDIRS): FRC
+ @cd $@; pwd; $(MAKE) $(TARGET)
+
+FRC:
+
+include ../Makefile.targ
diff --git a/usr/src/lib/libsum/Makefile.com b/usr/src/lib/libsum/Makefile.com
new file mode 100644
index 0000000000..75df821f30
--- /dev/null
+++ b/usr/src/lib/libsum/Makefile.com
@@ -0,0 +1,92 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+SHELL=/usr/bin/ksh93
+
+LIBRARY= libsum.a
+VERS= .1
+
+OBJECTS= \
+ sumlib.o
+
+include ../../Makefile.astmsg
+
+include ../../Makefile.lib
+
+# mapfile-vers does not live with the sources in in common/ to make
+# automated code updates easier.
+MAPFILES= ../mapfile-vers
+
+# Set common AST build flags (e.g. C99/XPG6, needed to support the math stuff)
+include ../../../Makefile.ast
+
+LIBS = $(DYNLIB) $(LINTLIB)
+
+LDLIBS += \
+ -last \
+ -lmd \
+ -lc
+
+$(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC)
+
+SRCDIR = ../common
+
+# We use "=" here since using $(CPPFLAGS.master) is very tricky in our
+# case - it MUST come as the last element but future changes in -D options
+# may then cause silent breakage in the AST sources because the last -D
+# option specified overrides previous -D options so we prefer the current
+# way to explicitly list each single flag.
+# Notes:
+# - "-D_BLD_DLL" comes from ${mam_cc_DLL} in Mamfile
+CPPFLAGS = \
+ $(DTEXTDOM) $(DTS_ERRNO) \
+ -Isrc/lib/libsum \
+ -I$(ROOT)/usr/include/ast \
+ -D_PACKAGE_ast \
+ -D_BLD_DLL
+
+CFLAGS += \
+ $(ASTCFLAGS)
+CFLAGS64 += \
+ $(ASTCFLAGS64)
+
+# Suppress this one warning as the fix would break old gcc, which upstream
+# still supports. This needs a better fix (later).
+pics/sumlib.o := CERRWARN += -erroff=E_CONST_PROMOTED_UNSIGNED_LONG
+
+.KEEP_STATE:
+
+all: $(LIBS)
+
+#
+# libsum is not lint-clean yet; fake up a target. (You can use
+# "make lintcheck" to actually run lint; please send all lint fixes
+# upstream (to AT&T) so the next update will pull them into ON.)
+#
+lint:
+ @ print "usr/src/lib/libsum is not lint-clean: skipping"
+
+include ../../Makefile.targ
diff --git a/usr/src/lib/libsum/THIRDPARTYLICENSE b/usr/src/lib/libsum/THIRDPARTYLICENSE
new file mode 100644
index 0000000000..50c6364c06
--- /dev/null
+++ b/usr/src/lib/libsum/THIRDPARTYLICENSE
@@ -0,0 +1,245 @@
++------------------------------------------------------------------------------+
+| This license covers all software that refers to the URL |
+| http://www.opensource.org/licenses/cpl1.0.txt |
++------------------------------------------------------------------------------+
+
+Common Public License Version 1.0
+
+ THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON
+ PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF
+ THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+ 1. DEFINITIONS
+
+ "Contribution" means:
+
+ a) in the case of the initial Contributor, the initial code and
+ documentation distributed under this Agreement, and
+
+ b) in the case of each subsequent Contributor:
+
+ i) changes to the Program, and
+
+ ii) additions to the Program;
+
+ where such changes and/or additions to the Program originate from
+ and are distributed by that particular Contributor. A Contribution
+ 'originates' from a Contributor if it was added to the Program by
+ such Contributor itself or anyone acting on such Contributor's
+ behalf. Contributions do not include additions to the Program
+ which: (i) are separate modules of software distributed in
+ conjunction with the Program under their own license agreement, and
+ (ii) are not derivative works of the Program.
+
+ "Contributor" means any person or entity that distributes the Program.
+
+ "Licensed Patents " mean patent claims licensable by a Contributor
+ which are necessarily infringed by the use or sale of its Contribution
+ alone or when combined with the Program.
+
+ "Program" means the Contributions distributed in accordance with this
+ Agreement.
+
+ "Recipient" means anyone who receives the Program under this
+ Agreement, including all Contributors.
+
+ 2. GRANT OF RIGHTS
+
+ a) Subject to the terms of this Agreement, each Contributor hereby
+ grants Recipient a non-exclusive, worldwide, royalty-free copyright
+ license to reproduce, prepare derivative works of, publicly
+ display, publicly perform, distribute and sublicense the
+ Contribution of such Contributor, if any, and such derivative
+ works, in source code and object code form.
+
+ b) Subject to the terms of this Agreement, each Contributor hereby
+ grants Recipient a non-exclusive, worldwide, royalty-free patent
+ license under Licensed Patents to make, use, sell, offer to sell,
+ import and otherwise transfer the Contribution of such Contributor,
+ if any, in source code and object code form. This patent license
+ shall apply to the combination of the Contribution and the Program
+ if, at the time the Contribution is added by the Contributor, such
+ addition of the Contribution causes such combination to be covered
+ by the Licensed Patents. The patent license shall not apply to any
+ other combinations which include the Contribution. No hardware per
+ se is licensed hereunder.
+
+ c) Recipient understands that although each Contributor grants the
+ licenses to its Contributions set forth herein, no assurances are
+ provided by any Contributor that the Program does not infringe the
+ patent or other intellectual property rights of any other entity.
+ Each Contributor disclaims any liability to Recipient for claims
+ brought by any other entity based on infringement of intellectual
+ property rights or otherwise. As a condition to exercising the
+ rights and licenses granted hereunder, each Recipient hereby
+ assumes sole responsibility to secure any other intellectual
+ property rights needed, if any. For example, if a third party
+ patent license is required to allow Recipient to distribute the
+ Program, it is Recipient's responsibility to acquire that license
+ before distributing the Program.
+
+ d) Each Contributor represents that to its knowledge it has
+ sufficient copyright rights in its Contribution, if any, to grant
+ the copyright license set forth in this Agreement.
+
+ 3. REQUIREMENTS
+
+ A Contributor may choose to distribute the Program in object code form
+ under its own license agreement, provided that:
+
+ a) it complies with the terms and conditions of this Agreement; and
+
+ b) its license agreement:
+
+ i) effectively disclaims on behalf of all Contributors all
+ warranties and conditions, express and implied, including
+ warranties or conditions of title and non-infringement, and implied
+ warranties or conditions of merchantability and fitness for a
+ particular purpose;
+
+ ii) effectively excludes on behalf of all Contributors all
+ liability for damages, including direct, indirect, special,
+ incidental and consequential damages, such as lost profits;
+
+ iii) states that any provisions which differ from this Agreement
+ are offered by that Contributor alone and not by any other party;
+ and
+
+ iv) states that source code for the Program is available from such
+ Contributor, and informs licensees how to obtain it in a reasonable
+ manner on or through a medium customarily used for software
+ exchange.
+
+ When the Program is made available in source code form:
+
+ a) it must be made available under this Agreement; and
+
+ b) a copy of this Agreement must be included with each copy of the
+ Program.
+
+ Contributors may not remove or alter any copyright notices contained
+ within the Program.
+
+ Each Contributor must identify itself as the originator of its
+ Contribution, if any, in a manner that reasonably allows subsequent
+ Recipients to identify the originator of the Contribution.
+
+ 4. COMMERCIAL DISTRIBUTION
+
+ Commercial distributors of software may accept certain
+ responsibilities with respect to end users, business partners and the
+ like. While this license is intended to facilitate the commercial use
+ of the Program, the Contributor who includes the Program in a
+ commercial product offering should do so in a manner which does not
+ create potential liability for other Contributors. Therefore, if a
+ Contributor includes the Program in a commercial product offering,
+ such Contributor ("Commercial Contributor") hereby agrees to defend
+ and indemnify every other Contributor ("Indemnified Contributor")
+ against any losses, damages and costs (collectively "Losses") arising
+ from claims, lawsuits and other legal actions brought by a third party
+ against the Indemnified Contributor to the extent caused by the acts
+ or omissions of such Commercial Contributor in connection with its
+ distribution of the Program in a commercial product offering. The
+ obligations in this section do not apply to any claims or Losses
+ relating to any actual or alleged intellectual property infringement.
+ In order to qualify, an Indemnified Contributor must: a) promptly
+ notify the Commercial Contributor in writing of such claim, and b)
+ allow the Commercial Contributor to control, and cooperate with the
+ Commercial Contributor in, the defense and any related settlement
+ negotiations. The Indemnified Contributor may participate in any such
+ claim at its own expense.
+
+ For example, a Contributor might include the Program in a commercial
+ product offering, Product X. That Contributor is then a Commercial
+ Contributor. If that Commercial Contributor then makes performance
+ claims, or offers warranties related to Product X, those performance
+ claims and warranties are such Commercial Contributor's responsibility
+ alone. Under this section, the Commercial Contributor would have to
+ defend claims against the other Contributors related to those
+ performance claims and warranties, and if a court requires any other
+ Contributor to pay any damages as a result, the Commercial Contributor
+ must pay those damages.
+
+ 5. NO WARRANTY
+
+ EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
+ PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY
+ WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
+ OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+ responsible for determining the appropriateness of using and
+ distributing the Program and assumes all risks associated with its
+ exercise of rights under this Agreement, including but not limited to
+ the risks and costs of program errors, compliance with applicable
+ laws, damage to or loss of data, programs or equipment, and
+ unavailability or interruption of operations.
+
+ 6. DISCLAIMER OF LIABILITY
+
+ EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR
+ ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
+ WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR
+ DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
+ HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+ 7. GENERAL
+
+ If any provision of this Agreement is invalid or unenforceable under
+ applicable law, it shall not affect the validity or enforceability of
+ the remainder of the terms of this Agreement, and without further
+ action by the parties hereto, such provision shall be reformed to the
+ minimum extent necessary to make such provision valid and enforceable.
+
+ If Recipient institutes patent litigation against a Contributor with
+ respect to a patent applicable to software (including a cross-claim or
+ counterclaim in a lawsuit), then any patent licenses granted by that
+ Contributor to such Recipient under this Agreement shall terminate as
+ of the date such litigation is filed. In addition, if Recipient
+ institutes patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Program
+ itself (excluding combinations of the Program with other software or
+ hardware) infringes such Recipient's patent(s), then such Recipient's
+ rights granted under Section 2(b) shall terminate as of the date such
+ litigation is filed.
+
+ All Recipient's rights under this Agreement shall terminate if it
+ fails to comply with any of the material terms or conditions of this
+ Agreement and does not cure such failure in a reasonable period of
+ time after becoming aware of such noncompliance. If all Recipient's
+ rights under this Agreement terminate, Recipient agrees to cease use
+ and distribution of the Program as soon as reasonably practicable.
+ However, Recipient's obligations under this Agreement and any licenses
+ granted by Recipient relating to the Program shall continue and
+ survive.
+
+ Everyone is permitted to copy and distribute copies of this Agreement,
+ but in order to avoid inconsistency the Agreement is copyrighted and
+ may only be modified in the following manner. The Agreement Steward
+ reserves the right to publish new versions (including revisions) of
+ this Agreement from time to time. No one other than the Agreement
+ Steward has the right to modify this Agreement. IBM is the initial
+ Agreement Steward. IBM may assign the responsibility to serve as the
+ Agreement Steward to a suitable separate entity. Each new version of
+ the Agreement will be given a distinguishing version number. The
+ Program (including Contributions) may always be distributed subject to
+ the version of the Agreement under which it was received. In addition,
+ after a new version of the Agreement is published, Contributor may
+ elect to distribute the Program (including its Contributions) under
+ the new version. Except as expressly stated in Sections 2(a) and 2(b)
+ above, Recipient receives no rights or licenses to the intellectual
+ property of any Contributor under this Agreement, whether expressly,
+ by implication, estoppel or otherwise. All rights in the Program not
+ expressly granted under this Agreement are reserved.
+
+ This Agreement is governed by the laws of the State of New York and
+ the intellectual property laws of the United States of America. No
+ party to this Agreement will bring a legal action under this Agreement
+ more than one year after the cause of action arose. Each party waives
+ its rights to a jury trial in any resulting litigation.
+
+Copyright (c) 2004 by the Open Source Initiative
+This is a copy of the license posted on 2004-10-06 at:
+ http://www.opensource.org/licenses/cpl
diff --git a/usr/src/lib/libsum/THIRDPARTYLICENSE.descrip b/usr/src/lib/libsum/THIRDPARTYLICENSE.descrip
new file mode 100644
index 0000000000..ce5312f88b
--- /dev/null
+++ b/usr/src/lib/libsum/THIRDPARTYLICENSE.descrip
@@ -0,0 +1 @@
+AT&T ADVANCED SOFTWARE TECHNOLOGY CHECKSUM LIBRARY (LIBSUM)
diff --git a/usr/src/cmd/sleep/Makefile b/usr/src/lib/libsum/amd64/Makefile
index 0ea024113d..9f293be4fa 100644
--- a/usr/src/cmd/sleep/Makefile
+++ b/usr/src/lib/libsum/amd64/Makefile
@@ -2,9 +2,8 @@
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
@@ -19,26 +18,13 @@
#
# CDDL HEADER END
#
+
#
-#ident "%Z%%M% %I% %E% SMI"
-#
-# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-PROG= sleep
-
-include ../Makefile.cmd
-CFLAGS += $(CCVERBOSE)
-
-.KEEP_STATE:
-
-all: $(PROG)
-
-install: all $(ROOTPROG)
-
-clean:
-
-lint: lint_PROG
+include ../Makefile.com
+include ../../Makefile.lib.64
-include ../Makefile.targ
+install: all $(ROOTLIBS64) $(ROOTLINKS64)
diff --git a/usr/src/lib/libsum/amd64/include/ast/sum.h b/usr/src/lib/libsum/amd64/include/ast/sum.h
new file mode 100644
index 0000000000..fa8157ab1e
--- /dev/null
+++ b/usr/src/lib/libsum/amd64/include/ast/sum.h
@@ -0,0 +1,74 @@
+
+/* : : generated by proto : : */
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1996-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* *
+***********************************************************************/
+
+
+/*
+ * Glenn Fowler
+ * AT&T Research
+ *
+ * checksum library interface
+ */
+
+#ifndef _SUM_H
+#if !defined(__PROTO__)
+#include <prototyped.h>
+#endif
+#if !defined(__LINKAGE__)
+#define __LINKAGE__ /* 2004-08-11 transition */
+#endif
+
+#define _SUM_H
+
+#include <ast.h>
+
+#define SUM_SIZE (1<<0) /* print size too */
+#define SUM_SCALE (1<<1) /* traditional size scale */
+#define SUM_TOTAL (1<<2) /* print totals since sumopen */
+#define SUM_LEGACY (1<<3) /* legacy field widths */
+
+#define _SUM_PUBLIC_ const char* name;
+
+typedef struct Sumdata_s
+{
+ uint32_t size;
+ uint32_t num;
+ __V_* buf;
+} Sumdata_t;
+
+typedef struct Sum_s
+{
+ _SUM_PUBLIC_
+#ifdef _SUM_PRIVATE_
+ _SUM_PRIVATE_
+#endif
+} Sum_t;
+
+extern __MANGLE__ Sum_t* sumopen __PROTO__((const char*));
+extern __MANGLE__ int suminit __PROTO__((Sum_t*));
+extern __MANGLE__ int sumblock __PROTO__((Sum_t*, const __V_*, size_t));
+extern __MANGLE__ int sumdone __PROTO__((Sum_t*));
+extern __MANGLE__ int sumdata __PROTO__((Sum_t*, Sumdata_t*));
+extern __MANGLE__ int sumprint __PROTO__((Sum_t*, Sfio_t*, int, size_t));
+extern __MANGLE__ int sumusage __PROTO__((Sfio_t*));
+extern __MANGLE__ int sumclose __PROTO__((Sum_t*));
+
+#endif
diff --git a/usr/src/lib/libsum/amd64/src/lib/libsum/FEATURE/sum b/usr/src/lib/libsum/amd64/src/lib/libsum/FEATURE/sum
new file mode 100644
index 0000000000..ce251b69f7
--- /dev/null
+++ b/usr/src/lib/libsum/amd64/src/lib/libsum/FEATURE/sum
@@ -0,0 +1,16 @@
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/src/lib/libsum/features/sum by iffe version 2008-01-31 : : */
+#ifndef _def_sum_sum
+#define _def_sum_sum 1
+#define _sys_types 1 /* #include <sys/types.h> ok */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_64bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_m 1 /* -lm is a library */
+#define _hdr_md4 1 /* #include <md4.h> ok */
+#define _LIB_md 1 /* -lmd is a library */
+#define _lib_MD4Init 1 /* MD4Init() in default lib(s) */
+#define _hdr_md5 1 /* #include <md5.h> ok */
+#define _lib_MD5Init 1 /* MD5Init() in default lib(s) */
+#define _hdr_sha1 1 /* #include <sha1.h> ok */
+#define _lib_SHA1Init 1 /* SHA1Init() in default lib(s) */
+#define _hdr_sha2 1 /* #include <sha2.h> ok */
+#define _lib_SHA2Init 1 /* SHA2Init() in default lib(s) */
+#endif
diff --git a/usr/src/lib/libsum/common/RELEASE b/usr/src/lib/libsum/common/RELEASE
new file mode 100644
index 0000000000..37de9bd7e8
--- /dev/null
+++ b/usr/src/lib/libsum/common/RELEASE
@@ -0,0 +1,14 @@
+08-06-05 sum-lmd.c: align context to largest int
+08-05-01 sumlib.c: add some -lmd verification checks
+08-02-11 sum-lmd.c,features/sum: add wrapper for solaris -lmd
+07-10-29 sum.h,sumlib.c: add SUM_LEGACY for legacy output format
+07-09-21 sum-sha1.c: reinstate Steve Reid's public domain implementation
+07-07-26 sumlib.c: drop GPL sum-sha1.c
+05-02-14 sumlib.c: split into sum-*.c
+05-02-14 sum-sha2.c: add SHA { 256 384 512 }
+04-02-29 Makefile: compile with $(CC.PIC) for codexlib/sum $(CC.DLL)
+03-12-16 add { crc prng } generic methods and maps[] to these methods
+03-12-16 sum.h,sumlib.c: add sumdata()
+03-09-29 sumlib.c: fix FNV to use ^ instead of +
+03-04-28 sumlib.c: drop md5 `zeroize' for performance
+ sumlib.c: add FIPS 180-1 SHA-1
diff --git a/usr/src/lib/libsum/common/features/sum b/usr/src/lib/libsum/common/features/sum
new file mode 100644
index 0000000000..ce15b4995e
--- /dev/null
+++ b/usr/src/lib/libsum/common/features/sum
@@ -0,0 +1,4 @@
+lib MD4Init md4.h -lmd
+lib MD5Init md5.h -lmd
+lib SHA1Init sha1.h -lmd
+lib SHA2Init sha2.h -lmd
diff --git a/usr/src/lib/libsum/common/llib-lsum b/usr/src/lib/libsum/common/llib-lsum
new file mode 100644
index 0000000000..eecd61c3ac
--- /dev/null
+++ b/usr/src/lib/libsum/common/llib-lsum
@@ -0,0 +1,32 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ *
+ * lib/libsum/common/llib-lsum
+ *
+ */
+
+/*LINTLIBRARY*/
+/*PROTOLIB1*/
+
+#include <sum.h>
diff --git a/usr/src/lib/libsum/common/sum-ast4.c b/usr/src/lib/libsum/common/sum-ast4.c
new file mode 100644
index 0000000000..59697893f8
--- /dev/null
+++ b/usr/src/lib/libsum/common/sum-ast4.c
@@ -0,0 +1,120 @@
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1996-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* *
+***********************************************************************/
+#pragma prototyped
+
+/*
+ * ast4
+ */
+
+#define ast4_description \
+ "The \bast\b 128 bit PRNG hash generated by catenating 4 separate 32 \
+ bit PNRG hashes. The block count is not printed."
+#define ast4_options 0
+#define ast4_match "ast4|32x4|tw"
+#define ast4_done long_done
+#define ast4_scale 0
+
+typedef struct Ast4_sum_s
+{
+ uint32_t sum0;
+ uint32_t sum1;
+ uint32_t sum2;
+ uint32_t sum3;
+} Ast4_sum_t;
+
+typedef struct Ast4_s
+{
+ _SUM_PUBLIC_
+ _SUM_PRIVATE_
+ Ast4_sum_t cur;
+ Ast4_sum_t tot;
+ unsigned char buf[sizeof(Ast4_sum_t)];
+} Ast4_t;
+
+static int
+ast4_init(Sum_t* p)
+{
+ register Ast4_t* a = (Ast4_t*)p;
+
+ a->tot.sum0 ^= a->cur.sum0;
+ a->cur.sum0 = 0;
+ a->tot.sum1 ^= a->cur.sum1;
+ a->cur.sum1 = 0;
+ a->tot.sum2 ^= a->cur.sum2;
+ a->cur.sum2 = 0;
+ a->tot.sum3 ^= a->cur.sum3;
+ a->cur.sum3 = 0;
+ return 0;
+}
+
+static Sum_t*
+ast4_open(const Method_t* method, const char* name)
+{
+ Ast4_t* p;
+
+ if (p = newof(0, Ast4_t, 1, 0))
+ {
+ p->method = (Method_t*)method;
+ p->name = name;
+ }
+ return (Sum_t*)p;
+}
+
+static int
+ast4_block(Sum_t* p, const void* s, size_t n)
+{
+ register Ast4_sum_t* a = &((Ast4_t*)p)->cur;
+ register unsigned char* b = (unsigned char*)s;
+ register unsigned char* e = b + n;
+ register int c;
+
+ while (b < e)
+ {
+ c = *b++;
+ a->sum0 = a->sum0 * 0x63c63cd9 + 0x9c39c33d + c;
+ a->sum1 = a->sum1 * 0x00000011 + 0x00017cfb + c;
+ a->sum2 = a->sum2 * 0x12345679 + 0x3ade68b1 + c;
+ a->sum3 = a->sum3 * 0xf1eac01d + 0xcafe10af + c;
+ }
+ return 0;
+}
+
+static int
+ast4_print(Sum_t* p, Sfio_t* sp, int flags, size_t scale)
+{
+ register Ast4_sum_t* a;
+
+ a = (flags & SUM_TOTAL) ? &((Ast4_t*)p)->tot : &((Ast4_t*)p)->cur;
+ sfprintf(sp, "%06..64u%06..64u%06..64u%06..64u", a->sum0, a->sum1, a->sum2, a->sum3);
+ return 0;
+}
+
+static int
+ast4_data(Sum_t* p, Sumdata_t* data)
+{
+ data->size = sizeof(((Ast4_t*)p)->cur);
+ data->num = 0;
+#if _ast_intswap
+ swapmem(_ast_intswap, data->buf = ((Ast4_t*)p)->buf, &((Ast4_t*)p)->cur, sizeof(((Ast4_t*)p)->cur));
+#else
+ data->buf = &((Ast4_t*)p)->cur;
+#endif
+ return 0;
+}
diff --git a/usr/src/lib/libsum/common/sum-att.c b/usr/src/lib/libsum/common/sum-att.c
new file mode 100644
index 0000000000..ef09d0c2e9
--- /dev/null
+++ b/usr/src/lib/libsum/common/sum-att.c
@@ -0,0 +1,60 @@
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1996-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* *
+***********************************************************************/
+#pragma prototyped
+
+/*
+ * att
+ */
+
+#define att_description \
+ "The system 5 release 4 checksum. This is the default for \bsum\b \
+ when \bgetconf UNIVERSE\b is \batt\b. This is the only true sum; \
+ all of the other methods are order dependent."
+#define att_options 0
+#define att_match "att|sys5|s5|default"
+#define att_open long_open
+#define att_init long_init
+#define att_print long_print
+#define att_data long_data
+#define att_scale 512
+
+static int
+att_block(register Sum_t* p, const void* s, size_t n)
+{
+ register uint32_t c = ((Integral_t*)p)->sum;
+ register unsigned char* b = (unsigned char*)s;
+ register unsigned char* e = b + n;
+
+ while (b < e)
+ c += *b++;
+ ((Integral_t*)p)->sum = c;
+ return 0;
+}
+
+static int
+att_done(Sum_t* p)
+{
+ register uint32_t c = ((Integral_t*)p)->sum;
+
+ c = (c & 0xffff) + ((c >> 16) & 0xffff);
+ c = (c & 0xffff) + (c >> 16);
+ ((Integral_t*)p)->sum = c & 0xffff;
+ return short_done(p);
+}
diff --git a/usr/src/lib/libsum/common/sum-bsd.c b/usr/src/lib/libsum/common/sum-bsd.c
new file mode 100644
index 0000000000..dcf1e6f135
--- /dev/null
+++ b/usr/src/lib/libsum/common/sum-bsd.c
@@ -0,0 +1,48 @@
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1996-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* *
+***********************************************************************/
+#pragma prototyped
+
+/*
+ * bsd
+ */
+
+#define bsd_description \
+ "The BSD checksum."
+#define bsd_options 0
+#define bsd_match "bsd|ucb"
+#define bsd_open long_open
+#define bsd_init long_init
+#define bsd_done short_done
+#define bsd_print long_print
+#define bsd_data long_data
+#define bsd_scale 1024
+
+static int
+bsd_block(register Sum_t* p, const void* s, size_t n)
+{
+ register uint32_t c = ((Integral_t*)p)->sum;
+ register unsigned char* b = (unsigned char*)s;
+ register unsigned char* e = b + n;
+
+ while (b < e)
+ c = ((c >> 1) + *b++ + ((c & 01) ? 0x8000 : 0)) & 0xffff;
+ ((Integral_t*)p)->sum = c;
+ return 0;
+}
diff --git a/usr/src/lib/libsum/common/sum-crc.c b/usr/src/lib/libsum/common/sum-crc.c
new file mode 100644
index 0000000000..eca34df603
--- /dev/null
+++ b/usr/src/lib/libsum/common/sum-crc.c
@@ -0,0 +1,191 @@
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1996-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* *
+***********************************************************************/
+#pragma prototyped
+
+/*
+ * crc
+ */
+
+#define crc_description \
+ "32 bit CRC (cyclic redundancy check)."
+#define crc_options "\
+[+polynomial?The 32 bit crc polynomial bitmask with implicit bit 32.]:[mask:=0xedb88320]\
+[+done?XOR the final crc value with \anumber\a. 0xffffffff is used if \anumber\a is omitted.]:?[number:=0]\
+[+init?The initial crc value. 0xffffffff is used if \anumber\a is omitted.]:?[number:=0]\
+[+rotate?XOR each input character with the high order crc byte (instead of the low order).]\
+[+size?Include the total number of bytes in the crc. \anumber\a, if specified, is first XOR'd into the size.]:?[number:=0]\
+"
+#define crc_match "crc"
+#define crc_open crc_open
+#define crc_print long_print
+#define crc_data long_data
+#define crc_scale 0
+
+typedef uint32_t Crcnum_t;
+
+typedef struct Crc_s
+{
+ _SUM_PUBLIC_
+ _SUM_PRIVATE_
+ _INTEGRAL_PRIVATE_
+ Crcnum_t init;
+ Crcnum_t done;
+ Crcnum_t xorsize;
+ Crcnum_t tab[256];
+ unsigned int addsize;
+ unsigned int rotate;
+} Crc_t;
+
+#define CRC(p,s,c) (s = (s >> 8) ^ (p)->tab[(s ^ (c)) & 0xff])
+#define CRCROTATE(p,s,c) (s = (s << 8) ^ (p)->tab[((s >> 24) ^ (c)) & 0xff])
+
+static Sum_t*
+crc_open(const Method_t* method, const char* name)
+{
+ register Crc_t* sum;
+ register const char* s;
+ register const char* t;
+ register const char* v;
+ register int i;
+ register int j;
+ Crcnum_t polynomial;
+ Crcnum_t x;
+
+ if (sum = newof(0, Crc_t, 1, 0))
+ {
+ sum->method = (Method_t*)method;
+ sum->name = name;
+ }
+ polynomial = 0xedb88320;
+ s = name;
+ while (*(t = s))
+ {
+ for (t = s, v = 0; *s && *s != '-'; s++)
+ if (*s == '=' && !v)
+ v = s;
+ i = (v ? v : s) - t;
+ if (isdigit(*t) || v && i >= 4 && strneq(t, "poly", 4) && (t = v + 1))
+ polynomial = strtoul(t, NiL, 0);
+ else if (strneq(t, "done", i))
+ sum->done = v ? strtoul(v + 1, NiL, 0) : ~sum->done;
+ else if (strneq(t, "init", i))
+ sum->init = v ? strtoul(v + 1, NiL, 0) : ~sum->init;
+ else if (strneq(t, "rotate", i))
+ sum->rotate = 1;
+ else if (strneq(t, "size", i))
+ {
+ sum->addsize = 1;
+ if (v)
+ sum->xorsize = strtoul(v + 1, NiL, 0);
+ }
+ if (*s == '-')
+ s++;
+ }
+ if (sum->rotate)
+ {
+ Crcnum_t t;
+ Crcnum_t p[8];
+
+ p[0] = polynomial;
+ for (i = 1; i < 8; i++)
+ p[i] = (p[i-1] << 1) ^ ((p[i-1] & 0x80000000) ? polynomial : 0);
+ for (i = 0; i < elementsof(sum->tab); i++)
+ {
+ t = 0;
+ x = i;
+ for (j = 0; j < 8; j++)
+ {
+ if (x & 1)
+ t ^= p[j];
+ x >>= 1;
+ }
+ sum->tab[i] = t;
+ }
+ }
+ else
+ {
+ for (i = 0; i < elementsof(sum->tab); i++)
+ {
+ x = i;
+ for (j = 0; j < 8; j++)
+ x = (x>>1) ^ ((x & 1) ? polynomial : 0);
+ sum->tab[i] = x;
+ }
+ }
+ return (Sum_t*)sum;
+}
+
+static int
+crc_init(Sum_t* p)
+{
+ Crc_t* sum = (Crc_t*)p;
+
+ sum->sum = sum->init;
+ return 0;
+}
+
+static int
+crc_block(Sum_t* p, const void* s, size_t n)
+{
+ Crc_t* sum = (Crc_t*)p;
+ register Crcnum_t c = sum->sum;
+ register unsigned char* b = (unsigned char*)s;
+ register unsigned char* e = b + n;
+
+ if (sum->rotate)
+ while (b < e)
+ CRCROTATE(sum, c, *b++);
+ else
+ while (b < e)
+ CRC(sum, c, *b++);
+ sum->sum = c;
+ return 0;
+}
+
+static int
+crc_done(Sum_t* p)
+{
+ register Crc_t* sum = (Crc_t*)p;
+ register Crcnum_t c;
+ register uintmax_t n;
+ int i;
+ int j;
+
+ c = sum->sum;
+ if (sum->addsize)
+ {
+ n = sum->size ^ sum->xorsize;
+ if (sum->rotate)
+ while (n)
+ {
+ CRCROTATE(sum, c, n);
+ n >>= 8;
+ }
+ else
+ for (i = 0, j = 32; i < 4; i++)
+ {
+ j -= 8;
+ CRC(sum, c, n >> j);
+ }
+ }
+ sum->sum = c ^ sum->done;
+ sum->total_sum ^= (sum->sum &= 0xffffffff);
+ return 0;
+}
diff --git a/usr/src/lib/libsum/common/sum-lmd.c b/usr/src/lib/libsum/common/sum-lmd.c
new file mode 100644
index 0000000000..1e011685cd
--- /dev/null
+++ b/usr/src/lib/libsum/common/sum-lmd.c
@@ -0,0 +1,330 @@
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1996-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* *
+***********************************************************************/
+#pragma prototyped
+
+/*
+ * sum(3) wrapper for solaris -lmd message digest library
+ */
+
+typedef void (*Lmd_init_f)(void*);
+typedef void (*Lmd_update_f)(void*, const void*, size_t);
+typedef void (*Lmd_final_f)(unsigned char*, void*);
+
+#define _SUM_LMD_ \
+ _SUM_PUBLIC_ \
+ _SUM_PRIVATE_ \
+ Lmd_init_f initf; \
+ Lmd_update_f updatef; \
+ Lmd_final_f finalf; \
+ unsigned int datasize; \
+ unsigned char total[64]; \
+ unsigned char data[64];
+
+typedef struct Lmd_s
+{
+ _SUM_LMD_
+ struct
+ {
+ uintmax_t context;
+ } context;
+} Lmd_t;
+
+static int
+lmd_init(Sum_t* p)
+{
+ Lmd_t* lmd = (Lmd_t*)p;
+
+ (*lmd->initf)(&lmd->context);
+ return 0;
+}
+
+static int
+lmd_block(Sum_t* p, const void* s, size_t n)
+{
+ Lmd_t* lmd = (Lmd_t*)p;
+
+ (*lmd->updatef)(&lmd->context, s, n);
+ return 0;
+}
+
+static int
+lmd_done(Sum_t* p)
+{
+ register Lmd_t* lmd = (Lmd_t*)p;
+ register int i;
+
+ (*lmd->finalf)(lmd->data, &lmd->context);
+ for (i = 0; i < lmd->datasize; i++)
+ lmd->total[i] ^= lmd->data[i];
+ return 0;
+}
+
+static int
+lmd_print(Sum_t* p, Sfio_t* sp, register int flags, size_t scale)
+{
+ register Lmd_t* lmd = (Lmd_t*)p;
+ register unsigned char* d;
+ register int i;
+
+ d = (flags & SUM_TOTAL) ? lmd->total : lmd->data;
+ for (i = 0; i < lmd->datasize; i++)
+ sfprintf(sp, "%02x", d[i]);
+ return 0;
+}
+
+static int
+lmd_data(Sum_t* p, Sumdata_t* data)
+{
+ Lmd_t* lmd = (Lmd_t*)p;
+
+ data->size = lmd->datasize;
+ data->num = 0;
+ data->buf = lmd->data;
+ return 0;
+}
+
+#if _lib_MD4Init && _hdr_md4
+
+#include <md4.h>
+
+#define md4_description "RFC1320 MD4 message digest. Cryptographically weak. The block count is not printed."
+#define md4_options "[+(version)?md4 (solaris -lmd) 2005-07-26]"
+#define md4_match "md4|MD4"
+#define md4_scale 0
+#define md4_init lmd_init
+#define md4_block lmd_block
+#define md4_done lmd_done
+#define md4_print lmd_print
+#define md4_data lmd_data
+
+typedef struct Md4_s
+{
+ _SUM_LMD_
+ MD4_CTX context;
+} Md4_t;
+
+static Sum_t*
+md4_open(const Method_t* method, const char* name)
+{
+ Md4_t* lmd;
+
+ if (lmd = newof(0, Md4_t, 1, 0))
+ {
+ lmd->method = (Method_t*)method;
+ lmd->name = name;
+ lmd->datasize = 16;
+ lmd->initf = (Lmd_init_f)MD4Init;
+ lmd->updatef = (Lmd_update_f)MD4Update;
+ lmd->finalf = (Lmd_final_f)MD4Final;
+ md4_init((Sum_t*)lmd);
+ }
+ return (Sum_t*)lmd;
+}
+
+#endif
+
+#if _lib_MD5Init && _hdr_md5
+
+#include <md5.h>
+
+#define md5_description "RFC1321 MD5 message digest. Cryptographically weak. The block count is not printed."
+#define md5_options "[+(version)?md5 (solaris -lmd) 2005-07-26]"
+#define md5_match "md5|MD5"
+#define md5_scale 0
+#define md5_init lmd_init
+#define md5_block lmd_block
+#define md5_done lmd_done
+#define md5_print lmd_print
+#define md5_data lmd_data
+
+typedef struct Md5_s
+{
+ _SUM_LMD_
+ MD5_CTX context;
+} Md5_t;
+
+static Sum_t*
+md5_open(const Method_t* method, const char* name)
+{
+ Md5_t* lmd;
+
+ if (lmd = newof(0, Md5_t, 1, 0))
+ {
+ lmd->method = (Method_t*)method;
+ lmd->name = name;
+ lmd->datasize = 16;
+ lmd->initf = (Lmd_init_f)MD5Init;
+ lmd->updatef = (Lmd_update_f)MD5Update;
+ lmd->finalf = (Lmd_final_f)MD5Final;
+ md5_init((Sum_t*)lmd);
+ }
+ return (Sum_t*)lmd;
+}
+
+#endif
+
+#if _lib_SHA1Init && _hdr_sha1
+
+#include <sha1.h>
+
+#define sha1_description "RFC3174 / FIPS 180-1 SHA-1 secure hash algorithm 1. Cryptographically weak. The block count is not printed."
+#define sha1_options "[+(version)?sha1 (solaris -lmd) 2005-07-26]"
+#define sha1_match "sha1|SHA1|sha-1|SHA-1"
+#define sha1_scale 0
+#define sha1_init lmd_init
+#define sha1_block lmd_block
+#define sha1_done lmd_done
+#define sha1_print lmd_print
+#define sha1_data lmd_data
+
+typedef struct Sha1_s
+{
+ _SUM_LMD_
+ SHA1_CTX context;
+ unsigned char pad[1024]; /* XXX: who's bug is it? */
+} Sha1_t;
+
+static Sum_t*
+sha1_open(const Method_t* method, const char* name)
+{
+ Sha1_t* lmd;
+
+ if (lmd = newof(0, Sha1_t, 1, 0))
+ {
+ lmd->method = (Method_t*)method;
+ lmd->name = name;
+ lmd->datasize = 20;
+ lmd->initf = (Lmd_init_f)SHA1Init;
+ lmd->updatef = (Lmd_update_f)SHA1Update;
+ lmd->finalf = (Lmd_final_f)SHA1Final;
+ sha1_init((Sum_t*)lmd);
+ }
+ return (Sum_t*)lmd;
+}
+
+#endif
+
+#if _lib_SHA2Init && _hdr_sha2
+
+#include <sha2.h>
+
+#define sha256_description "FIPS 180-2 SHA256 secure hash algorithm. The block count is not printed."
+#define sha256_options "[+(version)?sha256 (solaris -lmd) 2005-07-26]"
+#define sha256_match "sha256|sha-256|SHA256|SHA-256"
+#define sha256_scale 0
+#define sha256_init lmd_init
+#define sha256_block lmd_block
+#define sha256_done lmd_done
+#define sha256_print lmd_print
+#define sha256_data lmd_data
+
+typedef struct Sha256_s
+{
+ _SUM_LMD_
+ SHA256_CTX context;
+} Sha256_t;
+
+static Sum_t*
+sha256_open(const Method_t* method, const char* name)
+{
+ Sha256_t* lmd;
+
+ if (lmd = newof(0, Sha256_t, 1, 0))
+ {
+ lmd->method = (Method_t*)method;
+ lmd->name = name;
+ lmd->datasize = 32;
+ lmd->initf = (Lmd_init_f)SHA256Init;
+ lmd->updatef = (Lmd_update_f)SHA256Update;
+ lmd->finalf = (Lmd_final_f)SHA256Final;
+ sha256_init((Sum_t*)lmd);
+ }
+ return (Sum_t*)lmd;
+}
+
+#define sha384_description "FIPS 180-2 SHA384 secure hash algorithm. The block count is not printed."
+#define sha384_options "[+(version)?sha384 (solaris -lmd) 2005-07-26]"
+#define sha384_match "sha384|sha-384|SHA384|SHA-384"
+#define sha384_scale 0
+#define sha384_init lmd_init
+#define sha384_block lmd_block
+#define sha384_done lmd_done
+#define sha384_print lmd_print
+#define sha384_data lmd_data
+
+typedef struct Sha384_s
+{
+ _SUM_LMD_
+ SHA384_CTX context;
+} Sha384_t;
+
+static Sum_t*
+sha384_open(const Method_t* method, const char* name)
+{
+ Sha384_t* lmd;
+
+ if (lmd = newof(0, Sha384_t, 1, 0))
+ {
+ lmd->method = (Method_t*)method;
+ lmd->name = name;
+ lmd->datasize = 48;
+ lmd->initf = (Lmd_init_f)SHA384Init;
+ lmd->updatef = (Lmd_update_f)SHA384Update;
+ lmd->finalf = (Lmd_final_f)SHA384Final;
+ sha384_init((Sum_t*)lmd);
+ }
+ return (Sum_t*)lmd;
+}
+
+#define sha512_description "FIPS 180-2 SHA512 secure hash algorithm. The block count is not printed."
+#define sha512_options "[+(version)?sha512 (solaris -lmd) 2005-07-26]"
+#define sha512_match "sha512|sha-512|SHA512|SHA-512"
+#define sha512_scale 0
+#define sha512_init lmd_init
+#define sha512_block lmd_block
+#define sha512_done lmd_done
+#define sha512_print lmd_print
+#define sha512_data lmd_data
+
+typedef struct Sha512_s
+{
+ _SUM_LMD_
+ SHA512_CTX context;
+} Sha512_t;
+
+static Sum_t*
+sha512_open(const Method_t* method, const char* name)
+{
+ Sha512_t* lmd;
+
+ if (lmd = newof(0, Sha512_t, 1, 0))
+ {
+ lmd->method = (Method_t*)method;
+ lmd->name = name;
+ lmd->datasize = 64;
+ lmd->initf = (Lmd_init_f)SHA512Init;
+ lmd->updatef = (Lmd_update_f)SHA512Update;
+ lmd->finalf = (Lmd_final_f)SHA512Final;
+ sha512_init((Sum_t*)lmd);
+ }
+ return (Sum_t*)lmd;
+}
+
+#endif
diff --git a/usr/src/lib/libsum/common/sum-md5.c b/usr/src/lib/libsum/common/sum-md5.c
new file mode 100644
index 0000000000..895ad8294b
--- /dev/null
+++ b/usr/src/lib/libsum/common/sum-md5.c
@@ -0,0 +1,374 @@
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1996-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* *
+***********************************************************************/
+#pragma prototyped
+
+/*
+ * md5
+ */
+
+/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
+ rights reserved.
+
+ License to copy and use this software is granted provided that it
+ is identified as the "RSA Data Security, Inc. MD5 Message-Digest
+ Method" in all material mentioning or referencing this software
+ or this function.
+
+ License is also granted to make and use derivative works provided
+ that such works are identified as "derived from the RSA Data
+ Security, Inc. MD5 Message-Digest Method" in all material
+ mentioning or referencing the derived work.
+
+ RSA Data Security, Inc. makes no representations concerning either
+ the merchantability of this software or the suitability of this
+ software for any particular purpose. It is provided "as is"
+ without express or implied warranty of any kind.
+
+ These notices must be retained in any copies of any part of this
+ documentation and/or software.
+ */
+
+#define md5_description \
+ "The RSA Data Security, Inc. MD5 Message-Digest Method, 1991-2, \
+ used with permission. The block count is not printed."
+#define md5_options "[+(version)?md5 (RSA Data Security, Inc. MD5 Message-Digest, 1991-2) 1996-02-29]"
+#define md5_match "md5|MD5"
+#define md5_scale 0
+
+typedef uint32_t UINT4;
+
+typedef struct Md5_s
+{
+ _SUM_PUBLIC_
+ _SUM_PRIVATE_
+ UINT4 state[4]; /* state (ABCD) */
+ UINT4 count[2]; /* # bits handled mod 2^64 (lsb)*/
+ unsigned char buffer[64]; /* input buffer */
+ unsigned char digest[16]; /* final digest */
+ unsigned char digest_sum[16]; /* sum of all digests */
+} Md5_t;
+
+static const unsigned char md5_pad[] =
+{
+ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
+/*
+ * encode input into output
+ * len must be a multiple of 4
+ */
+
+static void
+md5_encode(register unsigned char* output, register UINT4* input, unsigned int len)
+{
+ register unsigned int i;
+ register unsigned int j;
+
+ for (i = j = 0; j < len; i++, j += 4)
+ {
+ output[j] = (unsigned char)(input[i] & 0xff);
+ output[j+1] = (unsigned char)((input[i] >> 8) & 0xff);
+ output[j+2] = (unsigned char)((input[i] >> 16) & 0xff);
+ output[j+3] = (unsigned char)((input[i] >> 24) & 0xff);
+ }
+}
+
+/*
+ * decode input into output
+ * len must be a multiple of 4
+ */
+
+static void
+md5_decode(register UINT4* output, register unsigned char* input, unsigned int len)
+{
+ unsigned int i;
+ unsigned int j;
+
+ for (i = j = 0; j < len; i++, j += 4)
+ output[i] = ((UINT4)input[j]) |
+ (((UINT4)input[j+1]) << 8) |
+ (((UINT4)input[j+2]) << 16) |
+ (((UINT4)input[j+3]) << 24);
+}
+
+static int
+md5_init(Sum_t* p)
+{
+ register Md5_t* context = (Md5_t*)p;
+
+ context->count[0] = context->count[1] = 0;
+ context->state[0] = 0x67452301;
+ context->state[1] = 0xefcdab89;
+ context->state[2] = 0x98badcfe;
+ context->state[3] = 0x10325476;
+ return 0;
+}
+
+static Sum_t*
+md5_open(const Method_t* method, const char* name)
+{
+ Md5_t* p;
+
+ if (p = newof(0, Md5_t, 1, 0))
+ {
+ p->method = (Method_t*)method;
+ p->name = name;
+ md5_init((Sum_t*)p);
+ }
+ return (Sum_t*)p;
+}
+
+/*
+ * basic MD5 step -- transforms buf based on in
+ */
+
+#define S11 7
+#define S12 12
+#define S13 17
+#define S14 22
+#define S21 5
+#define S22 9
+#define S23 14
+#define S24 20
+#define S31 4
+#define S32 11
+#define S33 16
+#define S34 23
+#define S41 6
+#define S42 10
+#define S43 15
+#define S44 21
+
+/* F, G, H and I are basic MD5 functions */
+#define F(x, y, z) (((x) & (y)) | ((~x) & (z)))
+#define G(x, y, z) (((x) & (z)) | ((y) & (~z)))
+#define H(x, y, z) ((x) ^ (y) ^ (z))
+#define I(x, y, z) ((y) ^ ((x) | (~z)))
+
+/* ROTATE_LEFT rotates x left n bits */
+#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
+
+/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4 */
+/* Rotation is separate from addition to prevent recomputation */
+#define FF(a, b, c, d, x, s, ac) { \
+ (a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \
+ (a) = ROTATE_LEFT ((a), (s)); \
+ (a) += (b); \
+ }
+#define GG(a, b, c, d, x, s, ac) { \
+ (a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \
+ (a) = ROTATE_LEFT ((a), (s)); \
+ (a) += (b); \
+ }
+#define HH(a, b, c, d, x, s, ac) { \
+ (a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \
+ (a) = ROTATE_LEFT ((a), (s)); \
+ (a) += (b); \
+ }
+#define II(a, b, c, d, x, s, ac) { \
+ (a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \
+ (a) = ROTATE_LEFT ((a), (s)); \
+ (a) += (b); \
+ }
+
+static void
+md5_transform(UINT4 state[4], unsigned char block[64])
+{
+ UINT4 a = state[0];
+ UINT4 b = state[1];
+ UINT4 c = state[2];
+ UINT4 d = state[3];
+ UINT4 x[16];
+
+ md5_decode(x, block, 64);
+
+ /* round 1 */
+ FF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */
+ FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */
+ FF (c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */
+ FF (b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */
+ FF (a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */
+ FF (d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */
+ FF (c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */
+ FF (b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */
+ FF (a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */
+ FF (d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */
+ FF (c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */
+ FF (b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */
+ FF (a, b, c, d, x[12], S11, 0x6b901122); /* 13 */
+ FF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */
+ FF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */
+ FF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */
+
+ /* round 2 */
+ GG (a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */
+ GG (d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */
+ GG (c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */
+ GG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */
+ GG (a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */
+ GG (d, a, b, c, x[10], S22, 0x02441453); /* 22 */
+ GG (c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */
+ GG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */
+ GG (a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */
+ GG (d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */
+ GG (c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */
+ GG (b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */
+ GG (a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */
+ GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */
+ GG (c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */
+ GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */
+
+ /* round 3 */
+ HH (a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */
+ HH (d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */
+ HH (c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */
+ HH (b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */
+ HH (a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */
+ HH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */
+ HH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */
+ HH (b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */
+ HH (a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */
+ HH (d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */
+ HH (c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */
+ HH (b, c, d, a, x[ 6], S34, 0x04881d05); /* 44 */
+ HH (a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */
+ HH (d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */
+ HH (c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */
+ HH (b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */
+
+ /* round 4 */
+ II (a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */
+ II (d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */
+ II (c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */
+ II (b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */
+ II (a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */
+ II (d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */
+ II (c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */
+ II (b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */
+ II (a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */
+ II (d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */
+ II (c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */
+ II (b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */
+ II (a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */
+ II (d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */
+ II (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */
+ II (b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */
+
+ state[0] += a;
+ state[1] += b;
+ state[2] += c;
+ state[3] += d;
+}
+
+static int
+md5_block(Sum_t* p, const void* s, size_t inputLen)
+{
+ register Md5_t* context = (Md5_t*)p;
+ unsigned char* input = (unsigned char*)s;
+ unsigned int i;
+ unsigned int index;
+ unsigned int partLen;
+
+ /* compute number of bytes mod 64 */
+ index = (unsigned int)((context->count[0] >> 3) & 0x3f);
+
+ /* update number of bits */
+ if ((context->count[0] += ((UINT4)inputLen << 3)) < ((UINT4)inputLen << 3))
+ context->count[1]++;
+ context->count[1] += ((UINT4)inputLen >> 29);
+ partLen = 64 - index;
+
+ /* transform as many times as possible */
+ if (inputLen >= partLen)
+ {
+ memcpy(&context->buffer[index], input, partLen);
+ md5_transform(context->state, context->buffer);
+ for (i = partLen; i + 63 < inputLen; i += 64)
+ md5_transform(context->state, &input[i]);
+ index = 0;
+ }
+ else
+ i = 0;
+
+ /* buffer remaining input */
+ memcpy(&context->buffer[index], &input[i], inputLen - i);
+
+ return 0;
+}
+
+static int
+md5_done(Sum_t* p)
+{
+ register Md5_t* context = (Md5_t*)p;
+ unsigned char bits[8];
+ unsigned int index;
+ unsigned int padLen;
+
+ /* save number of bits */
+ md5_encode(bits, context->count, sizeof(bits));
+
+ /* pad out to 56 mod 64 */
+ index = (unsigned int)((context->count[0] >> 3) & 0x3f);
+ padLen = (index < 56) ? (56 - index) : (120 - index);
+ md5_block(p, md5_pad, padLen);
+
+ /* append length (before padding) */
+ md5_block(p, bits, sizeof(bits));
+
+ /* store state in digest */
+ md5_encode(context->digest, context->state, sizeof(context->digest));
+
+ /* accumulate the digests */
+ for (index = 0; index < elementsof(context->digest); index++)
+ context->digest_sum[index] ^= context->digest[index];
+
+ return 0;
+}
+
+static int
+md5_print(Sum_t* p, Sfio_t* sp, register int flags, size_t scale)
+{
+ register Md5_t* x = (Md5_t*)p;
+ register unsigned char* d;
+ register int n;
+
+ d = (flags & SUM_TOTAL) ? x->digest_sum : x->digest;
+ for (n = 0; n < elementsof(x->digest); n++)
+ sfprintf(sp, "%02x", d[n]);
+ return 0;
+}
+
+static int
+md5_data(Sum_t* p, Sumdata_t* data)
+{
+ register Md5_t* x = (Md5_t*)p;
+
+ data->size = elementsof(x->digest);
+ data->num = 0;
+ data->buf = x->digest;
+ return 0;
+}
diff --git a/usr/src/lib/libsum/common/sum-prng.c b/usr/src/lib/libsum/common/sum-prng.c
new file mode 100644
index 0000000000..caccda1ffc
--- /dev/null
+++ b/usr/src/lib/libsum/common/sum-prng.c
@@ -0,0 +1,113 @@
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1996-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* *
+***********************************************************************/
+#pragma prototyped
+
+/*
+ * prng
+ */
+
+#include <fnv.h>
+
+#define prng_description \
+ "32 bit PRNG (pseudo random number generator) hash."
+#define prng_options "\
+[+mpy?The 32 bit PRNG multiplier.]:[number:=0x01000193]\
+[+add?The 32 bit PRNG addend.]:[number:=0]\
+[+init?The PRNG initial value. 0xffffffff is used if \anumber\a is omitted.]:?[number:=0x811c9dc5]\
+"
+#define prng_match "prng"
+#define prng_done long_done
+#define prng_print long_print
+#define prng_data long_data
+#define prng_scale 0
+
+typedef uint32_t Prngnum_t;
+
+typedef struct Prng_s
+{
+ _SUM_PUBLIC_
+ _SUM_PRIVATE_
+ _INTEGRAL_PRIVATE_
+ Prngnum_t init;
+ Prngnum_t mpy;
+ Prngnum_t add;
+} Prng_t;
+
+static Sum_t*
+prng_open(const Method_t* method, const char* name)
+{
+ register Prng_t* sum;
+ register const char* s;
+ register const char* t;
+ register const char* v;
+ register int i;
+
+ if (sum = newof(0, Prng_t, 1, 0))
+ {
+ sum->method = (Method_t*)method;
+ sum->name = name;
+ }
+ s = name;
+ while (*(t = s))
+ {
+ for (t = s, v = 0; *s && *s != '-'; s++)
+ if (*s == '=' && !v)
+ v = s;
+ i = (v ? v : s) - t;
+ if (isdigit(*t) || v && strneq(t, "mpy", i) && (t = v + 1))
+ sum->mpy = strtoul(t, NiL, 0);
+ else if (strneq(t, "add", i))
+ sum->add = v ? strtoul(v + 1, NiL, 0) : ~sum->add;
+ else if (strneq(t, "init", i))
+ sum->init = v ? strtoul(v + 1, NiL, 0) : ~sum->init;
+ if (*s == '-')
+ s++;
+ }
+ if (!sum->mpy)
+ {
+ sum->mpy = FNV_MULT;
+ if (!sum->init)
+ sum->init = FNV_INIT;
+ }
+ return (Sum_t*)sum;
+}
+
+static int
+prng_init(Sum_t* p)
+{
+ Prng_t* sum = (Prng_t*)p;
+
+ sum->sum = sum->init;
+ return 0;
+}
+
+static int
+prng_block(Sum_t* p, const void* s, size_t n)
+{
+ Prng_t* sum = (Prng_t*)p;
+ register Prngnum_t c = sum->sum;
+ register unsigned char* b = (unsigned char*)s;
+ register unsigned char* e = b + n;
+
+ while (b < e)
+ c = c * sum->mpy + sum->add + *b++;
+ sum->sum = c;
+ return 0;
+}
diff --git a/usr/src/lib/libsum/common/sum-sha1.c b/usr/src/lib/libsum/common/sum-sha1.c
new file mode 100644
index 0000000000..9c9a48bb07
--- /dev/null
+++ b/usr/src/lib/libsum/common/sum-sha1.c
@@ -0,0 +1,342 @@
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1996-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* *
+***********************************************************************/
+#pragma prototyped
+
+/*
+ * SHA-1 in C
+ * By Steve Reid <steve@edmweb.com>
+ * 100% Public Domain
+ *
+ * Test Vectors (from FIPS PUB 180-1)
+ * "abc"
+ * A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D
+ * "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"
+ * 84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1
+ * A million repetitions of "a"
+ * 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F
+ */
+
+#define sha1_description "FIPS 180-1 SHA-1 secure hash algorithm 1."
+#define sha1_options "[+(version)?sha1 (FIPS 180-1) 1996-09-26]\
+ [+(author)?Steve Reid <steve@edmweb.com>]"
+#define sha1_match "sha1|SHA1|sha-1|SHA-1"
+#define sha1_scale 0
+
+#define sha1_padding md5_pad
+
+typedef struct Sha1_s
+{
+ _SUM_PUBLIC_
+ _SUM_PRIVATE_
+ uint32_t count[2];
+ uint32_t state[5];
+ uint8_t buffer[64];
+ uint8_t digest[20];
+ uint8_t digest_sum[20];
+} Sha1_t;
+
+#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits))))
+
+/*
+ * blk0() and blk() perform the initial expand.
+ * I got the idea of expanding during the round function from SSLeay
+ */
+#if _ast_intswap
+# define blk0(i) \
+ (block->l[i] = (rol(block->l[i], 24) & 0xFF00FF00) \
+ | (rol(block->l[i], 8) & 0x00FF00FF))
+#else
+# define blk0(i) block->l[i]
+#endif
+#define blk(i) \
+ (block->l[i & 15] = rol(block->l[(i + 13) & 15] \
+ ^ block->l[(i + 8) & 15] \
+ ^ block->l[(i + 2) & 15] \
+ ^ block->l[i & 15], 1))
+
+/*
+ * (R0+R1), R2, R3, R4 are the different operations (rounds) used in SHA1
+ */
+#define R0(v,w,x,y,z,i) \
+ z += ((w & (x ^ y)) ^ y) + blk0(i) + 0x5A827999 + rol(v, 5); \
+ w = rol(w, 30);
+#define R1(v,w,x,y,z,i) \
+ z += ((w & (x ^ y)) ^ y) + blk(i) + 0x5A827999 + rol(v, 5); \
+ w = rol(w, 30);
+#define R2(v,w,x,y,z,i) \
+ z += (w ^ x ^ y) + blk(i) + 0x6ED9EBA1 + rol(v, 5); \
+ w = rol(w, 30);
+#define R3(v,w,x,y,z,i) \
+ z += (((w | x) & y) | (w & x)) + blk(i) + 0x8F1BBCDC + rol(v, 5); \
+ w = rol(w, 30);
+#define R4(v,w,x,y,z,i) \
+ z += (w ^ x ^ y) + blk(i) + 0xCA62C1D6 + rol(v, 5); \
+ w = rol(w, 30);
+
+typedef union {
+ unsigned char c[64];
+ unsigned int l[16];
+} CHAR64LONG16;
+
+#ifdef __sparc_v9__
+static void do_R01(uint32_t *a, uint32_t *b, uint32_t *c,
+ uint32_t *d, uint32_t *e, CHAR64LONG16 *);
+static void do_R2(uint32_t *a, uint32_t *b, uint32_t *c,
+ uint32_t *d, uint32_t *e, CHAR64LONG16 *);
+static void do_R3(uint32_t *a, uint32_t *b, uint32_t *c,
+ uint32_t *d, uint32_t *e, CHAR64LONG16 *);
+static void do_R4(uint32_t *a, uint32_t *b, uint32_t *c,
+ uint32_t *d, uint32_t *e, CHAR64LONG16 *);
+
+#define nR0(v,w,x,y,z,i) R0(*v,*w,*x,*y,*z,i)
+#define nR1(v,w,x,y,z,i) R1(*v,*w,*x,*y,*z,i)
+#define nR2(v,w,x,y,z,i) R2(*v,*w,*x,*y,*z,i)
+#define nR3(v,w,x,y,z,i) R3(*v,*w,*x,*y,*z,i)
+#define nR4(v,w,x,y,z,i) R4(*v,*w,*x,*y,*z,i)
+
+static void
+do_R01(uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d,
+ uint32_t *e, CHAR64LONG16 *block)
+{
+ nR0(a,b,c,d,e, 0); nR0(e,a,b,c,d, 1); nR0(d,e,a,b,c, 2);
+ nR0(c,d,e,a,b, 3); nR0(b,c,d,e,a, 4); nR0(a,b,c,d,e, 5);
+ nR0(e,a,b,c,d, 6); nR0(d,e,a,b,c, 7); nR0(c,d,e,a,b, 8);
+ nR0(b,c,d,e,a, 9); nR0(a,b,c,d,e,10); nR0(e,a,b,c,d,11);
+ nR0(d,e,a,b,c,12); nR0(c,d,e,a,b,13); nR0(b,c,d,e,a,14);
+ nR0(a,b,c,d,e,15); nR1(e,a,b,c,d,16); nR1(d,e,a,b,c,17);
+ nR1(c,d,e,a,b,18); nR1(b,c,d,e,a,19);
+}
+
+static void
+do_R2(uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d,
+ uint32_t *e, CHAR64LONG16 *block)
+{
+ nR2(a,b,c,d,e,20); nR2(e,a,b,c,d,21); nR2(d,e,a,b,c,22);
+ nR2(c,d,e,a,b,23); nR2(b,c,d,e,a,24); nR2(a,b,c,d,e,25);
+ nR2(e,a,b,c,d,26); nR2(d,e,a,b,c,27); nR2(c,d,e,a,b,28);
+ nR2(b,c,d,e,a,29); nR2(a,b,c,d,e,30); nR2(e,a,b,c,d,31);
+ nR2(d,e,a,b,c,32); nR2(c,d,e,a,b,33); nR2(b,c,d,e,a,34);
+ nR2(a,b,c,d,e,35); nR2(e,a,b,c,d,36); nR2(d,e,a,b,c,37);
+ nR2(c,d,e,a,b,38); nR2(b,c,d,e,a,39);
+}
+
+static void
+do_R3(uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d,
+ uint32_t *e, CHAR64LONG16 *block)
+{
+ nR3(a,b,c,d,e,40); nR3(e,a,b,c,d,41); nR3(d,e,a,b,c,42);
+ nR3(c,d,e,a,b,43); nR3(b,c,d,e,a,44); nR3(a,b,c,d,e,45);
+ nR3(e,a,b,c,d,46); nR3(d,e,a,b,c,47); nR3(c,d,e,a,b,48);
+ nR3(b,c,d,e,a,49); nR3(a,b,c,d,e,50); nR3(e,a,b,c,d,51);
+ nR3(d,e,a,b,c,52); nR3(c,d,e,a,b,53); nR3(b,c,d,e,a,54);
+ nR3(a,b,c,d,e,55); nR3(e,a,b,c,d,56); nR3(d,e,a,b,c,57);
+ nR3(c,d,e,a,b,58); nR3(b,c,d,e,a,59);
+}
+
+static void
+do_R4(uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d,
+ uint32_t *e, CHAR64LONG16 *block)
+{
+ nR4(a,b,c,d,e,60); nR4(e,a,b,c,d,61); nR4(d,e,a,b,c,62);
+ nR4(c,d,e,a,b,63); nR4(b,c,d,e,a,64); nR4(a,b,c,d,e,65);
+ nR4(e,a,b,c,d,66); nR4(d,e,a,b,c,67); nR4(c,d,e,a,b,68);
+ nR4(b,c,d,e,a,69); nR4(a,b,c,d,e,70); nR4(e,a,b,c,d,71);
+ nR4(d,e,a,b,c,72); nR4(c,d,e,a,b,73); nR4(b,c,d,e,a,74);
+ nR4(a,b,c,d,e,75); nR4(e,a,b,c,d,76); nR4(d,e,a,b,c,77);
+ nR4(c,d,e,a,b,78); nR4(b,c,d,e,a,79);
+}
+#endif
+
+/*
+ * Hash a single 512-bit block. This is the core of the algorithm.
+ */
+static void
+sha1_transform(uint32_t state[5], const unsigned char buffer[64]) {
+ uint32_t a, b, c, d, e;
+ CHAR64LONG16 *block;
+ CHAR64LONG16 workspace;
+
+ block = &workspace;
+ (void)memcpy(block, buffer, 64);
+
+ /* Copy sha->state[] to working vars */
+ a = state[0];
+ b = state[1];
+ c = state[2];
+ d = state[3];
+ e = state[4];
+
+#ifdef __sparc_v9__
+ do_R01(&a, &b, &c, &d, &e, block);
+ do_R2(&a, &b, &c, &d, &e, block);
+ do_R3(&a, &b, &c, &d, &e, block);
+ do_R4(&a, &b, &c, &d, &e, block);
+#else
+ /* 4 rounds of 20 operations each. Loop unrolled. */
+ R0(a,b,c,d,e, 0); R0(e,a,b,c,d, 1); R0(d,e,a,b,c, 2); R0(c,d,e,a,b, 3);
+ R0(b,c,d,e,a, 4); R0(a,b,c,d,e, 5); R0(e,a,b,c,d, 6); R0(d,e,a,b,c, 7);
+ R0(c,d,e,a,b, 8); R0(b,c,d,e,a, 9); R0(a,b,c,d,e,10); R0(e,a,b,c,d,11);
+ R0(d,e,a,b,c,12); R0(c,d,e,a,b,13); R0(b,c,d,e,a,14); R0(a,b,c,d,e,15);
+ R1(e,a,b,c,d,16); R1(d,e,a,b,c,17); R1(c,d,e,a,b,18); R1(b,c,d,e,a,19);
+ R2(a,b,c,d,e,20); R2(e,a,b,c,d,21); R2(d,e,a,b,c,22); R2(c,d,e,a,b,23);
+ R2(b,c,d,e,a,24); R2(a,b,c,d,e,25); R2(e,a,b,c,d,26); R2(d,e,a,b,c,27);
+ R2(c,d,e,a,b,28); R2(b,c,d,e,a,29); R2(a,b,c,d,e,30); R2(e,a,b,c,d,31);
+ R2(d,e,a,b,c,32); R2(c,d,e,a,b,33); R2(b,c,d,e,a,34); R2(a,b,c,d,e,35);
+ R2(e,a,b,c,d,36); R2(d,e,a,b,c,37); R2(c,d,e,a,b,38); R2(b,c,d,e,a,39);
+ R3(a,b,c,d,e,40); R3(e,a,b,c,d,41); R3(d,e,a,b,c,42); R3(c,d,e,a,b,43);
+ R3(b,c,d,e,a,44); R3(a,b,c,d,e,45); R3(e,a,b,c,d,46); R3(d,e,a,b,c,47);
+ R3(c,d,e,a,b,48); R3(b,c,d,e,a,49); R3(a,b,c,d,e,50); R3(e,a,b,c,d,51);
+ R3(d,e,a,b,c,52); R3(c,d,e,a,b,53); R3(b,c,d,e,a,54); R3(a,b,c,d,e,55);
+ R3(e,a,b,c,d,56); R3(d,e,a,b,c,57); R3(c,d,e,a,b,58); R3(b,c,d,e,a,59);
+ R4(a,b,c,d,e,60); R4(e,a,b,c,d,61); R4(d,e,a,b,c,62); R4(c,d,e,a,b,63);
+ R4(b,c,d,e,a,64); R4(a,b,c,d,e,65); R4(e,a,b,c,d,66); R4(d,e,a,b,c,67);
+ R4(c,d,e,a,b,68); R4(b,c,d,e,a,69); R4(a,b,c,d,e,70); R4(e,a,b,c,d,71);
+ R4(d,e,a,b,c,72); R4(c,d,e,a,b,73); R4(b,c,d,e,a,74); R4(a,b,c,d,e,75);
+ R4(e,a,b,c,d,76); R4(d,e,a,b,c,77); R4(c,d,e,a,b,78); R4(b,c,d,e,a,79);
+#endif
+
+ /* Add the working vars back into context.state[] */
+ state[0] += a;
+ state[1] += b;
+ state[2] += c;
+ state[3] += d;
+ state[4] += e;
+
+ /* Wipe variables */
+ a = b = c = d = e = 0;
+}
+
+static int
+sha1_block(register Sum_t* p, const void* s, size_t len)
+{
+ Sha1_t* sha = (Sha1_t*)p;
+ uint8_t* data = (uint8_t*)s;
+ unsigned int i, j;
+
+ if (len) {
+ j = sha->count[0];
+ if ((sha->count[0] += len << 3) < j)
+ sha->count[1] += (len >> 29) + 1;
+ j = (j >> 3) & 63;
+ if ((j + len) > 63) {
+ (void)memcpy(&sha->buffer[j], data, (i = 64 - j));
+ sha1_transform(sha->state, sha->buffer);
+ for ( ; i + 63 < len; i += 64)
+ sha1_transform(sha->state, &data[i]);
+ j = 0;
+ } else {
+ i = 0;
+ }
+
+ (void)memcpy(&sha->buffer[j], &data[i], len - i);
+ }
+ return 0;
+}
+
+static int
+sha1_init(Sum_t* p)
+{
+ register Sha1_t* sha = (Sha1_t*)p;
+
+ sha->count[0] = sha->count[1] = 0;
+ sha->state[0] = 0x67452301;
+ sha->state[1] = 0xEFCDAB89;
+ sha->state[2] = 0x98BADCFE;
+ sha->state[3] = 0x10325476;
+ sha->state[4] = 0xC3D2E1F0;
+
+ return 0;
+}
+
+static Sum_t*
+sha1_open(const Method_t* method, const char* name)
+{
+ Sha1_t* sha;
+
+ if (sha = newof(0, Sha1_t, 1, 0))
+ {
+ sha->method = (Method_t*)method;
+ sha->name = name;
+ sha1_init((Sum_t*)sha);
+ }
+ return (Sum_t*)sha;
+}
+
+/*
+ * Add padding and return the message digest.
+ */
+
+static const unsigned char final_200 = 128;
+static const unsigned char final_0 = 0;
+
+static int
+sha1_done(Sum_t* p)
+{
+ Sha1_t* sha = (Sha1_t*)p;
+ unsigned int i;
+ unsigned char finalcount[8];
+
+ for (i = 0; i < 8; i++) {
+ /* Endian independent */
+ finalcount[i] = (unsigned char)
+ ((sha->count[(i >= 4 ? 0 : 1)]
+ >> ((3 - (i & 3)) * 8)) & 255);
+ }
+
+ sha1_block(p, &final_200, 1);
+ while ((sha->count[0] & 504) != 448)
+ sha1_block(p, &final_0, 1);
+ /* The next Update should cause a sha1_transform() */
+ sha1_block(p, finalcount, 8);
+
+ for (i = 0; i < elementsof(sha->digest); i++)
+ {
+ sha->digest[i] = (unsigned char)((sha->state[i >> 2] >> ((3 - (i & 3)) * 8)) & 255);
+ sha->digest_sum[i] ^= sha->digest[i];
+ }
+ memset(sha->count, 0, sizeof(sha->count));
+ memset(sha->state, 0, sizeof(sha->state));
+ memset(sha->buffer, 0, sizeof(sha->buffer));
+ return 0;
+}
+
+static int
+sha1_print(Sum_t* p, Sfio_t* sp, register int flags, size_t scale)
+{
+ register Sha1_t* sha = (Sha1_t*)p;
+ register unsigned char* d;
+ register int n;
+
+ d = (flags & SUM_TOTAL) ? sha->digest_sum : sha->digest;
+ for (n = 0; n < elementsof(sha->digest); n++)
+ sfprintf(sp, "%02x", d[n]);
+ return 0;
+}
+
+static int
+sha1_data(Sum_t* p, Sumdata_t* data)
+{
+ register Sha1_t* sha = (Sha1_t*)p;
+
+ data->size = elementsof(sha->digest);
+ data->num = 0;
+ data->buf = sha->digest;
+ return 0;
+}
diff --git a/usr/src/lib/libsum/common/sum-sha2.c b/usr/src/lib/libsum/common/sum-sha2.c
new file mode 100644
index 0000000000..bfcd31f6ee
--- /dev/null
+++ b/usr/src/lib/libsum/common/sum-sha2.c
@@ -0,0 +1,1248 @@
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1996-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* *
+***********************************************************************/
+#pragma prototyped
+
+#if _typ_int64_t
+
+/*
+ * Aaron D. Gifford's SHA {256,384,512} code transcribed into a -lsum method
+ */
+
+/*
+ * Copyright (c) 2000-2001, Aaron D. Gifford
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holder nor the names of contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTOR(S) ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTOR(S) BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * ASSERT NOTE:
+ * Some sanity checking code is included using assert(). On my FreeBSD
+ * system, this additional code can be removed by compiling with NDEBUG
+ * defined. Check your own systems manpage on assert() to see how to
+ * compile WITHOUT the sanity checking code on your system.
+ *
+ * UNROLLED TRANSFORM LOOP NOTE:
+ * You can define SHA2_UNROLL_TRANSFORM to use the unrolled transform
+ * loop version for the hash transform rounds (defined using macros
+ * later in this file). Either define on the command line, for example:
+ *
+ * cc -DSHA2_UNROLL_TRANSFORM -o sha2 sha2.c sha2prog.c
+ *
+ * or define below:
+ *
+ * #define SHA2_UNROLL_TRANSFORM
+ *
+ */
+
+/*** SHA-256/384/512 Machine Architecture Definitions *****************/
+
+#if _PACKAGE_ast
+
+#ifndef __USE_BSD
+#define __undef__USE_BSD
+#define __USE_BSD
+#endif
+#include <endian.h>
+#ifdef __undef__USE_BSD
+#undef __undef__USE_BSD
+#undef __USE_BSD
+#endif
+
+typedef uint8_t sha2_byte; /* Exactly 1 byte */
+typedef uint32_t sha2_word32; /* Exactly 4 bytes */
+typedef uint64_t sha2_word64; /* Exactly 8 bytes */
+
+#define assert(x)
+
+#undef R
+#undef S32
+#undef S64
+
+#else /* _PACKAGE_ast */
+
+/*
+ * BYTE_ORDER NOTE:
+ *
+ * Please make sure that your system defines BYTE_ORDER. If your
+ * architecture is little-endian, make sure it also defines
+ * LITTLE_ENDIAN and that the two (BYTE_ORDER and LITTLE_ENDIAN) are
+ * equivilent.
+ *
+ * If your system does not define the above, then you can do so by
+ * hand like this:
+ *
+ * #define LITTLE_ENDIAN 1234
+ * #define BIG_ENDIAN 4321
+ *
+ * And for little-endian machines, add:
+ *
+ * #define BYTE_ORDER LITTLE_ENDIAN
+ *
+ * Or for big-endian machines:
+ *
+ * #define BYTE_ORDER BIG_ENDIAN
+ *
+ * The FreeBSD machine this was written on defines BYTE_ORDER
+ * appropriately by including <sys/types.h> (which in turn includes
+ * <machine/endian.h> where the appropriate definitions are actually
+ * made).
+ */
+
+#if !defined(BYTE_ORDER) || (BYTE_ORDER != LITTLE_ENDIAN && BYTE_ORDER != BIG_ENDIAN)
+#error Define BYTE_ORDER to be equal to either LITTLE_ENDIAN or BIG_ENDIAN
+#endif
+
+/*
+ * Define the following sha2_* types to types of the correct length on
+ * the native archtecture. Most BSD systems and Linux define u_intXX_t
+ * types. Machines with very recent ANSI C headers, can use the
+ * uintXX_t definintions from inttypes.h by defining SHA2_USE_INTTYPES_H
+ * during compile or in the sha.h header file.
+ *
+ * Machines that support neither u_intXX_t nor inttypes.h's uintXX_t
+ * will need to define these three typedefs below (and the appropriate
+ * ones in sha.h too) by hand according to their system architecture.
+ *
+ * Thank you, Jun-ichiro itojun Hagino, for suggesting using u_intXX_t
+ * types and pointing out recent ANSI C support for uintXX_t in inttypes.h.
+ */
+
+#ifdef SHA2_USE_INTTYPES_H
+
+typedef uint8_t sha2_byte; /* Exactly 1 byte */
+typedef uint32_t sha2_word32; /* Exactly 4 bytes */
+typedef uint64_t sha2_word64; /* Exactly 8 bytes */
+
+#else /* SHA2_USE_INTTYPES_H */
+
+typedef u_int8_t sha2_byte; /* Exactly 1 byte */
+typedef u_int32_t sha2_word32; /* Exactly 4 bytes */
+typedef u_int64_t sha2_word64; /* Exactly 8 bytes */
+
+#endif /* SHA2_USE_INTTYPES_H */
+
+#endif /* _PACKAGE_ast */
+
+/*** SHA-256/384/512 Various Length Definitions ***********************/
+
+#define SHA256_BLOCK_LENGTH 64
+#define SHA256_DIGEST_LENGTH 32
+#define SHA384_BLOCK_LENGTH 128
+#define SHA384_DIGEST_LENGTH 48
+#define SHA512_BLOCK_LENGTH 128
+#define SHA512_DIGEST_LENGTH 64
+
+#define SHA256_SHORT_BLOCK_LENGTH (SHA256_BLOCK_LENGTH - 8)
+#define SHA384_SHORT_BLOCK_LENGTH (SHA384_BLOCK_LENGTH - 16)
+#define SHA512_SHORT_BLOCK_LENGTH (SHA512_BLOCK_LENGTH - 16)
+
+/*** ENDIAN REVERSAL MACROS *******************************************/
+#if BYTE_ORDER == LITTLE_ENDIAN
+#define REVERSE32(w,x) { \
+ sha2_word32 tmp = (w); \
+ tmp = (tmp >> 16) | (tmp << 16); \
+ (x) = ((tmp & 0xff00ff00UL) >> 8) | ((tmp & 0x00ff00ffUL) << 8); \
+}
+#if _ast_LL
+#define REVERSE64(w,x) { \
+ sha2_word64 tmp = (w); \
+ tmp = (tmp >> 32) | (tmp << 32); \
+ tmp = ((tmp & 0xff00ff00ff00ff00ULL) >> 8) | \
+ ((tmp & 0x00ff00ff00ff00ffULL) << 8); \
+ (x) = ((tmp & 0xffff0000ffff0000ULL) >> 16) | \
+ ((tmp & 0x0000ffff0000ffffULL) << 16); \
+}
+#else
+#define REVERSE64(w,x) { \
+ sha2_word64 tmp = (w); \
+ tmp = (tmp >> 32) | (tmp << 32); \
+ tmp = ((tmp & ((sha2_word64)0xff00ff00ff00ff00)) >> 8) | \
+ ((tmp & ((sha2_word64)0x00ff00ff00ff00ff)) << 8); \
+ (x) = ((tmp & ((sha2_word64)0xffff0000ffff0000)) >> 16) | \
+ ((tmp & ((sha2_word64)0x0000ffff0000ffff)) << 16); \
+}
+#endif
+#endif /* BYTE_ORDER == LITTLE_ENDIAN */
+
+/*
+ * Macro for incrementally adding the unsigned 64-bit integer n to the
+ * unsigned 128-bit integer (represented using a two-element array of
+ * 64-bit words):
+ */
+
+#define ADDINC128(w,n) { \
+ (w)[0] += (sha2_word64)(n); \
+ if ((w)[0] < (n)) { \
+ (w)[1]++; \
+ } \
+}
+
+/*
+ * Macros for copying blocks of memory and for zeroing out ranges
+ * of memory. Using these macros makes it easy to switch from
+ * using memset()/memcpy() and using bzero()/bcopy().
+ *
+ * Please define either SHA2_USE_MEMSET_MEMCPY or define
+ * SHA2_USE_BZERO_BCOPY depending on which function set you
+ * choose to use:
+ */
+
+#if !defined(SHA2_USE_MEMSET_MEMCPY) && !defined(SHA2_USE_BZERO_BCOPY)
+/* Default to memset()/memcpy() if no option is specified */
+#define SHA2_USE_MEMSET_MEMCPY 1
+#endif
+#if defined(SHA2_USE_MEMSET_MEMCPY) && defined(SHA2_USE_BZERO_BCOPY)
+/* Abort with an error if BOTH options are defined */
+#error Define either SHA2_USE_MEMSET_MEMCPY or SHA2_USE_BZERO_BCOPY, not both!
+#endif
+
+#ifdef SHA2_USE_MEMSET_MEMCPY
+#define MEMSET_BZERO(p,l) memset((p), 0, (l))
+#define MEMCPY_BCOPY(d,s,l) memcpy((d), (s), (l))
+#endif
+#ifdef SHA2_USE_BZERO_BCOPY
+#define MEMSET_BZERO(p,l) bzero((p), (l))
+#define MEMCPY_BCOPY(d,s,l) bcopy((s), (d), (l))
+#endif
+
+
+/*** THE SIX LOGICAL FUNCTIONS ****************************************/
+/*
+ * Bit shifting and rotation (used by the six SHA-XYZ logical functions:
+ *
+ * NOTE: The naming of R and S appears backwards here (R is a SHIFT and
+ * S is a ROTATION) because the SHA-256/384/512 description document
+ * (see http://csrc.nist.gov/cryptval/shs/sha256-384-512.pdf) uses this
+ * same "backwards" definition.
+ */
+
+/* Shift-right (used in SHA-256, SHA-384, and SHA-512): */
+#define R(b,x) ((x) >> (b))
+/* 32-bit Rotate-right (used in SHA-256): */
+#define S32(b,x) (((x) >> (b)) | ((x) << (32 - (b))))
+/* 64-bit Rotate-right (used in SHA-384 and SHA-512): */
+#define S64(b,x) (((x) >> (b)) | ((x) << (64 - (b))))
+
+/* Two of six logical functions used in SHA-256, SHA-384, and SHA-512: */
+#define Ch(x,y,z) (((x) & (y)) ^ ((~(x)) & (z)))
+#define Maj(x,y,z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z)))
+
+/* Four of six logical functions used in SHA-256: */
+#define Sigma0_256(x) (S32(2, (x)) ^ S32(13, (x)) ^ S32(22, (x)))
+#define Sigma1_256(x) (S32(6, (x)) ^ S32(11, (x)) ^ S32(25, (x)))
+#define sigma0_256(x) (S32(7, (x)) ^ S32(18, (x)) ^ R(3 , (x)))
+#define sigma1_256(x) (S32(17, (x)) ^ S32(19, (x)) ^ R(10, (x)))
+
+/* Four of six logical functions used in SHA-384 and SHA-512: */
+#define Sigma0_512(x) (S64(28, (x)) ^ S64(34, (x)) ^ S64(39, (x)))
+#define Sigma1_512(x) (S64(14, (x)) ^ S64(18, (x)) ^ S64(41, (x)))
+#define sigma0_512(x) (S64( 1, (x)) ^ S64( 8, (x)) ^ R( 7, (x)))
+#define sigma1_512(x) (S64(19, (x)) ^ S64(61, (x)) ^ R( 6, (x)))
+
+/*** SHA-XYZ INITIAL HASH VALUES AND CONSTANTS ************************/
+/* Hash constant words K for SHA-256: */
+static const sha2_word32 K256[64] = {
+ 0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL,
+ 0x3956c25bUL, 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL,
+ 0xd807aa98UL, 0x12835b01UL, 0x243185beUL, 0x550c7dc3UL,
+ 0x72be5d74UL, 0x80deb1feUL, 0x9bdc06a7UL, 0xc19bf174UL,
+ 0xe49b69c1UL, 0xefbe4786UL, 0x0fc19dc6UL, 0x240ca1ccUL,
+ 0x2de92c6fUL, 0x4a7484aaUL, 0x5cb0a9dcUL, 0x76f988daUL,
+ 0x983e5152UL, 0xa831c66dUL, 0xb00327c8UL, 0xbf597fc7UL,
+ 0xc6e00bf3UL, 0xd5a79147UL, 0x06ca6351UL, 0x14292967UL,
+ 0x27b70a85UL, 0x2e1b2138UL, 0x4d2c6dfcUL, 0x53380d13UL,
+ 0x650a7354UL, 0x766a0abbUL, 0x81c2c92eUL, 0x92722c85UL,
+ 0xa2bfe8a1UL, 0xa81a664bUL, 0xc24b8b70UL, 0xc76c51a3UL,
+ 0xd192e819UL, 0xd6990624UL, 0xf40e3585UL, 0x106aa070UL,
+ 0x19a4c116UL, 0x1e376c08UL, 0x2748774cUL, 0x34b0bcb5UL,
+ 0x391c0cb3UL, 0x4ed8aa4aUL, 0x5b9cca4fUL, 0x682e6ff3UL,
+ 0x748f82eeUL, 0x78a5636fUL, 0x84c87814UL, 0x8cc70208UL,
+ 0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL
+};
+
+/* Initial hash value H for SHA-256: */
+static const sha2_word32 sha256_initial_hash_value[8] = {
+ 0x6a09e667UL,
+ 0xbb67ae85UL,
+ 0x3c6ef372UL,
+ 0xa54ff53aUL,
+ 0x510e527fUL,
+ 0x9b05688cUL,
+ 0x1f83d9abUL,
+ 0x5be0cd19UL
+};
+
+/* Hash constant words K for SHA-384 and SHA-512: */
+static const sha2_word64 K512[80] = {
+#if _ast_LL
+ 0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL,
+ 0xb5c0fbcfec4d3b2fULL, 0xe9b5dba58189dbbcULL,
+ 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL,
+ 0x923f82a4af194f9bULL, 0xab1c5ed5da6d8118ULL,
+ 0xd807aa98a3030242ULL, 0x12835b0145706fbeULL,
+ 0x243185be4ee4b28cULL, 0x550c7dc3d5ffb4e2ULL,
+ 0x72be5d74f27b896fULL, 0x80deb1fe3b1696b1ULL,
+ 0x9bdc06a725c71235ULL, 0xc19bf174cf692694ULL,
+ 0xe49b69c19ef14ad2ULL, 0xefbe4786384f25e3ULL,
+ 0x0fc19dc68b8cd5b5ULL, 0x240ca1cc77ac9c65ULL,
+ 0x2de92c6f592b0275ULL, 0x4a7484aa6ea6e483ULL,
+ 0x5cb0a9dcbd41fbd4ULL, 0x76f988da831153b5ULL,
+ 0x983e5152ee66dfabULL, 0xa831c66d2db43210ULL,
+ 0xb00327c898fb213fULL, 0xbf597fc7beef0ee4ULL,
+ 0xc6e00bf33da88fc2ULL, 0xd5a79147930aa725ULL,
+ 0x06ca6351e003826fULL, 0x142929670a0e6e70ULL,
+ 0x27b70a8546d22ffcULL, 0x2e1b21385c26c926ULL,
+ 0x4d2c6dfc5ac42aedULL, 0x53380d139d95b3dfULL,
+ 0x650a73548baf63deULL, 0x766a0abb3c77b2a8ULL,
+ 0x81c2c92e47edaee6ULL, 0x92722c851482353bULL,
+ 0xa2bfe8a14cf10364ULL, 0xa81a664bbc423001ULL,
+ 0xc24b8b70d0f89791ULL, 0xc76c51a30654be30ULL,
+ 0xd192e819d6ef5218ULL, 0xd69906245565a910ULL,
+ 0xf40e35855771202aULL, 0x106aa07032bbd1b8ULL,
+ 0x19a4c116b8d2d0c8ULL, 0x1e376c085141ab53ULL,
+ 0x2748774cdf8eeb99ULL, 0x34b0bcb5e19b48a8ULL,
+ 0x391c0cb3c5c95a63ULL, 0x4ed8aa4ae3418acbULL,
+ 0x5b9cca4f7763e373ULL, 0x682e6ff3d6b2b8a3ULL,
+ 0x748f82ee5defb2fcULL, 0x78a5636f43172f60ULL,
+ 0x84c87814a1f0ab72ULL, 0x8cc702081a6439ecULL,
+ 0x90befffa23631e28ULL, 0xa4506cebde82bde9ULL,
+ 0xbef9a3f7b2c67915ULL, 0xc67178f2e372532bULL,
+ 0xca273eceea26619cULL, 0xd186b8c721c0c207ULL,
+ 0xeada7dd6cde0eb1eULL, 0xf57d4f7fee6ed178ULL,
+ 0x06f067aa72176fbaULL, 0x0a637dc5a2c898a6ULL,
+ 0x113f9804bef90daeULL, 0x1b710b35131c471bULL,
+ 0x28db77f523047d84ULL, 0x32caab7b40c72493ULL,
+ 0x3c9ebe0a15c9bebcULL, 0x431d67c49c100d4cULL,
+ 0x4cc5d4becb3e42b6ULL, 0x597f299cfc657e2aULL,
+ 0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL
+#else
+ ((sha2_word64)0x428a2f98d728ae22), ((sha2_word64)0x7137449123ef65cd),
+ ((sha2_word64)0xb5c0fbcfec4d3b2f), ((sha2_word64)0xe9b5dba58189dbbc),
+ ((sha2_word64)0x3956c25bf348b538), ((sha2_word64)0x59f111f1b605d019),
+ ((sha2_word64)0x923f82a4af194f9b), ((sha2_word64)0xab1c5ed5da6d8118),
+ ((sha2_word64)0xd807aa98a3030242), ((sha2_word64)0x12835b0145706fbe),
+ ((sha2_word64)0x243185be4ee4b28c), ((sha2_word64)0x550c7dc3d5ffb4e2),
+ ((sha2_word64)0x72be5d74f27b896f), ((sha2_word64)0x80deb1fe3b1696b1),
+ ((sha2_word64)0x9bdc06a725c71235), ((sha2_word64)0xc19bf174cf692694),
+ ((sha2_word64)0xe49b69c19ef14ad2), ((sha2_word64)0xefbe4786384f25e3),
+ ((sha2_word64)0x0fc19dc68b8cd5b5), ((sha2_word64)0x240ca1cc77ac9c65),
+ ((sha2_word64)0x2de92c6f592b0275), ((sha2_word64)0x4a7484aa6ea6e483),
+ ((sha2_word64)0x5cb0a9dcbd41fbd4), ((sha2_word64)0x76f988da831153b5),
+ ((sha2_word64)0x983e5152ee66dfab), ((sha2_word64)0xa831c66d2db43210),
+ ((sha2_word64)0xb00327c898fb213f), ((sha2_word64)0xbf597fc7beef0ee4),
+ ((sha2_word64)0xc6e00bf33da88fc2), ((sha2_word64)0xd5a79147930aa725),
+ ((sha2_word64)0x06ca6351e003826f), ((sha2_word64)0x142929670a0e6e70),
+ ((sha2_word64)0x27b70a8546d22ffc), ((sha2_word64)0x2e1b21385c26c926),
+ ((sha2_word64)0x4d2c6dfc5ac42aed), ((sha2_word64)0x53380d139d95b3df),
+ ((sha2_word64)0x650a73548baf63de), ((sha2_word64)0x766a0abb3c77b2a8),
+ ((sha2_word64)0x81c2c92e47edaee6), ((sha2_word64)0x92722c851482353b),
+ ((sha2_word64)0xa2bfe8a14cf10364), ((sha2_word64)0xa81a664bbc423001),
+ ((sha2_word64)0xc24b8b70d0f89791), ((sha2_word64)0xc76c51a30654be30),
+ ((sha2_word64)0xd192e819d6ef5218), ((sha2_word64)0xd69906245565a910),
+ ((sha2_word64)0xf40e35855771202a), ((sha2_word64)0x106aa07032bbd1b8),
+ ((sha2_word64)0x19a4c116b8d2d0c8), ((sha2_word64)0x1e376c085141ab53),
+ ((sha2_word64)0x2748774cdf8eeb99), ((sha2_word64)0x34b0bcb5e19b48a8),
+ ((sha2_word64)0x391c0cb3c5c95a63), ((sha2_word64)0x4ed8aa4ae3418acb),
+ ((sha2_word64)0x5b9cca4f7763e373), ((sha2_word64)0x682e6ff3d6b2b8a3),
+ ((sha2_word64)0x748f82ee5defb2fc), ((sha2_word64)0x78a5636f43172f60),
+ ((sha2_word64)0x84c87814a1f0ab72), ((sha2_word64)0x8cc702081a6439ec),
+ ((sha2_word64)0x90befffa23631e28), ((sha2_word64)0xa4506cebde82bde9),
+ ((sha2_word64)0xbef9a3f7b2c67915), ((sha2_word64)0xc67178f2e372532b),
+ ((sha2_word64)0xca273eceea26619c), ((sha2_word64)0xd186b8c721c0c207),
+ ((sha2_word64)0xeada7dd6cde0eb1e), ((sha2_word64)0xf57d4f7fee6ed178),
+ ((sha2_word64)0x06f067aa72176fba), ((sha2_word64)0x0a637dc5a2c898a6),
+ ((sha2_word64)0x113f9804bef90dae), ((sha2_word64)0x1b710b35131c471b),
+ ((sha2_word64)0x28db77f523047d84), ((sha2_word64)0x32caab7b40c72493),
+ ((sha2_word64)0x3c9ebe0a15c9bebc), ((sha2_word64)0x431d67c49c100d4c),
+ ((sha2_word64)0x4cc5d4becb3e42b6), ((sha2_word64)0x597f299cfc657e2a),
+ ((sha2_word64)0x5fcb6fab3ad6faec), ((sha2_word64)0x6c44198c4a475817)
+#endif
+};
+
+/* Initial hash value H for SHA-384 */
+static const sha2_word64 sha384_initial_hash_value[8] = {
+#if _ast_LL
+ 0xcbbb9d5dc1059ed8ULL,
+ 0x629a292a367cd507ULL,
+ 0x9159015a3070dd17ULL,
+ 0x152fecd8f70e5939ULL,
+ 0x67332667ffc00b31ULL,
+ 0x8eb44a8768581511ULL,
+ 0xdb0c2e0d64f98fa7ULL,
+ 0x47b5481dbefa4fa4ULL
+#else
+ ((sha2_word64)0xcbbb9d5dc1059ed8),
+ ((sha2_word64)0x629a292a367cd507),
+ ((sha2_word64)0x9159015a3070dd17),
+ ((sha2_word64)0x152fecd8f70e5939),
+ ((sha2_word64)0x67332667ffc00b31),
+ ((sha2_word64)0x8eb44a8768581511),
+ ((sha2_word64)0xdb0c2e0d64f98fa7),
+ ((sha2_word64)0x47b5481dbefa4fa4)
+#endif
+};
+
+/* Initial hash value H for SHA-512 */
+static const sha2_word64 sha512_initial_hash_value[8] = {
+#if _ast_LL
+ 0x6a09e667f3bcc908ULL,
+ 0xbb67ae8584caa73bULL,
+ 0x3c6ef372fe94f82bULL,
+ 0xa54ff53a5f1d36f1ULL,
+ 0x510e527fade682d1ULL,
+ 0x9b05688c2b3e6c1fULL,
+ 0x1f83d9abfb41bd6bULL,
+ 0x5be0cd19137e2179ULL
+#else
+ ((sha2_word64)0x6a09e667f3bcc908),
+ ((sha2_word64)0xbb67ae8584caa73b),
+ ((sha2_word64)0x3c6ef372fe94f82b),
+ ((sha2_word64)0xa54ff53a5f1d36f1),
+ ((sha2_word64)0x510e527fade682d1),
+ ((sha2_word64)0x9b05688c2b3e6c1f),
+ ((sha2_word64)0x1f83d9abfb41bd6b),
+ ((sha2_word64)0x5be0cd19137e2179)
+#endif
+};
+
+/*** SHA-256: *********************************************************/
+
+#define sha256_description "FIPS SHA-256 secure hash algorithm."
+#define sha256_options "\
+[+(version)?sha-256 (FIPS) 2000-01-01]\
+[+(author)?Aaron D. Gifford]\
+"
+#define sha256_match "sha256|sha-256|SHA256|SHA-256"
+#define sha256_scale 0
+
+#define sha256_padding md5_pad
+
+#define SHA256_CTX Sha256_t
+
+typedef struct Sha256_s
+{
+ _SUM_PUBLIC_
+ _SUM_PRIVATE_
+ sha2_byte digest[SHA256_DIGEST_LENGTH];
+ sha2_byte digest_sum[SHA256_DIGEST_LENGTH];
+ sha2_word32 state[8];
+ sha2_word64 bitcount;
+ sha2_byte buffer[SHA256_BLOCK_LENGTH];
+} Sha256_t;
+
+#ifdef SHA2_UNROLL_TRANSFORM
+
+/* Unrolled SHA-256 round macros: */
+
+#if BYTE_ORDER == LITTLE_ENDIAN
+
+#define ROUND256_0_TO_15(a,b,c,d,e,f,g,h) \
+ REVERSE32(*data++, W256[j]); \
+ T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + \
+ K256[j] + W256[j]; \
+ (d) += T1; \
+ (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \
+ j++
+
+
+#else /* BYTE_ORDER == LITTLE_ENDIAN */
+
+#define ROUND256_0_TO_15(a,b,c,d,e,f,g,h) \
+ T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + \
+ K256[j] + (W256[j] = *data++); \
+ (d) += T1; \
+ (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \
+ j++
+
+#endif /* BYTE_ORDER == LITTLE_ENDIAN */
+
+#define ROUND256(a,b,c,d,e,f,g,h) \
+ s0 = W256[(j+1)&0x0f]; \
+ s0 = sigma0_256(s0); \
+ s1 = W256[(j+14)&0x0f]; \
+ s1 = sigma1_256(s1); \
+ T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + K256[j] + \
+ (W256[j&0x0f] += s1 + W256[(j+9)&0x0f] + s0); \
+ (d) += T1; \
+ (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \
+ j++
+
+static void SHA256_Transform(SHA256_CTX* sha, const sha2_word32* data) {
+ sha2_word32 a, b, c, d, e, f, g, h, s0, s1;
+ sha2_word32 T1, *W256;
+ int j;
+
+ W256 = (sha2_word32*)sha->buffer;
+
+ /* Initialize registers with the prev. intermediate value */
+ a = sha->state[0];
+ b = sha->state[1];
+ c = sha->state[2];
+ d = sha->state[3];
+ e = sha->state[4];
+ f = sha->state[5];
+ g = sha->state[6];
+ h = sha->state[7];
+
+ j = 0;
+ do {
+ /* Rounds 0 to 15 (unrolled): */
+ ROUND256_0_TO_15(a,b,c,d,e,f,g,h);
+ ROUND256_0_TO_15(h,a,b,c,d,e,f,g);
+ ROUND256_0_TO_15(g,h,a,b,c,d,e,f);
+ ROUND256_0_TO_15(f,g,h,a,b,c,d,e);
+ ROUND256_0_TO_15(e,f,g,h,a,b,c,d);
+ ROUND256_0_TO_15(d,e,f,g,h,a,b,c);
+ ROUND256_0_TO_15(c,d,e,f,g,h,a,b);
+ ROUND256_0_TO_15(b,c,d,e,f,g,h,a);
+ } while (j < 16);
+
+ /* Now for the remaining rounds to 64: */
+ do {
+ ROUND256(a,b,c,d,e,f,g,h);
+ ROUND256(h,a,b,c,d,e,f,g);
+ ROUND256(g,h,a,b,c,d,e,f);
+ ROUND256(f,g,h,a,b,c,d,e);
+ ROUND256(e,f,g,h,a,b,c,d);
+ ROUND256(d,e,f,g,h,a,b,c);
+ ROUND256(c,d,e,f,g,h,a,b);
+ ROUND256(b,c,d,e,f,g,h,a);
+ } while (j < 64);
+
+ /* Compute the current intermediate hash value */
+ sha->state[0] += a;
+ sha->state[1] += b;
+ sha->state[2] += c;
+ sha->state[3] += d;
+ sha->state[4] += e;
+ sha->state[5] += f;
+ sha->state[6] += g;
+ sha->state[7] += h;
+
+ /* Clean up */
+ a = b = c = d = e = f = g = h = T1 = 0;
+}
+
+#else /* SHA2_UNROLL_TRANSFORM */
+
+static void SHA256_Transform(SHA256_CTX* sha, const sha2_word32* data) {
+ sha2_word32 a, b, c, d, e, f, g, h, s0, s1;
+ sha2_word32 T1, T2, *W256;
+ int j;
+
+ W256 = (sha2_word32*)sha->buffer;
+
+ /* Initialize registers with the prev. intermediate value */
+ a = sha->state[0];
+ b = sha->state[1];
+ c = sha->state[2];
+ d = sha->state[3];
+ e = sha->state[4];
+ f = sha->state[5];
+ g = sha->state[6];
+ h = sha->state[7];
+
+ j = 0;
+ do {
+#if BYTE_ORDER == LITTLE_ENDIAN
+ /* Copy data while converting to host byte order */
+ REVERSE32(*data++,W256[j]);
+ /* Apply the SHA-256 compression function to update a..h */
+ T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + W256[j];
+#else /* BYTE_ORDER == LITTLE_ENDIAN */
+ /* Apply the SHA-256 compression function to update a..h with copy */
+ T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + (W256[j] = *data++);
+#endif /* BYTE_ORDER == LITTLE_ENDIAN */
+ T2 = Sigma0_256(a) + Maj(a, b, c);
+ h = g;
+ g = f;
+ f = e;
+ e = d + T1;
+ d = c;
+ c = b;
+ b = a;
+ a = T1 + T2;
+
+ j++;
+ } while (j < 16);
+
+ do {
+ /* Part of the message block expansion: */
+ s0 = W256[(j+1)&0x0f];
+ s0 = sigma0_256(s0);
+ s1 = W256[(j+14)&0x0f];
+ s1 = sigma1_256(s1);
+
+ /* Apply the SHA-256 compression function to update a..h */
+ T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] +
+ (W256[j&0x0f] += s1 + W256[(j+9)&0x0f] + s0);
+ T2 = Sigma0_256(a) + Maj(a, b, c);
+ h = g;
+ g = f;
+ f = e;
+ e = d + T1;
+ d = c;
+ c = b;
+ b = a;
+ a = T1 + T2;
+
+ j++;
+ } while (j < 64);
+
+ /* Compute the current intermediate hash value */
+ sha->state[0] += a;
+ sha->state[1] += b;
+ sha->state[2] += c;
+ sha->state[3] += d;
+ sha->state[4] += e;
+ sha->state[5] += f;
+ sha->state[6] += g;
+ sha->state[7] += h;
+
+ /* Clean up */
+ a = b = c = d = e = f = g = h = T1 = T2 = 0;
+}
+
+#endif /* SHA2_UNROLL_TRANSFORM */
+
+static int
+sha256_block(register Sum_t* p, const void* s, size_t len)
+{
+ Sha256_t* sha = (Sha256_t*)p;
+ sha2_byte* data = (sha2_byte*)s;
+ unsigned int freespace, usedspace;
+
+ if (!len)
+ return 0;
+ usedspace = (sha->bitcount >> 3) % SHA256_BLOCK_LENGTH;
+ if (usedspace > 0) {
+ /* Calculate how much free space is available in the buffer */
+ freespace = SHA256_BLOCK_LENGTH - usedspace;
+
+ if (len >= freespace) {
+ /* Fill the buffer completely and process it */
+ MEMCPY_BCOPY(&sha->buffer[usedspace], data, freespace);
+ sha->bitcount += freespace << 3;
+ len -= freespace;
+ data += freespace;
+ SHA256_Transform(sha, (sha2_word32*)sha->buffer);
+ } else {
+ /* The buffer is not yet full */
+ MEMCPY_BCOPY(&sha->buffer[usedspace], data, len);
+ sha->bitcount += len << 3;
+ /* Clean up: */
+ usedspace = freespace = 0;
+ return 0;
+ }
+ }
+ while (len >= SHA256_BLOCK_LENGTH) {
+ /* Process as many complete blocks as we can */
+ SHA256_Transform(sha, (sha2_word32*)data);
+ sha->bitcount += SHA256_BLOCK_LENGTH << 3;
+ len -= SHA256_BLOCK_LENGTH;
+ data += SHA256_BLOCK_LENGTH;
+ }
+ if (len > 0) {
+ /* There's left-overs, so save 'em */
+ MEMCPY_BCOPY(sha->buffer, data, len);
+ sha->bitcount += len << 3;
+ }
+ /* Clean up: */
+ usedspace = freespace = 0;
+
+ return 0;
+}
+
+static int
+sha256_init(Sum_t* p)
+{
+ register Sha256_t* sha = (Sha256_t*)p;
+
+ MEMCPY_BCOPY(sha->state, sha256_initial_hash_value, SHA256_DIGEST_LENGTH);
+ MEMSET_BZERO(sha->buffer, SHA256_BLOCK_LENGTH);
+ sha->bitcount = 0;
+
+ return 0;
+}
+
+static Sum_t*
+sha256_open(const Method_t* method, const char* name)
+{
+ Sha256_t* sha;
+
+ if (sha = newof(0, Sha256_t, 1, 0))
+ {
+ sha->method = (Method_t*)method;
+ sha->name = name;
+ sha256_init((Sum_t*)sha);
+ }
+ return (Sum_t*)sha;
+}
+
+static int
+sha256_done(Sum_t* p)
+{
+ Sha256_t* sha = (Sha256_t*)p;
+ unsigned int usedspace;
+ register int i;
+
+ /* Sanity check: */
+ assert(sha != (SHA256_CTX*)0);
+
+ usedspace = (sha->bitcount >> 3) % SHA256_BLOCK_LENGTH;
+#if BYTE_ORDER == LITTLE_ENDIAN
+ /* Convert FROM host byte order */
+ REVERSE64(sha->bitcount,sha->bitcount);
+#endif
+ if (usedspace > 0) {
+ /* Begin padding with a 1 bit: */
+ sha->buffer[usedspace++] = 0x80;
+
+ if (usedspace <= SHA256_SHORT_BLOCK_LENGTH) {
+ /* Set-up for the last transform: */
+ MEMSET_BZERO(&sha->buffer[usedspace], SHA256_SHORT_BLOCK_LENGTH - usedspace);
+ } else {
+ if (usedspace < SHA256_BLOCK_LENGTH) {
+ MEMSET_BZERO(&sha->buffer[usedspace], SHA256_BLOCK_LENGTH - usedspace);
+ }
+ /* Do second-to-last transform: */
+ SHA256_Transform(sha, (sha2_word32*)sha->buffer);
+
+ /* And set-up for the last transform: */
+ MEMSET_BZERO(sha->buffer, SHA256_SHORT_BLOCK_LENGTH);
+ }
+ } else {
+ /* Set-up for the last transform: */
+ MEMSET_BZERO(sha->buffer, SHA256_SHORT_BLOCK_LENGTH);
+
+ /* Begin padding with a 1 bit: */
+ *sha->buffer = 0x80;
+ }
+ /* Set the bit count: */
+ *(sha2_word64*)&sha->buffer[SHA256_SHORT_BLOCK_LENGTH] = sha->bitcount;
+
+ /* Final transform: */
+ SHA256_Transform(sha, (sha2_word32*)sha->buffer);
+
+#if BYTE_ORDER == LITTLE_ENDIAN
+ {
+ /* Convert TO host byte order */
+ int j;
+ sha2_word32* d = (sha2_word32*)sha->digest;
+ for (j = 0; j < 8; j++) {
+ REVERSE32(sha->state[j],sha->state[j]);
+ *d++ = sha->state[j];
+ }
+ }
+#else
+ MEMCPY_BCOPY(sha->digest, sha->state, SHA256_DIGEST_LENGTH);
+#endif
+
+ /* accumulate the digests */
+ for (i = 0; i < SHA256_DIGEST_LENGTH; i++)
+ sha->digest_sum[i] ^= sha->digest[i];
+
+ /* Clean up state data: */
+ MEMSET_BZERO(&sha->state, sizeof(*sha) - offsetof(Sha256_t, state));
+ usedspace = 0;
+
+ return 0;
+}
+
+static int
+sha256_print(Sum_t* p, Sfio_t* sp, register int flags, size_t scale)
+{
+ register Sha256_t* sha = (Sha256_t*)p;
+ register sha2_byte* d;
+ register sha2_byte* e;
+
+ d = (flags & SUM_TOTAL) ? sha->digest_sum : sha->digest;
+ e = d + SHA256_DIGEST_LENGTH;
+ while (d < e)
+ sfprintf(sp, "%02x", *d++);
+ return 0;
+}
+
+static int
+sha256_data(Sum_t* p, Sumdata_t* data)
+{
+ register Sha256_t* sha = (Sha256_t*)p;
+
+ data->size = SHA256_DIGEST_LENGTH;
+ data->num = 0;
+ data->buf = sha->digest;
+ return 0;
+}
+
+/*** SHA-512: *********************************************************/
+
+#define sha512_description "FIPS SHA-512 secure hash algorithm."
+#define sha512_options "\
+[+(version)?sha-512 (FIPS) 2000-01-01]\
+[+(author)?Aaron D. Gifford]\
+"
+#define sha512_match "sha512|sha-512|SHA512|SHA-512"
+#define sha512_scale 0
+
+#define sha512_padding md5_pad
+
+#define SHA512_CTX Sha512_t
+
+typedef struct Sha512_s
+{
+ _SUM_PUBLIC_
+ _SUM_PRIVATE_
+ sha2_byte digest[SHA512_DIGEST_LENGTH];
+ sha2_byte digest_sum[SHA512_DIGEST_LENGTH];
+ sha2_word64 state[8];
+ sha2_word64 bitcount[2];
+ sha2_byte buffer[SHA512_BLOCK_LENGTH];
+} Sha512_t;
+
+#ifdef SHA2_UNROLL_TRANSFORM
+
+/* Unrolled SHA-512 round macros: */
+#if BYTE_ORDER == LITTLE_ENDIAN
+
+#define ROUND512_0_TO_15(a,b,c,d,e,f,g,h) \
+ REVERSE64(*data++, W512[j]); \
+ T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + \
+ K512[j] + W512[j]; \
+ (d) += T1, \
+ (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)), \
+ j++
+
+
+#else /* BYTE_ORDER == LITTLE_ENDIAN */
+
+#define ROUND512_0_TO_15(a,b,c,d,e,f,g,h) \
+ T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + \
+ K512[j] + (W512[j] = *data++); \
+ (d) += T1; \
+ (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)); \
+ j++
+
+#endif /* BYTE_ORDER == LITTLE_ENDIAN */
+
+#define ROUND512(a,b,c,d,e,f,g,h) \
+ s0 = W512[(j+1)&0x0f]; \
+ s0 = sigma0_512(s0); \
+ s1 = W512[(j+14)&0x0f]; \
+ s1 = sigma1_512(s1); \
+ T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + K512[j] + \
+ (W512[j&0x0f] += s1 + W512[(j+9)&0x0f] + s0); \
+ (d) += T1; \
+ (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)); \
+ j++
+
+static void SHA512_Transform(SHA512_CTX* sha, const sha2_word64* data) {
+ sha2_word64 a, b, c, d, e, f, g, h, s0, s1;
+ sha2_word64 T1, *W512 = (sha2_word64*)sha->buffer;
+ int j;
+
+ /* Initialize registers with the prev. intermediate value */
+ a = sha->state[0];
+ b = sha->state[1];
+ c = sha->state[2];
+ d = sha->state[3];
+ e = sha->state[4];
+ f = sha->state[5];
+ g = sha->state[6];
+ h = sha->state[7];
+
+ j = 0;
+ do {
+ ROUND512_0_TO_15(a,b,c,d,e,f,g,h);
+ ROUND512_0_TO_15(h,a,b,c,d,e,f,g);
+ ROUND512_0_TO_15(g,h,a,b,c,d,e,f);
+ ROUND512_0_TO_15(f,g,h,a,b,c,d,e);
+ ROUND512_0_TO_15(e,f,g,h,a,b,c,d);
+ ROUND512_0_TO_15(d,e,f,g,h,a,b,c);
+ ROUND512_0_TO_15(c,d,e,f,g,h,a,b);
+ ROUND512_0_TO_15(b,c,d,e,f,g,h,a);
+ } while (j < 16);
+
+ /* Now for the remaining rounds up to 79: */
+ do {
+ ROUND512(a,b,c,d,e,f,g,h);
+ ROUND512(h,a,b,c,d,e,f,g);
+ ROUND512(g,h,a,b,c,d,e,f);
+ ROUND512(f,g,h,a,b,c,d,e);
+ ROUND512(e,f,g,h,a,b,c,d);
+ ROUND512(d,e,f,g,h,a,b,c);
+ ROUND512(c,d,e,f,g,h,a,b);
+ ROUND512(b,c,d,e,f,g,h,a);
+ } while (j < 80);
+
+ /* Compute the current intermediate hash value */
+ sha->state[0] += a;
+ sha->state[1] += b;
+ sha->state[2] += c;
+ sha->state[3] += d;
+ sha->state[4] += e;
+ sha->state[5] += f;
+ sha->state[6] += g;
+ sha->state[7] += h;
+
+ /* Clean up */
+ a = b = c = d = e = f = g = h = T1 = 0;
+}
+
+#else /* SHA2_UNROLL_TRANSFORM */
+
+static void SHA512_Transform(SHA512_CTX* sha, const sha2_word64* data) {
+ sha2_word64 a, b, c, d, e, f, g, h, s0, s1;
+ sha2_word64 T1, T2, *W512 = (sha2_word64*)sha->buffer;
+ int j;
+
+ /* Initialize registers with the prev. intermediate value */
+ a = sha->state[0];
+ b = sha->state[1];
+ c = sha->state[2];
+ d = sha->state[3];
+ e = sha->state[4];
+ f = sha->state[5];
+ g = sha->state[6];
+ h = sha->state[7];
+
+ j = 0;
+ do {
+#if BYTE_ORDER == LITTLE_ENDIAN
+ /* Convert TO host byte order */
+ REVERSE64(*data++, W512[j]);
+ /* Apply the SHA-512 compression function to update a..h */
+ T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + W512[j];
+#else /* BYTE_ORDER == LITTLE_ENDIAN */
+ /* Apply the SHA-512 compression function to update a..h with copy */
+ T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + (W512[j] = *data++);
+#endif /* BYTE_ORDER == LITTLE_ENDIAN */
+ T2 = Sigma0_512(a) + Maj(a, b, c);
+ h = g;
+ g = f;
+ f = e;
+ e = d + T1;
+ d = c;
+ c = b;
+ b = a;
+ a = T1 + T2;
+
+ j++;
+ } while (j < 16);
+
+ do {
+ /* Part of the message block expansion: */
+ s0 = W512[(j+1)&0x0f];
+ s0 = sigma0_512(s0);
+ s1 = W512[(j+14)&0x0f];
+ s1 = sigma1_512(s1);
+
+ /* Apply the SHA-512 compression function to update a..h */
+ T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] +
+ (W512[j&0x0f] += s1 + W512[(j+9)&0x0f] + s0);
+ T2 = Sigma0_512(a) + Maj(a, b, c);
+ h = g;
+ g = f;
+ f = e;
+ e = d + T1;
+ d = c;
+ c = b;
+ b = a;
+ a = T1 + T2;
+
+ j++;
+ } while (j < 80);
+
+ /* Compute the current intermediate hash value */
+ sha->state[0] += a;
+ sha->state[1] += b;
+ sha->state[2] += c;
+ sha->state[3] += d;
+ sha->state[4] += e;
+ sha->state[5] += f;
+ sha->state[6] += g;
+ sha->state[7] += h;
+
+ /* Clean up */
+ a = b = c = d = e = f = g = h = T1 = T2 = 0;
+}
+
+#endif /* SHA2_UNROLL_TRANSFORM */
+
+static int
+sha512_block(register Sum_t* p, const void* s, size_t len)
+{
+ Sha512_t* sha = (Sha512_t*)p;
+ sha2_byte* data = (sha2_byte*)s;
+ unsigned int freespace, usedspace;
+
+ if (!len)
+ return 0;
+ usedspace = (sha->bitcount[0] >> 3) % SHA512_BLOCK_LENGTH;
+ if (usedspace > 0) {
+ /* Calculate how much free space is available in the buffer */
+ freespace = SHA512_BLOCK_LENGTH - usedspace;
+
+ if (len >= freespace) {
+ /* Fill the buffer completely and process it */
+ MEMCPY_BCOPY(&sha->buffer[usedspace], data, freespace);
+ ADDINC128(sha->bitcount, freespace << 3);
+ len -= freespace;
+ data += freespace;
+ SHA512_Transform(sha, (sha2_word64*)sha->buffer);
+ } else {
+ /* The buffer is not yet full */
+ MEMCPY_BCOPY(&sha->buffer[usedspace], data, len);
+ ADDINC128(sha->bitcount, len << 3);
+ /* Clean up: */
+ usedspace = freespace = 0;
+ return 0;
+ }
+ }
+ while (len >= SHA512_BLOCK_LENGTH) {
+ /* Process as many complete blocks as we can */
+ SHA512_Transform(sha, (sha2_word64*)data);
+ ADDINC128(sha->bitcount, SHA512_BLOCK_LENGTH << 3);
+ len -= SHA512_BLOCK_LENGTH;
+ data += SHA512_BLOCK_LENGTH;
+ }
+ if (len > 0) {
+ /* There's left-overs, so save 'em */
+ MEMCPY_BCOPY(sha->buffer, data, len);
+ ADDINC128(sha->bitcount, len << 3);
+ }
+ /* Clean up: */
+ usedspace = freespace = 0;
+
+ return 0;
+}
+
+static int
+sha512_init(Sum_t* p)
+{
+ register Sha512_t* sha = (Sha512_t*)p;
+
+ MEMCPY_BCOPY(sha->state, sha512_initial_hash_value, SHA512_DIGEST_LENGTH);
+ MEMSET_BZERO(sha->buffer, SHA512_BLOCK_LENGTH);
+ sha->bitcount[0] = sha->bitcount[1] = 0;
+
+ return 0;
+}
+
+static Sum_t*
+sha512_open(const Method_t* method, const char* name)
+{
+ Sha512_t* sha;
+
+ if (sha = newof(0, Sha512_t, 1, 0))
+ {
+ sha->method = (Method_t*)method;
+ sha->name = name;
+ sha512_init((Sum_t*)sha);
+ }
+ return (Sum_t*)sha;
+}
+
+static int
+sha512_done(Sum_t* p)
+{
+ Sha512_t* sha = (Sha512_t*)p;
+ unsigned int usedspace;
+ register int i;
+
+ usedspace = (sha->bitcount[0] >> 3) % SHA512_BLOCK_LENGTH;
+#if BYTE_ORDER == LITTLE_ENDIAN
+ /* Convert FROM host byte order */
+ REVERSE64(sha->bitcount[0],sha->bitcount[0]);
+ REVERSE64(sha->bitcount[1],sha->bitcount[1]);
+#endif
+ if (usedspace > 0) {
+ /* Begin padding with a 1 bit: */
+ sha->buffer[usedspace++] = 0x80;
+
+ if (usedspace <= SHA512_SHORT_BLOCK_LENGTH) {
+ /* Set-up for the last transform: */
+ MEMSET_BZERO(&sha->buffer[usedspace], SHA512_SHORT_BLOCK_LENGTH - usedspace);
+ } else {
+ if (usedspace < SHA512_BLOCK_LENGTH) {
+ MEMSET_BZERO(&sha->buffer[usedspace], SHA512_BLOCK_LENGTH - usedspace);
+ }
+ /* Do second-to-last transform: */
+ SHA512_Transform(sha, (sha2_word64*)sha->buffer);
+
+ /* And set-up for the last transform: */
+ MEMSET_BZERO(sha->buffer, SHA512_BLOCK_LENGTH - 2);
+ }
+ } else {
+ /* Prepare for final transform: */
+ MEMSET_BZERO(sha->buffer, SHA512_SHORT_BLOCK_LENGTH);
+
+ /* Begin padding with a 1 bit: */
+ *sha->buffer = 0x80;
+ }
+ /* Store the length of input data (in bits): */
+ *(sha2_word64*)&sha->buffer[SHA512_SHORT_BLOCK_LENGTH] = sha->bitcount[1];
+ *(sha2_word64*)&sha->buffer[SHA512_SHORT_BLOCK_LENGTH+8] = sha->bitcount[0];
+
+ /* Final transform: */
+ SHA512_Transform(sha, (sha2_word64*)sha->buffer);
+
+#if BYTE_ORDER == LITTLE_ENDIAN
+ {
+ /* Convert TO host byte order */
+ sha2_word64* d = (sha2_word64*)sha->digest;
+ int j;
+ for (j = 0; j < 8; j++) {
+ REVERSE64(sha->state[j],sha->state[j]);
+ *d++ = sha->state[j];
+ }
+ }
+#else
+ MEMCPY_BCOPY(sha->digest, sha->state, SHA512_DIGEST_LENGTH);
+#endif
+
+ /* accumulate the digests */
+ for (i = 0; i < SHA512_DIGEST_LENGTH; i++)
+ sha->digest_sum[i] ^= sha->digest[i];
+
+ /* Clean up state data: */
+ MEMSET_BZERO(&sha->state, sizeof(*sha) - offsetof(Sha512_t, state));
+ usedspace = 0;
+
+ return 0;
+}
+
+static int
+sha512_print(Sum_t* p, Sfio_t* sp, register int flags, size_t scale)
+{
+ register Sha512_t* sha = (Sha512_t*)p;
+ register sha2_byte* d;
+ register sha2_byte* e;
+
+ d = (flags & SUM_TOTAL) ? sha->digest_sum : sha->digest;
+ e = d + SHA512_DIGEST_LENGTH;
+ while (d < e)
+ sfprintf(sp, "%02x", *d++);
+ return 0;
+}
+
+static int
+sha512_data(Sum_t* p, Sumdata_t* data)
+{
+ register Sha512_t* sha = (Sha512_t*)p;
+
+ data->size = SHA512_DIGEST_LENGTH;
+ data->num = 0;
+ data->buf = sha->digest;
+ return 0;
+}
+
+/*** SHA-384: *********************************************************/
+
+#define sha384_description "FIPS SHA-384 secure hash algorithm."
+#define sha384_options "\
+[+(version)?sha-384 (FIPS) 2000-01-01]\
+[+(author)?Aaron D. Gifford]\
+"
+#define sha384_match "sha384|sha-384|SHA384|SHA-384"
+#define sha384_scale 0
+#define sha384_block sha512_block
+#define sha384_done sha512_done
+
+#define sha384_padding md5_pad
+
+#define Sha384_t Sha512_t
+#define SHA384_CTX Sha384_t
+#define SHA384_DIGEST_LENGTH 48
+
+static int
+sha384_init(Sum_t* p)
+{
+ register Sha384_t* sha = (Sha384_t*)p;
+
+ MEMCPY_BCOPY(sha->state, sha384_initial_hash_value, SHA512_DIGEST_LENGTH);
+ MEMSET_BZERO(sha->buffer, SHA384_BLOCK_LENGTH);
+ sha->bitcount[0] = sha->bitcount[1] = 0;
+
+ return 0;
+}
+
+static Sum_t*
+sha384_open(const Method_t* method, const char* name)
+{
+ Sha384_t* sha;
+
+ if (sha = newof(0, Sha384_t, 1, 0))
+ {
+ sha->method = (Method_t*)method;
+ sha->name = name;
+ sha384_init((Sum_t*)sha);
+ }
+ return (Sum_t*)sha;
+}
+
+static int
+sha384_print(Sum_t* p, Sfio_t* sp, register int flags, size_t scale)
+{
+ register Sha384_t* sha = (Sha384_t*)p;
+ register sha2_byte* d;
+ register sha2_byte* e;
+
+ d = (flags & SUM_TOTAL) ? sha->digest_sum : sha->digest;
+ e = d + SHA384_DIGEST_LENGTH;
+ while (d < e)
+ sfprintf(sp, "%02x", *d++);
+ return 0;
+}
+
+static int
+sha384_data(Sum_t* p, Sumdata_t* data)
+{
+ register Sha384_t* sha = (Sha384_t*)p;
+
+ data->size = SHA384_DIGEST_LENGTH;
+ data->num = 0;
+ data->buf = sha->digest;
+ return 0;
+}
+
+#endif /* _typ_int64_t */
diff --git a/usr/src/lib/libsum/common/sum.h b/usr/src/lib/libsum/common/sum.h
new file mode 100644
index 0000000000..443a4f2d7f
--- /dev/null
+++ b/usr/src/lib/libsum/common/sum.h
@@ -0,0 +1,65 @@
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1996-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* *
+***********************************************************************/
+#pragma prototyped
+
+/*
+ * Glenn Fowler
+ * AT&T Research
+ *
+ * checksum library interface
+ */
+
+#ifndef _SUM_H
+#define _SUM_H
+
+#include <ast.h>
+
+#define SUM_SIZE (1<<0) /* print size too */
+#define SUM_SCALE (1<<1) /* traditional size scale */
+#define SUM_TOTAL (1<<2) /* print totals since sumopen */
+#define SUM_LEGACY (1<<3) /* legacy field widths */
+
+#define _SUM_PUBLIC_ const char* name;
+
+typedef struct Sumdata_s
+{
+ uint32_t size;
+ uint32_t num;
+ void* buf;
+} Sumdata_t;
+
+typedef struct Sum_s
+{
+ _SUM_PUBLIC_
+#ifdef _SUM_PRIVATE_
+ _SUM_PRIVATE_
+#endif
+} Sum_t;
+
+extern Sum_t* sumopen(const char*);
+extern int suminit(Sum_t*);
+extern int sumblock(Sum_t*, const void*, size_t);
+extern int sumdone(Sum_t*);
+extern int sumdata(Sum_t*, Sumdata_t*);
+extern int sumprint(Sum_t*, Sfio_t*, int, size_t);
+extern int sumusage(Sfio_t*);
+extern int sumclose(Sum_t*);
+
+#endif
diff --git a/usr/src/lib/libsum/common/sumlib.c b/usr/src/lib/libsum/common/sumlib.c
new file mode 100644
index 0000000000..3005e1fe5a
--- /dev/null
+++ b/usr/src/lib/libsum/common/sumlib.c
@@ -0,0 +1,349 @@
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1996-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* *
+***********************************************************************/
+#pragma prototyped
+/*
+ * Glenn Fowler
+ * AT&T Research
+ *
+ * man this is sum library
+ */
+
+static const char id[] = "\n@(#)$Id: sumlib (AT&T Research) 2008-05-01 $\0\n";
+
+#define _SUM_PRIVATE_ \
+ struct Method_s* method; \
+ uintmax_t total_count; \
+ uintmax_t total_size; \
+ uintmax_t size;
+
+#include <sum.h>
+#include <ctype.h>
+#include <swap.h>
+#include <hashpart.h>
+
+#define SCALE(n,m) (((n)+(m)-1)/(m))
+
+typedef struct Method_s
+{
+ const char* match;
+ const char* description;
+ const char* options;
+ Sum_t* (*open)(const struct Method_s*, const char*);
+ int (*init)(Sum_t*);
+ int (*block)(Sum_t*, const void*, size_t);
+ int (*data)(Sum_t*, Sumdata_t*);
+ int (*print)(Sum_t*, Sfio_t*, int, size_t);
+ int (*done)(Sum_t*);
+ int scale;
+} Method_t;
+
+typedef struct Map_s
+{
+ const char* match;
+ const char* description;
+ const char* map;
+} Map_t;
+
+/*
+ * 16 and 32 bit common code
+ */
+
+#define _INTEGRAL_PRIVATE_ \
+ uint32_t sum; \
+ uint32_t total_sum;
+
+typedef struct Integral_s
+{
+ _SUM_PUBLIC_
+ _SUM_PRIVATE_
+ _INTEGRAL_PRIVATE_
+} Integral_t;
+
+static Sum_t*
+long_open(const Method_t* method, const char* name)
+{
+ Integral_t* p;
+
+ if (p = newof(0, Integral_t, 1, 0))
+ {
+ p->method = (Method_t*)method;
+ p->name = name;
+ }
+ return (Sum_t*)p;
+}
+
+static int
+long_init(Sum_t* p)
+{
+ ((Integral_t*)p)->sum = 0;
+ return 0;
+}
+
+static int
+long_done(Sum_t* p)
+{
+ register Integral_t* x = (Integral_t*)p;
+
+ x->total_sum ^= (x->sum &= 0xffffffff);
+ return 0;
+}
+
+static int
+short_done(Sum_t* p)
+{
+ register Integral_t* x = (Integral_t*)p;
+
+ x->total_sum ^= (x->sum &= 0xffff);
+ return 0;
+}
+
+static int
+long_print(Sum_t* p, Sfio_t* sp, register int flags, size_t scale)
+{
+ register Integral_t* x = (Integral_t*)p;
+ register uint32_t c;
+ register uintmax_t z;
+ register size_t n;
+
+ c = (flags & SUM_TOTAL) ? x->total_sum : x->sum;
+ sfprintf(sp, "%.*I*u", (flags & SUM_LEGACY) ? 5 : 1, sizeof(c), c);
+ if (flags & SUM_SIZE)
+ {
+ z = (flags & SUM_TOTAL) ? x->total_size : x->size;
+ if ((flags & SUM_SCALE) && ((n = scale) || (n = x->method->scale)))
+ z = SCALE(z, n);
+ sfprintf(sp, " %*I*u", (flags & SUM_LEGACY) ? 6 : 0, sizeof(z), z);
+ }
+ if (flags & SUM_TOTAL)
+ sfprintf(sp, " %*I*u", (flags & SUM_LEGACY) ? 6 : 0, sizeof(x->total_count), x->total_count);
+ return 0;
+}
+
+static int
+long_data(Sum_t* p, Sumdata_t* data)
+{
+ register Integral_t* x = (Integral_t*)p;
+
+ data->size = sizeof(data->num);
+ data->num = x->sum;
+ data->buf = 0;
+ return 0;
+}
+
+#include "FEATURE/sum"
+
+#include "sum-att.c"
+#include "sum-ast4.c"
+#include "sum-bsd.c"
+#include "sum-crc.c"
+#include "sum-prng.c"
+
+#if _LIB_md && _lib_MD5Init && _hdr_md5 && _lib_SHA2Init && _hdr_sha2
+
+#include "sum-lmd.c"
+
+#else
+
+#include "sum-md5.c"
+#include "sum-sha1.c"
+#include "sum-sha2.c"
+
+#endif
+
+/*
+ * now the library interface
+ */
+
+#undef METHOD /* solaris <sys/localedef.h>! */
+#define METHOD(x) x##_match,x##_description,x##_options,x##_open,x##_init,x##_block,x##_data,x##_print,x##_done,x##_scale
+
+static const Method_t methods[] =
+{
+ METHOD(att),
+ METHOD(ast4),
+ METHOD(bsd),
+ METHOD(crc),
+ METHOD(prng),
+#ifdef md4_description
+ METHOD(md4),
+#endif
+#ifdef md5_description
+ METHOD(md5),
+#endif
+#ifdef sha1_description
+ METHOD(sha1),
+#endif
+#ifdef sha256_description
+ METHOD(sha256),
+#endif
+#ifdef sha384_description
+ METHOD(sha384),
+#endif
+#ifdef sha512_description
+ METHOD(sha512),
+#endif
+};
+
+static const Map_t maps[] =
+{
+ {
+ "posix|cksum|std|standard",
+ "The posix 1003.2-1992 32 bit crc checksum. This is the"
+ " default \bcksum\b(1) method.",
+ "crc-0x04c11db7-rotate-done-size"
+ },
+ {
+ "zip",
+ "The \bzip\b(1) crc.",
+ "crc-0xedb88320-init-done"
+ },
+ {
+ "fddi",
+ "The FDDI crc.",
+ "crc-0xedb88320-size=0xcc55cc55"
+ },
+ {
+ "fnv|fnv1",
+ "The Fowler-Noll-Vo 32 bit PRNG hash with non-zero"
+ " initializer (FNV-1).",
+ "prng-0x01000193-init=0x811c9dc5"
+ },
+ {
+ "ast|strsum",
+ "The \bast\b \bstrsum\b(3) PRNG hash.",
+ "prng-0x63c63cd9-add=0x9c39c33d"
+ },
+};
+
+/*
+ * open sum method name
+ */
+
+Sum_t*
+sumopen(register const char* name)
+{
+ register int n;
+ char pat[256];
+
+ if (!name || !name[0] || name[0] == '-' && !name[1])
+ name = "default";
+ for (n = 0; n < elementsof(maps); n++)
+ {
+ sfsprintf(pat, sizeof(pat), "*@(%s)*", maps[n].match);
+ if (strmatch(name, pat))
+ {
+ name = maps[n].map;
+ break;
+ }
+ }
+ for (n = 0; n < elementsof(methods); n++)
+ {
+ sfsprintf(pat, sizeof(pat), "*@(%s)*", methods[n].match);
+ if (strmatch(name, pat))
+ return (*methods[n].open)(&methods[n], name);
+ }
+ return 0;
+}
+
+/*
+ * initialize for a new run of blocks
+ */
+
+int
+suminit(Sum_t* p)
+{
+ p->size = 0;
+ return (*p->method->init)(p);
+}
+
+/*
+ * compute the running sum on buf
+ */
+
+int
+sumblock(Sum_t* p, const void* buf, size_t siz)
+{
+ p->size += siz;
+ return (*p->method->block)(p, buf, siz);
+}
+
+/*
+ * done with this run of blocks
+ */
+
+int
+sumdone(Sum_t* p)
+{
+ p->total_count++;
+ p->total_size += p->size;
+ return (*p->method->done)(p);
+}
+
+/*
+ * print the sum [size] on sp
+ */
+
+int
+sumprint(Sum_t* p, Sfio_t* sp, int flags, size_t scale)
+{
+ return (*p->method->print)(p, sp, flags, scale);
+}
+
+/*
+ * return the current sum (internal) data
+ */
+
+int
+sumdata(Sum_t* p, Sumdata_t* d)
+{
+ return (*p->method->data)(p, d);
+}
+
+/*
+ * close an open sum handle
+ */
+
+int
+sumclose(Sum_t* p)
+{
+ free(p);
+ return 0;
+}
+
+/*
+ * print the checksum method optget(3) usage on sp and return the length
+ */
+
+int
+sumusage(Sfio_t* sp)
+{
+ register int i;
+ register int n;
+
+ for (i = n = 0; i < elementsof(methods); i++)
+ {
+ n += sfprintf(sp, "[+%s?%s]", methods[i].match, methods[i].description);
+ if (methods[i].options)
+ n += sfprintf(sp, "{\n%s\n}", methods[i].options);
+ }
+ for (i = 0; i < elementsof(maps); i++)
+ n += sfprintf(sp, "[+%s?%s Shorthand for \b%s\b.]", maps[i].match, maps[i].description, maps[i].map);
+ return n;
+}
diff --git a/usr/src/cmd/sum/Makefile b/usr/src/lib/libsum/i386/Makefile
index cb91120a93..79cb51eae6 100644
--- a/usr/src/cmd/sum/Makefile
+++ b/usr/src/lib/libsum/i386/Makefile
@@ -2,9 +2,8 @@
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
@@ -19,28 +18,12 @@
#
# CDDL HEADER END
#
+
#
-#ident "%Z%%M% %I% %E% SMI"
-#
-# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-PROG= sum
-
-include ../Makefile.cmd
-
-CFLAGS += $(CCVERBOSE)
-CPPFLAGS += -D_FILE_OFFSET_BITS=64
-
-.KEEP_STATE:
-
-all: $(PROG)
-
-install: all $(ROOTPROG)
-
-clean:
-
-lint: lint_PROG
+include ../Makefile.com
-include ../Makefile.targ
+install: all $(ROOTLIBS) $(ROOTLINKS) $(ROOTLINT)
diff --git a/usr/src/lib/libsum/i386/include/ast/sum.h b/usr/src/lib/libsum/i386/include/ast/sum.h
new file mode 100644
index 0000000000..fa8157ab1e
--- /dev/null
+++ b/usr/src/lib/libsum/i386/include/ast/sum.h
@@ -0,0 +1,74 @@
+
+/* : : generated by proto : : */
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1996-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* *
+***********************************************************************/
+
+
+/*
+ * Glenn Fowler
+ * AT&T Research
+ *
+ * checksum library interface
+ */
+
+#ifndef _SUM_H
+#if !defined(__PROTO__)
+#include <prototyped.h>
+#endif
+#if !defined(__LINKAGE__)
+#define __LINKAGE__ /* 2004-08-11 transition */
+#endif
+
+#define _SUM_H
+
+#include <ast.h>
+
+#define SUM_SIZE (1<<0) /* print size too */
+#define SUM_SCALE (1<<1) /* traditional size scale */
+#define SUM_TOTAL (1<<2) /* print totals since sumopen */
+#define SUM_LEGACY (1<<3) /* legacy field widths */
+
+#define _SUM_PUBLIC_ const char* name;
+
+typedef struct Sumdata_s
+{
+ uint32_t size;
+ uint32_t num;
+ __V_* buf;
+} Sumdata_t;
+
+typedef struct Sum_s
+{
+ _SUM_PUBLIC_
+#ifdef _SUM_PRIVATE_
+ _SUM_PRIVATE_
+#endif
+} Sum_t;
+
+extern __MANGLE__ Sum_t* sumopen __PROTO__((const char*));
+extern __MANGLE__ int suminit __PROTO__((Sum_t*));
+extern __MANGLE__ int sumblock __PROTO__((Sum_t*, const __V_*, size_t));
+extern __MANGLE__ int sumdone __PROTO__((Sum_t*));
+extern __MANGLE__ int sumdata __PROTO__((Sum_t*, Sumdata_t*));
+extern __MANGLE__ int sumprint __PROTO__((Sum_t*, Sfio_t*, int, size_t));
+extern __MANGLE__ int sumusage __PROTO__((Sfio_t*));
+extern __MANGLE__ int sumclose __PROTO__((Sum_t*));
+
+#endif
diff --git a/usr/src/lib/libsum/i386/src/lib/libsum/FEATURE/sum b/usr/src/lib/libsum/i386/src/lib/libsum/FEATURE/sum
new file mode 100644
index 0000000000..6bb0ab44bd
--- /dev/null
+++ b/usr/src/lib/libsum/i386/src/lib/libsum/FEATURE/sum
@@ -0,0 +1,16 @@
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/src/lib/libsum/features/sum by iffe version 2008-01-31 : : */
+#ifndef _def_sum_sum
+#define _def_sum_sum 1
+#define _sys_types 1 /* #include <sys/types.h> ok */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_i386_32bit/arch/sol11.i386/lib/libast.a is a library */
+#define _LIB_m 1 /* -lm is a library */
+#define _hdr_md4 1 /* #include <md4.h> ok */
+#define _LIB_md 1 /* -lmd is a library */
+#define _lib_MD4Init 1 /* MD4Init() in default lib(s) */
+#define _hdr_md5 1 /* #include <md5.h> ok */
+#define _lib_MD5Init 1 /* MD5Init() in default lib(s) */
+#define _hdr_sha1 1 /* #include <sha1.h> ok */
+#define _lib_SHA1Init 1 /* SHA1Init() in default lib(s) */
+#define _hdr_sha2 1 /* #include <sha2.h> ok */
+#define _lib_SHA2Init 1 /* SHA2Init() in default lib(s) */
+#endif
diff --git a/usr/src/lib/libsum/mapfile-vers b/usr/src/lib/libsum/mapfile-vers
new file mode 100644
index 0000000000..145ac37008
--- /dev/null
+++ b/usr/src/lib/libsum/mapfile-vers
@@ -0,0 +1,39 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+SUNWprivate_1.1 {
+ global:
+ sumopen;
+ suminit;
+ sumblock;
+ sumdone;
+ sumdata;
+ sumprint;
+ sumusage;
+ sumclose;
+ local:
+ *;
+};
diff --git a/usr/src/lib/libsum/sparc/Makefile b/usr/src/lib/libsum/sparc/Makefile
new file mode 100644
index 0000000000..79cb51eae6
--- /dev/null
+++ b/usr/src/lib/libsum/sparc/Makefile
@@ -0,0 +1,29 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+include ../Makefile.com
+
+install: all $(ROOTLIBS) $(ROOTLINKS) $(ROOTLINT)
diff --git a/usr/src/lib/libsum/sparc/include/ast/sum.h b/usr/src/lib/libsum/sparc/include/ast/sum.h
new file mode 100644
index 0000000000..fa8157ab1e
--- /dev/null
+++ b/usr/src/lib/libsum/sparc/include/ast/sum.h
@@ -0,0 +1,74 @@
+
+/* : : generated by proto : : */
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1996-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* *
+***********************************************************************/
+
+
+/*
+ * Glenn Fowler
+ * AT&T Research
+ *
+ * checksum library interface
+ */
+
+#ifndef _SUM_H
+#if !defined(__PROTO__)
+#include <prototyped.h>
+#endif
+#if !defined(__LINKAGE__)
+#define __LINKAGE__ /* 2004-08-11 transition */
+#endif
+
+#define _SUM_H
+
+#include <ast.h>
+
+#define SUM_SIZE (1<<0) /* print size too */
+#define SUM_SCALE (1<<1) /* traditional size scale */
+#define SUM_TOTAL (1<<2) /* print totals since sumopen */
+#define SUM_LEGACY (1<<3) /* legacy field widths */
+
+#define _SUM_PUBLIC_ const char* name;
+
+typedef struct Sumdata_s
+{
+ uint32_t size;
+ uint32_t num;
+ __V_* buf;
+} Sumdata_t;
+
+typedef struct Sum_s
+{
+ _SUM_PUBLIC_
+#ifdef _SUM_PRIVATE_
+ _SUM_PRIVATE_
+#endif
+} Sum_t;
+
+extern __MANGLE__ Sum_t* sumopen __PROTO__((const char*));
+extern __MANGLE__ int suminit __PROTO__((Sum_t*));
+extern __MANGLE__ int sumblock __PROTO__((Sum_t*, const __V_*, size_t));
+extern __MANGLE__ int sumdone __PROTO__((Sum_t*));
+extern __MANGLE__ int sumdata __PROTO__((Sum_t*, Sumdata_t*));
+extern __MANGLE__ int sumprint __PROTO__((Sum_t*, Sfio_t*, int, size_t));
+extern __MANGLE__ int sumusage __PROTO__((Sfio_t*));
+extern __MANGLE__ int sumclose __PROTO__((Sum_t*));
+
+#endif
diff --git a/usr/src/lib/libsum/sparc/src/lib/libsum/FEATURE/sum b/usr/src/lib/libsum/sparc/src/lib/libsum/FEATURE/sum
new file mode 100644
index 0000000000..86dabedd89
--- /dev/null
+++ b/usr/src/lib/libsum/sparc/src/lib/libsum/FEATURE/sum
@@ -0,0 +1,16 @@
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/src/lib/libsum/features/sum by iffe version 2008-01-31 : : */
+#ifndef _def_sum_sum
+#define _def_sum_sum 1
+#define _sys_types 1 /* #include <sys/types.h> ok */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_32bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_m 1 /* -lm is a library */
+#define _hdr_md4 1 /* #include <md4.h> ok */
+#define _LIB_md 1 /* -lmd is a library */
+#define _lib_MD4Init 1 /* MD4Init() in default lib(s) */
+#define _hdr_md5 1 /* #include <md5.h> ok */
+#define _lib_MD5Init 1 /* MD5Init() in default lib(s) */
+#define _hdr_sha1 1 /* #include <sha1.h> ok */
+#define _lib_SHA1Init 1 /* SHA1Init() in default lib(s) */
+#define _hdr_sha2 1 /* #include <sha2.h> ok */
+#define _lib_SHA2Init 1 /* SHA2Init() in default lib(s) */
+#endif
diff --git a/usr/src/lib/libsum/sparcv9/Makefile b/usr/src/lib/libsum/sparcv9/Makefile
new file mode 100644
index 0000000000..9f293be4fa
--- /dev/null
+++ b/usr/src/lib/libsum/sparcv9/Makefile
@@ -0,0 +1,30 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+include ../Makefile.com
+include ../../Makefile.lib.64
+
+install: all $(ROOTLIBS64) $(ROOTLINKS64)
diff --git a/usr/src/lib/libsum/sparcv9/include/ast/sum.h b/usr/src/lib/libsum/sparcv9/include/ast/sum.h
new file mode 100644
index 0000000000..fa8157ab1e
--- /dev/null
+++ b/usr/src/lib/libsum/sparcv9/include/ast/sum.h
@@ -0,0 +1,74 @@
+
+/* : : generated by proto : : */
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1996-2008 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* Glenn Fowler <gsf@research.att.com> *
+* *
+***********************************************************************/
+
+
+/*
+ * Glenn Fowler
+ * AT&T Research
+ *
+ * checksum library interface
+ */
+
+#ifndef _SUM_H
+#if !defined(__PROTO__)
+#include <prototyped.h>
+#endif
+#if !defined(__LINKAGE__)
+#define __LINKAGE__ /* 2004-08-11 transition */
+#endif
+
+#define _SUM_H
+
+#include <ast.h>
+
+#define SUM_SIZE (1<<0) /* print size too */
+#define SUM_SCALE (1<<1) /* traditional size scale */
+#define SUM_TOTAL (1<<2) /* print totals since sumopen */
+#define SUM_LEGACY (1<<3) /* legacy field widths */
+
+#define _SUM_PUBLIC_ const char* name;
+
+typedef struct Sumdata_s
+{
+ uint32_t size;
+ uint32_t num;
+ __V_* buf;
+} Sumdata_t;
+
+typedef struct Sum_s
+{
+ _SUM_PUBLIC_
+#ifdef _SUM_PRIVATE_
+ _SUM_PRIVATE_
+#endif
+} Sum_t;
+
+extern __MANGLE__ Sum_t* sumopen __PROTO__((const char*));
+extern __MANGLE__ int suminit __PROTO__((Sum_t*));
+extern __MANGLE__ int sumblock __PROTO__((Sum_t*, const __V_*, size_t));
+extern __MANGLE__ int sumdone __PROTO__((Sum_t*));
+extern __MANGLE__ int sumdata __PROTO__((Sum_t*, Sumdata_t*));
+extern __MANGLE__ int sumprint __PROTO__((Sum_t*, Sfio_t*, int, size_t));
+extern __MANGLE__ int sumusage __PROTO__((Sfio_t*));
+extern __MANGLE__ int sumclose __PROTO__((Sum_t*));
+
+#endif
diff --git a/usr/src/lib/libsum/sparcv9/src/lib/libsum/FEATURE/sum b/usr/src/lib/libsum/sparcv9/src/lib/libsum/FEATURE/sum
new file mode 100644
index 0000000000..1fc37114db
--- /dev/null
+++ b/usr/src/lib/libsum/sparcv9/src/lib/libsum/FEATURE/sum
@@ -0,0 +1,16 @@
+/* : : generated from /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/src/lib/libsum/features/sum by iffe version 2008-01-31 : : */
+#ifndef _def_sum_sum
+#define _def_sum_sum 1
+#define _sys_types 1 /* #include <sys/types.h> ok */
+#define _LIB_ast 1 /* /home/gisburn/ksh93/ast_ksh_20081104/build_sparc_64bit/arch/sol11.sun4/lib/libast.a is a library */
+#define _LIB_m 1 /* -lm is a library */
+#define _hdr_md4 1 /* #include <md4.h> ok */
+#define _LIB_md 1 /* -lmd is a library */
+#define _lib_MD4Init 1 /* MD4Init() in default lib(s) */
+#define _hdr_md5 1 /* #include <md5.h> ok */
+#define _lib_MD5Init 1 /* MD5Init() in default lib(s) */
+#define _hdr_sha1 1 /* #include <sha1.h> ok */
+#define _lib_SHA1Init 1 /* SHA1Init() in default lib(s) */
+#define _hdr_sha2 1 /* #include <sha2.h> ok */
+#define _lib_SHA2Init 1 /* SHA2Init() in default lib(s) */
+#endif
diff --git a/usr/src/pkgdefs/SUNW0on/prototype_com b/usr/src/pkgdefs/SUNW0on/prototype_com
index 34c71c492a..593e5ddeb6 100644
--- a/usr/src/pkgdefs/SUNW0on/prototype_com
+++ b/usr/src/pkgdefs/SUNW0on/prototype_com
@@ -82,6 +82,7 @@ f none usr/lib/locale/C/LC_MESSAGES/libast 644 root sys
f none usr/lib/locale/C/LC_MESSAGES/libcmd 644 root sys
f none usr/lib/locale/C/LC_MESSAGES/libdll 644 root sys
f none usr/lib/locale/C/LC_MESSAGES/libshell 644 root sys
+f none usr/lib/locale/C/LC_MESSAGES/libsum 644 root sys
#
# Java locale directories
#
diff --git a/usr/src/pkgdefs/SUNWcsl/Makefile b/usr/src/pkgdefs/SUNWcsl/Makefile
index 19066642d1..df3e81bd8d 100644
--- a/usr/src/pkgdefs/SUNWcsl/Makefile
+++ b/usr/src/pkgdefs/SUNWcsl/Makefile
@@ -22,8 +22,6 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
include ../Makefile.com
@@ -32,11 +30,14 @@ include ../Makefile.com
LICENSEFILES_i386 = lic_AMD
LICENSEFILES += $(LICENSEFILES_$(MACH)) \
../../common/mpi/THIRDPARTYLICENSE \
+ ../../lib/libast/THIRDPARTYLICENSE \
../../lib/libbsdmalloc/THIRDPARTYLICENSE \
+ ../../lib/libcmd/THIRDPARTYLICENSE \
../../lib/libdll/THIRDPARTYLICENSE \
../../lib/libkmf/THIRDPARTYLICENSE \
../../lib/libldap5/THIRDPARTYLICENSE \
../../lib/libshell/THIRDPARTYLICENSE \
+ ../../lib/libsum/THIRDPARTYLICENSE \
../../lib/libwrap/THIRDPARTYLICENSE \
../../lib/pam_modules/authtok_check/THIRDPARTYLICENSE \
../../lib/passwdutil/THIRDPARTYLICENSE
diff --git a/usr/src/pkgdefs/SUNWcsl/prototype_com b/usr/src/pkgdefs/SUNWcsl/prototype_com
index 89dd9ed0b5..a856560c5e 100644
--- a/usr/src/pkgdefs/SUNWcsl/prototype_com
+++ b/usr/src/pkgdefs/SUNWcsl/prototype_com
@@ -249,6 +249,7 @@ s none usr/lib/libsocket.so=../../lib/libsocket.so.1
s none usr/lib/libsocket.so.1=../../lib/libsocket.so.1
f none usr/lib/libsoftcrypto.so.1 755 root bin
s none usr/lib/libsoftcrypto.so=./libsoftcrypto.so.1
+f none usr/lib/libsum.so.1 755 root bin
s none usr/lib/libsys.so=./libsys.so.1
f none usr/lib/libsys.so.1 755 root bin
s none usr/lib/libsysevent.so=../../lib/libsysevent.so.1
diff --git a/usr/src/pkgdefs/SUNWcsl/prototype_i386 b/usr/src/pkgdefs/SUNWcsl/prototype_i386
index fba61d9458..a397b1ea0a 100644
--- a/usr/src/pkgdefs/SUNWcsl/prototype_i386
+++ b/usr/src/pkgdefs/SUNWcsl/prototype_i386
@@ -332,6 +332,7 @@ s none usr/lib/amd64/libsocket.so.1=../../../lib/amd64/libsocket.so.1
s none usr/lib/amd64/libsocket.so=../../../lib/amd64/libsocket.so.1
f none usr/lib/amd64/libsoftcrypto.so.1 755 root bin
s none usr/lib/amd64/libsoftcrypto.so=./libsoftcrypto.so.1
+f none usr/lib/amd64/libsum.so.1 755 root bin
s none usr/lib/amd64/libsysevent.so=../../../lib/amd64/libsysevent.so.1
s none usr/lib/amd64/libsysevent.so.1=../../../lib/amd64/libsysevent.so.1
s none usr/lib/amd64/libtermcap.so=../../../lib/amd64/libcurses.so.1
diff --git a/usr/src/pkgdefs/SUNWcsl/prototype_sparc b/usr/src/pkgdefs/SUNWcsl/prototype_sparc
index 66cd56089a..5f333f3430 100644
--- a/usr/src/pkgdefs/SUNWcsl/prototype_sparc
+++ b/usr/src/pkgdefs/SUNWcsl/prototype_sparc
@@ -317,6 +317,7 @@ s none usr/lib/sparcv9/libsocket.so.1=../../../lib/sparcv9/libsocket.so.1
s none usr/lib/sparcv9/libsocket.so=../../../lib/sparcv9/libsocket.so.1
f none usr/lib/sparcv9/libsoftcrypto.so.1 755 root bin
s none usr/lib/sparcv9/libsoftcrypto.so=./libsoftcrypto.so.1
+f none usr/lib/sparcv9/libsum.so.1 755 root bin
s none usr/lib/sparcv9/libsysevent.so.1=../../../lib/sparcv9/libsysevent.so.1
s none usr/lib/sparcv9/libsysevent.so=../../../lib/sparcv9/libsysevent.so.1
s none usr/lib/sparcv9/libtermcap.so=../../../lib/sparcv9/libcurses.so.1
diff --git a/usr/src/pkgdefs/SUNWcsu/prototype_com b/usr/src/pkgdefs/SUNWcsu/prototype_com
index b1021d4267..6bb2772f1a 100644
--- a/usr/src/pkgdefs/SUNWcsu/prototype_com
+++ b/usr/src/pkgdefs/SUNWcsu/prototype_com
@@ -232,6 +232,7 @@ f none usr/bin/pwd 555 root bin
l none usr/bin/read=../../usr/bin/alias
l none usr/bin/red=../../usr/bin/ed
f none usr/bin/renice 555 root bin
+l none usr/bin/rev=../../usr/bin/alias
l none usr/bin/rksh=../../usr/bin/ksh
l none usr/bin/rksh93=../../usr/lib/isaexec
f none usr/bin/rm 555 root bin
@@ -248,7 +249,8 @@ f none usr/bin/setpgrp 555 root sys
f none usr/bin/settime 555 root bin
l none usr/bin/setuname=../../usr/lib/isaexec
s none usr/bin/sh=../../sbin/sh
-f none usr/bin/sleep 555 root bin
+f none usr/bin/shcomp 555 root bin
+l none usr/bin/sleep=../../usr/bin/alias
l none usr/bin/sparc=../../usr/bin/i286
f none usr/bin/strchg 555 root root
s none usr/bin/strclean=../sbin/strclean
@@ -256,6 +258,7 @@ f none usr/bin/strconf 555 root root
s none usr/bin/strerr=../sbin/strerr
f none usr/bin/stty 555 root bin
f none usr/bin/su 4555 root sys
+l none usr/bin/sum=../../usr/bin/alias
l none usr/bin/sun2=../../usr/bin/i286
l none usr/bin/sun3=../../usr/bin/i286
l none usr/bin/sun3x=../../usr/bin/i286
diff --git a/usr/src/pkgdefs/SUNWcsu/prototype_i386 b/usr/src/pkgdefs/SUNWcsu/prototype_i386
index 489ec29106..f448404146 100644
--- a/usr/src/pkgdefs/SUNWcsu/prototype_i386
+++ b/usr/src/pkgdefs/SUNWcsu/prototype_i386
@@ -22,8 +22,6 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
# This required package information file contains a list of package contents.
# The 'pkgmk' command uses this file to identify the contents of a package
# and their location on the development machine when building the package.
@@ -73,6 +71,7 @@ f none usr/kernel/drv/logindmux 755 root sys
f none usr/kernel/drv/ptm 755 root sys
f none usr/kernel/drv/pts 755 root sys
f none usr/kernel/exec/javaexec 755 root sys
+f none usr/kernel/exec/shbinexec 755 root sys
f none usr/kernel/fs/fdfs 755 root sys
f none usr/kernel/fs/pcfs 755 root sys
f none usr/kernel/sched/FX 755 root sys
@@ -136,6 +135,7 @@ f none usr/kernel/drv/amd64/ptm 755 root sys
f none usr/kernel/drv/amd64/pts 755 root sys
d none usr/kernel/exec/amd64 755 root sys
f none usr/kernel/exec/amd64/javaexec 755 root sys
+f none usr/kernel/exec/amd64/shbinexec 755 root sys
d none usr/kernel/fs/amd64 755 root sys
f none usr/kernel/fs/amd64/fdfs 755 root sys
f none usr/kernel/fs/amd64/pcfs 755 root sys
diff --git a/usr/src/pkgdefs/SUNWcsu/prototype_sparc b/usr/src/pkgdefs/SUNWcsu/prototype_sparc
index ddf795c592..86133102af 100644
--- a/usr/src/pkgdefs/SUNWcsu/prototype_sparc
+++ b/usr/src/pkgdefs/SUNWcsu/prototype_sparc
@@ -82,6 +82,7 @@ f none usr/kernel/drv/sparcv9/ptm 755 root sys
f none usr/kernel/drv/sparcv9/pts 755 root sys
d none usr/kernel/exec/sparcv9 755 root sys
f none usr/kernel/exec/sparcv9/javaexec 755 root sys
+f none usr/kernel/exec/sparcv9/shbinexec 755 root sys
d none usr/kernel/fs/sparcv9 755 root sys
f none usr/kernel/fs/sparcv9/fdfs 755 root sys
f none usr/kernel/fs/sparcv9/pcfs 755 root sys
diff --git a/usr/src/pkgdefs/SUNWesu/pkginfo.tmpl b/usr/src/pkgdefs/SUNWesu/pkginfo.tmpl
index 7ba5f49e8e..e4d4943051 100644
--- a/usr/src/pkgdefs/SUNWesu/pkginfo.tmpl
+++ b/usr/src/pkgdefs/SUNWesu/pkginfo.tmpl
@@ -20,11 +20,9 @@
#
#
-# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
#
# This required package information file describes characteristics of the
@@ -40,7 +38,7 @@ SUNW_PRODVERS="RELEASE/VERSION"
SUNW_PKGTYPE="usr"
MAXINST="1000"
CATEGORY="system"
-DESC="additional UNIX system utilities, including awk, bc, cal, compress, diff, dos2unix, last, rup, sort, spell, sum, uniq, and uuencode"
+DESC="additional UNIX system utilities, including awk, bc, cal, compress, diff, dos2unix, last, rup, sort, spell, uniq, and uuencode"
VENDOR="Sun Microsystems, Inc."
HOTLINE="Please contact your local service provider"
EMAIL=""
diff --git a/usr/src/pkgdefs/SUNWesu/prototype_com b/usr/src/pkgdefs/SUNWesu/prototype_com
index e61c2b200e..077aae5fbd 100644
--- a/usr/src/pkgdefs/SUNWesu/prototype_com
+++ b/usr/src/pkgdefs/SUNWesu/prototype_com
@@ -19,11 +19,9 @@
# CDDL HEADER END
#
#
-# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# This required package information file contains a list of package contents.
# The 'pkgmk' command uses this file to identify the contents of a package
# and their location on the development machine when building the package.
@@ -107,7 +105,6 @@ f none usr/bin/spell 555 root bin
f none usr/bin/spline 555 root bin
f none usr/bin/split 555 root bin
s none usr/bin/strace=../sbin/strace
-f none usr/bin/sum 555 root bin
f none usr/bin/tcopy 555 root bin
l none usr/bin/uncompress=../../usr/bin/compress
f none usr/bin/unexpand 555 root bin
diff --git a/usr/src/pkgdefs/SUNWhea/prototype_com b/usr/src/pkgdefs/SUNWhea/prototype_com
index df95ddfabe..45536bf13e 100644
--- a/usr/src/pkgdefs/SUNWhea/prototype_com
+++ b/usr/src/pkgdefs/SUNWhea/prototype_com
@@ -79,6 +79,8 @@ f none usr/include/ast/ast_limits.h 644 root bin
f none usr/include/ast/ast_map.h 644 root bin
f none usr/include/ast/ast_mmap.h 644 root bin
f none usr/include/ast/ast_mode.h 644 root bin
+f none usr/include/ast/ast_namval.h 644 root bin
+f none usr/include/ast/ast_ndbm.h 644 root bin
f none usr/include/ast/ast_nl_types.h 644 root bin
f none usr/include/ast/ast_param.h 644 root bin
f none usr/include/ast/ast_standards.h 644 root bin
@@ -87,7 +89,6 @@ f none usr/include/ast/ast_stdio.h 644 root bin
f none usr/include/ast/ast_sys.h 644 root bin
f none usr/include/ast/ast_time.h 644 root bin
f none usr/include/ast/ast_tty.h 644 root bin
-f none usr/include/ast/ast_types.h 644 root bin
f none usr/include/ast/ast_version.h 644 root bin
f none usr/include/ast/ast_vfork.h 644 root bin
f none usr/include/ast/ast_wait.h 644 root bin
@@ -118,6 +119,7 @@ f none usr/include/ast/hashkey.h 644 root bin
f none usr/include/ast/hashpart.h 644 root bin
f none usr/include/ast/history.h 644 root bin
f none usr/include/ast/iconv.h 644 root bin
+f none usr/include/ast/ip6.h 644 root bin
f none usr/include/ast/lc.h 644 root bin
f none usr/include/ast/ls.h 644 root bin
f none usr/include/ast/magic.h 644 root bin
@@ -142,12 +144,14 @@ f none usr/include/ast/sfdisc.h 644 root bin
f none usr/include/ast/sfio.h 644 root bin
f none usr/include/ast/sfio_s.h 644 root bin
f none usr/include/ast/sfio_t.h 644 root bin
+f none usr/include/ast/shcmd.h 644 root bin
f none usr/include/ast/shell.h 644 root bin
f none usr/include/ast/sig.h 644 root bin
f none usr/include/ast/stack.h 644 root bin
f none usr/include/ast/stak.h 644 root bin
f none usr/include/ast/stdio.h 644 root bin
f none usr/include/ast/stk.h 644 root bin
+f none usr/include/ast/sum.h 644 root bin
f none usr/include/ast/swap.h 644 root bin
f none usr/include/ast/tar.h 644 root bin
f none usr/include/ast/times.h 644 root bin
diff --git a/usr/src/pkgdefs/SUNWosdem/Makefile b/usr/src/pkgdefs/SUNWosdem/Makefile
index 7d58a25858..0443d2d1e7 100644
--- a/usr/src/pkgdefs/SUNWosdem/Makefile
+++ b/usr/src/pkgdefs/SUNWosdem/Makefile
@@ -2,9 +2,8 @@
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
@@ -20,15 +19,17 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
-# Copyright (c) 1994 by Sun Microsystems, Inc.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
#
include ../Makefile.com
DATAFILES += depend
+LICENSEFILES += \
+ ../../lib/libshell/THIRDPARTYLICENSE
+
.KEEP_STATE:
all: $(FILES)
diff --git a/usr/src/pkgdefs/SUNWosdem/prototype_com b/usr/src/pkgdefs/SUNWosdem/prototype_com
index e57fdaa163..10b4fd910d 100644
--- a/usr/src/pkgdefs/SUNWosdem/prototype_com
+++ b/usr/src/pkgdefs/SUNWosdem/prototype_com
@@ -19,11 +19,9 @@
# CDDL HEADER END
#
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# This required package information file contains a list of package contents.
# The 'pkgmk' command uses this file to identify the contents of a package
# and their location on the development machine when building the package.
@@ -54,20 +52,45 @@ f none usr/demo/ELF/pcom.c 644 root bin
f none usr/demo/ELF/dcom.c 644 root bin
f none usr/demo/ELF/tpcom.c 644 root bin
d none usr/demo/ksh 755 root bin
+d none usr/demo/ksh/bin 755 root bin
+f none usr/demo/ksh/bin/crawlsrccomments 755 root bin
+f none usr/demo/ksh/bin/filemutexdemo1 755 root bin
+f none usr/demo/ksh/bin/filetree1 755 root bin
+f none usr/demo/ksh/bin/gnaw 755 root bin
+f none usr/demo/ksh/bin/mandelbrotset1 755 root bin
+f none usr/demo/ksh/bin/multifollow 755 root bin
+f none usr/demo/ksh/bin/primenumbers1 755 root bin
+f none usr/demo/ksh/bin/rssread 755 root bin
+f none usr/demo/ksh/bin/shcalc 755 root bin
+f none usr/demo/ksh/bin/shircbot 755 root bin
+f none usr/demo/ksh/bin/shlint 755 root bin
+f none usr/demo/ksh/bin/shman 755 root bin
+f none usr/demo/ksh/bin/shnote 755 root bin
+f none usr/demo/ksh/bin/shpiano 755 root bin
+f none usr/demo/ksh/bin/shtinyurl 755 root bin
+f none usr/demo/ksh/bin/shtwitter 755 root bin
+f none usr/demo/ksh/bin/svcproptree1 755 root bin
+f none usr/demo/ksh/bin/termclock 755 root bin
+f none usr/demo/ksh/bin/test_net_sctp 755 root bin
+f none usr/demo/ksh/bin/xmldocumenttree1 755 root bin
+d none usr/demo/ksh/doc 755 root bin
+f none usr/demo/ksh/doc/COMPATIBILITY 644 root bin
+f none usr/demo/ksh/doc/DESIGN 644 root bin
+f none usr/demo/ksh/doc/OBSOLETE 644 root bin
+f none usr/demo/ksh/doc/README 644 root bin
+f none usr/demo/ksh/doc/RELEASE 644 root bin
+f none usr/demo/ksh/doc/TYPES 644 root bin
d none usr/demo/ksh/fun 755 root bin
-f none usr/demo/ksh/fun/dirs 644 root bin
-f none usr/demo/ksh/fun/mandelbrotset1 644 root bin
-f none usr/demo/ksh/fun/gnaw 644 root bin
-f none usr/demo/ksh/fun/rssread 644 root bin
-f none usr/demo/ksh/fun/popd 644 root bin
-f none usr/demo/ksh/fun/pushd 644 root bin
-f none usr/demo/ksh/fun/termclock 644 root bin
-f none usr/demo/ksh/fun/title 644 root bin
+f none usr/demo/ksh/fun/dirs 755 root bin
+f none usr/demo/ksh/fun/popd 755 root bin
+f none usr/demo/ksh/fun/pushd 755 root bin
+f none usr/demo/ksh/fun/title 755 root bin
d none usr/demo/ksh/tests 755 root bin
f none usr/demo/ksh/tests/alias.sh 644 root bin
f none usr/demo/ksh/tests/append.sh 644 root bin
f none usr/demo/ksh/tests/arith.sh 644 root bin
f none usr/demo/ksh/tests/arrays.sh 644 root bin
+f none usr/demo/ksh/tests/arrays2.sh 644 root bin
f none usr/demo/ksh/tests/attributes.sh 644 root bin
f none usr/demo/ksh/tests/basic.sh 644 root bin
f none usr/demo/ksh/tests/bracket.sh 644 root bin
@@ -75,6 +98,8 @@ f none usr/demo/ksh/tests/builtins.sh 644 root bin
f none usr/demo/ksh/tests/case.sh 644 root bin
f none usr/demo/ksh/tests/comvar.sh 644 root bin
f none usr/demo/ksh/tests/coprocess.sh 644 root bin
+f none usr/demo/ksh/tests/cubetype.sh 644 root bin
+f none usr/demo/ksh/tests/enum.sh 644 root bin
f none usr/demo/ksh/tests/exit.sh 644 root bin
f none usr/demo/ksh/tests/expand.sh 644 root bin
f none usr/demo/ksh/tests/functions.sh 644 root bin
@@ -82,18 +107,44 @@ f none usr/demo/ksh/tests/glob.sh 644 root bin
f none usr/demo/ksh/tests/grep.sh 644 root bin
f none usr/demo/ksh/tests/heredoc.sh 644 root bin
f none usr/demo/ksh/tests/io.sh 644 root bin
+f none usr/demo/ksh/tests/locale.sh 644 root bin
f none usr/demo/ksh/tests/nameref.sh 644 root bin
f none usr/demo/ksh/tests/options.sh 644 root bin
f none usr/demo/ksh/tests/path.sh 644 root bin
+f none usr/demo/ksh/tests/pointtype.sh 644 root bin
f none usr/demo/ksh/tests/quoting.sh 644 root bin
f none usr/demo/ksh/tests/quoting2.sh 644 root bin
+f none usr/demo/ksh/tests/recttype.sh 644 root bin
+f none usr/demo/ksh/tests/restricted.sh 644 root bin
f none usr/demo/ksh/tests/return.sh 644 root bin
f none usr/demo/ksh/tests/select.sh 644 root bin
-f none usr/demo/ksh/tests/shtests 644 root bin
+f none usr/demo/ksh/tests/shtests 755 root bin
+f none usr/demo/ksh/tests/sigchld.sh 644 root bin
+f none usr/demo/ksh/tests/signal.sh 644 root bin
+f none usr/demo/ksh/tests/statics.sh 644 root bin
f none usr/demo/ksh/tests/substring.sh 644 root bin
+f none usr/demo/ksh/tests/subshell.sh 644 root bin
+f none usr/demo/ksh/tests/sun_solaris_builtin_sum.sh 644 root bin
+f none usr/demo/ksh/tests/sun_solaris_compoundvario.sh 644 root bin
+f none usr/demo/ksh/tests/sun_solaris_cr_6687139_command_substitution_exec_redirection_allocation_loop.sh 644 root bin
+f none usr/demo/ksh/tests/sun_solaris_cr_6713682_compound_var_bleeds_through_subshell.sh 644 root bin
+f none usr/demo/ksh/tests/sun_solaris_cr_6722134_background_CHLD_trap.sh 644 root bin
+f none usr/demo/ksh/tests/sun_solaris_cr_6753538_subshell_leaks_umask.sh 644 root bin
+f none usr/demo/ksh/tests/sun_solaris_cr_6754020_weird_square_bracket_expansion.sh 644 root bin
+f none usr/demo/ksh/tests/sun_solaris_cr_6763594_command_failure_execs_twice.sh 644 root bin
+f none usr/demo/ksh/tests/sun_solaris_cr_6766246_pattern_matching_bug.sh 644 root bin
f none usr/demo/ksh/tests/sun_solaris_getconf.sh 644 root bin
+f none usr/demo/ksh/tests/sun_solaris_local_compound_nameref001.sh 644 root bin
+f none usr/demo/ksh/tests/sun_solaris_staticvariables.sh 644 root bin
+f none usr/demo/ksh/tests/sun_solaris_vartree001.sh 644 root bin
+f none usr/demo/ksh/tests/sun_solaris_vartree002.sh 644 root bin
+f none usr/demo/ksh/tests/sun_solaris_vartree003.sh 644 root bin
f none usr/demo/ksh/tests/tilde.sh 644 root bin
+f none usr/demo/ksh/tests/timetype.sh 644 root bin
+f none usr/demo/ksh/tests/types.sh 644 root bin
f none usr/demo/ksh/tests/variables.sh 644 root bin
+f none usr/demo/ksh/tests/vartree1.sh 644 root bin
+f none usr/demo/ksh/tests/vartree2.sh 644 root bin
d none usr/demo/libexacct 755 root bin
f none usr/demo/libexacct/README 644 root bin
f none usr/demo/libexacct/Makefile 644 root bin
diff --git a/usr/src/pkgdefs/etc/exception_list_i386 b/usr/src/pkgdefs/etc/exception_list_i386
index 9ef1fb9401..b21fe81d02 100644
--- a/usr/src/pkgdefs/etc/exception_list_i386
+++ b/usr/src/pkgdefs/etc/exception_list_i386
@@ -870,6 +870,12 @@ usr/lib/llib-lshell i386
usr/lib/llib-lshell.ln i386
usr/lib/amd64/libshell.so i386
usr/lib/amd64/llib-lshell.ln i386
+# libsum
+usr/lib/libsum.so i386
+usr/lib/llib-lsum i386
+usr/lib/llib-lsum.ln i386
+usr/lib/amd64/libsum.so i386
+usr/lib/amd64/llib-lsum.ln i386
#
# bmc (IPMI) interfaces shared within ON.
#
diff --git a/usr/src/pkgdefs/etc/exception_list_sparc b/usr/src/pkgdefs/etc/exception_list_sparc
index 94228e1460..d5add1bc5f 100644
--- a/usr/src/pkgdefs/etc/exception_list_sparc
+++ b/usr/src/pkgdefs/etc/exception_list_sparc
@@ -942,6 +942,12 @@ usr/lib/llib-lshell sparc
usr/lib/llib-lshell.ln sparc
usr/lib/sparcv9/libshell.so sparc
usr/lib/sparcv9/llib-lshell.ln sparc
+# libsum
+usr/lib/libsum.so sparc
+usr/lib/llib-lsum sparc
+usr/lib/llib-lsum.ln sparc
+usr/lib/sparcv9/libsum.so sparc
+usr/lib/sparcv9/llib-lsum.ln sparc
#
# bmc (IPMI) interfaces shared within ON.
#
diff --git a/usr/src/tools/findunref/exception_list.open b/usr/src/tools/findunref/exception_list.open
index ffd698050c..8d70459071 100644
--- a/usr/src/tools/findunref/exception_list.open
+++ b/usr/src/tools/findunref/exception_list.open
@@ -72,10 +72,22 @@
./src/lib/libshell/*/src/cmd/ksh93/FEATURE
./src/lib/libshell/common/data/math.tab
./src/lib/libshell/common/features
-./src/lib/libshell/misc/buildksh93.ksh
+./src/lib/libshell/misc/buildksh93.sh
./src/lib/libshell/misc/buildksh93.readme
#
+# Ignore ksh93/ast-related "iffe" (if feature enabled) probe
+#
+./src/lib/libsum/common/features/sum
+
+#
+# Ignore ksh93/ast-related upstream source, currently superseded by
+# a per-platform version of sum.h, since we use libmd.so.1 for some
+# ciphers.
+#
+./src/lib/libsum/common/sum.h
+
+#
# Ignore ksh93/ast-related test programs.
#
./src/cmd/ast/msgcc/msgcc.tst
@@ -89,7 +101,6 @@
./src/lib/libcmd/common/md5sum.c
./src/lib/libcmd/common/sum.c
./src/lib/libshell/common/bltins/mkservice.c
-./src/lib/libshell/common/bltins/shopen.c
./src/lib/libshell/common/data/bash_pre_rc.sh
./src/lib/libshell/common/include/env.h
./src/lib/libshell/common/sh/bash.c
diff --git a/usr/src/tools/opensolaris/license-list b/usr/src/tools/opensolaris/license-list
index f88d603b18..fc5cff0fe1 100644
--- a/usr/src/tools/opensolaris/license-list
+++ b/usr/src/tools/opensolaris/license-list
@@ -95,6 +95,7 @@ usr/src/lib/libresolv/THIRDPARTYLICENSE
usr/src/lib/libresolv2/THIRDPARTYLICENSE
usr/src/lib/libsasl/THIRDPARTYLICENSE
usr/src/lib/libshell/THIRDPARTYLICENSE
+usr/src/lib/libsum/THIRDPARTYLICENSE
usr/src/lib/libtecla/THIRDPARTYLICENSE
usr/src/lib/libwrap/THIRDPARTYLICENSE
usr/src/lib/mpapi/libmpapi/THIRDPARTYLICENSE
diff --git a/usr/src/uts/common/Makefile.files b/usr/src/uts/common/Makefile.files
index f0951c280b..eeb446cde6 100644
--- a/usr/src/uts/common/Makefile.files
+++ b/usr/src/uts/common/Makefile.files
@@ -965,6 +965,8 @@ ELFEXEC_OBJS += elf.o elf_notes.o old_notes.o
INTPEXEC_OBJS +=intp.o
+SHBINEXEC_OBJS +=shbin.o
+
JAVAEXEC_OBJS +=java.o
#
diff --git a/usr/src/uts/common/Makefile.rules b/usr/src/uts/common/Makefile.rules
index 35fe0895f1..1cd82570c1 100644
--- a/usr/src/uts/common/Makefile.rules
+++ b/usr/src/uts/common/Makefile.rules
@@ -180,6 +180,10 @@ $(OBJS_DIR)/%.o: $(UTSBASE)/common/exec/intp/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
+$(OBJS_DIR)/%.o: $(UTSBASE)/common/exec/shbin/%.c
+ $(COMPILE.c) -o $@ $<
+ $(CTFCONVERT_O)
+
$(OBJS_DIR)/%.o: $(UTSBASE)/common/exec/java/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
@@ -1388,6 +1392,9 @@ $(LINTS_DIR)/%.ln: $(UTSBASE)/common/exec/elf/%.c
$(LINTS_DIR)/%.ln: $(UTSBASE)/common/exec/intp/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
+$(LINTS_DIR)/%.ln: $(UTSBASE)/common/exec/shbin/%.c
+ @($(LHEAD) $(LINT.c) $< $(LTAIL))
+
$(LINTS_DIR)/%.ln: $(UTSBASE)/common/exec/java/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
diff --git a/usr/src/uts/common/conf/param.c b/usr/src/uts/common/conf/param.c
index cfe2458e5d..3d43511623 100644
--- a/usr/src/uts/common/conf/param.c
+++ b/usr/src/uts/common/conf/param.c
@@ -326,9 +326,14 @@ short nomagic = 0;
#define AOUT_ZMAGIC_STRING "\x1""\x0b" /* 0413 */
#define NOMAGIC_STRING ""
+#define SHBIN_CNTL(x) ((x)&037)
+#define SHBINMAGIC_STRING {SHBIN_CNTL('k'), SHBIN_CNTL('s'), SHBIN_CNTL('h'), 0}
+#define SHBINMAGIC_LEN 4
+
char elf32magicstr[] = ELF32MAGIC_STRING;
char elf64magicstr[] = ELF64MAGIC_STRING;
char intpmagicstr[] = INTPMAGIC_STRING;
+char shbinmagicstr[] = SHBINMAGIC_STRING;
char javamagicstr[] = JAVAMAGIC_STRING;
#if defined(__sparc)
char aout_nmagicstr[] = AOUT_NMAGIC_STRING;
@@ -343,6 +348,7 @@ char *execswnames[] = {
"elfexec", /* Elf64 */
#endif
"intpexec",
+ "shbinexec",
"javaexec",
#if defined(__sparc)
"aoutexec",
@@ -360,6 +366,7 @@ struct execsw execsw[] = {
{ elf64magicstr, 0, 5, NULL, NULL, NULL },
#endif
{ intpmagicstr, 0, 2, NULL, NULL, NULL },
+ { shbinmagicstr, 0, SHBINMAGIC_LEN, NULL, NULL, NULL },
{ javamagicstr, 0, 4, NULL, NULL, NULL },
#if defined(__sparc)
{ aout_zmagicstr, 2, 2, NULL, NULL, NULL },
diff --git a/usr/src/uts/common/exec/shbin/shbin.c b/usr/src/uts/common/exec/shbin/shbin.c
new file mode 100644
index 0000000000..7720f9ea34
--- /dev/null
+++ b/usr/src/uts/common/exec/shbin/shbin.c
@@ -0,0 +1,251 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/sysmacros.h>
+#include <sys/signal.h>
+#include <sys/cred.h>
+#include <sys/user.h>
+#include <sys/errno.h>
+#include <sys/vnode.h>
+#include <sys/proc.h>
+#include <sys/cmn_err.h>
+#include <sys/debug.h>
+#include <sys/pathname.h>
+#include <sys/disp.h>
+#include <sys/exec.h>
+#include <sys/kmem.h>
+#include <sys/note.h>
+
+/*
+ * This is the loadable module wrapper.
+ */
+#include <sys/modctl.h>
+
+/* Prototype */
+int
+shbinexec(
+ struct vnode *vp,
+ struct execa *uap,
+ struct uarg *args,
+ struct intpdata *idatap,
+ int level,
+ long *execsz,
+ int setid,
+ caddr_t exec_file,
+ struct cred *cred,
+ int brand_action);
+
+#define SHBIN_CNTL(x) ((x)&037)
+#define SHBINMAGIC_LEN 4
+extern char shbinmagicstr[];
+
+/*
+ * Our list where we may find a copy of ksh93. The ordering is:
+ * 1. 64bit (may not be installed or not supported in hardware)
+ * 2. 32bit
+ * 3. Use /sbin/ksh93 when /usr is not available
+ *
+ * ([1] and [2] explicitly bypass /usr/bin/ksh93 to avoid the
+ * isaexec overhead).
+ */
+static char *shell_list[] =
+{
+/* Bypass /usr/bin/ksh93 (which is "isaexec") for performance */
+#if defined(__sparc)
+ "/usr/bin/sparcv9/ksh93",
+ "/usr/bin/sparcv7/ksh93",
+#elif defined(__amd64)
+ "/usr/bin/amd64/ksh93",
+ "/usr/bin/i86/ksh93",
+#elif defined(__i386)
+ "/usr/bin/i86/ksh93",
+#else
+#error "Unrecognized platform/CPU (use /usr/bin/ksh93 when in doubt)."
+#endif
+ "/sbin/ksh93",
+ NULL
+};
+
+static struct execsw esw = {
+ shbinmagicstr,
+ 0,
+ SHBINMAGIC_LEN,
+ shbinexec,
+ NULL
+};
+
+/*
+ * Module linkage information for the kernel.
+ */
+extern struct mod_ops mod_execops;
+
+static struct modlexec modlexec = {
+ &mod_execops, "exec mod for shell binaries (ksh93)", &esw
+};
+
+static struct modlinkage modlinkage = {
+ MODREV_1, (void *)&modlexec, NULL
+};
+
+int
+_init(void)
+{
+ return (mod_install(&modlinkage));
+}
+
+int
+_fini(void)
+{
+ return (mod_remove(&modlinkage));
+}
+
+int
+_info(struct modinfo *modinfop)
+{
+ return (mod_info(&modlinkage, modinfop));
+}
+
+static int
+checkshbinmagic(struct vnode *vp)
+{
+ int error;
+ char linep[SHBINMAGIC_LEN];
+ ssize_t resid;
+
+ /*
+ * Read the entire line and confirm that it starts with the magic
+ * sequence for compiled ksh93 shell scripts.
+ */
+ if (error = vn_rdwr(UIO_READ, vp, linep, sizeof (linep), (offset_t)0,
+ UIO_SYSSPACE, 0, (rlim64_t)0, CRED(), &resid))
+ return (error);
+
+ if (memcmp(linep, shbinmagicstr, SHBINMAGIC_LEN) != 0)
+ return (ENOEXEC);
+
+ return (0);
+}
+
+int
+shbinexec(
+ struct vnode *vp,
+ struct execa *uap,
+ struct uarg *args,
+ struct intpdata *idatap,
+ int level,
+ long *execsz,
+ int setid,
+ caddr_t exec_file,
+ struct cred *cred,
+ int brand_action)
+{
+ _NOTE(ARGUNUSED(brand_action))
+ vnode_t *nvp;
+ int error = 0;
+ struct intpdata idata;
+ struct pathname intppn;
+ struct pathname resolvepn;
+ char *opath;
+ char devfd[19]; /* 32-bit int fits in 10 digits + 8 for "/dev/fd/" */
+ int fd = -1;
+ int i;
+
+ (void) memset(&idata, 0, sizeof (idata));
+
+ if (level) { /* Can't recurse */
+ error = ENOEXEC;
+ goto bad;
+ }
+
+ ASSERT(idatap == (struct intpdata *)NULL);
+
+ /*
+ * Check whether the executable has the correct magic value.
+ */
+ if (error = checkshbinmagic(vp))
+ goto fail;
+
+ pn_alloc(&resolvepn);
+
+ /*
+ * Travel the list of shells and look for one which is available...
+ */
+ for (i = 0; shell_list[i] != NULL; i++) {
+ error = pn_get(shell_list[i], UIO_SYSSPACE, &intppn);
+ if (error != 0) {
+ break;
+ }
+
+ error = lookuppn(&intppn, &resolvepn, FOLLOW, NULLVPP, &nvp);
+ if (!error) {
+ /* Found match */
+ break;
+ }
+
+ /* No match found ? Then continue with the next item... */
+ pn_free(&intppn);
+ }
+
+ if (error) {
+ pn_free(&resolvepn);
+ goto fail;
+ }
+
+ opath = args->pathname;
+ args->pathname = resolvepn.pn_path;
+ /* don't free resolvepn until we are done with args */
+ pn_free(&intppn);
+
+ /*
+ * When we're executing a set-uid script resulting in uids
+ * mismatching or when we execute with additional privileges,
+ * we close the "replace script between exec and open by shell"
+ * hole by passing the script as /dev/fd parameter.
+ */
+ if ((setid & EXECSETID_PRIVS) != 0 ||
+ (setid & (EXECSETID_UGIDS|EXECSETID_SETID)) ==
+ (EXECSETID_UGIDS|EXECSETID_SETID)) {
+ (void) strcpy(devfd, "/dev/fd/");
+ if (error = execopen(&vp, &fd))
+ goto done;
+ numtos(fd, &devfd[8]);
+ args->fname = devfd;
+ }
+
+ error = gexec(&nvp, uap, args, &idata, ++level, execsz, exec_file, cred,
+ EBA_NONE);
+done:
+ VN_RELE(nvp);
+ args->pathname = opath;
+ pn_free(&resolvepn);
+fail:
+ if (error && fd != -1)
+ (void) execclose(fd);
+bad:
+ return (error);
+}
diff --git a/usr/src/uts/intel/Makefile.intel.shared b/usr/src/uts/intel/Makefile.intel.shared
index 62e23247bf..97d240ac90 100644
--- a/usr/src/uts/intel/Makefile.intel.shared
+++ b/usr/src/uts/intel/Makefile.intel.shared
@@ -475,7 +475,7 @@ STRMOD_KMODS += ldlinux
#
# Exec Class Modules (/kernel/exec):
#
-EXEC_KMODS += elfexec intpexec javaexec
+EXEC_KMODS += elfexec intpexec shbinexec javaexec
#
# Scheduling Class Modules (/kernel/sched):
diff --git a/usr/src/uts/intel/shbinexec/Makefile b/usr/src/uts/intel/shbinexec/Makefile
new file mode 100644
index 0000000000..ab4f70ce62
--- /dev/null
+++ b/usr/src/uts/intel/shbinexec/Makefile
@@ -0,0 +1,82 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+# This makefile drives the production of the shbinexec (shell binary (ksh93))
+# exec kernel module.
+#
+# intel architecture dependent
+#
+
+#
+# Path to the base of the uts directory tree (usually /usr/src/uts).
+#
+UTSBASE = ../..
+
+#
+# Define the module and object file sets.
+#
+MODULE = shbinexec
+OBJECTS = $(SHBINEXEC_OBJS:%=$(OBJS_DIR)/%)
+LINTS = $(SHBINEXEC_OBJS:%.o=$(LINTS_DIR)/%.ln)
+ROOTMODULE = $(USR_EXEC_DIR)/$(MODULE)
+
+#
+# Include common rules.
+#
+include $(UTSBASE)/intel/Makefile.intel
+
+#
+# Define targets
+#
+ALL_TARGET = $(BINARY)
+LINT_TARGET = $(MODULE).lint
+INSTALL_TARGET = $(BINARY) $(ROOTMODULE)
+
+#
+# Default build targets.
+#
+.KEEP_STATE:
+
+def: $(DEF_DEPS)
+
+all: $(ALL_DEPS)
+
+clean: $(CLEAN_DEPS)
+
+clobber: $(CLOBBER_DEPS)
+
+lint: $(LINT_DEPS)
+
+modlintlib: $(MODLINTLIB_DEPS)
+
+clean.lint: $(CLEAN_LINT_DEPS)
+
+install: $(INSTALL_DEPS)
+
+#
+# Include common targets.
+#
+include $(UTSBASE)/intel/Makefile.targ
diff --git a/usr/src/uts/sparc/Makefile.sparc.shared b/usr/src/uts/sparc/Makefile.sparc.shared
index 061befa7e3..3723be6f32 100644
--- a/usr/src/uts/sparc/Makefile.sparc.shared
+++ b/usr/src/uts/sparc/Makefile.sparc.shared
@@ -336,7 +336,7 @@ MISC_KMODS += md_sp
#
# Exec Class Modules (/kernel/exec):
#
-EXEC_KMODS += aoutexec elfexec intpexec javaexec
+EXEC_KMODS += aoutexec elfexec intpexec shbinexec javaexec
#
# Scheduling Class Modules (/kernel/sched):
diff --git a/usr/src/uts/sparc/shbinexec/Makefile b/usr/src/uts/sparc/shbinexec/Makefile
new file mode 100644
index 0000000000..a8a7bad5b2
--- /dev/null
+++ b/usr/src/uts/sparc/shbinexec/Makefile
@@ -0,0 +1,82 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+# This makefile drives the production of the shbinexec (shell binary (ksh93))
+# exec kernel module.
+#
+# sparc architecture dependent
+#
+
+#
+# Path to the base of the uts directory tree (usually /usr/src/uts).
+#
+UTSBASE = ../..
+
+#
+# Define the module and object file sets.
+#
+MODULE = shbinexec
+OBJECTS = $(SHBINEXEC_OBJS:%=$(OBJS_DIR)/%)
+LINTS = $(SHBINEXEC_OBJS:%.o=$(LINTS_DIR)/%.ln)
+ROOTMODULE = $(USR_EXEC_DIR)/$(MODULE)
+
+#
+# Include common rules.
+#
+include $(UTSBASE)/sparc/Makefile.sparc
+
+#
+# Define targets
+#
+ALL_TARGET = $(BINARY)
+LINT_TARGET = $(MODULE).lint
+INSTALL_TARGET = $(BINARY) $(ROOTMODULE)
+
+#
+# Default build targets.
+#
+.KEEP_STATE:
+
+def: $(DEF_DEPS)
+
+all: $(ALL_DEPS)
+
+clean: $(CLEAN_DEPS)
+
+clobber: $(CLOBBER_DEPS)
+
+lint: $(LINT_DEPS)
+
+modlintlib: $(MODLINTLIB_DEPS)
+
+clean.lint: $(CLEAN_LINT_DEPS)
+
+install: $(INSTALL_DEPS)
+
+#
+# Include common targets.
+#
+include $(UTSBASE)/sparc/Makefile.targ